/* ==========================================================================
   Noisewize UI kit — "papercraft" theme
   One stylesheet for every screen. Wire screens to the engine by toggling
   classes / data attributes; all colours and type are CSS variables.
   Fonts: Fredoka (display) + Nunito (body), both SIL OFL. For the shipped
   offline app, bundle the .woff2 files with @font-face; the stacks fall back
   to Segoe UI Variable.
   ========================================================================== */

/* ---------- Tokens: light ("kraft paper") ---------- */
.nw {
  --nw-ground: #F3E3C3;          /* cardboard desk */
  --nw-ground-fleck: #E4CC9C;    /* cardboard fibres */
  --nw-paper: #FFFBF2;           /* cards */
  --nw-paper-2: #FFF1D6;         /* inset areas */
  --nw-ink: #2B1E14;             /* text + outlines (15.6:1 on paper) */
  --nw-ink-soft: #6B5440;        /* secondary text (6.8:1 on paper) */
  --nw-line: #2B1E14;            /* cut-out outlines */
  --nw-shadow: #2B1E14;          /* hard "stacked paper" shadow */
  --nw-on-accent: #2B1E14;       /* text on any bright fill */

  --nw-tomato: #FF7A5C;  --nw-tomato-tint: #FFD3C7;
  --nw-sun:    #FFC83D;  --nw-sun-tint:    #FFE9A8;
  --nw-sky:    #6CC3FF;  --nw-sky-tint:    #CFE8FF;
  --nw-leaf:   #74DB8F;  --nw-leaf-tint:   #CFF3D8;
  --nw-grape:  #B39BFF;  --nw-grape-tint:  #E5DCFF;
  --nw-bubble: #FF9EC4;  --nw-bubble-tint: #FFDCEA;

  --nw-pass-ink: #246B3A;        /* 6.3:1 on paper */
  --nw-miss-ink: #B5361F;        /* 5.8:1 on paper */
  --nw-warn-ink: #8A5A00;        /* 5.7:1 on paper */

  --nw-font-display: "Fredoka", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --nw-font-body: "Nunito", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;

  --nw-r-sm: 10px;  --nw-r: 16px;  --nw-r-lg: 24px;  --nw-r-pill: 999px;
  --nw-stroke: 2.5px;
  --nw-lift: 0 5px 0 var(--nw-shadow);
  --nw-lift-hover: 0 7px 0 var(--nw-shadow);
  --nw-lift-press: 0 1px 0 var(--nw-shadow);
  --nw-ease-pop: cubic-bezier(.34, 1.56, .64, 1);
}

/* ---------- Tokens: dark ("night cardboard") ---------- */
.nw[data-theme="dark"] {
  --nw-ground: #1C1830;
  --nw-ground-fleck: #29234A;
  --nw-paper: #2A2442;
  --nw-paper-2: #221D38;
  --nw-ink: #FFF4E0;             /* 13.5:1 on paper */
  --nw-ink-soft: #C9BBA4;        /* 7.8:1 on paper */
  --nw-line: #0D0A18;
  --nw-shadow: #0D0A18;
  --nw-on-accent: #1C1830;

  --nw-tomato-tint: #4D2B36;
  --nw-sun-tint: #463A26;
  --nw-sky-tint: #213A5C;
  --nw-leaf-tint: #1E4236;
  --nw-grape-tint: #362C66;
  --nw-bubble-tint: #4A2A48;

  --nw-pass-ink: #8BE6A2;
  --nw-miss-ink: #FF9A80;
  --nw-warn-ink: #FFD45C;
}

/* ---------- Base ---------- */
.nw, .nw * { box-sizing: border-box; }
.nw {
  font-family: var(--nw-font-body);
  font-size: 15px;
  line-height: 1.45;
  color: var(--nw-ink);
  background-color: var(--nw-ground);
  background-image:
    radial-gradient(var(--nw-ground-fleck) 1.1px, transparent 1.5px),
    radial-gradient(var(--nw-ground-fleck) 0.8px, transparent 1.2px);
  background-size: 17px 17px, 23px 23px;
  background-position: 0 0, 9px 11px;
}
.nw h1, .nw h2, .nw h3, .nw h4 { font-family: var(--nw-font-display); font-weight: 600; margin: 0; line-height: 1.15; }
.nw h1 { font-size: 30px; }
.nw h2 { font-size: 22px; }
.nw h3 { font-size: 18px; }
.nw p { margin: 0; }
.nw-soft { color: var(--nw-ink-soft); }
.nw-small { font-size: 13px; }
.nw-num { font-variant-numeric: tabular-nums; }
.nw-kbd { font-family: var(--nw-font-body); font-weight: 800; background: var(--nw-paper-2); border: 1.5px solid var(--nw-line); border-radius: 6px; padding: 0 6px; }
.nw-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- App shell ---------- */
.nw-app { min-height: 680px; display: flex; flex-direction: column; }
.nw-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 20px; }
.nw-top-spacer { flex: 1 1 auto; }
.nw-logo { display: inline-flex; align-items: center; gap: 8px; font-family: var(--nw-font-display); font-weight: 700; font-size: 22px; letter-spacing: .2px; padding: 4px 10px 4px 4px; border: 2px dashed color-mix(in srgb, var(--nw-ink) 35%, transparent); border-radius: var(--nw-r-sm); }
.nw-logo-mark { width: 32px; height: 32px; flex: none; }
.nw-slot { min-width: 120px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 2px dashed color-mix(in srgb, var(--nw-ink) 35%, transparent); border-radius: var(--nw-r-pill); font-size: 12px; color: var(--nw-ink-soft); padding: 0 12px; }
.nw-body { flex: 1; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px; padding: 4px 20px 20px; }
.nw-side { flex: 0 1 184px; display: flex; flex-direction: column; gap: 14px; }
.nw-main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }

/* ---------- Connection status pill ---------- */
.nw-status { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px 0 10px; border: var(--nw-stroke) solid var(--nw-line); border-radius: var(--nw-r-pill); background: var(--nw-paper); box-shadow: 0 3px 0 var(--nw-shadow); font-weight: 700; font-size: 14px; }
.nw-status-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--nw-line); flex: none; }
.nw-status--on .nw-status-dot { background: var(--nw-leaf); }
.nw-status--wait .nw-status-dot { background: var(--nw-sun); animation: nw-blink 1s steps(2) infinite; }
.nw-status--off .nw-status-dot { background: transparent; border-style: dashed; }
.nw-status--live .nw-status-dot { background: var(--nw-tomato); border-radius: 3px; }
.nw-status small { font-weight: 600; color: var(--nw-ink-soft); }

/* ---------- Side navigation ---------- */
.nw-nav { display: flex; flex-direction: column; gap: 8px; }
.nw-nav a, .nw-nav button { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; border-radius: var(--nw-r); font-family: var(--nw-font-display); font-weight: 600; font-size: 17px; color: var(--nw-ink); text-decoration: none; background: transparent; border: var(--nw-stroke) solid transparent; cursor: pointer; text-align: left; width: 100%; }
.nw-nav a:hover, .nw-nav button:hover { background: color-mix(in srgb, var(--nw-paper) 70%, transparent); border-color: var(--nw-line); }
.nw-nav [aria-current="page"] { background: var(--nw-sun); color: var(--nw-on-accent); border-color: var(--nw-line); box-shadow: 0 4px 0 var(--nw-shadow); }
.nw-nav svg { width: 22px; height: 22px; flex: none; }
.nw-nav-sub { display: flex; flex-direction: column; gap: 4px; padding-left: 18px; }
.nw-nav-sub a { font-size: 15px; min-height: 40px; font-family: var(--nw-font-body); font-weight: 700; }
.nw-chev { margin-left: auto; transition: transform .2s; }
.nw-chev--open { transform: rotate(90deg); }
.nw-promise { font-size: 13px; color: var(--nw-ink-soft); padding: 12px 14px; border: 2px dashed color-mix(in srgb, var(--nw-ink) 30%, transparent); border-radius: var(--nw-r); }
.nw-promise b { color: var(--nw-ink); }

/* ---------- Paper card ---------- */
.nw-card { position: relative; background: var(--nw-paper); border: var(--nw-stroke) solid var(--nw-line); border-radius: var(--nw-r-lg); box-shadow: var(--nw-lift); padding: 22px; }
.nw-card--inset { background: var(--nw-paper-2); box-shadow: none; border-width: 2px; border-radius: var(--nw-r); padding: 14px 16px; }
.nw-tilt-l { transform: rotate(-1.2deg); }
.nw-tilt-r { transform: rotate(1deg); }
.nw-tape::before { content: ""; position: absolute; top: -12px; left: 50%; width: 86px; height: 24px; transform: translateX(-50%) rotate(-3deg); background: color-mix(in srgb, var(--nw-sun) 70%, transparent); border-left: 2px dotted color-mix(in srgb, var(--nw-ink) 25%, transparent); border-right: 2px dotted color-mix(in srgb, var(--nw-ink) 25%, transparent); }
.nw-stitch { outline: 2px dashed color-mix(in srgb, var(--nw-ink) 28%, transparent); outline-offset: -9px; }

/* ---------- Buttons ---------- */
.nw-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border: var(--nw-stroke) solid var(--nw-line); border-radius: var(--nw-r-pill); background: var(--nw-paper); color: var(--nw-ink); font-family: var(--nw-font-display); font-weight: 600; font-size: 17px; text-decoration: none; cursor: pointer; box-shadow: 0 4px 0 var(--nw-shadow); transition: transform .12s var(--nw-ease-pop), box-shadow .12s; white-space: nowrap; }
.nw-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--nw-shadow); }
.nw-btn:active, .nw-btn.is-pressed { transform: translateY(3px); box-shadow: var(--nw-lift-press); }
.nw-btn:focus-visible, .nw-btn.is-focus, .nw-fcard:focus-visible, .nw-nav a:focus-visible, .nw-nav button:focus-visible, .nw-input:focus-visible, .nw-select:focus-visible { outline: 3px dashed var(--nw-ink); outline-offset: 4px; }
.nw-btn:disabled, .nw-btn.is-disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: 0 2px 0 var(--nw-shadow); }
.nw-btn svg { width: 20px; height: 20px; flex: none; }
.nw-btn--primary { background: var(--nw-tomato); color: var(--nw-on-accent); }
.nw-btn--go { background: var(--nw-leaf); color: var(--nw-on-accent); }
.nw-btn--sun { background: var(--nw-sun); color: var(--nw-on-accent); }
.nw-btn--big { min-height: 56px; font-size: 20px; padding: 0 30px; }
.nw-btn--sm { min-height: 38px; font-size: 15px; padding: 0 14px; box-shadow: 0 3px 0 var(--nw-shadow); }
.nw-btn--quiet { background: transparent; border-color: transparent; box-shadow: none; text-decoration: underline; text-underline-offset: 4px; padding: 0 10px; }
.nw-btn--quiet:hover { box-shadow: none; transform: none; background: color-mix(in srgb, var(--nw-paper) 60%, transparent); }
.nw-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- Form fields ---------- */
.nw-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.nw-label { font-family: var(--nw-font-display); font-weight: 600; font-size: 16px; }
.nw-hint { font-size: 13px; color: var(--nw-ink-soft); }
.nw-input, .nw-select { min-height: 46px; width: 100%; padding: 0 14px; border: var(--nw-stroke) solid var(--nw-line); border-radius: var(--nw-r); background: var(--nw-paper); color: var(--nw-ink); font-family: var(--nw-font-body); font-size: 16px; font-weight: 700; }
.nw-select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--nw-ink) 50%), linear-gradient(135deg, var(--nw-ink) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.nw-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.nw-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 2px solid var(--nw-line); border-radius: var(--nw-r-pill); background: var(--nw-paper); font-weight: 700; font-size: 14px; cursor: pointer; color: var(--nw-ink); font-family: var(--nw-font-body); }
.nw-chip[aria-pressed="true"] { background: var(--nw-sky); color: var(--nw-on-accent); box-shadow: 0 3px 0 var(--nw-shadow); }
.nw-chip[aria-pressed="true"]::before { content: "✔"; }
.nw-range { width: 100%; accent-color: var(--nw-tomato); height: 28px; }
.nw-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 700; }
.nw-switch input { appearance: none; width: 50px; height: 30px; border: var(--nw-stroke) solid var(--nw-line); border-radius: var(--nw-r-pill); background: var(--nw-paper-2); position: relative; cursor: pointer; margin: 0; flex: none; }
.nw-switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: var(--nw-ink-soft); transition: left .18s var(--nw-ease-pop); }
.nw-switch input:checked { background: var(--nw-leaf); }
.nw-switch input:checked::after { left: 23px; background: var(--nw-on-accent); }
.nw-switch-state { font-size: 12px; font-weight: 800; text-transform: uppercase; color: var(--nw-ink-soft); min-width: 26px; }

/* ---------- Callout (prominent note) ---------- */
.nw-callout { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; background: var(--nw-sun-tint); border: var(--nw-stroke) solid var(--nw-line); border-radius: var(--nw-r); box-shadow: 0 4px 0 var(--nw-shadow); }
.nw-callout svg { width: 36px; height: 36px; flex: none; }
.nw-callout b { font-family: var(--nw-font-display); font-weight: 600; font-size: 17px; }

/* ---------- Banners ---------- */
.nw-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; padding: 12px 14px 12px 16px; border: var(--nw-stroke) solid var(--nw-line); border-radius: var(--nw-r); background: var(--nw-paper); box-shadow: 0 3px 0 var(--nw-shadow); }
.nw-banner-icon { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border: 2px solid var(--nw-line); font-weight: 800; font-family: var(--nw-font-display); font-size: 17px; color: var(--nw-on-accent); }
.nw-banner-text { flex: 1 1 260px; min-width: 0; }
.nw-banner-text b { font-family: var(--nw-font-display); font-weight: 600; }
.nw-banner--warn { background: var(--nw-sun-tint); }
.nw-banner--warn .nw-banner-icon { background: var(--nw-sun); clip-path: polygon(50% 0, 100% 100%, 0 100%); border: none; padding-top: 8px; }
.nw-banner--error { background: var(--nw-tomato-tint); }
.nw-banner--error .nw-banner-icon { background: var(--nw-tomato); border-radius: 6px; }
.nw-banner--info { background: var(--nw-sky-tint); }
.nw-banner--info .nw-banner-icon { background: var(--nw-sky); border-radius: 50%; }
.nw-banner--live { background: var(--nw-grape-tint); }
.nw-banner--live .nw-banner-icon { background: var(--nw-tomato); border-radius: 50%; animation: nw-pulse 1.6s ease-in-out infinite; }
.nw-banner--ok { background: var(--nw-leaf-tint); }
.nw-banner--ok .nw-banner-icon { background: var(--nw-leaf); border-radius: 50%; }

/* ---------- Toast (quick confirmation) ---------- */
.nw-toast { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px 10px 12px; background: var(--nw-leaf); color: var(--nw-on-accent); border: var(--nw-stroke) solid var(--nw-line); border-radius: var(--nw-r-pill); box-shadow: 0 4px 0 var(--nw-shadow); font-family: var(--nw-font-display); font-weight: 600; font-size: 16px; animation: nw-pop .35s var(--nw-ease-pop) both; }
.nw-toast-check { width: 26px; height: 26px; border-radius: 50%; background: var(--nw-paper); color: var(--nw-ink); display: grid; place-items: center; border: 2px solid var(--nw-line); font-size: 14px; }

/* ---------- Progress steps ---------- */
.nw-steps { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.nw-step { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: var(--nw-r-pill); border: 2px solid var(--nw-line); background: var(--nw-paper); font-weight: 700; font-size: 14px; }
.nw-step-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--nw-line); font-family: var(--nw-font-display); font-weight: 600; background: var(--nw-paper-2); }
.nw-step--done { background: var(--nw-leaf-tint); }
.nw-step--done .nw-step-n { background: var(--nw-leaf); color: var(--nw-on-accent); }
.nw-step--now { background: var(--nw-sun); color: var(--nw-on-accent); box-shadow: 0 3px 0 var(--nw-shadow); }
.nw-step--now .nw-step-n { background: var(--nw-paper); color: var(--nw-ink); }
.nw-step--todo { opacity: .75; border-style: dashed; }

/* ---------- Instruction card ---------- */
.nw-instr { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.nw-instr-art { width: 120px; height: 120px; flex: none; }
.nw-instr-text { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.nw-instr-text p { font-size: 18px; }

/* ---------- Live cue panel (the big, unmistakable state) ---------- */
.nw-cue { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 330px; padding: 28px 26px; text-align: center; border: 3px solid var(--nw-line); border-radius: var(--nw-r-lg); box-shadow: 0 7px 0 var(--nw-shadow); color: var(--nw-on-accent); animation: nw-pop .4s var(--nw-ease-pop) both; overflow: hidden; }
.nw-cue::after { content: ""; position: absolute; inset: 10px; border: 2px dashed color-mix(in srgb, var(--nw-on-accent) 30%, transparent); border-radius: 18px; pointer-events: none; }
.nw-cue-tag { font-family: var(--nw-font-body); font-weight: 800; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; background: var(--nw-paper); color: var(--nw-ink); border: 2px solid var(--nw-line); border-radius: var(--nw-r-pill); padding: 2px 12px; }
.nw-cue-word { font-family: var(--nw-font-display); font-weight: 700; font-size: 60px; line-height: 1; letter-spacing: -.5px; }
.nw-cue-row { display: flex; align-items: center; justify-content: center; gap: 24px; flex-wrap: wrap; }
.nw-cue-icon { width: 92px; height: 92px; flex: none; }
.nw-count { position: relative; width: 108px; height: 108px; flex: none; }
.nw-count svg { width: 108px; height: 108px; transform: rotate(-90deg); }
.nw-count-track { fill: var(--nw-paper); stroke: var(--nw-line); stroke-width: 3; }
.nw-count-fill { fill: none; stroke: var(--nw-line); stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset .3s linear; }
.nw-count-num { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--nw-font-display); font-weight: 700; font-size: 40px; color: var(--nw-ink); }
.nw-count-num small { position: absolute; bottom: 20px; font-size: 11px; font-weight: 600; font-family: var(--nw-font-body); }
.nw-cue-line { max-width: 720px; background: var(--nw-paper); color: var(--nw-ink); border: var(--nw-stroke) solid var(--nw-line); border-radius: var(--nw-r); padding: 18px 22px; font-size: 24px; line-height: 1.45; font-weight: 700; text-align: left; box-shadow: 0 4px 0 var(--nw-shadow); }
.nw-cue-sub { font-size: 16px; font-weight: 700; }
.nw-cue--ready   { background: var(--nw-sun); }
.nw-cue--quiet   { background: var(--nw-sky); }
.nw-cue--read    { background: var(--nw-tomato); }
.nw-cue--chirp   { background: var(--nw-grape); }
.nw-cue--setting { background: var(--nw-leaf); }
.nw-cue--ready .nw-cue-icon { animation: nw-bounce 1s var(--nw-ease-pop) infinite; }
.nw-cue--quiet .nw-cue-icon { animation: nw-breathe 2.4s ease-in-out infinite; }
.nw-cue--read .nw-cue-word { animation: nw-wiggle .6s ease-in-out 2; }
.nw-cue--setting .nw-gear { animation: nw-spin 2.2s linear infinite; transform-origin: 50% 50%; transform-box: fill-box; }
.nw-wave rect { animation: nw-eq .9s ease-in-out infinite; transform-origin: 50% 100%; transform-box: fill-box; }
.nw-wave rect:nth-child(2) { animation-delay: .15s; } .nw-wave rect:nth-child(3) { animation-delay: .3s; } .nw-wave rect:nth-child(4) { animation-delay: .45s; } .nw-wave rect:nth-child(5) { animation-delay: .6s; }
.nw-cancel-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.nw-cancelling { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; color: var(--nw-miss-ink); }

/* ---------- Result rows ---------- */
.nw-results { display: flex; flex-direction: column; gap: 10px; }
.nw-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 4px 14px; align-items: center; padding: 12px 16px; background: var(--nw-paper); border: 2px solid var(--nw-line); border-radius: var(--nw-r); }
.nw-row-badge { width: 36px; height: 36px; display: grid; place-items: center; border: 2px solid var(--nw-line); font-weight: 800; font-size: 18px; color: var(--nw-on-accent); grid-row: span 2; }
.nw-row-name { font-family: var(--nw-font-display); font-weight: 600; font-size: 16px; }
.nw-row-plain { font-weight: 700; }
.nw-row-num { font-size: 13px; color: var(--nw-ink-soft); font-variant-numeric: tabular-nums; font-weight: 600; }
.nw-row-state { grid-row: span 2; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; padding: 4px 10px; border-radius: var(--nw-r-pill); border: 2px solid currentColor; }
.nw-row-why { grid-column: 2 / -1; margin-top: 6px; padding: 10px 12px; border-radius: var(--nw-r-sm); background: var(--nw-tomato-tint); font-size: 14px; }
.nw-row-why b { display: block; }
.nw-row--pass .nw-row-badge { background: var(--nw-leaf); border-radius: 50%; }
.nw-row--pass .nw-row-state { color: var(--nw-pass-ink); }
.nw-row--miss { background: var(--nw-paper); border-width: 2.5px; border-style: dashed; }
.nw-row--miss .nw-row-badge { background: var(--nw-tomato); border-radius: 6px; transform: rotate(-6deg); }
.nw-row--miss .nw-row-state { color: var(--nw-miss-ink); }
.nw-row--info .nw-row-badge { background: var(--nw-sky); border-radius: 50%; }
.nw-row--info .nw-row-state { color: var(--nw-ink-soft); }

/* ---------- Headline sticker (result / quick check) ---------- */
.nw-headline { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.nw-sticker { width: 74px; height: 74px; flex: none; display: grid; place-items: center; border: 3px solid var(--nw-line); border-radius: 50%; box-shadow: 0 4px 0 var(--nw-shadow); font-family: var(--nw-font-display); font-weight: 700; font-size: 34px; color: var(--nw-on-accent); transform: rotate(-8deg); animation: nw-stamp .5s var(--nw-ease-pop) both; }
.nw-sticker--pass { background: var(--nw-leaf); }
.nw-sticker--miss { background: var(--nw-sun); border-radius: 18px; }

/* ---------- Format cards ---------- */
.nw-fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.nw-fcard { position: relative; display: flex; flex-direction: column; gap: 8px; text-align: left; padding: 0 16px 16px; min-height: 168px; background: var(--nw-paper); color: var(--nw-ink); border: var(--nw-stroke) solid var(--nw-line); border-radius: var(--nw-r-lg); box-shadow: var(--nw-lift); cursor: pointer; font-family: var(--nw-font-body); font-size: 14px; transition: transform .15s var(--nw-ease-pop), box-shadow .15s; }
.nw-fcard:hover { transform: translateY(-3px) rotate(-.6deg); box-shadow: var(--nw-lift-hover); }
.nw-fcard:active { transform: translateY(3px); box-shadow: var(--nw-lift-press); }
.nw-fcard-tab { height: 18px; margin: 0 -16px 6px; border-bottom: 2px solid var(--nw-line); border-radius: 21px 21px 0 0; }
.nw-fcard-icon { width: 40px; height: 40px; }
.nw-fcard-name { font-family: var(--nw-font-display); font-weight: 600; font-size: 19px; }
.nw-fcard-active { position: absolute; top: 6px; right: -10px; transform: rotate(8deg); background: var(--nw-sun); color: var(--nw-on-accent); border: 2px solid var(--nw-line); border-radius: 8px; padding: 2px 10px; font-family: var(--nw-font-display); font-weight: 600; font-size: 14px; box-shadow: 0 3px 0 var(--nw-shadow); }
.nw-fcard[aria-pressed="true"] { border-width: 3.5px; outline: 3px solid var(--nw-sun); outline-offset: 3px; }
.nw-fcard--new { border-style: dashed; box-shadow: none; background: transparent; align-items: center; justify-content: center; text-align: center; padding-top: 16px; }
.nw-active-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.nw-active-pill { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px 10px 12px; background: var(--nw-paper); border: var(--nw-stroke) solid var(--nw-line); border-radius: var(--nw-r-pill); box-shadow: 0 4px 0 var(--nw-shadow); font-size: 16px; }
.nw-active-pill b { font-family: var(--nw-font-display); font-weight: 600; }
.nw-active-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--nw-leaf); border: 2px solid var(--nw-line); }

/* ---------- Drawer (edit format) ---------- */
.nw-drawer { display: flex; flex-direction: column; gap: 16px; background: var(--nw-paper); border: var(--nw-stroke) solid var(--nw-line); border-radius: var(--nw-r-lg); box-shadow: -6px 6px 0 var(--nw-shadow); padding: 22px; }
.nw-set { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: center; padding: 12px 0; border-bottom: 2px dashed color-mix(in srgb, var(--nw-ink) 22%, transparent); }
.nw-set:last-child { border-bottom: none; }
.nw-set-value { font-family: var(--nw-font-display); font-weight: 600; font-size: 18px; font-variant-numeric: tabular-nums; }
.nw-set-value small { font-family: var(--nw-font-body); font-size: 12px; color: var(--nw-ink-soft); font-weight: 700; margin-left: 2px; }
.nw-set .nw-range, .nw-set .nw-hint { grid-column: 1 / -1; }
.nw-stepper { display: inline-flex; align-items: center; border: var(--nw-stroke) solid var(--nw-line); border-radius: var(--nw-r-pill); background: var(--nw-paper-2); overflow: hidden; }
.nw-stepper button { width: 40px; height: 40px; border: none; background: transparent; font-family: var(--nw-font-display); font-weight: 700; font-size: 20px; color: var(--nw-ink); cursor: pointer; }
.nw-stepper button:hover { background: var(--nw-sun-tint); }
.nw-stepper span { min-width: 70px; text-align: center; font-family: var(--nw-font-display); font-weight: 600; font-size: 17px; }

/* ---------- Numbered help steps ---------- */
.nw-numlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; counter-reset: nw; }
.nw-numlist li { counter-increment: nw; display: flex; gap: 12px; align-items: flex-start; font-size: 16px; }
.nw-numlist li::before { content: counter(nw); flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--nw-line); background: var(--nw-sky); color: var(--nw-on-accent); font-family: var(--nw-font-display); font-weight: 600; }
.nw-plan li::before { background: var(--nw-sun); }

/* ---------- Board labels (design canvas only, not app UI) ---------- */
.nw-label-tag { display: inline-block; font-family: var(--nw-font-body); font-weight: 800; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--nw-ink-soft); }

/* ---------- Motion ---------- */
@keyframes nw-pop { 0% { transform: scale(.9) rotate(-1.5deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes nw-stamp { 0% { transform: scale(1.6) rotate(-20deg); opacity: 0; } 100% { transform: rotate(-8deg); opacity: 1; } }
@keyframes nw-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes nw-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes nw-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-3deg); } 75% { transform: rotate(3deg); } }
@keyframes nw-spin { to { transform: rotate(360deg); } }
@keyframes nw-eq { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
@keyframes nw-blink { 50% { opacity: .35; } }
@keyframes nw-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) {
  .nw *, .nw *::before, .nw *::after { animation: none !important; transition: none !important; }
}
