/* N.J. Berky workshop design system (same tokens as the AI in IVF workshop):
   warm paper, ink, one teal-green, hairlines, zero radius, handwritten margin notes and marker highlights. */
:root {
  --background: oklch(96.1% .007 88.6);
  --foreground: oklch(20% .009 264.4);
  --primary: oklch(44.1% .056 173.2);
  --primary-foreground: oklch(96.1% .007 88.6);
  --muted: oklch(89.8% .012 84.6);
  --muted-foreground: oklch(48.1% .014 264.4);
  --border: oklch(88.3% .013 86.8);
  --highlight: oklch(44.1% .056 173.2 / .14);
  --destructive: oklch(52.4% .158 30.3);
  --note-ink: oklch(34% .075 258);
  --note-highlight: oklch(91% .085 95 / .7);
  --pen-green: oklch(46% .11 152); --pen-green-hl: oklch(85% .12 152 / .5);
  --pen-red: oklch(53% .19 27); --pen-red-hl: oklch(86% .13 27 / .46);
  --pen-yellow: oklch(62% .15 82); --pen-yellow-hl: oklch(88% .15 92 / .62);
  --marker-1: oklch(90% .09 95 / .75); --marker-2: oklch(88% .07 15 / .65); --marker-3: oklch(88% .08 160 / .65);
  --marker-4: oklch(88% .06 240 / .65); --marker-5: oklch(86% .08 40 / .7);
  --surface: oklch(97.6% .005 88.6);
  --font-sans: "Epilogue", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Urbanist", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --font-readable: "Lexend", ui-sans-serif, system-ui, sans-serif;
  --font-handwritten: "Caveat", cursive;
  --font-principle: "Architects Daughter", cursive;
  --wrap: 696px;
}
html[data-mode="dyslexia"] { --font-sans: var(--font-readable); --font-display: var(--font-readable); }
* { box-sizing: border-box; border-radius: 0; }
html, body { margin: 0; background: var(--background); color: var(--foreground); font: 400 17px/1.65 var(--font-sans); -webkit-font-smoothing: antialiased; }
html[data-mode="dyslexia"] body { font-size: 18px; line-height: 1.85; letter-spacing: .01em; word-spacing: .06em; }
::selection { background: var(--highlight); }
a { color: var(--primary); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.035em; line-height: 1; margin: 0 0 .5em; }
.green { color: var(--primary); }
button { font: inherit; color: inherit; }
.eyebrow { font: 500 11px var(--font-mono); letter-spacing: .24em; text-transform: uppercase; color: var(--muted-foreground); }
.eyebrow.sq::before { content: ""; display: inline-block; width: 7px; height: 7px; background: var(--primary); margin-right: 9px; vertical-align: 1px; }
.eyebrow.ink { color: var(--foreground); }
.mono { font-family: var(--font-mono); }
.hairline { border: 0; border-top: 1px solid var(--border); margin: 56px 0; }

/* ---------- live bar + header ---------- */
.livebar { border-top: 2px solid var(--primary); text-align: center; font: 500 10.5px var(--font-mono); letter-spacing: .26em; text-transform: uppercase; padding: 7px 10px; }
.livebar i { display: inline-block; width: 6px; height: 6px; border-radius: 50% !important; background: var(--foreground); margin-right: 8px; vertical-align: 1px; animation: blink 2.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }
.hdr { position: sticky; top: 0; z-index: 30; background: color-mix(in oklch, var(--background) 94%, transparent); backdrop-filter: blur(6px); border-bottom: 1px solid var(--border); border-top: 1px solid var(--border); }
.hdr-in { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 10px 24px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--foreground); }
.brand img { height: 36px; width: auto; display: block; }
.brand b { font: 700 15px var(--font-display); letter-spacing: -0.01em; }
.hdr .sp { flex: 1; }
.ctl { display: flex; flex-direction: column; gap: 3px; }
.ctl > span { font: 500 9.5px var(--font-mono); letter-spacing: .22em; text-transform: uppercase; color: var(--muted-foreground); }
select, .hbtn { font: 600 11px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; background: var(--surface); border: 1px solid var(--border); padding: 8px 12px; color: var(--foreground); cursor: pointer; }
select { padding-right: 28px; min-width: 150px; }
.hbtn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.hbtn:hover, select:hover { border-color: var(--foreground); }
.chk { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.chk input { width: 15px; height: 15px; accent-color: var(--primary); }
.subnav { max-width: var(--wrap); margin: 0 auto; display: flex; gap: 22px; align-items: center; padding: 22px 0 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.subnav a { font: 500 11.5px var(--font-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--muted-foreground); text-decoration: none; padding-bottom: 6px; border-bottom: 2px solid transparent; }
.subnav a.on { color: var(--foreground); border-color: var(--primary); }
.subnav a:hover { color: var(--foreground); }
.subnav a.num { color: var(--primary); letter-spacing: .12em; }
.subnav .bar { width: 1px; height: 16px; background: var(--border); }

/* ---------- page frames ---------- */
.page { max-width: var(--wrap); margin: 0 auto; padding: 72px 0 96px; }
@media (max-width: 760px) { .page { padding: 44px 20px 80px; } .hdr-in { flex-wrap: wrap; gap: 10px; padding: 10px 16px; } .subnav { padding: 16px 20px 12px; gap: 14px; } .hide-sm { display: none !important; } }

/* ---------- handwritten margin notes ---------- */
.margins { display: grid; gap: 1.5rem; max-width: 24rem; padding: 1.6rem 1rem 1.4rem; transform: rotate(-4deg); }
.margin { display: flex; align-items: baseline; gap: .65rem; }
.margin:nth-child(2) { margin-left: 1.6rem; } .margin:nth-child(3) { margin-left: .6rem; }
.margin .mk { flex: none; font: 700 1.7rem var(--font-handwritten); color: var(--pen); }
.margin p { margin: 0; font: 600 1.55rem/1.3 var(--font-handwritten); color: var(--note-ink); }
.margin p span { background: linear-gradient(transparent 62%, var(--hl) 62%, var(--hl) 90%, transparent 90%); }
.margin small { display: block; margin: .25rem 0 0 .8rem; font: 400 .92rem/1.5 var(--font-principle); color: var(--pen); }
.tone-yellow { --pen: var(--pen-yellow); --hl: var(--pen-yellow-hl); }
.tone-green { --pen: var(--pen-green); --hl: var(--pen-green-hl); }
.tone-red { --pen: var(--pen-red); --hl: var(--pen-red-hl); }
.principle { font: 400 clamp(18px, 2.1vw, 25px)/1.7 var(--font-principle); color: var(--note-ink); letter-spacing: .06em; text-transform: uppercase; padding: 34px 24px 6px; }
.principle div:nth-child(2) { margin-left: 14px; }
.hand { font-family: var(--font-handwritten); color: var(--note-ink); }
.handnotes { display: flex; gap: 28px; flex-wrap: wrap; margin: 34px 0 0; }
.handnotes span { font: 600 1.6rem/1.2 var(--font-handwritten); color: var(--note-ink); display: inline-flex; gap: 10px; align-items: baseline; }
.handnotes span i { font-style: normal; font-family: var(--font-mono); font-size: 1rem; }
.handnotes span:first-child em { font-style: normal; border-bottom: 1.5px solid var(--note-ink); }
html[data-mode="dyslexia"] .margin p, html[data-mode="dyslexia"] .handnotes span, html[data-mode="dyslexia"] .principle { font-family: var(--font-readable); font-size: 1.1rem; font-weight: 500; text-transform: none; letter-spacing: 0; }
html[data-mode="dyslexia"] .margins, html[data-mode="calm"] .margins, html[data-mode="dyslexia"] .margin, html[data-mode="calm"] .margin { transform: none; margin-left: 0; }

/* ---------- home ---------- */
.home { max-width: 1180px; margin: 0 auto; padding: 20px 24px 80px; display: grid; grid-template-columns: 1.15fr 1fr; }
.home .l { padding: 56px 48px 40px 0; border-right: 1px solid var(--border); }
.home .r { padding: 30px 0 40px 32px; }
.hero { font-size: clamp(56px, 9vw, 104px); line-height: .9; letter-spacing: -0.045em; margin: 18px 0 26px; }
.lead { font-size: 20px; line-height: 1.55; color: var(--muted-foreground); max-width: 34ch; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 30px; }
.btn { display: inline-flex; align-items: center; gap: 10px; font: 600 15px var(--font-display); padding: 12px 22px; border: 1px solid var(--primary); background: var(--primary); color: var(--primary-foreground); cursor: pointer; text-decoration: none; transition: transform .12s, background .15s; }
.btn:hover { background: color-mix(in oklch, var(--primary) 86%, black); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--surface); color: var(--foreground); border-color: var(--border); }
.btn.ghost:hover { border-color: var(--foreground); }
.btn.sm { padding: 8px 14px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.rail a { display: grid; grid-template-columns: 44px 1fr 20px; gap: 16px; align-items: center; text-decoration: none; color: var(--foreground); padding: 12px 0; border-bottom: 1px solid var(--border); }
.rail a .box { width: 44px; height: 44px; border: 1.5px solid var(--primary); display: grid; place-items: center; color: var(--primary); background: var(--background); position: relative; }
.rail a:not(:last-child) .box::after { content: ""; position: absolute; left: 50%; top: 44px; height: 26px; border-left: 1.5px solid var(--primary); }
.rail a.final .box { background: var(--primary); color: var(--primary-foreground); }
.rail a small { display: block; color: var(--muted-foreground); font-size: 14px; }
.rail a b { font: 700 18px var(--font-display); letter-spacing: -0.015em; }
.rail a:hover b { color: var(--primary); }
@media (max-width: 900px) { .home { grid-template-columns: 1fr; } .home .l { border-right: 0; padding: 30px 0; } .home .r { padding: 0; } }

/* ---------- chapter ---------- */
.ch-top { display: flex; align-items: center; gap: 14px; }
.ch-top svg { width: 22px; height: 22px; }
.lede { font-style: italic; color: var(--muted-foreground); font-size: 19px; margin: 26px 0 30px; }
html[data-mode="dyslexia"] .lede { font-style: normal; }
.ch-title { font-size: clamp(48px, 8vw, 80px); line-height: .92; letter-spacing: -0.045em; margin: 0; }
.body p { font-size: 19px; line-height: 1.75; margin: 0 0 1.1em; max-width: 36em; }
.body b { font-weight: 600; background: linear-gradient(transparent 60%, var(--note-highlight) 60%, var(--note-highlight) 92%, transparent 92%); }
.block { margin: 56px 0; }
.callout { border-left: 3px solid var(--primary); background: var(--highlight); padding: 18px 22px; }
.callout .eyebrow { color: var(--primary); display: block; margin-bottom: 6px; }
.callout p { margin: 0 0 .6em; font-size: 18px; } .callout p:last-child { margin: 0; }
ul.clean { padding-left: 1.2em; margin: 0; } ul.clean li { margin: .5em 0; font-size: 18px; }
.terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.terms div { background: var(--surface); border: 1px solid var(--border); padding: 14px 16px; }
.terms div:nth-child(4n+1) { box-shadow: inset 0 4px 0 var(--marker-1); } .terms div:nth-child(4n+2) { box-shadow: inset 0 4px 0 var(--marker-3); }
.terms div:nth-child(4n+3) { box-shadow: inset 0 4px 0 var(--marker-4); } .terms div:nth-child(4n+4) { box-shadow: inset 0 4px 0 var(--marker-2); }
.terms b { display: block; font: 700 17px var(--font-display); }
.terms span { font-size: 14.5px; color: var(--muted-foreground); line-height: 1.5; }

/* questions */
.q .eyebrow { display: block; margin-bottom: 12px; }
.q h3 { font-size: clamp(22px, 2.6vw, 27px); letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 18px; }
.opts { display: grid; gap: 8px; }
.opt { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: baseline; text-align: left; width: 100%; background: var(--background); border: 1px solid var(--border); padding: 16px 18px; cursor: pointer; font-size: 17px; line-height: 1.45; transition: border-color .15s, background .15s; }
.opt:hover:not(:disabled) { border-color: var(--foreground); }
.opt .ix { font: 500 11px var(--font-mono); color: var(--muted-foreground); }
.opt.good { border-color: var(--primary); color: var(--primary); background: var(--highlight); }
.opt.wrong { border-color: var(--pen-red); background: var(--pen-red-hl); }
.opt:disabled { cursor: default; }
.feedback { margin-top: 14px; display: flex; gap: 12px; align-items: baseline; }
.feedback .hand { font-size: 1.55rem; font-weight: 700; flex: none; }
.feedback .hand.ok { color: var(--pen-green); } .feedback .hand.no { color: var(--pen-red); }
.feedback p { margin: 0; font-size: 16px; color: var(--muted-foreground); }
html[data-nopressure="1"] .score-only { display: none !important; }

/* poll */
.pbar { position: relative; width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; background: var(--background); border: 1px solid var(--border); padding: 13px 16px; margin: 6px 0; cursor: pointer; overflow: hidden; font-size: 16px; }
.pbar i { position: absolute; inset: 0 auto 0 0; background: var(--marker-3); transition: width .7s cubic-bezier(.2,.8,.2,1); }
.pbar span, .pbar em { position: relative; } .pbar span { flex: 1; } .pbar em { font: 700 12px var(--font-mono); font-style: normal; }
.pbar.mine { border-color: var(--primary); }

/* sorter (drag on desktop, tap on phone) */
.sort-pool { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 18px; min-height: 48px; }
.chipx { background: var(--surface); border: 1px solid var(--border); padding: 10px 14px; font-size: 15px; cursor: grab; user-select: none; text-align: left; }
.chipx.sel { border-color: var(--primary); box-shadow: 0 0 0 3px var(--highlight); }
.chipx.good { border-color: var(--primary); background: var(--highlight); }
.chipx.bad { border-color: var(--pen-red); background: var(--pen-red-hl); }
.buckets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.bucket { border-top: 1.5px solid var(--foreground); min-height: 120px; padding: 10px 0; display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.bucket.over { background: var(--highlight); }
.bucket[data-b="Unacceptable"] { border-color: var(--pen-red); }
.why { font-size: 13px; color: var(--muted-foreground); margin-top: -2px; }
@media (max-width: 760px) { .buckets { grid-template-columns: 1fr 1fr; } }

/* flip cards */
.reveal { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.flip { perspective: 900px; min-height: 200px; cursor: pointer; }
.flip .in { position: relative; width: 100%; height: 100%; min-height: 200px; transition: transform .6s cubic-bezier(.2,.8,.2,1); transform-style: preserve-3d; }
.flip.on .in { transform: rotateY(180deg); }
.flip .f, .flip .b { position: absolute; inset: 0; backface-visibility: hidden; padding: 18px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--border); }
.flip .f { background: var(--surface); }
.flip:nth-child(3n+1) .f { box-shadow: inset 0 -5px 0 var(--marker-1); } .flip:nth-child(3n+2) .f { box-shadow: inset 0 -5px 0 var(--marker-4); } .flip:nth-child(3n+3) .f { box-shadow: inset 0 -5px 0 var(--marker-2); }
.flip .f p { margin: 0; font: 700 19px/1.2 var(--font-display); }
.flip .f .hand { font-size: 1.2rem; }
.flip .b { background: var(--primary); color: var(--primary-foreground); transform: rotateY(180deg); font-size: 15px; line-height: 1.5; }

/* labs */
.lab { border: 1px solid var(--foreground); background: var(--surface); }
.lab .shot { display: block; border-bottom: 1px solid var(--border); overflow: hidden; }
.lab .shot img { display: block; width: 100%; aspect-ratio: 2.2/1; object-fit: cover; object-position: top left; transition: transform .7s cubic-bezier(.2,.8,.2,1); }
.lab:hover .shot img { transform: scale(1.035); }
.lab .hd { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px 0; }
.lab .hd h3 { margin: 0; font-size: 24px; }
.lab .cols { display: grid; grid-template-columns: 1fr 1fr; padding: 12px 0 0; }
.lab .cols > div { padding: 6px 20px 20px; font-size: 15.5px; }
.lab .cols > div + div { border-left: 1px dashed var(--border); }
.lab .cols p { margin: .4em 0; }
@media (max-width: 760px) { .lab .cols { grid-template-columns: 1fr; } .lab .cols > div + div { border-left: 0; border-top: 1px dashed var(--border); padding-top: 12px; } }

/* figures (sketch style) */
.fig { margin: 0; }
.fig svg { display: block; width: 100%; height: auto; overflow: visible; }
.fig figcaption { font: 500 11px var(--font-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--muted-foreground); margin-top: 18px; line-height: 1.8; }
.fig figcaption a { color: var(--muted-foreground); }
.fig .fo { font: 400 13px/1.35 var(--font-sans); color: var(--foreground); }
.fig .fo.c { text-align: center; }
.fig .rise, .fig .pop, .fig .bar, .fig .draw, .fig .packet, .fig .stamp-svg { opacity: 0; }
.fig .pop, .fig .rise { transform-box: fill-box; transform-origin: center; }
.fig.in .rise { animation: rise .7s cubic-bezier(.2,.8,.2,1) both; }
.fig.in .pop { animation: popin .55s cubic-bezier(.2,1.4,.4,1) both; }
.fig .bar { transform-box: fill-box; transform-origin: left center; }
.fig.in .bar { animation: barx 1s cubic-bezier(.2,.8,.2,1) both; }
.fig .draw { stroke-dasharray: 900; stroke-dashoffset: 900; }
.fig.in .draw { opacity: 1; animation: draw 1.3s ease forwards; }
.fig.in .packet { opacity: 1; animation: travel 5.5s cubic-bezier(.6,0,.4,1) 1.2s infinite; }
.fig.in .stamp-svg { transform-box: fill-box; transform-origin: center; animation: svgstamp 5.5s ease 1.2s infinite; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes popin { from { opacity: 0; transform: scale(.7) rotate(-3deg); } to { opacity: 1; transform: none; } }
@keyframes barx { from { opacity: 1; transform: scaleX(0); } to { opacity: 1; transform: scaleX(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes travel { 0% { transform: translate(70px, 80px); } 20% { transform: translate(255px, 80px); } 40% { transform: translate(440px, 80px); } 62%, 100% { transform: translate(625px, 80px); } }
@keyframes svgstamp { 0%, 60% { opacity: 0; transform: scale(2) rotate(-6deg); } 66%, 92% { opacity: 1; transform: scale(1) rotate(-6deg); } 100% { opacity: 0; transform: scale(1) rotate(-6deg); } }

/* journey */
.callout-product { border: 1px solid var(--border); background: var(--surface); padding: 20px 22px; }
.graph-wrap { position: relative; border: 1px solid var(--border); background: var(--surface); margin-top: 18px; }
.graph-wrap canvas { display: block; width: 100%; height: 440px; touch-action: none; cursor: grab; }
.graph-hint { position: absolute; left: 14px; top: 8px; font: 600 1.25rem var(--font-handwritten); color: var(--note-ink); }
.graph-legend { position: absolute; right: 14px; top: 12px; display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.graph-legend span { font: 500 9.5px var(--font-mono); letter-spacing: .2em; text-transform: uppercase; }
.graph-legend i { display: inline-block; width: 8px; height: 8px; margin-right: 5px; }
.mtabs { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border); border-top: 0; }
.mtabs button { background: var(--background); border: 0; border-right: 1px solid var(--border); padding: 12px 10px; cursor: pointer; text-align: left; }
.mtabs button:last-child { border-right: 0; }
.mtabs button b { display: block; font: 700 18px var(--font-display); }
.mtabs button span { font: 500 9.5px var(--font-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted-foreground); }
.mtabs button.on { box-shadow: inset 0 -3px 0 var(--mc); background: var(--surface); }
.market { border: 1px solid var(--border); border-top: 0; padding: 22px; background: var(--background); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--border); margin: 14px 0 18px; background: var(--surface); }
.stats > div { padding: 14px 16px; border-right: 1px solid var(--border); }
.stats > div:last-child { border-right: 0; }
.stats b { display: block; font: 800 28px/1.05 var(--font-display); letter-spacing: -0.03em; }
.tl-row { display: grid; grid-template-columns: 36% 1fr; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.tl-row .nm { font-size: 15px; line-height: 1.3; }
.tl-row .nm small { display: block; font: 500 10px var(--font-mono); letter-spacing: .1em; color: var(--muted-foreground); text-transform: uppercase; }
.tl-track { position: relative; height: 16px; background: var(--muted); }
.tl-track i { position: absolute; top: 0; bottom: 0; background: var(--mc); opacity: .85; transform-origin: left; animation: grow .9s ease both; }
@keyframes grow { from { transform: scaleX(0); } }
.tl-row .plain { grid-column: 1/-1; font-size: 14px; color: var(--muted-foreground); display: none; }
.tl-row.open .plain { display: block; }
.gotcha { margin-top: 16px; display: flex; gap: 12px; align-items: baseline; }
.gotcha .hand { color: var(--pen-red); font-size: 1.6rem; font-weight: 700; flex: none; }
.gotcha p { margin: 0; font-size: 15.5px; }
.budget { display: grid; gap: 8px; margin-top: 10px; }
.budget .row { display: grid; grid-template-columns: 90px 1fr 140px; gap: 10px; align-items: center; font-size: 13px; }
.budget .row .trk { height: 12px; background: var(--muted); position: relative; }
.budget .row .trk i { position: absolute; top: 0; bottom: 0; background: var(--mc); }
.budget .row .trk i.max { opacity: .3; }
@media (max-width: 760px) { .mtabs { grid-template-columns: 1fr 1fr; } .stats { grid-template-columns: 1fr; } .stats > div { border-right: 0; border-bottom: 1px solid var(--border); } .budget .row { grid-template-columns: 70px 1fr; } .graph-wrap canvas { height: 340px; } }

/* next chapter + source */
.next { display: flex; justify-content: space-between; align-items: center; gap: 16px; border-top: 1px solid var(--foreground); border-bottom: 1px solid var(--border); padding: 22px 0; margin-top: 72px; text-decoration: none; color: var(--foreground); }
.next b { font: 700 24px var(--font-display); letter-spacing: -0.02em; display: block; margin-top: 4px; }
.next:hover b { color: var(--primary); }
.source { margin-top: 36px; font: 500 10.5px/1.9 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted-foreground); }
.source a { color: var(--muted-foreground); }

/* chapters index */
.chlist a { display: grid; grid-template-columns: 50px 34px 1fr auto; gap: 14px; align-items: center; padding: 22px 0; border-top: 1px solid var(--border); text-decoration: none; color: var(--foreground); }
.chlist a:last-child { border-bottom: 1px solid var(--border); }
.chlist .n { font: 500 12px var(--font-mono); color: var(--muted-foreground); }
.chlist .c { width: 22px; height: 22px; border: 1.5px solid var(--muted-foreground); border-radius: 50% !important; display: grid; place-items: center; font-size: 12px; }
.chlist a.done .c { border-color: var(--primary); background: var(--primary); color: var(--primary-foreground); }
.chlist b { font: 700 24px var(--font-display); letter-spacing: -0.025em; }
.chlist .st { font: 500 11px var(--font-mono); letter-spacing: .2em; color: var(--muted-foreground); }
.chlist a:hover b { color: var(--primary); }

/* case study */
.levels { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.lvl { text-align: left; background: var(--surface); border: 1px solid var(--border); padding: 20px; cursor: pointer; position: relative; min-height: 160px; transition: transform .15s, border-color .15s; }
.lvl:hover { border-color: var(--foreground); transform: translateY(-2px); }
.lvl[data-l="easy"] { box-shadow: inset 0 5px 0 var(--marker-3); } .lvl[data-l="mid"] { box-shadow: inset 0 5px 0 var(--marker-1); }
.lvl[data-l="hard"] { box-shadow: inset 0 5px 0 var(--marker-5); } .lvl[data-l="extra"] { box-shadow: inset 0 5px 0 var(--marker-2); }
.lvl b { display: block; font: 700 21px/1.15 var(--font-display); margin: 12px 0 10px; letter-spacing: -0.02em; }
.lvl .sc { position: absolute; right: 16px; top: 12px; font: 700 1.6rem var(--font-handwritten); color: var(--pen-green); }
@media (max-width: 760px) { .levels { grid-template-columns: 1fr; } }
.progress { height: 6px; background: var(--muted); margin: 12px 0 6px; position: relative; }
.progress i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--primary); transition: width .4s; }
.progress .goal { position: absolute; left: 80%; top: -5px; bottom: -5px; border-left: 1.5px dashed var(--foreground); }
.scenario { font-size: 19px; line-height: 1.7; border-left: 3px solid var(--note-ink); padding: 4px 0 4px 20px; margin: 22px 0; }
.cp { border-top: 1px solid var(--border); padding: 28px 0; }
.cp.locked { opacity: .4; pointer-events: none; }
.teamcard { border: 1px solid var(--foreground); background: var(--surface); padding: 26px; }
input, textarea { font: 400 17px var(--font-sans); color: var(--foreground); background: var(--background); border: 1px solid var(--border); padding: 13px 15px; width: 100%; outline: none; }
input:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--highlight); }
.stamp { display: inline-block; border: 3px solid var(--pen-green); color: var(--pen-green); font: 700 2.4rem var(--font-handwritten); padding: 2px 18px; transform: rotate(-6deg); animation: stamp .45s cubic-bezier(.2,1.6,.4,1) both; }
.stamp.no { border-color: var(--pen-yellow); color: var(--pen-yellow); }
@keyframes stamp { from { transform: rotate(-6deg) scale(2.4); opacity: 0; } to { transform: rotate(-6deg) scale(1); opacity: 1; } }
.lock-note { display: flex; gap: 14px; align-items: baseline; border: 1px dashed var(--note-ink); padding: 18px 20px; }
.lock-note .hand { font-size: 1.5rem; font-weight: 700; flex: none; }
.err { color: var(--destructive); font-size: 14px; min-height: 20px; margin-top: 6px; }
.board .r { display: grid; grid-template-columns: 48px 1fr auto auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.board .r b { font: 700 1.7rem var(--font-handwritten); color: var(--note-ink); }
.board .r .pts { font: 700 15px var(--font-mono); }

/* AI cards */
.ai-card { border: 1px solid var(--primary); background: var(--surface); padding: 26px 22px 22px; position: relative; }
.ai-card .ai-tag { position: absolute; top: -11px; left: 18px; background: var(--primary); color: var(--primary-foreground); font: 600 10px var(--font-mono); letter-spacing: .2em; padding: 4px 9px; text-transform: uppercase; }
.ai-out { margin-top: 18px; display: grid; gap: 14px; }
.tier { display: inline-block; font: 700 2rem/1.1 var(--font-handwritten); padding: 0 14px; border: 2.5px solid currentColor; transform: rotate(-3deg); }
.tier.Unacceptable { color: var(--pen-red); } .tier.High { color: var(--note-ink); } .tier.Limited { color: var(--pen-green); } .tier.Minimal { color: var(--pen-yellow); }
.ai-out dl { display: grid; grid-template-columns: 140px 1fr; gap: 10px 14px; margin: 0; font-size: 15.5px; }
.ai-out dt { font: 500 10.5px var(--font-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--muted-foreground); padding-top: 3px; }
.ai-out dd { margin: 0; }
.ai-note { font: 500 10.5px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted-foreground); }
.dots { display: inline-flex; gap: 5px; vertical-align: middle; } .dots i { width: 7px; height: 7px; background: var(--primary); border-radius: 50% !important; animation: bounce 1s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 100% { transform: translateY(0); opacity: .4; } 50% { transform: translateY(-5px); opacity: 1; } }
@media (max-width: 760px) { .ai-out dl { grid-template-columns: 1fr; } }

/* floating AI guide + drawers */
.fab { position: fixed; right: 18px; bottom: 18px; z-index: 40; width: 52px; height: 52px; background: var(--primary); color: var(--primary-foreground); border: 0; display: grid; place-items: center; cursor: pointer; box-shadow: 0 6px 20px -8px rgba(0,0,0,.45); transition: transform .15s; }
.fab:hover { transform: translateY(-2px); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--background); border-left: 1px solid var(--foreground); z-index: 50; display: flex; flex-direction: column; transform: translateX(105%); transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.drawer.open { transform: none; }
.drawer .dh { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.drawer .dh h3 { margin: 0; font-size: 20px; }
.drawer .db { flex: 1; overflow: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.drawer .df { border-top: 1px solid var(--border); padding: 12px; display: flex; gap: 8px; }
.drawer .df input { flex: 1; }
.msg { max-width: 90%; padding: 12px 14px; font-size: 15.5px; line-height: 1.55; white-space: pre-wrap; }
.msg.me { align-self: flex-end; background: var(--primary); color: var(--primary-foreground); }
.msg.ai { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { background: var(--surface); border: 1px solid var(--border); padding: 8px 10px; font-size: 13.5px; cursor: pointer; text-align: left; }
.chips button:hover { border-color: var(--primary); }
.notes-ta { flex: 1; min-height: 60vh; resize: none; font: 600 1.4rem/32px var(--font-handwritten); color: var(--note-ink); background: repeating-linear-gradient(var(--background), var(--background) 31px, var(--border) 32px); border: 0; padding: 0 4px; }
.notes-ta:focus { box-shadow: none; }

/* ADHD: one step at a time */
.stepper { position: sticky; top: 60px; z-index: 5; background: var(--background); padding: 12px 0; display: flex; align-items: center; gap: 12px; }
.stepper .dotsx { display: flex; gap: 5px; flex: 1; }
.stepper .dotsx i { flex: 1; height: 5px; background: var(--muted); }
.stepper .dotsx i.on { background: var(--primary); }
html[data-mode="calm"] *, html[data-mode="calm"] *::before, html[data-mode="calm"] *::after { animation: none !important; transition: none !important; }
html[data-mode="calm"] .fig .rise, html[data-mode="calm"] .fig .pop, html[data-mode="calm"] .fig .bar, html[data-mode="calm"] .fig .draw { opacity: 1 !important; stroke-dashoffset: 0 !important; }
html[data-mode="calm"] .principle, html[data-mode="calm"] .margins { display: none; }

/* entry */
.entry { max-width: 1180px; margin: 0 auto; padding: 10px 24px 60px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.entry .qrbox { display: grid; grid-template-columns: 150px 1fr; gap: 18px; align-items: center; border: 1px solid var(--foreground); background: #fff; padding: 14px; margin-bottom: 26px; }
.entry .qrbox svg { width: 100%; height: auto; display: block; }
.entry .qrbox .hand { font-size: 2.1rem; font-weight: 700; line-height: 1; }
.entry form { display: grid; gap: 12px; }
@media (max-width: 900px) { .entry { grid-template-columns: 1fr; } .entry .qrbox { display: none; } }

/* footer */
.foot { border-top: 1px solid var(--border); padding: 30px 20px 40px; text-align: center; }
.foot .l1 { display: inline-flex; align-items: center; gap: 12px; font: 500 12px var(--font-mono); letter-spacing: .2em; text-transform: uppercase; }
.foot .l1 img { height: 34px; }
.foot .l1 a { color: var(--foreground); text-decoration: none; }
.foot .l2 { margin-top: 12px; font: 500 10.5px var(--font-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--muted-foreground); display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }
.foot .l2 a { color: var(--muted-foreground); text-decoration: none; }
.foot .l2 a:hover { color: var(--foreground); }

.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--foreground); color: var(--background); font: 500 12px var(--font-mono); letter-spacing: .06em; padding: 12px 16px; z-index: 60; animation: toastin .3s ease both; max-width: 90vw; }
.toast.warn { background: var(--pen-red); }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 8px); } }
.fade { animation: fadein .5s ease both; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } }
body.no-copy .page, body.no-copy .home { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.no-copy input, body.no-copy textarea { -webkit-user-select: text; user-select: text; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition: none !important; } .fig .rise, .fig .pop, .fig .bar, .fig .draw { opacity: 1; stroke-dashoffset: 0; } }

/* crawlable landing section */
#about { max-width: var(--wrap); margin: 0 auto; padding: 60px 0 40px; border-top: 1px solid var(--border); }
#about h2 { font-size: clamp(28px, 4vw, 40px); }
#about .cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0; }
#about .cols > div { background: var(--surface); border: 1px solid var(--border); padding: 16px; font-size: 15px; }
#about .cols b { display: block; font: 700 18px var(--font-display); margin-bottom: 4px; }
@media (max-width: 760px) { #about { padding: 40px 20px; } #about .cols { grid-template-columns: 1fr; } }

/* ---------- teacher zone (same tokens) ---------- */
:root { --ink: var(--foreground); --stone: var(--border); --paper: var(--background); --forest: var(--primary); --mono: var(--font-mono); --h: var(--font-display); --b: var(--font-sans); --muted-s: var(--muted); --err: var(--destructive); --forest-s: var(--primary); }
.top { position: sticky; top: 0; z-index: 20; background: var(--background); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 14px; padding: 10px 24px; }
.top .spacer { flex: 1; }
.pill { font: 500 10px var(--font-mono); letter-spacing: .2em; text-transform: uppercase; border: 1px solid var(--border); padding: 6px 10px; white-space: nowrap; }
.brand .logo { height: 34px; width: auto; display: block; }
.brand .who { font: 500 10px var(--font-mono); letter-spacing: .22em; text-transform: uppercase; }
.label { font: 500 10px var(--font-mono); text-transform: uppercase; letter-spacing: .22em; color: var(--muted-foreground); }
.kicker { font: 500 11px var(--font-mono); letter-spacing: .26em; text-transform: uppercase; color: var(--primary); margin-bottom: 12px; }
.card { border: 1px solid var(--border); background: var(--surface); padding: 22px; }
.dot { display: inline-block; width: 7px; height: 7px; background: var(--primary); border-radius: 50% !important; }
.dot.off { background: var(--border); }
.join { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.join .l { padding: clamp(28px, 6vw, 80px); border-right: 1px solid var(--border); display: flex; flex-direction: column; justify-content: space-between; gap: 30px; }
.join .r { padding: clamp(28px, 6vw, 80px); display: flex; flex-direction: column; justify-content: center; gap: 14px; max-width: 520px; }
.join h1 { font-size: clamp(48px, 7vw, 90px); }
.debrief-out { white-space: pre-wrap; font: 500 1.35rem/1.55 var(--font-handwritten); color: var(--note-ink); background: repeating-linear-gradient(var(--surface), var(--surface) 33px, var(--border) 34px); border: 1px solid var(--border); padding: 4px 22px 18px; }

/* ---------- Journey map (How I Think style) ---------- */
.block.wide { width: min(1240px, calc(100vw - 40px)); margin-left: 50%; transform: translateX(-50%); }
.jm-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); border: 1px solid var(--border); background: var(--surface); margin-top: 18px; }
.jm-stage { position: relative; border-right: 1px solid var(--border); background:
  radial-gradient(circle at 1px 1px, oklch(80% .01 88 / .55) 1px, transparent 1.4px) 0 0 / 22px 22px, var(--background); }
.jm-stage canvas { display: block; width: 100%; height: 600px; touch-action: manipulation; }
.jm-hint { position: absolute; left: 16px; top: 10px; font-size: 1.3rem; }
.jm-legend { position: absolute; right: 14px; top: 14px; display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; max-width: 60%; }
.jm-legend span { font: 500 9.5px var(--font-mono); letter-spacing: .18em; text-transform: uppercase; }
.jm-legend i { display: inline-block; width: 9px; height: 9px; margin-right: 5px; vertical-align: -1px; }
.jm-bar { position: absolute; left: 14px; right: 14px; bottom: 12px; display: flex; gap: 18px; align-items: end; flex-wrap: wrap; }
.jm-count { background: var(--surface); border: 1px solid var(--border); padding: 6px 12px; min-width: 96px; }
.jm-count b { display: block; font: 700 22px var(--font-display); font-variant-numeric: tabular-nums; }
.jm-count.bump b { animation: jmbump .5s ease; }
@keyframes jmbump { 30% { color: var(--pen-green); transform: translateY(-3px); } }
.jm-side { display: flex; flex-direction: column; min-height: 0; height: 600px; }
.jm-side-hd { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.jm-log { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
.jm-entry { border-left: 3px solid var(--border); padding: 4px 0 4px 12px; animation: jmin .35s ease both; font-size: 14.5px; line-height: 1.5; }
.jm-entry p { margin: 6px 0; }
.jm-entry.me { border-color: var(--note-ink); background: var(--marker-4); padding: 8px 12px; }
.jm-entry.ai { border-color: var(--primary); background: color-mix(in oklch, var(--marker-3) 50%, transparent); padding: 10px 12px; }
.jm-entry.intro { border-color: var(--pen-yellow); }
@keyframes jmin { from { opacity: 0; transform: translateX(10px); } }
.jm-eh { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.jm-eh i { width: 10px; height: 10px; display: inline-block; }
.jm-eh b { font: 700 16px var(--font-display); }
.jm-kv { display: grid; grid-template-columns: 78px 1fr; gap: 8px; padding: 3px 0; border-top: 1px dashed var(--border); }
.jm-kv .eyebrow { padding-top: 3px; }
.jm-catch { margin-top: 8px; padding: 8px 10px; background: var(--pen-red-hl); font-size: 14px; }
.jm-catch .hand { color: var(--pen-red); font-size: 1.25rem; }
.jm-tools, .jm-used { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.jm-tools button, .jm-used button, .jm-chips button { font: 500 12px var(--font-body); border: 1px solid var(--border); background: var(--surface); padding: 5px 9px; cursor: pointer; }
.jm-tools button:hover, .jm-chips button:hover { border-color: var(--primary); }
.jm-used button { border-left: 4px solid var(--c); }
.jm-follow { border: 0; background: none; cursor: pointer; font-size: 1.3rem; padding: 4px 0; text-align: left; }
.jm-ask { border-top: 1px solid var(--border); padding: 12px 14px; background: var(--surface); }
.jm-askrow { display: flex; gap: 8px; }
.jm-askrow input { flex: 1; min-width: 0; }
.jm-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.budget .row { cursor: pointer; }
@media (max-width: 900px) {
  .jm-grid { grid-template-columns: 1fr; }
  .jm-stage { border-right: 0; border-bottom: 1px solid var(--border); }
  .jm-stage canvas { height: 430px; }
  .jm-side { height: auto; }
  .jm-log { max-height: 380px; }
  .jm-legend { display: none; }
}

/* ---------- page navigation: back / home / skip (bottom left) ---------- */
.pnav { position: fixed; left: 16px; bottom: 16px; z-index: 40; display: flex; border: 1px solid var(--foreground); background: var(--surface); box-shadow: 4px 4px 0 var(--marker-3); }
.pnav button { font: 600 13px var(--font-display); padding: 10px 14px; border: 0; border-right: 1px solid var(--border); background: none; cursor: pointer; color: var(--foreground); }
.pnav button:last-child { border-right: 0; }
.pnav button:hover:not(:disabled) { background: var(--marker-1); }
.pnav button:disabled { opacity: .35; cursor: default; }
.pnav .skip { color: var(--primary); }
.subnav .sp { flex: 1; }
.subnav a.teacher { color: var(--note-ink); }
.brand { cursor: pointer; }
.brand:hover b { text-decoration: underline; text-decoration-color: var(--primary); text-underline-offset: 4px; }
body { padding-bottom: 64px; }
@media (max-width: 760px) { .pnav { left: 10px; bottom: 10px; } .pnav button { padding: 10px 11px; } }
html, body { overflow-x: clip; }

/* =====================================================================
   Same system as the AI in IVF workshop: landing, final debate, teacher zone
   ===================================================================== */
:root { --card: var(--background); --secondary: oklch(89.8% .012 84.6); --accent: oklch(44.1% .056 173.2 / .14); --ink-soft: oklch(48.1% .014 264.4); --forest: var(--primary); }
.ws-page { width: min(100%, 68rem); margin-inline: auto; padding: 1.5rem 1rem 6rem; }
.ws-page > .eyebrow, .landing .eyebrow { display: flex; align-items: center; gap: .5rem; }
.ws-page > .eyebrow::before, .landing .eyebrow::before { content: ""; width: 6px; height: 6px; background: var(--primary); flex: none; }
.ws-title { max-width: 22ch; font: 800 clamp(2rem, 6vw, 3.6rem)/1.05 var(--font-display); letter-spacing: -.035em; margin: .6rem 0 1.4rem; }
.ws-lead { color: var(--ink-soft); margin-bottom: 1rem; font-size: 1.05rem; line-height: 1.6; }
.ws-card { border: 0; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--card); padding: 1rem; }
.ws-card.grid { display: grid; }
.case-pen-note { font: 1.25rem/1.5 var(--font-handwritten); color: var(--note-ink); background: var(--note-highlight); width: fit-content; max-width: 100%; margin: .5rem 0 1rem; padding: .2rem .7rem; transform: rotate(-.8deg); }
.vault-banner.handwritten-principle { width: fit-content; max-width: calc(100% - 3rem); font: 400 1.35rem/1.4 var(--font-principle); letter-spacing: .03em; text-transform: uppercase; color: var(--note-ink); margin: 3.5rem 1.5rem 2rem; padding: .6rem 0; transform: rotate(-1deg); transform-origin: 0; }
.handwritten-principle > span { display: block; width: fit-content; transform: rotate(-1.5deg); transform-origin: 0; }
.handwritten-principle > span:nth-child(2n) { margin: .4rem 0 0 .8rem; transform: rotate(2deg); }
[data-mode=calm] .handwritten-principle > span, [data-mode=dyslexia] .handwritten-principle > span, [data-mode=calm] .vault-banner, [data-mode=dyslexia] .vault-banner { transform: none; }
.b { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; white-space: nowrap; font: 600 14px var(--font-display); height: 2.25rem; padding: 0 1rem; border: 1px solid var(--border); background: var(--background); color: var(--foreground); cursor: pointer; text-decoration: none; }
.b:hover { background: var(--accent); }
.b.pri { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }
.b.pri:hover { background: color-mix(in oklch, var(--primary) 86%, black); }
.b.ghost { border-color: transparent; background: transparent; }
.b.ghost:hover { background: var(--accent); }
.b.sec { background: var(--secondary); border-color: transparent; }
.b.danger { background: var(--destructive); color: #fff; border-color: var(--destructive); }
.b.lg { height: 2.75rem; padding: 0 1.5rem; font-size: 15px; }
.b.icon { width: 2.25rem; padding: 0; }
.b:disabled { opacity: .5; cursor: not-allowed; }
.b svg { width: 16px; height: 16px; flex: none; }
.text-muted { color: var(--muted-foreground); }
.small { font-size: .875rem; }

/* landing */
.landing { display: grid; gap: 1.5rem; max-width: 76rem; margin: 0 auto; padding: clamp(1rem, 4vw, 3rem) 1rem 6rem; }
.landing-qr { text-align: center; justify-items: center; gap: .75rem; display: grid; border-right: 1px solid var(--foreground); padding: 1rem; }
.qr-box { background: var(--card); width: 100%; max-width: 22rem; padding: .75rem; border: 1px solid var(--foreground); }
.qr-box svg { width: 100%; height: auto; display: block; aspect-ratio: 1; }
.landing-copy { display: grid; gap: 1rem; align-content: center; }
.landing-title { font: 800 clamp(2rem, 6vw, 3.5rem)/1.05 var(--font-display); letter-spacing: -.035em; margin: 0; }
.landing-copy label { display: grid; gap: .25rem; font-size: .875rem; font-weight: 600; }
.landing-reel { display: grid; justify-items: center; align-content: center; }
.iphone-frame { position: relative; width: min(100%, 17rem); border: 2px solid var(--foreground); background: var(--card); border-radius: 2.6rem; padding: 1.9rem .55rem; box-shadow: 0 1.2rem 2.4rem color-mix(in oklch, var(--foreground) 14%, transparent); }
.iphone-notch { position: absolute; top: .45rem; left: 50%; transform: translate(-50%); width: 5.4rem; height: 1.15rem; border-radius: 99px; background: var(--foreground); z-index: 2; }
.iphone-screen { display: block; width: 100%; height: auto; aspect-ratio: 9/16; object-fit: contain; background: var(--foreground); border-radius: 1.2rem; }
@media (min-width: 900px) { .landing { grid-template-columns: 1.05fr 1fr .8fr; align-items: center; min-height: 80vh; } .qr-box { max-width: 28rem; } }
@media (max-width: 767px) { .landing-qr { border-right: 0; border-bottom: 1px solid var(--foreground); padding-bottom: 2rem; } }

/* final debate */
.debate-tone-1 { --tone: var(--marker-1); } .debate-tone-2 { --tone: var(--marker-2); } .debate-tone-3 { --tone: var(--marker-3); } .debate-tone-4 { --tone: var(--marker-4); } .debate-tone-5 { --tone: var(--marker-5); }
.debate-hand { font: 600 2.1rem/1.15 var(--font-handwritten); color: var(--note-ink); margin: 0 0 .9rem; }
.debate-steps { display: flex; flex-wrap: wrap; gap: .6rem; padding: 0; margin: 0; list-style: none; }
.debate-chip { background: var(--tone); border-radius: 999px; padding: .55rem 1rem; font-size: 1rem; line-height: 1.4; }
.debate-bubbles { display: grid; grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr)); gap: 1.1rem; }
.debate-bubble { position: relative; aspect-ratio: 1; background: var(--tone); text-align: center; border: 2px solid transparent; border-radius: 46% 54% 50% 50% / 52% 46% 54% 48%; display: grid; justify-items: center; align-content: center; gap: .35rem; padding: 1.2rem; cursor: pointer; font: inherit; color: inherit; box-shadow: 0 12px 22px -16px color-mix(in oklab, var(--foreground) 45%, transparent); transition: transform .25s, box-shadow .25s, border-color .25s; }
.debate-bubble.tilt-l { transform: rotate(-2deg); } .debate-bubble.tilt-r { transform: rotate(2deg); }
.debate-bubble:hover, .debate-bubble:focus-visible { transform: rotate(0) scale(1.05); }
.debate-bubble.is-on { border-color: var(--note-ink); box-shadow: 0 18px 30px -14px color-mix(in oklab, var(--note-ink) 55%, transparent); transform: scale(1.06); }
.debate-emoji { font-size: 2.4rem; line-height: 1; }
.debate-id { font: .75rem var(--font-mono); letter-spacing: .12em; color: var(--ink-soft); margin: 0; }
.debate-title { font: 600 1.45rem/1.15 var(--font-handwritten); color: var(--note-ink); }
.debate-points { position: absolute; top: .6rem; right: .8rem; background: var(--background); color: var(--note-ink); border-radius: 999px; padding: .1rem .5rem; font-size: .85rem; font-weight: 800; }
.debate-stamp { position: absolute; top: 42%; left: 50%; transform: translate(-50%, -50%) rotate(-14deg); border: 2.5px solid var(--note-ink); font: 700 1.4rem var(--font-handwritten); color: var(--note-ink); background: color-mix(in oklab, var(--background) 70%, transparent); border-radius: .5rem; padding: .15rem .7rem; }
.debate-bubble.is-done > :not(.debate-stamp):not(.debate-points) { opacity: .45; }
.debate-case { display: grid; gap: .9rem; margin-top: 1.6rem; padding: 1.6rem 1.5rem; border-radius: 1.4rem; background: color-mix(in oklab, var(--background) 72%, var(--tone)); border: 1px solid color-mix(in oklab, var(--note-ink) 18%, transparent); }
.debate-case p { margin: 0; }
.debate-scene { font-size: 1.08rem; line-height: 1.65; }
.debate-facts, .debate-sources { background: var(--background); border-radius: 1rem; padding: 1rem 1.1rem; }
.debate-facts ul, .debate-sources ul { display: grid; gap: .4rem; margin: .4rem 0 0; padding-left: 1.2rem; }
.debate-sources a { color: var(--note-ink); text-decoration: underline; text-underline-offset: 3px; }
.debate-question { border-left: 4px solid var(--note-ink); background: var(--background); border-radius: .6rem; padding: .8rem 1rem; font-size: 1.1rem; font-weight: 650; }
.debate-progress { justify-self: start; background: var(--marker-1); border-radius: 999px; padding: .4rem .9rem; font-weight: 600; margin: 0; }
.debate-box { display: grid; gap: .45rem; min-width: 0; padding: 1rem; border-radius: 1.1rem; background: color-mix(in oklab, var(--background) 55%, var(--tone)); border: 0; margin: 0; }
.debate-box > span { font-weight: 650; }
.debate-box textarea, .debate-box input { background: var(--background); }
.debate-score { position: sticky; top: 5rem; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; padding: .7rem 1.1rem; border-radius: 999px; background: color-mix(in oklab, var(--background) 60%, var(--marker-1)); box-shadow: 0 10px 22px -16px color-mix(in oklab, var(--foreground) 45%, transparent); }
.debate-score-num { font: 700 2rem/1 var(--font-handwritten); color: var(--note-ink); }
.debate-score-num small { opacity: .7; font-size: 1rem; }
.debate-score-bar { flex: 8rem; height: .8rem; border-radius: 999px; background: var(--background); overflow: hidden; }
.debate-score-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--marker-3), var(--marker-1), var(--marker-5)); transition: width .6s; }
.debate-level { margin-bottom: 1.4rem; }
.debate-level-tag { display: inline-block; background: var(--background); border: 1.5px dashed color-mix(in oklab, var(--note-ink) 45%, transparent); border-radius: 999px; margin: 0 0 .7rem; padding: .25rem .8rem; font-size: .9rem; font-weight: 700; color: var(--note-ink); }
.debate-board { display: grid; gap: .5rem; padding: 0; list-style: none; }
.debate-board li { display: flex; align-items: center; gap: .8rem; padding: .6rem 1rem; border-radius: 1rem; background: color-mix(in oklab, var(--background) 55%, var(--tone)); }
.debate-board li.is-mine { outline: 2px solid var(--note-ink); }
.debate-timer { position: sticky; top: .5rem; z-index: 20; display: inline-flex; align-items: baseline; gap: .4rem; justify-self: start; margin-bottom: 1.5rem; padding: .4rem 1rem; border: 2px solid var(--border); border-radius: 999px; background: var(--card); font: 700 1.6rem ui-monospace, monospace; box-shadow: 0 2px 8px color-mix(in oklab, var(--foreground) 10%, transparent); }
.debate-timer small { color: var(--muted-foreground); font-size: .85rem; font-weight: 400; }
.debate-timer.is-low { color: var(--destructive); border-color: var(--destructive); }
.debate-podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 1rem; }
.debate-podium-card { display: grid; justify-items: center; gap: .3rem; text-align: center; min-width: 0; overflow-wrap: anywhere; padding: 1.2rem .8rem; border-radius: 1.4rem; background: color-mix(in oklab, var(--background) 40%, var(--tone)); }
.debate-podium-card p { margin: 0; }
.debate-podium-card.place-1 { outline: 3px solid var(--note-ink); order: 2; padding-block: 2rem; } .debate-podium-card.place-2 { order: 1; } .debate-podium-card.place-3 { order: 3; }
.debate-table { width: 100%; border-collapse: separate; border-spacing: 0 .35rem; }
.debate-table th { text-align: left; color: var(--muted-foreground); padding: .3rem .8rem; font-size: .8rem; font-weight: 500; }
.debate-table td { background: var(--card); padding: .6rem .8rem; }
.debate-table td:first-child { border-radius: .8rem 0 0 .8rem; font-size: 1.3rem; } .debate-table td:last-child { border-radius: 0 .8rem .8rem 0; }
.debate-table tr.place-1 td { background: color-mix(in oklab, var(--background) 40%, var(--marker-1)); }
.debate-table tr.place-2 td { background: color-mix(in oklab, var(--background) 40%, var(--marker-4)); }
.debate-table tr.place-3 td { background: color-mix(in oklab, var(--background) 40%, var(--marker-5)); }
.debate-grid { display: grid; gap: 2.5rem; max-width: 56rem; }
.grid2 { display: grid; gap: 1rem; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } .span2 { grid-column: span 2; } }
@media (max-width: 900px) { .debate-score { position: static; border-radius: 1.2rem; } }
@media (max-width: 640px) { .debate-bubbles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; } .debate-bubble { aspect-ratio: auto; border-radius: 2rem; min-height: 9.5rem; padding: .9rem .6rem; } .debate-title { font-size: 1.15rem; } .debate-emoji { font-size: 1.8rem; } .debate-hand { font-size: 1.7rem; } .debate-podium { grid-template-columns: 1fr; } .debate-podium-card { order: 0 !important; } }

/* teacher zone */
.teacher-reports, .teacher-team-browser, .teacher-team-detail { display: grid; gap: 1.5rem; min-width: 0; }
.teacher-team-browser, .teacher-team-detail { gap: 1.25rem; }
.teacher-report-toolbar, .teacher-report-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; }
.teacher-report-toolbar > .case-pen-note { flex: 1 1 22rem; }
.teacher-report-tabs { border-block: 1px solid var(--border); padding-block: .75rem; }
.teacher-report-tabs .b span, .teacher-team-filters .b span { color: var(--muted-foreground); font-family: var(--font-mono); }
.teacher-report-tabs .b.pri span { color: inherit; opacity: .8; }
.teacher-totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-block: 1px solid var(--border); }
.teacher-totals > div { padding: 1.4rem .8rem; }
.teacher-totals dt { color: var(--muted-foreground); font-size: .85rem; }
.teacher-totals dd { font: 700 2rem/1.2 var(--font-display); color: var(--primary); margin: .5rem 0 0; }
.teacher-chart-band { min-width: 0; padding-block: 1rem; }
.teacher-chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 2rem; }
.teacher-chart-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(4rem, 1.2fr) 3.5rem; align-items: center; gap: .8rem; font-size: .85rem; }
.teacher-chart-row progress { width: 100%; height: .65rem; accent-color: var(--primary); }
.teacher-search { flex: 1 1 18rem; display: flex; align-items: center; gap: .5rem; min-width: 0; max-width: 30rem; }
.teacher-search input { min-width: 0; }
.teacher-table-scroll { border-block: 1px solid var(--border); max-width: 100%; overflow-x: auto; }
.teacher-table { width: 100%; min-width: 70rem; border-collapse: collapse; table-layout: fixed; font-size: .85rem; }
.teacher-table th { text-align: left; color: var(--primary); background: var(--accent); font-weight: 600; }
.teacher-table td, .teacher-table th { border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; padding: 1rem .7rem; }
.teacher-table td { white-space: pre-wrap; line-height: 1.6; }
.teacher-table summary { cursor: pointer; color: var(--note-ink); }
.teacher-team-list-heading, .teacher-team-back, .teacher-team-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; }
.teacher-team-list-heading > span { color: var(--muted-foreground); font: .85rem/1.5 var(--font-mono); }
.teacher-team-list-heading .case-pen-note { margin: 0; }
.teacher-team-filters, .teacher-team-detail-tabs { display: flex; flex-wrap: wrap; gap: .5rem; }
.teacher-team-list { border-top: 1px solid var(--border); }
.teacher-team-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(12rem, .65fr); gap: 1.5rem; padding: 1.5rem .5rem; border-bottom: 1px solid var(--border); }
.teacher-team-row-main, .teacher-team-row-meta { display: grid; align-content: start; gap: .6rem; min-width: 0; }
.teacher-team-row h3, .teacher-team-heading h2 { font: 700 1.6rem/1.3 var(--font-display); margin: 0; overflow-wrap: anywhere; }
.teacher-team-heading h2 { font-size: 2.2rem; }
.teacher-team-row p, .teacher-team-heading p { margin: 0; line-height: 1.65; overflow-wrap: anywhere; }
.teacher-team-row-people, .teacher-team-row-meta > span { color: var(--muted-foreground); font-size: .85rem; }
.teacher-team-status { display: inline-flex; align-items: center; gap: .35rem; width: fit-content; padding: .3rem .5rem; font-size: .8rem; color: var(--muted-foreground); background: var(--secondary); }
.teacher-team-status[data-status=submitted] { color: var(--primary); background: var(--accent); }
.teacher-team-status[data-status=working] { color: var(--foreground); background: var(--note-highlight); }
.teacher-team-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 0; padding: 1.25rem 0; border-block: 1px solid var(--border); }
.teacher-team-facts dt { color: var(--muted-foreground); margin-bottom: .5rem; font-size: .8rem; }
.teacher-team-facts dd { margin: 0; font-weight: 600; line-height: 1.6; overflow-wrap: anywhere; }
.teacher-team-downloads { border-bottom: 1px solid var(--border); padding: .5rem 0 1.25rem; }
.teacher-team-downloads > h3 { display: flex; align-items: center; gap: .5rem; color: var(--primary); margin: 0 0 1rem; font-size: 1rem; }
.teacher-team-downloads > p { margin: 1rem 0 0; line-height: 1.65; }
.teacher-team-content { min-width: 0; padding: .5rem 0 1.5rem; }
.teacher-team-document { white-space: pre-wrap; overflow-wrap: anywhere; border-left: 2px solid var(--border); max-width: 70ch; padding: .25rem 0 .25rem 1.25rem; font-size: .95rem; line-height: 1.8; }
.teacher-team-empty { color: var(--muted-foreground); padding: 2rem 0; }
.teacher-team-member-list { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; padding: 0 0 1.25rem; list-style: none; border-bottom: 1px solid var(--border); }
.teacher-team-member-list li { display: flex; align-items: center; gap: .5rem; }
.teacher-team-member-list span { color: var(--primary); font-size: .8rem; }
.teacher-team-mission { display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: .75rem; padding: 1.25rem 0; border-bottom: 1px solid var(--border); }
.teacher-team-mission > span { color: var(--note-ink); font-family: var(--font-mono); }
.teacher-team-mission h3 { margin: 0; font-size: 1rem; line-height: 1.6; }
.teacher-team-mission p { color: var(--muted-foreground); font-size: .85rem; margin: .2rem 0 .6rem; }
@media (max-width: 700px) { .teacher-team-row { grid-template-columns: minmax(0, 1fr); gap: 1rem; } .teacher-team-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .teacher-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); } .teacher-chart-grid { grid-template-columns: minmax(0, 1fr); } }

/* =====================================================================
   Chapter 04 map: same look as https://howithink.njb-berky.com/ (scoped .hit)
   ===================================================================== */
.hit { --paper:#F4F2ED; --ink:#14161A; --hmuted:#5A5E66; --stone:#DCD8CF; --surf:#ECE9E2; --forest:#2F5D50; background: var(--paper); color: var(--ink); font: 14px/1.5 Epilogue, system-ui, sans-serif; border: 1px solid var(--stone); margin-top: 18px; }
.hit * { box-sizing: border-box; }
.hit button { border-radius: 0; }
.hit-wrap { display: grid; grid-template-columns: 250px minmax(0, 1fr) 270px; height: 720px; }
.hit-side1 { border-right: 1px solid var(--stone); padding: 22px 16px 22px 18px; display: flex; flex-direction: column; gap: 16px; min-width: 0; overflow-y: auto; }
.hit-side2 { border-left: 1px solid var(--stone); padding: 22px 16px; display: flex; flex-direction: column; gap: 14px; min-width: 0; overflow: hidden; }
.hit-kicker { font: 10px "JetBrains Mono", monospace; letter-spacing: .24em; text-transform: uppercase; color: var(--hmuted); }
.hit-h1 { font: 800 34px/.95 Urbanist, system-ui, sans-serif; letter-spacing: -.035em; margin: 6px 0 10px; }
.hit-lede { color: var(--hmuted); margin: 0; font-size: 13px; max-width: 34ch; }
.hit-projects { display: flex; flex-direction: column; gap: 16px; }
.hit-group { display: flex; flex-direction: column; gap: 6px; }
.hit-group h2 { margin: 0 0 2px; font: 700 10px "JetBrains Mono", monospace; letter-spacing: .22em; text-transform: uppercase; }
.hit-proj { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: transparent; border: 1px solid var(--stone); padding: 7px 10px; cursor: pointer; font: 13.5px Epilogue, system-ui, sans-serif; color: var(--ink); transition: background .15s, border-color .15s; }
.hit-proj:hover { background: var(--surf); }
.hit-proj[aria-pressed="true"] { border-color: var(--ink); background: #fff; }
.hit-proj .dot { width: 8px; height: 8px; flex: none; }
.hit-proj .name { flex: 1; min-width: 0; }
.hit-proj .st { font: 9.5px "JetBrains Mono", monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--hmuted); }
.hit-foot { margin-top: auto; font: 9.5px "JetBrains Mono", monospace; letter-spacing: .16em; text-transform: uppercase; color: var(--hmuted); border-top: 1px solid var(--stone); padding-top: 10px; }
.hit-stage { position: relative; min-width: 0; overflow: hidden; }
.hit-cv { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.hit-cv.drag { cursor: grabbing; }
.hit-bar { position: absolute; top: 14px; left: 16px; right: 16px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; pointer-events: none; }
.hit-chip { pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; font: 10px "JetBrains Mono", monospace; letter-spacing: .14em; text-transform: uppercase; background: rgba(244,242,237,.9); border: 1px solid var(--stone); padding: 5px 8px; cursor: pointer; color: var(--ink); }
.hit-chip i { width: 7px; height: 7px; display: inline-block; }
.hit-chip[aria-pressed="false"] { opacity: .38; }
.hit-hint { font: 9.5px "JetBrains Mono", monospace; letter-spacing: .16em; text-transform: uppercase; color: var(--hmuted); margin-left: 6px; }
.hit-ctrl { position: absolute; bottom: 12px; right: 16px; display: flex; gap: 6px; }
.hit-ctrl button { font: 10px "JetBrains Mono", monospace; letter-spacing: .16em; text-transform: uppercase; background: rgba(244,242,237,.92); border: 1px solid var(--ink); padding: 7px 10px; cursor: pointer; color: var(--ink); }
.hit-ctrl button:hover { background: var(--ink); color: var(--paper); }
.hit-tour { position: absolute; left: 16px; bottom: 12px; display: inline-flex; align-items: center; gap: 8px; font: 10px "JetBrains Mono", monospace; letter-spacing: .16em; text-transform: uppercase; background: rgba(244,242,237,.92); border: 1px solid var(--stone); padding: 7px 10px; color: var(--ink); cursor: pointer; }
.hit-tour[hidden] { display: none; }
.hit-tour i { width: 7px; height: 7px; border-radius: 50% !important; background: var(--forest); animation: hitpulse 1.4s ease-in-out infinite; }
.hit-tour .tm { color: var(--hmuted); } .hit-tour .tm::before { content: "·"; margin-right: 8px; }
@keyframes hitpulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.hit-tip { position: absolute; pointer-events: none; max-width: 280px; background: #fff; border: 1px solid var(--ink); padding: 9px 11px; font-size: 12.5px; line-height: 1.4; display: none; z-index: 3; }
.hit-tip .k { font: 9px "JetBrains Mono", monospace; letter-spacing: .18em; text-transform: uppercase; margin-bottom: 3px; }
.hit-tip .t { font-weight: 500; } .hit-tip .d { color: var(--hmuted); margin-top: 2px; }
.hit-readout { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--stone); flex: none; }
.hit-readout div { padding: 8px 10px; border-right: 1px solid var(--stone); border-bottom: 1px solid var(--stone); min-width: 0; }
.hit-readout div:nth-child(2n) { border-right: 0; } .hit-readout div:nth-last-child(-n+2) { border-bottom: 0; }
.hit-readout b { display: block; font: 700 16px "JetBrains Mono", monospace; font-variant-numeric: tabular-nums; }
.hit-readout span { display: block; font: 8px "JetBrains Mono", monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--hmuted); line-height: 1.35; }
.hit-logbox { flex: 1 1 auto; min-height: 110px; display: flex; flex-direction: column; min-width: 0; }
.hit-log { list-style: none; margin: 0; padding: 0; font: 11px/1.45 "JetBrains Mono", monospace; display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22px); mask-image: linear-gradient(to bottom, transparent 0, #000 22px); }
.hit-log::-webkit-scrollbar { display: none; }
.hit-log li { display: grid; grid-template-columns: 54px 1fr; gap: 8px; animation: hitin .25s ease-out; padding-bottom: 5px; border-bottom: 1px solid var(--stone); }
.hit-log li i { font-style: normal; color: var(--hmuted); font-variant-numeric: tabular-nums; }
.hit-log li em { font-style: normal; font-weight: 700; }
@keyframes hitin { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.hit-out { border: 1px solid var(--ink); background: #fff; padding: 12px; display: flex; flex-direction: column; gap: 6px; flex: none; max-height: 40%; overflow-y: auto; }
.hit-out[hidden] { display: none; }
.hit-out h3 { margin: 0; font: 800 20px Urbanist, sans-serif; letter-spacing: -.02em; }
.hit-out p { margin: 0; color: var(--hmuted); font-size: 13px; }
.hit-out .res { border-top: 1px solid var(--stone); padding-top: 8px; font-size: 13px; }
.hit-out .res b { display: block; font: 700 9px "JetBrains Mono", monospace; letter-spacing: .18em; text-transform: uppercase; color: var(--forest); margin-bottom: 3px; }
.hit-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.hit-btn { display: inline-block; font: 700 10.5px "JetBrains Mono", monospace; letter-spacing: .18em; text-transform: uppercase; padding: 8px 12px; text-decoration: none; border: 1px solid var(--forest); background: var(--forest); color: var(--paper); }
.hit-btn[hidden] { display: none; }
.hit-btn:hover { background: var(--ink); border-color: var(--ink); }
.hit-ask { border-top: 1px solid var(--stone); padding-top: 12px; display: grid; gap: 8px; flex: none; }
.hit-askrow { display: flex; gap: 6px; }
.hit-askrow input { flex: 1; min-width: 0; font: 13px Epilogue, sans-serif; padding: 8px 10px; border: 1px solid var(--stone); background: #fff; }
.hit-askrow button { font: 700 10px "JetBrains Mono", monospace; letter-spacing: .16em; text-transform: uppercase; background: var(--forest); color: var(--paper); border: 1px solid var(--forest); padding: 0 12px; cursor: pointer; }
.hit-askrow button:disabled { opacity: .5; }
.hit-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.hit-chips button { font: 11px Epilogue, sans-serif; background: transparent; border: 1px solid var(--stone); padding: 4px 7px; cursor: pointer; color: var(--ink); text-align: left; }
.hit-chips button:hover { border-color: var(--ink); background: #fff; }
@media (max-width: 1100px) and (min-width: 901px) { .hit-wrap { grid-template-columns: 220px minmax(0, 1fr) 236px; } .hit-h1 { font-size: 28px; } }
@media (max-width: 900px) {
  .hit-wrap { display: flex; flex-direction: column; height: auto; }
  .hit-side1, .hit-side2 { display: contents; }
  .hit-intro { order: 1; padding: 18px 16px 0; }
  .hit-stage { order: 2; height: clamp(440px, 118vw, 78vh); margin-top: 12px; border-top: 1px solid var(--stone); border-bottom: 1px solid var(--stone); }
  .hit-readout { order: 3; margin: 14px 16px 0; }
  .hit-logbox { order: 4; margin: 14px 16px 0; }
  .hit-log { max-height: 220px; }
  .hit-out { order: 5; margin: 14px 16px 0; max-height: none; }
  .hit-ask { order: 6; margin: 14px 16px 0; }
  .hit-projects { order: 7; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; }
  .hit-foot { order: 8; margin: 0 16px 16px; }
  .hit-bar { flex-wrap: nowrap; overflow-x: auto; pointer-events: auto; left: 0; right: 0; padding: 0 12px; }
  .hit-chip { flex: none; } .hit-hint { display: none; }
  .hit-ctrl { right: 8px; bottom: 8px; }
  .hit-tour { left: 8px; top: 48px; bottom: auto; padding: 5px 8px; font-size: 9.5px; } .hit-tour .tm { display: none; }
}
@media (max-width: 520px) { .hit-projects { grid-template-columns: 1fr; } }

/* ---------- Math for Different Brains: live toys, tutor, cheat cards ---------- */
.toy { border: 1px solid var(--foreground); background: var(--surface); padding: 26px 22px 22px; position: relative; box-shadow: 5px 5px 0 var(--marker-1); }
.toy .ai-tag { position: absolute; top: -11px; left: 18px; background: var(--foreground); color: var(--background); font: 600 10px var(--font-mono); letter-spacing: .2em; padding: 4px 9px; text-transform: uppercase; }
.toy h3 { font-size: 24px; margin: 4px 0 14px; }
.pz-row { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: 22px; align-items: center; }
@media (max-width: 600px) { .pz-row { grid-template-columns: 1fr; justify-items: center; text-align: center; } }
.pz { width: 100%; max-width: 260px; overflow: visible; }
.pz .slice { fill: oklch(88% .08 80); stroke: var(--note-ink); stroke-width: 2.2; cursor: pointer; transition: transform .18s ease, fill .18s; transform-box: fill-box; transform-origin: center; outline: none; }
.pz .slice:hover { transform: var(--lift); fill: oklch(84% .1 80); }
.pz .slice.on { fill: var(--primary); transform: var(--lift); }
.pz .slice:focus-visible { stroke: var(--pen-yellow); stroke-width: 4.5; }
.pz .pep { fill: var(--pen-red); pointer-events: none; }
.pz-frac { display: flex; justify-content: center; font: 900 56px/1 var(--font-display); margin: 6px 0; }
.fr { display: inline-flex; flex-direction: column; align-items: center; line-height: 1; vertical-align: middle; }
.fr > span:first-child { border-bottom: 4px solid currentColor; padding: 0 8px 4px; }
.fr > span:last-child { padding-top: 4px; }
.bump { animation: bump .32s ease; } @keyframes bump { 40% { transform: scale(1.18); } }
.pz-say { font-size: 1.5rem; margin: 10px 0 0; color: var(--note-ink); }
.pz-say.ok { color: var(--pen-green); }
.cells { display: grid; gap: 4px; height: 54px; margin: 16px 0; }
.cells i { border: 1px solid var(--foreground); background: var(--background); transition: background .3s; }
.cells i.on { background: var(--primary); }
.shake { animation: shake .4s; } @keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.verdict { display: inline-block; font: 700 11px var(--font-mono); letter-spacing: .2em; text-transform: uppercase; padding: 5px 10px; border: 1px solid var(--foreground); margin-bottom: 10px; }
.verdict.ok { background: var(--pen-green-hl); } .verdict.warn { background: var(--pen-yellow-hl); }
.cheats { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-top: 16px; }
.cheat { border: 1px solid var(--foreground); background: var(--marker-1); padding: 14px 16px; transform: rotate(-.6deg); }
.cheat:nth-child(even) { background: var(--marker-3); transform: rotate(.7deg); }
.cheat h4 { font: 800 18px var(--font-display); margin: 6px 0 8px; }
.cheat li { font-family: var(--font-handwritten); font-size: 1.35rem; line-height: 1.25; }
.ai-card input { font: 600 16px var(--font-mono); padding: 11px 14px; border: 1px solid var(--foreground); background: var(--background); min-width: 0; flex: 1 1 180px; }
html[data-mode="calm"] .cheat { transform: none; }
/* discount toy */
.dc-sl{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin:14px 0 18px}
.dc-sl label{display:flex;flex-direction:column;gap:8px;font-family:var(--font-mono);font-size:11px;letter-spacing:.22em;text-transform:uppercase;color:var(--muted-foreground)}
.dc-sl label b{font-family:var(--font-handwritten);font-size:2.4rem;color:var(--note-ink);letter-spacing:0;text-transform:none}
.dc-sl input[type=range]{width:100%;accent-color:var(--primary);height:28px}
.dc-bars{display:flex;flex-direction:column;gap:10px}
.dc-bar{position:relative;height:46px;border:1px solid var(--foreground);background:var(--surface)}
.dc-bar i{position:absolute;inset:0 auto 0 0;transition:width .45s cubic-bezier(.3,1.4,.5,1)}
.dc-bar.full i{background:var(--muted)}.dc-bar.one i{background:var(--marker-1)}.dc-bar.two i{background:var(--marker-3)}
.dc-bar.one::after{content:"";position:absolute;top:0;bottom:0;right:calc(100% - (100% - var(--w,0%)));}
.dc-bar span{position:relative;z-index:1;line-height:46px;padding-left:14px;font-weight:700;font-variant-numeric:tabular-nums}
.dc-vs{display:flex;align-items:center;gap:14px;margin:18px 0 6px;flex-wrap:wrap}
.dc-v{border:1px solid var(--foreground);padding:10px 16px;min-width:0;flex:1}
.dc-v small{display:block;font-family:var(--font-mono);font-size:10px;letter-spacing:.22em;text-transform:uppercase;color:var(--muted-foreground)}
.dc-v strong{font-family:var(--font-display);font-weight:800;letter-spacing:-.03em;font-size:30px;line-height:1.1}
.dc-v.think strong{text-decoration:line-through;text-decoration-color:var(--pen-red);text-decoration-thickness:3px;color:var(--muted-foreground)}
.dc-v.real{background:var(--marker-3)}
.dc-ne{font-size:34px;font-weight:700}
.dc-mult{font-size:13px;color:var(--muted-foreground);margin:10px 0 0}
.dc-say{font-size:1.4rem;margin:8px 0 0}.dc-say.ok{color:var(--pen-green)}
@media(max-width:640px){.dc-sl{grid-template-columns:1fr}}
/* ===== game layer, Studio Ink ===== */
.xp{position:fixed;top:118px;right:18px;z-index:30;display:grid;grid-template-columns:auto auto;gap:2px 10px;align-items:baseline;background:var(--background);border:1px solid var(--foreground);padding:8px 12px;font-family:var(--font-mono)}
.xp span{font-size:10px;letter-spacing:.22em;text-transform:uppercase;color:var(--muted-foreground)}.xp b{font-size:14px;text-align:right}
.xp.tick b{animation:tick .5s ease-out}@keyframes tick{0%{color:var(--primary)}100%{color:inherit}}
[data-nopressure="1"] .xp{display:none}
.ink-stamp{position:absolute;right:18px;top:14px;z-index:5;pointer-events:none;animation:stampIn .35s cubic-bezier(.3,1.5,.5,1)}
.ink-stamp.out{opacity:0;transition:opacity .5s}
@keyframes stampIn{from{transform:scale(1.8) rotate(-12deg);opacity:0}}
.gs-row{display:flex;align-items:center;gap:14px;margin:6px 0 4px}.gs-note{font-size:1.4rem;margin:0}
.gs input[type=range],.boss input[type=range]{width:100%;accent-color:var(--primary);height:28px}
.gs .fig{margin:10px 0 0}.gs .fig svg{width:100%;height:auto;overflow:visible}
.gs .pop{animation:fadeUp .5s ease-out both}@keyframes fadeUp{from{opacity:0;transform:translateY(8px)}}
.sw-card{position:relative;margin:16px auto 14px;max-width:460px;min-height:170px;display:flex;align-items:center;justify-content:center;padding:26px 30px;cursor:grab;touch-action:pan-y;transition:transform .22s,opacity .22s;user-select:none;outline-offset:6px}
.sw-bg{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
.sw-sign{position:relative;font-family:var(--font-handwritten);font-weight:700;font-size:2.3rem;line-height:1.1;color:var(--note-ink);text-align:center}
.sw-card[data-lean=r] .sw-sign{color:var(--pen-green)}.sw-card[data-lean=l] .sw-sign{color:var(--pen-red)}
.sw-card.fly-r{transform:translateX(120%) rotate(14deg);opacity:0}.sw-card.fly-l{transform:translateX(-120%) rotate(-14deg);opacity:0}
.sw-meta{display:flex;justify-content:space-between;font-family:var(--font-mono);font-size:10px;letter-spacing:.22em;text-transform:uppercase;color:var(--muted-foreground);margin-top:6px}
.sw-btns{display:flex;gap:10px;justify-content:center}.sw-btns .btn{min-width:150px}
.boss-meter{margin:8px 0 2px}.boss-meter svg{display:block;overflow:visible}
.boss-line{font-size:1.55rem;color:var(--pen-red);margin:16px 0 4px}
.boss-q{font-family:var(--font-display);font-weight:800;letter-spacing:-.03em;font-size:22px;margin:4px 0 12px}
.shop-row input,.shop-ans{flex:1;min-width:200px;padding:12px 0;border:0;border-bottom:1px solid var(--foreground);background:transparent;font:inherit;font-size:17px}
.shop-row input:focus,.shop-ans:focus{outline:none;border-bottom:2px solid var(--primary)}
.shop-grid{display:grid;grid-template-columns:minmax(220px,300px) 1fr;gap:24px;align-items:start;margin:20px 0 6px}
.receipt{font-family:var(--font-mono);font-size:13px;background:var(--surface);border:1px solid var(--foreground);padding:14px 16px;animation:fadeUp .4s ease-out}
.rc-shop{font-size:10px;letter-spacing:.22em;text-transform:uppercase;border-bottom:1px solid var(--border);padding-bottom:8px;margin-bottom:6px}
.rc-line{display:flex;justify-content:space-between;padding:4px 0}.rc-line.tot{border-top:1px solid var(--foreground);margin-top:8px;padding-top:8px;font-weight:700;font-size:15px}
.shop-twist{font-size:1.5rem;color:var(--pen-red);margin:0}
.vibes{display:flex;flex-wrap:wrap;gap:8px}
.vibe{border:1px solid var(--foreground);background:transparent;padding:9px 14px;font-family:var(--font-mono);font-size:11px;letter-spacing:.18em;text-transform:uppercase;cursor:pointer}
.vibe:hover{background:var(--highlight)}.vibe.on{background:var(--primary);color:var(--primary-foreground);border-color:var(--primary)}
.ex-q{margin:18px 0 0;padding:4px 0 4px 18px;border-left:1px solid var(--primary);animation:fadeUp .4s ease-out}.ex-q p{margin:8px 0 0;font-size:18px;line-height:1.6}
@media(max-width:640px){.shop-grid{grid-template-columns:1fr}.xp{top:auto;bottom:86px;right:10px}.sw-sign{font-size:1.9rem}}
.dc-sl.many{grid-template-columns:repeat(auto-fit,minmax(180px,1fr))}
.dc-sl.many label b{font-size:2rem}
.gs-choices{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px;margin:8px 0 4px}
.gs-choice{background:none;border:0;padding:0;cursor:pointer;transition:transform .15s}.gs-choice:hover:not(:disabled){transform:translateY(-3px)}
.gs-choice.dim{opacity:.45}.gs-choice svg{display:block}
