/* AT Finder — design system
   Warm-neutral editorial look; WCAG 2.2 AA: text ≥ 4.5:1, UI ≥ 3:1, 44px targets, visible focus. */

:root {
  --bg: #ffffff;
  --bg-soft: #f9f8f5;
  --bg-warm: #efece7;
  --bg-ink: #151514;
  --text: #151514;
  --text-2: #57534e;          /* 7.3:1 on white, 6.9:1 on --bg-soft */
  --text-on-ink: #f6f4f0;
  --border: #e6e2db;
  --border-strong: #8a847b;   /* 3.6:1 on white — form controls */
  --accent: #1d5e45;          /* deep green: vetted / success, 7.4:1 on white */
  --accent-soft: #e5f0ea;
  --danger: #a3271f;
  --danger-soft: #fbeceb;
  --focus: #1a56db;
  --chip: #efece7;
  --radius: 8px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(21, 21, 20, .04), 0 8px 24px -12px rgba(21, 21, 20, .12);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --track-tight: -0.022em;
  --max: 1240px;
  --header-h: 68px;
  color-scheme: light;
}
/* Light is the default. Dark mode is opt-in only (footer toggle sets data-theme="dark"). */
:root[data-theme="dark"] {
  --bg: #121211; --bg-soft: #1a1918; --bg-warm: #23211f; --bg-ink: #f4f1ec; --text: #f4f1ec;
  --text-2: #b8b2a9; --text-on-ink: #151514; --border: #34312d; --border-strong: #8d877e;
  --accent: #7fd1a8; --accent-soft: #17302a; --danger: #ff9b92; --danger-soft: #3a1b18;
  --focus: #8ab4ff; --chip: #2a2825; --shadow: none; color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
.theme-switching *, .theme-switching *::before, .theme-switching *::after { transition: none !important; }
html { scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--font);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { font-weight: 500; letter-spacing: var(--track-tight); line-height: 1.15; margin: 0; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}
::selection { background: var(--bg-warm); }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--bg-ink); color: var(--text-on-ink); padding: 12px 18px; border-radius: var(--radius);
}
.skip:focus { top: 12px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.eyebrow { font-size: .875rem; color: var(--text-2); letter-spacing: 0; font-weight: 500; }
.lead { font-size: 1.1875rem; color: var(--text-2); line-height: 1.55; }
.muted { color: var(--text-2); }
.small { font-size: .875rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: var(--radius);
  border: 1px solid transparent; font-weight: 500; font-size: .9375rem; letter-spacing: -0.01em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--bg-ink); color: var(--text-on-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--bg-ink) 86%, var(--bg)); }
.btn-secondary { background: var(--bg-warm); color: var(--text); }
.btn-secondary:hover { background: color-mix(in srgb, var(--bg-warm) 80%, var(--text) 8%); }
.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { background: var(--bg-soft); }
.btn[aria-pressed="true"] svg { fill: currentColor; }
#fav[aria-pressed="true"] { border-color: var(--text); }
.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-lg { min-height: 52px; padding: 14px 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--bg); color: var(--text); cursor: pointer;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--bg-soft); }
.link-btn { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; min-height: 24px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .bar { display: flex; align-items: center; gap: 28px; height: var(--header-h); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-size: 1.125rem; font-weight: 500; letter-spacing: -0.02em; text-decoration: none; }
.wordmark .mark { width: 22px; height: 22px; border: 2.5px solid currentColor; border-radius: 50%; position: relative; }
.wordmark .mark::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--accent); }
.primary-nav { display: flex; gap: 4px; }
.primary-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: var(--radius);
  text-decoration: none; color: var(--text-2); font-weight: 500; font-size: .9375rem;
}
.primary-nav a:hover { color: var(--text); background: var(--bg-soft); }
.primary-nav a[aria-current="page"] { color: var(--text); background: var(--bg-warm); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.saved-link { position: relative; }
.badge {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px; background: var(--accent); color: var(--bg); font-size: .75rem; font-weight: 600;
}
.avatar {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-warm); font-weight: 600; font-size: .875rem;
}
.menu { position: relative; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; z-index: 50;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 8px;
}
.menu-panel[hidden] { display: none; }
.menu-panel .who { padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-panel a, .menu-panel button {
  display: flex; width: 100%; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px;
  border-radius: var(--radius); border: 0; background: none; text-decoration: none; cursor: pointer; text-align: left;
}
.menu-panel a:hover, .menu-panel button:hover { background: var(--bg-soft); }
.nav-toggle { display: none; }
.mobile-nav { display: none; }

@media (max-width: 860px) {
  .primary-nav { display: none; }
  .nav-toggle { display: inline-grid; }
  .header-actions .hide-sm { display: none; }
  .mobile-nav:not([hidden]) {
    display: grid; gap: 4px; padding: 8px 24px 16px; border-top: 1px solid var(--border);
  }
  .mobile-nav a { display: flex; align-items: center; min-height: 48px; padding: 0 8px; text-decoration: none; font-weight: 500; border-radius: var(--radius); }
  .mobile-nav a[aria-current="page"] { background: var(--bg-warm); }
}

/* ---------- sections ---------- */
main:focus { outline: none; }
.section { padding: 96px 0; }
.section-sm { padding: 56px 0; }
.section.soft { background: var(--bg-soft); }
.section.warm { background: var(--bg-warm); }
.section.ink { background: var(--bg-ink); color: var(--text-on-ink); }
.section.ink .muted, .section.ink .lead { color: color-mix(in srgb, var(--text-on-ink) 72%, transparent); }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: start; }
.split h2 { font-size: 1.25rem; }
.split h2 .muted { display: block; }
.display { font-size: clamp(2.375rem, 5.2vw, 3.75rem); line-height: 1.05; letter-spacing: -0.03em; }
.h1 { font-size: clamp(2rem, 4vw, 2.875rem); line-height: 1.1; letter-spacing: -0.028em; }
.h2 { font-size: clamp(1.625rem, 3vw, 2.25rem); line-height: 1.15; }
.h3 { font-size: 1.25rem; }
.page-head { padding: 48px 0 24px; }
.page-head .lead { margin-top: 12px; max-width: 62ch; }

/* ---------- hero ---------- */
.hero { background: var(--bg-soft); border-bottom: 1px solid var(--border); }
.hero .container { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 56px; align-items: center; padding-top: 72px; padding-bottom: 80px; }
.hero .lead { margin: 20px 0 32px; max-width: 54ch; }
.mosaic { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mosaic a { display: block; background: #fff; border-radius: var(--radius-lg); aspect-ratio: 1; overflow: hidden; border: 1px solid var(--border); }
.mosaic a:nth-child(2) { transform: translateY(28px); }
.mosaic a:nth-child(4) { transform: translateY(28px); }
.mosaic img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }

.search-box { display: flex; gap: 8px; background: var(--bg); border: 1px solid var(--border-strong); border-radius: 12px; padding: 6px; box-shadow: var(--shadow); }
.search-box:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.search-box input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 12px; font-size: 1.0625rem; }
.search-box input:focus-visible { outline: none; }
.prompts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.prompt-chip {
  min-height: 40px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg); cursor: pointer; font-size: .9375rem; color: var(--text);
}
.prompt-chip:hover { border-color: var(--border-strong); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 20px; background: var(--bg); }
.stat .num { font-size: 2.25rem; letter-spacing: -0.03em; font-weight: 500; line-height: 1.1; }
.stat .lbl { color: var(--text-2); font-size: .9375rem; margin-top: 6px; }

.checklist { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
.checklist li { display: flex; gap: 14px; align-items: flex-start; font-size: 1.0625rem; }
.checklist svg { flex: none; width: 22px; height: 22px; color: var(--accent); margin-top: 2px; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 8px; }
.step { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; }
.step .n { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--bg-warm); font-weight: 600; font-size: .875rem; }
.step h3 { margin: 18px 0 8px; font-size: 1.125rem; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tile {
  display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 132px;
  padding: 20px; border-radius: var(--radius-lg); background: var(--bg); border: 1px solid var(--border);
  text-decoration: none;
}
.tile:hover { border-color: var(--border-strong); }
.tile .t { font-size: 1.0625rem; font-weight: 500; letter-spacing: -0.01em; }
.tile .c { color: var(--text-2); font-size: .875rem; display: flex; justify-content: space-between; align-items: center; }
.tile svg { width: 18px; height: 18px; }

.cta-band { display: flex; justify-content: space-between; align-items: center; gap: 32px; flex-wrap: wrap; }
.cta-band .btn-primary { background: var(--text-on-ink); color: var(--bg-ink); }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; }
.field label, .label { font-size: .9375rem; font-weight: 500; }
.hint { font-size: .875rem; color: var(--text-2); }
.input, .select, textarea.input {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: var(--bg); color: var(--text);
}
textarea.input { min-height: 96px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%2357534e' stroke-width='1.6'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.error { color: var(--danger); font-size: .9375rem; }

/* segmented / chip choices: real radios & checkboxes, styled */
.choices { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.choices legend { font-size: .9375rem; font-weight: 500; margin-bottom: 10px; padding: 0; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice span {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px;
  border-radius: 999px; border: 1px solid var(--border-strong); background: var(--bg); font-size: .9375rem;
}
.choice input:checked + span { background: var(--bg-ink); color: var(--text-on-ink); border-color: var(--bg-ink); }
.choice input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.choice input:checked + span::before {
  content: ""; width: 14px; height: 14px;
  background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3 3 7-7' stroke='black' stroke-width='2' fill='none'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3 3 7-7' stroke='black' stroke-width='2' fill='none'/%3E%3C/svg%3E") center/contain no-repeat;
}

.checkrow { display: flex; align-items: center; gap: 12px; min-height: 40px; cursor: pointer; font-size: .9375rem; }
.checkrow input { width: 20px; height: 20px; accent-color: var(--bg-ink); flex: none; margin: 0; }
.checkrow .count { margin-left: auto; color: var(--text-2); font-size: .8125rem; font-variant-numeric: tabular-nums; }

/* switch */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; cursor: pointer; font-size: .9375rem; }
.switch input { appearance: none; width: 44px; height: 26px; border-radius: 999px; background: var(--border-strong); position: relative; cursor: pointer; flex: none; margin: 0; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }

/* ---------- find page ---------- */
.find-form { display: grid; gap: 24px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; }
.criteria { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 32px; }
.criteria .row-end { display: flex; gap: 24px; align-items: end; flex-wrap: wrap; }
.find-form .actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 20px; }

.understanding { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  background: var(--chip); font-size: .8125rem; font-weight: 500; line-height: 1.4;
}
.tag.ok { background: var(--accent-soft); color: var(--accent); }
.tag { white-space: nowrap; }
.tag svg { width: 14px; height: 14px; flex: none; }
.tag .pct { color: var(--text-2); font-weight: 400; }
.tag.ok .pct { color: inherit; opacity: .85; }

.panel { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; }
.panel + .panel { margin-top: 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.panel-head h2 { font-size: 1.375rem; }
.results-stack { display: grid; gap: 20px; margin-top: 28px; }

.rate { display: grid; gap: 12px; }
.rate-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.thumb {
  display: inline-flex; align-items: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 0 12px;
  border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--bg); cursor: pointer;
}
.thumb svg { width: 18px; height: 18px; }
.thumb .n { font-size: .8125rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.thumb[aria-pressed="true"].up { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.thumb[aria-pressed="true"].down { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.thumb[aria-pressed="true"] .n { color: inherit; }
.prior { font-size: .875rem; color: var(--text-2); }

.weblinks { display: grid; gap: 0; }
.weblink { display: grid; grid-template-columns: 56px 1fr auto; gap: 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--border); }
.weblink:first-child { border-top: 0; padding-top: 0; }
.weblink .p { font-variant-numeric: tabular-nums; color: var(--text-2); font-size: .875rem; }
.weblink .links { display: flex; gap: 8px; flex-wrap: wrap; }
.program dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
.program dt { color: var(--text-2); }
.program dd { margin: 0; }

details.disclosure { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg); }
details.disclosure > summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  min-height: 56px; padding: 0 24px; font-weight: 500;
}
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::after { content: "+"; font-size: 1.5rem; font-weight: 300; color: var(--text-2); }
details.disclosure[open] > summary::after { content: "–"; }
details.disclosure > .inner { padding: 0 24px 24px; }

/* ---------- product grid & card ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { position: relative; display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.card .media { position: relative; aspect-ratio: 1 / 1; background: #fff; border-bottom: 1px solid var(--border); }
.card .media img { width: 100%; height: 100%; object-fit: contain; padding: 18px; }
.card .media .ph { position: absolute; inset: 0; display: grid; place-items: center; color: #6b6660; font-size: .875rem; background: var(--bg-soft); }
.card .fav { position: absolute; top: 10px; right: 10px; z-index: 2; background: rgba(255,255,255,.92); border-color: var(--border); color: #151514; }
.card .fav[aria-pressed="true"] { color: #a3271f; }
.card .fav[aria-pressed="true"] svg { fill: currentColor; }
.card .badge-vetted { position: absolute; top: 12px; left: 12px; z-index: 2; background: var(--accent); color: var(--bg); font-size: .75rem; font-weight: 600; padding: 4px 9px; border-radius: 999px; display: inline-flex; gap: 4px; align-items: center; }
.card .badge-vetted svg { width: 12px; height: 12px; }
.card .body { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 18px; flex: 1; }
.card .store { font-size: .8125rem; color: var(--text-2); display: flex; justify-content: space-between; gap: 8px; }
.card h3 { font-size: 1rem; font-weight: 500; line-height: 1.35; letter-spacing: -0.01em; }
.card h3 a { text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }   /* whole card clickable */
.card h3 a:hover { text-decoration: underline; }
.card h3 a:focus-visible { outline: none; }
.card:has(h3 a:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.card .price-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 2px; }
.card .price { font-size: 1.0625rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.card .meta { display: flex; flex-wrap: wrap; gap: 6px; }
.card .foot { display: flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 10px; position: relative; z-index: 2; }
.card .foot .thumb { min-height: 40px; min-width: 40px; padding: 0 10px; border-color: var(--border); }
.card .match { font-size: .8125rem; color: var(--text-2); margin-left: auto; font-variant-numeric: tabular-nums; }
.oos { color: var(--danger); font-size: .8125rem; font-weight: 600; }
.ease { font-size: .8125rem; color: var(--text-2); }

/* ---------- browse ---------- */
.browse { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 40px; align-items: start; padding-bottom: 96px; }
.filters { position: sticky; top: calc(var(--header-h) + 20px); max-height: calc(100vh - var(--header-h) - 40px); overflow: auto; padding-right: 6px; }
.filters h2 { font-size: 1rem; }
.filter-group { border-top: 1px solid var(--border); }
.filter-group > summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  min-height: 52px; font-weight: 500; font-size: .9375rem;
}
.filter-group > summary::-webkit-details-marker { display: none; }
.filter-group > summary .sel { color: var(--text-2); font-weight: 400; font-size: .8125rem; margin-left: auto; margin-right: 10px; }
.filter-group > summary::after { content: ""; width: 10px; height: 10px; border-right: 1.6px solid var(--text-2); border-bottom: 1.6px solid var(--text-2); transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s; }
.filter-group[open] > summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.filter-group .inner { padding: 0 0 18px; display: grid; gap: 2px; }
.filter-group .inner.scroll { max-height: 260px; overflow: auto; }
.price-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.price-inputs label { font-size: .8125rem; color: var(--text-2); display: grid; gap: 4px; }
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search-box { flex: 1 1 320px; box-shadow: none; }
.toolbar .search-box input { padding: 6px 10px; }
.toolbar .sort { display: flex; align-items: center; gap: 8px; }
.toolbar .sort .select { width: auto; min-width: 180px; }
.result-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; min-height: 40px; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.active-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 8px 0 12px;
  border-radius: 999px; background: var(--bg-warm); border: 0; cursor: pointer; font-size: .875rem;
}
.active-chip svg { width: 14px; height: 14px; }
.filters-toggle { display: none; }
.filter-dialog-actions { display: none; }

@media (max-width: 960px) {
  .browse { grid-template-columns: 1fr; }
  .filters-toggle { display: inline-flex; }
  .filters { display: none; }
  dialog.filters-dialog .filters { display: block; position: static; max-height: none; overflow: visible; padding: 0; }
  .filter-dialog-actions { display: flex; gap: 10px; position: sticky; bottom: 0; background: var(--bg); padding: 16px 0 4px; border-top: 1px solid var(--border); }
}

/* ---------- product page ---------- */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; font-size: .875rem; color: var(--text-2); padding: 24px 0 8px; list-style: none; margin: 0; }
.breadcrumb li + li::before { content: "/"; margin-right: 8px; color: var(--border-strong); }
.breadcrumb a { color: var(--text-2); }
.product { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; padding: 24px 0 72px; align-items: start; }
.product .gallery { position: sticky; top: calc(var(--header-h) + 24px); background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; }
.product .gallery img { width: 100%; height: 100%; object-fit: contain; padding: 40px; }
.product .gallery .ph { color: #6b6660; }
.product h1 { font-size: clamp(1.75rem, 3vw, 2.375rem); margin: 8px 0 14px; letter-spacing: -0.025em; }
.product .price { font-size: 1.625rem; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.product .buy { display: flex; gap: 10px; flex-wrap: wrap; margin: 24px 0; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--border); margin: 8px 0 28px; }
.facts div { padding: 14px 0; border-bottom: 1px solid var(--border); }
.facts div:nth-child(odd) { padding-right: 16px; }
.facts dt { font-size: .8125rem; color: var(--text-2); }
.facts dd { margin: 2px 0 0; font-weight: 500; }
.meter { display: grid; grid-template-columns: 1fr; gap: 6px; }
.bars { display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: minmax(120px, 200px) 1fr 48px; gap: 12px; align-items: center; font-size: .875rem; }
.bar .track { display: block; height: 8px; border-radius: 999px; background: var(--bg-warm); overflow: hidden; }
.bar .fill { display: block; height: 100%; background: var(--bg-ink); border-radius: 999px; }
.bar .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }
.desc { color: var(--text-2); white-space: pre-line; }
.fb-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.fb-list li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; }
.fb-list .when { font-size: .8125rem; color: var(--text-2); }

/* ---------- saved / history ---------- */
.notice { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; margin-bottom: 24px; }
.empty { text-align: center; padding: 72px 24px; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); }
.empty h2 { font-size: 1.375rem; margin-bottom: 8px; }
.empty p { color: var(--text-2); margin-bottom: 20px; }
.hist { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.hist a { display: grid; grid-template-columns: 1fr auto; gap: 6px 20px; padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--radius-lg); text-decoration: none; }
.hist a:hover { border-color: var(--border-strong); }
.hist .q { font-weight: 500; font-size: 1.0625rem; }
.hist .sub { color: var(--text-2); font-size: .875rem; }

/* ---------- pricing ---------- */
.billing { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--bg-warm); border: 0; margin: 28px 0 0; }
.billing legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.billing label { position: relative; }
.billing input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.billing span { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 18px; border-radius: 999px; font-weight: 500; font-size: .9375rem; }
.billing input:checked + span { background: var(--bg); box-shadow: var(--shadow); }
.billing input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.save-tag { font-size: .75rem; color: var(--accent); font-weight: 600; }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 40px; }
.plan { display: flex; flex-direction: column; gap: 20px; padding: 28px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg); }
.plan.featured { border: 2px solid var(--bg-ink); }
.plan .ribbon { align-self: flex-start; font-size: .75rem; font-weight: 600; background: var(--bg-ink); color: var(--text-on-ink); padding: 4px 10px; border-radius: 999px; }
.plan h2 { font-size: 1.375rem; }
.plan .amount { font-size: 2.75rem; letter-spacing: -0.035em; font-weight: 500; line-height: 1; }
.plan .per { color: var(--text-2); font-size: .9375rem; }
.plan ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.plan li { display: flex; gap: 10px; align-items: flex-start; font-size: .9375rem; }
.plan li svg { flex: none; width: 18px; height: 18px; color: var(--accent); margin-top: 3px; }
.plan .btn { margin-top: auto; }
.compare { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: .9375rem; }
.compare caption { text-align: left; font-size: 1.375rem; font-weight: 500; letter-spacing: -0.02em; padding-bottom: 16px; }
.compare th, .compare td { padding: 14px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.compare thead th { font-weight: 600; }
.compare td { color: var(--text-2); }
.compare tbody th { font-weight: 400; }
.faq { display: grid; gap: 12px; }

/* ---------- sign in ---------- */
.auth { min-height: calc(100vh - var(--header-h) - 1px); display: grid; place-items: center; background: var(--bg-soft); padding: 48px 24px; }
.auth-card { width: min(440px, 100%); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 36px 32px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.75rem; margin-bottom: 8px; }
.providers { display: grid; gap: 10px; margin: 28px 0 20px; }
.provider { justify-content: flex-start; gap: 14px; border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); }
.provider:hover { background: var(--bg-soft); }
.provider .pmark { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; background: var(--bg-warm); font-weight: 700; font-size: .8125rem; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-2); font-size: .875rem; margin: 6px 0 18px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.demo-note { margin-top: 20px; padding: 12px 14px; border-radius: var(--radius); background: var(--bg-warm); font-size: .875rem; }

/* ---------- prose ---------- */
.prose { max-width: 72ch; }
.prose h2 { font-size: 1.5rem; margin: 40px 0 12px; }
.prose p, .prose ul { margin: 0 0 16px; color: var(--text-2); }
.prose li { margin-bottom: 8px; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); padding: 64px 0 40px; font-size: .9375rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.site-footer h2 { font-size: .875rem; color: var(--text-2); font-weight: 500; margin-bottom: 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-footer ul a { text-decoration: none; display: inline-flex; min-height: 32px; align-items: center; }
.site-footer ul a:hover { text-decoration: underline; }
.theme-switch { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--bg-warm); border: 0; margin: 0; }
.theme-switch legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.theme-switch label { position: relative; }
.theme-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.theme-switch span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; font-size: .875rem; font-weight: 500; }
.theme-switch input:checked + span { background: var(--bg); box-shadow: var(--shadow); }
.theme-switch input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.disclaimer { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); color: var(--text-2); font-size: .8125rem; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }

/* ---------- dialog / toast / loading ---------- */
dialog {
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0; background: var(--bg); color: var(--text);
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: 0 24px 64px -16px rgba(0,0,0,.35);
}
dialog::backdrop { background: rgba(21, 21, 20, .45); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg); z-index: 1; }
.dialog-head h2 { font-size: 1.25rem; }
.dialog-body { padding: 20px 24px 24px; display: grid; gap: 16px; }
dialog.filters-dialog { width: min(480px, calc(100vw - 16px)); }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 90;
  background: var(--bg-ink); color: var(--text-on-ink); padding: 12px 18px; border-radius: var(--radius);
  font-size: .9375rem; opacity: 0; visibility: hidden; transition: opacity .2s, transform .2s, visibility .2s;
  pointer-events: none; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.skeleton { background: linear-gradient(90deg, var(--bg-soft), var(--bg-warm), var(--bg-soft)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius-lg); min-height: 360px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .grid.cols-4, .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plans { grid-template-columns: 1fr; max-width: 520px; }
}
@media (max-width: 860px) {
  .section { padding: 64px 0; }
  .hero .container { grid-template-columns: 1fr; padding-top: 48px; padding-bottom: 56px; gap: 40px; }
  .split, .product { grid-template-columns: 1fr; gap: 28px; }
  .product .gallery { position: static; }
  .steps, .criteria { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .container { padding: 0 16px; }
  .tiles, .grid.cols-4 { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .hero .search-box, .find-form .search-box { flex-direction: column; }
  .hero .search-box .btn { width: 100%; }
  .toolbar { display: grid; grid-template-columns: auto 1fr; }
  .toolbar .search-box { grid-column: 1 / -1; }
  .toolbar .filters-toggle { grid-row: 2; grid-column: 1; }
  .toolbar .sort { grid-row: 2; grid-column: 2; justify-content: flex-end; }
  .toolbar .sort .select { min-width: 0; width: 100%; max-width: 200px; }
  .weblink { grid-template-columns: 1fr; gap: 8px; }
  .bar { grid-template-columns: 110px 1fr 40px; }
  .facts { grid-template-columns: 1fr; }
  .facts div:nth-child(odd) { padding-right: 0; }
  .auth-card { padding: 28px 20px; }
}
@media (forced-colors: active) {
  .choice input:checked + span, .billing input:checked + span { outline: 2px solid CanvasText; }
  .card .badge-vetted, .badge { border: 1px solid CanvasText; }
}
