/* OT Tools: bright, friendly and OT themed. A warm cream "pegboard" background, a colour for
   each section, chunky buttons, and illustrations (art.js) that use the palette below, so
   everything follows light and dark mode. */

:root {
  color-scheme: light;
  --bg: #fdf8ef;
  --dot: #eadfcb;
  --surface: #ffffff;
  --sunk: #f6efe3;
  --text: #2b2433;
  --muted: #6e6577;
  --line: #e8dfd0;
  --ink: #2b2433;
  --skin: #ffd9b8;
  --mark: #ffe58a;
  --danger: #c0392b;

  /* The fun colours */
  --c-coral: #ff7a59;
  --c-sun: #ffc53d;
  --c-mint: #2fbf9b;
  --c-sky: #4f9cf0;
  --c-grape: #9b72e6;
  --c-pink: #f06aa6;

  /* Text-safe versions for small type on light backgrounds */
  --t-coral: #c94a2a;
  --t-sun: #a46a00;
  --t-mint: #13866b;
  --t-sky: #2465b8;
  --t-grape: #6f45bf;
  --t-pink: #b8306f;

  --accent: var(--c-mint);
  --accent-strong: #149b7b;
  --accent-text: #ffffff;
  --accent-soft: #d9f5ec;

  --k-condition: var(--c-grape);
  --k-intervention: var(--c-mint);
  --k-assessment: var(--c-sun);
  --k-case: var(--c-sky);

  --radius: 18px;
  --shadow: 0 2px 0 var(--line), 0 8px 24px rgb(43 36 51 / 0.06);
  --display: "Fredoka", "Nunito", system-ui, sans-serif;
  --sans: "Nunito", system-ui, -apple-system, sans-serif;
}

/* Dark: follows the device unless a choice was made with the toggle (theme.js sets data-theme) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #17151d;
    --dot: #26222f;
    --surface: #211e29;
    --sunk: #1b1923;
    --text: #f3eef8;
    --muted: #a99fb5;
    --line: #342f3e;
    --ink: #120f17;
    --skin: #f0c49e;
    --mark: #6b5414;
    --danger: #ff8a73;
    --c-coral: #ff8a6b;
    --c-sun: #ffd060;
    --c-mint: #4fd6b2;
    --c-sky: #6eb0ff;
    --c-grape: #b394f2;
    --c-pink: #ff86bb;
    --t-coral: #ff9f86;
    --t-sun: #ffd36b;
    --t-mint: #6fe0c1;
    --t-sky: #8cc0ff;
    --t-grape: #c4a9ff;
    --t-pink: #ff9cc8;
    --accent-strong: #2fb895;
    --accent-text: #0f1f1a;
    --accent-soft: #1f3b33;
    --shadow: 0 2px 0 #0e0c12, 0 8px 24px rgb(0 0 0 / 0.25);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17151d;
  --dot: #26222f;
  --surface: #211e29;
  --sunk: #1b1923;
  --text: #f3eef8;
  --muted: #a99fb5;
  --line: #342f3e;
  --ink: #120f17;
  --skin: #f0c49e;
  --mark: #6b5414;
  --danger: #ff8a73;
  --c-coral: #ff8a6b;
  --c-sun: #ffd060;
  --c-mint: #4fd6b2;
  --c-sky: #6eb0ff;
  --c-grape: #b394f2;
  --c-pink: #ff86bb;
  --t-coral: #ff9f86;
  --t-sun: #ffd36b;
  --t-mint: #6fe0c1;
  --t-sky: #8cc0ff;
  --t-grape: #c4a9ff;
  --t-pink: #ff9cc8;
  --accent-strong: #2fb895;
  --accent-text: #0f1f1a;
  --accent-soft: #1f3b33;
  --shadow: 0 2px 0 #0e0c12, 0 8px 24px rgb(0 0 0 / 0.25);
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--text);
  font: 16px/1.6 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* A pegboard: soft dots on cream */
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1.6px, transparent 1.7px);
  background-size: 22px 22px;
}
a { color: var(--t-mint); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0 0 0.4em; }
h1 { font-size: clamp(2rem, 4.5vw, 2.9rem); letter-spacing: -0.01em; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.12rem; }
p { margin: 0 0 0.8em; }
button, input, select, textarea { font: inherit; color: inherit; }
mark { background: var(--mark); color: inherit; border-radius: 4px; padding: 0 3px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.boot { padding: 4rem 1rem; text-align: center; color: var(--muted); }
svg.art { display: block; width: 100%; height: auto; }

/* Each section has its own colour (set on <body> by app.js) */
body { --sec: var(--c-mint); --sec-t: var(--t-mint); }
body[data-section="browse"], body[data-section="entry"], body[data-section="search"] { --sec: var(--c-grape); --sec-t: var(--t-grape); }
body[data-section="activities"] { --sec: var(--c-coral); --sec-t: var(--t-coral); }
body[data-section="sources"] { --sec: var(--c-sky); --sec-t: var(--t-sky); }
body[data-section="tools"], body[data-section="goals"], body[data-section="norms"], body[data-section="handouts"],
body[data-section="practice"], body[data-section="glossary"], body[data-section="reports"], body[data-section="milestones"],
body[data-section="mmt"], body[data-section="foundations"] { --sec: var(--c-sun); --sec-t: var(--t-sun); }

/* ---------- Header ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 3px solid var(--sec);
}
.brand { display: flex; align-items: center; gap: 0.45rem; font-family: var(--display); font-weight: 600; font-size: 1.3rem; color: var(--text); text-decoration: none; }
.mark { display: block; width: 2.4rem; height: 2.4rem; transition: transform 0.3s ease; }
.mark svg { width: 100%; height: 100%; display: block; }
.brand:hover .mark { transform: rotate(-12deg) scale(1.06); }
.nav { display: flex; gap: 0.3rem; }
.nav a { padding: 0.35rem 0.85rem; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: 0.95rem; transition: background 0.15s, color 0.15s; }
.nav a:hover { color: var(--text); background: var(--sunk); }
.nav a[data-nav="ideas"] { --n: var(--c-mint); }
.nav a[data-nav="browse"] { --n: var(--c-grape); }
.nav a[data-nav="activities"] { --n: var(--c-coral); }
.nav a[data-nav="sources"] { --n: var(--c-sky); }
.nav a[data-nav="tools"] { --n: var(--c-sun); }
.nav a.on { background: var(--n); color: var(--ink); }
.search { margin-left: auto; flex: 0 1 280px; }
.search input { width: 100%; padding: 0.5rem 0.95rem; border: 2px solid var(--line); border-radius: 999px; background: var(--surface); }
.theme-btn { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; flex: none; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.theme-btn:hover { border-color: var(--sec); transform: rotate(15deg); transition: transform 0.2s; }
.theme-btn:focus-visible { outline: 3px solid var(--sec); outline-offset: 1px; }
@media (max-width: 680px) {
  .top { flex-wrap: wrap; gap: 0.5rem; }
  .search { flex: 1 1 100%; order: 3; }
  .theme-btn { order: 2; }
  .nav { margin-left: auto; gap: 0.1rem; }
  .nav a { padding: 0.3rem 0.55rem; }
  .brand { font-size: 1.15rem; }
}

/* ---------- Layout ---------- */
main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 1.75rem 16px 3rem; }
.foot { border-top: 2px dashed var(--line); padding: 1.25rem 16px 2rem; text-align: center; color: var(--muted); font-size: 0.85rem; background: var(--bg); }
.foot p { max-width: 640px; margin: 0 auto 0.4rem; }
.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.head-row h1 { margin: 0; }
.lede { color: var(--muted); max-width: 640px; font-size: 1.08rem; }

/* A big friendly banner at the top of the main pages, with an illustration */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 1.5rem;
  align-items: center;
  padding: 1.6rem 1.8rem;
  margin-bottom: 1.6rem;
  border-radius: 28px;
  background: color-mix(in srgb, var(--sec) 16%, var(--surface));
  border: 2px solid color-mix(in srgb, var(--sec) 45%, var(--line));
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: auto -40px -60px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--sec) 22%, transparent);
}
.hero > * { position: relative; }
.hero h1 { margin: 0 0 0.35rem; }
.hero .lede { margin: 0; color: var(--text); opacity: 0.8; }
.hero .eyebrow { display: inline-block; margin-bottom: 0.5rem; padding: 0.15rem 0.7rem; border-radius: 999px; background: var(--sec); color: var(--ink); font-weight: 800; font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; }
.hero .art { max-width: 260px; justify-self: end; animation: bob 5s ease-in-out infinite; }
.hero .hero-actions { margin-top: 0.9rem; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-6px) rotate(-1.5deg); } }
@media (prefers-reduced-motion: reduce) { .hero .art { animation: none; } }
@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; padding: 1.25rem; }
  .hero .art { max-width: 200px; justify-self: center; order: -1; }
}

.card { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.stack > * + * { margin-top: 1rem; }

/* ---------- Buttons and forms ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.05rem;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  color: var(--text);
  box-shadow: 0 3px 0 var(--line);
  transition: transform 0.1s, box-shadow 0.1s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--line); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.btn.primary { background: var(--sec); border-color: var(--ink); color: var(--ink); box-shadow: 0 3px 0 var(--ink); font-size: 1.02rem; }
.btn.primary:hover { box-shadow: 0 4px 0 var(--ink); }
.btn.primary:active { box-shadow: 0 1px 0 var(--ink); }
.btn.danger { color: var(--danger); }
.btn.small { padding: 0.3rem 0.7rem; font-size: 0.875rem; border-radius: 11px; }
.btn[disabled] { opacity: 0.55; cursor: default; transform: none; }
.link { background: none; border: 0; padding: 0; color: var(--t-mint); cursor: pointer; text-decoration: underline; font-weight: 700; }

label.field { display: block; font-weight: 700; font-size: 0.95rem; }
label.field > span { display: block; margin-bottom: 0.3rem; }
input[type="text"], input[type="search"], input:not([type]), select, textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
input:focus, select:focus, textarea:focus { border-color: var(--sec); outline: none; }
textarea { resize: vertical; min-height: 6rem; line-height: 1.5; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .btn:focus-visible, .chip:focus-visible { outline: 3px solid color-mix(in srgb, var(--sec) 60%, transparent); outline-offset: 1px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  --c: var(--sec);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  border: 2px solid color-mix(in srgb, var(--c) 45%, var(--line));
  background: var(--surface);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  transition: background 0.15s, transform 0.1s;
}
.chip:hover { background: color-mix(in srgb, var(--c) 14%, var(--surface)); }
.chip:active { transform: scale(0.96); }
.chip[aria-pressed="true"] { background: var(--c); border-color: var(--ink); color: var(--ink); }
.tag { display: inline-block; padding: 0.1rem 0.6rem; border-radius: 999px; background: var(--sunk); color: var(--muted); font-size: 0.8rem; font-weight: 700; }
.kind { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text); }
.kind .k-icon { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 8px; background: var(--k); border: 2px solid var(--ink); font-size: 0.85rem; line-height: 1; }
.kind:not(:has(.k-icon))::before { content: ""; width: 0.65rem; height: 0.65rem; border-radius: 50%; background: var(--k); border: 2px solid var(--ink); }
[data-kind="condition"] { --k: var(--k-condition); }
[data-kind="intervention"] { --k: var(--k-intervention); }
[data-kind="assessment"] { --k: var(--k-assessment); }
[data-kind="case"] { --k: var(--k-case); }

/* Skill families for the activity generator's areas */
[data-family="hands"] { --c: var(--c-coral); }
[data-family="seeing"] { --c: var(--c-sky); }
[data-family="moving"] { --c: var(--c-mint); }
[data-family="sensory"] { --c: var(--c-grape); }
[data-family="life"] { --c: var(--c-sun); }
[data-family="thinking"] { --c: var(--c-pink); }
.tag[data-family] { background: color-mix(in srgb, var(--c) 22%, var(--surface)); color: var(--text); border: 1.5px solid color-mix(in srgb, var(--c) 55%, transparent); }
.legend { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; font-size: 0.8rem; color: var(--muted); margin: 0.35rem 0 0; }
.legend span { display: inline-flex; align-items: center; gap: 0.3rem; }
.legend span::before { content: ""; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--c); border: 1.5px solid var(--ink); }

/* ---------- Ideas ---------- */
.ideas { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.ideas form { position: sticky; top: 5.5rem; }
@media (max-width: 860px) { .ideas { grid-template-columns: 1fr; } .ideas form { position: static; } }
.ideas form .stack > div > span, .ideas form legend { display: block; font-weight: 800; font-size: 0.95rem; margin-bottom: 0.4rem; }
fieldset { border: 0; padding: 0; margin: 0; }
.results h2 { display: flex; align-items: center; gap: 0.5rem; margin-top: 1.6rem; }
.results h2:first-child { margin-top: 0; }
.results h2 .count { display: inline-grid; place-items: center; min-width: 1.7rem; height: 1.7rem; padding: 0 0.4rem; border-radius: 999px; background: var(--sec); color: var(--ink); font-family: var(--sans); font-size: 0.85rem; font-weight: 800; }

.list { display: grid; gap: 0.7rem; }
.item {
  display: block;
  padding: 0.9rem 1rem 0.95rem;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  box-shadow: 0 3px 0 color-mix(in srgb, var(--k, var(--line)) 55%, var(--line));
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}
.item:hover { transform: translateY(-2px); border-color: var(--k, var(--muted)); box-shadow: 0 5px 0 var(--k, var(--line)); }
.item strong { display: block; font-family: var(--display); font-weight: 600; font-size: 1.12rem; margin: 0.35rem 0 0.15rem; }
.item p { margin: 0; color: var(--muted); font-size: 0.93rem; }
.item .why { margin-top: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.3rem; }

.passage { padding: 0.9rem 1rem; border-radius: 16px; background: var(--sunk); border: 2px dashed var(--line); }
.passage blockquote { margin: 0 0 0.5rem; font-size: 0.95rem; }
.passage cite { font-style: normal; font-size: 0.82rem; color: var(--muted); }

.empty { padding: 2rem 1.25rem; text-align: center; color: var(--muted); border: 2px dashed color-mix(in srgb, var(--sec) 50%, var(--line)); border-radius: var(--radius); background: color-mix(in srgb, var(--sec) 6%, var(--surface)); }
.empty strong { display: block; color: var(--text); font-family: var(--display); font-weight: 600; font-size: 1.25rem; margin-bottom: 0.3rem; }

/* ---------- Browse ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 1rem; }
.tabs .chip[data-kind] { --c: var(--k, var(--sec)); }
.tabs .chip[data-kind=""] { --c: var(--sec); }
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 0.6rem; margin-bottom: 1.25rem; }
@media (max-width: 760px) { .filters { grid-template-columns: 1fr 1fr; } .filters > :first-child { grid-column: 1 / -1; } }
.cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.85rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.85rem; margin: 1.5rem 0; }
.stat { padding: 0.9rem 1rem; border-radius: 18px; background: var(--surface); border: 2px solid var(--line); box-shadow: var(--shadow); }
.stat:nth-child(1) { background: color-mix(in srgb, var(--c-sky) 16%, var(--surface)); }
.stat:nth-child(2) { background: color-mix(in srgb, var(--c-mint) 16%, var(--surface)); }
.stat:nth-child(3) { background: color-mix(in srgb, var(--c-sun) 20%, var(--surface)); }
.stat b { display: block; font-family: var(--display); font-weight: 600; font-size: 2rem; }

/* ---------- Entry ---------- */
.entry { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 2rem; align-items: start; }
@media (max-width: 860px) { .entry { grid-template-columns: 1fr; } }
.entry article > .kind { margin-bottom: 0.4rem; }
.entry .summary { font-size: 1.12rem; color: var(--muted); padding: 0.8rem 1rem; border-radius: 14px; background: color-mix(in srgb, var(--k, var(--sec)) 12%, var(--surface)); border-left: 5px solid var(--k, var(--sec)); }
.prose h3 { margin-top: 1.5em; display: flex; align-items: center; gap: 0.45rem; }
.prose h3::before { content: ""; width: 0.65rem; height: 0.65rem; border-radius: 3px; background: var(--k, var(--sec)); transform: rotate(45deg); flex: none; }
.prose ul { padding-left: 1.2rem; margin: 0 0 0.8em; }
.prose li { margin: 0.25em 0; }
.prose li::marker { color: var(--k, var(--sec)); }
.meta { position: sticky; top: 5.5rem; }
@media (max-width: 860px) { .meta { position: static; } }
.meta dl { margin: 0; display: grid; gap: 0.8rem; }
.meta dt { font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 0.25rem; }
.meta dd { margin: 0; }
.crumbs { font-size: 0.92rem; margin-bottom: 1rem; font-weight: 700; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.cite-list { margin: 0; padding-left: 1.1rem; font-size: 0.92rem; }

/* ---------- Sources ---------- */
.source { display: flex; gap: 1rem; justify-content: space-between; align-items: flex-start; }
.source h3 { margin: 0.25rem 0 0.2rem; }
.status { font-size: 0.78rem; font-weight: 800; padding: 0.15rem 0.6rem; border-radius: 999px; background: color-mix(in srgb, var(--c-sky) 20%, var(--surface)); color: var(--text); white-space: nowrap; border: 1.5px solid color-mix(in srgb, var(--c-sky) 50%, transparent); }
.status.ready { background: var(--accent-soft); }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; }
pre { background: var(--sunk); border: 2px solid var(--line); border-radius: 12px; padding: 0.7rem 0.85rem; overflow-x: auto; margin: 0.5rem 0 0; }

/* ---------- Dialog and toasts ---------- */
dialog { border: 2px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--text); padding: 1.25rem; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
dialog::backdrop { background: rgb(20 16 28 / 0.45); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.dlg-head h2 { margin: 0; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1.25rem; }
.toasts { position: fixed; bottom: max(16px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: grid; gap: 0.5rem; z-index: 50; }
.toast { padding: 0.6rem 1.1rem; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 0.92rem; font-weight: 700; box-shadow: 0 6px 24px rgb(0 0 0 / 0.2); animation: pop 0.25s ease-out; }
.toast.bad { background: var(--danger); color: #fff; }
@keyframes pop { from { transform: translateY(10px) scale(0.95); opacity: 0; } }
.picker { max-height: 260px; overflow-y: auto; display: grid; gap: 0.35rem; margin-top: 0.6rem; }
.picker button { text-align: left; }
.admin-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ---------- Activity generator ---------- */
.activity { position: relative; border-top: 6px solid var(--slot); }
.activity[data-role="warmup"] { --slot: var(--c-sun); }
.activity[data-role="main"] { --slot: var(--c-coral); }
.activity[data-role="cooldown"] { --slot: var(--c-grape); }
.activity h2 { margin: 0.45rem 0 0.5rem; font-size: 1.5rem; }
.activity .chips { margin: 0 0 0.4rem; }
.activity a.tag { text-decoration: none; }
.activity a.tag:hover { filter: brightness(0.95); }
.activity-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.slot { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.15rem 0.7rem 0.15rem 0.3rem; border-radius: 999px; background: color-mix(in srgb, var(--slot) 25%, var(--surface)); font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; }
.slot i { font-style: normal; display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--slot); border: 2px solid var(--ink); font-size: 0.8rem; }
.steps { padding-left: 0; margin: 0.7rem 0 0.95rem; list-style: none; counter-reset: step; }
.steps li { position: relative; margin: 0.45rem 0; padding-left: 2.2rem; counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0.05rem; display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: color-mix(in srgb, var(--slot) 30%, var(--surface)); border: 2px solid var(--slot); font-family: var(--display); font-weight: 600; font-size: 0.85rem; }
.grade { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 0.75rem; }
.grade > div { border-radius: 14px; padding: 0.65rem 0.8rem; font-size: 0.93rem; }
.grade > div:first-child { background: color-mix(in srgb, var(--c-mint) 14%, var(--surface)); border: 2px solid color-mix(in srgb, var(--c-mint) 40%, transparent); }
.grade > div:last-child { background: color-mix(in srgb, var(--c-coral) 12%, var(--surface)); border: 2px solid color-mix(in srgb, var(--c-coral) 40%, transparent); }
.grade b::before { margin-right: 0.3rem; }
.grade > div:first-child b::before { content: "⬇"; }
.grade > div:last-child b::before { content: "⬆"; }
.grade p { margin: 0.2rem 0 0; }
@media (max-width: 560px) { .grade { grid-template-columns: 1fr; } }
.why-it { padding: 0.6rem 0.8rem; border-radius: 12px; background: var(--sunk); }
.safety { color: var(--danger); font-weight: 700; }
.plan-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; padding: 1rem 1.1rem; border-radius: 20px; background: color-mix(in srgb, var(--sec) 14%, var(--surface)); border: 2px solid color-mix(in srgb, var(--sec) 40%, var(--line)); }
.plan-head h2 { margin: 0 0 0.2rem; }
details summary { cursor: pointer; }
label.check { display: flex; gap: 0.45rem; align-items: center; }

/* ---------- Evidence badges ---------- */
.item-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.ev { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.1rem 0.6rem; border-radius: 999px; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.02em; border: 1.5px solid var(--ink); background: var(--evc); color: var(--ink); white-space: nowrap; }
.ev::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--ink); opacity: 0.55; }
.ev[data-ev="strong"] { --evc: var(--c-mint); }
.ev[data-ev="moderate"] { --evc: var(--c-sky); }
.ev[data-ev="emerging"] { --evc: var(--c-sun); }
.ev[data-ev="mixed"] { --evc: var(--c-pink); }
.ev[data-ev="consensus"] { --evc: color-mix(in srgb, var(--muted) 35%, var(--surface)); }
.ev-legend { display: grid; gap: 0.35rem; margin: -0.4rem 0 1.2rem; }
.ev-legend span::before { display: none; }
.ev-note { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

/* Glossary words in entries */
abbr.gloss { text-decoration: underline dotted color-mix(in srgb, var(--sec) 80%, var(--text)); text-underline-offset: 3px; cursor: help; }

/* Report form's hidden field for bots */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- Tools ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.9rem; }
.tool-card { display: block; padding: 1.1rem 1.15rem; border-radius: 20px; border: 2px solid var(--line); background: var(--surface); color: inherit; text-decoration: none; box-shadow: 0 3px 0 color-mix(in srgb, var(--c-sun) 60%, var(--line)); transition: transform 0.12s, box-shadow 0.12s; }
.tool-card:hover { transform: translateY(-2px); box-shadow: 0 5px 0 var(--c-sun); border-color: var(--c-sun); }
.tool-card strong { display: block; font-family: var(--display); font-weight: 600; font-size: 1.2rem; margin: 0.5rem 0 0.2rem; }
.tool-card p { margin: 0; color: var(--muted); font-size: 0.93rem; }
.tool-icon { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 12px; background: color-mix(in srgb, var(--c-sun) 35%, var(--surface)); border: 2px solid var(--ink); font-size: 1.3rem; }
.hero-slim { grid-template-columns: 1fr; padding: 1.2rem 1.5rem; }
.hero-slim h1 { font-size: clamp(1.7rem, 3.6vw, 2.3rem); }

.goal-text { font-size: 1.15rem; font-weight: 700; padding: 0.9rem 1rem; border-radius: 14px; background: color-mix(in srgb, var(--c-sun) 18%, var(--surface)); border: 2px dashed color-mix(in srgb, var(--c-sun) 70%, var(--line)); }
.checks { list-style: none; padding: 0; margin: 0.8rem 0; display: grid; gap: 0.3rem; font-size: 0.92rem; }
.checks li.todo { color: var(--muted); }

.big-num { font-family: var(--display); font-weight: 600; font-size: 2.4rem; margin: 0.2rem 0; }
.norm-bar { position: relative; display: flex; height: 16px; border-radius: 999px; overflow: hidden; border: 2px solid var(--ink); margin: 0.8rem 0 0.2rem; }
.norm-bar .zone { flex: 1; }
.norm-bar .z1 { background: color-mix(in srgb, var(--c-coral) 55%, var(--surface)); flex: 1; }
.norm-bar .z2 { background: color-mix(in srgb, var(--c-sun) 55%, var(--surface)); flex: 1; }
.norm-bar .z3 { background: color-mix(in srgb, var(--c-mint) 55%, var(--surface)); flex: 4; }
.norm-bar i { position: absolute; top: -4px; bottom: -4px; width: 6px; margin-left: -3px; border-radius: 3px; background: var(--ink); }
.norm-axis { display: flex; justify-content: space-between; margin: 0 0 0.8rem; }
.norm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.6rem; margin: 0 0 0.8rem; }
.norm-stats dt { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.norm-stats dd { margin: 0; font-weight: 800; font-size: 1.1rem; }

.ho-list { display: grid; gap: 0.35rem; }
.handout { color: var(--text); }
.handout-head { border-bottom: 3px solid var(--c-sun); margin-bottom: 0.8rem; }
.handout-head h2 { margin: 0; }
.handout-part { padding: 0.6rem 0; border-bottom: 1px dashed var(--line); break-inside: avoid; }
.handout-part h3 { margin-top: 0.4rem; }
.handout-part ul { padding-left: 1.2rem; }
.handout-notes { padding: 0.7rem 0.9rem; border-radius: 12px; background: color-mix(in srgb, var(--c-sun) 15%, var(--surface)); margin-bottom: 0.6rem; }
.handout-tip { padding: 0.5rem 0.7rem; border-radius: 10px; background: var(--sunk); }
.handout-dose { font-weight: 700; }

.flash { min-height: 220px; display: grid; place-content: center; text-align: center; gap: 0.6rem; padding: 2rem 1.5rem; border-radius: 24px; border: 2px solid var(--ink); background: color-mix(in srgb, var(--c-sun) 20%, var(--surface)); box-shadow: 0 5px 0 var(--ink); cursor: pointer; margin-bottom: 1rem; transition: transform 0.15s; }
.flash.flipped { background: color-mix(in srgb, var(--c-mint) 18%, var(--surface)); text-align: left; }
.flash:active { transform: scale(0.99); }
.flash h2 { font-size: 1.7rem; margin: 0; }
.flash-actions { justify-content: center; }
.quiz-q { font-size: 1.08rem; padding: 0.8rem 1rem; border-radius: 14px; background: var(--sunk); }
.quiz-opt { justify-content: flex-start; text-align: left; width: 100%; }
.quiz-opt.right, label.right { background: color-mix(in srgb, var(--c-mint) 35%, var(--surface)); border-color: var(--c-mint); }
.quiz-opt.wrong, label.wrong-opt { background: color-mix(in srgb, var(--c-coral) 20%, var(--surface)); }
label.right, label.wrong-opt { border-radius: 10px; padding: 0.2rem 0.4rem; }
a.on-link { font-weight: 800; color: var(--text); }
.tabs a.chip { text-decoration: none; color: var(--text); }

.gl-search { margin-bottom: 1rem; }
.glossary { display: grid; gap: 0.6rem; margin: 0; }
.gl-item { padding: 0.75rem 1rem; border-radius: 14px; background: var(--surface); border: 2px solid var(--line); }
.gl-item dt { font-family: var(--display); font-weight: 600; font-size: 1.12rem; }
.gl-item dd { margin: 0.2rem 0 0; }

.report.resolved { opacity: 0.6; }

/* ---------- Milestones ---------- */
.ms-age { margin-bottom: 1.2rem; }
.ms-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.ms-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0.8rem; margin-bottom: 1rem; }
.ms-domain h3 { margin: 0 0 0.5rem; }
.ms-domain[data-domain="social"] { border-top: 5px solid var(--c-pink); }
.ms-domain[data-domain="language"] { border-top: 5px solid var(--c-sky); }
.ms-domain[data-domain="cognitive"] { border-top: 5px solid var(--c-grape); }
.ms-domain[data-domain="movement"] { border-top: 5px solid var(--c-mint); }
.ms-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.35rem; }
.ms-list label.check { align-items: flex-start; }
.ms-list input { margin-top: 0.3rem; }
.ms-help { margin-bottom: 1rem; border-top: 5px solid var(--c-sun); }
.ms-help h3 { margin: 0 0 0.4rem; }
.ms-help ul { margin: 0; padding-left: 1.2rem; }
.ms-help li { margin: 0.25rem 0; }
.ms-skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0.8rem; }
.tl { display: grid; gap: 0.45rem; margin: 0.4rem 0 0.6rem; }
.tl-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 0.5rem; align-items: center; font-size: 0.9rem; }
.tl-row.done .tl-label { color: var(--muted); }
.tl-row.now .tl-label { font-weight: 800; }
.tl-track { position: relative; height: 10px; border-radius: 999px; background: var(--sunk); border: 1px solid var(--line); }
.tl-bar { position: absolute; top: 0; bottom: 0; border-radius: 999px; background: var(--c-sun); }
.tl-row.done .tl-bar { background: var(--c-mint); }
.tl-row.now .tl-bar { background: var(--c-coral); }
.tl-mark { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; background: var(--ink); border-radius: 2px; }
.tl-age { white-space: nowrap; }
@media (max-width: 520px) { .tl-row { grid-template-columns: 1fr auto; } .tl-track { grid-column: 1 / -1; grid-row: 2; } }

/* ---------- MMT ---------- */
.mmt-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.mmt-table th, .mmt-table td { text-align: left; padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.mmt-table thead th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.mmt-table tr[data-g="5"] td:first-child, .mmt-table tr[data-g="4"] td:first-child { color: var(--t-mint); }
.mmt-table tr[data-g="3"] td:first-child { color: var(--t-sun); }
.mmt-table tr[data-g="2"] td:first-child, .mmt-table tr[data-g="1"] td:first-child, .mmt-table tr[data-g="0"] td:first-child { color: var(--t-coral); }
.mmt-region th { background: var(--sunk); font-family: var(--display); font-weight: 600; }
.mmt-record select { padding: 0.3rem 0.4rem; width: auto; min-width: 4.5rem; }
.mmt-test h3 { margin: 0; }
.mmt-test dl { margin: 0.5rem 0 0; display: grid; gap: 0.2rem; font-size: 0.92rem; }
.mmt-test dt { font-weight: 800; margin-top: 0.3rem; }
.mmt-test dd { margin: 0; }
.cautions { padding-left: 1.2rem; }
.cautions li { margin: 0.35rem 0; }

/* ---------- Foundations ---------- */
.foundation { max-width: 760px; }
.foundation .summary { font-size: 1.12rem; color: var(--muted); padding: 0.8rem 1rem; border-radius: 14px; background: color-mix(in srgb, var(--c-sun) 14%, var(--surface)); border-left: 5px solid var(--c-sun); }
.fd-item { --k: var(--c-sun); }

@media print {
  .top, .foot, .no-print, #toasts, .hero .art { display: none !important; }
  .handout, .print-area .card { border: none !important; box-shadow: none !important; padding: 0 !important; }
  abbr.gloss { text-decoration: none; }
  body { background: #fff; color: #000; }
  main { padding: 0; max-width: none; }
  .ideas { display: block; }
  .card { box-shadow: none; border-color: #bbb; break-inside: avoid; }
}
