/* ==========================================================================
   T-Learn Brand 2.0 — base, components and layouts
   Requires tokens.css. One stylesheet for every theme: colours come from
   tokens, so there is no separate dark-mode file any more.
   ========================================================================== */

/* ---------------------------------------------------------------- Reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg-canvas);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; display: block; }
a { color: var(--brand-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, h5, h6 { color: var(--text-primary); font-weight: 600; margin: 0; }
p { margin: 0; }
hr { border: 0; border-top: var(--border-w) solid var(--border); margin: var(--space-6) 0; }
::selection { background: var(--brand); color: var(--brand-on); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -48px; z-index: 1000; background: var(--brand); color: var(--brand-on); padding: 8px 14px; border-radius: var(--radius-sm); font-weight: 500; }
.skip-link:focus { top: 12px; }

/* ---------------------------------------------------------------- Type */
.display-xl { font-size: var(--fs-display-xl); line-height: var(--lh-display-xl); letter-spacing: -0.05em; font-weight: 600; color: var(--text-primary); }
.display-l  { font-size: var(--fs-display-l);  line-height: var(--lh-display-l);  letter-spacing: -0.04em; font-weight: 600; color: var(--text-primary); }
.h1, h1 { font-size: var(--fs-h1); line-height: var(--lh-h1); letter-spacing: -0.035em; }
.h2, h2 { font-size: var(--fs-h2); line-height: var(--lh-h2); letter-spacing: -0.03em; }
.h3, h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); letter-spacing: -0.015em; }
.h4, h4 { font-size: var(--fs-h4); line-height: var(--lh-h4); font-weight: 500; }
.body-l { font-size: var(--fs-body-l); line-height: var(--lh-body-l); }
.small, small { font-size: var(--fs-small); line-height: var(--lh-small); }
.mono, code, kbd, pre, samp { font-family: var(--font-mono); }
.overline {
  font-family: var(--font-mono); font-size: var(--fs-overline); line-height: var(--lh-overline);
  letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); font-weight: 500;
}
.overline--brand { color: var(--brand-text); }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-brand { color: var(--brand-text); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.highlight { color: var(--brand-text); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- Layout helpers */
.container { width: 100%; max-width: calc(1200px + var(--page-margin) * 2); margin: 0 auto; padding: 0 var(--page-margin); }
.stack > * + * { margin-top: var(--stack, var(--space-4)); }
.row { display: flex; align-items: center; gap: var(--space-3); }
.row--between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grid { display: grid; gap: var(--gutter); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- Icons */
.icon { display: inline-block; vertical-align: -0.2em; width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.icon--16 { width: 16px; height: 16px; }
.icon--24 { width: 24px; height: 24px; }

/* ---------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: 12px 20px; border-radius: var(--radius-sm);
  font-family: var(--font-sans); font-size: var(--fs-button); line-height: var(--lh-button); font-weight: 500;
  border: var(--border-w) solid transparent; background: transparent; color: var(--text-primary);
  text-decoration: none !important; white-space: nowrap; user-select: none;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn--primary { background: var(--brand); color: var(--brand-on); }
.btn--primary:hover:not(:disabled) { background: var(--brand-hover); }
.btn--secondary { background: var(--bg-raised); border-color: var(--border); }
.btn--secondary:hover:not(:disabled) { border-color: var(--text-secondary); }
.btn--ghost { color: var(--text-body); }
.btn--ghost:hover:not(:disabled) { background: var(--bg-raised); color: var(--text-primary); }
.btn--danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn--danger:hover:not(:disabled) { background: var(--danger); color: #0A0A0F; }
.btn--sm { padding: 8px 14px; font-size: 14px; }
.btn--lg { padding: 14px 24px; font-size: 16px; }
.btn--block { width: 100%; }
.btn--icon { padding: 10px; }
.btn .icon { width: 16px; height: 16px; }

/* ---------------------------------------------------------------- Forms */
.field { display: flex; flex-direction: column; gap: 8px; }
.field + .field { margin-top: var(--space-4); }
.grid > .field + .field { margin-top: 0; }
.label, .form-label { font-size: var(--fs-small); line-height: var(--lh-small); font-weight: 500; color: var(--text-primary); }
.input, .field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea,
input.input, select.input, textarea.input {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--bg-raised); color: var(--text-primary);
  border: var(--border-w) solid var(--border); outline: none;
  font-size: var(--fs-body); line-height: 22px;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.input::placeholder, .field input::placeholder, textarea::placeholder { color: var(--text-secondary); }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.field.is-error input, .input.is-error { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.help { font-size: 13px; line-height: 18px; color: var(--text-secondary); }
.help--error, .field.is-error .help { color: var(--danger); }
.password-wrap { position: relative; }
.password-wrap .input { padding-right: 48px; }
.password-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--text-secondary); padding: 8px; border-radius: 8px; }
.password-toggle:hover { color: var(--text-primary); }
.checkbox { display: inline-flex; align-items: flex-start; gap: 10px; font-size: var(--fs-small); color: var(--text-body); cursor: pointer; }
.checkbox input { appearance: none; width: 18px; height: 18px; margin: 1px 0 0; border-radius: 5px; border: var(--border-w) solid var(--border-strong); background: var(--bg-raised); display: grid; place-items: center; flex: none; }
.checkbox input:checked { background: var(--brand); border-color: var(--brand); }
.checkbox input:checked::after { content: ""; width: 9px; height: 5px; border: 2px solid var(--brand-on); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--text-secondary); font-family: var(--font-mono); font-size: 12px; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.strength { display: flex; gap: 6px; align-items: center; }
.strength span { flex: 1; height: 4px; border-radius: 4px; background: var(--border); }
.strength[data-score="1"] span:nth-child(-n+1),
.strength[data-score="2"] span:nth-child(-n+2) { background: var(--warning); }
.strength[data-score="3"] span:nth-child(-n+3),
.strength[data-score="4"] span:nth-child(-n+4) { background: var(--success); }
.strength-label { font-family: var(--font-mono); font-size: 12px; min-width: 110px; text-align: right; color: var(--text-secondary); }

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + span { opacity: .5; }
.switch span { position: absolute; inset: 0; background: var(--bg-raised); border: var(--border-w) solid var(--border); border-radius: 999px; transition: background var(--dur) var(--ease); }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-secondary); transition: transform var(--dur) var(--ease), background var(--dur) var(--ease); }
.switch input:checked + span { background: var(--brand); border-color: var(--brand); }
.switch input:checked + span::after { transform: translateX(18px); background: var(--brand-on); }
.switch input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------------------------------------------------------------- Cards, chips, tiles */
.card { background: var(--bg-surface); border: var(--border-w) solid var(--border); border-radius: var(--radius-lg); padding: var(--space-6); }
.card--pad-lg { padding: var(--space-8); }
.card--raised { background: var(--bg-raised); }
.card--accent { position: relative; overflow: hidden; }
.card--accent::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--brand); }
.card--glow { position: relative; overflow: hidden; }
.card--glow::after { content: ""; position: absolute; inset: 0; background: var(--glow); pointer-events: none; }
.card--glow > * { position: relative; z-index: 1; }
.card__title { color: var(--text-primary); font-size: var(--fs-h4); line-height: var(--lh-h4); font-weight: 600; }
.card-link { display: block; color: inherit; text-decoration: none !important; transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease); }
.card-link:hover { border-color: var(--text-secondary); }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: var(--radius-pill);
  background: var(--bg-raised); border: var(--border-w) solid var(--border);
  color: var(--text-body); font-size: 13px; line-height: 18px; font-weight: 500; white-space: nowrap;
}
.chip--stat { font-family: var(--font-mono); color: var(--text-primary); padding: 8px 14px; }
.chip--brand { color: var(--brand-text); border-color: color-mix(in srgb, var(--brand) 45%, transparent); background: var(--brand-soft); }
.chip--success { color: var(--success); border-color: color-mix(in srgb, var(--success) 45%, transparent); background: var(--success-soft); }
.chip--danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: var(--danger-soft); }
.chip--warning { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 45%, transparent); background: var(--warning-soft); }
.chip--tiny { font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; }
.swatch { width: 14px; height: 4px; border-radius: 4px; background: var(--swatch, var(--line)); flex: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--line)); flex: none; }

.stat-tile { background: var(--bg-surface); border: var(--border-w) solid var(--border); border-radius: var(--radius-md); padding: 16px 18px; }
.stat-tile__value { font-family: var(--font-sans); font-size: 28px; line-height: 32px; font-weight: 600; color: var(--text-primary); letter-spacing: -0.02em; }
.stat-tile__label { font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

.progress { height: 6px; border-radius: 6px; background: var(--line-track); overflow: hidden; }
.progress > span { display: block; height: 100%; width: var(--value, 0%); background: var(--line); border-radius: inherit; transition: width var(--dur-slow) var(--ease); }

.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--ember-gradient); color: #0A0A0F; font-weight: 600; font-size: 15px; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--lg { width: 56px; height: 56px; font-size: 22px; }
.avatar--xl { width: 88px; height: 88px; font-size: 34px; }

.empty { text-align: center; padding: var(--space-8) var(--space-4); color: var(--text-secondary); font-size: var(--fs-small); }

/* Byte */
.byte { image-rendering: pixelated; image-rendering: crisp-edges; flex: none; }
.byte--48 { width: 48px; height: 48px; }
.byte--72 { width: 72px; height: 72px; }
.byte--96 { width: 96px; height: 96px; }
.byte--120 { width: 120px; height: 120px; }
.byte--144 { width: 144px; height: 144px; }
.byte--192 { width: 192px; height: 192px; }
.byte-hint { display: flex; align-items: center; gap: 14px; }
.byte-hint__bubble { background: var(--bg-raised); border: var(--border-w) solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; font-size: var(--fs-small); color: var(--text-primary); }
.byte-hint__bubble b { font-family: var(--font-mono); font-weight: 500; color: var(--brand-text); font-size: 12px; margin-right: 6px; }

/* ---------------------------------------------------------------- Toasts */
.toast-region { position: fixed; right: 24px; bottom: 24px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; min-width: 260px; max-width: 420px;
  background: var(--bg-surface); border: var(--border-w) solid var(--border); border-left: 3px solid var(--info);
  color: var(--text-primary); border-radius: var(--radius-sm); padding: 12px 16px; box-shadow: var(--shadow-pop);
  font-size: var(--fs-small); animation: toast-in var(--dur-slow) var(--ease);
}
.toast--success { border-left-color: var(--success); }
.toast--error { border-left-color: var(--danger); }
.toast--xp { border-left-color: var(--brand); font-family: var(--font-mono); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Legacy XP toast used by older inline scripts */
.xp-notification {
  position: fixed; right: 24px; bottom: 24px; z-index: 2000; background: var(--bg-surface); color: var(--text-primary);
  border: var(--border-w) solid var(--border); border-left: 3px solid var(--brand); border-radius: var(--radius-sm);
  padding: 12px 16px; font-family: var(--font-mono); font-size: 14px; box-shadow: var(--shadow-pop); animation: toast-in var(--dur-slow) var(--ease);
}

/* ---------------------------------------------------------------- Modals (shared with existing scripts) */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1500; display: grid; place-items: center; padding: 20px;
  background: rgba(5, 5, 10, .72); backdrop-filter: blur(4px); opacity: 0; transition: opacity var(--dur) var(--ease);
}
.modal-overlay.is-open { opacity: 1; }
.modal-content {
  width: 100%; max-width: 460px; max-height: calc(100vh - 40px); overflow: auto;
  background: var(--bg-surface); border: var(--border-w) solid var(--border); border-radius: var(--radius-lg);
  padding: var(--space-8); color: var(--text-body); box-shadow: var(--shadow-pop);
  transform: scale(.96); transition: transform var(--dur) var(--ease);
}
.modal-overlay.is-open .modal-content { transform: scale(1); }
.modal-content h3 { font-size: var(--fs-h3); line-height: var(--lh-h3); margin-bottom: 8px; }
.modal-content p { color: var(--text-body); margin-bottom: 16px; }
.modal-content .setting-group { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.modal-content .setting-group label { font-size: var(--fs-small); font-weight: 500; color: var(--text-primary); }
.modal-content input, .modal-content select, .modal-content textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm) !important; background: var(--bg-raised) !important;
  border: var(--border-w) solid var(--border) !important; color: var(--text-primary) !important; font-family: var(--font-sans) !important;
}
.modal-buttons { display: flex; gap: 10px; justify-content: flex-end; margin-top: var(--space-6); flex-wrap: wrap; }
.modal-button { padding: 12px 20px; border-radius: var(--radius-sm); border: var(--border-w) solid var(--border); background: var(--bg-raised); color: var(--text-primary); font-weight: 500; font-size: var(--fs-button); }
.modal-button:hover { border-color: var(--text-secondary); }
.modal-button.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-on); }
.modal-button.danger { background: var(--danger); border-color: var(--danger); color: #0A0A0F; }
.goal-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.goal-option-btn { padding: 14px 10px; border-radius: var(--radius-sm); border: var(--border-w) solid var(--border); background: var(--bg-raised); color: var(--text-primary); font-family: var(--font-mono); }
.goal-option-btn.selected, .goal-option-btn:hover { border-color: var(--brand); color: var(--brand-text); background: var(--brand-soft); }

/* ==========================================================================
   Website chrome
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg-canvas) 86%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: var(--border-w) solid var(--border);
}
.site-header__inner { display: flex; align-items: center; gap: 32px; height: 72px; }
.brand-link { display: inline-flex; align-items: center; color: var(--text-primary); text-decoration: none !important; }
.wordmark { height: 26px; width: auto; color: var(--text-primary); }
.wordmark--lg { height: 34px; }
.site-nav { display: flex; align-items: center; gap: 28px; margin: 0 auto; }
.site-nav a { color: var(--text-body); font-size: var(--fs-small); font-weight: 500; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text-primary); text-decoration: none; }
.site-actions { display: flex; align-items: center; gap: 12px; }
.site-actions .signin { color: var(--text-primary); font-size: var(--fs-small); font-weight: 500; padding: 8px 10px; }
.theme-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--radius-sm); background: transparent; border: var(--border-w) solid var(--border); color: var(--text-body); }
.theme-btn:hover { color: var(--text-primary); border-color: var(--text-secondary); }
.menu-btn { display: none; }
.mobile-menu { display: none; }
@media (max-width: 960px) {
  .site-nav, .site-actions .signin, .site-actions .btn--primary { display: none; }
  .site-actions { margin-left: auto; }
  .menu-btn { display: grid; }
  .mobile-menu.is-open { display: flex; flex-direction: column; gap: 4px; padding: 12px var(--page-margin) 20px; border-top: var(--border-w) solid var(--border); background: var(--bg-canvas); }
  .mobile-menu a { padding: 12px 4px; color: var(--text-primary); font-weight: 500; border-bottom: var(--border-w) solid var(--border); }
  .mobile-menu .btn { margin-top: 12px; }
}

.site-footer { border-top: var(--border-w) solid var(--border); padding: 64px 0 40px; margin-top: 96px; }
.site-footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.site-footer__col { display: flex; flex-direction: column; gap: 10px; }
.site-footer__col a { color: var(--text-body); font-size: var(--fs-small); }
.site-footer__col a:hover { color: var(--text-primary); }
.site-footer__tag { color: var(--text-secondary); font-size: var(--fs-small); margin-top: 12px; max-width: 280px; }
.site-footer__bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 48px; padding-top: 24px; border-top: var(--border-w) solid var(--border); }
.social { display: flex; gap: 10px; }
.social a { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; border: var(--border-w) solid var(--border); color: var(--text-body); }
.social a:hover { color: var(--text-primary); border-color: var(--text-secondary); text-decoration: none; }
.social svg { width: 16px; height: 16px; fill: currentColor; }
@media (max-width: 800px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } .site-footer__bottom { flex-direction: column; align-items: flex-start; } }

/* Marketing sections */
.section { padding: 96px 0; }
.section--tight { padding: 64px 0; }
.section__head { max-width: 760px; margin-bottom: 48px; }
.section__head .overline { margin-bottom: 16px; display: block; }
.section__head p { margin-top: 16px; font-size: var(--fs-body-l); line-height: var(--lh-body-l); color: var(--text-body); }
.page-hero { padding: 96px 0 48px; position: relative; overflow: hidden; }
.page-hero::before { content: ""; position: absolute; inset: -20% -10% auto; height: 520px; background: var(--glow); pointer-events: none; }
.page-hero > * { position: relative; }
.page-hero .hero__meta { font-size: 12px; line-height: 16px; margin-top: 20px; }
.page-hero p:not(.hero__meta) { font-size: var(--fs-body-l); line-height: var(--lh-body-l); max-width: 640px; margin-top: 20px; }
.lede { font-size: var(--fs-body-l); line-height: var(--lh-body-l); color: var(--text-body); }

/* Landing hero */
.hero { position: relative; padding: 88px 0 96px; overflow: hidden; border-bottom: var(--border-w) solid var(--border); }
.hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(50% 70% at 72% 40%, rgba(255,106,26,.20), transparent 70%); pointer-events: none; }
[data-theme="contrast"] .hero::before { display: none; }
.hero__grid { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.hero h1 { margin: 20px 0 24px; }
.hero__lede { font-size: 18px; line-height: 28px; max-width: 480px; }
.hero__actions { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.hero__meta { margin-top: 20px; font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); }
.hero__art { position: relative; min-height: 460px; }
.hero__art svg.network { width: 100%; height: auto; }
.float-card { position: absolute; background: var(--bg-surface); border: var(--border-w) solid var(--border); border-radius: var(--radius-md); padding: 14px 16px; box-shadow: var(--shadow-pop); }
.float-chip { position: absolute; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; background: var(--bg-surface); border: var(--border-w) solid var(--border); font-size: 12px; color: var(--text-primary); box-shadow: var(--shadow-pop); }
.eyebrow-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: var(--border-w) solid var(--border); background: var(--bg-surface); font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-body); }
.eyebrow-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
@media (max-width: 960px) { .hero__grid { grid-template-columns: 1fr; } .hero__art { min-height: 360px; } }

.wants-strip { padding: 40px 0; border-bottom: var(--border-w) solid var(--border); text-align: center; }
.wants-strip p { color: var(--text-secondary); font-size: var(--fs-small); margin-bottom: 16px; }
.wants-strip .row { justify-content: center; }
.wants-strip .chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }

.stations-line { position: relative; height: 32px; margin: 0 0 32px; }
.stations-line::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: var(--line-weight); transform: translateY(-50%); background: var(--line); border-radius: 999px; }
.stations-line i { position: absolute; top: 50%; width: 44px; height: 26px; transform: translate(-50%, -50%); border-radius: 999px; background: var(--bg-canvas); border: 4px solid var(--text-primary); }

.feature-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: var(--gutter); }
.feature-grid .card { min-height: 300px; }
.feature-grid .card .card--raised { align-self: flex-start; }
@media (max-width: 900px) { .feature-grid { grid-template-columns: 1fr; } }

.network-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 64px; }
.network-item { display: grid; grid-template-columns: 140px 1fr auto; align-items: center; gap: 20px; padding: 14px 0; border-bottom: var(--border-w) solid var(--border); }
.network-item__lines { display: flex; flex-direction: column; gap: 5px; }
.network-item__lines span { height: 4px; border-radius: 4px; background: repeating-linear-gradient(90deg, var(--c) 0 28px, transparent 28px 34px); }
.network-item__lines span:nth-child(2) { opacity: .75; }
.network-item__lines span:nth-child(3) { opacity: .5; }
.network-item h4 { font-size: 16px; line-height: 22px; font-weight: 600; color: var(--text-primary); }
.network-item p { font-size: 12px; color: var(--text-secondary); }
@media (max-width: 900px) { .network-list { grid-template-columns: 1fr; } .network-item { grid-template-columns: 90px 1fr auto; } }

.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item { background: var(--bg-surface); border: var(--border-w) solid var(--border); border-radius: var(--radius-md); }
.faq-item summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; color: var(--text-primary); font-weight: 500; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-family: var(--font-mono); font-size: 20px; color: var(--text-secondary); transition: transform var(--dur) var(--ease); }
.faq-item[open] summary::after { content: "×"; color: var(--brand-text); }
.faq-item .faq-answer { padding: 0 24px 22px; color: var(--text-body); }
.faq-item .faq-answer p + p { margin-top: 10px; }

.cta-final { text-align: center; padding: 96px 0 24px; position: relative; }
.cta-final::before { content: ""; position: absolute; inset: 0; background: var(--glow); pointer-events: none; }
.cta-final > * { position: relative; }
.cta-final .byte { margin: 0 auto 24px; }
.cta-final p { margin: 20px auto 32px; max-width: 520px; font-size: 18px; }

/* Legal & prose pages */
.prose { max-width: 760px; color: var(--text-body); font-size: 17px; line-height: 28px; }
.prose h2 { font-size: var(--fs-h3); line-height: var(--lh-h3); margin: 40px 0 12px; }
.prose h3 { font-size: var(--fs-h4); line-height: var(--lh-h4); margin: 28px 0 10px; font-weight: 600; }
.prose p, .prose ul, .prose ol { margin: 0 0 14px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 6px; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose strong { color: var(--text-primary); }

/* ==========================================================================
   App shell (sidebar + top bar)
   ========================================================================== */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 8px;
  background: var(--bg-sidebar); border-right: var(--border-w) solid var(--border); padding: 28px 16px 20px;
}
.sidebar .brand-link { padding: 0 12px 28px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-radius: var(--radius-sm);
  color: var(--text-body); font-size: 15px; font-weight: 500; text-decoration: none !important;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
button.nav-item { width: 100%; background: none; border: var(--border-w) solid transparent; text-align: left; font: inherit; font-size: 15px; font-weight: 500; }
button.nav-item .badge, .nav-item .badge { margin-left: auto; }
.nav-item .icon { width: 18px; height: 18px; color: var(--text-secondary); }
.nav-item:hover { background: var(--bg-raised); color: var(--text-primary); }
.nav-item[aria-current="page"] { background: var(--bg-raised); color: var(--text-primary); }
.nav-item[aria-current="page"] .icon { color: var(--brand-text); }
.nav-item .badge { margin-left: auto; font-family: var(--font-mono); font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--brand); color: var(--brand-on); }
.sidebar__section { margin-top: 12px; padding: 8px 16px 4px; }
.sidebar__spacer { flex: 1; }
.countdown-card { background: var(--bg-surface); border: var(--border-w) solid var(--border); border-radius: var(--radius-md); padding: 16px 18px; }
.countdown-card h4 { font-size: 18px; line-height: 24px; font-weight: 600; margin: 8px 0 4px; }
.countdown-card .mono { color: var(--brand-text); font-size: 13px; }
.countdown-card .progress { margin-top: 12px; height: 5px; }
.profile-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px 0; }
.profile-row__name { color: var(--text-primary); font-weight: 500; font-size: 15px; line-height: 20px; }
.profile-row__meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); }
.profile-row .icon-btn { margin-left: auto; }

.main { min-width: 0; padding: 32px 32px 64px; }
.main__inner { max-width: var(--content-w); margin: 0 auto; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.topbar h1 { font-size: 40px; line-height: 48px; letter-spacing: -0.035em; }
.topbar__sub { margin-top: 6px; font-size: 17px; color: var(--text-body); }
.topbar__actions { display: flex; align-items: center; gap: 10px; flex: none; }
.search-btn { display: inline-flex; align-items: center; gap: 12px; min-width: 190px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--bg-surface); border: var(--border-w) solid var(--border); color: var(--text-secondary); font-size: 15px; }
.search-btn:hover { border-color: var(--text-secondary); color: var(--text-body); }
.search-btn kbd { margin-left: auto; font-size: 10px; padding: 2px 6px; border-radius: 5px; background: var(--bg-raised); color: var(--text-secondary); border: var(--border-w) solid var(--border); }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--bg-surface); border: var(--border-w) solid var(--border); color: var(--text-body); position: relative; }
.icon-btn:hover { color: var(--text-primary); border-color: var(--text-secondary); }
.icon-btn .pip { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); border: 2px solid var(--bg-surface); }
.stat-chip { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 999px; background: var(--bg-surface); border: var(--border-w) solid var(--border); font-family: var(--font-mono); font-size: 14px; color: var(--text-primary); }
.stat-chip .icon { width: 16px; height: 16px; color: var(--brand-text); }

.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { white-space: nowrap; flex: none; padding: 8px 16px; border-radius: 999px; color: var(--text-body); font-size: 15px; font-weight: 500; background: none; border: var(--border-w) solid transparent; }
.tab:hover { color: var(--text-primary); }
.tab[aria-selected="true"], .tab.is-active { background: var(--bg-raised); border-color: var(--border); color: var(--text-primary); }

.mobile-bar { display: none; }
@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 20px 20px 96px; }
  .topbar { flex-direction: column; }
  .topbar h1 { font-size: 32px; line-height: 38px; }
  .search-btn { min-width: 0; }
  .search-btn span, .search-btn kbd { display: none; }
  .mobile-bar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
    background: var(--bg-sidebar); border-top: var(--border-w) solid var(--border); padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  }
  .mobile-bar a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; font-size: 11px; color: var(--text-secondary); text-decoration: none; }
  .mobile-bar a .icon { width: 20px; height: 20px; }
  .mobile-bar a[aria-current="page"] { color: var(--text-primary); }
  .mobile-bar a[aria-current="page"] .icon { color: var(--brand-text); }
  .mobile-top { display: flex !important; }
}
.mobile-top { display: none; align-items: center; justify-content: space-between; margin-bottom: 16px; }

/* Panels / popovers */
.popover {
  position: fixed; z-index: 1200; width: 380px; max-width: calc(100vw - 32px); max-height: 520px; overflow: hidden;
  background: var(--bg-surface); border: var(--border-w) solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-pop);
}
.popover__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: var(--border-w) solid var(--border); }
.popover__body { max-height: 440px; overflow: auto; }
.notif-item { padding: 14px 18px; border-bottom: var(--border-w) solid var(--border); cursor: pointer; }
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--bg-raised); }
.notif-item.unread { box-shadow: inset 3px 0 0 var(--brand); }
.notif-msg { color: var(--text-primary); font-size: 14px; line-height: 20px; }
.notif-msg strong { font-weight: 600; }
.notif-time { font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); margin-top: 4px; }
.notif-actions { display: flex; gap: 8px; margin-top: 10px; }

/* Command palette */
.palette-overlay { position: fixed; inset: 0; z-index: 1800; background: rgba(5,5,10,.6); backdrop-filter: blur(4px); display: flex; justify-content: center; padding-top: 12vh; }
.palette { width: 620px; max-width: calc(100vw - 32px); background: var(--bg-surface); border: var(--border-w) solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-pop); overflow: hidden; align-self: flex-start; }
.palette__input { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: var(--border-w) solid var(--border); color: var(--text-secondary); }
.palette__input input { flex: 1; background: none; border: 0; outline: none; color: var(--text-primary); font-size: 17px; }
.palette__list { max-height: 50vh; overflow: auto; padding: 8px; margin: 0; list-style: none; }
.palette__item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text-body); cursor: pointer; }
.palette__item small { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); }
.palette__item[aria-selected="true"] { background: var(--bg-raised); color: var(--text-primary); }
.palette__empty { padding: 24px; text-align: center; color: var(--text-secondary); font-size: 14px; }

/* ==========================================================================
   The line
   ========================================================================== */
.line-map { position: relative; }
.line-map svg { width: 100%; height: auto; overflow: visible; }
.line-legend { display: flex; gap: 18px; align-items: center; font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); }
.line-legend span { display: inline-flex; align-items: center; gap: 8px; }
.stop-done { width: 12px; height: 12px; border-radius: 50%; background: var(--line); display: inline-block; }
.stop-you { width: 16px; height: 16px; border-radius: 50%; border: 4px solid var(--ring); background: var(--bg-surface); display: inline-block; }
.stop-next { width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--line); display: inline-block; }
.stop-locked { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--stop-locked); display: inline-block; }
.line-svg .track { stroke: var(--line-track); }
.line-svg .travelled { stroke: var(--line); }
.line-svg .stop--done { fill: var(--line); }
.line-svg .stop--next { fill: var(--bg-surface); stroke: var(--line); stroke-width: 4; }
.line-svg .stop--locked { fill: var(--bg-surface); stroke: var(--stop-locked); stroke-width: 3; }
.line-svg .stop--you { fill: var(--bg-surface); stroke: var(--ring); stroke-width: 7; }
.line-svg .halo { fill: var(--ring-halo); }
.line-svg .terminus { fill: var(--bg-surface); stroke: var(--text-primary); stroke-width: 4; }
.line-svg .unit-label { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; fill: var(--text-secondary); text-transform: uppercase; }
.line-svg .unit-label.is-current { fill: var(--text-primary); }
.line-svg .unit-tick { stroke: var(--border); stroke-width: 1; }
.line-svg .stop-label { font-family: var(--font-sans); font-size: 13px; font-weight: 500; fill: var(--text-primary); }
.line-svg a { cursor: pointer; }
.line-svg a:focus { outline: none; }
.line-svg a:focus-visible circle { stroke: var(--focus); stroke-width: 4; }

/* Unit stops list (right rail) */
.stop-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.stop-list a { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: var(--radius-sm); color: var(--text-body); border: var(--border-w) solid transparent; text-decoration: none; }
.stop-list a:hover { background: var(--bg-raised); color: var(--text-primary); }
.stop-list a.is-current { background: var(--bg-raised); border-color: var(--border); color: var(--text-primary); }
.stop-list .mono { white-space: nowrap; flex: none; margin-left: auto; font-size: 12px; color: var(--text-secondary); }

/* ==========================================================================
   Lessons — focus mode
   ========================================================================== */
.focus-bar {
  position: sticky; top: 0; z-index: 100; display: flex; align-items: center; gap: 20px; height: 64px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg-canvas) 90%, transparent); backdrop-filter: blur(12px); border-bottom: var(--border-w) solid var(--border);
}
.focus-bar__back { display: inline-flex; align-items: center; gap: 8px; color: var(--text-body); font-size: 15px; font-weight: 500; }
.focus-bar__back:hover { color: var(--text-primary); text-decoration: none; }
.focus-bar__title { padding-left: 20px; border-left: var(--border-w) solid var(--border); color: var(--text-primary); font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.focus-bar__progress { flex: 1; max-width: 360px; margin: 0 auto; }
.focus-bar__end { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.read-progress { height: 6px; border-radius: 6px; background: var(--line-track); overflow: hidden; }
.read-progress span { display: block; height: 100%; width: 0; background: var(--line); border-radius: inherit; }
@media (max-width: 760px) { .focus-bar__title, .focus-bar__progress { display: none; } }

.lesson { max-width: 820px; margin: 0 auto; padding: 48px var(--page-margin) 96px; }
@media (min-width: 761px) { .lesson { padding-left: 24px; padding-right: 24px; } }
.lesson__head { margin-bottom: 32px; }
.lesson__head .overline { margin-bottom: 12px; display: block; }
.lesson__head h1 { font-size: 52px; line-height: 56px; letter-spacing: -0.04em; }
.lesson__head [data-done-chip] { margin-top: 16px; }
.lesson__head p { margin-top: 14px; font-size: 19px; line-height: 30px; color: var(--text-body); }
@media (max-width: 720px) { .lesson__head h1 { font-size: 36px; line-height: 40px; } }

.lesson-body { font-size: 17px; line-height: 28px; color: var(--text-body); }
.lesson-body > * + * { margin-top: 16px; }
.lesson-body h2 { font-size: 28px; line-height: 34px; letter-spacing: -0.025em; margin-top: 48px; padding-top: 8px; }
.lesson-body h3 { font-size: 21px; line-height: 28px; margin-top: 32px; }
.lesson-body h4 { font-size: 18px; line-height: 26px; margin-top: 24px; font-weight: 600; }
.lesson-body strong, .lesson-body b { color: var(--text-primary); font-weight: 600; }
.lesson-body ul, .lesson-body ol { padding-left: 22px; }
.lesson-body li + li { margin-top: 6px; }
.lesson-body li::marker { color: var(--brand-text); }
.lesson-body a { text-decoration: underline; text-underline-offset: 3px; }
.lesson-body img { border-radius: var(--radius-md); border: var(--border-w) solid var(--border); background: #fff; margin: 8px auto; max-height: 560px; width: auto; }
.lesson-body .table-scroll { overflow-x: auto; border: var(--border-w) solid var(--border); border-radius: var(--radius-md); }
.lesson-body table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15px; line-height: 22px; }
.lesson-body th, .lesson-body td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: var(--border-w) solid var(--border); }
.lesson-body th { background: var(--bg-raised); color: var(--text-primary); font-weight: 600; font-size: 13px; }
.lesson-body tr:last-child td { border-bottom: 0; }
.lesson-body td { background: var(--bg-surface); }
.lesson-body code { font-size: .9em; padding: 2px 6px; border-radius: 6px; background: var(--bg-raised); border: var(--border-w) solid var(--border); color: var(--text-primary); }
.lesson-body pre { background: var(--bg-surface); border: var(--border-w) solid var(--border); border-radius: var(--radius-md); padding: 18px 20px; overflow-x: auto; font-size: var(--fs-code); line-height: var(--lh-code); color: var(--text-primary); }
.lesson-body pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.lesson-body blockquote { margin: 0; padding: 14px 18px; border-left: 3px solid var(--brand); background: var(--bg-surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.lesson-body .intro-text, .lesson-body .objectives {
  background: var(--bg-surface); border: var(--border-w) solid var(--border); border-radius: var(--radius-lg); padding: 22px 24px; position: relative; overflow: hidden;
}
.lesson-body .intro-text::before, .lesson-body .objectives::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--line); }
.lesson-body .intro-text > strong:first-child { display: block; font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-text); font-weight: 500; margin-bottom: 8px; }
.lesson-body .example-box, .lesson-body .info-box, .lesson-body .note, .lesson-body .tip, .lesson-body .key-point, .lesson-body .definition-box {
  background: var(--bg-surface); border: var(--border-w) solid var(--border); border-radius: var(--radius-md); padding: 16px 20px;
}

/* Quick check (quiz) */
.quick-check { margin-top: 64px; }
.quick-check__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.quick-check__head h2 { font-size: 28px; line-height: 34px; }
.qc-question { background: var(--bg-surface); border: var(--border-w) solid var(--border); border-radius: var(--radius-lg); padding: 24px; }
.qc-question + .qc-question { margin-top: 16px; }
.qc-question__n { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-text); margin-bottom: 8px; }
.qc-question__text { color: var(--text-primary); font-size: 19px; line-height: 27px; font-weight: 500; margin-bottom: 16px; }
.qc-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .qc-options { grid-template-columns: 1fr; } }
.qc-option { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius-md); border: var(--border-w) solid var(--border); background: var(--bg-canvas); color: var(--text-body); cursor: pointer; transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); }
.qc-option:hover { border-color: var(--text-secondary); }
.qc-option input { position: absolute; opacity: 0; pointer-events: none; }
.qc-option__key { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--bg-raised); border: var(--border-w) solid var(--border); font-family: var(--font-mono); font-size: 13px; color: var(--text-secondary); }
.qc-option__text { font-size: 15px; line-height: 22px; }
.qc-option.is-selected, .qc-option:has(input:checked) { border-color: var(--text-primary); color: var(--text-primary); }
.qc-option.is-selected .qc-option__key, .qc-option:has(input:checked) .qc-option__key { background: var(--text-primary); color: var(--bg-canvas); border-color: var(--text-primary); }
.qc-option:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.qc-option.option-correct, .qc-option.option-correct:has(input:checked) { border: 2px solid var(--success); background: var(--success-soft); color: var(--text-primary); }
.qc-option.option-correct .qc-option__key, .qc-option.option-correct:has(input:checked) .qc-option__key { background: var(--success); color: #0A0A0F; border-color: var(--success); }
.qc-option.option-wrong, .qc-option.option-wrong:has(input:checked) { border: 2px solid var(--danger); background: var(--danger-soft); }
.qc-option.option-wrong .qc-option__key, .qc-option.option-wrong:has(input:checked) .qc-option__key { background: var(--danger); color: #0A0A0F; border-color: var(--danger); }
.qc-option input:disabled ~ * { cursor: default; }
.qc-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 24px; flex-wrap: wrap; }
.qc-result { display: flex; align-items: center; gap: 18px; margin-top: 24px; padding: 20px 22px; border-radius: var(--radius-lg); border: var(--border-w) solid var(--border); background: var(--bg-surface); position: relative; overflow: hidden; }
.qc-result::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--success); }
.qc-result.is-partial::before { background: var(--warning); }
.qc-result h3 { font-size: 20px; line-height: 26px; }
.qc-result p { font-size: 15px; margin-top: 4px; }
.qc-result .chip { margin-left: auto; }

.lesson-next { display: flex; justify-content: space-between; gap: 16px; margin-top: 48px; padding-top: 24px; border-top: var(--border-w) solid var(--border); flex-wrap: wrap; }

/* Unit index pages (paper 1, paper 2, ESP, OSP) */
.unit-group + .unit-group { margin-top: 40px; }
.unit-group__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.unit-group__head .overline { color: var(--text-primary); }
.unit-group__head::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.topic-row { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-radius: var(--radius-md); border: var(--border-w) solid var(--border); background: var(--bg-surface); color: var(--text-body); text-decoration: none !important; transition: border-color var(--dur-fast) var(--ease); }
.topic-row + .topic-row { margin-top: 8px; }
.topic-row:hover { border-color: var(--text-secondary); color: var(--text-primary); }
.topic-row__code { font-family: var(--font-mono); font-size: 13px; color: var(--text-secondary); min-width: 44px; }
.topic-row__title { color: var(--text-primary); font-weight: 500; }
.topic-row__state { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); }
.topic-row.is-done .topic-row__state { color: var(--success); }

/* ==========================================================================
   Auth & onboarding
   ========================================================================== */
.auth { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }
.auth__brand { position: relative; overflow: hidden; background: var(--ember-gradient); color: #0A0A0F; padding: 40px 56px; display: flex; flex-direction: column; }
[data-theme="contrast"] .auth__brand { background: #000; color: #fff; border-right: 2px solid #fff; }
.auth__brand .wordmark { color: #0A0A0F; height: 24px; }
[data-theme="contrast"] .auth__brand .wordmark { color: #fff; }
.auth__lines { position: absolute; inset: 0; pointer-events: none; }
.auth__lines svg { width: 100%; height: 100%; }
.auth__brand-copy { position: relative; margin-top: auto; }
.auth__brand h2 { color: inherit; font-size: 64px; line-height: 64px; letter-spacing: -0.045em; max-width: 520px; }
.auth__brand p { margin-top: 16px; font-size: 17px; max-width: 420px; opacity: .85; }
.auth__ticks { list-style: none; padding: 0; margin: 48px 0 0; display: flex; flex-direction: column; gap: 10px; font-size: 15px; font-weight: 500; }
.auth__ticks li { display: flex; align-items: center; gap: 10px; }
.auth__ticks li::before { content: ""; width: 20px; height: 20px; border-radius: 50%; background: #0A0A0F url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath d='M12 25L20 33L36 16' fill='none' stroke='%23FFB15C' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; }
.auth__byte { position: absolute; right: 48px; bottom: 32px; }
.auth__panel { display: flex; align-items: center; justify-content: center; padding: 48px 24px; background: var(--bg-canvas); }
.auth__form { width: 100%; max-width: 380px; }
.auth__form h1 { font-size: 40px; line-height: 46px; letter-spacing: -0.035em; }
.auth__form .auth-sub { margin-top: 10px; color: var(--text-body); }
.auth__form form { margin-top: 28px; }
.auth__alt { margin-top: 24px; text-align: center; color: var(--text-body); font-size: var(--fs-small); }
.auth__fine { margin-top: 28px; text-align: center; font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; padding: 12px 20px; border-radius: var(--radius-sm); border: var(--border-w) solid var(--border); background: var(--bg-surface); color: var(--text-primary); font-weight: 500; font-size: var(--fs-button); }
.google-btn:hover { border-color: var(--text-secondary); }
.google-btn img, .google-btn svg { width: 18px; height: 18px; }
.form-message { margin-top: 16px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; line-height: 20px; border: var(--border-w) solid var(--border); background: var(--bg-surface); }
.form-message.is-error { border-color: color-mix(in srgb, var(--danger) 50%, transparent); color: var(--danger); background: var(--danger-soft); }
.form-message.is-success { border-color: color-mix(in srgb, var(--success) 50%, transparent); color: var(--success); background: var(--success-soft); }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth__brand { min-height: 260px; padding: 28px 24px; }
  .auth__brand h2 { font-size: 40px; line-height: 42px; }
  .auth__ticks, .auth__byte { display: none; }
}

.onboard { min-height: 100vh; position: relative; }
.onboard::before { content: ""; position: absolute; inset: 0 0 auto; height: 420px; background: radial-gradient(60% 100% at 50% 0%, rgba(255,106,26,.16), transparent 70%); pointer-events: none; }
.onboard__top { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 28px 40px; }
.onboard__steps { display: flex; align-items: flex-start; }
.onboard__step { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 84px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); position: relative; }
.onboard__step::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--line); position: relative; z-index: 1; }
.onboard__step + .onboard__step::after { content: ""; position: absolute; top: 5px; right: 50%; width: 100%; height: 4px; background: var(--line); }
.onboard__step.is-todo::before { background: var(--bg-canvas); border: 3px solid var(--stop-locked); }
.onboard__step.is-todo::after { background: var(--line-track); }
.onboard__step.is-current { color: var(--text-primary); }
.onboard__step.is-current::before { width: 20px; height: 20px; margin-top: -3px; background: var(--bg-canvas); border: 5px solid var(--ring); }
.onboard__body { position: relative; max-width: 880px; margin: 0 auto; padding: 24px 24px 64px; }
.onboard__body h1 { margin-top: 12px; font-size: 52px; line-height: 56px; letter-spacing: -0.04em; }
.onboard__body .lede { margin-top: 12px; font-size: 17px; }
.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 32px; }
.choice-grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) { .choice-grid, .choice-grid--3 { grid-template-columns: 1fr; } .onboard__body h1 { font-size: 36px; line-height: 40px; } .onboard__top { padding: 20px; } }
.choice {
  position: relative; text-align: left; padding: 22px 22px; border-radius: var(--radius-md); background: var(--bg-surface);
  border: var(--border-w) solid var(--border); color: var(--text-body); transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.choice:hover { border-color: var(--text-secondary); }
.choice h3 { font-size: 24px; line-height: 30px; }
.choice .overline { display: block; margin: 6px 0 10px; }
.choice p { font-size: 14px; }
.choice[aria-pressed="true"], .choice.selected { border: 2px solid var(--brand); background: var(--brand-soft); padding: 21px; }
.choice[aria-pressed="true"] .overline, .choice.selected .overline { color: var(--brand-text); }
.choice[aria-pressed="true"]::after, .choice.selected::after { content: ""; position: absolute; top: 18px; right: 18px; width: 24px; height: 24px; border-radius: 50%; background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath d='M12 25L20 33L36 16' fill='none' stroke='%230A0A0F' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat; }
.choice .pips { display: flex; gap: 8px; margin-top: 14px; }
.choice .pips i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--stop-locked); }
.choice .pips i.on { background: var(--text-primary); border-color: var(--text-primary); }
.choice[aria-pressed="true"] .pips i.on { background: var(--brand); border-color: var(--brand); }
.onboard__footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 32px; flex-wrap: wrap; }

/* ==========================================================================
   Utility for page-specific grids
   ========================================================================== */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--gutter); align-items: start; }
.split--wide-rail { grid-template-columns: minmax(0, 1fr) 380px; }
@media (max-width: 1200px) { .split, .split--wide-rail { grid-template-columns: 1fr; } }
.list-rows > * { padding: 14px 0; border-bottom: var(--border-w) solid var(--border); }
.list-rows > *:last-child { border-bottom: 0; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: var(--border-w) solid var(--border); font-size: 15px; }
.kv:last-child { border-bottom: 0; }
.kv b { font-family: var(--font-mono); font-weight: 500; color: var(--brand-text); white-space: nowrap; text-align: right; }

/* Tables (admin, class) */
.table-wrap { overflow-x: auto; border: var(--border-w) solid var(--border); border-radius: var(--radius-md); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; color: var(--text-secondary); padding: 12px 14px; background: var(--bg-surface); border-bottom: var(--border-w) solid var(--border); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: var(--border-w) solid var(--border); color: var(--text-body); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--bg-surface); }

/* Ads — keep them clearly separate from learning content */

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
[data-motion="reduce"] *, [data-motion="reduce"] *::before, [data-motion="reduce"] *::after { animation: none !important; transition: none !important; }

/* ==========================================================================
   Page-specific: flashcards, leaderboard, settings
   ========================================================================== */
.fc-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: var(--gutter); align-items: stretch; }
@media (max-width: 900px) { .fc-layout { grid-template-columns: 1fr; } }
.fc-card { min-height: 280px; cursor: pointer; max-width: 720px; }
.fc-card hr { margin: 20px 0; }
.fc-rate { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 720px; }
@media (max-width: 640px) { .fc-rate { grid-template-columns: repeat(2, 1fr); } }
.fc-rate button { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 14px 16px; border-radius: var(--radius-md); background: var(--bg-surface); border: var(--border-w) solid var(--border); border-top: 3px solid var(--c); color: var(--text-primary); }
.fc-rate button:hover { background: var(--bg-raised); }
.fc-rate b { font-weight: 600; font-size: 17px; }
.fc-rate kbd { font-size: 11px; padding: 1px 6px; border-radius: 5px; border: var(--border-w) solid var(--border); color: var(--text-secondary); }
.fc-rate [data-when] { color: var(--c); }
#fc-stats .stat-tile { min-width: 110px; }

.podium-wrap { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: end; padding: 32px 32px 0; min-height: 320px; }
.podium { display: flex; flex-direction: column; align-items: center; text-align: center; color: inherit; text-decoration: none !important; }
.podium__block { width: 100%; max-width: 150px; height: var(--h, 120px); margin-top: 14px; border-radius: 14px 14px 0 0; background: var(--bg-raised); border: var(--border-w) solid var(--border); border-bottom: 0; border-top: 3px solid var(--line); display: grid; place-items: center; }
.podium__block span { font-family: var(--font-sans); font-size: 44px; font-weight: 600; color: var(--text-secondary); }
.podium:nth-child(2) .podium__block span { color: var(--brand-text); font-size: 56px; }
.lb-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: var(--radius-sm); color: var(--text-body); text-decoration: none !important; border: var(--border-w) solid transparent; }
.lb-row:hover { background: var(--bg-raised); }
.lb-row.is-me { border-color: var(--brand); background: var(--brand-soft); }
@media (max-width: 640px) { .lb-row .chip { display: none; } .podium-wrap { padding: 20px 12px 0; gap: 8px; } }

.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--gutter); }
@media (max-width: 900px) { .settings-layout { grid-template-columns: 1fr; } .settings-layout > nav { position: static !important; display: flex; overflow-x: auto; } }
.theme-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 180px)); gap: 16px; }
.theme-choice { cursor: pointer; color: var(--text-primary); font-size: 15px; }
.theme-choice input { position: absolute; opacity: 0; }
.theme-choice__preview { position: relative; display: block; height: 96px; border-radius: var(--radius-md); border: 2px solid var(--border); overflow: hidden; }
.theme-choice__preview i { position: absolute; left: 14%; right: 14%; top: 28%; height: 5px; border-radius: 5px; }
.theme-choice__preview b { position: absolute; left: 14%; width: 30%; bottom: 18%; height: 22px; border-radius: 6px; }
.theme-choice__preview em { position: absolute; left: 18%; width: 16%; bottom: 24%; height: 8px; border-radius: 4px; }
.theme-choice__dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--text-secondary); display: inline-block; }
.theme-choice input:checked + .theme-choice__preview { border-color: var(--brand); }
.theme-choice input:checked ~ span .theme-choice__dot { border: 5px solid var(--brand); }
.theme-choice input:focus-visible + .theme-choice__preview { outline: 2px solid var(--focus); outline-offset: 2px; }
.line-legend i { display: inline-block; }

/* ==========================================================================
   Accessibility preferences (set by theme.js) and the display panel
   ========================================================================== */
html[data-text="lg"] body { zoom: 1.125; }
html[data-text="xl"] body { zoom: 1.25; }
html[data-spacing="wide"] body { letter-spacing: 0.03em; word-spacing: 0.12em; }
html[data-spacing="wide"] p, html[data-spacing="wide"] li, html[data-spacing="wide"] .lesson-body, html[data-spacing="wide"] .prose { line-height: 1.9 !important; }
html[data-spacing="wide"] .lesson-body p, html[data-spacing="wide"] .prose p { margin-bottom: 1.2em; }
html[data-links="underline"] a:not(.btn):not(.nav-item):not(.brand-link):not(.card-link):not(.topic-row):not(.lb-row):not(.avatar):not(.mobile-bar a):not(.podium) { text-decoration: underline !important; text-underline-offset: 3px; }
html[data-focus="strong"] :focus-visible, html[data-focus="strong"] :focus { outline: 4px solid var(--focus) !important; outline-offset: 3px !important; box-shadow: 0 0 0 8px color-mix(in srgb, var(--focus) 25%, transparent) !important; }
html[data-motion="reduce"] { scroll-behavior: auto; }

.reading-guide { position: fixed; left: 0; right: 0; top: 0; height: 44px; z-index: 2500; pointer-events: none; background: color-mix(in srgb, var(--warning) 14%, transparent); border-top: 2px solid color-mix(in srgb, var(--warning) 55%, transparent); border-bottom: 2px solid color-mix(in srgb, var(--warning) 55%, transparent); }

.speak-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; margin-left: 10px; vertical-align: middle; border-radius: 8px; border: var(--border-w) solid var(--border); background: var(--bg-raised); color: var(--text-primary); }
.speak-btn:hover { border-color: var(--text-secondary); }
[data-speak][aria-pressed="true"] { border-color: var(--brand); color: var(--brand-text); }

.a11y-panel {
  position: fixed; top: 80px; right: 24px; z-index: 2200; width: 380px; max-width: calc(100vw - 24px); max-height: calc(100vh - 100px); overflow: auto;
  background: var(--bg-surface); border: var(--border-w) solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-pop); color: var(--text-body);
}
@media (max-width: 640px) { .a11y-panel { left: 12px; right: 12px; top: auto; bottom: 12px; width: auto; max-height: 80vh; } }
.a11y-panel__head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 14px 20px; background: var(--bg-surface); border-bottom: var(--border-w) solid var(--border); }
.a11y-panel__head h2 { font-size: 17px; line-height: 24px; letter-spacing: -0.01em; }
.a11y-panel__body { padding: 16px 20px 20px; }
.a11y-panel__body .overline { margin-bottom: 10px; }
.a11y-panel__note { margin-top: 12px; font-size: 12px; line-height: 18px; color: var(--text-secondary); }
.a11y-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: var(--border-w) solid var(--border); }
.a11y-row__label { color: var(--text-primary); font-weight: 500; font-size: 15px; }
.a11y-row__help { color: var(--text-secondary); font-size: 13px; line-height: 18px; margin-top: 2px; }
.a11y-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: var(--radius-sm); background: var(--bg-raised); border: var(--border-w) solid var(--border); margin-bottom: 6px; }
.a11y-seg label { position: relative; cursor: pointer; }
.a11y-seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.a11y-seg span { display: block; text-align: center; padding: 8px 6px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--text-body); }
.a11y-seg input:checked + span { background: var(--bg-surface); color: var(--text-primary); box-shadow: inset 0 0 0 var(--border-w) var(--border-strong); }
.a11y-seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }

.auth-tools { position: fixed; top: 16px; right: 16px; z-index: 150; display: flex; gap: 8px; }
.auth-tools .theme-btn { background: var(--bg-surface); }

/* Closed modals must never catch clicks (fixes pages where nothing could be clicked) */
.modal-overlay:not(.is-open):not(.visible) { pointer-events: none; }
.modal-overlay[id]:not(.is-open):not(.visible) { display: none; }
.modal-overlay.visible { opacity: 1; }
.modal-overlay.visible .modal-content { transform: scale(1); }

/* Accent colour picker (display panel + settings) */
.accent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 8px; margin-bottom: 6px; }
.accent-swatch { position: relative; display: block; aspect-ratio: 1; cursor: pointer; }
.accent-swatch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.accent-swatch span { position: absolute; inset: 0; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 2px rgba(0,0,0,.25); transition: transform var(--dur) var(--ease); }
html[data-theme="light"] .accent-swatch span { background: var(--sw-light); }
.accent-swatch input:checked + span, .accent-swatch.is-on span { box-shadow: 0 0 0 2px var(--bg-surface), 0 0 0 4px var(--text-primary); }
.accent-swatch input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 4px; }
.accent-swatch:hover span { transform: scale(1.08); }
.accent-swatch.is-locked span { opacity: .35; }
.accent-swatch.is-locked span::after { content: ""; position: absolute; inset: 30%; background: var(--text-primary); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='black' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='10' y='22' width='28' height='20' rx='4'/%3E%3Cpath d='M16 22v-6a8 8 0 0 1 16 0v6'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48' fill='none' stroke='black' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='10' y='22' width='28' height='20' rx='4'/%3E%3Cpath d='M16 22v-6a8 8 0 0 1 16 0v6'/%3E%3C/svg%3E") center/contain no-repeat; }
.accent-swatch.is-locked input { cursor: not-allowed; }
.accent-swatch--custom span { background: conic-gradient(#FF6A1A, #FFC233, #2FD49A, #3B9EFF, #9B7BFF, #FF5C8A, #FF6A1A) !important; }
.accent-swatch--custom input { cursor: pointer; }

/* ==========================================================================
   Widget dashboard
   ========================================================================== */
.dash-head { margin-bottom: 16px; gap: 12px; }
.widget-grid { --cols: 4; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-auto-rows: 168px; grid-auto-flow: dense; gap: 16px; }
.widget { position: relative; grid-column: span min(var(--c), var(--cols)); grid-row: span var(--rfit, var(--r)); min-width: 0;
  background: var(--bg-surface); border: var(--border-w) solid var(--border); border-radius: var(--radius-lg); padding: 18px; overflow: hidden; }
.widget__body { display: flex; flex-direction: column; min-height: 100%; }
.widget__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; min-height: 24px; }
.widget__head .overline { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.widget__title { font-size: 17px; line-height: 23px; font-weight: 600; color: var(--text-primary); letter-spacing: -0.01em; }
.widget__title--clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.widget__big { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 2px 0 10px; color: var(--text-secondary); font-size: 14px; }
.widget__num { font-size: 40px; line-height: 44px; font-weight: 600; letter-spacing: -0.03em; color: var(--text-primary); }
.widget__cta { margin-top: auto; align-self: flex-start; max-width: 100%; }
.widget--s .widget__num { font-size: 34px; line-height: 38px; }
.widget--line { padding: 18px 18px 14px; }
.widget--line .widget__head { flex-wrap: wrap; }
.widget--line .line-map { min-height: 260px; }
.tabs--sm .tab { padding: 6px 12px; font-size: 14px; }
.week-dots { display: flex; gap: 6px; margin-top: 12px; }
.week-dots span { flex: 1; max-width: 32px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-mono); font-size: 12px; border: var(--border-w) solid var(--border); color: var(--text-secondary); }
.week-dots span.is-on { background: var(--line); border-color: var(--line); color: var(--brand-on); }
.week-dots span.is-today { outline: 2px solid var(--ring); outline-offset: 2px; }
.topic-row--compact { padding: 10px 12px; gap: 12px; margin-top: 6px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand-text); font: inherit; cursor: pointer; text-align: left; }
.link-btn:hover { text-decoration: underline; }

/* Edit mode */
.widget__tools { position: absolute; top: 8px; right: 8px; z-index: 3; display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 999px;
  background: var(--bg-raised); border: var(--border-w) solid var(--border); box-shadow: var(--shadow-pop); }
.widget__tools button { display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 999px; border: 0; background: none; color: var(--text-primary); font: 500 12px/1 var(--font-mono); cursor: pointer; }
.widget__tools button:hover { background: var(--bg-surface); }
.widget__tools [data-remove] { color: var(--danger); }
.widget__sizes { display: flex; gap: 2px; padding: 0 4px; border-left: var(--border-w) solid var(--border); border-right: var(--border-w) solid var(--border); }
.widget__sizes [aria-pressed="true"] { background: var(--brand); color: var(--brand-on); }
.widget__drag { cursor: grab; touch-action: none; }
.is-editing .widget:not(.widget--add) { outline: 2px dashed var(--border-strong); outline-offset: 2px; }
.is-editing .widget__body { animation: widget-wiggle .3s ease-in-out infinite alternate; }
.is-editing .widget:nth-child(2n) .widget__body { animation-delay: -.15s; }
.is-editing .widget:hover .widget__body, .is-editing .widget:focus-within .widget__body { animation-play-state: paused; }
.is-editing .widget__body { pointer-events: none; user-select: none; opacity: .85; }
.widget.is-dragging { opacity: .5; }
.widget.is-drop { outline: 2px solid var(--brand) !important; }
@keyframes widget-wiggle { from { transform: rotate(-.25deg); } to { transform: rotate(.25deg); } }
html[data-motion="reduce"] .is-editing .widget__body { animation: none; }
@media (prefers-reduced-motion: reduce) { .is-editing .widget__body { animation: none; } }
.widget--add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border-style: dashed; color: var(--text-secondary); cursor: pointer; font: inherit; }
.widget--add:hover { color: var(--text-primary); border-color: var(--text-secondary); }
.widget-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; max-height: 60vh; overflow: auto; margin: 12px 0; }
.widget-pick { border: var(--border-w) solid var(--border); border-radius: var(--radius-md); padding: 14px; background: var(--bg-raised); }
.widget-pick.is-locked { opacity: .6; }

@media (max-width: 1200px) { .widget-grid { --cols: 4; grid-auto-rows: 160px; } }
@media (max-width: 900px) { .widget-grid { --cols: 2; } }
@media (max-width: 640px) {
  .widget-grid { --cols: 2; gap: 12px; grid-auto-rows: 150px; }
  .widget { padding: 14px; border-radius: var(--radius-md); }
  .widget__num, .widget--s .widget__num { font-size: 30px; line-height: 34px; }
  .widget--s .widget__head .icon { display: none; }
  .widget__tools { left: 6px; right: 6px; top: auto; bottom: 6px; justify-content: space-between; }
}

/* ==========================================================================
   Byte (drawn by js/byte.js)
   ========================================================================== */
.byte-svg { display: block; image-rendering: pixelated; }
.byte-lid { opacity: 0; animation: byte-blink 4s steps(1) infinite; }
@keyframes byte-blink { 0%, 95% { opacity: 0; } 96%, 99% { opacity: 1; } }
html[data-motion="reduce"] .byte-lid { animation: none; }
.byte-tile { display: grid; place-items: end center; border-radius: var(--radius-md); overflow: hidden; padding: 10px 10px 0; background: var(--bg-raised); flex: none; }
.byte-bg--none { background: var(--bg-raised); }
.byte-bg--glow { background: radial-gradient(circle at 50% 70%, rgba(255, 106, 26, .35), transparent 65%), var(--bg-raised); }
.byte-bg--grid { background: linear-gradient(rgba(90, 169, 255, .18) 1px, transparent 1px) 0 0/12px 12px, linear-gradient(90deg, rgba(90, 169, 255, .18) 1px, transparent 1px) 0 0/12px 12px, #0F1B33; }
.byte-bg--night { background: radial-gradient(1.5px 1.5px at 20% 30%, #fff, transparent), radial-gradient(1px 1px at 70% 20%, #fff, transparent), radial-gradient(1.5px 1.5px at 85% 55%, #fff, transparent), radial-gradient(1px 1px at 40% 60%, #fff, transparent), linear-gradient(180deg, #0B1026, #1B1F4A); }
.byte-bg--sunset { background: linear-gradient(180deg, #FFB15C 0%, #FF6A1A 45%, #C2185B 100%); }
.byte-bg--aurora { background: radial-gradient(ellipse at 30% 20%, rgba(47, 212, 154, .6), transparent 55%), radial-gradient(ellipse at 75% 35%, rgba(155, 123, 255, .6), transparent 55%), #0A1020; }
.byte-widget { display: flex; align-items: stretch; gap: 16px; height: 100%; }
.byte-widget--s { justify-content: center; }
.byte-widget--s .byte-tile { width: 100%; }
.byte-widget--l { flex-direction: column; }
.byte-widget--l .byte-tile { place-items: end center; }
.byte-widget__talk { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; min-width: 0; flex: 1; }
.byte-widget__talk .btn { align-self: flex-start; }
.avatar--byte { padding: 0; overflow: hidden; display: inline-grid; place-items: center; }
.avatar--byte .byte-svg { width: 100%; height: 100%; }
.avatar-btn { background: none; border: 0; padding: 0; border-radius: 50%; cursor: pointer; }
.avatar-btn .avatar { width: 36px; height: 36px; font-size: 15px; }

/* Account menu */
.popover--menu { width: 280px; }
.menu-list { padding: 6px; display: flex; flex-direction: column; }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); color: var(--text-primary); text-decoration: none; background: none; border: 0; font: inherit; font-size: 15px; text-align: left; cursor: pointer; width: 100%; }
.menu-item:hover, .menu-item:focus-visible { background: var(--bg-raised); }
.menu-item .icon { color: var(--text-secondary); }
.menu-item--danger, .menu-item--danger .icon { color: var(--danger); }

/* Classes: student rows + progress detail */
.class-row { padding: 12px 0; border-bottom: var(--border-w) solid var(--border); flex-wrap: wrap; row-gap: 8px; }
.class-row__name { width: 150px; min-width: 0; }
.class-row__name .link-btn { color: var(--text-primary); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; display: block; }
.class-row__bar { flex: 1; min-width: 120px; }
@media (max-width: 640px) { .class-row__name { width: auto; flex: 1; } .class-row__bar { flex-basis: 100%; order: 5; } }
.mini-bars { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; height: 96px; align-items: end; margin-top: 10px; }
.mini-bar { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.mini-bar span { width: 100%; min-height: 2px; background: var(--line); border-radius: 3px 3px 0 0; }
.mini-bar em { font-style: normal; font-family: var(--font-mono); font-size: 10px; color: var(--text-secondary); }
.unit-detail { border-bottom: var(--border-w) solid var(--border); padding: 8px 0; }
.unit-detail summary { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; cursor: pointer; list-style: none; }
.unit-detail summary::-webkit-details-marker { display: none; }
.unit-detail[open] summary { margin-bottom: 6px; }
.plain-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

/* Mobile top bar: the bell, display panel and account menu live in .mobile-top,
   so the top bar keeps one tidy row of stats. */
.stat-chip { white-space: nowrap; }
@media (max-width: 1024px) {
  .topbar { gap: 14px; margin-bottom: 20px; }
  .topbar__actions { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 8px; }
  .topbar__actions::-webkit-scrollbar { display: none; }
  .topbar__actions [data-a11y-open], .topbar__actions [data-notif-toggle] { display: none; }
  .topbar__actions .icon-btn, .topbar__actions .search-btn { width: 40px; height: 40px; flex: none; padding: 0; justify-content: center; }
  .topbar__actions .stat-chip { padding: 8px 12px; font-size: 13px; }
  .mobile-top .icon-btn { width: 38px; height: 38px; }
}

/* Rewards */
.rw-hero { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; }
.rw-hero .byte-tile { width: 200px; height: 220px; }
.rw-options { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; max-width: 520px; }
.rw-option { padding: 10px 0; border-top: var(--border-w) solid var(--border); gap: 16px; }
@media (max-width: 640px) { .rw-hero { grid-template-columns: 1fr; justify-items: center; text-align: left; } .rw-hero > .stack { width: 100%; } }
.rw-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.rw-item { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 10px; border-radius: var(--radius-md); border: var(--border-w) solid var(--border); background: var(--bg-surface); color: var(--text-primary); cursor: pointer; font: inherit; text-align: left; }
.rw-item:hover { border-color: var(--text-secondary); }
.rw-item.is-on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.rw-item.is-locked { cursor: not-allowed; opacity: .55; }
.rw-item__art { height: 96px; place-items: center; padding: 6px; }
.rw-item__name { font-weight: 500; font-size: 14px; }
.rw-item__meta { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary); }
.rw-line { list-style: none; margin: 18px 0 0; padding: 0; position: relative; }
.rw-line::before { content: ""; position: absolute; left: 11px; top: 12px; bottom: 12px; width: 6px; border-radius: 6px; background: var(--line-track); }
.rw-stop { position: relative; display: grid; grid-template-columns: 28px 1fr; gap: 14px; padding: 10px 0; }
.rw-stop__dot { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; background: var(--bg-surface); border: 6px solid var(--stop-locked, var(--border-strong)); margin-top: 2px; }
.rw-stop--done .rw-stop__dot { border-color: var(--line); background: var(--line); }
.rw-stop--done::before { content: ""; position: absolute; left: 11px; top: -12px; bottom: -12px; width: 6px; background: var(--line); }
.rw-stop--you .rw-stop__dot { border-color: var(--ring); box-shadow: 0 0 0 6px color-mix(in srgb, var(--ring) 20%, transparent); }
.rw-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.rw-chips .chip .icon { width: 14px; height: 14px; }

/* Schools: partner card */
.partner-card { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.partner-list { gap: 14px; }
.partner-list li { display: flex; gap: 12px; align-items: center; color: var(--text-primary); }
@media (max-width: 900px) { .partner-card { grid-template-columns: 1fr; gap: 24px; } }

/* Network list: every T Level */
.network-item { align-items: start; }
.network-tlevels { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.network-tlevels li { font-size: 13px; line-height: 19px; color: var(--text-body); }
.network-tlevels a { color: var(--text-body); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.network-tlevels a:hover { color: var(--text-primary); }
.network-note { font-size: 12px; color: var(--text-secondary); font-style: italic; }
.network-item__lines { margin-top: 8px; }
@media (max-width: 640px) { .network-item { grid-template-columns: 1fr auto; } .network-item__lines { display: none; } }

/* Admin */
.admin-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.admin-filters .input { width: auto; min-width: 150px; flex: 0 1 auto; }
.admin-filters input[type="search"] { flex: 1 1 240px; }
.input--sm { padding: 6px 10px; font-size: 13px; width: auto; }
.table-wrap { overflow-x: auto; border: var(--border-w) solid var(--border); border-radius: var(--radius-md); }
.admin-table { width: 100%; border-collapse: collapse; min-width: 980px; }
.admin-table th { text-align: left; padding: 10px 12px; font: 500 11px/1.4 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary); background: var(--bg-raised); white-space: nowrap; }
.admin-table th .link-btn { color: inherit; font: inherit; letter-spacing: inherit; }
.admin-table td { padding: 10px 12px; border-top: var(--border-w) solid var(--border); vertical-align: middle; color: var(--text-body); }
.admin-table tr:hover td { background: color-mix(in srgb, var(--bg-raised) 50%, transparent); }
.checkbox--tight { margin: 0; font-size: 13px; }
.admin-bars { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; align-items: end; margin-top: 14px; }
.admin-bar { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
.admin-bar__b { width: 100%; min-height: 2px; background: var(--line); border-radius: 4px 4px 0 0; }
.admin-bar__v { font: 500 10px var(--font-mono); color: var(--text-secondary); }
.admin-bar em { font-style: normal; font: 10px var(--font-mono); color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.admin-item { padding: 18px 20px; }

/* Mobile layout fixes */
@media (max-width: 900px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-layout > nav { flex-direction: row; scrollbar-width: none; }
  .settings-layout > nav .nav-item { white-space: nowrap; flex: none; }
  .settings-layout > nav::-webkit-scrollbar { display: none; }
}
.person-row { padding: 14px 0; border-bottom: var(--border-w) solid var(--border); flex-wrap: wrap; row-gap: 10px; }
.person-row__actions { gap: 6px; }
@media (max-width: 640px) { .person-row__actions { flex-basis: 100%; padding-left: 54px; } .person-row__actions:empty { display: none; } }
.lesson-body table { display: block; max-width: 100%; overflow-x: auto; }
.lesson-body pre { max-width: 100%; overflow-x: auto; }
.lesson-body img { max-width: 100%; height: auto; }
.avatar-link { flex: none; border-radius: 50%; }
.faq-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 900px) {
  .faq-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .faq-layout > nav { position: static !important; display: flex; flex-direction: row; overflow-x: auto; scrollbar-width: none; gap: 6px; }
  .faq-layout > nav::-webkit-scrollbar { display: none; }
  .faq-layout > nav .nav-item { white-space: nowrap; flex: none; }
}
.row.wrap { flex-wrap: wrap; }
.faq-layout > nav .nav-item, .settings-layout > nav .nav-item { width: auto; }
@media (max-width: 480px) {
  .focus-bar [data-lesson-xp] { display: none; }
  .focus-bar__back { white-space: nowrap; }
}
body.no-select { user-select: none; -webkit-user-select: none; }
@media (max-width: 1024px) { .toast-region { bottom: calc(84px + env(safe-area-inset-bottom)) !important; } }
/* Narrow phones: grids must never be wider than the screen. */
@media (max-width: 1200px) { .split, .split--wide-rail { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) { .fc-layout { grid-template-columns: minmax(0, 1fr); } .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }
.split > *, .fc-layout > *, .stack > * { min-width: 0; }
@media (max-width: 420px) {
  .podium-wrap { padding: 20px 8px 0; gap: 6px; }
  .podium__block span { font-size: 34px; }
  .podium:nth-child(2) .podium__block span { font-size: 42px; }
  .lb-row { gap: 10px; padding: 10px; }
}

/* Auth pages on phones/tablets: keep the decorative lines away from the words. */
@media (max-width: 900px) {
  .auth__lines { opacity: .28; }
  .auth__brand h2 { position: relative; }
}
/* Onboarding top row: wrap instead of pushing Sign out off-screen. */
@media (max-width: 640px) {
  .onboard__top { flex-wrap: wrap; gap: 12px; padding: 16px 20px; }
  .onboard__top > .row { margin-left: auto; }
}
#fc-stats { flex-wrap: wrap; }
@media (max-width: 420px) { #fc-stats .stat-tile { min-width: 0; flex: 1 1 90px; padding: 12px; } }

/* Dashboard v2: 3-column grid matching the classic My line layout */
.widget-grid { --cols: 3; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-auto-rows: minmax(120px, auto); gap: var(--gutter); }
.widget { grid-row: span var(--r); padding: var(--space-6); }
.widget__body { min-height: 0; height: 100%; }
.widget--line { padding: 20px 20px 24px; }
.widget__head--line { flex-wrap: wrap; gap: 12px; margin-bottom: 4px; }
.widget--line .line-map { min-height: 360px; }
.widget.card--accent::before { z-index: 1; }
.widget.card--glow::after { border-radius: inherit; }
.widget__quote { font-size: 17px; line-height: 25px; color: var(--text-primary); }
.mini-bars--7 { grid-template-columns: repeat(7, 1fr); height: 88px; }
.module-progress { display: block; padding: 8px 0; color: inherit; text-decoration: none !important; }
.module-progress:hover .text-primary { color: var(--brand-text); }
.shortcut-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.shortcut-grid--m { grid-template-columns: repeat(6, 1fr); }
.shortcut { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: var(--radius-sm); background: var(--bg-raised); border: var(--border-w) solid var(--border); color: var(--text-primary); font-size: 12px; text-decoration: none !important; text-align: center; }
.shortcut:hover { border-color: var(--text-secondary); }
.shortcut .icon { color: var(--brand-text); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); flex: none; margin-top: 6px; }
.dot--on { background: var(--brand); }
@media (max-width: 1200px) { .widget-grid { --cols: 2; } }
@media (max-width: 640px) {
  .widget-grid { --cols: 2; gap: 12px; grid-auto-rows: minmax(100px, auto); }
  .widget { padding: 16px; }
  .widget--phone-full, .widget--m, .widget--l, .widget--xl { grid-column: 1 / -1; }
  .widget--line .line-map { min-height: 280px; }
  .shortcut-grid--m { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1025px) { .dash-head { margin-top: -58px; margin-bottom: 24px; min-height: 34px; } }
.widget--line .chip { white-space: normal; height: auto; line-height: 18px; padding-top: 6px; padding-bottom: 6px; }
.college-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 40px; align-items: center; }
@media (max-width: 900px) { .college-card { grid-template-columns: minmax(0, 1fr); gap: 24px; } }
@media (max-width: 480px) { .college-row .chip { display: none; } .college-card { padding: 22px; } }

/* Team as a line (about + our team) */
.team-wrap { display: flex; }
.team-line { --dot: 60px; --gap: 22px; display: flex; flex-direction: column; }
.team-group { position: relative; --c: #FF6A1A; --dotbg: linear-gradient(135deg, #FF8A3D, #FF3D2E); }
.team-group--crew { --c: #F5B26B; --dotbg: #F5B26B; }
.team-label { padding-left: calc(var(--dot) + 30px); margin-bottom: 10px; color: var(--c) !important; font-size: 15px !important; letter-spacing: .14em; font-weight: 600; }
.team-stops { list-style: none; margin: 0; padding: 0; position: relative; display: flex; flex-direction: column; gap: var(--gap); }
.team-stops::before { content: ""; position: absolute; left: calc(var(--dot) / 2 - 5px); top: calc(var(--dot) / 2); bottom: calc(var(--dot) / 2); width: 10px; background: repeating-linear-gradient(180deg, var(--c) 0 14px, transparent 14px 22px); }
.team-group:not(:last-child) .team-stops::before { bottom: calc(var(--dot) / -2 - 30px); }
.team-group--crew .team-stops::before { top: calc(var(--dot) / -2 - 46px); }
.team-stop { position: relative; display: grid; grid-template-columns: var(--dot) 1fr; gap: 30px; align-items: center; }
.team-stop__dot { position: relative; z-index: 1; width: var(--dot); height: var(--dot); border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: calc(var(--dot) / 3); color: #0A0A0F; background: var(--dotbg); }
.team-stop__name { font-size: 30px; line-height: 34px; font-weight: 600; letter-spacing: -0.02em; color: var(--text-primary); }
.team-stop__role { margin-top: 4px; font-size: 17px; color: var(--text-body); }
.team-break { position: relative; height: 44px; margin: 18px 0 14px; }
.team-break__pill { position: absolute; left: calc(var(--dot) / 2 - 28px); top: 8px; z-index: 2; width: 56px; height: 28px; border-radius: 14px; background: var(--bg-canvas); border: 5px solid var(--text-primary); }
@media (max-width: 640px) {
  .team-line { --dot: 48px; --gap: 18px; }
  .team-stop { gap: 16px; }
  .team-label { padding-left: calc(var(--dot) + 16px); }
  .team-stop__name { font-size: 22px; line-height: 27px; }
  .team-stop__role { font-size: 15px; }
}
.story-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 820px) { .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .team-line::before { left: 23px; }
  .team-stop { grid-template-columns: 50px 1fr; gap: 16px; }
  .team-stop__dot { width: 48px; height: 48px; font-size: 16px; }
  .team-label { padding-left: 66px; }
  .team-stop__name { font-size: 22px; line-height: 27px; }
  .team-stop__role { font-size: 15px; }
  .team-break__pill { left: 2px; width: 44px; height: 24px; }
}

/* Sign out + feedback entry points */
.sidebar__signout { margin-top: 8px; width: 100%; justify-content: flex-start; color: var(--text-secondary); }
.sidebar__signout:hover { color: var(--danger); }
.nav-item--quiet { margin-bottom: 12px; color: var(--text-secondary); }
.mobile-menu__link { background: none; border: 0; border-bottom: var(--border-w) solid var(--border); padding: 12px 4px; text-align: left; color: var(--text-primary); font: inherit; font-weight: 500; cursor: pointer; }
.site-actions .signin[data-sign-out] { background: none; border: 0; font: inherit; cursor: pointer; }
@media (max-width: 960px) { .site-actions .signin[data-sign-out] { display: none; } }

/* Themed scrollbars (display panel, menus, popovers, wide tables, the page) */
html { scrollbar-color: var(--border-strong) transparent; }
.a11y-panel, .popover, .popover__body, .widget-gallery, .table-wrap, .modal-content, .sidebar { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.a11y-panel::-webkit-scrollbar, .popover__body::-webkit-scrollbar, .widget-gallery::-webkit-scrollbar, .table-wrap::-webkit-scrollbar, .modal-content::-webkit-scrollbar, .sidebar::-webkit-scrollbar, html::-webkit-scrollbar { width: 10px; height: 10px; }
.a11y-panel::-webkit-scrollbar-track, .popover__body::-webkit-scrollbar-track, .widget-gallery::-webkit-scrollbar-track, .table-wrap::-webkit-scrollbar-track, .modal-content::-webkit-scrollbar-track, .sidebar::-webkit-scrollbar-track, html::-webkit-scrollbar-track { background: transparent; }
.a11y-panel::-webkit-scrollbar-thumb, .popover__body::-webkit-scrollbar-thumb, .widget-gallery::-webkit-scrollbar-thumb, .table-wrap::-webkit-scrollbar-thumb, .modal-content::-webkit-scrollbar-thumb, .sidebar::-webkit-scrollbar-thumb, html::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
.a11y-panel::-webkit-scrollbar-thumb:hover, .popover__body::-webkit-scrollbar-thumb:hover, html::-webkit-scrollbar-thumb:hover { background-color: var(--text-secondary); }
.a11y-panel { overscroll-behavior: contain; }
.byte-bg--matrix { background: repeating-linear-gradient(90deg, rgba(61, 220, 151, .22) 0 2px, transparent 2px 10px), linear-gradient(180deg, #03140C, #072A19); }
.byte-bg--space { background: radial-gradient(1.5px 1.5px at 15% 25%, #fff, transparent), radial-gradient(1px 1px at 60% 15%, #fff, transparent), radial-gradient(2px 2px at 80% 40%, #FFD54A, transparent), radial-gradient(circle at 85% 85%, #6D3FE0 0 14%, transparent 15%), linear-gradient(180deg, #05030F, #120B2E); }
.byte-bg--rainbow { background: linear-gradient(180deg, #FF5C8A, #FFC233 30%, #2FD49A 60%, #3B9EFF 85%, #9B7BFF); }
.byte-bg--goldbg { background: radial-gradient(circle at 50% 30%, #FFF1B8, transparent 60%), linear-gradient(135deg, #FFD54A, #C9971C 60%, #8A6A00); }
