/* Carga web design tokens (V1-WEB-DESIGN "Tokens"). iOS system colors,
   light + dark via prefers-color-scheme, manual override with data-theme. */
:root {
  color-scheme: light dark;
  --bg: #F2F2F7;
  --bg-elevated: #FFFFFF;
  --bg-secondary: #F2F2F7;
  --fill: rgba(120, 120, 128, .12);
  --label: #000000;
  --label-2: rgba(60, 60, 67, .6);
  --label-3: rgba(60, 60, 67, .3);
  --separator: rgba(60, 60, 67, .29);
  --tint: #007AFF;
  --ev: #34C759;
  --gas: #FF9500;
  --up: #FF3B30;
  --down: #34C759;
  /* Fills behind white text, darkened where the system color fails 4.5:1. */
  --tint-fill: #0062CC;
  --up-fill: #D70015;
  --down-fill: #248A3D;
  --segment: #FFFFFF;

  --t-large-title: 700 2.125rem/1.2 var(--font);
  --t-title1: 700 1.75rem/1.2 var(--font);
  --t-title2: 700 1.375rem/1.25 var(--font);
  --t-title3: 600 1.25rem/1.25 var(--font);
  --t-headline: 600 1.0625rem/1.3 var(--font);
  --t-body: 400 1.0625rem/1.4 var(--font);
  --t-subhead: 400 .9375rem/1.35 var(--font);
  --t-footnote: 400 .8125rem/1.35 var(--font);
  --t-caption: 400 .75rem/1.3 var(--font);
  --t-caption2: 400 .6875rem/1.3 var(--font);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --r-panel: 28px;
  --r-card: 20px;
  --r-detail: 16px;
  --r-pill: 6px;
  --inset: 16px;
  --gap: 12px;
  --row-min: 64px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --content-max: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --bg-elevated: #1C1C1E;
    --bg-secondary: #2C2C2E;
    --fill: rgba(120, 120, 128, .24);
    --label: #FFFFFF;
    --label-2: rgba(235, 235, 245, .6);
    --label-3: rgba(235, 235, 245, .3);
    --separator: rgba(84, 84, 88, .6);
    --tint: #0A84FF;
    --ev: #30D158;
    --gas: #FF9F0A;
    --up: #FF453A;
    --down: #30D158;
    --tint-fill: #0A6FDB;
    --up-fill: #D70015;
    --down-fill: #248A3D;
    --segment: #636366;
  }
}

:root[data-theme="dark"] {
  --bg: #000000;
  --bg-elevated: #1C1C1E;
  --bg-secondary: #2C2C2E;
  --fill: rgba(120, 120, 128, .24);
  --label: #FFFFFF;
  --label-2: rgba(235, 235, 245, .6);
  --label-3: rgba(235, 235, 245, .3);
  --separator: rgba(84, 84, 88, .6);
  --tint: #0A84FF;
  --ev: #30D158;
  --gas: #FF9F0A;
  --up: #FF453A;
  --down: #30D158;
  --tint-fill: #0A6FDB;
  --up-fill: #D70015;
  --down-fill: #248A3D;
  --segment: #636366;
}

/* Carga web components (V1-WEB-DESIGN "Components"). Served concatenated
   after tokens.css as one hashed file. No inline styles (CSP style-src 'self'). */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--label); font: var(--t-body); font-family: var(--font); }
a { color: var(--tint); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { margin: 0; }
.num, .price { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--bg-elevated); padding: 8px 12px; border-radius: 12px; z-index: 20; }
.skip:focus { left: 8px; }
.icon { width: 20px; height: 20px; flex: none; vertical-align: middle; }
.icon-24 { width: 24px; height: 24px; }

/* Glass: translucent panel with an opaque fallback. */
.glass { background: var(--bg-elevated); border: .5px solid color-mix(in srgb, var(--label) 10%, transparent); box-shadow: 0 8px 32px rgba(0, 0, 0, .12); }
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .glass { background: color-mix(in srgb, var(--bg-elevated) 72%, transparent); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); }
}
@media (prefers-reduced-transparency: reduce) { .glass { background: var(--bg-elevated); backdrop-filter: none; -webkit-backdrop-filter: none; } }

/* Header and footer. */
.topbar { position: sticky; top: 0; z-index: 10; border-width: 0 0 .5px; border-radius: 0; box-shadow: none; }
.topbar-inner { max-width: var(--content-max); margin: 0 auto; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 0 var(--inset); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--label); font: var(--t-headline); }
.brand:hover { text-decoration: none; }
.brand { gap: 6px; font: 600 1.25rem/1 var(--font); letter-spacing: -.01em; white-space: nowrap; }
.brand .brand-icon { flex: none; color: var(--label); }
.wm-gas { color: var(--gas); }
.wm-ev { color: var(--ev); font-style: italic; }
@media (max-width: 379.98px) { .brand:has(.wm-section) .wm-carga { display: none; } }
.topbar-nav { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.topbar-nav .chip { white-space: nowrap; }
.nav-short { display: none; }
@media (max-width: 430px) { .nav-long { display: none; } .nav-short { display: inline; } .topbar-nav .chip { padding: 0 12px; } }
.footer { max-width: var(--content-max); margin: 32px auto 0; padding: 24px var(--inset) 48px; color: var(--label-2); font: var(--t-footnote); }
.footer ul { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 0 20px; }
.footer li a { display: inline-flex; align-items: center; min-height: 44px; }
.footer p { margin: 6px 0; }

/* Page layout. */
.page { max-width: var(--content-max); margin: 0 auto; padding: 16px var(--inset) 0; }
.page-head { margin: 8px 0 16px; }
.large-title { font: var(--t-large-title); letter-spacing: -.01em; overflow-wrap: anywhere; }
.subtitle { color: var(--label-2); font: var(--t-subhead); margin: 4px 0 0; }
.legal-name { color: var(--label-2); font: var(--t-footnote); margin: 4px 0 0; overflow-wrap: anywhere; }
.status { display: flex; align-items: center; gap: 6px; font: var(--t-footnote); margin-top: 8px; color: var(--label-2); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--down); }
.status.stale::before { background: var(--gas); }
.section-title { font: var(--t-title3); margin: 24px 0 8px; }
.caption-title { font: var(--t-footnote); color: var(--label-2); text-transform: uppercase; letter-spacing: .02em; margin: 20px 4px 6px; }
.footnote { font: var(--t-footnote); color: var(--label-2); margin: 6px 4px 0; }
.breadcrumbs { font: var(--t-footnote); color: var(--label-2); display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; }
.breadcrumbs a, .breadcrumbs span { display: inline-flex; align-items: center; min-height: 44px; }
.breadcrumbs li { display: inline-flex; align-items: center; }
.breadcrumbs li + li::before { content: "›"; margin-right: 4px; color: var(--label-3); }
@media (min-width: 1024px) {
  .station-grid { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 24px; align-items: start; }
  .station-grid .snapshot-col { position: sticky; top: 72px; order: 2; }
}

/* Cards and rows. */
.card { background: var(--bg-elevated); border-radius: var(--r-card); overflow: hidden; }
.card + .card { margin-top: var(--gap); }
.card-pad { padding: 14px var(--inset); }
.card-title { font: var(--t-headline); padding: 14px var(--inset) 4px; }
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 12px; min-height: var(--row-min); padding: 8px var(--inset); color: var(--label); position: relative; }
a.row:hover { background: var(--fill); text-decoration: none; }
.rows > li + li .row::before, .rows > li + li > .row-static::before { content: ""; position: absolute; top: 0; right: 0; left: calc(var(--inset) + 56px); border-top: .5px solid var(--separator); }
.rows.plain > li + li .row::before { left: var(--inset); }
.row-icon { width: 44px; height: 44px; border-radius: 50%; background: var(--fill); display: grid; place-items: center; flex: none; color: var(--gas); font: var(--t-footnote); font-weight: 600; }
.row-icon.ev { color: var(--ev); }
.row-main { flex: 1; min-width: 0; }
.row-title { display: block; font: var(--t-headline); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { display: block; font: var(--t-subhead); color: var(--label-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-trail { text-align: right; flex: none; }
.row-price { font: var(--t-headline); font-variant-numeric: tabular-nums; }
.row-meta { font: var(--t-subhead); color: var(--label-2); }
.chev { color: var(--label-3); }

/* Price rows on the station card. */
.price-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px var(--inset); position: relative; }
.price-row + .price-row::before { content: ""; position: absolute; top: 0; left: var(--inset); right: 0; border-top: .5px solid var(--separator); }
.price-row .fuel { font: var(--t-body); }
.price-row .value { display: flex; align-items: center; gap: 8px; font: var(--t-title3); font-variant-numeric: tabular-nums; }

/* Change pill (Stocks). */
.pill { display: inline-block; min-width: 64px; padding: 3px 6px; border-radius: var(--r-pill); color: #fff; font: var(--t-subhead); font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; background: var(--label-3); }
.pill.up { background: var(--up-fill); }
.pill.down { background: var(--down-fill); }

/* Tiles (2-up actions) and summary cards (fitness-home). */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); margin: 16px 0; }
.tile { background: var(--bg-secondary); border-radius: var(--r-card); padding: 14px; color: var(--label); display: flex; flex-direction: column; gap: 8px; min-height: 96px; }
.card .tile, .tiles .tile { background: var(--bg-elevated); }
a.tile:hover { text-decoration: none; filter: brightness(1.03); }
.tile-icon { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--tint-fill); }
.tile-icon .icon { width: 16px; height: 16px; }
.tile-title { font: var(--t-headline); }
.tile-sub { font: var(--t-footnote); color: var(--label-2); }
.summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
@media (min-width: 720px) { .summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.summary { background: var(--bg-elevated); border-radius: var(--r-card); padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.summary-label { font: var(--t-headline); color: var(--gas); }
.summary-value { font: var(--t-title1); font-variant-numeric: tabular-nums; }
.summary-unit { font: var(--t-footnote); color: var(--label-2); }
.summary .spark { margin-top: 8px; width: 100%; height: 40px; color: var(--gas); }

/* Segmented control and chips. */
.segmented { display: flex; background: var(--fill); border-radius: 9px; padding: 2px; gap: 2px; margin: 0 var(--inset) 8px; }
.segmented a { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 44px; text-align: center; padding: 0; border-radius: 7px; color: var(--label); font: var(--t-footnote); font-weight: 600; }
.segmented a:hover { text-decoration: none; background: color-mix(in srgb, var(--segment) 50%, transparent); }
.segmented a[aria-current="true"] { background: var(--segment); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.segmented.page-tabs { margin: 0 0 16px; max-width: 360px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; }
.chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; background: var(--fill); color: var(--label); font: var(--t-subhead); font-weight: 600; white-space: nowrap; }
.chip:hover { text-decoration: none; filter: brightness(.97); }
.chip[aria-current="true"] { background: var(--tint-fill); color: #fff; }

/* Buttons. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 20px; border-radius: 999px; border: 0; font: var(--t-headline); cursor: pointer; }
.btn-primary { background: var(--tint-fill); color: #fff; width: 100%; }
.btn-secondary { background: var(--fill); color: var(--tint); }
.btn:hover { text-decoration: none; filter: brightness(1.05); }
.btn-circle { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--label); }

/* Chart (server-rendered SVG). */
.chart-card .chart-head { padding: 14px var(--inset) 8px; }
.chart-caption { font: var(--t-footnote); color: var(--label-2); }
.chart-value { font: var(--t-title1); font-variant-numeric: tabular-nums; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .line { stroke: var(--gas); }
.chart .avg { stroke: var(--label-3); }
.chart .grid { stroke: var(--separator); }
.chart .axis { fill: var(--label-2); font: 11px var(--font); font-variant-numeric: tabular-nums; }
.chart-legend { display: flex; gap: 16px; padding: 4px var(--inset) 12px; font: var(--t-caption); color: var(--label-2); }
.chart-legend .k::before { content: ""; display: inline-block; width: 12px; height: 2px; margin-right: 6px; vertical-align: middle; background: var(--gas); }
.chart-legend .k.avg::before { background: var(--label-3); }
.chart-data summary { cursor: pointer; display: flex; align-items: center; min-height: 44px; padding: 0 var(--inset); color: var(--tint); font: var(--t-footnote); }
.chart-data table { width: calc(100% - 2 * var(--inset)); margin: 0 var(--inset) 12px; font: var(--t-footnote); border-collapse: collapse; }
.chart-data td, .chart-data th { text-align: left; padding: 4px 0; border-bottom: .5px solid var(--separator); }

/* Snapshot (static map) and placeholders. */
.snapshot { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; border-radius: var(--r-card); background: var(--bg-secondary); object-fit: cover; }
.snapshot-placeholder { aspect-ratio: 2 / 1; border-radius: var(--r-card); background: var(--bg-secondary); display: grid; place-items: center; color: var(--label-3); text-align: center; font: var(--t-footnote); }
.map-placeholder { aspect-ratio: 16 / 9; max-height: 380px; width: 100%; }

/* Tables (today's prices). */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font: var(--t-subhead); font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 10px var(--inset); text-align: right; border-bottom: .5px solid var(--separator); white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data th { font: var(--t-footnote); color: var(--label-2); font-weight: 600; }
table.data th a { color: var(--label-2); }
table.data th a[aria-current="true"] { color: var(--tint); }
.up-text { color: var(--up); }
.down-text { color: var(--down); }

/* Empty states. */
.empty { text-align: center; padding: 40px var(--inset); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty .icon { width: 44px; height: 44px; color: var(--label-3); }
.empty-title { font: var(--t-title3); }
.empty-text { font: var(--t-subhead); color: var(--label-2); max-width: 32ch; }

/* Ad slot: reserved height, collapses when empty (no fill → no gap). */
.ad-slot { position: relative; min-height: 96px; margin: var(--gap) 0; border-radius: var(--r-card); background: var(--bg-elevated); display: flex; align-items: center; gap: 12px; padding: 10px var(--inset); }
.ad-slot:empty, .ad-slot[data-state="unfilled"] { display: none; }
.ad-slot .ad-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--fill); flex: none; }
.ad-label { position: absolute; top: 8px; right: 12px; font: var(--t-caption2); font-weight: 600; background: var(--fill); color: var(--label-2); padding: 1px 6px; border-radius: 999px; }

/* Prose (legal pages) in grouped cards. */
.prose { background: var(--bg-elevated); border-radius: var(--r-card); padding: 8px 20px 20px; overflow-wrap: anywhere; }
.prose h1 { font: var(--t-large-title); margin: 12px 0 8px; }
.prose h2 { font: var(--t-title3); margin: 24px 0 8px; }
.prose p, .prose li { font: var(--t-body); }
.prose .meta { color: var(--label-2); font: var(--t-footnote); }
.prose table { border-collapse: collapse; width: 100%; font: var(--t-subhead); }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 8px; border-bottom: .5px solid var(--separator); }
.prose .table-scroll { overflow-x: auto; }
.prose h3 { font: var(--t-headline); margin: 20px 0 4px; }
.prose table { min-width: 560px; }
.draft-note { margin: 0 0 12px; padding: 10px 14px; border-radius: 14px; background: color-mix(in srgb, var(--gas) 18%, transparent); color: var(--label); font: var(--t-footnote); font-weight: 600; }
.head-actions { margin: 12px 0 0; }
.btn-small { min-height: 44px; padding: 0 14px; font: var(--t-subhead); font-weight: 600; }
.network-card .store-badges { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px var(--inset) 12px; }
.store-badge { display: inline-grid; min-width: 150px; padding: 6px 14px; border-radius: 10px; background: #000; color: #fff; border: 1px solid #A6A6A6; line-height: 1.1; }
.store-badge:hover { text-decoration: none; filter: brightness(1.2); }
.store-badge[hidden] { display: none; }
.store-badge-small { font: var(--t-caption2); }
.store-badge-big { font: 600 1.125rem/1.2 var(--font); }
.prose .btn { background: var(--fill); color: var(--label-2); min-height: 44px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media (max-width: 380px) { .tiles { grid-template-columns: 1fr; } }


