/*
 * ChainhoistDB — the one stylesheet.
 *
 * Order: tokens → Bootstrap 5.3 mapping → base → shell (header, footer,
 * bottom nav) → shared components → page sections → admin.
 *
 * Rules of the house:
 *   - Colours, type, spacing, radius and elevation come from the tokens
 *     below. No raw hex outside the token blocks.
 *   - Dark is the default (<html data-bs-theme="dark">). Light lives under
 *     [data-bs-theme="light"]. The header toggle persists the choice.
 *   - Flat surfaces, 1px hairlines. Cards change border colour and lift
 *     2px on hover. No gradients, no drop shadows on cards, no blur.
 *   - Motion is progressive and brief (section 10): view transitions,
 *     one-time reveals, count-ups. All off under prefers-reduced-motion.
 *   - Dense and scannable: this is a reference tool for riggers. Numbers in
 *     tables are tabular.
 */

/* ==========================================================================
   1. Tokens
   ========================================================================== */

:root,
:root[data-bs-theme="dark"] {
  color-scheme: dark;

  /* Surfaces: page → card → raised/table head → hover */
  --surface-0: #0f1115;
  --surface-1: #161a20;
  --surface-2: #1d222a;
  --surface-3: #252b35;
  --field-bg: #0f1115;
  --line: #2a313b;
  --line-strong: #3a4350;

  /* Ink. Contrast on --surface-1: 14.2:1 / 8.0:1 / 5.6:1 */
  --text-1: #e6e8eb;
  --text-2: #a8b0bb;
  --text-3: #8b939e;

  /* Accent: rigging amber. On dark the fill and the text are the same hue
     (#f2a900 on --surface-0 = 9.4:1). --accent-ink is text set on it. */
  --accent: #f2a900;
  --accent-hover: #ffbb33;
  --accent-text: #f2a900;
  --accent-ink: #111111;
  --accent-wash: rgba(242, 169, 0, 0.12);
  --accent-line: rgba(242, 169, 0, 0.45);
  --focus: #ffbb33;

  /* Provenance / status. Each is paired with an icon and a word. */
  --verified: #56c28f;
  --verified-wash: rgba(86, 194, 143, 0.12);
  --verified-line: rgba(86, 194, 143, 0.45);
  --info: #7fb0e8;
  --info-wash: rgba(127, 176, 232, 0.12);
  --info-line: rgba(127, 176, 232, 0.4);
  --danger: #f07167;
  --danger-wash: rgba(240, 113, 103, 0.12);

  /* Chart marks (validated with the dataviz validator, see stats.ejs):
     verified = amber, unverified = de-emphasis gray. */
  --viz-verified: #c08800;
  --viz-unverified: #6b7482;
  --viz-grid: #2a313b;

  --overlay: rgba(8, 9, 12, 0.82);
  --elev-overlay: 0 12px 32px rgba(0, 0, 0, 0.45);

  /* 3D viewer panel. Lighter than every page surface on purpose: the
     modelled hoists are near-black, and a slate panel is what keeps their
     silhouette and edges readable in the dark theme. */
  --viewer-bg: #4a5260;
  --viewer-line: #5b6474;
  --viewer-caption-bg: rgba(15, 17, 21, 0.86);
  --viewer-caption-ink: #e6e8eb;

  /* Type */
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-base: 0.9375rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.625rem;
  --fs-2xl: 2.125rem;
  --fs-3xl: 2.75rem;
  --lh-tight: 1.15;
  --lh-base: 1.5;

  /* Spacing (4px grid) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;

  /* Radius: small and consistent */
  --radius-1: 3px;
  --radius-2: 5px;
  --radius-3: 8px;

  --header-h: 3.5rem;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --dur: 140ms;
}

:root[data-bs-theme="light"] {
  color-scheme: light;

  --surface-0: #f7f6f3;
  --surface-1: #ffffff;
  --surface-2: #efede8;
  --surface-3: #e6e3dc;
  --field-bg: #ffffff;
  --line: #dcd8cf;
  --line-strong: #c4bfb4;

  /* Contrast on white: 17.6:1 / 8.2:1 / 6.2:1 */
  --text-1: #17191d;
  --text-2: #4a4f57;
  --text-3: #5c6169;

  /* #f2a900 on white is only 2.0:1, so on light the accent splits: the fill
     stays amber (with dark ink on it, 9.4:1) and text/links use a darker
     amber, #8a5a00 = 5.9:1 on white, 5.5:1 on --surface-0 (WCAG AA). */
  --accent: #f2a900;
  --accent-hover: #d99700;
  --accent-text: #8a5a00;
  --accent-ink: #111111;
  --accent-wash: rgba(242, 169, 0, 0.16);
  --accent-line: rgba(138, 90, 0, 0.45);
  --focus: #8a5a00;

  --verified: #1e7a4f;
  --verified-wash: rgba(30, 122, 79, 0.09);
  --verified-line: rgba(30, 122, 79, 0.4);
  --info: #2f63a8;
  --info-wash: rgba(47, 99, 168, 0.08);
  --info-line: rgba(47, 99, 168, 0.35);
  --danger: #b3261e;
  --danger-wash: rgba(179, 38, 30, 0.08);

  --viz-verified: #a86f00;
  --viz-unverified: #8f959d;
  --viz-grid: #e6e3dc;

  --overlay: rgba(23, 25, 29, 0.72);
  --elev-overlay: 0 12px 32px rgba(23, 25, 29, 0.18);

  --viewer-bg: #efede8;
  --viewer-line: #dcd8cf;
  --viewer-caption-bg: rgba(255, 255, 255, 0.92);
  --viewer-caption-ink: #17191d;
}

/* ==========================================================================
   2. Bootstrap 5.3 colour-mode mapping
   Existing Bootstrap markup restyles through these variables.
   ========================================================================== */

:root[data-bs-theme="dark"],
:root[data-bs-theme="light"] {
  --bs-body-font-family: var(--font-body);
  --bs-body-font-size: var(--fs-base);
  --bs-body-line-height: var(--lh-base);
  --bs-body-bg: var(--surface-0);
  --bs-body-color: var(--text-1);
  --bs-emphasis-color: var(--text-1);
  --bs-heading-color: var(--text-1);
  --bs-secondary-color: var(--text-2);
  --bs-tertiary-color: var(--text-3);
  --bs-secondary-bg: var(--surface-2);
  --bs-tertiary-bg: var(--surface-1);
  --bs-border-color: var(--line);
  --bs-border-color-translucent: var(--line);
  --bs-border-radius: var(--radius-2);
  --bs-border-radius-sm: var(--radius-1);
  --bs-border-radius-lg: var(--radius-3);
  --bs-border-radius-xl: var(--radius-3);
  --bs-border-radius-xxl: var(--radius-3);
  --bs-link-color: var(--accent-text);
  --bs-link-hover-color: var(--accent-hover);
  --bs-code-color: var(--accent-text);
  --bs-focus-ring-color: var(--accent-line);
  --bs-primary: var(--accent);
  --bs-primary-text-emphasis: var(--accent-text);
  --bs-primary-bg-subtle: var(--accent-wash);
  --bs-primary-border-subtle: var(--accent-line);
  --bs-success-text-emphasis: var(--verified);
  --bs-success-bg-subtle: var(--verified-wash);
  --bs-success-border-subtle: var(--verified-line);
  --bs-info-text-emphasis: var(--info);
  --bs-info-bg-subtle: var(--info-wash);
  --bs-info-border-subtle: var(--info-line);
  --bs-danger-text-emphasis: var(--danger);
  --bs-danger-bg-subtle: var(--danger-wash);
}

/* The *-rgb channels cannot be derived from a var(), so they are spelled out
   once per theme. Keep them in step with the tokens above. */
:root[data-bs-theme="dark"] {
  --bs-body-bg-rgb: 15, 17, 21;
  --bs-body-color-rgb: 230, 232, 235;
  --bs-emphasis-color-rgb: 230, 232, 235;
  --bs-secondary-color-rgb: 168, 176, 187;
  --bs-secondary-bg-rgb: 29, 34, 42;
  --bs-tertiary-bg-rgb: 22, 26, 32;
  --bs-link-color-rgb: 242, 169, 0;
  --bs-link-hover-color-rgb: 255, 187, 51;
  --bs-primary-rgb: 242, 169, 0;
  --bs-success-rgb: 86, 194, 143;
  --bs-info-rgb: 127, 176, 232;
  --bs-danger-rgb: 240, 113, 103;
  --bs-secondary-rgb: 58, 67, 80;
}

:root[data-bs-theme="light"] {
  --bs-body-bg-rgb: 247, 246, 243;
  --bs-body-color-rgb: 23, 25, 29;
  --bs-emphasis-color-rgb: 23, 25, 29;
  --bs-secondary-color-rgb: 74, 79, 87;
  --bs-secondary-bg-rgb: 239, 237, 232;
  --bs-tertiary-bg-rgb: 255, 255, 255;
  --bs-link-color-rgb: 138, 90, 0;
  --bs-link-hover-color-rgb: 217, 151, 0;
  /* .bg-primary / .text-primary carry text or sit behind white text, so
     on light they use the AA-safe dark amber, not the fill amber. */
  --bs-primary-rgb: 138, 90, 0;
  --bs-success-rgb: 30, 122, 79;
  --bs-info-rgb: 47, 99, 168;
  --bs-danger-rgb: 179, 38, 30;
  --bs-secondary-rgb: 92, 97, 105;
}

/* Legacy light panels: bg-light / bg-white in older markup become the raised
   surface, in both themes. */
.bg-light,
.bg-white {
  background-color: var(--surface-2) !important;
  color: var(--text-1);
}
.bg-light.text-dark,
.bg-light .text-dark,
.text-dark {
  color: var(--text-1) !important;
}
.text-white.bg-success,
.bg-success.text-white,
.bg-primary.text-white {
  color: #ffffff !important;
}

/* Cards: hairline border, flat, hover changes border colour only. */
.card {
  --bs-card-bg: var(--surface-1);
  --bs-card-border-color: var(--line);
  --bs-card-cap-bg: var(--surface-1);
  --bs-card-cap-color: var(--text-1);
  --bs-card-border-radius: var(--radius-3);
  --bs-card-inner-border-radius: calc(var(--radius-3) - 1px);
  --bs-card-cap-padding-y: var(--space-3);
  --bs-card-cap-padding-x: var(--space-4);
  --bs-card-spacer-y: var(--space-4);
  --bs-card-spacer-x: var(--space-4);
  box-shadow: none;
  transition: border-color var(--dur) var(--ease);
}
.card:hover {
  border-color: var(--line-strong);
}
.card-header {
  border-bottom: 1px solid var(--line);
}

/* Buttons */
.btn {
  --bs-btn-font-weight: 600;
  --bs-btn-font-size: var(--fs-sm);
  --bs-btn-padding-y: 0.4375rem;
  --bs-btn-padding-x: 0.875rem;
  --bs-btn-border-radius: var(--radius-2);
  --bs-btn-focus-box-shadow: 0 0 0 3px var(--accent-line);
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.btn-sm {
  --bs-btn-padding-y: 0.25rem;
  --bs-btn-padding-x: 0.625rem;
  --bs-btn-font-size: var(--fs-xs);
}
.btn-primary,
.btn-accent {
  --bs-btn-color: var(--accent-ink);
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-color: var(--accent-ink);
  --bs-btn-hover-bg: var(--accent-hover);
  --bs-btn-hover-border-color: var(--accent-hover);
  --bs-btn-active-color: var(--accent-ink);
  --bs-btn-active-bg: var(--accent-hover);
  --bs-btn-active-border-color: var(--accent-hover);
  --bs-btn-disabled-color: var(--accent-ink);
  --bs-btn-disabled-bg: var(--accent);
  --bs-btn-disabled-border-color: var(--accent);
}
.btn-outline-primary {
  --bs-btn-color: var(--accent-text);
  --bs-btn-border-color: var(--accent-line);
  --bs-btn-hover-color: var(--accent-ink);
  --bs-btn-hover-bg: var(--accent);
  --bs-btn-hover-border-color: var(--accent);
  --bs-btn-active-color: var(--accent-ink);
  --bs-btn-active-bg: var(--accent);
  --bs-btn-active-border-color: var(--accent);
}
.btn-outline-secondary,
.btn-outline-light,
.btn-quiet {
  --bs-btn-color: var(--text-1);
  --bs-btn-bg: transparent;
  --bs-btn-border-color: var(--line-strong);
  --bs-btn-hover-color: var(--text-1);
  --bs-btn-hover-bg: var(--surface-3);
  --bs-btn-hover-border-color: var(--line-strong);
  --bs-btn-active-color: var(--text-1);
  --bs-btn-active-bg: var(--surface-3);
  --bs-btn-active-border-color: var(--text-3);
  --bs-btn-disabled-color: var(--text-3);
  --bs-btn-disabled-border-color: var(--line);
}

/* Forms */
.form-control,
.form-select {
  background-color: var(--field-bg);
  border-color: var(--line-strong);
  color: var(--text-1);
  font-size: var(--fs-base);
  border-radius: var(--radius-2);
}
.form-control::placeholder {
  color: var(--text-3);
}
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-line);
  background-color: var(--field-bg);
  color: var(--text-1);
}
.form-check-input:checked {
  background-color: var(--accent);
  border-color: var(--accent);
}
.form-label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: var(--space-1);
}

/* Tables: compact, hairline, tabular numbers */
.table {
  --bs-table-color: var(--text-1);
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--line);
  --bs-table-striped-color: var(--text-1);
  --bs-table-striped-bg: rgba(var(--bs-emphasis-color-rgb), 0.025);
  --bs-table-hover-color: var(--text-1);
  --bs-table-hover-bg: rgba(var(--bs-emphasis-color-rgb), 0.05);
  --bs-table-active-bg: rgba(var(--bs-emphasis-color-rgb), 0.07);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
  margin-bottom: 0;
}
.table > :not(caption) > * > * {
  padding: 0.5rem 0.625rem;
  vertical-align: middle;
}
.table > thead > tr > th,
.table-dark,
.table-light {
  --bs-table-bg: var(--surface-2);
  --bs-table-color: var(--text-2);
  --bs-table-border-color: var(--line);
  --bs-table-striped-bg: var(--surface-2);
  --bs-table-hover-bg: var(--surface-3);
}
.table > thead > tr > th {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
  white-space: nowrap;
}
.table-bordered > :not(caption) > * {
  border-color: var(--line);
}

/* List groups, pagination, breadcrumb, progress, alerts */
.list-group {
  --bs-list-group-bg: var(--surface-1);
  --bs-list-group-color: var(--text-1);
  --bs-list-group-border-color: var(--line);
  --bs-list-group-border-radius: var(--radius-2);
  --bs-list-group-item-padding-y: 0.4375rem;
  --bs-list-group-item-padding-x: 0.75rem;
  --bs-list-group-action-color: var(--text-1);
  --bs-list-group-action-hover-color: var(--text-1);
  --bs-list-group-action-hover-bg: var(--surface-2);
  --bs-list-group-action-active-color: var(--text-1);
  --bs-list-group-action-active-bg: var(--surface-3);
  --bs-list-group-active-color: var(--accent-ink);
  --bs-list-group-active-bg: var(--accent);
  --bs-list-group-active-border-color: var(--accent);
  font-size: var(--fs-sm);
}
.pagination {
  --bs-pagination-color: var(--text-1);
  --bs-pagination-bg: var(--surface-1);
  --bs-pagination-border-color: var(--line);
  --bs-pagination-hover-color: var(--text-1);
  --bs-pagination-hover-bg: var(--surface-3);
  --bs-pagination-hover-border-color: var(--line-strong);
  --bs-pagination-focus-color: var(--text-1);
  --bs-pagination-focus-bg: var(--surface-3);
  --bs-pagination-focus-box-shadow: 0 0 0 3px var(--accent-line);
  --bs-pagination-active-color: var(--accent-ink);
  --bs-pagination-active-bg: var(--accent);
  --bs-pagination-active-border-color: var(--accent);
  --bs-pagination-disabled-color: var(--text-3);
  --bs-pagination-disabled-bg: var(--surface-1);
  --bs-pagination-disabled-border-color: var(--line);
  --bs-pagination-font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}
.breadcrumb {
  --bs-breadcrumb-divider-color: var(--text-3);
  --bs-breadcrumb-item-active-color: var(--text-2);
  font-size: var(--fs-sm);
}
.progress {
  --bs-progress-bg: var(--surface-3);
  --bs-progress-bar-bg: var(--accent);
  --bs-progress-border-radius: 2px;
}
.alert {
  --bs-alert-border-radius: var(--radius-2);
  --bs-alert-padding-y: 0.625rem;
  --bs-alert-padding-x: 0.875rem;
  font-size: var(--fs-sm);
}
.alert-light {
  --bs-alert-bg: var(--surface-1);
  --bs-alert-color: var(--text-1);
  --bs-alert-border-color: var(--line);
}
.alert-secondary {
  --bs-alert-bg: var(--surface-2);
  --bs-alert-color: var(--text-1);
  --bs-alert-border-color: var(--line-strong);
}
.alert-warning {
  --bs-alert-bg: var(--accent-wash);
  --bs-alert-color: var(--text-1);
  --bs-alert-border-color: var(--accent-line);
}
.alert-success {
  --bs-alert-bg: var(--verified-wash);
  --bs-alert-color: var(--text-1);
  --bs-alert-border-color: var(--verified-line);
}
.spinner-border.text-primary {
  color: var(--accent) !important;
}
.text-primary {
  color: var(--accent-text) !important;
}
.text-success {
  color: var(--verified) !important;
}
.text-danger {
  color: var(--danger) !important;
}
.text-warning {
  color: var(--accent-text) !important;
}

/* Badges. Generic counts are quiet; meaning lives in the components in §4. */
.badge {
  --bs-badge-font-size: var(--fs-xs);
  --bs-badge-font-weight: 600;
  --bs-badge-padding-y: 0.2em;
  --bs-badge-padding-x: 0.5em;
  --bs-badge-border-radius: var(--radius-1);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.badge.rounded-pill,
.badge.bg-primary,
.badge.bg-secondary {
  background-color: var(--surface-3) !important;
  color: var(--text-1) !important;
  border-radius: var(--radius-1) !important;
}
.badge.bg-success {
  background-color: var(--verified-wash) !important;
  color: var(--verified) !important;
  border: 1px solid var(--verified-line);
}
.badge.bg-warning {
  background-color: var(--accent-wash) !important;
  color: var(--accent-text) !important;
  border: 1px solid var(--accent-line);
}
.badge.bg-danger {
  background-color: var(--danger-wash) !important;
  color: var(--danger) !important;
  border: 1px solid var(--danger);
}

/* ==========================================================================
   3. Base
   ========================================================================== */

html {
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--surface-0);
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, .h1, .h2, .h3,
.display-num {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.005em;
  line-height: var(--lh-tight);
}
h1, .h1 { font-size: var(--fs-2xl); }
h2, .h2 { font-size: var(--fs-xl); }
h3, .h3 { font-size: var(--fs-lg); }
h4, .h4 { font-size: var(--fs-md); font-weight: 600; }
h5, .h5 { font-size: var(--fs-base); font-weight: 600; }
h6, .h6 { font-size: var(--fs-sm); font-weight: 600; }

@media (min-width: 768px) {
  h1, .h1 { font-size: var(--fs-3xl); }
  h2, .h2 { font-size: var(--fs-2xl); }
}

.display-num {
  font-weight: 700;
  font-variant-numeric: lining-nums;
}

.tabular,
td, th {
  font-variant-numeric: tabular-nums;
}

a {
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

hr {
  border-color: var(--line);
  opacity: 1;
}

.text-muted {
  color: var(--text-2) !important;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

/* Focus: one visible ring everywhere, keyboard only. */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
:focus:not(:focus-visible) {
  outline: none;
}

/* Skip link: first focusable element on every page. */
.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -3rem;
  z-index: 2000;
  padding: var(--space-2) var(--space-3);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  border-radius: var(--radius-2);
  text-decoration: none;
}
.skip-link:focus {
  top: var(--space-2);
  color: var(--accent-ink);
}

main:focus {
  outline: none;
}

@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;
  }
}

/* ==========================================================================
   4. Shell — header, status line, footer, mobile bottom nav
   ========================================================================== */

.site-header {
  background: var(--surface-1);
  border-bottom: 1px solid var(--line);
}
.site-header .navbar {
  --bs-navbar-color: var(--text-2);
  --bs-navbar-hover-color: var(--text-1);
  --bs-navbar-active-color: var(--text-1);
  --bs-navbar-brand-color: var(--text-1);
  --bs-navbar-brand-hover-color: var(--text-1);
  --bs-navbar-toggler-border-color: var(--line-strong);
  --bs-navbar-toggler-focus-width: 3px;
  --bs-navbar-nav-link-padding-x: 0.625rem;
  min-height: var(--header-h);
  padding-top: var(--space-1);
  padding-bottom: var(--space-1);
}
:root[data-bs-theme="light"] .site-header .navbar-toggler-icon {
  filter: invert(1);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.375rem;
  letter-spacing: 0.01em;
  text-decoration: none;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--radius-2);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 1.125rem;
}
.brand-sub {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0.02em;
}
.site-header .nav-link {
  font-size: var(--fs-sm);
  font-weight: 500;
  border-radius: var(--radius-1);
}
.site-header .nav-link.active {
  color: var(--text-1);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.site-header .nav-link:hover {
  background: var(--surface-2);
}
.header-search {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}
.header-search .form-control {
  width: 14rem;
  padding: 0.3125rem 0.625rem;
  font-size: var(--fs-sm);
}

.theme-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-2);
  background: transparent;
  color: var(--text-2);
  font-size: 1rem;
}
.js .theme-toggle {
  display: inline-flex;
}
.theme-toggle:hover {
  color: var(--text-1);
  background: var(--surface-2);
}
.theme-toggle .bi-sun,
:root[data-bs-theme="light"] .theme-toggle .bi-moon-stars {
  display: none;
}
:root[data-bs-theme="light"] .theme-toggle .bi-sun {
  display: inline-block;
}

/* Quiet one-line dataset status under the nav. */
.site-status {
  border-top: 1px solid var(--line);
  font-size: var(--fs-xs);
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.site-status .container {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-3);
  padding-top: 0.3125rem;
  padding-bottom: 0.3125rem;
}
.site-status strong {
  color: var(--text-2);
  font-weight: 600;
}
.site-status a {
  color: inherit;
}
.site-status .status-verified strong {
  color: var(--verified);
}

.site-main {
  flex: 1 0 auto;
  padding-top: var(--space-5);
  padding-bottom: var(--space-6);
}

.site-footer {
  flex-shrink: 0;
  background: var(--surface-1);
  border-top: 1px solid var(--line);
  color: var(--text-2);
  font-size: var(--fs-sm);
  padding: var(--space-6) 0 var(--space-5);
}
.site-footer h2 {
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: var(--space-3);
}
.site-footer p {
  max-width: 46ch;
}
.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.site-footer li + li {
  margin-top: var(--space-1);
}
.site-footer a {
  color: var(--text-2);
  text-decoration: none;
}
.site-footer a:hover {
  color: var(--text-1);
  text-decoration: underline;
}
.site-footer .footer-base {
  border-top: 1px solid var(--line);
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  font-size: var(--fs-xs);
  color: var(--text-3);
}

.bottom-nav-mobile {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  background: var(--surface-1);
  border-top: 1px solid var(--line);
  padding: var(--space-1) var(--space-1) calc(var(--space-1) + env(safe-area-inset-bottom, 0px));
}
.bottom-nav-mobile .nav-items {
  display: flex;
  justify-content: space-around;
}
.bottom-nav-mobile .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 3.5rem;
  padding: 0.375rem 0.25rem;
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.6875rem;
  border-radius: var(--radius-2);
}
.bottom-nav-mobile .nav-item i {
  font-size: 1.25rem;
  line-height: 1.2;
}
.bottom-nav-mobile .nav-item.active {
  color: var(--accent-text);
}
.bottom-nav-mobile .nav-item:hover {
  color: var(--text-1);
}

@media (max-width: 767.98px) {
  .bottom-nav-mobile {
    display: block;
  }
  body {
    padding-bottom: 4.25rem;
  }
  .header-search {
    display: none;
  }
}

/* ==========================================================================
   5. Shared components
   ========================================================================== */

/* Page head: replaces the old gradient hero banners. Left-aligned, flat. */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3) var(--space-5);
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-5);
  border-bottom: 1px solid var(--line);
}
.page-head h1 {
  margin: 0;
}
.page-head .lead,
.page-lead {
  font-size: var(--fs-md);
  color: var(--text-2);
  margin: var(--space-2) 0 0;
  max-width: 68ch;
}
.page-head .meta {
  font-size: var(--fs-xs);
  color: var(--text-3);
  margin: var(--space-1) 0 0;
}
.eyebrow {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: var(--space-1);
}

/* Section heading inside cards and pages. */
.section-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  margin: 0 0 var(--space-3);
}
.section-title i {
  color: var(--text-3);
}

/* Panel: a card whose header is a quiet label row. */
.panel > .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  background: var(--surface-1);
}
.panel > .card-header h2,
.panel > .card-header h3,
.panel > .card-header h4,
.panel > .card-header h5 {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
  margin: 0;
}
.panel > .card-header i {
  color: var(--text-3);
  margin-right: var(--space-1);
}

/* Interactive cards: hover and focus move the border to the accent. */
.product-card,
.ask-product-card,
.card-link {
  transition: border-color var(--dur) var(--ease);
}
.product-card:hover,
.product-card:focus-within,
.ask-product-card:hover,
a:focus-visible > .ask-product-card,
.card-link:hover {
  border-color: var(--accent-line);
}

/* Provenance: one component for every place a record's trust is shown.
   verified (document-checked) / from-site (fetched, not doc-checked) /
   unverified (reference entry). Icon + word, never colour alone. */
.prov-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.0625rem 0.375rem;
  border: 1px solid transparent;
  border-radius: var(--radius-1);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: 0.1em;
}
.prov-badge i {
  font-size: 0.75rem;
}
.prov-verified {
  color: var(--verified);
  background: var(--verified-wash);
  border-color: var(--verified-line);
}
.prov-scraped {
  color: var(--info);
  background: var(--info-wash);
  border-color: var(--info-line);
}
.prov-unverified {
  color: var(--text-2);
  background: transparent;
  border: 1px dashed var(--line-strong);
}
.prov-note {
  font-size: var(--fs-xs);
  color: var(--text-2);
  margin-top: var(--space-1);
  max-width: 60ch;
}

/* Classification and other spec chips: neutral, monospaced caps. Existing
   markup uses .badge.bg-info — that is remapped here too. */
.classification-badge,
.badge.bg-info,
.spec-chip {
  display: inline-block;
  padding: 0.125rem 0.375rem;
  margin: 0 0.25rem 0.125rem 0;
  background: var(--surface-2) !important;
  color: var(--text-1) !important;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-1);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
a .classification-badge:hover,
a:hover > .classification-badge {
  border-color: var(--accent-line);
}
.lifecycle-badge {
  display: inline-block;
  padding: 0.0625rem 0.375rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-1);
  color: var(--text-2);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Spec label in key/value tables. */
.spec-label {
  width: 40%;
  color: var(--text-2);
  font-weight: 500;
}
.spec-table td:last-child {
  color: var(--text-1);
  font-weight: 500;
}

/* KPI tiles: label + big number. */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.kpi {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-3);
  padding: var(--space-3) var(--space-4);
}
.kpi-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
}
.kpi-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-3xl);
  line-height: 1.05;
  color: var(--text-1);
}
.kpi-value.is-verified {
  color: var(--verified);
}
.kpi-note {
  font-size: var(--fs-xs);
  color: var(--text-3);
}

/* Loading overlay (search, product) */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1080;
  background: var(--overlay);
  justify-content: center;
  align-items: center;
}
.loading-overlay.show {
  display: flex;
}
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-1);
}
.loading-spinner .text-muted {
  color: var(--text-1) !important;
}

/* Lazy images fade in (not under reduced motion — see §3). */
img[loading="lazy"] {
  transition: opacity 0.25s var(--ease);
}

/* Toasts (components/toast.ejs) */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1090;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: calc(100vw - 2rem);
}
.toast-notification {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  min-width: 17.5rem;
  max-width: 25rem;
  padding: var(--space-3) var(--space-4);
  background: var(--surface-2);
  color: var(--text-1);
  border: 1px solid var(--line-strong);
  border-left-width: 3px;
  border-radius: var(--radius-2);
  box-shadow: var(--elev-overlay);
  animation: toast-in 0.2s var(--ease);
}
.toast-notification.hiding {
  animation: toast-out 0.2s var(--ease) forwards;
}
.toast-notification .toast-icon {
  font-size: 1.125rem;
  flex-shrink: 0;
}
.toast-notification .toast-content {
  flex-grow: 1;
}
.toast-notification .toast-message {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.4;
}
.toast-notification .toast-close {
  background: none;
  border: 0;
  padding: 0;
  color: var(--text-2);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.toast-notification .toast-close:hover {
  color: var(--text-1);
}
.toast-notification .toast-retry {
  margin-top: var(--space-2);
  padding: 0.25rem 0.5rem;
  font-size: var(--fs-xs);
  font-weight: 600;
  background: transparent;
  color: var(--text-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-1);
  cursor: pointer;
}
.toast-notification .toast-retry:hover {
  background: var(--surface-3);
}
.toast-success { border-left-color: var(--verified); }
.toast-success .toast-icon { color: var(--verified); }
.toast-error { border-left-color: var(--danger); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning { border-left-color: var(--accent); }
.toast-warning .toast-icon { color: var(--accent-text); }
.toast-info { border-left-color: var(--info); }
.toast-info .toast-icon { color: var(--info); }
@keyframes toast-in {
  from { transform: translateY(0.5rem); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@keyframes toast-out {
  from { opacity: 1; }
  to { opacity: 0; }
}
@media (max-width: 575.98px) {
  .toast-container {
    bottom: 5rem;
    right: 1rem;
    left: 1rem;
  }
  .toast-notification {
    min-width: 0;
    max-width: none;
  }
}

/* Icon-font placeholder for a missing image (was a camera emoji). */
.no-thumb,
.no-thumb-mobile,
.no-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-2);
  color: var(--text-3);
}
.no-thumb::before,
.no-thumb-mobile::before {
  content: "\f42a"; /* bi-image */
  font-family: "bootstrap-icons";
  font-size: 1.125rem;
}

/* ==========================================================================
   6. Pages
   ========================================================================== */

/* ---- Home --------------------------------------------------------------- */

.home-intro {
  display: grid;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}
@media (min-width: 992px) {
  .home-intro {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    align-items: end;
  }
}
.home-intro h1 {
  margin-bottom: var(--space-3);
}
.home-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}
.home-counts .kpi-value {
  font-size: var(--fs-2xl);
}
.facet-list .list-group-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
}
.facet-list .count {
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-xs);
}
.facet-list .list-group-item-action:hover .count {
  color: var(--text-1);
}
.product-card .card-img-link {
  display: block;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius-3) var(--radius-3) 0 0;
}
.product-card .card-img-link img {
  display: block;
  width: 100%;
  height: 11rem;
  object-fit: contain;
  padding: var(--space-2);
}
:root[data-bs-theme="dark"] .product-card .card-img-link,
:root[data-bs-theme="dark"] .product-main-image,
:root[data-bs-theme="dark"] .ask-thumb {
  /* Manufacturer product shots are mostly on white; a light plate keeps them
     from looking like cut-outs on the dark surface. */
  background: #e9eaec;
}
.product-card .mfr {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
}
.product-card .model {
  font-size: var(--fs-md);
  font-weight: 600;
  margin: 0 0 var(--space-2);
}
.product-card .model a {
  color: var(--text-1);
  text-decoration: none;
}
.product-card .model a:hover {
  color: var(--accent-text);
  text-decoration: underline;
}
.mini-specs {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.125rem var(--space-3);
  margin: var(--space-2) 0 0;
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}
.mini-specs dt {
  font-weight: 500;
  color: var(--text-2);
}
.mini-specs dd {
  margin: 0;
}

/* ---- Search --------------------------------------------------------------- */

.filter-panel > .card-header h2 {
  font-size: var(--fs-sm);
}
.filter-panel .form-label i {
  color: var(--text-3);
  margin-right: 0.25rem;
}
.filter-toggle-mobile {
  display: none;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--surface-1);
  color: var(--text-1);
  border: 0;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  font-size: var(--fs-sm);
  border-radius: var(--radius-3) var(--radius-3) 0 0;
}
.filter-toggle-mobile i.toggle-icon {
  transition: transform var(--dur) var(--ease);
}
.filter-toggle-mobile.collapsed i.toggle-icon {
  transform: rotate(-180deg);
}
@media (max-width: 767.98px) {
  /* Only collapse the filter panel when JS is there to open it again —
     without scripts the form stays visible. */
  .js .filter-toggle-mobile {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .js .filter-panel-content.collapsed {
    display: none;
  }
}

.js-only {
  display: none !important;
}
.js .js-only {
  display: revert !important;
}
.js .btn-group.js-only {
  display: inline-flex !important;
}
kbd {
  padding: 0.0625rem 0.3125rem;
  font-size: 0.8em;
  color: var(--text-1);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-1);
}
.more-filters summary {
  cursor: pointer;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-2);
}
.search-box {
  position: relative;
}
.trust-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-2);
  font-size: var(--fs-sm);
}
.trust-bar.is-verified {
  border-left-color: var(--verified);
}
.results-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
  font-size: var(--fs-sm);
}
.page-size-select {
  width: auto;
  min-width: 4.5rem;
  display: inline-block;
}
.view-toggle-active {
  background-color: var(--surface-3) !important;
  border-color: var(--text-3) !important;
  color: var(--text-1) !important;
}

/* Results: one list, two views. List = dense rows on a shared grid (the
   sort bar uses the same columns); gallery = image cards. On phones the list
   rows become compact cards. Rendered by partials/result-item.ejs on the
   server and public/js/result-item.js on the client. */
.results,
.results-head {
  --result-cols: 3rem minmax(0, 2.4fr) minmax(0, 2fr) minmax(0, 1.3fr) 7rem;
}
.results {
  list-style: none;
  padding: 0;
  margin: 0;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-3);
}
.results:empty {
  display: none;
}
.result {
  display: grid;
  grid-template-columns: var(--result-cols);
  gap: var(--space-2) var(--space-4);
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-sm);
}
.result:last-child {
  border-bottom: 0;
}
.result:hover,
.result:focus-within {
  background: rgba(var(--bs-emphasis-color-rgb), 0.035);
}
.result-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-1);
  background: #e9eaec;
  color: #6b7280;
  overflow: hidden;
}
.result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.result-thumb .bi-image {
  font-size: 1.125rem;
}
.result-main {
  min-width: 0;
}
.result-mfr {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-2) !important;
}
.result-model {
  margin: 0.0625rem 0 0.25rem;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: 1.3;
}
.result-series {
  font-weight: 400;
  color: var(--text-3);
  font-size: var(--fs-sm);
}
.result-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.result-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.result-specs dt {
  display: none;
}
.result-specs dd {
  margin: 0;
}
.result-cls a {
  text-decoration: none;
}
.result-actions {
  text-align: right;
}
.results-head[hidden] {
  display: none;
}
.results-head {
  display: grid;
  grid-template-columns: var(--result-cols);
  gap: var(--space-4);
  padding: 0 var(--space-3) var(--space-1);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.results-head .rh-main {
  display: flex;
  gap: var(--space-4);
}
.results-head .rh-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  justify-items: start;
}
.sortable {
  position: relative;
  padding-right: 1rem;
  color: var(--text-2);
  text-decoration: none;
}
.sortable:hover {
  color: var(--text-1);
}
.sortable::after {
  content: "\2195";
  position: absolute;
  right: 0;
  opacity: 0.45;
}
.sortable.asc,
.sortable.desc {
  color: var(--text-1);
}
.sortable.asc::after {
  content: "\2191";
  opacity: 1;
  color: var(--accent-text);
}
.sortable.desc::after {
  content: "\2193";
  opacity: 1;
  color: var(--accent-text);
}

/* Gallery */
.results.is-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: var(--space-3);
  background: none;
  border: 0;
}
.results.is-gallery .result {
  grid-template-columns: 1fr;
  align-content: start;
  gap: var(--space-2);
  padding: 0 0 var(--space-3);
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-3);
  overflow: hidden;
}
.results.is-gallery .result:hover,
.results.is-gallery .result:focus-within {
  border-color: var(--accent-line);
}
.results.is-gallery .result > :not(.result-thumb) {
  padding: 0 var(--space-3);
}
.results.is-gallery .result-thumb {
  width: 100%;
  height: 9rem;
  border-radius: 0;
}
.results.is-gallery .result-actions {
  text-align: left;
}
#searchApp:has(.results.is-gallery) .results-head {
  display: none;
}

@media (max-width: 991.98px) {
  .results,
  .results-head {
    --result-cols: 3rem minmax(0, 2fr) minmax(0, 1.6fr) 6.5rem;
  }
  .results:not(.is-gallery) .result-cls,
  .results-head .rh-cls {
    display: none;
  }
}
@media (max-width: 767.98px) {
  .results-head {
    display: none;
  }
  .results:not(.is-gallery) .result {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "main thumb" "specs specs" "cls actions";
    padding: var(--space-3);
  }
  .results:not(.is-gallery) .result-thumb { grid-area: thumb; width: 3.5rem; height: 3.5rem; justify-self: end; }
  .results:not(.is-gallery) .result-main { grid-area: main; }
  .results:not(.is-gallery) .result-specs { grid-area: specs; }
  .results:not(.is-gallery) .result-cls { grid-area: cls; display: block; }
  .results:not(.is-gallery) .result-actions { grid-area: actions; }
  .results:not(.is-gallery) .result-specs dt {
    display: block;
    font-size: var(--fs-xs);
    color: var(--text-2);
  }
  .pagination .page-item:first-child .page-link,
  .pagination .page-item:last-child .page-link {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}
.empty-state {
  padding: var(--space-5) var(--space-4);
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-3);
}

.row-link {
  color: var(--text-1);
  text-decoration: none;
}
.row-link:hover {
  color: var(--accent-text);
  text-decoration: underline;
}
.cell-empty {
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-style: italic;
}
.filter-link:not(.list-group-item) {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted var(--text-3);
}
.filter-link:not(.list-group-item):hover {
  color: var(--accent-text);
  border-bottom-color: var(--accent-text);
}

/* Chips: 3D model available, compare toggle */
.chip-3d {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.0625rem 0.375rem;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-1);
  color: var(--accent-text);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.02em;
}
.compare-toggle {
  display: none;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
}
.js .compare-toggle {
  display: inline-flex;
}
.compare-toggle:hover {
  color: var(--text-1);
  border-color: var(--text-3);
}
.compare-toggle[aria-pressed="true"] {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}
.compare-toggle[aria-pressed="true"]:hover {
  color: var(--accent-ink);
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.compare-toggle[aria-pressed="true"] .bi-plus-lg::before {
  content: "\f633"; /* bi-check-lg */
}

/* Search autocomplete (public/js/search-suggest.js) */
.autocomplete-container {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1050;
  max-height: 20rem;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-top: 0;
  border-radius: 0 0 var(--radius-2) var(--radius-2);
  box-shadow: var(--elev-overlay);
}
.autocomplete-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-sm);
  cursor: pointer;
}
.autocomplete-item .ac-label {
  flex: 1;
}
.autocomplete-item .ac-kind {
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.autocomplete-item i {
  color: var(--text-3);
}
.autocomplete-item.is-selected,
.autocomplete-item:hover {
  background: var(--surface-3);
}

/* Compare tray (public/js/compare.js), fixed above the mobile bottom nav */
.compare-tray {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1040;
  background: var(--surface-2);
  border-top: 1px solid var(--line-strong);
}
.compare-tray[hidden] {
  display: none;
}
.compare-tray .container {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-top: var(--space-2);
  padding-bottom: var(--space-2);
}
.compare-tray .tray-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
  white-space: nowrap;
}
.tray-items {
  display: flex;
  gap: var(--space-2);
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  list-style: none;
  margin: 0;
  padding: 0;
}
.tray-items li {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  max-width: 14rem;
  padding: 0.125rem 0.125rem 0.125rem 0.5rem;
  background: var(--surface-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-2);
  font-size: var(--fs-xs);
  white-space: nowrap;
}
.tray-items li span {
  overflow: hidden;
  text-overflow: ellipsis;
}
.tray-items button {
  border: 0;
  background: none;
  color: var(--text-2);
  padding: 0 0.25rem;
  line-height: 1;
}
.tray-items button:hover {
  color: var(--text-1);
}
.tray-note {
  font-size: var(--fs-xs);
  color: var(--accent-text);
}
body.has-tray {
  padding-bottom: 3.5rem;
}
@media (max-width: 767.98px) {
  .compare-tray {
    bottom: calc(3.75rem + env(safe-area-inset-bottom, 0px));
  }
  .compare-tray .tray-label {
    display: none;
  }
  body.has-tray {
    padding-bottom: 8rem;
  }
}

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

.product-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--space-3);
  font-size: var(--fs-sm);
}
.product-nav .nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-2);
  color: var(--text-1);
  text-decoration: none;
  font-weight: 600;
}
.product-nav .nav-btn:hover {
  border-color: var(--accent-line);
  background: var(--surface-2);
}
.product-nav .nav-btn.disabled {
  color: var(--text-3);
  border-color: var(--line);
  pointer-events: none;
}
.product-nav .nav-info {
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.product-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2) var(--space-3);
  margin-bottom: var(--space-4);
}
.product-title h1 {
  margin: 0;
}
.product-title .mfr {
  display: block;
  width: 100%;
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
}
.product-main-image {
  max-width: 100%;
  max-height: 18.75rem;
  object-fit: contain;
  border-radius: var(--radius-3);
  border: 1px solid var(--line);
  background: var(--surface-2);
  cursor: zoom-in;
}
.no-image-placeholder {
  flex-direction: column;
  width: 100%;
  height: 11rem;
  font-size: var(--fs-sm);
}
.no-image-placeholder i {
  font-size: 2rem;
}
.product-image-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.product-thumbnail {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: contain;
  background: #e9eaec;
  border-radius: var(--radius-2);
  border: 2px solid var(--line);
  cursor: pointer;
}
.product-thumbnail:hover,
.product-thumbnail.active {
  border-color: var(--accent);
}
.completeness {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--fs-xs);
  color: var(--text-2);
}
.completeness .progress {
  flex: 1 1 8rem;
  max-width: 12.5rem;
  height: 6px;
}
.link-card {
  height: 100%;
  border-left: 3px solid var(--accent);
}
.link-card .card-title {
  font-size: var(--fs-base);
}
.similar-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.similar-list li {
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--line);
}
.similar-list li:last-child {
  border-bottom: 0;
}
.similar-list a {
  font-weight: 600;
}
.link-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: var(--fs-sm);
}
.link-list li + li {
  margin-top: var(--space-2);
}
.link-list a {
  display: inline-flex;
  gap: var(--space-2);
  color: var(--text-1);
  text-decoration: none;
}
.link-list a i {
  color: var(--text-3);
}
.link-list a:hover {
  color: var(--accent-text);
  text-decoration: underline;
}
@media (max-width: 767.98px) {
  .spec-label {
    width: 45%;
  }
  .btn-back-mobile {
    display: block;
    width: 100%;
    text-align: center;
  }
  .product-thumbnail {
    width: 3.5rem;
    height: 3.5rem;
  }
}

/* Lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1085;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.92);
}
.lightbox-overlay.show {
  display: flex;
}
.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
  color: #ffffff;
}
.lightbox-image {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  background: #e9eaec;
}
.lightbox-close,
.lightbox-nav {
  position: fixed;
  z-index: 1086;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
  font-size: 1.25rem;
  cursor: pointer;
}
.lightbox-close {
  top: 1rem;
  right: 1rem;
}
.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
}
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(0, 0, 0, 0.8);
  border-color: #ffffff;
}

.swipe-indicator {
  display: none;
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  padding: var(--space-3);
  background: var(--overlay);
  color: #ffffff;
  border-radius: var(--radius-2);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.swipe-indicator.left { left: 0.5rem; }
.swipe-indicator.right { right: 0.5rem; }
.swipe-indicator.visible { opacity: 1; }
@media (max-width: 767.98px) {
  .swipe-indicator {
    display: block;
  }
}

/* ---- Stats: inline SVG bar charts ------------------------------------------ */

.chart-card .card-body {
  padding-top: var(--space-3);
}
.chart-note {
  font-size: var(--fs-xs);
  color: var(--text-3);
  margin: 0 0 var(--space-3);
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-3);
  font-size: var(--fs-xs);
  color: var(--text-2);
}
.chart-legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}
.chart-legend .swatch {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 2px;
}
.swatch-verified { background: var(--viz-verified); }
.swatch-unverified { background: var(--viz-unverified); }
.bar-chart {
  display: block;
  width: 100%;
  overflow: visible;
  font-family: var(--font-body);
}
.bar-chart .bar-label {
  fill: var(--text-1);
  font-size: 13px;
  font-weight: 500;
}
.bar-chart .bar-value {
  fill: var(--text-2);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.bar-chart .bar-value tspan.v {
  fill: var(--text-1);
  font-weight: 600;
}
.bar-chart .bar-track {
  fill: var(--viz-grid);
}
.bar-chart .seg-verified { fill: var(--viz-verified); }
.bar-chart .seg-unverified { fill: var(--viz-unverified); }
.bar-chart .bar-hit {
  fill: transparent;
  stroke: transparent;
  stroke-width: 2;
}
.bar-chart .bar-row {
  cursor: default;
}
.bar-chart a.bar-row,
.bar-chart a.bar-row text {
  text-decoration: none;
}
.bar-chart a.bar-row {
  cursor: pointer;
}
.bar-chart .bar-row:hover .bar-hit {
  fill: rgba(var(--bs-emphasis-color-rgb), 0.04);
}
.bar-chart .bar-row:hover .seg-verified,
.bar-chart .bar-row:focus-visible .seg-verified {
  fill: var(--accent);
}
.bar-chart a.bar-row:hover .bar-label,
.bar-chart a.bar-row:focus-visible .bar-label {
  text-decoration: underline;
}
.bar-chart .bar-row:focus {
  outline: none;
}
.bar-chart .bar-row:focus-visible .bar-hit {
  stroke: var(--focus);
}
.chart-tip {
  position: fixed;
  z-index: 1070;
  pointer-events: none;
  min-width: 10rem;
  padding: var(--space-2) var(--space-3);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-2);
  box-shadow: var(--elev-overlay);
  font-size: var(--fs-xs);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.chart-tip[hidden] {
  display: none;
}
.chart-tip .tip-value {
  display: block;
  font-size: var(--fs-md);
  font-weight: 700;
  color: var(--text-1);
}
.chart-tip .tip-row {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.chart-tip .tip-key {
  width: 0.75rem;
  height: 2px;
}
.chart-tip .tip-cat {
  display: block;
  color: var(--text-1);
  font-weight: 600;
  margin-bottom: 0.125rem;
}
.meter-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.meter-list li + li {
  margin-top: var(--space-3);
}
.meter-head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: var(--fs-sm);
  margin-bottom: 0.25rem;
}
.meter-head .num {
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.meter-list .progress {
  height: 6px;
}

/* ---- Downloads --------------------------------------------------------------- */

.doc-filter .card-body {
  max-height: 32rem;
  overflow-y: auto;
}
.doc-filter .list-group-item.active .badge {
  background: var(--accent-ink) !important;
  color: var(--accent) !important;
}
@media (min-width: 768px) {
  .doc-filter {
    position: sticky;
    top: var(--space-4);
  }
}
@media (max-width: 767.98px) {
  .doc-filter .card-body {
    max-height: 12rem;
  }
  .doc-table .col-size {
    display: none;
  }
}
@media (max-width: 575.98px) {
  .doc-table .col-type {
    display: none;
  }
}

/* ---- Ask ------------------------------------------------------------------------ */

.ask-input {
  font-size: var(--fs-md);
  padding: 0.75rem 1rem;
}
.ask-answer {
  border-left: 3px solid var(--accent);
}
.ask-thumb {
  flex-shrink: 0;
  width: 4rem;
  height: 4rem;
  object-fit: contain;
  background: var(--surface-2);
  border-radius: var(--radius-2);
  border: 1px solid var(--line);
}
.example-chip {
  display: inline-block;
  margin: 0 0.25rem 0.375rem 0;
  padding: 0.25rem 0.625rem;
  background: var(--surface-1);
  color: var(--text-1);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-2);
  font-size: var(--fs-sm);
  cursor: pointer;
}
.example-chip:hover {
  border-color: var(--accent-line);
  background: var(--surface-2);
}

/* ---- Guide (L2 article) ----------------------------------------------------- */

.grade-card {
  height: 100%;
  border-top: 3px solid var(--text-3);
}
.grade-card.d8plus {
  border-top-color: var(--accent);
}
.grade-card.c1 {
  border-top-color: var(--danger);
}
.cite {
  font-size: var(--fs-xs);
  color: var(--text-2);
}
.req-yes {
  color: var(--verified);
  font-weight: 600;
}
.req-no {
  color: var(--danger);
  font-weight: 600;
}
.derate-table td,
.derate-table th {
  text-align: center;
}
.prose {
  max-width: 72ch;
}

/* ---- Error / compare placeholder ------------------------------------------- */

.status-block {
  max-width: 36rem;
  padding: var(--space-4) 0 var(--space-6);
}
.status-code {
  font-family: var(--font-display);
  font-size: 4.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-3);
}

/* ==========================================================================
   7. Admin (views/admin/*) — same tokens, same components
   ========================================================================== */

.admin-center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.admin-card {
  width: 100%;
  max-width: 25rem;
  padding: var(--space-6);
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-3);
}
.admin-card.wide {
  max-width: 31.25rem;
}
.admin-card h1 {
  font-size: var(--fs-xl);
  margin-bottom: var(--space-1);
}
.admin-card .subtitle {
  color: var(--text-2);
  font-size: var(--fs-sm);
  margin-bottom: var(--space-5);
}
.admin-card pre {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-2);
  color: var(--text-1);
  padding: var(--space-3);
}
.error-msg {
  background: var(--danger-wash);
  color: var(--danger);
  border: 1px solid var(--danger);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-2);
  margin-bottom: var(--space-4);
  font-size: var(--fs-sm);
}
.admin-stat,
.task-card {
  height: 100%;
  padding: var(--space-4);
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-3);
}
.task-card {
  height: auto;
  margin-bottom: var(--space-3);
}
.admin-stat .number {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--text-1);
}
.admin-stat .label {
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.task-btn {
  min-width: 7.5rem;
}
.output-box {
  display: none;
  max-height: 25rem;
  overflow-y: auto;
  padding: var(--space-3);
  background: var(--surface-0);
  border: 1px solid var(--line);
  border-radius: var(--radius-2);
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  white-space: pre-wrap;
}
.output-box.show {
  display: block;
}
.backup-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.backup-list li {
  display: flex;
  justify-content: space-between;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-sm);
}
.backup-list li:last-child {
  border-bottom: 0;
}

/* ==========================================================================
   8. C2 interactions — compare page, product scorecard, units, Ask panel
   ========================================================================== */

.compare-table {
  table-layout: fixed;
}
/* Up to two hoists fit a phone; three or four scroll sideways inside the
   .table-responsive wrapper rather than squeezing every column. */
.compare-table.cols-3 { min-width: 34rem; }
.compare-table.cols-4 { min-width: 44rem; }

.compare-table .compare-spec,
.compare-table tbody th {
  width: 11rem;
}
.table.compare-table > thead > tr > th {
  vertical-align: top;
  text-transform: none;
  letter-spacing: 0;
  white-space: normal;
  font-size: var(--fs-sm);
  color: var(--text-1);
}
.table.compare-table > thead > tr > th.compare-spec {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-2);
  vertical-align: bottom;
}
.compare-mfr {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-2);
}
.compare-model {
  display: block;
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--text-1);
  text-decoration: none;
  margin-bottom: 0.25rem;
}
.compare-model:hover {
  color: var(--accent-text);
  text-decoration: underline;
}
.compare-head-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.375rem;
}
.compare-remove {
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text-2);
}
.compare-table tr.is-diff > * {
  background-color: var(--accent-wash) !important;
  --bs-table-bg-type: transparent;
}
.compare-table tr.is-diff > th {
  box-shadow: inset 3px 0 0 var(--accent);
}

.scorecard {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: var(--fs-sm);
}
.scorecard li {
  display: grid;
  grid-template-columns: 1.25rem 1fr auto;
  align-items: center;
  gap: var(--space-2);
  padding: 0.3125rem 0;
  border-bottom: 1px solid var(--line);
}
.scorecard li:last-child {
  border-bottom: 0;
}
.scorecard .is-present i {
  color: var(--verified);
}
.scorecard .is-missing i,
.scorecard .is-missing .sc-label {
  color: var(--text-3);
}
.scorecard .sc-state {
  font-size: var(--fs-xs);
  color: var(--text-2);
}
.scorecard .is-missing .sc-state {
  font-style: italic;
  color: var(--text-3);
}
.unit-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.unit-qualifier {
  font-size: var(--fs-xs);
  color: var(--text-2);
}
.unit-source {
  font-size: var(--fs-xs);
  color: var(--text-2);
}
.unit-toggles {
  gap: var(--space-2);
  flex-wrap: wrap;
}
.js .unit-toggles.js-only {
  display: flex !important;
}
.unit-toggles .btn[aria-pressed="true"] {
  background: var(--surface-3);
  border-color: var(--text-3);
  color: var(--text-1);
}
.product-title .compare-toggle {
  align-self: center;
}
.ask-out {
  padding: var(--space-3);
  background: var(--surface-0);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-2);
}
.ask-answer-text {
  font-size: var(--fs-md);
  margin-bottom: var(--space-1);
}
.ask-cites {
  padding-left: 1.25rem;
  margin-bottom: var(--space-2);
  font-size: var(--fs-sm);
}
.ask-cites li + li {
  margin-top: 0.25rem;
}
.compare-table .prov-badge {
  white-space: normal;
}
@media (max-width: 575.98px) {
  .compare-table .compare-spec,
  .compare-table tbody th {
    width: 6.5rem;
  }
  .table.compare-table > :not(caption) > * > * {
    padding: 0.4375rem 0.5rem;
    overflow-wrap: anywhere;
  }
}

/* ==========================================================================
   9. 3D viewer (views/partials/model-viewer.ejs, /js/model-viewer-init.js)
   ========================================================================== */

/* 3D viewer */
.mv-shell {
  margin-bottom: var(--space-5);
  container-type: inline-size;
}
.mv-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.js .mv-toolbar.js-only {
  display: flex !important;
  flex-wrap: wrap;
  gap: var(--space-1);
}
.mv-toolbar .btn[aria-pressed="true"] {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

/* The element itself. Without JS it is an unknown inline element, so the
   box, the poster and the status are all set here, not by model-viewer. */
model-viewer.mv {
  display: block;
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  max-height: 72vh;
  background-color: var(--viewer-bg);
  border: 1px solid var(--viewer-line);
  border-radius: var(--radius-3);
  overflow: hidden;
  --poster-color: transparent;
}
@container (max-width: 519.98px) {
  model-viewer.mv {
    aspect-ratio: 1 / 1;
  }
}
.mv-progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  pointer-events: none;
}
.mv-progress-bar {
  width: 100%;
  height: 100%;
  background: var(--accent);
  transform: scaleX(var(--mv-progress, 0));
  transform-origin: left center;
}
.mv-progress.is-done,
model-viewer:not(:defined) > .mv-progress {
  display: none;
}
.mv-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
model-viewer:defined > .mv-fallback,
model-viewer:not(:defined) > .mv-hotspot,
model-viewer:not(:defined) > .mv-note-panel {
  display: none;
}

/* Draft label, on the model in every state. */
.mv-status {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 1;
  max-width: calc(100% - var(--space-4));
  margin: 0;
  padding: 0.125rem 0.5rem;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: var(--radius-1);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  pointer-events: none;
}
@container (max-width: 519.98px) {
  /* One line on a phone, so it does not sit on the suspension eye. */
  .mv-status {
    padding: 0.0625rem 0.375rem;
    font-size: 0.625rem;
    letter-spacing: 0.01em;
    white-space: nowrap;
  }
}

/* Hotspots: a numbered amber dot on the surface; the label sits beside it
   when the viewer is wide enough, and the note shows in the caption panel. */
.mv-hotspot {
  position: relative;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  color: var(--accent-ink);
  background: var(--accent);
  border: 2px solid var(--surface-1);
  border-radius: 50%;
  font: 700 0.6875rem/1 var(--font-body);
  cursor: pointer;
  --min-hotspot-opacity: 0.3;
}
.mv-hotspot:hover,
.mv-hotspot[aria-expanded="true"] {
  background: var(--accent-hover);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.mv-hotspot:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.mv-hotspot-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.mv-hotspot-note {
  display: none;
}
@container (min-width: 640px) {
  .mv-hotspot-label {
    left: calc(100% + 0.3125rem);
    top: 50%;
    width: auto;
    height: auto;
    clip: auto;
    transform: translateY(-50%);
    padding: 0.0625rem 0.375rem;
    color: var(--viewer-caption-ink);
    background: var(--viewer-caption-bg);
    border-radius: var(--radius-1);
    font-size: var(--fs-xs);
    font-weight: 600;
    pointer-events: none;
  }
  .mv-hotspot:not([data-visible]) .mv-hotspot-label {
    display: none;
  }
}
.mv-note-panel {
  position: absolute;
  left: var(--space-2);
  right: 3.75rem; /* clear of model-viewer's AR button */
  bottom: var(--space-2);
  z-index: 1;
  margin: 0;
  padding: var(--space-2) var(--space-3);
  color: var(--viewer-caption-ink);
  background: var(--viewer-caption-bg);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-2);
  font-size: var(--fs-sm);
  pointer-events: none;
}
.mv-note-panel strong {
  display: block;
}

/* Part list */
.mv-parts {
  margin-top: var(--space-3);
}
.mv-parts-title {
  margin-bottom: var(--space-2);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.mv-hint {
  margin-left: var(--space-2);
  color: var(--text-3);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}
.mv-part-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}
.mv-part {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-height: 2rem;
  padding: 0.25rem 0.625rem;
  color: var(--text-1);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-2);
  font-size: var(--fs-sm);
  line-height: 1.2;
  text-align: left;
}
.mv-part:hover {
  border-color: var(--line-strong);
}
.mv-part[aria-pressed="true"] {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}
.mv-part-num {
  display: inline-grid;
  place-items: center;
  width: 1.125rem;
  height: 1.125rem;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: 50%;
  font-size: 0.625rem;
  font-weight: 700;
}
.mv-part[aria-pressed="true"] .mv-part-num {
  color: var(--accent);
  background: var(--accent-ink);
}
@container (max-width: 519.98px) {
  .mv-part {
    min-height: 1.75rem;
    padding: 0.1875rem 0.5rem;
    font-size: var(--fs-xs);
  }
}

/* Provenance strip */
.mv-provenance {
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--surface-0);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-2);
  font-size: var(--fs-sm);
}
.mv-provenance p {
  margin: 0;
}
.mv-provenance p + p {
  margin-top: var(--space-1);
}
.mv-provenance-status {
  color: var(--accent-text);
  letter-spacing: 0.02em;
}
.mv-provenance-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem var(--space-3);
  color: var(--text-2);
}
.mv-provenance-meta code {
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.mv-provenance-note {
  color: var(--text-2);
}

/* Fullscreen: the whole viewer section fills the screen, model on top. */
.mv-shell:fullscreen {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: var(--space-3);
  overflow: auto;
  background: var(--surface-1);
}
.mv-shell:fullscreen model-viewer.mv {
  flex: 1 1 auto;
  min-height: 50vh;
  max-height: none;
  aspect-ratio: auto;
}

/* ==========================================================================
   10. Plain-language shell, search lines, product summary, motion
       (13/10/2026). One message per idea: trust is a badge plus one
       legend, explained once at /guides/hoist-classifications#trust.
   ========================================================================== */

/* ---- Motion -------------------------------------------------------------
   Progressive only. Page-to-page: the browser's cross-document View
   Transitions (a result thumbnail morphs into the product photo through a
   shared view-transition-name). In-page: .reveal fades up once. Everything
   is off under prefers-reduced-motion. */
@view-transition {
  navigation: auto;
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 200ms;
  animation-timing-function: var(--ease);
}
::view-transition-group(*) {
  animation-duration: 340ms;
  animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
}
.motion .reveal:not(.is-in) {
  opacity: 0;
  transform: translateY(6px);
}
.motion .reveal.is-in {
  transition: opacity 320ms var(--ease), transform 320ms var(--ease);
  transition-delay: calc(min(var(--i, 0), 10) * 35ms);
}
@keyframes chip-in {
  from { opacity: 0; transform: scale(0.85); }
}
@keyframes fade-in {
  from { opacity: 0; }
}
@keyframes ring-in {
  from { stroke-dasharray: 0 100; }
}
@keyframes seg-in {
  from { transform: scaleX(0); }
}
@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}

/* ---- Shell ---------------------------------------------------------------- */
.dropdown-item i {
  margin-right: 0.5rem;
  color: var(--text-3);
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3) var(--space-5);
}
.site-footer .footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-1);
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
  text-decoration: none;
}
.site-footer .footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  font-size: var(--fs-sm);
}

/* ---- Home ----------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(15rem, 1fr);
  gap: var(--space-6);
  align-items: center;
  padding: var(--space-6) 0 var(--space-5);
}
.hero h1 {
  margin: 0 0 var(--space-3);
  font-family: var(--font-display);
  font-size: clamp(2.375rem, 5.2vw, 3.625rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
}
.hero-lead {
  margin-bottom: var(--space-4);
  color: var(--text-2);
  font-size: var(--fs-md);
}
.hero-lead strong {
  color: var(--text-1);
}
.hero-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.375rem 0.375rem 0.375rem var(--space-4);
  background: var(--field-bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-3);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.hero-search:focus-within,
.filter-bar .search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.hero-search > .bi-search,
.filter-bar .search-box > .bi-search {
  color: var(--text-3);
}
.hero-search input,
.filter-bar .search-box input {
  flex: 1;
  border: 0;
  background: transparent;
  box-shadow: none !important;
  font-size: var(--fs-md);
}
.hero-search .autocomplete-container {
  top: calc(100% + 4px);
  left: 0;
  right: 0;
}
.quick-paths {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-4);
}
.qp-row {
  display: grid;
  grid-template-columns: 4.75rem minmax(0, 1fr);
  align-items: baseline;
  gap: var(--space-2);
}
.qp-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
}
.qp-label {
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.qp-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.6875rem;
  color: var(--text-1);
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: var(--fs-sm);
  text-decoration: none;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.qp-chip:hover,
.qp-chip:focus-visible {
  border-color: var(--accent-line);
  background: var(--accent-wash);
  color: var(--text-1);
  transform: translateY(-1px);
}
.qp-count {
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.qp-more {
  color: var(--accent-text);
}
.qp-more i {
  font-size: var(--fs-xs);
}
.qp-help {
  color: var(--text-3);
  padding: 0 0.25rem;
}
.hero-trust {
  padding: var(--space-5);
  text-align: center;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-3);
}
.trust-ring {
  position: relative;
  width: 9.5rem;
  margin: 0 auto var(--space-3);
}
.trust-ring svg {
  display: block;
  width: 100%;
  transform: rotate(-90deg);
}
.ring-track,
.ring-fill {
  fill: none;
  stroke-width: 10;
}
.ring-track {
  stroke: var(--surface-3);
}
.ring-fill {
  stroke: var(--verified);
  stroke-linecap: round;
  stroke-dasharray: var(--pct) 100;
}
.motion .ring-fill {
  animation: ring-in 1.2s var(--ease) both 150ms;
}
.ring-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  line-height: 1.05;
}
.ring-label strong {
  font-family: var(--font-display);
  font-size: 2.5rem;
}
.ring-label span {
  color: var(--text-2);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.trust-copy {
  margin: 0 0 var(--space-3);
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.trust-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  font-size: var(--fs-sm);
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
  margin: var(--space-5) 0 var(--space-3);
}
.section-head h2 {
  margin: 0;
}
.section-link {
  font-size: var(--fs-sm);
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: var(--space-3);
}
.product-card {
  transition: border-color var(--dur) var(--ease), transform 220ms var(--ease);
}
.product-card:hover,
.product-card:focus-within {
  transform: translateY(-2px);
}
.product-card .card-img-link img {
  transition: transform 420ms var(--ease);
}
.product-card:hover .card-img-link img {
  transform: scale(1.03);
}
.product-card .card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-2);
}
.card-actions {
  margin-top: var(--space-3);
}
@media (max-width: 767.98px) {
  .hero {
    grid-template-columns: 1fr;
    gap: var(--space-4);
    padding-top: var(--space-4);
  }
  .hero-trust {
    display: grid;
    grid-template-columns: 5.5rem 1fr;
    gap: var(--space-2) var(--space-3);
    align-items: center;
    padding: var(--space-3);
    text-align: left;
  }
  .trust-ring {
    width: 5.5rem;
    margin: 0;
  }
  .ring-label strong {
    font-size: 1.375rem;
  }
  .ring-label span {
    font-size: 0.625rem;
  }
  .trust-copy {
    margin: 0;
  }
  .trust-links {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .qp-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

/* ---- Search --------------------------------------------------------------- */
.search-head {
  margin: var(--space-4) 0 var(--space-3);
}
.search-head h1 {
  margin-bottom: var(--space-3);
  font-size: var(--fs-2xl);
}
.filter-bar {
  display: grid;
  gap: var(--space-3);
}
.filter-bar .search-box {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-3);
  background: var(--field-bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-3);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.filter-bar .search-box input {
  padding: 0.625rem 0.25rem;
}
.filter-bar .search-box .autocomplete-container {
  top: calc(100% + 4px);
  left: 0;
  right: 0;
}
.kbd-hint {
  padding: 0.0625rem 0.375rem;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-1);
  font-size: var(--fs-xs);
}
.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr));
  gap: var(--space-2) var(--space-3);
  align-items: end;
}
.filter-field {
  display: grid;
  gap: 0.25rem;
  margin: 0;
}
.filter-field > span {
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.filter-switch .form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.375rem;
  margin: 0;
}
.switch-count {
  margin-left: 0.25rem;
  padding: 0 0.4375rem;
  color: var(--verified);
  background: var(--verified-wash);
  border-radius: 999px;
  font-size: var(--fs-xs);
}
.more-filters summary {
  width: max-content;
  color: var(--text-2);
  font-size: var(--fs-sm);
  cursor: pointer;
}
.more-filters .filter-row {
  margin-top: var(--space-2);
}
.active-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  margin-top: var(--space-3);
}
.active-chips[hidden] {
  display: none;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.1875rem 0.375rem 0.1875rem 0.6875rem;
  color: var(--text-1);
  background: var(--accent-wash);
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  font-size: var(--fs-sm);
  text-decoration: none;
  animation: chip-in 220ms var(--ease) both;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.filter-chip:hover,
.filter-chip:focus-visible {
  color: var(--accent-ink);
  background: var(--accent);
}
.filter-chip .bi-x {
  font-size: 1rem;
  opacity: 0.75;
}
.chip-clear {
  margin-left: 0.25rem;
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.trust-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.trust-legend a {
  margin-left: 0.25rem;
  color: var(--text-2);
}
.type-chip {
  display: inline-flex;
  align-items: center;
  padding: 0 0.4375rem;
  color: var(--text-2);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-1);
  font-size: var(--fs-xs);
  line-height: 1.5;
}
.line-chip {
  margin-left: 0.25rem;
  color: var(--text-3);
  font-family: var(--font-body);
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
}
.badge-count {
  align-self: center;
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.result-thumb img {
  transition: transform 300ms var(--ease);
}
.result:hover .result-thumb img {
  transform: scale(1.06);
}
.result-group .size-pills {
  grid-column: 2 / -1;
  margin-top: calc(var(--space-1) * -1);
}
.size-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3125rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.size-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.125rem 0.5625rem;
  color: var(--text-1);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.size-pill:hover,
.size-pill:focus-visible {
  color: var(--text-1);
  border-color: var(--accent-line);
  transform: translateY(-1px);
}
.size-pill.is-current {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}
.pill-dot {
  flex: 0 0 auto;
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: 50%;
  border: 1px solid var(--text-3);
}
.is-checked .pill-dot {
  background: var(--verified);
  border-color: var(--verified);
}
.is-maker .pill-dot {
  background: var(--info);
  border-color: var(--info);
}
.size-pill.is-current .pill-dot {
  border-color: var(--accent-ink);
}
.results.is-gallery .result-group .size-pills {
  grid-column: auto;
  margin-top: 0;
}
.empty-icon {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--text-3);
  font-size: 2rem;
}
@media (max-width: 767.98px) {
  .result-group .size-pills {
    grid-column: 1 / -1;
    margin-top: 0;
  }
  .kbd-hint {
    display: none;
  }
  .filter-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---- Product -------------------------------------------------------------- */
.product-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  margin: var(--space-3) 0 var(--space-4);
}
.product-topbar .product-nav {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
}
.product-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: var(--space-5) var(--space-6);
  align-items: start;
  margin-bottom: var(--space-5);
}
.product-media {
  position: sticky;
  top: calc(var(--header-h) + var(--space-3));
  display: grid;
  gap: var(--space-2);
}
.media-main {
  margin: 0;
  overflow: hidden;
  background: #f4f4f2;
  border: 1px solid var(--line);
  border-radius: var(--radius-3);
}
.media-zoom {
  display: block;
  width: 100%;
  padding: 0;
  background: none;
  border: 0;
  cursor: zoom-in;
}
.media-main .product-main-image {
  display: block;
  width: 100%;
  max-height: none;
  aspect-ratio: 4 / 3;
  padding: var(--space-4);
  object-fit: contain;
}
.media-caption {
  display: flex;
  gap: 0.375rem;
  padding: 0.375rem var(--space-3);
  color: #4a4f57;
  background: #ebeae6;
  border-top: 1px solid #dcd8cf;
  font-size: var(--fs-xs);
}
.product-media .product-image-gallery {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  justify-content: flex-start;
}
.product-media .product-thumbnail {
  flex: 0 0 4rem;
  width: 4rem;
  height: 4rem;
  padding: 0;
  overflow: hidden;
  background: #f4f4f2;
  border: 1px solid var(--line);
  border-radius: var(--radius-2);
  opacity: 0.7;
  transition: opacity var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.product-media .product-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.product-media .product-thumbnail.active,
.product-media .product-thumbnail:hover {
  opacity: 1;
  border-color: var(--accent);
}
.no-image-placeholder .hoist-outline {
  width: 2.75rem;
  margin-bottom: var(--space-2);
  color: var(--text-3);
}
.no-image-placeholder p {
  margin: 0;
  color: var(--text-3);
  font-size: var(--fs-sm);
}
.product-summary .mfr {
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-decoration: none;
  text-transform: uppercase;
}
.product-summary h1 {
  margin: 0.25rem 0 var(--space-2);
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.875rem);
  line-height: 1.05;
}
.product-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: var(--space-4);
}
.key-specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 var(--space-2);
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-3);
}
.key-spec {
  padding: var(--space-3) var(--space-4);
  background: var(--surface-1);
}
.key-spec dt {
  margin-bottom: 0.25rem;
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.key-spec dd {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.key-spec dd.cell-empty,
.key-spec .cell-empty {
  font-size: var(--fs-sm);
  font-weight: 400;
}
.key-spec .unit-source {
  display: block;
  margin-top: 0.125rem;
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: 400;
}
.key-spec .classification-badge {
  font-size: var(--fs-sm);
}
.product-summary .unit-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.sizes {
  margin-bottom: var(--space-4);
}
.sizes-label {
  display: block;
  margin-bottom: 0.375rem;
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.sizes .size-pill {
  padding: 0.25rem 0.75rem;
  font-size: var(--fs-sm);
}
.source-line,
.note-line {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0 0 var(--space-3);
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.product-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
.product-actions .btn i {
  margin-right: 0.375rem;
}
.product-body {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(16rem, 1fr);
  gap: var(--space-4);
  align-items: start;
  margin-bottom: var(--space-4);
}
.product-aside {
  display: grid;
  gap: var(--space-3);
}
.source-notes {
  margin-top: var(--space-3);
  font-size: var(--fs-sm);
}
.source-notes summary,
.score-details summary {
  width: max-content;
  color: var(--text-2);
  font-size: var(--fs-sm);
  cursor: pointer;
}
.source-notes .prose {
  margin: var(--space-2) 0 0;
  color: var(--text-2);
  white-space: pre-line;
}
.score-meter {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 3px;
  margin-bottom: var(--space-2);
}
.score-meter span {
  height: 0.5rem;
  background: var(--surface-3);
  border-radius: 2px;
}
.score-meter span.on {
  background: var(--verified);
  transform-origin: left;
}
.motion .score-meter span.on {
  animation: seg-in 380ms var(--ease) both;
}
.score-details .scorecard {
  margin-top: var(--space-2);
}
.doc-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.doc-list a {
  display: grid;
  grid-template-columns: 4.75rem minmax(0, 1fr) auto;
  gap: var(--space-2);
  align-items: center;
  padding: 0.5rem var(--space-4);
  color: var(--text-1);
  border-top: 1px solid var(--line);
  font-size: var(--fs-sm);
  text-decoration: none;
}
.doc-list li:first-child a {
  border-top: 0;
}
.doc-list a:hover,
.doc-list a:focus-visible {
  background: rgba(var(--bs-emphasis-color-rgb), 0.035);
}
.doc-type {
  color: var(--text-3);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.doc-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
dialog.lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  padding: 0;
  background: transparent;
  border: 0;
}
dialog.lightbox::backdrop {
  background: var(--overlay);
}
dialog.lightbox[open] {
  display: grid;
  place-items: center;
  animation: fade-in 180ms var(--ease);
}
dialog.lightbox .lightbox-image {
  max-width: 92vw;
  max-height: 84vh;
  object-fit: contain;
  background: #fff;
  border-radius: var(--radius-2);
}
dialog.lightbox .lightbox-close,
dialog.lightbox .lightbox-nav {
  position: fixed;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
}
dialog.lightbox .lightbox-close {
  top: 1rem;
  right: 1rem;
}
dialog.lightbox .lightbox-prev {
  left: 1rem;
  top: 50%;
}
dialog.lightbox .lightbox-next {
  right: 1rem;
  top: 50%;
}
.lightbox-counter {
  position: fixed;
  bottom: 1rem;
  left: 0;
  right: 0;
  margin: 0;
  color: #fff;
  text-align: center;
  font-size: var(--fs-sm);
}
@media (max-width: 991.98px) {
  .product-hero,
  .product-body {
    grid-template-columns: 1fr;
  }
  .product-media {
    position: static;
  }
  /* On a narrow screen the name and key specs come first; media follows. */
  .product-summary {
    order: -1;
  }
}

/* ---- Guide: how we verify ------------------------------------------------ */
.trust-defs {
  display: grid;
  gap: var(--space-3);
  margin: var(--space-3) 0;
}
.trust-defs > div {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: var(--space-3);
  align-items: baseline;
}
.trust-defs dd {
  margin: 0;
}
.trust-explainer:target {
  border-color: var(--accent);
  transition: border-color 1.2s var(--ease);
}

.long-value summary {
  cursor: pointer;
  list-style: none;
}
.long-value summary::after {
  content: " more";
  color: var(--accent-text);
}
.long-value[open] summary {
  display: none;
}

@media (max-width: 767.98px) {
  .filter-switch > span {
    display: none;
  }
}
