/* FuelRamen — warm broth palette, light & dark. */
:root {
  --bg: #fbf7f2;
  --surface: #ffffff;
  --surface-2: #f4ede4;
  --text: #1f1712;
  --muted: #6d5f55;
  --line: #e7dcd0;
  --accent: #e2570f;
  --accent-ink: #ffffff;
  --accent-soft: #fde6d6;
  --good: #1f8a4c;
  --good-soft: #dcf3e5;
  --warn: #9a6a00;
  --warn-soft: #fbefcc;
  --bad: #b3261e;
  --hero-1: #1b1410;
  --hero-2: #3a2216;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(40 20 10 / .06), 0 6px 24px rgb(40 20 10 / .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14100d; --surface: #1d1814; --surface-2: #27201b; --text: #f3ebe3; --muted: #b3a497;
    --line: #362c25; --accent: #ff7a2e; --accent-ink: #1b0f06; --accent-soft: #3a2012;
    --good: #5fd08f; --good-soft: #15321f; --warn: #e8b84a; --warn-soft: #33280f; --bad: #ff8a80;
    --hero-1: #0d0a08; --hero-2: #2a1a10; --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 6px 24px rgb(0 0 0 / .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14100d; --surface: #1d1814; --surface-2: #27201b; --text: #f3ebe3; --muted: #b3a497;
  --line: #362c25; --accent: #ff7a2e; --accent-ink: #1b0f06; --accent-soft: #3a2012;
  --good: #5fd08f; --good-soft: #15321f; --warn: #e8b84a; --warn-soft: #33280f; --bad: #ff8a80;
  --hero-1: #0d0a08; --hero-2: #2a1a10; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1; }
a { color: var(--accent); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 820px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }

/* Header */
.top { background: var(--hero-1); color: #f6ede4; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; font-size: 1.2rem; letter-spacing: -.01em; }
.logo b { color: #ff8a3d; }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a { color: #e9dccf; text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: .95rem; }
.nav a:hover { background: rgb(255 255 255 / .08); }
.nav a[aria-current] { color: #fff; background: rgb(255 255 255 / .12); }
.langs { display: inline-flex; margin-left: 6px; border: 1px solid rgb(255 255 255 / .18); border-radius: 8px; overflow: hidden; }
.langs a { border-radius: 0; padding: 4px 9px; font-size: .8rem; font-weight: 600; }

/* Hero + search */
.hero { background: linear-gradient(160deg, var(--hero-1), var(--hero-2)); color: #f6ede4; padding: 40px 0 36px; }
.hero h1 { font-size: clamp(1.7rem, 4.4vw, 2.7rem); line-height: 1.12; margin: 0 0 8px; letter-spacing: -.02em; max-width: 20ch; }
.hero .sub { margin: 0 0 24px; color: #d8c7b8; max-width: 60ch; }
.search { background: rgb(255 255 255 / .06); border: 1px solid rgb(255 255 255 / .12); border-radius: 18px; padding: 14px; }
.search-row { display: flex; gap: 8px; flex-wrap: wrap; }
.search input[type=search] {
  flex: 1 1 260px; min-width: 0; font: inherit; padding: 12px 14px; border-radius: 12px;
  border: 1px solid transparent; background: #fff; color: #1f1712;
}
.search input[type=search]:focus { outline: 3px solid #ff8a3d; outline-offset: 1px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600;
  padding: 11px 16px; border-radius: 12px; border: 1px solid transparent; cursor: pointer; text-decoration: none;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: #f6ede4; border-color: rgb(255 255 255 / .28); }
.btn.ghost:hover { background: rgb(255 255 255 / .08); }
.btn:disabled { opacity: .6; cursor: progress; }
.view-notfound .btn, .prose .btn { background: var(--accent); color: #fff; }

.chips { border: 0; padding: 0; margin: 14px 0 0; display: flex; gap: 6px; flex-wrap: wrap; }
.chip input, .seg input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block; padding: 6px 12px; border-radius: 999px; font-size: .9rem; cursor: pointer;
  border: 1px solid rgb(255 255 255 / .22); color: #eadbcc;
}
.chip input:checked + span { background: #fff3e6; color: #3a1d0b; border-color: #fff3e6; font-weight: 600; }
.chip input:focus-visible + span, .seg input:focus-visible + span { outline: 2px solid #ff8a3d; outline-offset: 2px; }
.opts { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 12px; font-size: .9rem; color: #d8c7b8; }
.opts select { font: inherit; margin-left: 6px; padding: 5px 8px; border-radius: 8px; border: 1px solid rgb(255 255 255 / .25); background: #2a1d15; color: #fff; }
.seg { display: inline-flex; border: 1px solid rgb(255 255 255 / .25); border-radius: 10px; overflow: hidden; }
.seg span { display: inline-block; padding: 5px 12px; cursor: pointer; }
.seg input:checked + span { background: rgb(255 255 255 / .16); color: #fff; font-weight: 600; }

/* Results */
.results { padding: 24px 16px 40px; }
.notice { padding: 12px 14px; border-radius: 12px; background: var(--warn-soft); color: var(--text); margin-bottom: 16px; border: 1px solid var(--line); }
.notice.err { border-color: var(--bad); }
.notice[hidden] { display: none; }
.notice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.notice span { flex: 1 1 260px; }
.btn.small { padding: 6px 12px; font-size: .9rem; background: var(--accent); color: #fff; border-radius: 10px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.stat .k { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat .v { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat.hi .v { color: var(--good); }
.stat .s { font-size: .82rem; color: var(--muted); }

.split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.map { height: 620px; border-radius: var(--radius); border: 1px solid var(--line); position: sticky; top: 12px; background: var(--surface-2); z-index: 0; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.st {
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
  box-shadow: var(--shadow); cursor: pointer; transition: border-color .15s;
}
.st:hover, .st.active { border-color: var(--accent); }
.st .rank { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 1.6em; padding-top: 2px; }
.st .where { min-width: 0; }
.st .name { font-weight: 650; overflow-wrap: anywhere; }
.st .addr { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.st .price { text-align: right; font-variant-numeric: tabular-nums; }
.st .price b { font-size: 1.35rem; display: block; line-height: 1.1; }
.st .price small { color: var(--muted); font-size: .75rem; }
.st.best .price b { color: var(--good); }
.st .meta { grid-column: 2 / 4; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: .8rem; color: var(--muted); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text); font-size: .76rem; }
.tag.good { background: var(--good-soft); color: var(--good); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { color: var(--bad); }
.tag.cc { font-weight: 700; letter-spacing: .03em; }
.meta a { margin-left: auto; font-weight: 600; text-decoration: none; }
.meta a:hover { text-decoration: underline; }
.meta a.report { margin-left: auto; font-weight: 400; color: var(--muted); }
.meta a.report + a { margin-left: 0; }
.st.is-stale { opacity: .7; }

/* Leaflet price pins */
.pin { background: var(--surface); color: var(--text); border: 2px solid var(--accent); border-radius: 8px; padding: 1px 5px;
  font: 700 12px/1.3 system-ui, sans-serif; white-space: nowrap; box-shadow: 0 2px 6px rgb(0 0 0 / .25); transform: translate(-50%, -100%); display: inline-block; }
.pin.best { background: var(--good); border-color: var(--good); color: #fff; }
.pin.active { background: var(--accent); color: #fff; }
.pin.stale { border-style: dashed; opacity: .75; }
.leaflet-div-icon { background: none; border: 0; }
.leaflet-container { font: inherit; }
.leaflet-popup-content { margin: 10px 12px; }
.me-dot { width: 16px; height: 16px; border-radius: 50%; background: #2f6fed; border: 3px solid #fff; box-shadow: 0 0 0 6px rgb(47 111 237 / .25); }

/* National snapshot */
.snapshot { padding: 28px 16px 8px; }
.snapshot h2 { margin: 0 0 4px; font-size: 1.3rem; }
.snap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 14px 0 8px; }
.snap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.snap h3 { margin: 0 0 4px; font-size: .9rem; color: var(--muted); font-weight: 600; }
.snap p { margin: 0; }
.snap-med b { font-size: 1.45rem; font-variant-numeric: tabular-nums; }
.snap-med small { color: var(--muted); }
.snap-low { font-size: .85rem; color: var(--muted); margin-top: 2px !important; }
.snap-low b { color: var(--good); }
.small { font-size: .82rem; }

/* SEO pages */
.seo h1 { margin-top: .3em; }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px; font-size: .85rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 4px; }
.city-grid { list-style: none; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px 14px; }
.city-grid a { text-decoration: none; }
.city-grid a:hover { text-decoration: underline; }
.all-cities { margin-top: 14px; }
.all-cities summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.prices { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.prices th, table.prices td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.prices tr:last-child td { border-bottom: 0; }
table.prices th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); }
table.prices .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.prices tbody tr:first-child .num b { color: var(--good); }
.country-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 12px; }
.cl { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.cl-name { font-weight: 700; font-size: 1.05rem; text-decoration: none; }
.cl p { margin: 4px 0 0; }

/* Sources page */
.prose { padding: 36px 16px 48px; }
.prose h1 { font-size: clamp(1.6rem, 3.6vw, 2.2rem); line-height: 1.15; letter-spacing: -.02em; }
.prose h2 { margin-top: 2em; font-size: 1.25rem; }
.lead { font-size: 1.08rem; color: var(--muted); }
.cards { display: grid; gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.card header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.card h3 { margin: 0; font-size: 1.05rem; }
.card ul { margin: 10px 0; padding-left: 1.1em; }
.card li { margin: 4px 0; }
.links { display: flex; gap: 14px; flex-wrap: wrap; margin: 0; font-size: .92rem; }
.badge { font-size: .75rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.badge.b-live { background: var(--good-soft); color: var(--good); }
.badge.b-config { background: var(--accent-soft); color: var(--accent); }
.badge.b-third { background: var(--warn-soft); color: var(--warn); }
.checks li { margin: 6px 0; }
pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow-x: auto; font-size: .85rem; }

.notfound { padding: 60px 16px; text-align: center; }
.notfound h1 { font-size: 4rem; margin: 0; color: var(--accent); }

.foot { border-top: 1px solid var(--line); padding: 20px 0 28px; font-size: .85rem; color: var(--muted); }
.foot p { margin: 4px 0; }

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .map { height: 340px; position: relative; top: 0; }
  .hero { padding: 28px 0; }
}
@media (max-width: 480px) {
  .btn.ghost span { display: none; }
  .search-row .btn.primary { flex: 1; }
  .st { grid-template-columns: 1fr auto; }
  .st .rank { display: none; }
  .st .meta { grid-column: 1 / 3; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
