/* GEO-SYS Geoportal — dark glass UI on top of the 3D map, tokens shared with geo-sys.pl. */
:root {
  --ink: #0f1b2d;
  --ink-2: #172539;
  --graphite: #2b3442;
  --steel: #5a6577;
  --steel-light: #9aa6b8;
  --line: #dce1e8;
  --mist: #f2f4f7;
  --paper: #ffffff;
  --blue: #2563c9;
  --blue-bright: #5b9bff;
  --ok: #1d7a4f;
  --amber: #d98a0b;
  --red: #c8372d;
  --glass: rgba(15, 27, 45, 0.86);
  --glass-2: rgba(23, 37, 57, 0.92);
  --glass-line: rgba(255, 255, 255, 0.1);
  --txt: #e6ecf4;
  --txt-2: #a9b6c8;
  --font: 'Archivo', 'Segoe UI', system-ui, sans-serif;
  --radius: 10px;
  --header-h: 60px;
  --panel-w: 320px;
  --info-w: 390px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--txt);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
a { color: var(--blue-bright); }
h1, h2, h3 { font-variation-settings: 'wdth' 118; margin: 0; letter-spacing: -0.01em; color: #fff; }
[hidden] { display: none !important; }
button { font: inherit; }

/* ---------- Header ---------- */
.gp-header {
  height: var(--header-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 16px;
  background: var(--ink);
  border-bottom: 1px solid var(--glass-line);
  position: relative; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; flex: none; }
.brand svg .mark-dot { fill: var(--blue-bright); }
.brand-name { font-weight: 700; font-size: 1.05rem; font-variation-settings: 'wdth' 125; letter-spacing: 0.02em; }
.brand-sub { font-weight: 500; font-variation-settings: 'wdth' 100; letter-spacing: 0; color: rgba(255,255,255,.72); margin-left: 4px; }

.search { position: relative; flex: 1; max-width: 560px; margin-left: 8px; }
.search input {
  width: 100%; height: 40px; padding: 0 14px 0 38px;
  border: 1px solid rgba(255,255,255,.16); border-radius: 999px;
  background: var(--ink-2); color: #fff; font: inherit; font-size: .92rem;
  transition: border-color .15s, background .15s;
}
.search input::placeholder { color: var(--steel-light); }
.search input:focus { outline: none; border-color: var(--blue-bright); background: #1c2c44; }
.search-ico { position: absolute; left: 13px; top: 11px; color: var(--steel-light); }
.search-results {
  position: absolute; top: 46px; left: 0; right: 0; margin: 0; padding: 6px 0; list-style: none;
  background: var(--glass-2); backdrop-filter: blur(10px); border: 1px solid var(--glass-line); border-radius: var(--radius);
  box-shadow: 0 14px 34px rgba(0,0,0,.4); max-height: 55vh; overflow: auto;
}
.search-results li { padding: 9px 14px; color: var(--txt); cursor: pointer; font-size: .92rem; }
.search-results li small { display: block; color: var(--txt-2); }
.search-results li:hover { background: rgba(91,155,255,.14); }
.search-results li.empty { cursor: default; color: var(--txt-2); }

.mode { display: flex; background: var(--ink-2); border: 1px solid rgba(255,255,255,.16); border-radius: 999px; padding: 3px; flex: none; }
.mode button {
  background: transparent; color: rgba(255,255,255,.75); border: 0; padding: 0 16px; height: 32px; border-radius: 999px;
  font-weight: 700; font-variation-settings: 'wdth' 118; cursor: pointer; transition: background .15s, color .15s;
}
.mode button.is-on { background: var(--blue); color: #fff; box-shadow: 0 2px 10px rgba(37,99,201,.5); }
.icon-head { width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255,255,255,.16); background: var(--ink-2); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.icon-head:hover { border-color: var(--blue-bright); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: 8px;
  font-weight: 650; font-size: .92rem; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: .86rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #2f72e0; }
.btn-ghost { border-color: rgba(255,255,255,.28); color: var(--txt); background: transparent; }
.btn-ghost:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.5); }
.btn-ghost-dark { border-color: rgba(255,255,255,.35); color: #fff; background: transparent; }
.btn-ghost-dark:hover { background: #fff; color: var(--ink); }
.head-cta { margin-left: auto; flex: none; }

/* ---------- Layout ---------- */
.gp-main { position: relative; height: calc(100% - var(--header-h)); }
.map { position: absolute; inset: 0; background: var(--ink); }
.cesium-viewer-bottom { display: none; }
.cesium-widget canvas { outline: none; }

/* dock */
.dock {
  position: absolute; left: 12px; top: 12px; z-index: 12;
  display: flex; flex-direction: column; gap: 6px; padding: 6px;
  background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-line); border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.dock button {
  width: 56px; height: 54px; border: 0; border-radius: 10px; background: transparent; color: var(--txt-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer;
  font-size: .68rem; font-weight: 600; transition: background .15s, color .15s;
}
.dock svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dock button:hover { background: rgba(255,255,255,.08); color: #fff; }
.dock button.is-on { background: var(--blue); color: #fff; }
.dock .dock-sos { color: #ff8a80; }
.dock .dock-sos:hover { background: rgba(200,55,45,.25); color: #fff; }

/* panels */
.panel {
  position: absolute; top: 12px; z-index: 11;
  background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-line); border-radius: 14px;
  box-shadow: 0 14px 40px rgba(0,0,0,.4);
  display: flex; flex-direction: column; max-height: calc(100% - 60px); color: var(--txt);
}
.tool-panel { left: 88px; width: var(--panel-w); display: none; animation: slideIn .18s ease-out; }
.tool-panel.is-open { display: flex; }
.panel-info { right: 12px; width: var(--info-w); animation: slideIn .18s ease-out; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--glass-line); }
.panel-head h2 { font-size: .98rem; font-weight: 700; letter-spacing: .02em; }
.panel-body { padding: 10px 16px 16px; overflow: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.panel-body h3 { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--txt-2); font-weight: 650; margin: 14px 0 6px; font-variation-settings: 'wdth' 100; }
.icon-btn { background: none; border: 0; width: 32px; height: 32px; cursor: pointer; color: var(--txt-2); font-size: 16px; border-radius: 8px; }
.icon-btn:hover { color: #fff; background: rgba(255,255,255,.08); }
.lead-s { font-size: .9rem; color: var(--txt); margin: 4px 0 10px; }
.muted { color: var(--txt-2); font-size: .86rem; margin: 0; }
.small { font-size: .78rem; }

.layer-list { display: flex; flex-direction: column; gap: 1px; }
.layer { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 8px; padding: 6px 4px; font-size: .9rem; cursor: pointer; border-radius: 8px; }
.layer:hover { background: rgba(255,255,255,.05); }
.layer input[type="checkbox"], .layer input[type="radio"] { margin: 0; width: 16px; height: 16px; accent-color: #3fb26b; }
.layer small { grid-column: 2 / 4; color: var(--txt-2); font-size: .76rem; margin-top: -4px; }
.layer .op { width: 64px; accent-color: var(--blue-bright); }
.layer.is-disabled { opacity: .55; cursor: not-allowed; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .76rem; color: var(--txt-2); margin: 4px 0 10px 32px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); margin-right: 5px; }
#btn-locate { margin-top: 10px; }
.sources { font-size: .7rem; color: var(--txt-2); margin: 14px 0 0; line-height: 1.45; }

/* info panel */
.info-sec { border-top: 1px solid var(--glass-line); padding: 12px 0; }
.info-sec:first-child { border-top: 0; padding-top: 4px; }
.info-sec h3 { margin-top: 0; }
.kv { display: grid; grid-template-columns: 112px 1fr; gap: 4px 10px; margin: 0; font-size: .87rem; }
.kv dt { color: var(--txt-2); }
.kv dd { margin: 0; color: #fff; font-weight: 550; word-break: break-word; }
.kv dd.mono { font-variant-numeric: tabular-nums; }
.gfi { width: 100%; border: 0; border-radius: 8px; height: 250px; background: #fff; }
.gfi.tall { height: 340px; }
.shelters { list-style: none; margin: 0; padding: 0; }
.shelters li { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 8px 0; border-bottom: 1px solid var(--glass-line); font-size: .87rem; }
.shelters li:last-child { border-bottom: 0; }
.shelters .dist { font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.shelters small { grid-column: 1 / 3; color: var(--txt-2); }
.shelters button { background: none; border: 0; padding: 0; color: var(--blue-bright); font-weight: 600; cursor: pointer; text-align: left; }
.badge { display: inline-block; font-size: .7rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; color: #fff; background: var(--c, var(--blue)); }
.links { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .85rem; margin-top: 8px; }
.links button { background: none; border: 0; padding: 0; color: var(--blue-bright); cursor: pointer; }
.cta-box { background: linear-gradient(135deg, rgba(37,99,201,.35), rgba(37,99,201,.12)); border: 1px solid rgba(91,155,255,.35); border-radius: 10px; padding: 12px 14px; font-size: .85rem; margin-top: 10px; color: var(--txt); }
.cta-box strong { color: #fff; display: block; font-variation-settings: 'wdth' 118; margin-bottom: 4px; }
.cta-box a { color: #fff; font-weight: 700; }
.report-row { display: flex; gap: 8px; margin: 2px 0 10px; }

/* statistics */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 2px 0 10px; }
.stat { background: rgba(255,255,255,.06); border: 1px solid var(--glass-line); border-radius: 10px; padding: 10px 12px; }
.stat b { display: block; font-size: 1.35rem; color: #fff; font-variation-settings: 'wdth' 112; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat b small { font-size: .75rem; font-weight: 600; color: var(--txt-2); }
.stat span { display: block; font-size: .76rem; color: var(--txt-2); margin-top: 2px; }
.stat em { display: block; font-style: normal; font-size: .74rem; color: #7fb0ff; margin-top: 2px; }
.spark, .profil { margin: 6px 0 10px; }
.spark-head { display: flex; justify-content: space-between; gap: 8px; font-size: .76rem; color: var(--txt-2); margin-bottom: 4px; }
.spark-head b { color: #fff; }
.spark-head b.up { color: #6fd39a; } .spark-head b.down { color: #ff8a80; }
.spark svg, .profil svg { width: 100%; height: 80px; display: block; }
.profil svg { height: 110px; }
.spark text, .profil text { font-size: 9px; fill: var(--txt-2); font-family: var(--font); }
.prof-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .78rem; color: var(--txt-2); margin-top: 4px; }
.prof-stats b { color: #fff; }
.tx { list-style: none; margin: 0; padding: 0; }
.tx li { display: grid; grid-template-columns: 76px 1fr auto; gap: 8px; align-items: start; padding: 7px 0; border-bottom: 1px solid var(--glass-line); font-size: .84rem; }
.tx-d { color: var(--txt-2); font-variant-numeric: tabular-nums; }
.tx-a small, .tx-p small { display: block; color: var(--txt-2); font-size: .74rem; }
.tx-p { text-align: right; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.legend-ramp { display: flex; align-items: center; gap: 8px; font-size: .76rem; color: var(--txt-2); margin: 4px 0 8px; }
.legend-ramp i { flex: 1; height: 10px; border-radius: 999px; }
.row-btns { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* sun & measure */
.sun-row { display: grid; gap: 4px; margin: 10px 0; font-size: .84rem; color: var(--txt-2); }
.sun-row b { color: #fff; font-variant-numeric: tabular-nums; margin-left: 6px; }
.sun-row input[type="date"] { background: var(--ink-2); color: #fff; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; height: 36px; padding: 0 10px; font: inherit; color-scheme: dark; }
.sun-row input[type="range"] { width: 100%; accent-color: #ffb547; }
.sun-info { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; font-size: .8rem; color: var(--txt-2); margin: 6px 0 12px; }
.sun-info b { color: #fff; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 4px 0 12px; }
.seg button { border: 1px solid rgba(255,255,255,.2); background: transparent; color: var(--txt); border-radius: 8px; padding: 9px 6px; font-weight: 600; font-size: .84rem; cursor: pointer; }
.seg button.is-on { background: #ffd23f; color: var(--ink); border-color: #ffd23f; }

/* map tools & status */
.map-tools { position: absolute; right: 12px; bottom: 46px; z-index: 9; display: flex; flex-direction: column; gap: 6px; }
.tool {
  width: 42px; height: 42px; display: grid; place-items: center;
  background: var(--glass); backdrop-filter: blur(10px); color: #fff; border: 1px solid var(--glass-line); border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,.3); cursor: pointer; font-weight: 800;
}
.tool:hover { background: var(--blue); }
.status {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 9; height: 30px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px;
  background: linear-gradient(0deg, rgba(15,27,45,.95), rgba(15,27,45,.7)); color: rgba(255,255,255,.85); font-size: .78rem; font-variant-numeric: tabular-nums;
}
.status span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-load { color: var(--blue-bright); display: inline-flex; align-items: center; gap: 6px; }
.st-load i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--blue-bright); border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* welcome */
.welcome { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: radial-gradient(ellipse at center, rgba(15,27,45,.35), rgba(15,27,45,.75)); animation: fade .4s ease-out; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.welcome-card {
  position: relative; width: min(680px, 100%); max-height: 100%; overflow: auto;
  background: var(--glass-2); backdrop-filter: blur(14px); border: 1px solid var(--glass-line); border-radius: 18px;
  padding: 28px 28px 22px; box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.welcome-x { position: absolute; top: 12px; right: 12px; }
.eyebrow { color: var(--blue-bright); font-weight: 700; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 8px; }
.welcome h1 { font-size: clamp(1.4rem, 1rem + 1.8vw, 2.1rem); line-height: 1.1; font-variation-settings: 'wdth' 122; }
.welcome-lead { color: var(--txt-2); margin: 10px 0 18px; font-size: .98rem; max-width: 58ch; }
.welcome-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-bottom: 16px; }
.welcome-grid button {
  text-align: left; padding: 14px; border-radius: 12px; cursor: pointer; color: var(--txt);
  background: rgba(255,255,255,.06); border: 1px solid var(--glass-line); transition: background .15s, border-color .15s, transform .15s;
}
.welcome-grid button:hover { background: rgba(37,99,201,.28); border-color: var(--blue-bright); transform: translateY(-2px); }
.welcome-grid b { display: block; color: #fff; font-size: 1rem; font-variation-settings: 'wdth' 115; }
.welcome-grid span { font-size: .82rem; color: var(--txt-2); }
.welcome-grid .sos:hover { background: rgba(200,55,45,.3); border-color: #ff8a80; }

@media (max-width: 1000px) { .head-cta { display: none; } }
@media (max-width: 720px) {
  :root { --header-h: 104px; }
  .gp-header { flex-wrap: wrap; height: var(--header-h); padding: 8px 16px; gap: 8px 10px; align-content: center; }
  .search { order: 3; flex-basis: 100%; max-width: none; margin: 0; }
  .mode { margin-left: auto; }
  .brand-sub { display: none; }
  .dock { top: auto; bottom: 38px; left: 50%; transform: translateX(-50%); flex-direction: row; padding: 4px; }
  .dock button { width: 54px; height: 48px; }
  .tool-panel, .panel-info { left: 0; right: 0; top: auto; bottom: 30px; width: auto; max-height: 58%; border-radius: 14px 14px 0 0; z-index: 13; }
  .map-tools { bottom: 100px; }
  .status #st-coords { font-size: .72rem; }
}

/* visible notifications */
.gp-toast {
  position: absolute; left: 50%; top: 16px; z-index: 50; transform: translate(-50%, -12px); opacity: 0; pointer-events: none;
  max-width: min(560px, calc(100% - 32px)); padding: 12px 16px; border-radius: 12px;
  background: var(--glass-2); backdrop-filter: blur(10px); border: 1px solid rgba(91,155,255,.45); color: #fff; font-size: .9rem;
  box-shadow: 0 14px 34px rgba(0,0,0,.4); transition: opacity .2s, transform .2s;
}
.gp-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 420px) {
  .welcome-card { padding: 20px 16px 16px; }
  .welcome-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .welcome-grid button { padding: 10px; }
  .welcome-grid span { display: none; }
  .welcome-lead { font-size: .9rem; margin-bottom: 12px; }
}
