/* studio.css — the "Studio" design system for study.it-learn.io.
   Reference mockups: previews.collabmedia.agency/itlearn-themes/{modern,home}.html
   All text/background pairs below pass WCAG AA (4.5:1) in both modes; re-check
   any new pairing before adding it.

   Mode: <html data-mode="light|dark">, set before paint by js/core/theme.js.
   Without JS, the media query below follows the device setting. */

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --canvas: #ECEEF1;  --bg: #FFFFFF;  --surface: #F7F8FA;  --surface2: #EEF0F3;  --line: #E3E6EA;
  --text: #0E0F11;    --muted: #5C6370;
  --accent: #0E0F11;  --accent-soft: rgba(14,15,17,.07);
  --btn: #0E0F11;     --btn-ink: #FFFFFF;
  --ring: #0E0F11;    --hl: #C8F03C;  --hl-ink: #0E0F11;
  --ok: #147539;      --ok-ink: #FFFFFF;  --ok-soft: rgba(20,117,57,.09);
  --danger: #C0262D;  --danger-ink: #FFFFFF;  --danger-soft: rgba(192,38,45,.07);
  --code: #F4F5F7;    --vid: #D4F65A;   /* video controls sit on a dark frame in both modes */
  /* Extra hues for the network tools only (bits, layers, address classes). */
  --tool-b: #6D28D9;  --tool-c: #92400E;  --tool-d: #0E7490;
  --sh: 0 1px 2px rgba(16,24,40,.05), 0 8px 24px -12px rgba(16,24,40,.10);

  --f-head: 'Funnel Display', system-ui, -apple-system, sans-serif;
  --f-body: 'Funnel Sans', system-ui, -apple-system, sans-serif;
  --f-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r: 18px;  --r-lg: 24px;  --rb: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-mode="light"]) {
    --canvas: #09090A;  --bg: #121214;  --surface: #19191C;  --surface2: #222226;  --line: rgba(255,255,255,.08);
    --text: #F2F2F3;    --muted: #9EA1A8;
    --accent: #D4F65A;  --accent-soft: rgba(212,246,90,.12);
    --btn: #D4F65A;     --btn-ink: #0A0B05;
    --ring: #D4F65A;    --hl: #D4F65A;  --hl-ink: #0A0B05;
    --ok: #4ADE80;      --ok-ink: #052012;  --ok-soft: rgba(74,222,128,.13);
    --danger: #F97066;  --danger-ink: #2A0707;  --danger-soft: rgba(249,112,102,.13);
    --code: #0E0E10;    --sh: none;
    --tool-b: #C4B5FD;  --tool-c: #FBBF24;  --tool-d: #67E8F9;
    color-scheme: dark;
  }
}
:root[data-mode="dark"] {
  --canvas: #09090A;  --bg: #121214;  --surface: #19191C;  --surface2: #222226;  --line: rgba(255,255,255,.08);
  --text: #F2F2F3;    --muted: #9EA1A8;
  --accent: #D4F65A;  --accent-soft: rgba(212,246,90,.12);
  --btn: #D4F65A;     --btn-ink: #0A0B05;
  --ring: #D4F65A;    --hl: #D4F65A;  --hl-ink: #0A0B05;
  --ok: #4ADE80;      --ok-ink: #052012;  --ok-soft: rgba(74,222,128,.13);
  --danger: #F97066;  --danger-ink: #2A0707;  --danger-soft: rgba(249,112,102,.13);
  --code: #0E0E10;    --sh: none;
  --tool-b: #C4B5FD;  --tool-c: #FBBF24;  --tool-d: #67E8F9;
  color-scheme: dark;
}

/* ── Base ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--canvas); color: var(--text);
  font: 15.5px/1.65 var(--f-body);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { font-family: var(--f-head); font-weight: 600; letter-spacing: -.025em; line-height: 1.15; margin: 0; }
p { margin: 0 0 14px; }
a { color: inherit; text-decoration: none; }
img, svg, video { max-width: 100%; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }   /* component display rules must not un-hide */
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.label { font: 700 .7rem/1.4 var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ── App shell ──────────────────────────────────────────────────────────── */
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.app-top { display: flex; align-items: center; gap: 14px; padding: 12px 20px; }
.logo { display: flex; align-items: center; gap: 9px; font: 700 1.02rem var(--f-head); letter-spacing: -.025em; white-space: nowrap; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--btn); color: var(--btn-ink);
  display: grid; place-items: center; font-size: .78rem; font-weight: 800; letter-spacing: -.04em; }
.search-pill { flex: 1; max-width: 460px; margin: 0 auto; display: flex; align-items: center; gap: 9px; padding: 8px 12px;
  border-radius: var(--rb); background: var(--bg); border: 1px solid var(--line); color: var(--muted); font-size: .88rem; cursor: pointer; }
.search-pill kbd { margin-left: auto; font: 600 .7rem var(--f-body); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); }
.avatar { width: 32px; height: 32px; border-radius: 999px; background: var(--surface2); border: 1px solid var(--line);
  display: grid; place-items: center; font-size: .74rem; font-weight: 700; color: var(--muted); }
.app-frame { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 10px; padding: 0 10px 10px; max-width: 1440px; margin: 0 auto; }
.app-side { padding: 6px 8px 20px; display: flex; flex-direction: column; gap: 18px;
  position: sticky; top: 0; align-self: start; max-height: 100vh; overflow-y: auto; scrollbar-width: thin; }
.app-panel { background: var(--bg); border: 1px solid var(--line); border-radius: calc(var(--r) + 4px); box-shadow: var(--sh);
  min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 230px; }
.app-panel--full { grid-template-columns: minmax(0, 1fr); }
.app-content { padding: 30px 44px 50px; min-width: 0; max-width: 820px; }
.app-rail { padding: 30px 22px; border-left: 1px solid var(--line); font-size: .84rem; }

/* ── Panels, cards, tiles ───────────────────────────────────────────────── */
.panel { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.card--raised { background: var(--bg); box-shadow: var(--sh); }
.tile { padding: 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tile--ink { background: var(--btn); color: var(--btn-ink); border-color: transparent; }
.tile--ink .muted { color: inherit; opacity: .78; }
.tile--soft { background: var(--surface2); border-color: transparent; }
.stat { font: 600 2rem/1.1 var(--f-head); letter-spacing: -.035em; }
.bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.bento .span-2 { grid-column: span 2; }

/* ── Buttons, chips, tabs ───────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 650 .88rem var(--f-body);
  padding: 10px 18px; border-radius: var(--rb); border: 0; cursor: pointer; white-space: nowrap;
  background: var(--btn); color: var(--btn-ink); transition: transform .08s, opacity .15s; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn--ghost:hover { background: var(--accent-soft); }
.btn--hl { background: var(--hl); color: var(--hl-ink); }
.btn--sm { padding: 7px 13px; font-size: .84rem; border-radius: 10px; }
.btn--lg { padding: 13px 22px; font-size: .96rem; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; padding: 4px 10px;
  border-radius: 999px; background: var(--surface2); color: var(--muted); white-space: nowrap; }
.chip--hl { background: var(--hl); color: var(--hl-ink); }
.tabs { display: inline-flex; gap: 2px; padding: 4px; border-radius: calc(var(--rb) + 3px); background: var(--surface2); max-width: 100%; overflow-x: auto; }
.tabs a, .tabs button { padding: 7px 14px; border-radius: var(--rb); font: 600 .86rem var(--f-body); color: var(--muted);
  white-space: nowrap; display: flex; gap: 6px; align-items: center; background: none; border: 0; cursor: pointer; }
.tabs small { font-size: .72rem; opacity: .8; }
.tabs [aria-selected="true"], .tabs [aria-current="page"] { background: var(--bg); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
[data-mode="dark"] .tabs [aria-selected="true"], [data-mode="dark"] .tabs [aria-current="page"] { background: var(--surface); box-shadow: none; outline: 1px solid var(--line); }

/* ── Progress ───────────────────────────────────────────────────────────── */
.track { height: 6px; border-radius: 999px; background: var(--surface2); overflow: hidden; }
.track > i { display: block; height: 100%; background: var(--ring); border-radius: inherit; }
.ring { position: relative; width: 46px; height: 46px; flex: 0 0 46px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
.ring .ring-t { fill: none; stroke: var(--surface2); stroke-width: 4; }
.ring .ring-f { fill: none; stroke: var(--ring); stroke-width: 4; stroke-linecap: round; }
.ring > span { position: absolute; inset: 0; display: grid; place-items: center; font-size: .72rem; font-weight: 700; }
.ring--lg { width: 96px; height: 96px; flex-basis: 96px; }
.ring--lg > span { font: 600 1.3rem var(--f-head); letter-spacing: -.03em; }
.ring--lg .ring-t, .ring--lg .ring-f { stroke-width: 3.2; }
.tile--soft .ring-t, .action-card .ring-t { stroke: var(--bg); }   /* track would vanish on a surface2 background */
.dot { width: 18px; height: 18px; flex: 0 0 18px; border-radius: 999px; border: 1.5px solid var(--line); display: grid; place-items: center; }
.dot--done { background: var(--btn); border-color: transparent; color: var(--btn-ink); }
.dot--now { border: 2px solid var(--accent); }

/* ── Navigation list (course sidebar) ───────────────────────────────────── */
.nav-group h4 { font: 700 .7rem var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  margin: 0 0 6px 8px; display: flex; justify-content: space-between; gap: 8px; }
.nav-list a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; font-size: .88rem; }
.nav-list a:hover { background: var(--accent-soft); }
.nav-list a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.toc a { display: block; padding: 5px 0 5px 12px; border-left: 2px solid var(--line); color: var(--muted); }
.toc a[aria-current="true"] { border-left-color: var(--accent); color: var(--text); font-weight: 600; }

/* ── Video ──────────────────────────────────────────────────────────────── */
.video { position: relative; aspect-ratio: 16/9; border-radius: var(--r); overflow: hidden; background: #0d0e11; color: #fff; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-cover { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 22px; cursor: pointer;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 32px 32px; background-color: transparent; border: 0; color: inherit; text-align: left; font: inherit; width: 100%; }
.video-play { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); width: 68px; height: 68px; border-radius: 999px;
  background: var(--vid); color: #0d0e11; display: grid; place-items: center; }
.video-title { font: 600 1.25rem var(--f-head); letter-spacing: -.02em; }
.video-sub { font-size: .8rem; color: #b9bcc4; display: flex; justify-content: space-between; gap: 12px; margin-top: 4px; }
.video-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255,255,255,.15); }
.video-bar > i { display: block; height: 100%; background: var(--vid); }
.video-note { aspect-ratio: auto; padding: 28px; display: flex; gap: 12px; align-items: center; background: var(--surface2); color: var(--text); }

/* ── Quiz ───────────────────────────────────────────────────────────────── */
.opt { display: flex; gap: 12px; align-items: center; width: 100%; padding: 13px 14px; margin-bottom: 8px; border-radius: var(--rb);
  background: var(--bg); border: 1px solid var(--line); font: inherit; font-size: .94rem; color: inherit; text-align: left; cursor: pointer; }
.opt:hover:not(:disabled) { border-color: var(--muted); }
.opt:disabled { cursor: default; }
.opt-key { width: 26px; height: 26px; flex: 0 0 26px; border-radius: 8px; background: var(--surface2);
  display: grid; place-items: center; font-size: .74rem; font-weight: 700; color: var(--muted); }
.opt-note { margin-left: auto; font-size: .78rem; font-weight: 650; }
.opt.is-correct { border-color: var(--ok); background: var(--ok-soft); }
.opt.is-correct .opt-key { background: var(--ok); color: var(--ok-ink); }
.opt.is-correct .opt-note { color: var(--ok); }
.opt.is-wrong { border-color: var(--danger); background: var(--danger-soft); }
.opt.is-wrong .opt-key { background: var(--danger); color: var(--danger-ink); }
.explain { margin-top: 12px; padding: 12px 14px; border-radius: var(--rb); background: var(--surface2); font-size: .9rem; }
.explain strong { color: var(--ok); }

/* ── Callouts, code, tables, long-form notes ────────────────────────────── */
.tip { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r); background: var(--hl); color: var(--hl-ink); font-size: .92rem; margin: 0 0 24px; }
.code { background: var(--code); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin: 0 0 24px; }
.code-head { display: flex; justify-content: space-between; padding: 8px 14px; border-bottom: 1px solid var(--line); font-size: .74rem; color: var(--muted); font-weight: 600; }
.code pre, .prose pre { margin: 0; padding: 14px 16px; font: 13px/1.65 var(--f-mono); overflow-x: auto; }
.table-wrap { overflow-x: auto; margin: 6px 0 22px; border: 1px solid var(--line); border-radius: var(--r); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table-wrap th { text-align: left; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  font-weight: 700; padding: 10px 14px; background: var(--surface); }
.table-wrap td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.prose h2 { font-size: 1.4rem; margin: 34px 0 10px; }
.prose h3 { font-size: 1.12rem; margin: 26px 0 8px; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose code { font: .88em var(--f-mono); background: var(--code); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; }
.prose pre { background: var(--code); border: 1px solid var(--line); border-radius: var(--r); margin: 0 0 24px; }
.prose pre code { background: none; border: 0; padding: 0; }
.prose .code pre { background: none; border: 0; border-radius: 0; margin: 0; }
.prose blockquote { margin: 0 0 24px; padding: 14px 16px; border-radius: var(--r); background: var(--hl); color: var(--hl-ink); }
.prose blockquote p:last-child { margin: 0; }
.prose img { border-radius: var(--rb); border: 1px solid var(--line); }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* ── Forms ──────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: .84rem; font-weight: 600; }
.input { font: inherit; padding: 11px 13px; border-radius: var(--rb); border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.input:focus { outline: 2px solid var(--text); outline-offset: 0; border-color: transparent; }
.alert { padding: 12px 14px; border-radius: var(--rb); font-size: .9rem; background: var(--danger-soft); border: 1px solid var(--danger); }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1180px) { .app-panel { grid-template-columns: minmax(0, 1fr); } .app-rail { display: none; } }
@media (max-width: 980px) {
  .app-frame { grid-template-columns: minmax(0, 1fr); } .app-side { display: none; }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .app-top { padding: 10px 12px; gap: 10px; }
  .search-pill { flex: 0 0 auto; margin: 0 0 0 auto; } .search-pill span, .search-pill kbd { display: none; }
  .app-frame { padding: 0; }
  .app-panel, .panel { border-radius: 0; border-left: 0; border-right: 0; }
  .app-content { padding: 22px 16px 40px; }
  .bento { grid-template-columns: minmax(0, 1fr); } .bento .span-2 { grid-column: auto; }
  .video-cover { padding: 14px; } .video-play { width: 48px; height: 48px; top: 38%; } .video-title { font-size: 1rem; }
}

/* ── Account menu ───────────────────────────────────────────────────────── */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; min-width: 220px; padding: 6px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px -12px rgba(16,24,40,.25); }
.menu-pop .who { padding: 8px 10px 10px; font-size: .8rem; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; }
.menu-pop a, .menu-pop button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 9px; font: 500 .88rem var(--f-body);
  background: none; border: 0; color: var(--text); cursor: pointer; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--accent-soft); }

/* ── Sidebar course card + practice links ───────────────────────────────── */
.course-card { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r); background: var(--bg); border: 1px solid var(--line); box-shadow: var(--sh); }
.course-card h3 { font-size: .98rem; }
.course-card .muted { font-size: .78rem; }
.section-title { font: 600 .82rem var(--f-head); margin: 4px 0 -8px 8px; color: var(--text); }
.side-links { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--line); padding-top: 12px; }
.side-links a { padding: 7px 8px; border-radius: 10px; font-size: .88rem; color: var(--muted); }
.side-links a:hover { background: var(--accent-soft); color: var(--text); }

/* ── Lesson ─────────────────────────────────────────────────────────────── */
.crumbs { font-size: .82rem; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.crumbs a:hover { color: var(--text); }
.lesson-title { font-size: 2.35rem; margin: 10px 0 12px; letter-spacing: -.035em; }
.lesson-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.lesson-tabs { margin-bottom: 22px; }
.video--thumb .video-cover { background-color: #0d0e11; background-size: cover; background-position: center; }
.video--thumb .video-cover::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(0,0,0,.78) 100%); }
.video--thumb .video-title, .video--thumb .video-sub { position: relative; }
.video { margin-bottom: 26px; }
.concepts { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-bottom: 30px; }
.concepts .card { padding: 14px; }
.concepts h3 { font-size: .98rem; margin-bottom: 8px; }
.concepts .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.concepts .chip { background: var(--bg); border: 1px solid var(--line); color: var(--text); font-weight: 500; white-space: normal; }
.player { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); margin-top: 38px; }
.player-info { flex: 1; min-width: 180px; }
.player-info b { display: block; font-size: .95rem; }
.player-info span { font-size: .82rem; color: var(--muted); }
.player-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rail-next { margin-top: 26px; padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.rail-next b { display: block; font-size: .9rem; margin: 4px 0 8px; }
.locked { padding: 28px; border-radius: var(--r); background: var(--surface2); margin-top: 10px; }
.locked h2 { font-size: 1.5rem; margin-bottom: 8px; }
.skeleton { background: linear-gradient(90deg, var(--surface2) 25%, var(--surface) 50%, var(--surface2) 75%); background-size: 200% 100%;
  animation: shimmer 1.4s infinite; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Notes rendered by shared/markdown.js */
.prose .md-code { position: relative; background: var(--code); border: 1px solid var(--line); border-radius: var(--r); margin: 0 0 24px; overflow: hidden; }
.prose .md-code pre { background: none; border: 0; border-radius: 0; margin: 0; }
.prose .md-code-lang { padding: 7px 14px; border-bottom: 1px solid var(--line); font-size: .72rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.prose .md-table-wrap { overflow-x: auto; margin: 6px 0 22px; border: 1px solid var(--line); border-radius: var(--r); }
.prose .md-table-wrap table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.prose .md-table-wrap th { text-align: left; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 10px 14px; background: var(--surface); }
.prose .md-table-wrap td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.prose .md-figure { margin: 0 0 24px; }
.prose .md-caption { font-size: .82rem; color: var(--muted); margin-top: 6px; }
.prose h4 { font-size: 1rem; margin: 20px 0 6px; }

@media (max-width: 640px) {
  .lesson-title { font-size: 1.8rem; }
  .logo-word { display: none; }
  .player-actions { width: 100%; } .player-actions .btn { flex: 1; }
}

/* ── Course overview ────────────────────────────────────────────────────── */
.page { padding: 34px 44px 56px; min-width: 0; }
.page-title { font-size: 2.5rem; letter-spacing: -.04em; margin: 12px 0 10px; }
.lede { font-size: 1.08rem; color: var(--muted); max-width: 640px; margin: 0 0 22px; }
.chips-row { display: flex; gap: 8px; flex-wrap: wrap; }
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 0 0 22px; }
.stats-row .tile { padding: 14px 16px; }
.stats-row .stat { font-size: 1.6rem; }
.stats-row .muted { font-size: .82rem; }
.action-card { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 18px 20px; border-radius: var(--r); background: var(--surface2); margin: 0 0 34px; }
.action-card .grow { flex: 1; min-width: 200px; }
.action-card h2 { font-size: 1.2rem; margin: 2px 0; }
.section-heading { font-size: 1.5rem; margin: 30px 0 14px; }
.domain-card { border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); margin: 0 0 12px; overflow: hidden; scroll-margin-top: 16px; }
.domain-card.is-target { outline: 2px solid var(--accent); outline-offset: 2px; }
.domain-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--surface); flex-wrap: wrap; }
.domain-head h3 { font-size: 1.08rem; flex: 1; min-width: 200px; }
.domain-head .track { width: 120px; }
.lesson-row { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--line); font-size: .93rem; }
.lesson-row:hover { background: var(--accent-soft); }
.lesson-row .id { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 34px; }
.lesson-row .title { flex: 1; }
.lesson-row .tag { font-size: .74rem; color: var(--muted); white-space: nowrap; }

/* ── Dashboard ──────────────────────────────────────────────────────────── */
.dash-hero { display: flex; flex-direction: row; align-items: center; gap: 22px; flex-wrap: wrap; }
.dash-hero h2 { font-size: 1.35rem; margin: 4px 0; }
.dash-hero > div:last-child { flex: 1; min-width: 220px; }
.tile-label { font-size: .8rem; font-weight: 650; color: var(--muted); }
.tile--ink .tile-label { color: inherit; opacity: .78; }
.domain-bars { display: grid; grid-template-columns: minmax(0, auto) minmax(60px, 1fr) auto; gap: 7px 12px; align-items: center; font-size: .82rem; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.course-tile { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg); min-width: 0; }
.course-tile:hover { border-color: var(--muted); }
.course-tile h3 { font-size: 1rem; }
.course-tile .muted { font-size: .78rem; }
.course-tile.is-soon { opacity: .65; }
@media (max-width: 640px) { .page { padding: 24px 16px 40px; } .page-title { font-size: 1.9rem; } .domain-head .track { width: 100%; } }

/* ── Quiz ───────────────────────────────────────────────────────────────── */
.quiz-wrap { max-width: 760px; }
.setup-group { margin: 0 0 20px; }
.setup-group > .label { display: block; margin-bottom: 8px; }
.toggle-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.toggle-chips button { font: 600 .84rem var(--f-body); padding: 7px 12px; border-radius: 999px; cursor: pointer;
  background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.toggle-chips button[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
.select { font: inherit; padding: 10px 12px; border-radius: var(--rb); border: 1px solid var(--line); background: var(--bg); color: var(--text); max-width: 100%; }
.quiz-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; font-size: .86rem; color: var(--muted); }
.quiz-bar .track { flex: 1; min-width: 120px; }
.timer { font: 650 .95rem var(--f-mono); color: var(--text); padding: 4px 10px; border-radius: 8px; background: var(--surface2); }
.timer.is-low { background: var(--danger-soft); color: var(--danger); }
.q-text { font: 600 1.2rem/1.45 var(--f-head); letter-spacing: -.015em; margin: 10px 0 16px; white-space: pre-line; }
.opt.is-selected { border-color: var(--text); background: var(--accent-soft); }
.opt.is-selected .opt-key { background: var(--btn); color: var(--btn-ink); }
.q-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.result-head { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-bottom: 26px; }
.result-head h1 { font-size: 2rem; margin-bottom: 4px; }
.missed { border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; margin-bottom: 10px; background: var(--bg); }
.missed .q-text { font-size: 1rem; margin: 6px 0 10px; }
.missed .ans { font-size: .9rem; margin: 4px 0; }
.missed .ans b { display: inline-block; min-width: 92px; color: var(--muted); font-weight: 600; }
@media print {
  .app-top, .app-side, .no-print { display: none !important; }
  body, .app-panel, .panel { background: #fff !important; color: #000 !important; box-shadow: none !important; border: 0 !important; }
  .app-frame { display: block; }
}

/* ── Flashcards ─────────────────────────────────────────────────────────── */
.fc-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.fc-card { position: relative; min-height: 300px; border-radius: var(--r-lg); background: var(--bg); border: 1px solid var(--line); box-shadow: var(--sh);
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 40px 34px 34px;
  cursor: pointer; width: 100%; font: inherit; color: inherit; transition: border-color .15s; }
.fc-card:hover { border-color: var(--muted); }
.fc-card .chip { position: absolute; top: 16px; left: 16px; }
.fc-side { position: absolute; top: 18px; right: 18px; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fc-text { font: 600 1.3rem/1.45 var(--f-head); letter-spacing: -.015em; max-width: 560px; }
.fc-card.is-back { background: var(--surface); }
.fc-card.is-back .fc-text { font: 500 1.08rem/1.6 var(--f-body); letter-spacing: 0; }
.fc-hint { margin-top: 18px; font-size: .8rem; color: var(--muted); }
.fc-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 14px 0; flex-wrap: wrap; }
.rate { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.rate button { display: flex; flex-direction: column; gap: 2px; align-items: center; padding: 11px 6px; border-radius: var(--rb); cursor: pointer;
  font: 650 .9rem var(--f-body); background: var(--bg); color: var(--text); border: 1px solid var(--line); }
.rate button:hover { border-color: var(--text); }
.rate button small { font-size: .74rem; font-weight: 500; color: var(--muted); }
.rate button[data-q="4"] { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
.rate button[data-q="4"] small { color: inherit; opacity: .8; }
@media (max-width: 640px) { .q-actions > .muted, .fc-nav > .muted { display: none; } }   /* keyboard hints: not on phones */
@media (max-width: 640px) { .fc-card { min-height: 260px; padding: 44px 18px 24px; } .fc-text { font-size: 1.12rem; } .rate { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── Labs ───────────────────────────────────────────────────────────────── */
.lab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.lab-card { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg); min-width: 0; }
.lab-card:hover { border-color: var(--muted); }
.lab-card h3 { font-size: 1.05rem; line-height: 1.3; }
.lab-card p { margin: 0; font-size: .88rem; color: var(--muted); }
.lab-card .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.topology { background: #0d0e11; border-radius: var(--r); padding: 14px; margin: 0 0 26px; }
.topology img { display: block; width: 100%; height: auto; border: 0; border-radius: 0; }
.task-list { counter-reset: task; list-style: none; padding: 0; margin: 0 0 24px; }
.task-list li { counter-increment: task; display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.task-list li::before { content: counter(task); flex: 0 0 26px; height: 26px; border-radius: 8px; background: var(--surface2); display: grid; place-items: center; font-size: .78rem; font-weight: 700; }

/* ── Search ─────────────────────────────────────────────────────────────── */
.search-box { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg); margin-bottom: 14px; }
.search-box:focus-within { outline: 2px solid var(--text); outline-offset: 1px; }
.search-box input { flex: 1; border: 0; background: none; font: 500 1.15rem var(--f-body); color: var(--text); padding: 12px 0; outline: none; min-width: 0; }
.results { list-style: none; margin: 0; padding: 0; }
.result a { display: block; padding: 14px 16px; border-radius: var(--r); border: 1px solid transparent; }
.result a:hover, .result a[aria-selected="true"] { background: var(--surface); border-color: var(--line); }
.result h2 { font-size: 1.05rem; margin: 6px 0 4px; }
.result p { margin: 0; font-size: .88rem; color: var(--muted); }
.result mark { background: var(--hl); color: var(--hl-ink); border-radius: 3px; padding: 0 2px; }

/* ── Lessons drawer (phones/tablets: the course sidebar slides in) ──────── */
.side-toggle { display: none; }
.side-backdrop { display: none; }
@media (max-width: 980px) {
  .side-toggle { display: inline-flex; }
  body.side-open { overflow: hidden; }
  body.side-open .app-side { display: flex; position: fixed; top: 0; left: 0; bottom: 0; z-index: 60; width: min(86vw, 340px);
    max-height: none; padding: 16px 12px 24px; background: var(--canvas); box-shadow: 0 0 40px rgba(0,0,0,.35); }
  body.side-open .side-backdrop { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.45); }
}

/* Quiz: drag-and-drop types (CCIE) */
.match { display: flex; flex-direction: column; gap: 8px; }
.match-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 10px; align-items: center; padding: 10px 12px;
  border-radius: var(--rb); border: 1px solid var(--line); background: var(--bg); }
.match-row .select { width: 100%; }
.match-row.is-correct { border-color: var(--ok); background: var(--ok-soft); }
.match-row.is-wrong { border-color: var(--danger); background: var(--danger-soft); }
.match-left { font-weight: 600; font-size: .92rem; }
@media (max-width: 640px) { .match-row { grid-template-columns: minmax(0, 1fr); } }

/* ── Admin ──────────────────────────────────────────────────────────────── */
.admin-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 26px; }
.months { display: flex; align-items: flex-end; gap: 6px; height: 120px; margin: 4px 0 26px; }
.months div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .72rem; color: var(--muted); height: 100%; justify-content: flex-end; }
.months i { width: 100%; background: var(--ring); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.months b { color: var(--text); font-size: .76rem; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.admin-table th { text-align: left; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.admin-table th button { background: none; border: 0; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; padding: 0; }
.admin-table td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.admin-table tr.detail td { background: var(--surface); font-size: .82rem; color: var(--muted); }
.admin-table .email { font-weight: 600; word-break: break-all; }

/* One-time "we've moved" notice under the top bar */
.move-notice { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 0 auto 12px; max-width: 1420px;
  padding: 10px 14px 10px 16px; border-radius: var(--r); background: var(--hl); color: var(--hl-ink); font-size: .9rem; }
.move-notice a { text-decoration: underline; font-weight: 650; }
.move-notice .btn--ghost { color: var(--hl-ink); box-shadow: inset 0 0 0 1px rgba(0,0,0,.25); }
.app-top + .move-notice { margin: 0 10px 12px; }
