/* SlopeEye / GroundEye. Same family as CoastWatch and FloodEye: dark satellite map, floating dark glass panels. */
@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap; src: url("../fonts/poppins-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url("../fonts/poppins-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url("../fonts/poppins-latin-600-normal.woff2") format("woff2"); }

:root {
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --panel: rgba(13, 22, 35, 0.88);
  --panel-2: rgba(28, 41, 60, 0.92);
  --line: rgba(255, 255, 255, 0.13);
  --text: #eaf0f8;
  --muted: #a4b5ca;
  --accent: #38bdf8;
  --slope: #f97316;
  --focus: #8fd0ff;
  --c1: #94a3b8; --c2: #facc15; --c3: #f97316; --c4: #dc2626;
  --w0: #2dd4a7; --w1: #facc15; --w2: #fb923c; --w3: #ef4444;
  --sink: #dc2626; --rise: #2563eb;
  --r: 16px; --r-sm: 11px; --edge: 16px;
  --blur: blur(12px) saturate(1.2);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0a1420; color: var(--text); font: 400 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.map { position: fixed; inset: 0; }
.noscript { position: fixed; top: 40%; width: 100%; text-align: center; }
.glass { background: var(--panel); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* top-left: brand + product switch */
.tl { position: fixed; top: var(--edge); left: var(--edge); z-index: 5; display: flex; gap: 8px; align-items: stretch; }
.brand { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 9px; font-weight: 600; font-size: 18px; white-space: nowrap; }
.brand img { width: 30px; height: 30px; }
.brand small { font-weight: 400; font-size: 12px; color: var(--muted); margin-left: 2px; }
.seg { display: flex; padding: 4px; gap: 4px; }
.seg button { border: 0; background: none; border-radius: 10px; padding: 6px 12px; color: var(--muted); font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.seg button[aria-pressed="true"].slope { color: #fdba74; }
.seg button[aria-pressed="true"].ground { color: #7dd3fc; }

/* top-centre: 3-day strip */
.strip { position: fixed; top: var(--edge); left: 50%; transform: translateX(-50%); z-index: 4; padding: 8px 10px 10px; text-align: center; }
.strip h2 { margin: 0 0 6px; font-size: 11.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.days { display: flex; gap: 4px; }
.day { border: 0; background: none; border-radius: 10px; padding: 5px 12px 6px; min-width: 82px; display: grid; gap: 2px; justify-items: center; }
.day b { font-weight: 500; font-size: 13px; }
.day span { font-size: 11px; color: var(--muted); }
.day i { width: 10px; height: 10px; border-radius: 50%; background: var(--w0); margin-top: 3px; box-shadow: 0 0 0 3px rgba(255,255,255,0.06); }
.day[aria-pressed="true"] { background: var(--panel-2); box-shadow: inset 0 -2px 0 var(--accent); }

/* left panel */
.panel { position: fixed; top: calc(var(--edge) + 62px); left: var(--edge); bottom: var(--edge); width: 360px; z-index: 4; overflow: auto; padding: 16px 16px 18px; scrollbar-width: thin; }
.panel h1 { font-size: 17px; margin: 0 0 4px; font-weight: 600; }
.panel h3 { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); font-weight: 500; margin: 18px 0 8px; }
.panel p { margin: 0 0 8px; }
.legend { display: grid; gap: 6px; }
.legend div { display: flex; align-items: center; gap: 10px; }
.sw { width: 14px; height: 14px; border-radius: 4px; flex: none; }
.legend .pct { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.ramp { height: 12px; border-radius: 6px; background: linear-gradient(90deg, #dc2626, #f0b4b4 38%, #f1f5f9 50%, #b4c8f0 62%, #2563eb); }
.ramp-l { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; }
.card { background: rgba(255,255,255,0.04); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; margin: 8px 0; }
.stat { display: flex; align-items: baseline; gap: 8px; }
.stat b { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.list { display: grid; gap: 4px; }
.row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-radius: 9px; padding: 6px 8px; }
.row:hover { background: rgba(255,255,255,0.06); }
.row .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.row .v { margin-left: auto; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.note { font-size: 12.5px; color: var(--muted); }
.note li { margin-bottom: 5px; }
.note ul { padding-left: 18px; margin: 6px 0; }
.badge { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); margin-left: 6px; vertical-align: 2px; }
.warn { border-color: rgba(250, 204, 21, 0.45); color: #fde68a; }

/* right controls */
.tr { position: fixed; top: var(--edge); right: var(--edge); z-index: 5; display: flex; flex-direction: column; gap: 8px; }
.tool { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; }
.tool[aria-pressed="true"] { color: var(--accent); box-shadow: var(--shadow), inset 0 0 0 1.5px var(--accent); }

/* popups and tooltip */
.maplibregl-popup-content { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; font: 400 13px/1.45 var(--font); box-shadow: var(--shadow); backdrop-filter: var(--blur); }
.maplibregl-popup-tip { border-top-color: var(--panel) !important; border-bottom-color: var(--panel) !important; }
.maplibregl-popup-close-button { color: var(--muted); font-size: 18px; padding: 2px 8px; }
.pop h4 { margin: 0 0 6px; font-size: 14px; font-weight: 600; padding-right: 16px; }
.pop dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; }
.pop dt { color: var(--muted); }
.pop dd { margin: 0; font-variant-numeric: tabular-nums; }
.pop table { border-collapse: collapse; width: 100%; margin-top: 6px; font-variant-numeric: tabular-nums; }
.pop td, .pop th { padding: 3px 6px; text-align: right; font-weight: 400; }
.pop th { color: var(--muted); font-size: 12px; }
.pop td:first-child, .pop th:first-child { text-align: left; }
.tip { position: fixed; z-index: 9; padding: 5px 10px; font-size: 12.5px; pointer-events: none; border-radius: 9px; }
.maplibregl-ctrl-attrib { font-size: 10.5px; }

@media (max-width: 760px) {
  :root { --edge: 10px; }
  .brand small { display: none; }
  .strip { top: calc(var(--edge) + 58px); width: calc(100vw - 2 * var(--edge)); }
  .day { min-width: 0; flex: 1; padding: 4px 4px 6px; }
  .panel { top: auto; left: var(--edge); right: var(--edge); width: auto; max-height: 40vh; bottom: var(--edge); }
  .tr { top: calc(var(--edge) + 150px); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
