/* ==========================================================================
   UI Design Studio — course stylesheet
   Direction: "Riso studio" — misregistered ink, spec-sheet annotations,
   grotesk display type, plate-blue + fluoro-pink pigments.
   ========================================================================== */

/* ---------- 1. Tokens ----------------------------------------------------- */
:root {
  /* pigments */
  --plate:        #2340D9;   /* primary ink  */
  --plate-deep:   #1A32B4;
  --plate-soft:   #E7EAFD;
  --fluoro:       #FF3D8B;   /* accent ink   */
  --fluoro-soft:  #FFE6F0;
  --leaf:         #00915A;   /* success      */
  --leaf-soft:    #E0F5EC;
  --sun:          #FFC629;   /* highlight    */
  --sun-soft:     #FFF4D6;

  /* neutrals */
  --paper:        #F1F1EC;
  --surface:      #FFFFFF;
  --surface-2:    #FAFAF7;
  --ink:          #15172B;
  --ink-2:        #3A3E58;
  --muted:        #62667E;
  --line:         rgba(21, 23, 43, .14);
  --line-strong:  rgba(21, 23, 43, .30);
  --shadow:       0 1px 2px rgba(21,23,43,.06), 0 8px 24px -12px rgba(21,23,43,.18);
  --shadow-lift:  0 2px 4px rgba(21,23,43,.08), 0 18px 40px -16px rgba(21,23,43,.28);

  /* type */
  --display: "Bricolage Grotesque", "Poppins", ui-sans-serif, system-ui, sans-serif;
  --body:    "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* space scale (4pt base, 8pt rhythm) */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;

  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-xl: 24px; --r-pill: 999px;
  --header-h: 60px;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

html[data-theme="dark"] {
  --plate:        #8C9BFF;
  --plate-deep:   #A8B4FF;
  --plate-soft:   #24284A;
  --fluoro:       #FF74AC;
  --fluoro-soft:  #3A2036;
  --leaf:         #46D69B;
  --leaf-soft:    #12332A;
  --sun:          #FFD75E;
  --sun-soft:     #38300F;
  --paper:        #101120;
  --surface:      #191B2B;
  --surface-2:    #1F2134;
  --ink:          #ECEDF5;
  --ink-2:        #C3C6DA;
  --muted:        #9095AE;
  --line:         rgba(236, 237, 245, .16);
  --line-strong:  rgba(236, 237, 245, .34);
  --shadow:       0 1px 2px rgba(0,0,0,.4), 0 10px 30px -14px rgba(0,0,0,.6);
  --shadow-lift:  0 2px 6px rgba(0,0,0,.5), 0 22px 48px -18px rgba(0,0,0,.7);
}

/* ---------- 2. Base ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
body {
  margin: 0;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.12; margin: 0 0 var(--s3); letter-spacing: -.02em; font-weight: 700; }
h1 { font-size: clamp(28px, 6vw, 44px); }
h2 { font-size: clamp(22px, 4.4vw, 30px); }
h3 { font-size: clamp(18px, 3.4vw, 21px); }
p  { margin: 0 0 var(--s3); }
a  { color: var(--plate); text-decoration-thickness: 1px; text-underline-offset: 3px; }
img, svg { max-width: 100%; }
code, kbd { font-family: var(--mono); font-size: .88em; background: var(--plate-soft); color: var(--ink); padding: 1px 5px; border-radius: var(--r-sm); }
:focus-visible { outline: 3px solid var(--fluoro); outline-offset: 2px; border-radius: 3px; }
::selection { background: var(--sun); color: #15172B; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--s3); top: -60px; z-index: 200;
  background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: var(--r-md);
  transition: top .18s var(--ease);
}
.skip-link:focus { top: var(--s3); }

/* ---------- 3. Brand marks ------------------------------------------------ */
.mark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; font-family: var(--display); font-weight: 700; letter-spacing: -.02em; }
.mark__glyph {
  width: 30px; height: 30px; border-radius: 8px; flex: none; position: relative;
  background: var(--plate); box-shadow: 3px 3px 0 var(--fluoro);
}
.mark__glyph::after {
  content: ""; position: absolute; inset: 7px 7px auto 7px; height: 3px;
  background: #fff; box-shadow: 0 6px 0 rgba(255,255,255,.75), 0 12px 0 rgba(255,255,255,.45);
}
/* misregistered "riso" headline — the cover signature */
.riso {
  font-family: var(--display); font-weight: 800; letter-spacing: -.035em; line-height: .95;
  color: var(--ink);
  text-shadow: .055em .045em 0 var(--fluoro), -.05em -.035em 0 var(--plate);
}

/* ---------- 4. Buttons & pills ------------------------------------------- */
.btn {
  --btn-bg: var(--plate); --btn-fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border: 1px solid transparent; cursor: pointer;
  font: 600 15px/1.2 var(--body); color: var(--btn-fg); background: var(--btn-bg);
  border-radius: var(--r-md); text-decoration: none;
  transition: transform .12s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.btn:hover { background: var(--plate-deep); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0) scale(.99); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--plate); color: var(--plate); }
.btn--quiet { --btn-bg: transparent; --btn-fg: var(--muted); min-height: 36px; padding: 6px 10px; }
.btn--quiet:hover { background: var(--surface-2); color: var(--ink); }
.btn--accent { --btn-bg: var(--fluoro); }
.btn--accent:hover { background: #E92E79; }
.btn--sm { min-height: 36px; padding: 6px 12px; font-size: 13.5px; }
.btn--block { width: 100%; }
.btn--icon { min-width: 44px; padding: 8px; }
html[data-theme="dark"] .btn { --btn-fg: #10111F; }
html[data-theme="dark"] .btn--ghost, html[data-theme="dark"] .btn--quiet { --btn-fg: var(--ink); }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px;
  border-radius: var(--r-pill); font: 600 11.5px/1.5 var(--mono); letter-spacing: .04em;
  text-transform: uppercase; background: var(--plate-soft); color: var(--plate);
}
.pill--fluoro { background: var(--fluoro-soft); color: var(--fluoro); }
.pill--leaf { background: var(--leaf-soft); color: var(--leaf); }
.pill--sun  { background: var(--sun-soft); color: #8A6300; }
html[data-theme="dark"] .pill--sun { color: var(--sun); }

/* ---------- 5. App shell -------------------------------------------------- */
.appbar {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: var(--s3);
  height: var(--header-h); padding: 0 var(--s4);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.appbar__spacer { flex: 1; }
.appbar__title { font: 600 14px/1.2 var(--mono); color: var(--muted); letter-spacing: .02em; }
.ring { --p: 0; width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--leaf) calc(var(--p) * 1%), var(--line) 0); position: relative; }
.ring::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--surface); }
.ring span { position: relative; font: 700 10px/1 var(--mono); color: var(--ink); }
.appbar .btn { gap: 6px; }
@media (max-width: 620px) {
  .appbar { gap: 4px; padding: 0 10px; }
  .appbar__title { display: none; }
  .appbar .lbl { display: none; }
  .appbar .btn--quiet { padding: 6px 8px; min-width: 40px; justify-content: center; }
}

.layout { display: grid; grid-template-columns: 288px minmax(0, 1fr); gap: var(--s6); max-width: 1320px; margin: 0 auto; padding: var(--s5) var(--s4) var(--s8); }
.main { min-width: 0; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: var(--s4); padding: var(--s4) var(--s3) 96px; }
}

/* ---------- 6. Contents / TOC -------------------------------------------- */
.toc { position: sticky; top: calc(var(--header-h) + var(--s5)); align-self: start; max-height: calc(100vh - var(--header-h) - var(--s7)); overflow: auto; padding-right: 4px; }
.toc__search { width: 100%; margin-bottom: var(--s3); }
.toc__group { margin-bottom: var(--s4); }
.toc__group h4 { font: 600 11px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 8px; }
.toc__link {
  display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: var(--r-sm);
  color: var(--ink-2); text-decoration: none; font-size: 14.5px; line-height: 1.35;
}
.toc__link:hover { background: var(--surface); color: var(--ink); }
.toc__link[aria-current="true"] { background: var(--plate-soft); color: var(--plate); font-weight: 600; }
.toc__link .tick { width: 16px; height: 16px; flex: none; border: 1.5px solid var(--line-strong); border-radius: 4px; display: grid; place-items: center; font-size: 10px; color: transparent; }
.toc__link.is-done .tick { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.toc__num { font: 600 11px/1 var(--mono); color: var(--muted); width: 22px; flex: none; }

@media (max-width: 900px) {
  .toc {
    position: fixed; inset: auto 0 0 0; top: auto; z-index: 80; max-height: 74vh;
    background: var(--surface); border-top: 2px solid var(--ink);
    border-radius: var(--r-xl) var(--r-xl) 0 0; padding: var(--s4) var(--s4) calc(var(--s6) + env(safe-area-inset-bottom));
    box-shadow: var(--shadow-lift); transform: translateY(102%); transition: transform .28s var(--ease); visibility: hidden;
  }
  .toc.is-open { transform: none; visibility: visible; }
  .toc__handle { width: 44px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: 0 auto var(--s3); }
}
@media (min-width: 901px) { .toc__handle, .toc__close { display: none; } }

.fab-bar {
  position: fixed; z-index: 70; bottom: 0; left: 0; right: 0; display: none;
  gap: var(--s2); padding: var(--s2) var(--s3) calc(var(--s2) + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
@media (max-width: 900px) { .fab-bar { display: flex; } .fab-bar .btn { flex: 1; } }
.scrim { position: fixed; inset: 0; background: rgba(10,11,22,.5); z-index: 75; opacity: 0; pointer-events: none; transition: opacity .2s var(--ease); }
.scrim.is-open { opacity: 1; pointer-events: auto; }

/* ---------- 7. Cards, prose, progress ------------------------------------ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); box-shadow: var(--shadow); }
@media (max-width: 560px) { .card { padding: var(--s4); border-radius: var(--r-md); } }
.card--flat { box-shadow: none; }
.grid { display: grid; gap: var(--s4); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.bar { height: 8px; border-radius: var(--r-pill); background: var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--plate), var(--fluoro)); transition: width .5s var(--ease); }

.meta { font: 500 12.5px/1.5 var(--mono); color: var(--muted); letter-spacing: .02em; }
.lede { font-size: 17.5px; color: var(--ink-2); max-width: 62ch; }

/* lesson */
.lesson { scroll-margin-top: calc(var(--header-h) + 16px); margin-bottom: var(--s5); }
.lesson__head { display: flex; align-items: flex-start; gap: var(--s3); flex-wrap: wrap; }
.lesson__idx { font: 700 12px/1 var(--mono); color: var(--fluoro); padding-top: 6px; }
.lesson__title { flex: 1 1 240px; margin: 0; }
.lesson h3 + p { margin-top: 8px; }
.prose { max-width: 68ch; }
.prose p { color: var(--ink-2); }
.prose strong { color: var(--ink); }
.tabs { display: flex; gap: 4px; margin: var(--s4) 0 var(--s3); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab {
  appearance: none; background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer;
  padding: 9px 12px; font: 600 13.5px/1 var(--body); color: var(--muted); min-height: 40px;
}
.tab[aria-selected="true"] { color: var(--plate); border-bottom-color: var(--plate); }
.tab:hover { color: var(--ink); }
.panel[hidden] { display: none; }

.keypoints { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.keypoints li { display: flex; gap: 10px; font-size: 14.8px; color: var(--ink-2); }
.keypoints li::before { content: "▚"; color: var(--fluoro); font-size: 11px; line-height: 1.7; flex: none; }
.snippet { margin: 0; padding: var(--s3) var(--s4); border-radius: var(--r-md); background: var(--ink); color: #F4F5FF; overflow-x: auto; }
.snippet code { background: none; color: inherit; font-size: 12.8px; line-height: 1.7; padding: 0; white-space: pre; }
.callout { border-left: 3px solid var(--sun); background: var(--sun-soft); padding: var(--s3) var(--s4); border-radius: 0 var(--r-md) var(--r-md) 0; font-size: 14.5px; }
.lesson__foot { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-top: var(--s4); padding-top: var(--s3); border-top: 1px dashed var(--line); }

.done-toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 14.5px; min-height: 44px; }
.done-toggle input { width: 22px; height: 22px; accent-color: var(--leaf); }

/* ---------- 8. Demo stage (+ spec mode signature) ------------------------ */
.demo { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface-2); }
.demo__bar { display: flex; align-items: center; gap: var(--s2); padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
.demo__bar h4 { margin: 0; font: 600 12px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stage { padding: var(--s5) var(--s4); position: relative; container-type: inline-size; }
.stage--pad-sm { padding: var(--s3); }
.controls { display: grid; gap: var(--s3); padding: var(--s4); border-top: 1px dashed var(--line); background: var(--surface); grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.ctrl { display: grid; gap: 6px; }
.ctrl > label { font: 600 12px/1.3 var(--body); color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.ctrl output { font-family: var(--mono); font-size: 11.5px; color: var(--plate); }
input[type="range"] { width: 100%; accent-color: var(--plate); height: 28px; }
select, input[type="text"], input[type="email"], input[type="number"], textarea {
  font: 500 14.5px/1.4 var(--body); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 9px 11px; min-height: 42px; width: 100%;
}
input[type="color"] { width: 100%; height: 42px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); padding: 3px; }
.switch { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--ink-2); min-height: 42px; cursor: pointer; }
.switch input { appearance: none; width: 42px; height: 24px; border-radius: var(--r-pill); background: var(--line-strong); position: relative; cursor: pointer; transition: background .18s var(--ease); flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .18s var(--ease); }
.switch input:checked { background: var(--plate); }
.switch input:checked::after { transform: translateX(18px); }

/* SPEC MODE — reveals the measurements behind any example */
body[data-spec="on"] .stage { background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% 8px; }
body[data-spec="on"] .stage * { outline: 1px dashed color-mix(in srgb, var(--plate) 55%, transparent); outline-offset: -1px; }
body[data-spec="on"] [data-spec]::before {
  content: attr(data-spec); position: absolute; transform: translateY(-100%);
  font: 600 9.5px/1.6 var(--mono); background: var(--fluoro); color: #fff; padding: 0 5px; border-radius: 3px; z-index: 5; white-space: nowrap;
}
body[data-spec="on"] [data-spec] { position: relative; }

/* ---------- 9. Demo kit (classes reused by lesson examples) -------------- */
.dk-row { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }
.dk-col { display: flex; flex-direction: column; gap: var(--s2); }
.dk-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s4); box-shadow: var(--shadow); }
.dk-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 9px 16px; border-radius: 8px; border: 1px solid transparent; background: var(--plate); color: #fff; font: 600 14px/1 var(--body); cursor: pointer; }
.dk-btn--2 { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.dk-btn--3 { background: none; color: var(--plate); }
.dk-btn--danger { background: #D42D3F; }
.dk-input { display: block; width: 100%; }
.dk-label { display: block; font: 600 13px/1.4 var(--body); margin-bottom: 4px; color: var(--ink); }
.dk-help { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.dk-err { font-size: 12.5px; color: #D42D3F; margin-top: 4px; font-weight: 600; }
.dk-thumb { border-radius: 8px; background: linear-gradient(135deg, var(--plate), var(--fluoro)); }
.dk-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--plate-soft); color: var(--plate); display: grid; place-items: center; font-weight: 700; flex: none; }
.dk-skel { background: linear-gradient(90deg, var(--line) 25%, var(--surface-2) 37%, var(--line) 63%); background-size: 400% 100%; border-radius: 6px; height: 12px; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.dk-spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--plate); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.dk-phone { width: 232px; max-width: 100%; height: 340px; border: 8px solid var(--ink); border-radius: 26px; background: var(--surface); overflow: hidden; position: relative; display: flex; flex-direction: column; }
.dk-note { font-size: 12.5px; color: var(--muted); }
.dk-swatch { height: 46px; border-radius: 8px; border: 1px solid var(--line); }
.dk-tag { display: inline-block; padding: 2px 8px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 700; background: var(--plate-soft); color: var(--plate); }
.dk-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.dk-table th, .dk-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.dk-table th { font: 600 11.5px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.dk-bad { border: 1px solid #D42D3F; background: color-mix(in srgb, #D42D3F 8%, transparent); border-radius: var(--r-md); padding: var(--s3); }
.dk-good { border: 1px solid var(--leaf); background: var(--leaf-soft); border-radius: var(--r-md); padding: var(--s3); }

/* ---------- 10. Toast, sheet, dialog ------------------------------------- */
.toasts { position: fixed; z-index: 200; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 8px; width: min(420px, calc(100vw - 24px)); }
.toast { background: var(--ink); color: #F5F6FF; padding: 12px 16px; border-radius: var(--r-md); font-size: 14.5px; box-shadow: var(--shadow-lift); animation: rise .25s var(--ease); display: flex; gap: 10px; align-items: center; }
.toast--ok { background: var(--leaf); color: #04231A; }
.toast--warn { background: var(--sun); color: #3A2B00; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

dialog { border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); max-width: min(520px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lift); }
dialog::backdrop { background: rgba(10,11,22,.55); backdrop-filter: blur(2px); }

/* ---------- 11. Sign-in cover -------------------------------------------- */
.cover { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
@media (max-width: 900px) { .cover { grid-template-columns: 1fr; } }
.cover__art {
  position: relative; overflow: hidden; padding: var(--s7) var(--s6);
  background: var(--paper); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--s6);
}
.cover__art::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 32px 32px; mask-image: radial-gradient(120% 90% at 20% 10%, #000 30%, transparent 78%);
}
.cover__art > * { position: relative; }
.cover__ticks { display: flex; gap: 6px; align-items: flex-end; height: 26px; }
.cover__ticks i { width: 2px; background: var(--line-strong); height: 8px; }
.cover__ticks i:nth-child(5n+1) { height: 22px; background: var(--fluoro); }
.cover__form { display: grid; place-items: center; padding: var(--s6) var(--s5); background: var(--surface); }
.cover__form form { width: min(400px, 100%); }
.field { margin-bottom: var(--s4); }
.field label { display: block; font: 600 13px/1.4 var(--body); margin-bottom: 6px; }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.field-err { color: #D42D3F; font-size: 13px; font-weight: 600; margin-top: 6px; display: none; }
.field.is-invalid input { border-color: #D42D3F; }
.field.is-invalid .field-err { display: block; }
.stats-row { display: flex; gap: var(--s5); flex-wrap: wrap; }
.stat b { display: block; font-family: var(--display); font-size: 26px; line-height: 1.1; }
.stat span { font: 500 11.5px/1.4 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

/* ---------- 12. Dashboard ------------------------------------------------ */
.wrap { max-width: 1120px; margin: 0 auto; padding: var(--s6) var(--s4) var(--s8); }
@media (max-width: 560px) { .wrap { padding: var(--s5) var(--s3) 96px; } }
.level-card { display: flex; flex-direction: column; gap: var(--s3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); box-shadow: var(--shadow); text-decoration: none; color: inherit; transition: transform .16s var(--ease), box-shadow .2s var(--ease); }
.level-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.level-card__n { font: 700 34px/1 var(--display); color: var(--plate-soft); }
html[data-theme="dark"] .level-card__n { color: var(--plate-soft); }
.datarow { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }
.glossary-item { border-bottom: 1px dashed var(--line); padding: var(--s3) 0; }
.glossary-item b { font-family: var(--display); }
.tickmark { color: var(--leaf); font-weight: 700; }
footer.site { border-top: 1px solid var(--line); padding: var(--s5) var(--s4) calc(var(--s6) + env(safe-area-inset-bottom)); text-align: center; color: var(--muted); font-size: 13.5px; }
.print-hint { display: none; }
@media print {
  .appbar, .toc, .fab-bar, .controls, .demo__bar, .btn, footer.site { display: none !important; }
  body { background: #fff; }
  .print-hint { display: block; }
}
