:root {
  --bg: #f8f7f2;
  --surface: #ffffff;
  --ink: #1c1f1a;
  --ink-2: #4a4f46;
  --muted: #80857b;
  --line: #e2e0d8;
  --accent: #1a5e2c;
  --accent-soft: #e3f1dc;
  --land: #e9e7e0;
  --sea: #f8f7f2;
  --supermarket: #1a5e2c;
  --online: #86c276;
  --walk_in: #d9a441;
  --none: #d6d4ce;
  --radius: 10px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Charter, Georgia, serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--sans);
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin: 0 0 0.4em; }
h2 { font-size: 1.6rem; margin: 2.2em 0 0.4em; }
h3 { font-size: 1.15rem; margin: 0 0 0.6em; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 0.9rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.brand { font-family: var(--serif); font-weight: 700; font-size: 1.2rem; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 0.55rem; letter-spacing: -0.01em; }
.brand-mark { width: 1.9rem; height: 1.9rem; flex: none; }
.wordmark-tld { color: var(--accent); font-weight: 600; }
.top nav { display: flex; gap: 1.2rem; font-size: 0.95rem; }
.top nav a { color: var(--ink-2); text-decoration: none; }
.top nav a:hover { color: var(--accent); }

main { max-width: 1180px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem) 4rem; }
footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 0.9rem; padding: 1.5rem clamp(1rem, 4vw, 2.5rem) 3rem; max-width: 1180px; margin: 0 auto; }

.hero { padding: 3rem 0 1rem; max-width: 52rem; }
.lede { font-size: 1.12rem; color: var(--ink-2); }
.section-lede { color: var(--ink-2); max-width: 52rem; margin-top: 0; }

/* Maps */
.map-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem 2rem; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; padding: 0; margin: 0; font-size: 0.85rem; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 0.35rem; }
.swatch { display: inline-block; width: 0.95rem; height: 0.95rem; border-radius: 3px; vertical-align: -2px; }
.swatch-none { background: var(--land); outline: 1px solid var(--line); }
.map-frame { margin: 1rem 0 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.map-frame figcaption { font-size: 0.85rem; color: var(--muted); padding: 0.5rem 1rem 0.7rem; border-top: 1px solid var(--line); }
.map { display: block; width: 100%; height: auto; }
.map .sea { fill: var(--sea); }
.map .land path { fill: var(--land); stroke: var(--surface); stroke-width: 0.6; }
.map .painted path, .map .markers circle { stroke: var(--surface); stroke-width: 0.8; fill-rule: evenodd; transition: filter 0.12s; }
.map .land path { fill-rule: evenodd; }
.map .markers circle { stroke: var(--ink-2); stroke-width: 1; }
.map a:hover path, .map a:focus path, .map a:hover circle, .map a:focus circle { stroke: var(--ink); stroke-width: 1.6; filter: brightness(1.06); }
.map a:focus { outline: none; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
th, td { text-align: left; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; background: var(--bg); white-space: nowrap; }
tbody tr:last-child > * { border-bottom: 0; }
.num { text-align: right; white-space: nowrap; }
.ranking th[scope="row"] { font-weight: 600; }
.ranking th[scope="row"] a { color: var(--ink); text-decoration: none; }
.ranking th[scope="row"] a:hover { color: var(--accent); text-decoration: underline; }
.ranking tbody tr:hover { background: #fbfaf6; }
.cat-cell { white-space: nowrap; }
.score { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700; }
.score-swatch { width: 0.8rem; height: 0.8rem; border-radius: 3px; background: var(--fill); }

.chip-dot { display: inline-block; width: 0.6rem; height: 0.6rem; border-radius: 50%; margin-right: 0.35rem; vertical-align: 0; background: var(--none); }
.chip-dot.chip-supermarket, .chip-supermarket .chip-dot { background: var(--supermarket); }
.chip-dot.chip-online, .chip-online .chip-dot { background: var(--online); }
.chip-dot.chip-walk_in, .chip-walk_in .chip-dot { background: var(--walk_in); }
.chip-dot.chip-none, .chip-none .chip-dot { background: var(--none); }
.chip { font-size: 0.82rem; color: var(--ink-2); white-space: nowrap; }
.key { display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; font-size: 0.85rem; color: var(--ink-2); }

/* Leaderboards */
.leaders { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; }
.leader { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.leader ol { margin: 0; padding: 0; list-style: none; }
.leader li { display: grid; grid-template-columns: 3.2rem 1fr; column-gap: 0.5rem; padding: 0.45rem 0; border-top: 1px solid var(--line); }
.leader li:first-child { border-top: 0; }
.leader-pct { grid-row: span 2; font-weight: 700; font-size: 1.05rem; color: var(--accent); }
.leader-name { font-weight: 600; font-size: 0.93rem; line-height: 1.3; }
.leader-meta { font-size: 0.82rem; color: var(--muted); }

/* Country page */
.crumbs { font-size: 0.88rem; color: var(--muted); padding-top: 1.5rem; }
.country-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem 2rem; flex-wrap: wrap; padding-top: 0.5rem; }
.meta { color: var(--muted); margin: 0; font-size: 0.92rem; }
.big-score { display: flex; align-items: baseline; gap: 0.5rem; padding: 0.6rem 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); border-left: 8px solid var(--fill); }
.big-score-num { font-family: var(--serif); font-size: 2.4rem; font-weight: 700; line-height: 1; }
.big-score-of { color: var(--muted); font-size: 0.9rem; }
.summary { font-size: 1.08rem; max-width: 52rem; margin-top: 1.2rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.8rem; margin-top: 1.2rem; }
.card { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.9rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; }
.card:hover { border-color: var(--accent); }
.card-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 600; }
.card-pct { font-family: var(--serif); font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.card-meta { font-size: 0.8rem; color: var(--muted); }
.order-plan, .notes, .ruled-out { max-width: 52rem; }
.notes { color: var(--ink-2); }
.category { scroll-margin-top: 1rem; }

.products td { font-size: 0.9rem; }
.products .product { min-width: 15rem; }
.pname { display: block; font-weight: 600; line-height: 1.3; }
.brand-name { color: var(--ink-2); font-weight: 500; }
.pmeta { display: block; font-size: 0.8rem; color: var(--muted); }
.pnote { display: block; font-size: 0.82rem; color: var(--ink-2); margin-top: 0.15rem; }
.dispatch { display: block; font-size: 0.78rem; color: var(--ink-2); margin-top: 0.15rem; }
.dispatch-import { font-weight: 500; }
.dispatch a { font-size: 0.72rem; font-weight: 400; }
.brand-details { margin: 0.2rem 0; font-size: 0.78rem; }
.brand-details summary { color: var(--accent); cursor: pointer; }
.brand-details ul { padding-left: 1.2rem; margin: 0.3rem 0; }
.brand-highlight summary { width: fit-content; padding: 0.1rem 0.35rem; border-radius: 4px; background: var(--accent-soft); font-weight: 600; }
.offers { min-width: 11rem; }
.offer { display: block; }
.offer-best { font-weight: 600; }
.kind { font-size: 0.72rem; color: var(--muted); font-weight: 400; border: 1px solid var(--line); border-radius: 4px; padding: 0 0.3rem; white-space: nowrap; }
.macros { font-size: 0.8rem; color: var(--ink-2); min-width: 10rem; }
.src { font-size: 0.75rem; }
tr.dim td { color: var(--muted); }
tr.dim .pname, tr.dim strong { color: var(--muted); font-weight: 500; }
.tag { display: inline-block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.05rem 0.4rem; border-radius: 4px; margin: 0 0.25rem 0.2rem 0; }
.tag-top { background: var(--accent); color: #fff; }
.tag-sm { background: var(--accent-soft); color: var(--accent); }
.tag-value { background: #f6ead0; color: #7a5410; }
.empty { color: var(--muted); font-style: italic; }
details.excluded { margin-top: 0.8rem; font-size: 0.9rem; color: var(--ink-2); }
details.excluded summary { cursor: pointer; color: var(--muted); }
details.excluded ul { margin: 0.5rem 0 0; padding-left: 1.2rem; }
details.excluded li { margin-bottom: 0.35rem; }
.shops dl { display: grid; grid-template-columns: minmax(10rem, 16rem) 1fr; gap: 0.5rem 1.5rem; font-size: 0.92rem; }
.shops dt { font-weight: 600; }
.shops dt .kind { margin-left: 0.3rem; }
.shops dd { margin: 0; color: var(--ink-2); }

.prose { max-width: 46rem; padding-top: 2rem; }
table.plain { border: 1px solid var(--line); background: var(--surface); }

@media (max-width: 640px) {
  .shops dl { grid-template-columns: 1fr; }
  .shops dd { margin-bottom: 0.6rem; }
  .top nav { gap: 0.8rem; }
}
.cat-context { color: var(--muted); font-size: 0.88rem; margin-top: -0.2rem; }
.tag-serious { background: #134820; color: #fff; }
.card-pct small { font-size: 0.9rem; color: var(--muted); font-weight: 400; margin-left: 0.15rem; }
