/* MWSC Apps v3 — ops-center design system. Dark by default, light theme via [data-theme="light"]. */
:root {
  --bg: #0a1020;
  --bg-2: #0d1528;
  --panel: #111b2f;
  --panel-2: #16233c;
  --panel-3: #1c2b48;
  --line: #22324f;
  --line-2: #2d4066;
  --text: #e7eef8;
  --text-2: #b8c6db;
  --muted: #8396b3;
  --accent: #38bdf8;
  --accent-ink: #04212f;
  --amber: #f59e0b;
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --purple: #c026d3;
  --bolt: #facc15;
  --sev-extreme: #c026d3;
  --sev-severe: #ef4444;
  --sev-moderate: #f59e0b;
  --sev-minor: #3b82f6;
  --sev-unknown: #64748b;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px rgba(0,0,0,.25);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "JetBrains Mono", ui-monospace, Consolas, monospace;
  --nav-w: 236px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #eef2f8; --bg-2: #e6ecf5; --panel: #ffffff; --panel-2: #f4f7fc; --panel-3: #e9eef7;
  --line: #d7dfeb; --line-2: #c4cfe0; --text: #0f1b2d; --text-2: #33445e; --muted: #5d6f8b;
  --accent: #0284c7; --accent-ink: #ffffff; --shadow: 0 1px 2px rgba(15,27,45,.06), 0 6px 18px rgba(15,27,45,.06);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; min-height: 100vh; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { max-width: 100%; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.55rem; font-weight: 700; }
h2 { font-size: 1.15rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 .75rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.pre { white-space: pre-wrap; word-break: break-word; }

/* ── Shell ─────────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100vh; }
.nav { background: var(--bg-2); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; z-index: 40; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand img { width: 38px; height: 38px; object-fit: contain; }
.brand b { display: block; font-size: 14px; line-height: 1.1; }
.brand span { font-size: 11px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.nav-group { padding: 6px 10px; }
.nav-label { font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); padding: 10px 8px 4px; }
.nav a.item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text-2); font-weight: 500; }
.nav a.item:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.nav a.item.on { background: var(--panel-3); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.nav a.item .ico { width: 18px; text-align: center; opacity: .9; }
.nav a.item .pill { margin-left: auto; }
.nav-foot { margin-top: auto; padding: 12px 16px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.nav-foot .who { color: var(--text); font-weight: 600; }
.nav-foot a { display: inline-block; margin-right: 10px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 10px 20px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); transition: background .4s; }
.topbar .menu-btn { display: none; }
.topbar .title { font-weight: 650; font-size: 15px; margin-right: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .clock { font-family: var(--mono); color: var(--text-2); font-size: 13px; }
.threat { display: inline-flex; align-items: center; gap: 8px; padding: 5px 11px; border-radius: 999px; font-weight: 650; font-size: 12.5px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text-2); white-space: nowrap; }
.threat .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.threat:hover { text-decoration: none; }
body[data-level="advisory"] .threat { border-color: #3b82f6; color: #bfdbfe; } body[data-level="advisory"] .threat .dot { background: #3b82f6; }
body[data-level="watch"] .threat { border-color: var(--warn); color: #fde68a; } body[data-level="watch"] .threat .dot { background: var(--warn); }
body[data-level="severe"] .topbar { background: linear-gradient(90deg, rgba(234,88,12,.35), color-mix(in srgb, var(--bg) 88%, transparent) 60%); }
body[data-level="severe"] .threat { background: #c2410c; border-color: #fb923c; color: #fff; } body[data-level="severe"] .threat .dot { background: #fff; }
body[data-level="tornado"] .topbar { background: linear-gradient(90deg, rgba(220,38,38,.5), color-mix(in srgb, var(--bg) 88%, transparent) 65%); }
body[data-level="tornado"] .threat { background: #dc2626; border-color: #fca5a5; color: #fff; } body[data-level="tornado"] .threat .dot { background: #fff; animation: blink 1s steps(2) infinite; }
body[data-level="emergency"] .topbar { background: linear-gradient(90deg, rgba(192,38,211,.6), color-mix(in srgb, var(--bg) 88%, transparent) 70%); }
body[data-level="emergency"] .threat { background: var(--purple); border-color: #f0abfc; color: #fff; } body[data-level="emergency"] .threat .dot { background: #fff; animation: blink .6s steps(2) infinite; }
:root[data-theme="light"] body[data-level="advisory"] .threat { color: #1d4ed8; } :root[data-theme="light"] body[data-level="watch"] .threat { color: #92400e; }
@keyframes blink { 50% { opacity: .2; } }

.bolt-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-weight: 650; font-size: 12.5px; background: rgba(250,204,21,.12); border: 1px solid rgba(250,204,21,.55); color: var(--bolt); white-space: nowrap; }
.bolt-chip:hover { text-decoration: none; }
.bolt-chip.live { background: var(--bolt); color: #1a1400; border-color: var(--bolt); animation: pulse 2s ease-in-out infinite; }
:root[data-theme="light"] .bolt-chip:not(.live) { color: #854d0e; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(250,204,21,.6); } 50% { box-shadow: 0 0 0 6px rgba(250,204,21,0); } }

.icon-btn { background: transparent; border: 1px solid var(--line); color: var(--text-2); border-radius: 8px; height: 32px; min-width: 32px; padding: 0 8px; cursor: pointer; font: inherit; }
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn[aria-pressed="true"] { background: var(--panel-3); color: var(--text); border-color: var(--line-2); }

/* Ticker */
.ticker { display: flex; align-items: center; background: #050a16; border-bottom: 1px solid var(--line); height: 32px; overflow: hidden; font-size: 13px; }
:root[data-theme="light"] .ticker { background: #0f1b2d; color: #e7eef8; }
.ticker .tag { flex: none; padding: 0 12px; height: 100%; display: flex; align-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 750; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.ticker .viewport { overflow: hidden; flex: 1; position: relative; height: 100%; mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); }
.ticker .track { position: absolute; white-space: nowrap; display: flex; gap: 42px; align-items: center; height: 100%; will-change: transform; animation: ticker var(--dur, 60s) linear infinite; padding-left: 100%; }
.ticker:hover .track { animation-play-state: paused; }
.ticker .t-danger { color: #fca5a5; font-weight: 600; } .ticker .t-warn { color: #fde68a; } .ticker .t-ok { color: #86efac; } .ticker .t-info { color: #7dd3fc; }
.ticker .t-lightning { color: var(--bolt); font-weight: 700; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { .ticker .track { animation: none; padding-left: 12px; } }

.content { padding: 20px; max-width: 1500px; width: 100%; margin: 0 auto; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 18px; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin: 2px 0 0; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Panels & grids ─────────────────────────────────── */
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.span2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.tight { gap: 6px; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.panel > .ph { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.panel > .ph h2, .panel > .ph h3 { margin: 0; font-size: 13.5px; font-weight: 650; letter-spacing: .01em; }
.panel > .ph .ph-ico { opacity: .85; }
.panel > .ph .ph-act { margin-left: auto; display: flex; gap: 6px; align-items: center; font-size: 12px; }
.panel > .pb { padding: 14px 16px; }
.panel > .pb.flush { padding: 0; }
.panel.accent-top { border-top: 3px solid var(--accent); }

.stat { padding: 14px 16px; }
.stat .k { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.stat .v { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 4px; }
.stat .s { color: var(--muted); font-size: 12px; margin-top: 2px; }

.empty { color: var(--muted); text-align: center; padding: 26px 12px; }
.empty .big { font-size: 26px; display: block; margin-bottom: 4px; }

/* ── Lists ───────────────────────────────────────────── */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 10px 16px; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.list > li.click { cursor: pointer; }
.list > li.click:hover { background: var(--panel-2); }

.alert-row { display: grid; grid-template-columns: 4px 1fr auto; gap: 12px; align-items: start; }
.alert-row .bar { align-self: stretch; border-radius: 4px; background: var(--sev-unknown); }
.alert-row .ev { font-weight: 650; }
.alert-row .ar { color: var(--muted); font-size: 12.5px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sev-extreme .bar, .bar.sev-extreme { background: var(--sev-extreme); }
.sev-severe .bar, .bar.sev-severe { background: var(--sev-severe); }
.sev-moderate .bar, .bar.sev-moderate { background: var(--sev-moderate); }
.sev-minor .bar, .bar.sev-minor { background: var(--sev-minor); }

/* ── Badges / pills ─────────────────────────────────── */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 650; background: var(--panel-3); color: var(--text-2); border: 1px solid var(--line-2); white-space: nowrap; }
.pill.ok { background: rgba(34,197,94,.14); color: #4ade80; border-color: rgba(34,197,94,.4); }
.pill.warn { background: rgba(245,158,11,.14); color: #fbbf24; border-color: rgba(245,158,11,.45); }
.pill.danger { background: rgba(239,68,68,.15); color: #f87171; border-color: rgba(239,68,68,.45); }
.pill.info { background: rgba(56,189,248,.13); color: #7dd3fc; border-color: rgba(56,189,248,.4); }
.pill.purple { background: rgba(192,38,211,.16); color: #f0abfc; border-color: rgba(192,38,211,.45); }
.pill.bolt { background: rgba(250,204,21,.14); color: var(--bolt); border-color: rgba(250,204,21,.45); }
:root[data-theme="light"] .pill.ok { color: #15803d; } :root[data-theme="light"] .pill.warn { color: #b45309; } :root[data-theme="light"] .pill.danger { color: #b91c1c; } :root[data-theme="light"] .pill.info { color: #0369a1; } :root[data-theme="light"] .pill.bolt { color: #854d0e; } :root[data-theme="light"] .pill.purple { color: #a21caf; }
.st-Active { } .dot-s { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--muted); flex: none; }
.dot-s.Active { background: var(--ok); box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
.dot-s.Staging { background: #3b82f6; }
.dot-s.Standby { background: var(--warn); }
.dot-s.Offline { background: #475569; }

/* ── Forms ───────────────────────────────────────────── */
label { display: block; font-weight: 600; font-size: 12.5px; color: var(--text-2); margin-bottom: 5px; }
.field { margin-bottom: 14px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 400; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=tel], input[type=search], input[type=url], select, textarea {
  width: 100%; background: var(--bg-2); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 9px 11px; font: inherit; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
input[type=file] { color: var(--text-2); font: inherit; max-width: 100%; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 16px; height: 16px; vertical-align: -3px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--panel-3); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; transition: filter .15s, background .15s; text-decoration: none !important; }
.btn:hover { filter: brightness(1.12); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.ok { background: #16a34a; border-color: #16a34a; color: #fff; }
.btn.danger { background: #dc2626; border-color: #dc2626; color: #fff; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 4px 10px; font-size: 12.5px; }
.btn.block { width: 100%; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; }
.seg button, .seg a { background: transparent; border: 0; color: var(--text-2); padding: 7px 12px; font: inherit; font-weight: 600; cursor: pointer; border-right: 1px solid var(--line-2); }
.seg > :last-child { border-right: 0; }
.seg .on, .seg [aria-pressed="true"] { background: var(--panel-3); color: var(--text); }

.status-picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.status-picker button { padding: 12px 6px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text-2); font: inherit; font-weight: 650; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.status-picker button:hover { border-color: var(--accent); }
.status-picker button.on { background: var(--panel-3); color: var(--text); border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }

.notice { padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--panel-2); margin-bottom: 14px; }
.notice.ok { border-color: rgba(34,197,94,.5); background: rgba(34,197,94,.1); }
.notice.err { border-color: rgba(239,68,68,.5); background: rgba(239,68,68,.1); }
.notice.warn { border-color: rgba(245,158,11,.5); background: rgba(245,158,11,.1); }

/* ── Tables ──────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 650; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--panel); position: sticky; top: 0; }
table.t td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--panel-2); }

/* ── Map ─────────────────────────────────────────────── */
.map { height: 460px; border-radius: 0 0 var(--radius) var(--radius); background: #0b1324; z-index: 0; }
.map.tall { height: calc(100vh - 210px); min-height: 480px; }
.map.mid { height: 340px; }
.leaflet-container { font: 13px/1.4 var(--font); background: #0b1324; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel); color: var(--text); border: 1px solid var(--line-2); }
.leaflet-popup-content { margin: 10px 12px; }
.leaflet-control-layers, .leaflet-bar a { background: var(--panel) !important; color: var(--text) !important; border-color: var(--line-2) !important; }
.leaflet-control-attribution { background: rgba(10,16,32,.7) !important; color: var(--muted) !important; }
.leaflet-control-attribution a { color: var(--text-2) !important; }
.unit-icon { background: var(--accent); color: var(--accent-ink); border: 2px solid #fff; border-radius: 999px; font-weight: 750; font-size: 11px; padding: 1px 7px; white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,.4); }
.unit-icon.Active { background: var(--ok); color: #03200d; }
.unit-icon.Standby { background: var(--warn); color: #241700; }
.unit-icon.Offline, .unit-icon.stale { background: #475569; color: #fff; }
.map-legend { position: absolute; z-index: 500; bottom: 12px; left: 12px; background: color-mix(in srgb, var(--panel) 92%, transparent); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; font-size: 12px; }
.map-legend div { display: flex; align-items: center; gap: 6px; }
.map-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* ── Lightning ───────────────────────────────────────── */
.bolt-hero { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; padding: 16px; }
.bolt-hero .ring { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; background: rgba(250,204,21,.1); border: 2px solid rgba(250,204,21,.35); }
.bolt-hero.live .ring { background: var(--bolt); border-color: var(--bolt); animation: pulse 2s ease-in-out infinite; }
.bolt-hero .big { font-size: 22px; font-weight: 750; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: 6px; }
.bars .b { flex: 1; background: linear-gradient(180deg, var(--bolt), #ca8a04); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; opacity: .9; }
.bars .b.zero { background: var(--line); opacity: .7; }
.bars .b:hover { opacity: 1; outline: 1px solid var(--text); }
.bars-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-top: 4px; font-family: var(--mono); }
.countdown { font-family: var(--mono); font-size: 20px; font-weight: 700; }

/* ── Chat ───────────────────────────────────────────── */
.chat { display: grid; grid-template-columns: 220px 1fr; height: calc(100vh - 190px); min-height: 460px; }
.chat-side { border-right: 1px solid var(--line); overflow-y: auto; padding: 8px; }
.chat-side a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; color: var(--text-2); }
.chat-side a.on { background: var(--panel-3); color: var(--text); }
.chat-side a:hover { background: var(--panel-2); text-decoration: none; }
.chat-side .unread { margin-left: auto; background: var(--accent); color: var(--accent-ink); border-radius: 999px; font-size: 11px; font-weight: 700; padding: 0 7px; }
.chat > * { min-height: 0; }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-log { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.msg { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 6px 4px; border-radius: 8px; }
.msg:hover { background: var(--panel-2); }
.msg .av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 750; font-size: 13px; color: #fff; }
.msg .meta { font-size: 12px; color: var(--muted); }
.msg .meta b { color: var(--text); font-size: 13.5px; margin-right: 6px; }
.msg .body { white-space: pre-wrap; word-break: break-word; }
.msg.cont { grid-template-columns: 34px 1fr; padding-top: 0; }
.msg.cont .av, .msg.cont .meta { visibility: hidden; height: 0; }
.msg.sys .body { color: var(--muted); font-style: italic; }
.msg { position: relative; }
.msg .del { position: absolute; top: 4px; right: 6px; display: none; height: 24px; min-width: 24px; padding: 0 6px; font-size: 12px; }
.msg:hover .del, .msg:focus-within .del { display: inline-block; }
@media (hover: none) { .msg .del { display: inline-block; opacity: .6; } }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; }
.typing { height: 18px; font-size: 12px; color: var(--muted); padding: 0 16px; }

/* ── Media ───────────────────────────────────────────── */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; color: var(--text); }
.tile:hover { border-color: var(--line-2); text-decoration: none; }
.tile .thumb { aspect-ratio: 16/10; background: var(--bg-2) center/cover no-repeat; display: grid; place-items: center; color: var(--muted); font-size: 28px; position: relative; }
.tile .thumb .badge { position: absolute; top: 8px; left: 8px; }
.tile .thumb .play { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.tile .cap { padding: 9px 11px; font-size: 12.5px; }
.tile .cap b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.88); z-index: 1000; display: grid; place-items: center; padding: 20px; }
.lightbox img, .lightbox video { max-height: 86vh; max-width: 94vw; border-radius: 8px; }
.lightbox .close { position: absolute; top: 14px; right: 18px; }

/* ── Modal / toast ──────────────────────────────────── */
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: 14px; padding: 0; width: min(720px, 94vw); max-height: 88vh; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
dialog::backdrop { background: rgba(3,6,15,.7); backdrop-filter: blur(2px); }
dialog .dh { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); }
dialog .dh h2 { margin: 0; font-size: 16px; }
dialog .dh .x { margin-left: auto; }
dialog .db { padding: 16px 18px; overflow-y: auto; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--panel); border: 1px solid var(--line-2); border-left: 4px solid var(--accent); border-radius: 10px; padding: 10px 14px; box-shadow: 0 12px 30px rgba(0,0,0,.4); animation: tin .25s ease-out; cursor: pointer; }
.toast b { display: block; margin-bottom: 2px; }
.toast.danger { border-left-color: var(--danger); } .toast.warn { border-left-color: var(--warn); } .toast.ok { border-left-color: var(--ok); } .toast.bolt { border-left-color: var(--bolt); }
@keyframes tin { from { transform: translateY(10px); opacity: 0; } }

/* ── Public pages ───────────────────────────────────── */
.public-hero { padding: 26px 22px; border-radius: 16px; background: radial-gradient(1200px 300px at 10% -40%, rgba(56,189,248,.28), transparent 60%), linear-gradient(135deg, #0f1d36, #0b1428); border: 1px solid var(--line); margin-bottom: 18px; color: #e7eef8; }
.public-hero h1 { font-size: 1.8rem; }
.public-hero p { color: #b8c6db; max-width: 680px; }
.risk-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-weight: 700; color: #0b1220; }
.hail-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.hail-pick label { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 4px; cursor: pointer; font-weight: 600; text-align: center; }
.hail-pick input { position: absolute; opacity: 0; pointer-events: none; }
.hail-pick input:checked + span { color: var(--accent); }
.hail-pick label:has(input:checked) { border-color: var(--accent); background: var(--panel-3); }
.hail-pick .ball { border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #c7d7ea 60%, #8fa7c4); display: inline-block; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(900px 500px at 20% 0%, rgba(56,189,248,.18), transparent 60%), var(--bg); }
.login-card { width: min(400px, 100%); }
.login-card .brand { justify-content: center; padding: 0 0 18px; }
.login-card .brand img { width: 56px; height: 56px; }

/* ── CCWX wall display ──────────────────────────────── */
.ccwx { display: grid; gap: 12px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.ccwx .panel { display: flex; flex-direction: column; }
.ccwx .c2 { grid-column: span 2; } .ccwx .c3 { grid-column: span 3; } .ccwx .c4 { grid-column: span 4; } .ccwx .c5 { grid-column: span 5; } .ccwx .c6 { grid-column: span 6; } .ccwx .c7 { grid-column: span 7; } .ccwx .c12 { grid-column: span 12; }
.ccwx .now { font-size: 54px; font-weight: 750; line-height: 1; font-variant-numeric: tabular-nums; }
.hourly { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.hourly .h { flex: none; width: 82px; text-align: center; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 4px; }
.hourly .h .tt { font-size: 20px; font-weight: 700; }
.wind-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.wind-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: grid; grid-template-columns: 1fr auto; gap: 4px; }
.wind-card .arrow { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; grid-row: span 2; font-size: 18px; }
body.wall .shell { grid-template-columns: 1fr; }
body.wall .nav, body.wall .ticker-hide { display: none; }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: 1fr; }
  .ccwx .c2, .ccwx .c3 { grid-column: span 6; } .ccwx .c4, .ccwx .c5, .ccwx .c6, .ccwx .c7 { grid-column: span 12; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .nav { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; transform: translateX(-100%); transition: transform .2s; box-shadow: 20px 0 50px rgba(0,0,0,.4); }
  body.nav-open .nav { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 35; }
  .topbar .menu-btn { display: inline-flex; align-items: center; }
  .topbar { padding: 8px 12px; gap: 8px; }
  .topbar .clock { display: none; }
  .content { padding: 14px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .chat { grid-template-columns: 1fr; height: calc(100vh - 150px); }
  .chat-side { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 6px; gap: 4px; }
  .chat-side .nav-label { display: none; }
  .chat-side a { flex: none; }
  .map.tall { height: calc(100vh - 170px); }
  .status-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .g4 { grid-template-columns: 1fr 1fr; }
  .topbar .threat .lbl-long { display: none; }
  .topbar .title { visibility: hidden; flex: 1; }
  .topbar .threat, .bolt-chip { padding: 5px 9px; }
  .ccwx .c2, .ccwx .c3 { grid-column: span 12; }
  h1 { font-size: 1.3rem; }
  .stat .v { font-size: 22px; }
}

/* StormCAD (MWSC link) */
.cad-inc { width: 14px; height: 14px; transform: rotate(45deg); border: 2px solid #0b1220; box-shadow: 0 0 0 1px rgba(255,255,255,.35); }
.cad-unit { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 700 9px/1 ui-monospace, monospace; color: #fff; border: 2px solid #0b1220; box-shadow: 0 0 0 1px rgba(255,255,255,.3); }
