/* ===========================================================================
   R2 Reservation Tracker — styling inspired by rivian.com:
   clean, generous whitespace, near-black + warm off-white, yellow accent,
   small uppercase labels, geometric sans. Mobile-first.
   =========================================================================== */

:root {
  --bg: #f4f3ef;          /* warm off-white */
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --ink: #131313;
  --ink-soft: #5b5b58;
  --line: #e3e2dc;
  --line-strong: #cfcec7;
  --accent: #fedb00;       /* Rivian yellow */
  --accent-ink: #131313;
  --green: #38463a;        /* earthy Rivian green */
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(19, 19, 19, .05), 0 8px 24px rgba(19, 19, 19, .04);
  --maxw: 1120px;
  --header-h: 60px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

[data-theme="dark"] {
  --bg: #0f0f0f;
  --surface: #181818;
  --surface-2: #1f1f1f;
  --ink: #f3f2ee;
  --ink-soft: #a3a29b;
  --line: #2a2a2a;
  --line-strong: #3a3a3a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

/* The hidden attribute must win over component display rules (e.g. badges,
   pills) that set display:inline-grid / flex / block. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; overflow-x: clip; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Lock the page to its width like a native app: no sideways scroll, and no
     overscroll chaining/bounce (pull-to-refresh, rubber-banding). */
  overflow-x: clip;
  overscroll-behavior-y: none;
}

a { color: inherit; text-underline-offset: 2px; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 20px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -.01em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 9px;
  font-weight: 800;
  font-size: .95rem;
  letter-spacing: -.02em;
}
.brand-text { font-size: .98rem; }

.theme-toggle {
  width: 46px; height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  position: relative;
  cursor: pointer;
  padding: 0;
}
.theme-toggle-dot {
  position: absolute;
  top: 50%; left: 4px;
  transform: translateY(-50%);
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--ink);
  transition: left .2s ease, background .2s ease;
  display: grid;
  place-items: center;
}
[data-theme="dark"] .theme-toggle-dot { left: 22px; background: var(--accent); }

.theme-toggle-dot svg {
  grid-area: 1 / 1;
  width: 12px; height: 12px;
  transition: transform .25s ease, opacity .2s ease;
}
.theme-toggle-dot .sun-icon {
  color: var(--surface);
  opacity: 1;
  transform: scale(1) rotate(0deg);
}
.theme-toggle-dot .moon-icon {
  color: #131313;
  opacity: 0;
  transform: scale(0) rotate(-90deg);
}
[data-theme="dark"] .theme-toggle-dot .sun-icon {
  opacity: 0;
  transform: scale(0) rotate(90deg);
}
[data-theme="dark"] .theme-toggle-dot .moon-icon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.header-actions { display: flex; align-items: center; gap: 12px; }
/* Compact submit button that surfaces in the header once the controls pin. */
.header-submit {
  padding: 6px 12px; font-size: .82rem; line-height: 1.2;
  opacity: 0; transform: translateY(-6px); pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
body.scrolled .header-submit { opacity: 1; transform: none; pointer-events: auto; }
@media (max-width: 560px) {
  .header-submit { padding: 5px 10px; font-size: .75rem; line-height: 1.2; }
  body.scrolled .brand-text { display: none; }
}
@media (max-width: 560px) {
  .brand-text { display: none; }
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 60;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  border-radius: 50%;
  box-shadow: var(--shadow);
  cursor: pointer;
  /* Hidden until revealed: faded out and nudged down, ignoring taps. */
  opacity: 0; transform: translateY(12px) scale(.9); pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, background .15s ease;
}
.back-to-top svg { width: 22px; height: 22px; }
.back-to-top.visible { opacity: 1; transform: none; pointer-events: auto; }
.back-to-top:hover { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
@media (prefers-reduced-motion: reduce) {
  .back-to-top { transition: opacity .2s ease; transform: none; }
}

/* ---------- Submission fork dialog ---------- */
.submit-dialog {
  border: none;
  background: transparent;
  padding: 0;
  max-width: 460px;
  width: calc(100% - 32px);
}
.submit-dialog::backdrop { background: rgba(19, 19, 19, .55); backdrop-filter: blur(3px); }
.submit-dialog-inner {
  position: relative;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 24px 24px;
}
.submit-dialog-inner h2 { font-size: 1.25rem; margin: 0 0 6px; }
.submit-dialog-inner > p { margin: 0 0 18px; color: var(--ink-soft); font-size: .9rem; }
.submit-dialog-close {
  position: absolute; top: 12px; right: 14px;
  width: 32px; height: 32px; border: none; border-radius: 50%;
  background: transparent; color: var(--ink-soft);
  font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.submit-dialog-close:hover { background: var(--surface-2); color: var(--ink); }
.submit-choices { display: grid; gap: 12px; }
.submit-choice {
  display: flex; flex-direction: column; gap: 3px;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  text-decoration: none; color: var(--ink);
  transition: border-color .15s ease, background .15s ease, transform .08s ease;
}
.submit-choice:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}
.submit-choice:active { transform: translateY(1px); }
.submit-choice-name { font-weight: 700; }
.submit-choice-sub { font-size: .82rem; color: var(--ink-soft); }

/* ---------- Hero (asymmetric editorial) ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  margin: 28px 0 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
  min-height: 460px;
}

/* media column — bleeds to the edge */
.hero-media {
  position: relative; overflow: hidden; min-height: 280px;
  background: linear-gradient(135deg, #7a1418, #2a0608);
}
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: calc(58% + 10px) 50%;
  display: block;
}
.hero-media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 55%, color-mix(in srgb, var(--surface) 75%, transparent) 100%);
}
.hero-vertical {
  position: absolute;
  top: 20px; left: 20px;
  z-index: 2;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  text-transform: uppercase;
  letter-spacing: .28em;
  font-size: .66rem;
  font-weight: 600;
  color: #fff;
  mix-blend-mode: difference;
}

/* text panel — offset, overlaps the image */
.hero-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 40px 44px;
  margin-left: -14%;
  background: var(--surface);
  border-left: 1px solid var(--line);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .7rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 0 20px;
}
.eyebrow-sep { color: var(--accent); font-weight: 800; }

.hero h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.6rem);
  line-height: .98;
  letter-spacing: -.03em;
  margin: 0 0 22px;
  font-weight: 800;
}
.hero h1 em {
  font-style: italic;
  font-weight: 800;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0 .12em;
  border-radius: 4px;
  letter-spacing: -.04em;
}

.hero-sub { font-size: 1.02rem; color: var(--ink-soft); margin: 0; max-width: 440px; }
.hero-sub a { color: var(--ink); font-weight: 600; }

.hero-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
}
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: .92rem;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  transition: transform .15s ease, opacity .15s ease;
}
.hero-cta:hover { transform: translateY(-1px); opacity: .9; }
.hero-cta::after { content: "→"; }

@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    margin: 18px 0 28px;
  }
  .hero-media { aspect-ratio: 16 / 10; min-height: 0; }
  .hero-media::after {
    background: linear-gradient(180deg, transparent 50%, color-mix(in srgb, var(--surface) 80%, transparent) 100%);
  }
  .hero-panel {
    margin-left: 0;
    margin-top: -28px;
    border-left: 0;
    border-top: 1px solid var(--line);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 28px 22px 26px;
  }
  .hero-sub { max-width: none; }
}

.data-status {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 18px;
  font-size: .78rem; font-weight: 600;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink-soft);
}
.data-status .dot {
  width: 8px; height: 8px; border-radius: 50%; background: currentColor;
}
.data-status.live { color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, var(--line-strong)); }
.data-status.live .dot { background: #2fbf5b; box-shadow: 0 0 0 3px rgba(47,191,91,.18); }
[data-theme="dark"] .data-status.live { color: #6fe0a0; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- Compare ---------- */
.compare { padding: 22px; margin-bottom: 28px; }
.compare-head h2 { margin: 0 0 4px; font-size: 1.25rem; letter-spacing: -.02em; }
.compare-head p { margin: 0 0 18px; color: var(--ink-soft); font-size: .92rem; }
.compare-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: end;
}
.compare-form .btn { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 600;
  color: var(--ink-soft);
}
input, select {
  font: inherit;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent);
}
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23888' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}
.field.checkbox { flex-direction: row; align-items: center; gap: 10px; }
.field.checkbox input { width: 18px; height: 18px; }
.field.checkbox span { text-transform: none; letter-spacing: 0; font-size: .92rem; color: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
  font: inherit;
  font-weight: 600;
  border-radius: 999px;
  padding: 11px 20px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 86%, #000); }
.btn.ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn.ghost:hover { background: var(--surface-2); }

/* ---------- Compare result ---------- */
.compare-result {
  margin-top: 18px;
  padding: 18px;
  border-radius: var(--radius-sm);
  background: var(--green);
  color: #f3f2ee;
  border: 1px solid transparent;
}
.compare-result .big {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.1;
}
.compare-result .big .accent { color: var(--accent); }
.compare-result p { margin: 6px 0 0; opacity: .85; font-size: .92rem; }
.compare-result .bar {
  margin-top: 14px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  overflow: hidden;
}
.compare-result .bar span {
  display: block; height: 100%;
  background: var(--accent);
  border-radius: 999px;
}
.compare-result .delivery {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .16);
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  column-gap: 12px;
  row-gap: 2px;
}
.compare-result .delivery-label {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .09em;
  font-weight: 700; opacity: .8;
}
.compare-result .delivery-window {
  font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em; color: var(--accent);
}
.compare-result .delivery-note {
  grid-column: 1 / -1; font-size: .85rem; opacity: .8; margin-top: 2px;
}

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.stat .label {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .09em;
  font-weight: 600; color: var(--ink-soft); margin: 0 0 6px;
}
.stat .value { font-size: 1.65rem; font-weight: 800; letter-spacing: -.02em; }
.stat .sub { font-size: .8rem; color: var(--ink-soft); margin-top: 2px; }

/* ---------- Stat charts ---------- */
.stat-charts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
.stat.chart { display: flex; flex-direction: column; }
.stat.chart .value { font-size: 1.3rem; margin-bottom: 4px; }
.stat.chart .value .unit { font-size: .85rem; font-weight: 600; color: var(--ink-soft); margin-left: 4px; }
/* One grid for the whole chart so the label column auto-sizes to the widest
   label (e.g. "Northeast") and every bar starts at the same x — no overlap. */
.barchart {
  display: grid;
  grid-template-columns: max-content 1fr max-content;
  align-items: center; column-gap: 9px; row-gap: 7px;
  margin-top: 10px; font-size: .74rem;
}
.bc-row { display: contents; }
.bc-label { color: var(--ink); font-weight: 600; white-space: nowrap; }
.bc-track { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bc-fill { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.bc-fill.alt { background: var(--green); }
[data-theme="dark"] .bc-fill.alt { background: color-mix(in srgb, var(--green) 55%, #8aa78d); }
.bc-val { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.spark { width: 100%; height: 56px; display: block; margin-top: 12px; overflow: visible; }
.spark .bar { fill: var(--accent); }
.spark .axis { stroke: var(--line); stroke-width: 1; }

/* ---------- Controls ---------- */
/* Search + filters pin just under the sticky header as you scroll. */
.controls {
  padding: 16px; margin-bottom: 16px;
  position: sticky; top: var(--header-h); z-index: 40;
  transition: box-shadow .18s ease, border-radius .18s ease;
}
.controls.stuck {
  border-top-left-radius: 0; border-top-right-radius: 0;
  box-shadow: var(--shadow);
}
.search-row { display: flex; gap: 10px; }
.search-box {
  position: relative; flex: 1; display: flex; align-items: center;
}
.search-icon {
  position: absolute; left: 12px; width: 18px; height: 18px; color: var(--ink-soft);
  pointer-events: none;
}
.search-box input { padding-left: 38px; padding-right: 34px; }
.clear-search {
  position: absolute; right: 6px;
  border: none; background: transparent; cursor: pointer;
  font-size: 1.4rem; line-height: 1; color: var(--ink-soft);
  padding: 4px 8px;
}
.filter-toggle { white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
.filter-count {
  background: var(--accent); color: var(--accent-ink);
  border-radius: 999px; font-size: .72rem; font-weight: 700;
  min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-grid; place-items: center;
}

.filters {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.filters .reset { justify-self: start; }

/* ---------- Result bar ---------- */
.result-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: 4px 2px 14px;
}
.result-count { font-size: .9rem; color: var(--ink-soft); font-weight: 500; flex-shrink: 0; }
/* Let the sort control take the remaining row width and shrink instead of
   pushing past the viewport (its longest option is wider than a phone). */
.sort-field { display: inline-flex; align-items: center; gap: 8px; min-width: 0; flex: 0 1 auto; }
.sort-field > span {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
  font-weight: 600; color: var(--ink-soft); flex-shrink: 0;
}
.sort-field select { width: auto; max-width: 100%; min-width: 0; padding-block: 8px; }

/* ---------- Table (desktop) ---------- */
.table-wrap { display: none; overflow: hidden; padding: 0; }
.res-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.res-table th, .res-table td { padding: 13px 16px; text-align: left; }
.res-table thead th {
  font-size: .7rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-soft); font-weight: 600;
  border-bottom: 1px solid var(--line); position: sticky; top: 60px;
  background: var(--surface);
}
.res-table tbody tr { border-bottom: 1px solid var(--line); }
.res-table tbody tr:last-child { border-bottom: none; }
.res-table tbody tr.highlight { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
.res-table tbody tr:hover { background: var(--surface-2); }
.res-table .num { font-weight: 700; font-variant-numeric: tabular-nums; }
.res-table .name { font-weight: 600; }

/* ---------- Cards (mobile) ---------- */
.card-list { display: grid; gap: 12px; }
.res-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.res-card.highlight { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.res-card-top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
}
.res-card .placement {
  font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums;
}
.res-card .placement .hash { color: var(--ink-soft); font-weight: 600; }
.res-card .name { font-weight: 600; }
.res-card .date { font-size: .82rem; color: var(--ink-soft); }
.res-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag {
  font-size: .76rem; font-weight: 500;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 10px; color: var(--ink);
}
.tag.muted { color: var(--ink-soft); }
.tag.accent-tag { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.tag.own { background: color-mix(in srgb, var(--green) 14%, var(--surface)); border-color: transparent; }
.forum-tag {
  display: inline-block; font-size: .72rem; font-weight: 600; white-space: nowrap;
  padding: 2px 8px; border-radius: 999px; letter-spacing: .01em;
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line));
  color: var(--ink);
}
td .muted { color: var(--ink-soft); }
.res-card-extra { margin-top: 10px; font-size: .8rem; color: var(--ink-soft); }
.swatch { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: -1px; border: 1px solid rgba(0,0,0,.18); }

/* ---------- Empty / load more ---------- */
.empty { text-align: center; padding: 48px 20px; color: var(--ink-soft); }
.empty .btn { margin-top: 12px; }
.load-actions { display: flex; justify-content: center; gap: 12px; margin: 40px auto 0; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 56px;
  border-top: 1px solid var(--line);
  padding: 28px 0 48px;
}
.disclaimer { font-size: .82rem; color: var(--ink-soft); margin: 0 0 10px; max-width: 760px; }
.footer-meta { font-size: .82rem; color: var(--ink-soft); margin: 0; }
.footer-meta a { color: var(--ink); }

/* ---------- Responsive ---------- */
@media (min-width: 560px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .stat-charts { grid-template-columns: repeat(4, 1fr); }
  .filters { grid-template-columns: repeat(2, 1fr); }
  .filters .reset { grid-column: 1 / -1; }
}
@media (min-width: 860px) {
  .wrap { padding-inline: 32px; }
  .compare-form { grid-template-columns: 1fr 1fr auto; }
  .compare-form .btn { grid-column: auto; }
  .filters { grid-template-columns: repeat(3, 1fr); }
  .table-wrap { display: block; }
  .card-list { display: none; }
  .load-actions { margin-top: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto; }
}

/* ---------- FAQ ---------- */
.faq { margin: 40px 0 12px; }
.faq h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  letter-spacing: -.02em;
  margin: 0 0 18px;
  font-weight: 800;
}
.faq-list { display: grid; gap: 10px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 18px;
}
.faq-item summary {
  list-style: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.02rem;
  padding: 16px 28px 16px 0;
  position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  font-weight: 400;
  font-size: 1.4rem;
  color: var(--ink-soft);
  transition: transform .2s ease;
}
.faq-item[open] summary::after { content: "−"; }
.faq-item p {
  margin: 0;
  padding: 0 0 18px;
  color: var(--ink-soft);
  font-size: .96rem;
  line-height: 1.6;
}
