/* Learning IT by Example: platform. System fonts only, no third-party requests, no inline styles anywhere.
   Tokens follow docs/UX_PROMPT.md; every colour pair was checked with the WCAG contrast formula (see docs/UX_RESEARCH.md). */
:root {
  color-scheme: dark light;
  --bg: #0e1116;
  --surface: #151a22;
  --surface-2: #1c2330;
  --line: #2a3240;
  --control: #66718a;
  --text: #e6e9ef;
  --muted: #9aa4b5;
  --accent: #6cc6b0;
  --accent-ink: #07201a;
  --focus: #9ad7ff;
  --ok: #6fd39a;
  --warn: #e6b455;
  --bad: #ff8d84;
  --cat-s: 55%;
  --cat-l: 72%;
  --sh1: none;
  --sh2: none;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs-xs: .78rem; --fs-sm: .875rem; --fs-md: 1.25rem; --fs-lg: 1.563rem; --fs-xl: 1.953rem;
  --fs-hero: clamp(2rem, 5vw + .5rem, 3.4rem);
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px;
  --r1: 4px; --r2: 8px; --r3: 12px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --gutter: max(16px, env(safe-area-inset-left), env(safe-area-inset-right));
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f5f0;
    --surface: #ffffff;
    --surface-2: #eeece4;
    --line: #d6d2c4;
    --control: #7c818c;
    --text: #1a1f27;
    --muted: #566072;
    --accent: #136457;
    --accent-ink: #ffffff;
    --focus: #0b5cad;
    --ok: #17673d;
    --warn: #8a5600;
    --bad: #b3261e;
    --cat-s: 60%;
    --cat-l: 26%;
    --sh1: 0 1px 2px rgb(20 24 31 / .06), 0 2px 8px rgb(20 24 31 / .06);
    --sh2: 0 2px 4px rgb(20 24 31 / .08), 0 6px 18px rgb(20 24 31 / .10);
  }
}

/* one hue per category, picked by a hash of its name (see store.hue_class) */
.h0{--hue:0}.h1{--hue:15}.h2{--hue:30}.h3{--hue:45}.h4{--hue:60}.h5{--hue:75}.h6{--hue:90}.h7{--hue:105}
.h8{--hue:120}.h9{--hue:135}.h10{--hue:150}.h11{--hue:165}.h12{--hue:180}.h13{--hue:195}.h14{--hue:210}.h15{--hue:225}
.h16{--hue:240}.h17{--hue:255}.h18{--hue:270}.h19{--hue:285}.h20{--hue:300}.h21{--hue:315}.h22{--hue:330}.h23{--hue:345}
.cat, .cat-h, .chip, .poster-gen { --cat: hsl(var(--hue, 200) var(--cat-s) var(--cat-l)); }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; scroll-padding-bottom: 88px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.55 var(--sans); overflow-wrap: anywhere; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; font-weight: 650; }
h1 { font-size: clamp(1.7rem, 4vw + .6rem, 2.5rem); letter-spacing: -.01em; }
h2 { font-size: 1.05rem; letter-spacing: .02em; }
h3 { font-size: 1.05rem; line-height: 1.25; }
p { margin: 0 0 1em; }
code, pre, .mono { font-family: var(--mono); }
code { font-size: .92em; background: var(--surface-2); padding: .1em .35em; border-radius: var(--r1); }
.muted, .mut { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.fine { color: var(--muted); font-size: var(--fs-xs); margin: 0 0 var(--s6); }
.sr, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; left: 8px; top: 8px; z-index: 50; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: var(--r2); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.is-admin .wrap { max-width: 1700px; }
main.wrap { padding-top: var(--s5); padding-bottom: var(--s8); min-height: 60vh; }

/* header */
.top { border-bottom: 1px solid var(--line); background: var(--surface); }
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding-top: 12px; padding-bottom: 12px; }
.brand { font: 600 1rem var(--mono); color: var(--text); text-decoration: none; }
.brand .prompt { color: var(--accent); margin-right: .3em; }
.brand-sub { color: var(--muted); font-weight: 400; }
.topnav { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: center; font-size: .92rem; }
.topnav a:not(.btn) { color: var(--text); text-decoration: none; padding: 6px 0; }
.topnav a:not(.btn):hover { color: var(--accent); text-decoration: underline; }
.topnav a[aria-current="page"] { font-weight: 650; }
form.inline { display: inline; margin: 0; }
.linklike { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* hero */
.hero { padding: var(--s3) 0 var(--s2); }
.hero.narrow, .narrow { max-width: 34rem; }
.hero.landing { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--s6); align-items: center; padding: var(--s5) 0 var(--s7); }
.hero-copy h1 { font: 700 var(--fs-hero)/1.08 var(--mono); letter-spacing: -.02em; margin-bottom: var(--s4); }
.eyebrow { color: var(--accent); font-size: var(--fs-xs); margin: 0 0 var(--s4); letter-spacing: .01em; }
.lede { color: var(--muted); font-size: 1.1rem; max-width: 44rem; }
.btnrow { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s5); }
.crumb { font-size: .85rem; color: var(--muted); }
.cat-h { color: var(--cat); }
.hero-player { position: relative; display: block; border-radius: var(--r3); overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--sh2); color: inherit; text-decoration: none; }
.hero-player .poster { display: block; }
.play-btn { position: absolute; left: 50%; top: 46%; translate: -50% -50%; width: 72px; height: 72px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; border: 3px solid var(--bg); }
.play-btn .play { margin-left: 3px; }
.hero-cap { display: block; padding: var(--s3) var(--s4); font-size: var(--fs-xs); color: var(--muted); border-top: 1px solid var(--line); }
.hero-player:hover .play-btn, .hero-player:focus-visible .play-btn { background: var(--text); }

/* chips, search */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 18px; }
.chip { display: inline-flex; align-items: center; min-height: 32px; font-size: var(--fs-xs); padding: 3px 12px; border: 1px solid var(--control); border-radius: 999px; text-decoration: none; color: var(--cat, var(--text)); background: var(--surface); cursor: pointer; font-family: var(--mono); }
.chip:hover { border-color: var(--cat, var(--accent)); }
.chip.current, .chip[aria-current="page"], .chip[aria-pressed="true"] { background: var(--surface-2); border-color: var(--cat, var(--accent)); box-shadow: inset 0 -2px 0 var(--cat, var(--accent)); }
.chips > .chip:first-child { color: var(--text); }
.chip-free { color: var(--ok); }
.search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 18px; }
.search input { flex: 1 1 16rem; max-width: 34rem; }
input[type="search"], input[type="text"], input[type="password"], input[type="url"], input[type="email"], input[type="date"], input[type="number"], input:not([type]), select, textarea {
  background: var(--surface); color: var(--text); border: 1px solid var(--control); border-radius: var(--r2); padding: 8px 12px; font: inherit; min-width: 0; min-height: 44px; }
textarea { width: 100%; font-family: var(--mono); font-size: .9rem; line-height: 1.45; resize: vertical; min-height: 0; }
textarea[readonly] { background: var(--surface-2); color: var(--muted); }
.empty { color: var(--muted); padding: 24px 0; }
.catalogue { scroll-margin-top: 12px; }

/* poster + cards */
.poster { position: relative; display: block; aspect-ratio: 1280 / 632; background: var(--surface-2); overflow: hidden; }
.poster-img { display: block; width: 100%; height: auto; aspect-ratio: 1280 / 632; object-fit: cover; }
.poster-gen { display: flex; flex-direction: column; justify-content: center; gap: 6px; height: 100%; padding: var(--s5); background: var(--surface-2); border-top: 4px solid var(--cat); }
.poster-gen .cat { color: var(--cat); font-size: var(--fs-xs); }
.poster-pills { position: absolute; left: 10px; bottom: 10px; display: flex; gap: 6px; align-items: center; }
.poster-pills .lock { color: var(--text); background: var(--bg); border-radius: 4px; padding: 3px; width: 20px; height: 20px; }
.start-here { position: absolute; right: 10px; top: 10px; background: var(--accent); color: var(--accent-ink); font-size: var(--fs-xs); font-weight: 700; padding: 2px 8px; border-radius: var(--r1); }
.card-progress { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 4px; border: 0; appearance: none; background: rgb(0 0 0 / .45); }
.card-progress::-webkit-progress-bar { background: rgb(0 0 0 / .45); }
.card-progress::-webkit-progress-value { background: var(--accent); }
.card-progress::-moz-progress-bar { background: var(--accent); }
.grid { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.grid.one { grid-template-columns: minmax(0, 24rem); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r3); overflow: hidden; box-shadow: var(--sh1); }
.card:hover, .card:focus-within { border-color: var(--cat, var(--accent)); }
.card-link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.card-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 16px 16px; flex: 1; }
.card-top { display: flex; justify-content: space-between; gap: 10px; font-size: var(--fs-xs); }
.card .cat { color: var(--cat); }
.card h3 { margin: 0; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .hook { margin: 0; color: var(--muted); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-tested { margin-top: auto; font-size: var(--fs-xs); color: var(--muted); }

/* video page */
.player-box { background: #000; border: 1px solid var(--line); border-radius: var(--r3); overflow: hidden; margin-bottom: 18px; }
.player { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.watch-head { margin-bottom: var(--s5); }
.kicker { font-size: .82rem; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-bottom: 8px; }
.kicker .vid { color: var(--muted); }
.cols { display: grid; gap: 8px var(--s6); grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
@media (max-width: 760px) { .cols { grid-template-columns: minmax(0, 1fr); } }
.block { margin-bottom: 22px; }
.block h2, .tabpanel > h2 { color: var(--muted); text-transform: uppercase; font-size: var(--fs-xs); letter-spacing: .08em; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: var(--s4); }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; color: var(--muted); font: 600 .95rem var(--sans); padding: 10px 14px; min-height: 44px; cursor: pointer; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tabpanel { margin-bottom: var(--s5); }
.tabs-ready .tabpanel:not(.on) { display: none; }
.chapters { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.chapter, .tseek { display: flex; gap: 12px; width: 100%; text-align: left; background: none; border: 0; color: var(--text); font: inherit; padding: 8px 10px; min-height: 40px; cursor: pointer; border-radius: 0 var(--r2) var(--r2) 0; }
.chapter:hover, .tseek:hover { background: var(--surface-2); }
.chapter .t, .tseek .t { color: var(--accent); min-width: 3.2em; font-size: .88rem; padding-top: .1em; }
.chapter.playing { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--accent); }
.transcript { list-style: none; padding: 0; margin: 0; max-width: 68ch; }
.limits { border: 1px solid var(--line); border-left: 4px solid var(--warn); background: var(--surface); border-radius: var(--r2); padding: 12px 16px 2px; }
.limits h2 { color: var(--warn); }
.tags, .sources, .more { list-style: none; padding: 0; margin: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-size: var(--fs-xs); border: 1px solid var(--line); border-radius: var(--r1); padding: 2px 8px; color: var(--muted); }
.sources li, .more li { margin-bottom: 6px; font-size: .88rem; }
.more .vid { color: var(--muted); }
.up-next .grid { margin-top: var(--s2); }
.synthetic { color: var(--muted); font-size: .88rem; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 28px; }

/* paywall */
.paywall { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s5); align-items: center; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r3); padding: var(--s5); margin-bottom: var(--s5); box-shadow: var(--sh1); }
.paywall h2 { color: var(--text); font-size: var(--fs-lg); text-transform: none; letter-spacing: 0; }
.paywall-poster { position: relative; border-radius: var(--r2); overflow: hidden; border: 1px solid var(--line); }
.paywall-poster::after { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 55%, transparent); }
.lock-badge { position: absolute; left: 50%; top: 50%; translate: -50% -50%; z-index: 2; width: 56px; height: 56px; border-radius: 50%; background: var(--bg); color: var(--text); display: grid; place-items: center; border: 2px solid var(--accent); }
.lock-badge .lock { width: 26px; height: 26px; }
.paywall-prices { margin: 0 0 var(--s4); font-size: 1rem; }
@media (max-width: 760px) { .paywall { grid-template-columns: minmax(0, 1fr); padding: var(--s4); } }
.sticky-cta { display: none; }
@media (max-width: 600px) {
  .sticky-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
    padding: var(--s3) var(--gutter) calc(var(--s3) + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
}

/* badges */
.badge { font: 600 .68rem var(--mono); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); text-transform: uppercase; letter-spacing: .06em; background: var(--bg); }
.badge.free { color: var(--ok); border-color: var(--ok); }
.badge.members { color: var(--muted); border-color: var(--control); }

/* landing bands */
.band { padding: var(--s7) 0 0; }
.band-h { font: 700 var(--fs-lg)/1.2 var(--mono); letter-spacing: -.01em; text-transform: none; color: var(--text); margin-bottom: var(--s5); }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: var(--s4); max-width: 46rem; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); gap: var(--s3); }
.steps li::before { content: counter(step); font: 700 1.1rem var(--mono); color: var(--accent); border: 1px solid var(--control); border-radius: var(--r2); width: 2.4rem; height: 2.4rem; display: grid; place-items: center; }
.excerpt { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r3); padding: var(--s5); }
.excerpt h3 { color: var(--muted); font-size: var(--fs-xs); letter-spacing: .08em; text-transform: uppercase; }
.chapters-lite li { display: flex; gap: var(--s3); margin-bottom: 4px; font-size: .95rem; }
.chapters-lite .t { color: var(--accent); min-width: 3.2em; }
.excerpt-limits { border-left: 4px solid var(--warn); padding-left: var(--s3); }
.prose { max-width: 68ch; }
.faq { max-width: 52rem; border-top: 1px solid var(--line); }
.qa { border-bottom: 1px solid var(--line); }
.qa summary { cursor: pointer; font-weight: 600; padding: 14px 4px; min-height: 48px; list-style-position: outside; }
.qa p { margin: 0 0 var(--s4); padding: 0 4px; max-width: 68ch; color: var(--muted); }
.final { text-align: center; padding: var(--s7) 0 0; }
.final-line { font: 700 var(--fs-lg)/1.2 var(--mono); margin-bottom: var(--s4); }
@media (max-width: 860px) {
  .hero.landing { grid-template-columns: minmax(0, 1fr); padding-bottom: var(--s6); }
  .excerpt { grid-template-columns: minmax(0, 1fr); }
  .band { padding-top: var(--s6); }
}

/* plans */
.seg { display: inline-flex; gap: 0; border: 1px solid var(--control); border-radius: 999px; padding: 3px; margin: var(--s4) 0 var(--s2); background: var(--surface); }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg label { padding: 8px 20px; min-height: 40px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: .95rem; color: var(--muted); display: inline-flex; align-items: center; }
.seg input:checked + label { background: var(--accent); color: var(--accent-ink); }
.seg input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }
.plans { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); margin: var(--s4) 0 var(--s4); align-items: stretch; }
.plans.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); max-width: 46rem; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r3); padding: var(--s5); display: flex; flex-direction: column; gap: 4px; box-shadow: var(--sh1); }
.plan.main { border: 2px solid var(--accent); }
.plan-tag { margin: 0; color: var(--accent); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.plan h3 { margin-bottom: 2px; }
.plan .price { font-size: var(--fs-xl); font-weight: 700; margin: 4px 0; line-height: 1.1; }
.plan form { margin-top: auto; padding-top: var(--s4); }
.ticks { margin: var(--s3) 0 var(--s2) !important; }
.ticks li { padding-left: 1.4em; position: relative; margin-bottom: 4px; }
.ticks li::before { content: "\2713"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }

/* footer */
.foot { border-top: 1px solid var(--line); background: var(--surface); padding: var(--s6) 0 calc(var(--s6) + env(safe-area-inset-bottom)); margin-top: var(--s6); font-size: var(--fs-sm); }
.foot-in { display: grid; gap: var(--s2); }
.foot p { margin: 0; }
.foot-brand { font-weight: 600; color: var(--text); }
.foot-brand .prompt { color: var(--accent); }
.foot-links { display: flex; gap: var(--s4); }

/* forms, buttons */
.stack { display: flex; flex-direction: column; gap: 8px; }
label { font-size: .88rem; font-weight: 600; }
.btn { font: 600 .95rem var(--sans); padding: 8px 16px; min-height: 44px; border: 1px solid var(--control); border-radius: var(--r2); background: transparent; color: var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; line-height: 1.3; }
.btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary, a.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover:not(:disabled) { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn.big { min-height: 52px; padding: 10px 24px; font-size: 1.02rem; }
.btn.small { min-height: 40px; padding: 4px 12px; font-size: .88rem; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
a.btn { text-decoration: none; }
.btnrow .btn { flex: 0 0 auto; }
pre.cmd { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); padding: 10px 14px; overflow-x: auto; }
.flash { padding: 8px 12px; border-radius: var(--r2); border: 1px solid var(--line); background: var(--surface); }
.flash.bad, .flash-list .bad { color: var(--bad); }
.flash.warn, .flash-list .warn { color: var(--warn); }
.flash-list .ok, .ok, .flash.ok { color: var(--ok); }
.flash-list { list-style: none; margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); font-size: .9rem; }
.warn { color: var(--warn); } .bad { color: var(--bad); }
.auth { max-width: 28rem; }
.auth input, .auth select { width: 100%; }
.pw-wrap { display: flex; gap: 8px; }
.pw-wrap input { flex: 1; }
.plain { padding-left: 1.2em; margin: 0 0 1em; }
.plain li { margin-bottom: .4em; }
.plain.tight { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.plain.cols2 { columns: 2 16rem; column-gap: 28px; }
.plain-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.plain-table th, .plain-table td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.plan-edit { border: 1px solid var(--line); border-radius: var(--r2); padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; }
.plan-edit legend { padding: 0 6px; color: var(--muted); font-size: .8rem; }
.plan-edit input[type="text"], .plan-edit input:not([type]) { width: 100%; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.stack.tight { gap: 4px; }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--s5) + env(safe-area-inset-bottom)); translate: -50% 0; z-index: 40; background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: var(--r2); font-weight: 600; max-width: calc(100vw - 32px); box-shadow: var(--sh2); }


/* ---------------------------------------------------------------------------------------------- admin
   One shell for every admin page: sticky header, page head, sections. The dashboard answers "what needs me?" first (attention
   shortcuts), shows the real progress numbers next, then the catalogue table with a short default column set. */
.is-admin input[type="search"], .is-admin input[type="text"], .is-admin input[type="password"], .is-admin input[type="url"], .is-admin input[type="email"],
.is-admin input[type="date"], .is-admin input[type="number"], .is-admin input:not([type]), .is-admin select { min-height: 40px; }
@media (min-width: 761px) { .is-admin .top { position: sticky; top: 0; z-index: 30; } }
.is-admin .topnav { gap: 2px 6px; }
.is-admin .topnav a:not(.btn) { padding: 8px 12px; border-radius: var(--r2); }
.is-admin .topnav a:not(.btn):hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.is-admin .topnav a[aria-current="page"] { background: var(--surface-2); box-shadow: inset 0 -3px 0 var(--accent); }
.is-admin .topnav .ext { color: var(--muted); }
.is-admin .topnav .ext::after { content: " \2197"; }
.is-admin .topnav form.inline { margin-left: 6px; }
.page-head { margin-bottom: var(--s5); }
.page-head h1 { margin-bottom: var(--s2); }
.page-lead { color: var(--muted); font-size: var(--fs-sm); max-width: 56rem; margin: 0; }
.sec-h { font-size: 1rem; font-weight: 650; letter-spacing: 0; text-transform: none; color: var(--text); margin: 0 0 var(--s3); }

/* sign-in */
.auth-card { max-width: 26rem; margin: var(--s7) auto var(--s6); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r3); padding: var(--s6); box-shadow: var(--sh2); }
.auth-card h1 { font-size: 1.6rem; margin-bottom: var(--s2); }
.auth-card input { width: 100%; }
.auth-card .btn.big { width: 100%; margin-top: var(--s2); }
.auth-mark { width: 48px; height: 48px; border-radius: var(--r2); display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-size: 1.6rem; font-weight: 700; margin-bottom: var(--s4); }

/* status pills: colour is never the only signal, the text says it too */
.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .76rem; font-weight: 600; line-height: 1.55; white-space: nowrap;
  border: 1px solid color-mix(in srgb, currentColor 35%, transparent); background: color-mix(in srgb, currentColor 9%, var(--surface)); }
.pill.ok { color: var(--ok); } .pill.bad { color: var(--bad); } .pill.warn { color: var(--warn); } .pill.mut { color: var(--muted); }

/* dashboard: needs attention + progress */
.dash-top { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--s6); align-items: start; margin: var(--s4) 0 var(--s6); }
.attn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11.5rem), 1fr)); gap: var(--s3); }
.attn-card { text-align: left; display: flex; flex-direction: column; gap: 2px; min-height: 7.5rem; padding: var(--s4); background: var(--surface); color: var(--text); font: inherit;
  border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--r3); cursor: pointer; }
.attn-card b { font-size: 2rem; line-height: 1.1; }
.attn-l { font-weight: 650; }
.attn-h { color: var(--muted); font-size: var(--fs-xs); line-height: 1.35; }
.attn-card[data-preset="failed"] { border-left-color: var(--bad); }
.attn-card[data-preset="review"] { border-left-color: var(--warn); }
.attn-card:hover:not(:disabled) { border-color: var(--accent); }
.attn-card[aria-pressed="true"] { background: var(--surface-2); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.attn-card:disabled, .attn-card.calm { cursor: default; border-left-color: var(--line); }
.attn-card.calm b { color: var(--muted); }
.meters { list-style: none; margin: 0 0 var(--s4); padding: 0; display: grid; gap: var(--s2); }
.meter { display: grid; grid-template-columns: 9rem minmax(0, 1fr) 6rem; gap: var(--s3); align-items: center; font-size: var(--fs-sm); }
.meter progress { width: 100%; height: 10px; appearance: none; border: 0; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 999px; }
.meter progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
.meter progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.meter-n { text-align: right; white-space: nowrap; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); gap: var(--s2); margin: 0; }
.facts div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); padding: var(--s2) var(--s3); }
.facts dt { color: var(--muted); font-size: var(--fs-xs); }
.facts dd { margin: 0; font-size: 1.2rem; font-weight: 700; }
@media (max-width: 1000px) { .dash-top { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) { .meter { grid-template-columns: minmax(0, 1fr) 5.5rem; } .meter progress { grid-column: 1 / -1; grid-row: 2; } }

/* dashboard: filters and table */
.tiles { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 var(--s4); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2); padding: 8px 14px; min-width: 120px; }
.tile b { display: block; font-size: 1.35rem; }
.tile span { color: var(--muted); font-size: var(--fs-xs); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.filters input { flex: 1 1 14rem; max-width: 24rem; }
.table-scroll { overflow: auto; max-height: 70vh; border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); max-width: 100%; }
table.admin { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 960px; font-size: .84rem; line-height: 1.35; }
table.admin.wide { min-width: 1750px; }
table.admin:not(.wide) [data-opt] { display: none; }
table.admin th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); border-bottom: 1px solid var(--line); text-align: left; padding: 0; white-space: nowrap; }
table.admin th:not([data-k]):not(.sel) { padding: 9px 8px; font: 600 .74rem var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.sort { display: block; width: 100%; background: none; border: 0; color: var(--muted); font: 600 .74rem var(--mono); text-transform: uppercase; letter-spacing: .04em; padding: 9px 8px; cursor: pointer; text-align: left; }
.sort:hover { color: var(--text); }
th[aria-sort="ascending"] .sort::after { content: " \25B2"; }
th[aria-sort="descending"] .sort::after { content: " \25BC"; }
table.admin td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; overflow-wrap: normal; word-break: normal; }
table.admin td.t, table.admin td[data-k="gate"], table.admin td[data-k="review"], table.admin td[data-k="queue"] { white-space: normal; overflow-wrap: break-word; }
table.admin td[data-k="gate"], table.admin td[data-k="review"] { min-width: 9rem; max-width: 14rem; }
table.admin tr.drawer td { white-space: normal; overflow-wrap: anywhere; padding: 10px 14px 16px; background: var(--surface-2); }
table.admin th.sel, table.admin td.sel { width: 2.4rem; text-align: center; padding-left: 8px; padding-right: 8px; }
table.admin input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
table.admin td.t { min-width: 17rem; max-width: 28rem; }
table.admin td.num { text-align: right; }
table.admin tbody.v:hover tr.main td { background: var(--surface-2); }
tbody.v.selected tr.main td { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
tbody.v.open tr.main td { border-bottom-color: transparent; }
.mut-title { color: var(--muted); }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-align: left; cursor: pointer; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; }
.linklike:hover, .linklike:focus-visible { text-decoration-color: currentColor; }
.revform { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; margin: 0; white-space: nowrap; }
.btn.small { padding: 2px 10px; min-height: 32px; font-size: .8rem; }
.expander { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0 6px 0 0; font-size: .9rem; }
.expander[aria-expanded="true"] { transform: rotate(90deg); }
.panel { max-width: 56rem; position: sticky; left: 12px; }
.path { word-break: break-all; font-size: .76rem; }
.cat.mono { color: hsl(var(--hue, 200) var(--cat-s) var(--cat-l)); white-space: nowrap; }
#nomatch { text-align: center; }

/* dashboard: floating action bar (appears once a video is ticked) */
.bulkbar { position: sticky; bottom: 0; z-index: 25; margin-top: var(--s4); background: var(--surface); border: 1px solid var(--accent); border-radius: var(--r3);
  padding: var(--s3) var(--s4); box-shadow: 0 -6px 22px rgb(0 0 0 / .28); }
.bulk-top { display: flex; align-items: center; gap: var(--s4); margin-bottom: var(--s2); }
.bulk-top #selcount { font-weight: 700; }
.bulk-groups { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s6); }
.bgroup { display: flex; flex-direction: column; gap: 4px; }
.bg-l { color: var(--muted); font-size: var(--fs-xs); }
.bg-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.bulkbar .btn { min-height: 40px; }

/* flash messages */
.flash-list { list-style: none; margin: 0 0 var(--s4); padding: var(--s2) var(--s4); border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); font-size: .9rem; }
.flash-list li { padding: 4px 0 4px 10px; border-left: 3px solid var(--line); margin: 4px 0; }
.flash-list li.ok { border-left-color: var(--ok); } .flash-list li.warn { border-left-color: var(--warn); } .flash-list li.bad { border-left-color: var(--bad); }
.flash { border-left: 4px solid var(--line); }
.flash.warn { border-left-color: var(--warn); } .flash.bad { border-left-color: var(--bad); } .flash.ok { border-left-color: var(--ok); }

/* settings and plans */
.settings { display: grid; gap: var(--s4); max-width: 44rem; }
.card-sec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r3); padding: var(--s5); }
.card-sec h2 { font-size: 1.1rem; margin-bottom: var(--s2); }
.card-sec input:not([type="checkbox"]), .card-sec select { width: 100%; }
.savebar { display: flex; gap: var(--s3); padding-top: var(--s2); }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); gap: var(--s4); margin-bottom: var(--s4); }
.plan-edit { background: var(--surface); margin: 0; }
.plan-edit legend { display: flex; gap: var(--s2); align-items: center; }

@media (max-width: 600px) {
  body { font-size: .9375rem; }
  body:has(.sticky-cta) { padding-bottom: 76px; }
  main.wrap { padding-top: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .card, .chip, .btn, .plan, .play-btn, .tab { transition: background-color .12s var(--ease), border-color .12s var(--ease), color .12s var(--ease), transform .12s var(--ease), box-shadow .12s var(--ease); }
  .card:hover { transform: translateY(-3px); box-shadow: var(--sh2); }
  .expander { transition: transform .12s; }
  .toast { animation: toast-in .18s var(--ease); }
  @keyframes toast-in { from { opacity: 0; translate: -50% 8px; } to { opacity: 1; translate: -50% 0; } }
}

/* practice quiz */
.quiz-q { border: 1px solid var(--line); border-radius: var(--r2); padding: var(--s3) var(--s4); margin: 0 0 var(--s3); background: var(--surface); }
.quiz-q legend { font-weight: 650; padding: 0 var(--s2); }
.quiz-opt { display: flex; gap: var(--s2); align-items: flex-start; padding: var(--s1) 0; font-weight: 400; cursor: pointer; }
.quiz-opt input { margin-top: .35em; accent-color: var(--accent); }
.quiz-results { list-style: none; padding: 0; margin: 0 0 var(--s4); display: grid; gap: var(--s3); max-width: 46rem; }
.quiz-result { border: 1px solid var(--line); border-radius: var(--r2); padding: var(--s3) var(--s4); background: var(--surface); }
.quiz-result p { margin: 0 0 var(--s2); }

/* learning paths */
.path-list, .path-cards { list-style: none; margin: 0 0 var(--s4); padding: 0; display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.path-chip, .path-card { display: flex; flex-direction: column; gap: var(--s1); height: 100%; padding: var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r3); color: var(--text); text-decoration: none; }
.path-chip:hover { border-color: var(--accent); }
.path-card h2 { font-size: 1.15rem; margin: 0 0 var(--s2); }
.path-card p { margin: 0 0 var(--s2); }

/* notes and certificates */
.notes { list-style: none; margin: 0 0 var(--s4); padding: 0; }
.note { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr) auto; gap: var(--s3); align-items: baseline; padding: var(--s2) 0; border-bottom: 1px solid var(--line); }
.note-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.note-form textarea { min-height: 5.5rem; }
.note-row { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.note-row input[type="number"] { width: 7rem; }
.cert-form { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.cert-form input { min-width: 0; flex: 1 1 12rem; }
.cert { max-width: 46rem; margin: var(--s5) auto; padding: var(--s7) var(--s6); border: 2px solid var(--accent); border-radius: var(--r3); background: var(--surface); text-align: center; }
.cert h1 { font-family: var(--mono); margin: var(--s4) 0; }
.cert-top { color: var(--accent); margin: 0; }
.cert-line { margin: var(--s3) 0 var(--s1); color: var(--muted); }
.cert-name { font-size: var(--fs-xl); font-weight: 700; margin: 0 0 var(--s3); overflow-wrap: anywhere; }
.cert-cat { font-size: var(--fs-lg); font-weight: 650; margin: 0 0 var(--s3); }
.cert-code { margin-top: var(--s5); }
.cert-fine { color: var(--muted); font-size: var(--fs-xs); margin: var(--s3) 0 0; }
@media print {
  body { background: #fff; color: #000; }
  .top, .foot, .noprint, .toast, .sticky-cta, .skip { display: none !important; }
  main.wrap { padding: 0; max-width: none; }
  .cert { border: 2px solid #000; background: #fff; color: #000; box-shadow: none; }
  .cert-top, .cert-line, .cert-fine { color: #000; }
}

/* player tools and the "play next" bar */
.player-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: -6px 0 16px; font-size: .9rem; }
.player-tools select { width: auto; min-width: 5.5rem; }
.player-tools .check { display: inline-flex; gap: 6px; align-items: center; }
.player-tools kbd { font: inherit; font-family: var(--mono, monospace); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.next-up { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 16px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r3); background: var(--surface); }
.next-up[hidden] { display: none; }

/* My learning */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 12px; list-style: none; padding: 0; margin: 0 0 24px; }
.stat-row li { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r3); background: var(--surface); }
.stat-row strong { font-size: 1.4rem; }
.stat-row span { color: var(--muted); font-size: .85rem; }
.path-rows { display: grid; gap: 14px; }
.path-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r3); background: var(--surface); }
.path-row > div { min-width: 0; }
.path-row h3 { margin: 0 0 6px; font-size: 1.05rem; }
.path-progress { width: min(22rem, 100%); height: 8px; display: block; }
.notes-list { display: grid; gap: 10px; }

/* site search */
.site-search { display: flex; gap: 6px; align-items: center; margin: 0; }
.site-search input[type=search] { width: 11rem; min-width: 0; }
.hero .site-search { max-width: 32rem; }
.hero .site-search input[type=search] { flex: 1; width: auto; }
.results { display: grid; gap: 18px; padding: 0; list-style: none; }
.result-title { font-size: 1.1rem; margin: 0 0 2px; }
.hit mark { background: color-mix(in srgb, var(--accent, #3b82f6) 30%, transparent); color: inherit; border-radius: 2px; }

/* cheat sheet */
.sheet { max-width: 46rem; margin-inline: auto; }
.sheet-steps { padding-left: 1.2rem; display: grid; gap: 4px; }
@media print { .sheet { max-width: none; } .sheet .block { break-inside: avoid; } }

/* questions */
.qa-list { display: grid; gap: 14px; }
.qa .q { font-weight: 600; margin: 2px 0; }
.qa .answer { margin: 4px 0 0; padding-left: 10px; border-left: 3px solid var(--line); }

/* motivation */
.badge-list { display: flex; flex-wrap: wrap; gap: 8px; }
.badge-got, .badge-todo { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: .85rem; }
.badge-got { background: var(--surface); }
.badge-todo { color: var(--muted); border-style: dashed; }
.reminder { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 0 0 18px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r3); background: var(--surface); }
.reminder p { margin: 0; }

/* text size (the footer buttons set html[data-text]; everything is in rem, so it all scales) */
html[data-text="large"] { font-size: 112.5%; }
html[data-text="larger"] { font-size: 125%; }
.text-size { display: inline-flex; gap: 6px; align-items: center; }
.text-size button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }

/* touch screens: bigger targets for the small buttons and links in lists */
@media (pointer: coarse) {
  .btn.small, .linklike, .chip, .tab { min-height: 44px; }
  .topnav a:not(.btn) { padding: 12px 0; }
}

/* high-contrast / forced-colours modes: keep borders and the focus ring visible */
@media (forced-colors: active) {
  .btn, .card, .chip, .plan, .tab, .reminder, .next-up, .path-row { border: 1px solid CanvasText; }
  :focus-visible { outline: 3px solid Highlight; }
  progress { forced-color-adjust: auto; }
}

/* contact form, inbox, banner */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.pre-line { white-space: pre-line; margin: 0 0 8px; }
.admin-banner { margin: 0 0 12px; }
