/* combustiveisproximasemana.pt — one bold element (the price board), everything else quiet. */
:root {
  --paper: #f3f5f7;
  --surface: #ffffff;
  --ink: #13233f;
  --ink-2: #4a5a75;
  --ink-3: #5d6b83; /* ≥ 4.9:1 on --paper (WCAG AA) */
  --line: #d9dfe7;
  --totem: #0f1d36;
  --totem-2: #182a4b;
  --amber: #ffb21a;
  --down: #0b7a53;
  --down-bg: #e3f4ec;
  --up: #b4381a;
  --up-bg: #fbe9e3;
  --focus: #2d6bff;
  --s1: #257de0; /* gasóleo */
  --s2: #e0601f; /* gasolina 95 */
  --s3: #6a4ce2;
  --s4: #008a17;
  --radius-s: 6px;
  --radius-l: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --measure: 68ch;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.6 var(--font); }
.n, .kpis dd, .calc-out dd, .st-price, .districts .n, .acc-stats .big, .money, .delta, .totem-now, .chart text, .tip { font-variant-numeric: tabular-nums; }
img, svg { display: block; max-width: 100%; }
a { color: var(--ink); text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { top: 8px; }
.wrap { width: min(1140px, 100% - 40px); margin-inline: auto; }
.small, .source { font-size: 14px; color: var(--ink-2); }
.source { margin-top: 8px; }
.muted { color: var(--ink-3); }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(30px, 4.6vw, 50px); font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: clamp(22px, 2.6vw, 28px); font-weight: 750; }
h3 { font-size: 19px; font-weight: 700; }
p { margin: 0 0 1em; }
.prose { max-width: var(--measure); }
.wrap.prose { max-width: none; }
.wrap.prose > * { max-width: var(--measure); }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-bottom: .35em; }

/* Demo banner */
.demo-banner { background: #fff4d6; border-bottom: 1px solid #f0d58a; font-size: 14px; padding: 8px 0; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 14px; line-height: 1.1; letter-spacing: -0.01em; }
.brand svg { width: 34px; height: 34px; }
.nav-desktop { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-desktop a, .nav-mobile a { display: block; padding: 8px 12px; border-radius: var(--radius-s); text-decoration: none; font-size: 15px; color: var(--ink-2); }
.nav-desktop a:hover { background: var(--paper); color: var(--ink); }
.nav-desktop a[aria-current="page"] { color: var(--ink); font-weight: 650; box-shadow: inset 0 -2px 0 var(--ink); border-radius: 0; }
.nav-mobile { display: none; position: relative; }
.nav-mobile summary { list-style: none; cursor: pointer; padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--radius-s); font-weight: 600; }
.nav-mobile summary::-webkit-details-marker { display: none; }
.nav-mobile ul { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); list-style: none; padding: 6px; margin: 0; width: 260px; z-index: 5; box-shadow: 0 12px 30px rgba(19,35,63,.14); }
@media (max-width: 900px) { .nav-desktop { display: none; } .nav-mobile { display: block; } }

/* Crumbs */
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 20px 0 0; font-size: 14px; color: var(--ink-3); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line); }
.crumbs a { color: var(--ink-2); }

/* Hero */
.hero { padding: 36px 0 44px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.hero .lead { font-size: 20px; line-height: 1.45; color: var(--ink); max-width: 34ch; }
.hero h1 { margin-top: 8px; max-width: 16ch; }
.status { display: flex; gap: 10px; align-items: baseline; font-size: 14px; color: var(--ink-2); max-width: 52ch; }
.status .dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px rgba(255,178,26,.25); transform: translateY(-1px); }
.status-final .dot { background: var(--down); box-shadow: 0 0 0 3px rgba(11,122,83,.2); }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 24px; } .hero { padding-top: 24px; } }

/* The price board */
.totem { margin: 0; background: var(--totem); color: #e9eef7; border-radius: var(--radius-l); padding: 18px 20px 10px; box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 24px 48px -24px rgba(15,29,54,.6); }
.totem figcaption { display: flex; justify-content: space-between; font-size: 13px; color: #9fb0cc; padding-bottom: 12px; border-bottom: 1px solid var(--totem-2); }
.totem-rows { list-style: none; margin: 0; padding: 0; }
.totem-row { display: grid; grid-template-columns: minmax(110px, 1fr) auto auto; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--totem-2); }
.totem-row:last-child { border-bottom: 0; }
.totem-fuel { display: flex; flex-direction: column; }
.totem-name { font-weight: 700; font-size: 17px; color: #fff; }
.totem-now { font-size: 13px; color: #8ea1c0; }
.seg svg { height: 46px; width: auto; }
.seg .on { fill: var(--amber); }
/* One glow per number (not per segment): far cheaper to paint on phones. */
.seg svg { filter: drop-shadow(0 0 3px rgba(255,178,26,.4)); }
.seg .off { fill: #ffffff; opacity: .05; }
.delta { font-weight: 700; font-size: 14px; padding: 4px 9px; border-radius: 999px; white-space: nowrap; min-width: 92px; text-align: center; }
.totem .delta.down { background: rgba(91,214,164,.14); color: #5bd6a4; }
.totem .delta.up { background: rgba(255,120,90,.16); color: #ff9c84; }
.totem .delta.flat { background: rgba(255,255,255,.08); color: #c9d3e4; }
@media (max-width: 520px) {
  .totem { padding: 14px 14px 6px; }
  .totem-row { grid-template-columns: 1fr auto; row-gap: 4px; }
  .totem-row .seg { grid-column: 1; grid-row: 2; }
  .totem-row .delta { grid-column: 2; grid-row: 1 / span 2; }
  .seg svg { height: 38px; }
}
@media (prefers-reduced-motion: no-preference) {
  /* Animate one element per row (the whole number), not every segment. */
  .totem .seg svg { animation: lit .9s steps(3, end) both; }
  .totem-row:nth-child(2) .seg svg { animation-delay: .08s; }
  .totem-row:nth-child(3) .seg svg { animation-delay: .16s; }
  .totem-row:nth-child(4) .seg svg { animation-delay: .24s; }
  @keyframes lit { from { opacity: .15; } to { opacity: 1; } }
}

/* Sections */
.section { padding: 44px 0; border-top: 1px solid var(--line); }
/* Off-screen sections are rendered only when scrolled near: halves main-thread work at load on phones. */
main > .section { content-visibility: auto; contain-intrinsic-size: auto 700px; }
.section-head { max-width: var(--measure); margin-bottom: 20px; }
.section-head p { color: var(--ink-2); }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; gap: 28px; } }
/* Grid children may shrink below their content width, so wide tables scroll inside .table-wrap instead of widening the page. */
.two-col > *, .hero-grid > *, .footer-grid > * { min-width: 0; }
.prose a, .page-head a, .footer-grid a { overflow-wrap: anywhere; }

/* Verdict */
.verdict { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 22px 22px 14px; }
.verdict h2 { font-size: 22px; }
.tank-switch { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; margin-bottom: 14px; }
.tank-switch button { font: inherit; font-size: 14px; padding: 6px 12px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.tank-switch button + button { border-left: 1px solid var(--line); }
.tank-switch button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.verdict-list { list-style: none; padding: 0; margin: 0 0 8px; }
.verdict-list li { display: grid; grid-template-columns: 96px 1fr auto; gap: 12px; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--line); }
.v-fuel { font-weight: 700; }
.money { font-size: 15px; white-space: nowrap; }
.money b { font-size: 20px; }
.money.down { color: var(--down); }
.money.up { color: var(--up); }
@media (max-width: 520px) { .verdict-list li { grid-template-columns: 1fr auto; } .v-advice { grid-column: 1 / -1; grid-row: 2; } }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
caption { text-align: left; padding: 10px 12px; font-weight: 650; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: 13px; font-weight: 600; color: var(--ink-2); background: #f8fafc; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
tbody th { font-weight: 500; }
.n { text-align: right; white-space: nowrap; }
.down { color: var(--down); }
.up { color: var(--up); }
.flat { color: var(--ink-2); }
.miss { color: var(--up); font-weight: 700; }
table.sources tbody tr:last-child { background: #f8fafc; }

/* Accuracy */
.acc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.acc-stats p { margin: 0; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); color: var(--ink-2); font-size: 15px; }
.acc-stats .big { display: block; font-size: 34px; font-weight: 800; color: var(--ink); letter-spacing: -0.03em; line-height: 1.1; }
@media (max-width: 520px) { .acc-stats { grid-template-columns: 1fr; } }

/* Chart */
.chart { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 18px; }
.chart figcaption { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.chart-title { font-weight: 700; }
.legend { display: flex; gap: 16px; list-style: none; padding: 0; margin: 0; font-size: 14px; color: var(--ink-2); }
.swatch { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.swatch-gasoleo { background: var(--s1); } .swatch-gasolina95 { background: var(--s2); } .swatch-gasolina98 { background: var(--s3); } .swatch-gpl { background: var(--s4); }
.tip .t-row b { margin-left: auto; }
.after-list { margin-top: 12px; }
.geo-msg { flex-basis: 100%; margin: 0; }
.chart-box { position: relative; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ax { fill: var(--ink-3); font-size: 12px; }
.chart .lab { fill: var(--ink); font-size: 12.5px; font-weight: 600; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .xhair { stroke: var(--ink-3); stroke-dasharray: 3 3; }
.chart .xhair[hidden] { display: none; }
.tip { position: absolute; top: 0; pointer-events: none; background: var(--ink); color: #fff; font-size: 13px; padding: 8px 10px; border-radius: var(--radius-s); white-space: nowrap; transform: translateX(-50%); box-shadow: 0 8px 20px rgba(19,35,63,.25); }
.tip .t-row { display: flex; gap: 8px; align-items: center; }
.tip .t-dot { width: 8px; height: 8px; border-radius: 50%; }
.chart-table { margin-top: 10px; font-size: 14px; }
.chart-table summary { cursor: pointer; color: var(--ink-2); }
.chart-table .table-wrap { margin-top: 8px; max-height: 320px; overflow-y: auto; }

/* Calculator */
.calc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 20px; }
.calc-fields { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.calc label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.calc select, .calc input, .alert-form input, .station-tools select { font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid #b9c3d2; border-radius: var(--radius-s); background: #fff; color: var(--ink); width: 100%; }
.calc-out { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 16px 0 0; }
.calc-out div { padding: 12px; background: var(--paper); border-radius: var(--radius-s); }
.calc-out dt { font-size: 13px; color: var(--ink-2); }
.calc-out dd { margin: 2px 0 0; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
@media (max-width: 520px) { .calc-out { grid-template-columns: 1fr; } .calc-fields { grid-template-columns: 1fr; } }

/* Stations */
.stations { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); counter-reset: st; }
.stations li { display: grid; grid-template-columns: 30px 1fr auto auto; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); counter-increment: st; }
.stations li::before { content: counter(st); font-weight: 800; color: var(--ink-3); font-size: 14px; }
.stations li:last-child { border-bottom: 0; }
.st-main { display: flex; flex-direction: column; min-width: 0; }
.st-name { font-weight: 650; }
.st-meta { font-size: 13px; color: var(--ink-2); }
.st-price { font-weight: 800; font-size: 18px; }
.st-go { font-size: 14px; font-weight: 600; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); text-decoration: none; }
.st-go:hover { background: var(--paper); }
.station-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 16px; }
.station-tools label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); min-width: 220px; }
.btn { font: inherit; font-weight: 650; font-size: 15px; padding: 10px 16px; border-radius: var(--radius-s); border: 1px solid var(--ink); background: var(--ink); color: #fff; cursor: pointer; text-decoration: none; display: inline-block; }
.btn.ghost { background: transparent; color: var(--ink); }
@media (max-width: 520px) {
  .stations li { grid-template-columns: 22px 1fr auto; row-gap: 6px; padding: 12px 14px; }
  .st-go { grid-column: 3; grid-row: 2; justify-self: end; padding: 8px 14px; }
  .stations li::before { align-self: start; padding-top: 2px; }
}

/* Districts */
.districts { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.districts a { display: flex; justify-content: space-between; gap: 8px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); text-decoration: none; }
.districts a:hover { border-color: var(--ink-3); }
.districts .n { color: var(--ink-2); }

/* Alerts */
.alert-box { background: var(--totem); color: #e9eef7; border-radius: var(--radius-l); padding: 28px; }
.alert-box h2 { color: #fff; }
.alert-box p { color: #b8c6dc; max-width: 52ch; }
.alert-box p a { color: #e9eef7; }
.alert-form { display: flex; flex-wrap: wrap; gap: 10px; max-width: 520px; }
.alert-form input { flex: 1 1 240px; border-color: transparent; }
.alert-form button { font: inherit; font-weight: 700; padding: 10px 18px; border-radius: var(--radius-s); border: 0; background: var(--amber); color: var(--totem); cursor: pointer; }
.form-msg { flex-basis: 100%; margin: 0; font-size: 14px; color: #e9eef7; min-height: 1.4em; }

/* FAQ */
.faq details { border-top: 1px solid var(--line); max-width: var(--measure); }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 16px 32px 16px 0; font-weight: 650; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 { display: inline; font-size: inherit; font-weight: inherit; letter-spacing: normal; line-height: inherit; margin: 0; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font-size: 22px; color: var(--ink-3); }
.faq details[open] summary::after { content: "–"; }
.faq-a { padding: 0 0 12px; color: var(--ink-2); }

/* Page header for inner pages */
.page-head { padding: 8px 0 32px; }
.page-head h1 { max-width: 22ch; }
.page-head .lead { font-size: 19px; max-width: 60ch; color: var(--ink); }
.page-head .hero-grid { margin-top: 8px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 0; }
.kpis div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 14px 16px; }
.kpis dt { font-size: 13px; color: var(--ink-2); }
.kpis dd { margin: 2px 0 0; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.callout { background: var(--surface); border-left: 4px solid var(--ink); padding: 14px 18px; border-radius: 0 var(--radius-s) var(--radius-s) 0; max-width: var(--measure); }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.link-list { columns: 2 240px; padding-left: 1.1em; }
.formula { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 14px 16px; overflow-x: auto; max-width: var(--measure); }

/* Related links */
.related h2 { font-size: 20px; }
.related-home { max-width: var(--measure); font-size: 18px; }
.related-home a { font-weight: 650; }
.related-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.related-list a { display: inline-block; padding: 8px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: 15px; }
.related-list a:hover { border-color: var(--ink-3); }

/* Footer */
.site-footer { margin-top: 56px; background: var(--surface); border-top: 1px solid var(--line); padding: 40px 0 28px; font-size: 15px; color: var(--ink-2); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 28px; }
.footer-brand { font-weight: 800; color: var(--ink); }
.footer-h { font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: var(--ink-2); }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } body { font-size: 16px; } }

/* Phones: price board above the fold, readable charts */
@media (max-width: 600px) {
  .demo-banner { font-size: 13px; padding: 6px 0; }
  .hero { padding: 18px 0 32px; }
  .hero .lead { font-size: 18px; }
  .hero .small { display: none; }
  .chart { padding: 14px; }
  .chart .ax { font-size: 26px; }
  .chart .lab { display: none; }
  .chart polyline { stroke-width: 4; }
  .chart circle { r: 8px; }
  .legend { gap: 6px 14px; flex-wrap: wrap; }
}

/* Comfortable tap targets on touch screens (≥ 40px tall) */
@media (max-width: 900px) {
  .site-footer li { margin-bottom: 0; }
  .site-footer li a { display: inline-block; padding: 10px 0; }
  .chart-table summary { padding: 10px 0; }
  .pager a { display: inline-block; padding: 10px 0; }
  .crumbs a { display: inline-block; padding: 6px 0; }
  .related-home { line-height: 1.9; }
  .nav-mobile a { padding: 12px 14px; }
}

@media print { .site-header nav, .alert-box, .tank-switch, .demo-banner { display: none; } body { background: #fff; } }
