:root {
  --ink: #10201c;
  --paper: #f8f7f2;
  --muted: #65706b;
  --line: rgba(16, 32, 28, 0.13);
  --accent: #eb3b31;
  --accent-dark: #bb2119;
}

* { box-sizing: border-box; }

html, body, .app-shell, #map { height: 100%; margin: 0; }

body {
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#map { z-index: 0; background: #dce4d9; }

.info-panel {
  position: absolute;
  z-index: 1000;
  top: 24px;
  left: 24px;
  width: min(390px, calc(100vw - 48px));
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 18px;
  background: rgba(248, 247, 242, 0.94);
  box-shadow: 0 18px 48px rgba(26, 39, 33, 0.2);
  backdrop-filter: blur(14px);
  transition: transform 180ms ease, opacity 180ms ease;
}

.eyebrow { color: var(--accent-dark); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.13em; }
h1 { margin: 5px 0 8px; font-size: clamp(2rem, 5vw, 2.8rem); letter-spacing: -0.065em; line-height: 0.94; }
h1 span { color: var(--accent); font-weight: 400; }
.intro { margin: 0 0 21px; color: var(--muted); font-size: 0.94rem; line-height: 1.45; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 16px; }
.stat-card { min-height: 105px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.54); }
.stat-card.accent { border-color: rgba(235, 59, 49, .33); background: #fff0ee; }
.stat-card span { display: block; color: var(--muted); font-size: .62rem; font-weight: 800; letter-spacing: .09em; }
.stat-card strong { display: block; margin: 7px 0 4px; font-size: 1.22rem; letter-spacing: -.05em; }
.stat-card small { color: var(--muted); font-size: .73rem; }
.comparison { margin: 0 0 20px; font-size: .9rem; line-height: 1.35; }

.search-form { margin: 0 0 19px; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.43); }
.search-row { display: flex; gap: 7px; margin-top: 7px; }
.search-row input { min-width: 0; flex: 1; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; font: inherit; font-size: .83rem; }
.search-row button { min-height: auto; padding: 8px 11px; font-size: .75rem; }
.search-status { min-height: 1.1em; margin: 8px 0 0; color: var(--muted); font-size: .7rem; line-height: 1.35; }
.search-results { display: grid; gap: 5px; margin: 8px 0 0; padding: 0; list-style: none; }
.search-results:empty { display: none; }
.search-result { width: 100%; min-height: auto; padding: 7px 8px; border-color: var(--line); color: var(--ink); background: rgba(255,255,255,.8); text-align: left; font-size: .72rem; font-weight: 650; line-height: 1.3; }
.search-result:hover { background: #fff0ee; }

.control-group { margin: 16px 0; }
.label-row { display: flex; align-items: center; justify-content: space-between; }
label { font-size: .78rem; font-weight: 760; }
output { color: var(--muted); font-size: .76rem; font-variant-numeric: tabular-nums; }
select, button { font: inherit; }
select { width: 100%; margin-top: 7px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; }
input[type="range"] { width: 100%; margin: 9px 0 0; accent-color: var(--accent); cursor: pointer; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 21px; }
button { min-height: 38px; padding: 8px 10px; border: 1px solid var(--accent-dark); border-radius: 8px; color: white; background: var(--accent); cursor: pointer; font-size: .8rem; font-weight: 750; }
button:hover { background: var(--accent-dark); }
button.secondary { border-color: var(--line); color: var(--ink); background: transparent; }
button.secondary:hover { background: rgba(16, 32, 28, .07); }
.hint { margin: 20px 0 8px; font-size: .79rem; line-height: 1.4; }
.hint span { color: var(--accent); font-size: 1rem; }
.source-note { margin: 0; color: var(--muted); font-size: .69rem; line-height: 1.38; }

.panel-toggle { display: none; position: absolute; z-index: 1001; top: 12px; right: 12px; min-height: 34px; padding: 6px 10px; border-color: var(--line); color: var(--ink); background: rgba(248,247,242,.95); box-shadow: 0 3px 12px rgba(26,39,33,.17); }

.hyperion-label {
  border: 0 !important;
  border-radius: 4px !important;
  padding: 5px 8px !important;
  color: white !important;
  background: var(--accent) !important;
  box-shadow: none !important;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
}
.hyperion-label::before { display: none; }
.leaflet-control-scale-line { border-color: rgba(16,32,28,.75); color: var(--ink); background: rgba(248,247,242,.9); }

@media (max-width: 620px) {
  .info-panel { top: 0; left: 0; width: 100%; max-height: 78vh; overflow: auto; border-radius: 0 0 16px 16px; }
  .info-panel.is-hidden { transform: translateY(-105%); opacity: 0; pointer-events: none; }
  .panel-toggle { display: block; }
  h1 { font-size: 2.25rem; }
  .stat-card { min-height: 87px; }
}
