/* Next Bite: Hand-Made Zine brand layer on top of peak.css. Tokens only, no hex outside the brand block. */

[data-brand="nextbite"] {
  --font-display: "Caveat", "Brush Script MT", cursive;
  --font-body: "Work Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --r-sm: 4px; --r-md: 8px; --r-lg: 12px; --r-xl: 20px;
  --marker: #FFD84D; --teal: #0F766E; --paper-line: rgb(60 40 20 / .07);
  --sticker-edge: #FFFFFF; --ink-fixed: #1F1A17;
  --tab-h: 64px;
}
[data-brand="nextbite"][data-theme="light"] {
  --bg: #FBF7EE; --surface: #FFFFFF; --surface-2: #F3ECDD;
  --ink: #1F1A17; --ink-2: #5A4E46; --ink-3: #6F6258;
  --accent: #C2410C; --accent-2: var(--teal); --on-accent: #FFFFFF;
  --line: rgb(31 26 23 / .14); --line-strong: rgb(31 26 23 / .3);
  --accent-soft: color-mix(in oklab, var(--accent) 12%, transparent);
}
[data-brand="nextbite"][data-theme="dark"] {
  --bg: #1B1714; --surface: #26201C; --surface-2: #312923;
  --ink: #F5EDE0; --ink-2: #CBBDAB; --ink-3: #A89B8D;
  --accent: #FF8A4C; --accent-2: #5EEAD4; --on-accent: #1F0E04;
  --line: rgb(245 237 224 / .14); --line-strong: rgb(245 237 224 / .3); --paper-line: rgb(255 255 255 / .04);
  --sh-1: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px -10px rgb(0 0 0 / .55);
  color-scheme: dark;
}
[data-brand="nextbite"][data-theme="light"] { color-scheme: light; }

/* ---------- base ---------- */
html { scroll-padding-bottom: 120px; }
body {
  overflow-x: clip; min-height: 100dvh;
  background-color: var(--bg);
  background-image: radial-gradient(rgb(0 0 0 / .025) 1px, transparent 1px);
  background-size: 6px 6px;
}
body[data-route="today"]:not(.is-onboarding), body[data-route="chain"]:not(.is-onboarding) {
  background-image: repeating-linear-gradient(transparent 0 31px, var(--paper-line) 31px 32px), radial-gradient(rgb(0 0 0 / .025) 1px, transparent 1px);
  background-size: auto, 6px 6px;
}
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -64px; z-index: 200; background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: var(--r-md); }
.skip:focus { top: 8px; }
.small { font-size: var(--t-sm); }
.big { font: 600 32px/1 var(--font-mono); font-variant-numeric: tabular-nums; }
h1, h2, h3 { letter-spacing: 0; }
h2, h3 { font-family: var(--font-body); }
button { font: inherit; color: inherit; }
p { max-width: none; }
.noscript { padding: 16px; }

.app { max-width: 480px; margin-inline: auto; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 4px;
}
.screen-title { font: 700 36px/1.1 var(--font-display); margin: 0; }
.page { padding: 8px 16px calc(var(--tab-h) + env(safe-area-inset-bottom) + 24px); min-width: 0; outline: none; }
.page > * + * { margin-top: 16px; }
.is-onboarding .topbar, .is-onboarding .tabbar { display: none; }
.is-onboarding .page { padding-top: calc(24px + env(safe-area-inset-top)); padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.stack > * + * { margin-top: 16px; }
.stack-s > * + * { margin-top: 8px; }
.stack p, .stack-s p, .tile p, .card p { margin-bottom: 0; }

.profile-btn { width: 48px; height: 48px; display: grid; place-items: center; background: none; border: 0; cursor: pointer; border-radius: 50%; }
.profile-dot { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--ink); font: 700 24px/1 var(--font-display); }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; inset: auto 0 0; z-index: 60; max-width: 480px; margin-inline: auto;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
.tab {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 48px; color: var(--ink-2); text-decoration: none;
}
.tab-label { font: 600 12px/1.2 var(--font-body); }
.tab-line { position: absolute; bottom: 3px; opacity: 0; }
.tab-line path { stroke: var(--marker); }
.tab[aria-current="page"] { color: var(--accent); }
.tab[aria-current="page"] .tab-line { opacity: 1; }
.tab.bump svg:first-child { animation: bump .6s var(--ease-spring); }
@keyframes bump { 30% { transform: scale(1.45) rotate(-8deg); } 100% { transform: none; } }

/* ---------- buttons, inputs, shared ---------- */
.btn { text-align: center; }
.btn.block { width: 100%; }
.btn-ghost { background: var(--surface); }
.btn-ghost.done { border-color: var(--accent-2); }
.btn-danger { background: var(--surface); border-color: var(--bad); color: var(--ink); }
.text-btn { min-height: 48px; padding: 0 12px; background: none; border: 0; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.icon-btn { width: 48px; height: 48px; display: grid; place-items: center; background: none; border: 0; border-radius: var(--r-md); color: var(--ink); cursor: pointer; flex: none; }
.step-btn { width: 48px; height: 48px; display: grid; place-items: center; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; flex: none; }
.step-btn:active { transform: scale(.95); }
.row { display: flex; gap: 8px; align-items: stretch; }
.row > .input { flex: 1; min-width: 0; }
.row-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.row-2 > * { min-width: 0; }
.input.file { padding: 10px 12px; }
.input { width: 100%; min-width: 0; }
.field { min-width: 0; }
.err { color: var(--ink); font-size: var(--t-sm); font-weight: 600; border-left: 4px solid var(--bad); padding-left: 8px; margin: 0; }
.input[aria-invalid="true"] { border-color: var(--bad); }
.inline-form { display: flex; gap: 8px; margin-top: 8px; }
.inline-form .input { flex: 1; min-width: 0; }
.section-h { font: 700 18px/1.2 var(--font-body); margin: 0 0 8px; }
.sec-title { font: 700 18px/1.2 var(--font-body); margin: 0 0 8px; }
.label-hand { font: 700 24px/1 var(--font-display); }
.list-label { font: 700 22px/1 var(--font-display); padding-top: 8px; }
.card { border-radius: var(--r-lg); padding: 16px; min-width: 0; }
.empty { text-align: center; color: var(--ink-2); }
.check { display: flex; align-items: center; gap: 12px; min-height: 48px; cursor: pointer; }
.check input { width: 24px; height: 24px; accent-color: var(--accent); flex: none; }
.row-main { display: grid; min-width: 0; gap: 2px; }
.row-main strong { overflow-wrap: anywhere; }

.fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.fieldset legend { font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); padding: 0; margin-bottom: 8px; }
.card.fieldset { padding: 16px; border: 1px solid var(--line); }
.choices { display: grid; gap: 8px; }
.choice, .seg-opt {
  display: flex; align-items: center; min-height: 48px; padding: 8px 14px; border: 1px solid var(--line-strong);
  border-radius: var(--r-md); background: var(--surface); cursor: pointer;
}
.choice-body { display: grid; }
.choice:has(input:checked), .seg-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.choice:has(input:focus-visible), .seg-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-opt { font-weight: 600; flex: 1 1 auto; justify-content: center; }

/* ---------- sheets (dialog) ---------- */
dialog.sheet {
  margin: auto auto 0; padding: 0; width: 100%; max-width: 480px; max-height: 90dvh; overflow: auto;
  background: var(--bg); color: var(--ink); border: 1px solid var(--line-strong); border-bottom: 0;
  border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--sh-2); overscroll-behavior: contain;
  animation: sheet-up var(--d-base) var(--ease);
}
dialog.sheet.sheet-tall { height: 90dvh; }
dialog.sheet::backdrop, dialog.sticker-overlay::backdrop { background: rgb(20 12 6 / .55); }
body:has(dialog[open]) { overflow: hidden; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
.sheet-grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 10px auto 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 8px 0 16px; position: sticky; top: 0; background: var(--bg); z-index: 1; }
.sheet-title { font: 700 20px/1.2 var(--font-body); margin: 0; }
.sheet-body { padding: 8px 16px calc(24px + env(safe-area-inset-bottom)); }
.sheet-body > * + * { margin-top: 16px; }

.toast {
  position: fixed; inset: auto 16px calc(var(--tab-h) + env(safe-area-inset-bottom) + 16px); margin: 0 auto; width: auto; height: auto;
  max-width: 440px; overflow: visible; padding: 12px 16px; border: 0; border-radius: var(--r-md);
  background: var(--ink); color: var(--bg); font-weight: 500; box-shadow: var(--sh-2);
}
.toast:not(.show) { display: none; }
.toast.show { display: block; }

/* ---------- onboarding ---------- */
.onb > * + * { margin-top: 16px; }
.onb-title { font: 700 36px/1.1 var(--font-display); margin: 0; outline: none; }
.onb .lede { margin-bottom: 8px; }
.dashes { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0; color: var(--line-strong); }
.dashes li.on { color: var(--accent); }
.onb-actions { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding-top: 8px; }
.onb-actions .btn-primary { flex: 1; max-width: 280px; margin-left: auto; }
.note-card { background: var(--surface); }
.pick-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 16px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-weight: 500; max-width: 100%; }
.pick.on { background: var(--accent-soft); border-color: var(--accent); font-weight: 600; }
.pick.strike.on { background: var(--surface-2); border-color: var(--ink-2); }
.pick.strike.on .pick-name { text-decoration: line-through; text-decoration-thickness: 2px; }
.pick-name { overflow-wrap: anywhere; text-align: left; }

/* ---------- today ---------- */
.coach {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 22px 18px 18px; margin-top: 12px; transform: rotate(-1deg); box-shadow: var(--sh-1);
}
.tape { position: absolute; top: -11px; left: 50%; width: 84px; height: 22px; transform: translateX(-50%) rotate(2deg); background: color-mix(in oklab, var(--marker) 85%, transparent); box-shadow: 0 1px 2px rgb(0 0 0 / .15); }
.coach-head { font: 700 32px/1.1 var(--font-display); margin: 0 0 8px; padding-right: 72px; color: var(--ink); }
.coach-line { font: 600 24px/1.25 var(--font-display); margin: 0 0 6px; color: var(--ink); }
.coach-line.nudge { color: var(--accent); }
.stamp { position: absolute; right: 12px; top: 14px; width: 64px; height: 64px; border-radius: 50%; border: 3px double var(--accent); color: var(--accent); display: grid; place-content: center; text-align: center; transform: rotate(9deg); font-family: var(--font-display); line-height: 1; }
.stamp b { font: 700 24px/1 var(--font-mono); }
.stamp i { font: 700 16px/1 var(--font-display); font-style: normal; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; min-width: 0; display: grid; gap: 8px; align-content: start; }
.tile.span-2 { grid-column: span 2; }
.tile h2 { margin: 0; }
.tile-num { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; margin: 0; }
.meter { height: 10px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.meter-fill { display: block; height: 100%; width: var(--pct, 0%); background: var(--accent); border-radius: 5px; }
.meter.teal .meter-fill { background: var(--accent-2); }
.water { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.water .tile-num { order: -1; width: 100%; }
.swap { font-size: var(--t-lg); }
.swap .arrow { color: var(--accent); font-weight: 700; }
.log-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 4px; }
.log-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px dashed var(--line); padding: 4px 0; }
.card .btn { margin-top: 4px; }
.close-bar {
  position: sticky; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 8px); z-index: 20;
  padding: 8px 0; background: linear-gradient(transparent, var(--bg) 40%);
}
.closed-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 8px 12px; }
.closed-msg { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; }
.habits-note { margin: 0; }

/* ---------- scan ---------- */
.cam { position: relative; aspect-ratio: 4 / 5; max-height: 56dvh; width: 100%; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.cam-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.cam.live .cam-video { opacity: 1; }
.cam-poster { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 16px; padding: 32px; text-align: center; }
.cam.live .cam-poster { display: none; }
.cam-hand { font: 700 28px/1.15 var(--font-display); margin: 0; }
.br { position: absolute; width: 30px; height: 30px; border: 0 solid var(--marker); pointer-events: none; z-index: 2; }
.br.tl { top: 14px; left: 14px; border-width: 4px 0 0 4px; border-top-left-radius: 6px; }
.br.tr { top: 14px; right: 14px; border-width: 4px 4px 0 0; border-top-right-radius: 6px; }
.br.bl { bottom: 14px; left: 14px; border-width: 0 0 4px 4px; border-bottom-left-radius: 6px; }
.br.brr { bottom: 14px; right: 14px; border-width: 0 4px 4px 0; border-bottom-right-radius: 6px; }
.cam-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 12px; }
.cam-controls .btn { padding-inline: 12px; gap: 6px; white-space: nowrap; }
.cam-controls .btn[hidden] { display: none; }
.cam-btn[aria-pressed="true"] { background: var(--marker); color: var(--ink-fixed); border-color: var(--marker); }
.scan-status { min-height: 1.5em; margin: 0; color: var(--ink-2); }
.result-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.row-btn { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 8px 14px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; }
.add-pill { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--accent); flex: none; }
.result-head { display: flex; gap: 12px; align-items: center; }
.result-img { width: 64px; height: 64px; object-fit: contain; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); flex: none; }
.result-name { font: 700 20px/1.2 var(--font-body); margin: 0; overflow-wrap: anywhere; }
.result-line { font-size: var(--t-lg); margin: 0; }
.fill-row, .stepper-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dots { display: flex; gap: 6px; }
.dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink-2); }
.dot.on { background: var(--accent-2); border-color: var(--accent-2); }
.nova { margin: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.stepper { display: flex; align-items: center; gap: 12px; }
.step-val { min-width: 3ch; text-align: center; font: 600 24px/1 var(--font-mono); }
.total { margin: 0; color: var(--ink-2); }

/* ---------- food chain ---------- */
.segmented { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--surface-2); border-radius: var(--r-md); border: 1px solid var(--line); }
.segmented button { min-height: 48px; border: 1px solid transparent; border-radius: var(--r-sm); background: none; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.segmented button[aria-selected="true"] { background: var(--surface); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--sh-1); }
#seg-panel { margin-top: 16px; min-width: 0; }
.shelf-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.shelf-grid li { min-width: 0; }
.sticker-btn { display: block; width: 100%; padding: 0; background: none; border: 0; cursor: pointer; }
.sticker-solo { width: 160px; margin-inline: auto; }
.sticker {
  --tone: var(--surface-2);
  aspect-ratio: 1; width: 100%; display: grid; place-content: center; justify-items: center; gap: 2px; padding: 6px;
  background: color-mix(in oklab, var(--tone) 38%, var(--surface)); color: var(--ink);
  border: 4px solid var(--sticker-edge); border-radius: 38% 62% 55% 45% / 48% 42% 58% 52%; box-shadow: var(--sh-1); text-align: center; min-width: 0;
}
.sticker:not(.earned) { box-shadow: none; border-style: dashed; border-color: var(--line-strong); background: var(--surface); }
.sticker.earned { transform: rotate(-2deg); }
.sticker-btn:nth-child(even) .sticker.earned, li:nth-child(even) .sticker.earned { transform: rotate(2deg); }
.sticker-letter { font: 700 44px/1 var(--font-display); }
.sticker-name { font: 600 12px/1.15 var(--font-body); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 100%; }
.g-protein { --tone: var(--accent-2); } .g-carb { --tone: var(--marker); } .g-veg { --tone: var(--good); }
.g-fruit { --tone: var(--accent); } .g-dairy { --tone: var(--ink-3); } .g-snack { --tone: var(--marker); }
.g-drink { --tone: var(--accent-2); } .g-fat { --tone: var(--warn); }
.chain-path { list-style: none; padding: 0; margin: 0; display: grid; gap: 20px; }
.node { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 14px; border-radius: var(--r-md); font-weight: 600; width: 100%; text-align: left; }
.node.filled { background: var(--accent-soft); border: 2px solid var(--accent); }
.node.locked { background: transparent; border: 2px dashed var(--ink-2); cursor: pointer; }
.link { height: 22px; margin-left: 28px; border-left: 3px dashed var(--ink-3); }
.link-why { margin: 6px 0 0 8px; }
.verdicts { display: grid; gap: 12px; }
.meal-name { font: 700 18px/1.2 var(--font-body); margin: 0 0 4px; }
.meal > * + * { margin-top: 8px; }
.steps { padding-left: 20px; margin: 8px 0 0; }
summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; font-weight: 600; }
.groc { list-style: none; padding: 0; margin: 0; }

/* ---------- progress ---------- */
.week-strip { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.week-strip li { display: grid; justify-items: center; gap: 4px; }
.day-dot { width: 36px; height: 36px; border-radius: 50%; border: 2px dashed var(--line-strong); display: grid; place-items: center; }
.week-strip .closed .day-dot { background: var(--marker); border: 2px solid var(--ink-fixed); color: var(--ink-fixed); }
.week-strip .today .day-dot { border-style: solid; border-color: var(--accent); }
.stat-row { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.streak-stamp { width: 96px; height: 96px; border-radius: 50%; border: 4px double var(--accent); color: var(--accent); display: grid; place-content: center; text-align: center; transform: rotate(-7deg); }
.streak-stamp b { font: 700 36px/1 var(--font-mono); }
.streak-stamp i { font: 700 18px/1 var(--font-display); font-style: normal; }
.stat-card { display: grid; gap: 8px; }
.chart { width: 100%; height: auto; overflow: visible; }
.bar { fill: var(--accent); } .bar-protein { fill: var(--accent-2); } .bar-steps { fill: var(--marker); stroke: var(--ink-3); stroke-width: 1; }
.bar-empty { fill: var(--line-strong); }
.bar-val { font: 600 12px var(--font-mono); fill: var(--ink); }
.bar-lab { font: 500 12px var(--font-mono); fill: var(--ink-3); }
.goal-line { stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 5 4; }
.pace-band { fill: color-mix(in oklab, var(--accent-2) 22%, transparent); }
.wline { stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.wdot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }

/* ---------- profile ---------- */
.prof-sec > * + * { margin-top: 12px; }
.targets { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
details.card > summary { margin: -8px 0 0; font-weight: 700; }
details.card[open] > summary { margin-bottom: 12px; }

/* ---------- sticker peel ---------- */
dialog.sticker-overlay { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgb(20 12 6 / .9); color: #fff; }
dialog.sticker-overlay[open] { display: grid; place-items: center; }
.sticker-stage { display: grid; justify-items: center; gap: 20px; padding: 24px; text-align: center; color: var(--ink-fixed); }
.sticker-stage .cam-hand, .sticker-stage .muted { color: var(--sticker-edge); }
.sticker-stage.fade-in { animation: fade-in var(--d-fast) linear; }
@keyframes fade-in { from { opacity: 0; } }
.peel { --peel: 0; position: relative; width: min(66vw, 240px); aspect-ratio: 1; touch-action: none; }
.sticker-backing { position: absolute; inset: 0; background: var(--surface-2); border-radius: var(--r-lg); box-shadow: var(--sh-3); border: 1px solid var(--line); }
.peel .sticker {
  position: absolute; inset: 0; width: 100%; height: 100%; transform: none; padding: 12px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--peel) * 50%), calc(100% - var(--peel) * 50%) 100%, 0 100%);
}
.peel .sticker-letter { font-size: 96px; }
.peel .sticker-name { font-size: 18px; }
.fold {
  position: absolute; right: 0; bottom: 0; width: calc(var(--peel) * 50%); height: calc(var(--peel) * 50%);
  clip-path: polygon(100% 0, 0 100%, 0 0);
  background: linear-gradient(135deg, color-mix(in oklab, var(--sticker-edge) 80%, var(--marker)), color-mix(in oklab, var(--surface-2) 70%, var(--ink-3)));
  filter: drop-shadow(-2px -2px 3px rgb(0 0 0 / .3));
}
.peel-handle { position: absolute; right: -8px; bottom: -8px; width: 64px; height: 64px; background: none; border: 0; border-radius: 50%; cursor: grab; z-index: 3; touch-action: none; }
.peel-handle:focus-visible { outline: 3px solid var(--marker); }
.peel.released .sticker { clip-path: none; }
.peel.released .fold, .peel.released .sticker-backing, .peel.released .peel-handle { display: none; }

@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .app { max-width: 480px; }
}
@media (prefers-reduced-motion: reduce) {
  .coach, .sticker.earned { transform: none; }
}
.choice:has(input:checked) .muted, .pick.on .muted { color: var(--ink-2); }
