/* ---------- Area Control System · tokens ---------- */
:root {
  --bg: #0c1019;
  --bg-2: #121724;
  --panel: rgba(21, 26, 38, .92);
  --panel-solid: #171c28;
  --panel-2: rgba(255, 255, 255, .04);
  --line: rgba(180, 200, 255, .10);
  --line-2: rgba(180, 200, 255, .19);
  --text: #eef0f4;
  --text-2: #b5bac6;
  --text-3: #8b909e;
  --accent: #4f7cff;
  --accent-2: #7458ff;
  --accent-bg: rgba(79, 124, 255, .14);
  --cyan: #1fc8ff;
  --red: #ff4757;
  --orange: #ff8a2b;
  --yellow: #ffc61a;
  --green: #22d38f;
  --red-bg: rgba(255, 71, 87, .14);
  --orange-bg: rgba(255, 138, 43, .14);
  --yellow-bg: rgba(255, 198, 26, .14);
  --green-bg: rgba(34, 211, 143, .14);
  --font: "Pretendard Variable", Pretendard, -apple-system, "Segoe UI", sans-serif;
  --mono: "Pretendard Variable", Pretendard, -apple-system, "Segoe UI", sans-serif;
  --r: 14px;
  --r-sm: 10px;
  --rail-w: 76px;
  --top-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  grid-template-rows: var(--top-h) 1fr;
  height: 100vh;
  overflow: hidden;
  min-width: 1200px;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
.ph, .ph-fill { line-height: 1; }

.bg-glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(700px 500px at 88% 0%, rgba(79, 124, 255, .13), transparent 60%),
    radial-gradient(600px 500px at 8% 100%, rgba(116, 88, 255, .07), transparent 60%);
}

/* ---------- Rail (icon-only sidebar) ---------- */
.rail {
  grid-row: 1 / -1; z-index: 2;
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 0 16px; gap: 6px;
  background: rgba(12, 14, 19, .92); border-right: 1px solid var(--line);
}
.rail-logo {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-size: 22px;
  box-shadow: 0 8px 22px rgba(79, 124, 255, .35); margin-bottom: 18px;
}
.rail-nav { display: flex; flex-direction: column; gap: 6px; }
.rail-btn {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  color: var(--text-3); font-size: 22px; position: relative; transition: background .15s, color .15s;
}
.rail-btn:hover { background: var(--panel-2); color: var(--text-2); }
.rail-btn.active { background: var(--accent); color: #fff; box-shadow: 0 8px 20px rgba(79, 124, 255, .35); }
.rail-bottom { margin-top: auto; }

/* ---------- Top bar ---------- */
.topbar {
  z-index: 2; display: flex; align-items: center; gap: 18px; padding: 0 20px;
  border-bottom: 1px solid var(--line); background: rgba(12, 14, 19, .6); backdrop-filter: blur(12px);
}
.tb-title h1 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.1; }
.tb-sub { font-size: 11px; color: var(--text-3); }
.seg { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); }
.seg button { padding: 7px 13px; border-radius: 999px; font-size: 13px; color: var(--text-2); transition: background .15s, color .15s; white-space: nowrap; }
.tb-title { white-space: nowrap; }
.tb-clock, .tb-date { white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--accent); color: #fff; }
.seg.seg-sm button { padding: 5px 12px; font-size: 12px; font-family: var(--mono); }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.sev-chips { display: flex; gap: 5px; }
.chip-sev { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; font-size: 12px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text-2); }
.chip-sev .num { font-family: var(--mono); font-weight: 600; color: var(--text); }
.chip-sev.sev-critical { background: rgba(255, 71, 87, .12); border-color: rgba(255, 71, 87, .28); color: #ffb3b9; }
.chip-sev.sev-alert { background: rgba(255, 138, 43, .12); border-color: rgba(255, 138, 43, .28); color: #ffcfa8; }
.chip-sev.sev-caution { background: rgba(255, 198, 26, .12); border-color: rgba(255, 198, 26, .28); color: #f7e2a2; }
.chip-sev.sev-watch { background: rgba(34, 211, 143, .12); border-color: rgba(34, 211, 143, .28); color: #a9ecd3; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; flex: none; }
.c-red { color: var(--red); } .c-orange { color: var(--orange); } .c-yellow { color: var(--yellow); } .c-green { color: var(--green); } .c-accent { color: var(--accent); } .c-cyan { color: var(--cyan); }
.tb-clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.tb-clock .mono { font-size: 16px; font-weight: 600; }
.tb-date { font-size: 11px; color: var(--text-3); font-weight: 400; }
.tb-weather { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 15px; }
.tb-weather .ph-fill { color: var(--cyan); font-size: 22px; }
.tb-weather small { font-size: 11px; color: var(--text-3); margin-left: 2px; font-family: var(--font); }
.tb-icon { position: relative; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 20px; color: var(--text-2); background: var(--panel-2); border: 1px solid var(--line); }
.tb-icon b { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-family: var(--mono); display: grid; place-items: center; padding: 0 5px; }

/* ---------- Main ---------- */
.main { position: relative; overflow: auto; z-index: 1; }

/* ---------- Tags / buttons ---------- */
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 7px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.tag-red { background: var(--red); color: #fff; }
.tag-red-soft { background: var(--red-bg); color: var(--red); }
.tag-orange-soft { background: var(--orange-bg); color: var(--orange); }
.tag-yellow-soft { background: var(--yellow-bg); color: var(--yellow); }
.tag-green-soft { background: var(--green-bg); color: var(--green); }
.tag-accent-soft { background: var(--accent-bg); color: var(--accent); }
.tag-gray { background: var(--panel-2); color: var(--text-2); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 11px; font-size: 13px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; transition: transform .08s, background .15s, box-shadow .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #5f88ff; }
.btn-ghost { background: var(--panel-2); border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { background: rgba(255, 255, 255, .08); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .4; cursor: default; transform: none; box-shadow: none; }
.btn .ph { font-size: 16px; }

/* ---------- Map screen ---------- */
.mapscreen { position: absolute; inset: 0; }
.map { position: absolute; inset: 0; background: #10141d; }
.leaflet-container { background: #10141d; font-family: var(--font); }
.map .leaflet-tile-pane { filter: brightness(.72) contrast(1.08) saturate(.6); }

.fl { position: absolute; top: 16px; bottom: 16px; z-index: 500; display: flex; flex-direction: column; gap: 12px; pointer-events: none; }
.fl > * { pointer-events: auto; }
.fl-left { left: 16px; width: 276px; }
.fl-right { right: 16px; width: 308px; pointer-events: auto; overflow-y: auto; scrollbar-width: none; }
.fl-right::-webkit-scrollbar { display: none; }
.map .leaflet-tile-pane { filter: brightness(.72) contrast(1.08) saturate(.6); }
.fp {
  background: var(--panel); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: 0 16px 44px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(255, 255, 255, .04);
  flex: none; min-height: 0;
}
.fp-grow { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.fp-scroll { overflow: auto; min-height: 0; }
.fp-head { display: flex; align-items: center; gap: 9px; padding: 13px 16px 9px; font-size: 13px; font-weight: 600; }
.fp-head .ph, .fp-head .ph-fill { color: var(--accent); font-size: 18px; }
.fp-head .meta { margin-left: auto; font-size: 11px; color: var(--text); font-weight: 400; }
.fp-head .x { margin-left: auto; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 16px; }
.fp-head .x .ph { color: #fff; }
.fp-head .x:hover { background: rgba(255, 255, 255, .1); }
.fp-body { padding: 4px 16px 14px; }

.grp { width: 100%; text-align: left; font-size: 12px; color: var(--text-2); letter-spacing: .02em; padding: 9px 16px; display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); }
.grp:hover { background: var(--panel-2); }
.grp .ph { font-size: 14px; color: var(--text-3); }
.grp .cnt { margin-left: auto; font-size: 11px; color: var(--text-3); font-family: var(--mono); }
.grp.active { color: var(--text); }
.grp.active .ph { color: var(--accent); }
.switch { width: 30px; height: 16px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line-2); position: relative; flex: none; transition: background .15s, border-color .15s; }
.switch::after { content: ""; position: absolute; top: 1px; left: 1px; width: 12px; height: 12px; border-radius: 50%; background: var(--text-3); transition: left .15s, background .15s; }
.switch.on { background: var(--accent); border-color: var(--accent); }
.switch.on::after { left: 15px; background: #fff; }
.grp-body { padding-bottom: 4px; }
.grp-body.disabled .ck { opacity: .35; pointer-events: none; }
.grp-body.disabled .ck .box { background: transparent; border-color: var(--line-2); color: transparent; }
.ck { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 6px 16px; font-size: 13px; color: var(--text); }
.ck.off { color: var(--text-3); }
.ck .box { width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--line-2); display: grid; place-items: center; font-size: 12px; color: transparent; flex: none; transition: background .15s; }
.ck:not(.off) .box { background: var(--accent); border-color: var(--accent); color: #fff; }
.ck .ph-row { margin-left: auto; font-size: 15px; color: var(--text-3); }

.search { display: flex; align-items: center; gap: 8px; margin: 2px 12px 8px; padding: 8px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text-3); }
.search input { flex: 1; background: none; border: 0; outline: 0; color: var(--text); font-size: 12px; }
.search input::placeholder { color: var(--text-3); }
.ev-row { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 9px 16px; border-top: 1px solid var(--line); }
.ev-row:hover { background: var(--panel-2); }
.ev-row .ic { font-size: 20px; }
.ev-row .t { font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.ev-row .s { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.ev-row .tm { font-family: var(--mono); font-size: 11px; color: var(--text-3); align-self: start; padding-top: 2px; }

.detail { border-width: 2px; border-color: var(--line-2); }
.detail.lv-critical { border-color: var(--red); box-shadow: 0 16px 44px rgba(0, 0, 0, .45), 0 0 28px rgba(255, 71, 87, .22); }
.detail.lv-alert { border-color: var(--orange); box-shadow: 0 16px 44px rgba(0, 0, 0, .45), 0 0 28px rgba(255, 138, 43, .18); }
.detail.lv-caution { border-color: var(--yellow); box-shadow: 0 16px 44px rgba(0, 0, 0, .45), 0 0 28px rgba(255, 198, 26, .18); }
.detail.lv-watch { border-color: var(--green); box-shadow: 0 16px 44px rgba(0, 0, 0, .45), 0 0 28px rgba(34, 211, 143, .18); }
.dt-name { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; }
.dt-name .id { font-family: var(--mono); font-size: 13px; color: var(--accent); font-weight: 600; }
.dt-score { display: flex; align-items: baseline; gap: 10px; margin: 10px 0 8px; }
.dt-score b { font-family: var(--mono); font-size: 38px; font-weight: 700; line-height: 1; }
.dt-score span { font-size: 11.5px; color: var(--text-2); }
.kv-row { display: flex; justify-content: space-between; padding: 7px 0; border-top: 1px solid var(--line); font-size: 12.5px; }
.kv-row .k { color: var(--text-2); }
.kv-row .v { font-weight: 600; }
.dt-actions { display: grid; gap: 8px; margin-top: 12px; }

.rg-row { display: grid; grid-template-columns: 8px 1fr auto 34px 42px; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 8px 16px; font-size: 13px; font-weight: 600; border-top: 1px solid var(--line); }
.rg-row:hover { background: var(--panel-2); }
.rg-row.is-critical { background: rgba(255, 71, 87, .10); }
.rg-row.is-critical:hover { background: rgba(255, 71, 87, .16); }
.rg-row .lv { font-size: 11px; font-weight: 600; }
.rg-row .sc { font-family: var(--mono); font-size: 15px; text-align: right; }
.rg-row .dl { font-family: var(--mono); font-size: 11px; text-align: right; color: var(--text-3); font-weight: 500; }
.rg-row .dl.up { color: var(--red); }
.rg-more { width: 100%; padding: 8px; font-size: 11px; color: var(--text-3); border-top: 1px solid var(--line); }
.rg-more:hover { color: var(--text); }
.top-row { display: grid; grid-template-columns: 42px 1fr auto; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 9px 16px; border-top: 1px solid var(--line); }
.top-row:hover { background: var(--panel-2); }
.top-row .id { font-family: var(--mono); font-size: 12px; color: var(--accent); font-weight: 600; }
.top-row .n { font-size: 13px; font-weight: 600; }
.top-row .s { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.top-row .sc { font-family: var(--mono); font-size: 16px; font-weight: 700; }

.map-top { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); z-index: 500; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.map-top .row { display: flex; align-items: center; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--panel); backdrop-filter: blur(14px); border: 1px solid var(--line); font-size: 12px; color: var(--text-2); box-shadow: 0 10px 30px rgba(0, 0, 0, .3); white-space: nowrap; }
.chip .ph, .chip .ph-fill { color: var(--accent); font-size: 16px; }
.chip b { color: var(--text); font-weight: 600; }
.chip .seg { padding: 3px; }
.chip.chip-seg { padding: 4px 6px 4px 14px; }
.region-chip .btn { margin-left: 6px; }
.region-chip .crumbs { font-size: 11px; color: var(--text-3); }

.map-bl { position: absolute; left: 308px; bottom: 16px; z-index: 500; }
.legend { display: flex; align-items: center; gap: 14px; padding: 9px 14px; }
.legend .lg { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--text-2); }
.legend .lg i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend .lg .mono { color: var(--text-3); font-size: 11px; }
.legend .note { font-size: 11px; color: var(--text-3); border-left: 1px solid var(--line-2); padding-left: 12px; }

.map-br { position: absolute; right: 336px; top: 16px; z-index: 500; display: flex; flex-direction: column; gap: 6px; }
.rb { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--panel); backdrop-filter: blur(14px); border: 1px solid var(--line); color: var(--text-2); font-size: 18px; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }
.rb:hover { color: var(--text); background: rgba(30, 38, 66, .9); }
.scale-chip { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 500; padding: 8px 14px 9px; }
.scale-chip .bar { display: flex; height: 5px; width: 150px; border-radius: 2px; overflow: hidden; }
.scale-chip .bar span { flex: 1; }
.scale-chip .bar span:nth-child(odd) { background: var(--text-2); }
.scale-chip .bar span:nth-child(even) { background: rgba(255, 255, 255, .15); }
.scale-chip .ticks { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10px; color: var(--text-3); margin-top: 4px; }
.map-attrib { position: absolute; left: 50%; transform: translateX(-50%); bottom: 2px; z-index: 500; font-size: 10px; color: var(--text-3); }
.map-attrib.raised { bottom: 68px; }

/* ---------- Pages ---------- */
.page { padding: 20px 24px 32px; display: grid; gap: 16px; }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; align-items: stretch; }
.col-3 { grid-column: span 3; } .col-4 { grid-column: span 4; } .col-5 { grid-column: span 5; } .col-6 { grid-column: span 6; } .col-7 { grid-column: span 7; } .col-8 { grid-column: span 8; } .col-9 { grid-column: span 9; } .col-12 { grid-column: span 12; }
.card { background: var(--panel-solid); border: 1px solid rgba(255, 255, 255, .16); border-radius: var(--r); padding: 18px 20px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04); }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head .ph, .card-head .ph-fill { color: var(--accent); font-size: 18px; }
.card-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.card-meta { margin-left: auto; font-size: 11px; color: var(--text-3); font-family: var(--mono); }
.card-link { margin-left: auto; font-size: 11px; color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; }
.card-link:hover { color: var(--accent); }
.card-desc { color: var(--text-2); font-size: 12.5px; margin: -6px 0 14px; }

.hero { display: flex; align-items: center; gap: 22px; }
.card.lv-critical { background: linear-gradient(135deg, rgba(255, 71, 87, .16), rgba(255, 71, 87, .06)), var(--panel-solid); border-color: rgba(255, 71, 87, .45); }
.card.lv-alert { background: linear-gradient(135deg, rgba(255, 138, 43, .16), rgba(255, 138, 43, .06)), var(--panel-solid); border-color: rgba(255, 138, 43, .45); }
.card.lv-caution { background: linear-gradient(135deg, rgba(255, 198, 26, .14), rgba(255, 198, 26, .05)), var(--panel-solid); border-color: rgba(255, 198, 26, .4); }
.card.lv-watch { background: linear-gradient(135deg, rgba(34, 211, 143, .14), rgba(34, 211, 143, .05)), var(--panel-solid); border-color: rgba(34, 211, 143, .4); }
.ring { position: relative; width: 112px; height: 112px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .val { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .val b { font-family: var(--mono); font-size: 32px; font-weight: 700; line-height: 1; }
.ring .val span { font-size: 10px; color: var(--text); display: block; margin-top: 3px; }
.hero-t { flex: 1; min-width: 0; }
.hero-t h2 { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.hero-t h2 .id { font-family: var(--mono); font-size: 15px; color: var(--accent); }
.hero-t p { color: var(--text-2); font-size: 12.5px; margin-top: 6px; }
.hero-actions { display: flex; gap: 8px; margin-top: 12px; }

.mini { background: var(--panel-solid); border: 1px solid rgba(255, 255, 255, .16); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; }
.mini-head { display: flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 600; color: var(--text); }
.mini-ic { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-size: 16px; }
.mini-ic.red { background: var(--red-bg); color: var(--red); } .mini-ic.orange { background: var(--orange-bg); color: var(--orange); } .mini-ic.yellow { background: var(--yellow-bg); color: var(--yellow); } .mini-ic.accent { background: var(--accent-bg); color: var(--accent); } .mini-ic.green { background: var(--green-bg); color: var(--green); } .mini-ic.cyan { background: rgba(31, 200, 255, .14); color: var(--cyan); }
.mini-val { font-family: var(--mono); font-size: 24px; font-weight: 700; margin: 12px 0 8px; line-height: 1; }
.mini-val small { font-family: var(--font); font-size: 11px; color: var(--text-3); font-weight: 500; margin-left: 6px; }
.mini-sub { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); margin-top: auto; padding-top: 8px; }
.bar { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 2px; background: var(--accent); }

.comp { display: grid; gap: 10px; }
.comp-row .top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.comp-row .k { font-size: 13px; font-weight: 600; }
.comp-row .v { font-family: var(--mono); font-size: 14px; font-weight: 600; }
.comp-row .n { font-size: 11px; color: var(--text-3); margin-top: 5px; }
.comp-total { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px; border-radius: var(--r-sm); background: var(--panel-2); margin-top: 4px; font-weight: 600; }
.comp-total .v { font-family: var(--mono); font-size: 15px; color: var(--red); }
.comp-total small { font-family: var(--font); font-size: 11px; color: var(--text-2); font-weight: 500; margin-left: 8px; }

.chart { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; gap: 18px; font-size: 12px; color: var(--text-2); margin-top: 8px; }
.chart-legend i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 7px; }
.callout { margin-top: 12px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--red-bg); color: var(--red); font-weight: 600; font-size: 12.5px; display: flex; align-items: center; gap: 8px; }
.callout .ph-fill { font-size: 16px; }

.dmg-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.dmg { border-radius: var(--r-sm); padding: 14px 16px; background: var(--panel-2); border: 1px solid var(--line); }
.dmg.orange, .dmg.yellow { background: var(--panel-2); border-color: var(--line); }
.dmg .h { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 13px; gap: 8px; }
.dmg .b { color: var(--text-2); font-size: 12px; margin-top: 6px; }
.dmg .f { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); margin-top: 8px; }
.dmg .f .v { font-family: var(--mono); font-weight: 600; }

.gnn { display: grid; gap: 8px; }
.gnn-row { display: grid; grid-template-columns: auto 46px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--r-sm); background: var(--panel-2); border: 1px solid var(--line); }
.gnn-row .id { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.gnn-row .n { font-size: 13px; font-weight: 600; }
.gnn-row .e { font-size: 11px; color: var(--text-3); }
.gnn-row .im { font-family: var(--mono); font-size: 13px; font-weight: 700; }

/* ---------- Actions page ---------- */
.act-head { display: flex; align-items: center; gap: 20px; }
.act-head h2 { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
.act-head h2 .id { font-family: var(--mono); font-size: 15px; color: var(--accent); }
.act-head p { color: var(--text-2); font-size: 12.5px; margin-top: 6px; white-space: nowrap; }
.act-head .actions { margin-left: auto; display: flex; gap: 8px; }
.act { border: 1px solid var(--line-2); border-radius: var(--r); padding: 16px 18px; background: var(--panel-2); margin-bottom: 12px; }
.act.approved { border-color: rgba(34, 211, 143, .55); background: rgba(34, 211, 143, .05); }
.act.rejected { opacity: .5; }
.act.pending { border-color: rgba(255, 198, 26, .5); background: rgba(255, 198, 26, .04); }
.act .h { display: flex; align-items: center; gap: 12px; }
.act .h .id { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.act .h .t { font-size: 15px; font-weight: 700; }
.act .h .tags { margin-left: auto; display: flex; gap: 6px; }
.act .b { color: var(--text-2); font-size: 13px; margin: 10px 0; line-height: 1.55; }
.act .b[contenteditable="true"] { outline: 1px solid var(--accent); border-radius: 6px; padding: 6px 8px; background: var(--bg); color: var(--text); }
.act .f { display: flex; align-items: center; gap: 12px; font-size: 11.5px; color: var(--text-3); }
.act .f .basis b { font-weight: 500; margin-right: 6px; }
.act .f .actions { margin-left: auto; display: flex; gap: 6px; }
.act .f .ok { margin-left: auto; color: var(--green); font-size: 12px; display: inline-flex; align-items: center; gap: 5px; }

.rcp { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 11px 12px; border-radius: var(--r-sm); background: var(--panel-2); border: 1px solid var(--line); margin-bottom: 8px; }
.rcp .box { width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--line-2); display: grid; place-items: center; font-size: 13px; color: transparent; flex: none; }
.rcp.on .box { background: var(--accent); border-color: var(--accent); color: #fff; }
.rcp .n { font-size: 14px; font-weight: 700; }
.rcp .r { font-size: 11px; color: var(--text-3); margin-left: 6px; }
.rcp .s { font-size: 12px; color: var(--text-2); margin-top: 2px; }

.exec { padding: 12px 14px; border-radius: var(--r-sm); background: var(--panel-2); border: 1px solid var(--line); margin-bottom: 8px; }
.exec .h { display: flex; align-items: center; gap: 10px; }
.exec .h .id { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.exec .h .t { font-size: 13px; font-weight: 600; }
.exec .h .c { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--green); }
.exec .steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.exec .steps i { display: block; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .06); }
.exec .steps i.done { background: var(--green); }
.exec .steps span { display: block; font-size: 10.5px; color: var(--text-3); margin-top: 5px; }

/* ---------- Toast ---------- */
.toast-host { position: fixed; right: 24px; bottom: 24px; z-index: 2000; display: grid; gap: 8px; }
.toast { background: var(--panel-solid); border: 1px solid var(--line-2); border-left: 3px solid var(--accent); border-radius: var(--r-sm); padding: 12px 16px; font-size: 13px; box-shadow: 0 12px 34px rgba(0, 0, 0, .45); animation: toast-in .2s ease; }
.toast.ok { border-left-color: var(--green); }
.toast.warn { border-left-color: var(--yellow); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } .btn, .seg button, .rail-btn, .ck .box { transition: none; } }
.empty { padding: 28px 16px; text-align: center; color: var(--text-3); font-size: 12px; }

/* ---------- Reports / Datasync / Model ---------- */
.c-muted { color: var(--text-3); }
.seg.seg-xs button { padding: 4px 10px; font-size: 12px; }
.seg.seg-xs .n { font-family: var(--mono); font-size: 11px; margin-left: 5px; opacity: .7; }
.list-row { display: grid; grid-template-columns: 22px 44px 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 11px 12px; border-radius: var(--r-sm); border: 1px solid transparent; }
.list-row .ic { font-size: 18px; }
.list-row:hover { background: var(--panel-2); }
.list-row.is-active { background: var(--accent-bg); border-color: rgba(79, 124, 255, .35); }
.list-row .tm { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
.list-row .t { font-size: 13.5px; font-weight: 600; }
.list-row .s { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.detail-title { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.kv { display: grid; grid-template-columns: 80px 1fr; gap: 8px 12px; font-size: 13px; margin: 14px 0; }
.kv .k { color: var(--text-3); }
.detail-body { color: var(--text-2); font-size: 13px; line-height: 1.6; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; }
.section-label { font-size: 12px; color: var(--text-2); font-weight: 600; margin: 18px 0 6px; }
.timeline li { display: grid; grid-template-columns: 46px 1fr; gap: 12px; padding: 7px 0; font-size: 12.5px; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; }
.timeline .t { font-family: var(--mono); color: var(--text-3); }
.timeline .who { color: var(--text-3); margin-left: 8px; }
.detail-actions { display: flex; gap: 8px; margin-top: 18px; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 500; font-size: 11px; color: var(--text-3); padding: 6px 12px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td.mono, .table th.mono { font-family: var(--mono); }
.table td.right, .table th.right { text-align: right; }
.table .name { font-weight: 600; }
.table .sub { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.uptime { display: flex; gap: 2px; }
.uptime i { display: block; width: 5px; height: 14px; border-radius: 2px; background: var(--green); opacity: .75; }
.uptime i.warn { background: var(--yellow); }
.uptime i.miss { background: var(--red); }
.log-row { display: grid; grid-template-columns: 70px 1fr auto; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 12.5px; align-items: center; }
.log-row:first-of-type { border-top: 0; }
.log-row .t { font-family: var(--mono); color: var(--text-3); }
.log-row .src { color: var(--text-3); font-size: 11px; }

.grade-grid { display: grid; grid-template-columns: 1fr repeat(4, 74px); gap: 10px 10px; align-items: center; font-size: 13px; }
.grade-grid .h { font-size: 11px; color: var(--text-3); text-align: right; }
.grade-grid .g { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.grade-grid .n { font-family: var(--mono); text-align: right; }
.bars { display: grid; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 56px 1fr 40px; gap: 12px; align-items: center; font-size: 12.5px; }
.bar-row .k { color: var(--text-2); }
.bar-row .n { font-family: var(--mono); text-align: right; color: var(--text-2); }
.retrain li { display: grid; grid-template-columns: 70px 56px 1fr auto; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 12.5px; align-items: center; }
.retrain li:first-child { border-top: 0; }
.retrain .v { font-family: var(--mono); font-weight: 600; }
.retrain .d { font-family: var(--mono); color: var(--text-3); }
.retrain .n { color: var(--text-2); }

/* ---------- Scrollbars (dark) ---------- */
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .16) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .13); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .28); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }
.fp-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .10); background-clip: padding-box; }

/* ---------- Map layer icons, markers, floating detail card ---------- */
.ck .ph-row { margin-left: auto; font-size: 16px; color: var(--text-2); }
.ck.off .ph-row { color: var(--text-3); opacity: .5; }
.cell-ic { display: grid; place-items: center; font-size: 13px; color: #fff; pointer-events: none; background: none; border: 0; }
.vuln-ic { background: none; border: 0; }
.vuln-ic span { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-size: 13px; color: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .22), 0 1px 3px rgba(0, 0, 0, .14); transition: transform .12s; }
.vuln-ic:hover span { transform: translateY(-1px) scale(1.06); }
.leaflet-tooltip.acs-tip { background: var(--panel-solid); color: var(--text); border: 1px solid var(--line-2); border-radius: 8px; padding: 5px 10px; font-size: 12px; font-family: var(--font); box-shadow: 0 8px 24px rgba(0, 0, 0, .45); }
.leaflet-tooltip.acs-tip::before { border-top-color: var(--line-2); }
.cell-card { position: absolute; z-index: 650; width: 300px; }
.pulse-ic { background: none; border: 0; pointer-events: none; }
.pulse { position: relative; display: block; width: 0; height: 0; }
.pulse i { position: absolute; left: -22px; top: -22px; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 18%, transparent); opacity: 0; animation: pulse 2s ease-out infinite; }
.pulse i:nth-child(2) { animation-delay: 1s; }
@keyframes pulse { 0% { transform: scale(.5); opacity: .9; } 100% { transform: scale(2.8); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pulse i { animation: none; opacity: .5; transform: scale(1.6); } }
.ev-row { grid-template-columns: 22px 1fr auto; }
.ev-row .r { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ev-row .r .tm { padding-top: 0; }

/* ---------- Collapsible floating panels ---------- */
.fp-toggle { margin-left: auto; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-size: 14px; flex: none; }
.fp-head .meta + .fp-toggle { margin-left: 6px; }
.fp-toggle .ph { color: var(--text-2); transition: transform .15s; }
.fp-toggle:hover { background: rgba(255, 255, 255, .08); }
.fp.collapsed .fp-toggle .ph { transform: rotate(180deg); }
.fp.collapsed { flex: none; }
.fp.collapsed .fp-head { padding-bottom: 13px; }
.fp-grow .fp-content { display: flex; flex-direction: column; min-height: 0; flex: 1; }

/* ---------- Detail card buttons: neutral so they sit with any level border ---------- */
.cell-card .btn-primary { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .16); color: #fff; }
.cell-card .btn-primary:hover { background: rgba(255, 255, 255, .18); }
.cell-card .btn-ghost { background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .10); color: var(--text-2); }
.cell-card .btn-ghost:hover { background: rgba(255, 255, 255, .09); color: var(--text); }

/* ---------- Composition total: level-tinted ---------- */
.comp-total.lv-critical .v { color: var(--red); }
.comp-total.lv-alert .v { color: var(--orange); }
.comp-total.lv-caution .v { color: var(--yellow); }
.comp-total.lv-watch .v { color: var(--green); }
.comp-total.lv-critical { background: rgba(255, 71, 87, .12); }
.comp-total.lv-alert { background: rgba(255, 138, 43, .12); }
.comp-total.lv-caution { background: rgba(255, 198, 26, .12); }
.comp-total.lv-watch { background: rgba(34, 211, 143, .12); }

/* ---------- Composition bars: thicker ---------- */
.comp-row .bar { height: 8px; border-radius: 4px; }
.comp-row .bar i { border-radius: 4px; }
.comp { gap: 12px; }

/* ---------- Cards: gradient border for depth ---------- */
.card, .mini {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--panel-solid), var(--panel-solid)) padding-box,
    linear-gradient(155deg, rgba(255, 255, 255, .26) 0%, rgba(255, 255, 255, .12) 30%, rgba(255, 255, 255, .06) 65%, rgba(255, 255, 255, .14) 100%) border-box;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 10px 28px rgba(0, 0, 0, .28);
}

/* ---------- Metric card bars: slightly thicker ---------- */
.mini .bar { height: 6px; border-radius: 3px; }
.mini .bar i { border-radius: 3px; }

/* ---------- Recipient rows: more visible ---------- */
.rcp { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .13); }
.rcp:hover { background: rgba(255, 255, 255, .10); }
.rcp.on { background: rgba(79, 124, 255, .14); border-color: rgba(79, 124, 255, .4); }
.rcp.on:hover { background: rgba(79, 124, 255, .2); }

/* ---------- Report body: emphasized ---------- */
.detail-body { display: flex; gap: 12px; align-items: flex-start; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .18); color: var(--text); font-size: 14px; line-height: 1.7; padding: 14px 16px; }
.detail-body .ph { font-size: 20px; color: var(--accent); flex: none; margin-top: 2px; }
.detail-body p { margin: 0; }

/* ---------- Location shortcut in report detail ---------- */
.kv .loc { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.loc-btn { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 7px; font-size: 11.5px; font-weight: 600; color: var(--accent); background: var(--accent-bg); border: 1px solid rgba(79, 124, 255, .3); }
.loc-btn:hover { background: rgba(79, 124, 255, .24); }
.loc-btn .ph { font-size: 13px; }

/* ---------- Region error bars: match composition bar thickness ---------- */
.bar-row .bar { height: 8px; border-radius: 4px; }
.bar-row .bar i { border-radius: 4px; }
.bars { gap: 12px; }

/* ---------- Top bar: fit long title ---------- */
.topbar { gap: 14px; }
.tb-right { gap: 12px; }
.chip-sev { white-space: nowrap; }
.seg button { padding: 6px 11px; font-size: 12.5px; }
@media (max-width: 1560px) { .tb-sub { display: none; } }

/* ---------- Unified bar thickness (8px everywhere) ---------- */
.bar, .mini .bar, .comp-row .bar, .bar-row .bar, .exec .steps i { height: 8px; border-radius: 4px; }
.bar i, .mini .bar i, .comp-row .bar i, .bar-row .bar i { border-radius: 4px; }

/* ---------- Detail card linked to selected list row ---------- */
.card.linked {
  background:
    linear-gradient(var(--panel-solid), var(--panel-solid)) padding-box,
    linear-gradient(rgba(79, 124, 255, .45), rgba(79, 124, 255, .45)) border-box;
}
.card.linked {
  background:
    linear-gradient(rgba(79, 124, 255, .08), rgba(79, 124, 255, .08)) padding-box,
    linear-gradient(var(--panel-solid), var(--panel-solid)) padding-box,
    linear-gradient(rgba(79, 124, 255, .45), rgba(79, 124, 255, .45)) border-box;
}

/* ---------- Report row: time aligned to badge right edge ---------- */
.ev-row .r .tm { align-self: flex-end; text-align: right; }

/* ---------- v3: hazard glow layer ---------- */
.leaflet-heat-pane svg { overflow: visible; }
.leaflet-heat-pane { will-change: filter; }
.leaflet-heatHit-pane path { cursor: pointer; }
.pulse i { border-width: 1.5px; }

/* ---------- v3: critical cells pulse automatically (slightly calmer than selection) ---------- */
.pulse.pulse-auto i { animation-duration: 2.6s; opacity: 0; }
.pulse.pulse-auto i:nth-child(2) { animation-delay: 1.3s; }

/* ---------- v3: hazard type cues ---------- */
.type-chip { display: grid; place-items: center; border-radius: 6px; background: rgba(12, 16, 25, .78); color: #fff; font-size: 12px; border: 1px solid rgba(255, 255, 255, .22); pointer-events: none; }
.leaflet-tooltip.acs-tip .ph-fill { font-size: 14px; vertical-align: -2px; margin-right: 6px; color: var(--text-2); }
.grp-body [data-layer]:hover { background: var(--panel-2); }

/* ---------- v3: shape legend ---------- */
.legend .shapes { display: inline-flex; align-items: center; gap: 6px; }
.legend .sh { display: inline-block; background: var(--text-2); opacity: .85; margin-left: 8px; }
.legend .sh:first-child { margin-left: 0; }
.legend .sh-rain { width: 10px; height: 10px; border-radius: 50%; }
.legend .sh-river { width: 18px; height: 7px; border-radius: 50%; transform: rotate(-30deg); }
.legend .sh-slide { width: 11px; height: 11px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }

/* ---------- Floating panels: brighter border ---------- */
.fp { border-color: rgba(200, 212, 255, .24); }
