:root {
      --font-serif: 'Fraunces', Georgia, serif;
      --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
      --font-mono: 'DM Mono', monospace;
    }

    /* ==================== 4 LUXURY COOKIE BOX THEMES ==================== */
    html[data-box="crimson"] {
      --page-bg: radial-gradient(circle at 50% 0%, #FFF6EB 0%, #F4E7D4 100%);
      --ink: #241914;
      --muted: #6C584C;
      --tin-outer: linear-gradient(145deg, #9E1B24 0%, #6E0D14 100%);
      --tin-inner: radial-gradient(circle at 50% 30%, #8C161E 0%, #58090F 100%);
      --tin-rim: #E6B85C;
      --tin-text: #FFF8EB;
      --liner-bg: #FFFDF8;
      --liner-border: #E5D4B7;
      --accent: #B22222;
      --gold: #E6B85C;
    }
    html[data-box="forest"] {
      --page-bg: radial-gradient(circle at 50% 0%, #F1F6F1 0%, #E1EBE2 100%);
      --ink: #172A1E;
      --muted: #4B6354;
      --tin-outer: linear-gradient(145deg, #1E4631 0%, #102A1D 100%);
      --tin-inner: radial-gradient(circle at 50% 30%, #193B29 0%, #0D2217 100%);
      --tin-rim: #D4A359;
      --tin-text: #F4F9F4;
      --liner-bg: #FCFBF7;
      --liner-border: #C9D8CC;
      --accent: #1E5631;
      --gold: #D4A359;
    }
    html[data-box="velvet"] {
      --page-bg: radial-gradient(circle at 50% 0%, #161B33 0%, #0A0D1A 100%);
      --ink: #F8FAFC;
      --muted: #94A3B8;
      --tin-outer: linear-gradient(145deg, #1E2749 0%, #0F1429 100%);
      --tin-inner: radial-gradient(circle at 50% 30%, #18203E 0%, #0B0F20 100%);
      --tin-rim: #F3D078;
      --tin-text: #FEF9E7;
      --liner-bg: #FFFDF9;
      --liner-border: #CBD5E1;
      --accent: #EAB308;
      --gold: #F3D078;
    }
    html[data-box="kraft"] {
      --page-bg: radial-gradient(circle at 50% 0%, #FFFBF5 0%, #F3E9DC 100%);
      --ink: #2C221E;
      --muted: #75655C;
      --tin-outer: linear-gradient(145deg, #C89F74 0%, #A67B51 100%);
      --tin-inner: radial-gradient(circle at 50% 30%, #DFC09D 0%, #C49E76 100%);
      --tin-rim: #FFFDF9;
      --tin-text: #2C221E;
      --liner-bg: #FFFFFF;
      --liner-border: #E6D7C3;
      --accent: #B85028;
      --gold: #FFFDF9;
    }

    * { box-sizing: border-box; }
    body {
      margin: 0;
      font-family: var(--font-sans);
      background: var(--page-bg);
      color: var(--ink);
      min-height: 100vh;
      overflow-x: hidden;
      transition: background 0.45s ease, color 0.45s ease;
    }
    button, input { font: inherit; color: inherit; }
    button { cursor: pointer; border: none; background: none; }
    .serif { font-family: var(--font-serif); }
    .mono { font-family: var(--font-mono); }
    .wrap { width: min(1040px, calc(100% - 32px)); margin: 0 auto; position: relative; z-index: 4; }

    /* Ambient Snowfall & Fairy Lights */
    .snow-wrap { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
    .flake {
      position: absolute; top: -20px; opacity: 0.55; user-select: none;
      animation: snowFall linear infinite;
    }
    @keyframes snowFall {
      0% { transform: translateY(-4vh) translateX(0) rotate(0deg); opacity: 0; }
      15% { opacity: 0.65; }
      100% { transform: translateY(106vh) translateX(22px) rotate(180deg); opacity: 0.1; }
    }

    /* Top Bar */
    .topbar {
      position: sticky; top: 0; z-index: 30;
      backdrop-filter: blur(14px);
      background: color-mix(in srgb, var(--page-bg) 82%, transparent);
      border-bottom: 1px solid rgba(128,128,128,0.16);
    }
    .topbar-inner {
      height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    }
    .brand {
      display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -0.03em;
      color: inherit; text-decoration: none;
    }
    .brand-icon {
      width: 36px; height: 36px; border-radius: 12px;
      background: linear-gradient(135deg, #D97706, #B22222);
      color: #FFF; display: grid; place-items: center; font-size: 19px;
      box-shadow: 0 6px 16px rgba(178, 34, 34, 0.25);
    }
    .top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
    .top-nav { display: flex; align-items: center; gap: 18px; }
    .top-nav a { color: var(--muted); font-size: 12.5px; font-weight: 800; text-decoration: none; }
    .top-nav a:hover { color: var(--ink); text-decoration: underline; }
    .pill-btn {
      padding: 8px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
      border: 1px solid rgba(128,128,128,0.25); background: rgba(255,255,255,0.15);
      transition: 0.18s;
    }
    .pill-btn:hover { transform: translateY(-1px); border-color: var(--accent); }
    .pill-primary {
      padding: 9px 17px; border-radius: 999px; font-size: 12.5px; font-weight: 800;
      background: var(--accent); color: #FFF;
      box-shadow: 0 8px 20px rgba(0,0,0,0.15); transition: 0.18s;
    }
    html[data-box="velvet"] .pill-primary { color: #0A0D1A; }
    .pill-primary:hover { transform: translateY(-1px); filter: brightness(1.06); }

    .holiday-stage {
      position: relative; padding: 28px 0 36px;
      background: linear-gradient(105deg, #241916aa 0%, #2b1d1666 52%, #261912a6 100%),
        #2b1d16 url('/_a/gingerbox-christmas-background.c101145336.webp') center 43% / cover no-repeat;
      color: #FFF6E7;
    }
    .stage-layout { display: grid; gap: clamp(18px, 3vw, 36px); align-items: start; }
    .stage-board { min-width: 0; }
    .stage-panel {
      width: min(740px, 100%); margin-inline: auto; padding: 20px;
      border: 1px solid #E2D6C3; border-radius: 20px;
      background: linear-gradient(150deg, #FFFDF9, #F6ECD9); color: #241914;
      box-shadow: 0 12px 32px #160e0b45;
    }
    .stage-panel h2 { font: 700 25px/1.12 var(--font-serif); margin: 0 0 8px; }
    .stage-panel .box-swatches { margin: 12px 0; }
    .stage-panel .swatch-btn { background: #FFFDF9; color: #241914; }
    .stage-panel .opt-group + .opt-group { margin-top: 12px; }
    .stage-panel .opt-label { color: #5E493C; }
    .setup-submit { width: 100%; min-height: 44px; margin-top: 5px; font-size: 14px; }
    .stage-panel .setup-join { display: block; margin: 12px auto 0; font-size: 13px; text-decoration: underline; text-underline-offset: 2px; }
    .hero-block {
      text-align: center; padding: 0 0 18px;
    }
    .eyebrow {
      display: inline-flex; align-items: center; gap: 7px; padding: 5px 13px; border-radius: 999px;
      font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
      background: rgba(128,128,128,0.12); color: var(--muted);
    }
    .hero-title {
      font-family: var(--font-serif); font-size: clamp(32px, 5vw, 52px);
      line-height: 1.04; margin: 0 0 8px; letter-spacing: -0.035em; overflow-wrap: anywhere;
    }
    .hero-sub {
      font-size: 14px; color: #FFF1DA; max-width: 64ch; margin: 0 auto; line-height: 1.5;
    }

    #pageLabel { margin-bottom: 8px; color: #FFF1DA; }
    @media (min-width: 820px) {
      .stage-layout:has(.stage-panel:not([hidden])) {
        grid-template-columns: minmax(0, 1.65fr) minmax(285px, 1fr);
        row-gap: 0;
        .stage-board { display: contents; }
        .hero-block { grid-area: 1 / 1 / 2 / -1; text-align: left; }
        .hero-sub { margin-inline: 0; }
        .cookie-tin-outer { grid-area: 2 / 1; }
        .stage-panel { grid-area: 2 / 2; }
      }
    }
    .box-swatches { width: min(740px, 100%); margin: 14px auto 0; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
    .swatch-btn {
      display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
      font-size: 12px; font-weight: 700; border: 1.5px solid rgba(128,128,128,0.22);
      background: rgba(255,255,255,0.4); transition: 0.16s;
    }
    html[data-box="velvet"] .swatch-btn { background: rgba(255,255,255,0.08); }
    .swatch-btn.active { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
    .dot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.2); }

    .route-recovery { text-align: center; padding-bottom: 24px; }
    .route-recovery a { color: inherit; font-weight: 700; }

    /* ==================== LUXURY COOKIE TIN CONTAINER ==================== */
    .cookie-tin-outer {
      width: min(740px, 100%);
      margin-inline: auto;
      background: var(--tin-outer);
      border: 3px solid var(--tin-rim);
      border-radius: 28px;
      padding: 9px;
      box-shadow: 0 28px 70px rgba(0,0,0,0.22), inset 0 2px 12px rgba(255,255,255,0.25);
      position: relative;
    }
    .cookie-tin-inner {
      background: var(--tin-inner);
      border: 1.5px dashed var(--tin-rim);
      border-radius: 19px;
      padding: 15px;
      color: var(--tin-text);
    }
    .tin-header {
      display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
      gap: 8px; padding-bottom: 10px; margin-bottom: 10px;
      border-bottom: 1px solid rgba(255,255,255,0.16);
    }
    html[data-box="kraft"] .tin-header { border-bottom-color: rgba(44,34,30,0.14); }
    .tin-tag {
      display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px;
      font-family: var(--font-mono); font-size: 11px; font-weight: 700;
      background: rgba(255,255,255,0.16); border: 1px solid rgba(255,255,255,0.25);
    }
    html[data-box="kraft"] .tin-tag { background: rgba(255,255,255,0.7); border-color: rgba(44,34,30,0.15); }

    /* 8-Slot Fluted Paper Liner Grid */
    .slots-grid {
      display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
    }
    .parchment-slot {
      background: var(--liner-bg);
      color: #241914;
      border: 2px dashed var(--liner-border);
      border-radius: 16px;
      padding: 7px;
      display: flex; flex-direction: column; align-items: center; justify-content: center;
      min-height: 128px; min-width: 0;
      box-shadow: 0 10px 24px rgba(0,0,0,0.16);
      transition: transform 0.2s cubic-bezier(.16,1,.3,1), box-shadow 0.2s;
      position: relative;
    }
    button.parchment-slot:hover {
      transform: translateY(-5px) rotate(-1deg);
      box-shadow: 0 16px 32px rgba(0,0,0,0.24);
    }
    .parchment-slot.empty {
      background: rgba(255, 253, 248, 0.86);
      border-style: dashed;
    }
    .empty-slot-mark {
      display: grid; place-items: center; width: 31px; height: 31px; margin: 0 auto 5px;
      border-radius: 50%; background: #EFE6D6; color: #786A5E; font-size: 17px;
    }
    .slot-status { color: #166534; }

    .cookie-preview-wrap {
      width: min(84px, 100%); aspect-ratio: 260 / 300; display: grid; place-items: center;
    }
    .gingerbread-art { display: block; width: 100%; height: auto; }
    .cookie-preview-wrap, #liveCookieSvg, .unwrap-cookie { filter: drop-shadow(0 4px 4px #43241840); }
    .unwrap-cookie { width: 150px; margin: 10px auto; }
    .slot-label {
      width: 100%; font-size: 11px; font-weight: 800; text-align: center; margin-top: 2px;
      max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }

    /* Tin Footer CTA */
    .tin-footer {
      margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.16);
      font-size: 11px;
    }
    .demo-tools { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 4px 12px; }
    .demo-tools button { padding: 5px 0; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
    html[data-box="kraft"] .tin-footer { border-top-color: rgba(44,34,30,0.14); }

    /* ==================== MODALS (STREAMLINED BAKING, GUESSING & SHARE) ==================== */
    .modal-bg {
      position: fixed; inset: 0; z-index: 60; display: none; place-items: center; padding: 16px;
      background: rgba(10, 10, 14, 0.72); backdrop-filter: blur(8px);
    }
    .modal-bg.show { display: grid; }
    .modal-card {
      width: min(540px, 100%); max-height: 92vh; overflow-y: auto;
      background: #FFFDF9; color: #241914; border-radius: 28px; padding: 24px;
      box-shadow: 0 30px 90px rgba(0,0,0,0.4); position: relative;
      animation: popIn 0.22s cubic-bezier(.16,1,.3,1);
    }
    .modal-card--studio { width: min(940px, 100%); }
    @keyframes popIn { from { opacity: 0; transform: scale(0.95) translateY(8px); } to { opacity: 1; transform: none; } }
    .close-x {
      position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 50%;
      background: #F1ECE1; font-size: 18px; display: grid; place-items: center;
    }

    /* Baking studio */
    .studio-heading { padding-right: 42px; }
    .studio-heading h3 { margin: 3px 0 16px; font-size: clamp(24px, 3vw, 34px); line-height: 1.1; }
    .studio-slot { font-size: 11px; color: #786A5E; }
    .studio-presets {
      display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
      padding: 10px 12px; border: 1px solid #E2D6C3; border-radius: 16px; background: #F6EFE2;
    }
    .studio-presets strong { font-size: 12px; margin-right: 4px; }
    .studio-presets .mini-chip:last-child { margin-left: auto; }
    .bake-studio-grid {
      display: grid; grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr);
      gap: 24px; align-items: start; margin-top: 16px;
    }
    .piping-stage {
      background: #F6EFE2; border: 1px solid #D6C3A5; border-radius: 22px;
      padding: 14px; position: relative; user-select: none;
    }
    .piping-board {
      padding: 4px 0; border: 1px dashed #D6C3A5; border-radius: 16px;
      background: radial-gradient(ellipse at 50% 40%, #FFFDF9 12%, #F3EDE2 90%);
    }
    .canvas-stack {
      position: relative; width: min(328px, 100%); aspect-ratio: 260 / 300; margin: 0 auto;
    }
    #pipingCanvas {
      position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; touch-action: none; cursor: crosshair;
    }
    .pipe-tools, .pipe-colors {
      display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px;
    }
    .pipe-tools .mini-chip, .studio-presets .mini-chip { min-height: 34px; }
    .pipe-tools .mini-chip:last-child { margin-left: auto; }
    .pipe-colors strong, .piping-tip { color: #5E493C; font-size: 12px; }
    .piping-tip { margin: 10px 0 0; }
    .pipe-dot {
      width: 28px; height: 28px; border-radius: 50%; border: 2px solid #FFF;
      box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    }
    .pipe-dot.active { outline: 2px solid #241914; transform: scale(1.12); }

    .studio-controls { display: grid; gap: 12px; min-width: 0; }
    .studio-options, .studio-note {
      border: 1px solid #E2D6C3; border-radius: 16px; padding: 12px;
    }
    .studio-group { border: 0; margin: 0; padding: 0; min-width: 0; }
    .studio-group + .studio-group { margin-top: 12px; }
    .studio-group legend, .studio-note label {
      display: block; padding: 0; margin-bottom: 6px; font-size: 13px; font-weight: 800;
    }
    .studio-choice-grid {
      display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 6px;
    }
    .studio-choice-grid .mini-chip {
      min-height: 36px; padding: 5px 6px; line-height: 1.2; border-radius: 10px;
    }
    .studio-note { display: grid; gap: 10px; background: #F6EFE2; }
    .studio-note-header { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
    .studio-note-header button { padding: 4px 0 4px 6px; font-size: 12px; font-weight: 800; text-decoration: underline; flex: none; }
    .studio-note .optional { font-size: 11px; font-weight: 600; color: #786A5E; }
    .studio-note #submitCookie { min-height: 42px; font-size: 14px; }

    .opt-group { margin-bottom: 11px; }
    .opt-label { font-size: 11px; font-weight: 800; color: #786A5E; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 5px; display: block; }
    .box-capacity { border: 0; padding: 0; min-width: 0; margin-inline: 0; }
    .capacity-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
    .capacity-option {
      display: flex; align-items: center; justify-content: center; gap: 5px;
      min-height: 44px; padding: 6px 3px; border: 1px solid #E2D6C3; border-radius: 10px;
      background: #F3EDE2; color: #241914; font-size: 12px; font-weight: 700; cursor: pointer;
    }
    .capacity-option:has(:checked) { border-color: #241914; background: #241914; color: #FFF; }
    .capacity-option input { margin: 0; accent-color: #A62626; }
    .mini-chip {
      padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
      background: #F3EDE2; border: 1px solid #E2D6C3; transition: 0.14s;
    }
    .mini-chip.active, .mini-chip:hover { background: #241914; color: #FFF; border-color: #241914; }

    .clean-input {
      width: 100%; padding: 10px 12px; border-radius: 12px; border: 1.5px solid #DDD0BC;
      background: #FFF; font-size: 13.5px; outline: none;
    }
    .clean-input:focus { border-color: #241914; }

    /* Story Share Card Preview */
    .tin-share {
      display: grid; gap: 12px;
    }
    .share-banner { padding: 14px; border: 1px solid #e9d0a4; border-radius: 13px; background: #fff2db; }
    .share-banner p, .owner-card p { margin: 0; font-size: 13px; line-height: 1.55; color: #5e493c; }
    .owner-progress { display: grid; gap: 4px; text-align: center; font-size: 12px; color: #5e493c; }
    .owner-progress progress { width: 100%; height: 10px; accent-color: #a62626; }
    .share-main, .owner-dialog .pill-primary { background: #a62626; color: #fff !important; }
    .share-main { width: 100%; min-height: 46px; }
    .tin-share-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
    .tin-share-actions :is(button, a) { min-height: 40px; text-align: center; display: grid; place-items: center; }
    .share-channels { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 12px; font-size: 12px; }
    .share-channels a, .owner-links button { color: #8d2424; text-underline-offset: 3px; }
    .owner-card { padding: 13px; border: 1px solid #e6d6bb; border-radius: 13px; background: #fffaf0; }
    .owner-card h3, .owner-card summary { margin: 0 0 5px; font-size: 14px; font-weight: 800; }
    .owner-card summary { cursor: pointer; }
    .owner-card .pill-btn, .owner-card .tin-tag { margin-top: 8px; }
    .owner-key-card { border-style: dashed; border-color: #bd9149; }
    .owner-key-value { display: block; margin-top: 8px; padding: 8px; border: 1px solid #ddd0bc; border-radius: 8px; background: #fff; overflow-wrap: anywhere; user-select: all; }
    .owner-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-top: 2px; }
    .owner-links button { padding: 5px 0; font-size: 12px; text-decoration: underline; }
    .guest-recovery { text-align: center; margin: 10px auto 0; }
    .guest-recovery button, .route-recovery button { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
    .owner-dialog { display: grid; gap: 12px; }
    .owner-dialog h2 { font: 700 clamp(24px, 4vw, 32px)/1.15 var(--font-serif); margin: 0; padding-inline: 20px; }
    .owner-dialog p { margin: 0; font-size: 14px; color: #5e493c; line-height: 1.55; }
    .owner-dialog .pill-btn, .owner-dialog .pill-primary { min-height: 44px; }
    .ready-dialog { text-align: center; padding: 10px 0 0; }
    .ready-dialog .celebration { font-size: 36px; line-height: 1; }
    .ready-dialog .pill-primary { font-size: 15px; }
    .guess-feedback {
      margin: 0 0 8px; padding: 8px 10px; border-radius: 8px; background: #fff2db;
      color: #783c13; font-size: 13px; font-weight: 700;
    }
    .feature-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 14px 24px; }
    .feature-pair article { border-left: 2px solid #d5a55b; padding-left: 14px; }
    .tin-share .tin-tag { color: #241914; background: #F3EDE2; border-color: #D6C3A5; }
    .story-share { text-align: center; }
    .story-share h3 { font-size: 24px; margin: 0 30px 4px; }
    .story-share p { font-size: 12.5px; color: #6C584C; margin: 0; }
    .story-card {
      width: min(260px, 100%); aspect-ratio: 9 / 16; margin: 12px auto 16px; border-radius: 24px;
      padding: 18px 16px; background: var(--tin-outer); border: 3px solid var(--tin-rim);
      color: var(--tin-text); display: flex; flex-direction: column; justify-content: space-between;
      box-shadow: 0 20px 50px rgba(0,0,0,0.28); text-align: center;
    }
    .story-card-title { font-size: 22px; font-weight: 800; line-height: 1.12; margin-top: 6px; overflow-wrap: anywhere; }
    .story-actions { display: grid; justify-items: center; gap: 8px; }
    .story-actions > .pill-primary { width: min(260px, 100%); padding: 11px; }
    .story-mini-tin {
      background: var(--tin-inner); border: 1px dashed var(--tin-rim); border-radius: 16px;
      padding: 10px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
    }
    .story-mini-cell {
      aspect-ratio: 1; background: var(--liner-bg); border-radius: 10px;
      display: grid; place-items: center; font-size: 16px; color: #241914; font-weight: 800;
    }

    .story-mini-cell .gingerbread-art { width: 80%; }
    @keyframes riseSmoke {
      0% { transform: translateY(4px) scale(.85); opacity: 0; }
      35% { opacity: .7; }
      100% { transform: translateY(-18px) scale(1.25); opacity: 0; }
    }
    .smoke-wisp { animation: riseSmoke 2.4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
    .smoke-wisp.s2 { animation-delay: .8s; }
    .smoke-wisp.s3 { animation-delay: 1.5s; }
    @media (prefers-reduced-motion: reduce) {
      .smoke-wisp { animation: none; }
    }

    /* Toast */
    .toast {
      position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 16px); z-index: 90;
      background: #1C1917; color: #FFF; padding: 11px 20px; border-radius: 999px;
      font-size: 13px; font-weight: 700; box-shadow: 0 12px 30px rgba(0,0,0,0.3);
      opacity: 0; pointer-events: none; transition: 0.22s;
    }
    .toast.show { opacity: 1; transform: translate(-50%, 0); }

    @media (max-width: 720px) {
      .modal-card--studio { padding: 16px; max-height: calc(100dvh - 32px); }
      .bake-studio-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
      .canvas-stack { width: min(288px, 100%); }
      .studio-presets .mini-chip:last-child { margin-left: 0; }
      .studio-choice-grid .mini-chip { min-height: 44px; }
    }

    .content-section { margin: 0 auto; padding: 44px 0; scroll-margin-top: 72px; }
    #how { margin-top: 22px; }
    #app { scroll-margin-top: 74px; }
    .content-section + .content-section { border-top: 1px solid color-mix(in srgb, var(--ink) 16%, transparent); }
    .content-section h2 { font: 700 clamp(27px, 4vw, 40px)/1.08 var(--font-serif); margin: 0 0 20px; }
    .content-section p { font-size: 14px; line-height: 1.65; margin: 0; }
    .content-section h3 { font: 700 20px/1.16 var(--font-serif); margin: 0 0 7px; }
    .how-steps {
      padding: 0; margin: 0; list-style: none; counter-reset: how-step;
      display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
    }
    .how-steps li {
      counter-increment: how-step; display: grid; grid-template-columns: auto 1fr; gap: 8px 12px;
      padding: 16px; border: 1px solid #E2D6C3; border-radius: 16px; color: #241914; background: #FFFDF9;
    }
    .how-steps li::before {
      content: counter(how-step); grid-row: span 2; display: grid; place-items: center;
      width: 28px; height: 28px; border-radius: 50%; background: #F3EDE2; font: 700 12px var(--font-mono);
    }
    .how-steps h3 { margin: 3px 0 0; }
    .how-steps p { grid-column: 2; color: #5E493C; }
    .guide-layout { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(18px, 4vw, 46px); align-items: start; }
    .guide-copy h3 { margin: 18px 0 7px; }
    .clue-card {
      padding: 20px; border-radius: 18px; background: var(--tin-inner);
      border: 1px solid var(--tin-rim); color: var(--tin-text);
    }
    .clue-card ul { list-style: none; padding: 0; margin: 12px 0 0; }
    .clue-card li { padding: 10px 0; font-size: 13px; line-height: 1.55; }
    .clue-card li + li { border-top: 1px solid color-mix(in srgb, var(--tin-text) 26%, transparent); }
    .faq-section { max-width: 740px; }
    .faq-grid { display: grid; gap: 8px; }
    .faq-grid details { border: 1px solid rgba(90,60,35,.15); border-radius: 15px; padding: 15px 17px; background: color-mix(in srgb, var(--liner-bg) 72%, transparent); }
    .faq-grid summary { cursor: pointer; font-weight: 800; font-size: 13px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
    .faq-grid summary::-webkit-details-marker { display: none; }
    .faq-grid summary::after { content: '+'; font-family: var(--font-mono); color: var(--accent); }
    .faq-grid details[open] summary::after { content: '−'; }
    .faq-grid p { margin: 11px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.65; }
    .site-footer { width: min(1040px, calc(100% - 32px)); margin: 0 auto; padding: 26px 0 42px; display: grid; grid-template-columns: 1fr auto; gap: 10px 24px; color: var(--muted); font-size: 12px; }
    .site-footer strong { display: block; color: var(--ink); font-family: var(--font-serif); font-size: 20px; }
    .site-footer nav { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
    .site-footer a { color: inherit; text-decoration: none; font-weight: 700; }
    .site-footer a:hover { color: var(--accent); }
    .site-footer small { grid-column: 1 / -1; opacity: .7; }
    .pill-btn[href] { color: inherit; text-decoration: none; }
    [hidden] { display: none !important; }
    .faq-grid details { color: #241914; }
    .faq-grid p { color: #5e493c; }
    .home-cta { padding: 26px 16px; text-align: center; border-radius: 18px; background: var(--tin-inner); color: var(--tin-text); }
    .home-cta h2 { margin: 0 0 12px; }
    .home-cta .pill-primary { min-height: 42px; }
    @media (max-width: 780px) {
      .top-nav { display: none; }
      .topbar-inner { height: auto; min-height: 64px; padding: 8px 0; }
      .site-footer { grid-template-columns: 1fr; }
      .site-footer nav { justify-content: flex-start; }
    }
    @media (max-width: 560px) {
      .topbar-inner { flex-wrap: wrap; gap: 6px; }
      .top-actions { width: 100%; gap: 6px; }
      .top-actions button, .top-actions a { padding-inline: 11px; }
      #soundBtn { width: 36px; padding-inline: 0; }
      #soundText { display: none; }
      .holiday-stage { padding: 17px 0 22px; background-position: center, center top; }
      .hero-block { padding: 0 0 14px; }
      .stage-panel { padding: 15px; }
      .cookie-tin-outer { padding: 5px; border-radius: 21px; }
      .cookie-tin-inner { padding: 8px; border-radius: 15px; }
      .slots-grid { gap: 5px; }
      .parchment-slot { min-height: 80px; border-radius: 10px; padding: 4px 2px; }
      .cookie-preview-wrap { width: min(53px, 100%); }
      .slot-label { font-size: 10px; }
      .empty-slot-mark { width: 23px; height: 23px; margin-bottom: 2px; font-size: 13px; }
      .guide-layout, .how-steps { grid-template-columns: minmax(0, 1fr); }
      .content-section { padding: 28px 0; }
    }


    .slots-grid.closed-tin,
    .story-mini-tin.closed-tin { grid-template-columns: repeat(var(--closed-columns), minmax(0, 1fr)); }
    .slots-grid.closed-tin { width: min(100%, calc(var(--closed-columns) * 142px)); margin-inline: auto; }
    #tinSettings .clean-input { width: auto; margin: 0 4px; }
    #tinSettings button { margin-block: 5px; }
