:root {
  --bg: #e8ebee;
  --surface: #fff;
  --ink: #0f1419;
  --muted: #56616c;
  --line: rgba(15, 20, 25, .1);
  --panel: #10161d;
  --panel-ink: #f4f6f8;
  --panel-muted: #a0acb8;
  --panel-line: rgba(255, 255, 255, .12);
  --led: #ffb81c;
  --gain: #5ee391;
  --focus: #0a6cff;
  --skel: rgba(15, 20, 25, .07);
  --font: system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #080b0f;
    --surface: #151b22;
    --ink: #eef1f4;
    --muted: #97a3af;
    --line: rgba(255, 255, 255, .09);
    --panel: #0e141b;
    --focus: #5aa2ff;
    --skel: rgba(255, 255, 255, .07);
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.4 var(--font);
  min-height: 100dvh; overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.app {
  max-width: 480px; margin: 0 auto; min-height: 100dvh;
  padding: calc(8px + var(--sat)) calc(16px + var(--sar)) calc(24px + var(--sab)) calc(16px + var(--sal));
}

/* header */
.bar { display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
.logo { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.logo svg { color: var(--panel); border-radius: 9px; }
@media (prefers-color-scheme: dark) { .logo svg { color: #232d38; } }
.icon {
  width: 48px; height: 48px; margin-right: -8px; border: 0; border-radius: 50%; background: none;
  display: grid; place-items: center; color: var(--ink);
}
.icon:active { background: var(--skel); }
.icon.spin svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.chips { display: flex; gap: 8px; margin: 4px 0 14px; }
.chip {
  flex: 0 1 auto; min-height: 44px; padding: 0 12px 0 14px; border: 1px solid var(--line); border-radius: 22px;
  background: var(--surface); font-weight: 650; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip svg { flex: none; opacity: .5; }
.chip:first-child { flex: 0 1 auto; }
.chip:active { background: var(--skel); }

.where { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -4px 0 12px; color: var(--muted); font-size: 14px; }
.where[hidden] { display: none; }
.where-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link { min-height: 44px; padding: 0 4px; border: 0; background: none; font-weight: 650; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* hero: forecourt price sign */
.hero {
  position: relative; background: var(--panel); color: var(--panel-ink); border-radius: 28px; padding: 20px 20px 20px;
  border: 1px solid var(--panel-line); box-shadow: 0 14px 34px -18px rgba(8, 14, 22, .6);
}
.hero-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; color: var(--led); font-size: 15px; font-weight: 700; }
.hero-top small { color: var(--panel-muted); font-weight: 500; font-size: 13px; text-align: right; }
.brand { margin: 14px 0 0; font-size: 24px; line-height: 1.15; font-weight: 750; letter-spacing: -.015em; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.sub { margin: 2px 0 0; color: var(--panel-muted); font-size: 15px; }
.tag {
  display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border-radius: 12px; font-size: 12.5px; font-weight: 650;
  border: 1px solid var(--panel-line); color: var(--panel-ink); letter-spacing: .005em;
}
.price { display: flex; align-items: baseline; margin: 6px 0 0; color: var(--led); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; text-shadow: 0 0 28px rgba(255, 184, 28, .28); }
.price .big { font-size: clamp(76px, 25vw, 112px); letter-spacing: -.055em; }
.price .third { font-size: clamp(38px, 12.5vw, 56px); letter-spacing: -.04em; margin-left: 2px; align-self: flex-start; margin-top: .12em; }
.price .unit { font-size: 22px; font-weight: 700; letter-spacing: 0; margin-left: 10px; color: var(--panel-muted); text-shadow: none; }
.gain { margin: 12px 0 0; padding: 12px 14px; border-radius: 16px; background: rgba(94, 227, 145, .1); color: var(--panel-ink); font-size: 15.5px; line-height: 1.35; }
.gain b { color: var(--gain); font-weight: 750; }
.gain span { display: block; margin-top: 2px; color: var(--panel-muted); font-size: 14.5px; }
.gain.same { background: rgba(255, 255, 255, .07); }
.gain.same b { color: var(--panel-ink); }
.meta { margin: 14px 0 0; color: var(--panel-muted); font-size: 14.5px; }
.meta b { color: var(--panel-ink); font-weight: 650; }
.meta .warn { color: #fbbf24; font-weight: 600; }
.go {
  display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 16px; min-height: 60px; border-radius: 20px;
  background: #fff; color: #0f1419; font-size: 19px; font-weight: 750; text-decoration: none; letter-spacing: -.01em;
}
.go:active { transform: scale(.985); background: #e6eaee; }
.go:focus-visible { outline-color: var(--led); }

/* sections */
.sec { margin: 26px 0 0; }
.sec h2 { margin: 0 4px 8px; font-size: 20px; font-weight: 750; letter-spacing: -.015em; }
.list { margin: 0; padding: 0; list-style: none; background: var(--surface); border-radius: 22px; border: 1px solid var(--line); overflow: hidden; }
.list li + li { border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 10px 16px; text-decoration: none; }
.row:active { background: var(--skel); }
.row .p { flex: none; min-width: 74px; font-size: 24px; font-weight: 780; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.row .pv { display: block; }
.row .p small { font-size: .55em; letter-spacing: -.02em; vertical-align: .62em; margin-left: 1px; }
.row .pm { display: block; margin-top: 4px; color: var(--muted); font-size: 12.5px; font-weight: 600; letter-spacing: 0; }
.row .m { flex: 1 1 auto; min-width: 0; }
.row .t { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 16px; }
.row .t span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .a { display: block; margin-top: 1px; color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .d { flex: none; color: var(--muted); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 2px; }
.row .d svg { opacity: .55; }
.list .tag, .row .tag { border-color: var(--line); color: var(--muted); min-height: 22px; font-size: 12px; padding: 0 8px; flex: none; }
.near-note { margin: 18px 4px 6px; color: var(--muted); font-size: 14px; }

/* map */
.map {
  position: relative; height: 190px; margin-top: 26px; border-radius: 22px; overflow: hidden; background: var(--skel);
  border: 1px solid var(--line); isolation: isolate;
}
.map .leaflet-container { height: 100%; background: transparent; font: inherit; }
.pinw { background: none; border: 0; }
.pinw > div { transform: translate(-50%, -50%); }
.mk { display: inline-block; padding: 4px 9px; border-radius: 14px; font: 800 14px/1.1 var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
.mk.best { background: var(--panel); color: var(--led); border: 2px solid var(--led); font-size: 15px; }
.mk.near { background: #fff; color: #0f1419; }
.me { width: 18px; height: 18px; border-radius: 50%; background: var(--focus); border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(10, 108, 255, .25); }

/* states */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 26px; padding: 22px 20px; }
.card h2 { margin: 0 0 6px; font-size: 22px; line-height: 1.2; font-weight: 750; letter-spacing: -.02em; }
.card p { margin: 0; color: var(--muted); }
.card .btns { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.btn {
  display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 20px; border-radius: 16px; border: 0;
  background: var(--ink); color: var(--bg); font-weight: 700; font-size: 17px;
}
.btn.ghost { background: var(--skel); color: var(--ink); }
.btn:active { opacity: .85; }
.search { display: flex; gap: 8px; margin-top: 16px; }
.search input {
  flex: 1; min-width: 0; min-height: 52px; padding: 0 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--bg);
  font-size: 17px; -webkit-appearance: none; appearance: none;
}
.search input::placeholder { color: var(--muted); opacity: .85; }
.search .btn { min-height: 52px; padding: 0 18px; }
.err-t { margin-top: 10px !important; color: var(--ink) !important; font-size: 15px; }
.busy { display: flex; align-items: center; gap: 12px; margin: 0 4px 14px; color: var(--muted); font-size: 15px; }
.dot { width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid var(--skel); border-top-color: var(--ink); animation: spin .8s linear infinite; }
.sk { border-radius: 28px; background: var(--panel); height: 400px; position: relative; overflow: hidden; border: 1px solid var(--panel-line); }
.sk::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .06) 50%, transparent 80%); animation: shim 1.4s infinite; }
@keyframes shim { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* info */
.info { margin: 30px 4px 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.info p { margin: 0 0 8px; }
.info .priv { color: var(--ink); font-weight: 550; }
.info a { text-underline-offset: 2px; }
.info[hidden] { display: none; }

/* bottom sheet */
.scrim { position: fixed; inset: 0; background: rgba(5, 8, 12, .5); opacity: 0; visibility: hidden; transition: opacity .25s, visibility 0s .25s; z-index: 20; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-width: 480px; margin: 0 auto; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 28px 28px 0 0; padding: 8px calc(18px + var(--sar)) calc(18px + var(--sab)) calc(18px + var(--sal));
  transform: translateY(105%); visibility: hidden; transition: transform .3s cubic-bezier(.2, .8, .2, 1), visibility 0s .3s;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .25);
}
body.sheet-open .scrim { opacity: 1; visibility: visible; transition: opacity .25s; }
body.sheet-open .sheet { transform: none; visibility: visible; transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
body.sheet-open { overflow: hidden; }
.grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 6px; filter: contrast(2); }
.sheet h2:focus { outline: none; }
.sheet h2 { margin: 6px 0 10px; font-size: 24px; font-weight: 780; letter-spacing: -.02em; }
fieldset { border: 0; margin: 0 0 16px; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 8px; color: var(--muted); font-size: 14px; font-weight: 600; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--line); background: var(--bg); font-weight: 650; font-size: 16px;
}
.pill[aria-checked="true"], .seg button[aria-checked="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pill.more { background: none; border-style: dashed; color: var(--muted); }
.stepper { display: flex; align-items: center; margin-top: 10px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); }
.stepper button { width: 56px; height: 52px; border: 0; background: none; display: grid; place-items: center; border-radius: 16px; }
.stepper button:active { background: var(--skel); }
.stepper button:disabled { opacity: .3; }
.stepper output { flex: 1; text-align: center; font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 16px; background: var(--bg); border: 1px solid var(--line); }
.seg button { min-height: 44px; border: 0; border-radius: 12px; background: none; font-weight: 650; font-size: 16px; }
.cta { width: 100%; min-height: 56px; border: 0; border-radius: 18px; background: var(--ink); color: var(--bg); font-size: 18px; font-weight: 750; margin-top: 4px; }
.cta:active { opacity: .85; }
@media (prefers-color-scheme: dark) { .grip { background: rgba(255, 255, 255, .25); filter: none; } }

@media (max-width: 359px) { .chip { padding: 0 10px; font-size: 14px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}
