/* QRnaka - design system (no build step). Tokens, base, layout, components, pages.
   Look: the QR Hug brand kit (design/qrnaka-qr-hug-brand-kit-v1) - cream paper, deep forest ink, one forest accent,
   light mint on dark, the kit's yellow only in the logo (no purple-blue gradients, no sparkles, no cards in cards).
   Rules (kv-flow 02 §3): one type scale, 4/8 px spacing, thin icons, real dark mode, 150-250 ms motion,
   inputs 16 px, tap targets >= 44 px, nothing wider than the screen at 320 px. */

@font-face { font-family: "Anuphan"; font-style: normal; font-weight: 100 700; font-display: swap; src: url("../fonts/anuphan/anuphan-thai-wght-normal.woff2") format("woff2"); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Anuphan"; font-style: normal; font-weight: 100 700; font-display: swap; src: url("../fonts/anuphan/anuphan-latin-ext-wght-normal.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Anuphan"; font-style: normal; font-weight: 100 700; font-display: swap; src: url("../fonts/anuphan/anuphan-latin-wght-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
    color-scheme: light;
    --font: "Anuphan", system-ui, -apple-system, "Segoe UI", "Leelawadee UI", "Noto Sans Thai", sans-serif;
    --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

    /* the QR Hug brand kit's colours (design/qrnaka-qr-hug-brand-kit-v1, owner 28 Oct 2026); the kit names no colour
       for words, so --brand-ink is a deeper shade of its forest */
    --brand-forest: #28594d;
    --brand-mint: #66a58a;
    --brand-yellow: #f5d780;
    --brand-cream: #faf9ed;
    --brand-light-mint: #a8d8c4;
    --brand-pale: #e3f0e5;
    --brand-ink: #193830;

    --bg: var(--brand-cream);
    --bg-elev: #ffffff;
    --bg-sunken: #efefe1;
    --bg-tint: #fcfbf4;
    --ink: var(--brand-ink);
    --ink-2: #3a4b45;
    --ink-3: #5a6b64;
    --line: #e1e2d4;
    --line-strong: #c9cebf;

    --accent: var(--brand-forest);
    --accent-press: #1f473d;
    --accent-text: var(--brand-forest);
    --accent-soft: var(--brand-pale);
    --accent-line: rgba(40, 89, 77, .28);
    --accent-shadow: rgba(40, 89, 77, .7);
    --on-accent: #ffffff;
    /* an accent drawn on the ink colour (the chosen type, toasts): light mint, like "naka" of the kit's logo on dark */
    --accent-on-ink: var(--brand-light-mint);

    --ok: var(--brand-forest);
    --ok-soft: var(--brand-pale);
    --warn: #8a5300;
    --warn-soft: #faeed6;
    --danger: #b3261e;
    --danger-soft: #fbe6e3;

    /* the logo (partials/logo, partials/logo-mark): the kit's primary colours */
    --logo-mochi: var(--brand-forest);
    --logo-bits: var(--brand-mint);
    --logo-spark: var(--brand-yellow);
    --logo-qr: var(--brand-forest);
    --logo-naka: var(--brand-mint);

    --focus: 0 0 0 3px rgba(40, 89, 77, .3);
    --shadow-1: 0 1px 2px rgba(25, 56, 48, .06), 0 1px 1px rgba(25, 56, 48, .03);
    --shadow-2: 0 14px 34px -16px rgba(25, 56, 48, .26), 0 2px 6px rgba(25, 56, 48, .05);
    --shadow-3: 0 30px 60px -24px rgba(25, 56, 48, .34);

    --r-s: 8px;
    --r: 12px;
    --r-l: 18px;
    --r-xl: 24px;
    --r-pill: 999px;

    --fs-xs: 12px;
    --fs-s: 14px;
    --fs-m: 16px;
    --fs-l: 18px;
    --fs-xl: 22px;
    --fs-2xl: 28px;
    --fs-3xl: 36px;

    --ease: cubic-bezier(.2, .7, .2, 1);
    --dur: 180ms;
    --header-h: 72px;
    --container: 1200px;
    --gutter: 24px;
    --glass: rgba(250, 249, 237, .82);
    --checker: #ebebdd;
}

/* dark when the visitor chooses it: the kit's reverse look - cream words and light mint on deep forest */
[data-theme="dark"] {
    color-scheme: dark;
    --bg: #10231d;
    --bg-elev: #18322b;
    --bg-sunken: #214239;
    --bg-tint: #132a23;
    --ink: var(--brand-cream);
    --ink-2: #ccd8d1;
    --ink-3: #9fb3aa;
    --line: #29453d;
    --line-strong: #3a5a51;
    --accent: var(--brand-light-mint);
    --accent-press: #c3e7d8;
    --accent-text: var(--brand-light-mint);
    --accent-soft: #1d3d34;
    --accent-line: rgba(168, 216, 196, .3);
    --accent-shadow: rgba(0, 0, 0, .55);
    --on-accent: #10231d;
    --accent-on-ink: var(--brand-forest);
    --ok: var(--brand-light-mint);
    --ok-soft: #1d3d34;
    --warn: #f0b660;
    --warn-soft: #362a12;
    --danger: #ff8f84;
    --danger-soft: #3d1b18;
    --logo-mochi: var(--brand-cream);
    --logo-bits: var(--brand-mint);
    --logo-spark: var(--brand-yellow);
    --logo-qr: var(--brand-cream);
    --logo-naka: var(--brand-light-mint);
    --focus: 0 0 0 3px rgba(168, 216, 196, .35);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: 0 14px 34px -14px rgba(0, 0, 0, .75), 0 2px 6px rgba(0, 0, 0, .35);
    --shadow-3: 0 30px 60px -24px rgba(0, 0, 0, .85);
    --glass: rgba(16, 35, 29, .82);
    --checker: #22352f;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
    margin: 0; min-height: 100vh; display: flex; flex-direction: column;
    background: var(--bg); color: var(--ink);
    font: 400 var(--fs-m)/1.6 var(--font);
    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
main { flex: 1 0 auto; }
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 12px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-l); }
small, .small { font-size: var(--fs-s); }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-s); }
::selection { background: var(--accent-soft); color: var(--ink); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.ink-2 { color: var(--ink-2); }
.mono { font-family: var(--mono); font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon-s { width: 16px; height: 16px; }
.icon-l { width: 24px; height: 24px; }
.link { color: var(--accent-text); font-weight: 500; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link > .icon { display: inline-block; vertical-align: -3px; }

/* ---------- layout ---------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.container-narrow { max-width: 780px; }
.section { padding-block: 56px; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.between { justify-content: space-between; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; height: var(--header-h); background: var(--glass); -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--line); }
.site-header .container { height: 100%; display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; color: var(--ink); white-space: nowrap; }
/* the kit's logo (partials/logo): 56 px high and 136 px across on a computer; the 72 px header keeps the clear space
   the kit asks for (the yellow square's size, 8 px) above and below */
.logo { --logo-h: 56px; display: block; flex: none; height: var(--logo-h); width: auto; max-width: none; }
.logo .lg-mochi { fill: var(--logo-mochi); }
.logo .lg-bits { fill: var(--logo-bits); }
.logo .lg-spark { fill: var(--logo-spark); }
.logo .lg-qr { fill: var(--logo-qr); }
.logo .lg-naka { fill: var(--logo-naka); }
.nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav a { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: var(--r-pill); font-size: var(--fs-s); font-weight: 500; color: var(--ink-2); transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.nav a:hover { background: var(--bg-sunken); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.header-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-pill); border: 1px solid transparent; background: transparent; color: var(--ink-2); transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.icon-btn:hover { background: var(--bg-sunken); color: var(--ink); }
.lang-switch { display: inline-flex; align-items: center; height: 36px; padding: 3px; border-radius: var(--r-pill); background: var(--bg-sunken); }
.lang-switch a { display: inline-grid; place-items: center; min-width: 36px; height: 30px; padding: 0 8px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; color: var(--ink-3); }
.lang-switch a[aria-current="true"] { background: var(--bg-elev); color: var(--ink); box-shadow: var(--shadow-1); }
.menu-btn { display: none; }

/* bottom tab bar on phones: the app's five pages within thumb reach */
.tabbar { display: none; }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 18px; border-radius: var(--r-pill);
    border: 1px solid var(--line-strong); background: var(--bg-elev); color: var(--ink);
    font-size: var(--fs-s); font-weight: 600; line-height: 1; white-space: nowrap; text-align: center;
    transition: transform var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 10px 24px -12px var(--accent-shadow); }
.btn-primary:hover { background: var(--accent-press); border-color: var(--accent-press); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-dark:hover { border-color: var(--ink); opacity: .92; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg-sunken); border-color: transparent; color: var(--ink); }
.btn-soft { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.btn-soft:hover { border-color: var(--accent-line); }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: var(--fs-m); }
.btn-s { min-height: 36px; padding: 0 14px; font-size: var(--fs-xs); }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-busy { opacity: .55; pointer-events: none; }
.btn.is-busy::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 3px 10px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; line-height: 1.2; white-space: nowrap; background: var(--bg-sunken); color: var(--ink-2); }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-wait .dot { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- cards ---------- */
.card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-1); }
.card-pad { padding: 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { font-size: var(--fs-m); }
.card-body { padding: 20px 22px; }
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r); background: var(--bg-tint); border: 1px solid var(--line); font-size: var(--fs-s); color: var(--ink-2); }
.note .icon { margin-top: 1px; color: var(--ink-3); }
.note-warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.note-warn .icon { color: var(--warn); }
.note-ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.note-ok .icon { color: var(--ok); }
.note-danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: var(--fs-s); font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: var(--fs-xs); color: var(--ink-3); }
.photo-picker > .hint { display: flex; align-items: flex-start; gap: 6px; }
.photo-picker > .hint .icon { flex: none; margin-top: 2px; }
.field .opt { font-weight: 500; color: var(--ink-3); }
.field .opt::before { content: " · "; }
.error { font-size: var(--fs-xs); font-weight: 600; color: var(--danger); }
p.error { margin: 0; font-size: var(--fs-s); }
.field .warning { font-size: var(--fs-xs); font-weight: 600; color: var(--warn); }
.input, .select, .textarea {
    width: 100%; min-height: 48px; padding: 11px 14px; border-radius: var(--r);
    border: 1px solid var(--line-strong); background: var(--bg-elev); color: var(--ink);
    font-size: 16px; line-height: 1.4;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.textarea { resize: vertical; min-height: 88px; }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); opacity: .8; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.field.has-error .input, .field.has-error .textarea { border-color: var(--danger); }
.field.has-error .check input[type="checkbox"] { outline: 2px solid var(--danger); outline-offset: 2px; }
.select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235a6b64' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 14px; }
.form-grid > .full { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: var(--fs-s); color: var(--ink-2); cursor: pointer; user-select: none; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: var(--r); background: var(--bg-sunken); }
.seg button { flex: 1 1 auto; min-height: 40px; min-width: 44px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font-size: var(--fs-s); font-weight: 600; transition: background var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--bg-elev); color: var(--ink); box-shadow: var(--shadow-1); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; font-size: var(--fs-s); font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { position: relative; width: 44px; height: 26px; flex: none; border-radius: var(--r-pill); background: var(--line-strong); transition: background var(--dur) var(--ease); }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform var(--dur) var(--ease); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: var(--focus); }
.range { width: 100%; accent-color: var(--accent); height: 28px; }

/* ---------- page intro ---------- */
.intro { padding: 28px 0 18px; }
.intro h1 { font-size: clamp(24px, 3.2vw, 32px); letter-spacing: -.015em; }
.intro p { margin: 6px 0 0; color: var(--ink-3); max-width: 46em; }
.trust { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.trust span { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 12px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--bg-elev); font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); }
.trust .icon { width: 16px; height: 16px; color: var(--accent-text); }

/* ---------- hero of the generator pages (owner 29 Oct 2026: calm and premium, mochi of the logo drifting down in many
   colours, interactive - public/js/lib/hero.js; a red wave under the free word) ---------- */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.intro.hero { --hero-red: #e04b3c; --hero-glow: rgba(168, 216, 196, .4); position: relative; isolation: isolate; overflow: hidden; margin: 14px 0 24px; padding: 32px 44px 30px; border: 1px solid var(--line); border-radius: 28px; background: radial-gradient(90% 130% at 100% 0%, var(--hero-glow), transparent 62%), linear-gradient(180deg, var(--bg-elev), var(--bg-tint)); box-shadow: var(--shadow-1); }
[data-theme="dark"] .intro.hero { --hero-red: #ff7d6e; --hero-glow: rgba(168, 216, 196, .12); }
.hero-sky { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
/* low enough that a 1366 x 768 laptop still shows the download button without scrolling (simulation step) */
.hero-copy { position: relative; z-index: 1; max-width: 760px; }
.intro.hero h1 { font-size: clamp(28px, 3vw, 40px); line-height: 1.15; letter-spacing: -.02em; text-wrap: balance; }
.intro.hero p { margin-top: 8px; color: var(--ink-2); max-width: 46em; }
.intro.hero.hero-over { cursor: pointer; }
/* the free word: a hand-drawn red wave, drawn once when the page opens */
.hero-free { position: relative; display: inline-block; white-space: nowrap; }
.hero-wave { position: absolute; left: -3%; bottom: -.2em; width: 106%; height: .36em; overflow: visible; pointer-events: none; }
.hero-wave path { fill: none; stroke: var(--hero-red); stroke-width: 3.5px; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 0; animation: hero-draw .9s .3s cubic-bezier(.6, .05, .25, 1) both; }
@keyframes hero-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
/* the falling mochi: the brand's greens and a few soft colours, lighter lines and darker bodies on the dark theme */
.mochi-fall { --mochi-bits: var(--brand-mint); --mochi-spark: var(--brand-yellow); position: absolute; left: 0; top: 0; will-change: transform; transition: opacity .5s var(--ease); }
.mochi-fall svg { display: block; width: 100%; height: 100%; overflow: visible; }
.mochi-fall[data-tone="1"] { --mochi-ink: #28594d; --mochi-body: #e3f0e5; }
.mochi-fall[data-tone="2"] { --mochi-ink: #4e9478; --mochi-body: #e8f5ee; }
.mochi-fall[data-tone="3"] { --mochi-ink: #d9694b; --mochi-body: #fce3da; }
.mochi-fall[data-tone="4"] { --mochi-ink: #4f7fae; --mochi-body: #e1ecf6; }
.mochi-fall[data-tone="5"] { --mochi-ink: #c4962a; --mochi-body: #fff3cc; }
.mochi-fall[data-tone="6"] { --mochi-ink: #8366b8; --mochi-body: #eee8f8; }
[data-theme="dark"] .mochi-fall[data-tone="1"] { --mochi-ink: #a8d8c4; --mochi-body: #1d3d34; }
[data-theme="dark"] .mochi-fall[data-tone="2"] { --mochi-ink: #8fd3b6; --mochi-body: #18392f; }
[data-theme="dark"] .mochi-fall[data-tone="3"] { --mochi-ink: #f4a58c; --mochi-body: #3a2621; }
[data-theme="dark"] .mochi-fall[data-tone="4"] { --mochi-ink: #9dc1e6; --mochi-body: #1f2e3d; }
[data-theme="dark"] .mochi-fall[data-tone="5"] { --mochi-ink: #f5d780; --mochi-body: #3a321a; }
[data-theme="dark"] .mochi-fall[data-tone="6"] { --mochi-ink: #c5b3ec; --mochi-body: #2c2540; }
.mochi-bit { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 2px; pointer-events: none; }
/* laptops (768 px high): tighter still, so the download button stays whole on screen beside a real code */
@media (min-width: 641px) and (max-height: 920px) {
    .intro.hero { margin: 8px 0 18px; padding: 22px 32px 20px; }
    .intro.hero h1 { font-size: clamp(26px, 2.5vw, 34px); }
    .intro.hero p { margin-top: 6px; }
}
@media (max-width: 640px) {
    .intro.hero { margin: 12px 0 16px; padding: 24px 18px 22px; border-radius: 22px; }
    .intro.hero h1 { font-size: 28px; line-height: 1.3; }
    .hero-wave { bottom: -.14em; height: .3em; }
    .intro.hero p { margin-top: 8px; font-size: var(--fs-s); }
}
@media (prefers-reduced-motion: reduce) {
    .hero-wave path { animation: none; stroke-dashoffset: 0; }
}

/* ---------- generator ---------- */
.gen { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 24px; align-items: start; padding-bottom: 56px; }
.gen-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.types { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.type-btn { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg-elev); color: var(--ink-2); font-size: var(--fs-s); font-weight: 600; text-align: left; transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.type-btn .icon { color: var(--ink-3); transition: color var(--dur) var(--ease); }
.type-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.type-btn[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--bg); box-shadow: var(--shadow-2); }
.type-btn[aria-pressed="true"] .icon { color: var(--accent-on-ink); }
.type-btn span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.panel { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-1); }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px 0; }
.panel-head h2 { font-size: var(--fs-l); }
.panel-head p { margin: 2px 0 0; font-size: var(--fs-s); color: var(--ink-3); }
.panel-body { padding: 18px 22px 22px; }
.panel-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); }
.privacy-line { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: var(--fs-xs); color: var(--ink-3); }
.privacy-line .icon { width: 16px; height: 16px; color: var(--accent-text); }

.style-sec { border-top: 1px solid var(--line); }
.style-sec:first-child { border-top: 0; }
.style-sec > summary { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 22px; cursor: pointer; list-style: none; font-weight: 600; }
.style-sec > summary::-webkit-details-marker { display: none; }
.style-sec > summary .icon { color: var(--ink-3); }
.style-sec > summary .chev { margin-left: auto; transition: transform var(--dur) var(--ease); }
.style-sec[open] > summary .chev { transform: rotate(180deg); }
.style-sec > summary .sum { margin-left: auto; font-size: var(--fs-xs); font-weight: 500; color: var(--ink-3); }
.style-sec > summary .sum + .chev { margin-left: 8px; }
.style-body { padding: 0 22px 22px; display: flex; flex-direction: column; gap: 16px; }

.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.preset { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 6px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg-elev); font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); }
.preset:hover { border-color: var(--line-strong); }
.preset[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; color: var(--ink); }
.preset svg { width: 48px; height: 48px; border-radius: 8px; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.choice { display: grid; place-items: center; aspect-ratio: 1; min-height: 56px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg-elev); color: var(--ink); }
.choice:hover { border-color: var(--line-strong); }
.choice[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: var(--accent-soft); }
.choice svg { width: 34px; height: 34px; }
.choice-named { display: flex; flex-direction: column; justify-content: center; gap: 6px; aspect-ratio: auto; min-height: 88px; padding: 10px 4px 8px; }
.choice-named svg { width: 40px; height: 40px; border-radius: 6px; }
.choice-name { font-size: 11px; font-weight: 600; line-height: 1.2; color: var(--ink-2); text-align: center; overflow-wrap: anywhere; }
.choice-grid:has(.choice-named) { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
.field .hint.warning { color: var(--warn); font-weight: 600; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--bg-elev); box-shadow: 0 0 0 1px var(--line-strong); }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--accent); }
.color-pick { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px 0 6px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--bg-elev); font-size: var(--fs-xs); font-weight: 600; font-family: var(--mono); }
.color-pick input[type="color"] { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.color-pick input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-pick input[type="color"]::-webkit-color-swatch { border: 1px solid var(--line-strong); border-radius: 50%; }
.color-pick input[type="color"]::-moz-color-swatch { border: 1px solid var(--line-strong); border-radius: 50%; }
[data-theme="dark"] .color-pick input[type="color"]::-webkit-color-swatch { border-color: var(--ink-3); box-shadow: 0 0 0 2px var(--bg-sunken); }
[data-theme="dark"] .color-pick input[type="color"]::-moz-color-swatch { border-color: var(--ink-3); }
.color-row { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px 14px; }
.color-row .label { white-space: nowrap; }
.levels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.level { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 64px; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg-elev); text-align: left; }
.level b { font-size: var(--fs-l); line-height: 1.1; }
.level small { font-size: var(--fs-xs); color: var(--ink-3); }
.level:hover { border-color: var(--line-strong); }
.level[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: var(--accent-soft); }
.level[aria-pressed="true"] small { color: var(--accent-text); }
.upload { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r); border: 1px dashed var(--line-strong); background: var(--bg-tint); }
.upload img { width: 48px; height: 48px; object-fit: contain; border-radius: 8px; background: var(--bg-elev); }
.upload .grow { font-size: var(--fs-s); color: var(--ink-3); }
.upload input[type="file"] { display: none; }

/* preview column */
.preview { position: sticky; top: calc(var(--header-h) + 16px); display: flex; flex-direction: column; gap: 14px; }
.preview-card { overflow: hidden; }
.stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px 28px 28px; background: var(--bg-tint); border-bottom: 1px solid var(--line); min-height: 360px; }
.stage.is-transparent { background-color: var(--bg-elev); background-image: linear-gradient(45deg, var(--checker) 25%, transparent 25%), linear-gradient(-45deg, var(--checker) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, var(--checker) 75%), linear-gradient(-45deg, transparent 75%, var(--checker) 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
.stage-code { width: 100%; max-width: 320px; filter: drop-shadow(0 18px 30px rgba(25, 56, 48, .14)); transition: opacity var(--dur) var(--ease); }
.stage-code svg, .stage-code canvas, .stage-code img { width: 100%; height: auto; }
.stage.is-empty .stage-code { opacity: .16; filter: none; }
.stage-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; font-size: var(--fs-s); color: var(--ink-3); pointer-events: none; }
.stage-empty span { padding: 8px 14px; border-radius: var(--r-pill); background: var(--bg-elev); border: 1px solid var(--line); }
.stage-badge { align-self: stretch; display: flex; justify-content: center; min-height: 26px; }
.preview-info { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 14px 18px; font-size: var(--fs-xs); color: var(--ink-3); border-bottom: 1px solid var(--line); }
.preview-info b { color: var(--ink-2); font-weight: 600; }
.summary { padding: 14px 18px; border-bottom: 1px solid var(--line); display: grid; gap: 6px; }
.summary div { display: flex; justify-content: space-between; gap: 12px; font-size: var(--fs-s); }
.summary dt { color: var(--ink-3); flex: none; }
.summary dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.damage { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.damage-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: var(--fs-s); font-weight: 600; }
.damage-head label { display: inline-flex; align-items: center; gap: 8px; }
.damage-head label .icon { color: var(--ink-3); }
.damage-head output { font-variant-numeric: tabular-nums; color: var(--ink-3); font-weight: 500; }
.damage p { margin: 4px 0 0; font-size: var(--fs-xs); color: var(--ink-3); }
.actions { padding: 16px 18px 18px; display: grid; gap: 10px; }
.actions-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.actions-row .btn { padding: 0 8px; }
.size-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.payload { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border-radius: var(--r-s); border: 1px solid var(--line); background: var(--bg-tint); font-family: var(--mono); font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; max-height: 92px; overflow: auto; }

.track-card .panel-body { display: grid; gap: 12px; }
.track-card:has(> [data-track-body][hidden]) > .panel-head { padding-bottom: 18px; }
.track-result { display: grid; gap: 10px; padding: 14px; border-radius: var(--r); background: var(--accent-soft); }
.track-result .short { font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--accent-text); overflow-wrap: anywhere; }
.copy-field { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.copy-field .input { font-family: var(--mono); font-size: 13px; min-height: 44px; }

/* the printable PromptPay card (js/qr/card.js): what goes on it beside the card itself, which is white paper in both themes */
.card-panel .panel-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 260px); gap: 22px; align-items: start; }
.card-panel:has(> [data-card-body][hidden]) > .panel-head { padding-bottom: 18px; }
.card-fields, .card-out { display: grid; gap: 14px; min-width: 0; }
.card-fields .privacy-line { margin-top: 0; }
.card-stage { display: grid; justify-items: center; gap: 10px; padding: 10px 14px 18px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg-tint); }
.card-preview { width: 100%; max-width: 210px; }
.card-preview[data-size="biz"] { max-width: 100%; }
.card-preview:empty { display: none; }
.card-preview svg { width: 100%; height: auto; border-radius: 2px; box-shadow: 0 12px 26px -14px rgba(25, 56, 48, .5), 0 1px 3px rgba(25, 56, 48, .14); }
.card-empty { margin: 0; padding: 28px 6px; font-size: var(--fs-s); color: var(--ink-3); text-align: center; }
.card-out .card-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card-print-hint { margin: 0; font-size: var(--fs-xs); color: var(--ink-3); }
@media (max-width: 760px) {
    .card-panel .panel-body { grid-template-columns: minmax(0, 1fr); }
    .card-preview { max-width: 240px; }
}

/* mobile: thumb bar with the code + download when the preview has scrolled away */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: none; align-items: center; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--glass); -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px); border-top: 1px solid var(--line); visibility: hidden; opacity: 0; transform: translateY(12px); transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease), visibility 0s linear var(--dur); }
.dock.is-shown { visibility: visible; opacity: 1; transform: none; transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease), visibility 0s; }
.dock-thumb { width: 48px; height: 48px; flex: none; border-radius: 10px; overflow: hidden; background: #fff; border: 1px solid var(--line); }
.dock-thumb svg { width: 100%; height: 100%; }
.dock .grow { font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.3; }
.dock .grow b { display: block; font-size: var(--fs-s); color: var(--ink); }

/* D07: on a laptop screen the whole preview card - the code and its download buttons - fits beside the form */
@media (min-width: 921px) and (max-height: 920px) {
    .stage { min-height: 0; padding: 12px 20px 16px; gap: 10px; }
    .stage-code { max-width: clamp(160px, calc(100vh - 600px), 320px); }
    .damage { padding: 10px 18px; }
    .actions { padding: 12px 18px 14px; gap: 8px; }
    .preview-info, .summary { padding-top: 10px; padding-bottom: 10px; }
}

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 60; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r); background: var(--ink); color: var(--bg); font-size: var(--fs-s); font-weight: 500; box-shadow: var(--shadow-3); animation: toast-in var(--dur) var(--ease); pointer-events: auto; }
.toast .icon { color: var(--accent-on-ink); }
.toast.is-error .icon { color: #ff8f84; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- content sections (how to, FAQ) ---------- */
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.how .card { padding: 22px; }
.how h3 { font-size: var(--fs-m); margin: 12px 0 6px; }
.how p { margin: 0; font-size: var(--fs-s); color: var(--ink-3); }
.how .step { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; }
.faq { display: grid; gap: 10px; }
.faq details { padding: 0 20px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg-elev); }
.faq summary { display: flex; align-items: center; gap: 12px; min-height: 56px; cursor: pointer; list-style: none; font-weight: 600; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { margin-left: auto; color: var(--ink-3); transition: transform var(--dur) var(--ease); }
.faq details[open] summary .icon { transform: rotate(45deg); }
.faq details p { margin: 0 0 18px; color: var(--ink-2); font-size: var(--fs-s); }
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-title p { margin: 4px 0 0; color: var(--ink-3); font-size: var(--fs-s); }
.kicker { display: inline-block; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); margin-bottom: 6px; }

/* ---------- prose (terms, privacy) ---------- */
.prose { max-width: 760px; }
.prose h1 { margin-bottom: 8px; }
.prose h2 { margin: 36px 0 10px; font-size: var(--fs-l); }
.prose h3 { margin: 22px 0 8px; font-size: var(--fs-m); }
.prose p, .prose li { color: var(--ink-2); }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 12px; }
.prose li + li { margin-top: 4px; }
.prose table { width: 100%; border-collapse: collapse; margin: 12px 0 18px; font-size: var(--fs-s); }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { color: var(--ink-3); font-weight: 600; font-size: var(--fs-xs); }
.prose .table-wrap { overflow-x: auto; }
/* Articles (/articles, owner 30 Oct 2026): cards on cream, the article in one calm column, the call to make a QR in forest */
.articles-head { max-width: 760px; margin-bottom: 28px; }
.articles-head h1 { margin: 0; font-size: clamp(30px, 3.4vw, 42px); line-height: 1.15; letter-spacing: -.01em; }
.articles-lead { margin: 10px 0 0; color: var(--ink-2); font-size: var(--fs-l); }
.articles-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 14px 0 0; color: var(--ink-2); }
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 22px; }
.article-card { min-width: 0; }
.article-card-link { display: flex; flex-direction: column; height: 100%; overflow: hidden; color: inherit; text-decoration: none; background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--shadow-1); transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.article-card-link:hover { transform: translateY(-2px); border-color: var(--accent-line); box-shadow: var(--shadow-2); }
.article-card-link:focus-visible { outline: none; box-shadow: var(--focus); }
.article-card-cover { display: grid; place-items: center; overflow: hidden; aspect-ratio: 1200 / 630; background: var(--accent-soft); }
.article-card-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.article-card-mark { width: 64px; opacity: .55; }
.article-card-mark svg { display: block; width: 100%; height: auto; }
.article-card-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 20px; }
.article-card-body h2 { margin: 0; font-size: var(--fs-l); line-height: 1.4; overflow-wrap: anywhere; }
.article-card-body p:not(.article-meta) { display: -webkit-box; margin: 0; overflow: hidden; color: var(--ink-2); font-size: var(--fs-s); -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.article-meta { margin: 0; color: var(--ink-3); font-size: var(--fs-xs); }
.article-pages { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 28px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; max-width: 760px; margin: 0 auto 18px; color: var(--ink-3); font-size: var(--fs-s); }
.crumbs a { color: inherit; text-decoration: none; }
.crumbs a:hover { color: var(--accent-text); }
.article { max-width: 760px; margin: 0 auto; }
.article-head h1 { margin: 6px 0 0; font-size: clamp(28px, 3.6vw, 40px); line-height: 1.22; letter-spacing: -.01em; overflow-wrap: anywhere; }
.article-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.article-tags a { padding: 3px 10px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-text); font-size: var(--fs-xs); font-weight: 600; text-decoration: none; }
.article-lead { margin: 12px 0 0; color: var(--ink-2); font-size: var(--fs-l); }
.article-head .article-meta { margin-top: 14px; font-size: var(--fs-s); }
.article-cover { margin: 26px 0 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--accent-soft); }
.article-cover img { display: block; width: 100%; height: auto; }
.prose.article-body { max-width: none; margin-top: 28px; font-size: 17px; line-height: 1.8; overflow-wrap: anywhere; }
.article-body > :first-child { margin-top: 0; }
.article-body p { margin: 0 0 16px; }
.article-body h2 { margin: 36px 0 12px; font-size: var(--fs-xl); line-height: 1.35; }
.article-body h3 { margin: 26px 0 10px; font-size: var(--fs-l); line-height: 1.4; }
.article-body a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
.article-body img { display: block; max-width: 100%; height: auto; margin: 8px auto; border: 1px solid var(--line); border-radius: var(--r); }
.article-body li::marker { color: var(--accent-text); }
.article-body blockquote { margin: 18px 0; padding: 14px 18px; border-left: 4px solid var(--accent); border-radius: 0 var(--r) var(--r) 0; background: var(--accent-soft); }
.article-body blockquote p { color: var(--ink); }
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body code { padding: 1px 5px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg-sunken); font-family: var(--mono); font-size: .88em; }
.article-body pre { margin: 14px 0 18px; padding: 14px 16px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-sunken); font-size: 14px; line-height: 1.6; overflow-wrap: normal; }
.article-body pre code { padding: 0; border: 0; background: none; font-size: inherit; }
.article-body hr { margin: 28px 0; border: 0; border-top: 1px solid var(--line); }
.article-body .table-scroll { margin: 12px 0 18px; overflow-x: auto; }
.article-body .table-scroll table { margin: 0; overflow-wrap: normal; }
.article-body .table-scroll th, .article-body .table-scroll td { min-width: 7em; }
.article-body input[type="checkbox"] { margin-right: 6px; }
.article-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; margin-top: 40px; padding: 22px 24px; border-radius: var(--r-xl); background: var(--brand-forest); color: var(--brand-cream); }
.article-cta h2 { margin: 0; color: inherit; font-size: var(--fs-xl); }
.article-cta p { margin: 4px 0 0; color: rgba(250, 249, 237, .86); }
.article-cta .btn-primary { background: var(--brand-cream); border-color: var(--brand-cream); color: var(--brand-forest); box-shadow: none; }
.article-cta .btn-primary:hover { background: var(--brand-pale); border-color: var(--brand-pale); }
.article-related { margin-top: 56px; }
.article-related h2 { margin: 0 0 18px; font-size: var(--fs-xl); }
.article-related > p { margin: 18px 0 0; }
.article-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: 760px; margin: 0 auto 16px; padding: 10px 14px; border-radius: var(--r); background: var(--warn-soft); color: var(--warn); font-size: var(--fs-s); }
@media (max-width: 640px) {
    .articles-lead, .article-lead { font-size: var(--fs-m); }
    .article-grid { gap: 16px; }
    .prose.article-body { font-size: 16px; line-height: 1.75; }
    .article-cover { margin-top: 20px; border-radius: var(--r-l); }
    .article-cta { padding: 18px; }
    .article-cta .btn { width: 100%; justify-content: center; }
}
.consent-box { display: grid; gap: 12px; margin: 16px 0 24px; padding: 18px; border-radius: var(--r-l); border: 1px solid var(--line); background: var(--bg-elev); }
.consent-box .btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.consent-box [data-state] { font-size: var(--fs-s); color: var(--ink-2); }

/* ---------- footer ---------- */
.site-footer { margin-top: 24px; padding: 32px 0 calc(32px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); font-size: var(--fs-s); color: var(--ink-3); }
.site-footer .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; }
.footer-brand .logo { --logo-h: 30px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-2); }
.footer-links a:hover { color: var(--ink); }

/* ---------- simple pages (scan, barcode, bulk, my) ---------- */
.tool { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; padding-bottom: 56px; }
.tool-wide { grid-template-columns: minmax(0, 1fr) 460px; }
.bc-change { flex: none; align-self: flex-start; }
.bc-standards, .bc-data { scroll-margin-top: calc(var(--header-h) + 12px); }
.list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.list-item { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 14px 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg-elev); }
.list-item.wraps .grow b { white-space: normal; overflow-wrap: anywhere; }
.list-item.wraps .grow span { white-space: normal; overflow-wrap: anywhere; }
.list-item > .badge { flex: none; white-space: nowrap; }
.list-item .grow b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .grow span { display: block; font-size: var(--fs-xs); color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { display: grid; place-items: center; gap: 10px; padding: 40px 20px; text-align: center; color: var(--ink-3); border: 1px dashed var(--line-strong); border-radius: var(--r-l); }
.empty > .icon { width: 32px; height: 32px; color: var(--ink-3); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; font-size: var(--fs-s); }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { padding: 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg-elev); }
.stat small { display: block; font-size: var(--fs-xs); color: var(--ink-3); }
.stat b { display: block; margin-top: 4px; font-size: var(--fs-2xl); font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 120px 1fr 48px; align-items: center; gap: 10px; font-size: var(--fs-s); }
.bar-row .bar { height: 10px; border-radius: var(--r-pill); background: var(--bg-sunken); overflow: hidden; }
.bar-row .bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.bar-row span:last-child { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.chart-box { position: relative; height: 220px; }

.video-box { position: relative; overflow: hidden; border-radius: var(--r-l); background: #000; aspect-ratio: 3 / 4; max-height: 70vh; }
.video-box video { width: 100%; height: 100%; object-fit: cover; }
.video-box .aim { position: absolute; inset: 18%; border-radius: 22px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); border: 2px solid rgba(255, 255, 255, .85); }
.drop { display: grid; place-items: center; gap: 10px; min-height: 180px; padding: 24px; border-radius: var(--r-l); border: 1.5px dashed var(--line-strong); background: var(--bg-tint); text-align: center; color: var(--ink-3); cursor: pointer; transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease); }
.drop:hover, .drop.is-over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.drop .icon { width: 30px; height: 30px; }

.barcode-stage { display: grid; place-items: center; min-height: 240px; padding: 24px; background: var(--bg-tint); border-bottom: 1px solid var(--line); overflow: hidden; }
.barcode-stage svg, .barcode-stage canvas { max-width: 100%; height: auto; background: #fff; }
.sym-list { display: grid; gap: 4px; max-height: 340px; overflow: auto; padding-right: 4px; }
.sym { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border-radius: var(--r-s); border: 1px solid transparent; background: transparent; text-align: left; font-size: var(--fs-s); color: var(--ink-2); }
.sym small { color: var(--ink-3); font-size: var(--fs-xs); }
.sym:hover { background: var(--bg-sunken); }
.sym[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.sym-group { margin: 12px 0 4px; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; color: var(--ink-3); text-transform: uppercase; }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
    .gen { grid-template-columns: minmax(0, 1fr) 360px; }
    .nav a { padding: 0 10px; }
}
/* the header on laptops and tablets in landscape: up to six menu items, the languages, "เข้าสู่ระบบ" and "สมัครสมาชิก"
   on one line - the menu loses its icons first, then sign-in keeps its icon and sign-up its short word */
.nav a, .header-account { white-space: nowrap; }
@media (min-width: 921px) and (max-width: 1300px) {
    .nav a .icon { display: none; }
    .nav a { padding: 0 11px; }
}
@media (min-width: 921px) and (max-width: 1060px) {
    .site-header .container { gap: 14px; }
    .site-header .logo { --logo-h: 46px; }
    .nav { gap: 2px; }
    .nav a { padding: 0 8px; }
}
@media (max-width: 920px) {
    :root { --gutter: 20px; }
    .nav { display: none; }
    .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 44; display: grid; grid-template-columns: repeat(5, 1fr); padding: 4px 4px env(safe-area-inset-bottom); background: var(--glass); -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px); border-top: 1px solid var(--line); }
    .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; border-radius: var(--r); font-size: 12px; font-weight: 600; color: var(--ink-3); }
    .tabbar a[aria-current="page"] { color: var(--accent-text); }
    .tabbar .icon { width: 22px; height: 22px; }
    body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
    .dock { bottom: calc(64px + env(safe-area-inset-bottom)); padding-bottom: 10px; }
    .toasts { bottom: calc(76px + env(safe-area-inset-bottom)); }
    .dock-up .toasts { bottom: calc(150px + env(safe-area-inset-bottom)); }
    .gen { grid-template-columns: minmax(0, 1fr); }
    .preview { position: static; order: 2; }
    .gen-main { display: contents; }
    .gen-main > .types-wrap { order: 0; }
    .gen-main > .form-panel { order: 1; }
    .gen-main > .style-panel { order: 4; }
    .gen-main > .track-card { order: 2; }
    /* the printable card comes after the code it is made from */
    .gen-main > .card-panel { order: 3; }
    .dock { display: flex; }
    .tool, .tool-wide { grid-template-columns: minmax(0, 1fr); }
    /* phone: what you type, then the barcode, then the look, then the list of standards */
    .bc-main { display: contents; }
    .bc-main > .bc-data { order: 0; }
    .tool-barcode > .preview { order: 1; }
    .bc-main > .bc-look { order: 2; }
    .bc-main > .bc-standards { order: 3; }
    .how { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    :root { --gutter: 16px; --header-h: 60px; }
    .site-header .logo { --logo-h: 46px; }
    .types-wrap { margin: 0 calc(var(--gutter) * -1); }
    .types { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); padding: 2px var(--gutter) 6px; scrollbar-width: none; }
    .types::-webkit-scrollbar { display: none; }
    .type-btn { flex: none; scroll-snap-align: start; min-height: 44px; padding: 8px 14px; border-radius: var(--r-pill); }
    .form-grid { grid-template-columns: 1fr; }
    .bc-data .panel-head { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; }
    .bc-change { grid-column: 1 / -1; justify-self: start; }
    .panel-head { padding: 16px 16px 0; }
    .panel-body { padding: 14px 16px 18px; }
    .style-sec > summary { padding: 0 16px; }
    .style-body { padding: 0 16px 18px; }
    .stage { min-height: 0; padding: 20px; }
    .stage-code { max-width: 260px; }
    .levels { grid-template-columns: repeat(2, 1fr); }
    .actions-row { grid-template-columns: repeat(2, 1fr); }
    .intro { padding: 18px 0 12px; }
    .intro p { font-size: var(--fs-s); }
    .card-pad { padding: 18px; }
    .bar-row { grid-template-columns: 90px 1fr 40px; }
    .consent-box .btns { grid-template-columns: 1fr; }
    .copy-field .input { font-size: 16px; }
}
@media (max-width: 360px) {
    .trust span { font-size: 12px; padding: 4px 10px; }
    .lang-switch a { min-width: 32px; padding: 0 6px; }
}
/* the header keeps the language, account and theme buttons on screen: a smaller logo, then the mark alone (the kit:
   small places take the icon) */
@media (max-width: 400px) {
    .site-header .logo { --logo-h: 42px; }
}
@media (max-width: 370px) {
    .site-header .logo { --logo-h: 42px; width: calc(var(--logo-h) * 993 / 1109); }
    /* the mark, the languages, sign in, sign up and the theme on 320 px */
    .site-header .container { gap: 10px; }
    .lang-switch a { min-width: 30px; padding: 0 5px; }
}
@media (max-width: 640px) {
    /* fingers: every control at least 44 px tall (kv-flow 02 §3) */
    .btn-s, .seg button, .seg a, .color-pick { min-height: 44px; }
    .swatch { width: 44px; height: 44px; }
    .lang-switch { height: 44px; }
    .lang-switch a { height: 38px; min-width: 40px; }
    .site-header .brand { min-height: 44px; }
    details > summary.link { display: inline-flex; align-items: center; min-height: 44px; }
    .copy-field .btn { min-height: 44px; min-width: 44px; }
    .prose table.as-cards, .prose table.as-cards tbody, .prose table.as-cards tr, .prose table.as-cards td { display: block; width: 100%; }
    .prose table.as-cards thead { display: none; }
    .prose table.as-cards tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
    .prose table.as-cards td { padding: 2px 0; border: 0; }
    .prose table.as-cards td::before { content: attr(data-label); display: block; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-3); }
}

/* ---------- small charts (manage page) ---------- */
.chart-box .bars-svg { width: 100%; height: 160px; display: block; }
.bars-svg .bar-on { fill: var(--accent); }
.bars-svg .bar-off { fill: var(--line); }
.bars-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: var(--fs-xs); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chart-box { height: auto; }
.scan-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.small { font-size: var(--fs-s); }
.kicker + h1 { margin-top: 2px; }
.error-code { margin: 0 0 4px; font-size: 44px; font-weight: 700; line-height: 1; letter-spacing: -.02em; color: var(--line-strong); font-variant-numeric: tabular-nums; }
details > summary.link { cursor: pointer; list-style: none; }
details > summary.link::-webkit-details-marker { display: none; }
.consent-box .btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }

/* ---------- photo QR: the page a scan shows (redirect/photos.blade.php) ---------- */
.photo-page { width: 100%; max-width: 760px; margin: 0 auto; padding: 20px 16px 40px; display: grid; gap: 16px; align-content: start; }
.photo-brand { justify-self: center; padding: 6px 0; }
.photo-brand .logo { --logo-h: 44px; }
/* the small pages without the site chrome (layouts/bare: errors, paused or blocked QR) */
.bare-brand { margin-bottom: 20px; }
.bare-brand .logo { --logo-h: 52px; }
.photo-text { margin: 0; white-space: pre-line; overflow-wrap: anywhere; text-align: center; font-size: var(--fs-l); }
.photo-list { display: grid; gap: 12px; }
.photo { display: block; overflow: hidden; border-radius: var(--r-l); border: 1px solid var(--line); background: var(--bg-sunken); }
.photo img { width: 100%; }
.photo-hint { margin: 0; text-align: center; }
.photo-empty { text-align: center; }
.photo-foot { display: grid; gap: 12px; margin-top: 8px; text-align: center; }
.photo-foot p { margin: 0; }
.photo-report { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; justify-self: center; }

/* ---------- photo QR: choosing photos on the generator (js/qr/photos.js) ---------- */
.photo-picker { display: grid; gap: 10px; }
.photo-drop { min-height: 140px; }
.photo-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.photo-tiles:empty { display: none; }
.photo-tile { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 14px; border: 1px solid var(--line); background: var(--bg-sunken); }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-tile > a { display: block; height: 100%; }
.photo-tile.is-error { border-color: var(--danger); background: var(--danger-soft); }
.photo-n { position: absolute; left: 6px; top: 6px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: var(--r-pill); background: rgba(25, 56, 48, .72); color: #fff; font-size: var(--fs-xs); font-weight: 600; line-height: 24px; text-align: center; }
.photo-btn { position: absolute; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .94); color: var(--brand-ink); box-shadow: var(--shadow-1); cursor: pointer; }
.photo-x { right: 6px; top: 6px; }
.photo-left { left: 6px; bottom: 6px; }
.photo-wait { display: grid; place-items: center; width: 100%; height: 100%; }
.photo-wait .spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ink-3); border-right-color: transparent; animation: spin .7s linear infinite; }
.photo-err { display: grid; place-items: center; align-content: center; gap: 4px; height: 100%; padding: 30px 8px 8px; font-size: var(--fs-xs); line-height: 1.3; color: var(--danger); text-align: center; }

/* optional accounts and the QR history (REQUIREMENTS section 12) */
.seg a { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; min-width: 44px; padding: 0 14px; border-radius: 9px; color: var(--ink-2); font-size: var(--fs-s); font-weight: 600; text-decoration: none; }
.seg a:hover { color: var(--ink); }
.seg a[aria-current="page"] { background: var(--bg-elev); color: var(--ink); box-shadow: var(--shadow-1); }
.btn-line { background: #06c755; border-color: #06c755; color: #fff; }
.btn-line:hover { background: #05b34c; border-color: #05b34c; color: #fff; }
.acc-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 4px 0 16px; }
.acc-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 240px) auto; gap: 10px; align-items: center; margin: 8px 0 4px; }
.acc-filters .field { margin: 0; }
.acc-dates { grid-column: 1 / -1; }
.acc-dates summary { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; color: var(--ink-2); font-size: var(--fs-s); font-weight: 600; cursor: pointer; }
.acc-dates-body { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); gap: 10px; margin-top: 6px; }
.acc-hidden-link { margin: 0 0 14px; }
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.acc-card { display: flex; gap: 14px; align-items: center; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--bg-elev); color: inherit; text-decoration: none; }
.acc-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-1); }
.acc-thumb { display: grid; place-items: center; width: 72px; height: 72px; flex: none; border-radius: var(--r); background: #fff; border: 1px solid var(--line); overflow: hidden; }
.acc-thumb img { width: 100%; height: 100%; object-fit: contain; }
.acc-thumb .icon { width: 30px; height: 30px; color: #8c9a94; }
.acc-thumb-lg { width: 220px; height: 220px; }
.acc-meta { display: grid; gap: 2px; min-width: 0; }
.acc-meta b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-meta span { font-size: var(--fs-xs); color: var(--ink-3); overflow-wrap: anywhere; }
.acc-item { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 24px; align-items: start; }
.acc-preview { display: grid; place-items: center; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-l); }
.acc-preview img { max-width: 100%; height: auto; }
.acc-title { font-size: var(--fs-l); overflow-wrap: anywhere; }
.acc-sub { font-size: var(--fs-m); }
.acc-section { font-size: var(--fs-m); margin: 22px 0 10px; }
.acc-content { margin: 0; padding: 12px; max-height: 260px; overflow: auto; border-radius: var(--r); background: var(--bg-sunken); font-size: var(--fs-s); white-space: pre-wrap; overflow-wrap: anywhere; }
.acc-way { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.acc-way > span { display: inline-flex; align-items: center; gap: 8px; }
.acc-details summary { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; cursor: pointer; list-style: none; }
.acc-details summary::-webkit-details-marker { display: none; }
/* a chevron says the card opens (QC 1 Nov 2026 D10/M13): the flex summary hides the browser's own marker */
.acc-details summary::after { content: ""; flex: none; width: 9px; height: 9px; margin-left: auto; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg) translateY(-3px); transition: transform var(--dur) var(--ease); }
.acc-details[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
.input-pin { max-width: 14em; letter-spacing: .35em; font-variant-numeric: tabular-nums; }
/* a small icon at the start of a line of text stays on that line */
.icon-line { display: flex; align-items: center; gap: 6px; }
/* the one red button of the site (deleting an account); dark letters on the lighter red of the dark theme */
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
[data-theme="dark"] .btn-danger { color: #2b0d0a; }
.icon-line > .icon { flex: none; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 18px 0; }
.pager [aria-disabled="true"] { opacity: .45; pointer-events: none; }
.header-account { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: var(--r-pill); color: var(--ink-2); font-size: var(--fs-s); font-weight: 600; text-decoration: none; }
.header-account:hover { color: var(--ink); background: var(--bg-sunken); }
/* "สมัครสมาชิก" beside "เข้าสู่ระบบ" (owner 30 Oct 2026): the one filled button of the header */
.header-signup { flex: none; min-height: 44px; padding: 0 16px; box-shadow: none; }
.header-signup .short { display: none; }
@media (min-width: 921px) and (max-width: 1060px), (max-width: 480px) {
    .header-signup .long { display: none; }
    .header-signup .short { display: inline; }
}
@media (min-width: 921px) and (max-width: 1060px) {
    .header-account span { display: none; }
}
@media (max-width: 480px) {
    /* phones: the logo, the languages, sign in, sign up and the theme within the screen's margins (375 px iPhones) */
    .header-signup { padding: 0 12px; }
    .site-header .container { gap: 12px; }
    .header-tools { gap: 4px; }
    .header-tools .lang-switch a { min-width: 30px; padding: 0 5px; }
    .header-account { padding: 0 10px; }
    .header-tools .icon-btn { width: 44px; height: 44px; }
    /* the two letters keep their small pill; the finger gets 44 px around it (QC 1 Nov 2026 M07) */
    .header-tools .lang-switch a { position: relative; }
    .header-tools .lang-switch a::after { content: ""; position: absolute; inset: -4px -1px; }
    /* the account tabs: two by two, not three and a lonely fourth (M08) */
    .acc-nav .seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 370px) {
    .header-signup { padding: 0 10px; }
    .header-account { padding: 0 6px; }
    .site-header .container { gap: 10px; }
}
.acc-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--ink-2); font-size: var(--fs-s); }
@media (max-width: 860px) {
    .acc-filters { grid-template-columns: minmax(0, 1fr) auto; }
    .acc-filters .acc-q { grid-column: 1 / -1; }
    .acc-dates-body { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .acc-item { grid-template-columns: minmax(0, 1fr); }
    .header-account span { display: none; }
}
/* a text link that is also a button inside a sentence: still a finger-sized target */
.link-tap { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 2px; border: 0; background: none; font: inherit; font-weight: 600; cursor: pointer; }

/* the LINE button and its "remember me" (one GET form) */
.acc-line { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; }

/* why sign up before making a QR (owner 27 Oct 2026): the free membership, under the generator */
.pitch { padding-block: 40px 8px; }
.pitch-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 32px; align-items: center; padding: 32px; border: 1px solid var(--accent-line); border-radius: var(--r-l); background: linear-gradient(135deg, var(--accent-soft), var(--bg-elev) 72%); box-shadow: var(--shadow-1); }
.pitch h2 { font-size: var(--fs-2xl); line-height: 1.3; margin: 2px 0 12px; }
.pitch-lead { margin: 0 0 22px; color: var(--ink-2); }
.pitch-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.pitch-free { display: flex; align-items: center; gap: 6px; margin: 14px 0 0; font-size: var(--fs-s); font-weight: 600; color: var(--accent-text); }
.pitch-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.pitch-list li { display: flex; gap: 12px; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-elev); }
.pitch-list li > span:last-child { min-width: 0; font-size: var(--fs-xs); line-height: 1.55; color: var(--ink-3); }
.pitch-list b { display: block; margin-bottom: 3px; font-size: var(--fs-s); line-height: 1.4; color: var(--ink); }
.pitch-icon { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-text); }
.pitch-member { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; margin-top: 28px; padding: 14px 18px; border: 1px solid var(--accent-line); border-radius: var(--r-l); background: var(--accent-soft); color: var(--accent-text); font-size: var(--fs-s); font-weight: 600; }
.pitch-member .btn { margin-left: auto; }
@media (max-width: 960px) {
    .pitch-card { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 24px; }
}
@media (max-width: 560px) {
    .pitch-card { padding: 20px 16px; }
    .pitch h2 { font-size: var(--fs-xl); }
    .pitch-list { grid-template-columns: minmax(0, 1fr); }
    .pitch-cta .btn { flex: 1 1 100%; }
    .pitch-member .btn { margin-left: 0; }
}

/* ---------- the paid membership (owner 27 Oct 2026): offer, membership page, payment, receipt, API ---------- */
.price-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 22px; }
.price-card { position: relative; display: grid; gap: 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-elev); }
.price-best { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.price-name { font-size: var(--fs-s); font-weight: 600; color: var(--ink-2); }
.price-amount { font-size: var(--fs-s); color: var(--ink-3); }
.price-amount b { font-size: var(--fs-3xl); line-height: 1.05; font-weight: 700; color: var(--ink); letter-spacing: -.02em; }
.price-note { font-size: var(--fs-xs); color: var(--accent-text); font-weight: 600; }
.plan-tag { position: absolute; top: -11px; right: 12px; padding: 2px 10px; border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.pricing-free-line { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 16px 0 0; font-size: var(--fs-s); color: var(--ink-3); text-align: center; }
.pricing-free-line .icon { color: var(--accent-text); }
.pitch-member-warn { border-color: transparent; background: var(--warn-soft); color: var(--warn); }
.track-members { display: grid; gap: 10px; padding: 14px; border-radius: var(--r); background: var(--accent-soft); color: var(--ink-2); font-size: var(--fs-s); }
.track-members p { margin: 0; }
.track-members b { color: var(--ink); }
.member-banner { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 12px; padding: 8px var(--gutter); background: var(--warn-soft); color: var(--warn); font-size: var(--fs-s); font-weight: 600; text-align: center; }
.member-banner a { text-decoration: underline; text-underline-offset: 3px; }

.bill-status .acc-sub { margin: 0; }
.bill-until { margin: 0; font-size: var(--fs-l); font-weight: 600; }
.bill-grace .bill-until, .bill-locked .bill-until { color: var(--warn); font-size: var(--fs-m); }
.bill-card { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding: 12px 14px; border-radius: var(--r); background: var(--bg-tint); border: 1px solid var(--line); }
.bill-card form { margin: 0; }
.plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; border: 0; }
.plan { position: relative; display: block; cursor: pointer; }
.plan input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.plan-body { position: relative; display: grid; gap: 2px; height: 100%; padding: 16px 18px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--bg-elev); transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.plan input:checked + .plan-body { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: var(--accent-soft); }
.plan input:focus-visible + .plan-body { box-shadow: var(--focus); }
.plan-price { font-size: var(--fs-s); color: var(--ink-3); }
.plan-price .num { font-size: var(--fs-2xl); font-weight: 700; color: var(--ink); }
fieldset.stack { margin: 0; padding: 0; border: 0; min-width: 0; }
fieldset.stack > legend { margin-bottom: 8px; }
.method { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--bg-elev); cursor: pointer; }
.method:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.method input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; flex: none; }
.method > span { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.method-sub { margin: -4px 0 0 46px; }
.pay-qr { display: block; width: min(280px, 100%); height: auto; margin: 4px auto; padding: 12px; border-radius: var(--r-l); background: #fff; border: 1px solid var(--line); }
.pay-qr-svg svg { width: 100%; height: auto; }
.pay-steps { margin: 0; padding-left: 22px; color: var(--ink-2); }
.pay-wait { display: flex; align-items: center; justify-content: center; gap: 6px; }
.code-block { margin: 8px 0 16px; padding: 12px 14px; border-radius: var(--r); background: var(--bg-sunken); border: 1px solid var(--line); font-family: var(--mono); font-size: 13px; line-height: 1.55; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.dev code { font-family: var(--mono); font-size: .9em; padding: 1px 5px; border-radius: 6px; background: var(--bg-sunken); }
.receipt-head { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.receipt-head p { margin: 2px 0 0; }
.receipt-seller { font-size: var(--fs-l); }
.receipt-kind { text-align: right; }
.receipt-kind h1 { font-size: var(--fs-l); }
.receipt-lines { width: 100%; border-collapse: collapse; font-size: var(--fs-s); }
.receipt-lines th, .receipt-lines td { padding: 10px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.receipt-lines th { color: var(--ink-3); font-size: var(--fs-xs); font-weight: 600; }
.receipt-lines .num { text-align: right; white-space: nowrap; }
.receipt-total td { font-weight: 700; font-size: var(--fs-m); border-bottom: 0; }
@media (max-width: 560px) {
    .price-cards, .plan-grid { grid-template-columns: minmax(0, 1fr); }
    .receipt-kind { text-align: left; }
}
@media print {
    .site-header, .site-footer, .tabbar, .no-print, .toasts, .member-banner { display: none !important; }
    body { background: #fff; padding: 0; }
    .receipt { border: 0; box-shadow: none; }
}
/* panels one after another on the account pages keep a gap */
.container-narrow > .panel + .panel, .container-narrow > .panel + .acc-details, .container-narrow > .panel + .note, .container-narrow > .note + .panel { margin-top: 16px; }
.plan-grid + fieldset.stack, .plan-grid + .error + fieldset.stack { margin-top: 6px; }
