:root {
  --bg: #fbf5ec;
  --card: #fffdf9;
  --ink: #2a1f17;
  --ink-2: #6b5d50;
  --line: #e8dccb;
  --brand: #ef6f4c;
  --brand-ink: #fff;
  --brand-deep: #c4502f;
  --blue: #2b6cb0;
  --ok: #2f7d4f;
  --warn: #a86a00;
  --bad: #c2362b;
  --ok-bg: #e5f3ea;
  --warn-bg: #fbefd6;
  --bad-bg: #fbe3df;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 8px 24px rgba(60, 40, 20, .07);
  --radius: 16px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1714;
    --card: #24201c;
    --ink: #f3ebe0;
    --ink-2: #b7a998;
    --line: #3a332c;
    --brand: #f28463;
    --brand-ink: #1a1714;
    --brand-deep: #f6a183;
    --blue: #7fb2ec;
    --ok: #79c995;
    --warn: #e9b456;
    --bad: #f08a7f;
    --ok-bg: #1f3227;
    --warn-bg: #3a2f1a;
    --bad-bg: #3d221f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); }
a { color: var(--brand-deep); }
button, input { font: inherit; color: inherit; }
.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-2); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.top { padding-top: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 20px; }
.b-body { fill: var(--brand); }
.b-lens { fill: var(--card); }
.b-ink { fill: var(--ink); }

.hero { padding: 36px 0 8px; }
.hero h1 { font-size: clamp(28px, 5vw, 42px); line-height: 1.12; margin: 0 0 12px; letter-spacing: -.01em; max-width: 18ch; }
.lede { font-size: 18px; color: var(--ink-2); margin: 0; max-width: 60ch; }

.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin: 22px 0; }
.step h2 { font-size: 20px; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-size: 15px; flex: none; }
.hint { margin: -4px 0 14px; color: var(--ink-2); }
.c-top { color: var(--blue); }
.c-chin { color: var(--brand-deep); }
.small { font-size: 14px; color: var(--ink-2); }

.docs { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.doc { position: relative; display: grid; grid-template-columns: 52px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 12px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--bg); }
.doc input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.doc:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, var(--card)); }
.doc:has(input:focus-visible) { outline: 3px solid var(--blue); outline-offset: 2px; }
.doc-shape { grid-row: 1 / 3; justify-self: center; border: 2px solid var(--ink-2); border-radius: 3px; background: linear-gradient(to bottom, transparent 18%, color-mix(in srgb, var(--ink-2) 25%, transparent) 18% 70%, transparent 70%); }
.doc-name { font-weight: 650; line-height: 1.25; }
.doc-size { font-size: 13px; color: var(--ink-2); }

.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 140px; border: 2px dashed var(--line); border-radius: 14px; cursor: pointer; text-align: center; padding: 20px; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, transparent); }
.drop:focus-within { outline: 3px solid var(--blue); outline-offset: 2px; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-big { display: inline-block; background: var(--brand); color: var(--brand-ink); font-weight: 650; padding: 10px 22px; border-radius: 999px; }
.drop-small { color: var(--ink-2); font-size: 14px; }
.tips { margin-top: 12px; }
.tips summary { cursor: pointer; font-weight: 600; color: var(--brand-deep); }
.tips ul { margin: 8px 0 0; padding-left: 20px; color: var(--ink-2); }
.err { color: var(--bad); font-weight: 600; margin: 10px 0 0; }

.stage { position: relative; max-width: 520px; margin: 0 auto; touch-action: none; user-select: none; -webkit-user-select: none; }
.stage img { display: block; width: 100%; height: auto; border-radius: 10px; }
.frame { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(20, 14, 8, .42); border-radius: 2px; pointer-events: none; }
.stage { overflow: hidden; border-radius: 10px; }
.mark { position: absolute; left: 0; right: 0; height: 0; z-index: 2; cursor: grab; }
.mark::before { content: ""; position: absolute; left: 0; right: 0; top: -1.5px; height: 3px; background: currentColor; box-shadow: 0 0 0 1px rgba(255, 255, 255, .7); }
.mark::after { content: ""; position: absolute; left: 0; right: 0; top: -18px; height: 36px; }
.mark-top { color: var(--blue); }
.mark-chin { color: var(--brand); }
.mark.dragging { cursor: grabbing; }
.mark:focus-visible { outline: none; }
.mark:focus-visible .pill { outline: 3px solid var(--ink); outline-offset: 2px; }
.pill { position: absolute; top: 0; transform: translate(-50%, -50%); color: #fff; border-radius: 999px; padding: 4px 12px; white-space: nowrap; font-size: 13px; font-weight: 650; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); z-index: 1; }
.mark-top .pill { background: var(--blue); }
.mark-chin .pill { background: var(--brand); color: #2a1f17; }
@media (prefers-color-scheme: dark) { .mark-top .pill { color: #10131a; } }

.check-grid { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 24px; align-items: start; }
.preview { margin: 0; }
.preview canvas { display: block; width: 100%; height: auto; border-radius: 4px; box-shadow: var(--shadow); background: #fff; }
.preview figcaption { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: 14px; color: var(--ink-2); }
.toggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.checks { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.chk { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; }
.chk.ok { background: var(--ok-bg); }
.chk.warn { background: var(--warn-bg); }
.chk.bad { background: var(--bad-bg); }
.chk-icon { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 13px; margin-top: 1px; }
.ok .chk-icon { background: var(--ok); }
.warn .chk-icon { background: var(--warn); }
.bad .chk-icon { background: var(--bad); }
@media (prefers-color-scheme: dark) { .chk-icon { color: #1a1714; } }
.self { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 12px; margin: 0; }
.self legend { font-weight: 650; padding: 0 6px; }
.self label { display: flex; gap: 10px; align-items: flex-start; padding: 5px 0; cursor: pointer; }
.self input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--brand); flex: none; }

.saves { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.save { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.save h3 { margin: 0 0 4px; font-size: 17px; }
.save p { margin: 0 0 12px; }
.save .small { margin: 12px 0 0; }
.btn { appearance: none; border: 0; background: var(--brand); color: var(--brand-ink); font-weight: 650; padding: 10px 20px; border-radius: 999px; cursor: pointer; min-height: 44px; }
.btn:hover { background: var(--brand-deep); }
.sheet-preview { display: block; width: 100%; max-width: 600px; height: auto; margin: 18px auto 0; box-shadow: var(--shadow); border-radius: 4px; }

.foot { padding: 24px 16px 140px; color: var(--ink-2); font-size: 14px; }

/* Flash the camera */
.mascot-dock { position: fixed; right: 14px; bottom: 14px; z-index: 20; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: none; }
.mascot-dock > * { pointer-events: auto; }
.bubble { margin: 0; max-width: min(280px, calc(100vw - 40px)); background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 14px 14px 4px 14px; padding: 9px 12px; font-size: 14px; box-shadow: var(--shadow); }
.bubble:empty { display: none; }
.bubble.pop { animation: pop .22s ease-out; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }
.mascot { appearance: none; border: 0; background: none; padding: 0; cursor: pointer; filter: drop-shadow(0 4px 8px rgba(60, 40, 20, .2)); }
.mascot:focus-visible { outline: 3px solid var(--blue); border-radius: 18px; }
.tuck { position: absolute; right: -4px; bottom: 62px; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--ink-2); font-size: 15px; line-height: 1; cursor: pointer; padding: 0; }
.mascot-dock.tucked .bubble, .mascot-dock.tucked .tuck { display: none; }
.mascot-dock.tucked .mascot { transform: translateY(46px) scale(.7); opacity: .85; }

.s-body { fill: var(--brand); }
.s-bump { fill: var(--brand-deep); }
.s-flash { fill: #fff3c4; stroke: #e2b33d; stroke-width: 2; transition: fill .15s; }
.s-ring { fill: #3b2d22; }
.s-lens { fill: #fffaf2; }
.s-white { fill: #fff; stroke: #2a1f17; stroke-width: 1.5; }
.s-pupil { fill: #2a1f17; transition: transform .08s linear; }
.s-lids { stroke: #2a1f17; stroke-width: 2.5; stroke-linecap: round; opacity: 0; }
.s-mouth { fill: none; stroke: #fffaf2; stroke-width: 3; stroke-linecap: round; transition: d .2s; }
.s-cheek { fill: #ffb3a0; opacity: .7; }

.mascot[data-mood="sleepy"] .s-eye { opacity: 0; }
.mascot[data-mood="sleepy"] .s-lids { opacity: 1; }
.mascot[data-mood="sleepy"] .s-mouth { d: path("M55 69q5 2 10 0"); }
.mascot[data-mood="worried"] .s-mouth { d: path("M53 71q7 -6 14 0"); }
.mascot[data-mood="worried"] .s-cheek { opacity: 0; }
.mascot[data-mood="wow"] .s-mouth { d: path("M56 68q4 6 8 0q-4 -4 -8 0"); }
.mascot[data-mood="wow"] .s-flash, .mascot.flashing .s-flash { fill: #fffbe6; filter: drop-shadow(0 0 6px #ffe680); }
.mascot.blink .s-eye { opacity: 0; }
.mascot.blink .s-lids { opacity: 1; }
.mascot.hop { animation: hop .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes hop { 40% { transform: translateY(-14px) rotate(-4deg); } }
.mascot.wiggle { animation: wiggle .5s ease-in-out; }
@keyframes wiggle { 25% { transform: rotate(-7deg); } 75% { transform: rotate(7deg); } }

.flashout { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 30; }
.flashout.go { animation: flashout .5s ease-out; }
@keyframes flashout { 10% { opacity: .85; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 640px) {
  .check-grid, .saves { grid-template-columns: 1fr; }
  .preview { max-width: 280px; margin: 0 auto; }
  .step { padding: 16px; }
  .mascot svg { width: 76px; height: 64px; }
  .tuck { bottom: 50px; }
}
