/* Cell by Cell: the Excel sticker album. */
@font-face { font-family: "Big Shoulders Display"; src: url(fonts/BigShouldersDisplay-normal.woff2) format("woff2"); font-weight: 700 900; font-display: swap; }
@font-face { font-family: "Figtree"; src: url(fonts/Figtree-normal.woff2) format("woff2"); font-weight: 400 800; font-display: swap; }

:root {
  --pitch: #0F7A46;
  --pitch-deep: #0A5A33;
  --pitch-night: #083F25;
  --ground: #F2F5F3;
  --ink: #121417;
  --muted: #545C59;
  --line: #D6DEDA;
  --line-strong: #AEBBB5;
  --red: #E03A3E;
  --gold: #E9B949;
  --gold-ink: #3A2A05;
  --star: #A87A12;
  --ok: #0B6B3D;
  --ok-bg: #E2F3E9;
  --warn: #8A4500;
  --warn-bg: #FFF0D9;
  --note-bg: #EEF2F0;
  --hit-bg: #FFC7CE;
  --hit-ink: #9C0006;
  --focus: #1F5FBF;
  --display: "Big Shoulders Display", "Arial Narrow", sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Roboto Mono", monospace;
  --m-in: 140ms;
  --m-out: 200ms;
  --m-press: 90ms;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --lift: 0 1px 1px rgba(18, 20, 23, .08), 0 10px 22px -8px rgba(18, 20, 23, .38);
  --lift-hi: 0 2px 2px rgba(18, 20, 23, .08), 0 18px 30px -10px rgba(18, 20, 23, .42);
  --gutter: clamp(16px, 4vw, 40px);
}
.lv-basic { --lv: #E9B949; --lv-ink: #3A2A05; }
.lv-inter { --lv: #C2531A; --lv-ink: #fff; }
.lv-adv { --lv: #1F5FBF; --lv-ink: #fff; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line-strong) transparent; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 18px/1.5 var(--body); caret-color: var(--pitch); }
::selection { background: #BFE3CF; color: var(--ink); }
a { color: inherit; text-underline-offset: 4px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; animation: ring var(--m-out) var(--ease); }
@keyframes ring { from { outline-offset: 6px; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon.on { fill: currentColor; }
code { font-family: var(--mono); font-size: .9em; padding: .08em .35em; border-radius: 6px; background: #E6EDE9; overflow-wrap: anywhere; }
h1, h2, h3 { text-wrap: balance; }

/* ---------- buttons: hover steps toward ink and up 1px, press sinks (taste-skill motion numbers) ---------- */
.btn {
  --b: #fff; --bt: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 22px; border: 0; border-radius: 12px;
  background: var(--b); color: var(--bt); font: 800 18px/1.15 var(--body); text-decoration: none; cursor: pointer;
  transition: background-color var(--m-out) var(--ease), transform var(--m-out) var(--ease), box-shadow var(--m-out) var(--ease);
}
.btn .icon { width: 22px; height: 22px; }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.985); transition-duration: var(--m-press); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-red { --b: var(--red); --bt: #fff; box-shadow: 0 8px 18px -10px rgba(140, 20, 24, .7); }
.btn-green { --b: var(--pitch); --bt: #fff; }
.btn-ghost { --b: #fff; border: 1.5px solid var(--line-strong); }
.btn-ghost[aria-pressed="true"] { --b: var(--ok-bg); border-color: var(--pitch); }
.btn-ghost-light { --b: transparent; --bt: #fff; border: 1.5px solid rgba(255, 255, 255, .55); --focus: #fff; }
.btn-small { min-height: 42px; padding: 8px 14px; font-size: 16px; border-radius: 10px; }
.btn-small .icon { width: 18px; height: 18px; }
.btn-xl { min-height: 60px; padding: 16px 28px; font-size: 21px; border-radius: 14px; }
.btn-link { padding: 10px 0; border: 0; background: none; color: var(--muted); font: 600 17px var(--body); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) { background: color-mix(in srgb, var(--b) 86%, var(--ink)); transform: translateY(-1px); transition-duration: var(--m-in); }
  .btn-ghost-light:hover { background: rgba(255, 255, 255, .14); }
  .btn-xl:hover:not(:disabled) { transform: translateY(-2px); }
  .btn-link:hover { color: var(--ink); }
}

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  min-height: 64px; padding: 8px var(--gutter); background: var(--pitch-deep); color: #fff; --focus: #fff;
}
.bar-brand { font: 900 26px/1 var(--display); letter-spacing: .03em; text-transform: uppercase; color: #fff; text-decoration: none; }
.bar-back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: #fff; font-weight: 700; text-decoration: none; }
.bar-title { flex: 1; margin: 0; font: 900 24px/1 var(--display); letter-spacing: .04em; text-transform: uppercase; }
.bar-gap { flex: 1; }
.bar-kid { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.bar-stars { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .12); }
.bar-stars .icon { width: 18px; height: 18px; color: var(--gold); }
@media (max-width: 520px) {
  .bar-kid > span:nth-child(2), .bar .btn span, .bar-back span { display: none; }
  .bar-brand { font-size: 22px; }
}

/* ---------- avatars ---------- */
.avatar {
  --av: var(--pitch);
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--av); color: #fff; border: 3px solid #fff; box-shadow: var(--lift);
}
.avatar .icon { width: 54%; height: 54%; stroke-width: 2.2; }
.avatar.on-gold { color: var(--gold-ink); }
.avatar.is-sm { width: 36px; height: 36px; border-width: 2px; box-shadow: none; }
.avatar.is-lg { width: 120px; height: 120px; border-width: 5px; }
.avatar.is-empty { background: #fff; border: 3px dashed var(--line-strong); box-shadow: none; color: var(--muted); font: 900 24px/1 var(--display); }
.avatar.is-empty.is-lg { font-size: 64px; }
.avatar.is-empty.is-sm { font-size: 18px; }

/* ---------- cover: "Who's learning?" ---------- */
.cover {
  min-height: 100svh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 16px; text-align: center; color: #fff; --focus: #fff;
  background-color: var(--pitch);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='132' height='164'%3E%3Crect x='12' y='12' width='108' height='140' rx='14' fill='none' stroke='%23ffffff' stroke-opacity='.08' stroke-width='2' stroke-dasharray='9 8'/%3E%3C/svg%3E");
}
.cover-title { margin: 0; font: 900 clamp(68px, 13vw, 172px)/.84 var(--display); letter-spacing: .01em; text-transform: uppercase; }
.cover-title span { color: var(--gold); }
.cover-sub { margin: 18px 0 0; font-size: clamp(18px, 2.2vw, 22px); color: #E1F2E8; }
.cover-ask { margin: clamp(36px, 7vh, 72px) 0 22px; font: 900 clamp(32px, 4vw, 46px)/1 var(--display); letter-spacing: .05em; text-transform: uppercase; }
.kids { display: grid; grid-template-columns: repeat(3, minmax(0, 232px)); gap: clamp(14px, 3vw, 32px); margin: 0; padding: 0; list-style: none; }
.kid {
  display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 30px 16px 24px;
  border-radius: 18px; background: #fff; color: var(--ink); text-decoration: none; box-shadow: var(--lift);
  transition: transform var(--m-out) var(--ease), box-shadow var(--m-out) var(--ease);
}
.kid:active { transform: translateY(1px) scale(.985); transition-duration: var(--m-press); }
.kid-name { font: 900 48px/1 var(--display); letter-spacing: .02em; text-transform: uppercase; }
.kid-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; color: var(--muted); font-size: 16px; }
.kid-stars { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); font-weight: 700; }
.kid-stars .icon { width: 18px; height: 18px; color: var(--star); }
.cover-note { margin: 30px 0 0; font-size: 15px; color: #CFE9DA; }
@media (hover: hover) and (pointer: fine) {
  .kid:hover { transform: translateY(-2px); box-shadow: var(--lift-hi); transition-duration: var(--m-in); }
}
@media (max-width: 680px) {
  .kids { grid-template-columns: 1fr; width: 100%; max-width: 440px; }
  .kid { flex-direction: row; flex-wrap: wrap; gap: 4px 18px; padding: 16px 20px; text-align: left; }
  .kid .avatar.is-lg { grid-row: span 2; width: 76px; height: 76px; border-width: 4px; }
  .kid { display: grid; grid-template-columns: auto 1fr; align-items: center; }
  .kid-name { font-size: 38px; }
  .kid-meta { justify-content: flex-start; }
}

/* ---------- avatar picker ---------- */
.pick { max-width: 800px; margin: 0 auto; padding: 44px 16px 72px; text-align: center; }
.pick-title { margin: 0; font: 900 clamp(38px, 6vw, 60px)/.95 var(--display); text-transform: uppercase; }
.pick-sub { margin: 12px 0 0; color: var(--muted); }
.avatars { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin: 34px 0 36px; }
.av-choice { padding: 6px; border: 3px solid transparent; border-radius: 50%; background: none; cursor: pointer; transition: transform var(--m-out) var(--ease), border-color var(--m-out) var(--ease); }
.av-choice .avatar.is-lg { width: 100%; height: auto; aspect-ratio: 1; }
.av-choice[aria-checked="true"] { border-color: var(--ink); }
.av-choice:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .av-choice:hover { transform: translateY(-2px); } }
@media (max-width: 600px) { .avatars { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- album ---------- */
.album { padding-bottom: 72px; }
.album-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; max-width: 1440px; margin: 0 auto; padding: 34px var(--gutter) 30px; }
.album-head > div { flex: 1 1 340px; }
.album-title { margin: 0; font: 900 clamp(46px, 6vw, 76px)/.9 var(--display); letter-spacing: .01em; text-transform: uppercase; }
.album-sub { margin: 10px 0 0; color: var(--muted); font-size: 19px; }
.album-done { margin: 0; font-weight: 800; color: var(--ok); }
.got { flex-basis: 100%; display: flex; align-items: center; gap: 12px; margin: 0; padding: 14px 18px; border-radius: 12px; background: var(--ok-bg); color: var(--ok); font-weight: 800; }
.got .icon { width: 22px; height: 22px; }
.got .stars .icon { color: var(--star); }
.page { margin-bottom: 18px; padding: 26px var(--gutter) 32px; background: var(--pitch); color: #fff; --focus: #fff; }
.page-head { display: flex; align-items: center; gap: 18px; max-width: 1440px; margin: 0 auto 20px; }
.page-title { display: flex; align-items: center; gap: 14px; margin: 0; font: 900 clamp(36px, 4.6vw, 52px)/1 var(--display); letter-spacing: .02em; text-transform: uppercase; }
.page-no { order: 2; padding: 6px 10px; border-radius: 6px; background: var(--lv); color: var(--lv-ink); font-size: 16px; letter-spacing: .12em; }
.page-count { margin: 0 0 0 auto; font-size: 20px; font-weight: 800; color: #E1F2E8; }
/* Level badges: flat gold spot ink with the drawn trophy once earned; an empty dashed disc before. */
.badge {
  display: grid; place-items: center; width: 92px; height: 92px; border-radius: 50%; flex: none;
  border: 3px dashed rgba(255, 255, 255, .55); background: rgba(255, 255, 255, .1); color: #E6F4EC;
}
.badge.is-earned { border: 4px solid #fff; background: var(--gold); color: var(--gold-ink); box-shadow: var(--lift); }
.badge.is-new { animation: badge-in 900ms var(--ease) both; }
@keyframes badge-in { from { transform: scale(.6); } to { transform: none; } }
.slots { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 14px; max-width: 1440px; margin: 0 auto; padding: 0; list-style: none; }
.slot { position: relative; display: flex; flex-direction: column; height: 100%; min-height: 182px; border-radius: 14px; color: inherit; text-decoration: none; }
.slot.is-open, .slot.is-locked { justify-content: space-between; padding: 12px; }
.slot.is-open { border: 3px dashed #fff; background: rgba(0, 0, 0, .16); transition: transform var(--m-out) var(--ease), background-color var(--m-out) var(--ease); }
.slot.is-locked { border: 2px dashed rgba(255, 255, 255, .45); color: #D4ECDF; }
.slot-num { font: 900 70px/.85 var(--display); }
.slot.is-locked .slot-num { font-size: 44px; }
.slot-name { font-size: 15px; font-weight: 700; line-height: 1.25; }
.slot-go { align-self: flex-start; margin-top: 8px; padding: 5px 12px; border-radius: 999px; background: #fff; color: var(--pitch-deep); font-size: 14px; font-weight: 800; }
.slot-lock { position: absolute; top: 12px; right: 12px; width: 18px; height: 18px; }
.sticker {
  display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 10px; border-radius: 14px;
  background: #fff; color: var(--ink); box-shadow: var(--lift);
  transition: transform var(--m-out) var(--ease), box-shadow var(--m-out) var(--ease);
}
.st-num { font: 900 22px/1 var(--display); }
.st-art { display: grid; place-items: center; height: 84px; border-radius: 9px; background: var(--lv); color: var(--lv-ink); overflow: hidden; }
.art-t { font: 900 clamp(34px, 3.8vw, 58px)/1 var(--display); letter-spacing: .01em; }
.art-t.is-long { font-size: clamp(26px, 2.7vw, 40px); }
.art-i { width: 46px; height: 46px; stroke-width: 2.25; }
.st-name { font-size: 14px; font-weight: 800; line-height: 1.2; }
.stars { display: inline-flex; gap: 2px; }
.stars .icon { width: 16px; height: 16px; color: var(--star); }
.stars .icon:not(.on) { color: #B9C2BE; }
.slot.is-new .sticker { animation: press 760ms var(--ease) both; }
@keyframes press {
  from { transform: translateY(-22px) scale(1.12); box-shadow: 0 34px 44px -14px rgba(0, 0, 0, .5); }
  60% { transform: none; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
  to { transform: none; box-shadow: var(--lift); }
}
@media (hover: hover) and (pointer: fine) {
  .slot.is-done:hover .sticker { transform: translateY(-2px); box-shadow: var(--lift-hi); transition-duration: var(--m-in); }
  .slot.is-open:hover { transform: translateY(-2px); background: rgba(0, 0, 0, .24); transition-duration: var(--m-in); }
}
.slot:active .sticker, .slot.is-open:active { transform: translateY(1px) scale(.985); transition-duration: var(--m-press); }
@media (max-width: 900px) {
  .slots { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .slot { min-height: 158px; }
  .st-art { height: 64px; }
  .art-t { font-size: clamp(30px, 8vw, 44px); }
  .art-t.is-long { font-size: clamp(22px, 5.6vw, 30px); }
  .art-i { width: 36px; height: 36px; }
  .slot-num { font-size: 52px; }
  .badge { width: 72px; height: 72px; font-size: 12px; }
  .page-head { flex-wrap: wrap; }
}
@media (max-width: 420px) {
  .slots { gap: 8px; }
  .slot.is-open, .slot.is-locked, .sticker { padding: 8px; }
  .slot-name, .st-name { font-size: 13px; }
}

/* ---------- lesson ---------- */
.strip { display: flex; align-items: center; gap: 16px; padding: 10px var(--gutter); background: var(--pitch); color: #fff; }
.strip ol { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; }
.strip li span {
  display: grid; place-items: center; width: 38px; height: 46px; border-radius: 7px;
  border: 2px dashed rgba(255, 255, 255, .45); color: #D4ECDF; font: 900 19px/1 var(--display);
}
.strip li.is-done span { border: 0; border-top: 7px solid var(--lv); background: #fff; color: var(--ink); box-shadow: 0 6px 12px -6px rgba(0, 0, 0, .5); }
.strip li.is-now span { border: 2px dashed #fff; background: rgba(0, 0, 0, .2); color: #fff; }
.strip-name { margin-left: auto; font: 900 22px/1 var(--display); letter-spacing: .05em; text-transform: uppercase; }
@media (max-width: 520px) { .strip ol { gap: 5px; } .strip li span { width: 30px; height: 38px; font-size: 16px; } .strip-name { display: none; } }

.lesson { display: grid; grid-template-columns: minmax(320px, 430px) minmax(0, 1fr); gap: 24px; align-items: start; max-width: 1440px; margin: 0 auto; padding: 24px var(--gutter) 72px; }
.step-card {
  position: sticky; top: 88px; display: flex; flex-direction: column; gap: 18px; padding: 28px;
  border: 1px solid var(--line); border-radius: 16px; background: #fff;
}
.step-title { margin: 0; font: 900 clamp(34px, 3.3vw, 46px)/.94 var(--display); letter-spacing: .01em; text-transform: uppercase; }
.step-title:focus { outline: none; }
.dots { display: flex; align-items: center; gap: 6px; }
.dots span { width: 28px; height: 8px; border-radius: 4px; background: var(--line); }
.dots .is-done { background: var(--pitch); }
.dots .is-now { background: var(--ink); }
.dots b { margin-left: 8px; color: var(--muted); font-size: 15px; }
.say { margin: 0; font-size: 21px; line-height: 1.55; }
.step-tools { display: flex; flex-wrap: wrap; gap: 10px; }
.hint { margin: 0; padding: 14px 16px; border-radius: 12px; background: var(--note-bg); font-size: 18px; }
.quiz { display: grid; gap: 10px; }
.quiz-opt {
  padding: 14px 16px; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink);
  font: 600 18px/1.3 var(--body); text-align: left; cursor: pointer;
  transition: border-color var(--m-out) var(--ease), background-color var(--m-out) var(--ease), transform var(--m-out) var(--ease);
}
.quiz-opt:active { transform: translateY(1px) scale(.985); }
.quiz-opt.is-right { border-color: var(--pitch); background: var(--ok-bg); }
.quiz-opt.is-wrong { border-color: #D9A75F; background: var(--warn-bg); }
@media (hover: hover) and (pointer: fine) { .quiz-opt:hover { border-color: var(--line-strong); transform: translateY(-1px); } }
.feedback { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 12px; font-size: 18px; }
.feedback:empty { display: none; }
.feedback .icon { width: 22px; height: 22px; margin-top: 2px; }
.feedback.is-ok { background: var(--ok-bg); color: var(--ok); font-weight: 650; }
.feedback.is-wrong { background: var(--warn-bg); color: var(--warn); }
.feedback.is-note { background: var(--note-bg); }
.btn-next { align-self: flex-start; }
.work { min-width: 0; }
@media (max-width: 960px) {
  .lesson { grid-template-columns: minmax(0, 1fr); padding-top: 16px; }
  .step-card { position: static; padding: 22px; }
}

/* ---------- practice sheet ---------- */
.sheet { position: relative; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.sheet-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.tool {
  display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 7px 12px;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
  font: 700 15px/1 var(--body); cursor: pointer;
  transition: background-color var(--m-out) var(--ease), border-color var(--m-out) var(--ease), transform var(--m-out) var(--ease);
}
.tool .icon { width: 18px; height: 18px; }
.tool:active { transform: translateY(1px) scale(.985); transition-duration: var(--m-press); }
.tool[aria-pressed="true"] { border-color: var(--pitch); background: var(--ok-bg); color: var(--pitch-night); }
.tool-mark { font: 900 17px/1 var(--display); letter-spacing: .05em; }
.tool-group { display: inline-flex; gap: 4px; }
.tool-icon { padding: 7px 10px; }
.tool-spacer { flex: 1; }
@media (hover: hover) and (pointer: fine) { .tool:hover { border-color: var(--line-strong); background: #EEF2F0; transform: translateY(-1px); transition-duration: var(--m-in); } }
.fbar { display: flex; align-items: stretch; height: 48px; margin-bottom: 12px; border: 1.5px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.namebox { display: grid; place-items: center; min-width: 78px; padding: 0 10px; border-right: 1.5px solid var(--line); background: #F5F8F6; font: 700 16px/1 var(--mono); }
.fx { display: grid; place-items: center; padding: 0 12px; border-right: 1.5px solid var(--line); color: var(--muted); font-style: italic; font-weight: 700; }
.finput { flex: 1; min-width: 0; padding: 0 12px; border: 0; background: #fff; color: var(--ink); font: 400 18px/1 var(--mono); }
.finput:focus { outline: none; box-shadow: inset 0 0 0 3px var(--focus); }
.sheet-error { margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); font-size: 16px; }
.grid-wrap { position: relative; max-width: 100%; overflow: auto; border: 1.5px solid var(--line-strong); border-radius: 10px; background: #fff; overscroll-behavior-x: contain; }
.grid-wrap:focus { outline: none; }
.grid-wrap:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.grid { border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 17px; user-select: none; -webkit-user-select: none; }
.grid th, .grid td { height: 42px; padding: 0 10px; overflow: hidden; white-space: nowrap; border-right: 1px solid #E2E8E4; border-bottom: 1px solid #E2E8E4; }
.grid thead th { position: sticky; top: 0; z-index: 2; height: 34px; background: #EFF3F0; color: var(--muted); font-size: 14px; font-weight: 700; text-align: center; }
.grid tbody th { position: sticky; left: 0; z-index: 1; padding: 0; background: #EFF3F0; color: var(--muted); font-size: 14px; font-weight: 700; text-align: center; }
.grid .corner { left: 0; z-index: 3; }
.grid th.on { background: #CDE7D8; color: var(--pitch-night); }
.grid td { background: #fff; color: var(--ink); cursor: cell; font-variant-numeric: tabular-nums; }
.grid td.is-num { text-align: right; }
.grid td.is-mid { text-align: center; }
.grid td.al-left { text-align: left; }
.grid td.al-center { text-align: center; }
.grid td.al-right { text-align: right; }
.grid td.is-bold { font-weight: 800; }
.grid td.in-sel { background: #E5F2EA; }
.grid td.is-err { color: #A11B1E; font-weight: 700; }
.grid td.is-hit { background: var(--hit-bg) !important; color: var(--hit-ink); }
.sel-box { position: absolute; z-index: 4; border: 2px solid var(--pitch); pointer-events: none; }
.sel-box.is-fill { border-style: dashed; }
.handle { position: absolute; z-index: 5; width: 12px; height: 12px; margin: -7px 0 0 -7px; border: 2px solid #fff; background: var(--pitch); cursor: crosshair; touch-action: none; }
.resize { position: absolute; top: 0; right: -6px; z-index: 3; width: 12px; height: 100%; cursor: col-resize; touch-action: none; }
.resize:hover { background: linear-gradient(var(--pitch), var(--pitch)) center / 2px 100% no-repeat; }
@media (pointer: coarse) {
  .handle { width: 24px; height: 24px; margin: -12px 0 0 -12px; border-width: 3px; border-radius: 50%; }
  .resize { right: -12px; width: 24px; }
}
.fbtn {
  position: absolute; top: 50%; right: 4px; width: 26px; height: 26px; transform: translateY(-50%);
  display: grid; place-items: center; padding: 0; border: 1px solid var(--line-strong); border-radius: 6px;
  background: #fff; color: var(--ink); cursor: pointer;
}
.fbtn .icon { width: 15px; height: 15px; }
.fbtn.is-on { border-color: var(--pitch); background: var(--pitch); color: #fff; }
.vbtn { position: absolute; z-index: 6; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; cursor: pointer; }
.vbtn .icon { width: 16px; height: 16px; }
.cell-editor {
  position: absolute; z-index: 7; padding: 0 9px; border: 2px solid var(--pitch); outline: none;
  background: #fff; color: var(--ink); font: 400 17px/1 var(--body); box-shadow: 0 8px 18px -8px rgba(0, 0, 0, .3);
}
.pop {
  position: absolute; z-index: 30; min-width: 230px; max-width: min(360px, 92vw); padding: 14px;
  border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; box-shadow: 0 18px 40px -12px rgba(18, 20, 23, .35);
}
.pop-title { margin: 0 0 10px; font-size: 16px; font-weight: 800; }
.swatches { display: flex; gap: 8px; }
.swatch { width: 42px; height: 42px; padding: 0; border: 2px solid rgba(0, 0, 0, .14); border-radius: 10px; cursor: pointer; }
.swatch.is-none { display: grid; place-items: center; background: #fff; }
.cf-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cf-form select, .cf-form input { height: 42px; padding: 0 10px; border: 1.5px solid var(--line-strong); border-radius: 8px; background: #fff; font: 600 16px var(--body); }
.cf-form input { width: 96px; }
.checks { display: grid; gap: 4px; max-height: 240px; margin-bottom: 12px; overflow: auto; }
.checks label { display: flex; align-items: center; gap: 10px; min-height: 38px; font-size: 17px; }
.checks input { width: 20px; height: 20px; accent-color: var(--pitch); }
.pop-actions { display: flex; gap: 8px; }
.picks { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.picks button { width: 100%; min-height: 42px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; font: 600 17px var(--body); text-align: left; cursor: pointer; }
.pivot { margin-top: 16px; padding: 16px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: #F7FAF8; }
.pivot-title { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font: 900 26px/1 var(--display); letter-spacing: .03em; text-transform: uppercase; }
.pivot-fields { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-bottom: 14px; }
.pivot-fields label { display: flex; flex-direction: column; gap: 6px; font-size: 15px; font-weight: 700; }
.pivot-fields select { height: 44px; min-width: 170px; padding: 0 10px; border: 1.5px solid var(--line-strong); border-radius: 8px; background: #fff; font: 600 17px var(--body); }
.pivot-table { min-width: 280px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.pivot-table th, .pivot-table td { padding: 8px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.pivot-table th + th, .pivot-table td + td { text-align: right; }
.pivot-table thead th { background: #DCEFE4; }
.pivot-total td { border-top: 2px solid var(--ink); font-weight: 800; }
.pivot-empty { margin: 0; color: var(--muted); }

/* ---------- real Excel missions ---------- */
.mission { display: grid; justify-items: start; gap: 18px; padding: 28px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.mission-title { display: flex; align-items: center; gap: 12px; margin: 0; font: 900 clamp(32px, 3vw, 42px)/1 var(--display); text-transform: uppercase; }
.mission-title .icon { width: 38px; height: 38px; color: var(--pitch); }
.mission-where { margin: 0; color: var(--muted); }
.mission-steps { display: grid; gap: 10px; max-width: 62ch; margin: 0; padding-left: 26px; font-size: 19px; line-height: 1.5; }
.mission-answer { display: grid; gap: 8px; }
.mission-answer label { font-weight: 800; }
.mission-row { display: flex; flex-wrap: wrap; gap: 10px; }
.mission-row input { width: 230px; min-width: 0; height: 52px; padding: 0 14px; border: 2px solid var(--line-strong); border-radius: 12px; font: 600 20px var(--body); }
.mission-row input:focus { outline: 3px solid var(--focus); outline-offset: 1px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}

/* ---------- refinements after the first look ---------- */
code { box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.say { line-height: 1.65; }
.btn-red:disabled { --b: #DCE2DF; --bt: #5E6763; box-shadow: none; opacity: 1; }
.slot.is-locked { color: #E6F4EC; border-color: rgba(255, 255, 255, .5); }
.sticker .stars { margin-top: auto; }
.badge .icon { width: 42%; height: 42%; stroke-width: 2.2; color: #2a1f04; }
.album-who { display: flex; align-items: center; gap: 22px; }
.album-who .avatar.is-lg { width: 96px; height: 96px; }
@media (max-width: 600px) { .album-who { gap: 14px; } .album-who .avatar.is-lg { width: 64px; height: 64px; border-width: 4px; } }
@media (max-width: 900px) {
  .slot.is-locked .slot-num { font-size: 38px; }
  .slot-lock { top: 9px; right: 8px; width: 15px; height: 15px; }
}
@media (max-width: 480px) {
  .page-no { display: none; }
  .badge { width: 56px; height: 56px; border-width: 3px; }
  .page-count { font-size: 18px; }
}
.grid-wrap { width: fit-content; }
/* The grab strip sits inside its own header cell: the next header would cover anything that sticks out. */
.resize { right: 0; width: 12px; }
@media (pointer: coarse) { .resize { right: 0; width: 22px; } }
[hidden] { display: none !important; }
.grid td.has-fbtn { position: relative; padding-right: 36px; }
/* PivotTable beside the grid on wide sheets, like Excel's field list; below it on phones. */
.sheet.has-pivot-side .sheet-body { display: flex; align-items: flex-start; gap: 16px; }
.sheet.has-pivot-side .grid-wrap { flex: 0 1 auto; min-width: 0; }
.sheet.has-pivot-side .pivot { flex: 1 1 300px; margin-top: 0; }
.sheet.has-pivot-side .pivot-fields { flex-direction: column; }
.sheet.has-pivot-side .pivot-fields select { width: 100%; }
.sheet.has-pivot-side .pivot-table { width: 100%; min-width: 0; }

/* ---------- finish-review fixes ---------- */
/* Red marks only each screen's main action; at 19px bold, white on it counts as large text and passes. */
.btn-red:not(.btn-xl):not(.btn-small) { font-size: 19px; }
.btn-ink { --b: var(--ink); --bt: #fff; }

/* Continue sits right under the current page's slots. */
.page-go { max-width: 1440px; margin: 22px auto 0; }

/* Hover and press on the controls that had neither. */
.fbtn, .swatch, .vbtn, .picks button, .checks label, .pivot-fields select, .cf-form select, .cf-form input, .btn-link, .bar-back, .bar-brand {
  transition: background-color var(--m-out) var(--ease), border-color var(--m-out) var(--ease), transform var(--m-out) var(--ease), color var(--m-out) var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .fbtn:hover { border-color: var(--ink); background: #EEF2F0; transition-duration: var(--m-in); }
  .fbtn.is-on:hover { background: var(--pitch-deep); }
  .swatch:hover { transform: translateY(-1px); border-color: rgba(0, 0, 0, .35); transition-duration: var(--m-in); }
  .vbtn:hover, .picks button:hover { border-color: var(--ink); background: #EEF2F0; transition-duration: var(--m-in); }
  .checks label:hover { background: #F2F5F3; }
  .pivot-fields select:hover, .cf-form select:hover, .cf-form input:hover { border-color: var(--ink); transition-duration: var(--m-in); }
  .bar-back:hover span, .bar-brand:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
}
.fbtn:active { transform: translateY(-50%) scale(.92); transition-duration: var(--m-press); }
.swatch:active, .vbtn:active, .picks button:active { transform: translateY(1px) scale(.97); transition-duration: var(--m-press); }
.checks label { padding: 0 6px; border-radius: 8px; }
.checks label:active { background: #E6EDE9; }
.pivot-fields select:active, .cf-form select:active { background-color: #F2F5F3; }
.btn-link:active { transform: scale(.985); }

/* Selects drawn in the app's own style, with the icon set's chevron instead of the platform's. */
.pivot-fields select, .cf-form select {
  appearance: none; -webkit-appearance: none; padding-right: 38px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23121417' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 18px;
}

/* Phones: three stickers a row so the real names fit without awkward breaks. */
@media (max-width: 600px) { .slots { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.slot-name, .st-name { overflow-wrap: break-word; hyphens: manual; }
