/* Make My QR Codes. Tokens first (light, then dark), then base, layout and components.
   Brand: warm paper ground, near-black ink, one accent (code green), Bricolage Grotesque for display, Inter for text.
   The brand device is the print crop mark around every code preview (.proof). */

@font-face { font-family: "Inter"; src: url("/static/fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Bricolage"; src: url("/static/fonts/bricolage.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #efede6;
  --border: #dedad0;
  --border-strong: #8a8578;     /* input outlines: 3:1+ on white */
  --text: #17181c;
  --text-muted: #585a63;        /* 6.3:1 on --bg */
  --accent: #0e6e55;            /* 6.2:1 with white text */
  --accent-hover: #0b5a46;
  --accent-text: #ffffff;
  --accent-soft: #e2f1ec;
  --focus: #1d4ed8;
  --success: #067647;
  --success-soft: #e3f4ea;
  --warning: #8a4b00;
  --warning-soft: #fdf0dc;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --info-soft: #e8eefb;
  --shadow: 0 1px 2px rgb(23 24 28 / 0.06), 0 4px 16px rgb(23 24 28 / 0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Bricolage", "Inter", ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #111315;
    --surface: #1a1d20;
    --surface-2: #23272b;
    --border: #30353a;
    --border-strong: #6f767e;
    --text: #eceded;
    --text-muted: #a5abb2;
    --accent: #3ccb9b;
    --accent-hover: #5fd9b0;
    --accent-text: #08201a;
    --accent-soft: #15362c;
    --focus: #8ab4ff;
    --success: #5cd69a;
    --success-soft: #15301f;
    --warning: #f4b860;
    --warning-soft: #33270f;
    --danger: #ff8a80;
    --danger-soft: #3a1a18;
    --info-soft: #1b2638;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 6px 20px rgb(0 0 0 / 0.3);
  }
}

/* ---- base ---------------------------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.55 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; outline: none; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -0.015em; margin: 0 0 0.5em; text-wrap: balance; }
h1 { font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.75rem); font-weight: 700; }
h3, .h3 { font-size: 1.125rem; font-weight: 650; font-family: var(--font-display); }
p { margin: 0 0 1em; text-wrap: pretty; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
img, svg { max-width: 100%; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--text-muted); }
.small { font-size: 0.875rem; }
.mono { font-family: var(--mono); font-size: 0.92em; }
.break { overflow-wrap: anywhere; }
.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; }
.opt { color: var(--text-muted); font-weight: 400; }
.icon { flex: none; vertical-align: middle; }
[hidden] { display: none !important; }
.skip { position: absolute; left: 12px; top: -48px; background: var(--surface); color: var(--text); padding: 8px 12px; border-radius: var(--radius-sm); z-index: 10; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }
main.wrap { padding-top: 32px; padding-bottom: 64px; }

/* ---- header / footer --------------------------------------------------------------------------------------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--font-display); font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; }
.brand b { font-weight: 800; }
.brand:hover { color: var(--text); }
.mark { color: var(--text); }
.mark .mark-dot { fill: var(--accent); }
.nav { display: flex; align-items: center; gap: 4px 14px; flex-wrap: wrap; }
.nav > a:not(.btn) { color: var(--text); text-decoration: none; font-weight: 500; padding: 8px 4px; border-bottom: 2px solid transparent; }
.nav > a:not(.btn):hover { color: var(--accent); }
.nav > a[aria-current="page"] { border-bottom-color: var(--accent); }
@media (max-width: 640px), (pointer: coarse) { .nav .btn.small { min-height: 44px; } }
.site-footer { border-top: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: 0.875rem; }
.foot { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding-top: 20px; padding-bottom: 20px; }
.foot p { display: flex; align-items: center; gap: 10px; margin: 0; }
.foot .mark { width: 20px; height: 20px; }
.foot nav { display: flex; gap: 16px; flex-wrap: wrap; }
.foot a { color: var(--text-muted); display: inline-block; padding: 6px 0; }
.foot a[aria-current="page"] { color: var(--text); font-weight: 600; }
body.bare .site-footer nav a:not([href="/report"]) { display: none; }
@media (max-width: 520px) { .sr-only-sm { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }

/* ---- buttons ------------------------------------------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: 600 0.9375rem/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background-color 150ms ease-out, border-color 150ms ease-out, transform 100ms ease-out; }
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-text); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { border-color: var(--danger); color: var(--danger); background: var(--surface); }
.btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 0.875rem; }
.btn.large { min-height: 52px; padding: 0 24px; font-size: 1.0625rem; }
.btn.block { width: 100%; }
.btn[disabled], .btn[aria-busy="true"] { opacity: 0.6; cursor: progress; }
form.inline { display: inline; margin: 0; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.cta-row.center { justify-content: center; }

/* ---- forms --------------------------------------------------------------------------------------------------- */
.stack { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field.grow { flex: 1; }
label, .label { font-weight: 600; font-size: 0.9375rem; }
h3.label, p.label { font-family: var(--font); margin: 0 0 8px; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="tel"], input[type="search"], input[type="number"], input:not([type]), select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: 400 1rem/1.4 var(--font);
}
textarea { min-height: 88px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
input[type="file"] { font: inherit; max-width: 100%; }
input[type="range"] { width: 100%; accent-color: var(--accent); min-height: 32px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 18px; height: 18px; margin: 2px 0 0; flex: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; cursor: pointer; min-height: 28px; padding: 3px 0; }
.check.small { font-size: 0.875rem; }
.help { font-size: 0.875rem; color: var(--text-muted); margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-2.gap-lg { gap: 24px; margin-top: 8px; }
.span-2 { grid-column: span 2; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } .span-2 { grid-column: auto; } }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; }
.input-icon { position: relative; display: block; }
.input-icon .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.input-icon input { padding-left: 40px; }
.prefix-input { display: flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.prefix-input:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.prefix-input .prefix { display: flex; align-items: center; padding: 0 4px 0 12px; color: var(--text-muted); background: var(--surface-2); white-space: nowrap; }
.prefix-input input { border: 0; border-radius: 0; min-width: 0; }
.prefix-input input:focus-visible { outline: none; }
.color-input { display: flex; gap: 8px; align-items: center; }
.color-input input[type="color"] { width: 48px; height: 44px; padding: 4px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; flex: none; }
.color-input .hex { text-transform: lowercase; }

/* ---- notices, chips ---------------------------------------------------------------------------------------------- */
.notices { display: grid; gap: 8px; margin: 0 0 20px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); margin: 0; background: var(--info-soft); border: 1px solid transparent; }
.notice.ok { background: var(--success-soft); }
.notice.ok > .icon { color: var(--success); }
.notice.error { background: var(--danger-soft); }
.notice.error > .icon { color: var(--danger); }
.notice.info > .icon { color: var(--focus); }
.notice.warn { background: var(--warning-soft); }
.notice.warn > .icon { color: var(--warning); }
.notice .btn { margin-left: 4px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text); font-size: 0.8125rem; font-weight: 500; white-space: nowrap; }
.chip.folder { background: var(--accent-soft); }
.status-active { background: var(--success-soft); color: var(--success); }
.status-paused { background: var(--warning-soft); color: var(--warning); }
.status-blocked { background: var(--danger-soft); color: var(--danger); }
h1 .chip { vertical-align: middle; font-family: var(--font); letter-spacing: 0; }

/* ---- panels, page heads ------------------------------------------------------------------------------------------ */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
@media (max-width: 640px) { .panel { padding: 18px; } }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { margin-bottom: 4px; }
.page-head p { margin: 0; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 0.875rem; margin-bottom: 4px; padding: 6px 0; text-decoration: none; color: var(--text-muted); }
.back:hover { color: var(--accent); }
.danger-zone summary { cursor: pointer; font-weight: 600; color: var(--danger); }
.danger-zone[open] summary { margin-bottom: 12px; }
details.more summary { cursor: pointer; font-weight: 600; margin: 4px 0 12px; }

/* ---- print proof: the brand device (crop marks around a code) ------------------------------------------------------- */
.proof { position: relative; padding: 18px; background: var(--surface-2); border-radius: var(--radius); }
.crop { position: relative; display: grid; place-items: center; }
.crop::before, .crop::after, .proof::before, .proof::after { content: ""; position: absolute; width: 14px; height: 14px; border-color: var(--text-muted); border-style: solid; pointer-events: none; }
.proof::before { top: 6px; left: 6px; border-width: 1.5px 0 0 1.5px; }
.proof::after { bottom: 6px; right: 6px; border-width: 0 1.5px 1.5px 0; }
.crop::before { top: -12px; right: -12px; border-width: 1.5px 1.5px 0 0; }
.crop::after { bottom: -12px; left: -12px; border-width: 0 0 1.5px 1.5px; }
.crop svg { display: block; width: 100%; height: auto; max-width: 400px; border-radius: 4px; box-shadow: var(--shadow); background: repeating-conic-gradient(#e9e9e9 0% 25%, #fff 0% 50%) 50% / 16px 16px; }

/* ---- landing ------------------------------------------------------------------------------------------------------- */
main.wide { max-width: 1180px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 48px; align-items: center; padding: 24px 0 72px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.8125rem; font-weight: 700; color: var(--accent); margin-bottom: 12px; }
.hero h1 { font-size: clamp(2.5rem, 1.6rem + 3.6vw, 4.25rem); letter-spacing: -0.035em; line-height: 1.02; margin-bottom: 20px; font-weight: 750; }
.lead { font-size: 1.1875rem; color: var(--text-muted); max-width: 60ch; }
.hero .cta-row { margin: 28px 0 24px; }
.ticks { list-style: none; padding: 0; margin: 0; display: flex; gap: 8px 20px; flex-wrap: wrap; color: var(--text-muted); font-size: 0.9375rem; }
.ticks li { display: flex; align-items: center; gap: 6px; }
.ticks .icon { color: var(--accent); }
.hero-proof { margin: 0; justify-self: center; width: min(100%, 380px); }
.hero-proof figcaption { text-align: center; font-size: 0.875rem; color: var(--text-muted); margin-top: 14px; overflow-wrap: anywhere; }
@media (max-width: 860px) { .hero { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-bottom: 48px; } }
/* the quick maker in the hero (a static website code, no sign-up) and its result panel */
.link-maker { display: grid; gap: 8px; max-width: 36rem; margin: 28px 0 24px; }
.link-maker-row { display: flex; gap: 8px; flex-wrap: wrap; }
.link-maker-row input { flex: 1 1 15rem; min-height: 52px; font-size: 1.0625rem; }
.link-maker-row .btn { flex: 0 0 auto; }
@media (max-width: 520px) { .link-maker-row .btn { flex: 1 1 100%; } }
.link-maker-more summary { cursor: pointer; font-weight: 600; font-size: 0.9375rem; padding: 11px 0; margin: -5px 0; width: fit-content; } /* 44px tap target */
.link-maker-more[open] { display: grid; gap: 12px; padding-bottom: 4px; }
.link-maker-more .seg { display: flex; max-width: 22rem; }
.hero-out { display: grid; gap: 14px; justify-items: center; scroll-margin-top: 16px; }
.hero-out .scan, .hero-out .maker-dl, .hero-out .maker-next { width: min(100%, 380px); }
.hero .maker-dl .cta-row { margin: 0; }

section.steps, section.styles, section.promise, section.tips, section.faq, section.closing { padding: 56px 0; border-top: 1px solid var(--border); }
.step-list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.step-list li { display: flex; gap: 16px; }
.step-list p { color: var(--text-muted); margin: 0; }
.step-n { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 9px; background: var(--text); color: var(--bg); font: 700 0.9375rem/1 var(--font-display); }
@media (max-width: 860px) { .step-list { grid-template-columns: minmax(0, 1fr); gap: 24px; } }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 32px; flex-wrap: wrap; }
.section-head p { color: var(--text-muted); max-width: 52ch; margin: 0 0 0.5em; }
.style-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
@media (max-width: 960px) and (min-width: 721px) { .style-grid { gap: 10px; } .style-card { padding: 10px; } }
.style-card { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: grid; gap: 10px; align-content: start; }
.style-img { display: grid; place-items: center; }
.style-img svg { width: 100%; height: auto; display: block; }
.style-card figcaption { font-size: 0.875rem; font-weight: 600; text-align: center; }
@media (max-width: 720px) { .style-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .style-card:nth-child(n + 4) { display: none; } }
@media (max-width: 560px) { .style-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.promise-lead { font-size: 1.125rem; max-width: 62ch; }
.promise-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 24px 0 0; border-top: 2px solid var(--text); }
.promise-list div { padding: 20px 24px 20px 0; border-bottom: 1px solid var(--border); }
.promise-list dt { font-family: var(--font-display); font-weight: 700; font-size: 1.125rem; margin-bottom: 4px; }
.promise-list dd { margin: 0; color: var(--text-muted); }
@media (max-width: 720px) { .promise-list { grid-template-columns: minmax(0, 1fr); } }
.tip-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin-top: 16px; }
.tip-grid h3 { margin-bottom: 6px; }
.tip-grid p { color: var(--text-muted); margin: 0; }
@media (max-width: 860px) { .tip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .tip-grid { grid-template-columns: minmax(0, 1fr); } }
.faq details { border-bottom: 1px solid var(--border); padding: 7px 0; max-width: 820px; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 1.0625rem; padding: 9px 0; } /* 44px tap target, same spacing as before */
.faq details p { margin: 1px 0 9px; color: var(--text-muted); }
.closing { text-align: center; }
.closing p { color: var(--text-muted); }
.tips-more { margin: 24px 0 0; color: var(--text-muted); }

/* ---- guides (/qr/<topic>) and the guide cards on the home page ------------------------------------------------------ */
section.guides, aside.guide-more { padding: 56px 0; border-top: 1px solid var(--border); }
.guide-list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.guide-list a { display: grid; gap: 4px; align-content: start; height: 100%; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); text-decoration: none; transition: border-color 150ms ease-out; }
.guide-list a:hover { border-color: var(--accent); color: var(--text); }
.guide-list a:hover h3 { color: var(--accent); }
.guide-list h3 { margin: 0; }
.guide-list span { color: var(--text-muted); font-size: 0.9375rem; }
.guide-head { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr); gap: 48px; align-items: center; padding: 8px 0 48px; }
.guide-head h1 { font-size: clamp(2.25rem, 1.5rem + 2.6vw, 3.25rem); letter-spacing: -0.03em; line-height: 1.05; font-weight: 750; margin-bottom: 16px; }
.guide-head .cta-row { margin: 24px 0 12px; }
.eyebrow a { color: inherit; text-decoration: none; display: inline-block; padding: 6px 0; margin: -6px 0; } /* 28px tap target, same spacing */
.eyebrow a:hover { color: var(--accent-hover); text-decoration: underline; }
.guide-proof { margin: 0; justify-self: center; width: min(100%, 300px); }
.guide-proof figcaption { text-align: center; font-size: 0.875rem; color: var(--text-muted); margin-top: 14px; }
@media (max-width: 860px) { .guide-head { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-bottom: 32px; } }
.guide-head.solo { grid-template-columns: minmax(0, 1fr); padding-bottom: 32px; }
.guide-head.solo > div { max-width: 46rem; }
/* the no-sign-up maker (/qr/wifi): form, then the code and its downloads */
.maker { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 320px); gap: 40px; align-items: start; padding-bottom: 48px; }
.maker form.panel { max-width: 36rem; }
.maker h2 { font-size: 1.375rem; margin: 0; }
.maker .seg { display: flex; }
.maker .seg label { font-weight: 600; }
.maker-out { display: grid; gap: 14px; justify-items: center; scroll-margin-top: 16px; }
.maker-out .scan { width: min(100%, 300px); }
.maker-dl { display: grid; gap: 8px; width: min(100%, 300px); }
.maker-dl .label { margin: 4px 0 0; }
.maker-dl .cta-row { gap: 8px; }
.maker-dl .btn { flex: 1; padding: 0 10px; }
.maker-next { width: min(100%, 300px); margin: 4px 0 0; padding-top: 14px; border-top: 1px solid var(--border); font-size: 0.9375rem; }
@media (max-width: 860px) { .maker { grid-template-columns: minmax(0, 1fr); gap: 28px; } .maker form.panel { max-width: none; } }
.guide-body { border-top: 1px solid var(--border); padding-bottom: 32px; }
.guide-body h2 { font-size: clamp(1.35rem, 1.2rem + 0.6vw, 1.625rem); margin-top: 1.8em; }
.guide-body h3 { margin: 1.4em 0 0.3em; }
.guide-body .table-wrap { margin: 16px 0 20px; }
.guide-body td:first-child { font-weight: 600; }
.how { list-style: none; padding: 0; margin: 20px 0 16px; display: grid; gap: 18px; }
.prose .how li { display: flex; gap: 14px; margin: 0; }
.how h3, .guide-body .how h3 { font-size: 1.0625rem; margin: 5px 0 2px; }
.how p { margin: 0; color: var(--text-muted); }
.callout { background: var(--surface-2); border-radius: var(--radius); padding: 16px 20px; }
.guide-styles { margin: 20px 0 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr)); }
@media (max-width: 720px) { .guide-styles .style-card:nth-child(n + 4) { display: grid; } }

/* ---- auth & message pages ------------------------------------------------------------------------------------------ */
.auth { max-width: 440px; margin: 16px auto 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; }
@media (max-width: 520px) { .auth { padding: 22px 18px; } }
.auth h1 { font-size: 1.75rem; }
.auth-foot { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; font-size: 0.9375rem; color: var(--text-muted); }
.cf-turnstile { min-height: 65px; }
.message-page { max-width: 560px; margin: 32px auto 0; text-align: center; }
.message-icon { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--info-soft); color: var(--focus); margin-bottom: 16px; }
.message-icon.error { background: var(--danger-soft); color: var(--danger); }
.message-icon.ok { background: var(--success-soft); color: var(--success); }
.dest-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 16px; overflow-wrap: anywhere; text-align: left; }
.prose { max-width: 720px; }
.prose h2 { font-size: 1.25rem; margin-top: 1.6em; }
.prose li { margin-bottom: 0.4em; }
.pricing .table-wrap { margin: 24px 0 8px; }
.pricing tbody th { font-weight: 400; background: none; position: static; }
.pricing tbody th b { display: block; }
.pricing tbody th .muted { display: block; font-size: 0.875rem; margin-top: 2px; }
.pricing td:last-child, .pricing th:last-child { width: 32%; white-space: nowrap; }
.pricing td:last-child b { font-size: 1.125rem; font-variant-numeric: tabular-nums; }
.pricing .per { white-space: nowrap; }
.pricing .cta-row { margin-top: 28px; }
@media (max-width: 520px) { .pricing td:last-child, .pricing th:last-child { width: auto; white-space: normal; } }

/* ---- vCard page ----------------------------------------------------------------------------------------------------- */
.vcard { max-width: 460px; margin: 8px auto 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 22px; display: grid; gap: 20px; }
.vcard-head { display: flex; gap: 16px; align-items: center; }
.vcard-head h1 { font-size: 1.5rem; margin: 0; }
.vcard-head p { margin: 2px 0 0; }
.avatar { width: 64px; height: 64px; flex: none; border-radius: 18px; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; font: 700 1.75rem/1 var(--font-display); }
.vcard-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.vcard-list a, .vcard-list .row { display: flex; align-items: center; gap: 12px; padding: 12px 8px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.vcard-list a:hover { background: var(--surface-2); }
.vcard-list .icon { color: var(--accent); }
.vcard-note { color: var(--text-muted); white-space: pre-line; margin: 0; }

/* ---- dashboard ------------------------------------------------------------------------------------------------------ */
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; align-items: center; }
.filters .field { min-width: 150px; }
.filters .field.grow { min-width: min(100%, 260px); }
.code-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.code-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto auto; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.code-row:hover { border-color: var(--border-strong); }
.thumb img { display: block; width: 72px; height: 72px; border-radius: 6px; background: #fff; }
.info { display: grid; gap: 4px; min-width: 0; }
.info .name { font-weight: 650; font-size: 1.0625rem; color: var(--text); text-decoration: none; }
.info .name:hover { color: var(--accent); text-decoration: underline; }
.meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dest { color: var(--text-muted); font-size: 0.9375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nums { text-align: right; display: grid; font-variant-numeric: tabular-nums; }
.nums b { font-size: 1.25rem; font-family: var(--font-display); }
.nums span { font-size: 0.8125rem; color: var(--text-muted); }
.row-actions { display: flex; gap: 6px; }
@media (max-width: 760px) {
  .code-row { grid-template-columns: 64px minmax(0, 1fr); }
  .thumb img { width: 64px; height: 64px; }
  .nums { grid-column: 2; text-align: left; display: flex; gap: 6px; align-items: baseline; }
  .row-actions { grid-column: 1 / -1; }
  .row-actions .btn { flex: 1; }
}
.empty { text-align: center; padding: 48px 24px; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.empty p { max-width: 50ch; margin-left: auto; margin-right: auto; }

/* ---- editor ---------------------------------------------------------------------------------------------------------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; }
.editor-form { display: grid; gap: 20px; min-width: 0; }
.editor-form legend { display: flex; align-items: center; gap: 10px; font: 700 1.125rem/1.2 var(--font-display); margin-bottom: 16px; float: left; width: 100%; }
/* every child clears the floated legend, including a group that follows a hidden one (else it's squeezed beside it) */
.editor-form .panel > :not(legend) { clear: both; }
.type-fields { display: grid; gap: 16px; }
.type-fields[hidden] { display: none !important; }
.editor-form .panel > * + * { margin-top: 16px; }
.editor-form .panel > legend + * { margin-top: 0; }
.preview-sticky { position: sticky; top: 16px; display: grid; gap: 14px; }
@media (max-width: 920px) { .editor { grid-template-columns: minmax(0, 1fr); } .editor-preview { order: -1; } .preview-sticky { position: static; } .preview-sticky .proof { max-width: 360px; margin: 0 auto; width: 100%; } }
.type-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.opt-card { position: relative; display: block; cursor: pointer; font-weight: 400; }
.opt-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt-body { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); height: 100%; transition: border-color 150ms ease-out, background-color 150ms ease-out; }
.opt-card:hover .opt-body { background: var(--surface-2); }
.opt-card input:checked + .opt-body { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.opt-card input:focus-visible + .opt-body { outline: 2px solid var(--focus); outline-offset: 2px; }
.opt-card input:disabled + .opt-body { opacity: 0.5; cursor: not-allowed; }
.opt-label { font-weight: 600; font-size: 0.9375rem; }
.opt-hint { font-size: 0.8125rem; color: var(--text-muted); }
.opt-row { display: flex; flex-wrap: wrap; gap: 8px; }
.opt-card.mini .opt-body { display: flex; align-items: center; gap: 8px; padding: 8px 12px; min-height: 44px; }
.swatch { fill: var(--text); }
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.sub-panel { border-top: 1px solid var(--border); padding-top: 16px; }
.logo-row { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.logo-row .field { flex: 1 1 220px; min-width: 0; }
input[type="file"] { width: 100%; min-height: 44px; }
.logo-thumb { width: 48px; height: 48px; object-fit: contain; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.save-row { display: grid; gap: 8px; }
.scan { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 0.9375rem; }
.scan.ok { background: var(--success-soft); }
.scan.ok .icon { color: var(--success); }
.scan.bad { background: var(--warning-soft); }
.scan.bad .icon { color: var(--warning); }
.warnings { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 6px; font-size: 0.875rem; }
.warnings li { display: flex; gap: 8px; align-items: flex-start; }
.warnings .warn .icon, .warnings .bad .icon { color: var(--warning); }
.warnings .bad { color: var(--danger); font-weight: 500; }
.warnings .info .icon { color: var(--focus); }
#preview-status .muted { margin: 10px 0 0; }
#preview[aria-busy="true"] svg { opacity: 0.6; transition: opacity 150ms; }

/* ---- code page -------------------------------------------------------------------------------------------------------- */
.code-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 24px; align-items: start; }
.code-main { display: grid; gap: 20px; min-width: 0; }
.code-side { display: grid; gap: 14px; }
.code-side h2 { margin: 8px 0 0; }
@media (max-width: 900px) { .code-layout { grid-template-columns: minmax(0, 1fr); } .code-side .proof { max-width: 360px; width: 100%; margin: 0 auto; } }
.short-link { display: flex; align-items: center; gap: 4px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 4px 4px 4px 12px; }
.short-link .mono { flex: 1; overflow-wrap: anywhere; font-weight: 600; }
.download { display: grid; gap: 12px; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.seg label, .seg a { position: relative; flex: 1; text-align: center; font-weight: 600; font-size: 0.9375rem; cursor: pointer; color: var(--text); text-decoration: none; }
.seg label + label, .seg a + a { border-left: 1px solid var(--border-strong); }
.seg input { position: absolute; opacity: 0; }
.seg span, .seg a { display: block; padding: 10px 14px; min-height: 42px; }
.seg input:checked + span, .seg a[aria-current] { background: var(--text); color: var(--bg); }
.seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: -3px; }
.seg.small a { padding: 7px 10px; min-height: 36px; font-size: 0.8125rem; white-space: nowrap; }
.download .seg { display: flex; }
.dest-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.dest-form .field { min-width: min(100%, 280px); }
p.dest { white-space: normal; overflow-wrap: anywhere; color: var(--text); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpis div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; display: grid; }
.kpis b { font: 700 1.5rem/1.2 var(--font-display); font-variant-numeric: tabular-nums; }
.kpis b.small-b { font-size: 1.0625rem; line-height: 1.6; }
.kpis span { font-size: 0.8125rem; color: var(--text-muted); }
@media (max-width: 640px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.chart { margin: 0 0 16px; }
.chart-empty { background: var(--surface-2); border-radius: var(--radius-sm); padding: 24px 16px; text-align: center; margin: 0 0 16px; }
.chart svg { width: 100%; height: 160px; display: block; }
.chart rect { fill: var(--accent); }
.chart rect:hover { fill: var(--accent-hover); }
.chart .axis { stroke: var(--border-strong); stroke-width: 1; }
.chart figcaption { display: flex; justify-content: space-between; font-size: 0.8125rem; color: var(--text-muted); margin-top: 6px; }
.breakdown { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 0.9375rem; }
.breakdown li { display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr) 3.5rem; gap: 10px; align-items: center; }
.b-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-bar { display: block; min-width: 0; }
.b-bar svg { width: 100%; height: 8px; display: block; background: var(--surface-2); border-radius: 2px; }
.b-bar rect { fill: var(--accent); }
.b-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.history { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.history li { display: grid; gap: 2px; }

/* ---- account / admin ---------------------------------------------------------------------------------------------------- */
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.account-grid .danger-zone { grid-column: 1 / -1; }
@media (max-width: 800px) { .account-grid { grid-template-columns: minmax(0, 1fr); } }
main.wide > .panel + .panel { margin-top: 20px; }
.table-wrap { position: relative; overflow-x: auto; margin: 8px 0 20px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface-2); font-weight: 600; position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.actions { white-space: nowrap; display: flex; gap: 6px; flex-wrap: wrap; }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checklist li { display: flex; gap: 8px; align-items: center; }
.checklist .on .icon { color: var(--success); }
.checklist .off .icon { color: var(--warning); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---- paid codes -------------------------------------------------------------------------------------------------------- */
.quota { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin: 0 0 20px; }
.quota > span { flex: 1; min-width: 200px; }
.quota .icon { color: var(--success); }
.quota.none .icon { color: var(--focus); }
.packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 16px; margin: 0 0 12px; max-width: 640px; }
.pack { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; display: grid; gap: 4px; align-content: start; }
.pack.best { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.pack .chip { justify-self: start; background: var(--accent-soft); margin: 0 0 4px; }
.pack h2 { margin: 0; }
.pack .price { font: 750 2.25rem/1.1 var(--font-display); letter-spacing: -0.02em; margin: 4px 0 0; }
.pack .price .per { font: 500 1rem/1 var(--font); color: var(--text-muted); letter-spacing: 0; }
.pack.plain { background: var(--surface-2); border-color: transparent; }
.pack .field { margin-top: 8px; }
form.give { display: inline-flex; gap: 4px; align-items: center; }
form.give input { width: 72px; min-height: 36px; padding: 4px 8px; }
.billing-set { border-top: 1px solid var(--border); padding-top: 16px; display: grid; gap: 8px; }
.pack .btn { margin-top: 12px; }
.pricing-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 16px; margin-top: 20px; }
.pricing-list div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.pricing-list .price { font: 750 1.75rem/1.1 var(--font-display); margin: 6px 0; }
.pricing-list p { color: var(--text-muted); margin: 0; }
