/* design/tokens.css (inlined for a standalone mock) */
/* Tool Build Pack design tokens. Plain CSS custom properties, no build step.
   Light theme is the base. Dark theme comes from prefers-color-scheme or [data-theme="dark"]. */

:root {
  color-scheme: light;

  /* Neutral scale (cool grey) */
  --n-0: #ffffff;
  --n-25: #fbfcfd;
  --n-50: #f6f7f9;
  --n-100: #eef0f3;
  --n-200: #e1e5ea;
  --n-300: #c9d0d8;
  --n-400: #9aa4b1;
  --n-500: #6b7584;
  --n-600: #525b69;
  --n-700: #3a4250;
  --n-800: #252b35;
  --n-900: #161a21;
  --n-950: #0d1015;

  /* Semantic colours (AA on white for text use) */
  --bg: var(--n-50);
  --surface: var(--n-0);
  --surface-2: var(--n-25);
  --surface-sunken: var(--n-100);
  --text: var(--n-900);
  --text-2: var(--n-600);
  --text-3: var(--n-500);
  --border: var(--n-200);
  --border-strong: var(--n-300);
  --overlay: rgb(13 16 21 / 0.45);

  --success: #15803d;
  --success-bg: #ecfdf3;
  --warning: #a15c07;
  --warning-bg: #fff8e6;
  --danger: #c0262d;
  --danger-bg: #fef2f2;
  --info: #1d5fbf;
  --info-bg: #eef5ff;

  /* Hub accent: overridden by body.hub-N. Default = hub 1. */
  --accent: #0f766e;
  --accent-hover: #0b5f58;
  --accent-ink: #ffffff;         /* text on a solid accent background */
  --accent-soft: #e6f4f2;        /* tinted backgrounds */
  --accent-soft-ink: #0b5f58;    /* text on accent-soft */

  --focus: var(--accent);
  --focus-ring: 0 0 0 3px var(--surface), 0 0 0 5px var(--focus);

  /* Type: system stack only, no web fonts */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans",
    "Noto Sans Devanagari", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --fs-xs: 0.75rem;    /* 12 */
  --fs-sm: 0.875rem;   /* 14 */
  --fs-md: 1rem;       /* 16: body and inputs (no iOS zoom) */
  --fs-lg: 1.125rem;   /* 18 */
  --fs-xl: 1.375rem;   /* 22 */
  --fs-2xl: 1.75rem;   /* 28: H1 on mobile */
  --fs-3xl: 2.25rem;   /* 36: big result, H1 on desktop */
  --fs-4xl: 3rem;      /* 48: device-test counters */
  --lh-tight: 1.2;
  --lh-normal: 1.5;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --numeric: tabular-nums;

  /* Spacing: 4 px base */
  --s-0: 0;
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;

  --tap: 44px;               /* minimum touch target */
  --content-max: 1120px;
  --prose-max: 68ch;

  /* Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 999px;

  /* Shadow */
  --sh-1: 0 1px 2px rgb(16 24 40 / 0.06), 0 1px 1px rgb(16 24 40 / 0.04);
  --sh-2: 0 4px 12px rgb(16 24 40 / 0.08), 0 1px 3px rgb(16 24 40 / 0.06);
  --sh-3: 0 16px 40px rgb(16 24 40 / 0.16), 0 4px 10px rgb(16 24 40 / 0.08);

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --dur-1: 120ms;
  --dur-2: 200ms;
  --dur-3: 320ms;

  /* Layers */
  --z-sticky: 20;
  --z-header: 30;
  --z-drawer: 50;
  --z-toast: 60;
  --z-mock: 70;
}

/* One calm accent per hub. Light values give >= 4.5:1 on white. */
body.hub-1 { --accent: #0f766e; --accent-hover: #0b5f58; --accent-soft: #e6f4f2; --accent-soft-ink: #0b5f58; } /* Home Calculators: teal */
body.hub-2 { --accent: #4338ca; --accent-hover: #3730a3; --accent-soft: #eef0fd; --accent-soft-ink: #3730a3; } /* Device Tests: indigo */
body.hub-3 { --accent: #3f6e12; --accent-hover: #335a0e; --accent-soft: #eef5e6; --accent-soft-ink: #335a0e; } /* Map Tools: moss green */
body.hub-4 { --accent: #b0285f; --accent-hover: #8f1f4c; --accent-soft: #fcedf3; --accent-soft-ink: #8f1f4c; } /* Printables & Text: raspberry */
body.hub-5 { --accent: #0b6aa2; --accent-hover: #095683; --accent-soft: #e7f3fa; --accent-soft-ink: #095683; } /* File Tools: ocean blue */
body.hub-6 { --accent: #a14a0a; --accent-hover: #823c08; --accent-soft: #fdf1e7; --accent-soft-ink: #823c08; } /* India Tools: saffron brown */

/* Dark theme values, shared by the media query and the explicit attribute. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1217;
    --surface: #161a21;
    --surface-2: #1b2029;
    --surface-sunken: #11151b;
    --text: #e9edf2;
    --text-2: #aeb7c3;
    --text-3: #8d97a5;
    --border: #2a313c;
    --border-strong: #3a4350;
    --overlay: rgb(0 0 0 / 0.6);
    --success: #4ade80; --success-bg: #0f2a1b;
    --warning: #fbbf24; --warning-bg: #2b2108;
    --danger: #f87171;  --danger-bg: #2d1416;
    --info: #7cb4ff;    --info-bg: #10223d;
    --accent-ink: #0d1015;
    --sh-1: 0 1px 2px rgb(0 0 0 / 0.4);
    --sh-2: 0 4px 14px rgb(0 0 0 / 0.45);
    --sh-3: 0 18px 44px rgb(0 0 0 / 0.6);
  }
  :root:not([data-theme="light"]) body.hub-1 { --accent: #3ccfbf; --accent-hover: #6adccf; --accent-soft: #10302d; --accent-soft-ink: #7fe3d7; }
  :root:not([data-theme="light"]) body.hub-2 { --accent: #a3a8ff; --accent-hover: #c0c3ff; --accent-soft: #1f2148; --accent-soft-ink: #c4c7ff; }
  :root:not([data-theme="light"]) body.hub-3 { --accent: #9ad35c; --accent-hover: #b4e384; --accent-soft: #1d2b10; --accent-soft-ink: #bfe896; }
  :root:not([data-theme="light"]) body.hub-4 { --accent: #f38bb6; --accent-hover: #f7aecb; --accent-soft: #3a1626; --accent-soft-ink: #f8b9d3; }
  :root:not([data-theme="light"]) body.hub-5 { --accent: #6cc0f0; --accent-hover: #98d3f5; --accent-soft: #0e2a3c; --accent-soft-ink: #a5d9f6; }
  :root:not([data-theme="light"]) body.hub-6 { --accent: #f5a65b; --accent-hover: #f8c08a; --accent-soft: #35200c; --accent-soft-ink: #f9c99a; }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1217;
  --surface: #161a21;
  --surface-2: #1b2029;
  --surface-sunken: #11151b;
  --text: #e9edf2;
  --text-2: #aeb7c3;
  --text-3: #8d97a5;
  --border: #2a313c;
  --border-strong: #3a4350;
  --overlay: rgb(0 0 0 / 0.6);
  --success: #4ade80; --success-bg: #0f2a1b;
  --warning: #fbbf24; --warning-bg: #2b2108;
  --danger: #f87171;  --danger-bg: #2d1416;
  --info: #7cb4ff;    --info-bg: #10223d;
  --accent-ink: #0d1015;
  --sh-1: 0 1px 2px rgb(0 0 0 / 0.4);
  --sh-2: 0 4px 14px rgb(0 0 0 / 0.45);
  --sh-3: 0 18px 44px rgb(0 0 0 / 0.6);
}
:root[data-theme="dark"] body.hub-1 { --accent: #3ccfbf; --accent-hover: #6adccf; --accent-soft: #10302d; --accent-soft-ink: #7fe3d7; }
:root[data-theme="dark"] body.hub-2 { --accent: #a3a8ff; --accent-hover: #c0c3ff; --accent-soft: #1f2148; --accent-soft-ink: #c4c7ff; }
:root[data-theme="dark"] body.hub-3 { --accent: #9ad35c; --accent-hover: #b4e384; --accent-soft: #1d2b10; --accent-soft-ink: #bfe896; }
:root[data-theme="dark"] body.hub-4 { --accent: #f38bb6; --accent-hover: #f7aecb; --accent-soft: #3a1626; --accent-soft-ink: #f8b9d3; }
:root[data-theme="dark"] body.hub-5 { --accent: #6cc0f0; --accent-hover: #98d3f5; --accent-soft: #0e2a3c; --accent-soft-ink: #a5d9f6; }
:root[data-theme="dark"] body.hub-6 { --accent: #f5a65b; --accent-hover: #f8c08a; --accent-soft: #35200c; --accent-soft-ink: #f9c99a; }

@media (prefers-reduced-motion: reduce) {
  :root { --dur-1: 0ms; --dur-2: 0ms; --dur-3: 0ms; }
}


/* design/app.css (inlined for a standalone mock) */
/* Tool Build Pack components. Mobile first, no framework. Needs tokens.css first. */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: var(--fw-regular) var(--fs-md)/var(--lh-normal) var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas, video { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3, h4 { line-height: var(--lh-tight); margin: 0 0 var(--s-3); font-weight: var(--fw-bold); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
p { margin: 0 0 var(--s-3); }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--r-sm); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: var(--s-2); top: -60px; background: var(--surface); padding: var(--s-2) var(--s-3); z-index: 100; border-radius: var(--r-sm); }
.skip-link:focus { top: var(--s-2); }
.num, .tnum { font-variant-numeric: var(--numeric); }
.muted { color: var(--text-2); }
.small { font-size: var(--fs-sm); }
.unverified { font-size: var(--fs-xs); color: var(--warning); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: .03em; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 0 var(--s-4); }
.stack > * + * { margin-top: var(--s-4); }
.row { display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: center; }
.row--between { justify-content: space-between; }
.grid-2 { display: grid; gap: var(--s-3); grid-template-columns: 1fr 1fr; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s-4); box-shadow: var(--sh-1); }
.card .repeater__item { padding: var(--s-3); }
@media (min-width: 560px) { .card .repeater__item { padding: var(--s-4); } }
.card--flat { box-shadow: none; }
.section { margin: var(--s-10) 0; }
.prose { max-width: var(--prose-max); }
.prose li + li { margin-top: var(--s-1); }
.prose ol, .prose ul { padding-left: var(--s-6); }

/* ---------- Icons ---------- */
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: inline-block; vertical-align: middle; }
.icon--sm { width: 16px; height: 16px; }
.icon--lg { width: 28px; height: 28px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--tap); padding: 0 var(--s-4); border-radius: var(--r-md);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: var(--fw-semibold) var(--fs-sm)/1 var(--font-sans); cursor: pointer; text-decoration: none;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease);
  -webkit-tap-highlight-color: transparent; white-space: nowrap;
}
.btn:hover { background: var(--surface-sunken); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn--soft { background: var(--accent-soft); border-color: transparent; color: var(--accent-soft-ink); }
.btn--soft:hover { background: var(--accent-soft); filter: brightness(.97); color: var(--accent-soft-ink); }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--danger { color: var(--danger); }
.btn--lg { min-height: 52px; padding: 0 var(--s-6); font-size: var(--fs-md); border-radius: var(--r-lg); }
.btn--sm { min-height: 36px; padding: 0 var(--s-3); font-size: var(--fs-xs); }
.btn--icon { width: var(--tap); padding: 0; }
.btn--block { width: 100%; }
.btn .badge { margin-left: 2px; }
.badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink);
  font-size: var(--fs-xs); font-weight: var(--fw-bold); font-variant-numeric: var(--numeric);
}
.badge:empty, .badge[data-count="0"] { display: none; }
.tag { display: inline-flex; align-items: center; gap: var(--s-1); padding: 2px var(--s-2); border-radius: var(--r-pill); background: var(--surface-sunken); color: var(--text-2); font-size: var(--fs-xs); font-weight: var(--fw-semibold); }
.tag--success { background: var(--success-bg); color: var(--success); }
.tag--warning { background: var(--warning-bg); color: var(--warning); }
.tag--danger { background: var(--danger-bg); color: var(--danger); }
.tag--accent { background: var(--accent-soft); color: var(--accent-soft-ink); }

/* ---------- Page chrome ---------- */
.site-header { position: sticky; top: 0; z-index: var(--z-header); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--border); }
.site-header__inner { display: flex; align-items: center; gap: var(--s-2); min-height: 60px; }
.wordmark { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: var(--fw-bold); color: var(--text); text-decoration: none; font-size: var(--fs-md); letter-spacing: -.01em; white-space: nowrap; }
.wordmark:hover { color: var(--text); }
.wordmark__mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.wordmark__mark .icon { width: 18px; height: 18px; }
.site-search { flex: 1; min-width: 0; position: relative; display: none; }
.site-search input { width: 100%; height: 40px; padding: 0 var(--s-3) 0 36px; border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface-sunken); color: var(--text); font: inherit; font-size: var(--fs-sm); }
.site-search .icon { position: absolute; left: 12px; top: 10px; color: var(--text-3); }
.site-header__actions { margin-left: auto; display: flex; gap: var(--s-1); align-items: center; }
.site-header__actions .btn--mystuff .label { display: none; }
@media (min-width: 720px) {
  .site-search { display: block; max-width: 360px; margin-left: var(--s-4); }
  .site-header__actions .btn--mystuff .label { display: inline; }
}

.breadcrumb { font-size: var(--fs-xs); color: var(--text-2); margin: var(--s-3) 0 var(--s-2); }
@media (min-width: 720px) { .breadcrumb { font-size: var(--fs-sm); margin-top: var(--s-4); } }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-1); }
.breadcrumb li + li::before { content: "›"; margin-right: var(--s-1); color: var(--text-3); }
.breadcrumb a { color: var(--text-2); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

.tool-head { margin-bottom: var(--s-4); }
.tool-head__title { display: flex; align-items: flex-start; gap: var(--s-2); }
.tool-head h1 { font-size: var(--fs-2xl); letter-spacing: -.02em; margin: 0; flex: 1; }
.tool-head__promise { color: var(--text-2); margin: var(--s-1) 0 var(--s-2); max-width: 60ch; font-size: var(--fs-sm); }
@media (min-width: 720px) { .tool-head__promise { font-size: var(--fs-md); } }
.pin-btn { flex: none; }
.pin-btn[aria-pressed="true"] { color: var(--warning); }
.pin-btn[aria-pressed="true"] .icon { fill: currentColor; }
.trust-row { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-3); font-size: var(--fs-sm); color: var(--text-2); list-style: none; padding: 0; margin: 0; }
.trust-row li { display: inline-flex; align-items: center; gap: 6px; }
.trust-row .icon { width: 16px; height: 16px; color: var(--success); }
@media (min-width: 900px) { .tool-head h1 { font-size: var(--fs-3xl); } }

.site-footer { margin-top: var(--s-16); padding: var(--s-8) 0 calc(var(--s-8) + 72px); background: var(--surface); border-top: 1px solid var(--border); font-size: var(--fs-sm); color: var(--text-2); }
.site-footer__grid { display: grid; gap: var(--s-6); }
.site-footer a { color: var(--text-2); }
.site-footer .privacy-line { display: flex; gap: var(--s-2); align-items: flex-start; color: var(--text); }
@media (min-width: 720px) { .site-footer__grid { grid-template-columns: 2fr 1fr 1fr; } .site-footer { padding-bottom: var(--s-8); } }

/* ---------- Tool layout ---------- */
.tool { display: grid; gap: var(--s-4); align-items: start; }
.tool__inputs { min-width: 0; }
.tool__result { min-width: 0; }
@media (min-width: 900px) {
  .tool { grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: var(--s-6); }
  .tool__result { position: sticky; top: 76px; }
}

/* ---------- Forms (calculator) ---------- */
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field + .field { margin-top: var(--s-3); }
.field__label { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text); display: flex; align-items: baseline; gap: var(--s-2); justify-content: space-between; }
.field__hint { font-size: var(--fs-xs); color: var(--text-2); }
.field__error { font-size: var(--fs-sm); color: var(--danger); display: flex; gap: 6px; align-items: center; }
.input-group { display: grid; gap: var(--s-3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.input-group > .field { margin-top: 0; }
.input-group--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 560px) { .input-group--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.fieldset legend { padding: 0; font-weight: var(--fw-semibold); font-size: var(--fs-sm); margin-bottom: var(--s-2); }

.input, .select, .textarea {
  width: 100%; min-height: var(--tap); padding: 0 var(--s-3); border-radius: var(--r-md);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-size: var(--fs-md); font-variant-numeric: var(--numeric);
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--n-400); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-bg); }
.select { appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.textarea { padding: var(--s-3); min-height: 140px; resize: vertical; line-height: var(--lh-normal); }

.input-unit { position: relative; display: flex; align-items: stretch; }
.input-unit .input { padding-right: 52px; }
.input-unit__suffix { position: absolute; right: 1px; top: 1px; bottom: 1px; display: grid; place-items: center; padding: 0 var(--s-3); color: var(--text-2); font-size: var(--fs-sm); pointer-events: none; border-radius: 0 var(--r-md) var(--r-md) 0; }

/* Segmented control (radio group). Use for unit toggles and type pickers. */
.segmented { display: inline-flex; padding: 3px; gap: 3px; border-radius: var(--r-md); background: var(--surface-sunken); border: 1px solid var(--border); max-width: 100%; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 var(--s-3); border-radius: 8px; font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-2); cursor: pointer; transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease); white-space: nowrap; }
.segmented input:checked + label { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }
.segmented input:focus-visible + label { box-shadow: var(--focus-ring); }
.segmented--icons { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
.segmented--icons label { flex-direction: column; min-height: 64px; padding: var(--s-2) var(--s-1); font-size: var(--fs-xs); }
.segmented--icons label .icon { width: 28px; height: 28px; }
.segmented--icons input:checked + label { color: var(--accent-soft-ink); background: var(--surface); }
.unit-toggle { /* alias of .segmented with 2 options */ }

/* Slider with value */
.slider { display: grid; grid-template-columns: 1fr auto; gap: var(--s-3); align-items: center; }
.slider input[type="range"] { width: 100%; height: var(--tap); accent-color: var(--accent); background: transparent; }
.slider__value { min-width: 64px; text-align: right; font-weight: var(--fw-semibold); font-variant-numeric: var(--numeric); }

/* Stepper */
.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--border-strong); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.stepper button { width: var(--tap); border: 0; background: var(--surface-sunken); color: var(--text); font-size: var(--fs-lg); cursor: pointer; }
.stepper button:hover { background: var(--border); }
.stepper input { width: 64px; border: 0; text-align: center; font: inherit; font-variant-numeric: var(--numeric); background: transparent; color: var(--text); min-height: var(--tap); }
.stepper input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }

/* Repeater ("Add section") */
.repeater { display: grid; gap: var(--s-3); }
.repeater__item { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); padding: var(--s-4); position: relative; }
.repeater__item.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.repeater__head { display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-3); }
.repeater__name { flex: 1; min-width: 0; font-weight: var(--fw-semibold); border: 1px solid transparent; background: transparent; padding: 6px var(--s-2); margin-left: calc(var(--s-2) * -1); border-radius: var(--r-sm); font: inherit; font-weight: var(--fw-semibold); color: var(--text); }
.repeater__name:hover { border-color: var(--border); }
.repeater__name:focus { outline: none; border-color: var(--accent); }
.repeater__add { border: 1.5px dashed var(--border-strong); background: transparent; color: var(--accent); width: 100%; min-height: 52px; border-radius: var(--r-lg); font: inherit; font-weight: var(--fw-semibold); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: var(--s-2); }
.repeater__add:hover { border-color: var(--accent); background: var(--accent-soft); }

.details-toggle { margin-top: var(--s-3); }
.details-toggle summary { cursor: pointer; color: var(--accent); font-weight: var(--fw-semibold); font-size: var(--fs-sm); min-height: 32px; display: inline-flex; align-items: center; gap: 6px; list-style: none; }
.details-toggle summary::-webkit-details-marker { display: none; }
.details-toggle summary::before { content: "+"; font-weight: var(--fw-bold); }
.details-toggle[open] summary::before { content: "−"; }

/* ---------- Result panel ---------- */
.result { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--sh-2); overflow: hidden; }
.result__main { padding: var(--s-5) var(--s-5) var(--s-4); background: linear-gradient(180deg, var(--accent-soft), var(--surface)); }
.result__label { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--accent-soft-ink); margin: 0 0 var(--s-1); }
.result__value { font-size: var(--fs-3xl); font-weight: var(--fw-bold); letter-spacing: -.02em; line-height: 1.05; font-variant-numeric: var(--numeric); margin: 0; }
.result__value small { font-size: var(--fs-lg); font-weight: var(--fw-semibold); color: var(--text-2); letter-spacing: 0; }
.result__sub { color: var(--text-2); font-size: var(--fs-sm); margin: var(--s-1) 0 0; }
.result__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--border); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stat { background: var(--surface); padding: var(--s-3) var(--s-4); min-width: 0; }
.stat__label { font-size: var(--fs-xs); color: var(--text-2); font-weight: var(--fw-medium); }
.stat__value { font-size: var(--fs-lg); font-weight: var(--fw-bold); font-variant-numeric: var(--numeric); margin-top: 2px; }
.stat__value small { font-size: var(--fs-xs); color: var(--text-2); font-weight: var(--fw-medium); }
.result__body { padding: var(--s-4) var(--s-5); }
.result__foot { padding: var(--s-3) var(--s-5) var(--s-4); border-top: 1px solid var(--border); }
.result.is-empty .result__value, .result.is-error .result__value { color: var(--text-3); }
.result-explain { font-size: var(--fs-sm); color: var(--text-2); }

/* Breakdown and data tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); font-variant-numeric: var(--numeric); }
.table th, .table td { padding: 10px var(--s-3); text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.table thead th { background: var(--surface-2); font-weight: var(--fw-semibold); color: var(--text-2); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .03em; }
.table tbody tr:last-child td, .table tbody tr:last-child th { border-bottom: 0; }
.table td.r, .table th.r { text-align: right; }
.table tr.is-highlight td, .table tr.is-highlight th { background: var(--accent-soft); }
.table tfoot td { font-weight: var(--fw-bold); border-top: 1px solid var(--border-strong); border-bottom: 0; }
.breakdown { font-size: var(--fs-sm); width: 100%; border-collapse: collapse; font-variant-numeric: var(--numeric); }
.breakdown td { padding: 8px 0; border-bottom: 1px dashed var(--border); }
.breakdown td:last-child { text-align: right; font-weight: var(--fw-semibold); }
.breakdown tr:last-child td { border-bottom: 0; }

/* Formula block */
.formula { background: var(--surface-sunken); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--r-md); padding: var(--s-4); font-family: var(--font-mono); font-size: var(--fs-sm); line-height: 1.7; overflow-x: auto; white-space: pre-wrap; }
.formula b { font-family: var(--font-sans); }
.fact { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3) var(--s-4); background: var(--info-bg); color: var(--text); border-radius: var(--r-md); font-size: var(--fs-sm); }
.fact .icon { color: var(--info); margin-top: 2px; }

/* ---------- Shared: action bar, chips, cards ---------- */
.action-bar { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.action-bar .btn { flex: 1 1 auto; }
@media (min-width: 560px) { .action-bar .btn { flex: 0 0 auto; } }
.result__foot .action-bar { gap: 6px; }
.result__foot .action-bar .btn { padding: 0 var(--s-3); }
.result__foot .action-bar .btn--icon { padding: 0; width: 40px; }
.chips { display: flex; gap: var(--s-2); overflow-x: auto; padding: 2px 2px var(--s-2); scrollbar-width: thin; }
.chips:empty::before { content: attr(data-empty); color: var(--text-3); font-size: var(--fs-sm); }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 var(--s-3); border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-sm); cursor: pointer; font-variant-numeric: var(--numeric); }
.chip:hover { border-color: var(--accent); }
.chip.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-soft-ink); }
.chip__time { color: var(--text-3); font-size: var(--fs-xs); }
.recent { display: flex; align-items: center; gap: var(--s-3); }
.recent__label { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-2); flex: none; }
.recent .chips { flex: 1; min-width: 0; }

.next-card { display: flex; gap: var(--s-3); align-items: center; padding: var(--s-4); border-radius: var(--r-lg); background: var(--accent-soft); color: var(--text); text-decoration: none; border: 1px solid transparent; }
.next-card:hover { border-color: var(--accent); color: var(--text); }
.next-card__icon { width: 44px; height: 44px; border-radius: 12px; background: var(--surface); color: var(--accent); display: grid; place-items: center; flex: none; }
.next-card__title { font-weight: var(--fw-semibold); }
.next-card__text { font-size: var(--fs-sm); color: var(--text-2); }

.related { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); list-style: none; padding: 0; margin: 0; }
.related a { display: flex; gap: var(--s-3); align-items: center; padding: var(--s-4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); color: var(--text); text-decoration: none; min-height: 72px; transition: border-color var(--dur-1) var(--ease), transform var(--dur-1) var(--ease); }
.related a:hover { border-color: var(--accent); transform: translateY(-1px); }
.related .next-card__icon { background: var(--accent-soft); }
.related small { display: block; color: var(--text-2); font-size: var(--fs-xs); }

.empty-state { text-align: center; padding: var(--s-8) var(--s-4); color: var(--text-2); }
.empty-state .icon { width: 40px; height: 40px; margin: 0 auto var(--s-3); color: var(--text-3); }
.empty-state__title { color: var(--text); font-weight: var(--fw-semibold); margin-bottom: var(--s-1); }

.alert { display: flex; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); font-size: var(--fs-sm); border: 1px solid transparent; align-items: flex-start; }
.alert--info { background: var(--info-bg); }
.alert--success { background: var(--success-bg); }
.alert--warning { background: var(--warning-bg); }
.alert--danger { background: var(--danger-bg); color: var(--text); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.alert .icon { margin-top: 1px; }
.alert--danger .icon { color: var(--danger); }
.alert--warning .icon { color: var(--warning); }
.alert--success .icon { color: var(--success); }
.alert--info .icon { color: var(--info); }

/* FAQ */
.faq { border-top: 1px solid var(--border); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary { list-style: none; cursor: pointer; padding: var(--s-4) 0; font-weight: var(--fw-semibold); display: flex; justify-content: space-between; gap: var(--s-4); min-height: var(--tap); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; width: 10px; height: 10px; border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2); transform: rotate(45deg); margin-top: 4px; flex: none; transition: transform var(--dur-2) var(--ease); }
.faq details[open] summary::after { transform: rotate(225deg); margin-top: 8px; }
.faq details > div { padding: 0 0 var(--s-4); color: var(--text-2); max-width: var(--prose-max); }

.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-3); }
.steps li { counter-increment: step; display: grid; grid-template-columns: 32px 1fr; gap: var(--s-3); align-items: start; }
.steps li::before { content: counter(step); width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-soft-ink); display: grid; place-items: center; font-weight: var(--fw-bold); font-size: var(--fs-sm); }

/* Quote checker / comparison list */
.compare-list { display: grid; gap: var(--s-2); }
.compare-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: var(--s-2); align-items: center; }
.compare-row .tag { justify-self: start; }
.compare-out { font-variant-numeric: var(--numeric); }

/* ---------- Toasts ---------- */
.toast-region { position: fixed; left: 50%; bottom: calc(var(--s-4) + 72px); transform: translateX(-50%); z-index: var(--z-toast); display: grid; gap: var(--s-2); width: min(92vw, 420px); pointer-events: none; }
.toast { pointer-events: auto; background: var(--n-900); color: #fff; padding: var(--s-3) var(--s-4); border-radius: var(--r-md); box-shadow: var(--sh-3); font-size: var(--fs-sm); display: flex; align-items: center; gap: var(--s-2); animation: tb-in var(--dur-3) var(--ease); }
:root[data-theme="dark"] .toast { background: #f1f4f8; color: var(--n-900); }
.toast .icon { color: #4ade80; }
:root[data-theme="dark"] .toast .icon { color: var(--success); }
@media (min-width: 900px) { .toast-region { bottom: var(--s-6); } }
@keyframes tb-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.copied { color: var(--success) !important; }

/* ---------- My stuff drawer ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: var(--overlay); z-index: var(--z-drawer); opacity: 0; pointer-events: none; transition: opacity var(--dur-2) var(--ease); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--surface); z-index: calc(var(--z-drawer) + 1); box-shadow: var(--sh-3); transform: translateX(100%); transition: transform var(--dur-3) var(--ease); display: flex; flex-direction: column; visibility: hidden; }
.drawer.is-open { transform: none; visibility: visible; }
.drawer.is-open + .drawer-backdrop, .drawer-backdrop.is-open { opacity: 1; pointer-events: auto; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); }
.drawer__head h2 { margin: 0; font-size: var(--fs-lg); }
.drawer__tabs { display: flex; gap: var(--s-1); padding: var(--s-2) var(--s-4); border-bottom: 1px solid var(--border); overflow-x: auto; }
.drawer__tabs button { border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: var(--fs-sm); font-weight: var(--fw-semibold); padding: 0 var(--s-3); min-height: 40px; border-radius: var(--r-sm); cursor: pointer; white-space: nowrap; }
.drawer__tabs button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent-soft-ink); }
.drawer__body { padding: var(--s-4); overflow-y: auto; flex: 1; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.list-item { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.list-item__main { flex: 1; min-width: 0; }
.list-item__title { font-weight: var(--fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item__meta { font-size: var(--fs-xs); color: var(--text-2); }
.list-item a { color: inherit; text-decoration: none; }

/* ---------- Mobile sticky result bar ---------- */
.sticky-result { position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-sticky); background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -6px 20px rgb(16 24 40 / .08); padding: var(--s-2) var(--s-4) calc(var(--s-2) + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: var(--s-3); transform: none; transition: transform var(--dur-2) var(--ease); }
.sticky-result.is-hidden { transform: translateY(110%); }
.sticky-result__value { flex: 1; min-width: 0; font-variant-numeric: var(--numeric); }
.sticky-result__value b { font-size: var(--fs-md); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: var(--numeric); }
.sticky-result__value span { display: block; font-size: var(--fs-xs); color: var(--text-2); }
@media (min-width: 900px) { .sticky-result { display: none; } }

/* ---------- Ad slots (hidden until body.show-ads). Never between input and result. ---------- */
.ad-slot { display: none; margin: var(--s-8) auto; background: repeating-linear-gradient(45deg, var(--surface-sunken), var(--surface-sunken) 10px, var(--surface-2) 10px, var(--surface-2) 20px); border: 1px dashed var(--border-strong); border-radius: var(--r-sm); color: var(--text-3); font-size: var(--fs-xs); place-items: center; text-transform: uppercase; letter-spacing: .06em; contain: strict; }
.ad-slot::before { content: "Ad " attr(data-size); }
.ad-slot--300x250 { width: 300px; height: 250px; }
.ad-slot--728x90 { width: 320px; height: 100px; }   /* mobile fallback keeps the space reserved */
.ad-slot--320x100 { width: 320px; height: 100px; }
@media (min-width: 760px) { .ad-slot--728x90 { width: 728px; height: 90px; } }
body.show-ads .ad-slot { display: grid; }

/* ======================================================================
   Archetype: device-test
   ====================================================================== */
.stage { position: relative; min-height: 360px; border-radius: var(--r-xl); background: var(--n-950); color: #fff; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--border); }
.stage:fullscreen { border-radius: 0; }
.stage__center { text-align: center; padding: var(--s-6); display: grid; gap: var(--s-4); justify-items: center; }
.stage__hint { color: #c6cdd8; font-size: var(--fs-sm); }
.stage__corner { position: absolute; top: var(--s-3); right: var(--s-3); display: flex; gap: var(--s-2); }
.stage .btn { background: rgb(255 255 255 / .12); border-color: rgb(255 255 255 / .2); color: #fff; }
.stage .btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.start-btn { min-height: 64px; min-width: 200px; font-size: var(--fs-lg); border-radius: var(--r-pill); }
.meter { display: grid; gap: 6px; width: 100%; }
.meter__bar { height: 14px; border-radius: var(--r-pill); background: var(--surface-sunken); overflow: hidden; }
.meter__fill { height: 100%; width: var(--level, 0%); background: linear-gradient(90deg, var(--success), var(--warning) 75%, var(--danger)); border-radius: inherit; transition: width 80ms linear; }
.meter__labels { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--text-2); font-variant-numeric: var(--numeric); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--s-3); }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s-4); text-align: center; }
.tile__value { font-size: var(--fs-4xl); font-weight: var(--fw-bold); font-variant-numeric: var(--numeric); line-height: 1; }
.tile__label { font-size: var(--fs-xs); color: var(--text-2); margin-top: var(--s-2); text-transform: uppercase; letter-spacing: .04em; }
.keyboard { display: grid; gap: 4px; font-size: var(--fs-xs); user-select: none; overflow-x: auto; }
.keyboard__row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(26px, 1fr); gap: 4px; }
.key { min-height: 36px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; color: var(--text-2); font-family: var(--font-mono); box-shadow: 0 2px 0 var(--border-strong); transition: background var(--dur-1) var(--ease); }
.key--w2 { grid-column: span 2; } .key--w3 { grid-column: span 3; } .key--w6 { grid-column: span 6; }
.key.is-down { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); transform: translateY(2px); box-shadow: none; }
.key.is-tested { background: var(--accent-soft); color: var(--accent-soft-ink); border-color: var(--accent); }
.swatches { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.swatch { width: var(--tap); height: var(--tap); border-radius: 50%; border: 2px solid var(--border); cursor: pointer; background: var(--c, #000); }
.swatch[aria-pressed="true"] { box-shadow: var(--focus-ring); }
.permission-card { max-width: 420px; text-align: left; background: var(--surface); color: var(--text); border-radius: var(--r-lg); padding: var(--s-5); box-shadow: var(--sh-3); display: grid; gap: var(--s-3); }
.permission-card .icon--lg { color: var(--accent); }
.report { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.report__row { display: flex; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.report__row:last-child { border-bottom: 0; }
.report__status--pass { color: var(--success); font-weight: var(--fw-semibold); }
.report__status--fail { color: var(--danger); font-weight: var(--fw-semibold); }

/* ======================================================================
   Archetype: map (mocks never load tiles: use .fake-map)
   ====================================================================== */
.map-layout { display: grid; gap: var(--s-4); }
@media (min-width: 900px) { .map-layout { grid-template-columns: 340px minmax(0, 1fr); } .map-layout .map-canvas { min-height: 560px; } }
.map-canvas { position: relative; min-height: 360px; border-radius: var(--r-xl); border: 1px solid var(--border); overflow: hidden; background: var(--surface-sunken); }
.fake-map {
  background-color: #eae6df;
  background-image:
    radial-gradient(circle at 70% 30%, #cfe3c4 0 60px, transparent 61px),
    radial-gradient(circle at 20% 75%, #cfe3c4 0 80px, transparent 81px),
    linear-gradient(115deg, transparent 47%, #a9cbe6 47% 53%, transparent 53%),
    linear-gradient(0deg, transparent 49.4%, #fff 49.4% 50.6%, transparent 50.6%),
    linear-gradient(90deg, transparent 49.4%, #fff 49.4% 50.6%, transparent 50.6%),
    linear-gradient(0deg, rgb(255 255 255 / .7) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / .7) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 240px 240px, 240px 240px, 40px 40px, 40px 40px;
}
:root[data-theme="dark"] .fake-map { background-color: #1d232b; filter: brightness(.9); background-image:
    radial-gradient(circle at 70% 30%, #23382a 0 60px, transparent 61px),
    radial-gradient(circle at 20% 75%, #23382a 0 80px, transparent 81px),
    linear-gradient(115deg, transparent 47%, #1f3a52 47% 53%, transparent 53%),
    linear-gradient(0deg, transparent 49.4%, #39424f 49.4% 50.6%, transparent 50.6%),
    linear-gradient(90deg, transparent 49.4%, #39424f 49.4% 50.6%, transparent 50.6%),
    linear-gradient(0deg, rgb(255 255 255 / .05) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / .05) 1px, transparent 1px); }
.map-pin { position: absolute; left: var(--x, 50%); top: var(--y, 50%); width: 28px; height: 28px; transform: translate(-50%, -100%); color: var(--accent); }
.map-pin svg { width: 28px; height: 28px; fill: currentColor; stroke: #fff; stroke-width: 1.5; }
.map-radius { position: absolute; left: var(--x, 50%); top: var(--y, 50%); width: var(--d, 200px); height: var(--d, 200px); transform: translate(-50%, -50%); border-radius: 50%; border: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.map-controls { position: absolute; right: var(--s-3); top: var(--s-3); display: grid; gap: 1px; background: var(--border); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--sh-2); }
.map-controls button { width: 40px; height: 40px; border: 0; background: var(--surface); color: var(--text); font-size: var(--fs-lg); cursor: pointer; }
.map-attrib { position: absolute; right: 0; bottom: 0; background: rgb(255 255 255 / .8); color: #333; font-size: 10px; padding: 2px 6px; }
.address-search { position: relative; }
.address-search .input { padding-left: 40px; }
.address-search .icon { position: absolute; left: 12px; top: 12px; color: var(--text-3); }
.result-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; max-height: 320px; overflow-y: auto; }
.result-list li { background: var(--surface); padding: var(--s-3); display: flex; justify-content: space-between; gap: var(--s-2); font-size: var(--fs-sm); font-variant-numeric: var(--numeric); }

/* ======================================================================
   Archetype: text
   ====================================================================== */
.text-io { display: grid; gap: var(--s-4); }
@media (min-width: 900px) { .text-io--split { grid-template-columns: 1fr 1fr; } }
.counter-row { display: flex; gap: var(--s-4); font-size: var(--fs-xs); color: var(--text-2); font-variant-numeric: var(--numeric); justify-content: flex-end; margin-top: var(--s-1); }
.counter-row b { color: var(--text); }
.counter-row .is-over { color: var(--danger); }
.style-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-2); }
.style-item { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-3) var(--s-3) var(--s-4); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.style-item__main { flex: 1; min-width: 0; }
.style-item__name { font-size: var(--fs-xs); color: var(--text-2); }
.style-item__out { font-size: var(--fs-lg); overflow-wrap: anywhere; }
.style-item .btn.is-copied { background: var(--success-bg); color: var(--success); border-color: transparent; }
.output-pane { min-height: 140px; padding: var(--s-3); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font-mono); font-size: var(--fs-sm); }

/* ======================================================================
   Archetype: generator (printables)
   ====================================================================== */
.gen-layout { display: grid; gap: var(--s-4); }
@media (min-width: 900px) { .gen-layout { grid-template-columns: 320px minmax(0, 1fr); } }
.preview-wrap { background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--r-xl); padding: var(--s-4); display: grid; place-items: center; overflow: auto; }
.sheet { background: #fff; color: #111; width: 100%; max-width: 560px; aspect-ratio: 8.5 / 11; box-shadow: var(--sh-2); border-radius: 2px; padding: 6%; display: flex; flex-direction: column; gap: var(--s-3); }
.sheet--a4 { aspect-ratio: 210 / 297; }
.sheet--landscape { aspect-ratio: 11 / 8.5; max-width: 760px; }
.sheet--a4.sheet--landscape { aspect-ratio: 297 / 210; }
.sheet h2, .sheet h3 { color: #111; }
.sheet .table { color: #111; }
.sheet .table th, .sheet .table td { border-color: #ccc; }
.sheet .table thead th { background: #f3f3f3; color: #333; }
.sheet__foot { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s-3); font-size: 11px; color: #555; }
.qr { width: 72px; height: 72px; flex: none; image-rendering: pixelated; }

/* ======================================================================
   Archetype: file
   ====================================================================== */
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--r-xl); background: var(--surface); padding: var(--s-10) var(--s-4); text-align: center; display: grid; gap: var(--s-3); justify-items: center; cursor: pointer; transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease); }
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone__icon { width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.dropzone__title { font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
.dropzone__hint { font-size: var(--fs-sm); color: var(--text-2); }
.local-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px var(--s-3); border-radius: var(--r-pill); background: var(--success-bg); color: var(--success); font-size: var(--fs-xs); font-weight: var(--fw-semibold); }
.file-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-2); }
.file-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: var(--s-3); align-items: center; padding: var(--s-3); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.file-row__thumb { width: 48px; height: 48px; border-radius: 8px; background: var(--surface-sunken); display: grid; place-items: center; color: var(--text-3); overflow: hidden; object-fit: cover; }
.file-row__name { font-weight: var(--fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row__meta { font-size: var(--fs-xs); color: var(--text-2); font-variant-numeric: var(--numeric); display: flex; gap: var(--s-2); flex-wrap: wrap; }
.file-row__saved { color: var(--success); font-weight: var(--fw-semibold); }
.progress { height: 6px; border-radius: var(--r-pill); background: var(--surface-sunken); overflow: hidden; margin-top: 6px; }
.progress__fill { height: 100%; width: var(--p, 0%); background: var(--accent); transition: width var(--dur-2) linear; }
.progress--indeterminate .progress__fill { width: 35%; animation: tb-slide 1.1s ease-in-out infinite; }
@keyframes tb-slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.options-panel { display: grid; gap: var(--s-3); }
.loader-notice { display: flex; align-items: center; gap: var(--s-3); }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--border); border-top-color: var(--accent); animation: tb-spin .8s linear infinite; flex: none; }
@keyframes tb-spin { to { transform: rotate(360deg); } }

/* ---------- Mock toolbar (only with body[data-mock]) ---------- */
.tb-mock { position: fixed; left: var(--s-3); bottom: var(--s-3); z-index: var(--z-mock); background: #10141a; color: #e9edf2; border-radius: var(--r-lg); box-shadow: var(--sh-3); font: 12px/1.3 var(--font-sans); padding: 6px; display: flex; flex-wrap: wrap; gap: 4px; max-width: calc(100vw - 24px); align-items: center; }
.tb-mock__label { padding: 0 6px; color: #8d97a5; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 10px; }
.tb-mock button { border: 0; background: #222935; color: #e9edf2; padding: 6px 9px; border-radius: 7px; font: inherit; cursor: pointer; }
.tb-mock button[aria-pressed="true"] { background: #e9edf2; color: #10141a; }
.tb-mock__sep { width: 1px; height: 18px; background: #333c48; margin: 0 2px; }
.tb-mock__min { margin-left: auto; }
.tb-mock.is-min > :not(.tb-mock__min):not(.tb-mock__label) { display: none; }
@media (max-width: 719px) { .tb-mock { left: auto; right: var(--s-2); bottom: auto; top: 68px; opacity: .92; } .tb-events { top: 112px; bottom: auto; } }
.tb-events { position: fixed; left: var(--s-3); bottom: 64px; z-index: var(--z-mock); width: min(380px, calc(100vw - 24px)); max-height: 40vh; overflow: auto; background: #10141a; color: #cfd6df; border-radius: var(--r-md); font: 11px/1.5 var(--font-mono); padding: var(--s-2) var(--s-3); box-shadow: var(--sh-3); }
.tb-events div { border-bottom: 1px solid #232a35; padding: 3px 0; }
.tb-events b { color: #8fd9c9; }
html.tb-frame-mobile body { max-width: 390px; margin: 0 auto; box-shadow: 0 0 0 1px var(--border), 0 0 60px rgb(0 0 0 / .15); min-height: 100vh; }
html.tb-frame-mobile .sticky-result { max-width: 390px; margin: 0 auto; }
html.tb-frame-mobile .tool { grid-template-columns: 1fr; }
html.tb-frame-mobile .tool__result { position: static; }

/* ---------- Print: only the .print-area (sheet / materials list) ---------- */
@media print {
  @page { margin: 12mm; }
  body { background: #fff; color: #000; }
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area { position: absolute; left: 0; top: 0; width: 100%; box-shadow: none !important; border: 0 !important; max-width: none !important; aspect-ratio: auto !important; padding: 0 !important; }
  .no-print, .tb-mock, .tb-events, .sticky-result, .ad-slot, .site-header, .toast-region { display: none !important; }
  a { color: #000; }
}

