/* Zeynep's app. Uses only tokens.css values. One strong (rose) element per view. */

.noscript { padding: var(--sp-5); text-align: center; }
.boot { min-height: 60vh; display: grid; place-items: center; }
.boot img { animation: proud 1.2s var(--ease) infinite; }
[hidden] { display: none !important; }
a { color: var(--accent-ink); }
img { max-width: 100%; }

/* Icons: Lucide SVGs used as masks, so they take the text colour. */
.ic {
  display: inline-block; width: 22px; height: 22px; flex: none; background: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat;
}
.ic-squirrel { --i: url('/icons/squirrel.svg'); } .ic-cat { --i: url('/icons/cat.svg'); }
.ic-timer { --i: url('/icons/timer.svg'); } .ic-nut { --i: url('/icons/nut.svg'); }
.ic-volume-2 { --i: url('/icons/volume-2.svg'); } .ic-volume-x { --i: url('/icons/volume-x.svg'); } .ic-volume-1 { --i: url('/icons/volume-1.svg'); }
.ic-check { --i: url('/icons/check.svg'); } .ic-x { --i: url('/icons/x.svg'); }
.ic-arrow-left { --i: url('/icons/arrow-left.svg'); } .ic-chevron-right { --i: url('/icons/chevron-right.svg'); }
.ic-calculator { --i: url('/icons/calculator.svg'); } .ic-grid-3x3 { --i: url('/icons/grid-3x3.svg'); }
.ic-book-open { --i: url('/icons/book-open.svg'); } .ic-pencil { --i: url('/icons/pencil.svg'); }
.ic-flask-conical { --i: url('/icons/flask-conical.svg'); } .ic-languages { --i: url('/icons/languages.svg'); }
.ic-landmark { --i: url('/icons/landmark.svg'); } .ic-moon-star { --i: url('/icons/moon-star.svg'); }
.ic-refresh-cw { --i: url('/icons/refresh-cw.svg'); } .ic-palette { --i: url('/icons/palette.svg'); }
.ic-lock { --i: url('/icons/lock.svg'); }
.ic-message-circle { --i: url('/icons/message-circle.svg'); } .ic-send { --i: url('/icons/send.svg'); }
.ic-heart { --i: url('/icons/heart.svg'); } .ic-shirt { --i: url('/icons/shirt.svg'); } .ic-brain { --i: url('/icons/brain.svg'); }
.ic-lightbulb { --i: url('/icons/lightbulb.svg'); } .ic-eraser { --i: url('/icons/eraser.svg'); }
.ic-camera { --i: url('/icons/camera.svg'); } .ic-house { --i: url('/icons/house.svg'); }
.ic-flag { --i: url('/icons/flag.svg'); } .ic-map { --i: url('/icons/map.svg'); }
.ic-flame { --i: url('/icons/flame.svg'); } .ic-star { --i: url('/icons/star.svg'); }
.ic-pause { --i: url('/icons/pause.svg'); } .ic-triangle-alert { --i: url('/icons/triangle-alert.svg'); }
.ic-undo-2 { --i: url('/icons/undo-2.svg'); } .ic-target { --i: url('/icons/target.svg'); }
.ic-hourglass { --i: url('/icons/hourglass.svg'); } .ic-clipboard-check { --i: url('/icons/clipboard-check.svg'); }
.ic-book-open-check { --i: url('/icons/book-open-check.svg'); } .ic-tree-deciduous { --i: url('/icons/tree-deciduous.svg'); } .ic-trophy { --i: url('/icons/trophy.svg'); }

/* ---------- Top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3); padding: var(--sp-2) var(--sp-4); padding-top: max(var(--sp-2), env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
/* Slow network: a thin rose line slides under the top bar while the next screen loads (app.js route). */
.top::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; opacity: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--accent), transparent) no-repeat; background-size: 30% 100%;
}
body.busy .top::after { opacity: 1; animation: busy 1.1s ease-in-out infinite; }
@keyframes busy { from { background-position: -50% 0; } to { background-position: 150% 0; } }
.brand { display: flex; align-items: center; gap: var(--sp-2); text-decoration: none; color: var(--ink); min-height: 44px; }
.brand .ic { width: 28px; height: 28px; color: var(--accent); }
.brand-name { font-weight: 800; font-size: var(--fs-lg); }
.top-right { display: flex; align-items: center; gap: var(--sp-2); }
.nuts { display: inline-flex; align-items: center; gap: 4px; color: var(--nut); font-weight: 800; padding: 0 var(--sp-2); }
.nuts .ic { width: 20px; height: 20px; }
.nuts b { color: var(--ink); }
.nuts.pop-anim { animation: nutpop 600ms var(--ease); }
@keyframes nutpop { 30% { transform: scale(1.25); } }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: var(--r-pill);
  background: transparent; color: var(--ink-2); cursor: pointer; transition: background var(--t-fast) var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.clock {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 var(--sp-4);
  border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); cursor: pointer;
  box-shadow: var(--shadow); transition: border-color var(--t-fast) var(--ease);
}
.clock:hover { border-color: var(--accent-soft); }
.clock .ic { width: 20px; height: 20px; color: var(--accent-ink); }
.clock-time { font-weight: 800; font-size: var(--fs-md); min-width: 3.2ch; text-align: right; }
.clock.paused .ic { color: var(--ink-3); }
.clock.paused .clock-time { color: var(--ink-3); }
.clock.done .ic { color: var(--mint); }
@media (max-width: 420px) { .brand-name { font-size: var(--fs-md); } }

.pop {
  position: fixed; z-index: 30; right: var(--sp-4); top: 64px; width: min(320px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow);
  padding: var(--sp-4); animation: rise var(--t-med) var(--ease);
}
.pop h3 { font-size: var(--fs-md); margin-bottom: var(--sp-3); }
.sound-pop { width: min(300px, calc(100vw - 32px)); }
.sound-pop p { margin: var(--sp-2) 0 0; }
.snd-row { display: grid; grid-template-columns: 44px 1fr 5ch; gap: var(--sp-2); align-items: center; }
.snd-mute { background: var(--surface-2); color: var(--accent-ink); }
.snd-mute[aria-pressed="true"] { color: var(--ink-3); }
.snd-val { text-align: right; font-size: var(--fs-sm); }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: none; cursor: pointer; --fill: 70%; }
.range::-webkit-slider-runnable-track { height: 8px; border-radius: var(--r-pill); background: linear-gradient(to right, var(--accent) var(--fill), var(--surface-2) var(--fill)); }
.range::-moz-range-track { height: 8px; border-radius: var(--r-pill); background: var(--surface-2); }
.range::-moz-range-progress { height: 8px; border-radius: var(--r-pill); background: var(--accent); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -7px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); box-shadow: var(--shadow); }
.range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); }
.subj-row { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-2); align-items: center; font-size: var(--fs-sm); padding: 4px 0; }
.subj-row b { font-variant-numeric: tabular-nums; }
.subj-bar { grid-column: 1 / -1; height: 6px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.subj-bar i { display: block; height: 100%; background: var(--sky); border-radius: inherit; }
.pop-tasks { margin-top: var(--sp-4); padding-top: var(--sp-3); border-top: 1px solid var(--line); }
.stepper { display: inline-flex; align-items: center; gap: var(--sp-2); }
.stepper b { min-width: 4.5ch; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- Layout ---------- */
/* overflow-wrap: anywhere — one very long word (a pasted link, a stretched "çokkkk") breaks inside its
   card instead of widening the card and scrolling the whole page sideways on a phone. */
.view { max-width: 1080px; margin: 0 auto; padding: var(--sp-4) var(--sp-4) var(--sp-7); outline: none; overflow-wrap: anywhere; }
.narrow { max-width: 640px; margin: 0 auto; }
.screen-in { animation: rise var(--t-med) var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* --pad is the card's inner edge; parts that run to the card's edge (map picture, sticky bar) use it. */
.card { --pad: var(--sp-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--pad); box-shadow: var(--shadow); }
@media (max-width: 420px) { .card { --pad: var(--sp-4); } }
.card + .card, .stack > * + * { margin-top: var(--sp-4); }
/* In a grid the gap spaces the cards; a margin on top would push one card lower than its neighbour. */
.q-layout > .card + .card { margin-top: 0; }
.card h2 { font-size: var(--fs-lg); font-weight: 800; }
.muted { color: var(--ink-2); }
.small { font-size: var(--fs-sm); }
.row { display: flex; align-items: center; gap: var(--sp-3); }
.spread { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); min-height: 48px;
  padding: 0 var(--sp-5); border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font-weight: 700; font-size: var(--fs-md); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.btn:hover { border-color: var(--accent-soft); background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn-big { min-height: 56px; font-size: var(--fs-lg); padding: 0 var(--sp-6); }
.btn-block { width: 100%; }
.btn-text { border: 0; background: none; color: var(--accent-ink); padding: 0 var(--sp-3); }
.btn-text:hover { background: var(--accent-soft); }
.btn .ic { width: 20px; height: 20px; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.view:focus, .view:focus-visible { outline: none; }

/* ---------- Mascot ---------- */
.mascot { position: relative; display: grid; place-items: center; flex: none; }
.mascot-img { width: 120px; height: 120px; object-fit: contain; }
.mascot.proud .mascot-img { animation: proud 900ms var(--ease) 1; }
@keyframes proud { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .mascot.proud .mascot-img { animation: none; } }
.mascot-fallback {
  display: grid; place-items: center; width: 104px; height: 104px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-ink);
}
.mascot-fallback .ic { width: 56px; height: 56px; }
.bubble {
  position: relative; background: var(--surface-2); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4);
  font-weight: 600; font-size: var(--fs-md); max-width: 46ch; text-wrap: pretty;
}

/* ---------- Home ----------
   Laptop (1366×768) shows everything without scrolling: hero on the left, shortcuts, deneme and
   the journey on the right. Phone: one column. */
.home { display: grid; gap: var(--sp-4); }
@media (min-width: 960px) {
  .home { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: stretch; }
  .hero { align-content: space-around; }
}
.side > * + * { margin-top: var(--sp-3); }
.hero { display: grid; gap: var(--sp-5); }
.hero-top { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-4); align-items: center; }
.hero .mascot-img { width: 150px; height: 150px; }
.hero h1 { font-size: var(--fs-xl); font-weight: 800; margin-bottom: var(--sp-3); }
.hero .bubble { margin: 0; }
/* Laptop: a little tighter, so the opened month goals still fit 1366×768. */
@media (min-width: 960px) { .hero { gap: var(--sp-4); } .hero .mascot-img { width: 128px; height: 128px; } }
.hero-act { display: grid; gap: var(--sp-3); justify-items: start; }
.hero-act .btn-big { min-width: 280px; }
@media (max-width: 560px) {
  .hero-top { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .hero .mascot-img { width: 128px; height: 128px; }
  .hero-act { justify-items: stretch; }
  .hero-act .btn-big { min-width: 0; width: 100%; }
}
.wardrobe-head .mascot-img { width: 168px; height: 168px; }

/* Today's path: one round step per mission. */
.today-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.today-head h2 { font-size: var(--fs-md); font-weight: 800; }
.today-count { font-weight: 800; color: var(--ink-2); }
/* --cols / --cols-s (set by app.js) split the steps into even rows, so a step never ends up alone
   on a row and 11 steps never squeeze into one row narrower than the steps. */
.path { --cols: 10; --cols-s: 5; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 6px; row-gap: var(--sp-3); position: relative; }
.path.one-row::before { content: ''; position: absolute; left: 22px; right: 22px; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; background: var(--line); }
.path li { position: relative; display: grid; place-items: center; }
.step {
  position: relative; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--line); color: var(--ink-3); text-decoration: none;
  transition: transform var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.step:hover { transform: scale(1.08); border-color: var(--accent-soft); }
.step .ic { width: 20px; height: 20px; }
.step.part { border-color: var(--accent-soft); color: var(--accent-ink);
  background: conic-gradient(var(--accent-soft) var(--p), var(--surface) 0); }
.step.now { width: 52px; height: 52px; border: 3px solid var(--accent); color: var(--accent-ink); background: var(--accent-soft); box-shadow: var(--shadow); }
.step.now .ic { width: 24px; height: 24px; }
.step.done { background: var(--mint); border-color: var(--mint); color: var(--surface); }
/* A step of a later stop: quiet, with a small lock; tapping says what comes first. */
.step.locked { border-style: dashed; color: var(--ink-3); background: var(--surface-2); cursor: default; font: inherit; padding: 0; }
.step.locked:hover { transform: none; border-color: var(--line); }
.step.locked > .ic { opacity: 0.55; }
.step-lock { position: absolute; right: -5px; bottom: -5px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); color: var(--ink-2); box-shadow: 0 0 0 1px var(--line); }
.step-lock .ic { width: 12px; height: 12px; }
.path-next { margin: var(--sp-3) 0 0; color: var(--ink-2); font-size: var(--fs-sm); }
.path-next b { color: var(--ink); }
@media (max-width: 560px) {
  .path { grid-template-columns: repeat(var(--cols-s), minmax(0, 1fr)); }
  .path::before { display: none; }
}

/* This month's goal: a quiet line under today's path; a tap opens the six subjects as chips. */
.plan-line { display: grid; gap: var(--sp-2); }
.plan-goal {
  display: grid; grid-template-columns: auto 1fr auto; gap: var(--sp-3); align-items: center; width: 100%; min-height: 48px;
  padding: var(--sp-2) var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg);
  color: var(--ink); text-align: left; cursor: pointer; transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.plan-goal:hover { border-color: var(--sky-soft); background: var(--surface); }
.plan-goal > .ic-target { color: var(--sky); }
.plan-text { display: grid; min-width: 0; text-wrap: pretty; }
.plan-text b { font-weight: 700; }
.plan-text span { font-size: var(--fs-sm); color: var(--ink-2); }
.plan-more { color: var(--ink-3); width: 18px; height: 18px; transition: transform var(--t-fast) var(--ease); }
.plan-goal[aria-expanded="true"] .plan-more { transform: rotate(90deg); }
.plan-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-2); animation: rise var(--t-med) var(--ease); }
.plan-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: var(--r-pill); background: var(--sky-soft); color: var(--ink); font-size: var(--fs-sm); }
.plan-chip b { color: var(--sky); }
.plan-chip.reached { background: var(--mint-soft); }
.plan-chip.reached .ic { width: 16px; height: 16px; color: var(--mint); }
.plan-chip.focus { box-shadow: inset 0 0 0 1.5px var(--sky); }
.focus-tag { display: inline-block; padding: 0 8px; border-radius: var(--r-pill); background: var(--sky-soft); color: var(--sky); font-size: var(--fs-xs); font-weight: 700; line-height: 1.6; vertical-align: 1px; }
.step-tag { position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%); pointer-events: none; box-shadow: 0 0 0 2px var(--surface); }

.reward-line {
  display: flex; align-items: center; gap: var(--sp-3); width: 100%; max-width: 420px; padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md); background: var(--mint-soft); color: var(--ink); text-decoration: none;
  transition: transform var(--t-fast) var(--ease);
}
.reward-line:hover { transform: translateY(-1px); }
.reward-line > .ic { width: 26px; height: 26px; color: var(--mint); }
.rl-text { display: grid; flex: 1; min-width: 0; }
.rl-name { font-weight: 800; }
.rl-sub { font-size: var(--fs-sm); color: var(--ink-2); text-wrap: pretty; }
.reward-line .bar { margin: 6px 0 0; height: 6px; background: color-mix(in srgb, var(--surface) 70%, var(--mint-soft)); }

.note-card { display: flex; gap: var(--sp-3); align-items: flex-start; background: var(--sky-soft); border-color: transparent; }
.note-card .ic { color: var(--sky); margin-top: 2px; }
.note-card p { margin: 2px 0 var(--sp-2); font-weight: 600; }

.missions { list-style: none; margin: var(--sp-3) 0 0; padding: 0; }
.mission {
  display: grid; grid-template-columns: 44px 1fr auto; gap: var(--sp-3); align-items: center; width: 100%;
  padding: var(--sp-3); border: 0; border-radius: var(--r-md); background: none; text-align: left; cursor: pointer;
  color: var(--ink); font: inherit; text-decoration: none; transition: background var(--t-fast) var(--ease);
}
.mission:hover { background: var(--surface-2); }
.mission-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-ink); }
.mission-title { font-weight: 700; }
.mission-sub { font-size: var(--fs-sm); color: var(--ink-2); text-wrap: pretty; }
.mission .go { color: var(--ink-3); }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3); }
@media (max-width: 420px) { .quick { grid-template-columns: repeat(2, 1fr); } }
.quick a {
  position: relative; display: grid; justify-items: center; gap: 6px; padding: var(--sp-3) var(--sp-2); border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 700;
  font-size: var(--fs-sm); text-align: center; transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.quick a:hover { border-color: var(--accent-soft); transform: translateY(-1px); }
.quick .ic { width: 26px; height: 26px; color: var(--accent-ink); }
.dot-badge {
  position: absolute; top: 8px; right: 8px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 3px var(--surface); transform: scale(0); transition: transform var(--t-med) var(--ease);
}
.has-unread .dot-badge { transform: scale(1); }

.journey { padding-top: 0; overflow: hidden; }
.journey h2 { font-size: var(--fs-md); font-weight: 800; }
.journey svg { width: 100%; height: auto; display: block; margin-top: var(--sp-1); }
.journey-map {
  display: block; width: calc(100% + 2 * var(--pad)); max-width: none; height: 104px; object-fit: cover; object-position: center 30%;
  margin: 0 calc(-1 * var(--pad)) var(--sp-3);
}
.j-path { fill: none; stroke: var(--line); stroke-width: 8; stroke-linecap: round; }
.j-dot { fill: var(--surface); stroke: var(--ink-3); stroke-width: 2; }
.j-dot.done { fill: var(--mint); stroke: var(--mint); }
.j-dot.half { fill: var(--mint-soft); stroke: var(--mint); }
.j-dot.now { fill: var(--accent); stroke: var(--accent); }
.j-flag { fill: var(--sky); }
.j-stop { margin: var(--sp-1) 0 0; }
.counts { display: flex; gap: var(--sp-4); flex-wrap: wrap; margin-top: var(--sp-2); font-size: var(--fs-sm); color: var(--ink-2); }
.counts b { color: var(--ink); }

.tree-row { display: grid; grid-template-columns: 64px 1fr; gap: var(--sp-3); align-items: center; margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--line); }
.tree-row img, .tree-row .tree-fallback { width: 64px; height: 64px; object-fit: contain; }
.tree-row p { margin: 0; }
.tree-title { font-size: var(--fs-sm); }
.tree-row .bar { margin: 4px 0; height: 8px; }
.tree-fallback { display: grid; place-items: center; border-radius: var(--r-md); background: var(--mint-soft); color: var(--mint); }
.tree-fallback .ic { width: 32px; height: 32px; }
.bar { height: 10px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; margin: var(--sp-2) 0; }
.bar i { display: block; height: 100%; background: var(--mint); border-radius: inherit; transition: width var(--t-med) var(--ease); }

/* ---------- Question screen ---------- */
.q-head { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.q-head h1 { font-size: var(--fs-md); font-weight: 800; flex: 1; min-width: 0; }
/* Round progress: one slim bar made of segments (green right, pink wrong) and "5 / 20". */
.progress { display: flex; align-items: center; gap: var(--sp-3); width: min(360px, 45%); }
.segs { flex: 1; display: flex; gap: 3px; height: 10px; }
.segs i { flex: 1; border-radius: 3px; background: var(--surface-2); transition: background var(--t-med) var(--ease); }
.segs i.ok { background: var(--mint); }
.segs i.no { background: var(--accent); opacity: .55; }
.segs i.now { background: var(--accent-soft); }
.progress-n { font-weight: 800; font-size: var(--fs-sm); color: var(--ink-2); white-space: nowrap; }
@media (max-width: 640px) {
  .q-head { flex-wrap: wrap; row-gap: var(--sp-2); }
  .progress { order: 3; width: 100%; }
}
.key.blank { visibility: hidden; }

/* One card, no scratchpad (Enes, 2026-10-22: she works in her notebook, as in the exam). */
.q-layout { display: grid; gap: var(--sp-4); max-width: 880px; margin: 0 auto; }
.q-card { transition: opacity var(--t-fast) var(--ease); }
.q-card.loading { opacity: .55; }

/* Multiplication fact: the equation holds the answer box; the keypad sits beside it on a laptop. */
.fact-screen { max-width: 1000px; margin: 0 auto; }
.q-layout.fact-layout { grid-template-columns: minmax(0, 1fr); max-width: none; }
.fact { display: grid; gap: var(--sp-5); align-items: center; }
@media (min-width: 760px) { .fact { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); min-height: 360px; } }
@media (min-width: 1000px) { .fact { grid-template-columns: 170px minmax(0, 1.15fr) minmax(0, 1fr); } }
.fact-buddy { display: none; }
@media (min-width: 1000px) {
  .fact-buddy { display: grid; justify-items: center; gap: var(--sp-2); align-self: center; text-align: center;
    padding-right: var(--sp-4); border-right: 1px solid var(--line); }
}
.fact-pose { width: 150px; height: 150px; object-fit: contain; animation: rise var(--t-med) var(--ease); }
.fact-stat { margin: 0; font-size: var(--fs-sm); color: var(--ink-2); font-weight: 700; }
.fact-stat b { color: var(--accent-ink); font-size: var(--fs-lg); }
.fact-nuts { display: inline-flex; align-items: center; gap: 4px; margin: 0; color: var(--nut); font-weight: 800; }
.fact-nuts .ic { width: 18px; height: 18px; }
.fact-left { display: grid; gap: var(--sp-4); justify-items: center; text-align: center; }
.fact-left .q-label { margin: 0; }
.fact-eq { display: flex; align-items: center; justify-content: center; flex-wrap: nowrap; white-space: nowrap; gap: var(--sp-3); margin: 0;
  font-size: clamp(2.25rem, 5vw, 3.25rem); font-weight: 800; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.fact-eq .slot { min-width: 2.6em; min-height: 1.5em; font-size: 1em; border-width: 3px; border-radius: var(--r-md); }
.slot.ok { border-color: var(--mint); background: var(--mint-soft); color: var(--mint); animation: pop 360ms var(--ease); }
.slot.fixed { border-color: var(--mint); background: var(--mint-soft); color: var(--mint); animation: pop 360ms var(--ease); cursor: default; }
.fact-no s { color: var(--ink-3); text-decoration-thickness: 2px; font-weight: 800; }
@keyframes pop { 40% { transform: scale(1.08); } }
.fact-msg { min-height: 28px; font-weight: 700; }
.fact-ok { display: inline-flex; align-items: center; gap: 6px; color: var(--mint); font-size: var(--fs-lg); }
.fact-no { color: var(--ink-2); }
.fact-no b { color: var(--ink); }
.fact-right .keypad { max-width: 320px; margin: 0 auto; }
.fact-right .key { min-height: 60px; font-size: var(--fs-xl); }
.fact-help { animation: rise var(--t-med) var(--ease); }
.fact-help .steps li { font-size: var(--fs-md); }
.fact-help { margin: 0; }
.fact-help .visual svg { max-height: 220px; }
.q-card { padding: var(--pad); }
.q-label { color: var(--ink-2); font-size: var(--fs-sm); font-weight: 700; }
.stem { font-size: var(--fs-lg); font-weight: 700; line-height: 1.55; margin: var(--sp-2) 0 var(--sp-4); overflow-wrap: anywhere; }
@media (min-width: 960px) { .q-card .stem:not(.big) { font-size: 1.25rem; } }
/* A long reading passage: regular weight, only its question line bold (play.js stemHtml). */
.stem.long { font-weight: 400; }
.stem.long b { font-weight: 800; }
.stem.big { font-size: var(--fs-2xl); text-align: center; letter-spacing: .02em; }
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1.1; margin: 0 3px; font-size: .9em; }
.frac > span:first-child { border-bottom: 2px solid currentColor; padding: 0 3px 1px; }
.frac > span:last-child { padding: 1px 3px 0; }

.answer-row { display: flex; justify-content: center; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.slot {
  min-width: 128px; min-height: 64px; padding: 0 var(--sp-4); border-radius: var(--r-md); border: 2px solid var(--line);
  background: var(--bg); display: grid; place-items: center; font-size: var(--fs-xl); font-weight: 800;
  font-variant-numeric: tabular-nums; cursor: text;
}
.slot.active { border-color: var(--accent); background: var(--surface); }
.slot.empty::after { content: ''; width: 2px; height: 32px; background: var(--accent); animation: blink 1s steps(1) infinite; }
.slot:not(.active).empty::after { display: none; }
@keyframes blink { 50% { opacity: 0; } }
.frac-input { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; }
.frac-input .line { width: 100%; height: 3px; background: var(--ink); border-radius: 2px; }
.frac-input .slot { min-height: 54px; min-width: 104px; font-size: var(--fs-lg); }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); max-width: 340px; margin: 0 auto var(--sp-4); }
.key {
  min-height: 52px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface);
  font-size: var(--fs-lg); font-weight: 800; color: var(--ink); cursor: pointer; transition: background var(--t-fast) var(--ease);
}
.key:hover { background: var(--surface-2); }
.key:active { background: var(--accent-soft); }
.key.soft { color: var(--ink-2); font-size: var(--fs-md); }
@media (pointer: fine) and (min-width: 960px) { .keypad { max-width: 300px; } .key { min-height: 46px; } }

.choices { display: grid; gap: var(--sp-2); margin-bottom: var(--sp-4); }
@media (min-width: 560px) { .choices.two { grid-template-columns: 1fr 1fr; } }
.choice {
  display: grid; grid-template-columns: 36px 1fr; gap: var(--sp-3); align-items: center; padding: 10px var(--sp-4); min-height: 56px;
  border-radius: var(--r-md); border: 2px solid var(--line); background: var(--surface); text-align: left; font: inherit;
  font-size: var(--fs-md); font-weight: 600; color: var(--ink); cursor: pointer; transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.choice:hover { border-color: var(--accent-soft); }
.choice > span:last-child { text-wrap: balance; }
.choice .letter { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); font-weight: 800; }
.choice.picked { border-color: var(--accent); background: var(--accent-soft); }
.choice.picked .letter { background: var(--accent); color: var(--on-accent); }
.choice.right { border-color: var(--mint); }
.choice.right .letter { background: var(--mint); color: var(--surface); }

.q-actions { display: flex; gap: var(--sp-3); justify-content: center; flex-wrap: wrap; }

/* Result: the question and her answer on the left; the solution and then the button on the
   right (laptop), so reading ends at the button. Phone: the same order, one column. */
.result-grid { display: grid; gap: var(--sp-5); }
@media (min-width: 900px) { .result-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.result-grid .solution { margin: 0; }
.result-main .choices { margin-bottom: 0; }
.small-stem { font-size: var(--fs-md); margin: var(--sp-1) 0 var(--sp-3); }
.choices.compact { gap: var(--sp-2); }
.choices.compact .choice { padding: var(--sp-2) var(--sp-3); }
.choices.compact .letter { width: 32px; height: 32px; }
.result-actions { justify-content: flex-start; margin-top: var(--sp-4); }
.q-actions .btn-primary { min-width: 200px; }
/* "Bu soruda hata var" is rare: a quiet link at the end of the solution, not a second button. */
.report-line { margin: var(--sp-3) 0 0; text-align: right; }
.report-line .btn { min-height: 44px; padding: 0 var(--sp-3); font-size: var(--fs-sm); color: var(--ink-2); }
@media (pointer: fine) { .report-line .btn { min-height: 36px; } }
.coach-line { margin-top: var(--sp-4); padding-top: var(--sp-3); border-top: 1px solid var(--line); }
.coach-line > .btn { width: 100%; }
.coach-box .chat { min-height: 0; max-height: 360px; padding-top: 0; }
.report-form { display: grid; gap: var(--sp-2); justify-items: start; margin: var(--sp-3) 0 0; padding-top: var(--sp-3); border-top: 1px dashed var(--line); }
.report-form textarea { width: 100%; }
/* Phone: the solution is longer than the screen, so "Devam" rides along at the bottom while
   she reads (its block is the whole result, not only the solution column). */
@media (max-width: 899px) {
  .result-side { display: contents; }
  .result-actions {
    position: sticky; bottom: 0; z-index: 2; margin: 0 calc(-1 * var(--pad));
    padding: var(--sp-3) var(--pad) calc(var(--sp-3) + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--line);
  }
  .result-actions .btn-primary { flex: 1; }
}

.result { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; flex: none; }
.mark.ok { background: var(--mint-soft); color: var(--mint); }
.mark.no { background: var(--accent-soft); color: var(--accent-ink); }
.result h2 { font-size: var(--fs-lg); font-weight: 800; }
.result p { margin: 0; color: var(--ink-2); }
.key-answer { font-size: var(--fs-lg); font-weight: 800; margin: 0 0 var(--sp-3); }

.solution { border-radius: var(--r-md); background: var(--bg); border: 1px solid var(--line); padding: var(--sp-4); margin-bottom: var(--sp-4); }
.solution h3 { font-size: var(--fs-sm); color: var(--ink-2); font-weight: 800; margin-bottom: var(--sp-2); text-transform: none; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps li { position: relative; padding: 8px 0 8px 38px; font-size: var(--fs-md); line-height: 1.65; }
.steps li + li { border-top: 1px dashed var(--line); }
.steps li:only-child { padding-left: 0; font-size: var(--fs-lg); font-weight: 600; }
.steps li:only-child::before { display: none; }
.steps li::before {
  counter-increment: s; content: counter(s); position: absolute; left: 0; top: 10px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--sky-soft); color: var(--sky); font-weight: 800; font-size: var(--fs-xs); display: grid; place-items: center;
}
.steps li.enter { animation: rise var(--t-med) var(--ease); }
.visual { margin: var(--sp-3) 0 0; }
.visual svg { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.visual figcaption { text-align: center; color: var(--ink-2); font-weight: 700; font-size: var(--fs-sm); margin-top: var(--sp-2); }

/* Picture parts (SVG) */
.v-box { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; }
.v-nut { fill: var(--nut); }
.v-cell { fill: var(--surface); stroke: var(--ink-3); stroke-width: 1; }
.v-cell.on { fill: var(--accent-soft); stroke: var(--accent); }
.v-cell.row { fill: var(--mint-soft); }
.v-cell.col { fill: var(--sky-soft); }
.v-cell.both { fill: var(--accent); stroke: var(--accent-ink); }
.v-part { fill: var(--sky-soft); stroke: var(--sky); stroke-width: 2; }
.v-part.alt { fill: var(--mint-soft); stroke: var(--mint); }
.v-text { font: 700 15px var(--font); fill: var(--ink); }
.v-text.soft { fill: var(--ink-2); font-weight: 600; }
.v-text.big { font-size: 18px; font-weight: 800; }
.v-axis { stroke: var(--ink-2); stroke-width: 2; }
.v-tick { stroke: var(--ink-3); stroke-width: 1.5; }
.v-zero { stroke: var(--ink); stroke-width: 2.5; }
.v-jump { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.v-jump.back { stroke: var(--sky); }
.v-start { fill: var(--surface); stroke: var(--ink); stroke-width: 2.5; }
.v-end { fill: var(--mint); stroke: var(--mint); }

/* Offline or a failed load in the question card: one calm line and "Tekrar dene". */
.retry { display: grid; justify-items: center; gap: var(--sp-3); padding: var(--sp-5) 0; text-align: center; }
.retry .mascot-img { width: 96px; height: 96px; }
.retry p { margin: 0; color: var(--ink-2); max-width: 36ch; }

/* Worked example */
.example-tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: var(--r-pill);
  background: var(--sky-soft); color: var(--sky); font-weight: 800; font-size: var(--fs-sm);
}
.example-tag .ic { width: 18px; height: 18px; }

/* ---------- Overlays ---------- */
.idle, .modal {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: var(--sp-4);
  background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(6px); animation: fade var(--t-med) var(--ease);
}
/* A tall card (a checklist on a short phone) scrolls instead of losing its top. */
.modal { overflow-y: auto; place-items: safe center; }
@keyframes fade { from { opacity: 0; } }
.idle-card, .modal-card {
  max-width: 420px; width: 100%; text-align: center; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: var(--sp-6) var(--sp-5); box-shadow: var(--shadow); animation: rise var(--t-med) var(--ease);
}
.idle-card h2, .modal-card h2 { font-size: var(--fs-xl); font-weight: 800; margin: var(--sp-3) 0 var(--sp-2); }
.idle-card p, .modal-card p { color: var(--ink-2); margin: 0 0 var(--sp-4); }
.modal-card h2 { text-wrap: balance; }
.modal-card p { text-wrap: pretty; }
/* A short checklist in a dialog (deneme: get ready first): left-aligned, ticks, not bullets. */
.modal-list { list-style: none; margin: calc(-1 * var(--sp-2)) 0 var(--sp-4); padding: 0; display: grid; gap: var(--sp-2); text-align: left; }
.modal-list li { position: relative; padding-left: 26px; color: var(--ink); text-wrap: pretty; }
.modal-list li::before { content: ''; position: absolute; left: 4px; top: 0.35em; width: 12px; height: 7px; border: solid var(--accent); border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg); }
.idle-card .mascot-img, .modal-card .mascot-img { width: 140px; height: 140px; }
.modal-card .mascot, .idle-card .mascot { margin: 0 auto; }
.modal-card.alarm { border: 2px solid var(--bad); }
.modal-card.alarm h2 { color: var(--bad); }

/* Under the top bar, not at the bottom: on a phone the main button (and the keypad) sits at the
   bottom, and a toast there covered it. Centred with margins, not a transform, so the drop-in
   animation does not shift it sideways. */
.toast {
  position: fixed; left: 0; right: 0; margin-inline: auto; width: fit-content; z-index: 60;
  top: calc(max(var(--sp-2), env(safe-area-inset-top)) + 64px);
  background: var(--ink); color: var(--bg); padding: var(--sp-3) var(--sp-5); border-radius: var(--r-pill); font-weight: 700;
  box-shadow: var(--shadow); animation: drop var(--t-med) var(--ease); max-width: calc(100vw - 32px); text-align: center; text-wrap: balance;
}
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- Forms (login, onboarding) ---------- */
.center-screen { min-height: calc(100vh - 120px); display: grid; place-items: center; }
.login-card { width: min(420px, 100%); text-align: center; }
.login-card h1 { font-size: var(--fs-xl); font-weight: 800; margin: var(--sp-3) 0 var(--sp-2); }
.pin-input {
  width: 100%; min-height: 64px; text-align: center; font: 800 var(--fs-xl) var(--font); letter-spacing: .4em;
  border-radius: var(--r-md); border: 2px solid var(--line); background: var(--bg); color: var(--ink); margin: var(--sp-4) 0 var(--sp-3);
}
.pin-input:focus { border-color: var(--accent); outline: none; }
.err { color: var(--bad); font-weight: 700; min-height: 1.5em; margin: 0 0 var(--sp-3); }
.text-input {
  width: 100%; min-height: 52px; padding: 0 var(--sp-4); font: 600 var(--fs-md) var(--font); color: var(--ink);
  border-radius: var(--r-md); border: 2px solid var(--line); background: var(--bg);
}
.text-input:focus, textarea.text-input:focus { border-color: var(--accent); outline: none; }
textarea.text-input { padding: var(--sp-3) var(--sp-4); min-height: 96px; resize: vertical; }
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: center; margin: var(--sp-4) 0; }
.chip {
  min-height: 44px; padding: 0 var(--sp-4); border-radius: var(--r-pill); border: 2px solid var(--line); background: var(--surface);
  font: 700 var(--fs-md) var(--font); color: var(--ink); cursor: pointer; transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.chip:hover { border-color: var(--accent-soft); }
.chip.on { border-color: var(--accent); background: var(--accent-soft); }
.onb { text-align: center; }
.onb h1 { font-size: var(--fs-xl); font-weight: 800; margin: var(--sp-3) 0 var(--sp-2); }
.onb .btn-big { margin-top: var(--sp-4); min-width: 220px; }
.onb-steps { display: flex; justify-content: center; gap: 6px; margin-bottom: var(--sp-4); }
.onb-steps i { width: 28px; height: 6px; border-radius: var(--r-pill); background: var(--surface-2); }
.onb-steps i.on { background: var(--accent); }
.big-number { font-size: var(--fs-2xl); font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- Lesson, drawing, chats, table ---------- */
.lesson-card { min-height: 280px; }
.lesson-card h2 { margin-bottom: var(--sp-3); }
.lesson-text { font-size: var(--fs-md); line-height: 1.7; }
.lesson-text p { margin: 0 0 var(--sp-3); }
.lesson-nav { margin-top: var(--sp-5); flex-wrap: nowrap; }
.lesson-nav .btn-primary { min-width: 0; flex: 0 1 280px; }

.code-lead { margin: 0; text-wrap: balance; }
.code-box {
  display: flex; justify-content: center; gap: var(--sp-2); margin: var(--sp-4) 0; font-size: var(--fs-2xl); font-weight: 800; font-variant-numeric: tabular-nums;
}
.code-box span { display: grid; place-items: center; width: 64px; height: 76px; border-radius: var(--r-md); background: var(--accent-soft); color: var(--accent-ink); }
.kind-tag { display: inline-block; padding: 2px 12px; border-radius: var(--r-pill); background: var(--mint-soft); color: var(--mint); font-weight: 800; font-size: var(--fs-sm); }
.photo-preview { display: block; max-height: 320px; margin: var(--sp-3) auto; border-radius: var(--r-md); }

.chat-card { display: flex; flex-direction: column; height: calc(100dvh - 176px); min-height: 380px; max-height: 760px; }
.chat-card .chat { flex: 1; min-height: 0; max-height: none; }
.chat-card > .row .mascot-img { width: 96px; height: 96px; }
@media (max-width: 560px) { .chat-card > .row { gap: var(--sp-2); } .chat-card > .row .mascot-img { width: 64px; height: 64px; } }
.chat { display: flex; flex-direction: column; gap: var(--sp-2); min-height: 300px; max-height: calc(100vh - 300px); overflow-y: auto; padding: var(--sp-2) 0; }
.msg { max-width: 82%; padding: var(--sp-3) var(--sp-4); border-radius: 18px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.me { align-self: flex-end; background: var(--accent-soft); border-bottom-right-radius: 6px; }
.msg.them { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 6px; }
.msg small { display: block; color: var(--ink-2); font-weight: 700; font-size: var(--fs-xs); margin-bottom: 2px; }
.msg.wait { color: var(--ink-2); font-style: italic; }
.composer { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); }
.composer .text-input { flex: 1; min-width: 0; }
.composer .btn { min-height: 52px; min-width: 52px; padding: 0 var(--sp-4); }
.coach-left { margin: 0 0 var(--sp-2); color: var(--ink-2); font-size: var(--fs-sm); }
.coach-left b { color: var(--ink); }

.table-grid { display: grid; grid-template-columns: 28px repeat(9, minmax(0, 1fr)); gap: 4px; margin: var(--sp-4) 0; }
.table-grid > div {
  display: grid; place-items: center; aspect-ratio: 1; border-radius: 8px; font-weight: 800; font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}
.table-grid .h { color: var(--ink-2); }
@media (max-width: 420px) { .table-grid { gap: 3px; } .table-grid > div { font-size: var(--fs-xs); border-radius: 6px; } }
/* Laptop: rows a little lower than square, so the whole table and its button fit 1366×768. */
@media (min-width: 960px) { .table-grid > div { aspect-ratio: auto; height: 34px; } }
.b0 { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-3); }
.b1, .b2 { background: var(--accent-soft); color: var(--accent-ink); }
.b3, .b4 { background: var(--sky-soft); color: var(--sky); }
.b5 { background: var(--mint-soft); color: var(--mint); }
.legend { display: flex; flex-wrap: wrap; gap: var(--sp-3); font-size: var(--fs-sm); color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }

.done-card { text-align: center; }
.done-card h1 { font-size: var(--fs-xl); font-weight: 800; margin: var(--sp-3) 0 var(--sp-2); }
.done-card .q-actions { margin-top: var(--sp-4); }
.gain { display: inline-flex; align-items: center; gap: 6px; color: var(--nut); font-weight: 800; font-size: var(--fs-lg); }
.gain .ic { width: 24px; height: 24px; }

/* ---------- Family button (Enes / Mom) ---------- */
.buddy {
  position: fixed; right: var(--sp-4); bottom: max(var(--sp-4), env(safe-area-inset-bottom)); z-index: 25;
  display: flex; align-items: flex-end; gap: var(--sp-2); text-decoration: none; color: var(--ink);
}
.buddy-face {
  position: relative; display: block; width: 64px; height: 64px; border-radius: 50%; background: var(--sky-soft);
  box-shadow: var(--shadow); transition: transform var(--t-fast) var(--ease);
}
.buddy:hover .buddy-face { transform: scale(1.05); }
.buddy-face img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.buddy-fallback { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; color: var(--sky); }
.buddy-fallback .ic { width: 30px; height: 30px; }
.buddy-badge {
  position: absolute; top: -4px; right: -4px; display: grid; place-items: center; width: 26px; height: 26px;
  border-radius: 50%; background: var(--accent); color: var(--on-accent); transform: scale(0);
  transition: transform var(--t-med) var(--ease);
}
.buddy-badge .ic { width: 15px; height: 15px; }
.buddy.unread .buddy-badge { transform: scale(1); }
.buddy.unread .buddy-face { animation: nudge 2.4s var(--ease) 3; }
@keyframes nudge { 0%, 70%, 100% { transform: none; } 80% { transform: translateY(-6px); } 90% { transform: translateY(0); } }
.buddy-bubble {
  max-width: 240px; padding: var(--sp-2) var(--sp-4); border-radius: 18px 18px 6px 18px; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow); font-size: var(--fs-sm); line-height: 1.4;
  animation: rise var(--t-med) var(--ease), bubble-out 400ms var(--ease) 12s forwards; overflow-wrap: anywhere;
}
/* The bubble says it once, then steps aside so it never covers the page; the badge stays. */
@keyframes bubble-out { to { opacity: 0; visibility: hidden; transform: translateY(6px); } }
.buddy:hover .buddy-bubble, .buddy:focus-visible .buddy-bubble { animation: none; }
.buddy-bubble b { display: block; color: var(--accent-ink); }
/* The face shows only on the home page while a family message is unread (buddy.js); room for it
   under the page only then, so it never covers the last button. */
.view { padding-bottom: var(--sp-5); }
.buddy:not(.show) { display: none; }
body:has(.buddy.show:not([hidden])) .view { padding-bottom: 112px; }
@media (min-width: 960px) { .buddy { right: var(--sp-5); bottom: var(--sp-5); } .buddy-face { width: 72px; height: 72px; } body:has(.buddy.show:not([hidden])) .view { padding-bottom: var(--sp-5); } }

/* ---------- Family note on a drawing (more.js familyNoteCard) ----------
   Abi's or Mom's face with the note as a speech bubble; one quiet "Sağ ol" closes it. */
.family-note {
  --pad: var(--sp-4); display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: var(--sp-2) var(--sp-3);
  align-items: start; animation: rise var(--t-med) var(--ease);
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.family-note.leaving { opacity: 0; transform: translateY(-6px); }
.note-face { display: block; width: 52px; height: 52px; border-radius: 50%; background: var(--sky-soft); overflow: hidden; }
.note-face img { display: block; width: 100%; height: 100%; object-fit: cover; }
.note-face-fallback { display: grid; place-items: center; width: 100%; height: 100%; color: var(--sky); }
.note-face-fallback .ic { width: 26px; height: 26px; }
.family-note h2 { font-size: var(--fs-md); font-weight: 800; }
.note-for { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--ink-2); }
.note-text {
  margin: var(--sp-2) 0 0; padding: var(--sp-2) var(--sp-3); border-radius: 4px var(--r-md) var(--r-md) var(--r-md);
  background: var(--surface-2); white-space: pre-line; overflow-wrap: anywhere;
}
.note-ok { grid-column: 2; justify-self: start; }

/* ---------- Wardrobe (Dolap) ---------- */
.wardrobe { display: grid; gap: var(--sp-5); max-width: 980px; margin: 0 auto; }
.wardrobe > .q-head { margin-bottom: calc(-1 * var(--sp-3)); }
.wardrobe-head { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-4); align-items: center; }
.wardrobe-head h1 { font-size: var(--fs-xl); font-weight: 800; margin-bottom: var(--sp-2); }
.wardrobe-head .ic-nut, .outfit .ic-nut { width: 18px; height: 18px; color: var(--nut); vertical-align: -3px; }
.outfits { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.outfit {
  display: grid; grid-template-rows: auto auto 1fr; gap: var(--sp-2); justify-items: center; text-align: center;
  padding: var(--sp-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  transition: border-color var(--t-fast) var(--ease);
}
.outfit.on { border: 2px solid var(--accent); }
.outfit-pic { display: grid; place-items: center; width: 132px; height: 132px; border-radius: var(--r-md); background: var(--surface-2); }
.outfit-img { width: 120px; height: 120px; object-fit: contain; }
.outfit-pic .mascot-fallback { width: 120px; height: 120px; background: none; }
.outfit .price { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--ink-2); }
.outfit b { font-weight: 700; text-wrap: balance; }
.outfit-act { display: grid; gap: var(--sp-2); justify-items: center; align-self: end; width: 100%; }
.outfit-act .bar { width: 100%; margin: 0; height: 8px; }
.outfit-act .btn { width: 100%; }
.tag { font-size: var(--fs-xs); font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); padding: 2px var(--sp-3); border-radius: var(--r-pill); }
@media (max-width: 640px) {
  .wardrobe-head { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .wardrobe-head .mascot-img { width: 120px; height: 120px; }
  .outfits { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
  .outfit { padding: var(--sp-3); }
  .outfit-act .btn { white-space: normal; text-wrap: balance; line-height: 1.25; padding: var(--sp-2) var(--sp-3); font-size: var(--fs-sm); }
  .outfit-act .btn .ic { display: none; } /* the price says nuts already; the label then fits one line */
  .outfit-pic { width: 104px; height: 104px; }
  .outfit-img, .outfit-pic .mascot-fallback { width: 96px; height: 96px; }
}

/* ---------- Pacing: next reward + teaser ---------- */
.outfit.soon .outfit-img { filter: brightness(0) opacity(.18); }
.outfit.soon .mascot-fallback { opacity: .4; }

/* ---------- Deneme (mock exam) ---------- */
/* Exam clock: sits in the top bar in place of the study clock while a block runs. */
.dn-clock {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 var(--sp-4);
  border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-ink); font-weight: 800;
}
.dn-clock .ic { width: 20px; height: 20px; }
.dn-clock b { color: var(--ink); min-width: 4.2ch; text-align: right; }
.dn-clock-word { font-size: var(--fs-sm); font-weight: 700; }
.dn-clock.low { background: var(--warn-soft); color: var(--warn); }
@media (max-width: 420px) { .dn-clock-word { display: none; } }

.dn-intro { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-4); align-items: center; }
.dn-intro .mascot-img { width: 104px; height: 104px; }
.dn-intro h1 { font-size: var(--fs-xl); font-weight: 800; margin-bottom: var(--sp-2); }
.dn-intro p { margin: 0; }
@media (max-width: 420px) { .dn-intro { gap: var(--sp-3); } .dn-intro .mascot-img { width: 72px; height: 72px; } }
.dn-open { display: grid; grid-template-columns: auto 1fr auto; gap: var(--sp-3); align-items: center; background: var(--accent-soft); border-color: transparent; }
.dn-open > .ic { width: 28px; height: 28px; color: var(--accent-ink); }
.dn-open p { margin: 2px 0 0; }
.dn-format { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-4); align-items: center; }
.dn-format p { margin: var(--sp-1) 0 0; }
.dn-blocks { font-weight: 700; }
.dn-format-act { justify-self: end; max-width: 30ch; }
.dn-format-act p { margin: 0; }
.dn-format.wait { grid-template-columns: 1fr; }
.dn-format.wait .dn-format-act { justify-self: stretch; max-width: none; }
@media (max-width: 560px) {
  .dn-format { grid-template-columns: 1fr; }
  .dn-format-act { justify-self: stretch; max-width: none; }
  .dn-format-act .btn { width: 100%; }
  .dn-open { grid-template-columns: auto 1fr; }
  .dn-open .btn { grid-column: 1 / -1; }
}
.dn-rules { margin: var(--sp-3) 0 0; padding-left: 1.2em; }
.dn-rules li + li { margin-top: var(--sp-2); }
.dn-history { list-style: none; margin: var(--sp-3) 0 0; padding: 0; }
.dn-hist {
  display: grid; grid-template-columns: 1fr auto auto; gap: var(--sp-3); align-items: center; padding: var(--sp-3);
  border-radius: var(--r-md); color: var(--ink); text-decoration: none; transition: background var(--t-fast) var(--ease);
}
.dn-hist:hover { background: var(--surface-2); }
.dn-hist .ic { color: var(--ink-3); }
.dn-hist-num { font-size: var(--fs-sm); color: var(--ink-2); white-space: nowrap; }
.dn-hist-num b { color: var(--ink); font-size: var(--fs-md); }
@media (max-width: 560px) { .dn-hist { grid-template-columns: 1fr auto; } .dn-hist-num { grid-column: 1; } .dn-hist .ic { grid-row: 1 / span 2; grid-column: 2; } }

/* Question navigation: back · blank · next, on one line when it fits */
.dn-nav { display: grid; grid-template-columns: auto 1fr auto; gap: var(--sp-2); align-items: center; }
.dn-nav #dn-blank { justify-self: center; }
@media (max-width: 420px) {
  .dn-nav { grid-template-columns: 1fr 1fr; }
  .dn-nav #dn-blank { grid-column: 1 / -1; grid-row: 2; }
  .dn-nav .btn { padding: 0 var(--sp-3); }
}
.dn-subj { margin: var(--sp-3) 0 var(--sp-2); font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2); }
.dn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.dn-cell {
  min-height: 44px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface);
  font: 700 var(--fs-sm) var(--font); color: var(--ink-2); cursor: pointer; font-variant-numeric: tabular-nums;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.dn-cell:hover { border-color: var(--accent-soft); }
.dn-cell.on { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent-ink); }
.dn-cell.now { border: 2px solid var(--accent); color: var(--ink); }
.dn-finish { margin-top: var(--sp-4); }

/* Result */
.dn-score { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); text-align: center; }
.dn-score > div { display: grid; gap: 2px; padding: var(--sp-3); border-radius: var(--r-md); background: var(--surface-2); }
.dn-score span { color: var(--ink-2); font-weight: 700; font-size: var(--fs-sm); }
.dn-table-wrap { overflow-x: auto; margin: var(--sp-3) 0 0; }
.dn-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: var(--fs-sm); }
.dn-table th, .dn-table td { padding: var(--sp-2) 6px; text-align: right; border-bottom: 1px solid var(--line); }
.dn-table th[scope="row"], .dn-table thead th:first-child { text-align: left; font-weight: 700; }
.dn-table thead th { color: var(--ink-2); font-weight: 700; }
.dn-table abbr { text-decoration: none; }
.dn-table tfoot th, .dn-table tfoot td { border-bottom: 0; font-weight: 800; }

/* Solutions */
.dn-filter { justify-content: flex-start; margin: 0 0 var(--sp-4); }
.chip:disabled { opacity: .45; cursor: default; }
.dn-sol .stem { font-size: var(--fs-md); }
.dn-sol .q-label { margin: 0; }
.dn-tag { flex: none; padding: 2px var(--sp-3); border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 800; background: var(--surface-2); color: var(--ink-2); }
.dn-tag.ok { background: var(--mint-soft); color: var(--mint); }
.dn-tag.no { background: var(--accent-soft); color: var(--accent-ink); }
.dn-note { display: block; font-size: var(--fs-xs); font-weight: 700; color: var(--ink-2); margin-top: 2px; }

/* Scheduled deneme, target nets, weakest topics */
.dn-today {
  display: inline-block; margin-bottom: var(--sp-1); padding: 2px 10px; border-radius: var(--r-pill);
  background: var(--accent-soft); color: var(--accent-ink); font-size: var(--fs-xs); font-weight: 700;
}
.dn-targets, .dn-focus { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); }
.dn-targets li { display: grid; grid-template-columns: 1fr auto; column-gap: var(--sp-3); align-items: baseline; }
.dn-targets .bar { grid-column: 1 / -1; margin: var(--sp-1) 0 0; }
.dn-target-name { font-weight: 700; }
.dn-target-left { grid-column: 1 / -1; color: var(--ink-2); }
.dn-targets li.ok .dn-target-left { color: var(--mint); font-weight: 700; }
.dn-target-left .ic { width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; }
.dn-focus li { display: grid; grid-template-columns: 24px 1fr; gap: var(--sp-3); align-items: start; }
.dn-focus .ic { width: 22px; height: 22px; color: var(--ink-2); margin-top: 2px; }

/* Home card */
.deneme-card {
  display: grid; grid-template-columns: 44px 1fr auto; gap: var(--sp-3); align-items: center; padding: var(--sp-4);
  color: var(--ink); text-decoration: none; transition: border-color var(--t-fast) var(--ease);
}
.deneme-card:hover { border-color: var(--accent-soft); }
.deneme-card .mission-sub { display: block; margin-top: 2px; }
.deneme-card .go { color: var(--ink-3); }

/* ---------------- Official MEB booklets: answer sheet (optik form) ---------------- */
.dn-sets { list-style: none; margin: var(--sp-3) 0 0; padding: 0; }
.dn-set { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-3); align-items: center; padding: var(--sp-3) 0; border-top: 1px solid var(--line); }
.dn-set p { margin: 2px 0 0; }
.dn-set-act { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 560px) { .dn-set { grid-template-columns: 1fr; } .dn-set-act { justify-content: stretch; } .dn-set-act .btn { flex: 1; } }
.dn-book { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-3); align-items: center; }
.dn-book p { margin: 2px 0 0; }
@media (max-width: 560px) { .dn-book { grid-template-columns: 1fr; } .dn-book .btn { width: 100%; } }
/* Rows like a paper sheet: numbers run down a column, more columns side by side when there is room. */
.dn-rows { list-style: none; margin: 0; padding: 0; columns: 260px auto; column-gap: var(--sp-6); }
.dn-row { break-inside: avoid; display: grid; grid-template-columns: 2.4ch 1fr; gap: var(--sp-3); align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.dn-no { font-weight: 700; color: var(--ink-2); text-align: right; }
.dn-row.done .dn-no { color: var(--ink); }
.dn-bubbles { display: flex; gap: var(--sp-2); }
.dn-bub {
  width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--ink-3); background: var(--surface);
  color: var(--ink-2); font: inherit; font-weight: 700; cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.dn-bub:hover { border-color: var(--accent-soft); }
.dn-bub.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.dn-bub:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dn-keys { list-style: none; margin: 0; padding: 0; }
.dn-keys li { display: grid; grid-template-columns: 2.4ch 1fr 1fr auto; gap: var(--sp-3); align-items: center; padding: var(--sp-2) 0; border-bottom: 1px solid var(--line); }

/* Big PC screen: the reading screens (lesson, drawing, coach, chat, table) use more of the width
   and a size up in text; 760 px keeps lines short enough to read. */
@media (min-width: 1200px) {
  .narrow { max-width: 760px; }
  .lesson-text, .msg { font-size: 1.1875rem; }
}

/* Today's path in stops: the current stop's 2–4 steps as friendly tiles, the rest as chips. */
.stops { list-style: none; margin: 0 0 var(--sp-3); padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.stop-chip {
  display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 0 var(--sp-3);
  border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); background: var(--surface-2);
}
.stop-chip .ic { width: 16px; height: 16px; }
.stop-chip.done { background: var(--mint-soft); color: var(--mint); }
.stop-chip.now { background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; }
.stop-chip.later { background: none; border: 1px dashed var(--line); font-weight: 500; }
.stop-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.stop-step {
  position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: var(--sp-3);
  min-height: 64px; padding: var(--sp-3); border-radius: var(--r-md); border: 2px solid var(--line);
  background: var(--surface); color: var(--ink); text-decoration: none;
  transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.stop-step:hover { border-color: var(--accent-soft); transform: translateY(-1px); }
.stop-step.now { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.stop-step.done { border-color: transparent; background: var(--surface-2); color: var(--ink-2); }
.stop-step.done .mission-ic { background: var(--mint-soft); color: var(--mint); }
.stop-step-text { display: grid; gap: 2px; min-width: 0; }
.stop-step-text b { font-weight: 700; line-height: 1.3; }
.stop-step-text > span { font-size: var(--fs-sm); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stop-step .bar { position: absolute; left: var(--sp-3); right: var(--sp-3); bottom: 6px; height: 4px; margin: 0; }
.today-all { margin: var(--sp-3) 0 0; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.today-all .num { color: var(--accent-ink); font-weight: 800; }
.today-all + .path { margin-top: var(--sp-3); }
.stop-cheer {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: var(--sp-3);
  margin-bottom: var(--sp-3); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-md); background: var(--mint-soft);
  animation: stop-cheer-in 300ms var(--ease) both;
}
.stop-cheer .mascot-img { width: 56px; height: 56px; }
.stop-cheer p { margin: 0; display: grid; gap: 2px; }
.stop-cheer b { color: var(--mint); font-weight: 800; }
.stop-cheer span { font-size: var(--fs-sm); color: var(--ink-2); }
@keyframes stop-cheer-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .stop-cheer { animation: none; } }
@media (max-width: 560px) { .stop-chip .stop-n, .stop-chip.more { display: none; } }

/* Question screen on a PC: the card is the whole screen now (no scratchpad), so it reads a size up. */
@media (min-width: 960px) {
  .q-layout:not(.fact-layout) .q-card { padding: var(--sp-6) var(--sp-7); }
  .q-layout:not(.fact-layout) .q-card .stem:not(.big) { font-size: 1.3rem; line-height: 1.55; }
  .q-layout:not(.fact-layout) .q-card .choice { min-height: 60px; font-size: 1.125rem; }
  .q-layout:not(.fact-layout) .q-card .steps li { font-size: 1.0625rem; }
}
@media (min-width: 1600px) and (min-height: 900px) {
  .q-layout:not(.fact-layout) { max-width: 1000px; }
  .q-layout:not(.fact-layout) .q-card .stem:not(.big) { font-size: 1.5rem; }
  .q-layout:not(.fact-layout) .q-card .choice { min-height: 68px; font-size: 1.25rem; }
}
