/* Hallmark · macrostructure: Workbench (search console hero) · tone: utilitarian-warm · anchor hue: navy 258 + saffron 85
 * genre: modern-minimal (marketplace) · theme: custom "Danube workshop" — brand navy #0B2545, warm paper, saffron signal
 * display: Bricolage Grotesque (roman only) · body: Instrument Sans · axes: light / grotesk-sans / cool+warm accent
 * Hallmark · pre-emit critique: P4 H4 E4 S5 R4 V4
 */

/* ================================================================ fonts */
@font-face {
  font-family: "Bricolage";
  src: url("../fonts/bricolage-grotesque-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 200 800; font-style: normal; font-display: swap;
  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;
}
@font-face {
  font-family: "Bricolage";
  src: url("../fonts/bricolage-grotesque-latin-ext-wght-normal.woff2") format("woff2-variations");
  font-weight: 200 800; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument";
  src: url("../fonts/instrument-sans-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 400 700; font-style: normal; font-display: swap;
  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;
}
@font-face {
  font-family: "Instrument";
  src: url("../fonts/instrument-sans-latin-ext-wght-normal.woff2") format("woff2-variations");
  font-weight: 400 700; font-style: normal; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Instrument";
  src: url("../fonts/instrument-sans-latin-wght-italic.woff2") format("woff2-variations");
  font-weight: 400 700; font-style: italic; font-display: swap;
}
/* Metric-matched fallbacks keep layout shift near zero while fonts load. */
@font-face { font-family: "Bricolage Fallback"; src: local("Arial"); size-adjust: 104%; ascent-override: 92%; descent-override: 24%; }
@font-face { font-family: "Instrument Fallback"; src: local("Arial"); size-adjust: 97%; ascent-override: 98%; descent-override: 26%; }

/* ================================================================ tokens */
:root {
  color-scheme: light;
  --font-display: "Bricolage", "Bricolage Fallback", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Instrument", "Instrument Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;

  /* brand */
  --navy: oklch(27% 0.07 258);          /* #0B2545 */
  --navy-2: oklch(35% 0.085 258);
  --navy-3: oklch(45% 0.09 258);
  --navy-soft: oklch(94% 0.02 258);
  --mark-bg: oklch(27% 0.07 258);
  --saffron: oklch(85% 0.155 85);
  --saffron-2: oklch(79% 0.16 78);
  --saffron-soft: oklch(95.5% 0.05 90);
  --saffron-ink: oklch(45% 0.1 70);

  /* neutrals, tinted warm */
  --paper: oklch(98.6% 0.006 85);
  --paper-2: oklch(96.2% 0.009 85);
  --paper-3: oklch(93% 0.012 85);
  --surface: oklch(99.7% 0.003 85);
  --ink: oklch(22% 0.045 258);
  --ink-2: oklch(38% 0.03 258);
  --ink-3: oklch(50% 0.022 258);
  --line: oklch(90.5% 0.01 258);
  --line-2: oklch(84% 0.014 258);

  /* status */
  --ok: oklch(52% 0.13 155);
  --ok-soft: oklch(95% 0.04 155);
  --warn: oklch(62% 0.15 60);
  --warn-soft: oklch(96% 0.045 80);
  --danger: oklch(53% 0.19 27);
  --danger-soft: oklch(95.5% 0.03 27);
  --focus: oklch(58% 0.19 255);

  /* semantic roles */
  --bg: var(--paper);
  --fg: var(--ink);
  --muted: var(--ink-2);
  --subtle: var(--ink-3);
  --card: var(--surface);
  --sunken: var(--paper-2);
  --primary-bg: var(--navy);
  --primary-bg-hover: var(--navy-2);
  --primary-fg: var(--paper);
  --accent-bg: var(--saffron);
  --accent-bg-hover: var(--saffron-2);
  --accent-fg: var(--navy);
  --link: var(--navy-3);
  --header-bg: color-mix(in oklch, var(--paper) 88%, transparent);

  /* type scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.125rem;
  --text-lg: 1.3125rem;
  --text-xl: 1.625rem;
  --text-2xl: clamp(1.75rem, 1.2rem + 1.6vw, 2.25rem);
  --text-3xl: clamp(2.1rem, 1.4rem + 2.6vw, 3.25rem);
  --text-display: clamp(2.5rem, 1.5rem + 4.4vw, 4.75rem);

  /* 4pt spacing */
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.25rem; --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem;
  --space-12: 3rem; --space-16: 4rem; --space-20: 5rem; --space-24: 6rem;

  --radius-sm: 6px; --radius: 10px; --radius-lg: 16px; --radius-xl: 24px; --radius-pill: 999px;
  --rule: 1px solid var(--line);
  --shadow-1: 0 1px 2px oklch(22% 0.045 258 / 0.06), 0 1px 1px oklch(22% 0.045 258 / 0.04);
  --shadow-2: 0 8px 24px -6px oklch(22% 0.045 258 / 0.16), 0 2px 6px oklch(22% 0.045 258 / 0.06);
  --shadow-3: 0 24px 60px -12px oklch(22% 0.045 258 / 0.28);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-1: 120ms; --dur-2: 200ms; --dur-3: 320ms;

  --wrap: 1240px;
  --gutter: clamp(1rem, 0.5rem + 2.4vw, 2rem);
  --header-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: oklch(17.5% 0.03 258);
    --paper-2: oklch(15% 0.028 258);
    --paper-3: oklch(24% 0.035 258);
    --surface: oklch(21% 0.035 258);
    --ink: oklch(95.5% 0.008 85);
    --ink-2: oklch(82% 0.015 258);
    --ink-3: oklch(70% 0.02 258);
    --line: oklch(30% 0.03 258);
    --line-2: oklch(38% 0.035 258);
    --navy-soft: oklch(26% 0.05 258);
    --mark-bg: oklch(40% 0.09 258);
    --saffron-soft: oklch(30% 0.05 80);
    --saffron-ink: oklch(85% 0.12 85);
    --ok-soft: oklch(28% 0.05 155);
    --warn-soft: oklch(30% 0.05 70);
    --danger-soft: oklch(29% 0.06 27);
    --ok: oklch(72% 0.14 155);
    --danger: oklch(70% 0.16 27);
    --warn: oklch(78% 0.13 70);
    --focus: oklch(75% 0.14 255);
    --primary-bg: var(--saffron);
    --primary-bg-hover: var(--saffron-2);
    --primary-fg: oklch(22% 0.06 258);
    --link: oklch(82% 0.1 250);
    --shadow-1: 0 1px 2px oklch(0% 0 0 / 0.3);
    --shadow-2: 0 10px 30px -8px oklch(0% 0 0 / 0.55);
    --shadow-3: 0 24px 60px -12px oklch(0% 0 0 / 0.6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: oklch(17.5% 0.03 258);
  --paper-2: oklch(15% 0.028 258);
  --paper-3: oklch(24% 0.035 258);
  --surface: oklch(21% 0.035 258);
  --ink: oklch(95.5% 0.008 85);
  --ink-2: oklch(82% 0.015 258);
  --ink-3: oklch(70% 0.02 258);
  --line: oklch(30% 0.03 258);
  --line-2: oklch(38% 0.035 258);
  --navy-soft: oklch(26% 0.05 258);
  --mark-bg: oklch(40% 0.09 258);
  --saffron-soft: oklch(30% 0.05 80);
  --saffron-ink: oklch(85% 0.12 85);
  --ok-soft: oklch(28% 0.05 155);
  --warn-soft: oklch(30% 0.05 70);
  --danger-soft: oklch(29% 0.06 27);
  --ok: oklch(72% 0.14 155);
  --danger: oklch(70% 0.16 27);
  --warn: oklch(78% 0.13 70);
  --focus: oklch(75% 0.14 255);
  --primary-bg: var(--saffron);
  --primary-bg-hover: var(--saffron-2);
  --primary-fg: oklch(22% 0.06 258);
  --link: oklch(82% 0.1 250);
  --shadow-1: 0 1px 2px oklch(0% 0 0 / 0.3);
  --shadow-2: 0 10px 30px -8px oklch(0% 0 0 / 0.55);
  --shadow-3: 0 24px 60px -12px oklch(0% 0 0 / 0.6);
}

/* ================================================================ reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: clip; scroll-padding-top: calc(var(--header-h) + 1rem); }
body {
  margin: 0; overflow-x: clip; min-height: 100dvh;
  background: var(--bg); color: var(--fg);
  font: 400 var(--text-base)/1.55 var(--font-body);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  display: flex; flex-direction: column;
}
main { flex: 1 0 auto; }
img, svg, video { max-width: 100%; display: block; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { font-family: var(--font-display); font-style: normal; font-weight: 700; line-height: 1.08; letter-spacing: -0.02em; margin: 0; text-wrap: balance; color: var(--fg); overflow-wrap: anywhere; min-width: 0; }
h1 { font-size: var(--text-3xl); letter-spacing: -0.03em; }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-lg); letter-spacing: -0.012em; }
h4 { font-size: var(--text-md); }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
table { border-collapse: collapse; width: 100%; }
hr { border: 0; border-top: var(--rule); margin: var(--space-8) 0; }
[hidden] { display: none !important; }
::selection { background: var(--saffron); color: var(--navy); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.i { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.i-fill { fill: currentColor; stroke: none; }
.num, .price, time, .tabular { font-variant-numeric: tabular-nums; }
.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 { position: absolute; left: var(--space-4); top: -100px; z-index: 100; background: var(--primary-bg); color: var(--primary-fg); padding: var(--space-2) var(--space-4); border-radius: var(--radius-sm); }
.skip:focus { top: var(--space-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 150ms !important; transition-property: opacity, color, background-color !important; scroll-behavior: auto !important; }
}

/* ================================================================ layout primitives */
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 2 * var(--gutter), 760px); margin-inline: auto; }
.stack > * + * { margin-top: var(--stack, var(--space-4)); }
.row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.muted { color: var(--muted); }
.subtle { color: var(--subtle); }
.small { font-size: var(--text-sm); }
.xs { font-size: var(--text-xs); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.section { padding-block: clamp(2.5rem, 1.5rem + 4vw, 5rem); }
.section-tight { padding-block: clamp(1.5rem, 1rem + 2vw, 2.5rem); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-6); flex-wrap: wrap; }
.section-head h2 { max-width: 22ch; }
.section-head p { max-width: 56ch; color: var(--muted); }
.lead { font-size: var(--text-md); color: var(--muted); max-width: 62ch; }
.prose { max-width: 68ch; }
.prose > * + * { margin-top: var(--space-4); }
.prose h2 { margin-top: var(--space-12); font-size: var(--text-xl); }
.prose section > * + * { margin-top: var(--space-4); }
.prose section > h2 + * { margin-top: var(--space-3); }
.prose > section:first-child > h2, .prose > .answer-box + section > h2 { margin-top: var(--space-8); }
.prose h3 { margin-top: var(--space-8); }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li + li { margin-top: var(--space-2); }
.prose li::marker { color: var(--subtle); }

/* ================================================================ buttons */
.btn {
  --_bg: var(--card); --_fg: var(--fg); --_bd: var(--line-2); --_bg-h: var(--paper-2);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 0 var(--space-5); border-radius: var(--radius-pill);
  background: var(--_bg); color: var(--_fg); border: 1px solid var(--_bd);
  font-weight: 600; font-size: var(--text-base); line-height: 1; white-space: nowrap; text-decoration: none;
  transition: background-color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out);
  -webkit-tap-highlight-color: transparent; user-select: none; position: relative;
}
.btn:hover { background: var(--_bg-h); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius-pill); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn .i { width: 1.15em; height: 1.15em; }
.btn-primary { --_bg: var(--primary-bg); --_fg: var(--primary-fg); --_bd: var(--primary-bg); --_bg-h: var(--primary-bg-hover); }
.btn-accent { --_bg: var(--accent-bg); --_fg: var(--accent-fg); --_bd: var(--accent-bg); --_bg-h: var(--accent-bg-hover); }
.btn-ghost { --_bg: transparent; --_bd: transparent; --_bg-h: var(--paper-2); }
.btn-danger { --_bg: var(--danger-soft); --_fg: var(--danger); --_bd: transparent; --_bg-h: color-mix(in oklch, var(--danger-soft) 70%, var(--danger)); }
.btn-sm { min-height: 36px; padding: 0 var(--space-4); font-size: var(--text-sm); }
.btn-lg { min-height: 52px; padding: 0 var(--space-6); font-size: var(--text-md); }
.btn-block { width: 100%; }
.btn-icon { width: 44px; padding: 0; }
.btn-icon.btn-sm { width: 36px; }
.btn[data-state="loading"] { color: transparent !important; pointer-events: none; }
.btn[data-state="loading"]::after { content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--_fg); border-right-color: transparent; animation: spin 700ms linear infinite; }
.btn[data-state="success"] { --_bg: var(--ok-soft); --_fg: var(--ok); --_bd: transparent; }
.btn[data-state="error"] { --_bg: var(--danger-soft); --_fg: var(--danger); --_bd: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.link-btn { display: inline-flex; align-items: center; gap: var(--space-1); background: none; border: 0; padding: 0; color: var(--link); font-weight: 600; text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }
.textlink { font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: var(--space-1); white-space: nowrap; }
.textlink:hover { text-decoration: underline; }

/* ================================================================ forms */
.field { display: grid; gap: var(--space-2); min-width: 0; }
.field > label, .label { font-weight: 600; font-size: var(--text-sm); color: var(--fg); }
.field .row-between > label { font-weight: 600; font-size: var(--text-sm); }
.hint { font-size: var(--text-sm); color: var(--muted); }
.error-text { font-size: var(--text-sm); color: var(--danger); font-weight: 500; }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: var(--space-3) var(--space-4);
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius);
  color: var(--fg); transition: border-color var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out);
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 2.5rem; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--subtle); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in oklch, var(--focus) 25%, transparent); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"], .select[aria-invalid="true"] { border-color: var(--danger); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--sunken); color: var(--subtle); cursor: not-allowed; }
.input::placeholder, .textarea::placeholder { color: var(--subtle); }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-left: 2.75rem; }
.input-group > .i { position: absolute; left: var(--space-4); color: var(--subtle); pointer-events: none; }
.input-affix { display: flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.input-affix:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in oklch, var(--focus) 25%, transparent); }
.input-affix .input { border: 0; box-shadow: none !important; border-radius: 0; min-width: 0; }
.input-affix > span { display: grid; place-items: center; padding: 0 var(--space-3); background: var(--sunken); color: var(--muted); font-weight: 600; font-size: var(--text-sm); }
.check { display: flex; align-items: flex-start; gap: var(--space-3); cursor: pointer; line-height: 1.4; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--navy); flex: none; }
.switch { position: relative; display: inline-flex; align-items: center; gap: var(--space-3); cursor: pointer; }
.switch input { appearance: none; width: 44px; height: 26px; border-radius: 99px; background: var(--line-2); position: relative; margin: 0; transition: background-color var(--dur-2) var(--ease-out); flex: none; cursor: pointer; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-1); transition: transform var(--dur-2) var(--ease-out); }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(18px); }
.switch input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.form-grid { display: grid; gap: var(--space-5); }
.form-grid-2 { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.fieldset > legend { font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg); margin-bottom: var(--space-4); padding: 0; }
.segmented { display: inline-flex; padding: 3px; background: var(--sunken); border-radius: var(--radius-pill); border: 1px solid var(--line); gap: 2px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label, .segmented a, .segmented button { padding: var(--space-2) var(--space-4); border-radius: var(--radius-pill); font-weight: 600; font-size: var(--text-sm); color: var(--muted); cursor: pointer; white-space: nowrap; text-decoration: none; border: 0; background: none; }
.segmented input:checked + label, .segmented [aria-current="true"], .segmented [aria-selected="true"] { background: var(--card); color: var(--fg); box-shadow: var(--shadow-1); }
.segmented input:focus-visible + label { outline: 2px solid var(--focus); }

/* ================================================================ chips & badges */
.chip { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 36px; padding: 0 var(--space-4); border-radius: var(--radius-pill); border: 1px solid var(--line-2); background: var(--card); color: var(--fg); font-size: var(--text-sm); font-weight: 600; text-decoration: none; white-space: nowrap; transition: border-color var(--dur-1) var(--ease-out), background-color var(--dur-1) var(--ease-out); }
.chip:hover { border-color: var(--fg); text-decoration: none; }
.chip[aria-current="page"], .chip[aria-pressed="true"], .chip.is-on { background: var(--primary-bg); color: var(--primary-fg); border-color: var(--primary-bg); }
.chip .i { width: 1em; height: 1em; }
.chips { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.chips-scroll { display: flex; gap: var(--space-2); overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); }
.chips-scroll::-webkit-scrollbar { display: none; }
.badge { display: inline-flex; align-items: center; gap: 0.35em; padding: 0.2em 0.6em; border-radius: var(--radius-pill); font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.01em; white-space: nowrap; background: var(--sunken); color: var(--muted); line-height: 1.3; }
.badge .i { width: 1.1em; height: 1.1em; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--saffron-ink); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--navy-soft); color: var(--link); }
.badge-accent { background: var(--saffron); color: var(--navy); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; flex: none; }
.count-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: white; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; line-height: 1; }

/* ================================================================ cards (product) */
.grid-cards { display: grid; gap: var(--space-6) var(--space-5); grid-template-columns: repeat(auto-fill, minmax(min(100%, 232px), 1fr)); }
.card-p { position: relative; display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; color: var(--fg); text-decoration: none; }
.card-p__media { position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius-lg); overflow: hidden; background: var(--paper-3); isolation: isolate; }
.card-p__media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-3) var(--ease-out); }
.card-p:hover .card-p__media img { transform: scale(1.035); }
.card-p__ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--line-2); background: repeating-linear-gradient(135deg, var(--paper-2) 0 12px, var(--paper-3) 12px 24px); }
.card-p__ph .i { width: 42px; height: 42px; stroke-width: 1.25; }
.card-p__tags { position: absolute; left: var(--space-2); top: var(--space-2); display: flex; gap: var(--space-1); flex-wrap: wrap; z-index: 1; }
.card-p__tags .badge { background: color-mix(in oklch, var(--surface) 92%, transparent); color: var(--fg); backdrop-filter: blur(6px); }
.card-p__fav { position: absolute; right: var(--space-2); top: var(--space-2); z-index: 2; }
.card-p__body { display: grid; gap: 2px; min-width: 0; }
.card-p__title { font-weight: 600; font-size: var(--text-base); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-p__title a { color: inherit; text-decoration: none; }
.card-p__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--radius-lg); }
.card-p__title a:focus-visible { outline: none; }
.card-p:has(a:focus-visible) .card-p__media { outline: 2px solid var(--focus); outline-offset: 3px; }
.card-p__meta { display: flex; align-items: center; gap: var(--space-2); color: var(--muted); font-size: var(--text-sm); min-width: 0; }
.card-p__meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-p__price { display: flex; align-items: baseline; gap: var(--space-2); flex-wrap: wrap; margin-top: 2px; }
.price-main { font-family: var(--font-display); font-weight: 700; font-size: var(--text-md); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.price-unit { color: var(--muted); font-size: var(--text-sm); }
.price-alt { color: var(--muted); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.rating { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; font-size: var(--text-sm); color: var(--fg); }
.rating .i { width: 14px; height: 14px; color: var(--saffron-2); fill: currentColor; stroke: none; }
.stars { display: inline-flex; gap: 1px; color: var(--saffron-2); }
.stars .i { width: 16px; height: 16px; }
.stars .s-full { fill: currentColor; stroke: none; }
.stars .s-empty { color: var(--line-2); fill: currentColor; stroke: none; }
.stars .s-half { fill: url(#half); }

.fav-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; background: color-mix(in oklch, var(--surface) 90%, transparent); color: var(--fg); box-shadow: var(--shadow-1); backdrop-filter: blur(6px); transition: transform var(--dur-1) var(--ease-out); }
.fav-btn:hover { transform: scale(1.06); }
.fav-btn[aria-pressed="true"] { color: var(--danger); }
.fav-btn[aria-pressed="true"] .i { fill: currentColor; }

/* rails */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: var(--space-5); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding: 2px var(--gutter) var(--space-2); scroll-padding-inline: var(--gutter); }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
@media (min-width: 900px) { .rail { grid-auto-columns: calc((100% - 3 * var(--space-5)) / 4); margin-inline: 0; padding-inline: 0; } }
.rail-nav { display: flex; gap: var(--space-2); }

/* ================================================================ generic panels */
.panel { background: var(--card); border: var(--rule); border-radius: var(--radius-lg); padding: clamp(var(--space-4), 3vw, var(--space-6)); }
.panel-flush { background: var(--card); border: var(--rule); border-radius: var(--radius-lg); overflow: hidden; }
.panel-sunken { background: var(--sunken); border-radius: var(--radius-lg); padding: var(--space-5); }
.panel h2, .panel h3 { margin-bottom: var(--space-3); }
.divided > * + * { border-top: var(--rule); }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2) var(--space-4); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.callout { display: flex; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius); background: var(--navy-soft); color: var(--fg); align-items: flex-start; }
.callout > .i { margin-top: 2px; color: var(--link); }
.callout-warn { background: var(--warn-soft); }
.callout-warn > .i { color: var(--saffron-ink); }
.callout-danger { background: var(--danger-soft); }
.callout-danger > .i { color: var(--danger); }
.callout-ok { background: var(--ok-soft); }
.callout-ok > .i { color: var(--ok); }
.callout p + p { margin-top: var(--space-2); }

/* ================================================================ breadcrumbs, pager */
.crumbs { font-size: var(--text-sm); color: var(--muted); padding-block: var(--space-4) 0; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-2); align-items: center; }
.crumbs li { display: inline-flex; align-items: center; gap: var(--space-2); white-space: nowrap; max-width: 100%; }
.crumbs li + li::before { content: "/"; color: var(--line-2); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--fg); text-decoration: underline; }
.crumbs [aria-current] { color: var(--fg); overflow: hidden; text-overflow: ellipsis; }
.pager { display: flex; justify-content: center; align-items: center; gap: var(--space-1); margin-top: var(--space-12); flex-wrap: wrap; }
.pager a, .pager span { min-width: 44px; height: 44px; display: grid; place-items: center; padding: 0 var(--space-3); border-radius: var(--radius-pill); text-decoration: none; color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }
.pager a:hover { background: var(--paper-2); }
.pager [aria-current="page"] { background: var(--primary-bg); color: var(--primary-fg); }
.pager .gap { color: var(--subtle); min-width: 20px; }

/* ================================================================ skeleton, empty, spinner */
.skel { background: linear-gradient(90deg, var(--paper-2), var(--paper-3), var(--paper-2)); background-size: 200% 100%; animation: shimmer 1.4s var(--ease-in-out) infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }
.skel-line { height: 1em; margin: 0.4em 0; }
.skel-card { aspect-ratio: 4/3; border-radius: var(--radius-lg); }
.empty { text-align: center; padding: var(--space-12) var(--space-4); display: grid; justify-items: center; gap: var(--space-3); }
.empty > .i { width: 48px; height: 48px; color: var(--line-2); stroke-width: 1.4; }
.empty h2, .empty h3 { font-size: var(--text-lg); }
.empty p { color: var(--muted); max-width: 44ch; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--fg); animation: spin 700ms linear infinite; }

/* ================================================================ dialog, sheet, toast, popover */
dialog { border: 0; padding: 0; background: var(--card); color: var(--fg); border-radius: var(--radius-xl); box-shadow: var(--shadow-3); width: min(560px, calc(100% - 2rem)); max-height: min(88dvh, 820px); overflow: auto; }
dialog::backdrop { background: oklch(15% 0.03 258 / 0.5); backdrop-filter: blur(2px); }
dialog[open] { animation: pop var(--dur-2) var(--ease-out); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-5) var(--space-6) 0; }
.dialog-head h2 { font-size: var(--text-xl); }
.dialog-body { padding: var(--space-5) var(--space-6); display: grid; gap: var(--space-4); }
.dialog-foot { display: flex; gap: var(--space-3); justify-content: flex-end; padding: 0 var(--space-6) var(--space-6); flex-wrap: wrap; }
@media (max-width: 640px) {
  dialog.sheet { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: var(--radius-xl) var(--radius-xl) 0 0; max-height: 92dvh; }
  dialog.sheet[open] { animation: sheet var(--dur-3) var(--ease-out); }
  .dialog-foot .btn { flex: 1; }
}
@keyframes sheet { from { transform: translateY(40px); opacity: 0; } }
.toasts { position: fixed; z-index: 90; left: 50%; bottom: calc(var(--space-6) + env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: var(--space-2); width: min(440px, calc(100% - 2rem)); pointer-events: none; }
body.has-tabbar .toasts { bottom: calc(76px + env(safe-area-inset-bottom)); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--ink); color: var(--paper); box-shadow: var(--shadow-2); animation: toast var(--dur-3) var(--ease-out); font-weight: 500; }
.toast .i { flex: none; }
.toast-ok .i { color: oklch(78% 0.15 155); }
.toast-error .i { color: oklch(75% 0.15 27); }
.toast button { margin-left: auto; background: none; border: 0; color: var(--saffron); font-weight: 700; padding: var(--space-1) var(--space-2); }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity var(--dur-2) var(--ease-in), transform var(--dur-2) var(--ease-in); }
@keyframes toast { from { opacity: 0; transform: translateY(10px); } }
.popover { position: absolute; z-index: 60; background: var(--card); border: var(--rule); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); padding: var(--space-2); min-width: 220px; }
.menu { display: grid; gap: 1px; }
.menu a, .menu button { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-3); border-radius: var(--radius-sm); color: var(--fg); text-decoration: none; background: none; border: 0; text-align: left; width: 100%; font-weight: 500; white-space: nowrap; }
.menu a:hover, .menu button:hover, .menu [aria-current="page"] { background: var(--paper-2); }
.menu hr { margin: var(--space-1) 0; }

/* ================================================================ header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--header-bg); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid transparent; transition: border-color var(--dur-2) var(--ease-out); }
.site-header.is-scrolled, .app .site-header, .page-search .site-header, .page-item .site-header { border-bottom-color: var(--line); }
.site-header__in { height: var(--header-h); display: flex; align-items: center; gap: var(--space-4); }
.brand { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--fg); text-decoration: none; font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; letter-spacing: -0.03em; flex: none; }
.brand svg { width: 30px; height: 30px; }
.brand:hover { text-decoration: none; }
.hsearch { flex: 1 1 auto; max-width: 520px; position: relative; }
.hsearch form { display: flex; align-items: center; height: 44px; border-radius: var(--radius-pill); background: var(--card); border: 1px solid var(--line-2); padding-left: var(--space-4); transition: border-color var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out); }
.hsearch form:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in oklch, var(--focus) 22%, transparent); }
.hsearch input { flex: 1; min-width: 0; border: 0; background: none; outline: none; height: 100%; padding: 0 var(--space-2); }
.hsearch .i { color: var(--subtle); }
.hsearch button[type=submit] { height: 36px; margin-right: 3px; border-radius: var(--radius-pill); border: 0; background: var(--primary-bg); color: var(--primary-fg); padding: 0 var(--space-4); font-weight: 600; }
.site-nav { display: flex; align-items: center; gap: var(--space-1); margin-left: auto; }
.site-nav > a:not(.btn), .site-nav > button { position: relative; display: inline-flex; align-items: center; gap: var(--space-2); height: 44px; padding: 0 var(--space-3); border-radius: var(--radius-pill); color: var(--fg); text-decoration: none; font-weight: 600; background: none; border: 0; white-space: nowrap; }
.site-nav > a:not(.btn):hover, .site-nav > button:hover { background: var(--paper-2); }
.site-nav > a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--saffron-2); border-radius: 0; }
.site-nav .count-badge { position: absolute; top: 4px; right: 2px; }
.site-nav .btn { margin-left: var(--space-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--navy-soft); color: var(--link); display: inline-grid; place-items: center; font-weight: 700; font-size: var(--text-sm); overflow: hidden; flex: none; object-fit: cover; }
.avatar-lg { width: 72px; height: 72px; font-size: var(--text-xl); }
.avatar-xl { width: 104px; height: 104px; font-size: var(--text-2xl); }
@media (max-width: 899px) {
  .site-nav .hide-sm { display: none !important; }
  .site-header__in { gap: var(--space-2); }
  .hsearch { min-width: 0; }
  .hsearch { display: none; }
  .page-search .hsearch, .page-item .hsearch, .page-category .hsearch, .page-city .hsearch { display: block; }
  .page-search .brand span, .page-item .brand span, .page-category .brand span, .page-city .brand span { display: none; }
}
@media (min-width: 900px) { .show-sm { display: none !important; } }
@media (max-width: 560px) { .hsearch button[type=submit] { display: none; } .hsearch form { padding-right: var(--space-2); } }

/* instant search dropdown */
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--card); border: var(--rule); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); padding: var(--space-2); z-index: 70; max-height: 70dvh; overflow: auto; }
.suggest [role=option] { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); cursor: pointer; color: var(--fg); text-decoration: none; }
.suggest [role=option][aria-selected="true"], .suggest [role=option]:hover { background: var(--paper-2); }
.suggest img { width: 44px; height: 44px; border-radius: var(--radius-sm); object-fit: cover; background: var(--paper-3); }
.suggest .grp { font-size: var(--text-xs); font-weight: 700; color: var(--subtle); padding: var(--space-2) var(--space-3) var(--space-1); text-transform: uppercase; letter-spacing: 0.06em; }
.suggest mark { background: none; color: inherit; font-weight: 700; }

/* mobile tab bar */
.tabbar { display: none; }
@media (max-width: 899px) {
  body.has-tabbar { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; z-index: 55; left: 0; right: 0; bottom: 0; height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in oklch, var(--card) 94%, transparent); backdrop-filter: blur(12px); border-top: var(--rule); }
  .tabbar a { position: relative; display: grid; justify-items: center; align-content: center; gap: 3px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600; }
  .tabbar a[aria-current="page"] { color: var(--fg); }
  .tabbar .i { width: 24px; height: 24px; }
  .tabbar .tab-plus .i { width: 40px; height: 40px; padding: 8px; border-radius: 50%; background: var(--accent-bg); color: var(--accent-fg); stroke-width: 2.2; }
  .tabbar .count-badge { position: absolute; top: 6px; left: calc(50% + 6px); }
}

/* ================================================================ footer */
.site-footer { --mark-bg: oklch(40% 0.09 258); margin-top: var(--space-16); background: var(--navy); color: oklch(88% 0.02 258); padding-block: var(--space-16) var(--space-8); }
:root[data-theme="dark"] .site-footer { background: var(--paper-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .site-footer { background: var(--paper-2); } }
.site-footer a { color: oklch(92% 0.015 85); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: var(--saffron); }
.footer-top { display: grid; gap: var(--space-10); grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)); }
.footer-brand p { max-width: 36ch; margin-top: var(--space-4); color: oklch(80% 0.02 258); }
.footer-brand .brand { color: oklch(97% 0.01 85); }
.footer-col h2 { font-family: var(--font-body); font-size: var(--text-sm); font-weight: 700; color: var(--saffron); margin-bottom: var(--space-4); letter-spacing: 0; }
.footer-col ul { list-style: none; display: grid; gap: var(--space-2); font-size: var(--text-sm); }
.footer-news { display: flex; gap: var(--space-2); margin-top: var(--space-5); max-width: 380px; }
.footer-news input { flex: 1; min-width: 0; min-height: 44px; border-radius: var(--radius-pill); border: 1px solid oklch(45% 0.05 258); background: oklch(22% 0.06 258); color: white; padding: 0 var(--space-4); }
.footer-news input::placeholder { color: oklch(72% 0.03 258); }
.footer-bottom { margin-top: var(--space-12); padding-top: var(--space-6); border-top: 1px solid oklch(38% 0.05 258); display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6); justify-content: space-between; align-items: center; font-size: var(--text-sm); color: oklch(78% 0.02 258); }
.footer-bottom nav { display: flex; gap: var(--space-5); flex-wrap: wrap; }
.lang-switch { display: inline-flex; gap: var(--space-1); }
.lang-switch a { padding: 2px 8px; border-radius: var(--radius-pill); }
.lang-switch [aria-current="true"] { background: oklch(35% 0.07 258); color: white; }
@media (max-width: 899px) { .footer-top { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 420px) { .footer-top { grid-template-columns: minmax(0, 1fr); } }

/* ================================================================ home */
.hero { padding-block: clamp(2rem, 1rem + 4vw, 4.5rem) clamp(2rem, 1rem + 3vw, 3.5rem); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(2rem, 4vw, 4rem); align-items: center; }
.hero h1 { font-size: var(--text-display); font-weight: 800; letter-spacing: -0.04em; line-height: 0.98; max-width: 12ch; }
.hero h1 .hl { position: relative; white-space: nowrap; }
.hero h1 .hl::after { content: ""; position: absolute; left: -0.04em; right: -0.04em; bottom: 0.06em; height: 0.26em; background: var(--saffron); z-index: -1; border-radius: 3px; }
.hero h1 { position: relative; z-index: 0; }
.hero__lead { margin-top: var(--space-5); font-size: var(--text-md); color: var(--muted); max-width: 46ch; }
.console { margin-top: var(--space-8); background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius-xl); box-shadow: var(--shadow-2); padding: var(--space-2); max-width: 640px; }
.console__modes { display: flex; gap: var(--space-1); padding: var(--space-1) var(--space-1) var(--space-2); }
.console__row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: var(--space-1); align-items: stretch; }
.console__cell { display: grid; align-content: center; padding: var(--space-2) var(--space-4); border-radius: var(--radius-lg); min-width: 0; position: relative; }
.console__cell:hover { background: var(--paper-2); }
.console__cell:focus-within { background: var(--paper-2); }
.console__cell label { font-size: var(--text-xs); font-weight: 700; color: var(--muted); }
.console__cell input, .console__cell select { border: 0; background: none; padding: 2px 0 0; outline: none; font-weight: 600; width: 100%; min-width: 0; }
.console__go { min-height: 56px; border-radius: var(--radius-lg); padding: 0 var(--space-6); }
.console__cell + .console__cell::before { content: ""; position: absolute; left: -2px; top: 22%; bottom: 22%; width: 1px; background: var(--line); }
@media (max-width: 720px) {
  .console__row { grid-template-columns: minmax(0, 1fr); }
  .console__cell + .console__cell::before { display: none; }
  .console__cell { border-bottom: var(--rule); border-radius: 0; }
  .console__go { width: 100%; margin-top: var(--space-2); }
}
.hero__quick { margin-top: var(--space-5); }
.hero__board { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); transform: rotate(1.2deg); }
.hero__board .tile { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: var(--paper-3); aspect-ratio: 1; box-shadow: var(--shadow-1); display: block; color: inherit; text-decoration: none; }
.hero__board .tile:nth-child(2) { margin-top: var(--space-8); }
.hero__board .tile:nth-child(3) { margin-top: calc(var(--space-8) * -1); }
.hero__board .tile img { width: 100%; height: 100%; object-fit: cover; }
.hero__board .tile figcaption { position: absolute; left: var(--space-2); right: var(--space-2); bottom: var(--space-2); background: color-mix(in oklch, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-radius: var(--radius); padding: var(--space-2) var(--space-3); font-size: var(--text-sm); display: flex; justify-content: space-between; gap: var(--space-2); }
.hero__board .tile figcaption b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hero__board.is-empty .tile { display: grid; place-items: center; color: var(--subtle); }
.hero__board.is-empty .tile .i { width: 48px; height: 48px; stroke-width: 1.2; }
@media (max-width: 899px) { .hero__grid { grid-template-columns: minmax(0, 1fr); } .hero__board { display: none; } }

.cat-index { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: var(--space-3); }
.cat-tile { display: flex; flex-direction: column; justify-content: space-between; gap: var(--space-6); padding: var(--space-4); min-height: 128px; border-radius: var(--radius-lg); background: var(--card); border: var(--rule); color: var(--fg); text-decoration: none; transition: border-color var(--dur-1) var(--ease-out), transform var(--dur-2) var(--ease-out); }
.cat-tile:hover { border-color: var(--fg); text-decoration: none; transform: translateY(-2px); }
.cat-tile .i { width: 30px; height: 30px; stroke-width: 1.5; color: var(--link); }
.cat-tile b { font-family: var(--font-display); font-weight: 700; font-size: var(--text-md); line-height: 1.15; letter-spacing: -0.01em; }
.cat-tile small { display: block; color: var(--muted); font-size: var(--text-xs); margin-top: 2px; }
.cat-index .cat-tile:first-child { background: var(--navy); color: oklch(97% 0.01 85); border-color: var(--navy); }
.cat-index .cat-tile:first-child .i { color: var(--saffron); }
.cat-index .cat-tile:first-child small { color: oklch(80% 0.02 258); }

/* the lifecycle: request → payout, drawn as a track */
.flow { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; counter-reset: flow; position: relative; }
.flow::before { content: ""; position: absolute; top: 22px; left: 8%; right: 8%; height: 2px; background: repeating-linear-gradient(90deg, var(--line-2) 0 8px, transparent 8px 14px); }
.flow li { list-style: none; position: relative; padding: 0 var(--space-3); display: grid; gap: var(--space-2); justify-items: start; }
.flow li::before { counter-increment: flow; content: counter(flow); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 2px solid var(--fg); font-family: var(--font-display); font-weight: 800; position: relative; z-index: 1; }
.flow li:last-child::before { background: var(--saffron); border-color: var(--saffron); color: var(--navy); }
.flow b { font-family: var(--font-display); font-size: var(--text-md); line-height: 1.2; }
.flow p { font-size: var(--text-sm); color: var(--muted); }
.flow .who { font-size: var(--text-xs); font-weight: 700; color: var(--link); }
@media (max-width: 899px) {
  .flow { grid-template-columns: minmax(0, 1fr); gap: var(--space-5); }
  .flow::before { top: 0; bottom: 0; left: 21px; right: auto; width: 2px; height: auto; background: repeating-linear-gradient(180deg, var(--line-2) 0 8px, transparent 8px 14px); }
  .flow li { grid-template-columns: 44px minmax(0, 1fr); column-gap: var(--space-4); padding: 0; }
  .flow li::before { grid-row: span 3; }
}

.trust { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); }
.trust > div { padding: var(--space-5); border-radius: var(--radius-lg); background: var(--sunken); display: grid; gap: var(--space-2); align-content: start; }
.trust .i { width: 28px; height: 28px; color: var(--link); }
.trust b { font-family: var(--font-display); font-size: var(--text-md); line-height: 1.2; }
.trust p { color: var(--muted); font-size: var(--text-sm); }
@media (max-width: 899px) { .trust { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .trust { grid-template-columns: minmax(0, 1fr); } }

.lend-band { background: var(--navy); color: oklch(96% 0.01 85); border-radius: var(--radius-xl); padding: clamp(var(--space-8), 5vw, var(--space-16)); display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--space-8); align-items: center; overflow: hidden; position: relative; }
.lend-band h2 { color: oklch(98% 0.01 85); font-size: var(--text-3xl); max-width: 14ch; }
.lend-band p { color: oklch(84% 0.02 258); margin-top: var(--space-4); max-width: 48ch; }
.lend-band ul { list-style: none; display: grid; gap: var(--space-3); }
.lend-band li { display: flex; gap: var(--space-3); align-items: flex-start; }
.lend-band li .i { color: var(--saffron); margin-top: 2px; }
.lend-band .btn-accent { margin-top: var(--space-6); }
@media (max-width: 899px) { .lend-band { grid-template-columns: minmax(0, 1fr); } }

.faq-list { display: grid; gap: 0; border-top: var(--rule); }
.faq-list details { border-bottom: var(--rule); }
.faq-list summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: var(--space-4); align-items: center; padding: var(--space-5) 0; font-family: var(--font-display); font-weight: 700; font-size: var(--text-md); line-height: 1.25; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary .i { transition: transform var(--dur-2) var(--ease-out); flex: none; color: var(--muted); }
.faq-list details[open] summary .i { transform: rotate(45deg); }
.faq-list .answer { padding: 0 0 var(--space-5); color: var(--muted); max-width: 70ch; }
.faq-list .answer p + p { margin-top: var(--space-3); }

.places { display: flex; flex-wrap: wrap; gap: var(--space-2); }

.promo-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 1fr); gap: var(--space-4); overflow-x: auto; scrollbar-width: none; }
.promo { border-radius: var(--radius-lg); background: var(--saffron-soft); padding: var(--space-5); display: grid; gap: var(--space-2); align-content: start; min-height: 140px; position: relative; overflow: hidden; }
.promo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.18; }
.promo > * { position: relative; }
.promo .badge { justify-self: start; }
.promo b { font-family: var(--font-display); font-size: var(--text-lg); line-height: 1.15; }
.promo p { color: var(--muted); font-size: var(--text-sm); }

/* ================================================================ listing (search/category/place) */
.listing-head { padding-block: var(--space-6) var(--space-4); display: grid; gap: var(--space-3); }
.listing-head h1 { font-size: var(--text-3xl); max-width: 26ch; }
.listing-head .lead { font-size: var(--text-base); }
.listing-layout { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: var(--space-8); align-items: start; }
.filters { position: sticky; top: calc(var(--header-h) + var(--space-4)); display: grid; gap: var(--space-6); max-height: calc(100dvh - var(--header-h) - 2rem); overflow: auto; padding: 2px 2px var(--space-6); scrollbar-width: thin; }
.filters > form { display: grid; gap: var(--space-6); }
.filters h2 { font-size: var(--text-base); font-family: var(--font-body); font-weight: 700; margin-bottom: var(--space-3); }
.filters .cat-list { list-style: none; display: grid; gap: 1px; }
.filters .cat-list a { display: flex; justify-content: space-between; padding: 6px var(--space-3); border-radius: var(--radius-sm); color: var(--fg); text-decoration: none; font-size: var(--text-sm); }
.filters .cat-list a:hover { background: var(--paper-2); }
.filters .cat-list a[aria-current="page"] { background: var(--navy-soft); font-weight: 700; }
.filters .cat-list ul { list-style: none; padding-left: var(--space-3); border-left: var(--rule); margin: 2px 0 4px var(--space-3); }
.price-range { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: var(--space-2); align-items: center; }
.results-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-5); flex-wrap: wrap; }
.results-bar .count { color: var(--muted); font-size: var(--text-sm); }
.active-filters { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
.active-filters a { display: inline-flex; align-items: center; gap: var(--space-1); padding: 4px 6px 4px 12px; border-radius: var(--radius-pill); background: var(--navy-soft); color: var(--fg); text-decoration: none; font-size: var(--text-sm); font-weight: 600; }
.active-filters a .i { width: 16px; height: 16px; }
.active-filters a:hover { background: var(--line); }
.stats-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: var(--space-3); margin-block: var(--space-6); }
.stat { padding: var(--space-4); border-radius: var(--radius-lg); border: var(--rule); background: var(--card); }
.stat b { display: block; font-family: var(--font-display); font-size: var(--text-xl); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1.1; }
.stat span { color: var(--muted); font-size: var(--text-sm); }
.answer-box { border-left: 3px solid var(--saffron); padding: var(--space-1) 0 var(--space-1) var(--space-5); max-width: 72ch; }
.answer-box p + p { margin-top: var(--space-2); }
.filters-toggle { display: none; }
@media (max-width: 1023px) {
  .listing-layout { grid-template-columns: minmax(0, 1fr); }
  .filters { display: none; }
  .filters-toggle { display: inline-flex; }
  dialog .filters { display: grid; position: static; max-height: none; padding: 0; overflow: visible; }
}

/* ================================================================ item page */
.item-top { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(var(--space-6), 4vw, var(--space-12)); align-items: start; margin-top: var(--space-4); }
.gallery { display: grid; gap: var(--space-2); }
.gallery__main { position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius-xl); overflow: hidden; background: var(--paper-3); }
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.gallery__main button.zoom { position: absolute; inset: 0; background: none; border: 0; cursor: zoom-in; }
.gallery__nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; }
.gallery__nav.prev { left: var(--space-3); }
.gallery__nav.next { right: var(--space-3); }
.gallery__count { position: absolute; right: var(--space-3); bottom: var(--space-3); z-index: 2; }
.gallery__thumbs { display: flex; gap: var(--space-2); overflow-x: auto; scrollbar-width: none; }
.gallery__thumbs button { flex: none; width: 76px; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; border: 2px solid transparent; padding: 0; background: var(--paper-3); }
.gallery__thumbs button[aria-current="true"] { border-color: var(--fg); }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.item-title h1 { font-size: var(--text-2xl); letter-spacing: -0.025em; }
.item-title .row { margin-top: var(--space-3); color: var(--muted); font-size: var(--text-sm); }
.booking-box { position: sticky; top: calc(var(--header-h) + var(--space-4)); display: grid; gap: var(--space-5); }
.price-block { display: grid; gap: var(--space-1); }
.price-block .price-main { font-size: var(--text-2xl); }
.price-tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: var(--rule); border-radius: var(--radius); overflow: hidden; }
.price-tiers > div { padding: var(--space-3); display: grid; gap: 2px; }
.price-tiers > div + div { border-left: var(--rule); }
.price-tiers span { color: var(--muted); font-size: var(--text-xs); font-weight: 600; }
.price-tiers b { font-variant-numeric: tabular-nums; font-size: var(--text-base); }
.breakdown { display: grid; gap: var(--space-2); font-size: var(--text-sm); }
.breakdown .line { display: flex; justify-content: space-between; gap: var(--space-3); }
.breakdown .line .note { display: block; color: var(--subtle); font-size: var(--text-xs); }
.breakdown .line.minus b { color: var(--ok); }
.breakdown .total { border-top: var(--rule); padding-top: var(--space-3); margin-top: var(--space-1); font-weight: 700; font-size: var(--text-base); }
.breakdown b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.owner-card { display: flex; gap: var(--space-4); align-items: center; }
.owner-card .avatar { width: 52px; height: 52px; font-size: var(--text-lg); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: var(--space-4) var(--space-6); }
.facts div { display: flex; gap: var(--space-3); align-items: flex-start; }
.facts .i { color: var(--link); margin-top: 2px; }
.facts b { display: block; font-size: var(--text-sm); }
.facts span { color: var(--muted); font-size: var(--text-sm); }
.item-body { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(var(--space-6), 4vw, var(--space-12)); margin-top: var(--space-10); }
.item-body section + section { margin-top: var(--space-10); }
.item-body h2 { font-size: var(--text-xl); margin-bottom: var(--space-4); }
.desc { white-space: pre-line; max-width: 68ch; }
.desc.is-clamped { max-height: 16em; overflow: hidden; mask-image: linear-gradient(180deg, black 60%, transparent); }
.review { padding-block: var(--space-5); border-top: var(--rule); display: grid; gap: var(--space-2); }
.review header { display: flex; align-items: center; gap: var(--space-3); }
.review header .avatar { width: 36px; height: 36px; }
.map { position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius-lg); overflow: hidden; background: var(--paper-3); }
.map__tiles { position: absolute; display: grid; }
.map__tiles img { width: 256px; height: 256px; max-width: none; }
.map__circle { position: absolute; border-radius: 50%; background: color-mix(in oklch, var(--navy) 16%, transparent); border: 2px solid var(--navy); transform: translate(-50%, -50%); }
.map__attr { position: absolute; right: 4px; bottom: 4px; font-size: 10px; background: color-mix(in oklch, var(--surface) 85%, transparent); padding: 1px 4px; border-radius: 3px; color: var(--muted); }
.map__attr a { color: inherit; }
.map-fallback { display: grid; place-items: center; text-align: center; padding: var(--space-6); color: var(--muted); gap: var(--space-2); }
.item-cta-bar { display: none; }
@media (max-width: 899px) {
  .item-top, .item-body { grid-template-columns: minmax(0, 1fr); }
  .gallery__main { border-radius: 0; margin-inline: calc(var(--gutter) * -1); }
  .booking-box { position: static; }
  .item-cta-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 56; padding: var(--space-3) var(--gutter) calc(var(--space-3) + env(safe-area-inset-bottom)); background: var(--card); border-top: var(--rule); align-items: center; gap: var(--space-3); box-shadow: 0 -6px 20px -10px oklch(22% 0.045 258 / 0.2); }
  .page-item { padding-bottom: 88px; }
  .page-item .tabbar { display: none; }
}

/* calendar */
.cal { display: grid; gap: var(--space-3); user-select: none; }
.cal__head { display: flex; justify-content: space-between; align-items: center; }
.cal__months { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-6); }
.cal__month h3 { font-family: var(--font-body); font-size: var(--text-sm); font-weight: 700; text-align: center; margin-bottom: var(--space-2); }
.cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px 0; }
.cal__dow { font-size: 11px; color: var(--subtle); text-align: center; font-weight: 700; padding-bottom: 4px; }
.cal__day { aspect-ratio: 1; border: 0; background: none; border-radius: 50%; font-size: var(--text-sm); font-variant-numeric: tabular-nums; color: var(--fg); display: grid; place-items: center; position: relative; min-height: 36px; }
.cal__day:hover:not(:disabled) { background: var(--paper-3); }
.cal__day:disabled { color: var(--line-2); text-decoration: line-through; cursor: not-allowed; }
.cal__day.is-today { font-weight: 800; }
.cal__day.is-in { background: var(--navy-soft); border-radius: 0; }
.cal__day.is-start, .cal__day.is-end { background: var(--primary-bg); color: var(--primary-fg); border-radius: 50%; }
.cal__day.is-busy { color: var(--subtle); }
.cal__legend { display: flex; gap: var(--space-4); font-size: var(--text-xs); color: var(--muted); flex-wrap: wrap; }

/* lightbox */
.lightbox { width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; background: oklch(12% 0.02 258); color: white; display: none; }
.lightbox[open] { display: grid; place-items: center; }
.lightbox img { max-width: 94vw; max-height: 86vh; object-fit: contain; }
.lightbox .btn { position: absolute; }

/* ================================================================ profile */
.profile-head { display: flex; gap: var(--space-6); align-items: center; padding-block: var(--space-8); flex-wrap: wrap; }
.profile-head h1 { font-size: var(--text-3xl); }

/* ================================================================ content pages */
.content-hero { padding-block: var(--space-10) var(--space-8); border-bottom: var(--rule); margin-bottom: var(--space-10); }
.content-hero h1 { max-width: 20ch; font-size: var(--text-display); font-weight: 800; letter-spacing: -0.035em; }
.content-hero .lead { margin-top: var(--space-5); }
.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: var(--space-12); align-items: start; }
.toc { position: sticky; top: calc(var(--header-h) + var(--space-6)); font-size: var(--text-sm); }
.toc h2 { font-size: var(--text-sm); font-family: var(--font-body); margin-bottom: var(--space-3); color: var(--muted); }
.toc ol { list-style: none; display: grid; gap: var(--space-2); border-left: var(--rule); padding-left: var(--space-4); }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover, .toc a[aria-current="true"] { color: var(--fg); }
.steps { list-style: none; display: grid; gap: var(--space-4); counter-reset: st; }
.steps li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: var(--space-4); counter-increment: st; }
.steps li::before { content: counter(st); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--navy-soft); color: var(--link); font-weight: 800; font-family: var(--font-display); }
.steps b { display: block; font-size: var(--text-md); font-family: var(--font-display); }
.steps .who { font-size: var(--text-xs); font-weight: 700; color: var(--saffron-ink); }
.fact-table { border: var(--rule); border-radius: var(--radius-lg); overflow: hidden; }
.fact-table div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--space-4); padding: var(--space-3) var(--space-4); }
.fact-table div + div { border-top: var(--rule); }
.fact-table dt { font-weight: 600; }
.fact-table dd { margin: 0; color: var(--muted); }
.updated { font-size: var(--text-sm); color: var(--subtle); margin-top: var(--space-3); }
@media (max-width: 899px) { .content-layout { grid-template-columns: minmax(0, 1fr); } .toc { display: none; } }

/* ================================================================ auth */
.auth-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: calc(100dvh - var(--header-h)); }
.auth-side { background: var(--navy); color: oklch(92% 0.02 258); padding: clamp(var(--space-8), 6vw, var(--space-20)); display: grid; align-content: end; gap: var(--space-6); position: relative; overflow: hidden; }
.auth-side h2 { color: oklch(98% 0.01 85); font-size: var(--text-3xl); max-width: 14ch; }
.auth-side ul { list-style: none; display: grid; gap: var(--space-3); }
.auth-side li { display: flex; gap: var(--space-3); }
.auth-side .i { color: var(--saffron); }
.auth-side .mark { position: absolute; right: -60px; top: -40px; width: 340px; height: 340px; color: oklch(32% 0.08 258); }
.auth-main { display: grid; place-items: center; padding: var(--space-10) var(--gutter); }
.auth-card { width: min(100%, 420px); display: grid; gap: var(--space-5); }
.auth-card h1 { font-size: var(--text-2xl); }
.divider-text { display: flex; align-items: center; gap: var(--space-3); color: var(--subtle); font-size: var(--text-sm); }
.divider-text::before, .divider-text::after { content: ""; flex: 1; border-top: var(--rule); }
.code-input { font-family: var(--font-mono); letter-spacing: 0.4em; text-align: center; font-size: var(--text-lg); }
@media (max-width: 899px) { .auth-wrap { grid-template-columns: minmax(0, 1fr); } .auth-side { display: none; } }
.pw-meter { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.pw-meter span { display: block; height: 100%; width: 0; background: var(--danger); transition: width var(--dur-2) var(--ease-out), background-color var(--dur-2); }

/* ================================================================ error page */
.error-page { padding-block: var(--space-16); display: grid; gap: var(--space-5); justify-items: start; }
.error-page .code { font-family: var(--font-display); font-weight: 800; font-size: clamp(5rem, 16vw, 11rem); line-height: 0.85; letter-spacing: -0.06em; color: var(--saffron); }

/* ================================================================ banner (email verify, offline) */
.banner { background: var(--saffron-soft); border-bottom: 1px solid color-mix(in oklch, var(--saffron) 50%, transparent); font-size: var(--text-sm); }
.banner .wrap { display: flex; gap: var(--space-3); align-items: center; padding-block: var(--space-2); flex-wrap: wrap; }
.banner .i { color: var(--saffron-ink); }
.banner button.close { margin-left: auto; }
.offline-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 99; background: var(--danger); color: white; text-align: center; font-size: var(--text-sm); padding: 4px; }
