/* Station detail inside the panel / sheet, and the fuel colors (V1-WEB B). Loaded with map.css. */
/* Station detail inside the panel. */
#view-detail { display: block; overflow-y: auto; padding: 8px 20px 96px; }
#view-detail[hidden] { display: none; }
.dtitle { margin: 0; font: var(--t-title1); letter-spacing: -.01em; text-align: left; overflow-wrap: anywhere; }
.dtitle:focus { outline: none; }
.dsub { margin: 0; text-align: left; color: var(--label-2); font: var(--t-body); overflow-wrap: anywhere; }
.daddr { font: var(--t-body); margin: 16px 0 0; }
/* Prices as equal tiles (one per fuel, Magna | Premium | Diesel): small fuel name in its color, big bold price, the change in red / green under it (an empty .dchg-none keeps the line so tiles align). A 3-column grid: one or two fuels keep the 3-up tile width, left-aligned. Fits 320 px: tiles are ~(320 - 32 - 16) / 3 = 90 px wide, the price shrinks with clamp() and never wraps. */
.dprices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 16px 0 0; }
.dprice { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; padding: 12px; border-radius: 16px; background: var(--panel-tile); }
.dprice-fuel { font: var(--t-footnote); font-weight: 600; color: var(--label-2); white-space: nowrap; }
.dprice-value { font: 700 clamp(1.0625rem, 5.4vw, 1.375rem)/1.2 var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dprice .dchg { font: var(--t-footnote); min-height: 1.2em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dfoot { margin: 6px 4px 0; color: var(--label-2); font: var(--t-footnote); }
.devprice { margin-top: 12px; }
.devprice .tiers { list-style: none; margin: 0; padding: 0; font: var(--t-subhead); }
.devprice .tiers li { padding: 2px 0; }
.seen { margin: 6px 0 0; }
.seen summary { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; cursor: pointer; color: var(--label-2); font: var(--t-footnote); list-style: none; }
.seen summary::-webkit-details-marker { display: none; }
.seen summary .icon { width: 16px; height: 16px; color: var(--tint); }
.seen .dnote { margin-top: 0; }
.dnote { color: var(--label-2); font: var(--t-footnote); margin: 12px 0 0; }
.dtiles { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; margin-top: 16px; }
.dtile { display: grid; gap: 10px; padding: 14px; border-radius: 16px; background: var(--panel-tile); color: var(--label); border: .5px solid color-mix(in srgb, var(--label) 8%, transparent); }
.dtile:hover { text-decoration: none; filter: brightness(1.06); }
.dtile-icon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.dtile-icon .icon { width: 18px; height: 18px; }
.dtile-label { font: var(--t-body); }
.dcard { list-style: none; margin: 10px 0 0; padding: 0 16px; border-radius: 16px; background: var(--panel-tile); }
.dcard li + li { border-top: .5px solid var(--separator); }
.dcard a { display: flex; align-items: center; justify-content: space-between; min-height: 48px; color: var(--label); font: var(--t-body); }
.dcard a:hover { text-decoration: none; color: var(--accent); }


/* Sections inside the sheet: collapsible groups of rows, the address and the network card. */
.darea { display: flex; align-items: center; justify-content: flex-start; gap: 6px; margin: 6px 0 0; color: var(--label-2); font: var(--t-subhead); text-align: left; }
.darea.is-link { color: var(--accent); min-height: 44px; }
.darea.is-link:hover { text-decoration: none; filter: brightness(1.1); }
.darea .icon { width: 16px; height: 16px; }
button.dtile { font: inherit; text-align: left; cursor: pointer; }
.dtile-nav { position: relative; }
.dtile-go { position: absolute; top: 14px; right: 12px; width: 18px; height: 18px; color: var(--label-2); }
/* The chart preview in the detail is a button to the Historial view. */
.dchart-open { display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: 8px; }
.dchart-open:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }
/* Historial view: back / station name / close bar, large heading, larger chart with the ranges under it. */
.hbar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; margin: 0 -10px; }
.hback { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px 0 6px; border: 0; background: none; color: var(--tint); font: var(--t-body); cursor: pointer; }
.hback .icon { width: 22px; height: 22px; }
.hback:focus-visible { outline: 2px solid var(--tint); outline-offset: -2px; border-radius: 8px; }
.hname { margin: 0; text-align: center; font: var(--t-footnote); font-weight: 600; color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.htitle { margin: 4px 0 0; font: var(--t-title1); letter-spacing: -.01em; }
.htitle:focus { outline: none; }
.dchart-full { margin-top: 12px; }
.dchart-full .dchart-body { margin-top: 0; }
.dchart-full .dranges { margin-top: 10px; }
.dsec { margin-top: 12px; border-radius: 16px; background: var(--panel-tile); }
.dsec > summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 16px; font: var(--t-headline); cursor: pointer; list-style: none; }
.dsec > summary::-webkit-details-marker { display: none; }
.dsec > summary .chev { transition: transform 150ms var(--ease); }
.dsec[open] > summary .chev { transform: rotate(180deg); }
.dlist { list-style: none; margin: 0; padding: 0 16px 6px; }
.dlist li + li { border-top: .5px solid var(--separator); }
.drow { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 0; color: var(--label); font: var(--t-subhead); }
a.drow:hover { text-decoration: none; color: var(--accent); }
.drow-l { flex: none; max-width: 45%; color: var(--label-2); }
.drow-v { flex: 1; min-width: 0; text-align: right; overflow-wrap: anywhere; }
.drow .chev { flex: none; width: 16px; height: 16px; }
.dsec-plain { padding: 12px 16px 6px; }
.dsec-plain .dlist { padding: 0; }
.dsec-h { margin: 0 0 4px; font: var(--t-headline); }
.dsec-plain .daddr { margin: 0 0 6px; }
.dnet-name { margin: 0 0 8px; font: var(--t-body); }
.dnet .store-badges { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 0 8px; }

/* Fuel colors (2026-12-03, still an experiment; tokens in tokens.css): Magna
   green, Premium red, Diesel graphite/silver. The chips are plain blue toggles
   (blue fill when on, outlined when off); the fuel colors stay on the price
   labels (map-rows.css), the pins and the detail prices. */
.mchips .chip { min-height: 32px; padding: 0 12px; font-weight: 700; border: 1.5px solid var(--gas-accent); background: none; color: var(--gas-accent); cursor: pointer; font-family: inherit; }
.mchips .chip[aria-pressed="true"] { background: var(--gas-accent-fill); color: #fff; }
/* EV filter chips (evfilter.ts): blue like the EV UI; the plug chip opens its menu (a chevron, "Conector · 2" when plugs are picked). JS only. */
.evchips .chip { border-color: var(--ev-accent); color: var(--ev-accent); }
.evchips .chip[aria-pressed="true"] { background: var(--ev-accent-fill); color: #fff; }
.evchips .chip-menu { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.evchips .chip-menu .icon { width: 14px; height: 14px; }
html:not(.js) .evchips { display: none; }
/* Network filter chip ("Pemex · 312 ×", filled in the tab's accent; tapping clears it) and the detail's tappable brand line (tinted, with a chevron). */
.netchips .chip { display: inline-flex; align-items: center; gap: 6px; border-color: var(--tint); background: var(--tint-fill); color: #fff; }
.netchips .chip .icon { width: 14px; height: 14px; }
.dsub-net { display: inline-flex; align-items: center; gap: 2px; padding: 0; border: 0; background: none; color: var(--tint); cursor: pointer; font: var(--t-body); text-align: left; }
.dsub-net .icon { width: 14px; height: 14px; }
.dsub-net:hover span { text-decoration: underline; }
.dsub-net:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; border-radius: 4px; }
/* Plug menu: a popover under its chip (positioned in JS), checkboxes in a 2-column grid. */
.launcher.connmenu { position: fixed; inset: auto; width: min(300px, calc(100vw - 24px)); height: auto; max-height: calc(100dvh - 120px); padding: 4px 16px 12px; border-radius: 16px; }
.connmenu .launcher-h { margin: 12px 0 4px; }
.connmenu-note { margin: 0 0 10px; color: var(--label-2); font: var(--t-footnote); }
.connopts { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; }
.connopt { display: flex; align-items: center; gap: 8px; min-height: 44px; font: var(--t-subhead); cursor: pointer; }
.connopt input { width: 20px; height: 20px; margin: 0; accent-color: var(--ev-accent-fill); flex: none; }
.connall { width: 100%; min-height: 44px; margin-top: 8px; border: 0; border-radius: 12px; background: var(--fill); color: var(--ev-accent); font: var(--t-subhead); font-weight: 600; cursor: pointer; }
.connall:focus-visible, .connopt input:focus-visible { outline: 2px solid var(--ev-accent); outline-offset: 2px; }
.pin.f-regular .pin-cap, .pin.f-regular .pin-tile { color: var(--fuel-regular-pin); }
.pin.f-premium .pin-cap, .pin.f-premium .pin-tile { color: var(--fuel-premium-pin); }
.pin.f-diesel .pin-cap, .pin.f-diesel .pin-tile { color: var(--fuel-diesel-pin); }
.dprice[data-fuel="regular"] .dprice-fuel { color: var(--fuel-regular-text); }
.dprice[data-fuel="premium"] .dprice-fuel { color: var(--fuel-premium-text); }
.dprice[data-fuel="diesel"] .dprice-fuel { color: var(--fuel-diesel-text); }

/* Stocks-style header: round close and share buttons, bold name with the gray brand beside it, price + change, gray caption. */
.dbar { display: flex; justify-content: space-between; align-items: center; margin: 0 -10px; }
.dcirc { position: relative; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; background: none; color: var(--label); cursor: pointer; }
.dcirc::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: color-mix(in srgb, var(--label) 10%, transparent); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); box-shadow: inset 0 0 0 .5px color-mix(in srgb, var(--label) 8%, transparent); }
.dcirc:hover::before { background: color-mix(in srgb, var(--label) 16%, transparent); }
.dcirc .icon { position: relative; width: 18px; height: 18px; }
.dtitlerow { display: grid; gap: 2px; margin-top: 6px; }
.dchg { font: var(--t-headline); }
.dchg.up { color: var(--spark-up); } .dchg.down { color: var(--spark-down); }

/* Price chart with ranges (gas). */
.dchart { margin-top: 16px; }
.dchart-view:empty { display: none; }
.dranges { display: flex; gap: 2px; }
.drange { position: relative; flex: 1; min-height: 32px; padding: 0 4px; border: 0; border-radius: 8px; background: none; color: var(--label-2); font: var(--t-footnote); font-weight: 600; cursor: pointer; }
.drange::after { content: ""; position: absolute; inset: -6px 0; }
.drange[aria-pressed="true"] { background: var(--fill); color: var(--label); }
.dchart-body { margin-top: 10px; }
.dchart-svg { display: block; width: 100%; height: 104px; overflow: visible; }
.dchart-full .dchart-svg { height: 220px; }
/* Figure: plot | trailing price labels, then day labels under the plot (dchartsvg.ts places them in %). */
.dfig { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; }
.dfig-plot { min-width: 0; }
.dfig-y { position: relative; min-width: 3.1rem; }
.dfig-y span, .dfig-x span { position: absolute; color: var(--label-2); font: var(--t-caption2, 500 .6875rem/1.2 var(--font)); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dfig-y span { right: 0; transform: translateY(-50%); }
.dfig-x { position: relative; grid-column: 1; height: 18px; margin-top: 4px; }
.dfig-x span { top: 0; padding-left: 3px; }
.dchart-grid line { stroke: var(--separator); stroke-width: 1; }
/* One line per fuel in the fuel's color (as at the pump); rises and falls stay red / green only in the change numbers. */
.f-regular { --fuel-c: var(--fuel-regular-text); --fuel-c-fill: var(--fuel-regular); --fuel-c-on: var(--fuel-regular-on); }
.f-premium { --fuel-c: var(--fuel-premium-text); --fuel-c-fill: var(--fuel-premium); --fuel-c-on: var(--fuel-premium-on); }
.f-diesel { --fuel-c: var(--fuel-diesel-text); --fuel-c-fill: var(--fuel-diesel); --fuel-c-on: var(--fuel-diesel-on); }
.dchart-fuel { color: var(--fuel-c, var(--label-2)); }
.dchart-line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.dchart-svg.multi .dchart-line { stroke-width: 2.25; }
.dstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.dstat { display: grid; gap: 2px; }
.dstat-l { font: var(--t-footnote); color: var(--label-2); }
.dstat-v { font: var(--t-headline); font-variant-numeric: tabular-nums; }
.dstats-multi { grid-template-columns: auto repeat(3, 1fr); row-gap: 6px; align-items: baseline; }
.dstats-multi .dstat-v { font: var(--t-subhead); font-weight: 600; }
.dstat-f { font: var(--t-subhead); font-weight: 700; color: var(--fuel-c); }
.dchart-note { margin: 0; padding: 12px 0; }
/* Price history list (hidden until the history tile opens it): period, price (bold), change in red / green. */
.dhist { list-style: none; margin: 14px 0 0; padding: 0 16px; border-radius: 16px; background: var(--panel-tile); font-variant-numeric: tabular-nums; }
.dhist-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 8px 0; }
.dhist-row + .dhist-row { border-top: .5px solid var(--separator); }
.dhist-main { display: grid; gap: 1px; min-width: 0; }
.dhist-label { font: var(--t-subhead); }
.dhist-sub { color: var(--label-2); font: var(--t-footnote); }
.dhist-px { display: flex; align-items: baseline; gap: 10px; flex: none; }
.dhist-price { font: 700 1rem/1.2 var(--font); }
.dhist-px .dchg { font: var(--t-subhead); text-align: right; } /* before the price, so prices line up on the right */
.dchart-note + .dhist { margin-top: 0; }
.dhist-multi .dhist-px { gap: 14px; }
.dhist-multi .dhist-price { min-width: 3.6rem; text-align: right; color: var(--fuel-c); font-weight: 600; }
.dchart-more:empty { display: none; }
/* Fuel chips above the chart (toggles, the last one stays on) and its legend: outlined in the fuel's color when off, filled when on. */
.dfchips { display: flex; gap: 8px; margin-bottom: 10px; }
.dfchip { position: relative; min-height: 30px; padding: 0 12px; border: 1.5px solid var(--fuel-c); border-radius: 999px; background: none; color: var(--fuel-c); font: var(--t-footnote); font-weight: 700; cursor: pointer; }
.dfchip::after { content: ""; position: absolute; inset: -7px -2px; }
/* On = the deep fill with white text in both themes (Magna #1F7A36, Premium #D70015, Diesel #3A3A3C, as the stacked row pills in dark mode); the diesel fill gets a light ring on dark surfaces. */
.dfchip[aria-pressed="true"] { border-color: var(--fuel-chip); background: var(--fuel-chip); color: #fff; }
.dfchip.f-regular { --fuel-chip: #1F7A36; } .dfchip.f-premium { --fuel-chip: #D70015; } .dfchip.f-diesel { --fuel-chip: #3A3A3C; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .dfchip.f-diesel[aria-pressed="true"] { border-color: color-mix(in srgb, var(--label) 35%, transparent); } }
:root[data-theme="dark"] .dfchip.f-diesel[aria-pressed="true"] { border-color: color-mix(in srgb, var(--label) 35%, transparent); }
.dfchip:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }

/* Station strip over the phone sheet while a detail is open (strip.ts): the list's stations, scrolling sideways. Phones only; --strip-h = STRIP_H. */
.dstrip { display: none; }
@media (max-width: 599.98px) {
  .js .dstrip:not([hidden]) { display: block; position: absolute; z-index: 11; top: 0; left: 0; right: 0; height: 60px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; touch-action: pan-x; background: var(--bar-bg); border-bottom: .5px solid var(--separator); }
  .dstrip::-webkit-scrollbar { display: none; }
  .dstrip-list { display: flex; gap: 6px; width: max-content; margin: 0; padding: 8px 12px; list-style: none; }
  .dstrip-item { display: grid; align-content: center; gap: 1px; min-width: 112px; max-width: 168px; height: 44px; padding: 0 10px; border: 0; border-radius: 10px; background: none; color: var(--label); text-align: left; font: inherit; cursor: pointer; }
  .dstrip-item[aria-current="true"] { background: var(--fill); }
  .dstrip-name { font: var(--t-footnote); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dstrip-line { display: flex; align-items: center; gap: 6px; height: 18px; font: var(--t-footnote); font-variant-numeric: tabular-nums; color: var(--label-2); white-space: nowrap; }
  .dstrip-chg.up { color: var(--spark-up); } .dstrip-chg.down { color: var(--spark-down); }
  .dstrip-spark { width: 34px; height: 16px; margin-left: auto; }
  .mapapp:has(.dstrip:not([hidden])) .mctl-style { top: 72px; }
  .mapapp:has(.dstrip:not([hidden])) .mctl-bottom { top: 124px; }
}
