:root {
  --ink: #163b35;
  --green: #146c5b;
  --paper: #f8f6f0;
  --line: #ddd8cc;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: #f2f0e9; color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }

.header { height: 76px; display: flex; align-items: center; gap: 13px; padding: 0 24px; background: #fcfbf7; border-bottom: 1px solid #d8d4c8; }
.brand { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; background: var(--ink); color: white; font-size: 13px; font-weight: 800; letter-spacing: .08em; }
.eyebrow, .step { margin: 0 0 4px; color: #6f7c76; font-size: 9px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1 { margin: 0; font: 600 25px/1.05 Georgia, serif; }
h2 { margin: 0; font-size: 14px; }
.status { margin-left: auto; padding: 8px 11px; border: 1px solid #c7d8d2; border-radius: 999px; background: #edf6f2; color: #286456; font-size: 11px; font-weight: 750; }

.layout { height: calc(100vh - 76px); min-height: 650px; display: grid; grid-template-columns: 370px 1fr; }
.sidebar { padding: 18px; overflow-y: auto; background: var(--paper); border-right: 1px solid #d8d4c8; }
.intro { display: flex; gap: 11px; padding: 15px; border-radius: 13px; background: var(--ink); color: #eef4ed; box-shadow: 0 10px 30px rgba(25,52,47,.12); }
.intro-icon { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 9px; background: rgba(255,255,255,.1); color: #f3c868; font-size: 21px; }
.intro p { margin: 5px 0 0; color: #bed0ca; font-size: 11px; line-height: 1.5; }

.metrics { display: grid; grid-template-columns: repeat(3,1fr); margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fffdfa; }
.metrics div { padding: 11px 10px; border-right: 1px solid #e7e2d8; }
.metrics div:last-child { border: 0; }
.metrics span, .cell-details span { display: block; color: #78817d; font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.metrics strong { display: block; margin-top: 3px; font-size: 18px; font-variant-numeric: tabular-nums; }

.panel { padding: 19px 2px; border-bottom: 1px solid var(--line); }
.legend { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 13px; }
.legend-item { display: flex; align-items: center; gap: 7px; color: #53635d; font-size: 10px; font-weight: 750; }
.swatch { width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(47,53,48,.13); }
.hint, .coordinates { margin: 12px 0 0; color: #79827e; font-size: 10px; line-height: 1.5; }
.cell-details { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 14px; }
.cell-details div { padding: 10px; border: 1px solid #e4dfd4; border-radius: 9px; background: #fffdfa; }
.cell-details strong { display: block; margin-bottom: 3px; font-size: 17px; }
.method { margin-top: 16px; padding: 13px; border: 1px solid #d7ddd7; border-radius: 10px; background: #eef3ef; color: #54665f; font-size: 9.5px; line-height: 1.45; }
.method strong { color: var(--ink); font-size: 10.5px; }
.method p { margin: 5px 0 0; }

.map-shell { position: relative; min-width: 0; background: #dce3df; }
#map { width: 100%; height: 100%; }
.load-error { position: absolute; inset: 0; z-index: 1000; display: grid; place-items: center; background: #eef0ec; color: #8e3e35; font-weight: 700; }
.load-error[hidden] { display: none; }
.leaflet-container { font-family: inherit; }
.leaflet-tooltip { border: 0; border-radius: 7px; color: var(--ink); font-size: 10px; font-weight: 700; box-shadow: 0 5px 18px rgba(21,48,42,.16); }

@media (max-width: 800px) {
  .header { height: 68px; padding: 0 14px; }
  h1 { font-size: 20px; }
  .status { font-size: 0; padding: 7px; }
  .status::after { content: "Live"; font-size: 10px; }
  .layout { height: auto; min-height: 0; display: flex; flex-direction: column; }
  .map-shell { order: 1; height: 58vh; min-height: 430px; }
  .sidebar { order: 2; overflow: visible; border-right: 0; }
}
