:root {
  color-scheme: light dark;
  --bg: #f5f5f7;
  --paper: #fff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --accent: #0066cc;
  --pattern-gold: #E0A531;
  --star: #b87503;
  --button: #0071e3;
  --button-hover: #0062c4;
  --surface: #f2f2f7;
  --blue-wash: #eef5ff;
  --line: #e7e7eb;
  --green: #23763b;
  --green-wash: #eef7f0;
  --warn: #815408;
  --warn-bg: #fff6e5;
  --shadow: 0 4px 24px #00000005, 0 1px 3px #00000004;
  --radius: 24px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

/* One CSS pixel at the default size; on iOS the Dynamic Type block near the end of this file rescales it. */
html { --u: 1px; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
[hidden] { display: none !important; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
p, h1, h2, h3 { margin: 0; }
button, input, select { font: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
button, a, summary { touch-action: manipulation; }
button { border: 0; cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 4px;
}
.sr-only { position: absolute; width: 1px; height: 1px; min-width: 0; min-height: 0; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
html:has(body.dialog-open) { overflow: hidden; height: 100%; overscroll-behavior: none; }
/* Fixing the body without a transform keeps the tab bar and backdrop viewport-fixed. */
body.dialog-open { position: fixed; left: 0; right: 0; top: calc(-1 * var(--fn-scroll-y, 0px)); overflow: hidden; }
.app-shell { width: min(100%, 480px); margin: 0 auto; padding: max(12px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom)); }
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 56px; margin-bottom: 14px; }
.identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.identity > div { min-width: 0; }
.identity h1, .header-saved { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo { display: grid; place-items: center; width: 36px; height: 36px; background: var(--button); color: #fff; border-radius: 11px; flex: none; }
.logo svg { width: 23px; height: 23px; }
.logo-app { background: #E0A531; overflow: hidden; }
.logo-app img { display: block; width: 100%; height: 100%; }
h1 { font-size: calc(18 * var(--u)); letter-spacing: -.5px; font-weight: 700; line-height: 1.2; }
.demo-badge { font-size: calc(11 * var(--u)); line-height: 1.3; color: var(--muted); margin-top: 3px; }
.header-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.state-picker { display: flex; align-items: center; min-height: 44px; margin-bottom: 0; }
.state-picker select, #settings-state-select { min-height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: inherit; font-weight: 700; padding: 0 10px; }
.fuel-segments label[hidden] { display: none; }
.price-attribution { margin: 10px 0 0; color: var(--muted); line-height: 1.5; }
.price-attribution a { color: inherit; }
.language-button, .icon-button { min-width: 44px; min-height: 44px; background: transparent; color: var(--ink); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.language-button { gap: 5px; padding: 0 8px; font-size: calc(12 * var(--u)); font-weight: 600; border-radius: 22px; }
.language-button svg { width: 19px; height: 19px; }
@media (hover: hover) {
  .icon-button:hover, .language-button:hover { background: var(--surface); }
}
.button { min-height: 52px; width: 100%; border-radius: 999px; font-size: calc(17 * var(--u)); font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 9px; padding: 13px 18px; text-decoration: none; line-height: 1.35; }
.button-primary { background: var(--button); color: var(--on-accent); }
@media (hover: hover) {
  .button-primary:hover { background: var(--button-hover); }
}
.button-quiet { background: transparent; color: var(--link); font-size: calc(14 * var(--u)); }
@media (hover: hover) {
  .button-quiet:hover { background: var(--blue-wash); }
}
.button-quiet svg { width: 18px; height: 18px; }
.notice { font-size: calc(12 * var(--u)); padding: 10px 13px; margin-bottom: 9px; border-radius: 14px; background: var(--warn-bg); color: var(--warn); line-height: 1.45; overflow-wrap: anywhere; }
.notice.offline { background: var(--blue-wash); color: var(--link); }

/* One compact recommendation, on a phone or centred on a large display. */
.location-strip { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; margin-bottom: 9px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--link); min-height: 44px; font-size: calc(13 * var(--u)); }
@media (hover: hover) {
  .location-strip:hover { background: var(--blue-wash); }
}
.location-strip > svg { width: 16px; height: 16px; }
.location-strip > #location-label { min-width: 0; overflow-wrap: anywhere; color: var(--ink); }
.text-button { min-height: 44px; min-width: 44px; background: transparent; color: var(--link); font-size: calc(12 * var(--u)); font-weight: 500; padding: 7px 0 7px 8px; }
.hero-advice { display: flex; align-items: flex-start; gap: 12px; padding: 20px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.hero-advice[data-state="wait"] { background: var(--green-wash); }
.hero-advice[data-state="today"] { background: var(--blue-wash); }
.hero-advice-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--paper); color: var(--muted); }
.hero-advice[data-state="wait"] .hero-advice-icon { color: var(--green); }
.hero-advice[data-state="today"] .hero-advice-icon { color: var(--link); }
.hero-advice-copy { min-width: 0; overflow-wrap: anywhere; }
.hero-advice h2 { font-size: calc(22 * var(--u)); font-weight: 700; letter-spacing: -.5px; line-height: 1.2; }
.hero-advice-reason { margin-top: 7px; font-size: calc(14 * var(--u)); color: var(--muted); }
.hero-advice-footnote { margin-top: 10px; font-size: calc(11 * var(--u)); color: var(--muted); }
.hero-advice-enter { animation: hero-advice-in 250ms cubic-bezier(.34,1.56,.64,1) both; }
@keyframes hero-advice-in {
  from { transform: translateY(6px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.answer-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.verdict { display: inline-flex; max-width: 100%; align-items: center; flex-wrap: wrap; gap: 5px 7px; padding: 7px 10px; border-radius: 12px; margin-bottom: 19px; font-size: calc(12 * var(--u)); line-height: 1.35; color: var(--green); background: var(--green-wash); }
.verdict > svg { width: 16px; height: 16px; }
.verdict-label { font-weight: 700; }
.verdict-detail { font-weight: 500; }
.verdict-wait { background: var(--blue-wash); color: var(--link); }
.verdict-not_out, .verdict-not_in { background: var(--surface); color: var(--muted); }
.answer-topline { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.station-brand { color: var(--muted); font-size: calc(12 * var(--u)); font-weight: 500; overflow-wrap: anywhere; }
.fuel-pill { display: inline-flex; align-items: center; gap: 5px; font-size: calc(11 * var(--u)); line-height: 1.4; padding: 5px 8px; background: var(--surface); color: var(--ink); border-radius: 8px; font-weight: 600; white-space: nowrap; flex: none; }
.fuel-pill svg { width: 14px; height: 14px; }
.answer-card h2 { font-size: min(calc(26 * var(--u)), 10.7vw); letter-spacing: -.8px; line-height: 1.17; font-weight: 700; overflow-wrap: anywhere; }
.station-address-line { display: flex; align-items: flex-start; gap: 5px; margin-top: 8px; color: var(--muted); }
.station-address-line > svg { width: 14px; height: 14px; margin-top: 2px; }
.station-address { font-size: calc(12 * var(--u)); line-height: 1.45; overflow-wrap: anywhere; }
.price-block { margin-top: 19px; }
.price-line { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price-line strong { font-size: clamp(calc(64 * var(--u)), 19.5vw, calc(82 * var(--u))); letter-spacing: -4px; line-height: 1.04; font-weight: 700; font-variant-numeric: tabular-nums; }
.price-line > span { font-size: calc(17 * var(--u)); color: var(--muted); font-weight: 500; }
.price-date { display: flex; align-items: center; gap: 5px; font-size: calc(11 * var(--u)); color: var(--muted); margin-top: 7px; }
.price-date svg { width: 13px; height: 13px; }
.station-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; border-top: 1px solid var(--line); margin-top: 19px; padding-top: 17px; }
.station-metrics > div { min-width: 0; }
.saving-block { border-left: 1px solid var(--line); padding-left: 18px; }
.metric-label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: calc(11 * var(--u)); margin-bottom: 5px; }
.metric-label svg { width: 15px; height: 15px; }
.station-metrics strong { display: block; font-size: calc(22 * var(--u)); line-height: 1.25; font-weight: 650; letter-spacing: -.6px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.saving-block strong { color: var(--green); }
.saving-block.extra-cost strong { color: var(--warn); }
.saving-explanation { font-size: calc(11 * var(--u)); color: var(--muted); margin-top: 10px; line-height: 1.4; }
.restriction { font-size: calc(12 * var(--u)); background: var(--warn-bg); color: var(--warn); border-radius: 12px; padding: 10px 12px; margin-top: 13px; overflow-wrap: anywhere; }
.map-button { margin-top: 20px; }
.map-button svg { width: 19px; height: 19px; }
.card-notes { text-align: center; margin-top: 13px; }
.card-source { font-size: calc(11 * var(--u)); }
.card-source a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.pump-check { font-size: calc(10 * var(--u)); color: var(--muted); margin-top: 5px; }
.alternatives { margin-top: 7px; }
.alternatives summary { list-style: none; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: calc(13 * var(--u)); font-weight: 600; cursor: pointer; padding: 10px 5px; }
.alternatives summary::-webkit-details-marker { display: none; }
.alternatives summary svg { width: 18px; height: 18px; color: var(--muted); }
.alternatives[open] summary svg { transform: rotate(180deg); }
.alternatives ol { list-style: none; padding: 0; margin: 0; }
.alternative-item { padding: 15px 17px; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; margin: 7px 0; }
.alternative-item h3 { font-size: calc(15 * var(--u)); font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.alternative-meta { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 7px; color: var(--muted); font-size: calc(11 * var(--u)); margin-top: 6px; }
.alternative-distance { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.alternative-distance svg { width: 15px; height: 15px; }
.alternative-meta strong { font-size: calc(16 * var(--u)); color: var(--ink); }
.alternative-restriction { font-size: calc(11 * var(--u)); color: var(--warn); margin-top: 7px; overflow-wrap: anywhere; }
.freshness { font-size: calc(10 * var(--u)); line-height: 1.5; color: var(--muted); margin: 5px 5px 0; }
.freshness:empty { display: none; }
footer { padding: 15px 4px 2px; }
.privacy-note { display: flex; align-items: flex-start; justify-content: center; gap: 5px; font-size: calc(10 * var(--u)); line-height: 1.4; color: var(--muted); }
.privacy-note svg { width: 12px; height: 12px; margin-top: 1px; }

/* First visit and recovery states use the same card and one primary action. */
.welcome-panel { text-align: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 31px 24px 17px; box-shadow: var(--shadow); }
.welcome-art { position: relative; width: 82px; height: 82px; border-radius: 25px; background: var(--blue-wash); color: var(--link); margin: 4px auto 25px; display: grid; place-items: center; }
.welcome-art > svg { width: 40px; height: 40px; }
.check-bubble { position: absolute; right: -8px; bottom: -5px; border: 4px solid var(--paper); border-radius: 50%; width: 32px; height: 32px; background: var(--button); color: #fff; display: grid; place-items: center; }
.check-bubble svg { width: 14px; height: 14px; }
.eyebrow { color: var(--muted); font-size: calc(10 * var(--u)); font-weight: 600; letter-spacing: 1.2px; }
.welcome-panel h2 { font-size: min(calc(32 * var(--u)), 13.1vw); line-height: 1.13; letter-spacing: -1.1px; margin-top: 12px; font-weight: 700; }
#welcome-title { white-space: pre-line; }
.intro { font-size: calc(14 * var(--u)); color: var(--muted); max-width: 280px; margin: 17px auto 25px; line-height: 1.5; }
.welcome-panel > .button + .button { margin-top: 4px; }
.suburb-form { margin: 12px 0 7px; padding-top: 19px; border-top: 1px solid var(--line); text-align: left; }
.field-help { font-size: calc(12 * var(--u)); font-weight: 400; color: var(--muted); margin: 9px 0 14px; line-height: 1.5; }
.message { font-size: calc(13 * var(--u)); margin-top: 14px; padding: 12px; border-radius: 12px; background: var(--warn-bg); color: var(--warn); text-align: left; }
.empty-state { padding: 31px 24px 20px; text-align: center; background: var(--paper); border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
.empty-state > svg { width: 38px; height: 38px; color: var(--link); margin-bottom: 15px; }
.empty-state h2 { font-size: calc(23 * var(--u)); line-height: 1.2; letter-spacing: -.5px; }
.empty-state p { color: var(--muted); font-size: calc(14 * var(--u)); margin: 13px 0 23px; }
.empty-state .button + .button { margin-top: 5px; }

/* Four compact first-visit steps precede every location request. */
.setup-panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 23px 25px; box-shadow: var(--shadow); }
.setup-topline { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.setup-progress { display: flex; align-items: center; gap: 7px; }
.setup-progress span { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.setup-progress span[aria-current="step"] { width: 22px; border-radius: 8px; background: var(--accent); }
.setup-skip { text-decoration: underline; text-underline-offset: 3px; font-size: calc(13 * var(--u)); }
.setup-panel h2 { font-size: min(calc(31 * var(--u)), 12.7vw); line-height: 1.15; font-weight: 700; letter-spacing: -.9px; }
.setup-panel h2:focus { outline: none; }
.setup-subtitle { color: var(--muted); font-size: calc(13 * var(--u)); line-height: 1.5; margin-top: 10px; }
.setup-fuel-options { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px; margin-top: 24px; }
.setup-fuel-tile { position: relative; display: block; grid-column: span 2; min-width: 0; margin: 0; cursor: pointer; }
.setup-fuel-tile:nth-child(7) { grid-column: 3 / span 2; }
.setup-use-options .setup-fuel-tile:nth-child(4) { grid-column: 2 / span 2; }
.setup-use-options .setup-fuel-tile:nth-child(5) { grid-column: 4 / span 2; }
.setup-number-content { min-height: 112px; gap: 7px; padding: 18px 5px 13px; }
.setup-number-content > svg:not(.setup-fuel-check) { width: 30px; height: 30px; }
.setup-number-hint { color: var(--muted); font-size: calc(10 * var(--u)); font-weight: 550; line-height: 1.25; white-space: nowrap; }
.setup-fuel-tile input:checked + .setup-number-content .setup-number-hint { color: var(--link); }
.setup-fuel-tile input { position: absolute; opacity: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; cursor: pointer; }
.setup-fuel-content { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 105px; gap: 11px; padding: 18px 5px 13px; border-radius: 18px; border: 1.5px solid transparent; background: var(--surface); color: var(--muted); pointer-events: none; }
.setup-fuel-content > svg { width: 32px; height: 32px; }
.setup-fuel-name { font-size: calc(12 * var(--u)); font-weight: 650; color: var(--ink); white-space: nowrap; }
.setup-fuel-content .setup-fuel-check { position: absolute; top: 7px; right: 7px; width: 13px; height: 13px; opacity: 0; }
.setup-fuel-tile input:checked + .setup-fuel-content { background: var(--blue-wash); border-color: var(--accent); color: var(--link); }
.setup-fuel-tile input:checked + .setup-fuel-content .setup-fuel-check { opacity: 1; }
.setup-fuel-tile input:focus-visible + .setup-fuel-content { outline: 3px solid var(--accent); outline-offset: 3px; }
.setup-tip { margin-top: 15px; color: var(--muted); }
.setup-tip summary { display: inline-flex; align-items: center; gap: 6px; list-style: none; min-height: 44px; font-size: calc(12 * var(--u)); color: var(--link); cursor: pointer; }
.setup-tip summary::-webkit-details-marker { display: none; }
.setup-tip summary svg { width: 14px; height: 14px; }
.setup-tip[open] summary svg { transform: rotate(180deg); }
.setup-tip p { font-size: calc(12 * var(--u)); line-height: 1.5; padding-bottom: 5px; }
#setup-brands-step { margin-top: 25px; }
.setup-brand-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.setup-brand-options > .brand-chip { position: relative; min-width: 0; padding: 8px; gap: 5px; font-size: calc(12 * var(--u)); }
.brand-chip { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 10px 14px; margin: 0; border: 1px solid transparent; border-radius: 999px; background: var(--surface); color: var(--ink); font-size: calc(13 * var(--u)); font-weight: 500; cursor: pointer; overflow-wrap: anywhere; }
.brand-chip > svg { width: 16px; height: 16px; }
.brand-chip input { width: 18px; height: 18px; min-height: 18px; flex: none; margin: 0; padding: 0; }
.brand-chip:has(input:checked), .brand-chip[aria-pressed="true"] { color: var(--link); background: var(--blue-wash); border-color: var(--accent); }
.brand-chip:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }
.any-brand-chip { margin-bottom: 16px; }
.any-brand-chip[aria-pressed="false"] > svg { opacity: .3; }
.setup-actions { display: flex; align-items: center; gap: 10px; margin-top: 24px; }
.setup-actions .setup-back { width: auto; min-width: 85px; padding-right: 10px; padding-left: 0; }
.setup-back svg { transform: rotate(180deg); }
.setup-actions #setup-next { flex: 1; }
.setup-actions #setup-next svg { width: 18px; height: 18px; }

/* Native form controls retain keyboard, screen-reader and browser validation. */
input, select { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); padding: 11px 12px; font-size: calc(16 * var(--u)); }
input::placeholder { color: var(--muted); }
label { display: block; font-weight: 500; font-size: calc(13 * var(--u)); margin-bottom: 8px; }
dialog { width: min(420px, calc(100% - 24px)); max-height: calc(100dvh - 32px); border: 1px solid var(--line); border-radius: 26px; background: var(--paper); color: var(--ink); padding: 23px; overscroll-behavior: contain; box-shadow: 0 24px 96px #00000030; }
dialog::backdrop { background: #00000045; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.dialog-header h2 { font-size: calc(25 * var(--u)); line-height: 1.2; letter-spacing: -.7px; font-weight: 700; }
.dialog-header .icon-button { width: 32px; min-width: 44px; background: var(--surface); flex: none; }
.dialog-header .icon-button svg { width: 18px; height: 18px; }
.settings-label { display: flex; align-items: center; gap: 7px; font-size: calc(13 * var(--u)); font-weight: 600; margin-bottom: 10px; }
.settings-label svg { width: 17px; height: 17px; color: var(--muted); }
.fuel-segments { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); background: var(--surface); padding: 3px; border-radius: 12px; margin-bottom: 24px; gap: 2px; }
.fuel-segments label { display: block; position: relative; grid-column: span 3; margin: 0; cursor: pointer; font-size: calc(12 * var(--u)); font-weight: 600; min-width: 0; }
.fuel-segments label:nth-child(n+5) { grid-column: span 4; }
.fuel-segments input { position: absolute; opacity: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; cursor: pointer; }
.fuel-segments span { position: relative; display: grid; place-items: center; min-height: 44px; border-radius: 9px; padding: 4px 2px; white-space: nowrap; pointer-events: none; }
.fuel-segments input:checked + span { background: var(--paper); color: var(--ink); box-shadow: 0 1px 4px #00000018; }
.fuel-segments input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.settings-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: end; margin-bottom: 24px; }
.settings-row > div { min-width: 0; }
.settings-row label { font-size: calc(12 * var(--u)); }
.brand-fieldset { padding: 0; border: 0; margin: 0 0 24px; min-width: 0; }
.brand-fieldset legend { font-weight: 600; font-size: calc(13 * var(--u)); padding: 0; }
.brand-fieldset .field-help { font-size: calc(11 * var(--u)); margin-top: 6px; }
.brand-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.brand-options > p { font-size: calc(12 * var(--u)); color: var(--muted); grid-column: 1 / -1; }
.brand-choice { display: flex; align-items: center; gap: 6px; min-height: 44px; background: var(--surface); border: 1px solid transparent; border-radius: 11px; padding: 8px; margin: 0; font-size: calc(12 * var(--u)); font-weight: 500; cursor: pointer; }
.brand-choice:has(input:checked) { border-color: var(--accent); background: var(--blue-wash); }
.brand-choice input { min-height: 18px; width: 18px; height: 18px; margin: 0; padding: 0; flex: none; }
.brand-choice > span:last-child,
.setup-brand-options > .brand-chip > span:last-child { min-width: 0; overflow-wrap: normal; word-break: normal; }
.dialog-actions { position: sticky; bottom: -23px; background: var(--paper); border-top: 1px solid var(--line); padding: 13px 0 5px; margin-top: 24px; }

@media (min-width: 700px) {
  .app-shell { padding-top: 46px; }
  .app-header { margin-bottom: 18px; }
  .answer-card { padding: 26px; }
  .answer-card h2 { font-size: min(calc(28 * var(--u)), 11.5vw); }
  .welcome-panel { padding: 38px 30px 23px; }
  .welcome-panel h2 { font-size: min(calc(36 * var(--u)), 14.8vw); }
  .setup-panel { padding: 20px 28px 28px; }
  .setup-panel h2 { font-size: min(calc(34 * var(--u)), 13.9vw); }
}

@media (max-width: 359px) {
  .app-shell { padding-right: 14px; padding-left: 14px; }
  .identity { gap: 7px; }
  .logo { width: 31px; height: 31px; border-radius: 9px; }
  h1 { font-size: calc(16 * var(--u)); }
  .language-button { padding-right: 4px; padding-left: 4px; }
  .answer-card { padding: 18px; }
  .answer-card h2 { font-size: calc(24 * var(--u)); }
  .station-metrics { gap: 10px; }
  .saving-block { padding-left: 12px; }
  .station-metrics strong { font-size: calc(20 * var(--u)); }
  dialog { padding: 19px; }
  .dialog-actions { bottom: -19px; }
  .setup-panel { padding-right: 18px; padding-left: 18px; }
  .setup-fuel-options { gap: 7px; }
  .setup-fuel-name { font-size: calc(11 * var(--u)); }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --paper: #1c1c1e;
    --ink: #f5f5f7;
    --muted: #aaaab2;
    --accent: #70b7ff;
    --star: #f5a623;
    --button: #0071e3;
    --button-hover: #0062c4;
    --surface: #2c2c2e;
    --blue-wash: #142a42;
    --line: #343437;
    --green: #82d79b;
    --green-wash: #183323;
    --warn: #f0cb85;
    --warn-bg: #352a18;
    --shadow: 0 4px 24px #00000016;
  }
  .fuel-segments input:checked + span { background: #545458; box-shadow: 0 1px 4px #00000030; }
  dialog::backdrop { background: #00000080; }
}


@media (forced-colors: active) {
  .button-primary, .verdict, .fuel-pill, .logo { border: 1px solid ButtonText; }
  .fuel-segments input:checked + span { outline: 2px solid Highlight; }
  .setup-fuel-tile input:checked + .setup-fuel-content, .brand-chip:has(input:checked), .brand-chip[aria-pressed="true"], .brand-choice:has(input:checked) { outline: 2px solid Highlight; }
}

/* Follow-up 2: icon-led recommendation and minimal first-run setup. */
.tiny-icon-button {
  width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0; margin: -7px;
  display: inline-grid; place-items: center; border-radius: 50%; background: transparent;
  color: var(--muted); flex: none;
}
@media (hover: hover) {
  .tiny-icon-button:hover { background: var(--surface); }
}
.tiny-icon-button svg { width: 16px; height: 16px; }
.setup-title-row { display: flex; align-items: center; gap: 7px; }
.setup-title-row .tiny-icon-button { margin-top: -5px; }
.setup-brand-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-bottom: 14px; }
.setup-brand-toolbar .any-brand-chip { margin-bottom: 0; }
.more-brand-chip { color: var(--link); background: var(--blue-wash); }

.answer-card { padding: 22px; }
.station-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-badge {
  width: 44px; height: 44px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
  padding: 0; overflow: hidden;
  font-size: calc(13 * var(--u)); font-weight: 750; letter-spacing: -.2px;
  color: #59616b;
  background: #eef0f2;
  border: 1px solid #c8cdd3;
}
.station-title-wrap { min-width: 0; flex: 1; }
.answer-card h2 { font-size: calc(23 * var(--u)); letter-spacing: -.6px; line-height: 1.15; }
.station-address {
  display: block; max-width: 100%; margin-top: 4px; font-size: calc(12 * var(--u)); line-height: 1.35;
  color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.price-block { margin-top: 18px; }
.price-line { align-items: center; gap: 8px; flex-wrap: nowrap; }
.price-line strong { font-size: clamp(calc(64 * var(--u)), 19.5vw, calc(82 * var(--u))); }
.price-info { margin-left: -5px; }
.icon-metrics {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px;
  border-top: 1px solid var(--line); margin-top: 17px; padding-top: 15px;
}
.icon-metric {
  min-height: 30px; display: inline-flex; align-items: center; gap: 2px; white-space: nowrap;
  color: var(--muted); font-size: calc(11 * var(--u)); font-weight: 650; font-variant-numeric: tabular-nums;
}
.icon-metric > svg { width: 13px; height: 13px; flex: none; }
.day-chip {
  display: inline-flex; align-items: center; min-height: 26px; padding: 4px;
  border-radius: 999px; background: var(--surface); color: var(--ink); font-size: calc(11 * var(--u));
}
.diff-metric > svg { transition: transform .15s ease; }
.diff-metric.diff-up > svg { transform: rotate(-90deg); }
.diff-metric.diff-down > svg { transform: rotate(90deg); }
.diff-metric.diff-same > svg { transform: rotate(0deg); opacity: .55; }
.saving-metric { margin-top: 8px; color: var(--green); font-size: calc(21 * var(--u)); font-weight: 700; line-height: 1.35; font-variant-numeric: tabular-nums; }
.saving-metric.extra-cost { color: var(--warn); }
.map-button { margin-top: 18px; }
.card-notes { margin-top: 12px; }
.card-source { font-size: calc(12 * var(--u)); }
footer { display: flex; justify-content: center; padding-top: 12px; }
.privacy-lock { display: inline-grid; place-items: center; width: 28px; height: 28px; color: var(--muted); }
.privacy-lock svg { width: 12px; height: 12px; }

@media (prefers-color-scheme: dark) {
  .brand-badge {
    color: #d1d5db;
    background: #30343b;
    border-color: #626a75;
  }
}

/* Local logos retain a white tile in both colour schemes. */
/* F-015b: one fixed landscape logo slot on every row; no per-logo width. */
.brand-badge-small,
.brand-choice .brand-badge,
.setup-brand-options .brand-badge { width: 44px; height: 28px; border-radius: 7px; font-size: calc(10 * var(--u)); flex: none; }
.brand-badge > svg { width: 20px; height: 20px; }
.brand-badge-small > svg,
.brand-choice .brand-badge > svg,
.setup-brand-options .brand-badge > svg { width: 17px; height: 17px; }
.brand-badge.has-logo { background: #fff; border-color: #e5e7eb; padding: 2px 3px; }
.station-heading > .brand-badge { width: 60px; height: 40px; border-radius: 10px; }
.station-heading > .brand-badge.has-logo { padding: 3px 4px; }
.brand-choice, .setup-brand-options > .brand-chip { gap: 5px; padding: 8px 6px; }
.brand-choice > span:last-child,
.setup-brand-options > .brand-chip > span:last-child { line-height: 1.15; letter-spacing: -.1px; }
.brand-badge img {
  display: block; width: 100%; height: 100%; min-width: 0; min-height: 0;
  flex: 0 0 auto; margin: auto; object-fit: contain; object-position: center center;
}
@media (forced-colors: active) {
  .brand-badge { color: CanvasText; background: Canvas; border-color: CanvasText; }
}
.alternative-heading { display: flex; align-items: center; gap: 9px; }

.answer-map { position: relative; height: 170px; margin-top: 18px; border-radius: 16px; overflow: hidden; isolation: isolate; }
.answer-map.map-loading { visibility: hidden; }
.answer-map-canvas { position: absolute; inset: 0; }
.answer-map-link { position: absolute; inset: 0; z-index: 700; }
.answer-map .leaflet-control-attribution { font: 10px/1.5 -apple-system, BlinkMacSystemFont, sans-serif; color: #666; background: #ffffffe6; }
.answer-map .leaflet-control-attribution a { color: #666; }
.map-user-dot { border: 3px solid white; border-radius: 50%; background: #007aff; box-shadow: 0 0 0 5px #007aff26, 0 1px 4px #0003; }
.map-station-pin { padding: 4px; background: white; border-radius: 10px; box-shadow: 0 2px 6px #0004; }
.map-station-pin .brand-badge { display: flex; align-items: center; justify-content: center; width: 44px; height: 28px; }
.leaflet-container .map-station-pin .brand-badge.has-logo { background: #fff; padding: 2px 3px; }
.leaflet-container .leaflet-marker-pane .map-station-pin .brand-badge img {
  width: 100%; height: 100%; max-width: 100% !important; max-height: 100% !important;
  object-fit: contain; object-position: center;
}
.map-station-pin::after { content: ''; position: absolute; bottom: -6px; left: calc(50% - 6px); border: 6px solid transparent; border-bottom: 0; border-top-color: white; }

/* v5: keep the new information concise and readable on a 390px screen. */
.header-saved { margin-top: 3px; color: var(--muted); font-size: calc(11 * var(--u)); line-height: 1.2; font-variant-numeric: tabular-nums; }
.price-day-label { color: var(--muted); font-size: calc(11 * var(--u)); line-height: 1.3; margin-top: 0; }
.saving-basis { margin-top: 2px; font-size: calc(11 * var(--u)); line-height: 1.4; color: var(--muted); }
.tomorrow-alert-badge {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 11px;
  padding: 5px 9px; border-radius: 999px; font-size: calc(11 * var(--u)); font-weight: 650;
  line-height: 1.35; color: var(--green); background: var(--green-wash);
}
.tomorrow-alert-badge svg { width: 14px; height: 14px; }
.tomorrow-price-metric { padding: 4px 3px; border-radius: 999px; background: var(--blue-wash); color: var(--link); font-size: calc(11 * var(--u)); min-height: 26px; }
.tomorrow-price-metric > svg { width: 13px; height: 13px; }
.any-brand-line { margin-top: 10px; padding: 8px 11px; background: var(--surface); border-radius: 10px; font-size: calc(11 * var(--u)); font-weight: 550; line-height: 1.4; overflow-wrap: anywhere; }
.filled-button {
  width: 100%; min-height: 44px; margin-top: 7px; display: inline-flex; align-items: center;
  justify-content: center; gap: 6px; border-radius: 12px; background: transparent;
  color: var(--link); font-size: calc(12 * var(--u)); font-weight: 650;
}
.filled-button svg { width: 15px; height: 15px; }
@media (hover: hover) {
  .filled-button:hover:not(:disabled) { background: var(--blue-wash); }
}
.filled-button:disabled { opacity: .55; cursor: default; }
.setting-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 19px; font-size: calc(13 * var(--u)); font-weight: 600; }
.setting-toggle-row label { cursor: pointer; margin-bottom: 0; }
.setting-toggle-title { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
.toggle-touch-target { display: grid; place-items: center; width: 46px; min-width: 46px; min-height: 44px; }
#tomorrow-alert-toggle {
  appearance: none; width: 46px; height: 28px; min-height: 28px; margin: 0; padding: 0;
  border-radius: 999px; background: var(--muted); border: 1px solid var(--line);
  position: relative; flex: none; cursor: pointer;
}
#tomorrow-alert-toggle::before {
  content: ''; display: block; position: absolute; left: 3px; top: 3px;
  width: 20px; height: 20px; background: #fff; border-radius: 50%;
  box-shadow: 0 1px 2px #0002; transition: transform .15s ease;
}
#tomorrow-alert-toggle:checked { background: var(--button); border-color: var(--button); }
#tomorrow-alert-toggle:checked::before { transform: translateX(18px); }
.setting-note { margin-top: 6px; font-size: calc(11 * var(--u)); line-height: 1.4; color: var(--muted); }
.settings-saved-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; padding-top: 10px; border-top: 1px solid var(--line); font-size: calc(12 * var(--u)); color: var(--muted); font-variant-numeric: tabular-nums; }
.settings-saved-row .text-button { flex: none; }
footer { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: center; gap: 0 3px; text-align: center; }
footer .privacy-lock { margin-top: 8px; }
.footer-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 4px; flex: 1; min-width: 0; font-size: calc(12 * var(--u)); line-height: 1.5; color: var(--muted); }
.footer-part { display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap; }
.footer-part > [aria-hidden="true"] { margin-left: 4px; }
#footer-updated:not([hidden]) { flex-basis: 100%; font-size: calc(11 * var(--u)); }
.footer-meta a { display: inline-flex; align-items: center; min-height: 44px; vertical-align: middle; color: var(--link); text-underline-offset: 2px; text-decoration: underline; }
@media (max-width: 359px) {
  .price-line strong { font-size: clamp(calc(54 * var(--u)), 19vw, calc(64 * var(--u))); }
  .answer-card { padding: 18px; }
  .header-saved { font-size: calc(9 * var(--u)); }
}

/* Preview additions: discreet source credits and Terms. */
.footer-about, .dialog-about-link {
  border: 0; background: none; color: var(--link); cursor: pointer;
  font: inherit; text-underline-offset: 2px; text-decoration: underline;
}
.footer-about { display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; font-size: calc(12 * var(--u)); vertical-align: middle; }
.glv-credit { font-size: calc(11 * var(--u)); font-weight: 500; color: var(--muted); }
.footer-meta .glv-credit { flex-basis: 100%; }
.dialog-disclosure { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px;
  margin: -10px 0 18px; font-size: calc(11 * var(--u)); line-height: 1.5; color: var(--muted); }
.dialog-disclosure a, .about-source { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.dialog-disclosure a, .about-source { position: relative; }
.dialog-disclosure a::after, .about-source::after { content: ''; position: absolute; inset: -14px -8px; }
.dialog-about-link { display: inline-block; min-height: 44px; padding: 11px 0; margin-top: 12px; font-size: calc(12 * var(--u)); }
.about-content { display: grid; gap: 10px; }
.about-content .about-brand { display: grid; gap: 2px; color: var(--ink); }
.about-brand span { color: var(--muted); }
.about-brand strong { font-size: calc(17 * var(--u)); font-weight: 700; line-height: 1.3; }
.about-content h3 { font-size: calc(13 * var(--u)); font-weight: 650; line-height: 1.4; margin-top: 9px; }
.about-content p { font-size: calc(13 * var(--u)); line-height: 1.55; color: var(--muted); overflow-wrap: anywhere; }
.about-source { display: inline-block; font-size: calc(12 * var(--u)); line-height: 1.5; }
.about-credit { margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--line); }

/* Compact recovery notices keep the current result within reach. */
.state-notice { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.state-notice > svg { width: 20px; height: 20px; flex: none; }
.state-notice > span { flex: 1; min-width: 140px; }
.state-notice .text-button { min-height: 44px; }
#location-hint { font-size: calc(12 * var(--u)); line-height: 1.5; margin: 10px 0; }
#error-banner { border: 1px solid currentColor; }

#error-banner { flex-wrap: nowrap; }
#error-banner #error-banner-text { flex: 1 1 auto; min-width: 0; }
#error-banner #error-banner-close { flex: 0 0 44px; width: 44px; height: 44px; }
#error-banner #error-banner-retry { flex: none; white-space: nowrap; }

.setting-toggle-title > svg, .alert-note svg { width: 16px; height: 16px; flex: none; }
.alert-note { display: flex; align-items: center; gap: 6px; }
#alert-threshold-label { display: block; margin-top: 12px; }

/* Recent pattern: secondary to the station answer, with native keyboard disclosure. */
.pattern-card { margin-top: 12px; padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.pattern-card h2 { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: calc(14 * var(--u)); font-weight: 600; }
.pattern-card h2 svg { width: 17px; height: 17px; }
.pattern-card .pattern-chart { display: block; width: 100%; height: 70px; margin-top: 8px; overflow: hidden; }
.pattern-baseline { stroke: var(--muted); stroke-width: 0.7; }
.pattern-bar { fill: var(--muted); stroke: none; opacity: .5; }
.pattern-bar-cheapest { fill: var(--pattern-gold); opacity: 1; }
.pattern-day { fill: var(--muted); stroke: none; font-size: calc(10 * var(--u)); text-anchor: middle; }
.pattern-headline { margin: 10px 0; font-size: calc(14 * var(--u)); line-height: 1.5; }
.pattern-chip { display: inline-block; padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: calc(11 * var(--u)); }
.pattern-range { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: calc(14 * var(--u)); min-width: 0; color: var(--ink); }
.pattern-range svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; }
.pattern-range span { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.pattern-range .pattern-chip { white-space: normal; box-sizing: border-box; }
@media (forced-colors: active) {
  .pattern-range { color: CanvasText; }
  .pattern-range .pattern-chip { color: CanvasText; border-color: CanvasText; }
}
.pattern-card summary { min-height: 44px; padding: 12px 0; box-sizing: border-box; cursor: pointer; }
.pattern-card summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pattern-card details { font-size: calc(12 * var(--u)); line-height: 1.5; }
.pattern-card details p { margin: 0 0 8px; }
.pattern-meta { color: var(--muted); font-size: calc(11 * var(--u)); line-height: 1.5; margin-top: 5px; }

/* Shrink long fuel names; wrap metrics if the other values need more room. */
.icon-metrics > .icon-metric { min-width: 0; max-width: 100%; }
#fuel-metric { flex: 0 1 auto; }
#fuel-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.favourite-button { flex: none; color: var(--muted); }
.favourite-button[aria-pressed="true"] { color: var(--star); }
.favourite-button[aria-pressed="true"] svg { fill: var(--star); stroke: var(--star); }
#answer-favourite, .favourite-button.labelled-star { width: auto; min-width: 44px; min-height: 44px; gap: 4px; padding: 0 12px; border-radius: 999px; }
#answer-favourite svg, .favourite-button.labelled-star svg { width: 28px; height: 28px; }
.favourite-label { font-size: calc(13 * var(--u)); font-weight: 650; line-height: 1; }
.alternative-heading h3 { flex: 1; min-width: 0; }
.favourites-shelf { margin: 12px 0; min-width: 0; }
.favourites-shelf-head, .settings-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.favourites-shelf h2 { margin: 0; font-size: calc(14 * var(--u)); }
.favourites-shelf ol, #favourites-dialog ol { list-style: none; margin: 0; padding: 0; }
.favourites-shelf li, #favourites-dialog li { padding: 8px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.favourites-shelf button, #favourites-dialog button, #favourites-reset-dialog button, #alerts-dialog button, .settings-links button { min-width: 44px; min-height: 44px; }
.setting-toggle-row { display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 8px 0; }
.favourite-line { display: flex; align-items: center; gap: 6px; margin: 10px 4px; font-size: calc(12 * var(--u)); color: var(--muted); min-width: 0; }
.favourite-line span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.favourite-line svg, .device-prompt > svg { width: 18px; height: 18px; flex: none; }
.device-prompt { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: calc(12 * var(--u)); color: var(--muted); }
.device-prompt > span { flex: 1; min-width: 130px; }
.device-prompt button { min-width: 44px; min-height: 44px; }
.install-hint { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.maps-fieldset { border: 0; padding: 0; margin: 0 0 24px; min-width: 0; }
.maps-fieldset legend { font-size: calc(13 * var(--u)); font-weight: 600; margin-bottom: 10px; }
.maps-options { display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.maps-options label { flex: 1; min-width: 0; min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 4px; margin: 0; font-size: calc(12 * var(--u)); cursor: pointer; }
.maps-options label:has(:checked) { background: var(--surface); color: var(--link); }
.maps-options input { width: 16px; height: 16px; min-height: 0; padding: 0; margin: 0; flex: none; accent-color: var(--accent); }
.maps-options label:has(:focus-visible) { outline: 3px solid var(--accent); outline-offset: -3px; }

/* Motion uses only compositing, except the small SVG stroke draw. */
.press {
  --press-scale: .96;
  transition: transform 180ms cubic-bezier(.34,1.56,.64,1), opacity 180ms cubic-bezier(.34,1.56,.64,1);
}
.press-sm { --press-scale: .9; }
.press-lg { --press-scale: .98; }
.press.is-pressed { transform: scale(var(--press-scale)); opacity: .86; }
/* Inline text links need a transformable box; existing flex/block layouts win. */
:where(a.press) { display: inline-block; }
.brand-checkbox { display: inline-grid; width: 18px; height: 18px; flex: none; }
.brand-checkbox input { appearance: none; border: 1px solid var(--muted); border-radius: 4px; background: var(--paper); cursor: pointer; }
.brand-checkbox input, .brand-checkbox svg { grid-area: 1 / 1; width: 18px; height: 18px; }
.brand-checkbox input:checked { background: var(--button); border-color: var(--button); }
.brand-checkbox svg { color: #fff; opacity: 0; pointer-events: none; }
.brand-checkbox path { stroke-dasharray: 24; stroke-dashoffset: 24; }
.brand-checkbox input:checked + svg { opacity: 1; }
.brand-checkbox input:checked + svg path { animation: check-draw 250ms ease-out both; }
.favourite-button svg { stroke-dasharray: 80; stroke-dashoffset: 0; }
.favourite-button[aria-pressed="true"] svg { animation: star-draw 300ms ease-out both; }
@keyframes check-draw { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }
@keyframes star-draw { from { stroke-dashoffset: 80; } to { stroke-dashoffset: 0; } }

#station-price { position: relative; display: inline-grid; flex: none; height: 1.04em; line-height: 1.04; overflow: clip; font-variant-numeric: tabular-nums; }
#station-price > span:not(.sr-only) { grid-area: 1 / 1; white-space: nowrap; }
#station-price > .price-exit { position: absolute; inset: 0; }
.price-enter { animation: price-in 300ms cubic-bezier(.34,1.56,.64,1) both; }
.price-exit { animation: price-out 300ms ease-out both; }
@keyframes price-in { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes price-out { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-100%); opacity: 0; } }

/* Approximate a typical answer while the first price response loads. */
.answer-skeleton { position: relative; min-height: 40rem; }
.skeleton-content { width: 100%; }
.skeleton-bar { position: relative; overflow: hidden; background: var(--surface); border-radius: 10px; height: 30px; }
.skeleton-bar::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent, var(--paper), transparent); animation: skeleton-shimmer 350ms ease-out infinite; }
.skeleton-title { width: 80%; height: 50px; }
.skeleton-price { width: 76%; height: 110px; margin-top: 18px; }
.skeleton-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 32px; }
@keyframes skeleton-shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.save-pulse { animation: save-pulse 200ms cubic-bezier(.34,1.56,.64,1); }
@keyframes save-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }

@media (max-width: 700px) {
  #settings-dialog { inset: auto 0 0; margin: 0 auto; width: 100%; max-width: 480px; max-height: calc(100dvh - max(12px, env(safe-area-inset-top))); overflow-y: auto; overflow-x: hidden; border-radius: 26px 26px 0 0; padding: 23px 20px max(23px, env(safe-area-inset-bottom)); }
  #settings-dialog::before { content: ''; display: block; width: 36px; height: 5px; border-radius: 999px; background: var(--line); margin: -10px auto 18px; }
  #settings-dialog[open] { animation: sheet-in 320ms cubic-bezier(.34,1.56,.64,1) both; }
  #settings-dialog[open]::backdrop { animation: backdrop-in 320ms ease-out both; }
  #settings-dialog.sheet-closing { animation: sheet-out 250ms ease-out both; pointer-events: none; }
  #settings-dialog.sheet-closing::backdrop { animation: backdrop-out 250ms ease-out both; }
  #settings-dialog .dialog-actions { bottom: calc(-1 * max(23px, env(safe-area-inset-bottom))); padding-bottom: max(5px, env(safe-area-inset-bottom)); z-index: 1; }
  #settings-form { min-width: 0; }
}
@keyframes sheet-in { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes sheet-out { from { transform: translateY(0); opacity: 1; } to { transform: translateY(100%); opacity: 0; } }
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes backdrop-out { from { opacity: 1; } to { opacity: 0; } }

/* Native shell only: no app-owned Share / Add to Home Screen entry (JS also returns no install mode). */
html[data-native="1"] #install-hint, html[data-native="1"] #install-sheet { display: none !important; }

/* --- Motion pass: transform/opacity only, each <=300ms, always played (GLV rule) --- */
.alternatives summary svg, .why-details summary svg, .forecast-details summary svg, .setup-tip summary svg { transition: transform 200ms ease; }
:is(.alternatives, .why-details, .forecast-details)[open] > :not(summary) { animation: reveal-in 200ms ease-out both; }
:is(.alternatives, .why-details, .forecast-details).is-closing[open] > :not(summary) { animation: reveal-out 160ms ease-in both; }
:is(.alternatives, .why-details, .forecast-details).is-closing[open] summary svg { transform: none; }
@keyframes reveal-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes reveal-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-6px); } }
.card-enter { animation: card-in 260ms cubic-bezier(.22,.8,.3,1) both; }
.card-enter .price-line, .card-enter .station-metrics { animation: card-in 280ms cubic-bezier(.22,.8,.3,1) 50ms both; }
@keyframes card-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
/* Loading skeletons: forecast line and map. */
.forecast-card.is-loading { position: relative; overflow: hidden; background: var(--surface); border-radius: 10px; color: transparent; }
.forecast-card.is-loading::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent, var(--paper), transparent); animation: skeleton-shimmer 300ms ease-out infinite; }
.answer-map.map-loading { visibility: visible; background: var(--surface); }
.answer-map.map-loading .answer-map-canvas { visibility: hidden; }
.answer-map.map-loading .answer-map-link { display: none; }
.answer-map.map-loading::after { content: ''; position: absolute; inset: 0; z-index: 1; background: linear-gradient(100deg, transparent, var(--paper), transparent); animation: skeleton-shimmer 300ms ease-out infinite; }
/* Map failure state (retryable). */
.answer-map-fail { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px; text-align: center; background: var(--surface); font-size: calc(13 * var(--u)); }
.answer-map-fail[hidden] { display: none; }
.answer-map-fail p { margin: 0; color: var(--muted); }
.answer-map-fail-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.answer-map-fail .button { width: auto; padding: 8px 14px; }
.answer-map.map-failed { height: auto; min-height: 120px; }
.answer-map.map-failed .answer-map-fail { position: static; padding: 18px 12px; }
.answer-map.map-failed .answer-map-canvas, .answer-map.map-failed .answer-map-link { display: none; }
.answer-map.map-failed { animation: reveal-in 200ms ease-out both; }
/* Map markers: the marker elements carry Leaflet's own transform, so only their children animate. */
.map-station-pin .brand-badge { animation: pin-drop 280ms cubic-bezier(.34,1.56,.64,1) 120ms both; transform-origin: 50% 100%; }
.map-user-dot::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid #007aff; animation: dot-ping 300ms ease-out 80ms both; }
@keyframes pin-drop { from { opacity: 0; transform: translateY(-10px) scale(.8); } to { opacity: 1; transform: none; } }
@keyframes dot-ping { from { opacity: .8; transform: scale(1); } to { opacity: 0; transform: scale(2.4); } }
/* Pull to refresh (touch, at scroll top). The indicator is fixed; only transform/opacity change. */
.ptr { position: fixed; top: max(8px, env(safe-area-inset-top)); left: 50%; width: 36px; height: 36px; margin-left: -18px; z-index: 40; display: grid; place-items: center; border-radius: 50%; background: var(--paper); box-shadow: 0 2px 10px #0003; opacity: 0; pointer-events: none; transform: translateY(calc(var(--ptr-y, 0px) - 56px)) rotate(calc(var(--ptr-turn, 0) * 270deg)); will-change: transform, opacity; }
.ptr[data-state="pulling"], .ptr[data-state="ready"], .ptr[data-state="loading"] { opacity: 1; }
.ptr[data-state="idle"], .ptr:not([data-state]) { transition: transform 200ms ease, opacity 200ms ease; }
.ptr-spinner { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ptr[data-state="loading"] .ptr-spinner { animation: ptr-spin 300ms linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }

@keyframes intro-fade { from { opacity: 0; } to { opacity: 1; } }
/* Shelf, star and local dialogs: transform/opacity, 240–280ms. Reduced motion uses the opacity-only classes. */
.motion-rise { animation: motion-rise 280ms ease-out both; }
.motion-out { animation: motion-out 240ms ease-in both; }
.motion-fade { animation-name: intro-fade; animation-duration: 280ms; animation-timing-function: ease-out; animation-fill-mode: both; }
.motion-fade-out { animation-name: motion-fade-out; animation-duration: 240ms; animation-timing-function: ease-in; animation-fill-mode: both; }
.rm-fade { animation-name: intro-fade; animation-duration: 200ms; animation-timing-function: ease-out; animation-fill-mode: both; }
#answer-favourite.motion-fade, #answer-favourite.motion-fade-out,
.favourite-button.motion-fade, .favourite-button.motion-fade-out {
  animation-name: intro-fade !important; animation-duration: 280ms !important;
  animation-timing-function: ease-out !important; animation-fill-mode: both !important;
}
#answer-favourite.motion-fade-out, .favourite-button.motion-fade-out { animation-name: motion-fade-out !important; animation-duration: 240ms !important; animation-timing-function: ease-in !important; }
dialog.local-dialog[open]:not(.motion-fade) { animation: dialog-in 280ms ease-out both; }
dialog.local-dialog[open]:not(.motion-fade)::backdrop { animation: backdrop-in 280ms ease-out both; }
dialog.local-dialog.sheet-closing:not(.motion-fade) { animation: dialog-out 240ms ease-in both; }
dialog.local-dialog.sheet-closing:not(.motion-fade)::backdrop { animation: backdrop-out 240ms ease-in both; }
dialog.local-dialog.motion-fade[open], dialog.local-dialog.motion-fade[open]::backdrop {
  animation-name: intro-fade; animation-duration: 280ms; animation-timing-function: ease-out; animation-fill-mode: both;
}
dialog.local-dialog.motion-fade.sheet-closing, dialog.local-dialog.motion-fade.sheet-closing::backdrop {
  animation-name: motion-fade-out; animation-duration: 240ms; animation-timing-function: ease-in; animation-fill-mode: both;
}
@keyframes motion-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes motion-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(6px); } }
@keyframes motion-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes dialog-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(12px); } }

dialog.local-dialog.sheet-closing { pointer-events: none; }

/* F-015c: tighter gaps, right breathing room, smaller names below 380px, larger Dunning's mark. */
.brand-choice, .setup-brand-options > .brand-chip { gap: 4px; padding-right: 9px; }
.brand-badge.has-logo:has(img[src$="/dunnings.svg"]) { padding: 2px 0; }
@media (max-width: 379.98px) {
  .brand-options, .setup-brand-options { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .brand-choice > span:last-child,
  .setup-brand-options > .brand-chip > span:last-child { font-size: calc(11 * var(--u)); letter-spacing: -.2px; }
}

/* The iOS guide uses the same sheet shape at every screen size. */
#install-hint-text { flex: 1; min-width: 130px; text-align: left; color: inherit; white-space: normal; }
#install-hint-text:disabled { opacity: 1; cursor: default; }
#alert-ios-hint { width: 100%; text-align: left; background: none; color: var(--muted); padding: 8px 0; min-height: 44px; }
#install-sheet { inset: auto 0 0; margin: 0 auto; width: 100%; max-width: 480px; max-height: calc(100dvh - max(12px, env(safe-area-inset-top))); border-radius: 26px 26px 0 0; padding: 23px 20px max(23px, env(safe-area-inset-bottom)); touch-action: pan-x; }
.sheet-grabber { width: 36px; height: 5px; border-radius: 999px; background: var(--line); margin: -10px auto 18px; }
#install-sheet.install-scrollable { touch-action: pan-y; }
#install-sheet .dialog-header, #install-sheet .sheet-grabber { touch-action: none; }
.install-steps { max-height: 60dvh; overflow-y: auto; }
.install-steps p { margin: 12px 0; }
.install-illustration { display: block; width: 100%; height: auto; color: var(--ink); }
#install-sheet[open] { animation: sheet-in 320ms cubic-bezier(.34,1.56,.64,1) both; }
#install-sheet[open]::backdrop { animation: backdrop-in 320ms ease-out both; }
#install-sheet.sheet-dragging { animation: none; transform: translateY(var(--install-drag, 0px)); }
#install-sheet.sheet-closing { animation: install-sheet-out 250ms ease-out both; pointer-events: none; }
#install-sheet.sheet-closing::backdrop { animation: backdrop-out 250ms ease-out both; }
@keyframes install-sheet-out { from { transform: translateY(var(--install-drag, 0px)); opacity: 1; } to { transform: translateY(100%); opacity: 0; } }

/* Legal copy stays in flow, including inside modal sheets; never covers controls. */
.legal-note { display: flex; align-items: flex-start; justify-content: center; gap: 5px;
  width: 100%; margin: 12px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px);
  font-size: calc(12 * var(--u)); line-height: 1.5; font-weight: 400; color: var(--muted); }
.legal-note > svg { width: 14px; height: 14px; margin-top: 2px; }
.legal-note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.legal-note a:focus-visible { outline-offset: 2px; }
/* v51 fix2: inline FuelWatch link needs a >=44px tall hit area; vertical padding on an inline box does not change layout. */
.legal-note a { padding: 15px 0; }
/* A sheet's action row must scroll away before its legal footer is reached. */
#settings-dialog .dialog-actions { position: static; }

.forecast-card { padding: 1rem; margin: 1rem 0; border: 1px solid currentColor; border-radius: 1rem; font-weight: 600; }
#postcode-suburbs { display: grid; gap: .25rem; }
#postcode-suburbs[hidden] { display: none; }
#postcode-suburbs button { text-align: left; padding: .75rem; cursor: pointer; }

/* ===== v51: first screen + visual tokens (Gary UI review 2026-11-05) ===== */
/* V2 light tokens. --link is a darker accent for small text so it stays >= 4.5:1. */
:root {
  --bg: #F5F5F7; --paper: #FFFFFF; --ink: #1C1C1E; --muted: #6E6E73;
  --accent: #A86A12; --green: #1E7B3C; --link: #7A4B0A; --on-accent: #FFFFFF;
  --button: #9C610F; --button-hover: #8A540C; --star: #A86A12;
  --surface: #F2F2F7; --blue-wash: #FAF4E8; --line: #E3E3E8; --green-wash: #EEF7F1;
  --warn: #815408; --warn-bg: #FFF6E5; --shadow: none; --radius: 22px;
  font-size: calc(16 * var(--u)); line-height: 1.5;
}
/* V1 dark tokens: system dark unless the user chose Light. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B0B0D; --paper: #1C1C1E; --ink: #F5F5F7; --muted: #98989E;
    --accent: #D49B42; --green: #A0E9B5; --link: #D49B42; --on-accent: #0B0B0D;
    --button: #D49B42; --button-hover: #E2AE5E; --star: #D49B42;
    --surface: #2C2C2E; --blue-wash: #2A2318; --line: #2C2C2E; --green-wash: #14281C;
    --warn: #F0CB85; --warn-bg: #352A18; --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B0B0D; --paper: #1C1C1E; --ink: #F5F5F7; --muted: #98989E;
  --accent: #D49B42; --green: #A0E9B5; --link: #D49B42; --on-accent: #0B0B0D;
  --button: #D49B42; --button-hover: #E2AE5E; --star: #D49B42;
  --surface: #2C2C2E; --blue-wash: #2A2318; --line: #2C2C2E; --green-wash: #14281C;
  --warn: #F0CB85; --warn-bg: #352A18; --shadow: none;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="light"] .brand-badge { color: #59616b; background: #eef0f2; border-color: #c8cdd3; }
:root[data-theme="light"] .fuel-segments input:checked + span { background: #fff; }
:root[data-theme="dark"] .brand-badge { color: #d1d5db; background: #30343b; border-color: #626a75; }
body { font-size: calc(16 * var(--u)); line-height: 1.5; background: var(--bg); color: var(--ink); }
.button-quiet, .text-button, .setup-tip summary, .footer-meta a { color: var(--link); }
.text-button { font-size: calc(14 * var(--u)); }
.tiny-icon-button { min-width: 44px; min-height: 44px; }

/* Header: brand row, then tagline + a distinct "saved" pill. */
.app-header { margin-bottom: 4px; }
h1 { font-size: calc(20 * var(--u)); }
.header-sub { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-bottom: 8px; }
.tagline { font-size: calc(14 * var(--u)); line-height: 1.4; color: var(--muted); }
.header-saved { display: inline-flex; align-items: center; min-height: 30px; margin: 0; padding: 2px 12px; border: 1px solid var(--accent); border-radius: 999px; color: var(--link); font-size: calc(14 * var(--u)); font-weight: 600; line-height: 1.3; white-space: nowrap; }
.location-strip { justify-content: center; min-height: 44px; margin: 10px 0 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); font-size: calc(13 * var(--u)); }
.location-strip > #location-label { flex: 0 1 auto; }

/* Best-station card: flat surface, no glass, one clear hierarchy. */
.answer-card { padding: 24px; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.best-label { display: flex; align-items: center; gap: 6px; margin: 0 0 14px; color: var(--link); font-size: calc(14 * var(--u)); font-weight: 600; line-height: 1.3; }
.best-label svg { width: 16px; height: 16px; }
.answer-card h2 { font-size: calc(22 * var(--u)); letter-spacing: -.4px; line-height: 1.25; }
.station-address { white-space: normal; overflow: visible; text-overflow: clip; font-size: calc(14 * var(--u)); }
.price-block { margin-top: 18px; }
.price-line { gap: 6px; }
.price-line strong { font-size: min(calc(48 * var(--u)), 19.7vw); letter-spacing: -1.5px; line-height: 1.04; }
.price-line > span { font-size: calc(17 * var(--u)); }
.core-metrics { margin-top: 6px; padding-top: 0; border-top: 0; gap: 4px 16px; }
.core-metrics .icon-metric { min-height: 28px; gap: 6px; font-size: calc(15 * var(--u)); font-weight: 500; }
.core-metrics .icon-metric > svg { width: 17px; height: 17px; }
.saving-metric { margin-top: 14px; font-size: calc(20 * var(--u)); line-height: 1.3; }
.saving-basis { margin-top: 2px; font-size: calc(15 * var(--u)); line-height: 1.4; color: var(--muted); }
#maps-link.button-primary { width: 100%; min-height: 52px; margin-top: 20px; border-radius: 14px; background: var(--button); color: var(--on-accent); font-size: calc(18 * var(--u)); font-weight: 700; }
#maps-link.button-primary:hover { background: var(--button-hover); }
.setting-note { font-size: calc(14 * var(--u)); line-height: 1.45; }
#pump-price-note { margin-top: 10px; }
.why-details { margin-top: 10px; border-top: 1px solid var(--line); }
.why-details summary, .forecast-details summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; font-size: calc(15 * var(--u)); font-weight: 600; cursor: pointer; }
.why-details summary::-webkit-details-marker, .forecast-details summary::-webkit-details-marker { display: none; }
.why-details summary svg, .forecast-details summary svg { width: 18px; height: 18px; color: var(--muted); }
.why-details[open] summary svg, .forecast-details[open] summary svg { transform: rotate(180deg); }
.why-rows { margin: 0; }
.why-rows > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 8px 0; }
.why-rows dt { font-size: calc(15 * var(--u)); color: var(--muted); }
.why-rows dd { margin: 0; font-size: calc(15 * var(--u)); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.why-rows > div:last-child dd { color: var(--green); }
.why-text { margin-top: 6px; font-size: calc(14 * var(--u)); line-height: 1.5; color: var(--muted); }
.why-metrics { margin-top: 8px; padding-top: 0; border-top: 0; }
.map-toggle { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; margin-top: 8px; border: 1px solid var(--line); border-radius: 14px; background: transparent; color: var(--ink); font-size: calc(15 * var(--u)); font-weight: 600; }
.map-toggle svg { width: 18px; height: 18px; }
.answer-map { height: 140px; margin-top: 10px; border-radius: 14px; }
.filled-button { min-height: 48px; margin-top: 8px; color: var(--link); font-size: calc(15 * var(--u)); }

/* Secondary content: flat, below the card. */
.hero-advice { display: block; gap: 0; margin: 14px 0 0; padding: 2px 0 2px 14px; border: 0; border-left: 3px solid var(--accent); border-radius: 0; background: transparent; }
.hero-advice[data-state="wait"], .hero-advice[data-state="today"] { background: transparent; }
.hero-advice-icon, .hero-advice-footnote { display: none; }
.hero-advice h2 { font-size: calc(16 * var(--u)); letter-spacing: 0; line-height: 1.35; }
.hero-advice-reason { margin-top: 2px; font-size: calc(15 * var(--u)); }
.forecast-details { margin-top: 12px; border-top: 1px solid var(--line); }
.forecast-card { margin: 0; padding: 0 0 12px; border: 0; border-radius: 0; font-size: calc(15 * var(--u)); font-weight: 400; line-height: 1.5; }
.forecast-details .pattern-card { margin-top: 0; padding: 0 0 8px; border: 0; border-radius: 0; background: transparent; }
.alternatives { margin-top: 4px; border-top: 1px solid var(--line); }
.alternatives summary { font-size: calc(15 * var(--u)); }
.device-prompt, .footer-meta, .legal-note { font-size: calc(13 * var(--u)); }
@media (max-width: 359px) {
  .answer-card { padding: 20px; }
  .price-line strong { font-size: min(calc(44 * var(--u)), 18.1vw); }
  .header-saved { font-size: calc(13 * var(--u)); }
}
@media (forced-colors: active) {
  .header-saved, .map-toggle { border-color: CanvasText; }
}

/* ===== Dynamic Type (iOS Safari / WKWebView) =====
   Every font-size is calc(N * var(--u)). By default --u is 1px (unchanged look). On iOS the root takes the
   system body size (-apple-system-body: 17px at the default "Large" setting, up to ~53px at AX5), and --u becomes
   1rem/17, so text follows the Settings > Display > Text Size / Accessibility setting while the default is still 1px.
   The WKWebView reads the size at load; a size change needs the app to be reopened. Display sizes are capped by vw. */
@supports (-webkit-touch-callout: none) {
  html[lang] { font: -apple-system-body; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "PingFang SC", sans-serif; line-height: 1.5; --u: calc(1rem / 17); }
}
/* Large text: rows may wrap, nothing is clipped, controls grow with their text (min-height only, never height). */
.location-strip, .alternative-meta, .price-line, .core-metrics, .access-alt-row, .day-rows { flex-wrap: wrap; }
.button, .location-strip, .map-toggle, .filled-button, summary { height: auto; overflow-wrap: anywhere; }
.price-line strong, #station-name, .alternative-item h3 { overflow-wrap: anywhere; }
/* Large text: the title may use the full card width, and the app name wraps instead of being cut off. */
.station-heading { flex-wrap: wrap; }
.station-title-wrap { flex: 1 1 9em; }
.answer-card h2 { overflow-wrap: break-word; }
.identity h1, .header-saved { white-space: normal; overflow: visible; text-overflow: clip; }
.app-header { flex-wrap: wrap; }

/* ===== Part 2 UX: access info, day rows, stale location ===== */
.price-day-label { font-weight: 600; color: var(--ink); }
.day-rows { display: grid; gap: 6px; margin-top: 12px; }
.day-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 8px 12px; border-radius: 12px; background: var(--surface); font-size: calc(13 * var(--u)); }
.day-row-shown { outline: 2px solid var(--accent); outline-offset: -2px; }
.day-row-day { min-width: 5.5em; color: var(--muted); }
.day-row strong { font-variant-numeric: tabular-nums; }
.day-row-saving { color: var(--green); }
.day-row-badge { margin-inline-start: auto; font-size: calc(11 * var(--u)); font-weight: 600; color: var(--ink); }
.access-info { margin: 14px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--warn-bg); color: var(--warn); display: grid; gap: 6px; font-size: calc(13 * var(--u)); overflow-wrap: anywhere; }
.access-restriction { font-weight: 600; }
.access-hours { color: var(--muted); }
.access-alt { display: grid; gap: 2px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--ink); }
.access-alt-name { font-weight: 600; }
.access-alt-link { color: var(--link); min-height: 44px; display: inline-flex; align-items: center; }
.alternative-hours { font-size: calc(12 * var(--u)); color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.location-age { color: var(--warn); font-weight: 600; }
.location-strip[data-stale="1"] { box-shadow: inset 0 0 0 1.5px var(--warn); }
.empty-state .button { margin-top: 10px; }

/* ===== generated: min font sizes (tools/gen_min_fonts.mjs) ===== */
.demo-badge,
.language-button,
.notice,
.text-button,
.hero-advice-footnote,
.verdict,
.station-brand,
.fuel-pill,
.station-address,
.price-date,
.metric-label,
.saving-explanation,
.restriction,
.card-source,
.pump-check,
.alternative-meta,
.alternative-restriction,
.freshness,
.privacy-note,
.eyebrow,
.field-help,
.setup-number-hint,
.setup-fuel-name,
.setup-tip summary,
.setup-tip p,
.setup-brand-options > .brand-chip,
.fuel-segments label,
.settings-row label,
.brand-fieldset .field-help,
.brand-options > p,
.brand-choice,
.icon-metric,
.day-chip,
.brand-badge-small,
.brand-choice .brand-badge,
.setup-brand-options .brand-badge,
.header-saved,
.price-day-label,
.saving-basis,
.tomorrow-alert-badge,
.tomorrow-price-metric,
.any-brand-line,
.filled-button,
.setting-note,
.settings-saved-row,
.footer-meta,
#footer-updated:not([hidden]),
.footer-about,
.glv-credit,
.dialog-disclosure,
.dialog-about-link,
.about-source,
#location-hint,
.pattern-day,
.pattern-chip,
.pattern-card details,
.pattern-meta,
.favourite-line,
.device-prompt,
.maps-options label,
.brand-choice > span:last-child,
.setup-brand-options > .brand-chip > span:last-child,
.legal-note,
.day-row-badge,
.alternative-hours { font-size: calc(13 * var(--u)); }
html[lang="zh-Hans"] .demo-badge,
html[lang="zh-Hans"] .language-button,
html[lang="zh-Hans"] .button-quiet,
html[lang="zh-Hans"] .notice,
html[lang="zh-Hans"] .location-strip,
html[lang="zh-Hans"] .text-button,
html[lang="zh-Hans"] .hero-advice-reason,
html[lang="zh-Hans"] .hero-advice-footnote,
html[lang="zh-Hans"] .verdict,
html[lang="zh-Hans"] .station-brand,
html[lang="zh-Hans"] .fuel-pill,
html[lang="zh-Hans"] .station-address,
html[lang="zh-Hans"] .price-date,
html[lang="zh-Hans"] .metric-label,
html[lang="zh-Hans"] .saving-explanation,
html[lang="zh-Hans"] .restriction,
html[lang="zh-Hans"] .card-source,
html[lang="zh-Hans"] .pump-check,
html[lang="zh-Hans"] .alternatives summary,
html[lang="zh-Hans"] .alternative-meta,
html[lang="zh-Hans"] .alternative-restriction,
html[lang="zh-Hans"] .freshness,
html[lang="zh-Hans"] .privacy-note,
html[lang="zh-Hans"] .eyebrow,
html[lang="zh-Hans"] .intro,
html[lang="zh-Hans"] .field-help,
html[lang="zh-Hans"] .message,
html[lang="zh-Hans"] .empty-state p,
html[lang="zh-Hans"] .setup-skip,
html[lang="zh-Hans"] .setup-subtitle,
html[lang="zh-Hans"] .setup-number-hint,
html[lang="zh-Hans"] .setup-fuel-name,
html[lang="zh-Hans"] .setup-tip summary,
html[lang="zh-Hans"] .setup-tip p,
html[lang="zh-Hans"] .setup-brand-options > .brand-chip,
html[lang="zh-Hans"] .brand-chip,
html[lang="zh-Hans"] label,
html[lang="zh-Hans"] .settings-label,
html[lang="zh-Hans"] .fuel-segments label,
html[lang="zh-Hans"] .settings-row label,
html[lang="zh-Hans"] .brand-fieldset legend,
html[lang="zh-Hans"] .brand-fieldset .field-help,
html[lang="zh-Hans"] .brand-options > p,
html[lang="zh-Hans"] .brand-choice,
html[lang="zh-Hans"] .brand-badge,
html[lang="zh-Hans"] .icon-metric,
html[lang="zh-Hans"] .day-chip,
html[lang="zh-Hans"] .brand-badge-small,
html[lang="zh-Hans"] .brand-choice .brand-badge,
html[lang="zh-Hans"] .setup-brand-options .brand-badge,
html[lang="zh-Hans"] .header-saved,
html[lang="zh-Hans"] .price-day-label,
html[lang="zh-Hans"] .saving-basis,
html[lang="zh-Hans"] .tomorrow-alert-badge,
html[lang="zh-Hans"] .tomorrow-price-metric,
html[lang="zh-Hans"] .any-brand-line,
html[lang="zh-Hans"] .filled-button,
html[lang="zh-Hans"] .setting-toggle-row,
html[lang="zh-Hans"] .setting-note,
html[lang="zh-Hans"] .settings-saved-row,
html[lang="zh-Hans"] .footer-meta,
html[lang="zh-Hans"] #footer-updated:not([hidden]),
html[lang="zh-Hans"] .footer-about,
html[lang="zh-Hans"] .glv-credit,
html[lang="zh-Hans"] .dialog-disclosure,
html[lang="zh-Hans"] .dialog-about-link,
html[lang="zh-Hans"] .about-content h3,
html[lang="zh-Hans"] .about-content p,
html[lang="zh-Hans"] .about-source,
html[lang="zh-Hans"] #location-hint,
html[lang="zh-Hans"] .pattern-card h2,
html[lang="zh-Hans"] .pattern-day,
html[lang="zh-Hans"] .pattern-headline,
html[lang="zh-Hans"] .pattern-chip,
html[lang="zh-Hans"] .pattern-range,
html[lang="zh-Hans"] .pattern-card details,
html[lang="zh-Hans"] .pattern-meta,
html[lang="zh-Hans"] .favourites-shelf h2,
html[lang="zh-Hans"] .favourite-label,
html[lang="zh-Hans"] .favourite-line,
html[lang="zh-Hans"] .device-prompt,
html[lang="zh-Hans"] .maps-fieldset legend,
html[lang="zh-Hans"] .maps-options label,
html[lang="zh-Hans"] .answer-map-fail,
html[lang="zh-Hans"] .brand-choice > span:last-child,
html[lang="zh-Hans"] .setup-brand-options > .brand-chip > span:last-child,
html[lang="zh-Hans"] .legal-note,
html[lang="zh-Hans"] .tagline,
html[lang="zh-Hans"] .best-label,
html[lang="zh-Hans"] .why-text,
html[lang="zh-Hans"] .day-row,
html[lang="zh-Hans"] .day-row-badge,
html[lang="zh-Hans"] .access-info,
html[lang="zh-Hans"] .alternative-hours { font-size: calc(15 * var(--u)); }
html[lang="zh-Hans"] :is(body, p, span, a, button, summary, label, li, legend, dd, dt, div, h1, h2, h3, strong, small, input, select):not(#station-price):not(#station-price *) { line-height: 1.5; }
/* ===== end generated ===== */
/* ---------- Forecast teaser + full-screen history, and the 1.0.4 motion additions ----------
   New CSS lives above the Opening sequence block. Transform / opacity only, except the one-shot line draw. */
html { --fx-down: var(--green); --fx-up: #B3261E; --fx-flat: var(--muted); --fx-grid: rgba(122,75,10,.10); --fx-halo: rgba(168,106,18,.0); --fx-glow-wash: rgba(224,165,49,.10); }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) { --fx-up: #FF8F86; --fx-grid: rgba(224,165,49,.10); --fx-halo: rgba(224,165,49,.28); --fx-glow-wash: rgba(224,165,49,.18); } }
html[data-theme="dark"] { --fx-up: #FF8F86; --fx-grid: rgba(224,165,49,.10); --fx-halo: rgba(224,165,49,.28); --fx-glow-wash: rgba(224,165,49,.18); }
.forecast-teaser[data-trend="down"], .forecast-screen[data-trend="down"], .fs-hero[data-trend="down"] { --fx: var(--fx-down); }
.forecast-teaser[data-trend="up"], .forecast-screen[data-trend="up"], .fs-hero[data-trend="up"] { --fx: var(--fx-up); }
.forecast-teaser[data-trend="flat"], .forecast-screen[data-trend="flat"], .fs-hero[data-trend="flat"] { --fx: var(--fx-flat); }

.forecast-teaser { position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 76px; margin: 12px 0 0; padding: 12px 14px; text-align: left; font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 18px; cursor: pointer; }
.forecast-teaser[hidden] { display: none; }
.ft-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.ft-label { font-size: calc(12 * var(--u)); color: var(--muted); }
.ft-line { display: flex; align-items: baseline; gap: 5px; }
.ft-number { font-size: calc(30 * var(--u)); font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; color: var(--fx, var(--ink)); }
.ft-unit { font-size: calc(13 * var(--u)); color: var(--muted); }
.ft-word { font-size: calc(13 * var(--u)); font-weight: 700; color: var(--fx, var(--muted)); overflow-wrap: anywhere; }
.ft-spark { flex: none; width: 96px; height: 30px; }
.ft-chevron { flex: none; width: 18px; height: 18px; color: var(--muted); transform: rotate(-90deg); }
.fv-spark { display: block; width: 100%; height: 100%; overflow: visible; }
.fv-spark .fv-line { stroke-width: 1.6; }
.forecast-teaser.is-loading .ft-word { color: transparent; }
.forecast-teaser.is-loading::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent, var(--surface), transparent); animation: skeleton-shimmer 300ms ease-out infinite; pointer-events: none; }

.forecast-screen { position: fixed; z-index: 40; inset: 0 0 calc(var(--tab-h) + env(safe-area-inset-bottom)) 0; width: 100%; max-width: none; height: auto; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; overflow: hidden; background: var(--bg); color: var(--ink); box-shadow: none; }
.forecast-screen[open] { display: flex; flex-direction: column; animation: fs-in 260ms ease-out both; }
.forecast-screen::backdrop { background: var(--bg); }
.forecast-screen.fs-closing { animation: fs-out 200ms ease-in both; pointer-events: none; }
.fs-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; background: radial-gradient(70% 38% at 50% 14%, var(--fx-glow-wash), transparent 72%); }
.fs-grid { position: absolute; inset: -32px; background-image: linear-gradient(var(--fx-grid) 1px, transparent 1px), linear-gradient(90deg, var(--fx-grid) 1px, transparent 1px); background-size: 32px 32px; animation: fs-grid 24s linear infinite; will-change: transform; -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 85%); mask-image: linear-gradient(180deg, #000 0%, transparent 85%); }
.fs-particles i { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: var(--accent); opacity: 0; animation: fs-float 10s linear infinite; will-change: transform, opacity; }
.fs-paused .fs-grid, .fs-paused .fs-particles i { animation-play-state: paused; }
.fs-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(14px, env(safe-area-inset-top)) 16px 4px 20px; }
.fs-head h2 { margin: 0; font-size: calc(13 * var(--u)); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--link); }
.fs-body { position: relative; flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px 20px max(28px, env(safe-area-inset-bottom)); }
.fs-hero { margin: 8px 0 18px; text-align: center; }
.fs-hero p { margin: 0; }
.fs-hero-line { display: flex; align-items: baseline; justify-content: center; gap: 8px; min-height: calc(88 * var(--u)); }
.fs-number { font-size: calc(88 * var(--u)); font-weight: 800; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--fx, var(--ink)); text-shadow: 0 0 26px var(--fx-halo); }
.fs-unit { font-size: calc(18 * var(--u)); font-weight: 600; color: var(--muted); }
.fs-word { margin-top: 4px; font-size: calc(20 * var(--u)); font-weight: 700; color: var(--fx, var(--muted)); }
.fs-note { margin-top: 2px; font-size: calc(12 * var(--u)); color: var(--muted); }
.fs-hero[data-state="empty"] .fs-hero-line { min-height: 0; }
.fs-hero[data-state="empty"] .fs-word { font-size: calc(17 * var(--u)); color: var(--muted); }
.fs-figure { margin: 0 0 14px; }
.fs-chart { aspect-ratio: 300 / 140; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); overflow: hidden; }
.fs-chart:empty { aspect-ratio: auto; min-height: 0; border: 0; }
.fv-chart { display: block; width: 100%; height: 100%; }
.fv-gridline { stroke: var(--line); stroke-width: 1; }
.fv-glow, .fv-line { fill: none; stroke: var(--accent); stroke-linecap: round; stroke-linejoin: round; }
.fv-glow { stroke-width: 7; opacity: .2; }
.fv-line { stroke-width: 2.2; }
.fv-dot { fill: var(--accent); }
.fv-end { fill: var(--fx, var(--accent)); }
.fv-draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: fv-draw 1000ms cubic-bezier(.4, 0, .2, 1) 120ms forwards; }
.fv-draw-end { opacity: 0; animation: fv-end-in 240ms ease-out 1000ms forwards; }
.fs-range { margin-top: 8px; font-size: calc(12 * var(--u)); color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.fs-gaps { margin: 2px 0 0; font-size: calc(12 * var(--u)); color: var(--muted); text-align: center; }
.fs-gaps:empty { display: none; }
.fs-source { margin: 0 0 4px; font-size: calc(12 * var(--u)); color: var(--muted); text-align: center; }
.fs-disclaimer { margin: 0 0 14px; font-size: calc(12 * var(--u)); color: var(--muted); text-align: center; }
@keyframes fs-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fs-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(14px); } }
@keyframes fs-grid { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, 32px, 0); } }
@keyframes fs-float { 0% { transform: translate3d(0, 0, 0); opacity: 0; } 20% { opacity: .55; } 80% { opacity: .35; } 100% { transform: translate3d(0, -48px, 0); opacity: 0; } }
@keyframes fv-draw { to { stroke-dashoffset: 0; } }
@keyframes fv-end-in { to { opacity: 1; } }

/* Alternatives stagger, footer pulse, PTR success tick, star burst. */
#alternative-list.stagger > li { animation: alt-rise 220ms ease-out both; animation-delay: calc(var(--i, 0) * 40ms); }
@keyframes alt-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.footer-pulse { display: inline-block; animation: footer-pulse 500ms ease-out; }
@keyframes footer-pulse { 0% { opacity: .2; transform: scale(1.08); } 100% { opacity: 1; transform: none; } }
.ptr-check { display: none; width: 20px; height: 20px; fill: none; stroke: var(--green); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; }
.ptr[data-state="done"] { opacity: 1; transform: translateY(calc(var(--ptr-y, 0px) - 56px)); }
.ptr[data-state="done"] .ptr-spinner { display: none; }
.ptr[data-state="done"] .ptr-check { display: block; animation: check-draw 300ms ease-out both; }
.favourite-button { position: relative; }
.star-spark { position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: var(--star); pointer-events: none; animation: star-spark 380ms ease-out both; }
@keyframes star-spark { from { transform: rotate(var(--a)) translateY(-6px) scale(1); opacity: 1; } to { transform: rotate(var(--a)) translateY(-22px) scale(.2); opacity: 0; } }

/* ---------- Price history card (#pattern-card): same glow language as the forecast screen ---------- */
.pattern-card { position: relative; overflow: hidden; padding: 18px 16px 8px; border: 1px solid var(--line); border-radius: 20px; background: radial-gradient(90% 60% at 50% 0%, var(--fx-glow-wash), transparent 75%), var(--paper); }
.pattern-card h2 { margin: 0 0 4px; color: var(--link); font-size: calc(12 * var(--u)); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.pattern-card .pattern-chart { height: 96px; margin-top: 4px; border-radius: 10px; background-image: linear-gradient(var(--fx-grid) 1px, transparent 1px); background-size: 100% 24px; }
.pattern-baseline { stroke: var(--line); stroke-width: 1; }
.pattern-bar { fill: var(--muted); opacity: .45; }
.pattern-bar-low { fill: var(--green); opacity: .55; }
.pattern-bar-dear { fill: var(--fx-up); opacity: .5; }
.pattern-bar-cheapest { fill: var(--pattern-gold); opacity: 1; filter: drop-shadow(0 0 4px rgba(224, 165, 49, .65)); }
.pattern-callout { fill: var(--ink); stroke: none; font-size: calc(10 * var(--u)); font-weight: 700; text-anchor: middle; font-variant-numeric: tabular-nums; }
.pattern-headline { margin: 12px 0 6px; font-size: calc(17 * var(--u)); font-weight: 700; line-height: 1.35; }
.pattern-chip { padding: 2px 9px; border-color: var(--fx-grid); background: var(--fx-glow-wash); color: var(--ink); font-weight: 600; }
.pattern-range { margin: 12px 0 0; font-size: calc(15 * var(--u)); font-weight: 700; }
.pattern-range svg { color: var(--pattern-gold); }
.pattern-card .pattern-meta { margin: 6px 0 0; }
.pattern-bar { animation: pc-rise 320ms cubic-bezier(.2, .7, .2, 1) both; transform-box: fill-box; transform-origin: 50% 0; }
.pattern-bar-dear, .pattern-bar-cheapest { transform-origin: 50% 100%; }
.pattern-bar:nth-of-type(2) { animation-delay: 30ms; } .pattern-bar:nth-of-type(3) { animation-delay: 60ms; } .pattern-bar:nth-of-type(4) { animation-delay: 90ms; }
.pattern-bar:nth-of-type(5) { animation-delay: 120ms; } .pattern-bar:nth-of-type(6) { animation-delay: 150ms; } .pattern-bar:nth-of-type(7) { animation-delay: 180ms; }
.pattern-card > :is(h2, .pattern-range, .pattern-headline, .pattern-meta) { animation-name: pc-fade; animation-duration: 240ms; animation-timing-function: ease-out; animation-fill-mode: both; }
@keyframes pc-rise { from { opacity: 0; transform: scaleY(.15); } }
@keyframes pc-fade { from { opacity: 0; } to { opacity: 1; } }
/* ---------- Bottom tab bar (1.0.4) ---------- */
html { --tab-h: 56px; }
html.has-tabbar .app-shell { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 24px); }
.tabbar { position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; display: flex; padding-bottom: env(safe-area-inset-bottom); background: var(--paper); border-top: 1px solid var(--line); }
.tabbar[hidden] { display: none; }
html.fn-intro-on .tabbar { visibility: hidden; }
.tab { position: relative; flex: 1; min-width: 44px; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px 2px; border: 0; border-radius: 0; background: none; color: var(--muted); font: inherit; font-size: calc(11 * var(--u)); font-weight: 600; line-height: 1.2; cursor: pointer; }
.tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab.is-active { color: var(--link); }
.tab::before { content: ''; position: absolute; top: 0; left: 50%; width: 28px; height: 3px; margin-left: -14px; border-radius: 0 0 3px 3px; background: var(--accent); opacity: 0; transform: scaleX(.4); transition: opacity 200ms ease, transform 200ms ease; }
.tab.is-active::before { opacity: 1; transform: none; }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }
html[lang="zh-Hans"] .tab { font-size: calc(12 * var(--u)); }
.history-screen .fs-body { padding-top: 12px; }

/* ---------- Gary's History / Forecast / Settings design (1.0.4) ---------- */
.gv { --gv-bg: #F5F5F7; --gv-ink: #1C1C1E; --gv-mut: #6E6E73; --gv-sub: #3A3A3C; --gv-gold: #A86A12; --gv-goldtx: #7A4B0A; --gv-up: #B3261E; --gv-dn: #1E7B3C; --gv-cell: #FFFFFF; --gv-grid: #E3E3E8; --gv-hair: rgba(168, 106, 18, .22); --gv-chip: rgba(168, 106, 18, .45); --gv-seg: rgba(168, 106, 18, .08); --gv-segon: rgba(168, 106, 18, .18); --gv-col: rgba(30, 123, 60, .09); --gv-pill: rgba(30, 123, 60, .1); }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .gv { --gv-bg: #0E0C09; --gv-ink: #F3ECDF; --gv-mut: #8E8576; --gv-sub: #A89F90; --gv-gold: #F5B83D; --gv-goldtx: #F5B83D; --gv-up: #F07A6A; --gv-dn: #5ED3A5; --gv-cell: #15120E; --gv-grid: #262019; --gv-hair: rgba(245, 184, 61, .12); --gv-chip: rgba(245, 184, 61, .35); --gv-seg: rgba(255, 236, 200, .05); --gv-segon: rgba(245, 184, 61, .16); --gv-col: rgba(94, 211, 165, .08); --gv-pill: rgba(94, 211, 165, .1); } }
html[data-theme="dark"] .gv { --gv-bg: #0E0C09; --gv-ink: #F3ECDF; --gv-mut: #8E8576; --gv-sub: #A89F90; --gv-gold: #F5B83D; --gv-goldtx: #F5B83D; --gv-up: #F07A6A; --gv-dn: #5ED3A5; --gv-cell: #15120E; --gv-grid: #262019; --gv-hair: rgba(245, 184, 61, .12); --gv-chip: rgba(245, 184, 61, .35); --gv-seg: rgba(255, 236, 200, .05); --gv-segon: rgba(245, 184, 61, .16); --gv-col: rgba(94, 211, 165, .08); --gv-pill: rgba(94, 211, 165, .1); }
.gv [hidden] { display: none !important; }
.forecast-screen.gv { background: var(--gv-bg); color: var(--gv-ink); border: 0; }
.forecast-screen.gv .gv-in { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; padding: max(18px, env(safe-area-inset-top)) 16px 12px; overflow-y: auto; overscroll-behavior: contain; }
.gv-hd { display: flex; justify-content: space-between; align-items: center; min-height: 44px; gap: 12px; }
.gv-title { margin: 0; font-size: calc(18 * var(--u)); font-weight: 500; line-height: 1.25; letter-spacing: 0; }
.gv-cap { margin: 0; font-size: calc(11 * var(--u)); line-height: 1.4; color: var(--gv-mut); }
.gv-chip { flex: none; position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0; border: 0; background: transparent; color: var(--gv-goldtx); font: inherit; cursor: pointer; }
.gv-chip span { display: block; font-size: calc(11 * var(--u)); border: 1px solid var(--gv-chip); border-radius: 99px; padding: 3px 10px; }
.gv-hero { margin-top: clamp(14px, 3vh, 30px); min-height: 84px; }
.gv-hero p { margin: 0; }
.gv-big { font-size: calc(44 * var(--u)); font-weight: 500; letter-spacing: -1px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.gv-unit { font-size: calc(13 * var(--u)); color: var(--gv-mut); margin-left: 4px; letter-spacing: 0; font-weight: 400; }
.gv-sub { font-size: calc(13 * var(--u)); line-height: 1.5; color: var(--gv-sub); font-variant-numeric: tabular-nums; }
span.gv-up, b.gv-up { color: var(--gv-up); } span.gv-dn, b.gv-dn { color: var(--gv-dn); }
.gv-figure { margin: clamp(10px, 2.4vh, 24px) 0 0; flex: 1 0 auto; display: flex; flex-direction: column; }
.gv-chart { position: relative; flex: 1 0 auto; min-height: 230px; }
.forecast-screen.gv .gv-in > * { flex-shrink: 0; }
.gv-svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: pan-y; overflow: visible; }
.gv-svg text, .gv-area, .gv-band, .gv-col, .gv-dotfill, .gv-up-f, .gv-dn-f { stroke: none; }
.gv-gridline { stroke: var(--gv-grid); stroke-width: 1; stroke-dasharray: 2 4; }
.gv-axis { fill: var(--gv-mut); font-size: calc(10 * var(--u)); } .gv-mk { font-size: calc(10 * var(--u)); }
.gv-svg .gv-up { fill: var(--gv-up); } .gv-svg .gv-dn { fill: var(--gv-dn); }
.gv-up-f { fill: var(--gv-up); } .gv-dn-f { fill: var(--gv-dn); } .gv-dotfill { fill: var(--gv-gold); }
.gv-line { fill: none; stroke: var(--gv-gold); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; } .gv-line-f { stroke-width: 2; }
.gv-stop-a { stop-color: var(--gv-gold); stop-opacity: .32; } .gv-stop-b { stop-color: var(--gv-gold); stop-opacity: 0; }
.gv-band-a { stop-color: var(--gv-gold); stop-opacity: .26; } .gv-band-b { stop-color: var(--gv-gold); stop-opacity: .05; }
.gv-col { fill: var(--gv-col); }
.gv-pt { fill: var(--gv-bg); stroke-width: 1.8; } .gv-up-s { stroke: var(--gv-up); } .gv-dn-s { stroke: var(--gv-dn); } .gv-gold-s { stroke: var(--gv-gold); }
.gv-xl { stroke: var(--gv-ink); stroke-opacity: .45; stroke-dasharray: 3 3; } .gv-xc { fill: var(--gv-gold); stroke: var(--gv-bg); stroke-width: 2; }
.gv-seg { display: flex; height: 32px; align-items: center; gap: 2px; background: var(--gv-seg); border-radius: 10px; padding: 2px; margin-top: 10px; }
.gv-seg button { position: relative; flex: 1; height: 28px; min-width: 0; background: transparent; border: 0; border-radius: 8px; color: var(--gv-mut); font: inherit; font-size: calc(12 * var(--u)); padding: 0; cursor: pointer; }
.gv-seg button::after { content: ''; position: absolute; inset: -8px 0; }
.gv-seg button.on { background: var(--gv-segon); color: var(--gv-goldtx); }
.gv-collect { text-align: center; margin-top: 8px; }
.gv-pill { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 32px; margin-top: 10px; border-radius: 10px; background: var(--gv-pill); color: var(--gv-dn); font-size: calc(12 * var(--u)); }
.gv-pill svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.gv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--gv-hair); border: 1px solid var(--gv-hair); border-radius: 14px; overflow: hidden; margin-top: clamp(12px, 2.4vh, 24px); font-variant-numeric: tabular-nums; }
.gv-grid > div { background: var(--gv-cell); padding: 10px 12px; }
.gv-k { display: block; font-size: calc(11 * var(--u)); color: var(--gv-mut); }
.gv-grid b { display: block; font-size: calc(16 * var(--u)); font-weight: 500; margin-top: 2px; }
.gv-foot { margin: auto 0 0; padding-top: 12px; text-align: center; font-size: calc(11 * var(--u)); color: var(--gv-mut); }
.gv-foot p { margin: 0 0 3px; }
.gv-empty { margin-top: 18px; padding: 30px 16px; text-align: center; border: 1px dashed var(--gv-hair); border-radius: 14px; }
.gv-empty h3 { margin: 0 0 6px; font-size: calc(15 * var(--u)); font-weight: 500; } .gv-empty p { margin: 0; font-size: calc(12 * var(--u)); color: var(--gv-mut); }
/* weekly-pattern card, compact, under the grid */
.gv .pattern-card { margin-top: 14px; padding: 12px 14px 4px; border-radius: 14px; border: 1px solid var(--gv-hair); background: var(--gv-cell); }
.gv .pattern-card h2 { color: var(--gv-goldtx); }
.gv .pattern-card .pattern-chart { height: 72px; }
.gv .pattern-headline { font-size: calc(14 * var(--u)); margin: 8px 0 4px; }
.gv .pattern-card .pattern-meta { display: none; }
/* ---------- Logo header on every tab + redesigned Settings (1.0.4, Gary) ---------- */
.gv-word { font-size: calc(20 * var(--u)); letter-spacing: -.5px; font-weight: 700; line-height: 1.2; white-space: nowrap; color: var(--gv-ink); }
@media (max-width: 359px) { .gv-word { font-size: calc(16 * var(--u)); } }
.gv-brand { min-height: 44px; }
.gv { --gv-on: #FFFFFF; --gv-track: #D8D3C8; }
@media (prefers-color-scheme: dark) { html:not([data-theme="light"]) .gv { --gv-on: #2A1D05; --gv-track: #3A3328; } }
html[data-theme="dark"] .gv { --gv-on: #2A1D05; --gv-track: #3A3328; }
#settings-dialog.gv { background: var(--gv-bg); color: var(--gv-ink); padding: max(18px, env(safe-area-inset-top)) 16px max(14px, env(safe-area-inset-bottom)); border: 0; }
.st-top { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.st-top .icon-button { background: var(--gv-seg); color: var(--gv-ink); }
.st-title { margin: 6px 2px 4px; } .st-h { font-size: calc(18 * var(--u)); font-weight: 500; letter-spacing: 0; line-height: 1.25; }
.sg { margin: 0 0 12px; padding: 0; border: 0; }
.sg-t { margin: 12px 4px 6px; font-size: calc(12 * var(--u)); font-weight: 600; letter-spacing: .04em; color: var(--gv-mut); }
.sg-c { background: var(--gv-cell); border: 1px solid var(--gv-hair); border-radius: 16px; overflow: hidden; }
.sg-car { background: linear-gradient(160deg, var(--gv-seg), var(--gv-cell) 55%); }
.sg-blk { padding: 12px 14px 4px; } .sg-blk + .sg-blk { border-top: 1px solid var(--gv-hair); }
.sg-lbl { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: calc(14 * var(--u)); }
.sr-h { display: block; font-size: calc(11 * var(--u)); line-height: 1.4; color: var(--gv-mut); font-weight: 400; }
.sg-val { display: inline-flex; align-items: baseline; gap: 4px; color: var(--gv-goldtx); }
.sg-val input { width: 74px; min-height: 44px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--gv-goldtx); font-size: calc(18 * var(--u)); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.sg-val input::-webkit-outer-spin-button, .sg-val input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sg-val input:focus-visible { outline: 2px solid var(--gv-gold); }
.sg-unit { font-size: calc(12 * var(--u)); color: var(--gv-mut); }
.sg-slider { -webkit-appearance: none; appearance: none; display: block; width: 100%; min-height: 44px; height: 44px; margin: 0; padding: 0; border: 0; background: transparent; }
.sg-slider::-webkit-slider-runnable-track { height: 4px; border-radius: 99px; background: linear-gradient(90deg, var(--gv-gold) var(--p, 50%), var(--gv-track) var(--p, 50%)); }
.sg-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -9px; border-radius: 50%; background: var(--gv-ink); border: 4px solid var(--gv-gold); }
.sg-slider::-moz-range-track { height: 4px; border-radius: 99px; background: var(--gv-track); } .sg-slider::-moz-range-progress { height: 4px; border-radius: 99px; background: var(--gv-gold); }
.sg-slider::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--gv-ink); border: 4px solid var(--gv-gold); }
.sg-slider:focus-visible { outline: 2px solid var(--gv-gold); outline-offset: -2px; border-radius: 8px; }
.sg-sum { display: flex; justify-content: space-between; gap: 8px; margin: 0; padding: 12px 14px; border-top: 1px solid var(--gv-hair); font-size: calc(12 * var(--u)); color: var(--gv-sub); font-variant-numeric: tabular-nums; }
.sg-sum span:first-child { color: var(--gv-ink); font-weight: 500; }
.fuel-segments.fuel-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; padding: 0; background: transparent; border-radius: 0; }
.fuel-segments.fuel-chips label, .fuel-segments.fuel-chips label:nth-child(n+5) { grid-column: auto; flex: 0 0 auto; font-size: calc(13 * var(--u)); }
.fuel-segments.fuel-chips span { display: grid; place-items: center; min-height: 44px; min-width: 52px; padding: 0 14px; border: 1px solid var(--gv-hair); border-radius: 10px; white-space: nowrap; color: var(--gv-ink); background: transparent; }
.fuel-segments.fuel-chips input:checked + span { background: var(--gv-gold); border-color: var(--gv-gold); color: var(--gv-on); font-weight: 600; box-shadow: none; }
.sr-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 6px 14px; margin: 0; border: 0; border-top: 1px solid var(--gv-hair); border-radius: 0; background: transparent; color: var(--gv-ink); font: inherit; text-align: left; position: relative; cursor: pointer; }
.sg-c > .sr-row:first-child { border-top: 0; }
.sr-ico { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--gv-goldtx); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sr-t { flex: 1; min-width: 0; display: flex; flex-direction: column; } .sr-t > span { font-size: calc(15 * var(--u)); }
.sr-v { display: flex; align-items: center; justify-content: flex-end; gap: 6px; max-width: 46%; font-size: calc(14 * var(--u)); color: var(--gv-sub); text-align: right; }
.sr-chev { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--gv-mut); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sr-marks { display: inline-flex; align-items: center; gap: 4px; }
.sr-marks .brand-badge { width: 24px; height: 24px; flex: none; }
.sr-more { font-size: calc(12 * var(--u)); color: var(--gv-mut); }
.sr-static .sr-act { position: absolute; inset: 0; width: 100%; min-height: 56px; opacity: 0; }
.sr-static::after, .sg-c > .sr-row[data-open]::after { content: none; }
.sg-c .settings-saved-row { margin: 0; padding: 6px 14px; min-height: 56px; border-top: 1px solid var(--gv-hair); font-size: calc(14 * var(--u)); }
.sg-c .dialog-about-link { display: flex; align-items: center; width: 100%; margin: 0; padding: 0 14px; min-height: 56px; border-top: 1px solid var(--gv-hair); font-size: calc(15 * var(--u)); text-align: left; color: var(--gv-ink); }
[data-sp="brands"], [data-sp="state"], [data-sp="maps"], [data-sp="theme"], [data-sp="lang"] { position: relative; }
.sp-head { display: flex; align-items: center; gap: 6px; min-height: 56px; margin: 0 0 4px -8px; }
.sp-back { display: grid; place-items: center; width: 44px; min-width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--gv-goldtx); }
.sp-back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sp-list { margin-top: 8px; }
.sp-opt, .sp-list .maps-options label { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 0 14px; margin: 0; border-top: 1px solid var(--gv-hair); border-radius: 0; font-size: calc(15 * var(--u)); cursor: pointer; background: transparent; }
.sp-list > :first-child.sp-opt, .sp-list .maps-options label:first-child, #sp-state-list .sp-opt:first-child, #sp-lang-list .sp-opt:first-child { border-top: 0; }
.sp-opt input, .sp-list .maps-options input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; opacity: 0; cursor: pointer; }
.sp-opt svg { width: 20px; height: 20px; fill: none; stroke: var(--gv-goldtx); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.sp-opt:has(:checked), .sp-list .maps-options label:has(:checked) { color: var(--gv-goldtx); font-weight: 600; background: transparent; }
.sp-opt:has(:checked) svg { opacity: 1; }
.sp-list .maps-options label:has(:checked)::after { content: '✓'; font-size: calc(17 * var(--u)); }
.sp-opt:has(:focus-visible), .sp-list .maps-options label:has(:focus-visible) { outline: 2px solid var(--gv-gold); outline-offset: -2px; }
.sp-list .maps-options { display: block; border: 0; border-radius: 0; background: transparent; }
.sp-list .maps-fieldset { margin: 0; padding: 0; border: 0; }
.sp-list .maps-fieldset legend, .sp-list select { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.st-clear { position: absolute; right: -6px; top: 6px; min-height: 44px; padding: 0 8px; border: 0; background: transparent; color: var(--gv-goldtx); font-size: calc(13 * var(--u)); }
.st-search { display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 4px 0 10px; padding: 0 12px; border-radius: 12px; background: var(--gv-seg); }
.st-search svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--gv-mut); stroke-width: 2; stroke-linecap: round; }
.st-search input { flex: 1; min-height: 40px; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--gv-ink); font-size: calc(14 * var(--u)); }
[data-sp="brands"] .brand-fieldset { margin: 0; padding: 0; border: 0; }
[data-sp="brands"] .brand-fieldset legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[data-sp="brands"] .any-brand-chip { margin: 0 0 10px; min-height: 44px; border-color: var(--gv-chip); background: transparent; color: var(--gv-goldtx); white-space: nowrap; }
[data-sp="brands"] .any-brand-chip[aria-pressed="true"] { background: var(--gv-segon); }
#brand-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
#brand-options .brand-choice { position: relative; flex-direction: column; justify-content: center; align-items: center; gap: 4px; min-height: 92px; padding: 10px 6px; text-align: center; background: var(--gv-cell); border: 1px solid var(--gv-hair); border-radius: 14px; }
#brand-options .brand-choice:has(input:checked) { border-color: var(--gv-gold); background: var(--gv-segon); }
#brand-options.is-all .brand-choice:has(input:checked) { border-color: var(--gv-hair); background: var(--gv-cell); }
#brand-options.is-all .brand-checkbox { display: none; }
#brand-options .brand-checkbox { position: absolute; top: 6px; right: 6px; }
#brand-options .brand-badge { width: 34px; height: 34px; }
#brand-options .brand-choice > span:last-child { display: flex; flex-direction: column; align-items: center; min-width: 0; max-width: 100%; }
.brand-choice > span:last-child { max-width: 100%; font-size: calc(12 * var(--u)); font-weight: 500; line-height: 1.3; }
.brand-count { font-size: calc(11 * var(--u)); color: var(--gv-mut); }
.brand-none { grid-column: 1 / -1; text-align: center; font-size: calc(13 * var(--u)); color: var(--gv-mut); padding: 18px 0; }
.brands-more { display: block; width: 100%; min-height: 44px; margin-top: 10px; border: 1px dashed var(--gv-chip); border-radius: 12px; background: transparent; color: var(--gv-goldtx); font-size: calc(13 * var(--u)); }
#settings-dialog.gv .dialog-actions { margin-top: 8px; padding-top: 4px; border-top: 0; background: transparent; }
#settings-dialog.gv .legal-note { font-size: calc(11 * var(--u)); margin-top: 8px; }
#settings-dialog.gv .message { font-size: calc(13 * var(--u)); }

/* Addendum H: Settings shares the tab panels' inset; the bar remains interactive. */
#settings-dialog.gv { position: fixed; z-index: 50; inset: 0 0 calc(var(--tab-h) + env(safe-area-inset-bottom)) 0; margin: 0; width: 100%; max-width: none; height: auto; max-height: none; border-radius: 0; overflow-y: auto; box-shadow: none; }
#home-fuel-chip { min-width: 44px; min-height: 44px; color: var(--ink); }
/* Both header pills share a 44px box and centreline, independent of label defaults. */
.header-actions .state-picker, #home-fuel-chip { height: 44px; margin: 0; }
#home-fuel-chip span, .header-actions #state-select { display: inline-flex; align-items: center; height: 44px; min-height: 44px; border: 1px solid var(--line); border-radius: 22px; padding: 0 10px; background: var(--paper); color: var(--ink); font-size: calc(12 * var(--u)); font-weight: 700; line-height: 1.5; }
.app-shell, #history-screen, #forecast-screen, #settings-dialog { touch-action: pan-y pinch-zoom; }
#fuel-picker { position: fixed; z-index: 70; inset: auto; margin: 0; width: min(272px, calc(100vw - 24px)); padding: 12px; border: 1px solid var(--gv-hair); border-radius: 16px; background: var(--gv-cell); color: var(--gv-ink); overflow-y: auto; box-shadow: 0 8px 28px #00000026; }
#fuel-picker .dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#fuel-picker-title { margin: 0; font-size: calc(14 * var(--u)); font-weight: 600; }

/* ---------- Shared tech backdrop: each opaque tab owns a clipped copy ---------- */
html { --tech-base: #F5F5F7; --tech-rgb: 168, 106, 18; --tech-wide-light: rgba(168, 106, 18, .12); --tech-line: rgba(168, 106, 18, .10); --tech-light: rgba(168, 106, 18, .10); --tech-halo: rgba(168, 106, 18, .045); --tech-depth: rgba(100, 116, 139, .045); }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) { --tech-base: #0E0C09; --tech-rgb: 245, 184, 61; --tech-wide-light: rgba(245, 184, 61, .18); --tech-line: rgba(245, 184, 61, .09); --tech-light: rgba(245, 184, 61, .14); --tech-halo: rgba(245, 184, 61, .055); --tech-depth: transparent; }
}
html[data-theme="dark"] { --tech-base: #0E0C09; --tech-rgb: 245, 184, 61; --tech-wide-light: rgba(245, 184, 61, .18); --tech-line: rgba(245, 184, 61, .09); --tech-light: rgba(245, 184, 61, .14); --tech-halo: rgba(245, 184, 61, .055); --tech-depth: transparent; }
/* Isolation keeps negative layers above their screen's base, below all its content. */
body { isolation: isolate; background: var(--tech-base); }
.tech-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.tech-bg-glow { position: absolute; inset: -15%; background: radial-gradient(ellipse at 50% 50%, var(--tech-light) 0%, var(--tech-halo) 32%, transparent 65%), radial-gradient(ellipse at 50% 55%, var(--tech-depth), transparent 70%); transform-origin: 50% 50%; opacity: .8; animation: tech-bg-breathe 8s ease-in-out infinite; }
.tech-bg-grid { position: absolute; inset: -40px; background-image: linear-gradient(var(--tech-line) 1px, transparent 1px), linear-gradient(90deg, var(--tech-line) 1px, transparent 1px); background-size: 40px 40px; -webkit-mask-image: radial-gradient(ellipse at 50% 50%, #000 12%, transparent 72%); mask-image: radial-gradient(ellipse at 50% 50%, #000 12%, transparent 72%); animation: tech-bg-drift 32s linear infinite; }
/* Broader falloff exposes the effect around Home's answer card and History's chart. */
#home-panel > .tech-bg, #history-screen > .tech-bg { --tech-line: rgba(var(--tech-rgb), .12); --tech-light: var(--tech-wide-light); }
#home-panel > .tech-bg .tech-bg-glow, #history-screen > .tech-bg .tech-bg-glow { inset: -30%; background: radial-gradient(ellipse at 50% 50%, var(--tech-light) 0%, var(--tech-halo) 50%, transparent 85%), radial-gradient(ellipse at 50% 55%, var(--tech-depth), transparent 85%); }
#home-panel > .tech-bg .tech-bg-grid, #history-screen > .tech-bg .tech-bg-grid { -webkit-mask-image: radial-gradient(ellipse at 50% 50%, #000 35%, rgba(0, 0, 0, .5) 75%, transparent 100%); mask-image: radial-gradient(ellipse at 50% 50%, #000 35%, rgba(0, 0, 0, .5) 75%, transparent 100%); }
/* Only the exposed screen runs; Settings and other dialogs can cover existing panels. */
body.dialog-open #home-panel > .tech-bg :is(.tech-bg-grid, .tech-bg-glow),
body:has(dialog[open]:not(.forecast-screen)) .forecast-screen .tech-bg :is(.tech-bg-grid, .tech-bg-glow),
body:has(dialog[open]:not(.forecast-screen):not(#settings-dialog)) #settings-dialog .tech-bg :is(.tech-bg-grid, .tech-bg-glow) { animation-play-state: paused; }
/* Release the sheet's transform after entry so its fixed backdrop stays put while scrolling. */
#settings-dialog.gv[open]:not(.sheet-closing) { animation-fill-mode: backwards; }
html.fn-intro-on .tech-bg-grid, html.fn-intro-on .tech-bg-glow,
.fs-paused .tech-bg-grid, .fs-paused .tech-bg-glow { animation-play-state: paused; }
@keyframes tech-bg-drift { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, 40px, 0); } }
@keyframes tech-bg-breathe { 0%, 100% { transform: scale(.94); opacity: .8; } 50% { transform: scale(1.12); opacity: 1; } }

/* b18: Settings shares the chart panels' top safe area, including the mobile sheet override. */
#settings-dialog.gv::before { display: none; }
@media (max-width: 700px) {
  #settings-dialog.gv { padding-top: max(18px, env(safe-area-inset-top)); }
}

/* Both live pages move together; the body and root clip the off-screen neighbour. */
.forecast-screen.gv[open]:not(.fs-closing), #settings-dialog.gv[open]:not(.sheet-closing) { animation: none !important; }
#home-panel { position: relative; isolation: isolate; min-height: 100dvh; background: var(--tech-base); }
html:has(body.tab-swiping), body.tab-swiping { overflow-x: hidden; }
.tab-page, #settings-dialog.gv.tab-page { animation: none !important; will-change: transform; }
#home-panel.tab-page { z-index: 51; }
.tab-page.tab-neighbour { z-index: 52 !important; }
.tab-page.tab-edge-left { box-shadow: -8px 0 18px -12px #0006 !important; }
.tab-page.tab-edge-right { box-shadow: 8px 0 18px -12px #0006 !important; }

/* Android WebView draws its own overlay scroll bars on inner scrollers (CSS cannot hide them; the native
   setVerticalScrollBarEnabled(false) only covers page-level scrolling). Push each inner scroller 14px past a
   clipped right edge so the bar is drawn off-screen. Android app only; the website and iOS are unchanged. */
html[data-native-platform="android"] .forecast-screen.gv .gv-in { margin-right: -14px; padding-right: 30px; }
html[data-native-platform="android"] .fs-body { margin-right: -14px; padding-right: 34px; }
html[data-native-platform="android"] #settings-dialog.gv { right: -14px; width: calc(100% + 14px); padding-right: 30px; clip-path: inset(0 14px 0 0); }
html[data-native-platform="android"] .m-sheet:not(#settings-dialog.gv) { right: -14px; padding-right: 34px; clip-path: inset(0 14px 0 0 round 26px 26px 0 0); }
/* Native-feel fixes from the 20 Nov device test. Sheet title and close button stay pinned while the sheet scrolls. */
dialog.m-sheet.local-dialog > .dialog-header { position: sticky; top: -10px; z-index: 3; margin: -10px -20px 16px; padding: 14px 20px 10px;
  background: var(--paper); border-radius: 26px 26px 0 0; }
/* The floating tab bar steps aside while the keyboard is up, so it never covers a field's button. */
html.kb-open #tabbar { display: none; }
/* Favourite rows: keep "Navigate" apart from the date before it. */
#favourites-shelf-list li > a, #favourites-dialog-list li > a { display: inline-block; margin-left: .6em; }

/* Quick opening on repeat launches (intro.js adds .fn-intro-quick): the same logo, gauge and fill, played in ~0.4 s.
   Higher specificity than the opening rules below, so their timing is replaced without editing that block. */
html.fn-intro-quick.fn-intro-play .fn-intro-logo { animation: fn-logo-in 240ms cubic-bezier(.16,1,.3,1) 0ms both; }
html.fn-intro-quick.fn-intro-play .fn-intro-gauge { animation: fn-gauge-in 240ms cubic-bezier(.22,1,.36,1) 0ms both; }
html.fn-intro-quick.fn-intro-play .fn-intro-halo { animation: fn-halo 320ms cubic-bezier(.22,1,.36,1) 0ms both; }
html.fn-intro-quick.fn-intro-play .fn-intro-fill { animation: fn-fill 320ms cubic-bezier(.45,.05,.25,1) 60ms both; }
html.fn-intro-quick.fn-intro-play .fn-intro-fill-inner { animation: fn-fill-inner 320ms cubic-bezier(.45,.05,.25,1) 60ms both; }
html.fn-intro-quick.fn-intro-play .fn-intro-needle { animation: fn-needle 320ms cubic-bezier(.45,.05,.25,1) 60ms both; }
html.fn-intro-quick.fn-intro-play .fn-intro-crest, html.fn-intro-quick.fn-intro-play .fn-intro-crest-wave,
html.fn-intro-quick.fn-intro-play .fn-intro-sheen { animation: none; opacity: 0; }

/* Fill-today / wait verdict at the top of the price card. */
.card-verdict { display: inline-flex; align-items: center; margin: 6px 0 2px; padding: 5px 12px; border-radius: 999px; font-size: calc(14 * var(--u)); font-weight: 700; line-height: 1.25; }
.card-verdict[data-state="today"] { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--ink); }
.card-verdict[data-state="wait"] { background: color-mix(in srgb, #1f8a4c 16%, transparent); color: #1f6e3d; }
:root[data-theme="dark"] .card-verdict[data-state="wait"] { color: #7fd6a2; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .card-verdict[data-state="wait"] { color: #7fd6a2; } }

/* ---------- Opening sequence (intro.js) ----------
   Brand dark, not black: a warm charcoal that sits under the amber logo.
   The logo is the fuel tank: it appears unlit, then liquid gold rises inside it while a fine
   E-to-F gauge sweeps around it, like an instrument cluster waking up.
   Timeline (after .fn-intro-play): 0.2s unlit logo + dial in, 0.8-1.65s fill + needle sweep,
   1.65s full: halo pulse + sheen, 1.95s reveal. intro.js keeps FILL_* in step with this. */
.fn-intro { display: none; }
html.fn-intro-on:not(.fn-intro-reveal) { background: #14120f; }
html.fn-intro-on .fn-intro {
  --intro-bg: #14120f; --intro-gold: #e0a531; --intro-lit: #f6c869;
  display: grid; place-items: center; position: fixed; inset: 0; z-index: 2147483000;
  background: radial-gradient(120% 80% at 50% 46%, #1c1914 0%, var(--intro-bg) 62%);
  overflow: hidden; touch-action: none; -webkit-user-select: none; user-select: none;
}
.fn-intro-stage { position: relative; width: 96px; height: 96px; margin-top: -24px; }
.fn-intro-logo {
  position: relative; width: 96px; height: 96px; border-radius: 22px; overflow: hidden;
  opacity: 0; transform: scale(.96); background: #1a1712;
  box-shadow: 0 18px 44px #00000073;
  -webkit-mask-image: -webkit-radial-gradient(white, black); /* keeps overflow clipping on iOS during transforms */
}
.fn-intro-logo img { display: block; width: 96px; height: 96px; }
/* Unlit emblem: the same artwork, dark and colourless, under the rising fuel. */
.fn-intro-empty { filter: grayscale(1) sepia(.55) brightness(.26) contrast(1.1); }
.fn-intro-logo::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px #f6c86929; pointer-events: none; }
/* The fill window moves up while its image moves down by the same amount, so the artwork stays put
   and only the waterline rises (transform-only, no clip-path animation). */
.fn-intro-fill { position: absolute; inset: 0; overflow: hidden; transform: translateY(100%); }
.fn-intro-fill-inner { position: absolute; inset: 0; transform: translateY(-100%); }
.fn-intro-fill-inner::after { content: ""; position: absolute; inset: 0 0 auto; height: 14px; background: linear-gradient(#fff3d6a8, #fff3d600); }
.fn-intro svg.fn-intro-crest { position: absolute; left: 0; top: -1px; width: 192px; height: 8px; overflow: visible; fill: none; stroke: #fff1cc; stroke-width: 1.2; opacity: 0; }
.fn-intro-crest-wave { transform: translateX(0); }
.fn-intro-sheen {
  position: absolute; inset: -20% -60%; transform: translateX(-75%);
  background: linear-gradient(105deg, transparent 40%, #fff8e61a 46%, #fff8e68c 50%, #fff8e61a 54%, transparent 60%);
  mix-blend-mode: soft-light; opacity: 0;
}
.fn-intro-halo {
  position: absolute; left: 50%; top: 50%; width: 320px; height: 320px; margin: -160px 0 0 -160px;
  border-radius: 50%; background: radial-gradient(closest-side, #e0a53133, #e0a53112 55%, transparent);
  opacity: 0; transform: scale(.8); pointer-events: none;
}
/* The dial: 270 degrees of fine ticks from E (lower left) to F (lower right), built by intro.js. */
.fn-intro svg.fn-intro-gauge {
  position: absolute; left: 50%; top: 50%; width: 180px; height: 180px; margin: -90px 0 0 -90px;
  overflow: visible; fill: none; stroke-linecap: round; opacity: 0;
}
.fn-intro-tick { stroke: var(--intro-lit); stroke-width: 1; opacity: .16; }
.fn-intro-tick.is-major { stroke-width: 1.4; }
.fn-intro-mark { fill: var(--intro-gold); stroke: none; font: 600 8px/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif; letter-spacing: .08em; text-anchor: middle; opacity: .55; }
.fn-intro-needle { transform-box: fill-box; transform-origin: center; transform: rotate(-135deg); }
.fn-intro-needle line { stroke: var(--intro-lit); stroke-width: 1.4; }
.fn-intro-needle .fn-intro-tip { fill: #fff1cc; stroke: none; filter: drop-shadow(0 0 3px #f6c869) drop-shadow(0 0 7px #e0a531b3); }

html.fn-intro-play .fn-intro-logo { animation: fn-logo-in 700ms cubic-bezier(.16,1,.3,1) 200ms both; }
html.fn-intro-play .fn-intro-gauge { animation: fn-gauge-in 600ms cubic-bezier(.22,1,.36,1) 300ms both; }
html.fn-intro-play .fn-intro-halo { animation: fn-halo 1200ms cubic-bezier(.22,1,.36,1) 200ms both, fn-pulse 700ms ease-out 1650ms forwards; }
html.fn-intro-play .fn-intro-fill { animation: fn-fill 850ms cubic-bezier(.45,.05,.25,1) 800ms both; }
html.fn-intro-play .fn-intro-fill-inner { animation: fn-fill-inner 850ms cubic-bezier(.45,.05,.25,1) 800ms both; }
html.fn-intro-play .fn-intro-crest { animation: fn-crest 1000ms linear 760ms both; }
html.fn-intro-play .fn-intro-crest-wave { animation: fn-wave 620ms linear 760ms infinite; }
html.fn-intro-play .fn-intro-needle { animation: fn-needle 850ms cubic-bezier(.45,.05,.25,1) 800ms both; }
html.fn-intro-play .fn-intro-tick { animation: fn-tick 260ms ease-out both; } /* per-tick delay set by intro.js */
html.fn-intro-play .fn-intro-sheen { animation: fn-sheen 900ms cubic-bezier(.45,.05,.25,1) 1620ms both; }
/* Data still on its way: the full tank glows softly instead of freezing. */
html.fn-intro-wait .fn-intro-halo { animation: fn-breathe 1100ms ease-in-out infinite alternate; }

html.fn-intro-reveal .fn-intro { animation: fn-intro-out 500ms cubic-bezier(.4,0,.2,1) 60ms both; pointer-events: none; }
html.fn-intro-reveal .fn-intro-stage { animation: fn-stage-up 220ms cubic-bezier(.2,.7,.3,1) both; }
.answer-card.fn-rise { animation: fn-rise 640ms cubic-bezier(.16,1,.3,1) 120ms both; }

@keyframes fn-logo-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
@keyframes fn-gauge-in { from { opacity: 0; transform: scale(.94) rotate(-6deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes fn-halo { 0% { opacity: 0; transform: scale(.8); } 70% { opacity: .8; } 100% { opacity: .6; transform: scale(1); } }
@keyframes fn-pulse { 0% { opacity: .6; transform: scale(1); } 30% { opacity: 1; transform: scale(1.08); } 100% { opacity: .8; transform: scale(1.04); } }
@keyframes fn-fill { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes fn-fill-inner { from { transform: translateY(-100%); } to { transform: translateY(0); } }
@keyframes fn-crest { 0% { opacity: 0; } 8%, 80% { opacity: .95; } 100% { opacity: 0; } }
@keyframes fn-wave { from { transform: translateX(0); } to { transform: translateX(-96px); } }
@keyframes fn-needle { from { transform: rotate(-135deg); } to { transform: rotate(135deg); } }
@keyframes fn-tick { from { opacity: .16; } to { opacity: 1; } }
@keyframes fn-sheen { 0% { transform: translateX(-75%); opacity: 0; } 15%, 80% { opacity: 1; } 100% { transform: translateX(75%); opacity: 0; } }
@keyframes fn-breathe { from { opacity: 1; } to { opacity: .5; } }
@keyframes fn-intro-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes fn-stage-up { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(-22px) scale(.97); } }
@keyframes fn-rise { from { opacity: 0; transform: translateY(32px) scale(.985); } to { opacity: 1; transform: none; } }
