: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%;
}

* { 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; }
body.dialog-open { 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: 18px; letter-spacing: -.5px; font-weight: 700; line-height: 1.2; }
.demo-badge { font-size: 11px; line-height: 1.3; color: var(--muted); margin-top: 3px; }
.header-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.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: 12px; font-weight: 600; border-radius: 22px; }
.settings-button { white-space: nowrap; background: var(--paper); border: 1px solid var(--line); padding: 0 12px; }
.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: 17px; 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: 14px; }
@media (hover: hover) {
  .button-quiet:hover { background: var(--blue-wash); }
}
.button-quiet svg { width: 18px; height: 18px; }
.notice { font-size: 12px; 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: 13px; }
@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: 12px; 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: 22px; font-weight: 700; letter-spacing: -.5px; line-height: 1.2; }
.hero-advice-reason { margin-top: 7px; font-size: 14px; color: var(--muted); }
.hero-advice-footnote { margin-top: 10px; font-size: 11px; 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; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-advice-enter { animation: none; }
}
.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: 12px; 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: 12px; font-weight: 500; overflow-wrap: anywhere; }
.fuel-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; 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: 26px; 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: 12px; 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(64px, 19.5vw, 82px); letter-spacing: -4px; line-height: 1.04; font-weight: 700; font-variant-numeric: tabular-nums; }
.price-line > span { font-size: 17px; color: var(--muted); font-weight: 500; }
.price-date { display: flex; align-items: center; gap: 5px; font-size: 11px; 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: 11px; margin-bottom: 5px; }
.metric-label svg { width: 15px; height: 15px; }
.station-metrics strong { display: block; font-size: 22px; 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: 11px; color: var(--muted); margin-top: 10px; line-height: 1.4; }
.restriction { font-size: 12px; 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: 11px; }
.card-source a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.pump-check { font-size: 10px; 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: 13px; 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: 15px; 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: 11px; 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: 16px; color: var(--ink); }
.alternative-restriction { font-size: 11px; color: var(--warn); margin-top: 7px; overflow-wrap: anywhere; }
.freshness { font-size: 10px; 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: 10px; 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: 10px; font-weight: 600; letter-spacing: 1.2px; }
.welcome-panel h2 { font-size: 32px; line-height: 1.13; letter-spacing: -1.1px; margin-top: 12px; font-weight: 700; }
#welcome-title { white-space: pre-line; }
.intro { font-size: 14px; 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: 12px; font-weight: 400; color: var(--muted); margin: 9px 0 14px; line-height: 1.5; }
.message { font-size: 13px; 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: 23px; line-height: 1.2; letter-spacing: -.5px; }
.empty-state p { color: var(--muted); font-size: 14px; 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: 13px; }
.setup-panel h2 { font-size: 31px; line-height: 1.15; font-weight: 700; letter-spacing: -.9px; }
.setup-panel h2:focus { outline: none; }
.setup-subtitle { color: var(--muted); font-size: 13px; 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: 10px; 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: 12px; 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: 12px; 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: 12px; 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: 12px; }
.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: 13px; 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: 16px; }
input::placeholder { color: var(--muted); }
label { display: block; font-weight: 500; font-size: 13px; 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: 25px; 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: 13px; 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: 12px; 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: 12px; }
.brand-fieldset { padding: 0; border: 0; margin: 0 0 24px; min-width: 0; }
.brand-fieldset legend { font-weight: 600; font-size: 13px; padding: 0; }
.brand-fieldset .field-help { font-size: 11px; margin-top: 6px; }
.brand-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.brand-options > p { font-size: 12px; 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: 12px; 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: 28px; }
  .welcome-panel { padding: 38px 30px 23px; }
  .welcome-panel h2 { font-size: 36px; }
  .setup-panel { padding: 20px 28px 28px; }
  .setup-panel h2 { font-size: 34px; }
}

@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: 16px; }
  .language-button { padding-right: 4px; padding-left: 4px; }
  .answer-card { padding: 18px; }
  .answer-card h2 { font-size: 24px; }
  .station-metrics { gap: 10px; }
  .saving-block { padding-left: 12px; }
  .station-metrics strong { font-size: 20px; }
  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: 11px; }
}

@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: 13px; 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: 23px; letter-spacing: -.6px; line-height: 1.15; }
.station-address {
  display: block; max-width: 100%; margin-top: 4px; font-size: 12px; 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(64px, 19.5vw, 82px); }
.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: 11px; 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: 11px;
}
.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: 21px; 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: 12px; }
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: 10px; 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: 11px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.price-day-label { color: var(--muted); font-size: 11px; line-height: 1.3; margin-top: 0; }
.saving-basis { margin-top: 2px; font-size: 11px; 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: 11px; 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: 11px; 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: 11px; 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: 12px; 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: 13px; 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: 11px; 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: 12px; 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: 12px; 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: 11px; }
.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(54px, 19vw, 64px); }
  .answer-card { padding: 18px; }
  .header-saved { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  #tomorrow-alert-toggle::before { transition: none; }
}

/* 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: 12px; vertical-align: middle; }
.glv-credit { font-size: 11px; 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: 11px; 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: 12px; }
.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: 17px; font-weight: 700; line-height: 1.3; }
.about-content h3 { font-size: 13px; font-weight: 650; line-height: 1.4; margin-top: 9px; }
.about-content p { font-size: 13px; line-height: 1.55; color: var(--muted); overflow-wrap: anywhere; }
.about-source { display: inline-block; font-size: 12px; 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: 12px; 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: 14px; 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: 10px; text-anchor: middle; }
.pattern-headline { margin: 10px 0; font-size: 14px; 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: 11px; }
.pattern-range { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; 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: 12px; line-height: 1.5; }
.pattern-card details p { margin: 0 0 8px; }
.pattern-meta { color: var(--muted); font-size: 11px; 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); }
.alternative-heading h3 { flex: 1; min-width: 0; }
.favourite-line { display: flex; align-items: center; gap: 6px; margin: 10px 4px; font-size: 12px; 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: 12px; 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: 13px; 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: 12px; 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; } }

@media (prefers-reduced-motion: reduce) {
  button, .button, .brand-chip, .brand-choice, .fuel-segments label, .maps-options label,
  .setup-fuel-tile, .diff-metric > svg, #tomorrow-alert-toggle::before,
  .brand-checkbox path, .brand-checkbox input:checked + svg path,
  .favourite-button svg, .favourite-button[aria-pressed="true"] svg, .price-enter, .price-exit,
  .skeleton-bar::after, .save-pulse, #settings-dialog[open], #settings-dialog.sheet-closing,
  #settings-dialog[open]::backdrop, #settings-dialog.sheet-closing::backdrop,
  #install-sheet[open], #install-sheet.sheet-closing, #install-sheet.sheet-dragging,
  #install-sheet[open]::backdrop, #install-sheet.sheet-closing::backdrop { animation: none !important; transition: none !important; }
  #install-sheet.sheet-dragging { transform: none !important; }
  .brand-checkbox path { stroke-dashoffset: 0; }
  .price-exit { display: none; }
  .press, .press.is-pressed { transform: none !important; transition: none !important; animation: none !important; }

}

/* 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: 11px; 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: 12px; 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: 16px; 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: 16px; 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: 14px; }
.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: 20px; }
.header-sub { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-bottom: 8px; }
.tagline { font-size: 14px; 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: 14px; font-weight: 600; line-height: 1.3; white-space: nowrap; }
.location-strip { justify-content: flex-start; min-height: 44px; margin-bottom: 4px; padding: 6px 0; border: 0; border-radius: 0; background: transparent; font-size: 15px; }
.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: 14px; font-weight: 600; line-height: 1.3; }
.best-label svg { width: 16px; height: 16px; }
.answer-card h2 { font-size: 22px; letter-spacing: -.4px; line-height: 1.25; }
.station-address { white-space: normal; overflow: visible; text-overflow: clip; font-size: 14px; }
.price-block { margin-top: 18px; }
.price-line { gap: 6px; }
.price-line strong { font-size: 48px; letter-spacing: -1.5px; line-height: 1.04; }
.price-line > span { font-size: 17px; }
.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: 15px; font-weight: 500; }
.core-metrics .icon-metric > svg { width: 17px; height: 17px; }
.saving-metric { margin-top: 14px; font-size: 20px; line-height: 1.3; }
.saving-basis { margin-top: 2px; font-size: 15px; 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: 18px; font-weight: 700; }
#maps-link.button-primary:hover { background: var(--button-hover); }
.setting-note { font-size: 14px; 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: 15px; 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: 15px; color: var(--muted); }
.why-rows dd { margin: 0; font-size: 15px; 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: 14px; 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: 15px; 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: 15px; }

/* 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: 16px; letter-spacing: 0; line-height: 1.35; }
.hero-advice-reason { margin-top: 2px; font-size: 15px; }
.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: 15px; 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: 15px; }
.device-prompt, .footer-meta, .legal-note { font-size: 13px; }
@media (max-width: 359px) {
  .answer-card { padding: 20px; }
  .price-line strong { font-size: 44px; }
  .header-saved { font-size: 13px; }
}
@media (forced-colors: active) {
  .header-saved, .map-toggle { border-color: CanvasText; }
}

/* ===== 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 { font-size: 13px; }
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"] .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"] .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 { font-size: 15px; }
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 ===== */

/* ===== v51 fix3: contrast / touch / CJK line-height (CSS only) ===== */
/* Disabled "Filled here": no opacity dimming; muted token is >=4.5 on paper in light and dark. */
.filled-button:disabled { opacity: 1; color: var(--muted); }
/* Hit areas >= 44px without layout shift. */
.footer-meta a, .dialog-about-link { min-width: 44px; justify-content: center; }
.about-content p a.press { display: inline-block; min-height: 44px; min-width: 44px; padding: 11px 0; box-sizing: border-box; }
.alternative-item > a.press { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
html[lang="zh-Hans"] .alternative-item h3, html[lang="zh-Hans"] .about-content h3 { line-height: 1.5; }

/* CJK station names (lang set in app.js setName) keep line-height >= 1.5 */
.answer-card h2[lang="zh-Hans"], .alternative-item h3[lang="zh-Hans"] { line-height: 1.5; }

/* Marketing / store discovery (LitreLess rename, 2026-11-15) */
.formerly-name { margin: 1px 0 0; font-size: 11px; line-height: 1.2; font-weight: 400; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.store-cta { display: flex; justify-content: center; margin: 4px 0 2px; }
.store-cta a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 8px; color: var(--link); font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* SA adds one fuel to the existing native controls and legal text treatment. */
#settings-dialog[data-price-state="SA"] .fuel-segments label:nth-child(n+5) { grid-column: span 3; }
.sa-only { overflow-wrap: anywhere; }
#settings-dialog[data-price-state="SA"] .fuel-segments span { white-space: normal; overflow-wrap: anywhere; }

/* SA sources have four separate rows; leave the WA legal layout unchanged. */
.legal-note > [data-sa-legal] { display: grid; gap: 4px; line-height: 1.5; min-width: 0; }
.legal-note > [data-sa-legal] > span { display: block; }
.legal-note > [data-sa-legal] a { display: flex; align-items: center; min-height: 44px; padding: 0; }
