/* SkillsDey design system. One file for the login page and the app; the
   app's component styles (lesson steps, reader, workspace) are bundled from
   ui/src/styles/app.css and use only these tokens.
   Light and dark from the same tokens; the theme follows the OS unless the
   person picks one (html[data-theme]). Colours only through tokens. */

:root {
  --bg: #f5f6f8;
  --bg-grad: radial-gradient(1200px 600px at 100% -10%, #e9f0ff 0%, transparent 60%);
  --surface: #ffffff;
  --surface-2: #f2f4f7;
  --surface-3: #e9edf2;
  --line: #e2e6ec;
  --line-2: #cfd6e0;
  --ink: #111827;
  --ink-2: #4b5565;
  /* Text tokens pass WCAG AA (4.5 to 1) on every surface and soft tint
     they sit on, light and dark (audit M6). */
  --ink-3: #5f6b7c;
  --accent: #2a64d8;
  --accent-2: #1d52bd;
  --accent-ink: #ffffff;
  --accent-soft: #e8efff;
  --ok: #157a41;
  --ok-soft: #e2f4ea;
  --on-ok: #ffffff;
  --warn: #95590a;
  --warn-soft: #fdf1dc;
  --bad: #b93030;
  --bad-soft: #fbe8e8;
  --on-bad: #ffffff;
  --note: #2a64d8;
  --note-soft: #eef3ff;
  --code-bg: #f6f8fb;
  --code-ink: #1f2937;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-2: 0 8px 24px -6px rgba(16, 24, 40, .14), 0 2px 6px rgba(16, 24, 40, .06);
  /* focus ring: a gap in the surface colour, then a solid accent band (m15) */
  --ring: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
  --ring-inset: inset 0 0 0 2px var(--accent);
  --img-filter: none;
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Inter, Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  /* syntax */
  --syn-kw: #c0337a;
  --syn-str: #0f7b55;
  --syn-num: #b45309;
  --syn-fn: #6b46c1;
  --syn-type: #0b6fa4;
  --syn-com: #5f6b7c;
  --syn-lit: #b45309;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f15;
    --bg-grad: radial-gradient(1200px 600px at 100% -10%, #121c2e 0%, transparent 60%);
    --surface: #121821;
    --surface-2: #171f2a;
    --surface-3: #1e2733;
    --line: #222c39;
    --line-2: #2f3b4b;
    --ink: #e8edf3;
    --ink-2: #a7b3c2;
    --ink-3: #8a96a8;
    --accent: #5b9dff;
    --accent-2: #7db1ff;
    --accent-ink: #06101f;
    --accent-soft: #15233a;
    --ok: #46c46a;
    --ok-soft: #10261a;
    --on-ok: #06101f;
    --warn: #e2a53c;
    --warn-soft: #2c2210;
    --bad: #f07272;
    --bad-soft: #321718;
    --on-bad: #06101f;
    --note: #6aa6ff;
    --note-soft: #121e31;
    --code-bg: #0d131b;
    --code-ink: #dbe3ec;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: 0 10px 30px -8px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .35);
    --ring: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
    --img-filter: brightness(.86);
    --syn-kw: #ff7ab2;
    --syn-str: #7ee0a8;
    --syn-num: #f5b56b;
    --syn-fn: #c4a5ff;
    --syn-type: #6cc6f5;
    --syn-com: #8a96a8;
    --syn-lit: #f5b56b;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0b0f15;
  --bg-grad: radial-gradient(1200px 600px at 100% -10%, #121c2e 0%, transparent 60%);
  --surface: #121821;
  --surface-2: #171f2a;
  --surface-3: #1e2733;
  --line: #222c39;
  --line-2: #2f3b4b;
  --ink: #e8edf3;
  --ink-2: #a7b3c2;
  --ink-3: #8a96a8;
  --accent: #5b9dff;
  --accent-2: #7db1ff;
  --accent-ink: #06101f;
  --accent-soft: #15233a;
  --ok: #46c46a;
  --ok-soft: #10261a;
  --on-ok: #06101f;
  --warn: #e2a53c;
  --warn-soft: #2c2210;
  --bad: #f07272;
  --bad-soft: #321718;
  --on-bad: #06101f;
  --note: #6aa6ff;
  --note-soft: #121e31;
  --code-bg: #0d131b;
  --code-ink: #dbe3ec;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 10px 30px -8px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .35);
  --ring: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
  --img-filter: brightness(.86);
  --syn-kw: #ff7ab2;
  --syn-str: #7ee0a8;
  --syn-num: #f5b56b;
  --syn-fn: #c4a5ff;
  --syn-type: #6cc6f5;
  --syn-com: #8a96a8;
  --syn-lit: #f5b56b;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--ink);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-sm); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 18px; height: 18px; flex-shrink: 0; }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { border-color: var(--ink-3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: var(--on-ok); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.sm { height: 30px; padding: 0 11px; font-size: 13px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; }
.btn.block { width: 100%; }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font-weight: 500; }
.linkbtn:hover { text-decoration: underline; }
.iconbtn {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--r-sm);
  border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer;
}
.iconbtn:hover { background: var(--surface-2); color: var(--ink); }

/* ------------------------------------------------------------ badges, chips */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px;
  border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .01em; white-space: nowrap;
  background: var(--surface-2); color: var(--ink-2);
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.open { background: var(--ok-soft); color: var(--ok); }
.badge.soon { background: var(--surface-3); color: var(--ink-3); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.chip {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px;
  font: 600 12px var(--mono); background: var(--surface-2); color: var(--ink-2);
}
.chip.good { background: var(--ok-soft); color: var(--ok); }
.chip.mid { background: var(--warn-soft); color: var(--warn); }
.chip.low { background: var(--bad-soft); color: var(--bad); }

/* ------------------------------------------------------------ app shell */
.shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100vh;
  /* paint the sidebar column to the bottom of long pages (the sidebar itself is sticky, 100vh) */
  background: linear-gradient(90deg, var(--surface) 0 271px, var(--line) 271px 272px, transparent 272px); }
.side {
  position: sticky; top: 0; height: 100vh; overflow: auto;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; font: 700 17px var(--display); letter-spacing: -.01em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #2f6fed, #7c4dff); box-shadow: 0 4px 12px -4px rgba(47, 111, 237, .6);
}
.nav { padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-label { padding: 14px 18px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.nav-item {
  display: flex; align-items: center; gap: 11px; height: 40px; padding: 0 10px; border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 500; cursor: pointer; border: 0; background: none; width: 100%; text-align: left;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.nav-item.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item.off { cursor: not-allowed; opacity: .6; }
.nav-item.off:hover { background: none; color: var(--ink-2); }
.nav-item .grow { flex: 1; }
.side-foot { margin-top: auto; padding: 14px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 20; height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; color: var(--ink-3); }
.crumbs a { color: var(--ink-2); }
.crumbs .sep { color: var(--line-2); }
.crumbs .cur { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top .grow { flex: 1; }
.user { display: flex; align-items: center; gap: 9px; padding: 4px 6px 4px 4px; border-radius: 999px; font-weight: 600; font-size: 14px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700;
  color: #fff; background: linear-gradient(135deg, #0ea5a4, #2f6fed);
}
.menu-btn { display: none; }
.content { padding: 32px 40px 72px; width: 100%; max-width: 1240px; margin: 0 auto; }
.content.narrow { max-width: 900px; }

/* ------------------------------------------------------------ page heads */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.h1 { font: 700 30px/1.15 var(--display); letter-spacing: -.02em; margin: 0; }
.h2 { font: 700 19px/1.3 var(--display); letter-spacing: -.01em; margin: 0; }
.sub { color: var(--ink-2); margin: 6px 0 0; font-size: 15.5px; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 36px 0 14px; font: 700 13px var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.section-title .count { font: 600 12px var(--mono); color: var(--ink-3); background: var(--surface-2); padding: 1px 7px; border-radius: 99px; letter-spacing: 0; }

/* ------------------------------------------------------------ course icon tiles */
.tile {
  --c1: #2f6fed; --c2: #7c4dff;
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; color: #fff; flex-shrink: 0;
  background: linear-gradient(140deg, var(--c1), var(--c2));
  box-shadow: 0 6px 16px -8px var(--c1), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.tile svg { width: 28px; height: 28px; }
.tile.sm { width: 34px; height: 34px; border-radius: 10px; }
.tile.sm svg { width: 19px; height: 19px; }
.tile.xl { width: 64px; height: 64px; border-radius: 18px; }
.tile.xl svg { width: 34px; height: 34px; }
.tile[data-icon="go"] { --c1: #00add8; --c2: #0077a8; }
.tile[data-icon="terraform"] { --c1: #8a54d6; --c2: #5c2da8; }
.tile[data-icon="python"] { --c1: #3776ab; --c2: #e0b52a; }
.tile[data-icon="kubernetes"] { --c1: #326ce5; --c2: #1d4fb8; }
.tile[data-icon="docker"] { --c1: #2496ed; --c2: #0f6dbb; }
.tile[data-icon="linux"] { --c1: #f2a516; --c2: #c56b06; }
.tile[data-icon="networking"] { --c1: #14b8a6; --c2: #0d7f86; }
.tile[data-icon="devops"] { --c1: #f97316; --c2: #d9431b; }
.tile[data-icon="fde"] { --c1: #6366f1; --c2: #4338ca; }
.tile[data-icon="ev-ocpp"] { --c1: #22c55e; --c2: #0f8a5f; }
.tile[data-icon="javascript"] { --c1: #e8b10c; --c2: #b7860b; }
.tile[data-icon="typescript"] { --c1: #3178c6; --c2: #1f5a9e; }
.tile[data-icon="html-css"] { --c1: #e5532d; --c2: #2965f1; }

/* ------------------------------------------------------------ continue hero */
.hero {
  position: relative; overflow: hidden; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 22px; align-items: center;
  padding: 24px 26px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(500px 200px at 0% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%);
}
.hero .kicker { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.hero .title { font: 700 21px/1.25 var(--display); margin: 3px 0 4px; letter-spacing: -.01em; }
.hero .next { color: var(--ink-2); font-size: 14.5px; }
.hero .next b { color: var(--ink); font-weight: 600; }
.hero .bar { margin-top: 12px; max-width: 420px; }

/* ------------------------------------------------------------ course cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.grid.soon { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.ccard {
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 20px; min-height: 236px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1);
  color: var(--ink); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
a.ccard:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--line-2); }
.ccard .row1 { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ccard .name { font: 700 19px/1.25 var(--display); letter-spacing: -.01em; margin: 0; }
.ccard .tag { color: var(--ink-2); font-size: 14px; margin: 4px 0 0; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ccard .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ink-3); }
.ccard .meta span { display: inline-flex; align-items: center; gap: 5px; }
.ccard .meta svg { width: 15px; height: 15px; }
.ccard .foot { margin-top: auto; display: flex; align-items: center; gap: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.ccard .foot .what { flex: 1; min-width: 0; font-size: 13.5px; color: var(--ink-2); }
.ccard .foot .what b { display: block; color: var(--ink); font-size: 14px; }
.ccard .go-arrow { color: var(--ink-3); transition: transform .18s, color .18s; }
a.ccard:hover .go-arrow { color: var(--accent); transform: translateX(3px); }
.ccard.soon { min-height: 0; gap: 10px; padding: 16px; background: var(--surface-2); box-shadow: none; border-style: dashed; }
.ccard.soon .tile { filter: grayscale(.85) opacity(.55); box-shadow: none; }
.ccard.soon .name { font-size: 16px; color: var(--ink-2); }
.ccard.soon .tag { font-size: 13px; color: var(--ink-3); -webkit-line-clamp: 3; }

/* progress ring */
.ring { position: relative; width: 52px; height: 52px; flex-shrink: 0; }
.ring svg { width: 52px; height: 52px; transform: rotate(-90deg); }
.ring .track { stroke: var(--surface-3); }
.ring .val { stroke: var(--accent); transition: stroke-dashoffset .6s ease; }
.ring.done .val { stroke: var(--ok); }
.ring .pct { position: absolute; inset: 0; display: grid; place-items: center; font: 700 12.5px var(--sans); }
.ring.lg, .ring.lg svg { width: 84px; height: 84px; }
.ring.lg .pct { font-size: 19px; }

/* progress bar */
.bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .5s ease; }
.bar.ok > i { background: var(--ok); }
.bar.thin { height: 5px; }

/* ------------------------------------------------------------ course sidebar (outline) */
.back {
  display: flex; align-items: center; gap: 8px; margin: 14px 12px 4px; padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 600; font-size: 14px; background: none; border: 0; cursor: pointer; width: calc(100% - 24px);
}
.back:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.course-head { display: flex; gap: 12px; align-items: center; padding: 12px 18px 6px; }
.course-head .t { display: inline-block; min-height: 24px; padding: 2px 0; font: 700 16px/1.25 var(--display); }
.course-head .s { font-size: 12.5px; color: var(--ink-3); }
.course-prog { padding: 8px 18px 14px; border-bottom: 1px solid var(--line); }
.course-prog .lbl { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink-3); margin-bottom: 7px; }
.course-prog .lbl b { color: var(--ink-2); }
.outline { list-style: none; margin: 0; padding: 10px 10px 18px; }
.outline li + li { margin-top: 2px; }
.trow {
  display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border-radius: var(--r-sm);
  color: var(--ink-2); font-size: 14px; line-height: 1.35;
}
.trow:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.trow.on { background: var(--accent-soft); color: var(--ink); }
.trow .st { width: 20px; height: 20px; flex-shrink: 0; margin-top: 0; display: grid; place-items: center; }
.trow .tt { flex: 1; min-width: 0; }
.trow .tt .n { color: var(--ink-3); font: 600 12px var(--mono); margin-right: 6px; }
.trow.on .tt { font-weight: 600; }
.trow .chip { margin-top: -1px; }
.st-todo { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); }
.st-cur { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--accent); box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 8px var(--accent); }
.st-done { width: 18px; height: 18px; border-radius: 50%; background: var(--ok); color: var(--on-ok); display: grid; place-items: center; }
.st-done svg { width: 12px; height: 12px; }
.subrows { margin: 2px 0 6px 30px; display: flex; flex-direction: column; gap: 1px; }
.subrow { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: var(--r-sm); font-size: 13.5px; color: var(--ink-2); }
.subrow:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
.subrow.on { color: var(--accent); font-weight: 600; }
.subrow svg { width: 15px; height: 15px; }
.subrow .grow { flex: 1; }

/* ------------------------------------------------------------ lesson */
.tracker {
  position: sticky; top: 60px; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 10px 40px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  font-size: 13px; color: var(--ink-3);
}
.tracker b { color: var(--ink); }
.segs { flex: 1; display: flex; gap: 4px; max-width: 520px; }
.segs a { flex: 1; height: 7px; border-radius: 99px; background: var(--surface-3); }
.segs a.done { background: var(--ok); }
.segs a.cur { background: var(--accent); }
.segs a.cur.done { background: linear-gradient(90deg, var(--ok), var(--accent)); }
.lesson-head { margin: 8px 0 26px; }
.lesson-head .eyeline { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 13.5px; font-weight: 600; }
.lesson-head .h1 { font-size: 34px; margin: 10px 0 10px; }
.lesson-head .summary { font-size: 17px; color: var(--ink-2); margin: 0 0 14px; max-width: 70ch; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; }
.fact { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; color: var(--ink-2); }
.fact svg { width: 15px; height: 15px; color: var(--ink-3); }
.fact.ok { border-color: color-mix(in srgb, var(--ok) 35%, transparent); color: var(--ok); background: var(--ok-soft); }
.fact.ok svg { color: var(--ok); }

.prose { font-size: 16.5px; line-height: 1.75; color: var(--ink); max-width: 760px; }
.prose > :first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 { font-family: var(--display); letter-spacing: -.015em; line-height: 1.3; scroll-margin-top: 120px; }
.prose h1 { font-size: 28px; margin: 2em 0 .6em; }
.prose h2 { font-size: 24px; margin: 2.1em 0 .6em; padding-bottom: .3em; border-bottom: 1px solid var(--line); }
.prose h3 { font-size: 19px; margin: 1.8em 0 .5em; }
.prose h4 { font-size: 16.5px; margin: 1.6em 0 .4em; }
.prose p { margin: 0 0 1.05em; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.1em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--ink-3); }
.prose strong { font-weight: 650; }
.prose a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.2em 0; }
.prose :not(pre) > code {
  font: 0.86em var(--mono); background: var(--surface-2); border: 1px solid var(--line); padding: .12em .38em; border-radius: 5px; color: var(--code-ink);
  overflow-wrap: anywhere;
}
/* Diagrams are drawn on white: a white card keeps them readable in dark mode,
   dimmed there so it does not glare (P9); full screen shows them undimmed. */
.prose img { max-width: 100%; height: auto; border-radius: var(--r); border: 1px solid var(--line); background: #fff; padding: 10px; display: block; margin: 1.4em auto; filter: var(--img-filter); }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; margin: 1.3em 0 1.5em; font-size: 15px; width: max-content; max-width: 100%; }
.prose th, .prose td { border: 1px solid var(--line); padding: 9px 13px; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); font-weight: 650; }
.prose tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.prose blockquote { margin: 1.4em 0; padding: 12px 18px; border-left: 3px solid var(--line-2); color: var(--ink-2); background: var(--surface); border-radius: 0 var(--r) var(--r) 0; }
.prose blockquote > :last-child { margin-bottom: 0; }
.prose blockquote.callout { position: relative; padding: 14px 18px 14px 50px; border: 1px solid; border-left-width: 4px; color: var(--ink); border-radius: var(--r); }
.prose blockquote.callout::before { content: ""; position: absolute; left: 16px; top: 16px; width: 20px; height: 20px; background: currentColor; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
.prose blockquote.callout-note { background: var(--note-soft); border-color: color-mix(in srgb, var(--note) 30%, transparent); border-left-color: var(--note); }
.prose blockquote.callout-note::before { color: var(--note); --ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'><circle cx='12' cy='12' r='9'/><path d='M12 11v6M12 7.5v.5'/></svg>"); }
.prose blockquote.callout-tip { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); border-left-color: var(--ok); }
.prose blockquote.callout-tip::before { color: var(--ok); --ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M9 18h6M10 21h4M12 3a6 6 0 0 0-3.6 10.8c.6.5 1 1.2 1.1 2.2h5c.1-1 .5-1.7 1.1-2.2A6 6 0 0 0 12 3z'/></svg>"); }
.prose blockquote.callout-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 32%, transparent); border-left-color: var(--warn); }
.prose blockquote.callout-warn::before { color: var(--warn); --ico: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 3 2 20h20L12 3z'/><path d='M12 10v4M12 17v.5'/></svg>"); }
.prose .callout-label { display: inline; margin-right: 4px; }
.prose figure.media { margin: 1.6em 0; }
.prose figure.media video, .prose figure.media iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 1px solid var(--line); border-radius: var(--r); background: #000; }
.prose figure.media figcaption { text-align: center; color: var(--ink-3); font-size: 13.5px; margin-top: 8px; }

/* code blocks */
.codeblock { position: relative; margin: 1.3em 0 1.5em; border: 1px solid var(--line); border-radius: var(--r); background: var(--code-bg); overflow: hidden; }
.codeblock .cb-head { display: flex; align-items: center; justify-content: space-between; height: 34px; padding: 0 8px 0 14px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface-2) 70%, var(--code-bg)); }
.codeblock .lang { font: 600 11.5px var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.codeblock pre { margin: 0; padding: 14px 16px; overflow-x: auto; font: 13.5px/1.65 var(--mono); color: var(--code-ink); tab-size: 4; }
.codeblock pre code { font: inherit; background: none; border: 0; padding: 0; }
.copy { height: 26px; padding: 0 9px; border-radius: 6px; border: 1px solid transparent; background: transparent; color: var(--ink-3); font-size: 12px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.copy:hover { background: var(--surface); border-color: var(--line); color: var(--ink); }
.copy svg { width: 14px; height: 14px; }

/* highlight.js tokens */
.hljs-keyword, .hljs-built_in.hljs-keyword, .hljs-meta .hljs-keyword { color: var(--syn-kw); }
.hljs-string, .hljs-regexp, .hljs-char.escape_ { color: var(--syn-str); }
.hljs-number, .hljs-literal { color: var(--syn-num); }
.hljs-title.function_, .hljs-title { color: var(--syn-fn); }
.hljs-type, .hljs-built_in, .hljs-title.class_ { color: var(--syn-type); }
.hljs-comment, .hljs-quote { color: var(--syn-com); font-style: italic; }
.hljs-meta, .hljs-attr, .hljs-variable { color: var(--syn-type); }
.hljs-params { color: inherit; }
.hljs-deletion { color: var(--bad); }
.hljs-addition { color: var(--ok); }

/* finish panel */
.finish { margin: 44px 0 24px; max-width: 760px; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); display: flex; gap: 18px; align-items: center; }
.finish .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.finish.done .ic { background: var(--ok-soft); color: var(--ok); }
.finish .ic svg { width: 24px; height: 24px; }
.finish .txt { flex: 1; min-width: 0; }
.finish .txt b { display: block; font: 700 17px var(--display); }
.finish .txt span { color: var(--ink-2); font-size: 14.5px; }
.finish .acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.finish.offer { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); background: linear-gradient(0deg, var(--surface), var(--surface)), var(--ok-soft); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 760px; margin-top: 18px; }
.pager a { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
.pager a .k { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.pager a.next { text-align: right; grid-column: 2; }
.pager a .t { font-weight: 600; }

/* ------------------------------------------------------------ course overview */
.cover { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px; align-items: center; margin-bottom: 24px; }
.cover .desc { color: var(--ink-2); font-size: 15.5px; max-width: 70ch; }
.cover .desc p { margin: 6px 0 0; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 22px 0 30px; }
.stat { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.stat .v { font: 700 22px var(--display); letter-spacing: -.01em; }
.stat .k { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.tlist { display: flex; flex-direction: column; gap: 10px; }
.titem { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); }
.titem:hover { border-color: var(--line-2); box-shadow: var(--shadow-1); text-decoration: none; }
.titem .num { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font: 700 15px var(--mono); background: var(--surface-2); color: var(--ink-2); }
.titem.done .num { background: var(--ok-soft); color: var(--ok); }
.titem .tt { font-weight: 650; font-size: 15.5px; }
.titem .ts { color: var(--ink-2); font-size: 13.5px; margin-top: 2px; }

/* ------------------------------------------------------------ practice test */
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); width: max-content; max-width: 100%; margin: 6px 0 24px; }
.tab { height: 36px; padding: 0 16px; border-radius: 9px; border: 0; background: transparent; color: var(--ink-2); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.tab:hover { color: var(--ink); }
.tab.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.tab .chip { height: 20px; }
.test-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 26px; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 650; }
.panel-b { padding: 16px 18px; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.history li:first-child { border-top: 0; }
.history .when { color: var(--ink-3); font-size: 12.5px; }
.history .bar { grid-column: 1 / -1; height: 4px; }
.empty-note { color: var(--ink-3); font-size: 13.5px; }
.sticky { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 16px; }

.q { scroll-margin: 90px 0 110px; padding: 20px 22px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.q.right { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); }
.q.wrong { border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.q-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-size: 12.5px; color: var(--ink-3); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.q-prompt { font-size: 16px; }
.q-prompt.prose { max-width: none; font-size: 16px; }
.q-prompt.prose p { margin-bottom: .6em; }
.opts { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.opt { scroll-margin: 90px 0 110px; display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); cursor: pointer; transition: border-color .12s, background .12s; }
.opt:hover { border-color: var(--line-2); background: var(--surface-2); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt .letter { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font: 700 12.5px var(--mono); border: 1px solid var(--line-2); color: var(--ink-2); flex-shrink: 0; background: var(--surface); }
.opt .otext { padding-top: 2px; min-width: 0; overflow-wrap: anywhere; }
.opt .otext code { font: .9em var(--mono); background: var(--surface-2); padding: .1em .35em; border-radius: 4px; border: 1px solid var(--line); }
.opt.sel { border-color: var(--accent); background: var(--accent-soft); }
.opt.sel .letter { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.opt:has(input:focus-visible) { box-shadow: var(--ring); }
.opts.marked .opt { cursor: default; }
.opts.marked .opt:hover { background: var(--surface); border-color: var(--line); }
.opt.is-answer { border-color: var(--ok); background: var(--ok-soft); }
.opt.is-answer .letter { background: var(--ok); border-color: var(--ok); color: var(--on-ok); }
.opt.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.is-wrong .letter { background: var(--bad); border-color: var(--bad); color: var(--on-bad); }
.opt .mark { margin-left: auto; font-size: 12px; font-weight: 700; padding-top: 4px; white-space: nowrap; }
.opt.is-answer .mark { color: var(--ok); }
.opt.is-wrong .mark { color: var(--bad); }
.verdict { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; letter-spacing: 0; text-transform: none; font-size: 13px; }
.verdict.ok { color: var(--ok); }
.verdict.no { color: var(--bad); }
.explain { margin-top: 14px; padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); font-size: 14.5px; color: var(--ink-2); }
.explain b { color: var(--ink); }
.explain.prose { max-width: none; font-size: 14.5px; line-height: 1.6; }
.submitbar { position: sticky; bottom: 16px; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); box-shadow: var(--shadow-2); }
.submitbar .grow { flex: 1; color: var(--ink-2); font-size: 14px; }
.submitbar .warn { color: var(--warn); }
.scorecard { display: flex; align-items: center; gap: 22px; padding: 22px 24px; margin-bottom: 18px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-1); }
.scorecard .big { font: 800 30px var(--display); letter-spacing: -.02em; }
.scorecard .msg { color: var(--ink-2); }
.scorecard .grow { flex: 1; }

/* exercises */
.ex-list { display: flex; flex-direction: column; gap: 6px; }
.ex-pick { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r); border: 1px solid transparent; background: none; text-align: left; cursor: pointer; color: var(--ink-2); width: 100%; }
.ex-pick:hover { background: var(--surface-2); color: var(--ink); }
.ex-pick.on { border-color: var(--line); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.ex-pick .n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font: 700 12px var(--mono); background: var(--surface-3); flex-shrink: 0; }
.ex-pick.solved .n { background: var(--ok); color: var(--on-ok); }
.ex-pick .tt { flex: 1; font-weight: 600; font-size: 14px; }
.ex-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.ex-prompt { margin-bottom: 16px; }
.ex-prompt.prose { max-width: none; font-size: 15.5px; }
.editor { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--code-bg); box-shadow: var(--shadow-1); }
.editor-bar { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 8px 0 0; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.filetab { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px; font: 600 13px var(--mono); color: var(--ink); background: var(--code-bg); border-right: 1px solid var(--line); }
.filetab .dotmod { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); display: none; }
.filetab.dirty .dotmod { display: block; }
.editor-bar .grow { flex: 1; }
.kbd { font: 600 11px var(--mono); padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line-2); color: var(--ink-3); background: var(--surface); }
.hint { color: var(--ink-3); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.result { margin-top: 16px; }
.result-h { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.result-h .ttl { font-weight: 700; }
.result-h .grow { flex: 1; }
.tests { list-style: none; margin: 0; padding: 6px 0; }
.tests li { display: flex; align-items: center; gap: 10px; padding: 7px 18px; font: 13px var(--mono); }
.tests li .tag { font: 600 11px var(--sans); color: var(--ink-3); background: var(--surface-2); padding: 1px 7px; border-radius: 99px; }
.tests li .res { margin-left: auto; font: 700 12px var(--sans); }
.tests li.pass .res { color: var(--ok); }
.tests li.fail .res { color: var(--bad); }
.tdot { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.tdot svg { width: 11px; height: 11px; }
.pass .tdot { background: var(--ok); }
.fail .tdot { background: var(--bad); }
.term { margin: 0; padding: 14px 18px; max-height: 300px; overflow: auto; font: 12.5px/1.6 var(--mono); color: var(--ink-2); background: var(--code-bg); border-top: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); font-size: 14px; margin: 12px 0; }
.alert.err { background: var(--bad-soft); color: var(--bad); }
.alert.info { background: var(--note-soft); color: var(--note); }
.alert svg { margin-top: 1px; }

/* ------------------------------------------------------------ states */
.state { display: grid; place-items: center; text-align: center; padding: 70px 20px; }
.state .ic { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-3); margin: 0 auto 16px; }
.state .ic svg { width: 30px; height: 30px; }
.state h2 { font: 700 20px var(--display); margin: 0 0 6px; }
.state p { color: var(--ink-2); margin: 0 0 18px; max-width: 46ch; }
.skel { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--r); }
@keyframes shimmer { to { background-position: -200% 0; } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); opacity: 0; z-index: 100; padding: 11px 18px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 14px; box-shadow: var(--shadow-2); transition: opacity .2s, transform .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ------------------------------------------------------------ login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 400px; padding: 34px 32px 28px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); }
.login-card .brand { padding: 0; margin-bottom: 26px; }
.login-card h1 { font: 700 25px var(--display); letter-spacing: -.02em; margin: 0 0 6px; }
.login-card .sub { margin: 0 0 24px; font-size: 14.5px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.input { position: relative; }
.input input { width: 100%; height: 44px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 15px var(--sans); transition: border-color .15s, box-shadow .15s; }
.input input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.input .peek { position: absolute; right: 4px; top: 4px; }
.input.pw input { padding-right: 46px; }
.login-card .foot { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 12.5px; display: flex; align-items: center; gap: 8px; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .test-layout { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); background: none; }
  .grid.soon { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ccard.soon { padding: 12px; }
  .ccard.soon .row1 .badge { display: none; }
  .ccard.soon .tag { -webkit-line-clamp: 3; font-size: 12.5px; }
  .side { position: fixed; left: 0; top: 0; z-index: 50; width: 286px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-2); }
  .shell.nav-open .side { transform: none; }
  .shell.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 40; }
  .menu-btn { display: grid; }
  .top { padding: 0 12px; }
  .content { padding: 22px 16px 60px; }
  .tracker { padding: 10px 16px; }
  .hero { grid-template-columns: auto minmax(0, 1fr); }
  .hero .btn { grid-column: 1 / -1; }
  .user .uname { display: none; }
  .finish { flex-direction: column; align-items: flex-start; }
  .finish .acts { justify-content: flex-start; }
  .lesson-head .h1 { font-size: 27px; }
}

/* ------------------------------------------------------------ sign-up (public page) */
.login-card.wide { max-width: 460px; }
.input select { width: 100%; height: 44px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 15px var(--sans); }
.input select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.phone-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px; }
.field .hint { font-size: 12.5px; color: var(--ink-3); margin: 0; }
.field .ferr { font-size: 12.5px; color: var(--bad); margin: 0; }
.field.bad input, .field.bad select { border-color: var(--bad); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); margin: 4px 0 16px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--accent); flex: none; }
.code-input input { letter-spacing: .4em; font: 600 22px var(--mono, var(--sans)); text-align: center; height: 52px; }
.login-card .alt { margin: 18px 0 0; font-size: 14px; text-align: center; color: var(--ink-2); }
.login-card .alt a { font-weight: 600; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.linkbtn:disabled { color: var(--ink-3); cursor: default; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; font-size: 14px; }
@media (max-width: 420px) { .login-card { padding: 26px 18px 22px; } .phone-row { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ public pages: wide sign-up, animated background (Mel 22306) */
.login-card.signup-card { max-width: 900px; padding: 30px 34px 22px; }
.signup-card .brand { margin-bottom: 18px; }
.signup-card h1 { font-size: 24px; }
.signup-card .sub { margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 28px; }
.form-grid .field { margin-bottom: 13px; }
.form-grid .col-span { grid-column: 1 / -1; }
.signup-card .field .hint { font-size: 12px; }
.signup-card #step-code, .signup-card #step-done { max-width: 420px; margin: 0 auto; }
.check a { font-weight: 600; }
.check-group { display: grid; gap: 4px; margin-top: 2px; }
.check-group .check { margin: 0; }
.signup-card .alt { margin-top: 12px; }
.signup-card .foot { margin-top: 14px; padding-top: 12px; }
@media (max-width: 760px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .login-card.signup-card { padding: 26px 18px 20px; }
}

/* Calm moving colour behind the sign-in pages: CSS only, transform-only animation
   (no blur filters, cheap on phones), off for people who ask for less motion. */
.auth-page { position: relative; overflow-x: hidden; }
.auth-page::before, .auth-page::after {
  content: ""; position: fixed; z-index: -1; pointer-events: none; border-radius: 50%;
  width: 70vmax; height: 70vmax; opacity: .55; will-change: transform;
}
.auth-page::before {
  top: -30vmax; left: -20vmax;
  background: radial-gradient(closest-side, var(--accent-soft), transparent 70%);
  animation: auth-drift-a 38s ease-in-out infinite alternate;
}
.auth-page::after {
  bottom: -35vmax; right: -25vmax;
  background: radial-gradient(closest-side, var(--note-soft), transparent 70%);
  animation: auth-drift-b 46s ease-in-out infinite alternate;
}
@keyframes auth-drift-a { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(18vmax, 10vmax, 0) scale(1.15); } }
@keyframes auth-drift-b { from { transform: translate3d(0, 0, 0) scale(1.1); } to { transform: translate3d(-16vmax, -12vmax, 0) scale(.95); } }
@media (prefers-reduced-motion: reduce) { .auth-page::before, .auth-page::after { animation: none; } }

/* Terms and privacy pages */
.legal-wrap { max-width: 780px; margin: 0 auto; padding: 32px 22px 60px; }
.legal-wrap .brand { margin-bottom: 18px; }
.legal-wrap h1 { font: 700 28px var(--display); letter-spacing: -.02em; margin: 6px 0 4px; }
.legal-wrap h2 { font: 700 18px var(--display); margin: 26px 0 8px; }
.legal-wrap p, .legal-wrap li { color: var(--ink-2); line-height: 1.65; font-size: 15px; }
.legal-wrap .meta { color: var(--ink-3); font-size: 13.5px; margin: 0 0 14px; }
.draft-flag { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--bad-soft); color: var(--bad); font-weight: 700; font-size: 12.5px; }
