/* ==========================================================================
   Theme tokens
   ========================================================================== */
:root {
  --brand: #ff9f43;          /* light orange: main color */
  --brand-strong: #f2871c;
  --brand-soft: #fff3e6;
  --brand-ink: #1f2328;      /* text on orange fills (white on this orange fails contrast) */

  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #faf9f7;
  --text: #1f2328;
  --muted: #5d6570;
  --border: #ecebe8;
  --shadow: 0 1px 2px rgba(31, 35, 40, .04), 0 8px 24px rgba(31, 35, 40, .06);
  --danger: #c2410c;
  --danger-soft: #fff1ea;
  --up: #15803d;
  --down: #c62828;
  --focus: 0 0 0 3px rgba(255, 159, 67, .45);

  --radius: 14px;
  --radius-sm: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  color-scheme: light;
}

[data-theme="dark"] {
  --brand: #ffab5e;
  --brand-strong: #ffbd80;
  --brand-soft: rgba(255, 159, 67, .13);
  --brand-ink: #1a1206;

  --bg: #121316;
  --surface: #1a1c20;
  --surface-2: #202329;
  --text: #ecedef;
  --muted: #a3a9b2;
  --border: #2c2f36;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --danger: #ff9a6b;
  --danger-soft: rgba(255, 120, 70, .12);
  --up: #4ade80;
  --down: #f87171;

  color-scheme: dark;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  transition: background-color .2s, color .2s;
}

a { color: inherit; }

h1, h2, h3 { line-height: 1.2; margin: 0; }

button, input, select { font: inherit; color: inherit; }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }

[hidden] { display: none !important; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--brand);
  color: var(--brand-ink);
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header::after {      /* thin "racing stripe" under the header */
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--brand) 0 60%, transparent 60% 63%, var(--brand) 63% 70%, transparent 70% 73%, var(--brand) 73% 76%, transparent 76%);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--brand);
  color: var(--brand-ink);
  flex: none;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 17px; letter-spacing: -.01em; }
.wordmark { font-weight: 800; letter-spacing: -.03em; }
.brand-text .wordmark { font-size: 21px; line-height: 1.1; }
.wordmark span { color: var(--brand-strong); }
[data-theme="dark"] .wordmark span { color: var(--brand); }
.brand-text small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main-nav { display: flex; gap: 4px; margin-left: auto; }
.main-nav a {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s, background-color .15s;
}
.main-nav a:hover { color: var(--text); background: var(--surface-2); }
.main-nav a[aria-current="page"] { color: var(--text); background: var(--brand-soft); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  flex: none;
  transition: border-color .15s, transform .15s;
}
.icon-btn:hover { border-color: var(--brand); }
.icon-btn:active { transform: scale(.94); }
.menu-toggle { display: none; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; color: var(--brand); }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ==========================================================================
   Ad slots (IAB standard sizes). Dashed placeholders while ads are off; with ads on (.is-live)
   the box keeps its size and the AdSense unit fills it.
   ========================================================================== */
.ad {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin: 0 auto;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: repeating-linear-gradient(-45deg, var(--surface-2) 0 10px, transparent 10px 20px);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  overflow: hidden;
}
.ad small { font-size: 11px; letter-spacing: .04em; opacity: .75; }
.ad.is-live { border: 0; border-radius: 0; background: none; }
.ad ins.adsbygoogle { display: block; width: 100%; height: 100%; }
.ad ins.adsbygoogle[data-ad-status="unfilled"] { display: none; }

.ad-band { padding: 16px 0; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.ad-leaderboard, .ad-incontent { width: 728px; max-width: 100%; height: 90px; }
.ad-mrec { width: 300px; height: 250px; }
.ad-halfpage { width: 300px; height: 600px; }
.ad-size-mobile { display: none; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  padding: 44px 0 64px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 80% at 100% 0%, var(--brand-soft), transparent 70%),
    var(--bg);
}
.hero-inner { max-width: 1200px; }
.eyebrow {
  display: inline-block;
  margin: 0 0 14px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
}
.hero h1 {
  max-width: 760px;
  font-size: clamp(28px, 4.2vw, 44px);
  letter-spacing: -.025em;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(transparent 62%, color-mix(in srgb, var(--brand) 55%, transparent) 62%);
}
.lead { max-width: 640px; margin: 14px 0 0; font-size: 18px; color: var(--muted); }

/* Road with a car driving across: the site's small automotive signature. */
.road {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 36px;
  border-top: 1px solid var(--border);
  background:
    linear-gradient(90deg, var(--brand) 0 40px, transparent 40px 80px) 0 50% / 80px 3px repeat-x,
    var(--surface-2);
  opacity: .9;
}
.road-car {
  position: absolute;
  bottom: 14px;
  left: -130px;
  width: 92px;
  height: auto;
  color: var(--text);
  animation: drive 14s cubic-bezier(.45, .05, .55, .95) 1s infinite;
}
.road-car-glass { fill: var(--brand); }
.road-car-wheel { fill: var(--bg); stroke: currentColor; stroke-width: 3; }

@keyframes drive {
  0% { transform: translateX(0); }
  45%, 55% { transform: translateX(calc(50vw - 46px)); }
  100% { transform: translateX(calc(100vw + 140px)); }
}

/* ==========================================================================
   Layout
   ========================================================================== */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start;
  padding-top: 28px;
  padding-bottom: 48px;
}
.content { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.layout-single { grid-template-columns: minmax(0, 860px); }
.sidebar { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 92px; }

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

/* ==========================================================================
   Comparator
   ========================================================================== */
.comparator { padding: 24px; }
.overlap { margin-top: -48px; position: relative; z-index: 2; }
.card-head h2 { font-size: 22px; letter-spacing: -.01em; }
.card-head p { margin: 4px 0 0; color: var(--muted); }

.picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.picker .step:nth-child(2) { grid-column: span 1; }

.step label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
}
.step-num {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  transition: background-color .2s, color .2s, border-color .2s;
}
.step.is-ready .step-num { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.step.is-done .step-num { background: var(--brand-soft); border-color: var(--brand); color: var(--text); }

select,
.combo input {
  width: 100%;
  height: 46px;
  padding: 0 40px 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 15px;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%238a9099' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
  text-overflow: ellipsis;
}
select:hover:not(:disabled), .combo input:hover:not(:disabled) { border-color: color-mix(in srgb, var(--brand) 60%, var(--border)); }
select:focus-visible, .combo input:focus-visible { border-color: var(--brand); box-shadow: var(--focus); border-radius: var(--radius-sm); }
select:disabled, .combo input:disabled { cursor: not-allowed; opacity: .55; background-color: var(--surface-2); }
.step.is-ready select, .step.is-ready .combo input { border-color: var(--brand); }

/* Model combobox: a text field that filters a listbox. */
.combo { position: relative; }
.combo-chevron { position: absolute; right: 12px; top: 14px; color: #8a9099; pointer-events: none; }
.combo-list {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  width: max(100%, 340px);
  max-height: 320px;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow), 0 16px 40px rgba(0, 0, 0, .12);
}
.combo-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}
.combo-list li small { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.combo-list li[aria-selected="true"], .combo-list li:hover { background: var(--brand-soft); }
.combo-list li.combo-empty { cursor: default; color: var(--muted); background: none; }
.combo-list mark { background: none; color: inherit; font-weight: 700; text-decoration: underline; text-decoration-color: var(--brand); text-decoration-thickness: 2px; }

.picker-status { min-height: 22px; margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.picker-status.is-error { color: var(--danger); }
.picker-status button { padding: 0; border: 0; background: none; color: var(--text); font-weight: 600; text-decoration: underline; cursor: pointer; }

/* Vehicles in the chart */
.vehicle-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 0; padding: 0; list-style: none; }
.chip {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 6px 6px 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 13px;
  animation: chip-in .3s ease-out;
}
.chip-swatch { width: 10px; height: 10px; border-radius: 999px; flex: none; background: var(--chip-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--chip-color) 25%, transparent); }
.chip-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.chip-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.chip-text span { color: var(--muted); white-space: nowrap; }
.chip-price { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.chip-remove {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex: none;
}
.chip-remove:hover { background: var(--danger-soft); color: var(--danger); }
.chip.is-flash { animation: chip-flash .9s ease-out; }

@keyframes chip-in { from { opacity: 0; transform: translateY(4px) scale(.97); } }
@keyframes chip-flash { 0%, 100% { box-shadow: none; } 30% { box-shadow: 0 0 0 4px var(--brand); } }

/* Toolbar: index toggles + scale switch */
.chart-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}
.indexes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 0; border: 0; }
.indexes legend { float: left; margin-right: 4px; font-size: 14px; font-weight: 600; color: var(--muted); }

.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: border-color .15s, background-color .15s;
}
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-swatch {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-radius: 5px;
  transition: background-color .15s, border-color .15s;
}
.toggle:hover { border-color: color-mix(in srgb, var(--brand) 60%, var(--border)); }
.toggle:has(input:checked) { border-color: var(--toggle-color, var(--brand)); background: color-mix(in srgb, var(--toggle-color, var(--brand)) 10%, var(--surface)); }
.toggle input:checked + .toggle-swatch {
  border-color: var(--toggle-color, var(--brand));
  background: var(--toggle-color, var(--brand)) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3.5 8.5 3 3 6-7' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.toggle:has(input:focus-visible) { box-shadow: var(--focus); }
.toggle.is-loading .toggle-swatch { border-color: var(--brand); border-top-color: transparent; border-radius: 999px; animation: spin .7s linear infinite; }

.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); }
.segmented button {
  min-width: 48px;
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
.segmented button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); }

/* Chart and its states */
.chart-wrap {
  position: relative;
  height: 420px;
  margin-top: 16px;
  padding: 12px 8px 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.chart-wrap canvas { transition: opacity .25s, filter .25s; }
.chart-wrap.is-loading canvas { opacity: .35; filter: blur(1px) grayscale(.4); }

.chart-empty, .chart-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
}
.chart-empty svg { color: var(--brand); }
.chart-empty p { margin: 0; }
.chart-empty strong { color: var(--text); }
.chart-loading { z-index: 3; color: var(--brand); }
.chart-loading p { margin: 0; font-weight: 600; color: var(--text); }
.gauge-arc { stroke-dasharray: 82; stroke-dashoffset: 82; animation: gauge-arc 1.4s ease-in-out infinite alternate; }
.gauge-needle { transform-origin: 32px 36px; animation: gauge-needle 1.4s ease-in-out infinite alternate; }
@keyframes gauge-needle { from { transform: rotate(-70deg); } to { transform: rotate(70deg); } }
@keyframes gauge-arc { from { stroke-dashoffset: 82; } to { stroke-dashoffset: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Drag-to-compare: the canvas takes horizontal drags, vertical swipes still scroll the page */
.chart-wrap canvas { touch-action: pan-y; cursor: crosshair; }
.chart-wrap.is-selecting canvas { cursor: col-resize; }

.range-panel { margin-top: 12px; }
.range-hint { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--muted); }
.range-hint svg { color: var(--brand); flex: none; }
.hint-touch { display: none; }
@media (hover: none) and (pointer: coarse) {
  .hint-pointer { display: none; }
  .hint-touch { display: inline; }
}

.range-summary {
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--brand) 45%, var(--border));
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  animation: chip-in .2s ease-out;
}
.range-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.range-head strong { font-size: 15px; }
.range-head span { color: var(--muted); font-size: 14px; }
.range-head .btn { margin-left: auto; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; }

.range-rows { display: grid; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.range-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.range-swatch { width: 10px; height: 10px; border-radius: 999px; background: var(--row-color); }
.range-row.is-index .range-swatch { height: 3px; border-radius: 2px; }
.range-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.range-label small { color: var(--muted); margin-left: 6px; }
.range-values { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.range-change {
  min-width: 76px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.range-change.is-up { color: var(--up); background: color-mix(in srgb, var(--up) 14%, transparent); }
.range-change.is-down { color: var(--down); background: color-mix(in srgb, var(--down) 14%, transparent); }
.range-change.is-flat, .range-change.is-none { color: var(--muted); background: var(--surface-2); font-weight: 600; }

.alert {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  animation: chip-in .25s ease-out;
}
.alert p { margin: 0; font-size: 14px; }
.alert-actions { display: flex; gap: 8px; }

.btn {
  height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-strong); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-ghost:hover { background: var(--surface); }

.source { margin: 14px 0 0; font-size: 12px; color: var(--muted); }

/* ==========================================================================
   How it works
   ========================================================================== */

/* ==========================================================================
   Shared page pieces (Tabela FIPE, Rankings, Calculadoras, Notícias, Alertas)
   ========================================================================== */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.block { display: block; }
.narrow { max-width: 720px; padding-top: 40px; padding-bottom: 56px; }

.page-head {
  padding: 28px 0 64px;
  background: radial-gradient(ellipse 60% 90% at 100% 0%, var(--brand-soft), transparent 70%), var(--bg);
  border-bottom: 1px solid var(--border);
}
.page-head h1 { font-size: clamp(26px, 3.6vw, 38px); letter-spacing: -.02em; }
.page-head + .layout { margin-top: -40px; position: relative; }
.page-head .lead { font-size: 17px; }

.crumbs ol { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 12px; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 4px; opacity: .7; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }
.crumbs [aria-current] { color: var(--text); font-weight: 500; }

.section-card { padding: 22px 24px; }
.section-card > h2, .section-head h2 { font-size: 19px; letter-spacing: -.01em; }
.section-card > h2 { margin-bottom: 14px; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
}
.badge-data { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); color: var(--text); }

/* Tabs (vehicle type) and pills (list) */
.tabs { display: flex; gap: 4px; margin: 0 0 16px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs a {
  padding: 10px 16px;
  margin-bottom: -1px;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--brand); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.pills a {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.pills a:hover { border-color: var(--brand); color: var(--text); }
.pills a[aria-current="page"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

/* Search over server-rendered lists */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; }
.search { position: relative; flex: 1 1 260px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input, .calc-form input, .calc-form select, .filters select, .inline-field select {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  font-size: 15px;
}
.search input { padding-left: 38px; }
.search input:focus-visible, .calc-form input:focus-visible { border-color: var(--brand); box-shadow: var(--focus); }

.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.link-grid a {
  display: block;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  transition: border-color .15s, background-color .15s, transform .15s;
}
.link-grid a:hover { border-color: var(--brand); background: var(--brand-soft); transform: translateY(-1px); }

.model-list { margin: 0; padding: 0; list-style: none; columns: 2 320px; column-gap: 20px; }
.model-list li { break-inside: avoid; }
.model-list a { display: flex; justify-content: space-between; gap: 12px; padding: 9px 10px; border-radius: 8px; text-decoration: none; }
.model-list a:hover { background: var(--brand-soft); }
.model-list small { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.empty-filter, .empty-state { color: var(--muted); padding: 12px 0; margin: 0; }

/* Data tables */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.data-table th, .data-table td { padding: 11px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.data-table thead th { font-size: 13px; font-weight: 600; color: var(--muted); border-bottom-width: 2px; white-space: nowrap; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table a { text-decoration: none; }
.data-table a:hover { text-decoration: underline; }
.data-table .rank { width: 40px; color: var(--muted); font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }

.change { display: inline-block; padding: 2px 8px; border-radius: 999px; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.change.is-up { color: var(--up); background: color-mix(in srgb, var(--up) 13%, transparent); }
.change.is-down { color: var(--down); background: color-mix(in srgb, var(--down) 13%, transparent); }
.change.is-flat { color: var(--muted); background: var(--surface-2); }

/* Ranking filters and headline numbers */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.filters label, .calc-form label, .inline-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.filters label { flex: 1 1 160px; }
.filters select, .calc-form select, .inline-field select {
  appearance: none;
  padding-right: 38px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%238a9099' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.inline-field { flex-direction: row; align-items: center; gap: 10px; }
.inline-field select { width: auto; min-width: 200px; height: 40px; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 4px 0 18px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 24px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-note { font-size: 12px; color: var(--muted); }

.rank-list { margin: 0; padding: 0; list-style: none; counter-reset: rank; }
.rank-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); counter-increment: rank; }
.rank-list li::before { content: counter(rank); width: 22px; flex: none; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.rank-list li > div { flex: 1; min-width: 0; }
.rank-list a { font-weight: 600; text-decoration: none; }
.rank-list a:hover { text-decoration: underline; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

/* Explore cards (home) */
.explore h2 { font-size: 20px; margin-bottom: 14px; }
.explore-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.explore-card { display: block; height: 100%; padding: 20px; box-shadow: none; text-decoration: none; transition: transform .2s, box-shadow .2s, border-color .2s; }
.explore-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 50%, var(--border)); }
.explore-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 12px; border-radius: 11px; background: var(--brand-soft); color: var(--text); }
.explore-card h3 { font-size: 17px; }
.explore-card p { margin: 6px 0 0; color: var(--muted); font-size: 15px; }

.toolbar-end { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }

/* Model page */
.chart-sm { height: 320px; }
.actions-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 0; }

/* Calculators */
.calc-vehicle {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 40%, var(--border));
}
.calc-vehicle > div { display: flex; flex-direction: column; }
.calc-price { text-align: right; }
.calc-price strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.calc-form { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.calc-form label { flex: 1 1 160px; }
.calc-form label.grow { flex: 3 1 260px; }
.calc-result { display: grid; gap: 2px; }
.result-big {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.result-big span { font-weight: 600; color: var(--muted); }
.result-big strong { font-size: 28px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.result-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--border); font-size: 15px; }
.result-row strong { font-variant-numeric: tabular-nums; }
.calc-result p { margin: 10px 0 0; }

/* Alerts */
.alert-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 16px; font-size: 14px; color: var(--muted); }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand-strong); flex: none; }
.form-status { min-height: 22px; margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.form-status.is-error { color: var(--danger); }
.form-status.is-success { color: var(--up); font-weight: 600; }
.steps-list { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.status-card { text-align: center; padding: 36px 28px; }
.status-card h1 { font-size: 26px; margin-bottom: 10px; }
.status-card form, .status-card p { margin: 14px 0 0; }
.status-card .btn { margin: 4px; }
.status-icon { color: var(--brand); margin-bottom: 8px; }
.status-vehicle { padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); }

/* News */
.news-list { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.news-card { padding: 20px 22px; box-shadow: none; transition: border-color .2s, box-shadow .2s; }
.news-card:hover { border-color: color-mix(in srgb, var(--brand) 50%, var(--border)); box-shadow: var(--shadow); }
.news-card h2 { margin: 10px 0 6px; font-size: 20px; letter-spacing: -.01em; }
.news-card h2 a { text-decoration: none; }
.news-card h2 a:hover { text-decoration: underline; text-decoration-color: var(--brand); }
.news-card p { margin: 0 0 8px; color: var(--muted); }
.archive details { border-bottom: 1px solid var(--border); }
.archive summary { padding: 10px 2px; font-weight: 700; cursor: pointer; }
.archive-months { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; }
.archive-months a { display: inline-block; padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; text-decoration: none; }
.archive-months a:hover { border-color: var(--brand); background: var(--brand-soft); }
.article-head { padding: 8px 0 18px; }
.article-head h1 { margin: 10px 0 8px; font-size: clamp(26px, 3.6vw, 38px); letter-spacing: -.02em; }
.article-head .lead { max-width: none; }
.prose { font-size: 17px; line-height: 1.7; }
.prose h2 { margin: 26px 0 8px; font-size: 21px; }
.prose p, .prose ul, .prose ol { margin: 0 0 14px; }
.prose li { margin-bottom: 6px; }
.prose > :first-child { margin-top: 0; }
.pager { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* API page */
.feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; margin: 0; padding: 0; list-style: none; }
.feature-grid li { display: flex; flex-direction: column; gap: 4px; padding-left: 14px; border-left: 3px solid var(--brand); }
.feature-grid span { color: var(--muted); font-size: 15px; }
.code { margin: 10px 0; padding: 14px 16px; overflow-x: auto; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; line-height: 1.5; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { border-top: 1px solid var(--border); background: var(--surface-2); padding: 32px 0; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 16px 32px; align-items: start; }
.footer-inner p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.site-footer nav a { color: var(--muted); font-size: 14px; text-decoration: none; }
.site-footer nav a:hover { color: var(--text); text-decoration: underline; }
.footer-note { grid-column: 1 / -1; font-size: 12px !important; }

/* Cookie notice (LGPD), fixed at the bottom until dismissed */
.cookie-notice {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 880px;
  margin: 0 auto;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-size: 14px;
}
.cookie-notice p { margin: 0; color: var(--muted); }
.cookie-notice .btn { flex: none; }
@media (max-width: 600px) {
  .cookie-notice { flex-direction: column; align-items: stretch; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; flex-direction: row; justify-content: center; }
  .ad-halfpage { display: none; }
}

@media (max-width: 1060px) {
  .menu-toggle { display: grid; margin-left: auto; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 2px;
    padding: 10px 16px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .main-nav.is-open { display: flex; }
  .main-nav a { padding: 12px 14px; border-radius: var(--radius-sm); }
  .header-inner { position: relative; }
}

@media (max-width: 900px) {
  .picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  .stats, .two-col, .explore-grid, .feature-grid { grid-template-columns: minmax(0, 1fr); }
  .section-card { padding: 18px 16px; }
  .row-actions { flex-wrap: wrap; justify-content: flex-start; }
  .data-table th, .data-table td { padding: 10px 6px; }
  .result-row { grid-template-columns: minmax(0, 1fr) auto; }
  .result-row .change { grid-column: 2; justify-self: end; }
  .inline-field { flex-direction: column; align-items: stretch; }
  .inline-field select { width: 100%; }
  .ad-leaderboard { width: 320px; height: 50px; }
  .ad-incontent { width: 300px; height: 250px; }
  .ad-size-desktop { display: none; }
  .ad-size-mobile { display: inline; }
  .hero { padding: 28px 0 56px; }
  .lead { font-size: 16px; }
  .comparator { padding: 18px 16px; }
  .chart-wrap { height: 340px; padding: 8px 2px 2px; }
  .footer-inner { grid-template-columns: minmax(0, 1fr); }
  .chip-text strong { max-width: 180px; }
  .range-row { grid-template-columns: 10px minmax(0, 1fr) auto; }
  .range-values { grid-column: 2 / -1; grid-row: 2; font-size: 13px; }
}

@media (max-width: 520px) {
  .container { padding: 0 16px; }
  .picker { grid-template-columns: minmax(0, 1fr); }
  .brand-text small { display: none; }
  .chart-toolbar { flex-direction: column; align-items: stretch; }
  .segmented { align-self: flex-end; }
  .combo-list { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .road-car { display: none; }
}
