/* FloatChat — full-screen map canvas with floating glass panels.
   One accent (emerald) on neutral zinc. Chart colours are mirrored in app.py. */
:root {
  color-scheme: dark;
  --bg: #09090b;
  --glass: rgba(24, 24, 27, 0.8);
  --surface: #18181b;
  --surface-2: #232327;
  --surface-3: #2c2c31;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --ink: #f4f4f5;
  --ink-2: #a1a1aa;
  --muted: #8b8b94;
  --accent: #34d399;
  --accent-ink: #04221a;
  --accent-soft: rgba(52, 211, 153, 0.12);
  --highlight: #fbbf24;
  --danger: #f87171;
  --radius-xl: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow: 0 24px 48px -24px rgba(0, 0, 0, 0.7), 0 2px 8px -4px rgba(0, 0, 0, 0.5);
  --font: Geist, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --left: 340px;
  --right: 420px;
  --gap: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
a { color: var(--accent); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12.5px; }

/* Dash's pre-render placeholder */
._dash-loading {
  position: fixed; inset: 0; display: grid; place-items: center;
  font-size: 0; background: var(--bg);
}
._dash-loading::after {
  content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent);
  animation: breathe-solid 1.6s var(--ease) infinite;
}

/* ── Icons (CSS masks, 1.5 px strokes) ───────────────── */
.icon {
  display: inline-block; flex: none; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat;
}
.icon-search { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M20 20l-4.2-4.2'/%3E%3C/svg%3E"); }
.icon-list { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6.5h11M9 12h11M9 17.5h11'/%3E%3Ccircle cx='4.5' cy='6.5' r='1.1' fill='black' stroke='none'/%3E%3Ccircle cx='4.5' cy='12' r='1.1' fill='black' stroke='none'/%3E%3Ccircle cx='4.5' cy='17.5' r='1.1' fill='black' stroke='none'/%3E%3C/svg%3E"); }
.icon-sparkle { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 3.5l1.8 4.9 4.9 1.8-4.9 1.8L11 16.9l-1.8-4.9-4.9-1.8 4.9-1.8z'/%3E%3Cpath d='M18.5 15.5v5M16 18h5'/%3E%3C/svg%3E"); }
.icon-key { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='15.5' r='4'/%3E%3Cpath d='M11 12.5l8.5-8.5M16.5 7l2.5 2.5M14 9.5l2 2'/%3E%3C/svg%3E"); }
.icon-send { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5M5.5 11.5L12 5l6.5 6.5'/%3E%3C/svg%3E"); }
.icon-pin { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s-6.5-5.6-6.5-11a6.5 6.5 0 0 1 13 0c0 5.4-6.5 11-6.5 11z'/%3E%3Ccircle cx='12' cy='10' r='2.3'/%3E%3C/svg%3E"); }
.icon-alert { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 7.5v5.2M12 16.3h.01'/%3E%3C/svg%3E"); }
.icon-chevron { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.5 6l6 6-6 6'/%3E%3C/svg%3E"); }
.icon-float { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9.5' y='2.5' width='5' height='12.5' rx='2.5'/%3E%3Cpath d='M12 15v2.5M2.5 19.5c1.6 0 1.6-1.3 3.2-1.3s1.6 1.3 3.2 1.3 1.6-1.3 3.1-1.3 1.6 1.3 3.2 1.3 1.6-1.3 3.2-1.3 1.6 1.3 3.1 1.3'/%3E%3C/svg%3E"); }

/* ── Shell: map canvas under floating panels ─────────── */
.app { position: relative; height: 100dvh; min-height: 640px; overflow: hidden; background: var(--bg); }
.map-stage { position: absolute; inset: 0; z-index: 0; }   /* own stacking context: map controls stay under the panels */
.map-graph { position: relative; width: 100%; height: 100%; }
.map-graph .js-plotly-plot { position: absolute; inset: 0; }
.shell {
  position: relative; height: 100%; padding: var(--gap); gap: var(--gap);
  display: grid; grid-template-columns: var(--left) minmax(0, 1fr) var(--right); grid-template-rows: minmax(0, 1fr);
  pointer-events: none;   /* the map receives clicks between panels */
}
.col-left { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.col-center { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; gap: 12px; min-width: 0; }
.col-right { display: flex; min-height: 0; }
.brand, .panel, .toolbar, .statusbar, .analysis { pointer-events: auto; }

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), var(--shadow);
}
.reveal { animation: rise 0.8s var(--ease) both; animation-delay: calc(var(--d, 0) * 1ms); }

/* Brand */
.brand { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.25);
}
.brand-mark .icon { width: 20px; height: 20px; }
.brand-name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
.brand-sub { font-size: 12px; color: var(--muted); line-height: 1.3; }

/* Toolbar and status over the map */
.toolbar { display: flex; align-items: center; gap: 10px; padding: 7px 7px 7px 10px; border-radius: var(--radius); max-width: 100%; flex-wrap: wrap; }
.toolbar-rule { width: 1px; height: 22px; background: var(--line); }
.kpis { display: flex; gap: 4px; flex-wrap: wrap; }
.kpi { display: flex; align-items: baseline; gap: 5px; padding: 4px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.04); min-height: 28px; white-space: nowrap; }
.kpi-value { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--ink); }
.kpi-label { font-size: 12px; color: var(--muted); }
.period { display: flex; align-items: center; gap: 8px; }
.period label { font-size: 12px; color: var(--muted); }
.period .dash-dropdown { width: 172px; }
.period .dd { width: 100%; }
.statusbar { display: flex; align-items: center; gap: 14px; padding: 8px 14px; border-radius: 999px; font-size: 12.5px; }
.status { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.hint { color: var(--muted); }
.highlight-chip { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }
.highlight-swatch { width: 8px; height: 8px; border-radius: 50%; background: var(--highlight); flex: none; }
.btn-sm { padding: 3px 10px; font-size: 12px; font-weight: 500; border-radius: 999px; }

/* Analysis panel: floats above the status bar */
.center-bottom { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; min-width: 0; max-width: 100%; }
.analysis { width: min(620px, 100%); padding: 12px 14px 10px; border-radius: var(--radius); animation: rise 0.6s var(--ease) both; }
.analysis-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.analysis-message { margin: 8px 0 4px; color: var(--ink-2); line-height: 1.5; }
.analysis-message:empty { display: none; }

.status-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.status-dot.is-live, .is-on .status-dot { background: var(--accent); }
.status-dot.is-live::after, .is-on .status-dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent);
  animation: breathe 2.4s var(--ease) infinite;
}
.status-dot.is-error { background: var(--danger); }

/* Map chrome: keep the CARTO / OpenStreetMap credit visible beside the inspector */
.map-stage .maplibregl-ctrl-bottom-right { right: calc(var(--right) + var(--gap) * 2) !important; bottom: calc(var(--gap) + 48px) !important; }
.map-stage .maplibregl-ctrl-attrib { background: rgba(24, 24, 27, 0.8) !important; color: var(--muted) !important; border-radius: 999px !important; }
.map-stage .maplibregl-ctrl-attrib a { color: var(--ink-2) !important; }
.map-stage .maplibregl-ctrl-attrib-button { filter: invert(1) opacity(0.7); }

/* ── Panels ──────────────────────────────────────────── */
.panel { display: flex; flex-direction: column; min-height: 0; overflow: hidden; border-radius: var(--radius-xl); }
.sidebar { flex: 1; }
.inspector { flex: 1; }
.panel-head { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 10px; }
.panel-title { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }

/* Tabs with a sliding indicator */
.tabs { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); margin: 12px 12px 0; padding: 4px; background: rgba(0, 0, 0, 0.25); border-radius: 12px; }
.tabs::before {
  content: ""; position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 3);
  border-radius: 9px; background: var(--surface-3); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.45s var(--ease);
}
.tabs.is-regions::before { transform: translateX(100%); }
.tabs.is-chat::before { transform: translateX(200%); }
.tab {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 7px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--muted);
  font-weight: 500; cursor: pointer; transition: color 0.3s var(--ease), transform 0.2s var(--ease);
}
.tab:hover { color: var(--ink-2); }
.tab.is-active { color: var(--ink); }
.tab.is-active .icon { color: var(--accent); }
.pane { display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 12px; gap: 10px; }
.pane.is-hidden { display: none; }
.pane:not(.is-hidden) { animation: fade-in 0.4s var(--ease); }

/* Inputs */
.input-wrap { position: relative; display: flex; align-items: center; min-width: 0; }
.key-row .input-wrap { flex: 1; }
.input-wrap > .icon { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.text-input {
  width: 100%; min-width: 0; padding: 9px 12px; border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.28); border: 1px solid var(--line); color: var(--ink); outline: none;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.text-input.with-icon { padding-left: 36px; }
.text-input::placeholder { color: var(--muted); }
.text-input:focus { border-color: rgba(52, 211, 153, 0.55); background: rgba(0, 0, 0, 0.4); }
.list-caption { font-size: 12px; color: var(--muted); padding: 0 2px; font-family: var(--mono); }

/* Float list */
.float-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -6px; padding: 0 6px 6px; }
.float-item {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "wmo span" "meta meta";
  gap: 1px 8px; width: 100%; padding: 10px 12px; text-align: left; cursor: pointer;
  background: transparent; border: 0; border-radius: var(--radius-sm);
  animation: rise 0.55s var(--ease) both; animation-delay: calc(min(var(--i, 0), 14) * 32ms);
  transition: background 0.25s var(--ease), transform 0.2s var(--ease), box-shadow 0.25s var(--ease);
}
.float-item:hover { background: rgba(255, 255, 255, 0.04); }
.float-item.is-selected { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }
.float-wmo { grid-area: wmo; font-family: var(--mono); font-weight: 500; color: var(--ink); }
.float-item.is-selected .float-wmo { color: var(--accent); }
.float-span { grid-area: span; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.float-meta { grid-area: meta; font-size: 12px; color: var(--ink-2); }

/* Skeletons and notices */
.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 6px; }
.skeleton::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent);
  animation: shimmer 1.5s var(--ease) infinite;
}
.skeleton-row { display: grid; gap: 7px; padding: 12px; }
.line-lg { height: 12px; width: 46%; }
.line-sm { height: 10px; width: 70%; }
.kpi.skeleton { border-radius: 999px; background: rgba(255, 255, 255, 0.05); }

.notice { display: grid; justify-items: start; gap: 6px; padding: 18px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.notice-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 4px; }
.notice-icon .icon { width: 20px; height: 20px; }
.notice-title { font-weight: 600; color: var(--ink); }
.notice-body { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.55; max-width: 42ch; }
.notice.is-error { border-color: rgba(248, 113, 113, 0.35); }
.notice.is-error .notice-icon { background: rgba(248, 113, 113, 0.12); color: var(--danger); }

/* AI settings */
.ai-settings { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(0, 0, 0, 0.22); }
.ai-settings summary {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--ink-2); list-style: none;
}
.ai-settings summary::-webkit-details-marker { display: none; }
.ai-settings .chevron { width: 14px; height: 14px; color: var(--muted); transition: transform 0.3s var(--ease); }
.ai-settings[open] .chevron { transform: rotate(90deg); }
.ai-status { display: flex; align-items: center; gap: 6px; margin-left: auto; font-size: 12px; color: var(--muted); }
.ai-status.is-on { color: var(--accent); }
.settings-body { display: flex; flex-direction: column; gap: 12px; padding: 2px 12px 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.field-help { font-size: 12px; color: var(--muted); margin: 0; line-height: 1.5; }
.field-help:empty { display: none; }
#pane-regions { overflow-y: auto; }   /* the Analyze form is taller than the panel on short screens */
.region-actions { display: flex; gap: 8px; }
.region-actions .btn { flex: 1; }
.key-row { display: flex; gap: 6px; }

/* Chat */
.messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 2px; }
.msg { max-width: 92%; padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.55; word-break: break-word; animation: rise 0.45s var(--ease) both; }
.msg-user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); font-weight: 500; border-bottom-right-radius: 5px; white-space: pre-wrap; }
.msg-ai { align-self: flex-start; background: rgba(255, 255, 255, 0.045); border: 1px solid var(--line); border-bottom-left-radius: 5px; color: var(--ink); }
.msg-ai p { margin: 0 0 8px; }
.msg-ai p:last-child { margin-bottom: 0; }
.msg-ai ul, .msg-ai ol { margin: 4px 0 8px; padding-left: 20px; }
.msg-ai code { font-family: var(--mono); font-size: 12px; background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }
.msg-ai strong { color: var(--ink); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent;
  color: var(--ink-2); font-size: 12px; cursor: pointer;
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.2s var(--ease);
}
.chip:hover { border-color: rgba(52, 211, 153, 0.6); color: var(--ink); }
.chat-loading { min-height: 0; }
.typing { display: inline-flex; gap: 5px; padding: 11px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.045); border: 1px solid var(--line); }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-2); animation: bob 1.1s ease-in-out infinite; }
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
.composer { display: flex; gap: 8px; padding: 6px; border-radius: var(--radius); background: rgba(0, 0, 0, 0.28); border: 1px solid var(--line); }
.composer .text-input { border: 0; background: transparent; }
.composer .text-input:focus { background: transparent; }
.composer:focus-within { border-color: rgba(52, 211, 153, 0.55); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.2s var(--ease), opacity 0.25s;
}
.btn:disabled { opacity: 0.5; cursor: progress; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: #4ade9f; }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink-2); }
.btn-ghost:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.24); }
.btn-icon { width: 38px; padding: 0; }
.btn:active:not(:disabled), .chip:active, .tab:active, .float-item:active { transform: scale(0.98); }

/* Dropdowns (react-select) */
.dd .Select-control {
  background: rgba(0, 0, 0, 0.28) !important; border: 1px solid var(--line) !important;
  border-radius: var(--radius-sm) !important; min-height: 34px; height: 34px; box-shadow: none !important; cursor: pointer;
}
.dd .Select-control:hover { border-color: var(--line-strong) !important; }
.dd .Select-value-label, .dd .Select-placeholder, .dd .Select-input > input { color: var(--ink) !important; line-height: 32px; }
.dd .Select-value, .dd .Select-placeholder { line-height: 32px !important; }
.dd .Select-menu-outer {
  background: var(--surface) !important; border: 1px solid var(--line-strong) !important;
  border-radius: var(--radius-sm) !important; margin-top: 6px; overflow: hidden; z-index: 30;
  box-shadow: var(--shadow) !important;
}
.dd .VirtualizedSelectOption { color: var(--ink-2); padding: 0 12px; }
.dd .VirtualizedSelectFocusedOption { background: var(--surface-2); color: var(--ink); }
.dd .VirtualizedSelectSelectedOption { color: var(--accent); font-weight: 500; }
.dd .Select-arrow { border-top-color: var(--muted) !important; }

/* Inspector */
.profile-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; color: var(--ink-2); }
.badge { padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-family: var(--mono); font-size: 12.5px; font-weight: 500; }
.meta-error { display: inline-flex; align-items: center; gap: 6px; color: var(--danger); }
.inspector-loading { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.inspector-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 18px 18px; display: flex; flex-direction: column; gap: 16px; }
.inspector-detail { display: flex; flex-direction: column; gap: 16px; animation: fade-in 0.4s var(--ease); }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stats:empty { display: none; }
.stat { padding: 11px 13px; border-radius: 12px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); }
.chart-block { border-top: 1px solid var(--line); padding-top: 14px; }
.chart-title { margin: 0 0 2px; font-size: 13px; font-weight: 600; color: var(--ink); }
.progress-line { position: absolute; top: 0; left: 18px; right: 18px; height: 2px; overflow: hidden; border-radius: 2px; background: var(--line); }
.progress-line::after { content: ""; position: absolute; inset: 0; width: 40%; background: var(--accent); animation: sweep 1.1s var(--ease) infinite; }

/* ── Motion ──────────────────────────────────────────── */
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes breathe { 0% { transform: scale(1); opacity: 0.55; } 70%, 100% { transform: scale(2.8); opacity: 0; } }
@keyframes breathe-solid { 0%, 100% { transform: scale(0.8); opacity: 0.5; } 50% { transform: scale(1.1); opacity: 1; } }
@keyframes bob { 0%, 100% { transform: translateY(0); opacity: 0.5; } 50% { transform: translateY(-3px); opacity: 1; } }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ── Narrower screens: map on top, panels stacked below ─ */
@media (max-width: 1279px) {
  .app { height: auto; min-height: 100dvh; overflow: visible; display: flex; flex-direction: column; gap: 12px; padding: 12px; }
  .shell, .col-left, .col-center, .col-right { display: contents; }
  .brand { order: 1; }
  .toolbar { order: 2; }
  .map-stage { order: 3; position: relative; inset: auto; height: 60vh; min-height: 420px; border-radius: var(--radius-xl); overflow: hidden; border: 1px solid var(--line); }
  .statusbar { order: 4; align-self: flex-start; }
  .shell .center-bottom { display: contents; }
  .analysis { order: 5; width: 100%; }
  .sidebar { order: 6; flex: none; height: 600px; }
  .inspector { order: 7; flex: none; }
  .inspector-body { overflow: visible; }
  .map-stage .maplibregl-ctrl-bottom-right { right: 0 !important; bottom: 0 !important; }
  .glass { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--surface); }
}
@media (max-width: 640px) {
  .toolbar { width: 100%; }
  .toolbar-rule { display: none; }
  .period { width: 100%; }
  .period .dash-dropdown { flex: 1; width: auto; }
  .map-stage { height: 54vh; min-height: 360px; }
  .hint { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
