/* ============================================================================
   OnLearn — application styles
   Loaded after tokens.css. Server-rendered (HTMX/Alpine), no build step.
   Sections: base · type · layout shell · sidebar · topbar · buttons · cards ·
   badges · spine (signature) · progress · forms · menu · toast · skeleton ·
   auth · landing · motion · responsive.
   ========================================================================== */

/* ----------------------------------------------------------- base + reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1,h2,h3,h4,h5 { font-family: var(--font-display); font-weight: 600; line-height: var(--lh-tight); margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
img, svg { display: block; max-width: 100%; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[x-cloak] { display: none !important; }
::selection { background: rgba(124,58,237,.4); color: #fff; }

/* Ambient backdrop: a faint dual-color aurora, fixed behind everything. */
.aura {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(60vw 50vh at 12% -8%, rgba(124,58,237,.16), transparent 60%),
    radial-gradient(55vw 45vh at 100% 0%, rgba(6,182,212,.12), transparent 55%);
}

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: #3a4757; }

/* --------------------------------------------------------------- typography */
.eyebrow {
  font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 600;
  letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--text-muted);
}
.grad-text { color: var(--violet-300); }  /* visible fallback */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .grad-text {
    background: var(--grad-text); -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
  }
}
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.mono  { font-family: var(--font-mono); }
.h1 { font-size: var(--fs-3xl); }
.h2 { font-size: var(--fs-2xl); }
.lead { font-size: var(--fs-lg); color: var(--text-muted); line-height: 1.5; }

/* ------------------------------------------------------------------ layout */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--sp-6); }
.container--wide { max-width: var(--container-wide); }
.stack > * + * { margin-top: var(--sp-4); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.spread { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); }
.grid { display: grid; gap: var(--sp-5); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-5); }

/* --------------------------------------------------------------- app shell */
.app {
  --rail: var(--sidebar-w);
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  min-height: 100vh;
  min-height: 100dvh;
  transition: grid-template-columns var(--dur-3) var(--ease);
}
.app.is-collapsed { --rail: var(--sidebar-w-min); }
/* focus mode: sidebar is display:none, so collapse to a single full-width column
   (otherwise app__main would land in a 0-width track). */
.app.is-focus { grid-template-columns: 1fr; }

.app__main { min-width: 0; display: flex; flex-direction: column; }
.content { flex: 1; padding: var(--sp-8) var(--sp-8) var(--sp-16); }
.content--narrow { max-width: 1080px; width: 100%; margin-inline: auto; }
.content--flush { padding: 0; }  /* full-bleed workspaces (Practice / Conversational) */

/* ----------------------------------------------------------------- sidebar */
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-deep) 100%);
  border-right: 1px solid var(--border);
  overflow: hidden; z-index: 30;
}
.app.is-focus .sidebar { display: none; }
.sidebar__brand {
  display: flex; align-items: center; gap: var(--sp-3);
  height: var(--topbar-h); padding-inline: var(--sp-5);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: var(--grad); display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; color: #fff; font-size: 1.05rem;
  box-shadow: var(--glow-violet);
}
.brand-word { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -.02em; white-space: nowrap; }
.app.is-collapsed .brand-word { opacity: 0; pointer-events: none; width: 0; overflow: hidden; }

.sidebar__nav { flex: 1; overflow-y: auto; padding: var(--sp-4) var(--sp-3); display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-faint); padding: var(--sp-4) var(--sp-3) var(--sp-2);
}
.app.is-collapsed .nav-label { opacity: 0; height: var(--sp-4); padding: 0; overflow: hidden; white-space: nowrap; }

.nav-item {
  position: relative; display: flex; align-items: center; gap: var(--sp-3);
  padding: 10px var(--sp-3); border-radius: var(--r-sm);
  color: var(--text-muted); font-weight: 500; font-size: var(--fs-base);
  white-space: nowrap; transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}
.nav-item i, .nav-item svg { width: 19px; height: 19px; flex-shrink: 0; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.is-active { color: var(--text); background: var(--grad-soft); }
.nav-item.is-active::before {
  content: ""; position: absolute; left: -3px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 22px; border-radius: 0 4px 4px 0; background: var(--grad);
  box-shadow: var(--glow-violet);
}
.nav-item__label { transition: opacity var(--dur-2) var(--ease); }
.app.is-collapsed .nav-item__label { opacity: 0; width: 0; overflow: hidden; }
/* collapsed rail: icons sit dead-center (item 5 — the off-center look came from
   keeping the expanded padding + label gap around a zero-width label) */
.app.is-collapsed .nav-item { justify-content: center; padding-inline: 0; gap: 0; }
.app.is-collapsed .sidebar__brand { justify-content: center; padding-inline: 0; }
.nav-item__badge {
  margin-left: auto; font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  background: var(--surface-3); color: var(--text-muted); padding: 1px 7px; border-radius: var(--r-pill);
}
.app.is-collapsed .nav-item__badge { display: none; }

.sidebar__foot { flex-shrink: 0; border-top: 1px solid var(--border); padding: var(--sp-3); }
.sidebar__collapse { width: 100%; margin-bottom: var(--sp-2); }
.app.is-collapsed .user-chip { justify-content: center; padding-inline: 0; }
.sidebar__collapse-open { display: none; }
.app.is-collapsed .sidebar__collapse-close { display: none; }
.app.is-collapsed .sidebar__collapse-open { display: block; }
.user-chip {
  display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md); width: 100%; transition: background var(--dur-2) var(--ease);
}
.user-chip:hover { background: var(--surface-2); }
.user-chip__meta { min-width: 0; text-align: left; }
.app.is-collapsed .user-chip__meta { display: none; }
.user-chip__name { font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip__sub { font-size: var(--fs-xs); color: var(--text-faint); white-space: nowrap; }

/* ------------------------------------------------------------------ topbar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--topbar-h); display: flex; align-items: center; gap: var(--sp-4);
  padding-inline: var(--sp-6);
  background: rgba(13,17,23,.8);  /* fallback for engines without color-mix */
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.app.is-focus .topbar { display: none; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: var(--r-sm);
  color: var(--text-muted); transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn i, .icon-btn svg { width: 19px; height: 19px; }

.crumbs { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--text-faint); min-width: 0; }
.crumbs a { color: var(--text-muted); }
.crumbs a:hover { color: var(--text); }
.crumbs__sep { color: var(--border-strong); }
.crumbs__here { color: var(--text); font-weight: 600; }

.topbar__spacer { flex: 1; }
.searchbox {
  display: flex; align-items: center; gap: var(--sp-2);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-pill);
  padding: 7px var(--sp-4); color: var(--text-faint); font-size: var(--fs-sm); min-width: 200px;
  transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.searchbox:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.searchbox input { flex: 1; border: none; background: none; color: var(--text); outline: none; font-size: var(--fs-sm); padding: 0; box-shadow: none; }
.searchbox kbd {
  font-family: var(--font-mono); font-size: 10px; color: var(--text-faint);
  border: 1px solid var(--border-strong); border-radius: 5px; padding: 1px 5px;
}

/* streak flame chip */
.streak {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-weight: 600;
  font-size: var(--fs-sm); padding: 6px 12px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
}
.streak i, .streak svg { width: 15px; height: 15px; color: var(--ember); }

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  font-family: var(--font-body); font-weight: 600; font-size: var(--fs-base);
  padding: 10px var(--sp-5); border-radius: var(--r-sm); white-space: nowrap;
  transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease),
              background var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease);
  border: 1px solid transparent;
}
.btn i, .btn svg { width: 17px; height: 17px; }
.btn:active { transform: translateY(1px) scale(.99); }
/* text-shadow lifts white labels to AA across the whole gradient (the cyan end
   alone is ~2.4:1 against white) */
.btn--primary { background: var(--grad); color: #fff; box-shadow: var(--glow-violet); text-shadow: 0 1px 2px rgba(0,0,0,.45); }
.btn--primary:hover { box-shadow: 0 14px 50px -10px rgba(124,58,237,.7); transform: translateY(-1px); }
.btn--ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn--outline { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn--outline:hover { background: var(--surface); }
.btn--subtle { background: transparent; color: var(--text-muted); padding-inline: var(--sp-3); }
.btn--subtle:hover { color: var(--text); background: var(--surface-2); }
.btn--block { width: 100%; }
.btn--lg { padding: 14px var(--sp-8); font-size: var(--fs-md); border-radius: var(--r-md); }
.btn--sm { padding: 6px var(--sp-3); font-size: var(--fs-sm); }
.btn:disabled { opacity: .62; pointer-events: none; }

/* ------------------------------------------------------------------- cards */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--sp-6);
  transition: transform var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.card--pad-sm { padding: var(--sp-4); }
.card--raise:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow-2); }
.card--glow { position: relative; overflow: hidden; }
.card--glow::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  opacity: 0; transition: opacity var(--dur-3) var(--ease);
  background: radial-gradient(40% 60% at 100% 0%, rgba(124,58,237,.16), transparent 70%);
}
.card--glow:hover::after { opacity: 1; }
.card-link { display: block; color: inherit; }

/* course card */
.course-card { display: flex; flex-direction: column; gap: var(--sp-4); min-height: 220px; }
.course-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); }
.course-glyph {
  width: 46px; height: 46px; border-radius: var(--r-md); display: grid; place-items: center; flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--violet-300);
}
.course-glyph i, .course-glyph svg { width: 22px; height: 22px; }
.course-card__title { font-size: var(--fs-lg); }
.course-card__desc { color: var(--text-muted); font-size: var(--fs-sm); flex: 1; }
.course-card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: var(--sp-4); border-top: 1px solid var(--border); }

/* ------------------------------------------------------------------ badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono);
  font-size: var(--fs-xs); font-weight: 600; padding: 3px 9px; border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border);
}
.badge--dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge--easy   { color: var(--easy);   border-color: color-mix(in srgb, var(--easy) 40%, transparent); }
.badge--medium { color: var(--medium); border-color: color-mix(in srgb, var(--medium) 40%, transparent); }
.badge--hard   { color: var(--hard);   border-color: color-mix(in srgb, var(--hard) 40%, transparent); }
.badge--done   { color: var(--success); border-color: color-mix(in srgb, var(--success) 40%, transparent); }
.badge--accent { background: var(--grad-soft); color: var(--accent-text); border-color: transparent; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--border); font-size: var(--fs-sm); }
a.pill { color: var(--text-muted); transition: color var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease); }
a.pill:hover { color: var(--text); border-color: var(--border-strong); }
.pill--on { background: var(--grad-soft); border-color: var(--accent); color: var(--text); }

/* --------------------------------------------------- spine (the signature) */
/* A gradient learning-path rail. Completed portion fills violet->cyan; the
   current node pulses; future nodes stay faint. Used vertically in module/
   topic lists and the timeline, and horizontally in the landing hero. */
.spine { position: relative; }
.spine__node {
  position: relative; display: grid; grid-template-columns: 44px 1fr; gap: var(--sp-4);
  padding-bottom: var(--sp-5);
}
.spine__node:last-child { padding-bottom: 0; }
.spine__rail { position: relative; display: flex; flex-direction: column; align-items: center; }
.spine__rail::after {
  content: ""; position: absolute; top: 30px; bottom: -6px; width: 2px; left: 50%; transform: translateX(-50%);
  background: var(--border-strong);
}
.spine__node:last-child .spine__rail::after { display: none; }
.spine__node.is-done .spine__rail::after { background: var(--grad); }
.spine__dot {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  background: var(--surface-2); border: 2px solid var(--border-strong); color: var(--text-muted);
  font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 700; z-index: 1;
  transition: all var(--dur-3) var(--ease);
}
.spine__dot i, .spine__dot svg { width: 15px; height: 15px; }
.spine__node.is-done .spine__dot { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--glow-violet); }
.spine__node.is-current .spine__dot { border-color: var(--accent); color: var(--violet-300); animation: pulse-ring 2.4s var(--ease) infinite; }
.spine__body { padding-top: 2px; min-width: 0; }

/* ---------------------------------------------------------------- progress */
.bar { height: 7px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.bar__fill { height: 100%; border-radius: inherit; background: var(--grad); width: 0; transition: width var(--dur-4) var(--ease-out); }

/* ---------------------------------------------------------------- table */
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th, .table td { padding: 10px var(--sp-3); text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { color: var(--text-faint); font-weight: 600; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }

/* Moderation: a hidden thread/reply is dimmed in the faculty queue. */
.is-hidden-row { opacity: .55; }

.ring { --p: 0; --sz: 96px; width: var(--sz); height: var(--sz); display: grid; place-items: center; position: relative; }
.ring::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from -90deg, var(--violet), var(--cyan) calc(var(--p) * 1%), var(--surface-3) calc(var(--p) * 1%));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(50% - 7px), #000 calc(50% - 6px));
          mask: radial-gradient(farthest-side, transparent calc(50% - 7px), #000 calc(50% - 6px));
}
/* labels sit above the disc so they stay visible even if mask is unsupported */
.ring__num { position: relative; z-index: 1; font-family: var(--font-display); font-weight: 700; font-size: var(--fs-lg); }
.ring__lbl { position: relative; z-index: 1; font-size: 10px; color: var(--text-muted); font-family: var(--font-mono); letter-spacing: .1em; }

/* metric stat */
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat__num { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-2xl); line-height: 1; }
.stat__lbl { font-size: var(--fs-xs); color: var(--text-muted); font-family: var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }

/* -------------------------------------------------------------------- forms
   One input component (demo feedback item 18): every text-like control shares
   the same box, and every control answers hover / focus / error / disabled. */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); }
.input,
input:where([type=text],[type=email],[type=password],[type=tel],[type=url],[type=number],[type=search],[type=date],[type=time],[type=datetime-local]),
textarea, select {
  width: 100%; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 11px var(--sp-4); transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
.input:hover:not(:focus):not(:disabled),
input:where([type=text],[type=email],[type=password],[type=tel],[type=url],[type=number],[type=search],[type=date],[type=time],[type=datetime-local]):hover:not(:focus):not(:disabled),
textarea:hover:not(:focus):not(:disabled), select:hover:not(:focus):not(:disabled) { border-color: var(--border-strong); }
.input:focus,
input:where([type=text],[type=email],[type=password],[type=tel],[type=url],[type=number],[type=search],[type=date],[type=time],[type=datetime-local]):focus,
textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
textarea { resize: vertical; min-height: 2.75em; }

/* selects: replace the native OS arrow with a token-colored chevron */
select:not([multiple]):not([size]) {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239AA7B8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 38px;
}

/* file inputs: the picker button reads as one of our small ghost buttons */
input[type=file] { padding: 8px var(--sp-3); cursor: pointer; }
input[type=file]::file-selector-button {
  font: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: var(--r-xs);
  padding: 6px var(--sp-3); margin-right: var(--sp-3); cursor: pointer;
  transition: background var(--dur-2) var(--ease);
}
input[type=file]::file-selector-button:hover { background: var(--surface-3); }

/* error + disabled states (Django forms set aria-invalid on invalid fields) */
.input--error, .input[aria-invalid=true],
input[aria-invalid=true], textarea[aria-invalid=true], select[aria-invalid=true] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 25%, transparent);
}
.input:disabled, input:disabled, textarea:disabled, select:disabled {
  opacity: .55; cursor: not-allowed; background: var(--surface-2);
}

/* toggles must escape the full-width text-input styling above */
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); cursor: pointer; }
.check { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--text-muted); cursor: pointer; }
.form-error { color: var(--danger); font-size: var(--fs-sm); margin-top: 4px; }
.form-error ul { list-style: none; }

/* ------------------------------------------------------------- menu / popover */
.menu { position: relative; }
.menu__panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; z-index: 50;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-md);
  box-shadow: var(--shadow-3); padding: 6px; overflow: hidden;
}
.menu__item {
  display: flex; align-items: center; gap: var(--sp-3); width: 100%; text-align: left;
  padding: 9px var(--sp-3); border-radius: var(--r-xs); color: var(--text-muted); font-size: var(--fs-sm); font-weight: 500;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.menu__item:hover { background: var(--surface-2); color: var(--text); }
.menu__item i, .menu__item svg { width: 16px; height: 16px; }
.menu__item--danger:hover { color: var(--danger); }
.menu__sep { height: 1px; background: var(--border); margin: 5px 0; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--violet); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: var(--fs-base);
  border: 1px solid rgba(255,255,255,.12);
}
.avatar--sm { width: 30px; height: 30px; font-size: var(--fs-sm); }

/* --------------------------------------------------------------- blog cards
   Editorial layout (item 10): a featured hero + a grid of even, clamped cards. */
.blog-hero {
  display: grid; grid-template-columns: 220px 1fr; gap: var(--sp-6);
  text-decoration: none; color: inherit; margin-bottom: var(--sp-6);
}
.blog-hero__art {
  border-radius: var(--r-md); min-height: 168px;
  background: var(--grad-soft); border: 1px solid var(--border-strong);
  display: grid; place-items: center; overflow: hidden; position: relative;
}
.blog-hero__art::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 20% 0%, rgba(124,58,237,.25), transparent 55%),
              radial-gradient(120% 90% at 90% 100%, rgba(6,182,212,.2), transparent 55%);
}
.blog-hero__glyph {
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-5xl);
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.blog-hero__body { display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.blog-hero__title { font-size: var(--fs-2xl); letter-spacing: -.02em; line-height: var(--lh-snug); margin: 0; }
.blog-card { display: flex; flex-direction: column; gap: var(--sp-3); text-decoration: none; color: inherit; }
.blog-card__title {
  font-size: var(--fs-lg); line-height: var(--lh-snug); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.blog-card__excerpt {
  font-size: var(--fs-sm); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.blog-card__meta { display: flex; align-items: center; gap: var(--sp-2); margin-top: auto; font-size: var(--fs-xs); flex-wrap: wrap; }
.blog-card__author { font-weight: 600; font-size: var(--fs-sm); }
@media (max-width: 720px) {
  .blog-hero { grid-template-columns: 1fr; }
  .blog-hero__art { min-height: 110px; }
}

/* ------------------------------------------------------ live-session card
   Fixed hierarchy (item 7): date anchor · badges · title · meta · host + CTA. */
.session-card { display: flex; gap: var(--sp-5); align-items: flex-start; }
.session-card__date {
  flex: none; width: 64px; padding: var(--sp-3) 0;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md);
}
.session-card__dow { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); }
.session-card__day { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 700; line-height: 1.05; }
.session-card__mon { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-muted); }
.session-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.session-card__title { font-size: var(--fs-lg); margin: 0; line-height: var(--lh-snug); }
.session-card__meta { display: flex; align-items: center; gap: 6px; margin: 0; font-size: var(--fs-xs); }
.session-card__meta i, .session-card__meta svg { width: 13px; height: 13px; flex-shrink: 0; }
.session-card__foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  margin-top: var(--sp-1); padding-top: var(--sp-3); border-top: 1px solid var(--border);
}
.session-card__host { font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-card--past .session-card__date { background: var(--surface); }
.session-card--past .session-card__day { color: var(--text-muted); }

/* ------------------------------------------------------------------- toast */
.toasts { position: fixed; right: var(--sp-6); bottom: var(--sp-6); z-index: 100; display: flex; flex-direction: column; gap: var(--sp-2); }
.toast {
  background: var(--surface); border: 1px solid var(--border-strong); border-left: 3px solid var(--accent);
  border-radius: var(--r-sm); padding: var(--sp-3) var(--sp-4); box-shadow: var(--shadow-2);
  font-size: var(--fs-sm); animation: toast-in var(--dur-3) var(--ease-out);
}
.toast--error { border-left-color: var(--danger); }
.toast--success { border-left-color: var(--success); }

/* --------------------------------------------------------------- skeleton */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; border-radius: var(--r-sm); animation: shimmer 1.4s ease infinite; }
.htmx-indicator { opacity: 0; transition: opacity var(--dur-2) var(--ease); }
.htmx-request .htmx-indicator { opacity: 1; }
.htmx-request.htmx-indicator { opacity: 1; }

/* terminal (AI planner / onboarding stream) + spinner */
.terminal {
  font-family: var(--font-mono); font-size: var(--fs-sm); line-height: 1.65;
  background: var(--bg-deep); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5); color: var(--text-muted); white-space: pre-wrap;
  overflow-y: auto; word-break: break-word;
}
.spinner { display: inline-block; width: 15px; height: 15px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* empty state */
.empty { text-align: center; padding: var(--sp-16) var(--sp-6); color: var(--text-muted); }
.empty__glyph { width: 64px; height: 64px; margin: 0 auto var(--sp-5); border-radius: var(--r-lg); display: grid; place-items: center; background: var(--grad-soft); border: 1px solid var(--border-strong); color: var(--violet-300); }
.empty__glyph i, .empty__glyph svg { width: 28px; height: 28px; }

/* ----------------------------------------------- page header / segmented / banner */
.page-head { margin-bottom: var(--sp-8); }
.page-head h1 { font-size: var(--fs-3xl); letter-spacing: -.02em; }
.page-head .lead { margin-top: var(--sp-2); }

.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 3px; gap: 2px; }
.segmented button, .segmented label { padding: 6px 16px; border-radius: var(--r-pill); font-family: var(--font-mono); font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease); }
.segmented button.is-on, .segmented label.is-on { background: var(--grad); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.segmented button:not(.is-on):hover, .segmented label:not(.is-on):hover { color: var(--text); }
.segmented label { position: relative; }
.segmented label:focus-within { outline: 2px solid var(--accent); outline-offset: 1px; }

/* resume / spotlight banner — the one place a course card gets the gradient edge */
.banner { position: relative; overflow: hidden; display: flex; align-items: center; gap: var(--sp-6); padding: var(--sp-6); border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border-strong); }
.banner::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--grad); }
.banner__glow { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(50% 120% at 100% 0%, rgba(124,58,237,.14), transparent 60%); }
.banner__body { flex: 1; min-width: 0; position: relative; }
.banner__icon { width: 52px; height: 52px; flex-shrink: 0; border-radius: var(--r-md); display: grid; place-items: center; background: var(--grad); color: #fff; box-shadow: var(--glow-violet); position: relative; }
.banner__icon i, .banner__icon svg { width: 24px; height: 24px; }

/* metric tiles row */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--sp-4); }
.tile { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-5); }
.tile__icon { width: 42px; height: 42px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--surface-2); color: var(--violet-300); flex-shrink: 0; }
.tile__icon i, .tile__icon svg { width: 20px; height: 20px; }
.tile__num { font-family: var(--font-mono); font-weight: 700; font-size: var(--fs-2xl); line-height: 1; }
.tile__lbl { font-size: var(--fs-xs); color: var(--text-muted); font-family: var(--font-mono); letter-spacing: .06em; text-transform: uppercase; margin-top: 3px; }

/* grids */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: var(--sp-5); }
.col-2 { display: grid; grid-template-columns: 2fr 1fr; gap: var(--sp-6); align-items: start; }
@media (max-width: 900px) { .col-2 { grid-template-columns: 1fr; } }

/* ----------------------------------------------------------- activity heatmap */
.heatmap { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; }
.heatmap__cell { aspect-ratio: 1; border-radius: 3px; background: var(--surface-3); transition: transform var(--dur-1) var(--ease); }
.heatmap__cell:hover { transform: scale(1.25); }
.heatmap__cell[data-level="1"] { background: rgba(124,58,237,.35); }
.heatmap__cell[data-level="2"] { background: rgba(124,58,237,.6); }
.heatmap__cell[data-level="3"] { background: rgba(56,135,232,.78); }
.heatmap__cell[data-level="4"] { background: var(--cyan); }
.heatmap-legend { display: flex; align-items: center; gap: 5px; justify-content: flex-end; margin-top: var(--sp-3); font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-muted); }
.heatmap-legend .heatmap__cell { width: 12px; height: 12px; aspect-ratio: auto; }

/* module spine row (course hub) — accordion built on the signature spine */
.module { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); overflow: hidden; transition: border-color var(--dur-2) var(--ease); }
.module + .module { margin-top: var(--sp-3); }
.module:hover { border-color: var(--border-strong); }
.module__head { display: flex; align-items: center; gap: var(--sp-4); width: 100%; padding: var(--sp-3) var(--sp-4) var(--sp-3) var(--sp-3); text-align: left; }
.module__enter { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--sp-4); padding: 7px var(--sp-3); border-radius: var(--r-sm); transition: background var(--dur-2) var(--ease); }
.module__enter:hover { background: var(--surface-2); }
.module__no { width: 34px; height: 34px; flex-shrink: 0; border-radius: var(--r-sm); display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; font-size: var(--fs-sm); background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-muted); }
.module.is-done .module__no { background: var(--grad); color: #fff; border-color: transparent; }
.module__title { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.module__toggle { flex-shrink: 0; width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--r-sm); color: var(--text-faint); transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease); }
.module__toggle:hover { background: var(--surface-2); color: var(--text); }
.module__chev { transition: transform var(--dur-2) var(--ease); }
.module__chev.is-open { transform: rotate(90deg); }
.module__meta { display: flex; align-items: center; gap: var(--sp-3); font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-muted); flex-shrink: 0; }
.module__body { border-top: 1px solid var(--border); padding: var(--sp-2); }

/* topic overview (course hub — brief, no question rows) */
.topic-ov { display: flex; flex-direction: column; gap: 2px; }
.topic-ov__row { display: flex; align-items: center; gap: var(--sp-3); padding: 9px var(--sp-3); border-radius: var(--r-sm); color: var(--text); transition: background var(--dur-1) var(--ease); }
a.topic-ov__row:hover { background: var(--surface-2); }
.topic-ov__row.is-empty { pointer-events: none; }
.topic-ov__dot { width: 24px; height: 24px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-faint); }
.topic-ov__dot i, .topic-ov__dot svg { width: 13px; height: 13px; }
.topic-ov__row.is-done .topic-ov__dot { background: var(--grad); color: #fff; border-color: transparent; }
.topic-ov__title { flex: 1; min-width: 0; font-size: var(--fs-sm); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topic-ov__meta { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-xs); color: var(--text-muted); flex-shrink: 0; }
.topic-ov__go { width: 15px; height: 15px; color: var(--text-faint); opacity: 0; transition: opacity var(--dur-1) var(--ease); flex-shrink: 0; }
a.topic-ov__row:hover .topic-ov__go { opacity: 1; }

/* topic group + question rows */
.topic-group { padding: var(--sp-3) var(--sp-5); }
.topic-group__label { font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); padding: var(--sp-2) 0; }
.q-row { display: flex; align-items: center; gap: var(--sp-3); padding: 10px var(--sp-3); border-radius: var(--r-sm); color: var(--text); transition: background var(--dur-1) var(--ease); }
.q-row:hover { background: var(--surface-2); }
.q-row__status { flex-shrink: 0; width: 18px; height: 18px; }
.q-row__status--done { color: var(--success); }
.q-row__status--prog { color: var(--warning); }
.q-row__status--todo { color: var(--text-faint); }
.q-row__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* timeline mini (course hub right rail) */
.tl-week { display: grid; grid-template-columns: 40px 1fr; gap: var(--sp-3); padding-bottom: var(--sp-4); }
.tl-week:last-child { padding-bottom: 0; }
.tl-week__no { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 700; background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-muted); }
.tl-week.is-done .tl-week__no { background: var(--grad); color: #fff; border-color: transparent; }

/* ===========================================================================
   MODULE WORKSPACE — one chrome row + a collapsible tutor dock (item 12).
   Lesson-only: no rail, no section switcher — the whole width belongs to
   the lesson (video column scrolls; the dock keeps the right edge).
   ========================================================================== */
.wsx {
  display: flex; flex-direction: column;
  height: 100vh; height: 100dvh; overflow: hidden;
}

/* (2) the module's questions live in the PROBLEMS OVERLAY now; these rows are
   reused there (grouped by topic, current highlighted, keyboard-focusable). */
.wsx-topic + .wsx-topic { margin-top: var(--sp-3); }
.wsx-topic__label { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); padding: var(--sp-2) var(--sp-2) 4px; }
.wsx-q { position: relative; display: flex; align-items: center; gap: var(--sp-3); padding: 9px var(--sp-3); border-radius: var(--r-sm); color: var(--text-muted); font-size: var(--fs-sm); transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease); }
.wsx-q:hover, .wsx-q.is-focus { background: var(--surface-2); color: var(--text); }
.wsx-q.is-active { background: var(--grad-soft); color: var(--text); font-weight: 600; }
.wsx-q.is-active::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 18px; border-radius: 0 3px 3px 0; background: var(--grad); }
.wsx-q__status { width: 16px; height: 16px; flex-shrink: 0; display: grid; place-items: center; color: var(--text-faint); }
.wsx-q__status--completed { color: var(--success); }
.wsx-q__status--in_progress { color: var(--warning); }
.wsx-q__status i, .wsx-q__status svg { width: 14px; height: 14px; }
.wsx-q__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* main column */
.wsx-main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
/* ONE chrome row: back · lesson identity · (spread) · ring · account */
.wsx-top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); height: var(--topbar-h); padding: 0 var(--sp-4); border-bottom: 1px solid var(--border); background: var(--surface); flex-shrink: 0; transition: background var(--dur-3) var(--ease), border-color var(--dur-3) var(--ease); }
.wsx-top__left { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.wsx-top__right { display: flex; align-items: center; gap: var(--sp-3); flex-shrink: 0; }
.wsx-back { display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0; color: var(--text-muted); font-size: var(--fs-sm); font-weight: 600; padding: 7px 10px; border-radius: var(--r-sm); transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease); }
.wsx-back:hover { background: var(--surface-2); color: var(--text); }
.wsx-back i, .wsx-back svg { width: 16px; height: 16px; }
.wsx-lesson { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; padding: 5px 10px; border-radius: var(--r-sm); text-align: left; transition: background var(--dur-2) var(--ease); }
.wsx-lesson:hover { background: var(--surface-2); }
.wsx-lesson__mod { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42ch; }
.wsx-lesson__ttl { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-base); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42ch; }
.wsx-ringlink { display: grid; place-items: center; padding: 4px; border-radius: 50%; }
.wsx-ringlink:hover { background: var(--surface-2); }
.wsx-prog__ring { --p: 0; width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; background: conic-gradient(from -90deg, var(--violet), var(--cyan) calc(var(--p) * 1%), var(--surface-3) calc(var(--p) * 1%)); -webkit-mask: radial-gradient(farthest-side, transparent calc(50% - 4px), #000 calc(50% - 3px)); mask: radial-gradient(farthest-side, transparent calc(50% - 4px), #000 calc(50% - 3px)); }
.wsx-body { flex: 1; min-height: 0; overflow: hidden; display: flex; }
.wsx-panel { flex: 1; min-width: 0; min-height: 0; overflow-y: auto; padding: var(--sp-6) var(--sp-8); }
.wsx-panel--fill { overflow: hidden; padding: 0; display: flex; flex-direction: column; }
.wsx-panel--fill > .lab, .wsx-panel--fill > .convo { flex: 1; min-height: 0; }

/* Lesson ▸ Video (wireframe): a full-height split — the video column scrolls,
   the tutor dock is pinned to the right edge. Closing the dock (or cinema)
   animates its column to zero width. */
.wsx-video { display: grid; grid-template-columns: 1fr 320px; padding: 0; overflow: hidden; transition: grid-template-columns var(--dur-3) var(--ease); }
.wsx-video.is-nodock { grid-template-columns: 1fr 0; }
.wsx-vcol { min-width: 0; min-height: 0; overflow-y: auto; padding: var(--sp-5) var(--sp-6) var(--sp-8); }
.vid__frame { aspect-ratio: 16/9; border-radius: var(--r-lg); background: linear-gradient(135deg, var(--surface) 0%, var(--bg-deep) 100%); border: 1px solid var(--border-strong); display: grid; place-items: center; position: relative; overflow: hidden; transition: border-radius var(--dur-3) var(--ease); }
.vid__frame--embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vid__play { width: 72px; height: 72px; border-radius: 50%; background: var(--grad); display: grid; place-items: center; color: #fff; box-shadow: var(--glow-violet); }
.vid__play i, .vid__play svg { width: 30px; height: 30px; }
.vid__meta { position: absolute; left: var(--sp-5); bottom: var(--sp-4); }
.vid__meta b { font-family: var(--font-display); font-size: var(--fs-lg); }

/* cinema toggle rides the player's corner so the exit is always where the entry was */
.wsx-cine {
  position: absolute; top: var(--sp-3); right: var(--sp-3); z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--text-muted);
  background: rgba(10,14,20,.82); border: 1px solid var(--border-strong); border-radius: var(--r-xs);
  padding: 5px 10px; cursor: pointer; transition: color var(--dur-2) var(--ease);
}
.wsx-cine:hover { color: var(--text); }
.wsx-cine i, .wsx-cine svg { width: 13px; height: 13px; }

/* mode pills live with the content, not the chrome */
.wsx-under { display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-4); flex-wrap: wrap; }
.wsx-under--bar { margin: 0; padding: var(--sp-3) var(--sp-5); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.wsx-under__meta { margin-left: auto; font-size: var(--fs-xs); color: var(--text-faint); }
.wsx-mode { display: inline-flex; align-items: center; gap: 7px; padding: 7px 15px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; transition: background var(--dur-2) var(--ease), color var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease); }
.wsx-mode i, .wsx-mode svg { width: 15px; height: 15px; }
.wsx-mode:hover { color: var(--text); }
.wsx-mode.is-on { background: var(--grad-soft); border-color: var(--accent); color: var(--text); }

/* tutor dock — live-chat pattern (item 12, wireframe note 3): full-height on the
   right edge, pulse header, messages pinned to a bottom input like a live chat.
   ✕ hides the whole column (the grid animates it away). */
.vid-ask { border-left: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.wsx-video.is-nodock .vid-ask { visibility: hidden; border-left-width: 0; }
.vid-ask__head { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.vid-ask__head .mono { font-size: var(--fs-xs); letter-spacing: .06em; text-transform: uppercase; color: var(--violet-300); display: inline-flex; align-items: center; gap: 6px; }
.vid-ask .chat__log { padding: var(--sp-4); }
.vid-ask .chat__log > :first-child { margin-top: auto; }  /* live-chat: content hugs the input */
.vid-ask .suggestions { padding: 0 var(--sp-4) var(--sp-2); }
.vid-ask .chat__input { padding: var(--sp-3) var(--sp-4) var(--sp-4); border-top: 1px solid var(--border); }
.vid-ask .chat__input .input { border-radius: var(--r-pill); padding-block: 8px; }
.vid-ask__send { width: 38px; height: 38px; padding: 0; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; }
.vid-ask__send i, .vid-ask__send svg { width: 15px; height: 15px; }

/* ── CINEMA (item 12): the video owns the viewport; everything else steps back.
   Applied on .wsx via Alpine while on the video mode. ── */
.wsx.is-cinema .wsx-top { background: var(--bg-deep); border-bottom-color: transparent; }
.wsx.is-cinema .wsx-video { grid-template-columns: 1fr 0; }
.wsx.is-cinema .vid-ask { visibility: hidden; border-left-width: 0; }
.wsx.is-cinema .wsx-vcol { padding: 0; overflow: hidden; }
.wsx.is-cinema .wsx-under, .wsx.is-cinema .vbelow { display: none; }
.wsx.is-cinema .vid__frame { aspect-ratio: auto; height: calc(100dvh - var(--topbar-h)); border-radius: 0; border: 0; }

/* below-video tab strip (YouTube-style): Quiz · Discussion · Resources */
.vbelow { margin-top: var(--sp-7); }
.vtabs { display: flex; gap: var(--sp-1); border-bottom: 1px solid var(--border); margin-bottom: var(--sp-6); overflow-x: auto; scrollbar-width: none; }
.vtabs::-webkit-scrollbar { display: none; }
.vtab { padding: 11px var(--sp-4); font-weight: 600; font-size: var(--fs-sm); color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; transition: color var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease); }
.vtab i, .vtab svg { width: 15px; height: 15px; }
.vtab:hover { color: var(--text); }
.vtab.is-on { color: var(--text); border-bottom-color: var(--accent); }

.disc { max-width: 760px; }
.disc__head { display: flex; align-items: baseline; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.disc__head h3 { font-size: var(--fs-lg); }
.disc__compose { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-6); }
.disc__compose .input { flex: 1; }
.disc__list { display: flex; flex-direction: column; gap: var(--sp-5); }
.disc-c { display: flex; gap: var(--sp-3); }
.disc-c__body { flex: 1; min-width: 0; }
.disc-c__meta { font-size: var(--fs-sm); margin-bottom: 3px; }
.disc-c__body p { font-size: var(--fs-sm); color: var(--text); line-height: 1.55; white-space: pre-wrap; word-break: break-word; }

/* problems overlay — the module's questions, on demand (closes on select) */
.wsx-overlay { position: fixed; inset: 0; z-index: 80; display: flex; align-items: flex-start; justify-content: center; padding: 10vh var(--sp-4) var(--sp-4); background: var(--overlay); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.ovl { width: min(620px, 100%); max-height: 76vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-lg); box-shadow: var(--shadow-3); overflow: hidden; animation: rise var(--dur-3) var(--ease-out); }
.ovl__head { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.ovl__head i, .ovl__head svg { width: 17px; height: 17px; color: var(--text-faint); flex-shrink: 0; }
.ovl__search { flex: 1; border: none; background: none; color: var(--text); font: inherit; outline: none; padding: 6px 0; }
.ovl__search:focus { box-shadow: none; }
.ovl__search::placeholder { color: var(--text-faint); }
.ovl__head kbd { font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); border: 1px solid var(--border-strong); border-radius: 5px; padding: 1px 6px; }
.ovl__list { flex: 1; overflow-y: auto; padding: var(--sp-3); }
.ovl__empty { text-align: center; color: var(--text-faint); font-size: var(--fs-sm); padding: var(--sp-8) var(--sp-4); }

/* practice (lab) — resizable panes (OnlearnSplit manages flex on the children) */
.lab { display: flex; flex-direction: row; height: 100%; min-height: 0; }
.lab__panel { min-width: 0; min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--border); overflow: hidden; }
.lab__panel:last-child { border-right: none; }
.lab__problem { padding: var(--sp-5); overflow-y: auto; }
.lab__problem > * + * { margin-top: var(--sp-4); }
.lab__editor { background: var(--bg-deep); }
.lab__toolbar { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border); }
.lab__toolbar .grow { flex: 1; }
.lab__monaco { flex: 1; min-width: 0; min-height: 0; overflow: hidden; }
/* terminal (editor⇕terminal split, INPUT/OUTPUT tabs) lives in workspace.css */

/* chat (mentor + conversational) */
.chat { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.chat__head .mono { font-size: var(--fs-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--violet-300); display: inline-flex; align-items: center; gap: 6px; }
.chat__log { flex: 1; overflow-y: auto; padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-4); }
.chat__empty { margin: auto; text-align: center; color: var(--text-faint); font-size: var(--fs-sm); max-width: 30ch; }
.msg { font-size: var(--fs-sm); line-height: 1.6; }
.msg--user { align-self: flex-end; max-width: 88%; background: var(--surface-2); border: 1px solid var(--border-strong); padding: 9px 13px; border-radius: 14px 14px 4px 14px; white-space: pre-wrap; }
.msg--assistant { align-self: flex-start; width: 100%; }
.suggestions { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 var(--sp-5) var(--sp-3); }
.suggestion-chip { font-size: var(--fs-xs); padding: 6px 12px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text-muted); transition: color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease); }
.suggestion-chip:hover { color: var(--text); border-color: var(--accent); }
.chat__input { display: flex; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--border); flex-shrink: 0; }
.chat__input .input { flex: 1; }
.cursor { display: inline-block; width: 7px; height: 1em; background: var(--accent); vertical-align: -2px; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }
.pulse-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px var(--success); animation: live-dot 2s var(--ease) infinite; }

/* conversational = centered chat */
.convo { width: 100%; max-width: 860px; margin-inline: auto; height: 100%; }

/* rendered markdown — problem statements + AI replies. Tuned to read like a
   real coding-platform problem: clear section headings, distinct code blocks. */
.md { font-size: var(--fs-sm); line-height: 1.7; color: var(--text); }
.md > :first-child { margin-top: 0; }
.md h1, .md h2, .md h3, .md h4 { font-family: var(--font-display); margin: 1.3em 0 .5em; line-height: 1.3; letter-spacing: -.01em; }
.md h1 { font-size: var(--fs-lg); }
.md h2 { font-size: var(--fs-md); padding-bottom: .35em; border-bottom: 1px solid var(--border); }
.md h3 { font-size: var(--fs-base); color: var(--text); }
.md h4 { font-size: var(--fs-sm); color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; font-family: var(--font-mono); }
.md p { margin: .65em 0; }
.md ul, .md ol { margin: .55em 0; padding-left: 1.4em; list-style: revert; }
.md li { margin: .3em 0; }
.md li::marker { color: var(--text-faint); }
.md code { font-family: var(--font-mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 5px; color: var(--violet-300); }
.md pre { position: relative; background: var(--bg-deep); border: 1px solid var(--border); border-left: 3px solid var(--border-strong); border-radius: var(--r-sm); padding: var(--sp-3) var(--sp-4); overflow-x: auto; margin: .8em 0; font-size: var(--fs-xs); line-height: 1.6; }
.md pre code { background: none; border: none; padding: 0; color: var(--text); font-size: 1em; }
.md a { color: var(--violet-300); text-decoration: underline; }
.md strong { color: var(--text); font-weight: 700; }
.md blockquote { border-left: 3px solid var(--accent); padding: .2em var(--sp-4); color: var(--text-muted); margin: .8em 0; background: var(--surface); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.md table { border-collapse: collapse; width: 100%; margin: .8em 0; font-size: var(--fs-xs); }
.md th, .md td { border: 1px solid var(--border); padding: 7px 11px; text-align: left; }
.md th { background: var(--surface-2); font-family: var(--font-mono); font-weight: 600; }
.md hr { border: none; border-top: 1px solid var(--border); margin: 1.2em 0; }

/* structured sample I/O cards (runnable samples, alongside the statement) */
.io { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); margin: var(--sp-2) 0; }
.io__col { min-width: 0; }
.io__k { display: block; font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 4px; }
.io pre { margin: 0; background: var(--bg-deep); border: 1px solid var(--border); border-radius: var(--r-sm); padding: var(--sp-2) var(--sp-3); font-family: var(--font-mono); font-size: var(--fs-xs); line-height: 1.55; white-space: pre-wrap; word-break: break-word; color: var(--text); }
@media (max-width: 560px) { .io { grid-template-columns: 1fr; } }

/* test cases + run output */
.testcase { border: 1px solid var(--border); border-radius: var(--r-sm); padding: var(--sp-3); margin-top: var(--sp-2); background: var(--surface); font-family: var(--font-mono); font-size: var(--fs-xs); }
.testcase--pass { border-color: color-mix(in srgb, var(--success) 40%, transparent); }
.testcase--fail { border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.success { color: var(--success); } .warning { color: var(--warning); } .error { color: var(--danger); }

/* ----------------------------------------------------------- onboarding */
.onb { max-width: 720px; margin-inline: auto; padding: var(--sp-10) var(--sp-6) var(--sp-8); min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.onb__head { text-align: center; margin-bottom: var(--sp-6); }
.onb__head .brand-mark { margin-inline: auto; }
.onb__chat { display: flex; flex-direction: column; height: min(56vh, 520px); overflow: hidden; padding: 0; }

/* ----------------------------------------------------------- checkout */
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
@media (max-width: 720px) { .plan-grid { grid-template-columns: 1fr; } }
.plan { position: relative; }
.plan--pro { border-color: var(--accent); box-shadow: var(--glow-violet); }
.plan__price { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-3xl); }
.plan__price small { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--text-muted); font-weight: 400; }
.plan__feat { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--text-muted); padding: 5px 0; }
.plan__feat i { width: 16px; height: 16px; color: var(--success); flex-shrink: 0; }

/* ----------------------------------------------- platform tour (driver.js theme) */
.driver-popover.onlearn-tour { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--r-md); box-shadow: var(--shadow-3); }
.driver-popover.onlearn-tour .driver-popover-title { font-family: var(--font-display); font-size: var(--fs-md); color: var(--text); }
.driver-popover.onlearn-tour .driver-popover-description { color: var(--text-muted); font-size: var(--fs-sm); }
.driver-popover.onlearn-tour .driver-popover-progress-text { color: var(--text-faint); font-family: var(--font-mono); font-size: var(--fs-xs); }
.driver-popover.onlearn-tour button.driver-popover-next-btn { background: var(--grad); color: #fff; border: none; text-shadow: none; border-radius: var(--r-xs); font-weight: 600; }
.driver-popover.onlearn-tour button.driver-popover-prev-btn { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border-strong); text-shadow: none; border-radius: var(--r-xs); }
.driver-popover.onlearn-tour button.driver-popover-close-btn { color: var(--text-muted); }
.driver-popover.onlearn-tour .driver-popover-arrow-side-left.driver-popover-arrow { border-left-color: var(--surface); }
.driver-popover.onlearn-tour .driver-popover-arrow-side-right.driver-popover-arrow { border-right-color: var(--surface); }
.driver-popover.onlearn-tour .driver-popover-arrow-side-top.driver-popover-arrow { border-top-color: var(--surface); }
.driver-popover.onlearn-tour .driver-popover-arrow-side-bottom.driver-popover-arrow { border-bottom-color: var(--surface); }

@media (max-width: 1100px) {
  /* OnlearnSplit is inert below this width — panels stack vertically via flex */
  .lab { flex-direction: column; height: auto; min-height: 100%; }
  .lab__panel { border-right: none; border-bottom: 1px solid var(--border); flex: 0 0 auto !important; min-height: 300px; }
  .lab__panel.is-collapsed { min-height: 0; }
  .lab__split { min-height: 360px; }
}

/* ===========================================================================
   AUTH
   ========================================================================== */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-aside {
  position: relative; overflow: hidden; padding: var(--sp-16) var(--sp-12);
  display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(150deg, var(--surface) 0%, var(--bg-deep) 100%); border-right: 1px solid var(--border);
}
.auth-aside__glow { position: absolute; inset: 0; background: radial-gradient(50% 40% at 20% 10%, rgba(124,58,237,.22), transparent 60%), radial-gradient(45% 45% at 90% 100%, rgba(6,182,212,.16), transparent 60%); pointer-events: none; }
.auth-aside__content { position: relative; z-index: 1; }
.auth-main { display: grid; place-items: center; padding: var(--sp-12) var(--sp-6); }
.auth-box { width: 100%; max-width: 400px; }
.auth-box h1 { font-size: var(--fs-2xl); margin-bottom: 6px; }
.auth-box__sub { color: var(--text-muted); margin-bottom: var(--sp-8); }
.auth-divider { display: flex; align-items: center; gap: var(--sp-3); margin: var(--sp-6) 0; color: var(--text-faint); font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: .1em; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-quote { font-family: var(--font-display); font-size: var(--fs-xl); line-height: 1.4; font-weight: 500; }
.auth-foot { color: var(--text-muted); font-size: var(--fs-sm); margin-top: var(--sp-6); text-align: center; }
.auth-foot a, .link { color: var(--accent-text); font-weight: 600; }
.link:hover, .auth-foot a:hover { text-decoration: underline; }

/* ===========================================================================
   LANDING
   ========================================================================== */
.lp { position: relative; }
.lp-nav { position: sticky; top: 0; z-index: 40; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); background: rgba(13,17,23,.72); background: color-mix(in srgb, var(--bg) 72%, transparent); border-bottom: 1px solid var(--border); }
.lp-nav__inner { height: 68px; display: flex; align-items: center; justify-content: space-between; }
.lp-nav__links { display: flex; align-items: center; gap: var(--sp-6); }
.lp-nav__links a { color: var(--text-muted); font-size: var(--fs-sm); font-weight: 500; }
.lp-nav__links a:hover { color: var(--text); }

.hero { position: relative; padding: var(--sp-24) 0 var(--sp-20); text-align: center; overflow: hidden; }
.hero__tag { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--border-strong); font-size: var(--fs-sm); color: var(--text-muted); margin-bottom: var(--sp-6); }
.hero__tag .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 10px var(--success); animation: live-dot 2s var(--ease) infinite; }
@keyframes live-dot { 0%,100% { box-shadow: 0 0 0 0 rgba(52,211,153,.6); } 50% { box-shadow: 0 0 0 5px rgba(52,211,153,0); } }
.hero h1 { font-size: clamp(2.4rem, 6vw, var(--fs-5xl)); line-height: 1.04; letter-spacing: -.03em; max-width: 16ch; margin-inline: auto; }
.hero__sub { font-size: var(--fs-lg); color: var(--text-muted); max-width: 56ch; margin: var(--sp-6) auto var(--sp-8); line-height: 1.5; }
.hero__cta { display: flex; gap: var(--sp-3); justify-content: center; flex-wrap: wrap; }

/* hero path visualization (the signature, horizontal) */
.hero-path { margin: var(--sp-16) auto 0; max-width: 820px; }
.hero-path__track { display: flex; align-items: center; }
.hpn { display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); flex-shrink: 0; }
/* The hero path is the signature spine shown horizontally — and it demonstrates
   the mechanic: done nodes fill with the gradient, the current node pulses, future
   nodes stay faint. (Same states as the in-app vertical .spine.) */
.hpn__dot { width: 52px; height: 52px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-muted); box-shadow: var(--shadow-2); }
.hpn__dot i, .hpn__dot svg { width: 22px; height: 22px; }
.hpn--done .hpn__dot { background: var(--grad); color: #fff; border-color: transparent; box-shadow: var(--glow-violet); }
.hpn--current .hpn__dot { border: 2px solid var(--accent); color: var(--violet-300); animation: pulse-ring 2.4s var(--ease) infinite; }
.hpn--future .hpn__dot { opacity: .6; }
.hpn__lbl { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-muted); letter-spacing: .04em; }
.hpn--done .hpn__lbl, .hpn--current .hpn__lbl { color: var(--text); }
.hpn__seg { height: 3px; flex: 1; border-radius: 2px; background: var(--border-strong); position: relative; transform-origin: left; animation: draw-x var(--dur-4) var(--ease-out) backwards; }
.hpn__seg--done { background: linear-gradient(90deg, var(--violet), var(--cyan)); }
.hpn__seg--current { background: linear-gradient(90deg, var(--cyan) 0, var(--cyan) 45%, var(--border-strong) 45%); }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); }
.feature { padding: var(--sp-6); }
.feature__icon { width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--violet-300); margin-bottom: var(--sp-4); }
.feature__icon i, .feature__icon svg { width: 21px; height: 21px; }
.feature h3 { font-size: var(--fs-lg); margin-bottom: 6px; }
.feature p { color: var(--text-muted); font-size: var(--fs-sm); }

.statline { display: flex; gap: var(--sp-12); justify-content: center; flex-wrap: wrap; padding: var(--sp-10) 0; }
.section-pad { padding: var(--sp-20) 0; }
.section-pad--tight { padding: var(--sp-16) 0; }

.lp-foot { border-top: 1px solid var(--border); padding: var(--sp-10) 0; color: var(--text-faint); font-size: var(--fs-sm); }

/* ===========================================================================
   MOTION
   ========================================================================== */
@keyframes pulse-ring { 0%,100% { box-shadow: 0 0 0 0 rgba(139,92,246,.45); } 50% { box-shadow: 0 0 0 7px rgba(139,92,246,0); } }
@keyframes shimmer { to { background-position: -400% 0; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes draw-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes float-soft { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* page-load reveal: children rise in sequence (set --i on each child) */
.reveal > * { animation: rise var(--dur-3) var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 70ms); }
.float { animation: float-soft 5s var(--ease) infinite; }

/* ===========================================================================
   A11Y FLOORS
   ========================================================================== */
/* outline (not box-shadow) so the ring is never clipped by overflow:hidden
   ancestors like .sidebar / .menu__panel */
:focus-visible { outline: 2px solid var(--violet-300); outline-offset: 2px; }
a:focus-visible { text-decoration: underline; }  /* robust secondary cue for inline links */
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 200; background: var(--surface); border: 1px solid var(--accent); padding: 8px 14px; border-radius: var(--r-sm); }
.skip-link:focus { left: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  /* content that starts hidden for a reveal must never stay hidden */
  .reveal > *, [data-reveal] > *, .hpn__seg { animation: none !important; opacity: 1 !important; transform: none !important; }
}

/* ===========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1024px) {
  .feature-grid { grid-template-columns: 1fr; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 0 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: min(86vw, var(--sidebar-w)); transform: translateX(-100%); transition: transform var(--dur-3) var(--ease); box-shadow: var(--shadow-3); }
  .app.is-mobile-open .sidebar { transform: none; }
  .scrim { position: fixed; inset: 0; background: var(--overlay); z-index: 25; opacity: 0; pointer-events: none; transition: opacity var(--dur-2) var(--ease); }
  .app.is-mobile-open .scrim { opacity: 1; pointer-events: auto; }
  .content { padding: var(--sp-5) var(--sp-4) var(--sp-12); }
  .searchbox { display: none; }
  /* mobile drawer is always the full panel — collapse control doesn't apply */
  .sidebar__collapse { display: none; }
  .app.is-collapsed .nav-item__label, .app.is-collapsed .brand-word { opacity: 1; width: auto; }
  .app.is-collapsed .user-chip__meta { display: block; }
  .app.is-collapsed .nav-item__badge { display: inline-block; }
  .app.is-collapsed .nav-label { opacity: 1; height: auto; padding: var(--sp-4) var(--sp-3) var(--sp-2); }
  .app.is-collapsed .nav-item { justify-content: flex-start; padding-inline: var(--sp-3); gap: var(--sp-3); }
  .app.is-collapsed .sidebar__brand { justify-content: flex-start; padding-inline: var(--sp-5); }
  .app.is-collapsed .user-chip { justify-content: flex-start; padding-inline: var(--sp-3); }

  /* workspace: tighten the single chrome row for small screens (the questions
     live in the overlay, so there's no sidebar to manage here) */
  .wsx-lesson__mod, .wsx-back__lbl, .wsx-under__meta { display: none; }
  .wsx-lesson__ttl { max-width: 14ch; }
  .wsx-panel { padding: var(--sp-5) var(--sp-4); }
  /* Single-column lesson with the professor-requested live-comments tutor as
     an explicit full-screen sheet. The video remains the default focus; the
     Ask tutor pill opens this surface and Escape / close returns to the video. */
  .wsx-video, .wsx-video.is-nodock { grid-template-columns: 1fr; padding: 0; }
  .vid-ask {
    position: fixed; inset: var(--topbar-h) 0 0; z-index: 70;
    display: flex; border-left: 0; border-top: 1px solid var(--border);
    box-shadow: var(--shadow-3); transform: translateY(0);
    transition: transform var(--dur-3) var(--ease-out), visibility var(--dur-3);
  }
  .wsx-video.is-nodock .vid-ask {
    display: flex; visibility: hidden; pointer-events: none;
    transform: translateY(100%); border-left-width: 0;
  }
  .vid-ask__head { min-height: 58px; padding-inline: var(--sp-5); }
  .vid-ask__head small { color: var(--text-faint); font: inherit; }
  .vid-ask .chat__log { padding: var(--sp-5); }
  .vid-ask .suggestions { padding-inline: var(--sp-5); }
  .vid-ask .chat__input { padding: var(--sp-3) var(--sp-5) max(var(--sp-4), env(safe-area-inset-bottom)); }
  .wsx-vcol { padding: var(--sp-4) var(--sp-4) var(--sp-8); }
}
@media (min-width: 861px) { .scrim, .topbar__hamburger { display: none; } }

/* Faculty preview-as-student banner (Phase 5c) — pinned above the app shell. */
.preview-bar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center; gap: var(--sp-4);
  padding: 8px var(--sp-4);
  background: var(--grad-soft);
  border-bottom: 1px solid var(--border);
  color: var(--text); font-size: var(--fs-sm); font-weight: 500;
  backdrop-filter: blur(6px);
}
.preview-bar i { width: 16px; height: 16px; }
.preview-bar a { color: var(--accent-text); font-weight: 600; }
