/* Parity — Alternatives Finder (synthetic demo). Plain CSS, no framework. */

:root {
  --navy-900: #002C58; /* primary header and main headings */
  --navy-800: #073B70; /* hover and secondary dark surfaces */
  --blue-500: #277CB5; /* primary interactive accents */
  --blue-100: #E8F2F9; /* selected rows and subtle highlights */
  --surface: #FFFFFF;
  --background: #F5F8FB;
  --border: #D9E3EC;
  --text: #172B40;
  --muted: #61758A;
  --success: #217A58;
  --warning: #A86416;
  --danger: #B43E45;

  --success-bg: #E5F2EC;
  --neutral-bg: #EEF2F6;
  --border-strong: #BFCFDD;

  --font-sans: "Avenir Next", Avenir, "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue", Helvetica, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(0, 44, 88, 0.06);
  --shadow-lg: 0 24px 60px -20px rgba(0, 44, 88, 0.35);
  --focus: 0 0 0 3px #FFFFFF, 0 0 0 5px var(--blue-500);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--background);
  font-feature-settings: "tnum" 1, "lnum" 1;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { color: var(--navy-900); margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 19px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
a { color: var(--blue-500); text-underline-offset: 2px; }
a:hover { color: var(--navy-800); }
button, input, select { font: inherit; color: inherit; }
code { font-family: var(--font-mono); font-size: 0.92em; }
[hidden] { display: none !important; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }

.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; left: 12px; top: -48px; z-index: 100;
  background: var(--surface); color: var(--navy-900); padding: 8px 14px; border-radius: var(--radius-sm); font-weight: 600;
}
.skip-link:focus { top: 12px; }

/* ----------------------------------------------------------------- Top bar */

.topbar {
  position: sticky; top: 0; z-index: 20; height: 64px;
  display: flex; align-items: center; gap: 16px; padding: 0 32px;
  background: var(--navy-900); color: #FFFFFF;
}
.brand { display: flex; align-items: center; gap: 12px; color: #FFFFFF; text-decoration: none; }
.brand:hover { color: #FFFFFF; }
.brand:focus-visible { box-shadow: 0 0 0 2px var(--navy-900), 0 0 0 4px #7FB6DC; }
.brand-mark { width: 36px; height: 36px; flex: none; }
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.brand-sub { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #9FC3E0; padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, 0.2); }
.demo-badge {
  margin-left: auto; white-space: nowrap; font-size: 12px; font-weight: 600; color: #DCE8F3;
  padding: 5px 10px; border-radius: 999px; border: 1px dashed rgba(255, 255, 255, 0.4);
}

.view { padding: 32px 32px 80px; max-width: 1200px; width: 100%; margin: 0 auto; }
.view:focus, .view:focus-visible { outline: none; box-shadow: none; }

/* ------------------------------------------------------------ Page header */

.page-head { margin-bottom: 20px; }
.page-head p { color: var(--muted); margin-top: 6px; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; text-decoration: none; margin-bottom: 16px; }
.back svg { width: 16px; height: 16px; }

/* ---------------------------------------------------------------- Buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--navy-900); font-weight: 650; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--navy-800); color: var(--navy-800); }
.btn svg { width: 16px; height: 16px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-primary { background: var(--navy-900); border-color: var(--navy-900); color: #FFFFFF; }
.btn-primary:hover { background: var(--navy-800); border-color: var(--navy-800); color: #FFFFFF; }
.link-btn { background: none; border: 0; padding: 0; color: var(--blue-500); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-btn:hover { color: var(--navy-800); }

/* ------------------------------------------------------------- Small bits */

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 650; white-space: nowrap; background: var(--neutral-bg); color: var(--navy-800);
}
.chip svg { width: 14px; height: 14px; }
.chip-match { background: var(--success-bg); color: var(--success); }
.chip-count { background: var(--blue-100); color: var(--navy-800); }

.bool { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; }
.bool svg { width: 16px; height: 16px; }
.bool.yes { color: var(--success); }
.bool.no { color: var(--muted); }
.bool.unknown { color: var(--muted); font-style: italic; font-weight: 500; }

.sku {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 12.5px; font-weight: 600;
  color: var(--navy-800); background: var(--blue-100); border: 1px solid #D4E5F2; border-radius: 5px; padding: 1px 7px;
  letter-spacing: 0.02em; white-space: nowrap;
}
.sku button { border: 0; background: none; padding: 0; color: var(--blue-500); cursor: pointer; display: inline-flex; }
.sku button svg { width: 14px; height: 14px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { white-space: nowrap; }

.thumb { display: block; flex: none; border-radius: 8px; overflow: hidden; background: var(--blue-100); }
.thumb svg { display: block; width: 100%; height: 100%; }

/* Product photo placeholders (no real photos yet) */
.photo-ph {
  display: grid; place-content: center; justify-items: center; gap: 6px; text-align: center;
  background: repeating-linear-gradient(135deg, #F4F8FB 0 8px, #EAF1F7 8px 16px);
  border: 1.5px dashed #9DB8CF; color: #5A7590; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; line-height: 1.15;
}
.photo-ph svg { width: 34%; height: auto; opacity: .7; }
.photo-ph-text { display: grid; }
.photo-ph-sm { font-size: 8px; letter-spacing: .04em; border-width: 1px; }
.photo-ph-md { font-size: 9px; gap: 3px; }
.photo-ph-md svg { width: 30%; }
.photo-ph-lg { font-size: 12px; gap: 8px; }
.photo-ph-lg svg { width: 28%; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.card-head p { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* ---------------------------------------------------------------- Filters */

.search-row { display: flex; gap: 12px; padding: 18px 22px; align-items: center; }
.search-row .search-field { flex: 1; }
.search-row input[type="search"] { height: 46px; font-size: 16px; }
.search-row .search-field svg { bottom: 14px; }
.advanced-toggle { height: 46px; flex: none; }
.advanced-toggle[aria-expanded="true"] { background: var(--blue-100); border-color: var(--blue-500); }
.filter-bar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; padding: 0 22px 18px; align-items: end; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-size: 12.5px; font-weight: 700; color: var(--navy-900); }
select, input[type="search"] {
  width: 100%; height: 40px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
}
select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 17px, calc(100% - 10px) 17px; background-size: 5px 5px; background-repeat: no-repeat; }
select:hover, input:hover { border-color: var(--navy-800); }
select:focus, input:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(39, 124, 181, 0.18); }
.search-field { position: relative; }
.search-field svg { position: absolute; left: 11px; bottom: 11px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search-field input { padding-left: 36px; }

.results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 22px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: #FAFCFE; font-size: 14px; }
.results-head strong { color: var(--navy-900); }

/* ------------------------------------------------------------------ Tables */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th {
  text-align: left; font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data td { padding: 12px 14px; border-bottom: 1px solid #E8EEF4; vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr.clickable:hover { background: #F8FBFD; }
.cell-product { display: flex; align-items: center; gap: 12px; min-width: 260px; }
.cell-product a { color: var(--navy-900); font-weight: 650; text-decoration: none; line-height: 1.3; }
.cell-product a:hover { color: var(--blue-500); text-decoration: underline; }
.cell-product .sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }

/* Alternatives on the product page: requested product, matched-on rules, alternatives */
.compare-panel { margin: 18px 22px 0; border: 1px solid var(--border); border-left: 4px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; }
.compare-panel table.data { table-layout: fixed; }
.compare-panel .panel-label { display: flex; align-items: center; gap: 8px; padding: 10px 16px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; border-bottom: 1px solid var(--border); }
.requested-panel { border-color: #BFD6EA; border-left-color: var(--navy-900); background: #F4F9FD; }
.requested-panel .panel-label { background: #EAF3FA; border-bottom-color: #D4E5F2; color: var(--navy-900); }
.requested-panel table.data td { border-bottom: 0; }
.requested-panel .product-name { font-weight: 650; color: var(--navy-900); line-height: 1.3; }
.alternatives-panel { border-left-color: var(--success); margin-bottom: 22px; }
.alternatives-panel .panel-label { background: #F6FBF8; color: var(--success); }
.alternatives-panel .count { background: var(--success-bg); border-radius: 999px; padding: 1px 8px; letter-spacing: 0; }
table.alts td[data-label="Volume"] { white-space: nowrap; }
table.alts td.differs { background: var(--blue-100); font-weight: 650; }
.matched-on { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 14px 22px 0 26px; font-size: 13px; color: var(--muted); }
.matched-on .arrow { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--success-bg); color: var(--success); margin-right: 4px; }
.matched-on .arrow svg { width: 16px; height: 16px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 22px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }

.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 48px 24px; color: var(--muted); }
.empty svg.empty-art { width: 120px; height: 96px; }
.empty h3 { font-size: 17px; }
.empty p { max-width: 46ch; }

.skeleton { position: relative; overflow: hidden; background: #E9EFF5; border-radius: 6px; height: 14px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* ------------------------------------------------------------- Product page */

.product-head { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; padding: 22px; }
.product-head .thumb { width: 180px !important; height: 180px !important; border-radius: var(--radius); }
.product-head .eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--blue-500); margin-bottom: 6px; }
.product-head h1 { font-size: 26px; }
.product-head .meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 12px; }
.product-head .price { font-size: 18px; font-weight: 700; color: var(--navy-900); }
.product-head .price .per { font-size: 13px; font-weight: 500; color: var(--muted); }
.product-head .desc { color: #33475C; max-width: 72ch; }

.spec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.spec-group { padding: 6px 22px 16px; }
.spec-group:nth-child(odd) { border-right: 1px solid var(--border); }
.spec-group:nth-child(n+3) { border-top: 1px solid var(--border); }
.spec-group h3 { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 12px 0 4px; }
dl.specs { margin: 0; display: grid; grid-template-columns: minmax(120px, 42%) 1fr; }
dl.specs dt, dl.specs dd { padding: 8px 0; border-bottom: 1px solid #EDF2F6; margin: 0; }
dl.specs dt { color: var(--muted); font-size: 13.5px; }
dl.specs dd { font-weight: 600; font-size: 14px; }
dl.specs dt:last-of-type, dl.specs dd:last-of-type { border-bottom: 0; }
.unknown-text { color: var(--muted); font-style: italic; font-weight: 500; }
.note { padding: 18px 22px; color: var(--muted); }

/* ------------------------------------------------------------ Product dialog */

dialog.pd {
  width: min(1180px, 94vw); height: min(820px, 92vh); max-width: none; max-height: none;
  padding: 0; border: 0; border-radius: 16px; box-shadow: var(--shadow-lg); color: var(--text); overflow: hidden;
}
dialog.pd[open] { display: flex; flex-direction: column; }
dialog.pd::backdrop { background: rgba(0, 28, 56, 0.55); }
.pd-head { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 20px 24px 14px; }
.pd-head .thumb { border-radius: var(--radius); }
.pd-head .eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--blue-500); margin-bottom: 4px; }
.pd-head h2 { font-size: 21px; line-height: 1.25; }
.pd-head .meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.pd-head .price { font-size: 17px; font-weight: 700; color: var(--navy-900); }
.pd-head .price .per { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.pd-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; text-decoration: none; margin-bottom: 6px; }
.pd-back svg { width: 15px; height: 15px; }
.pd-actions { display: flex; gap: 8px; align-items: center; align-self: start; }
.pd-close { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: var(--radius-sm); background: none; color: var(--muted); cursor: pointer; }
.pd-close:hover { background: var(--neutral-bg); color: var(--navy-900); }
.pd-close svg { width: 20px; height: 20px; }
.pd-tabs { display: flex; gap: 4px; padding: 0 24px; border-bottom: 1px solid var(--border); flex: none; }
.pd-tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 14px; border: 0; background: none; cursor: pointer;
  font-weight: 650; font-size: 14.5px; color: var(--muted); border-bottom: 2.5px solid transparent; margin-bottom: -1px;
}
.pd-tab:hover { color: var(--navy-900); }
.pd-tab[aria-selected="true"] { color: var(--navy-900); border-bottom-color: var(--navy-900); }
.pd-tab .n { font-size: 12px; background: var(--neutral-bg); color: var(--navy-800); border-radius: 999px; padding: 1px 8px; }
.pd-tab[aria-selected="true"] .n { background: var(--navy-900); color: #FFFFFF; }
.pd-body { flex: 1; min-height: 0; overflow: auto; }
.pd-panel { padding: 18px 24px 22px; }
.pd-panel:focus-visible { box-shadow: inset 0 0 0 2px var(--blue-500); border-radius: 0; }
.pd .compare-panel { margin: 0; }
.pd table.data td { padding: 9px 12px; }
.pd table.data th { padding: 8px 12px; }
.pd .matched-on { padding: 12px 4px; }
.pd .alternatives-panel { margin-bottom: 0; }
.pd-desc { color: #33475C; max-width: 90ch; margin-bottom: 14px; }
.pd .pd-specs { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); }
.pd .pd-specs .spec-group { border: 0; border-right: 1px solid var(--border); padding: 4px 18px 12px; }
.pd .pd-specs .spec-group:last-child { border-right: 0; }

@media (max-width: 720px) {
  dialog.pd { width: 100vw; height: 100dvh; border-radius: 0; }
  .pd-head { grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; padding: 14px 16px 10px; }
  .pd-head .thumb { width: 64px !important; height: 64px !important; }
  .pd-head .photo-ph-md { font-size: 7.5px; }
  .pd-head h2 { font-size: 17px; }
  .pd-actions { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
  .pd-actions .pd-close { position: absolute; top: 10px; right: 10px; }
  .pd-tabs { padding: 0 12px; }
  .pd-panel { padding: 14px 16px 18px; }
  .pd .pd-specs .spec-group { border-right: 0; border-bottom: 1px solid var(--border); }
}

/* -------------------------------------------------- Printable PDF summary sheet */

#print-root { display: none; }

@page { size: A4; margin: 14mm 14mm 16mm; }

@media print {
  body.printing-sheet { background: #FFFFFF; }
  body.printing-sheet > :not(#print-root) { display: none !important; }
  body.printing-sheet #print-root { display: block; }
}

.print-sheet {
  --ps-navy: #002C58; --ps-pale: #E8F2F9; --ps-border: #D9E3EC; --ps-muted: #61758A; --ps-green: #217A58; --ps-greenbg: #E5F2EC;
  width: 182mm; margin: 0 auto; color: var(--text); font-size: 10pt; line-height: 1.4;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.print-sheet .ps-head { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 5mm; border-bottom: 2.5pt solid var(--ps-navy); }
.print-sheet .ps-brand { display: flex; align-items: center; gap: 3mm; }
.print-sheet .ps-brand svg { width: 11mm; height: 11mm; }
.print-sheet .ps-brand-name { font-size: 15pt; font-weight: 700; color: var(--ps-navy); line-height: 1; }
.print-sheet .ps-brand-sub { font-size: 7.5pt; letter-spacing: .12em; text-transform: uppercase; color: var(--ps-muted); margin-top: 1mm; }
.print-sheet .ps-meta { text-align: right; font-size: 8.5pt; color: var(--ps-muted); line-height: 1.6; }
.print-sheet .ps-meta b { color: var(--text); font-weight: 600; }
.print-sheet h1 { font-size: 17pt; color: var(--ps-navy); margin: 6mm 0 1mm; }
.print-sheet .ps-lede { color: var(--ps-muted); margin: 0 0 5mm; }
.print-sheet .ps-label { display: flex; align-items: center; gap: 2mm; font-size: 7.5pt; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 2mm; }
.print-sheet .ps-label-requested { color: var(--ps-navy); }
.print-sheet .ps-label-alts { color: var(--ps-green); }
.print-sheet .ps-n { background: var(--ps-greenbg); border-radius: 10mm; padding: 0 2mm; letter-spacing: 0; }
.print-sheet .ps-requested { border: 1pt solid #BFD6EA; border-left: 3pt solid var(--ps-navy); border-radius: 2mm; background: #F4F9FD; padding: 4mm; display: grid; grid-template-columns: 22mm 1fr auto; gap: 4mm; align-items: start; break-inside: avoid; }
.print-sheet .ps-requested .thumb { width: 22mm !important; height: 22mm !important; border-radius: 1.5mm; }
.print-sheet .ps-pname { font-size: 12pt; font-weight: 700; color: var(--ps-navy); line-height: 1.25; }
.print-sheet .ps-sub { margin-top: 1.2mm; color: var(--ps-muted); font-size: 8.5pt; }
.print-sheet .ps-sku { font-family: var(--font-mono); font-size: 8pt; font-weight: 600; color: var(--ps-navy); background: var(--ps-pale); border: .6pt solid #C9DDEE; border-radius: 1mm; padding: .3mm 1.5mm; white-space: nowrap; }
.print-sheet .ps-price { font-size: 13pt; font-weight: 700; color: var(--ps-navy); text-align: right; white-space: nowrap; }
.print-sheet .ps-price small { display: block; font-size: 7.5pt; font-weight: 500; color: var(--ps-muted); }
.print-sheet .ps-specs { display: grid; grid-template-columns: repeat(4, auto); gap: 1.5mm 6mm; margin: 2.5mm 0 0; font-size: 8.5pt; }
.print-sheet .ps-specs div { display: grid; gap: .3mm; }
.print-sheet .ps-specs dt { color: var(--ps-muted); font-size: 7pt; text-transform: uppercase; letter-spacing: .06em; }
.print-sheet .ps-specs dd { margin: 0; font-weight: 600; }
.print-sheet .ps-matched { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5mm; margin: 4mm 0 5mm; font-size: 8.5pt; color: var(--ps-muted); }
.print-sheet .ps-chip { background: var(--ps-greenbg); color: var(--ps-green); border-radius: 10mm; padding: .6mm 2.5mm; font-weight: 600; font-size: 8pt; }
.print-sheet .ps-table { width: 100%; border-collapse: collapse; font-size: 8.5pt; border: 1pt solid var(--ps-border); border-left: 3pt solid var(--ps-green); }
.print-sheet .ps-table th { text-align: left; font-size: 7pt; letter-spacing: .07em; text-transform: uppercase; color: var(--ps-muted); font-weight: 700; padding: 2mm 2.5mm; background: #F6FBF8; border-bottom: 1pt solid var(--ps-border); }
.print-sheet .ps-table td { padding: 2.5mm; border-bottom: .6pt solid #E3EAF1; vertical-align: top; }
.print-sheet .ps-table tr { break-inside: avoid; }
.print-sheet .ps-table .num { text-align: right; white-space: nowrap; }
.print-sheet .ps-table .vol { white-space: nowrap; }
.print-sheet .ps-table .diff { background: var(--ps-pale); font-weight: 650; }
.print-sheet .ps-pn { font-weight: 650; color: var(--ps-navy); display: block; margin-bottom: .8mm; }
.print-sheet .ps-idx { color: var(--ps-muted); font-weight: 700; width: 6mm; }
.print-sheet .ps-none { border: 1pt solid var(--ps-border); border-left: 3pt solid var(--ps-green); padding: 4mm; color: var(--ps-muted); }
.print-sheet .ps-foot { margin-top: 8mm; padding-top: 3mm; border-top: .8pt solid var(--ps-border); font-size: 7.5pt; color: var(--ps-muted); display: flex; justify-content: space-between; gap: 6mm; break-inside: avoid; }
.print-sheet .ps-legend { display: inline-block; width: 3mm; height: 3mm; background: var(--ps-pale); border: .6pt solid #C9DDEE; vertical-align: -.4mm; margin-right: 1mm; }
.print-sheet .ps-demo { white-space: nowrap; }

/* ------------------------------------------------------------------ Toast */

.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 90; display: grid; gap: 10px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius);
  background: var(--navy-900); color: #FFFFFF; box-shadow: var(--shadow-lg); font-size: 14px;
}
.toast svg { width: 18px; height: 18px; color: #7FD1AE; }

.error-panel { max-width: 640px; margin: 60px auto; padding: 22px; }
.error-panel pre { background: var(--navy-900); color: #FFFFFF; padding: 12px 14px; border-radius: var(--radius-sm); overflow-x: auto; }

/* ------------------------------------------------------------ Responsive */

@media (max-width: 1000px) {
  .filter-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .topbar { padding: 0 16px; }
  .brand-sub { display: none; }
  .view { padding: 20px 16px 60px; }
  h1 { font-size: 24px; }
  .filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 16px 16px; }
  .search-row { padding: 16px; flex-wrap: wrap; }
  .search-row .search-field { flex-basis: 100%; }
  .advanced-toggle { height: 38px; }
  .product-head { grid-template-columns: 88px minmax(0, 1fr); gap: 16px; padding: 16px; }
  .product-head .thumb { width: 88px !important; height: 88px !important; }
  .product-head .photo-ph-lg { font-size: 8.5px; gap: 4px; }
  .product-head h1 { font-size: 21px; }
  .spec-grid { grid-template-columns: minmax(0, 1fr); }
  .spec-group:nth-child(odd) { border-right: 0; }
  .spec-group:nth-child(n+2) { border-top: 1px solid var(--border); }
  /* Tables become stacked cards */
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { padding: 12px 16px; border-bottom: 1px solid var(--border); }
  table.stack td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; }
  table.stack td[data-label]::before { content: attr(data-label); font-size: 12px; color: var(--muted); font-weight: 600; }
  table.stack td.cell-first { display: block; padding-bottom: 8px; }
  .cell-product { min-width: 0; }
  .card-head, .matched-on, .results-head, .pager { padding-left: 16px; padding-right: 16px; }
  .compare-panel { margin-left: 16px; margin-right: 16px; }
  .compare-panel table.data { table-layout: auto; }
  .toasts { left: 12px; right: 12px; bottom: 12px; }
}

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