:root {
  --bg: #ece8e1;
  --bg-2: #e0dbd2;
  --card: #f7f4ee;
  --ink: #141a1e;
  --muted: #5a6770;
  --teal: #0a4f5c;
  --cyan: #0f9ea0;
  --line: #cfc8bc;
  --danger: #b42318;
  --warn: #b54708;
  --ok: #027a48;
  --radius: 4px;
  --max: 1100px;
  --font: "Libre Baskerville", "Georgia", serif;
  --sans: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --header-bg: rgba(236, 232, 225, 0.92);
  --hero-overlay: linear-gradient(100deg, rgba(20,26,30,0.78) 0%, rgba(20,26,30,0.45) 48%, rgba(20,26,30,0.15) 100%);
  --hero-ink: #f4f7f8;
  --hero-muted: #c5d0d4;
}

html[data-theme="dark"] {
  --bg: #0c1014;
  --bg-2: #141a20;
  --card: #1a222a;
  --ink: #e7eef1;
  --muted: #93a4ad;
  --teal: #3dd6d8;
  --cyan: #7aeff0;
  --line: #2a343e;
  --danger: #ff6b6b;
  --warn: #ffb020;
  --ok: #3ddc97;
  --header-bg: rgba(12, 16, 20, 0.9);
  --hero-overlay: linear-gradient(100deg, rgba(8,12,16,0.88) 0%, rgba(8,12,16,0.55) 50%, rgba(8,12,16,0.25) 100%);
  --hero-ink: #f2f6f7;
  --hero-muted: #aebbc2;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background:
    radial-gradient(900px 420px at 0% 0%, rgba(15, 158, 160, 0.07), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.55;
}
html[data-theme="dark"] body {
  background:
    radial-gradient(800px 380px at 0% 0%, rgba(61, 214, 216, 0.08), transparent 55%),
    linear-gradient(180deg, #0a0e12, #121820);
}
a { color: var(--teal); text-underline-offset: 2px; }
a:hover { color: var(--cyan); }
img { max-width: 100%; display: block; }

.wrap { width: min(var(--max), calc(100% - 1.25rem)); margin-inline: auto; }
@media (min-width: 720px) {
  .wrap { width: min(var(--max), calc(100% - 2rem)); }
}

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.65rem; padding: 0.55rem 0;
  position: relative;
  flex-wrap: nowrap;
}
.brand {
  display: inline-flex; align-items: center; text-decoration: none;
  flex: 0 1 auto; min-width: 0; max-width: calc(100% - 8.5rem);
}
.brand img {
  height: 34px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}
.brand .logo-dark { display: none; }
html[data-theme="dark"] .brand .logo-light { display: none; }
html[data-theme="dark"] .brand .logo-dark { display: block; }

.header-actions {
  display: inline-flex; align-items: center; gap: 0.35rem;
  flex: 0 0 auto; margin-left: auto;
}

.nav-toggle {
  display: inline-grid; place-items: center;
  width: 2.35rem; height: 2.35rem;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--ink);
  cursor: pointer; padding: 0;
}
.nav-toggle:hover { border-color: var(--teal); }
.burger,
.burger::before,
.burger::after {
  display: block; width: 1.05rem; height: 2px;
  background: currentColor; border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
  position: relative;
}
.burger::before,
.burger::after {
  content: ""; position: absolute; left: 0;
}
.burger::before { top: -6px; }
.burger::after { top: 6px; }
body.nav-open .burger { background: transparent; }
body.nav-open .burger::before { top: 0; transform: rotate(45deg); }
body.nav-open .burger::after { top: 0; transform: rotate(-45deg); }

.nav {
  display: flex; flex-wrap: wrap; gap: 0.2rem 0.9rem; align-items: center;
}
.nav a {
  color: var(--muted); font-size: 0.9rem; font-weight: 600;
  text-decoration: none;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--teal); }

/* Mobile: collapsible panel */
@media (max-width: 860px) {
  .nav-toggle { display: inline-grid; }
  .nav {
    display: none;
    position: absolute;
    left: 0; right: 0; top: calc(100% + 1px);
    flex-direction: column; align-items: stretch;
    gap: 0;
    padding: 0.35rem 0 0.55rem;
    background: var(--header-bg);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
    box-shadow: 0 14px 28px rgba(0,0,0,0.12);
    max-height: min(70vh, 420px);
    overflow-y: auto;
  }
  body.nav-open .nav { display: flex; }
  .nav a {
    padding: 0.85rem 0.15rem;
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
  }
  .nav a:last-child { border-bottom: 0; }
  body.nav-open { overflow: hidden; }
}
@media (min-width: 861px) {
  .nav-toggle { display: none; }
  .header-inner { gap: 1rem; }
  .brand { max-width: none; }
  .brand img { height: 36px; }
  .nav {
    display: flex !important;
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    margin-left: 0.5rem;
    padding: 0;
    border: 0; box-shadow: none; max-height: none; overflow: visible;
    background: transparent;
  }
  .header-actions { order: 3; margin-left: 0.35rem; }
  .nav { order: 2; margin-left: auto; }
  .brand { order: 1; }
}

.lang-toggle, .theme-toggle {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; width: 2.35rem; height: 2.35rem;
  display: inline-grid; place-items: center;
  cursor: pointer; font-weight: 700; font-size: 0.72rem;
  padding: 0; line-height: 1;
  flex: 0 0 auto;
}
.theme-toggle {
  font-size: 1.05rem;
  border: 1px solid var(--line);
}
.theme-toggle:hover, .lang-toggle:hover { border-color: var(--teal); }
.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }

.hero-banner {
  position: relative;
  min-height: clamp(320px, 52vw, 520px);
  background: #1a2226 center/cover no-repeat;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.15rem;
  background-attachment: scroll;
  image-rendering: auto;
}
@media (min-width: 900px) {
  .hero-banner { background-attachment: scroll; }
}
.hero-banner::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--hero-overlay);
}
.hero-banner::after {
  content: "";
  position: absolute; inset: auto 0 0 0; height: 90px;
  background: linear-gradient(0deg, var(--bg), transparent);
  pointer-events: none;
}
.hero-banner .wrap {
  position: relative; z-index: 1;
  padding: 2.6rem 0 2rem;
}
.hero h1 {
  font-family: var(--font);
  font-size: clamp(1.9rem, 4.6vw, 2.9rem);
  line-height: 1.12; font-weight: 700; max-width: 15ch;
  color: var(--hero-ink);
  text-shadow: 0 2px 18px rgba(0,0,0,0.35);
}
.hero h1 em { font-style: normal; color: var(--cyan); }
.hero p {
  margin-top: 0.85rem; color: var(--hero-muted);
  max-width: 42ch; font-size: 1.05rem;
}

.counters-bar { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1.35rem; }
.counter-box {
  min-width: 140px; padding: 0.35rem 0.2rem 0.35rem 0.85rem;
  border-left: 3px solid var(--cyan);
  background: rgba(0,0,0,0.22);
  backdrop-filter: blur(4px);
}
.counter-box .muted { font-size: 0.75rem; color: var(--hero-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.counter-box .n {
  font-family: var(--font); font-size: 1.85rem; font-weight: 700;
  color: var(--hero-ink); font-variant-numeric: tabular-nums;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem;
  margin-bottom: 1rem;
}
.search-row { display: grid; gap: 0.6rem; grid-template-columns: 1fr auto auto; }
@media (max-width: 720px) { .search-row { grid-template-columns: 1fr; } }

input[type="search"], input[type="text"] {
  width: 100%; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); padding: 0.75rem 0.9rem; font-size: 1rem;
  font-family: var(--sans);
}
button, .btn {
  border: 0; border-radius: var(--radius); padding: 0.75rem 1rem; font-weight: 700;
  cursor: pointer; font-size: 0.92rem; font-family: var(--sans);
}
.btn-primary { background: var(--teal); color: #fff; }
html[data-theme="dark"] .btn-primary { color: #0b1216; }
.btn-ghost { background: transparent; color: var(--teal); border: 1px solid var(--line); }

.layout {
  display: grid; gap: 1rem;
  grid-template-columns: 1.15fr 0.85fr;
  padding-bottom: 2rem;
  align-items: stretch;
}
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }

.results-pane {
  display: flex; flex-direction: column;
  min-height: 0;
  max-height: min(58vh, 520px);
}
.results-pane .list-head { flex: 0 0 auto; }
#results {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.25rem;
  scrollbar-width: thin;
}
#results::-webkit-scrollbar { width: 8px; }
#results::-webkit-scrollbar-thumb {
  background: var(--line); border-radius: 99px;
}

#map {
  height: min(58vh, 520px);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--bg-2);
  z-index: 1;
  overflow: hidden;
}
html[data-theme="dark"] #map .leaflet-tile-pane {
  filter: invert(0.88) hue-rotate(175deg) brightness(0.95) contrast(0.92) saturate(0.85);
}

.map-legend {
  position: absolute; z-index: 500; left: 10px; bottom: 10px;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 0.45rem 0.55rem; backdrop-filter: blur(6px);
  font-size: 0.68rem; color: var(--muted); font-weight: 700;
  display: grid; gap: 0.25rem; pointer-events: none;
}
.map-wrap { position: relative; }
.map-legend .row { display: flex; align-items: center; gap: 0.35rem; }
.map-legend i {
  width: 10px; height: 10px; border-radius: 50%; display: inline-block;
  border: 1px solid rgba(0,0,0,0.15);
}
.map-legend .l0 { background: #98a2b3; }
.map-legend .l1 { background: #0ba5ec; }
.map-legend .l2 { background: #f79009; }
.map-legend .l3 { background: #f04438; }
.map-legend .l4 { background: #d92d20; }

.search-wrap { position: relative; }
.suggest-box {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(0,0,0,0.12); display: none; overflow: hidden;
}
.suggest-box.open { display: block; }
.suggest-box button {
  display: block; width: 100%; text-align: left;
  background: transparent; color: var(--ink); border: 0; border-bottom: 1px solid var(--line);
  padding: 0.65rem 0.8rem; cursor: pointer; font-size: 0.9rem;
}
.suggest-box button:hover, .suggest-box button:focus { background: var(--bg-2); }
.suggest-box button:last-child { border-bottom: 0; }

.skeleton-card {
  display: grid; grid-template-columns: 112px 1fr; gap: 0.8rem;
  padding: 0.5rem; margin-bottom: 0.55rem;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
}
.skeleton-card .sk {
  background: linear-gradient(90deg, var(--bg-2), color-mix(in srgb, var(--bg-2) 40%, #fff), var(--bg-2));
  background-size: 200% 100%; animation: shimmer 1.1s linear infinite; border-radius: 4px;
}
html[data-theme="dark"] .skeleton-card .sk {
  background: linear-gradient(90deg, #1a222a, #243039, #1a222a); background-size: 200% 100%;
}
.skeleton-card .sk.thumb { height: 84px; }
.skeleton-card .sk.line { height: 12px; margin-bottom: 0.45rem; width: 70%; }
.skeleton-card .sk.line.short { width: 42%; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.age-pill {
  display: inline-block; margin-left: 0.35rem;
  font-size: 0.68rem; font-weight: 700; color: var(--warn);
  border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
  background: color-mix(in srgb, var(--warn) 10%, transparent);
  border-radius: 999px; padding: 0.05rem 0.4rem;
}
.tier-pill.has-thumb {
  display: grid; grid-template-columns: 52px 1fr; gap: 0.45rem; align-items: center;
  min-width: 200px;
}
.tier-pill .t-thumb {
  width: 52px; height: 40px; object-fit: cover; border-radius: 3px; background: var(--bg-2);
}
.share-btn {
  margin-top: 0.85rem; width: 100%;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  border-radius: var(--radius); padding: 0.65rem 0.8rem; font-weight: 700; cursor: pointer;
}
.share-btn:hover { border-color: var(--teal); color: var(--teal); }

.view-chip {
  font-size: 0.72rem; font-weight: 700;
  padding: 0.15rem 0.5rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
}
.view-chip.active { color: var(--teal); border-color: var(--teal); }

.hot-board { display: grid; gap: 0.55rem; margin: 1rem 0 1.5rem; }
.hot-card {
  display: grid; grid-template-columns: 48px 1fr auto; gap: 0.75rem; align-items: center;
  padding: 0.75rem 0.9rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); text-decoration: none; color: inherit;
}
.hot-card:hover { border-color: var(--teal); }
.hot-rank {
  font-family: var(--font); font-size: 1.4rem; font-weight: 700; color: var(--teal);
  text-align: center;
}
.hot-card .meta-line { color: var(--muted); font-size: 0.8rem; margin-top: 0.15rem; }
.hot-badge {
  font-size: 0.72rem; font-weight: 700; color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
  padding: 0.25rem 0.5rem; border-radius: 999px; white-space: nowrap;
}

.list-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 0.65rem;
}
.list-head h2 { font-family: var(--font); font-size: 1.2rem; }
.muted { color: var(--muted); font-size: 0.88rem; }

.viaduc-card {
  display: grid; grid-template-columns: 112px 1fr; gap: 0.8rem;
  padding: 0.5rem; margin-bottom: 0.55rem; width: 100%;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); cursor: pointer; text-align: left; color: inherit;
  transition: border-color .15s ease, transform .15s ease;
}
.viaduc-card:hover, .viaduc-card.active { border-color: var(--teal); transform: translateY(-1px); }
.viaduc-card.nearest { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan); }
.viaduc-card .thumb {
  width: 112px; height: 84px; object-fit: cover; border-radius: 2px; background: var(--bg-2);
  filter: saturate(1.05) contrast(1.04);
}
.viaduc-card h3 { font-size: 0.98rem; font-family: var(--font); margin-bottom: 0.25rem; }
.meta { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chip {
  font-size: 0.7rem; font-weight: 700;
  padding: 0.15rem 0.45rem; border-radius: 999px;
  background: var(--bg-2); color: var(--muted); border: 1px solid var(--line);
}
.chip.fatal { color: var(--danger); }
.chip.hurt { color: var(--warn); }
.chip.low { color: var(--ok); }

.viaduc-card .thumb.missing {
  display: grid; place-items: center; color: var(--muted);
  background:
    linear-gradient(180deg, transparent 55%, color-mix(in srgb, var(--teal) 12%, transparent) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 72'%3E%3Cpath fill='%2399a8b0' d='M8 48c12-18 24-26 40-26s28 8 40 26v8H8z'/%3E%3Cpath fill='none' stroke='%236b7a82' stroke-width='3' d='M8 48c12-18 24-26 40-26s28 8 40 26'/%3E%3Cpath stroke='%236b7a82' stroke-width='2' d='M24 48V36M48 48V28M72 48V36'/%3E%3C/svg%3E")
    center 58%/56% no-repeat,
    var(--bg-2);
  font-size: 0;
}
.viaduc-card .thumb.missing::after { content: ""; }

.drawer-backdrop {
  position: fixed; inset: 0; z-index: 55;
  background: rgba(10, 14, 18, 0.45);
  opacity: 0; pointer-events: none;
  transition: opacity .22s ease;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; z-index: 60;
  background: var(--card);
  overflow: auto;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.18);
  transition: transform .28s cubic-bezier(.2,.8,.2,1);
}
/* mobile: bottom sheet */
.drawer {
  inset: auto 0 0 0;
  border-top: 2px solid var(--teal);
  max-height: min(88vh, 820px);
  padding: 0.85rem 1rem 1.4rem;
  transform: translateY(105%);
  border-radius: 14px 14px 0 0;
}
.drawer.open { transform: translateY(0); }
@media (min-width: 900px) {
  .drawer {
    inset: 0 0 0 auto;
    width: min(460px, 42vw);
    max-height: none;
    height: 100%;
    border-top: 0;
    border-left: 2px solid var(--teal);
    border-radius: 0;
    transform: translateX(105%);
    padding: 1.1rem 1.15rem 1.6rem;
    box-shadow: -12px 0 40px rgba(0,0,0,0.18);
  }
  .drawer.open { transform: translateX(0); }
}
.drawer-inner { width: 100%; margin: 0; }
.drawer-top {
  display: flex; justify-content: space-between; gap: 1rem; align-items: start;
  position: sticky; top: 0; z-index: 2;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(8px);
  padding-bottom: 0.55rem; margin-bottom: 0.25rem;
}
.drawer-top h2 { font-family: var(--font); font-size: 1.35rem; line-height: 1.2; padding-right: 0.5rem; }
.drawer-hero {
  width: 100%; height: min(220px, 34vw); object-fit: cover;
  border-radius: var(--radius); margin: 0.5rem 0 0.75rem; background: var(--bg-2);
}
.drawer-hero.missing {
  display: grid; place-items: center; color: var(--muted); font-size: 0.8rem;
  background: var(--bg-2)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 72'%3E%3Cpath fill='%2399a8b0' d='M8 48c12-18 24-26 40-26s28 8 40 26v8H8z'/%3E%3C/svg%3E")
    center/40% no-repeat;
}
.close-btn {
  flex: 0 0 auto;
  width: 2.2rem; height: 2.2rem;
  display: inline-grid; place-items: center;
  background: var(--bg); border: 1px solid var(--line); color: var(--ink);
  border-radius: 999px; cursor: pointer; font-weight: 700; font-size: 1.15rem;
  line-height: 1; padding: 0;
}
.close-btn:hover { border-color: var(--teal); color: var(--teal); }
.close-btn .close-label { display: none; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.6rem 0 2.4rem;
  color: var(--muted);
  font-size: 0.82rem;
  background:
    radial-gradient(600px 180px at 90% 0%, rgba(251, 185, 0, 0.08), transparent 60%),
    var(--bg-2);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr auto;
  gap: 1.2rem 2rem;
  align-items: center;
}
@media (max-width: 720px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-links { display: flex; flex-wrap: wrap; gap: 0.35rem 0.85rem; margin-bottom: 0.55rem; }
.footer-links a { font-weight: 600; text-decoration: none; }
.site-footer .disc {
  margin-top: 0.35rem;
  max-width: 68ch;
  font-size: 0.68rem;
  line-height: 1.45;
  opacity: 0.85;
}
.help-card {
  display: inline-flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #f0e6b8;
  text-decoration: none;
  color: #1f2328;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
  transition: transform .15s ease, box-shadow .15s ease;
}
.help-card:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(0,0,0,0.1); color: #1f2328; }
html[data-theme="dark"] .help-card {
  background: #1f2328; border-color: #3a3f46; color: #f4f4f4;
}
.help-card img { height: 36px; width: auto; display: block; }
.help-card .help-txt { display: grid; gap: 0.1rem; }
.help-card strong { font-size: 0.9rem; }
.help-card span { font-size: 0.72rem; opacity: 0.8; }

.marker-cluster-small, .marker-cluster-medium, .marker-cluster-large {
  background: color-mix(in srgb, var(--teal) 25%, transparent) !important;
}
.marker-cluster-small div, .marker-cluster-medium div, .marker-cluster-large div {
  background: var(--teal) !important; color: #fff !important; font-weight: 700;
}

.stats-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.55rem; margin: 0.75rem 0;
}
@media (max-width: 600px) { .stats-grid { grid-template-columns: 1fr; } }
.stat {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.75rem;
}
.stat .label { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; }
.stat .value { font-family: var(--font); font-size: 1.5rem; font-weight: 700; margin-top: 0.15rem; }
.gauge { height: 8px; border-radius: 999px; background: var(--bg-2); overflow: hidden; margin-top: 0.5rem; }
.gauge > span { display: block; height: 100%; background: linear-gradient(90deg, var(--ok), var(--warn), var(--danger)); transition: width .8s ease; }

.news-list { display: grid; gap: 0.5rem; margin-top: 0.6rem; }
.news-item {
  display: grid; gap: 0.1rem; padding: 0.7rem 0;
  border-bottom: 1px solid var(--line); text-decoration: none; color: inherit;
}
.news-item strong { color: var(--teal); font-size: 0.95rem; }
.news-item .src { color: var(--muted); font-size: 0.75rem; }
.history { margin-top: 0.5rem; color: var(--muted); font-size: 0.92rem; }
.history li { margin-left: 1.1rem; margin-top: 0.3rem; }

.page { padding: 1.5rem 0 3rem; }
.page h1 { font-family: var(--font); font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 0.45rem; }
.page > .lead { color: var(--muted); margin-bottom: 1.2rem; max-width: 62ch; }

.tier-board { display: grid; gap: 0.75rem; }
.tier-row {
  display: grid; grid-template-columns: 64px 1fr; gap: 0.65rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.tier-label { display: grid; place-items: center; font-weight: 900; font-size: 1.3rem; color: #fff; }
.tier-S .tier-label { background: #b42318; }
.tier-A .tier-label { background: #c4320a; }
.tier-B .tier-label { background: #b54708; }
.tier-C .tier-label { background: #026aa2; }
.tier-D .tier-label { background: #667085; }
.tier-items { display: flex; flex-wrap: wrap; gap: 0.45rem; padding: 0.65rem; }
.tier-pill {
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.45rem 0.6rem; min-width: 140px;
}
.tier-pill strong { display: block; font-size: 0.88rem; }
.tier-pill span { color: var(--muted); font-size: 0.72rem; }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table { width: 100%; border-collapse: collapse; min-width: 640px; }
th, td { text-align: left; padding: 0.7rem 0.85rem; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; }


.search-row .search-wrap { min-width: 0; }
.map-wrap #map { width:100%; }

.list-filters { display:flex; flex-wrap:wrap; gap:0.35rem; margin-bottom:0.55rem; }
.list-filters button {
  border:1px solid var(--line); background:var(--card); color:var(--muted);
  border-radius:999px; padding:0.25rem 0.65rem; font-size:0.72rem; font-weight:700; cursor:pointer;
}
.list-filters button.active { color:var(--teal); border-color:var(--teal); }
.tier-pill { cursor:pointer; font:inherit; color:inherit; text-align:left; }
.tier-pill:hover { border-color:var(--teal); }
.page-head { display:flex; justify-content:space-between; gap:1rem; align-items:flex-start; flex-wrap:wrap; margin-bottom:0.5rem; }
.page-head .lead { margin-bottom:0; }
.compare-pick { display:grid; grid-template-columns:1fr 1fr; gap:0.75rem; }
@media (max-width:720px){ .compare-pick { grid-template-columns:1fr; } }
.compare-pick select {
  width:100%; padding:0.7rem 0.8rem; border-radius:var(--radius); border:1px solid var(--line);
  background:var(--bg); color:var(--ink); font:inherit;
}
.compare-grid { display:grid; grid-template-columns:1fr 1fr; gap:1rem; margin-top:1rem; }
@media (max-width:800px){ .compare-grid { grid-template-columns:1fr; } }
.compare-card {
  border:1px solid var(--line); border-radius:var(--radius); background:var(--card); padding:0.85rem;
  display:grid; gap:0.55rem;
}
.compare-card img { width:100%; height:180px; object-fit:cover; border-radius:var(--radius); }
.compare-card .btn { text-align:center; text-decoration:none; display:inline-block; }
.fiche-hero { width:100%; max-height:360px; object-fit:cover; border-radius:var(--radius); margin:0.8rem 0; }
.spark-panel { margin:0.8rem 0 1rem; }
.spark-head { font-size:0.78rem; font-weight:700; color:var(--muted); margin-bottom:0.35rem; }
.spark-svg { width:100%; max-width:100%; height:auto; color:var(--teal); display:block; }
.spark-svg-wide { max-width:640px; min-height:96px; }

.about-chill {
  margin: 0 0 1.1rem;
  max-width: 28rem;
}
.about-chill img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #f4efe6;
}
.about-chill figcaption {
  margin-top: 0.4rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.compare-wrap, .compare-grid { display:grid; grid-template-columns:1fr 1fr; gap:1rem; margin-top:1rem; }
@media (max-width:800px){ .compare-wrap, .compare-grid { grid-template-columns:1fr; } }
.compare-banner {
  grid-column: 1 / -1;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  border: 1px solid var(--line);
}
.compare-banner.win { background: rgba(217,45,32,0.08); border-color: #d92d20; color: #8b1a12; }
.compare-banner.tie { background: rgba(0,168,169,0.08); }
html[data-theme="dark"] .compare-banner.win { color: #fda29b; }
.compare-card { position: relative; }
.compare-card.is-winner {
  border-color: #d92d20;
  box-shadow: 0 0 0 2px rgba(217,45,32,0.25);
}
.win-badge {
  position: absolute; top: 0.65rem; right: 0.65rem;
  background: #d92d20; color: #fff;
  font-size: 0.72rem; font-weight: 700;
  padding: 0.25rem 0.55rem; border-radius: 999px;
  z-index: 1;
}

.fiche-tools {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end;
  margin-top: 1rem;
}
.qr-box {
  display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
  font-size: 0.72rem; color: var(--muted);
}
.qr-box img {
  border-radius: 8px; border: 1px solid var(--line); background: #fff;
}

.near-alert {
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid #f79009;
  background: rgba(247,144,9,0.12);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
}

.quiz-clue { font-size: 1.15rem; margin: 0.6rem 0 1rem; }
.quiz-choices { display: grid; gap: 0.5rem; }
.quiz-feedback { min-height: 1.4em; margin-top: 0.75rem; }
.chip.nearest-badge.pulse-once { animation: nearestPulse 1.4s ease 1; }
@keyframes nearestPulse {
  0% { box-shadow:0 0 0 0 color-mix(in srgb, var(--cyan) 55%, transparent); }
  70% { box-shadow:0 0 0 10px transparent; }
  100% { box-shadow:0 0 0 0 transparent; }
}
html.accent-3114 {
  --cyan:#fbb900;
}
html[data-theme="dark"].accent-3114 {
  --teal:#fbb900;
  --cyan:#ffd212;
}
html.accent-3114 .site-header { border-bottom-color: color-mix(in srgb, #fbb900 35%, var(--line)); }


.blurb {
  margin: 0.55rem 0 0.85rem;
  font-size: 0.98rem;
  line-height: 1.45;
  color: var(--text);
  opacity: 0.92;
}
.site-footer .host {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}


.cookie-bar {
  position: fixed; z-index: 80; left: 0; right: 0; bottom: 0;
  background: rgba(18,22,26,0.96); color: #e8eef0;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 0.85rem 1rem;
  padding-bottom: max(0.85rem, env(safe-area-inset-bottom));
}
.cookie-inner {
  max-width: 980px; margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: center; justify-content: space-between;
}
.cookie-inner p { margin: 0; font-size: 0.9rem; max-width: 52ch; }
.cookie-actions { display: flex; gap: 0.45rem; }

/* —— Mobile polish —— */
@media (max-width: 860px) {
  .hero-banner {
    min-height: clamp(240px, 58vw, 380px);
    background-position: center 35%;
  }
  .hero-banner .wrap { padding: 1.6rem 0 1.35rem; }
  .hero h1 {
    font-size: clamp(1.55rem, 7.2vw, 2.1rem);
    max-width: 14ch;
  }
  .hero p {
    font-size: 0.95rem;
    max-width: 36ch;
    margin-top: 0.65rem;
  }
  .counters-bar { gap: 0.65rem; margin-top: 1rem; }
  .counter-box { min-width: 0; flex: 1 1 120px; }
  .counter-box .n { font-size: 1.45rem; }

  #map {
    height: min(46vh, 360px);
    border-radius: 10px;
  }
  .results-pane {
    max-height: none;
  }
  #results {
    max-height: min(52vh, 420px);
  }
  .viaduc-card {
    grid-template-columns: 84px 1fr;
    gap: 0.65rem;
  }
  .viaduc-card .thumb { height: 72px; }
  .hot-card {
    grid-template-columns: 36px 1fr;
    gap: 0.55rem;
  }
  .hot-badge { display: none; }
  .hot-rank { font-size: 1.15rem; }

  .page { padding-bottom: 2rem; }
  .page h1 { font-size: clamp(1.6rem, 7vw, 2.2rem); }
  .lead { font-size: 0.95rem; }

  .tier-board { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tier-row { min-width: 0; }
  .tier-items { flex-wrap: wrap; }
  .tier-pill { min-width: min(100%, 160px); }

  .spark-svg-wide { max-width: 100%; }
  .compare-banner { font-size: 0.92rem; }
  .fiche-tools { flex-direction: column; align-items: stretch; }
  .qr-box { align-items: flex-start; }

  .help-card {
    width: 100%;
  }
  .map-legend {
    font-size: 0.62rem;
    padding: 0.35rem 0.45rem;
    left: 8px; bottom: 8px;
  }

  .list-filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.15rem;
  }
  .list-filters button { white-space: nowrap; flex: 0 0 auto; }

  body.drawer-open { overflow: hidden; }
  .drawer {
    padding-bottom: max(1.4rem, env(safe-area-inset-bottom));
  }
}

@media (max-width: 420px) {
  .brand img { height: 30px; }
  #heatToggle { display: none; }
  .header-actions { gap: 0.28rem; }
}

/* Prevent global img rule from squashing logos/icons */
.brand img,
.help-card img,
.qr-box img {
  max-width: 100%;
  height: auto;
}
.brand img {
  height: 34px;
  width: auto;
  max-height: 36px;
}
@media (min-width: 861px) {
  .brand img { height: 36px; max-height: 36px; }
}
@media (max-width: 420px) {
  .brand img { height: 30px; max-height: 30px; }
}

