/* PartLark design system. Tokens first; every component below uses only these variables.
   Reference: /styleguide (live) and docs/styleguide.md. No build step. */

@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- tokens ---------- */
:root {
  /* brand palette */
  --forest: #1F6B4F;
  --navy: #243746;
  --ivory: #FAF8F2;
  --sage: #E3EFE7;
  --copper: #C97A3D;
  --stone: #6F786F;

  /* semantic roles (light) */
  --bg: var(--ivory);
  --surface: #FFFFFF;
  --surface-2: var(--sage);
  --surface-sunken: #F3F1EA;
  --text: var(--navy);
  --text-muted: #5F685F;           /* stone, darkened a touch for AA on ivory */
  --text-subtle: #646C64;           /* stone, AA-adjusted for small text */
  --border: #E4E1D7;
  --border-strong: #CFCBBE;
  --primary: var(--forest);
  --primary-hover: #185A42;
  --primary-soft: #E3EFE7;
  --on-primary: #FFFFFF;
  --accent: var(--copper);
  --accent-strong: #A9612B;        /* copper fill behind white text (AA 4.7:1) */
  --accent-text: #975523;          /* copper text on light surfaces (AA) */
  --accent-soft: #F6E8DB;
  --on-accent: #FFFFFF;
  --price: var(--forest);
  --danger: #B42318;
  --danger-soft: #FDECEA;
  --ring: color-mix(in srgb, var(--forest) 45%, transparent);
  --thumb-bg: #FFFFFF;
  --header-bg: color-mix(in srgb, var(--ivory) 86%, transparent);
  --scrim: rgba(17, 26, 22, .55);

  /* shape, depth, space */
  --r-xs: 6px; --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 24px; --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(36, 55, 70, .06), 0 1px 1px rgba(36, 55, 70, .04);
  --shadow-md: 0 4px 12px rgba(36, 55, 70, .07), 0 2px 4px rgba(36, 55, 70, .04);
  --shadow-lg: 0 16px 40px rgba(36, 55, 70, .12), 0 4px 10px rgba(36, 55, 70, .05);
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;

  /* type & motion */
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t-fast: 150ms; --t-med: 250ms;
  --header-h: 64px;
  --wrap: 1240px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0F1613;
  --surface: #16201C;
  --surface-2: #1C2A24;
  --surface-sunken: #121B17;
  --text: #E7EEE9;
  --text-muted: #A3AEA6;
  --text-subtle: #8A958D;
  --border: #26342E;
  --border-strong: #34463E;
  --primary: #4FB58A;
  --primary-hover: #66C79D;
  --primary-soft: #1D3A2E;
  --on-primary: #0C1A13;
  --accent: #E0975C;
  --accent-strong: #E9A872;
  --accent-text: #E9A872;
  --accent-soft: #3A2818;
  --on-accent: #1F1209;
  --price: #6FCBA0;
  --danger: #FF8A7A;
  --danger-soft: #3A1D1A;
  --ring: color-mix(in srgb, #4FB58A 55%, transparent);
  --thumb-bg: #EEF2EE;
  --header-bg: color-mix(in srgb, #0F1613 82%, transparent);
  --scrim: rgba(0, 0, 0, .65);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, .35);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 72px); }
body { margin: 0; padding-top: var(--header-space, var(--header-h)); background: var(--bg); color: var(--text); font: 400 15px/1.55 var(--font);
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--primary); text-decoration: none; transition: color var(--t-fast) var(--ease); }
a:hover { color: var(--primary-hover); text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { color: var(--text); letter-spacing: -.02em; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0 0 .5rem; font-weight: 700; }
h2 { font-size: 1.1rem; line-height: 1.3; margin: 0 0 .5rem; font-weight: 650; }
h3 { font-size: 1rem; line-height: 1.35; margin: 0 0 .4rem; font-weight: 650; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--primary) 22%, transparent); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.catalogue-feedback { margin-top: 12px; }
.catalogue-feedback p { margin: 0; }
#catalogue-status { color: var(--text-muted); }
#catalogue-error { padding: 12px 16px; background: var(--danger-soft); color: var(--danger); border-radius: var(--r-sm); }
#catalogue[aria-busy="true"] .results { opacity: .65; }
@media (min-width: 761px) { .wrap { padding: 0 24px; } }
.muted { color: var(--text-muted); font-weight: 400; }
.small { font-size: .82rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 50; padding: 10px 14px; border-radius: var(--r-sm);
  background: var(--primary); color: var(--on-primary); font-weight: 600; transition: top var(--t-fast) var(--ease); }
.skip-link:focus { top: 12px; color: var(--on-primary); }
.stock-warning { display: inline-block; max-width: 12rem; color: var(--danger); font-size: .82rem; font-weight: 500; white-space: normal; text-align: left; vertical-align: top; }
.eyebrow { margin: 0 0 8px; color: var(--primary); font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
main { min-height: 50vh; }
main.wrap { padding-bottom: var(--s-7); }

/* ---------- buttons ---------- */
.button, .search button { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; font: 600 .92rem/1 var(--font); letter-spacing: -.005em; white-space: nowrap; cursor: pointer;
  color: var(--on-primary); background: var(--primary); border: 1px solid var(--primary); border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm); text-decoration: none;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.button:hover, .search button:hover { color: var(--on-primary); background: var(--primary-hover); border-color: var(--primary-hover);
  text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.button:active { transform: translateY(0); box-shadow: var(--shadow-sm); }
.button-lg { height: 50px; padding: 0 26px; font-size: 1rem; }
.button-sm { height: 32px; padding: 0 12px; font-size: .84rem; }
.button-block { width: 100%; }
.button-secondary, .button-ghost { color: var(--text); background: var(--surface); border-color: var(--border-strong); box-shadow: none; }
.button-secondary:hover, .button-ghost:hover { color: var(--primary); background: var(--surface); border-color: var(--primary); box-shadow: var(--shadow-sm); }
.button-ghost { color: var(--primary); }
.button-accent { color: var(--on-accent); background: var(--accent-strong); border-color: var(--accent-strong); }
.button-accent:hover { color: var(--on-accent); background: var(--accent-text); border-color: var(--accent-text); }
.button-neutral { color: var(--text); background: var(--surface-sunken); border-color: var(--border); box-shadow: none; }
.button-neutral:hover { color: var(--text); background: var(--surface-2); border-color: var(--border-strong); }
.button .arrow { transition: transform var(--t-fast) var(--ease); }
.button:hover .arrow { transform: translateX(3px); }
.icon-button { display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; cursor: pointer;
  color: var(--text); background: transparent; border: 1px solid transparent; border-radius: var(--r-pill);
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.icon-button:hover { background: var(--surface-2); }
.icon-button svg { width: 20px; height: 20px; }
.text-button, .basket-add { font: inherit; cursor: pointer; color: var(--primary); background: transparent; border: 0; padding: 4px; white-space: nowrap; }
.text-button:hover, .basket-add:hover { text-decoration: underline; text-underline-offset: 3px; }
button:disabled, .button:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }

/* ---------- chips & badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; font-size: .8rem; font-weight: 550;
  color: var(--text); background: var(--surface-2); border: 1px solid transparent; border-radius: var(--r-pill); white-space: nowrap; }
a.chip { transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
a.chip:hover { color: var(--primary); border-color: var(--primary); background: var(--surface); text-decoration: none; }
.chip-sm { padding: 2px 9px; font-size: .72rem; }
.chip-outline { background: transparent; border-color: var(--border-strong); }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 650; padding: 3px 8px; border-radius: var(--r-pill);
  border: 1px solid var(--border); color: var(--text-muted); background: var(--surface); letter-spacing: .01em; white-space: nowrap; }
.badge-rec { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.badge-low { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.badge-save { color: var(--on-accent); background: var(--accent-strong); border-color: var(--accent-strong); font-size: .8rem; font-weight: 750;
  padding: 4px 10px; box-shadow: var(--shadow-sm); font-variant-numeric: tabular-nums; }
.verified { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-size: .8rem; font-weight: 600; }
.verified svg { width: 16px; height: 16px; flex: none; }

/* ---------- header ---------- */
/* Fixed, not sticky: browsers scroll a focused input inside a sticky element to its un-stuck position (top of page). */
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 30; background: var(--header-bg);
  -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; gap: 28px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); flex-shrink: 0; }
.brand:hover { color: var(--text); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-md); background: transparent;
  transition: transform var(--t-med) var(--ease); }
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.04); }
.brand-mark img { width: 36px; height: 36px; }
:root[data-theme="dark"] .brand-mark { background: var(--ivory); }
:root[data-theme="dark"] .brand-mark img { width: 32px; height: 32px; }
.brand-word { font-size: 1.28rem; font-weight: 750; letter-spacing: -.035em; }
.brand-word span { color: var(--primary); }
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a { white-space: nowrap; padding: 8px 12px; color: var(--text-muted); font-size: .92rem; font-weight: 550; border-radius: var(--r-pill);
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease); }
.main-nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.main-nav a[aria-current="page"], .main-nav a[aria-current="true"] { color: var(--primary); background: var(--primary-soft); }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.currency { display: inline-flex; align-items: center; }
.currency select, .select { appearance: none; -webkit-appearance: none; height: 36px; padding: 0 30px 0 12px; font: 550 .84rem var(--font); color: var(--text);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236F786F' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--border); border-radius: var(--r-pill); cursor: pointer; }
.currency select:hover, .select:hover { border-color: var(--border-strong); }
.basket-link { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; white-space: nowrap; font-size: .86rem; font-weight: 600;
  color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-pill);
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.basket-link:hover { color: var(--primary); border-color: var(--primary); text-decoration: none; }
.basket-link svg { width: 18px; height: 18px; flex: none; }
.basket-link #basket-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; font-size: .72rem;
  color: var(--on-primary); background: var(--primary); border-radius: var(--r-pill); font-variant-numeric: tabular-nums; }
.basket-link #basket-total { font-variant-numeric: tabular-nums; }
.basket-link .original-cny { display: none; }
.theme-toggle .icon-moon, :root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
.theme-toggle .icon-sun, :root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.menu-toggle { display: none; }
.account-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.account-link { white-space: nowrap; height: 36px; padding: 0 16px; font-size: .86rem; }
.auth-back-link { margin-left: auto; font-size: .9rem; font-weight: 550; }
.mobile-nav { display: none; }
.haul-notice:not(:empty) { margin: 12px 0 0; padding: 10px 14px; background: var(--primary-soft); color: var(--text); border-radius: var(--r-md); }

/* ---------- search ---------- */
.search { position: relative; display: flex; align-items: center; width: 100%; max-width: 680px; height: 52px; padding: 5px 5px 5px 48px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-pill); box-shadow: var(--shadow-md);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring), var(--shadow-md); }
.search-icon { position: absolute; left: 18px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--text-subtle); pointer-events: none; }
.search input { flex: 1; min-width: 0; height: 100%; padding: 0 8px 0 0; font: 450 1rem var(--font); color: var(--text);
  background: transparent; border: 0; outline: none; }
.search input::placeholder { color: var(--text-subtle); }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search button { height: 100%; padding: 0 22px; box-shadow: none; }
.search button:hover { transform: none; }
.search-lg { height: 64px; max-width: 640px; padding: 7px 7px 7px 56px; }
.search-lg .search-icon { left: 22px; width: 22px; height: 22px; }
.search-lg input { font-size: 1.06rem; }
.search-lg button { padding: 0 28px; font-size: 1rem; }
/* Absolutely placed under the header bar so docking never changes the header's height: the page offset
   (--header-space) is measured from the bar alone, so docking cannot shift the page and flip itself back. */
.search-dock { position: absolute; top: 100%; left: 0; right: 0; background: var(--header-bg);
  -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--border); }
.search-dock-inner { display: flex; justify-content: center; padding: 10px 16px 12px; }
.search-dock .search { height: 46px; max-width: 760px; padding-left: 44px; box-shadow: var(--shadow-sm); }
.search-dock .search .search-icon { left: 16px; }
.search-dock:empty, .search-dock-inner:empty { display: none; }
.search-dock.is-entering { animation: dock-in var(--t-med) var(--ease); }
@keyframes dock-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.search-slot { min-height: 64px; }

/* ---------- hero ---------- */
.hero { position: relative; isolation: isolate; overflow: hidden; padding: clamp(40px, 7vw, 96px) 0 clamp(40px, 6vw, 80px); }
/* Decorative PCB traces: dense at the right, faded out behind the copy column. */
.hero-circuit { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none;
  color: color-mix(in srgb, var(--primary) 20%, transparent);
  /* Faded behind the copy column, and dissolving smoothly toward the bottom of the hero. */
  -webkit-mask-image: linear-gradient(100deg, rgba(0,0,0,.12) 0%, rgba(0,0,0,.22) 38%, #000 62%), linear-gradient(to bottom, #000 55%, transparent 96%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(100deg, rgba(0,0,0,.12) 0%, rgba(0,0,0,.22) 38%, #000 62%), linear-gradient(to bottom, #000 55%, transparent 96%);
  mask-composite: intersect; }
.circuit-chips { opacity: .8; }
.circuit-signals path { stroke: color-mix(in srgb, var(--primary) 55%, transparent); stroke-dasharray: 64 var(--len);
  stroke-dashoffset: calc(var(--len) + 64); opacity: 0; animation: circuit-signal 2.4s var(--ease) var(--delay) 1 forwards; }
@keyframes circuit-signal { 0% { stroke-dashoffset: calc(var(--len) + 64); opacity: 1; } 85% { opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
.circuit-vias circle { fill: color-mix(in srgb, var(--accent) 55%, transparent); transform-box: fill-box; transform-origin: center;
  animation: circuit-via 4s ease-in-out var(--delay) infinite; }
@keyframes circuit-via { 0%, 100% { opacity: .35; transform: scale(.85); } 50% { opacity: .9; transform: scale(1.15); } }
/* Landing page: the circuit hero hands over to a calm dot grid behind the popular parts and catalogue.
   The hero paints the plain background and fades it out at its bottom, so the dots fade in. */
body[data-hero] { background-image: radial-gradient(color-mix(in srgb, var(--primary) 13%, transparent) 1px, transparent 1.3px);
  background-size: 22px 22px; background-position: 0 0; }
body[data-hero] .hero { background: linear-gradient(to bottom, var(--bg) 0%, var(--bg) 72%, color-mix(in srgb, var(--bg) 0%, transparent) 100%); }
.hero-inner { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 22px; padding: 6px 14px 6px 8px;
  font-size: .84rem; font-weight: 600; line-height: 1.55; letter-spacing: normal; color: var(--primary); background: var(--primary-soft); border-radius: var(--r-pill); }
.hero-eyebrow img { width: 22px; height: 22px; border-radius: 50%; background: var(--ivory); }
.hero-title { margin: 0; font-size: clamp(2.5rem, 6.2vw, 4.4rem); line-height: 1.02; letter-spacing: -.045em; font-weight: 780; }
.hero-title span { color: var(--primary); }
.hero-lede { max-width: 560px; margin: 22px 0 30px; color: var(--text-muted); font-size: clamp(1.04rem, 1.6vw, 1.2rem); line-height: 1.6; }
.hero-lede strong { color: var(--text); font-weight: 600; }
.quick-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; font-size: .84rem; color: var(--text-muted); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.trust-strip { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 28px; margin: 34px 0 0; padding: 0; color: var(--text-muted); font-size: .88rem; }
.trust-strip li { display: inline-flex; align-items: center; gap: 8px; }
.trust-strip svg { width: 18px; height: 18px; color: var(--primary); flex: none; }

.hero-visual { position: relative; display: grid; justify-items: center; }
.compare-stack { position: relative; width: min(100%, 420px); }
.compare-card { position: relative; padding: 22px 22px 44px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--shadow-lg); transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease); }
.compare-stack:hover .compare-card { transform: translateY(-4px); }
.compare-media { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; margin-bottom: 18px;
  background: var(--surface-2); border-radius: var(--r-lg); }
.compare-media img { width: 62%; }
.compare-media .badge-save { position: absolute; top: 12px; right: 12px; }
.compare-head { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 0 0 14px; }
.compare-name { min-width: 0; font-weight: 650; font-size: 1.02rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.compare-head .badge { flex: none; }
.compare-head .badge svg { width: 14px; height: 14px; }
.compare-rows { display: grid; gap: 10px; margin: 0; }
.compare-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 14px; border-radius: var(--r-md); background: var(--surface-sunken); }
.compare-row dt { color: var(--text-muted); font-size: .86rem; }
.compare-row dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.compare-row.is-eu dd { color: var(--text-subtle); text-decoration: line-through; font-weight: 550; }
.compare-row.is-factory { background: var(--primary-soft); }
.compare-row.is-factory dt { color: var(--primary); font-weight: 600; }
.compare-row.is-factory dd { color: var(--price); font-size: 1.2rem; }
.compare-foot { margin: 14px 0 0; font-size: .76rem; color: var(--text-subtle); }
.float-chip { position: absolute; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-md); color: var(--text);
  animation: chip-float 6s ease-in-out infinite; }
.float-chip strong { display: block; font-size: .84rem; font-weight: 700; line-height: 1.25; }
.float-chip small { display: block; font-size: .74rem; color: var(--text-muted); line-height: 1.3; white-space: nowrap; }
.float-icon { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; color: var(--primary); background: var(--primary-soft); }
.float-icon svg { width: 18px; height: 18px; }
.float-chip-parcel { left: -64px; top: 96px; }
.float-chip-save { right: -48px; bottom: -26px; animation-delay: -3s; }
.float-chip-save strong { color: var(--accent-text); }
.float-chip-save .float-icon { color: var(--accent-text); background: var(--accent-soft); }
@keyframes chip-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* ---------- sections ---------- */
.section { padding: clamp(40px, 6vw, 80px) 0; }
.section-alt { background: var(--surface-2); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; }
.section-head h2 { margin: 0; font-size: clamp(1.5rem, 2.8vw, 2.1rem); line-height: 1.15; letter-spacing: -.03em; font-weight: 720; }
.section-head p { margin: 8px 0 0; color: var(--text-muted); max-width: 560px; }
.popular .section-head > div { flex: 1; min-width: 0; }
.popular .section-head p { max-width: none; }
.section-link { font-weight: 600; white-space: nowrap; }
.section-note { margin: 18px 0 0; font-size: .78rem; color: var(--text-subtle); }

/* ---------- product cards (popular + results share these) ---------- */
.pgrid { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); }
.pcard { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease), border-color var(--t-med) var(--ease); }
.pcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.pcard-media { position: relative; display: grid; place-items: center; aspect-ratio: 1; background: var(--surface-2); overflow: hidden; }
.pcard-media img { width: 78%; height: 78%; object-fit: contain; transition: transform var(--t-med) var(--ease); }
.pcard:hover .pcard-media img { transform: scale(1.05); }
.pcard-media .badge-save { position: absolute; top: 12px; left: 12px; }
.pcard-body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 16px 16px 18px; }
.pcard-body > .chip { align-self: flex-start; }
.pcard-name { margin: 0; font-size: 1rem; font-weight: 650; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-name a { color: var(--text); }
.pcard-name a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.pcard-name a:hover { text-decoration: none; }
.pcard-prices { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 2px; }
.price-now { font-size: 1.35rem; font-weight: 750; color: var(--price); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.price-was { color: var(--text-subtle); font-size: .92rem; font-variant-numeric: tabular-nums; }
.price-label { width: 100%; font-size: .74rem; color: var(--text-subtle); }
.pcard-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.pcard-cta { position: relative; z-index: 2; margin-top: auto; padding-top: 6px; }
.pcard-cta .button { width: 100%; }

/* results grid cards (catalogue) */
.grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease), border-color var(--t-med) var(--ease); }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.card a { color: inherit; display: flex; flex-direction: column; height: 100%; }
.card a:hover { text-decoration: none; }
.thumb { aspect-ratio: 1; background: var(--thumb-bg); display: grid; place-items: center; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: contain; transition: transform var(--t-med) var(--ease); }
.card:hover .thumb img { transform: scale(1.04); }
.thumb-empty { color: var(--text-subtle); }
.thumb-empty svg { width: 48px; height: 48px; opacity: .5; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.card-cat { font-size: .72rem; color: var(--text-subtle); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.card-name { font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { margin-top: auto; padding-top: 8px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.card .price { font-size: 1.15rem; }
.card-sources { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.price { color: var(--price); font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.price:not([data-cny]) { color: var(--text-muted); font-weight: 550; font-size: .9rem; }
.original-cny { font-size: .72em; font-weight: 400; color: var(--text-subtle); white-space: nowrap; }

/* ---------- how it works strip ---------- */
.steps { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 0; padding: 0; }
.step { position: relative; padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.step-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 20px; color: var(--primary); background: var(--primary-soft); border-radius: var(--r-md); }
.step-icon svg { width: 24px; height: 24px; }
.step-num { position: absolute; top: 24px; right: 26px; font-size: .78rem; font-weight: 700; color: var(--text-subtle); font-variant-numeric: tabular-nums; }
.step h3 { font-size: 1.08rem; margin: 0 0 6px; }
.step p { margin: 0; color: var(--text-muted); line-height: 1.6; }

/* ---------- catalogue layout ---------- */
.browse { padding-top: clamp(24px, 4vw, 48px); }
.browse-head { margin-bottom: 20px; }
.browse-head > div { width: 100%; }
.browse-head p { max-width: none; }
.catalogue { display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 32px; padding: 24px 0; }
.sidebar { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 16px; }
.gallery, .summary, .sidebar, .results { min-width: 0; }
.category-nav { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 4px 8px; box-shadow: var(--shadow-sm); }
.category-panel > summary h2 { flex: 1; font-size: .92rem; font-weight: 650; margin: 0; }
.category-panel > .category-body { padding: 0 0 8px; }
.category-link { display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 8px 10px; color: var(--text); border-radius: var(--r-sm); font-size: .88rem; line-height: 1.4;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.category-link > span:first-child, .category-label { min-width: 0; overflow-wrap: anywhere; }
.category-link .count, .category-group .count { flex-shrink: 0; font-variant-numeric: tabular-nums; font-weight: 500;
  padding: 0 7px; border-radius: var(--r-pill); background: var(--surface-sunken); font-size: .72rem; line-height: 1.6; }
.category-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.category-link.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.category-link.active .count { color: var(--primary); background: var(--surface); }.category-groups { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 8px; }
.category-group { margin-top: 0; }
.category-group summary { display: flex; align-items: center; gap: 10px; list-style: none; cursor: pointer;
  padding: 8px 10px; font-size: .88rem; line-height: 1.4; font-weight: 550; border-radius: var(--r-sm); }
.category-group summary::-webkit-details-marker { display: none; }
.category-group summary:hover { background: var(--surface-2); }
.category-group summary .category-label { flex: 1; }
/* A root category without children lines up exactly with the expandable ones. */
.category-link.category-root { align-items: center; justify-content: flex-start; gap: 10px; font-weight: 550; }
.category-root .category-label { flex: 1; }
.category-chevron-spacer { flex: 0 0 7px; }
.category-group.contains-current > summary { color: var(--primary); }
.category-chevron { width: 7px; height: 7px; flex: 0 0 7px; border-right: 1.6px solid var(--text-subtle);
  border-bottom: 1.6px solid var(--text-subtle); transform: rotate(-45deg); align-self: center; transition: transform var(--t-fast) var(--ease); }
.category-group[open] > summary .category-chevron { transform: rotate(45deg); }
.category-children { list-style: none; margin: 2px 6px 8px 16px; padding: 0 0 0 8px; border-left: 1px solid var(--border); }
.category-children .category-link { padding: 7px 10px; font-size: .84rem; }
.category-nav :is(a, summary):focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.filters { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 4px 8px; box-shadow: var(--shadow-sm); }
.filters-panel { margin: 0; }
.filters-panel > summary { display: flex; align-items: center; gap: 10px; list-style: none; cursor: pointer; padding: 10px 8px; border-radius: var(--r-sm); }
.filters-panel > summary::-webkit-details-marker { display: none; }
.filters-panel > summary:hover { background: var(--surface-2); }
.filters-panel > summary .category-chevron { transition: transform var(--t-med) var(--ease); }
.filters-panel[open]:not([data-state="closing"]) > summary .category-chevron { transform: rotate(45deg); }
.filters h2 { flex: 1; font-size: .92rem; font-weight: 650; margin: 0; }
.filter-count { min-width: 20px; padding: 1px 7px; border-radius: var(--r-pill); font-size: .72rem; font-weight: 700; text-align: center;
  color: var(--on-primary); background: var(--primary); }
.filters-body { padding: 0 8px 12px; }
.filters-panel[data-state] > .filters-body { overflow: hidden; }
.filters fieldset { border: 0; border-top: 1px solid var(--border); margin: 10px 0 0; padding: 12px 0 0; min-width: 0; }
.filters legend { float: left; width: 100%; padding: 0; margin-bottom: 6px; font-size: .78rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.filter-check { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: .88rem; cursor: pointer; clear: both; }
.filter-check input { width: 17px; height: 17px; margin: 0; accent-color: var(--primary); }
.filter-range { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 6px; clear: both; }
.filter-range label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.input, .filter-range input, .report-dialog select, .report-dialog textarea, .auth-form input:not([type="hidden"]) {
  width: 100%; min-width: 0; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.filter-range input { height: 36px; padding: 0 10px; font-size: .88rem; }
.input { height: 42px; padding: 0 12px; }
.input:focus, .filter-range input:focus, .report-dialog :is(select, textarea):focus, .auth-form input:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.filter-error { margin: 6px 0 0; color: var(--danger); font-size: .8rem; }
.filter-error:empty { display: none; }
.filter-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.filter-actions .button { height: 34px; padding: 0 16px; font-size: .86rem; }
.filter-chips { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; padding: 0; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; font-size: .82rem; font-weight: 600;
  color: var(--primary); background: var(--primary-soft); border-radius: var(--r-pill); }
.filter-chip:hover { color: var(--primary); text-decoration: none; box-shadow: inset 0 0 0 1px var(--primary); }
.filter-clear { font-size: .82rem; color: var(--text-muted); padding: 3px 4px; }
.count { color: var(--text-muted); font-size: .82rem; }
.results-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.results-head h1 { margin: 0; font-size: 1.5rem; }
.results-head h1 .muted { font-size: .92rem; margin-left: 8px; font-weight: 450; letter-spacing: 0; }
.sort { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.sort label { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: .86rem; font-weight: 550; }
.sort select { appearance: none; -webkit-appearance: none; height: 36px; padding: 0 30px 0 12px; font: 550 .86rem var(--font); color: var(--text);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236F786F' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--border); border-radius: var(--r-pill); cursor: pointer; }
.pager { display: flex; justify-content: center; align-items: center; gap: 16px; padding: 28px 0 8px; }
.pager a { display: inline-flex; align-items: center; height: 38px; padding: 0 16px; font-weight: 600; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-pill); }
.pager a:hover { border-color: var(--primary); text-decoration: none; }
.empty { background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--r-lg); padding: clamp(32px, 6vw, 64px) 24px; text-align: center; margin: 20px 0; }
.empty img { width: 72px; height: 72px; margin: 0 auto 16px; opacity: .9; }
.empty h1 { font-size: 1.5rem; }
.empty .button { margin-top: 12px; }
.htmx-request.catalogue, .htmx-request #catalogue, #catalogue.htmx-request { opacity: .55; transition: opacity var(--t-fast) var(--ease); }

/* ---------- product page ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 4px; padding: 20px 0 12px; font-size: .86rem; color: var(--text-subtle); }
.crumbs a { color: var(--text-muted); }
.crumbs a:hover { color: var(--primary); }
.product { display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); gap: clamp(20px, 4vw, 48px); align-items: start; }
.gallery { position: sticky; top: calc(var(--header-h) + 84px); }
.gallery-main { aspect-ratio: 1; background: var(--thumb-bg); border: 1px solid var(--border); border-radius: var(--r-xl); display: grid; place-items: center; overflow: hidden; box-shadow: var(--shadow-sm); }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-fallback { display: grid; justify-items: center; gap: 12px; padding: 24px; text-align: center; }
.gallery-fallback svg { width: 48px; height: 48px; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; }
.gallery-thumbs button { flex: 0 0 68px; height: 68px; padding: 0; background: var(--thumb-bg); border: 1px solid var(--border);
  border-radius: var(--r-md); cursor: pointer; overflow: hidden; transition: border-color var(--t-fast) var(--ease); }
.gallery-thumbs button:hover { border-color: var(--border-strong); }
.gallery-thumbs button.active { border: 2px solid var(--primary); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: contain; }
.summary h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.15; letter-spacing: -.03em; margin-bottom: 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tag { font-size: .78rem; font-weight: 550; padding: 3px 10px; border: 1px solid var(--border); border-radius: var(--r-pill); color: var(--text-muted); background: var(--surface); }
.tag-generic { color: var(--primary); border-color: transparent; background: var(--primary-soft); }
.buybox { display: grid; gap: 6px; margin: 4px 0 20px; padding: 22px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--shadow-md); }
.big-price { font-size: 2.1rem; font-weight: 780; color: var(--price); letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.big-price .muted { font-size: 1rem; }
.buybox .button { margin-top: 8px; justify-self: start; }
.buybox-verified { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.specs-title { margin: 24px 0 8px; font-weight: 700; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-subtle); }
.specs { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.specs th, .specs td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.specs tr:last-child th, .specs tr:last-child td { border-bottom: 0; }
.specs tr:nth-child(even) { background: var(--surface-sunken); }
.specs th { width: 38%; color: var(--text-muted); font-weight: 500; }

.section-title { display: flex; align-items: baseline; gap: 10px; margin: 48px 0 16px; font-size: 1.4rem; letter-spacing: -.02em; }
.section-title .muted { font-size: 1rem; }
.offer { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; margin-bottom: 14px; box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t-med) var(--ease), border-color var(--t-med) var(--ease); }
.offer:hover { box-shadow: var(--shadow-md); }
.offer-head { display: grid; grid-template-columns: 1fr auto auto; gap: 24px; align-items: center; }
.offer-actions { display: grid; justify-items: start; gap: 8px; }
.offer-shop { font-weight: 650; font-size: 1.02rem; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 2px; }
.offer-price { text-align: right; }
.offer-price .price { font-size: 1.3rem; }
.offer-summary { margin: 12px 0 4px; color: var(--text-muted); font-size: .9rem; line-height: 1.6; }
.offer-body { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 16px; }
.offer-body.has-images { grid-template-columns: minmax(0, 220px) minmax(0, 1fr); }
.offer-gallery { min-width: 0; }
.offer-image-main { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--thumb-bg);
  border: 1px solid var(--border); border-radius: var(--r-md); }
.offer-thumbs { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; padding-bottom: 4px; }
.offer-thumb { flex: 0 0 44px; height: 44px; padding: 0; background: var(--thumb-bg); border: 1px solid var(--border);
  border-radius: var(--r-sm, 6px); cursor: pointer; overflow: hidden; }
.offer-thumb.active { border: 2px solid var(--primary); }
.offer-thumb img { width: 100%; height: 100%; object-fit: contain; }
.offer-info { min-width: 0; }
.offer-title { margin: 0; font-size: 1rem; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.offer-title-cn { margin: 4px 0 0; overflow-wrap: anywhere; }
.offer-info .offer-summary:first-child { margin-top: 0; }
.offer-details { margin-top: 12px; font-size: .85rem; }
.offer-details td { overflow-wrap: anywhere; }
details { margin-top: 10px; }
summary { cursor: pointer; font-size: .9rem; font-weight: 600; padding: 4px 0; }
.offer details > summary { color: var(--primary); }
.variants { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: .9rem; }
.variants th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-subtle);
  font-weight: 700; padding: 8px; border-bottom: 1px solid var(--border); }
.variants td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.variants tr:last-child td { border-bottom: 0; }
.variants tr.dim { color: var(--text-subtle); }
.variants tr.selected { background: var(--primary-soft); color: var(--text); box-shadow: inset 3px 0 var(--primary); }
.variant-select, .variant-image { font: inherit; color: inherit; cursor: pointer; background: transparent; border: 0; padding: 0; text-align: left; }
.variant-select { display: block; min-height: 40px; padding: 5px 0; align-content: center; }
.variant-select:hover { color: var(--primary); text-decoration: underline; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vimg { width: 56px; }
.variant-image { position: relative; display: block; }
.variant-image > img { width: 46px; height: 46px; object-fit: contain; background: var(--thumb-bg); border: 1px solid var(--border); border-radius: var(--r-sm); }
.variant-preview { display: none; position: absolute; left: 100%; bottom: 0; z-index: 6; width: min(250px, 55vw); height: min(250px, 55vw); padding: 6px;
  background: var(--thumb-bg); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lg); pointer-events: none; }
.variant-preview img { width: 100%; height: 100%; object-fit: contain; }
.variant-image:hover .variant-preview, .variant-image:focus-visible .variant-preview { display: block; }
.variant-dialog-image { width: min(360px, 100%); max-height: 45vh; object-fit: contain; margin: 12px auto; background: var(--thumb-bg); border-radius: var(--r-md); }
.variant-dialog-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- haul controls ---------- */
.button.basket-add { height: 40px; padding: 0 18px; font-weight: 600; color: var(--primary); background: var(--surface); border: 1px solid var(--primary); box-shadow: none; }
.button.basket-add:hover { color: var(--primary); background: var(--primary-soft); }
.basket-add-row { border: 1px solid var(--primary); border-radius: var(--r-pill); padding: 5px 12px; font-weight: 600; }
.basket-add-row:hover { text-decoration: none; background: var(--primary-soft); }
.haul-add { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.haul-add .haul-qty-stepper { margin-top: 0; }
.buybox .haul-add .button { margin-top: 0; }
.haul-add .haul-qty-stepper button, .haul-add .haul-qty-stepper input { height: 38px; }
.haul-add .haul-qty-stepper button { width: 34px; }
.haul-add .haul-qty-stepper input { width: 52px; }
.haul-in { flex-basis: 100%; color: var(--primary); font-weight: 600; }
.haul-in:empty { display: none; }
.haul-moq { flex-basis: 100%; color: var(--warning, #9a5b00); font-weight: 600; }
.haul-moq--high { color: var(--danger, #b3261e); }
.moq-flag { color: var(--warning, #9a5b00); }
.haul-add--compact { display: grid; grid-template-columns: max-content max-content; justify-content: end; align-items: center; gap: 6px 8px; }
.haul-add--compact .haul-qty-stepper button, .haul-add--compact .haul-qty-stepper input { height: 36px; font-size: .9rem; }
.haul-add--compact .haul-qty-stepper button { width: 32px; }
.haul-add--compact .haul-qty-stepper input { width: 48px; }
.haul-add--compact .basket-add-row { height: 36px; min-width: 72px; display: inline-flex; align-items: center; padding: 0 12px; }
.haul-add--compact .haul-in, .haul-add--compact .haul-moq { display: none; }
.variant-save .haul-in:not(:empty) { display: block; grid-column: 1 / -1; font-size: .78rem; text-align: right; }
.buy-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.buybox .buy-actions .button { margin-top: 0; }
.quantity-label { color: var(--text-muted); font-size: .8rem; }
.quantity-stepper { display: flex; margin-top: 4px; border: 1px solid var(--border-strong); border-radius: var(--r-pill); overflow: hidden; background: var(--surface); }
.quantity-stepper button, .quantity-stepper input { height: 40px; font: 600 1rem var(--font); color: var(--text); background: var(--surface); border: 0; text-align: center; }
.quantity-stepper button { width: 40px; cursor: pointer; background: var(--surface-sunken); transition: background var(--t-fast) var(--ease); }
.quantity-stepper button:hover:not(:disabled) { background: var(--surface-2); }
.quantity-stepper button:disabled { color: var(--text-subtle); cursor: default; opacity: .5; }
.quantity-stepper input { width: 58px; border-left: 1px solid var(--border); border-right: 1px solid var(--border); appearance: textfield; -moz-appearance: textfield; }
.quantity-stepper input::-webkit-inner-spin-button, .quantity-stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.quantity-stepper :focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }

/* ---------- basket page ---------- */
.page-head { padding: 28px 0 8px; }
.page-head h1 { font-size: clamp(1.8rem, 3.6vw, 2.5rem); letter-spacing: -.035em; }
.page-head > p { max-width: 680px; color: var(--text-muted); }
.page-head-wide > p { max-width: none; }
.basket-toolbar { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; align-items: center; margin: 16px 0; }
.basket-toolbar { padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); }
.basket-toolbar-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.basket-toolbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-left: auto; }
.basket-toolbar input[type="checkbox"] { accent-color: var(--primary); width: 16px; height: 16px; vertical-align: -3px; }
.basket-checkout, .basket-summary { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px; margin: 16px 0; box-shadow: var(--shadow-sm); }
.basket-checkout h2, .basket-summary h2 { font-size: 1.05rem; }
.basket-checkout .button:disabled { cursor: default; opacity: .55; }
#basket-progress { margin: 8px 0 0; }
.basket-status { display: inline-block; margin-left: 6px; padding: 1px 9px; border-radius: var(--r-pill); font-size: .74rem; font-weight: 600; border: 1px solid var(--border); color: var(--text-muted); vertical-align: middle; }
.basket-status--opened { color: var(--primary); border-color: var(--primary); }
.basket-status--in_basket, .basket-status--ordered { color: var(--on-primary); background: var(--primary); border-color: var(--primary); }
.basket-steps { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 8px; }
.basket-step { padding: 6px 12px; font-size: .85rem; }
.basket-item--done { opacity: .62; }
.basket-item--done .basket-item-info > a:first-child { text-decoration: line-through; }
.basket-item--current { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); opacity: 1; }
.basket-add--saved { color: var(--on-primary); background: var(--primary); border-radius: var(--r-sm); font-weight: 650; }
.basket-item { display: flex; gap: 16px; align-items: start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; margin-bottom: 10px; box-shadow: var(--shadow-sm); }
.basket-item > img { width: 76px; height: 76px; object-fit: contain; background: var(--thumb-bg); border-radius: var(--r-md); border: 1px solid var(--border); }
.basket-item-info { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.basket-item-info > a:first-child { font-weight: 650; color: var(--text); }
.basket-item-info > a.button { display: inline-flex; margin: 8px 10px 0 0; }
.basket-controls { display: grid; gap: 8px; justify-items: start; }
.basket-warning { color: var(--danger); font-size: .84rem; }
.basket-disclaimer { margin: 16px 0; padding: 16px 18px; border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); border-radius: var(--r-lg); background: var(--accent-soft); }
.basket-disclaimer h2 { font-size: 1rem; color: var(--text); }
.basket-disclaimer p { margin: 0; }
.basket-disclaimer p + p { margin-top: 6px; }
body.basket-guide-open { overflow: hidden; }
dialog.basket-guide-dialog { --guide-open: #175cd3; width: min(680px, calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 32px); padding: 0; overflow: hidden; }
:root[data-theme="dark"] dialog.basket-guide-dialog { --guide-open: #8cb4ff; }
.basket-guide-dialog[open] { display: flex; flex-direction: column; }
.basket-guide-header, .basket-guide-footer { flex: none; padding: 16px 24px; background: var(--surface); }
.basket-guide-header { display: flex; align-items: start; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--border); }
.basket-guide-header h2 { margin: 4px 0; }
.basket-guide-header button { min-height: 44px; margin: -4px -8px -4px 0; padding: 8px; }
.basket-guide-body { padding: 0 24px 20px; overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.basket-guide-body h3 { font-size: 1.1rem; margin: 16px 0 6px; overflow-wrap: anywhere; }
.basket-guide-progress { color: var(--primary); font-weight: 600; margin: 20px 0 8px; }
.basket-guide-instructions { padding-left: 1.4em; font-size: .9rem; }
.basket-guide-instructions li + li { margin-top: 8px; }
.basket-guide-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.basket-guide-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--guide-open); text-decoration: underline; text-underline-offset: 3px; }
.basket-guide-select-all { margin: 20px 0 0; font-weight: 600; }
.basket-guide-variants { margin-top: 20px; }
.basket-guide-variant { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 16px; padding: 16px 0; border-top: 1px solid var(--border); }
.basket-guide-variant img { width: 72px; height: 72px; object-fit: contain; background: var(--thumb-bg); border-radius: var(--r-sm); }
.basket-guide-variant-info { grid-column: 2; min-width: 0; overflow-wrap: anywhere; }
.basket-guide-variant--no-image .basket-guide-variant-info { grid-column: 1 / -1; }
.basket-guide-variant h4 { margin: 0 0 4px; font-size: 1rem; }
.basket-guide-variant p { margin: 6px 0; }
.basket-guide-original { user-select: all; }
.basket-guide-quantity { font-size: 1.1rem; font-weight: 650; }
.basket-guide-check { display: flex; gap: 10px; align-items: center; min-height: 44px; cursor: pointer; }
.basket-guide-check input { width: 20px; height: 20px; flex: none; accent-color: var(--primary); }
.basket-guide-check:has(input:disabled) { color: var(--text-subtle); cursor: default; }
.basket-guide-footer { border-top: 1px solid var(--border); }
.basket-guide-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; align-items: center; }
.basket-guide-dialog [hidden] { display: none; }
.basket-guide-dialog button { min-height: 44px; white-space: normal; }
.basket-guide-dialog .button-open { color: #fff; background: var(--guide-open); border-color: var(--guide-open); }
.basket-guide-header .text-button, .basket-guide-footer .text-button { color: var(--text-muted); }
.basket-guide-dialog #basket-guide-undo { margin: 0 0 8px; }
@media (max-width: 600px) {
  dialog.basket-guide-dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
  .basket-guide-header, .basket-guide-footer { padding: 12px 16px; }
  .basket-guide-body { padding: 0 16px 16px; }
  .basket-guide-variant { grid-template-columns: 56px minmax(0, 1fr); gap: 12px; }
  .basket-guide-variant img { width: 56px; height: 56px; }
  .basket-guide-actions { flex-direction: column-reverse; align-items: stretch; gap: 8px; }
  #basket-guide-finish-actions { flex-direction: column; }
}

/* ---------- dialogs ---------- */
dialog { width: min(500px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow: auto;
  padding: 28px; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); box-shadow: var(--shadow-lg); }
dialog[open] { animation: dialog-in var(--t-med) var(--ease); }
dialog::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
dialog h2 { font-size: 1.3rem; letter-spacing: -.02em; }
dialog ol { padding-left: 1.3em; }
dialog li + li { margin-top: 10px; }
.welcome-mark { width: 56px; height: 56px; margin-bottom: 12px; }
.welcome-disclaimer { font-size: .74rem; color: var(--text-subtle); }

/* ---------- report ---------- */
.report-row { margin-top: 10px; }
.report-button { padding: 0; font: inherit; font-size: .8rem; color: var(--text-subtle); background: none; border: 0;
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.report-button:hover, .report-button:focus-visible { color: var(--text); }
.report-dialog form { display: grid; gap: 6px; }
.report-dialog h2 { margin: 0; }
.report-dialog label { font-weight: 600; margin-top: 6px; }
.report-dialog select, .report-dialog textarea { padding: 9px 10px; }
.report-dialog textarea { resize: vertical; min-height: 90px; }
.report-dialog p { margin: 0; }
.report-status:empty { display: none; }
.report-status { color: var(--primary); }
.report-status--error { color: var(--danger); }
.report-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.report-actions .button { margin-top: 0; }

/* ---------- informational pages ---------- */
.guide { padding: 32px 0 12px; }
.guide-hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(240px, .6fr); border: 1px solid var(--border); border-radius: var(--r-xl); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm); }
.guide-hero-copy { padding: clamp(28px, 5vw, 64px); }
.guide-eyebrow { margin: 0 0 12px; color: var(--primary); font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.guide h1 { max-width: 680px; margin: 0; font-size: clamp(2rem, 4.4vw, 3.4rem); line-height: 1.06; letter-spacing: -.04em; }
.guide-hero-copy > p:not(.guide-eyebrow) { max-width: 550px; margin: 20px 0 0; color: var(--text-muted); font-size: 1.1rem; line-height: 1.6; }
.guide-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 28px; }
.guide-text-link { font-weight: 600; }
.guide-hero-aside { display: flex; flex-direction: column; justify-content: space-between; gap: 36px; padding: clamp(28px, 4vw, 48px); background: var(--surface-2); color: var(--primary); }
.guide-aside-label, .guide-card-label { font-size: .7rem; font-weight: 700; letter-spacing: .08em; }
.guide-hero-aside strong { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.13; letter-spacing: -.03em; color: var(--text); }
.guide-aside-detail { font-size: .9rem; line-height: 1.5; color: var(--text-muted); }
.guide-section { padding: 56px 0 32px; }
.guide-section-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 24px; }
.guide-section-heading h2, .guide-note h2, .guide-bottom h2 { font-size: clamp(1.4rem, 2.2vw, 1.9rem); line-height: 1.2; margin: 0; letter-spacing: -.03em; }
.guide-section-heading > p { max-width: 360px; margin: 0; color: var(--text-muted); }
.guide-grid { display: grid; gap: 16px; }
.guide-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.guide-grid-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.guide-card { padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease); }
.guide-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.guide-number { display: grid; place-items: center; width: 44px; height: 44px; color: var(--primary); background: var(--primary-soft); font-weight: 700; border-radius: var(--r-md); }
.guide-card-label { color: var(--primary); }
.guide-card h3 { margin: 22px 0 8px; font-size: 1.1rem; }
.guide-card p, .guide-note > p, .guide-note > div > p:not(.guide-eyebrow), .guide-bottom p { color: var(--text-muted); line-height: 1.6; margin: 0; }
.guide-note > div > p:not(.guide-eyebrow) + p { margin-top: 12px; }
.guide-note { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); gap: 24px; padding: 28px; background: var(--accent-soft); border-radius: var(--r-lg); }
.guide-note .guide-eyebrow { color: var(--accent-text); }
.guide-bottom { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-top: 40px; padding: 32px; background: var(--surface-2); border-radius: var(--r-xl); }
.guide-bottom p { margin-top: 8px; }

/* ---------- how it works ---------- */
.hiw { padding: 32px 0 12px; }
.hiw-hero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(230px, .5fr); border: 1px solid var(--border); border-radius: var(--r-xl); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm); }
.hiw-hero-copy { padding: clamp(28px, 5vw, 64px); }
.hiw h1 { max-width: 640px; margin: 0; font-size: clamp(2.1rem, 4.6vw, 3.6rem); line-height: 1.04; letter-spacing: -.045em; }
.hiw-hero-copy > p:not(.guide-eyebrow) { max-width: 68ch; margin: 20px 0 0; color: var(--text-muted); font-size: 1.1rem; line-height: 1.6; }
.hiw-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 28px; }
.hiw-text-link { font-weight: 600; }
.hiw-hero-index { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: clamp(24px, 3vw, 40px); background: var(--surface-2); }
.hiw-hero-index a { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: var(--r-md); color: var(--text); font-weight: 600; text-decoration: none; transition: background var(--t-fast) var(--ease); }
.hiw-hero-index a:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.hiw-hero-index span { color: var(--primary); font-size: .8rem; font-variant-numeric: tabular-nums; }

.hiw-steps { position: relative; padding: 40px 0 24px; }
.hiw-steps::before { content: ""; position: absolute; left: 50%; top: 80px; bottom: 80px; border-left: 1px dashed var(--border-strong); }
.hiw-step { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; padding: clamp(40px, 6vw, 72px) 0; scroll-margin-top: calc(var(--header-h) + 16px); }
.hiw-step-flip .hiw-copy { order: 2; }
.hiw-copy { max-width: 470px; }
.hiw-num { display: inline-block; margin-bottom: 18px; padding: 6px 12px; border-radius: var(--r-sm); background: var(--primary-soft); color: var(--primary); font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.hiw-copy h2 { margin: 0 0 16px; font-size: clamp(1.8rem, 3.4vw, 2.7rem); line-height: 1.08; letter-spacing: -.045em; }
.hiw-copy p { margin: 0 0 14px; color: var(--text-muted); line-height: 1.65; }
.hiw-copy p strong { color: var(--text); }
.hiw-aside { padding: 12px 16px; border-left: 3px solid var(--primary); border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--surface-sunken); font-size: .9rem; }

.hiw-scene { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; min-height: 360px; margin: 0; padding: 28px; border: 1px solid var(--border); border-radius: var(--r-xl); background: linear-gradient(155deg, var(--surface-2), var(--bg)); box-shadow: var(--shadow-sm); overflow: hidden; }
.hiw-card { width: 100%; max-width: 380px; padding: 18px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-lg); }
.hiw-card-title { margin: 0 0 12px; font-size: .9rem; font-weight: 700; }
.hiw-card small { display: block; color: var(--text-subtle); font-size: .72rem; }
.hiw-card b { font-size: .85rem; }
.hiw-card strong { margin-left: auto; color: var(--price); font-size: .9rem; font-variant-numeric: tabular-nums; }

/* scene 1: search */
.hiw-search-bar { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--r-md); background: var(--surface-sunken); color: var(--text-muted); font-size: .9rem; }
.hiw-typed { white-space: nowrap; clip-path: inset(0 100% 0 0); }
.hiw-caret { width: 2px; height: 16px; margin-left: -8px; background: var(--primary); animation: hiw-blink 1s step-end infinite; }
.hiw-results { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.hiw-results li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-md); opacity: 0; transform: translateY(10px) scale(.97); }
.hiw-results li:first-child { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.hiw-results small { color: var(--primary); font-weight: 600; }
.hiw-chip { flex: none; position: relative; width: 34px; height: 30px; border-radius: 5px; background: #293D46; box-shadow: 0 0 0 4px var(--primary-soft); }
.hiw-chip::before { content: ""; position: absolute; inset: 6px; border: 2px solid #69917C; border-radius: 2px; }
.hiw-step.is-visible .hiw-typed { animation: hiw-type 1.4s steps(18, end) .3s forwards; }
.hiw-step.is-visible .hiw-results li { animation: hiw-pop .55s var(--ease) forwards; }
.hiw-step.is-visible .hiw-results li:nth-child(1) { animation-delay: 1.9s; }
.hiw-step.is-visible .hiw-results li:nth-child(2) { animation-delay: 2.05s; }
.hiw-step.is-visible .hiw-results li:nth-child(3) { animation-delay: 2.2s; }

/* scene 2: variant */
.hiw-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hiw-option { position: relative; padding: 14px 12px; border: 2px solid var(--border); border-radius: var(--r-md); }
.hiw-option-a { border-color: var(--primary); }
.hiw-tick { position: absolute; top: 8px; right: 10px; color: var(--primary); font-weight: 800; opacity: 0; transform: scale(.4); }
.hiw-add { margin-top: 14px; padding: 11px; border-radius: var(--r-md); background: var(--primary); color: var(--on-primary); text-align: center; font-size: .85rem; font-weight: 700; }
.hiw-toast { margin-top: 10px; padding: 9px; border-radius: var(--r-md); background: var(--primary-soft); color: var(--primary); text-align: center; font-size: .8rem; font-weight: 700; opacity: 0; transform: translateY(6px); }
.hiw-step.is-visible .hiw-option-a { animation: hiw-unselect .4s var(--ease) 1s forwards; }
.hiw-step.is-visible .hiw-option-b { animation: hiw-select .4s var(--ease) 1s forwards; }
.hiw-step.is-visible .hiw-tick { animation: hiw-tick .45s var(--ease) 1.15s forwards; }
.hiw-step.is-visible .hiw-add { animation: hiw-press .5s var(--ease) 1.9s; }
.hiw-step.is-visible .hiw-toast { animation: hiw-pop .5s var(--ease) 2.3s forwards; }

/* scene 3: haul */
.hiw-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); opacity: 0; transform: translateX(-12px); }
.hiw-ico { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: var(--r-md); background: var(--primary-soft); color: var(--primary); font-size: 1.1rem; }
.hiw-haul-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; font-size: .82rem; color: var(--text-muted); opacity: 0; }
.hiw-haul-foot b { color: var(--text); }
.hiw-go { padding: 8px 12px; border-radius: var(--r-pill); background: var(--primary); color: var(--on-primary); font-weight: 700; }
.hiw-step.is-visible .hiw-row { animation: hiw-slide .5s var(--ease) forwards; }
.hiw-step.is-visible .hiw-row:nth-of-type(2) { animation-delay: .3s; }
.hiw-step.is-visible .hiw-row:nth-of-type(3) { animation-delay: .55s; }
.hiw-step.is-visible .hiw-row:nth-of-type(4) { animation-delay: .8s; }
.hiw-step.is-visible .hiw-haul-foot { animation: hiw-fade .5s var(--ease) 1.2s forwards; }
.hiw-step.is-visible .hiw-go { animation: hiw-press .5s var(--ease) 1.9s; }

/* scene 4: parcel */
.hiw-parcel { flex-direction: column; gap: 6px; min-height: 440px; background: linear-gradient(155deg, var(--accent-soft), var(--surface-2)); }
.hiw-parcel-svg { width: 100%; max-width: 360px; height: auto; overflow: visible; }
.hiw-parcel-svg text { font-family: var(--font); }
.hiw-blob { fill: color-mix(in srgb, var(--surface) 55%, transparent); }
.hiw-accent { fill: none; stroke: var(--primary); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.hiw-caption { display: grid; justify-items: center; }
.hiw-caption > span { grid-area: 1 / 1; padding: 10px 18px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--shadow-md); font-size: .95rem; white-space: nowrap; transition: opacity .45s var(--ease), transform .45s var(--ease); }
.hiw-cap-a b { color: var(--accent-text); }
.hiw-cap-b b { color: var(--primary); }
.hiw-parcel[data-state="a"] .hiw-cap-b, .hiw-parcel[data-state="b"] .hiw-cap-a { opacity: 0; transform: translateY(8px); }

/* reveal */
.hiw-reveal .hiw-copy, .hiw-reveal .hiw-scene { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.hiw-reveal .hiw-scene { transition-delay: .1s; }
.hiw-reveal.is-visible .hiw-copy, .hiw-reveal.is-visible .hiw-scene { opacity: 1; transform: none; }

@keyframes hiw-type { to { clip-path: inset(0 0 0 0); } }
@keyframes hiw-blink { 50% { opacity: 0; } }
@keyframes hiw-pop { to { opacity: 1; transform: none; } }
@keyframes hiw-fade { to { opacity: 1; } }
@keyframes hiw-slide { to { opacity: 1; transform: none; } }
@keyframes hiw-select { to { border-color: var(--primary); background: var(--primary-soft); } }
@keyframes hiw-unselect { to { border-color: var(--border); } }
@keyframes hiw-tick { to { opacity: 1; transform: scale(1); } }
@keyframes hiw-press { 40% { transform: scale(.95); } 100% { transform: none; } }

@media (max-width: 760px) {
  .hiw-hero, .hiw-step { grid-template-columns: 1fr; }
  .hiw-hero-index { flex-direction: row; flex-wrap: wrap; gap: 4px 8px; padding: 16px; }
  .hiw-hero-index a { padding: 6px 8px; font-size: .85rem; }
  .hiw-steps::before { display: none; }
  .hiw-step { gap: 24px; padding: 36px 0; }
  .hiw-step-flip .hiw-copy { order: 0; }
  .hiw-scene { min-height: 300px; padding: 20px 16px; }
  .hiw-parcel { min-height: 0; }
  .hiw-caption > span { font-size: .85rem; padding: 8px 14px; }
}

.why-page { max-width: 1180px; margin: 0 auto; padding: 52px 0 24px; }
.why-kicker { color: var(--primary); font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 12px; }
.why-intro { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: clamp(32px, 5vw, 72px); align-items: center; padding-bottom: 40px; }
.why-intro .hiw-parcel { min-height: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: none; overflow: visible; }
.why-intro .hiw-parcel-svg { max-width: 400px; }
.why-intro h1 { font-size: clamp(2.4rem, 5vw, 4rem); line-height: 1.03; letter-spacing: -.045em; margin: 0; }
.why-intro-copy > p:not(.why-kicker) { max-width: none; font-size: 1.15rem; line-height: 1.6; color: var(--text-muted); margin: 18px 0 0; }
.why-intro-copy .button { margin-top: 26px; }
.why-example { margin: 0 0 24px; padding: clamp(24px, 4vw, 40px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-sm); }
.why-example-intro { max-width: none; }
.why-example-intro > p:last-child { max-width: none; }
.why-page h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); line-height: 1.15; letter-spacing: -.03em; margin: 0; }
.why-example-intro > p:last-child, .why-end > p { color: var(--text-muted); line-height: 1.6; }
.comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
.comparison-column { padding: 22px 24px; background: var(--surface-sunken); border-radius: var(--r-lg); }
.comparison-alternative { background: var(--primary-soft); }
.comparison-label { margin: 0 0 14px; color: var(--text-muted); font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.comparison-alternative .comparison-label { color: var(--primary); }
.comparison h3 { margin: 0 0 4px; font-size: 1.1rem; }
.comparison-detail { color: var(--text-muted); margin: 0; font-size: .88rem; }
.comparison-lines { margin: 20px 0 0; }
.comparison-lines > div, .comparison-total { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; }
.comparison-lines dt { color: var(--text-muted); }
.comparison-lines dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.comparison-total { align-items: baseline; border-top: 1px solid var(--border-strong); margin-top: 8px; font-weight: 600; }
.comparison-total strong { font-size: 1.6rem; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.comparison-alternative .comparison-total strong { color: var(--price); }
.why-saving { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 22px 0; }
.why-saving strong { display: inline-flex; padding: 6px 14px; font-size: 1.1rem; color: var(--on-accent); background: var(--accent-strong); border-radius: var(--r-pill); }
.why-saving span, .why-fineprint { font-size: .85rem; color: var(--text-muted); }
.why-fineprint { font-size: .75rem; line-height: 1.55; color: var(--text-subtle); }
.why-reasons { margin: 0 0 24px; padding: clamp(24px, 4vw, 40px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-sm); }
.why-reason-grid { display: block; }
.why-reasons h2 { margin-bottom: 24px; }
.why-reason { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 16px; padding: 24px 0; border-top: 1px solid var(--border); }
.why-reason > span { display: grid; place-items: center; width: 44px; height: 44px; color: var(--primary); background: var(--primary-soft); border-radius: var(--r-md); font-weight: 700; font-variant-numeric: tabular-nums; }
.why-reason h3 { margin: 0 0 8px; font-size: 1.15rem; }
.why-reason p { color: var(--text-muted); line-height: 1.65; margin: 0; }

.prose-page { max-width: 820px; margin: 0 auto; padding: 40px 0 24px; }
.prose-page h1 { font-size: clamp(2.2rem, 5.4vw, 3.6rem); line-height: 1.05; letter-spacing: -.045em; margin: 0; }
.lede { max-width: 690px; margin: 20px 0 32px; color: var(--text-muted); font-size: 1.15rem; line-height: 1.65; }
.prose { max-width: 68ch; padding: clamp(24px, 4vw, 40px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-sm); }
.prose h2 { margin: 28px 0 8px; font-size: 1.2rem; }
.prose h2:first-child { margin-top: 0; }
.prose p { color: var(--text-muted); line-height: 1.7; margin: 0 0 12px; }
.prose mark, .contact-card mark { padding: 2px 6px; border-radius: 4px; background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.contact-card { max-width: 680px; padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-sm); }
.contact-card p { color: var(--text-muted); }

/* ---------- contact page ---------- */
.contact-page { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 5vw, 64px); align-items: start; max-width: 1040px; margin: 0 auto; padding: 40px 0 32px; }
.contact-intro h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); line-height: 1.05; letter-spacing: -.045em; margin: 0; }
.contact-intro .lede { margin: 18px 0 28px; }
.contact-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.contact-points li { display: flex; gap: 14px; align-items: flex-start; }
.contact-points p { margin: 2px 0 0; color: var(--text-muted); font-size: .92rem; line-height: 1.55; }
.contact-point-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-md); background: var(--primary-soft); color: var(--primary); font-size: 1.05rem; }
.contact-page .contact-card { max-width: none; padding: clamp(22px, 4vw, 36px); box-shadow: var(--shadow-md); position: relative; overflow: hidden; }
.contact-form-card h2 { margin: 0 0 18px; font-size: 1.35rem; letter-spacing: -.02em; }
.contact-form { display: grid; gap: 18px; }
.contact-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.contact-form label { font-weight: 600; font-size: .9rem; }
.contact-form .input { width: 100%; height: 46px; font-size: 16px; }
.contact-form select.input { padding-right: 8px; }
.contact-form .contact-textarea { height: auto; min-height: 150px; padding: 12px; resize: vertical; line-height: 1.5; font-family: inherit; }
.contact-form [aria-invalid="true"] { border-color: var(--danger); }
.contact-form [aria-invalid="true"]:focus { box-shadow: 0 0 0 3px var(--danger-soft); }
.contact-error { margin: 0; font-size: .82rem; color: var(--danger); line-height: 1.4; }
.contact-notice { margin: 0 0 16px; padding: 12px 14px; border-radius: var(--r-md); background: var(--primary-soft); color: var(--text) !important; font-size: .92rem; }
.contact-notice.is-error { background: var(--danger-soft); color: var(--danger) !important; }
.contact-notice[hidden], .contact-error[hidden] { display: none; }
.contact-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-submit { width: 100%; position: relative; justify-content: center; }
.contact-spinner { display: none; width: 18px; height: 18px; margin-left: 10px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: contact-spin .7s linear infinite; }
.contact-submit.is-busy .contact-spinner { display: inline-block; }
.contact-submit:disabled { opacity: .65; cursor: not-allowed; transform: none; }
@keyframes contact-spin { to { transform: rotate(360deg); } }

.contact-success { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 24px 0 8px; outline: none; }
.contact-success[hidden] { display: none; }
.contact-success h2 { margin: 14px 0 0; font-size: 1.6rem; letter-spacing: -.03em; }
.contact-success p { margin: 0 0 18px; max-width: 34ch; line-height: 1.6; }
.contact-success-art svg { overflow: visible; color: var(--primary); }
.contact-success-art svg * { stroke: currentColor; }
.contact-ring { stroke-dasharray: 327; stroke-dashoffset: 327; }
.contact-envelope { opacity: 0; transform-origin: 60px 60px; }
.contact-check { stroke-dasharray: 60; stroke-dashoffset: 60; opacity: 0; }
.contact-success h2, .contact-success p, .contact-success .button { opacity: 0; transform: translateY(8px); }
.contact-form-card.is-sent .contact-ring { animation: contact-draw .7s var(--ease) forwards; }
.contact-form-card.is-sent .contact-envelope { animation: contact-envelope 1.1s var(--ease) .25s forwards; }
.contact-form-card.is-sent .contact-check { animation: contact-check .5s var(--ease) 1.05s forwards; }
.contact-form-card.is-sent .contact-success h2 { animation: contact-rise .45s var(--ease) 1.15s forwards; }
.contact-form-card.is-sent .contact-success p { animation: contact-rise .45s var(--ease) 1.25s forwards; }
.contact-form-card.is-sent .contact-success .button { animation: contact-rise .45s var(--ease) 1.35s forwards; }
@keyframes contact-draw { to { stroke-dashoffset: 0; } }
@keyframes contact-envelope {
  0% { opacity: 0; transform: translate(-14px, 10px) scale(.7); }
  35% { opacity: 1; transform: translate(0, 0) scale(1); }
  70% { opacity: 1; transform: translate(0, -3px) scale(1); }
  100% { opacity: 0; transform: translate(34px, -26px) scale(.55) rotate(8deg); }
}
@keyframes contact-check { from { opacity: 1; stroke-dashoffset: 60; } to { opacity: 1; stroke-dashoffset: 0; } }
@keyframes contact-rise { to { opacity: 1; transform: none; } }
/* Server-rendered success (no JavaScript) and reduced motion show the final state at once. */
.contact-form-card[data-sent]:not(.is-sent) .contact-ring,
.contact-form-card[data-sent]:not(.is-sent) .contact-check { stroke-dashoffset: 0; opacity: 1; }
.contact-form-card[data-sent]:not(.is-sent) .contact-success :is(h2, p, .button) { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .contact-form-card.is-sent .contact-ring, .contact-form-card.is-sent .contact-check { animation: none; stroke-dashoffset: 0; opacity: 1; }
  .contact-form-card.is-sent .contact-envelope { animation: none; opacity: 0; }
  .contact-form-card.is-sent .contact-success :is(h2, p, .button) { animation: none; opacity: 1; transform: none; }
}
@media (max-width: 820px) {
  .contact-page { grid-template-columns: 1fr; padding-top: 24px; }
}
@media (max-width: 520px) {
  .contact-row { grid-template-columns: 1fr; }
}

/* ---------- auth & account ---------- */
.auth-panel { max-width: 560px; margin: 40px auto 20px; padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-md); }
.auth-panel h1 { margin-bottom: 8px; }
.auth-panel > p { color: var(--text-muted); }
.auth-form { display: grid; gap: 10px; margin: 22px 0; }
.auth-form label { font-weight: 600; font-size: .9rem; }
.auth-form input:not([type="hidden"]) { padding: 10px 14px; }
.auth-form .button { width: 100%; margin-top: 6px; }
.auth-message { padding: 12px 14px; color: var(--text) !important; background: var(--primary-soft); border-radius: var(--r-md); }
.auth-layout { width: 100%; max-width: 440px; margin: clamp(28px, 6vh, 72px) auto 48px; }
.auth-card { margin: 0; padding: 32px; }
.auth-brand { display: flex; justify-content: center; margin-bottom: 20px; }
.auth-brand img { width: 56px; height: 56px; }
.auth-switch { display: flex; gap: 4px; padding: 4px; background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--r-pill); margin-bottom: 28px; }
.auth-switch a { flex: 1; padding: 8px 12px; text-align: center; font-weight: 600; color: var(--text-muted); border-radius: var(--r-pill); }
.auth-switch a:hover { text-decoration: none; color: var(--text); }
.auth-switch a[aria-current="page"] { color: var(--primary); background: var(--surface); box-shadow: var(--shadow-sm); }
.auth-intro h1 { font-size: 1.7rem; letter-spacing: -.03em; margin-bottom: 6px; }
.auth-intro p { color: var(--text-muted); margin: 0; line-height: 1.6; }
.auth-private-note { font-size: .85rem; padding: 10px 12px; background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--r-md); }
.auth-card .auth-form { gap: 20px; margin: 24px 0 14px; }
.auth-field { display: grid; gap: 7px; }
.auth-card .auth-form input:not([type="hidden"]) { height: 46px; font-size: 16px; }
.auth-password { position: relative; }
.auth-password input { padding-right: 68px !important; }
.auth-password-toggle { position: absolute; right: 4px; top: 3px; min-width: 56px; min-height: 40px; padding: 6px; font: 600 .82rem var(--font); color: var(--primary); background: transparent; border: 0; border-radius: var(--r-sm); cursor: pointer; }
.auth-password-toggle:hover { background: var(--primary-soft); }
.auth-hint { font-size: .8rem; color: var(--text-muted); margin: 0; line-height: 1.5; }
.auth-captcha { display: grid; justify-items: start; gap: 8px; min-width: 0; }
.auth-card .auth-submit { height: 46px; margin-top: 0; }
.auth-submit:disabled { opacity: .65; cursor: wait; }
.auth-session-note { font-size: .8rem; margin: 0; line-height: 1.6; color: var(--text-muted); }
.auth-card-footer { margin: 24px -32px -32px; padding: 18px 20px; text-align: center; background: var(--surface-sunken); border-top: 1px solid var(--border); border-radius: 0 0 var(--r-xl) var(--r-xl); font-size: .88rem; }
.auth-card-footer p { margin: 0; }
.auth-card-footer a { font-weight: 600; }
.auth-card-footer .button { margin-top: 12px; width: 100%; }
.auth-outside-note { margin: 20px 0 0; color: var(--text-muted); text-align: center; font-size: .8rem; line-height: 1.7; }
.auth-error { color: var(--danger) !important; border-color: var(--danger); }
.auth-message.auth-error { background: var(--danger-soft); }
.auth-field [aria-invalid="true"] { border-color: var(--danger) !important; }
.auth-field-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.auth-field-header a { font-size: .82rem; }
.account-details { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 6px 16px; margin: 20px 0; }
.account-details dt { color: var(--text-muted); }
.account-details dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; }
.danger-panel { margin-top: 16px; border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); box-shadow: none; }
.danger-panel h2 { font-size: 1.05rem; }
.delete-button { background: var(--danger); border-color: var(--danger); color: #fff; }
.delete-button:hover { background: color-mix(in srgb, var(--danger) 85%, #000); border-color: transparent; color: #fff; }

/* ---------- footer ---------- */
.footer { margin-top: var(--s-6); padding: 56px 0 40px; background: var(--surface); border-top: 1px solid var(--border); color: var(--text-muted); font-size: .88rem; }
main > .section:last-child { padding-bottom: clamp(24px, 3vw, 40px); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 32px; }
.footer-brand p { max-width: 340px; margin: 14px 0 0; line-height: 1.6; }
.footer h2 { margin: 0 0 12px; font-size: .76rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text); }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-links a, .footer ul a { color: var(--text-muted); }
.footer-links a:hover, .footer ul a:hover { color: var(--primary); }
.footer-legal { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); font-size: .78rem; line-height: 1.65; color: var(--text-subtle); }
.footer-legal p { margin: 0 0 6px; }

/* ---------- styleguide page ---------- */
.sg { padding: 40px 0; }
.sg-section { margin: 0 0 56px; }
.sg-section > h2 { font-size: 1.5rem; letter-spacing: -.03em; margin-bottom: 6px; }
.sg-section > p { color: var(--text-muted); max-width: 680px; margin-top: 0; }
.sg-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 16px 0; }
.sg-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin-top: 16px; }
.sg-swatch { overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.sg-swatch-color { height: 84px; border-bottom: 1px solid var(--border); }
.sg-swatch-info { padding: 10px 12px; font-size: .82rem; }
.sg-swatch-info strong { display: block; font-size: .9rem; }
.sg-swatch-info code { font: .78rem var(--mono); color: var(--text-muted); }
.sg-card { padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.sg-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.sg-type > * { margin: 0 0 12px; }
.sg-token { display: grid; grid-template-columns: 140px 1fr; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .86rem; }
.sg-token code { font: .8rem var(--mono); color: var(--text-muted); }
.sg-box { height: 56px; background: var(--surface-2); border: 1px solid var(--border); }
.sg-copy { padding: 20px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); margin-bottom: 12px; }
.sg-copy h3 { font-size: 1.4rem; letter-spacing: -.03em; margin-bottom: 6px; }
.sg-copy p { margin: 0; color: var(--text-muted); }
.sg-do, .sg-dont { padding: 18px 20px; border-radius: var(--r-lg); }
.sg-do { background: var(--primary-soft); }
.sg-dont { background: var(--danger-soft); }
.sg-do h3 { color: var(--primary); }
.sg-dont h3 { color: var(--danger); }
.sg-do ul, .sg-dont ul { margin: 0; padding-left: 1.2em; line-height: 1.7; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .header-inner { gap: 16px; }
  .main-nav a { padding: 8px 10px; }
  .currency select { max-width: 92px; }
  .hero-inner { grid-template-columns: minmax(0, 1fr); }
  .hero-visual { display: none; }
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 1100px) {
  :root { --header-h: 60px; }
  .main-nav, .header-actions .currency, .header-actions .account-actions { display: none; }
  .menu-toggle { display: inline-grid; }
  .mobile-nav { border-top: 1px solid var(--border); background: var(--surface); }
  .mobile-nav[data-open="true"] { display: block; animation: dock-in var(--t-med) var(--ease); }
  .mobile-nav-inner { display: grid; gap: 4px; padding: 12px 16px 16px; }
  .mobile-nav-inner > a { padding: 12px 10px; font-weight: 600; color: var(--text); border-radius: var(--r-sm); }
  .mobile-nav-inner > a[aria-current="page"], .mobile-nav-inner > a[aria-current="true"] { color: var(--primary); background: var(--primary-soft); }
  .mobile-nav-inner > a:hover { background: var(--surface-2); text-decoration: none; }
  .mobile-nav-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 0; margin-top: 6px; border-top: 1px solid var(--border); }
  .mobile-nav .currency { display: inline-flex; }
  .mobile-nav .account-actions { display: flex; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .brand-word { font-size: 1.15rem; }
  .basket-link .basket-total-wrap { display: none; }
  .basket-link { padding: 0 10px; }
  .search-lg { height: 56px; padding: 5px 5px 5px 46px; }
  .search-lg .search-icon { left: 16px; }
  .search-lg button, .search button { padding: 0 16px; }
  .search-slot { min-height: 56px; }
  .hero-ctas .button { flex: 1 1 auto; }
  .hero-circuit { opacity: .6; }
  .trust-strip { gap: 10px 20px; }
  .section-head { flex-direction: column; align-items: start; gap: 8px; }
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .pcard-body { padding: 12px 12px 14px; gap: 6px; }
  .pcard-name { font-size: .92rem; }
  .price-now { font-size: 1.15rem; }
  .price-label { display: none; }
  .pcard-media .badge-save { top: 8px; left: 8px; font-size: .74rem; padding: 3px 8px; }
  .pcard-cta .button { height: 36px; padding: 0 10px; font-size: .84rem; }
  .steps { grid-template-columns: 1fr; gap: 12px; }
  .basket-item { flex-wrap: wrap; gap: 10px; }
  .basket-controls { display: flex; flex-wrap: wrap; align-items: center; width: 100%; }
  .catalogue { grid-template-columns: minmax(0, 1fr); gap: 12px; padding-top: 12px; }
  .sidebar { gap: 10px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-body { padding: 10px 12px 12px; }
  .product { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .gallery { position: static; }
  .offer-head { grid-template-columns: 1fr auto; gap: 14px; }
  .offer-head .offer-actions { grid-column: 1 / -1; }
  .offer-body.has-images { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .offer-image-main { max-width: 280px; }
  .offer-details th { width: 42%; }
  .results-head { flex-direction: column; align-items: start; gap: 8px; }
  .variants, .variants tbody { display: block; width: 100%; }
  .variants thead { display: none; }
  .variants tr { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 4px; border-bottom: 1px solid var(--border); }
  .variants td { display: block; padding: 0; border: 0; min-width: 0; }
  .variants .vimg { grid-column: 1; grid-row: 1 / span 3; width: 72px; }
  .variant-image > img { width: 72px; height: 72px; }
  .variants .variant-name { grid-column: 2 / 4; overflow-wrap: anywhere; }
  .variants .variant-price { grid-column: 2; text-align: left; }
  .variants .variant-stock { grid-column: 2; text-align: left; color: var(--text-muted); font-size: .82rem; }
  .variant-stock::before { content: "Stock: "; }
  .variants .variant-status { grid-column: 2; }
  .variants .variant-save { grid-column: 2 / 4; grid-row: auto; align-self: start; margin-top: 6px; }
  .variant-save .haul-add--compact { justify-content: start; }
  .haul-add .haul-qty-stepper button, .haul-add .haul-qty-stepper input { height: 44px; }
  .haul-add .haul-qty-stepper button { width: 40px; }
  .haul-add .haul-qty-stepper input { width: 52px; }
  .haul-add--compact .basket-add-row { height: 44px; padding: 0 16px; }
  .variant-save .haul-in:not(:empty) { text-align: left; }
  .basket-add { padding: 0 14px; }
  .variant-preview { display: none !important; }
  .guide-hero, .guide-grid-three, .guide-grid-two, .guide-note { grid-template-columns: 1fr; }
  .guide-hero-aside { gap: 20px; }
  .guide-section { padding: 36px 0 24px; }
  .guide-section-heading, .guide-bottom { align-items: start; flex-direction: column; }
  .why-page { padding-top: 32px; }
  .why-intro { padding-bottom: 36px; }
  .comparison { grid-template-columns: 1fr; }
  .why-reasons { padding: 24px 20px; }
  .why-intro { grid-template-columns: 1fr; }
  .why-intro .hiw-parcel { max-width: 420px; margin: 0 auto; }
  .footer { padding-top: 40px; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .sg-grid-2 { grid-template-columns: 1fr; }
  .auth-panel { margin-top: 24px; padding: 20px; }
  .auth-card { padding: 24px 20px; }
  .auth-card-footer { margin: 24px -20px -24px; }
}
@media (max-width: 420px) {
  .header-actions { gap: 4px; }
  .pcard-cta .button { font-size: .8rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .footer, .sidebar, .hero-ctas, .search { display: none !important; }
  body { background: #fff; }
}

/* ---------- projects ---------- */
.project-add-button { display: inline-flex; align-items: center; min-height: 40px; padding: 0 4px; font: inherit; font-size: .84rem; font-weight: 600; color: var(--primary); background: none;
  border: 0; cursor: pointer; text-decoration: none; }
.project-add-button:hover, .project-add-button:focus-visible { text-decoration: underline; text-underline-offset: 2px; }
.report-row .project-add-button { margin-right: 14px; }
.offer-actions .project-add-button { font-size: .8rem; }
.project-dialog form { display: grid; gap: 6px; }
.project-dialog .input { width: 100%; }
.project-dialog [hidden] { display: none; }

.project-dialog fieldset { margin: 12px 0 4px; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-sm); }
.project-dialog fieldset legend { font-weight: 600; font-size: .9rem; padding: 0 4px; }
.project-dialog fieldset label { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; margin: 0; font-weight: 500; }
.project-dialog fieldset input { flex: 0 0 auto; margin: 4px 0 0; accent-color: var(--primary); }
.project-dialog #project-new-wrap label { display: block; margin-bottom: 4px; }
.project-dialog .report-actions { flex-wrap: wrap; }

/* page frame */
.projects-page { max-width: 1120px; margin: 8px auto 56px; }
.project-page { max-width: none; margin: 8px 0 56px; }
.project-head h1, .editor-head h1, .project-hero h1, .projects-head h1 { margin: 0 0 6px; font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.15; letter-spacing: -.03em; overflow-wrap: anywhere; }
.project-head p { margin: 4px 0; }
.project-summary { margin: 4px 0 10px; font-size: 1.08rem; color: var(--text-muted); max-width: 62ch; }
.project-meta { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0 0 6px; font-size: .9rem; font-weight: 600; color: var(--text-muted); }
.project-meta span + span::before { content: "·"; margin: 0 8px; color: var(--text-subtle); }
.project-notice, .project-owner-bar { margin: 0 0 16px; padding: 10px 14px; background: var(--accent-soft); border-radius: var(--r-md); }
.project-owner-bar { background: var(--primary-soft); }
.project-actions { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin: 22px 0 6px; }
.project-actions .button, .project-actions summary.button { height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin: 0; white-space: nowrap; }
.project-actions .pl-menu, .project-actions form { display: flex; align-self: center; margin: 0; }
.project-actions form { margin: 0; }
.project-panel { margin-top: 24px; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.project-panel h2 { margin: 0 0 4px; font-size: 1.1rem; }
.project-empty { padding: 24px; text-align: center; background: var(--surface-sunken); border-radius: var(--r-lg); }

/* status pills (editor header, my projects) */
.editor-status { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.status-pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; font-size: .76rem; font-weight: 650; color: var(--text-muted);
  background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--r-pill); white-space: nowrap; text-decoration: none; }
.status-pill--ok { color: var(--primary); background: var(--primary-soft); border-color: transparent; }
.status-pill--warn { color: var(--accent-text); background: var(--accent-soft); border-color: transparent; }
a.status-pill--link:hover { color: var(--primary); border-color: var(--primary); text-decoration: none; }

/* menus: <details class="pl-menu"> */
.pl-menu { position: relative; }
.pl-menu > summary { list-style: none; cursor: pointer; }
.pl-menu > summary::-webkit-details-marker { display: none; }
.pl-menu-list { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; display: grid; min-width: 240px; max-height: 70vh; overflow-y: auto; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lg); }
.pl-menu--right .pl-menu-list, .bom-menu .pl-menu-list { left: auto; right: 0; }
.pl-menu-list form { margin: 0; }
.pl-menu-list a, .pl-menu-list button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 38px; padding: 8px 10px; font: 500 .88rem/1.3 var(--font);
  color: var(--text); text-align: left; background: none; border: 0; border-radius: var(--r-sm); cursor: pointer; text-decoration: none; }
.pl-menu-list a:hover, .pl-menu-list button:hover:not(:disabled) { background: var(--surface-sunken); text-decoration: none; }
.pl-menu-list button:disabled { color: var(--text-subtle); cursor: default; }
.pl-menu-list .icon { width: 16px; height: 16px; flex: none; color: var(--text-muted); }
.pl-menu-list .muted { margin-left: auto; padding-left: 8px; }
.pl-menu-heading { margin: 6px 10px 2px; padding-top: 8px; border-top: 1px solid var(--border); font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-subtle); }
.pl-menu-list .pl-menu-danger { color: var(--danger); }
.icon-button--bordered { border-color: var(--border-strong); background: var(--surface); }
.button .icon { width: 17px; height: 17px; }

/* editor header + tabs */
.editor-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 24px; margin: 4px 0 18px; }
.editor-head-main { flex: 1 1 420px; min-width: 0; }
.editor-head-main p { margin: 2px 0; }
.editor-head-actions { display: flex; align-items: center; gap: 8px; }
.editor-head-actions form { margin: 0; display: flex; }
.editor-head-actions .pl-menu { display: flex; }
.editor-head-actions .button, .editor-head-actions summary.icon-button { height: 42px; margin: 0; }
.editor-head-actions summary.icon-button { width: 42px; }
.editor-tabs { display: flex; gap: 4px; margin: 0 0 24px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.editor-tabs a { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; margin-bottom: -1px; font-weight: 600; font-size: .94rem;
  color: var(--text-muted); border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.editor-tabs a:hover { color: var(--text); text-decoration: none; }
.editor-tabs a[aria-current="page"] { color: var(--primary); border-bottom-color: var(--primary); }
.editor-tab-count { min-width: 22px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; font-size: .74rem; border-radius: var(--r-pill);
  background: var(--surface-sunken); color: var(--text-muted); }
.editor-tabs a[aria-current="page"] .editor-tab-count { background: var(--primary-soft); color: var(--primary); }
.editor-panel { margin: 0 0 20px; padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.editor-panel h2 { margin: 0 0 4px; font-size: 1.15rem; }
.editor-panel > p { margin: 0 0 12px; }
.editor-panel .bom-form { padding: 0; margin-top: 12px; }
.editor-split { display: grid; gap: 20px; align-items: start; margin: 0 0 20px; }
.editor-split > .editor-panel { margin: 0; }
.editor-side-title { margin: 0 0 4px; font-size: 1rem; }
.reader-counts { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; }
.reader-counts li { display: grid; gap: 2px; }
.reader-counts span { font-size: .84rem; color: var(--text-muted); }
.reader-counts strong { font-size: .95rem; font-weight: 650; }
.editor-share-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
@media (min-width: 900px) {
  .editor-split { grid-template-columns: minmax(0, 1fr) minmax(0, 320px); }
  .editor-side { position: sticky; top: calc(var(--header-h) + 16px); }
  .editor-share-form { grid-template-columns: minmax(0, 1fr) minmax(0, 320px); }
  .editor-share-form > .bom-form-actions { grid-column: 1 / -1; }
  .editor-share-form > .public-checklist { margin: 0; }
}
.danger-zone { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.danger-zone form { margin: 0; }
.share-link { display: grid; gap: 6px; margin: 12px 0 18px; }
.share-link label { font-weight: 600; font-size: .9rem; }
.share-link-row { display: flex; gap: 8px; }
.share-link-row .input { flex: 1; min-width: 0; font-family: var(--mono); font-size: .86rem; }
.share-link p { margin: 0; min-height: 1.2em; }
.project-visibility { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.project-visibility legend { margin-bottom: 8px; font-weight: 650; font-size: .95rem; }
.bom-form label.visibility-option { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; font-weight: 500; border: 1px solid var(--border); border-radius: var(--r-md); cursor: pointer; }
.visibility-option:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.visibility-option:has(input:disabled) { cursor: default; opacity: .6; }
.visibility-option input { margin: 3px 0 0; accent-color: var(--primary); width: 17px; height: 17px; flex: none; }
.visibility-option > span { display: grid; gap: 2px; }

/* parts layout: list + sticky summary */
.bom-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.bom-col { min-width: 0; }
.bom-list-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 12px; }
.bom-list-head .section-title { margin: 0; }
.project-select-all { display: inline-flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; }
.project-select-all input, .bom-pick input, .bom-check input { accent-color: var(--primary); width: 17px; height: 17px; margin: 0; }
.bom-summary { position: sticky; top: calc(var(--header-h) + 16px); display: grid; gap: 8px; padding: 20px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.bom-summary p { margin: 0; }
.bom-summary-title { margin: 0; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-subtle); }
.bom-subtotal { font-size: 1.8rem; font-weight: 750; letter-spacing: -.02em; color: var(--price); line-height: 1.15; }
.bom-subtotal .original-cny { font-size: .9rem; font-weight: 500; color: var(--text-muted); }
.bom-priced { font-weight: 600; }
.bom-summary .button { margin-top: 6px; }
.bom-build { display: grid; gap: 6px; padding: 10px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.bom-build label { font-weight: 600; font-size: .9rem; }
.bom-build-row { display: flex; gap: 8px; }
.bom-build .input { width: 96px; }
.bom-refresh { margin: 0 0 12px; padding: 10px 14px; background: var(--accent-soft); border-radius: var(--r-md); }

/* rows */
.bom { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.bom-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto minmax(104px, auto); grid-template-areas: "thumb main qty price";
  gap: 12px 16px; align-items: center; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm); transition: opacity var(--t-fast) var(--ease); }
.bom-row:not(.bom-row--edit) { grid-template-columns: 22px 64px minmax(0, 1fr) 84px 150px; grid-template-areas: "pick thumb main qty price"; }
.bom-row--edit { grid-template-columns: 64px minmax(0, 1fr) 124px 128px 40px; grid-template-areas: "thumb main qty price menu" "edit edit edit edit edit"; }
.bom-row--manual { background: var(--surface-sunken); border-style: dashed; border-color: var(--border-strong); box-shadow: none; }
.bom-row--optional { opacity: .78; }
.bom-row--saving { opacity: .6; }
.bom-pick { grid-area: pick; align-self: center; }
.bom-thumb { grid-area: thumb; width: 64px; height: 64px; display: grid; place-items: center; overflow: hidden; color: var(--text-subtle);
  background: var(--thumb-bg); border: 1px solid var(--border); border-radius: var(--r-md); }
.bom-thumb img { width: 100%; height: 100%; object-fit: contain; }
.bom-thumb .icon { width: 26px; height: 26px; }
.bom-thumb--manual { background: var(--surface); border-style: dashed; border-color: var(--border-strong); }
.bom-main { grid-area: main; min-width: 0; }
.bom-main p { margin: 3px 0 0; }
.bom-name { margin: 0; font-size: 1rem; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.bom-name a { color: var(--text); }
.bom-name a:hover { color: var(--primary); }
.bom-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: .86rem; color: var(--text-muted); overflow-wrap: anywhere; }
.bom-pill { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; font-size: .74rem; font-weight: 700; border-radius: var(--r-pill); white-space: nowrap; }
.bom-pill .icon { width: 13px; height: 13px; }
.bom-pill--manual { color: var(--accent-text); background: var(--accent-soft); }
.bom-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bom-chips:empty { display: none; }
.bom-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; font-size: .74rem; font-weight: 600; color: var(--text-muted);
  background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--r-pill); white-space: nowrap; }
.bom-row--manual .bom-chip { background: var(--surface); }
.bom-chip--refs { font-family: var(--mono); font-weight: 500; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.bom-chip--warn { color: var(--accent-text); background: var(--accent-soft); border-color: transparent; }
.bom-notes { white-space: pre-line; overflow-wrap: anywhere; color: var(--text-muted); }
.bom-qty-col { grid-area: qty; display: grid; justify-items: center; gap: 2px; }
.bom-qty-form { margin: 0; display: flex; align-items: center; gap: 6px; }
.bom-stepper { margin: 0; }
.bom-stepper button, .bom-stepper input { height: 36px; font-size: .92rem; }
.bom-stepper button { width: 34px; }
.bom-stepper input { width: 52px; }
.bom-qty { display: inline-block; padding: 3px 10px; font-size: .86rem; font-weight: 700; color: var(--primary); background: var(--primary-soft); border-radius: var(--r-pill); white-space: nowrap; }
.bom-price-col { grid-area: price; display: grid; gap: 2px; justify-items: end; text-align: right; }
.bom-total { font-size: 1.05rem; font-weight: 700; color: var(--price); white-space: nowrap; }
.bom-total .original-cny { display: block; font-size: .76rem; font-weight: 500; color: var(--text-muted); }
.bom-unit { white-space: nowrap; }
.bom-unpriced { max-width: 150px; }
.bom-menu { grid-area: menu; justify-self: end; }
.bom-edit-panel { grid-area: edit; margin: 2px -16px -14px; padding: 16px; border-top: 1px solid var(--border); background: var(--surface); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.bom-row--manual .bom-edit-panel { border-top-style: dashed; }
.bom-edit-panel[hidden] { display: none; }
.bom-edit-panel .bom-form { padding: 0; }

/* forms */
.bom-form { display: grid; gap: 12px; }
.bom-form label { display: grid; gap: 5px; font-weight: 600; font-size: .88rem; }
.bom-form .input { width: 100%; font-weight: 400; }
.bom-form textarea.input { height: auto; padding: 9px 12px; resize: vertical; }
.bom-form-grid { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 12px; }
.bom-form label.bom-check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.bom-form-actions { display: flex; justify-content: flex-start; align-items: center; gap: 8px; }
.bom-form-actions .button { height: 42px; }

/* empty state + add a part */
.bom-empty { padding: 36px 24px; text-align: center; background: var(--surface-sunken); border: 1px dashed var(--border-strong); border-radius: var(--r-lg); }
.bom-empty h3 { margin: 0 0 6px; font-size: 1.15rem; }
.bom-empty p { margin: 0 auto; max-width: 52ch; }
.bom-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.bom-add { margin-top: 20px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.bom-add-title { margin: 0 0 12px; font-size: 1rem; }
.bom-add-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.bom-add-option { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: var(--text); border: 1px solid var(--border); border-radius: var(--r-md); text-decoration: none;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease); }
.bom-add-option:hover { border-color: var(--primary); background: var(--primary-soft); text-decoration: none; }
.bom-add-option > span:last-child { display: grid; gap: 2px; }
.bom-add-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: none; color: var(--primary); background: var(--primary-soft); border-radius: var(--r-pill); }
.bom-add-icon .icon { width: 18px; height: 18px; }
.bom-quick-form { display: grid; grid-template-columns: minmax(0, 1fr) 96px auto; gap: 10px; align-items: end; margin: 16px 0 0; padding-top: 16px; border-top: 1px solid var(--border); }
.bom-quick-form label { display: grid; gap: 5px; font-weight: 600; font-size: .88rem; }
.bom-quick-form .input { width: 100%; }
.bom-quick-form .button { height: 42px; }

.copy-button { flex: none; min-width: 96px; justify-content: center; }
.copy-button.is-copied { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.share-panel { min-width: min(420px, calc(100vw - 32px)); padding: 14px; gap: 12px; }
.share-panel-title { margin: 0; font-weight: 700; }
.share-panel-item { display: grid; gap: 4px; }
.share-panel-item label { font-weight: 600; font-size: .86rem; }
.share-panel-status { margin: 0; min-height: 1.2em; }
.share-panel .share-link-row .input { font-family: var(--mono); font-size: .8rem; }
.public-checklist { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-sunken); }
.public-checklist--ok { border-color: var(--primary); background: var(--primary-soft); }
.public-checklist ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.public-checklist li { display: flex; gap: 10px; align-items: flex-start; }
.public-checklist .check-mark { flex: none; width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-size: .8rem; font-weight: 700; border: 1px solid var(--border); color: var(--text-subtle); }
.public-checklist li.is-met .check-mark { background: var(--primary); border-color: var(--primary); color: #fff; }
.public-checklist p { margin: 8px 0 0; }
.public-checklist .visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

/* published page */
.project-hero { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 24px; margin: 24px 0 8px; }
.project-hero-main { flex: 1 1 480px; min-width: 0; }
.project-hero .project-actions { margin: 0; }
.project-notes { max-width: none; margin: 8px 0 8px; }
.project-notes-text, .project-links { max-width: 90ch; }
.project-notes-text { white-space: pre-line; overflow-wrap: anywhere; }
.project-links { padding-left: 1.2em; overflow-wrap: anywhere; }
.project-page .bom-layout { margin-top: 28px; }

/* my projects */
.projects-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 32px; margin: 24px 0 24px; }
.projects-head > div { flex: 1 1 420px; }
.projects-head p { margin: 4px 0; max-width: 60ch; }
.projects-head > .projects-head-actions { flex: 0 0 auto; margin: 0; }
.projects-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin: 0 0 22px; }
.projects-toolbar .project-search { flex: 1 1 360px; max-width: 560px; margin: 0; }
.projects-toolbar .sort-tabs { margin: 0; }
.project-create { flex: 0 1 420px; display: grid; gap: 6px; margin: 0; }
.project-create label { font-weight: 600; font-size: .9rem; }
.project-create-row { display: flex; gap: 8px; }
.project-create-row .input { flex: 1; min-width: 0; }
.my-projects { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.my-project { display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.my-project:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.my-project-thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); gap: 1px; height: 110px; flex: none; overflow: hidden; background: var(--border); border-bottom: 1px solid var(--border); }
.my-project-thumbs img { display: block; min-width: 0; min-height: 0; width: 100%; height: 100%; object-fit: contain; background: var(--thumb-bg); }
.my-project-thumbs--empty { display: grid; place-items: center; grid-template-columns: 1fr; background: var(--surface-sunken); color: var(--text-subtle); }
.my-project-thumbs--empty .icon { width: 34px; height: 34px; }
.my-project-body { display: flex; flex-direction: column; gap: 4px; flex: 1; padding: 14px 16px 16px; }
.my-project-body p { margin: 0; }
.my-project-body .editor-status { margin-bottom: 4px; }
.my-project h2 { margin: 0; font-size: 1.08rem; overflow-wrap: anywhere; }
.my-project h2 a { color: var(--text); }
.my-project h2 a:hover { color: var(--primary); }
.my-project-summary { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--text-muted); }
.my-project-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 10px; }

@media (max-width: 900px) {
  .bom-layout { grid-template-columns: minmax(0, 1fr); }
  .bom-summary { position: static; order: -1; }
}
@media (max-width: 640px) {
  .bom-row, .bom-row:not(.bom-row--edit) { grid-template-columns: 22px 52px minmax(0, 1fr) auto; grid-template-areas: "pick thumb main main" "pick qty qty price";
    align-items: start; gap: 10px 12px; padding: 12px; }
  .bom-pick { align-self: start; padding-top: 16px; }
  .bom-qty-col, .bom-price-col, .bom-menu { align-self: center; }
  .bom-row--edit { grid-template-columns: 52px minmax(0, 1fr) auto 40px; grid-template-areas: "thumb main main menu" "qty qty price price" "edit edit edit edit"; }
  .bom-thumb { width: 52px; height: 52px; }
  .bom-qty-col { justify-items: start; }
  .bom-stepper button, .bom-stepper input { height: 44px; }
  .bom-stepper button { width: 44px; }
  .bom-edit-panel { margin: 2px -12px -12px; padding: 14px 12px; }
  .bom-form-grid, .bom-form-grid--2 { grid-template-columns: minmax(0, 1fr); }
  .bom-add-options { grid-template-columns: minmax(0, 1fr); }
  .bom-quick-form { grid-template-columns: minmax(0, 1fr) 80px; }
  .bom-quick-form .bom-quick-name { grid-column: 1 / -1; }
  .editor-head-actions { width: 100%; }
  .editor-head-actions form { flex: 1; }
  .editor-head-actions form .button { width: 100%; }
  .project-hero .project-actions { width: 100%; }
  .project-create-row { flex-direction: column; }
  .share-link-row { flex-direction: column; }
  .pl-menu-list { min-width: min(280px, calc(100vw - 32px)); }
  .editor-panel { padding: 16px; }
}
@media print {
  .project-actions, .bom-build, .project-select-all, .bom-pick, .bom-summary .button, .bom-menu, .editor-tabs { display: none !important; }
  .bom-layout { grid-template-columns: 1fr; }
  .bom-summary { position: static; box-shadow: none; }
  .bom-row { break-inside: avoid; box-shadow: none; }
}

/* ---------- projects: directory, export, listing status, import ---------- */
.project-search { display: flex; gap: 8px; margin: 8px 0 22px; }
.project-search .input { flex: 1; min-width: 0; }
.project-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.project-tile .thumb { aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; background: var(--thumb-bg); border-bottom: 1px solid var(--border); }
.project-tile .thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.project-tile h2.card-name { margin: 0; font-size: 1rem; }
.project-tile-summary { margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.project-export { position: relative; }
.project-export > summary { list-style: none; cursor: pointer; }
.project-export > summary::-webkit-details-marker { display: none; }
.project-export-menu { position: absolute; z-index: 5; top: calc(100% + 6px); left: 0; display: grid; min-width: 280px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lg); }
.project-export-menu a { padding: 8px 10px; border-radius: var(--r-sm); font-size: .88rem; }
.project-export-menu a:hover { background: var(--surface-sunken); text-decoration: none; }
.project-actions--secondary { margin-top: 0; }
.project-listing { margin: 10px 0 14px; padding: 12px 14px; font-size: .9rem; background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--r-md); }
.project-listing ul { margin: 6px 0 0; padding-left: 1.2em; }
.project-listing--ok { background: var(--primary-soft); border-color: transparent; }
.project-report { margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.bom-form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.import-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-md); }
.import-table-wrap table { margin: 0; }
.import-table-wrap th, .import-table-wrap td { padding: 8px; vertical-align: top; }
.import-map th { min-width: 160px; }
.import-map td { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-review .input { min-width: 220px; height: 38px; }
.bom-import code { font-size: .85em; }
@media (max-width: 760px) {
  .bom-form-grid--2 { grid-template-columns: minmax(0, 1fr); }
  .project-search { flex-direction: column; }
  .project-export-menu { min-width: 240px; }
}

/* ---------- BOM import flow ---------- */
.import-progress { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 24px; padding: 0; list-style: none; counter-reset: import-step; }
.import-progress li { flex: 1 1 140px; min-width: 0; padding: 10px 12px; color: var(--text-muted); background: var(--surface-sunken);
  border: 1px solid var(--border); border-radius: var(--r-md); font-size: .88rem; }
.import-progress li::before { counter-increment: import-step; content: counter(import-step) ". "; font-weight: 700; color: var(--primary); }
.import-progress li[aria-current="step"] { color: var(--text); background: var(--primary-soft); border-color: var(--primary); font-weight: 650; }
.import-navigation { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 18px; }
.import-review thead.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 760px) {
  .import-navigation { flex-direction: column; }
  .import-navigation > * { width: 100%; }
  table.import-review, .import-review tbody, .import-review tr, .import-review td { display: block; width: 100%; }
  .import-review thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .import-review .input { min-width: 0; width: 100%; }
  .import-review tbody { display: grid; gap: 10px; }
  .import-review tr { padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); }
  .import-review td { display: grid; grid-template-columns: minmax(90px, .75fr) minmax(0, 1.5fr); gap: 10px; padding: 6px 0; border: 0; overflow-wrap: anywhere; }
  .import-review td::before { content: attr(data-label); color: var(--text-muted); font-size: .8rem; font-weight: 650; }
}

/* Add-to-project dialog: Seller / Variant segmented controls */
.project-dialog .seg-row { display: grid; grid-template-columns: 72px 1fr; align-items: center; gap: 12px; margin-top: 10px; }
.project-dialog .seg-label { font-weight: 600; font-size: .9rem; }
.project-dialog .seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; }
.project-dialog .seg label { position: relative; display: block; margin: 0; padding: 0; font-weight: 500; cursor: pointer; }
.project-dialog .seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.project-dialog .seg span { display: block; padding: 8px 14px; font-size: .9rem; white-space: nowrap; text-align: center; }
.project-dialog .seg label + label span { border-left: 1px solid var(--border); }
.project-dialog .seg input:checked + span { background: var(--primary); color: #fff; }
.project-dialog .seg input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: -3px; }
.project-dialog .seg input:disabled { cursor: not-allowed; }
.project-dialog .seg input:disabled + span { opacity: .5; }
.project-dialog .project-summary { margin: 10px 0 0; font-size: .88rem; line-height: 1.5; max-width: none; }

/* Project ratings: vote pill, sort tabs, score chip */
.vote-pill { display: inline-flex; align-items: center; align-self: center; height: 42px; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-pill); box-shadow: var(--shadow-sm); overflow: visible; }
.vote-form { display: contents; }
.vote-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 40px; padding: 0; margin: 0; font: inherit;
  color: var(--text-muted); background: transparent; border: 0; border-radius: var(--r-pill); cursor: pointer; text-decoration: none;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease); }
a.vote-btn:hover { text-decoration: none; }
.vote-btn:hover:not(:disabled) { color: var(--text); background: var(--surface-2); }
.vote-btn:disabled { opacity: .5; cursor: not-allowed; }
.vote-btn .icon { transform-origin: 50% 70%; transition: fill var(--t-fast) var(--ease); }
.vote-up[aria-pressed="true"] { color: var(--accent-text); }
.vote-up[aria-pressed="true"] .icon { fill: var(--accent); }
.vote-down[aria-pressed="true"] { color: var(--danger); }
.vote-down[aria-pressed="true"] .icon { fill: var(--danger); }
.vote-score { display: inline-block; min-width: 2.2ch; height: 1.4em; overflow: hidden; text-align: center; font-weight: 700; font-size: .95rem; line-height: 1.4;
  font-variant-numeric: tabular-nums; border-inline: 1px solid var(--border); padding: 0 8px; }
.vote-score-num { display: block; }
.vote-up.is-popping .icon { animation: vote-pop-up .55s cubic-bezier(.34, 1.56, .64, 1); }
.vote-down.is-popping .icon { animation: vote-pop-down .55s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes vote-pop-up { 0% { transform: scale(1) rotate(0); } 35% { transform: scale(1.45) rotate(-15deg); } 70% { transform: scale(.95) rotate(4deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes vote-pop-down { 0% { transform: scale(1) rotate(0); } 35% { transform: scale(1.45) rotate(15deg); } 70% { transform: scale(.95) rotate(-4deg); } 100% { transform: scale(1) rotate(0); } }
.vote-score-num.roll-up { animation: vote-roll-up .3s var(--ease); }
.vote-score-num.roll-down { animation: vote-roll-down .3s var(--ease); }
@keyframes vote-roll-up { from { transform: translateY(100%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes vote-roll-down { from { transform: translateY(-100%); opacity: 0; } to { transform: none; opacity: 1; } }
.vote-particle { position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: var(--accent);
  pointer-events: none; animation: vote-burst .6s var(--ease) forwards; }
@keyframes vote-burst { from { transform: rotate(var(--angle)) translateY(-8px) scale(1); opacity: 1; } to { transform: rotate(var(--angle)) translateY(-26px) scale(.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .vote-up.is-popping .icon, .vote-down.is-popping .icon, .vote-score-num.roll-up, .vote-score-num.roll-down { animation: none; }
  .vote-particle { display: none; }
  .vote-btn, .vote-btn .icon { transition: none; }
}

.sort-tabs { display: flex; gap: 8px; margin: 0 0 18px; padding: 2px 0; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.sort-tabs::-webkit-scrollbar { display: none; }
.sort-tab { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; font-size: .92rem; font-weight: 600; color: var(--text-muted);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-pill); white-space: nowrap;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }
.sort-tab:hover { color: var(--primary); border-color: var(--primary); text-decoration: none; }
.sort-tab.is-active { color: var(--on-primary); background: var(--primary); border-color: var(--primary); }
.sort-tab .icon { width: 16px; height: 16px; }
.score-chip { display: inline-flex; align-items: center; gap: 4px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--text); }
.score-chip .icon { width: 14px; height: 14px; }
@media (max-width: 600px) { .sort-tabs { margin-inline: -16px; padding-inline: 16px; } }

/* ---------- blog ---------- */
.blog-index, .blog-post { padding: 40px 0 24px; }
.blog-crumb { margin: 0 0 14px; font-size: .88rem; font-weight: 550; color: var(--text-subtle); }
.blog-index-header h1, .blog-post-header h1 { max-width: 22ch; margin: 0; font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: 1.05; letter-spacing: -.045em; text-wrap: balance; }
.blog-index-header .lede, .blog-post-header .lede { margin: 18px 0 0; }

/* topic filter */
.blog-topics { display: flex; flex-wrap: wrap; gap: 8px; margin: 28px 0 32px; }
.blog-topics .chip { min-height: 36px; padding: 6px 14px; }
.blog-topics .chip.is-active { color: var(--on-primary); background: var(--primary); border-color: var(--primary); }
.blog-topic-count { font-variant-numeric: tabular-nums; opacity: .7; }

/* latest article */
.blog-feature { margin-bottom: 48px; }
.blog-feature .guide-eyebrow { margin: 0 0 14px; font-size: .85rem; font-weight: 650; letter-spacing: 0; text-transform: none; }
.blog-feature-title { max-width: 24ch; margin: 0; font-size: clamp(1.6rem, 3.2vw, 2.4rem); line-height: 1.12; letter-spacing: -.035em; text-wrap: balance; }
.blog-feature-title a { color: var(--text); }
.blog-feature-title a:hover { color: var(--primary); }
.blog-feature-aside { justify-content: flex-start; gap: 0; }
.blog-feature-toc { margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.blog-feature-toc li { counter-increment: toc; display: grid; grid-template-columns: 2ch minmax(0, 1fr); gap: 10px; padding: 10px 0; border-top: 1px solid color-mix(in srgb, var(--primary) 18%, transparent); font-size: .95rem; line-height: 1.4; }
.blog-feature-toc li::before { content: counter(toc); color: var(--primary); font-weight: 650; font-variant-numeric: tabular-nums; }
.blog-feature-toc a { color: var(--text); }
.blog-feature-toc a:hover { color: var(--primary); }

/* article list: a ruled parts list rather than a card grid */
.blog-list-heading { margin: 0 0 4px; font-size: 1rem; font-weight: 650; color: var(--text-muted); letter-spacing: -.01em; }
.blog-list { margin: 0; padding: 0; list-style: none; border-bottom: 1px solid var(--border); }
.blog-row { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr) auto; gap: 8px 32px; align-items: baseline; padding: 22px 0; border-top: 1px solid var(--border); }
.blog-row-date { color: var(--text-subtle); font-size: .88rem; font-variant-numeric: tabular-nums; }
.blog-row-title { margin: 0; font-size: 1.2rem; line-height: 1.3; letter-spacing: -.02em; }
.blog-row-title a { color: var(--text); }
.blog-row-title a:hover { color: var(--primary); }
.blog-row-summary { max-width: 68ch; margin: 6px 0 0; color: var(--text-muted); line-height: 1.6; }
.blog-row-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; margin: 0; color: var(--text-subtle); font-size: .82rem; white-space: nowrap; }
.blog-row-meta .tag { margin: 0; }
.blog-row-meta a.tag:hover { color: var(--primary); border-color: var(--primary); text-decoration: none; }
.blog-empty { max-width: 60ch; padding: 32px; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--r-lg); }
.blog-empty p { color: var(--text-muted); }
.blog-empty p:last-child { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-bottom: 0; }
.blog-feed-link { margin: 28px 0 0; }

/* article page */
.blog-post-header { max-width: 820px; }
.blog-draft-flag { display: inline-block; margin: 0 0 14px; padding: 4px 10px; border-radius: var(--r-xs); background: var(--accent-soft); color: var(--accent-text); font-size: .85rem; font-weight: 600; }
.blog-post-cover { width: 100%; height: auto; margin-top: 32px; border-radius: var(--r-lg); border: 1px solid var(--border); }
.blog-post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; grid-template-areas: "body aside"; gap: 56px; margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--border); }
.blog-body { grid-area: body; min-width: 0; max-width: 70ch; }
.blog-post-aside { grid-area: aside; align-self: start; position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 20px; }

/* datasheet: article facts set like a component spec table */
.blog-datasheet { margin: 0; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); overflow: hidden; font-size: .85rem; }
.blog-datasheet > div { display: grid; grid-template-columns: 7rem minmax(0, 1fr); }
.blog-datasheet time { white-space: nowrap; }
.blog-datasheet > div + div { border-top: 1px solid var(--border); }
.blog-datasheet dt { padding: 9px 12px; color: var(--text-muted); background: var(--surface-sunken); border-right: 1px solid var(--border); font-weight: 550; }
.blog-datasheet dd { margin: 0; padding: 9px 12px; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.blog-datasheet-tags { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.blog-datasheet-tags a { font-weight: 600; }

.blog-toc summary { cursor: pointer; padding: 4px 0; font-size: .9rem; font-weight: 650; color: var(--text); }
.blog-toc ol { margin: 8px 0 0; padding: 0; list-style: none; border-left: 2px solid var(--border); }
.blog-toc li a { display: block; padding: 6px 0 6px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--text-muted); font-size: .88rem; line-height: 1.4; }
.blog-toc li a:hover { color: var(--primary); border-left-color: var(--primary); text-decoration: none; }

/* long-form body */
.blog-body { font-size: 1.0625rem; line-height: 1.75; color: var(--text); }
.blog-body > :first-child { margin-top: 0; }
.blog-body p, .blog-body ul, .blog-body ol { margin: 0 0 1.15em; }
.blog-body ul, .blog-body ol { padding-left: 1.4em; }
.blog-body li + li { margin-top: .35em; }
.blog-body li::marker { color: var(--primary); }
.blog-body h2 { margin: 2.2em 0 .6em; font-size: clamp(1.35rem, 2.4vw, 1.65rem); line-height: 1.2; letter-spacing: -.03em; }
.blog-body h3 { margin: 1.8em 0 .45em; font-size: 1.15rem; line-height: 1.3; }
.blog-body a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--primary) 40%, transparent); text-underline-offset: 3px; }
.blog-body a:hover { text-decoration-color: currentColor; }
.blog-body strong { font-weight: 650; }
.blog-body blockquote { margin: 1.6em 0; padding: 16px 20px; background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--text); }
.blog-body blockquote > :last-child { margin-bottom: 0; }
.blog-body code { padding: .1em .35em; font: .88em var(--mono); background: var(--surface-sunken); border: 1px solid var(--border); border-radius: 4px; }
.blog-body pre { margin: 1.4em 0; padding: 16px 18px; overflow-x: auto; background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--r-sm); line-height: 1.55; }
.blog-body pre code { padding: 0; border: 0; background: none; font-size: .86rem; }
.blog-body img { height: auto; margin: 1.6em 0; border-radius: var(--r-md); border: 1px solid var(--border); }
.blog-body hr { margin: 2.4em 0; border: 0; border-top: 1px solid var(--border); }
.blog-body .table-wrap { margin: 1.6em 0; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); }
.blog-body table { width: 100%; min-width: 34rem; border-collapse: collapse; font-size: .92rem; line-height: 1.5; }
.blog-body th, .blog-body td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.blog-body th { background: var(--surface-sunken); font-weight: 650; white-space: nowrap; }
.blog-body tr:last-child td { border-bottom: 0; }
.blog-body .footnotes { margin-top: 2.4em; padding-top: 1em; border-top: 1px solid var(--border); font-size: .88rem; color: var(--text-muted); }
.blog-body .footnotes-sep { display: none; }

.blog-cta { margin-top: 56px; }
.blog-cta h2 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); line-height: 1.2; margin: 0; letter-spacing: -.03em; }
.blog-related { margin-top: 48px; }

@media (max-width: 960px) {
  .blog-post-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "aside" "body"; gap: 28px; }
  .blog-post-aside { position: static; }
  .blog-toc { padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); }
}
@media (max-width: 760px) {
  .blog-index, .blog-post { padding-top: 28px; }
  .blog-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .blog-row-date { order: -1; }
  .blog-row-meta { justify-content: flex-start; margin-top: 8px; }
  .blog-feature-aside { display: none; }
  .blog-cta { flex-direction: column; align-items: flex-start; }
}

/* faq: accordion of questions, reusing the blog layout, TOC and guide-bottom */
.faq-hero { padding-bottom: 0; margin-left: 0; max-width: 820px; }
.faq-intro { max-width: 68ch; margin-top: 16px; color: var(--text-muted); line-height: 1.7; }
.faq-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.faq-toolbar p { margin: 0; font-size: .9rem; }
.faq-section { margin-top: 32px; scroll-margin-top: calc(var(--header-h) + 16px); }
.faq-section:first-of-type { margin-top: 8px; }
.faq-section h2 { font-size: 1.3rem; margin: 0 0 12px; }
.faq-item { margin: 0 0 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); scroll-margin-top: calc(var(--header-h) + 16px); }
.faq-item[open] { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.faq-item > summary { display: flex; align-items: center; gap: 14px; padding: 14px 18px; list-style: none; cursor: pointer; border-radius: var(--r-lg); }
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary:hover { background: var(--surface-2); }
.faq-item > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.faq-item .faq-q { flex: 1; margin: 0; font-size: 1rem; font-weight: 650; line-height: 1.4; letter-spacing: 0; }
.faq-item[open] > summary .category-chevron { transform: rotate(45deg); }
.faq-answer { padding: 0 18px 14px; font-size: 1rem; line-height: 1.7; color: var(--text-muted); overflow-wrap: anywhere; }
.faq-answer p, .faq-answer ul, .faq-answer ol { margin: 0 0 .9em; }
.faq-answer ul, .faq-answer ol { padding-left: 1.4em; }
.faq-answer li + li { margin-top: .3em; }
.faq-answer a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.faq-answer .faq-answer-foot { margin: 0; text-align: right; font-size: .85rem; }
.faq-answer a.faq-permalink { color: var(--text-subtle); text-decoration: none; padding: 2px 6px; border-radius: var(--r-sm); }
.faq-answer a.faq-permalink:hover, .faq-answer a.faq-permalink:focus-visible { color: var(--primary); }
.faq-cta { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 960px) { .faq-hero { padding-top: 24px; } }

/* Cookie consent banner: map vanilla-cookieconsent tokens to site theme */
#cc-main {
  --cc-font-family: var(--font);
  --cc-bg: var(--surface);
  --cc-primary-color: var(--text);
  --cc-secondary-color: var(--text-muted);
  --cc-btn-primary-bg: var(--accent-strong);
  --cc-btn-primary-color: #fff;
  --cc-btn-primary-border-color: var(--accent-strong);
  --cc-btn-primary-hover-bg: var(--accent-text);
  --cc-btn-primary-hover-color: #fff;
  --cc-btn-primary-hover-border-color: var(--accent-text);
  --cc-btn-secondary-bg: var(--surface-2);
  --cc-btn-secondary-color: var(--text);
  --cc-btn-secondary-border-color: var(--border-strong);
  --cc-btn-secondary-hover-bg: var(--surface-sunken);
  --cc-btn-secondary-hover-color: var(--text);
  --cc-btn-secondary-hover-border-color: var(--border-strong);
  --cc-separator-border-color: var(--border);
  --cc-toggle-on-bg: var(--accent-strong);
  --cc-toggle-off-bg: var(--border-strong);
  --cc-toggle-readonly-bg: var(--border);
  --cc-section-category-border: var(--border);
  --cc-cookie-category-block-bg: var(--surface-sunken);
  --cc-cookie-category-block-border: var(--border);
  --cc-cookie-category-block-hover-bg: var(--surface-2);
  --cc-cookie-category-block-hover-border: var(--border-strong);
  --cc-overlay-bg: rgba(0, 0, 0, .5);
  --cc-link-color: var(--accent-text);
}
#cc-main a.cc-link { color: var(--accent-text); text-decoration: underline; }
