/* Carve-Out's one stylesheet: calm and easy on the eyes. A plain light background, soft white panels, one muted
   teal. Built from the approved prototype (docs/superpowers/specs/2026-10-25-calm-redesign-prototype.html). */
@import url("https://fonts.googleapis.com/css2?family=Wix+Madefor+Display:wght@500;600;700&family=Wix+Madefor+Text:wght@400;500;600&family=Geist+Mono:wght@400;500&family=Shantell+Sans:ital,wght,BNCE,INFM@0,300..800,-100..100,0..100&family=Atkinson+Hyperlegible+Mono:wght@400;600&display=swap");

/* ---------- Tokens and base ---------- */
:root {
  color-scheme: light;
  --bg: #F3F4F2;
  --surface: #FDFDFC;
  --ink: #22303A;
  --muted: #5B6770;
  --line: #E1E4E0;
  --accent: #3D7F77;
  --accent-hover: #336D66;
  --accent-soft: #E4EFEC;
  --accent-line: #A9CCC4;
  --accent-ink: #2F6A63;
  --good: #3B8A5A;
  --good-ink: #2E7049;
  --bad: #C2554D;
  --bad-ink: #A8433C;
  --kw: #8E4A9E;
  --fn: #2F6BB0;
  --str: #3B7D5A;
  --ty: #9A6A2E;
  --studio: #ECE9E3;
  --shadow: 0 1px 2px rgba(34, 48, 58, .05), 0 8px 24px rgba(34, 48, 58, .06);
  --shadow-lg: 0 2px 6px rgba(34, 48, 58, .05), 0 18px 44px rgba(34, 48, 58, .09);
  --shadow-xl: 0 6px 12px rgba(34, 48, 58, .06), 0 30px 64px rgba(34, 48, 58, .14);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --display: "Wix Madefor Display", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --text: "Wix Madefor Text", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font: 400 16px/1.6 var(--text); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button, input, textarea { font: inherit; color: inherit; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 8px; }
.gut { padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }
body { margin: 0; min-height: 100dvh; }
a { color: var(--accent-ink); }
a.brand, a.btn, a.navb { color: var(--ink); text-decoration: none; }
a.navb { display: inline-flex; align-items: center; color: var(--muted); }
a.btn.primary { color: #FFFFFF; }
h1, h2, h3 { font-family: var(--display); }

/* Panels: plain and soft, close in tone to the page, so they blend without any gradients. */
.panel { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.panel.raised { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); }

/* Pages and sections ease in whenever they become visible. Fixed layers (dialogs, the tour) live outside them. */
.screen { animation: screenIn .55s var(--ease) both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } }

/* Top bar. */
.top { max-width: 1240px; margin: 0 auto; min-height: 70px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.brand { display: inline-flex; align-items: center; gap: 10px; padding: 0; border: 0; background: none; font: 700 18px var(--display); letter-spacing: -0.02em; cursor: pointer; }
.crumb { font-size: 15px; color: var(--muted); }
.crumb b { color: var(--ink); font-weight: 500; }
.top-right { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.py-status { display: inline-flex; align-items: center; gap: 8px; margin-right: 6px; font-size: 13.5px; color: var(--muted); }
.spin { width: 13px; height: 13px; border-radius: 50%; border: 2px solid rgba(34, 48, 58, .15); border-top-color: var(--ink); animation: spin .8s linear infinite; }
.ready { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px rgba(59, 138, 90, .15); }
.navb { height: 38px; padding: 0 12px; border: 0; border-radius: 11px; background: none; color: var(--muted); font-size: 15px; font-weight: 500; cursor: pointer; transition: background .2s, color .2s; }
.navb:hover { background: var(--surface); color: var(--ink); }
.own { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 13px 0 9px; border-radius: 18px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.own.bump { animation: bump .8s var(--spring); }
.ring .track { stroke: rgba(34, 48, 58, .12); }
.ring .val { stroke: var(--accent); transition: stroke-dashoffset .9s var(--ease); }

/* Buttons. */
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.btn { position: relative; height: 46px; padding: 0 20px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); font: 600 15.5px var(--text); white-space: nowrap; cursor: pointer; box-shadow: 0 1px 2px rgba(34, 48, 58, .05); transition: transform .2s var(--ease), box-shadow .25s var(--ease), opacity .2s, filter .2s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(34, 48, 58, .1); }
.btn:active { transform: translateY(1px) scale(.98); box-shadow: none; }
.btn:disabled { opacity: .45; cursor: default; transform: none; box-shadow: none; }
.btn.primary { background: var(--accent); border-color: transparent; color: #FFFFFF; box-shadow: 0 4px 14px rgba(61, 127, 119, .22); }
.btn.primary:hover { background: var(--accent-hover); box-shadow: 0 8px 22px rgba(61, 127, 119, .28); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface); }
.btn.lg { height: 54px; padding: 0 26px; border-radius: 16px; font-size: 16.5px; }
.btn.xl { height: 64px; min-width: 156px; border-radius: 18px; font-size: 19px; }
.btn.sm { height: 40px; padding: 0 15px; border-radius: 12px; font-size: 14.5px; }
.btn .go { transition: transform .25s var(--ease); }
.btn:hover .go { transform: translateX(3px); }
.btn.nudge, .icon-btn.nudge { animation: nudge 2s ease-in-out infinite; }
.btn.nudge .go { animation: arrow 2s ease-in-out infinite; }
.link { padding: 4px 2px; border: 0; background: none; color: var(--muted); font-size: 15px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(91, 103, 112, .4); cursor: pointer; }
.link:hover { color: var(--ink); text-decoration-color: currentColor; }
.pill { height: 40px; padding: 0 16px; border-radius: 20px; font-size: 15px; font-weight: 500; cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s, background .2s; }
.pill:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.pill.on { background: var(--accent-soft); border-color: var(--accent-line); }
.go { display: inline-block; }

/* Tags: small labels like "Coming soon" or "Shown". */
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-ink); font: 600 12.5px var(--text); white-space: nowrap; }
.tag.good { background: rgba(59, 138, 90, .12); color: var(--good-ink); }
.tag.warn { background: rgba(154, 106, 46, .14); color: var(--ink); }
.tag.bad { background: rgba(194, 85, 77, .12); color: var(--bad-ink); }

/* Status lines: what just happened, or what went wrong. */
.status { margin: 0; min-height: 1.4em; font-size: 14.5px; color: var(--muted); white-space: pre-wrap; }
.status.error { color: var(--bad-ink); font: 400 13px/1.5 var(--mono); }

/* Chip: a little microchip. Pins, a screen for a face, eyes that follow you, a cursor for a mouth, a status light. */
.chip { --s: 54px; position: relative; flex: none; display: inline-block; width: var(--s); height: var(--s); filter: drop-shadow(0 calc(var(--s) * .07) calc(var(--s) * .1) rgba(40, 70, 80, .18)); transition: opacity .4s var(--ease), scale .5s var(--spring), margin-left .6s var(--ease); }
.chip svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chip.xs { --s: 28px; }
.chip.sm { --s: 40px; }
.chip.md { --s: 56px; }
.chip.lg { --s: 100px; }
.chip.xl { --s: 168px; }
.chip .pin { transform-box: fill-box; transform-origin: center; }
.chip .look { transform: translate(var(--px, 0px), var(--py, 0px)); transition: transform .14s ease-out; }
.chip .eyes { filter: drop-shadow(0 0 1.5px rgba(191, 235, 221, .5)); }
.chip .eye { fill: #BFEBDD; transform-box: fill-box; transform-origin: center; animation: blink 5.5s infinite; }
.chip .eye + .eye { animation-delay: .05s; }
.chip .smile { stroke: #BFEBDD; opacity: 0; }
.chip .mouth { fill: #BFEBDD; transform-box: fill-box; transform-origin: center; animation: cursor 1.1s steps(1) infinite; }
.chip .led { fill: #E2BE6A; }
.chip .cheek { fill: #E6A1B2; opacity: .75; }
.chip.happy .eyes { opacity: 0; }
.chip.happy .smile { opacity: 1; }
.chip.happy .mouth { animation: none; transform: scaleX(1.5); }
.chip.talk .mouth { animation: mouth .2s ease-in-out infinite alternate; }
.chip.talk .led, .chip.think .led, .chip.busy .led { animation: led .4s ease-in-out infinite alternate; }
.chip.talk .pin.l { animation: pinL .34s ease-in-out infinite alternate; }
.chip.talk .pin.r { animation: pinR .34s ease-in-out infinite alternate; }
.chip.busy .pin { animation: tap .28s ease-in-out infinite alternate; }
.chip.busy .pin:nth-child(even) { animation-delay: .14s; }
.chip.think .look { transform: translate(3px, -4px); }
.chip.hop { animation: hop 2.8s ease-in-out infinite; }
.chip.jump { animation: jump .7s var(--spring); }

/* Chip's words arrive one at a time. */
.say { margin: 0; font: 600 30px/1.28 var(--display); letter-spacing: -0.015em; text-wrap: balance; }
.say.md { font-size: 22px; line-height: 1.35; }
.say.sm { font: 500 16px/1.5 var(--text); letter-spacing: 0; }
.say .w { display: inline-block; animation: wordIn .55s var(--ease) both; }

@media (max-width: 760px) {
  .crumb, .wide-only { display: none; }
  .top { gap: 6px 8px; }
  .navb { padding: 0 8px; }
  .say { font-size: 22px; }
  .say.md { font-size: 19px; }
}

/* ---------- The story ---------- */
.story { overflow-x: clip; max-width: 1120px; margin: 0 auto; padding-block: 0 40px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.stage-wrap { position: relative; width: 100%; max-width: 1040px; height: 470px; }
.stage { position: absolute; left: 0; top: 0; width: 1040px; height: 470px; transform: scale(var(--k, 1)); transform-origin: 0 0; }
.stage > * { position: absolute; left: 0; top: 0; transition: transform .9s var(--ease), opacity .6s var(--ease), box-shadow .6s var(--ease); }
.caption { min-height: 88px; max-width: 860px; display: flex; align-items: center; justify-content: center; gap: 16px; }
.story.s-hello .caption .chip { opacity: 0; scale: .4; margin-left: -72px; }
.story.s-hello .say { text-align: center; }
.story-nav { display: flex; align-items: center; gap: 18px; }
.dots { display: flex; gap: 6px; }
.dots i { width: 8px; height: 8px; border-radius: 4px; background: rgba(34, 48, 58, .16); transition: width .45s var(--ease), background .3s; }
.dots i.done { background: rgba(34, 48, 58, .38); }
.dots i.on { width: 28px; background: var(--accent); }

.hello { width: 280px; height: 280px; display: grid; place-items: center; transform: translate(380px, 120px); }
.hello-glow { position: absolute; inset: 24px; border-radius: 50%; background: var(--accent-soft); animation: breathe 3.6s ease-in-out infinite; }
.story:not(.s-hello) .hello { opacity: 0; transform: translate(380px, 120px) scale(.45); }

.idea-box { width: 640px; display: flex; flex-direction: column; gap: 10px; opacity: 0; transform: translate(200px, 160px) scale(.96); }
.s-idea .idea-box { opacity: 1; transform: translate(200px, 140px); }
.s-app .idea-box { opacity: 0; transform: translate(200px, 80px) scale(.9); }
.ib-label { font-size: 14px; font-weight: 600; color: var(--muted); padding-left: 6px; }
.ib-field { height: 82px; display: flex; align-items: center; gap: 14px; padding: 0 12px 0 24px; border-radius: 22px; }
.ib-text { flex: 1; min-width: 0; font: 500 23px var(--display); white-space: nowrap; overflow: hidden; }
.ib-go { height: 56px; padding: 0 22px; display: inline-flex; align-items: center; border-radius: 16px; background: var(--accent); color: #FFFFFF; font-weight: 600; box-shadow: 0 4px 14px rgba(61, 127, 119, .22); transition: scale .2s; }
.ib-go.pressed { scale: .94; }

.app-win { width: 500px; height: 340px; overflow: hidden; border-radius: 20px; opacity: 0; transform: translate(270px, 70px) scale(.94); }
.s-app .app-win { opacity: 1; transform: translate(270px, 40px); }
.s-code .app-win { transform: translate(20px, 40px); }
.s-lift .app-win { opacity: .3; }
.s-all .app-win { box-shadow: 0 0 0 3px rgba(61, 127, 119, .45), var(--shadow-lg); }
.aw-head { height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid var(--line); }
.aw-logo { font: 700 16px var(--display); letter-spacing: -0.01em; }
.aw-add { padding: 6px 12px; border-radius: 10px; background: var(--accent-soft); border: 1px solid rgba(61, 127, 119, .4); font-size: 12.5px; font-weight: 600; transition: scale .2s, background .2s; }
.aw-add.pressed { scale: .93; background: var(--accent); color: #FFFFFF; }
.aw-search { margin: 12px 18px 6px; height: 36px; display: flex; align-items: center; padding: 0 12px; border-radius: 11px; background: rgba(34, 48, 58, .045); font-size: 13px; color: var(--muted); }
.aw-list { display: flex; flex-direction: column; gap: 4px; padding: 4px 12px 12px; }
.aw-row { height: 48px; display: flex; align-items: center; gap: 12px; padding: 0 8px; border-radius: 12px; }
.aw-row:nth-child(odd) { background: rgba(34, 48, 58, .03); }
.aw-thumb { width: 34px; height: 34px; flex: none; border-radius: 10px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); }
.aw-title { flex: 1; font-size: 13.5px; font-weight: 600; }
.aw-time { font-size: 12.5px; color: var(--muted); }
.aw-row.new { opacity: 0; transform: translateY(-10px); transition: opacity .5s var(--ease), transform .6s var(--spring); }
.aw-row.new.show { opacity: 1; transform: none; }
.aw-toast { position: absolute; left: 50%; top: 11px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 12px; background: rgba(255, 255, 255, .95); box-shadow: var(--shadow-lg); color: var(--accent-ink); font-size: 12.5px; font-weight: 600; white-space: nowrap; opacity: 0; transform: translate(-50%, -10px); transition: opacity .5s var(--ease), transform .6s var(--ease); }
.tk { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #FFFFFF; }
.s-back .aw-toast { opacity: 1; transform: translate(-50%, 0); transition-delay: 1s; }

.code-win { width: 440px; height: 340px; border-radius: 20px; opacity: 0; transform: translate(620px, 40px); }
.s-code .code-win { opacity: 1; transform: translate(580px, 40px); }
.s-lift .code-win { opacity: .3; }
.cw-head { height: 46px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.cw-head .muted { font-weight: 500; }

.blk { width: 400px; height: 40px; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(34, 48, 58, .05); opacity: 0; transform: translate(640px, var(--y)); transition: transform .9s var(--ease), opacity .6s var(--ease), background .4s, border-color .4s; }
.s-code .blk { opacity: 1; transform: translate(600px, var(--y)); }
.story.b4 .blk { transition-delay: calc(var(--i) * 70ms + 250ms); }
.s-lift .blk { opacity: .3; }
.s-lift .blk.b0 { opacity: 0; transform: translate(320px, 214px) scale(1.15); }
.blk .bd { width: 8px; height: 8px; border-radius: 50%; background: rgba(34, 48, 58, .2); transition: background .4s; }
.blk .bn { font: 500 13px var(--mono); }
.blk .bf { margin-left: auto; font-size: 12px; color: var(--muted); }
.blk .bc { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #FFFFFF; scale: 0; transition: scale .45s var(--spring); }
.blk.mine { background: var(--accent-soft); border-color: var(--accent-line); }
.blk.mine .bd { background: var(--accent); }
.blk.mine .bc { scale: 1; }
.blk.pop { animation: popScale .55s var(--spring); }

.slot-ghost { width: 400px; height: 40px; border-radius: 12px; background: repeating-linear-gradient(-45deg, rgba(34, 48, 58, .05) 0 7px, transparent 7px 14px); box-shadow: inset 0 0 0 1px rgba(34, 48, 58, .08); opacity: 0; transform: translate(600px, 98px); }
.s-lift .slot-ghost { opacity: 1; }

.desk { width: 560px; height: 268px; display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; border-radius: 22px; opacity: 0; transform: translate(240px, 124px) scale(.94); }
.s-lift .desk { opacity: 1; transform: translate(240px, 100px); transition-delay: .15s; }
.s-back .desk { opacity: 0; transform: translate(520px, -15px) scale(.2); }
.dk-head { display: flex; align-items: center; justify-content: space-between; }
.dk-name { font: 500 14px var(--mono); }
.dk-tag { padding: 4px 10px; border-radius: 8px; background: var(--accent-soft); border: 1px solid rgba(61, 127, 119, .4); color: var(--accent-ink); font-size: 12px; font-weight: 600; }
.dk-code { margin: 0; padding: 14px 16px; border-radius: 13px; background: rgba(34, 48, 58, .04); font: 400 12.5px/22px var(--mono); white-space: pre; overflow: hidden; }
.dk-tests { display: flex; gap: 22px; font-size: 13px; }
.dk-tests .t { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); opacity: 0; transform: translateY(6px); transition: opacity .35s var(--ease), transform .45s var(--ease), color .3s; }
.dk-tests .t.show { opacity: 1; transform: none; }
.dk-tests .t i { position: relative; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(34, 48, 58, .15); border-top-color: var(--ink); animation: spin .7s linear infinite; }
.dk-tests .t.ok { color: var(--good-ink); font-weight: 600; }
.dk-tests .t.ok i { border-color: var(--good); background: var(--good); animation: popScale .4s var(--spring); }
.dk-tests .t.ok i::after { content: ""; position: absolute; left: 3.5px; top: 1px; width: 4px; height: 7px; border: solid #FFFFFF; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.dk-hint { position: absolute; right: -30px; top: -26px; display: flex; align-items: center; gap: 8px; padding: 7px 14px 7px 7px; border-radius: 16px; background: rgba(255, 255, 255, .96); box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 600; opacity: 0; transform: translateY(8px) scale(.94); transition: opacity .35s var(--ease), transform .5s var(--spring); }
.dk-hint.show { opacity: 1; transform: none; }
.caret { display: inline-block; width: 2px; height: 1.15em; vertical-align: -0.2em; background: var(--accent); animation: caret 1s steps(1) infinite; }

.meter { width: 400px; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); opacity: 0; transform: translate(320px, 424px); }
.s-back .meter { opacity: 1; transform: translate(320px, 410px); }
.meter b { color: var(--ink); }
.m-track { width: 100%; height: 8px; overflow: hidden; border-radius: 4px; background: rgba(34, 48, 58, .08); }
.m-fill { display: block; width: 0; height: 100%; border-radius: 4px; background: var(--accent); transition: width .8s var(--ease); }

.cursor { width: 26px; height: 26px; opacity: 0; transform: translate(960px, 450px); filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .22)); }
.py-status.failed { color: var(--bad-ink); }
#story-sound.off .waves { opacity: 0; }
.top-right .icon-btn { border-color: transparent; background: none; }
@media (max-width: 760px) {
  .caption { min-height: 70px; }
  .py-status { display: none; }
  .story-nav { gap: 10px; }
}

/* ---------- What do you want to build? ---------- */
.choose { max-width: 780px; margin: 0 auto; padding-block: clamp(12px, 4vh, 44px) 56px; display: flex; flex-direction: column; gap: 22px; }
.greet { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.idea { display: flex; flex-direction: column; gap: 14px; padding: 22px; border-radius: 26px; transition: box-shadow .3s var(--ease); }
.idea textarea { width: 100%; min-height: 96px; padding: 4px; border: 0; outline: none; resize: none; background: transparent; font: 500 24px/1.35 var(--display); letter-spacing: -0.01em; }
.idea textarea::placeholder { color: var(--muted); }
.idea:focus-within { box-shadow: 0 0 0 3px rgba(61, 127, 119, .35), var(--shadow-lg); }
.idea-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.idea-foot .muted { font-size: 14.5px; }
.known { display: flex; flex-direction: column; gap: 10px; }
.known .muted { font-size: 15px; }
.own-project { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 16px; padding: 18px 20px; border-radius: 22px; }
.op-icon { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 14px; background: var(--accent-soft); border: 1px solid rgba(61, 127, 119, .35); }
.op-text { flex: 1 1 260px; display: flex; flex-direction: column; }
.op-text b { font-weight: 600; }
.op-text span { font-size: 15px; }
.drop { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 22px; animation: rise .45s var(--ease) both; }
.drop-zone { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 26px 16px; border-radius: 16px; border: 1.5px dashed rgba(34, 48, 58, .2); text-align: center; cursor: pointer; transition: background .2s, border-color .2s; }
.drop-zone:focus-within { outline: 2px solid var(--ink); outline-offset: 3px; }
.drop-zone:hover, .drop-zone.over { background: var(--accent-soft); border-color: rgba(61, 127, 119, .7); }
.small { font-size: 14px; }
.good { color: var(--good-ink); }
.bad { color: var(--bad-ink); }
.btn.danger { background: var(--bad); border-color: transparent; color: #FFFFFF; }
.example { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 16px; padding: 14px 18px 14px 14px; border-radius: 22px; }
.ex-pics { display: flex; gap: 6px; }
.starter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.starter { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 18px; border: 0; font: inherit; color: var(--ink); text-align: left; text-decoration: none; cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s; }
.starter b { font-weight: 600; }
.starter span { font-size: 13px; color: var(--muted); }
.starter:hover { transform: translateY(-2px); }
.starter:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.starter:disabled { opacity: .6; cursor: progress; }
@media (max-width: 760px) { .starter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ex-pics img { width: 48px; height: 48px; padding: 6px; object-fit: contain; border-radius: 12px; background: var(--studio); }
#upload-result p { margin: 0; }
#upload-result:empty { display: none; }
.drop .own-project { padding: 0; }
.drop .drop-zone { padding-block: 12px; flex-direction: row; justify-content: center; gap: 8px; }
.gh-row { display: flex; gap: 8px; }
.gh-row input { flex: 1; min-width: 0; height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; }
.gh-row input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
@media (max-width: 640px) { .drop .drop-zone { flex-direction: column; gap: 4px; } }
.drop > p { margin: 0; }
#uploads h2 { margin: 8px 0 12px; font: 600 20px var(--display); }
.mine-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.p-mine { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 18px; border-radius: 22px; }
.p-mine h3 { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.p-mine p, .p-mine ul { margin: 0; }
.confirm { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--bg); }
.confirm p { margin: 0; }
@media (max-width: 760px) {
  .idea textarea { font-size: 20px; }
}
@media (max-width: 640px) {
  .mine-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Questions ---------- */
.quiz { max-width: 760px; margin: 0 auto; padding-block: clamp(8px, 3vh, 36px) 56px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.build-pill { display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 16px 0 10px; border-radius: 20px; font-size: 14px; font-weight: 500; }
.qtop { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.qdots { display: flex; gap: 6px; }
.qdots i { width: 30px; height: 5px; border-radius: 3px; background: rgba(34, 48, 58, .13); transition: background .4s; }
.qdots i.done { background: var(--accent); }
.qdots i.on { background: var(--ink); }
.q-react { min-height: 32px; margin: 0; font: 600 19px var(--display); color: var(--accent-ink); }
.q-text { max-width: 22ch; margin: 0; font: 600 clamp(26px, 4.2vw, 42px)/1.2 var(--display); letter-spacing: -0.02em; text-wrap: balance; transition: opacity .25s, transform .4s var(--ease); }
.q-text.out { opacity: 0; transform: translateX(-28px); }
.q-text.pre { opacity: 0; transform: translateX(28px); transition: none; }
.q-why { margin: 0; color: var(--muted); }
.q-yn { display: flex; gap: 14px; margin-top: 10px; }
.q-voice { justify-content: center; min-height: 40px; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); cursor: pointer; font-size: 17px; }
.icon-btn:hover { color: var(--ink); }
.icon-btn[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent-soft); border-color: var(--accent-line); }
.voice-notice { position: fixed; left: 50%; bottom: 24px; z-index: 80; max-width: min(520px, calc(100% - 32px)); padding: 12px 16px; border-radius: 14px; background: var(--ink); color: #FFFFFF; font-size: 15px; transform: translateX(-50%); }
.voice-notice a { color: #FFFFFF; }
@media (max-width: 760px) {
  .q-yn .btn.xl { min-width: 120px; }
}

/* ---------- Profile ---------- */
.profile { max-width: 760px; margin: 0 auto; padding-block: clamp(8px, 3vh, 36px) 56px; }
.profile h1 { margin: 8px 0 4px; font-size: clamp(30px, 5vw, 44px); letter-spacing: -0.02em; }
.profile h2 { margin: 30px 0 4px; font-size: 19px; }
.profile .lead { margin: 0; font-size: 17px; color: var(--muted); }
.profile .muted.small { margin: 0 0 10px; }
.claims { list-style: none; margin: 0; padding: 4px 18px; border-radius: 20px; }
.claims li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.claims li:last-child { border-bottom: 0; }
.claims li > span:first-child { flex: 1; min-width: 0; }
.claims .icon-btn { width: 36px; height: 36px; border-color: transparent; background: none; }
.p-actions { margin-top: 30px; }

/* ---------- Home: one next step ---------- */
.home { max-width: 1000px; margin: 0 auto; padding-block: 16px 64px; display: flex; flex-direction: column; gap: 24px; }
.next { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); overflow: hidden; border-radius: 28px; }
.next-visual { position: relative; min-height: 310px; display: grid; place-items: center; padding: 30px; overflow: hidden; background: #EDF1EE; }
.next-body { display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 36px 36px 32px; }
.next-step { font-size: 13.5px; font-weight: 600; color: var(--accent-ink); }
.next-title { margin: 0; font: 600 34px/1.12 var(--display); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.next-text { margin: 0; font-size: 16.5px; color: var(--muted); }
.next-note { margin: 2px 0 0; padding: 12px 14px; border-radius: 13px; background: var(--bg); font-size: 15px; }
.next-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.next.in .next-visual > * { animation: rise .8s var(--ease) both; }
.next.in .next-body > * { animation: rise .6s var(--ease) both; }
.next.in .next-body > :nth-child(2) { animation-delay: .06s; }
.next.in .next-body > :nth-child(3) { animation-delay: .12s; }
.next.in .next-body > :nth-child(4) { animation-delay: .18s; }
.next.in .next-body > :nth-child(5) { animation-delay: .24s; }
.mini { position: relative; width: min(360px, 100%); overflow: hidden; border-radius: 20px; text-align: left; }
.mh { height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.mh b { font: 700 14px var(--display); }
.mb { padding: 4px 10px; border-radius: 9px; background: var(--accent-soft); border: 1px solid rgba(61, 127, 119, .4); font-size: 12px; font-weight: 600; }
.mb.dark { background: var(--ink); color: #FFFFFF; border-color: var(--ink); }
.ml { display: flex; flex-direction: column; gap: 4px; padding: 10px; }
.mr { height: 46px; display: flex; align-items: center; gap: 12px; padding: 0 8px; border-radius: 12px; font-size: 13.5px; }
.mr:nth-child(odd) { background: rgba(34, 48, 58, .03); }
.mt { width: 30px; height: 30px; flex: none; border-radius: 9px; }
.mn { flex: 1; font-weight: 600; }
.mm { font-size: 12.5px; color: var(--muted); }
.mini .my { position: absolute; right: 12px; top: 54px; padding: 3px 9px; border-radius: 7px; background: var(--accent); color: #FFFFFF; font-size: 11.5px; font-weight: 600; animation: popScale .5s .4s var(--spring) both; }
.ms-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 14px; }
.ms-grid span { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 12px; background: var(--studio); }
.ms-grid img { position: absolute; left: 10%; top: 10%; width: 80%; height: 80%; object-fit: contain; }
.ms-cursor { position: absolute; right: 26px; top: 32px; width: 22px; height: 22px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .22)); animation: hover 2.4s ease-in-out infinite; }
.mini-code { width: min(360px, 100%); overflow: hidden; border-radius: 20px; }
.mc-head { display: flex; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.mc-lines { color: var(--accent-ink); font-weight: 600; }
.mini-code pre { margin: 0; padding: 18px 16px 22px; font: 400 14px/24px var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.kw { color: var(--kw); } .fn { color: var(--fn); } .str { color: var(--str); } .ty { color: var(--ty); }

.journey { display: flex; align-items: center; padding: 14px 10px 38px; }
.jn { position: relative; flex: none; width: 16px; height: 16px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); border: 2px solid rgba(34, 48, 58, .2); transition: background .4s, border-color .4s; }
.jn.done { background: var(--accent); border-color: var(--accent); color: #FFFFFF; animation: popScale .5s var(--spring); }
.jn.done svg { width: 9px; height: 9px; }
.jn.now { width: 22px; height: 22px; border-color: var(--ink); animation: ring 1.8s ease-out infinite; }
.jn.now::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.jl { position: absolute; top: 30px; left: 50%; transform: translateX(-50%); font-size: 13px; font-weight: 600; white-space: nowrap; }
.jn .tip { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translate(-50%, 4px); padding: 5px 9px; border-radius: 8px; background: var(--ink); color: #FFFFFF; font-size: 12.5px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s var(--ease); }
.jn:hover .tip { opacity: 1; transform: translate(-50%, 0); }
.jline { flex: 1; height: 2px; margin: 0 6px; border-radius: 1px; background: rgba(34, 48, 58, .12); transition: background .5s; }
.jline.done { background: var(--accent); }
.plan-wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.plan { width: 100%; list-style: none; margin: 0; padding: 8px 22px; border-radius: 22px; animation: rise .45s var(--ease) both; }
.plan li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.plan li:last-child { border-bottom: 0; }
.plan .pi { width: 20px; height: 20px; margin-top: 2px; display: grid; place-items: center; border-radius: 50%; border: 2px solid rgba(34, 48, 58, .18); }
.plan li.done .pi { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.plan li.done .pi svg { width: 10px; height: 10px; }
.plan li.now .pi { border-color: var(--ink); }
.plan li.now .pi::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.plan b { display: block; font-weight: 600; }
.plan li.next b { color: var(--muted); font-weight: 500; }
.plan .muted { font-size: 14.5px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.ml .mt { background: var(--studio); }
.ml .mn { height: 10px; border-radius: 5px; background: rgba(34, 48, 58, .08); }
.next-status:empty { display: none; }
.jn.done i { font-size: 10px; }
.jmore { flex: none; padding: 0 8px; font-size: 13px; color: var(--muted); }
.plan-panel { width: 100%; display: flex; flex-direction: column; gap: 14px; }
.step-open { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.step-open:hover b { text-decoration: underline; text-underline-offset: 3px; }
.plan li.loading { background: var(--accent-soft); border-radius: 12px; }
.plan li.loading .muted { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.plan.opening .step-open { cursor: progress; }
.edit { padding: 16px 22px; border-radius: 22px; }
.edit summary { font-weight: 600; cursor: pointer; }
.edit > p { margin: 10px 0; }
.plan-file { margin-top: 12px; }
.plan-file summary { cursor: pointer; }
.plan-file ul { list-style: none; margin: 8px 0 0; padding: 0; }
.plan-file li { display: flex; align-items: flex-start; gap: 12px; padding: 6px 0; }
.plan-file li > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.switch { flex: none; min-width: 112px; height: 34px; font-size: 14px; }
.switch:disabled { cursor: default; opacity: .7; transform: none; }
.notice { padding: 18px; border-radius: 20px; font-size: 15px; }
.notice p { margin: 0 0 8px; }
.notice ul { margin: 0 0 8px; }
.libs { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.foot-links .confirm { display: inline-flex; margin-top: 8px; }
@media (max-width: 760px) {
  .next { grid-template-columns: minmax(0, 1fr); }
  .next-visual { min-height: 230px; }
  .next-body { padding: 26px 22px 24px; }
  .next-title { font-size: 28px; }
}

/* ---------- Workspace ---------- */
.card { border-radius: 24px; }
.work { max-width: 1240px; margin: 0 auto; padding-block: 10px 48px; display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); grid-template-areas: "task editor" "buddy editor"; grid-template-rows: auto 1fr; gap: 20px; }
.task { grid-area: task; display: flex; flex-direction: column; gap: 6px; padding: 24px; }
.w-step { font-size: 13.5px; font-weight: 600; color: var(--accent-ink); }
.task h1 { margin: 2px 0 0; font: 500 26px/1.2 var(--mono); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.w-sig { margin: 0; font: 400 13.5px/1.5 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.w-desc { margin: 10px 0 6px; }
.w-h { margin: 6px 0 2px; font: 600 15px var(--text); }
.checks { list-style: none; margin: 0 0 12px; padding: 0; }
.checks li { display: flex; align-items: flex-start; gap: 10px; padding: 5px 0; font-size: 15px; transition: color .3s; }
.ck { position: relative; flex: none; width: 18px; height: 18px; margin-top: 3px; border-radius: 50%; border: 2px solid rgba(34, 48, 58, .18); }
[data-state="run"] > .ck { border-top-color: var(--ink); animation: spin .7s linear infinite; }
[data-state="pass"] > .ck { border-color: var(--good); background: var(--good); animation: popScale .4s var(--spring); }
[data-state="pass"] > .ck::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid #FFFFFF; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.checks li[data-state="pass"] { color: var(--good-ink); }
[data-state="fail"] > .ck { border-color: var(--bad); background: var(--bad); animation: popScale .4s var(--spring); }
[data-state="fail"] > .ck::before, [data-state="fail"] > .ck::after { content: ""; position: absolute; left: 6px; top: 2px; width: 2px; height: 10px; border-radius: 1px; background: #FFFFFF; transform: rotate(45deg); }
[data-state="fail"] > .ck::after { transform: rotate(-45deg); }
.checks li[data-state="fail"] { color: var(--bad-ink); }
.task details { padding-top: 12px; border-top: 1px solid var(--line); }
.task summary { font-size: 15px; font-weight: 600; cursor: pointer; }
.task details ul { margin: 8px 0 0; padding-left: 18px; font-size: 14.5px; color: var(--muted); }
.editor { grid-area: editor; min-height: 560px; display: flex; flex-direction: column; overflow: hidden; transition: box-shadow .45s var(--ease); }
.editor.ok { box-shadow: 0 0 0 3px rgba(61, 127, 119, .5), var(--shadow); }
.editor.bad { animation: shake .45s; box-shadow: 0 0 0 3px rgba(220, 38, 38, .25), var(--shadow); }
.ed-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 14px; }
.ed-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); }
.saved { margin-left: auto; font-size: 13px; color: var(--muted); }
.buddy { grid-area: buddy; align-self: start; display: flex; align-items: flex-start; gap: 12px; padding: 18px; }
.buddy-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.buddy .say { min-height: 48px; }
.ask { display: flex; gap: 8px; }
.ask input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: #FAFBFA; }
.ask { flex-wrap: wrap; }
.ask input::placeholder { color: var(--muted); }
.ed-body { flex: 1; display: flex; min-height: 0; background: #FAFBFA; }
.ed-body .CodeMirror, .ed-body textarea { flex: 1; height: auto; min-height: 400px; width: 100%; border: 0; }
.ed-tools { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.editor-font { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.editor-font select, .map-bar select { height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: 400 13.5px var(--text); }
.ed-foot .btn.primary .ph-check { font-size: 17px; }
@media (min-width: 921px) {
  .editor { position: sticky; top: 16px; align-self: start; height: calc(100dvh - 104px); min-height: 460px; }
  .ed-body .CodeMirror { min-height: 0; }
}
.work.editor-full { grid-template-columns: minmax(0, 1fr); grid-template-areas: "editor" "buddy"; }
.work.editor-full .task { display: none; }
/* Expanded: the editor takes the whole window, wide and tall. Esc or the same button brings the page back. */
.work.editor-full .editor { position: fixed; inset: 12px; z-index: 40; width: auto; height: calc(100dvh - 24px); min-height: 0; max-width: none; align-self: stretch; }
.work.editor-full .ed-body .CodeMirror { min-height: 0; }
.work.editor-full { animation: none; transform: none; filter: none; }  /* its entrance motion leaves a transform, which would trap the fixed editor */
.run-line { max-width: 1240px; margin: 0 auto; }
.run-line:empty { display: none; }
.buddy .say { font-size: 15.5px; }
.buddy .say code, .results code { font: 400 13.5px var(--mono); background: var(--bg); padding: 1px 5px; border-radius: 6px; }
.buddy .say pre, .clean-code { margin: 8px 0; padding: 10px 12px; border-radius: 10px; background: var(--bg); font: 400 13px/1.5 var(--mono); white-space: pre-wrap; overflow-x: auto; }
.clean-points { margin: 6px 0; padding-left: 18px; }
.fade-in { animation: rise .45s var(--ease) both; }
@media (max-width: 920px) {
  .work { grid-template-columns: minmax(0, 1fr); grid-template-areas: "task" "editor" "buddy"; grid-template-rows: auto; }
  .editor { min-height: 460px; }
}

/* ---------- Editor: CodeMirror in the calm colors ---------- */
:root { --code-font: var(--mono); --code-axes: normal; --code-size: 14px; }
:root[data-code-font="hand"] { --code-font: "Shantell Sans", "Comic Sans MS", cursive; --code-axes: "INFM" 100, "BNCE" 25; --code-size: 15px; }
:root[data-code-font="legible"] { --code-font: "Atkinson Hyperlegible Mono", ui-monospace, monospace; }
.CodeMirror { background: #FAFBFA; color: var(--ink); font: 400 var(--code-size)/24px var(--code-font); font-variation-settings: var(--code-axes); }
.CodeMirror-gutters { background: #FAFBFA; border-right: 1px solid var(--line); }
.CodeMirror-linenumber { color: rgba(91, 103, 112, .7); font: 400 13px/24px var(--mono); }
.CodeMirror-lines { padding: 14px 0; }
.CodeMirror-cursor { border-left: 2px solid var(--accent); }
.CodeMirror-selected, .CodeMirror-focused .CodeMirror-selected { background: var(--accent-soft) !important; }
.cm-s-default .cm-keyword { color: var(--kw); }
.cm-s-default .cm-def { color: var(--fn); }
.cm-s-default .cm-string { color: var(--str); }
.cm-s-default .cm-number, .cm-s-default .cm-builtin, .cm-s-default .cm-meta { color: var(--ty); }
.cm-s-default .cm-comment { color: var(--muted); font-style: italic; }
.cm-s-default .cm-variable, .cm-s-default .cm-property, .cm-s-default .cm-operator, .cm-s-default .cm-variable-2 { color: var(--ink); }
.CodeMirror-matchingbracket { color: var(--good-ink) !important; }

/* ---------- Results of a check ---------- */
.results { position: relative; flex-shrink: 0; max-height: 40%; overflow-y: auto; padding: 14px 18px; border-top: 1px solid var(--line); font-size: 15px; }
.results-close { position: absolute; top: 8px; right: 10px; width: 32px; height: 32px; font-size: 20px; line-height: 1; }
.ed-body { min-height: 200px; }
.results .summary { margin: 0 0 6px; padding-right: 36px; font-weight: 600; }
.results .tests { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.results pre { margin: 4px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--bg); font: 400 12.5px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.done-note { margin: 8px 0 0; }

/* ---------- Task details: files, the map, code to read ---------- */
.task details pre { margin: 6px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--bg); font: 400 12.5px/1.5 var(--mono); overflow-x: auto; }
.task details details { padding-top: 6px; border-top: 0; }
.task details details summary { font-weight: 500; font-size: 14px; }
.task details p { margin: 8px 0 0; font-size: 14.5px; }
#w-refs > details:first-child { margin-top: 8px; }
.file-tree, .file-tree ul { list-style: none; margin: 8px 0 0; padding-left: 14px; font: 400 14px var(--mono); }
.file-tree { padding-left: 0; }
.file-tree li { padding: 2px 0; color: var(--ink); }
.file-tree summary { display: flex; align-items: center; gap: 6px; font: 500 14px var(--mono); }
.file-tree li.you { color: var(--accent-ink); font-weight: 500; }
.map-bar { margin-top: 10px; }
.diagram { max-height: 360px; margin-top: 8px; overflow: auto; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); cursor: zoom-in; }
dialog.sheet.map-dialog { width: calc(100% - 32px); max-width: 1600px; height: calc(100dvh - 32px); padding: 20px 24px; display: flex; flex-direction: column; }
dialog.sheet.map-dialog:not([open]) { display: none; }
.map-dialog .diagram { flex: 1; max-height: none; min-height: 0; margin: 0; border: 0; cursor: zoom-in; }
.map-dialog .diagram svg { display: block; margin: 0 auto; max-width: 100%; max-height: 100%; height: auto; }
.map-dialog .diagram.actual { cursor: zoom-out; }
.map-dialog .diagram.actual svg { max-width: none; max-height: none; }
.map-dialog .map-hint { margin: 0 48px 8px 0; font-size: 13px; }
.map-dialog .close { position: sticky; top: 0; float: right; }

/* ---------- Tour, win sheet, flyer ---------- */
.spot { position: relative; z-index: 50; box-shadow: 0 0 0 4px rgba(61, 127, 119, .9), 0 0 0 200vmax rgba(34, 48, 58, .42) !important; transition: box-shadow .35s var(--ease); }
.shield { position: fixed; inset: 0; z-index: 49; }
.coach-card { position: fixed; left: 0; top: 0; z-index: 60; width: min(330px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-xl); transition: transform .45s var(--ease); }
.coach-card .head { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.coach-card .row { justify-content: space-between; }
.coach-card .say { min-height: 72px; }
.win-top { display: flex; align-items: center; gap: 14px; }
.win-top h2 { margin: 0; font: 600 24px/1.2 var(--display); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.win-top p { margin: 2px 0 0; }
.qa { display: flex; flex-direction: column; gap: 10px; }
.qa label, .qa p { display: flex; flex-direction: column; gap: 2px; margin: 0; }
.qa textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #FAFBFA; resize: vertical; }
.qa textarea::placeholder { color: var(--muted); }
.flyer { position: fixed; left: 0; top: 0; z-index: 70; display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px 12px 12px; border-radius: 16px; background: #FFFFFF; box-shadow: var(--shadow-xl); font-size: 15px; pointer-events: none; }
.flyer .fc { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: #FFFFFF; }
.win { display: flex; flex-direction: column; gap: 18px; }
.win:not([open]) { display: none; }
.win-note { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); font-size: 15px; }
.win-reply:empty { display: none; }
.win-reply { font-size: 15px; }
#answer-it { align-self: flex-start; }

/* Short laptop windows: the first screens still fit without scrolling. */
@media (max-height: 820px) {
  .story { padding-block-end: 16px; gap: 12px; }
  .choose { padding-block: 4px 20px; gap: 14px; }
  .choose .chip.lg { --s: 72px; }
  .idea { padding: 16px 18px; gap: 8px; }
  .idea textarea { min-height: 56px; }
  .known { gap: 6px; }
  .example { padding-block: 10px; }
  .own-project { padding-block: 12px; }
  .quiz { padding-block: 4px 16px; gap: 10px; }
  .quiz .chip.lg { --s: 72px; }
  .q-text { font-size: clamp(24px, 3.4vw, 34px); }
  .q-yn { margin-top: 4px; }
  .q-yn .btn.xl { height: 56px; }
}

/* ---------- Dialogs: Settings, the map, the win sheet ---------- */
dialog.sheet { width: min(600px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 28px; border: 0; border-radius: 28px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xl); }
dialog.sheet::backdrop { background: rgba(243, 244, 242, .72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
dialog.sheet[open] { animation: sheetIn .55s var(--spring) both; }
@keyframes sheetIn { from { opacity: 0; transform: translateY(34px) scale(.98); } }
.settings-dialog h2 { margin: 0 0 6px; font: 600 24px var(--display); }
.settings-dialog form { display: flex; flex-direction: column; gap: 12px; }
.settings-dialog p { margin: 0; }
.settings-dialog label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; }
.settings-dialog input, .settings-dialog select { height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: #FAFBFA; font: 400 15px var(--text); color: var(--ink); }

/* ---------- Motion ---------- */
@keyframes wordIn { from { opacity: 0; transform: translateY(.35em); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes cursor { 0%, 55% { opacity: 1; } 56%, 100% { opacity: .15; } }
@keyframes mouth { from { transform: scale(1, 1); } to { transform: scale(.8, 2.6); } }
@keyframes led { from { fill: #E2BE6A; } to { fill: #F4E3B5; } }
@keyframes pinL { to { transform: translateX(-2px); } }
@keyframes pinR { to { transform: translateX(2px); } }
@keyframes tap { to { transform: translateY(-2px); } }
@keyframes hop { 0%, 100% { transform: none; } 18% { transform: translateY(-10px) rotate(-6deg); } 36% { transform: translateY(0) rotate(4deg); } 52% { transform: translateY(-5px) rotate(-2deg); } 68% { transform: none; } }
@keyframes jump { 0% { transform: none; } 30% { transform: translateY(-14px) scale(1.06, .96); } 60% { transform: translateY(0) scale(.96, 1.04); } 100% { transform: none; } }
@keyframes breathe { 0%, 100% { transform: scale(.92); opacity: .8; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes caret { 0%, 50% { opacity: 1; } 51%, 100% { opacity: 0; } }
@keyframes popScale { 0% { scale: .6; } 60% { scale: 1.12; } 100% { scale: 1; } }
@keyframes bump { 0% { scale: 1; } 35% { scale: 1.12; box-shadow: 0 0 0 6px rgba(61, 127, 119, .22); } 100% { scale: 1; } }
@keyframes nudge { 0%, 100% { box-shadow: 0 6px 18px rgba(61, 127, 119, .35), 0 0 0 0 rgba(61, 127, 119, .45); } 55% { box-shadow: 0 6px 18px rgba(61, 127, 119, .35), 0 0 0 12px rgba(61, 127, 119, 0); } }
@keyframes arrow { 0%, 100% { transform: none; } 50% { transform: translateX(4px); } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes shake { 0%, 100% { translate: 0; } 20% { translate: -6px; } 40% { translate: 5px; } 60% { translate: -3px; } 80% { translate: 2px; } }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(34, 48, 58, .3); } 100% { box-shadow: 0 0 0 11px rgba(34, 48, 58, 0); } }
@keyframes hover { 0%, 100% { translate: 0 0; } 50% { translate: -7px 5px; } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; transition-duration: .01ms !important; transition-delay: 0ms !important; }
}

.tools { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tools code { font-weight: 600; }
.plan .steps-more { display: flex; flex-direction: column; gap: 2px; padding-top: 14px; }
