/* APEX — Automotive Showroom & 2x2 Decision Matrix Design System
   Palette: Azul Motorsport (#164473) + Guards Red (#cf142b) on Porcelain (#f6f7f9)
   Semantic Emerald (#0c7a4b) reserved exclusively for Sweet Spot & Na meta. */
:root {
  --bg: #f6f7f9;
  --stage: #f1f2f4;
  --surface: #ffffff;
  --surface-alt: #eef2f7;
  --ink: #131b26;
  --ink-2: #364354;
  --muted: #647184;
  --line: #e2e7ef;
  --line-strong: #c7d2e0;

  --brand: #164473;        /* Azul Motorsport — primary brand & active UI */
  --brand-hover: #0f3358;
  --brand-soft: #e7f0fa;
  --brand-border: #b6cde6;

  --accent: #cf142b;       /* Guards Red — fun/performance & active highlight */
  --accent-soft: #fdecef;
  --ok: #0c7a4b;           /* Emerald — exclusively Sweet Spot & Na meta */
  --ok-soft: #e6f6ee;
  --warn: #b45309;
  --warn-soft: #fef5e7;
  --over: #b91c1c;
  --over-soft: #fef2f2;

  /* Cost breakdown palette */
  --c-dep: #164473;
  --c-rend: #64748b;
  --c-seg: #2563eb;
  --c-ipva: #0ea5e9;
  --c-comb: #d97706;
  --c-man: #cf142b;
  --c-fin: #7c3aed;
  --c-sub: #0f766e;

  --display: "Space Grotesk", -apple-system, BlinkMacSystemFont, sans-serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --shadow-card: 0 2px 10px rgba(19, 27, 38, 0.045);
  --shadow-hover: 0 18px 40px rgba(22, 68, 115, 0.12);
  --shadow-sheet: -16px 0 60px rgba(19, 27, 38, 0.2);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
body.sheet-open { overflow: hidden; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4, p { margin: 0; }
img { display: block; max-width: 100%; }

/* ---------- APEX Motorsport Header ---------- */
.site { min-height: 100vh; display: flex; flex-direction: column; }
.header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand) 82%, var(--accent) 100%);
}
.header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 28px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}
.brand-mark {
  color: var(--brand);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(22, 68, 115, 0.22);
  border-radius: 8px;
}
.brand-text {
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.16em;
  color: var(--ink);
}
.wordmark small {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 2px 8px;
  border-radius: 999px;
}
.wordmark small:empty { display: none; }

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav a {
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  padding: 8px 15px;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.nav a:hover { color: var(--brand); background: var(--brand-soft); }
.nav a[aria-current="page"] { color: var(--brand); font-weight: 600; background: var(--brand-soft); }
.nav-count:not(:empty) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-link {
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  padding: 7px 11px;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
}
.header-link:hover, .header-link[aria-current="page"] {
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 600;
}
.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  text-decoration: none;
  transition: all 0.16s ease;
}
.icon-btn:hover {
  border-color: var(--brand-border);
  color: var(--brand);
  background: var(--brand-soft);
}
.icon-btn[aria-current="page"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.cfg-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px #fff;
}
.icon-btn[aria-current="page"] .cfg-dot { box-shadow: 0 0 0 2px var(--brand); }

@media (max-width: 820px) {
  .header-inner { padding: 0 16px; height: 56px; }
  .wordmark small { display: none; }
  .nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    justify-content: space-around;
  }
  .nav a { flex: 1; text-align: center; padding: 8px 4px; font-size: 12.5px; }
  .container { padding-bottom: 110px; }
}

/* ---------- Container ---------- */
.container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 26px 28px 96px;
  display: grid;
  gap: 30px;
}
@media (max-width: 820px) { .container { padding: 18px 16px 110px; gap: 22px; } }

/* ---------- Minimal Home Scenario Bar ---------- */
.scenario-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 13px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
}
.scenario-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
}
.scenario-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.context-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.context-chip:hover {
  border-color: var(--brand-border);
  background: var(--brand-soft);
  color: var(--brand);
}
.context-chip b { color: var(--brand); font-weight: 600; }

.ctrl {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.ctrl-lbl {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}
.stepper {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  overflow: hidden;
  transition: border-color 0.15s;
}
.stepper:focus-within { border-color: var(--brand); }
.stepper button {
  border: 0;
  background: var(--bg);
  width: 30px;
  height: 34px;
  cursor: pointer;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.stepper button:hover { background: var(--brand-soft); color: var(--brand); }
.stepper input {
  width: 78px;
  border: 0;
  text-align: center;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--ink);
  padding: 4px 2px;
  background: #fff;
}
.stepper input:focus { outline: none; }
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.seg {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 2px;
}
.seg button {
  border: 0;
  background: none;
  padding: 6px 11px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.seg button:hover { color: var(--brand); }
.seg button[aria-pressed="true"] {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
}

.pill-toggle {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: var(--r-sm);
  padding: 7px 13px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.pill-toggle:hover { border-color: var(--brand); color: var(--brand); }
.pill-toggle[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* ---------- Section Heading ---------- */
.sec-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 20px;
}
.sec-eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 4px;
}
.sec-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(26px, 3.6vw, 38px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.sec-sub {
  margin-top: 6px;
  font-size: 14.5px;
  color: var(--muted);
  max-width: 60ch;
}

/* ---------- 2x2 Decision Matrix + Live Photo Spotlight ---------- */
.matrix-section {
  display: grid;
  gap: 18px;
}
.matrix-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.85fr);
  gap: 20px;
  align-items: stretch;
}
@media (max-width: 980px) { .matrix-layout { grid-template-columns: 1fr; } }

.matrix-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 22px 18px;
  display: grid;
  gap: 12px;
  box-shadow: var(--shadow-card);
}
.matrix-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.matrix-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
}
.matrix-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot-swatch {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.dot-swatch.pareto { background: var(--brand); box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--brand); }
.dot-swatch.sweet { background: var(--ok); }
.dot-swatch.other { background: #94a3b8; }

.matrix-svg {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
}
.matrix-svg .quad-title {
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.matrix-svg .quad-sub {
  font-family: var(--sans);
  font-size: 10px;
  fill: var(--muted);
}
.matrix-svg .axis-tick {
  font-family: var(--sans);
  font-size: 10.5px;
  fill: var(--muted);
}
.matrix-svg .axis-name {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  fill: var(--ink-2);
}
.matrix-svg .car-pt {
  cursor: pointer;
  transition: transform 0.14s ease;
}
.matrix-svg .car-pt text {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 600;
  fill: var(--ink);
  pointer-events: none;
}

/* Spotlight Card beside Matrix */
.spotlight {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
}
.spotlight-stage {
  position: relative;
  background: var(--stage);
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.spotlight-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.spotlight-pills {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.spotlight-body {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}
.spotlight-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.spotlight-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

.spotlight-kpi {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.spotlight-price {
  font-family: var(--display);
  font-weight: 700;
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.spotlight-price small { font-family: var(--sans); font-size: 13px; font-weight: 500; color: var(--muted); }
.spotlight-fun { text-align: right; }
.spotlight-fun b {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  color: var(--brand);
}
.spotlight-fun.high b { color: var(--accent); }
.spotlight-fun small { display: block; font-size: 11px; color: var(--muted); }

.stat-trio {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 0;
  border-block: 1px solid var(--line);
}
.stat-cell b {
  display: block;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.15;
}
.stat-cell span { font-size: 11px; color: var(--muted); }

.spotlight-verdict {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.spotlight-actions {
  margin-top: auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

/* ---------- Quick Decision Winner Strip ---------- */
.winners-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 860px) { .winners-strip { grid-template-columns: 1fr; } }

.winner-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px;
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.winner-card:hover {
  border-color: var(--brand-border);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.winner-thumb {
  aspect-ratio: 16 / 10;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--stage);
}
.winner-thumb img { width: 100%; height: 100%; object-fit: cover; }
.winner-tag {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ok);
}
.winner-tag.upgrade { color: var(--accent); }
.winner-tag.rational { color: var(--brand); }
.winner-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.15;
  margin-top: 2px;
}
.winner-meta {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px;
}
.winner-meta b { color: var(--ink); font-weight: 600; }

/* ---------- Filter & Search Toolbar ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip .cnt { font-size: 11.5px; opacity: 0.72; }

.catalog-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.search-input {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 8px 15px;
  font-size: 13px;
  width: 230px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-input:focus {
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  outline: none;
}
.sort-select {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.sort-select:focus { border-color: var(--brand); outline: none; }

/* ---------- Porsche.com Photo Model Grid ---------- */
.showroom-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
@media (max-width: 1080px) { .showroom-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 660px) { .showroom-grid { grid-template-columns: 1fr; } }

.model-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  box-shadow: var(--shadow-card);
}
.model-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--brand-border);
}
.model-card.selected-cmp { border-color: var(--brand); box-shadow: 0 0 0 1.5px var(--brand); }

.model-stage {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--stage);
  overflow: hidden;
}
.model-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.model-card:hover .model-stage img { transform: scale(1.04); }

.stage-top {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(19, 27, 38, 0.07);
}
.pill.dark { background: rgba(22, 68, 115, 0.92); color: #fff; }
.pill.brand { background: var(--brand-soft); color: var(--brand); box-shadow: none; }
.pill.ok { background: var(--ok); color: #fff; }
.pill.red { background: var(--accent); color: #fff; }
.pill.warn { background: var(--warn-soft); color: var(--warn); box-shadow: none; }
.pill.subtle { background: var(--surface-alt); color: var(--ink-2); box-shadow: none; }

.model-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
.model-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.model-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.15;
  letter-spacing: -0.015em;
}
.model-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}
.model-cost-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.model-monthly {
  font-family: var(--display);
  font-weight: 700;
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.02em;
}
.model-monthly small { font-family: var(--sans); font-size: 12.5px; font-weight: 500; color: var(--muted); }
.budget-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
}
.budget-tag.ok { background: var(--ok-soft); color: var(--ok); }
.budget-tag.over { background: var(--surface-alt); color: var(--muted); }

.model-specs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.model-specs div b { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.model-specs div span { font-size: 11px; color: var(--muted); }

.model-actions {
  margin-top: auto;
  padding-top: 4px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1.5px solid var(--brand);
  background: var(--brand);
  color: #fff;
  border-radius: var(--r-sm);
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
}
.btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.outline {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn.outline:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.btn.outline[aria-pressed="true"] { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.accent:hover { background: #a80e22; border-color: #a80e22; }
.btn.sm { padding: 7px 13px; font-size: 12.5px; }
.btn.pill-btn { border-radius: 999px; }

.lnk {
  border: 0;
  background: none;
  padding: 0;
  color: var(--brand);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.lnk:hover { color: var(--brand-hover); }

.field {
  display: grid;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
}
.field input, .field select {
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 9px 11px;
  font-size: 14px;
  width: 100%;
  min-width: 0;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  outline: none;
}
.field small { font-weight: 400; color: var(--muted); font-size: 11.5px; }

/* ---------- Floating Compare Bar ---------- */
.compare-bar {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 35;
  background: var(--brand);
  color: #fff;
  border-radius: 999px;
  padding: 8px 10px 8px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 20px 50px rgba(15, 51, 88, 0.35);
  max-width: calc(100vw - 24px);
}
@media (max-width: 820px) { .compare-bar { bottom: 68px; } }
.compare-chips { display: flex; align-items: center; gap: 6px; overflow-x: auto; }
.compare-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.compare-chip button { border: 0; background: none; color: rgba(255, 255, 255, 0.8); cursor: pointer; padding: 0; }
.compare-chip button:hover { color: #fff; }
.compare-bar .btn { background: #fff; color: var(--brand); border-color: #fff; }
.compare-bar .btn:hover { background: var(--brand-soft); }

/* ---------- Slide-Over Porsche Model Sheet ---------- */
.sheet-root {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  justify-content: flex-end;
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(19, 27, 38, 0.5);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}
.sheet-panel {
  position: relative;
  z-index: 1;
  width: min(780px, 100vw);
  height: 100%;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sheet);
  animation: slideIn 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet-backdrop.no-anim, .sheet-panel.no-anim { animation: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0.7; } to { transform: translateX(0); opacity: 1; } }

.sheet-scroll { flex: 1; overflow-y: auto; }
.sheet-hero {
  position: relative;
  background: var(--stage);
  aspect-ratio: 16 / 8.5;
  overflow: hidden;
}
.sheet-hero img { width: 100%; height: 100%; object-fit: cover; }
.sheet-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  color: var(--ink);
  font-size: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(19, 27, 38, 0.14);
}
.sheet-close:hover { background: #fff; color: var(--brand); transform: scale(1.05); }

.sheet-head {
  padding: 22px 28px 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 5;
}
.sheet-head-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
}
.sheet-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.sheet-price-block { text-align: right; }
.sheet-price {
  font-family: var(--display);
  font-weight: 700;
  font-size: 36px;
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.sheet-price small { font-family: var(--sans); font-size: 13px; font-weight: 500; color: var(--muted); }

.sheet-tabs {
  margin-top: 16px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
}
.sheet-tab {
  border: 0;
  background: none;
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2.5px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.sheet-tab:hover { color: var(--brand); }
.sheet-tab[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }
.sheet-tab span {
  margin-left: 5px;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
}

.sheet-body {
  padding: 24px 28px 40px;
  display: grid;
  gap: 20px;
}
@media (max-width: 600px) {
  .sheet-head { padding: 16px 18px 0; }
  .sheet-body { padding: 18px 18px 36px; }
}

/* ---------- Panels & Cards ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 20px 22px;
  display: grid;
  gap: 14px;
  box-shadow: var(--shadow-card);
}
.panel.soft { background: var(--surface-alt); border-color: var(--line); box-shadow: none; }
.panel.brand-tint { background: var(--brand-soft); border-color: var(--brand-border); box-shadow: none; }
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.panel-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.panel-sub { font-size: 13px; color: var(--muted); }

.verdict-quote {
  padding: 14px 16px;
  border-left: 3.5px solid var(--brand);
  background: var(--surface);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 14px;
  color: var(--ink-2);
  box-shadow: var(--shadow-card);
}

/* Cost Breakdown Bars */
.breakdown { display: grid; gap: 9px; }
.bd-grp {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.bd-grp:first-child { padding-top: 0; border-top: 0; }
.bd-grp b { color: var(--ink); }
.bd-row {
  display: grid;
  grid-template-columns: 162px minmax(0, 1fr) 78px;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}
.bd-name { display: inline-flex; align-items: center; gap: 7px; }
.sw { width: 9px; height: 9px; border-radius: 2px; display: inline-block; flex-shrink: 0; }
.bd-track { height: 7px; border-radius: 999px; background: var(--surface-alt); overflow: hidden; }
.bd-track i { display: block; height: 100%; border-radius: 999px; }
.bd-val { text-align: right; font-weight: 600; }

/* Fun Score Breakdown */
.fun-pillars {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
}
@media (max-width: 520px) { .fun-pillars { grid-template-columns: 1fr; } }
.fun-row { display: grid; gap: 4px; font-size: 12.5px; }
.fun-row-top { display: flex; justify-content: space-between; }
.fun-row-top span { color: var(--muted); }
.fun-row-top b { color: var(--ink); }
.fun-bar { height: 6px; border-radius: 999px; background: var(--surface-alt); overflow: hidden; }
.fun-bar i { display: block; height: 100%; background: var(--brand); border-radius: 999px; }

/* Chart SVG */
.chart-svg { width: 100%; height: auto; display: block; }
.chart-svg text { font-family: var(--sans); font-size: 11px; fill: var(--muted); }
.chart-svg .chart-val { fill: var(--ink); font-weight: 700; }

/* Callout */
.callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 16px;
  border-radius: var(--r-sm);
  background: var(--warn-soft);
  border: 1px solid #f5d8a8;
  color: var(--ink);
  font-size: 13px;
}
.callout.info { background: var(--brand-soft); border-color: var(--brand-border); color: var(--ink-2); }
.callout.ok { background: var(--ok-soft); border-color: #b7e4cd; color: var(--ink); }

/* Tuner & Tiers */
.tuner-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tier-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 560px) { .tier-grid { grid-template-columns: 1fr; } }
.tier-card {
  text-align: left;
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 13px 15px;
  cursor: pointer;
  display: grid;
  gap: 3px;
  transition: all 0.15s;
}
.tier-card:hover { border-color: var(--brand-border); }
.tier-card[aria-pressed="true"] { border-color: var(--brand); background: var(--surface); box-shadow: 0 4px 16px rgba(22, 68, 115, 0.09); }
.tier-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.tier-card[aria-pressed="true"] .tier-label { color: var(--brand); }
.tier-val { font-family: var(--display); font-weight: 700; font-size: 24px; }
.tier-desc { font-size: 11.5px; color: var(--muted); }

/* Risks & Ads */
.risk-list, .ad-list { display: grid; gap: 10px; }
.risk-card {
  background: var(--bg);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 12px 15px;
  display: grid;
  gap: 4px;
}
.risk-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.risk-cost { font-size: 12px; font-weight: 700; color: var(--over); background: var(--over-soft); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }

.ad-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  display: grid;
  gap: 10px;
}
.ad-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ad-price { font-family: var(--display); font-weight: 700; font-size: 22px; text-align: right; }
.ad-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }

/* Details accordion */
details.acc {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 11px 14px;
}
details.acc summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
details.acc summary::after { content: "▾"; color: var(--brand); }
details.acc[open] summary { margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
details.acc[open] summary::after { transform: rotate(180deg); }

.spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 8px; }
.spec-tile { background: var(--bg); border-radius: var(--r-sm); padding: 10px 12px; border: 1px solid var(--line); }
.spec-tile small { display: block; font-size: 11px; color: var(--muted); }
.spec-tile b { display: block; margin-top: 2px; font-size: 13.5px; }

.tw { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; }
td.wrap, th.wrap { white-space: normal; min-width: 170px; }
tr.total-row td { font-weight: 700; background: var(--surface-alt); border-bottom: 0; }
ol.steps { margin: 0; padding-left: 18px; display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); }
.source-line { font-size: 12px; color: var(--muted); }
.source-line a { color: var(--brand); font-weight: 500; }

/* ---------- Compare, Simulator, Settings, Research & Method ---------- */
.cmp-cols { display: grid; gap: 18px; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); }
@media (max-width: 720px) { .cmp-cols { grid-template-columns: 1fr; } }

.split-view { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 880px) { .split-view { grid-template-columns: 1fr; } }
.sticky-col { position: sticky; top: 84px; display: grid; gap: 16px; }
@media (max-width: 880px) { .sticky-col { position: static; } }

.cfg-stack { display: grid; gap: 20px; }
.loc-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}
@media (max-width: 640px) { .loc-bar { grid-template-columns: 1fr; } }
.model-select-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 680px) { .model-select-grid { grid-template-columns: 1fr; } }

.slider-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; }
.slider-row span { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.slider-row output { font-size: 13px; font-weight: 700; color: var(--brand); }
.slider-row input[type="range"] { grid-column: 1 / -1; width: 100%; accent-color: var(--brand); cursor: pointer; }

.tornado { display: grid; gap: 12px; }
.torn-item { display: grid; gap: 4px; }
.torn-head { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 600; }
.torn-track { position: relative; height: 10px; background: var(--surface-alt); border-radius: 999px; }
.torn-bar { position: absolute; top: 0; bottom: 0; background: var(--brand); border-radius: 999px; }
.torn-base { position: absolute; top: -3px; bottom: -3px; width: 2.5px; background: var(--accent); border-radius: 2px; }
.torn-ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }

.picker-wrap { position: relative; }
.picker-menu {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 4px); z-index: 25;
  background: #fff; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  max-height: 240px; overflow-y: auto; box-shadow: var(--shadow-hover);
}
.picker-opt { width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; font-size: 13.5px; cursor: pointer; border-bottom: 1px solid var(--line); }
.picker-opt:hover { background: var(--brand-soft); color: var(--brand); }

.step-log { display: grid; gap: 10px; }
.step-item { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-2); }
.step-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; flex-shrink: 0; }
.step-item.av .step-dot { background: var(--over-soft); color: var(--over); }
.step-item.av { color: var(--over); }

.method-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.method-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px; display: grid; gap: 6px; box-shadow: var(--shadow-card); }
.method-card h3 { font-family: var(--display); font-size: 16px; font-weight: 700; color: var(--brand); }
.method-card p { font-size: 13px; color: var(--ink-2); }

.empty-state {
  background: var(--surface);
  border: 1.5px dashed var(--brand-border);
  border-radius: var(--r-md);
  padding: 40px 20px;
  text-align: center;
  display: grid;
  gap: 12px;
  justify-items: center;
  color: var(--muted);
}

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