:root {
  --ink: #172321;
  --muted: #5e6a66;
  --paper: #f6f6f2;
  --surface: #ffffff;
  --photo-bg: #f7f8f5;
  --line: #dfe3dc;
  --teal: #0f6b62;
  --teal-dark: #0b4f49;
  --mint: #dceee6;
  --amber: #a9672d;
  --amber-bg: #fff3de;
  --warn-border: #d9822b;
  --warn-bg: #fff8ed;
  --mfg-bg: #edf2f6;
  --mfg-ink: #274a66;
  --radius: 16px;
  --shadow: 0 12px 36px rgba(24, 43, 38, .08);
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.6 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, a { color: inherit; }
a { text-decoration: none; }

.container { max-width: var(--max); margin: auto; padding: 0 28px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(246, 246, 242, .94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(223, 227, 220, .85);
}
.header-inner {
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; line-height: 1.08; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--teal);
  color: #d9f1e7;
  font-size: 22px;
}
.brand strong { display: block; font-size: 16px; letter-spacing: -.02em; }
.brand small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.main-nav { display: flex; align-items: center; gap: 28px; font-size: 13px; font-weight: 600; color: #4f5e59; }
.main-nav a { padding: 8px 0; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s; }
.main-nav a:hover, .main-nav a.active { color: var(--teal); border-color: var(--teal); }
.saved-nav span {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--mint);
  color: var(--teal-dark);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  background: var(--surface);
  color: var(--teal);
  font-weight: 700;
  cursor: pointer;
}

/* Route visibility: strictly one active route panel at a time */
.route-panel { display: none; }
.route-panel.active { display: block; }
.route-panel[hidden] { display: none !important; }

/* Buttons & shared elements */
.eyebrow {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
}
.button {
  border: 0;
  border-radius: 10px;
  padding: 11px 17px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13px;
  transition: transform .18s, background .18s, border-color .18s;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button-primary { background: var(--teal); color: #fff; box-shadow: 0 4px 14px rgba(15, 107, 98, .18); }
.button-primary:hover:not(:disabled) { background: var(--teal-dark); }
.button-secondary { background: var(--mint); color: var(--teal-dark); }
.button-secondary:hover:not(:disabled) { background: #cde6db; }
.button-ghost { background: var(--surface); border: 1px solid var(--line); color: #4b5a55; }
.button-ghost:hover:not(:disabled) { border-color: #9bbcb0; color: var(--teal-dark); }
.text-link { color: var(--teal); font-weight: 700; font-size: 13px; background: transparent; border: 0; cursor: pointer; padding: 0; }
.text-link:hover { text-decoration: underline; }

.section { padding: 48px 0 72px; }

/* Overview (8 categories grid) */
.overview-section {
  background: radial-gradient(circle at 85% 0%, #e4f1e9 0, transparent 36%), var(--paper);
}
.overview-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 32px;
  margin-bottom: 34px;
}
.overview-head h1 {
  font-size: clamp(32px, 4.4vw, 52px);
  line-height: 1.05;
  letter-spacing: -.04em;
  margin: 0 0 14px;
  font-weight: 750;
}
.hero-lead {
  max-width: 620px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
  margin: 0;
}
.hero-proof {
  display: flex;
  gap: 28px;
  padding: 16px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  flex-shrink: 0;
}
.hero-proof span { display: flex; flex-direction: column; }
.hero-proof b { font-size: 22px; line-height: 1.1; letter-spacing: -.03em; color: var(--teal-dark); }
.hero-proof small { color: var(--muted); font-size: 11px; margin-top: 3px; white-space: nowrap; }

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.category-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 184px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.category-card:hover {
  transform: translateY(-3px);
  border-color: #9dc8b8;
  box-shadow: var(--shadow);
}
.category-icon { font-size: 26px; color: var(--teal); margin-bottom: 14px; display: inline-block; }
.category-card b { display: block; font-size: 17px; letter-spacing: -.015em; margin-bottom: 6px; }
.category-card small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.category-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid #eef1ec;
  font-size: 12px;
  font-weight: 700;
  color: var(--teal);
}

/* Guide Page */
.guide-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 24px;
}
.category-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.category-pills a {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.category-pills a:hover { border-color: #9dc8b8; color: var(--teal-dark); }
.category-pills a.active { background: var(--teal); border-color: var(--teal); color: #fff; }

.guide-hero-head {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 28px;
}
.guide-hero-head h1 {
  font-size: clamp(26px, 3.6vw, 40px);
  line-height: 1.1;
  letter-spacing: -.03em;
  margin: 0 0 10px;
}
.guide-hero-head p.guide-subtitle { margin: 0; color: var(--muted); font-size: 15.5px; max-width: 780px; }

.guide-layout {
  display: grid;
  grid-template-columns: 256px 1fr;
  gap: 28px;
  align-items: start;
}
.guide-sidebar { position: sticky; top: 92px; }
.guide-sidebar-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.sidebar-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 10px;
}
.topic-list { display: flex; flex-direction: column; gap: 3px; }
.topic-list a {
  display: block;
  padding: 8px 10px;
  border-left: 3px solid transparent;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition: color .15s, background .15s, border-color .15s;
}
.topic-list a:hover { color: var(--teal); background: #f8fbf9; }
.topic-list a.active {
  color: var(--teal-dark);
  border-left-color: var(--teal);
  background: #edf6f1;
  font-weight: 700;
}

.guide-sidebar-cta {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.guide-catalog-cta { width: 100%; text-align: center; }
.guide-source-meta {
  margin-top: 14px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
}

.guide-article-sheet {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 36px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.guide-section {
  scroll-margin-top: 96px;
  padding-top: 28px;
  margin-top: 28px;
  border-top: 1px solid #ecefe9;
}
.guide-section:first-child {
  padding-top: 0;
  margin-top: 0;
  border-top: 0;
}
.guide-section-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.02em;
  color: var(--ink);
  margin: 0 0 18px;
}
.guide-entries { display: flex; flex-direction: column; gap: 20px; }

.guide-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 172px;
  gap: 28px;
  align-items: start;
}
.guide-entry-main { min-width: 0; max-width: 68ch; }
.guide-entry-main h3 {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -.01em;
  color: var(--ink);
  margin: 0 0 8px;
}
.guide-entry-text {
  margin: 0;
  font-size: 15.5px;
  font-weight: 400;
  line-height: 1.72;
  color: #24312e;
  white-space: pre-line;
}

.guide-marginalia { min-width: 0; padding-top: 2px; }
.guide-side-note {
  padding-left: 12px;
  border-left: 2px solid #d6dcd8;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}
.guide-side-note strong {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: #44534e;
}
.guide-side-note.warning { border-left-color: var(--warn-border); }
.guide-side-note.warning strong { color: #8c470b; }
.guide-side-note.manufacturer { border-left-color: #6b8fae; }
.guide-side-note.manufacturer strong { color: var(--mfg-ink); }
.guide-side-note a {
  display: inline-block;
  margin-top: 4px;
  color: var(--teal);
  font-size: 11.5px;
  font-weight: 600;
}
.guide-side-note a:hover { text-decoration: underline; }

.guide-block-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.guide-model-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid #b8d5c9;
  background: #f2f9f5;
  color: var(--teal-dark);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.guide-model-chip:hover { background: var(--mint); border-color: var(--teal); }

.guide-author-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 600;
}
.guide-author-link:hover { border-color: var(--teal); background: #f4f9f7; }

/* Catalog */
.section-heading, .catalog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 28px;
}
.section-heading h2, .catalog-head h2 {
  font-size: 36px;
  line-height: 1.08;
  letter-spacing: -.04em;
  margin: 0;
}
.section-intro { color: var(--muted); max-width: 620px; margin: 10px 0 0; }
.catalog-guide-banner { margin-top: 14px; }
.catalog-tools { display: flex; gap: 8px; flex-shrink: 0; }
.catalog-layout { display: grid; grid-template-columns: 255px 1fr; gap: 32px; align-items: start; }

.filter-panel {
  position: sticky;
  top: 92px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.filter-mobile-head { display: none; }
.search-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 8px;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 12px;
}
.search-box span { font-size: 18px; color: var(--muted); }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; padding: 10px 0; font-size: 13px; }
.facet { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 16px; }
.facet h4 { margin: 0 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.facet label { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; cursor: pointer; }
.facet input { accent-color: var(--teal); }

.results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 13px;
}
.results-toolbar select {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--ink);
  font-size: 12.5px;
}
.filter-open { display: none; }

.model-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.model-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s;
}
.model-card:hover { border-color: #9bc8b8; box-shadow: var(--shadow); }
.model-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.model-kind { color: var(--teal); font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; font-weight: 800; }
.save-toggle { border: 0; background: transparent; color: #aab4af; cursor: pointer; font-size: 22px; line-height: 1; padding: 2px 4px; }
.save-toggle.saved { color: var(--amber); }

/* Unified 4:3 light photo window */
.model-photo-wrap { margin-bottom: 12px; }
.model-photo-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--photo-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.model-photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.photo-caption {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}
.photo-caption.analog {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--amber-bg);
  color: #824b17;
  font-weight: 700;
}

.model-card h3 { font-size: 18px; letter-spacing: -.02em; margin: 4px 0 4px; }
.model-sub { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.model-mention { font-size: 12.5px; color: #4a5652; margin: 6px 0 0; line-height: 1.45; }
.model-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.model-chips span { background: #f1f3ef; border-radius: 6px; padding: 4px 8px; color: #54625c; font-size: 11px; }
.model-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
}
.model-card-footer button { border: 0; background: transparent; color: var(--teal); font-weight: 800; font-size: 12px; cursor: pointer; padding: 4px 6px; }
.model-recommendation { color: var(--teal-dark); font-size: 11px; font-weight: 700; }
.model-recommendation.warn { color: #9c4a0d; }

.empty-state { text-align: center; padding: 56px 20px; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty-icon { font-size: 30px; color: var(--teal); }
.empty-state h3 { color: var(--ink); margin: 8px 0 4px; }
.empty-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* Saved list */
.saved-heading { align-items: flex-start; }
.list-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.file-button { cursor: pointer; }
.saved-list { display: flex; flex-direction: column; gap: 12px; }
.saved-row {
  display: grid;
  grid-template-columns: 96px 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.saved-thumb { width: 100%; min-width: 0; }
.saved-thumb .model-photo-frame { padding: 4px; border-radius: 8px; }
.saved-row > div { min-width: 0; }
.saved-row h3 { font-size: 16px; margin: 0 0 3px; }
.saved-row p { color: var(--muted); font-size: 12.5px; margin: 0; }
.saved-row-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.saved-row-actions .button { font-size: 11.5px; padding: 8px 11px; }
.saved-empty { padding: 54px 20px; text-align: center; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.saved-empty h3 { color: var(--ink); margin: 8px 0; }

/* Modal */
.modal { position: fixed; z-index: 60; inset: 0; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 29, 25, .52); }
.modal-card {
  position: relative;
  background: var(--surface);
  border-radius: 18px;
  width: min(780px, 100%);
  max-height: min(840px, 92vh);
  overflow: auto;
  box-shadow: 0 25px 80px rgba(0, 0, 0, .25);
  padding: 30px;
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 10;
  border: 0;
  background: rgba(241, 243, 239, .96);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  font-size: 22px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}
.modal-close:hover { background: var(--mint); color: var(--teal-dark); }
.modal-hero {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}
.detail-kicker { color: var(--teal); text-transform: uppercase; letter-spacing: .1em; font-weight: 800; font-size: 10.5px; }
.detail-title { font-size: 28px; line-height: 1.08; letter-spacing: -.03em; margin: 8px 36px 8px 0; }
.detail-subtitle { color: var(--muted); margin: 0; font-size: 13.5px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 8px; }
.detail-section { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 18px; }
.detail-section h4 { margin: 0 0 10px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.spec-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.spec-item { background: #f5f7f3; border-radius: 8px; padding: 10px 12px; }
.spec-item small { display: block; color: var(--muted); font-size: 10.5px; }
.spec-item b { display: block; font-size: 13px; margin-top: 2px; }
.detail-copy { white-space: pre-line; color: #394743; margin: 0; line-height: 1.55; }
.source-list { display: flex; flex-direction: column; gap: 7px; }
.source-list a { color: var(--teal); font-size: 12.5px; font-weight: 600; }
.source-list a:hover { text-decoration: underline; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; background: #edf4ef; border-radius: 30px; color: var(--teal-dark); padding: 4px 10px; font-size: 11px; font-weight: 700; }
.table-scroll { overflow-x: auto; }
.comparison-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.comparison-table th, .comparison-table td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.comparison-table th { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; }
.comparison-different td { background: #fbfdf9; font-weight: 600; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); font-size: 11.5px; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; }

/* Focus visible */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

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

@media (max-width: 1020px) {
  .guide-entry { grid-template-columns: 1fr; gap: 10px; }
  .guide-marginalia:empty { display: none; }
}

@media (max-width: 900px) {
  .container { padding: 0 18px; }
  .overview-head { flex-direction: column; align-items: flex-start; gap: 18px; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .guide-layout, .catalog-layout { grid-template-columns: 1fr; gap: 20px; }
  .guide-sidebar, .filter-panel { position: static; }
  .modal-card { padding-top: 56px; }
  .modal-hero { grid-template-columns: 1fr; }
  .saved-row { grid-template-columns: 76px 1fr auto; }
  .saved-row-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

@media (max-width: 720px) {
  .main-nav {
    position: absolute;
    display: none;
    top: 74px;
    left: 0;
    right: 0;
    padding: 12px 20px 18px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 11px 0; }
  .nav-toggle { display: block; }
  .filter-panel { display: none; }
  .filter-panel.open { display: block; }
  .filter-mobile-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
  .filter-mobile-head button { border: 0; background: transparent; font-size: 24px; cursor: pointer; }
  .filter-open { display: inline-flex; }
  .model-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; gap: 6px; }
}

@media (max-width: 540px) {
  .section { padding: 28px 0 48px; }
  .hero-proof { width: 100%; justify-content: space-between; gap: 12px; padding: 14px; }
  .category-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .category-card { min-height: 150px; padding: 16px; }
  .guide-hero-head { padding: 20px; }
  .guide-article-sheet { padding: 22px 18px; }
  .section-heading, .catalog-head { flex-direction: column; gap: 14px; }
  .catalog-tools { width: 100%; }
  .catalog-tools .button { flex: 1; }
  .modal-card { padding: 56px 16px 22px; }
  .detail-title { font-size: 23px; }
  .spec-grid { grid-template-columns: 1fr; }
}
