/* ZeroWrong app in the brand's board-and-paper look (08.10.2026), matching zerowrong.com.
 *
 * Loaded last on the merchant-facing pages (the four console sections, sign-in, sign-up,
 * onboarding). It changes colour tokens, type and the chrome, plus two phone layout fixes the
 * bigger hand-written numbers need. No behaviour changes.
 * Dark theme = chalkboard, light theme = paper. The three kinds of information keep their
 * outline colours (red = problem, blue = what the customer typed, green = delivery), in the
 * brand's chalk tones; outlines only, no glow (Niki 06.10). Every colour lives in this file.
 * The shop-styled previews (the order form, the product button) keep their own look.
 */

:root {
  --bg: #15171A; --bg-2: #1A1D21;
  --panel: rgba(241, 238, 230, .035); --panel-2: rgba(241, 238, 230, .06);
  --edge: rgba(241, 238, 230, .13); --edge-2: rgba(241, 238, 230, .24);
  --ink: #F1EEE6; --ink-2: #BDB9B0; --muted: #918D85;
  --ok-rgb: 63, 215, 160; --info-rgb: 106, 166, 255; --bad-rgb: 255, 107, 94;
  --acc: rgb(var(--ok-rgb)); --acc-2: rgb(var(--info-rgb)); --bad: rgb(var(--bad-rgb)); --warn: #F2B65E;
  --ok-ink: #78E6BD; --info-ink: #A3C6FF; --bad-ink: #FF9A90; --warn-ink: #F2B65E;
  --glow-acc: none; --glow-soft: none;
  --surface: #1A1D21; --surface-2: #1E2126; --field: #121417;
  --line: rgba(241, 238, 230, .10); --line-2: rgba(241, 238, 230, .22); --line-3: rgba(241, 238, 230, .36);
  --led-base: 241, 238, 230;
  --backdrop: rgba(9, 10, 12, .8); --focus: #F1EEE6;
  /* the one filled button: paper on the board, ink on paper */
  --primary: #F1EDE3; --primary-hi: #FFFFFF; --primary-ink: #1A1A1C;
  --sans: "Onest", system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --hand: "Shantell Sans", "Onest", system-ui, sans-serif;
  --texture: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  --texture-blend: screen; --texture-op: .07;
  /* a hand-drawn underline, used as a mask so it takes the text colour */
  --scribble: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 12' preserveAspectRatio='none'><path d='M3 8 C70 2 150 11 297 4' fill='none' stroke='black' stroke-width='3.2' stroke-linecap='round'/></svg>");
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #F1EDE3; --bg-2: #EAE5D9;
  --panel: #F6F3EC; --panel-2: #FAF8F3;
  --edge: rgba(26, 26, 28, .16); --edge-2: rgba(26, 26, 28, .28);
  --ink: #1A1A1C; --ink-2: #4A4844; --muted: #66625C;
  --ok-rgb: 14, 134, 92; --info-rgb: 36, 99, 209; --bad-rgb: 194, 55, 45;
  --warn: #8F5600; --ok-ink: #0E7A54; --info-ink: #2158C0; --bad-ink: #B3322A; --warn-ink: #8F5600;
  --surface: #F7F4ED; --surface-2: #FBF9F4; --field: #FFFFFF;
  --line: rgba(26, 26, 28, .12); --line-2: rgba(26, 26, 28, .24); --line-3: rgba(26, 26, 28, .38);
  --led-base: 26, 26, 28;
  --backdrop: rgba(26, 26, 28, .45); --focus: #1A1A1C;
  --primary: #1A1A1C; --primary-hi: #000000; --primary-ink: #F1EDE3;
  --texture: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .18 0'/></filter><rect width='100%' height='100%' filter='url(%23g)'/></svg>");
  --texture-blend: multiply; --texture-op: .55;
  --card-shadow: 0 1px 2px rgba(26, 26, 28, .06), 0 18px 40px -28px rgba(26, 26, 28, .35);
  color-scheme: light;
}

/* the page: chalkboard or paper, no aurora */
body, [data-theme="light"] body { background: var(--bg); }
.field, [data-theme="light"] .field { display: none; }
.grain, [data-theme="light"] .grain { display: block; z-index: 1; opacity: var(--texture-op); mix-blend-mode: var(--texture-blend); background-image: var(--texture); }
/* Russian-style Cyrillic letterforms, as on zerowrong.com */
body, body * { font-feature-settings: "locl" 0; }

/* the panel everything sits on */
.card { background: var(--surface); border-color: var(--edge); box-shadow: 0 40px 90px -50px rgba(0, 0, 0, .9); }
[data-theme="light"] .card { box-shadow: var(--card-shadow); }

/* the wordmark instead of the old Z */
.brand { gap: 12px; }
.brand .logo-mark { display: none; }
.brand .wm { display: block; width: 177px; height: 31px; background: currentColor;
  -webkit-mask: url(/brand/wordmark.svg) left center / contain no-repeat; mask: url(/brand/wordmark.svg) left center / contain no-repeat; }

/* headings in the brand's hand; body text stays in a plain, readable sans */
.card h1, dialog h2 { font-family: var(--hand); font-weight: 800; letter-spacing: -.01em; }
.card > h1 { position: relative; width: fit-content; font-size: clamp(30px, 3.4vw, 40px); line-height: 1.05; margin-bottom: 14px; padding-bottom: 6px; }
.card > h1::after { content: ""; position: absolute; left: 0; right: -4%; bottom: -4px; height: 10px; background: currentColor;
  -webkit-mask: var(--scribble) 0 0 / 100% 100% no-repeat; mask: var(--scribble) 0 0 / 100% 100% no-repeat; opacity: .85; }
.card h2 { font-family: var(--hand); font-weight: 700; letter-spacing: -.005em; }
dialog h2 { font-size: 32px; }

/* the section tabs */
.sections { border-bottom-color: var(--line-2); }
.sections a { font: 600 14px/1 var(--sans); }
.sections a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.mode { background: transparent; border-color: var(--edge-2); }

/* numbers read like the site: big, hand-written */
.sum b { font-family: var(--hand); font-weight: 800; font-size: 38px; line-height: 1; letter-spacing: -.01em; }
.sum span { font-size: 13px; }

/* buttons: outlined chalk; the one filled button is paper (ink on the paper theme) */
.btn { color: var(--primary-ink); background: var(--primary); box-shadow: none; font: 700 15px/1 var(--hand); border-radius: 12px; }
.btn:hover { box-shadow: none; background: var(--primary-hi); }
.btn::after { display: none; }
.btn-ghost { color: var(--ink); background: transparent; border: 1.5px solid var(--edge-2); }
.btn-ghost:hover { background: var(--panel-2); }
button.pick, a.pick, button.undo { font-family: var(--hand); font-weight: 700; }
/* a card never jumps under the pointer: on a phone the lift pushed the save bar off screen */
.card:hover { transform: none; }
.pick.main { color: var(--primary-ink); background: var(--primary); }
.pick.main:hover { background: var(--primary-hi); }
.more { border-width: 1.5px; }
.more:hover { border-color: var(--ink); background: var(--panel-2); }
.filters button { border-width: 1.5px; }
.filters button[aria-pressed=true] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* links and focus in ink, not green */
.alt a, .check a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.f input:focus-visible { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
:where(a, button, summary, input, select, [tabindex]):focus-visible { outline-color: var(--focus); }

/* the order popup */
dialog { background: var(--surface); border-color: var(--line-2); }
.d-who { font-weight: 600; }

/* The app sits straight on the board, the way the site does: no outer panel. The inner
   sections keep their chalk edge. */
.card.wide, [data-theme="light"] .card.wide { background: transparent; border-color: transparent; box-shadow: none; }

/* Sign-in and sign-up are a pinned paper sheet: drawn by brand-ui.css (.pg-auth .card), like
   every other sheet in the console, so the ink flips with the ground and the pin is the same. */

/* A chosen option is marked in ink. Green stays for delivery, so it does not also mean "selected". */
.chip[aria-pressed=true], .bar .pick[aria-pressed=true] { color: var(--ink); border-color: var(--ink); background: var(--panel-2); }
.q.on { border-color: var(--edge-2); }
input[type=range], input[type=checkbox], input[type=radio] { accent-color: var(--ink); }
summary::after { color: var(--ink-2); }

/* Phone: the four counts sit two by two instead of three and one; the underline stops at the text. */
@media (max-width: 560px) {
  .sum { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
  .card > h1::after { right: 0; }
}
