/* ============================================================================
   CutCost — Alt v2 (warm, doctor-friendly) design system
   Single source of truth. Replaces Bootstrap 5.1 + FontAwesome + Bootstrap
   Icons + Inter + legacy style.css.
   ============================================================================ */

/* ---------- FONTS (self-host, GDPR-friendly) ---------- */

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/plus-jakarta-sans-latin-400.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/plus-jakarta-sans-400.woff2') format('woff2');
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('/static/fonts/plus-jakarta-sans-latin-500.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('/static/fonts/plus-jakarta-sans-500.woff2') format('woff2'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('/static/fonts/plus-jakarta-sans-latin-600.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('/static/fonts/plus-jakarta-sans-600.woff2') format('woff2'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('/static/fonts/plus-jakarta-sans-latin-700.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('/static/fonts/plus-jakarta-sans-700.woff2') format('woff2'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 800; font-display: swap; src: url('/static/fonts/plus-jakarta-sans-latin-800.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 800; font-display: swap; src: url('/static/fonts/plus-jakarta-sans-800.woff2') format('woff2'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 400; font-display: swap; src: url('/static/fonts/fraunces-latin-400.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 400; font-display: swap; src: url('/static/fonts/fraunces-400.woff2') format('woff2'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 500; font-display: swap; src: url('/static/fonts/fraunces-latin-500.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 500; font-display: swap; src: url('/static/fonts/fraunces-500.woff2') format('woff2'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 600; font-display: swap; src: url('/static/fonts/fraunces-latin-600.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 600; font-display: swap; src: url('/static/fonts/fraunces-600.woff2') format('woff2'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 700; font-display: swap; src: url('/static/fonts/fraunces-latin-700.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 700; font-display: swap; src: url('/static/fonts/fraunces-700.woff2') format('woff2'); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- TOKENS ---------- */

:root {
  --bg:           #fbf8f3;
  --bg-2:         #f4efe6;
  --surface:      #ffffff;
  --surface-soft: #faf6ef;
  --ink:          #1f1d1b;
  --ink-2:        #45413c;
  --ink-3:        #6e6960;
  --ink-4:        #a39d92;
  --rule:         #ece6da;
  --rule-soft:    #f1ebde;
  --accent:       #d8541a;
  /* CutCost extensions (not in altv2.css canonical set — derived from altv2 hover colors). */
  --accent-hover: #c54414;
  --accent-soft:  #fde9dd;
  --accent-soft-hover: #facab1;
  --accent-ink:   #8a3210;
  --good:         #2e7a4d;
  --good-soft:    #e3f1e9;
  --warn:         #b9851b;
  --warn-soft:    #faf0d4;
  --bad:          #b53a32;
  --bad-soft:     #fae3e1;
  --sky:          #2f5d8a;
  --sky-soft:     #e2ecf6;

  --sans:  'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;

  --r-sm: 6px;
  --r:    10px;
  --r-lg: 16px;
  --r-xl: 22px;

  --shadow-sm: 0 1px 2px rgba(40,28,15,0.05), 0 1px 3px rgba(40,28,15,0.04);
  --shadow:    0 2px 6px rgba(40,28,15,0.06), 0 8px 24px -10px rgba(40,28,15,0.10);
  --shadow-lg: 0 6px 16px rgba(40,28,15,0.08), 0 20px 50px -16px rgba(40,28,15,0.18);

  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
  --focus-outline: 2px solid var(--accent);
  --focus-offset: 2px;

  --page-max: 1320px;
  --page-pad: 28px;
  --topbar-h: 64px;
}

/* ---------- RESET + BASE ---------- */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; padding: 0; }
img, svg, video { max-width: 100%; display: block; }
input, select, textarea { font: inherit; }
:focus { outline: none; }
:focus-visible { outline: var(--focus-outline); outline-offset: var(--focus-offset); border-radius: 4px; }
.serif { font-family: var(--serif); letter-spacing: -0.01em; }

/* ---------- A11Y UTILITIES ---------- */

.sr-only, .visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; top: -40px; left: 0;
  background: var(--accent); color: #fff; padding: 10px 16px;
  border-radius: 0 0 var(--r) 0; font-weight: 600; z-index: 9999;
  transition: top 150ms;
}
.skip-link:focus { top: 0; color: #fff; }

/* ---------- UTILITIES (Bootstrap-compat subset) ---------- */

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-inline { display: inline !important; }
.d-inline-flex { display: inline-flex !important; }
.d-inline-block { display: inline-block !important; }

@media (min-width: 576px) {
  .d-sm-none { display: none !important; }
  .d-sm-inline { display: inline !important; }
  .d-sm-inline-flex { display: inline-flex !important; }
  .d-sm-block { display: block !important; }
}
@media (min-width: 768px) {
  .d-md-none { display: none !important; }
  .d-md-inline { display: inline !important; }
  .d-md-inline-flex { display: inline-flex !important; }
  .d-md-block { display: block !important; }
}
@media (min-width: 992px) {
  .d-lg-none { display: none !important; }
  .d-lg-inline { display: inline !important; }
  .d-lg-inline-flex { display: inline-flex !important; }
  .d-lg-block { display: block !important; }
}

.flex { display: flex; }
.flex--col { display: flex; flex-direction: column; }
.gap-sm { gap: 8px; }
.gap { gap: 14px; }
.gap-lg { gap: 22px; }
.center { align-items: center; }
.between { justify-content: space-between; }
.around { justify-content: space-around; }
.text-center { text-align: center; }
.text-start { text-align: left; }
.text-end { text-align: right; }
.text-muted { color: var(--ink-3); }
.text-danger { color: var(--bad); }
.text-success { color: var(--good); }
.text-warning { color: var(--warn); }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.fw-medium { font-weight: 500; }
.fw-normal { font-weight: 400; }
.w-100 { width: 100%; }
.mw-100 { max-width: 100%; }
.mx-auto { margin-left: auto; margin-right: auto; }
.me-auto { margin-right: auto; }
.ms-auto { margin-left: auto; }

/* ===== BEGIN PHASE-3-REMOVE: BS-COMPAT SHIM (results_partial.html bridge) =====
   Bootstrap-compat utility classes — preserved for results_partial.html and
   other yet-to-be-migrated templates. Will shrink as Phase 3+ progresses.
   Phase 3.2 (search-results screen redesign per handoff 02-search-results.html)
   will replace this entire shim region with native altv2 markup. When that
   lands, delete everything between BEGIN/END PHASE-3-REMOVE markers in this
   file: utility classes (here), .filters-sidebar block, FontAwesome compat,
   stock/order badges, search-popular-pill, autocomplete-dropdown, etc. */
.align-items-center { align-items: center !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-end { justify-content: flex-end !important; }
.flex-column { flex-direction: column !important; }
.flex-row { flex-direction: row !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }
.h-100 { height: 100% !important; }
.position-absolute { position: absolute !important; }
.position-relative { position: relative !important; }
.position-fixed { position: fixed !important; }
.position-sticky { position: sticky !important; }
.top-0 { top: 0 !important; }
.end-0 { right: 0 !important; }
.start-0 { left: 0 !important; }
.bottom-0 { bottom: 0 !important; }
.gap-1 { gap: 4px !important; }
.gap-2 { gap: 8px !important; }
.gap-3 { gap: 12px !important; }
.gap-4 { gap: 16px !important; }
.gap-5 { gap: 20px !important; }
/* Bootstrap-style gutter classes — when applied to .row, they only need
   row-gap (vertical spacing for wrapped content). Horizontal spacing is
   already handled by .row's negative margin + .col-* padding (18px gutter).
   Adding column-gap here would push col percentages over 100% → flex-wrap
   would break col-lg-3 + col-lg-9 sidebar/main layouts. */
.g-1 { row-gap: 4px; } .g-2 { row-gap: 8px; } .g-3 { row-gap: 12px; }
.g-4 { row-gap: 16px; } .g-5 { row-gap: 20px; }
.m-2 { margin: 8px !important; }
.m-3 { margin: 12px !important; }
.ms-1 { margin-left: 4px !important; }
.ms-2 { margin-left: 8px !important; }
.me-1 { margin-right: 4px !important; }
.me-2 { margin-right: 8px !important; }
.text-decoration-line-through { text-decoration: line-through; }
.text-decoration-none { text-decoration: none; }
.fst-italic { font-style: italic; }
.fs-5 { font-size: 1.25rem; }
.fs-6 { font-size: 1rem; }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.rounded-3 { border-radius: var(--r-lg); }
.rounded-4 { border-radius: var(--r-xl); }
.rounded-pill { border-radius: 999px; }
.opacity-25 { opacity: 0.25; }
.opacity-75 { opacity: 0.75; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Pill colors used by results_partial.html availability filters */
.pill { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.pill-success { background: var(--good-soft); color: var(--good); }
.pill-warning { background: var(--warn-soft); color: var(--warn); }
.pill-danger { background: var(--bad-soft); color: var(--bad); }
.pill-count { font-size: 11px; opacity: 0.75; margin-left: 4px; }

/* Card image classes used by legacy product cards in results_partial.html */
.card-img-top { width: 100%; aspect-ratio: 1.15/1; object-fit: contain; padding: 14px; background: var(--bg-2); }
.card-body { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1; }
.card-brand { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.card-title { font-size: 16px; font-weight: 600; line-height: 1.3; color: var(--ink); margin: 0 0 8px; }
.text-truncate-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* .spinner-border-sm is defined in the spinner section (~line 1330). */

/* Filters sidebar — wraps the col-lg-3 on results_partial.html. Bootstrap-era
   styling re-implemented in altv2 tones so the search page looks coherent
   until Phase 3 redesigns it natively. */
.filters-sidebar {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: 18px;
  position: sticky; top: calc(var(--topbar-h) + 16px);
  max-height: calc(100vh - var(--topbar-h) - 36px);
  overflow-y: auto;
}
.filters-header { padding-bottom: 12px; border-bottom: 1px solid var(--rule-soft); margin-bottom: 12px; }
.filters-header h5 { font-family: var(--sans); font-size: 14px; font-weight: 700; color: var(--ink); margin: 0; }
.filters-content { display: flex; flex-direction: column; gap: 14px; }
.filter-group { border-bottom: 1px solid var(--rule-soft); padding-bottom: 12px; }
.filter-group:last-child { border-bottom: none; }
.filter-group-header { display: flex; justify-content: space-between; align-items: center; cursor: pointer; padding: 6px 0; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.filter-group-header:hover { color: var(--ink); }
.filter-group-header.collapsed .filter-chevron { transform: rotate(-90deg); }
.filter-chevron { font-size: 10px; color: var(--ink-3); transition: transform 200ms; }
.filter-count { color: var(--ink-3); font-weight: 500; font-size: 12.5px; margin-left: 4px; }
.filter-group-body { padding-top: 8px; }
.filter-search { padding: 6px 10px; font-size: 13px; }
.filter-loading { display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 13px; padding: 8px 0; }
.checkbox-list { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; }
.checkbox-list-tall { max-height: 320px; }
.checkbox-list label { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.checkbox-list label:hover { color: var(--ink); }
.checkbox-list input[type="checkbox"] { accent-color: var(--accent); cursor: pointer; }

.availability-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.availability-pill { cursor: pointer; }

.price-inputs { display: flex; align-items: center; gap: 8px; }
.price-separator { color: var(--ink-4); }
.input-group { display: flex; flex: 1; }
.input-group-sm .form-control, .input-group-sm .input-group-text { padding: 6px 10px; font-size: 13px; }
.input-group-text { background: var(--bg-2); border: 1px solid var(--rule); border-right: none; padding: 6px 10px; font-size: 13px; color: var(--ink-3); border-radius: var(--r) 0 0 var(--r); }
.input-group .form-control { border-radius: 0 var(--r) var(--r) 0; }

.active-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.active-filter-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: var(--accent-soft); color: var(--accent-ink); border-radius: 999px; font-size: 12px; font-weight: 500; cursor: pointer; }
.active-filter-tag:hover { background: var(--accent-soft-hover); }
.active-filter-tag .x { font-size: 14px; line-height: 1; }

/* Search results page legacy product card variant — sits inside col-lg-9 grid */
.product-card.h-100 { height: 100%; display: flex; flex-direction: column; }
.search-popular-pills { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0; }
.search-popular-label { font-size: 12.5px; color: var(--ink-3); padding: 7px 0; }
.search-popular-pill { display: inline-flex; align-items: center; padding: 6px 14px; background: var(--surface); border: 1px solid var(--rule); border-radius: 999px; font-size: 13px; color: var(--ink-2); }
.search-popular-pill:hover { border-color: var(--ink-3); color: var(--ink); }

/* Autocomplete dropdown (used by autocomplete.js + topbar #searchInput) */
.autocomplete-dropdown { position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: var(--shadow); display: none; z-index: 100; max-height: 380px; overflow-y: auto; }
.autocomplete-dropdown.show, .autocomplete-dropdown[data-open="true"] { display: block; }

/* Stretched link helper — clickable parent without breaking nested links */
.stretched-link-title { color: inherit; }
.stretched-link-title::after { content: ""; position: absolute; inset: 0; }

/* Supplier compare badge in product cards */
.supplier-compare-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: var(--accent-soft); color: var(--accent-ink); border-radius: 999px; font-size: 12px; font-weight: 500; text-decoration: none; }
.supplier-compare-badge:hover { background: var(--accent-soft-hover); color: var(--accent-ink); }

/* Stock + freshness badges (legacy results_partial markup) */
.badge-stock { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; background: var(--good-soft); color: var(--good); border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.badge-order { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; background: var(--warn-soft); color: var(--warn); border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.last-updated-time { font-size: 11.5px; color: var(--ink-3); }

/* Bootstrap-shim utilities used in unmigrated templates (results_partial,
   index.html JS-rendered cards). Duplicates of pre-existing altv2 utilities
   (text-success, text-warning, py-1/2/3, px-3, mt-3/4, mb-1/3, fst-italic,
   opacity-25) deleted — keep only genuinely new ones below. */
.text-primary { color: var(--accent); }
.text-secondary { color: var(--ink-3); }
.text-dark { color: var(--ink); }
.text-white { color: #fff; }
.text-white-50 { color: rgba(255,255,255,0.5); }
.bg-white { background: #fff; }
.bg-light { background: var(--bg-2); }
.bg-secondary { background: var(--ink-3); color: #fff; }
.border { border: 1px solid var(--rule); }
.border-0 { border: 0; }
.border-bottom { border-bottom: 1px solid var(--rule); }
.border-start { border-left: 1px solid var(--rule); }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-5 { padding-top: 24px; padding-bottom: 24px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.ps-3 { padding-left: 12px; }
.pt-2 { padding-top: 8px; }
.pt-3 { padding-top: 12px; }
.my-3 { margin-top: 12px; margin-bottom: 12px; }
.flex-fill { flex: 1; }
.small { font-size: 13px; }

/* FontAwesome compat — fallback rendering for legacy fa-* icons. Each renders
   as an inline-block placeholder until results_partial.html is migrated to
   data-icon SVG in Phase 3. Unicode glyphs approximate the FontAwesome shape. */
.fas, .far, .fab, [class^="fa-"], [class*=" fa-"] {
  display: inline-block; font-style: normal; font-weight: 600;
  width: 1em; text-align: center; vertical-align: middle;
  font-family: var(--sans);
}
/* Generic fallback so unmapped fa-* icons render as a small bullet rather
   than an empty box. ~63 fa-* references in templates aren't mapped
   explicitly; this catches them. Specific .fa-X::before rules below
   override via cascade. Phase 3 will replace fa-* with [data-icon]
   entirely and this whole block goes away. */
[class^="fa-"]::before, [class*=" fa-"]::before { content: '·'; color: var(--ink-4); }
.fa-search::before { content: '🔎'; color: inherit; }
.fa-sliders-h::before { content: '⚙'; }
.fa-undo::before { content: '↺'; }
.fa-times::before { content: '×'; }
.fa-times-circle::before { content: '⊗'; }
.fa-check::before { content: '✓'; }
.fa-check-circle::before { content: '✓'; color: var(--good); }
.fa-clock::before { content: '⏱'; }
.fa-calendar-alt::before { content: '📅'; }
.fa-calendar-times::before { content: '📅'; }
.fa-box::before { content: '📦'; }
.fa-box-open::before { content: '📦'; }
.fa-tag::before { content: '⊟'; }
.fa-tags::before { content: '⊟'; }
.fa-copyright::before { content: '©'; }
.fa-globe::before { content: '🌐'; }
.fa-store::before { content: '🏬'; }
.fa-folder::before { content: '📁'; }
.fa-share-alt::before { content: '↗'; }
.fa-image::before { content: '🖼'; }
.fa-chevron-down::before { content: '⌄'; }
.fa-chevron-up::before { content: '⌃'; }
.fa-chevron-right::before { content: '›'; }
.fa-chevron-left::before { content: '‹'; }
.fa-exclamation-triangle::before { content: '⚠'; }
.fa-dollar-sign::before { content: '$'; }
.fa-question-circle::before { content: '?'; }
.fa-info-circle::before { content: 'ℹ'; }
.fa-ban::before { content: '⊘'; }
.fa-sync-alt::before { content: '↻'; }
.fa-chart-line::before { content: '📈'; }
.fa-external-link-alt::before { content: '↗'; }
.fa-balance-scale::before { content: '⚖'; }
.fa-tooth::before { content: '🦷'; }
.fa-user-plus::before { content: '👤+'; }
.fa-3x { font-size: 3em; }
.fa-4x { font-size: 4em; }
.fa-2x { font-size: 2em; }
.fa-lg { font-size: 1.25em; }
/* ===== END PHASE-3-REMOVE: BS-COMPAT SHIM ===== */

.mt-0 { margin-top: 0; } .mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-5 { margin-top: 20px; }
.mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; } .mt-10 { margin-top: 40px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-5 { margin-bottom: 20px; }
.mb-6 { margin-bottom: 24px; } .mb-8 { margin-bottom: 32px; }
.my-0 { margin-top: 0; margin-bottom: 0; }
.p-0 { padding: 0; } .p-1 { padding: 4px; } .p-2 { padding: 8px; }
.p-3 { padding: 12px; } .p-4 { padding: 16px; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.px-3 { padding-left: 12px; padding-right: 12px; }

/* Neutral wrapper class preserved for favorites.js: .col-sm-6 closest() target */
.col-sm-6 { /* no-op container; grid layout handled by parent .grid-* */ }

/* ---------- TYPOGRAPHY ---------- */

.h-eyebrow { font-size: 13px; font-weight: 600; color: var(--accent-ink); text-transform: uppercase; letter-spacing: 0.08em; }
.h-display { font-family: var(--serif); font-weight: 600; font-size: 56px; line-height: 1.05; letter-spacing: -0.025em; margin: 0; color: var(--ink); }
.h-1 { font-family: var(--serif); font-weight: 600; font-size: 42px; line-height: 1.1; letter-spacing: -0.02em; margin: 0; color: var(--ink); }
.h-2 { font-family: var(--serif); font-weight: 600; font-size: 30px; line-height: 1.15; letter-spacing: -0.015em; margin: 0; color: var(--ink); }
.h-3 { font-family: var(--sans); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; margin: 0; color: var(--ink); }
.body-lg { font-size: 17px; line-height: 1.55; color: var(--ink-2); }
.muted { color: var(--ink-3); }

h1 { font-family: var(--serif); font-weight: 600; font-size: 42px; line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 16px; }
h2 { font-family: var(--serif); font-weight: 600; font-size: 30px; line-height: 1.15; letter-spacing: -0.015em; margin: 24px 0 12px; }
h3 { font-family: var(--sans); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; margin: 20px 0 10px; }
h4, h5, h6 { font-family: var(--sans); font-weight: 700; margin: 16px 0 8px; }
p { margin: 0 0 12px; }
small { font-size: 13px; color: var(--ink-3); }
kbd { font-family: var(--sans); font-size: 11px; color: var(--ink-3); background: var(--surface); border: 1px solid var(--rule); padding: 2px 6px; border-radius: 4px; font-weight: 600; }

/* ---------- SHELL ---------- */

.page { max-width: var(--page-max); margin: 0 auto; padding: 32px var(--page-pad); width: 100%; }
.container { max-width: var(--page-max); margin: 0 auto; padding-left: var(--page-pad); padding-right: var(--page-pad); width: 100%; }
main { flex: 1; }

/* ---------- TOPBAR ---------- */

.tb {
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  padding: 14px var(--page-pad);
  display: flex;
  align-items: center;
  gap: 18px;
  position: sticky; top: 0; z-index: 100;
}
.tb__logo { font-family: var(--serif); font-weight: 700; font-size: 22px; letter-spacing: -0.025em; color: var(--ink); display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.tb__logo .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.tb__logo:hover { color: var(--ink); }
.tb__nav { display: flex; gap: 4px; margin-left: 18px; }
.tb__nav a { padding: 8px 14px; border-radius: var(--r-sm); font-size: 14px; font-weight: 600; color: var(--ink-2); }
.tb__nav a:hover { background: var(--bg-2); color: var(--ink-2); }
.tb__nav a.on, .tb__nav a.active { background: var(--bg-2); color: var(--ink); }
.tb__search {
  flex: 1; max-width: 480px; margin-left: auto;
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-2); border-radius: var(--r);
  padding: 10px 14px; font-size: 14px; color: var(--ink-3);
  transition: box-shadow 120ms;
}
.tb__search:focus-within { box-shadow: 0 0 0 2px var(--accent-soft); }
.tb__search input { flex: 1; border: none; background: none; outline: none; font: inherit; color: var(--ink); min-width: 0; }
.tb__search input::placeholder { color: var(--ink-3); }
.tb__search kbd { flex-shrink: 0; }
.tb__icons { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.tb__icon {
  width: 40px; height: 40px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-2); position: relative; transition: background 120ms;
}
.tb__icon:hover { background: var(--bg-2); color: var(--ink); }
.tb__icon .badge {
  position: absolute; top: 7px; right: 7px;
  background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700;
  border-radius: 8px; min-width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}
.tb__avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.tb__burger {
  display: none;
  width: 40px; height: 40px; border-radius: var(--r-sm);
  align-items: center; justify-content: center;
  color: var(--ink-2);
}
.tb__burger:hover { background: var(--bg-2); }

/* ---------- LIVE MARKET STRIP ---------- */

.live {
  background: var(--ink); color: #efe9dc;
  padding: 10px var(--page-pad);
  display: flex; align-items: center; gap: 24px;
  font-size: 13px; overflow: hidden; white-space: nowrap;
}
.live__pill {
  display: inline-flex; align-items: center; gap: 7px;
  color: #f5b58a; font-weight: 700; font-size: 11.5px;
  letter-spacing: 0.08em; text-transform: uppercase; flex-shrink: 0;
}
.live__pill .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #f28140;
  box-shadow: 0 0 0 0 rgba(242,129,64,0.7);
  animation: cc-pulse 2s infinite;
}
@keyframes cc-pulse {
  0% { box-shadow: 0 0 0 0 rgba(242,129,64,0.5); }
  70% { box-shadow: 0 0 0 8px rgba(242,129,64,0); }
  100% { box-shadow: 0 0 0 0 rgba(242,129,64,0); }
}
.live__track { display: flex; gap: 32px; align-items: center; flex: 1; overflow: hidden; color: #d6d2c8; }
.live__item { display: inline-flex; align-items: center; gap: 8px; }
.live__item b { color: #fff; font-weight: 600; }
.live__delta { font-weight: 600; }
.live__delta--down { color: #7ed2a0; }
.live__delta--up { color: #ef9b94; }

.brief-topbar-live {
  background: var(--ink); color: #efe9dc;
  padding: 8px var(--page-pad); font-size: 12.5px;
  display: flex; gap: 22px; align-items: center;
  overflow: hidden; white-space: nowrap;
}
.brief-topbar-live .dot { width: 6px; height: 6px; border-radius: 50%; background: #f28140; margin-right: 6px; display: inline-block; }
.brief-topbar-live b { color: #fff; font-weight: 600; }

/* ---------- BUTTONS ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px;
  font-weight: 600; font-size: 14px;
  font-family: var(--sans); line-height: 1;
  transition: transform 80ms, background 120ms, border-color 120ms, color 120ms;
  cursor: pointer; border: 1px solid transparent; text-decoration: none;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn.disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn--primary, .btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--primary:hover, .btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn--ghost, .btn-outline-secondary, .btn-outline-primary { background: var(--surface); border-color: var(--rule); color: var(--ink-2); }
.btn--ghost:hover, .btn-outline-secondary:hover, .btn-outline-primary:hover { border-color: var(--ink-3); color: var(--ink); background: var(--surface); }
.btn--soft { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-soft); }
.btn--soft:hover { background: var(--accent-soft-hover); color: var(--accent-ink); border-color: var(--accent-soft-hover); }
.btn-secondary { background: var(--bg-2); color: var(--ink-2); border-color: var(--bg-2); }
.btn-secondary:hover { background: var(--rule); color: var(--ink); }
.btn-danger { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn-danger:hover { background: #962e27; color: #fff; }
.btn-link { background: none; color: var(--accent-ink); padding: 11px 0; border-color: transparent; }
.btn-link:hover { color: var(--accent); text-decoration: underline; }
.btn--lg, .btn-lg { padding: 14px 26px; font-size: 15px; }
.btn--sm, .btn-sm { padding: 7px 14px; font-size: 13px; }
.btn--block, .btn-block { width: 100%; }
.btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,0.4); }
.btn-outline-light:hover { background: rgba(255,255,255,0.1); color: #fff; border-color: #fff; }
.btn-light { background: #fff; color: var(--ink); border-color: #fff; }
.btn-light:hover { background: var(--bg-2); color: var(--ink); }

.btn-close {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-2); color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; line-height: 1; padding: 0; border: none;
  transition: background 120ms;
}
.btn-close::before { content: "×"; font-size: 20px; font-weight: 400; }
.btn-close:hover { background: var(--rule); color: var(--ink); }
.btn-close-white { background: rgba(255,255,255,0.15); color: #fff; }
.btn-close-white:hover { background: rgba(255,255,255,0.3); color: #fff; }

/* ---------- CARDS ---------- */

.card {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--r-lg); padding: 22px;
}
.card--pad-lg { padding: 28px; }
.card--soft { background: var(--surface-soft); }
.card-body { padding: 22px; }
.card-header { padding: 16px 22px; border-bottom: 1px solid var(--rule-soft); font-weight: 600; }
.card-footer { padding: 16px 22px; border-top: 1px solid var(--rule-soft); }

/* ---------- TAGS / CHIPS / PILLS / BADGES ---------- */

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-2); color: var(--ink-2);
  padding: 4px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 500;
}
.tag--good { background: var(--good-soft); color: var(--good); }
.tag--accent { background: var(--accent-soft); color: var(--accent-ink); }
.tag--sky { background: var(--sky-soft); color: var(--sky); }
.tag--bad { background: var(--bad-soft); color: var(--bad); }
.tag--warn { background: var(--warn-soft); color: var(--warn); }
.tag--soft { background: var(--surface-soft); color: var(--ink-3); border: 1px solid var(--rule-soft); }
.tag--xs { font-size: 11px; padding: 3px 8px; }

.chip {
  background: var(--surface); border: 1px solid var(--rule);
  padding: 7px 13px; border-radius: 999px;
  font-size: 13px; color: var(--ink-2);
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer; transition: border-color 120ms, background 120ms, color 120ms;
}
.chip:hover { border-color: var(--ink-3); }
.chip.on, .chip--on, .chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .x { color: var(--ink-4); margin-left: 2px; }
.chip__x {
  background: none; border: none; color: rgba(255,255,255,0.7);
  font-size: 16px; line-height: 1; padding: 0 0 0 6px; cursor: pointer;
  transition: color 120ms;
}
.chip__x:hover { color: #fff; }
.chip:not(.on) .chip__x { color: var(--ink-4); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }

.badge {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: 6px;
  font-size: 11.5px; font-weight: 700;
  background: var(--bg-2); color: var(--ink-2);
  line-height: 1.3;
}
.badge.bg-danger, .bg-danger { background: var(--bad); color: #fff; }
.badge.bg-success, .bg-success { background: var(--good); color: #fff; }
.badge.bg-warning, .bg-warning { background: var(--warn); color: #fff; }
.badge.bg-primary, .bg-primary { background: var(--accent); color: #fff; }
.badge.bg-light, .bg-light { background: var(--bg-2); color: var(--ink-2); }

.savings-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--good-soft); color: var(--good);
  padding: 5px 11px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  white-space: nowrap;
}
.savings-pill.bad { background: var(--bad-soft); color: var(--bad); }
.savings-pill.warn { background: var(--warn-soft); color: var(--warn); }
.savings-pill.sky { background: var(--sky-soft); color: var(--sky); }

/* ---------- PRICE ---------- */

.price { font-family: var(--sans); font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.price--xl { font-size: 38px; line-height: 1; }
.price--lg { font-size: 28px; line-height: 1; }
.price--md { font-size: 20px; line-height: 1.1; }
.price--sm { font-size: 16px; line-height: 1.2; }
.price .unit { font-weight: 500; color: var(--ink-3); font-size: 0.6em; margin-left: 2px; }
.price-was { color: var(--ink-4); text-decoration: line-through; font-weight: 500; font-size: 0.85em; }

/* ---------- GRIDS ---------- */

.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.grid-gap-lg { gap: 24px; }
.grid-gap-sm { gap: 12px; }

/* Bootstrap-compat row/col shim for templates not yet migrated.
   Full 12-col grid shim — search results uses col-lg-3 (sidebar) + col-lg-9
   (results); without col-lg-9 the results pane collapsed to content width. */
.row { display: flex; flex-wrap: wrap; margin: 0 -9px; }
.row > [class*="col-"] { padding: 0 9px; }
.col, .col-auto { flex: 1 1 auto; max-width: 100%; }
.col-1  { flex: 0 0 8.333%;  max-width: 8.333%; }
.col-2  { flex: 0 0 16.666%; max-width: 16.666%; }
.col-3  { flex: 0 0 25%;     max-width: 25%; }
.col-4  { flex: 0 0 33.333%; max-width: 33.333%; }
.col-5  { flex: 0 0 41.666%; max-width: 41.666%; }
.col-6  { flex: 0 0 50%;     max-width: 50%; }
.col-7  { flex: 0 0 58.333%; max-width: 58.333%; }
.col-8  { flex: 0 0 66.666%; max-width: 66.666%; }
.col-9  { flex: 0 0 75%;     max-width: 75%; }
.col-10 { flex: 0 0 83.333%; max-width: 83.333%; }
.col-11 { flex: 0 0 91.666%; max-width: 91.666%; }
.col-12 { flex: 0 0 100%;    max-width: 100%; }
@media (min-width: 576px) {
  .col-sm-1  { flex: 0 0 8.333%;  max-width: 8.333%; }
  .col-sm-2  { flex: 0 0 16.666%; max-width: 16.666%; }
  .col-sm-3  { flex: 0 0 25%;     max-width: 25%; }
  .col-sm-4  { flex: 0 0 33.333%; max-width: 33.333%; }
  .col-sm-6  { flex: 0 0 50%;     max-width: 50%; }
  .col-sm-8  { flex: 0 0 66.666%; max-width: 66.666%; }
  .col-sm-9  { flex: 0 0 75%;     max-width: 75%; }
  .col-sm-12 { flex: 0 0 100%;    max-width: 100%; }
}
@media (min-width: 768px) {
  .col-md-1  { flex: 0 0 8.333%;  max-width: 8.333%; }
  .col-md-2  { flex: 0 0 16.666%; max-width: 16.666%; }
  .col-md-3  { flex: 0 0 25%;     max-width: 25%; }
  .col-md-4  { flex: 0 0 33.333%; max-width: 33.333%; }
  .col-md-5  { flex: 0 0 41.666%; max-width: 41.666%; }
  .col-md-6  { flex: 0 0 50%;     max-width: 50%; }
  .col-md-7  { flex: 0 0 58.333%; max-width: 58.333%; }
  .col-md-8  { flex: 0 0 66.666%; max-width: 66.666%; }
  .col-md-9  { flex: 0 0 75%;     max-width: 75%; }
  .col-md-10 { flex: 0 0 83.333%; max-width: 83.333%; }
  .col-md-12 { flex: 0 0 100%;    max-width: 100%; }
}
@media (min-width: 992px) {
  .col-lg-1  { flex: 0 0 8.333%;  max-width: 8.333%; }
  .col-lg-2  { flex: 0 0 16.666%; max-width: 16.666%; }
  .col-lg-3  { flex: 0 0 25%;     max-width: 25%; }
  .col-lg-4  { flex: 0 0 33.333%; max-width: 33.333%; }
  .col-lg-5  { flex: 0 0 41.666%; max-width: 41.666%; }
  .col-lg-6  { flex: 0 0 50%;     max-width: 50%; }
  .col-lg-7  { flex: 0 0 58.333%; max-width: 58.333%; }
  .col-lg-8  { flex: 0 0 66.666%; max-width: 66.666%; }
  .col-lg-9  { flex: 0 0 75%;     max-width: 75%; }
  .col-lg-10 { flex: 0 0 83.333%; max-width: 83.333%; }
  .col-lg-12 { flex: 0 0 100%;    max-width: 100%; }
}
@media (min-width: 1200px) {
  .col-xl-3  { flex: 0 0 25%;     max-width: 25%; }
  .col-xl-4  { flex: 0 0 33.333%; max-width: 33.333%; }
  .col-xl-6  { flex: 0 0 50%;     max-width: 50%; }
  .col-xl-8  { flex: 0 0 66.666%; max-width: 66.666%; }
  .col-xl-9  { flex: 0 0 75%;     max-width: 75%; }
}

/* ---------- SECTION HEAD ---------- */

.sec-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 18px; gap: 18px; flex-wrap: wrap; }
.sec-head__title { font-family: var(--serif); font-weight: 600; font-size: 28px; letter-spacing: -0.018em; margin: 0; color: var(--ink); }
.sec-head__sub { color: var(--ink-3); font-size: 14.5px; margin-top: 6px; }
.sec-head__more { color: var(--ink-2); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.sec-head__more:hover { color: var(--accent); }

/* ---------- ICONS ---------- */

/* All size variants share stroke+fill defaults so paths render as line-art
   regardless of which size class icons.js emits (it uses a single class like
   "ic-sm" without combining .ic). Without this group, paths default to
   fill:black + stroke:none and render as solid black blobs. */
.ic, .ic-sm, .ic-lg, .ic-xl {
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ic { width: 18px; height: 18px; }
.ic-sm { width: 14px; height: 14px; }
.ic-lg { width: 22px; height: 22px; }
.ic-xl { width: 28px; height: 28px; }

/* ---------- PRODUCT CARD ---------- */

.pcard {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--r-lg); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform 120ms, box-shadow 150ms, border-color 120ms;
  text-decoration: none; color: inherit; position: relative;
}
.pcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--ink-4); color: inherit; }
.pcard__img {
  aspect-ratio: 1.15/1; background: var(--bg-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-4); position: relative; overflow: hidden;
}
.pcard__img img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.pcard__img__placeholder { font-family: var(--serif); font-size: 42px; color: var(--ink-4); opacity: 0.4; }
.pcard__img--r { background: linear-gradient(135deg,#fbe6d5 0%,#f5c9a5 100%); }
.pcard__img--a { background: linear-gradient(135deg,#e4f1e8 0%,#c4ddc9 100%); }
.pcard__img--d { background: linear-gradient(135deg,#fbf3d6 0%,#ecd99a 100%); }
.pcard__img--k { background: linear-gradient(135deg,#e6edf7 0%,#c1cee0 100%); }
.pcard__flag {
  position: absolute; top: 14px; left: 14px;
  background: var(--accent); color: #fff;
  font-size: 11.5px; font-weight: 700;
  padding: 5px 10px; border-radius: 999px;
  letter-spacing: 0.02em;
}
.pcard__fav, .pcard__report {
  position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px;
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); font-size: 14px;
  cursor: pointer; transition: color 120ms, border-color 120ms;
}
.pcard__report { right: 56px; }
.pcard__fav:hover, .pcard__fav.active { color: var(--accent); border-color: var(--accent); }
.pcard__report:hover { color: var(--bad); border-color: var(--bad); }
.pcard__body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pcard__brand { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.pcard__name { font-size: 16px; font-weight: 600; line-height: 1.3; color: var(--ink); min-height: 42px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard__supp { font-size: 13px; color: var(--ink-3); }
.pcard__supp b { color: var(--ink-2); font-weight: 600; }
.pcard__price-row { display: flex; justify-content: space-between; align-items: flex-end; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--rule-soft); gap: 8px; }
.pcard__price { display: flex; flex-direction: column; gap: 3px; }
.pcard__price__big { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.pcard__price--quote { font-style: italic; color: var(--ink-3); font-weight: 500; font-size: 18px; }
.pcard__price__sub { font-size: 12.5px; color: var(--ink-3); }
.pcard__spark { margin-top: 10px; height: 22px; }

/* ---------- CATEGORY CARD ---------- */

.cat-card {
  padding: 0; overflow: hidden;
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  transition: transform 120ms, box-shadow 150ms, border-color 120ms;
}
.cat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--ink-4); color: inherit; }
.cat-card__art { aspect-ratio: 1.55/1; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.cat-card__art svg { width: 58%; height: 58%; }
.cat-card__body { padding: 18px 20px 20px; }
.cat-card__title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); margin: 0; }
.cat-card__meta { margin-top: 6px; font-size: 13.5px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.cat-card__spark { margin-top: 10px; height: 28px; display: block; }

/* ---------- SEARCH RESULTS / PROW ---------- */

/* Search-results page layout — 280px filter aside + 1fr results.
   Replaces Bootstrap .row > .col-lg-3+9 for results_partial.html. */
.search-layout { display: grid; grid-template-columns: 280px 1fr; gap: 28px; align-items: start; }
@media (max-width: 991px) {
  .search-layout { grid-template-columns: 1fr; }
  /* Below tablet — sidebar becomes drawer; hide unless .show is set by openMobileFilters */
  #filtersSidebarCol { display: none; }
  #filtersSidebarCol .filters-sidebar.show {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1050; background: var(--bg);
    overflow-y: auto; padding: 18px;
    box-shadow: 0 0 0 100vmax rgba(31,29,27,0.4);
  }
  #filtersSidebarCol .filters-sidebar.show ~ * { display: none; }
  /* When drawer is shown, force the col to display so its content is visible */
  #filtersSidebarCol:has(.filters-sidebar.show) { display: block; }
}
.search-empty { grid-column: 1 / -1; text-align: center; padding: 64px 24px; }

/* Search header — title + active-filter chips */
.search-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 24px; gap: 24px; flex-wrap: wrap; }
.search-header__title { min-width: 0; flex: 1 1 320px; }

.subbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0; margin-bottom: 18px;
  border-bottom: 1px solid var(--rule); gap: 16px; flex-wrap: wrap;
}
.crumbs { font-size: 13px; color: var(--ink-3); display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--ink-2); }
.crumbs .sep { color: var(--ink-4); }
.crumbs__current { color: var(--ink-2); }

/* Color utilities used by JS-rendered cards (avoid inline style="color:..."). */
.text-good { color: var(--good); }
.prow__meta-strike { color: var(--ink-4); }

/* Sortbar — replaces Bootstrap d-flex justify-between row */
.sortbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 14px; margin-bottom: 14px;
  background: var(--surface-soft); border: 1px solid var(--rule); border-radius: var(--r);
  font-size: 13px; flex-wrap: wrap;
}
.sortbar__left, .sortbar__right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sortbar__sort { display: inline-flex; align-items: center; gap: 6px; }
.sortbar__sort select, .sortbar select {
  padding: 6px 8px; border: none; background: none;
  font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; outline: none;
}
.sortbar__filter-count {
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 999px; padding: 1px 7px; margin-left: 4px;
}
.sortbar__mobile-filters { display: none; }
@media (max-width: 991px) {
  .sortbar__mobile-filters { display: inline-flex; }
}

/* Filter card extras */
.filter-card__count { color: var(--ink-4); font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; margin-left: 4px; }
.filter-card__admin-badge { background: var(--bad); color: #fff; font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 4px; margin-left: 6px; vertical-align: middle; }
.filter-card--admin h4 { color: var(--bad); }
.checkbox-list--tall { max-height: 320px; }

/* fopt — visual checkbox (hide native input, render fopt__cb) */
.fopt > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.fopt__cb-input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.fopt .fopt__cb { width: 16px; height: 16px; border: 1.6px solid var(--rule); border-radius: 4px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); transition: background 120ms, border-color 120ms; }
.fopt:hover .fopt__cb { border-color: var(--ink-3); }
.fopt.on .fopt__cb,
.fopt:has(.fopt__cb-input:checked) .fopt__cb {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.fopt.on .fopt__cb::after,
.fopt:has(.fopt__cb-input:checked) .fopt__cb::after {
  content: '✓'; font-size: 11px; font-weight: 700; line-height: 1;
}
.fopt--disabled { opacity: 0.45; cursor: not-allowed; }
.fopt--disabled:hover { color: var(--ink-2); }
.fopt__label { word-break: break-word; }
.fopt.hidden { display: none; }
.fopt:focus-within .fopt__cb { box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }

/* Filters header — clear + close (mobile) buttons */
.filters-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--rule-soft); }
.filters-clear, .filters-close {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: var(--r-sm);
  font-size: 12.5px; font-weight: 600; color: var(--ink-3);
  background: none; border: none; cursor: pointer;
  transition: color 120ms, background 120ms;
}
.filters-clear:hover, .filters-close:hover { color: var(--ink); background: var(--bg-2); }
.filters-close { display: none; }
@media (max-width: 991px) { .filters-close { display: inline-flex; } }

/* Price range inputs */
.price-input { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.price-input + .price-input { margin-top: 8px; }
.price-input__label { font-size: 12px; color: var(--ink-3); font-weight: 600; min-width: 18px; }
.price-input__field {
  flex: 1; min-width: 0; padding: 7px 10px;
  border: 1px solid var(--rule); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); font-size: 13px;
  font-family: var(--sans); outline: none;
  transition: border-color 120ms;
}
.price-input__field:focus { border-color: var(--accent); }
.price-inputs { display: flex; flex-direction: column; gap: 4px; }

/* Prow internals — link styling, supplementary cells */
.prow__name-link { color: var(--ink); text-decoration: none; }
.prow__name-link:hover { color: var(--accent); }
.prow__supp__link { color: var(--accent-ink); font-size: 12.5px; font-weight: 600; margin-top: 2px; }
.prow__supp__link:hover { color: var(--accent); }
.prow__price__big { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); }
.prow__price__sub { font-size: 12px; color: var(--ink-3); }
.prow__img__placeholder { font-family: var(--serif); font-size: 42px; color: var(--ink-4); opacity: 0.4; }
.prow__cta { display: flex; gap: 6px; margin-top: 8px; align-items: center; justify-content: flex-end; }

/* Stock pill */
.stock { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink-2); }
.stock__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); flex-shrink: 0; }
.stock--ok { color: var(--good); }
.stock--ok .stock__dot { background: var(--good); }
.stock--warn { color: var(--warn); }
.stock--warn .stock__dot { background: var(--warn); }
.stock--bad { color: var(--bad); }
.stock--bad .stock__dot { background: var(--bad); }

/* Favorite heart on prow image */
.prow__img { position: relative; }
.prow__img .favorite-btn {
  position: absolute; top: 8px; right: 8px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,0.92); border: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); cursor: pointer; padding: 0;
  transition: color 120ms, background 120ms, border-color 120ms;
}
.prow__img .favorite-btn:hover { color: var(--accent); border-color: var(--accent); }
.prow__img .favorite-btn.active { color: var(--accent); }
.prow__img .favorite-btn.active svg { fill: currentColor; }

/* Load-more + guest banner */
.search-loadmore { display: flex; justify-content: center; margin-top: 24px; }
.search-guest-banner { margin-top: 32px; }
.search-guest-banner__inner {
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--surface-soft) 100%);
  border: 1px solid var(--rule); border-radius: var(--r-lg);
  padding: 28px 24px; text-align: center;
}
.search-guest-banner__icons { display: flex; justify-content: center; gap: 14px; font-size: 22px; margin-bottom: 12px; }
.search-guest-banner h3 { margin: 0 0 6px; }
.search-guest-banner p { margin: 0 0 14px; }

.filter-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 18px; margin-bottom: 14px; }
.filter-card h4 { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 12px; font-weight: 700; font-family: var(--sans); }

/* Canonical .fopt rules live in the SEARCH RESULTS section (~line 911).
   The duplicate block here predated the visual-checkbox migration and is
   superseded — keep only the legacy fallback for non-Phase-3.2 callers. */
.fopt:hover { color: var(--ink); }

.price-slider { margin: 12px 0; }

.active-filter-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-soft); color: var(--accent-ink);
  padding: 5px 10px 5px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 500;
}
.active-filter-tag .x { cursor: pointer; font-size: 14px; line-height: 1; }

.prow, .search-row {
  display: grid;
  grid-template-columns: 140px 1fr 220px 200px;
  grid-template-areas: "img body supp price";
  gap: 18px; padding: 18px;
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--r-lg); margin-bottom: 12px;
  transition: border-color 120ms, box-shadow 120ms;
  align-items: center;
}
.prow__img { grid-area: img; }
.prow__body { grid-area: body; }
.prow__supp { grid-area: supp; }
.prow__price { grid-area: price; }
.prow:hover, .search-row:hover { border-color: var(--ink-4); box-shadow: var(--shadow-sm); }
.prow__img { aspect-ratio: 1/1; background: var(--bg-2); border-radius: var(--r); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.prow__img img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.prow__body { display: flex; flex-direction: column; gap: 6px; }
.prow__brand { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.prow__name { font-size: 16px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.prow__meta { font-size: 13px; color: var(--ink-3); display: flex; gap: 12px; flex-wrap: wrap; }
.prow__supp { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-3); }
.prow__supp b { color: var(--ink-2); font-weight: 600; }
.prow__supp__best { color: var(--good); font-weight: 600; font-size: 12.5px; }
.prow__supp__more { color: var(--ink-3); font-size: 12.5px; }
.prow__price { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

.plist { display: flex; flex-direction: column; gap: 12px; }

/* ---------- PAGINATION ---------- */

.pagination { display: flex; gap: 6px; justify-content: center; margin: 32px 0; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: 8px 14px; border: 1px solid var(--rule); border-radius: var(--r);
  font-size: 14px; font-weight: 600; color: var(--ink-2);
  background: var(--surface); min-width: 40px; text-align: center;
  transition: border-color 120ms, color 120ms, background 120ms;
}
.pagination a:hover { border-color: var(--ink-3); color: var(--ink); }
.pagination .active, .pagination a.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.pagination .disabled { opacity: 0.4; pointer-events: none; }

/* ---------- PRODUCT DETAIL ---------- */

.pd-layout { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; }
/* Canonical single-dash form; double-underscore `.pd__*` is alias for handoff compat. */
.pd-gallery, .pd__gallery { display: flex; flex-direction: column; gap: 12px; }
.pd-gallery__main, .pd__gallery__main {
  aspect-ratio: 1/1; background: var(--bg-2);
  border-radius: var(--r-lg); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.pd-gallery__main img, .pd__gallery__main img { width: 100%; height: 100%; object-fit: contain; padding: 22px; }
.pd-thumbs, .pd__thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.pd-thumb, .pd__thumb {
  aspect-ratio: 1/1; background: var(--bg-2); border: 2px solid transparent;
  border-radius: var(--r); overflow: hidden; cursor: pointer;
  transition: border-color 120ms;
}
.pd-thumb img, .pd__thumb img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.pd-thumb.on, .pd-thumb.active, .pd__thumb.on, .pd__thumb.active { border-color: var(--accent); }

.spec-row {
  display: flex; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--rule-soft);
  font-size: 14px;
}
.spec-row__label { color: var(--ink-3); }
.spec-row__value { color: var(--ink-2); font-weight: 600; }

.supp-row {
  display: grid;
  grid-template-columns: 40px 1fr auto auto auto auto;
  gap: 16px; padding: 14px 18px;
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--r-lg); margin-bottom: 8px; align-items: center;
  transition: border-color 120ms;
}
.supp-row:hover { border-color: var(--ink-4); }
.supp-row.best, .supp-row--best {
  border-left: 4px solid var(--accent);
  background: var(--good-soft);
  border-color: #b5d8c3;
}
.supp-row.best .supp-row__name, .supp-row--best .supp-row__name { color: var(--good); }
.supp-row__logo, .supp-logo { width: 40px; height: 40px; border-radius: var(--r); background: var(--bg-2); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--ink-2); }
.supp-row__name, .supp-name { font-weight: 600; color: var(--ink); }
.supp-row__meta, .supp-meta { font-size: 12.5px; color: var(--ink-3); }
.supp-row__price, .supp-price { font-weight: 700; font-size: 18px; color: var(--ink); }
.supp-price__sub { font-size: 12px; color: var(--ink-3); font-weight: 500; }

.price-history { width: 100%; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 22px; }
.price-history svg { width: 100%; height: auto; display: block; }

/* ---------- PRODUCT DETAIL PAGE (Phase 3.3) ---------- */

/* Hero — gallery + info, 1.15 / 1 ratio */
.pd-hero { padding: 16px 0 8px; position: relative; }
.pd-hero .pd-layout { display: grid; grid-template-columns: 1.15fr 1fr; gap: 56px; align-items: start; }
@media (max-width: 991px) { .pd-hero .pd-layout { grid-template-columns: 1fr; gap: 32px; } }

.pd-gallery__main { position: relative; }
@media (min-width: 992px) { .pd-gallery__main:not(.pd-gallery__main--empty) { cursor: zoom-in; } }
.pd-gallery__main--empty { cursor: default; }
.pd-gallery__main img { transition: transform 220ms ease, opacity 220ms ease; }
.pd-gallery__main:hover img.img-loaded { transform: scale(1.02); }
.pd-gallery__placeholder { font-family: var(--serif); font-size: 64px; color: var(--ink-4); opacity: 0.4; }
.pd-gallery__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.92); border: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-2); cursor: pointer; padding: 0;
  transition: color 120ms, background 120ms, border-color 120ms;
  z-index: 2;
}
.pd-gallery__nav:hover { color: var(--accent); border-color: var(--accent); }
.pd-gallery__nav--prev { left: 12px; }
.pd-gallery__nav--next { right: 12px; }
.pd-gallery__counter {
  position: absolute; bottom: 12px; right: 12px;
  background: rgba(31,29,27,0.7); color: #fff;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500;
}

/* Info panel */
.pd-info { display: flex; flex-direction: column; gap: 14px; }
.pd-info__tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pd-info__brand { text-decoration: none; }
.pd-info__title { font-size: 36px; line-height: 1.15; }
@media (max-width: 768px) { .pd-info__title { font-size: 28px; } }
.pd-info__avail { display: flex; }

/* Best price block — cream surface, serif Fraunces, primary CTA */
.pd-best {
  background: var(--surface-soft); border: 1px solid var(--rule);
  border-radius: var(--r-lg); padding: 22px 24px;
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px;
  margin-top: 4px;
}
@media (max-width: 720px) { .pd-best { grid-template-columns: 1fr; gap: 14px; } }
.pd-best__label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
.pd-best__price { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.pd-best__price .price-main {
  font-family: var(--serif); font-weight: 600;
  font-size: 44px; line-height: 1; letter-spacing: -0.025em; color: var(--ink);
}
.pd-best__price .price-vat { font-size: 13px; color: var(--ink-3); margin-left: 4px; vertical-align: super; }
.pd-best__price .price-on-request { font-size: 24px; font-weight: 600; font-style: italic; color: var(--ink-3); }
.pd-best__alt { font-size: 13px; }
.pd-best__sub { font-size: 13px; }
.pd-best__discount { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 14px; }
.pd-best__pack { font-size: 13px; margin: 4px 0 0; }
.pd-best__right { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; text-align: right; }
@media (max-width: 720px) { .pd-best__right { align-items: stretch; text-align: left; } }
.pd-best__shop { font-size: 13px; }
.pd-best__shop a { color: var(--ink-2); font-weight: 600; text-decoration: none; }
.pd-best__shop a:hover { color: var(--accent); }
.pd-best__updated { font-size: 12px; }

/* Variants block */
.pd-variants { background: var(--bg-2); border-radius: var(--r); padding: 14px; }
.pd-variants__title { font-weight: 600; font-size: 13px; color: var(--ink-3); margin-bottom: 10px; }
.pd-variants__chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* Secondary actions row */
.pd-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Admin scrape block */
.pd-admin { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px; background: var(--bg-2); border-radius: var(--r); }
.pd-admin__status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }

/* Savings callout */
.pd-savings {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--good-soft); color: var(--good);
  border-radius: var(--r); font-size: 14px; font-weight: 500;
}

/* Trust signals row (under info panel) */
.pd-trust { display: flex; flex-wrap: wrap; gap: 16px; padding-top: 12px; border-top: 1px solid var(--rule-soft); font-size: 12.5px; color: var(--ink-3); }
.pd-trust__item { display: inline-flex; align-items: center; gap: 6px; }

/* Anchor nav (sticky on scroll past hero) */
.anchor-nav {
  position: sticky; top: 0; z-index: 30;
  background: rgba(251,248,243,0.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  display: flex; gap: 4px; padding: 8px 0; margin: 24px 0 0;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  transform: translateY(-100%); opacity: 0;
  transition: transform 220ms ease, opacity 180ms ease;
}
.anchor-nav::-webkit-scrollbar { display: none; }
.anchor-nav--visible { transform: translateY(0); opacity: 1; }
.anchor-pill {
  padding: 8px 14px; font-size: 13.5px; font-weight: 600;
  color: var(--ink-3); text-decoration: none; white-space: nowrap;
  border-radius: var(--r-sm);
  transition: color 120ms, background 120ms;
}
.anchor-pill:hover { color: var(--ink-2); background: var(--bg-2); }
.anchor-pill.on { color: var(--ink); background: var(--bg-2); }

/* PD section spacing */
.pd-section { padding: 40px 0 8px; }

/* Supplier comparison table */
.pd-supp-list { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; }
.pd-supp-table { width: 100%; border-collapse: collapse; }
.pd-supp-table thead { background: var(--surface-soft); }
.pd-supp-table th {
  text-align: left; padding: 12px 16px; font-size: 12.5px; font-weight: 600;
  color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 1px solid var(--rule);
}
.pd-supp-table td { padding: 14px 16px; vertical-align: middle; border-bottom: 1px solid var(--rule-soft); font-size: 14px; }
.pd-supp-table tr:last-child td { border-bottom: none; }
.pd-supp-table tr.best td { background: var(--good-soft); }
.pd-supp-table tr.best td:first-child { box-shadow: inset 4px 0 0 var(--good); }
.pd-supp-table tr.current td { background: var(--accent-soft); }
.pd-supp-table tr.current td:first-child { box-shadow: inset 4px 0 0 var(--accent); }
.pd-supp-table__shop { display: flex; align-items: flex-start; gap: 12px; }
.pd-supp-table__shop > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pd-supp-table__shop .supp-name { font-weight: 600; color: var(--ink); text-decoration: none; }
.pd-supp-table__shop .supp-name:hover { color: var(--accent); }
.pd-supp-table__altname { font-size: 12.5px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-supp-table__price { font-weight: 700; font-size: 16px; color: var(--ink); }
.pd-supp-table__price--best { color: var(--good); }
.pd-supp-table__savings { color: var(--bad); font-size: 12.5px; font-weight: 600; }
.pd-supp-table .text-end { text-align: right; }
.pd-supp-table .text-center { text-align: center; }
@media (max-width: 720px) {
  .pd-supp-table thead { display: none; }
  .pd-supp-table tr { display: grid; grid-template-columns: 1fr auto; gap: 6px; padding: 14px 16px; border-bottom: 1px solid var(--rule-soft); }
  .pd-supp-table td { display: contents; padding: 0; border: none; }
  .pd-supp-table__verified { display: none; }
}

.pd-skeleton { padding: 14px 16px; }
.skeleton--row { height: 38px; margin-bottom: 8px; border-radius: var(--r); }

/* Description + specs grid */
.pd-details-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; }
@media (max-width: 991px) { .pd-details-grid { grid-template-columns: 1fr; gap: 24px; } }
.pd-desc { line-height: 1.65; color: var(--ink-2); font-size: 15px; }
.pd-desc.collapsed { max-height: 7em; overflow: hidden; position: relative; }
.pd-desc.collapsed::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3em; background: linear-gradient(transparent, var(--bg)); pointer-events: none; }
.pd-desc__toggle { margin-top: 8px; }
.pd-specs { margin: 0; }
.pd-specs code { background: var(--bg-2); padding: 2px 6px; border-radius: 4px; font-size: 13px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.pd-article-link { display: block; padding: 4px 0; color: var(--accent-ink); font-size: 13.5px; font-weight: 500; text-decoration: none; }
.pd-article-link:hover { color: var(--accent); }

/* Price history grid + stats */
.pd-history-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 991px) { .pd-history-grid { grid-template-columns: 1fr; } }
.pd-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 480px) { .pd-stats { grid-template-columns: 1fr; } }
.stat-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 14px 16px; }
.stat-card__label { font-size: 12px; }
.stat-card__value { font-family: var(--serif); font-weight: 600; font-size: 22px; color: var(--ink); margin-top: 2px; }
.stat-card__sub { font-size: 11.5px; }

/* Editorial context card (next to chart) — handoff dark-bg variant */
.pd-editorial { background: var(--ink); color: #fff; padding: 28px; border: none; }
.pd-editorial__eyebrow { color: #f5b58a; }
.pd-editorial__title { color: #fff; font-size: 24px; margin-top: 14px; }
.pd-editorial__lead { color: #d6d2c8; font-size: 14.5px; line-height: 1.55; margin: 14px 0 22px; }
.pd-editorial__cta { display: inline-flex; }

/* Reviews section */
.pd-reviews-rating { display: flex; align-items: center; gap: 14px; }
.pd-reviews-rating__num { font-family: var(--serif); font-weight: 600; font-size: 48px; line-height: 1; color: var(--ink); }

/* Price rating banner */
.pd-price-rating {
  padding: 12px 16px; border-radius: var(--r); margin-bottom: 16px;
  border: 1px solid var(--rule); background: var(--surface-soft);
  font-size: 14px;
}
.pd-price-rating--good { background: var(--good-soft); color: var(--good); border-color: rgba(46,122,77,0.3); }
.pd-price-rating--average { background: var(--warn-soft); color: var(--warn); border-color: rgba(185,133,27,0.3); }
.pd-price-rating--high { background: var(--bad-soft); color: var(--bad); border-color: rgba(181,58,50,0.3); }

/* Lightbox modal — .modal__dialog--lg moved further down (after the base
   .modal__dialog rule at ~line 1617) so its 1100px max-width wins the cascade. */
.modal__content--lightbox { background: rgba(31,29,27,0.95); border: none; padding: 0; position: relative; min-height: 60vh; display: flex; align-items: center; justify-content: center; }
.modal__close {
  position: absolute; top: 16px; right: 16px; z-index: 4;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.15); color: #fff; border: none;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background 120ms;
}
.modal__close:hover { background: rgba(255,255,255,0.25); }
.modal__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,0.15); color: #fff; border: none;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  z-index: 3;
}
.modal__nav:hover { background: rgba(255,255,255,0.25); }
.modal__nav--prev { left: 16px; }
.modal__nav--next { right: 16px; }
.modal__image { max-width: 90%; max-height: 80vh; object-fit: contain; display: block; }

/* Sticky mobile CTA — z-index above cookie banner (1070) so the conversion CTA
   is never occluded. When banner is visible, body.cc-active gives sticky-cta a
   bottom offset = banner height. */
.sticky-cta {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 1080;
  background: var(--surface); border-top: 1px solid var(--rule);
  padding: 10px 16px; padding-bottom: max(10px, env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform 220ms ease, bottom 180ms ease;
  display: none;
}
body.cc-active .sticky-cta { bottom: var(--cc-banner-h, 64px); }
@media (max-width: 991px) { .sticky-cta { display: block; } }
.sticky-cta--visible { transform: translateY(0); }
.sticky-cta__inner { display: flex; align-items: center; gap: 10px; max-width: 1320px; margin: 0 auto; }
.sticky-cta__price { flex: 1; font-family: var(--serif); font-weight: 600; font-size: 18px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.has-sticky-cta { padding-bottom: 72px; }

/* Toast styles live below in the cookie/notifications block (canonical .toast +
   .toast-success use border-left pattern, positioned via #toast-container). */

/* Text utilities — .text-good and .mt-6 already defined upstream (lines 885, 417).
   .text-bad / .text-warn diverge from existing .text-warning naming but match the
   --bad / --warn token convention; aliasing both names keeps JS injection safe. */
.text-bad, .text-danger { color: var(--bad); }
.text-warn { color: var(--warn); }

/* ---------- MARKET REPORT (Phase 3.7) ---------- */

.mr-hero { padding: 16px 0 8px; max-width: 720px; }
.mr-hero__title { line-height: 1.1; }
.mr-hero__lead { color: var(--ink-2); }

/* 4-up stat tiles — Fraunces big number, soft accent variants */
.mr-stat {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--r-lg); padding: 24px 22px;
  display: flex; flex-direction: column; gap: 6px;
  position: relative; overflow: hidden;
}
.mr-stat::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 4px;
  background: var(--accent);
}
.mr-stat--good::before { background: var(--good); }
.mr-stat--bad::before { background: var(--bad); }
.mr-stat--warn::before { background: var(--warn); }
.mr-stat__label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
.mr-stat__value { font-family: var(--serif); font-weight: 600; font-size: 36px; line-height: 1; color: var(--ink); letter-spacing: -0.02em; }
.mr-stat__unit { font-size: 16px; font-weight: 500; color: var(--ink-3); }
.mr-stat__hint { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }

/* Price distribution bar chart */
.mr-dist { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.mr-dist__row { display: grid; grid-template-columns: 140px 1fr 120px; gap: 16px; align-items: center; }
@media (max-width: 720px) { .mr-dist__row { grid-template-columns: 100px 1fr 80px; gap: 10px; } }
.mr-dist__label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.mr-dist__bar-wrap { background: var(--bg-2); border-radius: 999px; height: 12px; overflow: hidden; }
.mr-dist__bar {
  height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-ink));
  border-radius: 999px;
  transition: width 240ms ease;
}
.mr-dist__count { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: right; }

/* Overview spec list */
.mr-overview { margin-top: 18px; }

/* Methodology bullet list */
.mr-meth__list { padding-left: 18px; margin: 14px 0; line-height: 1.65; color: var(--ink-2); font-size: 14.5px; }
.mr-meth__list li { margin: 6px 0; }
.mr-meth__note { font-size: 13px; margin-top: 14px; }

/* CTA row */
.mr-cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; padding-top: 20px; border-top: 1px solid var(--rule); }

/* ---------- ARTICLE DETAIL (Phase 3.8) ---------- */

.article-hero { max-width: 720px; margin: 0 auto; padding: 16px 0 8px; text-align: left; }
.article-hero__title { font-size: 56px; line-height: 1.05; }
@media (max-width: 768px) { .article-hero__title { font-size: 40px; } }
@media (max-width: 480px) { .article-hero__title { font-size: 32px; } }
.article-hero__lead { color: var(--ink-2); }

.article-cover { max-width: 1100px; margin: 0 auto; padding: 0; }
/* aspect-ratio:16/9 + object-fit:cover crops portrait/square sources.
   Use contain + soft bg + bounded heights so non-16/9 covers stay intact. */
.article-cover img {
  width: 100%;
  max-height: 540px; min-height: 320px;
  background: var(--surface-soft);
  object-fit: contain;
  border-radius: var(--r-lg);
  display: block;
}
.article-cover figcaption { font-size: 13px; margin-top: 8px; text-align: center; }

/* Article body table styling — sanitize_html allows <table>; redesign it.
   Editorial tables are static prose, not data grids: thead uses --ink (darker)
   so the header tier reads above body cells; no hover affordance — tables
   aren't clickable and a hover state suggests interactivity that isn't there.
   Mobile: horizontal scroll wrapper so wide tables don't overflow .article. */
.article table { width: 100%; border-collapse: collapse; margin: 22px 0; font-size: 16px; }
.article thead th {
  text-align: left; padding: 10px 12px; font-weight: 700; color: var(--ink);
  background: var(--bg-2); border-bottom: 2px solid var(--rule);
}
.article tbody td { padding: 10px 12px; border-bottom: 1px solid var(--rule-soft); color: var(--ink-2); }
.article tbody tr:last-child td { border-bottom: none; }
@media (max-width: 720px) {
  .article table { font-size: 15px; display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* Inline product teaser inside article */
.article-products { max-width: 1100px; margin-left: auto; margin-right: auto; }
.article-products__card { padding: 28px 32px; }
@media (max-width: 720px) { .article-products__card { padding: 22px 18px; } }
.article-products__loading { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 24px; justify-content: center; }
.article-products__empty { grid-column: 1 / -1; padding: 24px; text-align: center; }

/* CTA strip at bottom of article */
.article-cta { max-width: 720px; margin: 40px auto 0; padding-top: 24px; border-top: 1px solid var(--rule); display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between; }

/* Pulse cards (pohyby_cen.html) — drop/rise variants */
.pulse-card {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--r-lg); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 8px;
  text-decoration: none; color: inherit;
  transition: transform 120ms, box-shadow 120ms, border-color 120ms;
}
.pulse-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--ink-4); color: inherit; }
.pulse-card--drop { border-left: 4px solid var(--good); }
.pulse-card--rise { border-left: 4px solid var(--bad); }
.pulse-card__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pulse-card__shop { font-size: 12.5px; }
.pulse-card__name { font-weight: 600; font-size: 14.5px; line-height: 1.35; color: var(--ink); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pulse-card__pricing { display: flex; align-items: baseline; gap: 10px; }
.pulse-card__curr { font-family: var(--serif); font-weight: 600; font-size: 22px; letter-spacing: -0.01em; }
.pulse-card__saving { font-size: 13px; font-weight: 600; }

/* Mobile reflow — stat tiles 2×2 at tablet, 1-col at phone */
@media (max-width: 768px) {
  .mr-stats .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .mr-stat__value { font-size: 30px; }
}
@media (max-width: 480px) {
  .mr-stats .grid-4 { grid-template-columns: 1fr; }
  .mr-stat__value { font-size: 28px; }
  .mr-dist__row { grid-template-columns: 1fr; gap: 6px; }
  .mr-dist__label { font-size: 13px; }
  .mr-dist__count { text-align: left; }
}

/* ---------- CATEGORY PAGE (Phase 3.4) ---------- */

/* Hero gradient banner */
.cat-hero {
  background: linear-gradient(135deg, var(--accent-soft), #f7d2bc);
  border-radius: var(--r-xl);
  padding: 40px 44px;
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px;
  align-items: center; margin-bottom: 24px;
}
@media (max-width: 991px) { .cat-hero { grid-template-columns: 1fr; padding: 32px 28px; } }
@media (max-width: 480px) { .cat-hero { padding: 24px 20px; } }
.cat-hero__title { font-size: 46px; line-height: 1.05; }
@media (max-width: 768px) { .cat-hero__title { font-size: 36px; } }
.cat-hero__lead { color: var(--ink-2); max-width: 520px; }
.cat-hero__tags { display: flex; flex-wrap: wrap; gap: 10px; }
.cat-hero__art { text-align: center; color: var(--accent-ink); }
.cat-hero__art svg { width: 85%; max-width: 280px; }
@media (max-width: 991px) { .cat-hero__art { display: none; } }

/* Sort bar with chips */
.cat-sortbar {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 14px; margin-bottom: 18px;
}
.cat-sortbar h2 { margin: 0; }

/* Filter aside + products grid. When no filter_facets, layout is single-col
   (avoids dead 280px column on desktop). */
.cat-grid-layout { display: grid; grid-template-columns: 280px 1fr; gap: 28px; align-items: start; }
.cat-grid-layout--no-aside { grid-template-columns: 1fr; }
@media (max-width: 991px) {
  .cat-grid-layout { grid-template-columns: 1fr; }
  .cat-filters { display: none; }
}

/* Top row of cheap products (mini thumb strip) */
.cat-toprow {
  background: var(--surface-soft); border: 1px solid var(--rule);
  border-radius: var(--r-lg); padding: 18px 20px; margin-bottom: 18px;
}
.cat-toprow__grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-top: 10px; }
@media (max-width: 768px) { .cat-toprow__grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .cat-toprow__grid { grid-template-columns: repeat(2, 1fr); } }
.cat-toprow__item {
  display: flex; flex-direction: column; gap: 4px;
  text-decoration: none; color: var(--ink-2);
  font-size: 12.5px; line-height: 1.3;
}
.cat-toprow__img { width: 100%; height: 80px; object-fit: contain; background: var(--surface); border-radius: var(--r-sm); padding: 6px; }
.cat-toprow__placeholder { width: 100%; height: 80px; background: var(--bg-2); border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; color: var(--ink-4); font-family: var(--serif); font-size: 28px; }
.cat-toprow__name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-toprow__price { color: var(--accent-ink); font-weight: 600; font-size: 13px; }

/* Pagination — altv2 buttons */
.cat-pagination { display: flex; justify-content: center; gap: 6px; margin-top: 32px; flex-wrap: wrap; align-items: center; }
.cat-pagination__current { background: var(--ink); color: #fff; font-weight: 700; padding: 7px 14px; border-radius: 999px; min-width: 36px; text-align: center; }
.cat-pagination__ellipsis { padding: 7px 6px; color: var(--ink-3); }

/* FAQ — native <details>/<summary> with chevron rotation */
.cat-faq__list { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.cat-faq__item {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--r-lg); padding: 0; overflow: hidden;
  transition: border-color 120ms;
}
.cat-faq__item[open] { border-color: var(--ink-4); }
.cat-faq__q {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 22px; cursor: pointer; list-style: none;
  font-weight: 600; font-size: 15px; color: var(--ink);
  transition: background 120ms;
}
.cat-faq__q::-webkit-details-marker { display: none; }
.cat-faq__q:hover { background: var(--bg-2); }
.cat-faq__chev { color: var(--ink-3); transition: transform 200ms ease; flex-shrink: 0; }
.cat-faq__item[open] .cat-faq__chev { transform: rotate(180deg); }
.cat-faq__a { padding: 0 22px 18px; color: var(--ink-2); font-size: 14.5px; line-height: 1.6; }

/* Article cards (related articles) */
.art-card {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--r-lg); padding: 22px;
  text-decoration: none; color: inherit;
  display: block;
  transition: transform 120ms, box-shadow 120ms, border-color 120ms;
}
.art-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--ink-4); color: inherit; }
.art-card__title { font-family: var(--serif); font-weight: 600; font-size: 19px; line-height: 1.25; color: var(--ink); margin: 0; }
.art-card__excerpt { font-size: 14px; line-height: 1.5; }

/* ---------- SUBCATEGORY (category screen) ---------- */

.subcat {
  display: flex; flex-direction: row; align-items: center; gap: 14px;
  padding: 18px; background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--r-lg);
  text-decoration: none; color: inherit;
  transition: transform 120ms, box-shadow 120ms, border-color 120ms;
}
.subcat:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--ink-4); color: inherit; }
.subcat__icon { width: 48px; height: 48px; border-radius: var(--r); background: var(--accent-soft); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.subcat__icon svg { width: 28px; height: 28px; }
.subcat__body { min-width: 0; flex: 1; }
.subcat__title { font-size: 15px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.subcat__count { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
/* Tonal palette rotation — cycles 4 backgrounds across grid for visual variety. */
.grid-4 .subcat:nth-child(4n+1) .subcat__icon { background: var(--accent-soft); color: var(--accent-ink); }
.grid-4 .subcat:nth-child(4n+2) .subcat__icon { background: var(--good-soft); color: var(--good); }
.grid-4 .subcat:nth-child(4n+3) .subcat__icon { background: var(--sky-soft); color: var(--sky); }
.grid-4 .subcat:nth-child(4n) .subcat__icon { background: var(--warn-soft); color: var(--warn); }

/* ---------- INVOICE UPLOAD ---------- */

.drop {
  border: 2px dashed var(--rule); border-radius: var(--r-lg);
  padding: 48px 32px; text-align: center; cursor: pointer;
  transition: border-color 150ms, background 150ms;
  background: var(--surface);
}
.drop:hover, .drop.dragover { border-color: var(--accent); background: #fff8ef; }
.drop__icon {
  width: 72px; height: 72px; background: var(--accent-soft); color: var(--accent);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
}
.drop__icon svg { width: 32px; height: 32px; }
.drop__title { font-size: 18px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.drop__sub { font-size: 14px; color: var(--ink-3); }

.inv-row {
  display: grid;
  grid-template-columns: 44px 1fr auto auto auto;
  gap: 14px; padding: 14px 18px;
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--r-lg); margin-bottom: 8px;
  align-items: center; text-decoration: none; color: inherit;
  transition: border-color 120ms;
}
.inv-row:hover { border-color: var(--ink-4); color: inherit; }
.inv-ic { width: 44px; height: 44px; border-radius: var(--r); background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.inv-name { font-weight: 600; color: var(--ink); font-size: 15px; }
.inv-meta { font-size: 12.5px; color: var(--ink-3); }
.inv-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600;
  background: var(--bg-2); color: var(--ink-2);
}
.inv-pill--saved { background: var(--good-soft); color: var(--good); }
.inv-pill--pending { background: var(--warn-soft); color: var(--warn); }
.inv-pill--error { background: var(--bad-soft); color: var(--bad); }

/* ---------- INVOICE RESULTS ---------- */

.invoice-hdr { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-xl); padding: 32px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center; }

.line-row {
  display: grid;
  grid-template-columns: 6px 40px 1fr auto auto auto auto;
  gap: 14px; padding: 14px 18px 14px 0;
  background: var(--surface); border: 1px solid var(--rule);
  border-left: none; border-radius: 0 var(--r-lg) var(--r-lg) 0;
  margin-bottom: 6px; align-items: center;
  position: relative; padding-left: 18px;
}
.line-row::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  border-radius: var(--r-lg) 0 0 var(--r-lg); background: var(--ink-4);
}
.line-row.saving::before { background: var(--good); }
/* `--accent` is the brand CTA color elsewhere on the page; reusing it for
   "overpay" sent two contradictory signals at once (CTA-friendly vs bad-news).
   Keep the bad-news rail on `--bad` so the stripe matches the red savings text. */
.line-row.overpay::before { background: var(--bad); }
.line-row.ok::before { background: var(--ink-4); }
.line-ic { width: 40px; height: 40px; border-radius: var(--r); background: var(--bg-2); display: flex; align-items: center; justify-content: center; color: var(--ink-3); }
.line-name { font-weight: 600; color: var(--ink); }
.line-sub { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.line-val { font-weight: 700; color: var(--ink); font-size: 15px; text-align: right; }
.line-val__sub { font-size: 12px; color: var(--ink-3); font-weight: 500; }

.mag-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 22px; display: flex; gap: 14px; }
.mag-ic { width: 44px; height: 44px; border-radius: var(--r); background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ---------- MARKET REPORTS ---------- */

.trend-row { display: grid; grid-template-columns: 40px 1fr 240px auto; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule-soft); align-items: center; }
.trend-row:last-child { border-bottom: none; }
.trend-ic { width: 40px; height: 40px; border-radius: var(--r); background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.spark { width: 240px; height: 40px; }

.stat { display: flex; flex-direction: column; gap: 6px; padding: 22px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); }
.stat__label { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.stat__num { font-family: var(--serif); font-weight: 600; font-size: 34px; letter-spacing: -0.02em; color: var(--ink); line-height: 1; }
.stat__sub { font-size: 13px; color: var(--ink-3); }

/* ---------- ARTICLE ---------- */

.article { max-width: 720px; margin: 0 auto; }
.article p.lead { font-size: 22px; line-height: 1.55; color: var(--ink); font-weight: 500; }
.article p { font-size: 18px; line-height: 1.7; color: var(--ink-2); margin: 18px 0; font-family: var(--sans); }
.article h2 { font-family: var(--serif); font-weight: 600; font-size: 32px; letter-spacing: -0.02em; color: var(--ink); margin: 44px 0 12px; line-height: 1.15; }
.article h3 { font-family: var(--serif); font-weight: 600; font-size: 22px; letter-spacing: -0.015em; color: var(--ink); margin: 32px 0 10px; }
.article ul, .article ol { padding-left: 22px; font-size: 18px; line-height: 1.7; color: var(--ink-2); }
.article ul li, .article ol li { margin: 8px 0; }
.article blockquote { border-left: 3px solid var(--accent); padding: 4px 0 4px 22px; margin: 28px 0; font-family: var(--serif); font-style: italic; font-size: 24px; line-height: 1.35; color: var(--ink); }
.article blockquote footer { font-family: var(--sans); font-style: normal; font-size: 14px; color: var(--ink-3); margin-top: 10px; font-weight: 500; }
.article a { color: var(--accent-ink); text-decoration: underline; text-decoration-color: var(--accent-soft); text-underline-offset: 3px; }
.article a:hover { color: var(--accent); }
.article img, .article figure { margin: 24px 0; }

.pullbox { background: var(--accent-soft); border-left: 4px solid var(--accent); padding: 22px 26px; border-radius: 0 var(--r-lg) var(--r-lg) 0; margin: 28px 0; font-size: 16px; color: var(--accent-ink); }
.figure { margin: 24px 0; }
.figure__caption { font-size: 13.5px; color: var(--ink-3); margin-top: 8px; text-align: center; }

.author-row { display: flex; gap: 14px; align-items: center; padding: 22px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin: 32px 0 0; }

/* ---------- QUOTE ---------- */

.quote { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-xl); padding: 40px 44px; position: relative; }
.quote__mark { font-family: var(--serif); font-size: 140px; line-height: 0.7; color: var(--accent-soft); position: absolute; top: 28px; left: 32px; font-weight: 700; user-select: none; pointer-events: none; }
.quote__text { font-family: var(--serif); font-weight: 500; font-size: 28px; line-height: 1.3; letter-spacing: -0.015em; color: var(--ink); max-width: 760px; position: relative; margin: 0; }
.quote__text em { background: linear-gradient(transparent 62%, var(--accent-soft) 62%); font-style: normal; padding: 0 3px; }
.quote__foot { display: flex; align-items: center; gap: 14px; margin-top: 28px; }
.quote__av { width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; font-family: var(--sans); }
.quote__name { font-weight: 700; color: var(--ink); font-size: 15px; }
.quote__meta { color: var(--ink-3); font-size: 13px; }
.quote-strip { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 20px; }
.mini-quote { background: var(--surface-soft); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 22px 24px; }
.mini-quote__num { font-family: var(--serif); font-weight: 600; font-size: 34px; letter-spacing: -0.02em; color: var(--accent); line-height: 1; }
.mini-quote__unit { font-size: 14px; color: var(--ink-3); margin-top: 2px; }
.mini-quote__text { font-size: 14px; line-height: 1.5; color: var(--ink-2); margin-top: 14px; }
.mini-quote__who { margin-top: 14px; font-size: 12.5px; color: var(--ink-3); }
.mini-quote__who b { color: var(--ink-2); font-weight: 600; }

/* ---------- AUTHOR ---------- */

.author { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.author__img { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.author__name { font-weight: 600; color: var(--ink); }
.author__meta { color: var(--ink-3); font-size: 12.5px; }

/* ---------- ARTICLE CARD ---------- */

.art-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column; transition: box-shadow 150ms, border-color 120ms; }
.art-card:hover { box-shadow: var(--shadow); border-color: var(--ink-4); color: inherit; }
.art-card__img { aspect-ratio: 16/9; background: linear-gradient(135deg, #fde9dd, #f7d2bc); display: flex; align-items: center; justify-content: center; position: relative; }
.art-card__img svg { width: 40%; height: 40%; opacity: 0.8; }
.art-card__img img { width: 100%; height: 100%; object-fit: cover; }
.art-card__body { padding: 20px 22px 22px; }
.art-card__tag { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-ink); }
.art-card__title { font-family: var(--serif); font-weight: 600; font-size: 20px; line-height: 1.25; margin: 8px 0 10px; color: var(--ink); }
.art-card__meta { color: var(--ink-3); font-size: 12.5px; }

.related-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 22px; display: flex; flex-direction: column; gap: 10px; }

/* ---------- SUPPLIER ---------- */

.supp-hero { display: grid; grid-template-columns: 140px 1fr auto; gap: 24px; align-items: center; padding: 32px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-xl); }
.supp-logo-big { width: 140px; height: 140px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-weight: 700; font-size: 52px; }

.tabbar { display: flex; gap: 0; border-bottom: 1px solid var(--rule); margin-bottom: 24px; overflow-x: auto; }
.tabbar a, .tabbar button { padding: 14px 20px; font-weight: 600; font-size: 14px; color: var(--ink-3); border-bottom: 2px solid transparent; transition: color 120ms, border-color 120ms; white-space: nowrap; }
.tabbar a:hover, .tabbar button:hover { color: var(--ink-2); }
.tabbar a.on, .tabbar a.active, .tabbar button.on, .tabbar button.active { color: var(--ink); border-color: var(--accent); }

.supp-line { display: grid; grid-template-columns: 40px 1fr auto auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--rule-soft); }
.supp-line:last-child { border-bottom: none; }
.supp-line__ic { width: 40px; height: 40px; border-radius: var(--r); background: var(--bg-2); display: flex; align-items: center; justify-content: center; }

.review { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.stars { display: inline-flex; gap: 2px; color: var(--warn); font-size: 14px; }
.stars .star { color: var(--ink-4); }
.stars .star.fill, .stars .star--fill { color: var(--warn); }

.rating-bar { display: grid; grid-template-columns: 40px 1fr 40px; gap: 10px; align-items: center; font-size: 13px; color: var(--ink-3); }
.rating-bar__track { height: 8px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.rating-bar__fill { height: 100%; background: var(--warn); }

.info-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 22px; }
.info-card h4 { font-family: var(--sans); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 12px; font-weight: 700; }
.info-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.info-card dt { color: var(--ink-3); }
.info-card dd { margin: 0; color: var(--ink-2); font-weight: 600; }
.info-card__body { font-size: 14px; line-height: 1.55; margin: 0; }
.info-card__links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.info-card__links a { color: var(--ink); text-decoration: none; font-weight: 600; }
.info-card__links a:hover { color: var(--accent); }

/* ---------- STEP card (homepage how-it-works) ---------- */

.step { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; }
.step__scene { aspect-ratio: 1.9/1; background: var(--surface-soft); border-bottom: 1px solid var(--rule); padding: 22px; position: relative; overflow: hidden; }
.step__body { padding: 22px 24px 26px; position: relative; }
.step__num { position: absolute; top: 18px; right: 22px; font-family: var(--serif); font-size: 48px; color: var(--bg-2); font-weight: 600; line-height: 1; }
.step__kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-ink); }
.step__title { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; margin: 6px 0 8px; }

/* ---------- FORM INPUTS ---------- */

.form-control, input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], input[type="tel"], input[type="url"], textarea, select {
  display: block; width: 100%;
  padding: 10px 14px; font-size: 14px; line-height: 1.5;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--r);
  transition: border-color 120ms, box-shadow 120ms;
  font-family: inherit;
}
.form-control:focus, input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-control.is-invalid, .input-error { border-color: var(--bad); }
.form-control.is-invalid:focus, .input-error:focus { box-shadow: 0 0 0 3px var(--bad-soft); }
.form-control-sm, .form-control.form-control-sm { padding: 7px 12px; font-size: 13px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.helper-text { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
.input-group { display: flex; gap: 0; }
.input-group .form-control { border-radius: var(--r) 0 0 var(--r); border-right: none; }
.input-group .btn { border-radius: 0 var(--r) var(--r) 0; }

.form-check { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.form-check-input { accent-color: var(--accent); cursor: pointer; width: 16px; height: 16px; }
.form-check-label { font-size: 14px; color: var(--ink-2); cursor: pointer; }

/* ---------- ALERTS / FLASH ---------- */

.alert {
  padding: 14px 18px; border-radius: var(--r); margin-bottom: 14px;
  background: var(--bg-2); color: var(--ink-2);
  border: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.alert-success { background: var(--good-soft); color: var(--good); border-color: rgba(46,122,77,0.2); }
.alert-danger { background: var(--bad-soft); color: var(--bad); border-color: rgba(181,58,50,0.2); }
.alert-warning { background: var(--warn-soft); color: var(--warn); border-color: rgba(185,133,27,0.2); }
.alert-info { background: var(--sky-soft); color: var(--sky); border-color: rgba(47,93,138,0.2); }
.alert-dismissible { padding-right: 44px; position: relative; }
.alert .btn-close { position: relative; flex-shrink: 0; }
.fade { transition: opacity 150ms ease-in-out; }
.fade.show { opacity: 1; }
.fade:not(.show) { opacity: 0; }

/* ---------- MODAL ---------- */

.modal {
  display: none; position: fixed; inset: 0;
  z-index: 1050; align-items: center; justify-content: center;
  padding: 20px;
}
.modal.show { display: flex; }
/* Backdrop sits absolute INSIDE the .modal flex container so click events on
   it can be detected (mobile: .modal-dialog covers full width, no flex gap
   left to receive direct clicks). z-index: 0 puts it behind the dialog
   (which gets z-index: 1051 below) so visual stack is unchanged. */
.modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(31,29,27,0.55); backdrop-filter: blur(2px);
  z-index: 0; cursor: pointer;
}
.modal-dialog, .modal__dialog {
  position: relative; z-index: 1051;
  background: var(--surface); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 480px;
  max-height: calc(100vh - 40px); overflow-y: auto;
  animation: cc-modal-in 200ms ease-out;
}
.modal-dialog-centered { margin: 0 auto; }
.modal-content { background: var(--surface); border-radius: var(--r-xl); padding: 0; }
.modal-header { padding: 22px 26px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: none; }
.modal-title { font-family: var(--serif); font-weight: 600; font-size: 22px; margin: 0; color: var(--ink); }
.modal-body { padding: 0 26px 22px; }
.modal-footer { padding: 14px 26px 22px; display: flex; justify-content: flex-end; gap: 10px; border: none; }
.modal-lg .modal-dialog { max-width: 800px; }
/* Lightbox uses --lg with wider max-width — must come AFTER base .modal__dialog rule
   above to win the cascade. */
.modal__dialog--lg { max-width: 1100px; }
.modal-xl .modal-dialog, .modal__dialog--xl { max-width: 1140px; }
body.modal-open { overflow: hidden; }
@keyframes cc-modal-in {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- DROPDOWN ---------- */

.dropdown { position: relative; display: inline-block; }
.dropdown-toggle { cursor: pointer; }
.dropdown-menu {
  display: none; position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 220px; background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 6px; z-index: 200;
  list-style: none; margin: 0;
}
.dropdown-menu.show { display: block; animation: cc-dropdown-in 150ms ease-out; }
.dropdown-menu-end { right: 0; left: auto; }
.dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; font-size: 14px; color: var(--ink-2);
  border-radius: var(--r-sm); text-decoration: none;
  cursor: pointer; transition: background 120ms;
}
.dropdown-item:hover { background: var(--bg-2); color: var(--ink); }
.dropdown-item.text-danger { color: var(--bad); }
.dropdown-item.text-danger:hover { background: var(--bad-soft); color: var(--bad); }
.dropdown-divider { height: 1px; background: var(--rule); margin: 6px 0; border: none; }
.dropdown-header { padding: 10px 14px 6px; font-size: 11px; color: var(--ink-3); letter-spacing: 0.05em; text-transform: uppercase; font-weight: 600; }
@keyframes cc-dropdown-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- COLLAPSE (accordion, mobile nav) ---------- */

.collapse { display: none; }
.collapse.show { display: block; }
.collapsing { display: block; overflow: hidden; transition: height 200ms ease; }

/* Topbar nav opts out of .collapse{display:none} on desktop. Both .tb__nav and
   .collapse have single-class specificity (0,1,0); without this 0,2,0 override
   the source-order .collapse rule wins and #tbNav is invisible above 768px. */
.tb__nav.collapse { display: flex; }
@media (max-width: 768px) {
  .tb__nav.collapse { display: none; }
  .tb__nav.collapse.show {
    display: flex; flex-direction: column; gap: 8px;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--rule);
    padding: 14px var(--page-pad); box-shadow: var(--shadow);
    z-index: 99;
  }
}

.accordion { display: flex; flex-direction: column; gap: 8px; }
.accordion-item { background: var(--surface-soft); border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; }
.accordion-header { margin: 0; }
.accordion-button {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 16px 20px; font-size: 15px; font-weight: 600;
  color: var(--ink); background: transparent; border: none; cursor: pointer; text-align: left;
  transition: background 120ms;
}
.accordion-button:hover { background: rgba(0,0,0,0.02); }
.accordion-button::after { content: ""; width: 14px; height: 14px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(-135deg); transition: transform 200ms; flex-shrink: 0; }
.accordion-button.collapsed::after { transform: rotate(45deg); }
.accordion-body { padding: 0 20px 20px; font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }

/* ---------- STATUS MODIFIERS ---------- */

.pos { color: var(--good); }
.neg { color: var(--bad); }
.ok { color: var(--good); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.sep { color: var(--ink-4); margin: 0 4px; }

/* ---------- SKELETON LOADER ---------- */

.skeleton { background: linear-gradient(90deg, var(--bg-2) 0%, var(--rule) 50%, var(--bg-2) 100%); background-size: 200% 100%; animation: cc-skeleton 1.4s ease-in-out infinite; border-radius: var(--r); }
@keyframes cc-skeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-text { height: 14px; border-radius: 4px; margin: 6px 0; }
.skeleton-title { height: 22px; width: 60%; border-radius: 4px; margin: 8px 0; }
.skeleton-img { aspect-ratio: 1.15/1; }
.loading-spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid var(--rule); border-top-color: var(--accent); border-radius: 50%; animation: cc-spin 700ms linear infinite; }
.spinner-border { display: inline-block; width: 20px; height: 20px; border: 2px solid var(--rule); border-right-color: transparent; border-radius: 50%; animation: cc-spin 700ms linear infinite; }
.spinner-border-sm { width: 14px; height: 14px; border-width: 2px; }
@keyframes cc-spin { to { transform: rotate(360deg); } }

/* ---------- EMPTY / ERROR STATES ---------- */

.empty-state, .error-state { background: var(--surface-soft); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 48px 32px; text-align: center; }
.empty-state__ic, .error-state__ic { width: 72px; height: 72px; margin: 0 auto 18px; background: var(--bg-2); color: var(--ink-3); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.error-state { background: var(--bad-soft); border-color: rgba(181,58,50,0.2); }
.error-state__ic { background: var(--surface); color: var(--bad); }
.empty-state__title, .error-state__title { font-family: var(--serif); font-weight: 600; font-size: 22px; margin: 0 0 8px; color: var(--ink); }
.empty-state__sub, .error-state__sub { color: var(--ink-3); max-width: 420px; margin: 0 auto 18px; }

/* ---------- TOAST ---------- */

#toast-container { position: fixed; top: 20px; right: 20px; z-index: 1080; display: flex; flex-direction: column; gap: 10px; max-width: 380px; pointer-events: none; }
#toast-container > * { pointer-events: auto; }
.toast { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 14px 18px; box-shadow: var(--shadow); font-size: 14px; color: var(--ink-2); animation: cc-toast-in 200ms ease-out; }
.toast-success { border-left: 4px solid var(--good); }
.toast-danger, .toast-error { border-left: 4px solid var(--bad); }
.toast-warning { border-left: 4px solid var(--warn); }
.toast-info { border-left: 4px solid var(--sky); }
@keyframes cc-toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ---------- USER AVATAR (legacy compat — auth menu trigger) ---------- */

.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }

/* ---------- COOKIE BANNER ---------- */

.cc-banner {
  position: fixed; bottom: 16px; left: 16px;
  max-width: 380px; width: calc(100vw - 32px);
  background: var(--ink); color: #e6e1d5;
  padding: 16px 18px;
  border-radius: var(--r-lg);
  z-index: 1070;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
@media (max-width: 480px) {
  .cc-banner { left: 12px; right: 12px; max-width: none; width: auto; padding: 14px 16px; }
}
.cc-banner-inner { display: flex; flex-direction: column; gap: 12px; }
.cc-banner-text { font-size: 13.5px; color: #d6d2c8; line-height: 1.55; flex: 1; min-width: 280px; margin: 0; }
.cc-banner-text a { color: #fff; text-decoration: underline; }
.cc-banner-text strong { color: #fff; }
.cc-banner-actions { display: flex; gap: 10px; flex-shrink: 0; justify-content: flex-end; }
/* Cookie banner buttons — readable on dark --ink background. */
.cc-banner__btn { padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: 13px; border: 1px solid transparent; cursor: pointer; transition: background 120ms, border-color 120ms; }
.cc-banner__btn--decline { background: transparent; color: #fff; border-color: rgba(255,255,255,0.45); }
.cc-banner__btn--decline:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.7); }
.cc-banner__btn--accept { background: #fff; color: var(--ink); border-color: #fff; }
.cc-banner__btn--accept:hover { background: var(--bg-2); }

/* Footer newsletter — readable on dark --ink background. */
.foot__newsletter-btn { background: rgba(255,255,255,0.08); color: #fff; border: 1px solid rgba(255,255,255,0.45); border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: 13px; cursor: pointer; transition: background 120ms, border-color 120ms; white-space: nowrap; }
.foot__newsletter-btn:hover { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.7); }
.foot__newsletter-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.foot__newsletter-input { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.25); color: #fff; padding: 7px 12px; border-radius: var(--r); font-size: 13px; flex: 1; min-width: 0; max-width: 220px; }
.foot__newsletter-input::placeholder { color: rgba(255,255,255,0.5); }
.foot__newsletter-input:focus { outline: none; border-color: rgba(255,255,255,0.6); background: rgba(255,255,255,0.12); box-shadow: none; }

/* ---------- VARIANT CHIPS (product card + detail) ---------- */

.variant-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface); font-size: 13px; color: var(--ink-2); cursor: pointer; transition: border-color 120ms, background 120ms, color 120ms; margin: 4px 4px 0 0; }
.variant-chip:hover { border-color: var(--ink-3); }
.variant-chip.active, .variant-chip--active { background: var(--ink); color: #fff; border-color: var(--ink); }
.variant-chip.variant-out-of-stock, .variant-chip.out-of-stock { opacity: 0.5; cursor: not-allowed; }
.variant-chip.variant-backorder { border-style: dashed; }
.variant-chip.variant-preorder { background: var(--warn-soft); color: var(--warn); }
.variant-swatch { display: inline-block; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--rule); cursor: pointer; transition: transform 120ms; margin: 4px 4px 0 0; }
.variant-swatch:hover { transform: scale(1.08); }
.variant-swatch.active { box-shadow: 0 0 0 2px var(--accent); transform: scale(1.08); }

/* ---------- FOOTER ---------- */

.foot, .lp-footer { background: var(--ink); color: #d6d2c8; padding: 36px var(--page-pad); margin-top: 64px; }
.foot__grid { max-width: var(--page-max); margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.foot__logo, .lp-footer-brand { font-family: var(--serif); font-weight: 700; font-size: 24px; color: #fff; display: flex; align-items: center; gap: 8px; }
.foot__logo .dot, .lp-footer-brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.foot__col h4 { color: #fff; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; margin: 0 0 12px; font-weight: 700; font-family: var(--sans); }
.foot__col a { display: block; padding: 5px 0; color: #bcb6a8; font-size: 14px; }
.foot__col a:hover { color: #fff; }
.foot__desc, .lp-footer-desc { color: #bcb6a8; font-size: 14px; margin: 12px 0 0; line-height: 1.55; }
.foot__bottom, .lp-footer-bottom { max-width: var(--page-max); margin: 24px auto 0; padding-top: 18px; border-top: 1px solid #2a2724; color: #8d8779; font-size: 12.5px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.lp-footer-links { list-style: none; padding: 0; margin: 0; }
.lp-footer-links li { margin: 5px 0; }
.lp-footer-links a { color: #bcb6a8; font-size: 14px; }
.lp-footer-links a:hover { color: #fff; }

/* ---------- REPORT ERROR BUTTON (in-card) ---------- */

.report-error-btn { background: none; border: none; color: var(--ink-4); font-size: 12px; cursor: pointer; padding: 4px 8px; border-radius: var(--r-sm); transition: color 120ms, background 120ms; }
.report-error-btn:hover { color: var(--bad); background: var(--bad-soft); }

/* ---------- LEGACY COMPAT (specific existing class names) ---------- */

.product-card { /* alias for .pcard; favorites.js closest() target. Grid placement inherited. */ }
.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--ink-4); }
.card-img-container { position: relative; }
.card-brand, .card-title { font-family: var(--sans); }
.card-brand { font-size: 12.5px; color: var(--ink-3); }
.card-title { font-size: 16px; font-weight: 600; color: var(--ink); }
.badge-stock, .badge-order { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700; }
.badge-stock { background: var(--good-soft); color: var(--good); }
.badge-order { background: var(--warn-soft); color: var(--warn); }
.img-loaded { /* marker class set by image fallback — no visual effect by default */ }

/* ---------- NAVBAR COMPAT (legacy templates still use .navbar-*) ---------- */

.navbar { padding: 14px var(--page-pad); background: var(--surface); border-bottom: 1px solid var(--rule); display: flex; align-items: center; gap: 18px; }
.navbar-brand { font-family: var(--serif); font-weight: 700; font-size: 22px; color: var(--ink); display: flex; align-items: center; gap: 8px; text-decoration: none; }
.navbar-brand:hover { color: var(--ink); }
.navbar-nav { display: flex; list-style: none; gap: 4px; margin: 0; padding: 0; }
.nav-item { list-style: none; }
.nav-link { padding: 8px 14px; border-radius: var(--r-sm); font-size: 14px; font-weight: 600; color: var(--ink-2); display: inline-block; }
.nav-link:hover, .nav-link.active { background: var(--bg-2); color: var(--ink); }
.navbar-toggler { width: 40px; height: 40px; border-radius: var(--r-sm); background: var(--bg-2); color: var(--ink-2); display: none; }
.navbar-toggler-icon { display: inline-block; width: 22px; height: 2px; background: currentColor; box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor; }
.navbar-collapse { display: flex; flex: 1; align-items: center; gap: 18px; }

/* ---------- PHASE 4 /recheck POLISH ---------- */

/* Center-aligned chip rows used in hero blocks (replaces inline
   style="justify-content: center;" across 5+ index templates). */
.chips--center { justify-content: center; }

/* Flush info-card — drops the inner padding so a wrapped table sits flush
   against rounded corners. Used by category_report top-5/buckets tables. */
.info-card--flush { padding: 0; overflow: hidden; }

/* Aria-busy spinner cue + small body utilities (replace inline font-size
   styles in author.html, pages/contact.html). */
.btn[aria-busy="true"] { cursor: progress; }
.body-sm { font-size: 13px; }
.body-xs { font-size: 12.5px; }

/* SR-only — conventional alias for visually-hidden, used by favorites
   modal textarea label. */
.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;
}

/* Modal BEM aliases — the base modal-* classes already styled in
   cutcost.css (line 1858-1862), but only `.modal-dialog ↔ .modal__dialog`
   was BEM-aliased. Aliasing the rest so future templates can use either
   convention without the surprise of "some are aliased, some aren't." */
.modal__content { background: var(--surface); border-radius: var(--r-xl); padding: 0; }
.modal__header { padding: 22px 26px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: none; }
.modal__title { font-family: var(--serif); font-weight: 600; font-size: 22px; margin: 0; color: var(--ink); }
.modal__body { padding: 0 26px 22px; }
.modal__footer { padding: 14px 26px 22px; display: flex; justify-content: flex-end; gap: 10px; border: none; }

/* ---------- CATEGORY REPORTS (Phase 4.14) ---------- */

/* Data tables on category report pages — flush against .info-card edges. */
.static-page-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.static-page-table thead th {
  text-align: left; padding: 12px 22px; font-weight: 700; color: var(--ink);
  background: var(--bg-2); border-bottom: 1px solid var(--rule);
  font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase;
}
.static-page-table tbody td { padding: 12px 22px; border-bottom: 1px solid var(--rule-soft); color: var(--ink-2); }
.static-page-table tbody tr:last-child td { border-bottom: none; }

/* ---------- STATIC PAGES + CONTACT FORM (Phase 4.11) ---------- */

/* Static pages (privacy/terms/cookies/about) — long-form prose layout */
.static-page { max-width: 720px; margin: 0 auto; }
.static-page section { margin-top: 32px; }
.static-page section:first-child { margin-top: 0; }
.static-page h2 {
  font-family: var(--serif); font-weight: 600; font-size: 24px; letter-spacing: -0.018em;
  color: var(--ink); margin: 0 0 14px;
}
.static-page h3 {
  font-family: var(--sans); font-weight: 700; font-size: 16px; letter-spacing: 0.01em;
  color: var(--ink); margin: 22px 0 10px; text-transform: none;
}
.static-page code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px;
  background: var(--bg-2); padding: 2px 6px; border-radius: 4px; color: var(--ink-2);
}
.static-page table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14px; }
.static-page thead th {
  text-align: left; padding: 10px 12px; font-weight: 700; color: var(--ink);
  background: var(--bg-2); border-bottom: 2px solid var(--rule);
}
.static-page tbody td { padding: 10px 12px; border-bottom: 1px solid var(--rule-soft); color: var(--ink-2); }
.static-page tbody tr:last-child td { border-bottom: none; }

/* Contact form — minimal, accessible */
.contact-form { max-width: 560px; margin: 0 auto; }
.form-row { margin-bottom: 18px; }
.form-label {
  display: block; margin-bottom: 6px;
  font-size: 14px; font-weight: 600; color: var(--ink);
}
.form-required { color: var(--bad); margin-left: 2px; }
.form-control {
  display: block; width: 100%;
  padding: 10px 14px; font-size: 14.5px; line-height: 1.5;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r);
  color: var(--ink); font-family: inherit;
  transition: border-color 120ms, box-shadow 120ms;
}
.form-control:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-control.is-invalid { border-color: var(--bad); }
.form-error { margin-top: 4px; font-size: 12.5px; color: var(--bad); min-height: 16px; }

.contact-direct { text-align: center; padding-top: 24px; border-top: 1px solid var(--rule); }
.contact-direct p { margin: 4px 0; }

/* ---------- FAQ + COMPARISON + ERROR (Phase 4.10, 4.5, 4.13) ---------- */

/* Chip size + sentiment modifiers used on comparison rows */
.chip--sm { padding: 4px 10px; font-size: 11.5px; }
.chip--good { background: var(--good-soft); color: var(--good); border-color: rgba(46,122,77,0.2); }
.chip--warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(185,133,27,0.2); }

/* FAQ accordion — native <details>/<summary> with chevron rotation */
.faq-list { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.faq-list__item {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--r-lg); overflow: hidden;
  transition: border-color 120ms;
}
.faq-list__item:hover { border-color: var(--ink-4); }
.faq-list__item[open] { border-color: var(--accent); }
.faq-list__question {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 20px;
  font-size: 16px; font-weight: 600; color: var(--ink);
}
.faq-list__question::-webkit-details-marker { display: none; }
.faq-list__chevron {
  flex-shrink: 0; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); transition: transform 200ms, color 120ms;
}
.faq-list__item[open] .faq-list__chevron { transform: rotate(180deg); color: var(--accent); }
.faq-list__answer {
  padding: 0 20px 18px;
  font-size: 15px; line-height: 1.6; color: var(--ink-2);
}
.faq-list__answer p:first-child { margin-top: 0; }
.faq-list__answer a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* Comparison page — price rozpetí strip + ranked rows */
.cmp-range {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--r-lg); padding: 18px 22px;
}
.cmp-range__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.cmp-range__label { font-weight: 600; font-size: 14px; color: var(--ink); }
.cmp-range__track {
  height: 10px; border-radius: 999px;
  background: linear-gradient(90deg, var(--good) 0%, var(--warn) 50%, var(--bad) 100%);
  position: relative;
}
.cmp-range__ends { display: flex; justify-content: space-between; margin-top: 8px; font-size: 13px; font-weight: 600; }

.cmp-list { display: flex; flex-direction: column; gap: 8px; }
.cmp-row {
  display: grid;
  grid-template-columns: 56px 80px 1fr 180px 140px;
  gap: 14px; align-items: center;
  padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  transition: box-shadow 150ms, border-color 120ms;
}
.cmp-row:hover { box-shadow: var(--shadow); border-color: var(--ink-4); }
.cmp-row--best { border-color: var(--good); background: var(--good-soft); }
.cmp-row__rank {
  width: 56px; height: 64px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-2); border-radius: var(--r);
  font-family: var(--serif); font-weight: 700; font-size: 16px;
  color: var(--ink-3); letter-spacing: 0.02em;
}
.cmp-row--best .cmp-row__rank { background: var(--good); color: #fff; }
.cmp-row__img {
  width: 80px; height: 80px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-soft); border-radius: var(--r);
  overflow: hidden;
}
.cmp-row__img img { max-width: 72px; max-height: 72px; object-fit: contain; }
.cmp-row__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cmp-row__name {
  font-size: 14.5px; font-weight: 600; color: var(--ink);
  text-decoration: none; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.cmp-row__name:hover { color: var(--accent); }
.cmp-row__meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; }
.cmp-row__price { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.cmp-row__price-big { font-weight: 700; font-size: 18px; color: var(--ink); letter-spacing: -0.01em; }
.cmp-row__price-sub { font-size: 12px; }
.cmp-row__diff { font-size: 12px; }
.cmp-row__cta { display: flex; flex-direction: column; gap: 6px; }

@media (max-width: 1024px) {
  .cmp-row {
    grid-template-columns: 48px 64px 1fr;
    grid-template-rows: auto auto;
    row-gap: 10px;
  }
  .cmp-row__price { grid-column: 2 / -1; align-items: flex-start; flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .cmp-row__cta { grid-column: 2 / -1; flex-direction: row; }
  .cmp-row__cta .btn { flex: 1; justify-content: center; }
}
@media (max-width: 480px) {
  .cmp-row { grid-template-columns: 40px 1fr; }
  .cmp-row__img { display: none; }
  .cmp-row__body { grid-column: 2 / -1; }
}

/* Error page — full-bleed state with code + actions */
.error-state--page {
  max-width: 560px; margin: 0 auto;
  background: var(--surface); border-color: var(--rule);
}
.error-state__code {
  display: block; margin-top: 8px;
  font-family: var(--serif); font-weight: 600; font-size: 56px; line-height: 1;
  color: var(--accent); letter-spacing: -0.02em;
}
.error-state__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ---------- INDEX GRIDS (Phase 4.1, 4.2, 4.6, 4.7) ---------- */

.grid-6 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1024px) { .grid-6 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 720px) { .grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 480px) { .grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }

.sec-head--row { flex-wrap: nowrap; align-items: center; }
.sec-head__link { color: inherit; text-decoration: none; }
.sec-head__link:hover { color: var(--accent); }

/* Generic entity card (brand / supplier / etc.) — avatar + name + meta + arrow */
.entity-card {
  display: flex; align-items: center; gap: 14px;
  min-width: 0; overflow: hidden;
  padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  text-decoration: none; color: inherit;
  transition: transform 120ms, border-color 120ms, box-shadow 150ms;
}
.entity-card:hover {
  transform: translateY(-2px);
  border-color: var(--ink-4);
  box-shadow: var(--shadow);
  color: inherit;
}
.entity-card__avatar {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: var(--r);
  background: var(--accent-soft); color: var(--accent-ink);
  font-family: var(--serif); font-weight: 700; font-size: 14px;
  letter-spacing: 0.02em;
  display: flex; align-items: center; justify-content: center;
}
.entity-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.entity-card__name {
  font-size: 14.5px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.entity-card__meta { font-size: 12.5px; }
.entity-card__arrow {
  color: var(--ink-4); font-size: 16px; flex-shrink: 0;
  transition: color 120ms, transform 120ms;
}
.entity-card:hover .entity-card__arrow { color: var(--accent); transform: translateX(2px); }
.entity-card--lg { padding: 18px 20px; gap: 16px; }
.entity-card--lg .entity-card__avatar { width: 56px; height: 56px; font-size: 16px; border-radius: var(--r-lg); }
.entity-card--lg .entity-card__name { font-size: 16px; }

/* Subcategory card — compact, icon-free, name-forward */
.subcat-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 14px;
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--r);
  text-decoration: none; color: inherit;
  transition: border-color 120ms, transform 120ms, box-shadow 150ms;
  min-height: 64px;
}
.subcat-card:hover {
  border-color: var(--accent); transform: translateY(-1px);
  box-shadow: var(--shadow); color: inherit;
}
.subcat-card__name { font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.subcat-card__meta { font-size: 11.5px; }

/* A-Z letter index for brands */
.letter-nav { display: flex; flex-wrap: wrap; gap: 6px; max-width: 1100px; margin: 0 auto; }
.letter-nav__item {
  min-width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 10px; font-size: 13.5px; font-weight: 700; letter-spacing: 0.02em;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r);
  color: var(--ink-2); text-decoration: none;
  transition: color 120ms, border-color 120ms, background 120ms;
}
.letter-nav__item:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

.brand-letter-group { scroll-margin-top: 90px; }
.brand-letter-group__heading {
  display: flex; align-items: baseline; gap: 12px;
  margin: 0; padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--serif); font-weight: 600; font-size: 24px; color: var(--ink);
}
.brand-letter-group__letter { color: var(--accent); }
.brand-letter-group__count { font-family: var(--sans); font-size: 13px; font-weight: 500; }

/* Empty-state CTA — bigger, marketing-style empty for anonymous favorites */
.empty-cta { padding: 48px 32px; text-align: center; max-width: 720px; margin: 0 auto; }
.empty-cta__ic {
  width: 72px; height: 72px; margin: 0 auto 18px;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.empty-cta__lead { max-width: 520px; margin-left: auto; margin-right: auto; }
.empty-cta__bullets {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: center;
  font-size: 13.5px; color: var(--ink-3);
}
.empty-cta__bullets li { display: inline-flex; align-items: center; gap: 6px; }
.empty-cta__check { color: var(--good); font-weight: 700; }
.empty-cta__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ---------- SUPPLIER PROFILE (Phase 3.9) ---------- */

.supp-hero__body { display: flex; flex-direction: column; min-width: 0; }
.supp-hero__title { color: var(--ink); margin: 0; }
.supp-hero__lead { color: var(--ink-2); }
.supp-hero__meta { display: flex; gap: 8px; flex-wrap: wrap; }
.supp-hero__cta { white-space: nowrap; }

.supp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
  gap: 28px;
  align-items: start;
}
.supp-grid__main { min-width: 0; }
.supp-grid__side { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 0; }

.supp-avail { margin-top: 12px; }

@media (max-width: 1024px) {
  .supp-grid { grid-template-columns: 1fr; }
  .supp-grid__side { position: static; }
}
@media (max-width: 768px) {
  .supp-hero { grid-template-columns: 80px 1fr; padding: 22px; gap: 18px; }
  .supp-logo-big { width: 80px; height: 80px; font-size: 32px; }
  .supp-hero__cta { grid-column: 1 / -1; justify-self: stretch; text-align: center; justify-content: center; }
}

/* ---------- UPLOAD (Phase 3.5) ---------- */

.upload-hero { max-width: 720px; margin: 0 auto; text-align: center; }
.upload-hero__title { color: var(--ink); }
.upload-hero__lead { color: var(--ink-2); }

.upload-form { max-width: 720px; margin-left: auto; margin-right: auto; }
.upload-form__hint { font-size: 13.5px; text-align: center; }

.drop:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.drop--dragover { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.005); }

.file-chip {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--r-lg);
}
.file-chip__ic {
  width: 40px; height: 40px; flex-shrink: 0;
  border-radius: var(--r); background: var(--accent-soft);
  color: var(--accent); display: flex; align-items: center; justify-content: center;
}
.file-chip__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.file-chip__name { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip__size { font-size: 12.5px; }
.file-chip__close {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: var(--r); background: transparent;
  color: var(--ink-3); font-size: 22px; line-height: 1;
  border: 1px solid var(--rule); cursor: pointer;
  transition: color 120ms, border-color 120ms;
}
.file-chip__close:hover { color: var(--bad); border-color: var(--bad); }

.upload-progress {
  padding: 18px 22px; background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--r-lg);
}
.upload-progress__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.upload-progress__label { font-weight: 600; color: var(--ink); }
.upload-progress__track { height: 6px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.upload-progress__fill {
  height: 100%; background: var(--accent); border-radius: 999px;
  transition: width 320ms ease-out;
}
.upload-progress__text { margin-top: 8px; font-size: 13px; }

.alert .ic { flex-shrink: 0; margin-right: 4px; }

/* How it works — 3-step visual */
.how-it-works { max-width: 1100px; margin-left: auto; margin-right: auto; }
.how-step {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--r-lg); padding: 24px 22px;
  display: flex; flex-direction: column; gap: 10px;
}
.how-step__num {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-family: var(--serif); font-weight: 700; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.how-step__title { font-size: 17px; font-weight: 700; color: var(--ink); margin: 0; }

/* Trust strip */
.upload-trust { max-width: 1100px; margin-left: auto; margin-right: auto; }
.trust-card {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--r-lg); padding: 22px;
  display: flex; flex-direction: column; gap: 10px;
}
.trust-card__ic {
  width: 44px; height: 44px; border-radius: var(--r);
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.trust-card__title { font-size: 16px; font-weight: 700; color: var(--ink); margin: 0; }

/* ---------- INVOICE RESULTS (Phase 3.6) ---------- */

.upload-results { max-width: 1320px; margin-left: auto; margin-right: auto; }

.invoice-hero {
  text-align: center; padding: 32px 24px;
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--r-xl);
}
.invoice-hero__big { color: var(--ink); }
.invoice-hero__num {
  font-family: var(--serif); font-weight: 600;
  font-size: 64px; line-height: 1; letter-spacing: -0.02em;
  color: var(--ink); margin-top: 12px;
}
/* Color the big number by sentiment so a "you overpaid" outcome doesn't render
   in the same friendly accent-orange used by every CTA on the page. */
.invoice-hero--saving .invoice-hero__num { color: var(--good); }
.invoice-hero--overpay .invoice-hero__num { color: var(--bad); }
.invoice-hero--neutral .invoice-hero__num { color: var(--ink-3); }

.invoice-table {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--r-lg); padding: 8px 0;
}
.invoice-table__head {
  display: grid;
  grid-template-columns: 2fr 2fr 1fr 1fr 1fr 110px;
  gap: 14px; padding: 12px 18px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-3);
  border-bottom: 1px solid var(--rule-soft);
}
.invoice-table .line-row {
  display: grid;
  grid-template-columns: 2fr 2fr 1fr 1fr 1fr 110px;
  gap: 14px; align-items: center;
  padding: 14px 18px; margin-bottom: 0;
  background: transparent; border: none;
  border-radius: 0; border-bottom: 1px solid var(--rule-soft);
  position: relative;
}
.invoice-table .line-row:last-child { border-bottom: none; }
.invoice-table .line-row::before { left: 0; border-radius: 0; }

.line-row__name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.line-row__name strong { color: var(--ink); font-weight: 600; }
.line-row__sub { font-size: 12.5px; }
.line-row__match { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.line-row__link { color: var(--ink); text-decoration: none; font-weight: 600; }
.line-row__link:hover { color: var(--accent); }
.line-row__val { font-weight: 600; color: var(--ink); font-size: 14.5px; }
.line-row__conf { display: flex; align-items: center; }
.line-row__action { display: flex; align-items: center; justify-content: center; }

.conf-pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em;
  background: var(--bg-2); color: var(--ink-3);
}
.conf-pill--high { background: var(--good-soft); color: var(--good); }
.conf-pill--mid { background: var(--sky-soft); color: var(--sky); }
.conf-pill--low { background: var(--warn-soft); color: var(--warn); }

.skipped-list summary {
  cursor: pointer; padding: 12px 0;
  font-size: 13.5px; list-style: none;
}
.skipped-list summary::-webkit-details-marker { display: none; }
.skipped-list summary::before {
  content: "›"; display: inline-block;
  margin-right: 8px; transition: transform 200ms;
}
.skipped-list[open] summary::before { transform: rotate(90deg); }
.skipped-list__body {
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px 18px; font-size: 13.5px;
  background: var(--bg-2); border-radius: var(--r);
}

.ta-r { text-align: right; }
.ta-c { text-align: center; }

@media (max-width: 1024px) {
  .invoice-table__head, .invoice-table .line-row {
    grid-template-columns: 1.6fr 1.4fr 1fr 1fr 90px 90px;
    gap: 10px; padding-left: 14px; padding-right: 14px;
  }
}
@media (max-width: 720px) {
  .invoice-hero { padding: 24px 16px; }
  .invoice-hero__num { font-size: 40px; }
  .invoice-table { padding: 0; }
  .invoice-table__head { display: none; }
  /* Mobile: single column. Each cell takes its own row so the conf pill and
     "Ověřit" action button don't collide on similar rows (which have 6 slots
     to the saving/overpay row's 5). */
  .invoice-table .line-row {
    grid-template-columns: 1fr;
    gap: 6px; padding: 14px 16px;
  }
  .invoice-table .line-row > * { grid-column: 1 / -1; }
  .line-row__match { font-size: 13.5px; }
  .line-row__val.ta-r { text-align: left; }
  .line-row__conf, .line-row__action { justify-self: flex-start; }
  .line-row__action .btn { width: 100%; justify-content: center; }
}

/* ---------- RESPONSIVE BREAKPOINTS ---------- */

@media (max-width: 1200px) {
  :root { --page-pad: 20px; }
  .h-display { font-size: 48px; }
  .h-1 { font-size: 36px; }
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) {
  .pd-layout { grid-template-columns: 1fr; gap: 24px; }
  .invoice-hdr { grid-template-columns: 1fr; }
  .quote-strip { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
  .foot__grid { grid-template-columns: 1fr 1fr 1fr; gap: 24px; }
  .foot__col:first-child { grid-column: 1 / -1; }
  /* Tablet: 3-col grid — img + body span 2 rows; supp + price stack right column. */
  .prow, .search-row {
    grid-template-columns: 120px 1fr;
    grid-template-areas:
      "img body"
      "img supp"
      "price price";
    align-items: start;
  }
  .prow__price { text-align: left; align-items: flex-start; padding-top: 12px; border-top: 1px solid var(--rule-soft); margin-top: 4px; }
  .prow__cta { justify-content: flex-start; }
  .trend-row { grid-template-columns: 40px 1fr 180px auto; }
  .spark { width: 180px; }
  .supp-hero { grid-template-columns: 100px 1fr; }
  .supp-hero > :last-child { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  :root { --page-pad: 16px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .h-display { font-size: 40px; }
  .h-1 { font-size: 32px; }
  .h-2 { font-size: 26px; }
  .tb__nav { display: none; }
  .tb__burger { display: flex; }
  .tb__search { order: 3; width: 100%; max-width: none; margin-left: 0; }
  .tb__search kbd { display: none; }
  .quote { padding: 28px 24px; }
  .quote__mark { font-size: 100px; top: 20px; left: 18px; }
  .quote__text { font-size: 22px; }
  .invoice-hdr { padding: 22px; }
  .stat { padding: 18px; }
  .stat__num { font-size: 28px; }
  .article p.lead { font-size: 19px; }
  .article p, .article ul, .article ol { font-size: 16px; }
  .article h2 { font-size: 26px; margin-top: 32px; }
  .article h3 { font-size: 19px; }
}

@media (max-width: 720px) {
  /* Phone: image+title row, then meta, then supp, then price+CTA. Image first
     so the user identifies the product before seeing the price. */
  .prow, .search-row {
    grid-template-columns: 100px 1fr;
    grid-template-areas:
      "img body"
      "supp supp"
      "price price";
    gap: 12px;
  }
  .prow__price { text-align: left; align-items: flex-start; }
  .prow__cta { justify-content: flex-start; }
  .pcard__img { aspect-ratio: 1/1; }
  .filter-card { padding: 14px; }
  .subbar { flex-direction: column; align-items: flex-start; }
  .supp-row { grid-template-columns: 40px 1fr auto; gap: 10px; }
  .supp-row__meta { grid-column: 2 / -1; grid-row: 2; }
  .line-row { grid-template-columns: 6px 40px 1fr auto; }
  .line-row__alt, .line-val__sub { grid-column: 3 / -1; }
  .tabbar { margin-bottom: 18px; }
  .foot__grid { grid-template-columns: 1fr 1fr; }
  .cc-banner-inner { flex-direction: column; align-items: stretch; }
  .cc-banner-actions { justify-content: flex-end; }
}

@media (max-width: 480px) {
  :root { --page-pad: 14px; }
  .grid-4 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .h-display { font-size: 34px; }
  .h-1 { font-size: 28px; }
  .h-2 { font-size: 22px; }
  .price--xl { font-size: 30px; }
  .price--lg { font-size: 24px; }
  .foot__grid { grid-template-columns: 1fr; }
  .modal-dialog, .modal__dialog { max-width: 100%; }
  .quote-strip { grid-template-columns: 1fr; }
  .pd-thumbs { grid-template-columns: repeat(4, 1fr); }
  .btn--lg { padding: 12px 22px; font-size: 14px; }
}

/* ---------- PRINT ---------- */

@media print {
  .tb, .foot, .cc-banner, #toast-container, .tb__burger, .modal { display: none !important; }
  body { background: #fff; color: #000; }
  .page { padding: 0; max-width: 100%; }
}

/* ---------- REDUCED MOTION ---------- */

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