body { overflow: hidden; }
:root { --crit: #ef4444; --warn-c: #f59e0b; }

/* ---------------------------------------------------------- top bar */
.topbar { height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: .14em; }
.brand img { width: 26px; height: 26px; }
#missionSelect { width: auto; max-width: 300px; font-weight: 600; }
.mission-clock { font-size: 12px; color: var(--muted); white-space: nowrap; }
.mission-clock b { color: var(--text); font-weight: 650; }
.top-kpis { display: flex; gap: 6px; }
.kchip { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); cursor: pointer; }
.kchip b { color: var(--text); font-weight: 650; }
.kchip.alarm { border-color: #7f1d1d; background: #2a1215; color: #fca5a5; }
.kchip.alarm b { color: #fff; }
.kchip.live { border-color: #7f1d1d; color: #fca5a5; }
.kchip.live b { color: #fff; }
.clock { font-family: var(--mono); font-size: 13px; color: var(--muted); }

.layout { display: flex; height: calc(100% - 52px); }

/* ---------------------------------------------------------- rail */
.rail { width: 64px; flex: none; background: var(--bg); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 6px 0; gap: 2px; }
.rail button { position: relative; flex-direction: column; gap: 2px; border: 0; border-radius: 0; background: transparent; padding: 8px 2px; color: var(--muted); border-left: 3px solid transparent; }
.rail button:hover { background: var(--panel); }
.rail button.on { color: var(--text); background: var(--panel); border-left-color: var(--accent); }
.rail .ri { font-size: 19px; line-height: 1; }
.rail .rt { font-size: 10px; letter-spacing: .02em; }
.rb { position: absolute; top: 3px; right: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.rb:empty { display: none; }
.rb.alarm { background: var(--crit); color: #fff; }
.rb.warn { background: var(--warn-c); color: #1c1003; }

/* ---------------------------------------------------------- panel */
.panel { width: 360px; flex: none; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.panel-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 10px; border-bottom: 1px solid var(--line); min-height: 50px; }
.panel-head h2 { font-size: 16px; flex: 1; }
.panel-tools { display: flex; gap: 6px; }
.panel-body { flex: 1; overflow: auto; display: flex; flex-direction: column; min-height: 0; }
.sec { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.sec:last-child { border-bottom: 0; }
.sec > h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 650; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.sec > h3 .spacer + * { text-transform: none; letter-spacing: 0; }
.sub { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; margin: 10px 0 6px; }
.filters { padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; background: var(--panel); position: sticky; top: 0; z-index: 2; }
.filters .row > select { flex: 1; padding: 4px 8px; font-size: 12px; }
.seg.full { display: flex; }
.seg.full button { flex: 1; padding: 4px 6px; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; font-size: 13px; }
.checks .wide { grid-column: 1 / -1; }
select.inline { width: auto; padding: 2px 6px; font-size: 12px; margin-left: 4px; }
.chips.compact .chip { font-size: 11px; padding: 2px 8px 2px 6px; }

/* mission card + KPI tiles */
.mcard h3 { font-size: 16px; text-transform: none; letter-spacing: -.01em; color: var(--text); margin-bottom: 4px; }
.mcard .desc { color: var(--muted); font-size: 13px; margin-top: 4px; white-space: pre-wrap; }
.mtime { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 6px; }
.mtime b { color: var(--text); font-weight: 650; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; cursor: pointer; text-align: left; display: block; }
.tile:hover { border-color: #33465a; }
.tile .tl { font-size: 12px; color: var(--muted); }
.tile .tv { font-size: 26px; font-weight: 650; line-height: 1.15; margin-top: 2px; }
.tile .ts { font-size: 11px; color: var(--faint); margin-top: 2px; }
.tile.alarm { border-color: #7f1d1d; background: #1f1013; }
.tile.alarm .ts { color: #fca5a5; }

/* action list */
.alist { display: flex; flex-direction: column; gap: 6px; }
.aitem { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--warn-c); cursor: pointer; font-size: 13px; }
.aitem.crit { border-left-color: var(--crit); }
.aitem.info { border-left-color: var(--accent); }
.aitem .ai { width: 18px; text-align: center; flex: none; }
.aitem .at { flex: 1; min-width: 0; }
.aitem .at b { font-weight: 650; }
.aitem .at span { display: block; color: var(--muted); font-size: 12px; }
.ok-note { color: var(--muted); font-size: 13px; display: flex; gap: 8px; align-items: center; }
.ok-note::before { content: "✓"; color: #86efac; font-weight: 800; }

/* single-series bar list (counts per marker type) */
.bars { display: flex; flex-direction: column; gap: 7px; }
.bar { display: grid; grid-template-columns: 130px 1fr 28px; gap: 8px; align-items: center; font-size: 12px; cursor: pointer; }
.bar .bl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.bar .bt { height: 8px; border-radius: 0 4px 4px 0; background: var(--panel-3); position: relative; }
.bar .bf { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; background: var(--accent); min-width: 2px; }
.bar .bv { color: var(--muted); text-align: right; }
.bar:hover .bf { background: #7dd3fc; }

.courselist { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.courselist div { display: flex; gap: 8px; cursor: pointer; }
.courselist .km { font-family: var(--mono); font-size: 12px; color: var(--muted); width: 58px; flex: none; text-align: right; }

/* ---------------------------------------------------------- lists */
.list { padding: 4px 0; }
.item { display: flex; gap: 10px; padding: 8px 14px; cursor: pointer; align-items: flex-start; border-left: 3px solid transparent; }
.item:hover { background: var(--panel-2); }
.item.sel { background: var(--panel-2); border-left-color: var(--accent); }
.item .ic { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; font-size: 14px; border: 2px solid rgba(255, 255, 255, .85); }
.item .tx { min-width: 0; flex: 1; }
.item .t1 { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .t1 .nr { color: var(--muted); font-weight: 650; margin-right: 4px; }
.item .t2 { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item.dim { opacity: .5; }
.item .side { font-size: 11px; color: var(--faint); white-space: nowrap; text-align: right; display: flex; flex-direction: column; gap: 3px; align-items: flex-end; }
.item.alarm .ic { box-shadow: 0 0 0 3px rgba(239, 68, 68, .35); }
.spill { display: inline-flex; gap: 4px; align-items: center; font-size: 11px; font-weight: 650; padding: 1px 7px; border-radius: 999px; }
.spill.open { background: #3f1d1d; color: #fca5a5; }
.spill.in_progress { background: #45300c; color: #fcd34d; }
.spill.resolved { background: #0f2e1c; color: #86efac; }
.group-head { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 10px 14px 4px; }
.jitem .ic { border: 0; background: var(--panel-3); width: 26px; height: 26px; font-size: 12px; }

/* ---------------------------------------------------------- chat */
.chat { flex: 1; overflow: auto; padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.msg { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; max-width: 92%; align-self: flex-start; }
.msg.mine { align-self: flex-end; background: #0f2a3a; border-color: #164e6b; }
.msg.important { border-color: var(--crit); background: #2a1215; }
.msg .mh { font-size: 11px; color: var(--muted); display: flex; gap: 8px; margin-bottom: 2px; }
.msg .mh b { color: var(--text); }
.msg .mb { white-space: pre-wrap; word-break: break-word; }
.msg a.ref { color: var(--accent); cursor: pointer; text-decoration: underline; }
.chatform { border-top: 1px solid var(--line); padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; background: var(--panel); }
.chatform textarea { min-height: 44px; height: 44px; resize: none; }

/* ---------------------------------------------------------- map */
.mapwrap { position: relative; flex: 1; min-width: 0; }
#map { position: absolute; inset: 0; }
.map-tools { position: absolute; top: 10px; left: 10px; right: 60px; display: flex; gap: 6px; z-index: 3; align-items: flex-start; pointer-events: none; }
.map-tools > * { pointer-events: auto; box-shadow: var(--shadow); }
.map-tools > button:not(.primary) { background: rgba(17, 24, 32, .94); width: 36px; padding: 7px 0; }
.map-tools > button.on { background: var(--accent); color: var(--accent-ink); }
.finder { position: relative; width: min(340px, 40%); }
.finder input { background: rgba(11, 16, 22, .94); }
.finder-results { position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); max-height: 60vh; overflow: auto; }
.finder-results .fh { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); padding: 8px 10px 2px; }
.finder-results .fr { display: flex; gap: 8px; padding: 7px 10px; cursor: pointer; font-size: 13px; align-items: center; }
.finder-results .fr:hover, .finder-results .fr.on { background: var(--panel-3); }
.finder-results .fr span:last-child { color: var(--muted); font-size: 11px; margin-left: auto; white-space: nowrap; }
.map-hint { position: absolute; top: 56px; left: 50%; transform: translateX(-50%); z-index: 4; background: var(--accent); color: var(--accent-ink); font-weight: 650; padding: 8px 14px; border-radius: 999px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.map-hint button { background: rgba(0, 0, 0, .15); border: 0; color: inherit; padding: 2px 10px; }
.mapwrap.picking .maplibregl-canvas { cursor: crosshair; }
.ctx-menu { position: absolute; z-index: 6; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 4px; min-width: 220px; }
.ctx-menu button { display: flex; width: 100%; justify-content: flex-start; border: 0; background: transparent; padding: 7px 10px; }
.ctx-menu button:hover { background: var(--panel-3); }
.ctx-menu .coord { padding: 6px 10px; font-size: 11px; color: var(--muted); font-family: var(--mono); line-height: 1.5; }

.statusbar { position: absolute; left: 0; right: 0; bottom: 0; height: 24px; z-index: 2; display: flex; gap: 18px; align-items: center; padding: 0 10px 0 150px; background: rgba(11, 16, 22, .82); border-top: 1px solid var(--line); font-family: var(--mono); font-size: 11px; color: var(--muted); }
.statusbar #sbZoom { margin-left: auto; }
.statusbar #sbMeasure { color: var(--accent); font-weight: 700; }
.maplibregl-ctrl-bottom-left { bottom: 24px; }
.mapwrap.with-band .maplibregl-ctrl-bottom-left { bottom: 116px; }


/* ---------------------------------------------------------- course band */
.band { position: absolute; left: 10px; right: 10px; bottom: 32px; z-index: 3; background: rgba(17, 24, 32, .95); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px 14px 4px; }
.band-head { display: flex; gap: 10px; align-items: center; font-size: 12px; color: var(--muted); }
.band-head b { color: var(--text); }
.band-head button { margin-left: auto; padding: 0 6px; min-height: 0; border: 0; background: transparent; color: var(--muted); }
.band-track { position: relative; height: 64px; margin: 0 8px; }
.band-line { position: absolute; left: 0; right: 0; top: 31px; height: 2px; background: #e6007e; border-radius: 1px; }
.band-tick { position: absolute; top: 28px; width: 1px; height: 8px; background: var(--faint); }
.band-tick span { position: absolute; top: 9px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--faint); font-family: var(--mono); white-space: nowrap; }
.bu, .bm { position: absolute; transform: translateX(-50%); padding: 0; min-height: 0; border-radius: 50%; width: 22px; height: 22px; font-size: 12px; border: 2px solid var(--panel); }
.bu { top: 4px; background: var(--c, #38bdf8); }
.bu.stale { background: #64748b; opacity: .6; }
.bm { top: 39px; border-radius: 6px; background: var(--c, #64748b); }
.bm.in_progress { box-shadow: 0 0 0 2px var(--warn-c); }
.bu:hover, .bm:hover { z-index: 2; transform: translateX(-50%) scale(1.25); }

/* ---------------------------------------------------------- detail */
.detail { width: 400px; flex: none; background: var(--panel); border-left: 1px solid var(--line); overflow: auto; display: flex; flex-direction: column; }
.d-head { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 2; }
.d-head .ic { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 19px; border: 2px solid #fff; flex: none; }
.d-head .kicker { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.d-head h2 { font-size: 17px; line-height: 1.25; word-break: break-word; }
.d-body { padding: 12px 14px 24px; display: flex; flex-direction: column; gap: 14px; }
.d-body .pills { display: flex; gap: 6px; flex-wrap: wrap; }
.d-body .desc { white-space: pre-wrap; word-break: break-word; }
.kv { display: grid; grid-template-columns: 104px 1fr; gap: 5px 10px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.kv dd .mono { font-size: 12px; }
.d-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.d-section h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stepper { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.stepper button { padding: 8px 4px; font-size: 12px; background: var(--panel-2); color: var(--muted); }
.stepper button.on.open { background: #3f1d1d; border-color: #7f1d1d; color: #fecaca; font-weight: 700; }
.stepper button.on.in_progress { background: #45300c; border-color: #92400e; color: #fde68a; font-weight: 700; }
.stepper button.on.resolved { background: #0f2e1c; border-color: #166534; color: #bbf7d0; font-weight: 700; }
.assign { display: flex; gap: 6px; }
.assign select { flex: 1.3; }
.assign input { flex: 1; }
.near { display: flex; flex-direction: column; gap: 4px; }
.near div { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.near .nd { color: var(--muted); font-size: 12px; margin-left: auto; white-space: nowrap; }
.near button { padding: 2px 8px; font-size: 11px; }
.timeline { display: flex; flex-direction: column; gap: 0; border-left: 2px solid var(--line); margin-left: 8px; }
.tl { position: relative; padding: 0 0 10px 16px; font-size: 13px; }
.tl::before { content: ""; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--panel-3); border: 2px solid var(--panel); }
.tl.comment::before { background: var(--accent); }
.tl.status::before { background: var(--warn-c); }
.tl.created::before { background: var(--crit); }
.tl .th { font-size: 11px; color: var(--muted); }
.tl .tb { white-space: pre-wrap; word-break: break-word; }
.comment-form { display: flex; gap: 6px; margin-top: 4px; }
.comment-form textarea { min-height: 38px; height: 38px; resize: vertical; }
.type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.type-grid button { flex-direction: column; gap: 2px; padding: 8px 4px; font-size: 11px; white-space: normal; text-align: center; line-height: 1.2; }
.type-grid button .e { font-size: 20px; }
.type-grid button.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 22%, var(--panel-3)); }
.form { display: flex; flex-direction: column; gap: 12px; }
.upload-progress { height: 4px; background: var(--panel-3); border-radius: 2px; overflow: hidden; }
.upload-progress div { height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.battery-low { color: #fca5a5; }

/* ---------------------------------------------------------- camera wall */
.camwall { position: fixed; inset: 0; z-index: 45; background: rgba(3, 7, 12, .96); display: flex; flex-direction: column; }
.camwall-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.camwall-head h2 { font-size: 16px; flex: 1; }
.camwall-grid { flex: 1; display: grid; gap: 10px; padding: 12px; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); align-content: start; overflow: auto; }
.camtile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.camtile .ct { display: flex; gap: 8px; align-items: center; padding: 8px 10px; font-size: 13px; }
.camtile .ct b { flex: 1; }

/* ---------------------------------------------------------- tooltip */
.tip { position: fixed; z-index: 70; pointer-events: none; background: #0b1016; border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px; font-size: 12px; box-shadow: var(--shadow); max-width: 280px; }
.tip b { display: block; }

@media (max-width: 1280px) { .top-kpis { display: none; } .detail { width: 360px; } }
@media (max-width: 1050px) { .panel { width: 300px; } .mission-clock { display: none; } }
@media (max-width: 760px) {
  .panel { display: none; }
  .detail { position: absolute; right: 0; top: 52px; bottom: 0; width: 100%; z-index: 10; }
  .finder { width: 100%; }
}

/* ---------- layers panel ---------- */
.lylist { display: flex; flex-direction: column; gap: 4px; }
.lyr { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); }
.lyr.active { border-color: #1e6f94; }
.lyr-row { display: flex; align-items: center; gap: 6px; padding: 4px 6px; }
.lyr-row .lyr-name { padding: 3px 4px; font-weight: 650; justify-content: flex-start; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.lyr-count { font-size: 11px; }
.lyr-star { color: #fcd34d; font-size: 13px; }
.lyr-row button.small { padding: 2px 7px; }
.lyr-menu { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 8px 8px; }
.lyr-items { border-top: 1px solid var(--line); padding: 4px 0; }
.lyo { display: flex; align-items: center; gap: 8px; padding: 5px 10px; font-size: 13px; cursor: pointer; }
.lyo:hover, .lyo.sel { background: var(--panel-3); }
.lyo .nr { color: var(--muted); font-weight: 650; }
.lyo .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lyo.dim { opacity: .5; }
.lyo-empty { padding: 6px 10px; font-size: 12px; }
.layer-pick { width: auto; max-width: 180px; background: rgba(11, 16, 22, .94); padding: 6px 8px; }
.draw-hint { position: absolute; top: 56px; left: 50%; transform: translateX(-50%); z-index: 4; background: var(--panel-2); border: 1px solid #1e6f94;
  padding: 8px 10px 8px 14px; border-radius: 12px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; font-size: 13px; max-width: calc(100% - 40px); flex-wrap: wrap; }
.draw-hint .dh-size { color: var(--accent); font-family: var(--mono); }
.draw-hint .dh-err { color: #fca5a5; }
.grid2f { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* chat: conversation list on top, open conversation below */
.chatwrap { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.convlist { max-height: 36%; overflow: auto; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.convview { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.convhead { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--line); font-size: 13px; background: var(--panel); }
.convhead .faint { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; flex-shrink: 1; font-size: 12px; }
.convhead .spacer { flex: 1 0 0; }
.pbtn { text-align: left; }
.chatform .check.nowrap { font-size: 13px; white-space: nowrap; }

/* journal timeline */
.jnote { display: flex; gap: 6px; }
.jnote input { flex: 1; min-width: 0; }
.jmeta { font-size: 11px; align-items: center; }
.jmeta a { color: var(--accent); cursor: pointer; }
.jday { padding: 12px 14px 4px; font-size: 11px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); border-top: 1px solid var(--line); }
.jday:first-child { border-top: 0; }
.jitem.nolink { cursor: default; }
.jitem .jcat { font-size: 10px; color: var(--faint); }
.jitem.jnote-e { border-left-color: var(--warn-c); background: rgba(245, 158, 11, .06); }
.jitem.jimp { border-left-color: var(--crit); background: rgba(239, 68, 68, .07); }
.jitem.jnote-e .t2, .jitem.jimp .t2 { white-space: pre-wrap; overflow: visible; color: var(--text); }
.jmore { padding: 12px; text-align: center; }
.filters .row > select#jGroup, .filters .row > select#jUser, .filters .row > select#jLayer { padding: 4px 2px 4px 6px; min-width: 0; }

/* status of people and devices */
.tile.warn { border-color: #78350f; background: #1f1709; }
.tile.warn .tv, .tile.warn .ts { color: #fcd34d; }
.tile .tv small { font-size: 14px; color: var(--muted); font-weight: 500; }
.sp { padding: 10px 14px; border-bottom: 1px solid var(--line); border-left: 3px solid transparent; }
.sp.warn { border-left-color: var(--warn-c); }
.sp.away .sp-h b { color: var(--muted); }
.sp-h { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 4px; }
.sp-h .faint { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sd { margin: 4px 0 0 14px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); font-size: 12px; }
.sd.link { cursor: pointer; }
.sd.link:hover { border-color: #33465a; }
.sd.warn { border-color: #78350f; }
.sd.none { background: none; border-style: dashed; }
.sd1 { display: flex; align-items: center; gap: 6px; }
.sd2 { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 3px; color: var(--muted); }
.sc.on { color: #4ade80; }
.sc.off { color: var(--faint); }
.ss.on { color: var(--text); }
.warn.su, .warn.sb { color: #fcd34d; font-weight: 650; }
.sa.weak { color: #fcd34d; }
.na { color: var(--faint); }
.tile .tl { position: static; padding: 0; margin: 0; border: 0; }
.tile .tl::before { content: none; }

/* bar above the map: key figures, open alarms, Handlungsbedarf */
.mapwrap { --leiste: 44px; }
.leiste { position: absolute; top: 0; left: 0; right: 0; height: var(--leiste); z-index: 5; display: flex; align-items: center; gap: 10px; padding: 0 10px;
  background: var(--panel); border-bottom: 1px solid var(--line); }
#map { top: var(--leiste); }
.map-tools { top: calc(var(--leiste) + 10px); }
.map-hint, .draw-hint { top: calc(var(--leiste) + 56px); }
.lb-kpis { display: flex; gap: 6px; flex-shrink: 0; }
.lb-kpis .kchip { font-family: inherit; min-height: 0; }
.lb-kpis .kchip.sim { cursor: default; }
.lb-alarms { display: flex; gap: 6px; flex: 1; min-width: 0; overflow: hidden; }
.lb-alarm { display: inline-flex; align-items: center; gap: 6px; max-width: 280px; min-width: 0; min-height: 0; padding: 4px 10px; border-radius: 999px; font-size: 12px;
  background: #2a1215; border: 1px solid #7f1d1d; color: #fecaca; flex-shrink: 1; }
.lb-alarm .lb-at { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.lb-alarm .lb-am { color: #fca5a5; white-space: nowrap; font-size: 11px; }
.lb-need { position: relative; flex-shrink: 0; }
.lb-needbtn { min-height: 0; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 650; }
.lb-needbtn.ok { color: #86efac; background: transparent; border-color: var(--line); font-weight: 500; }
.lb-needbtn.info { border-color: #164e6b; background: #0f2a3a; }
.lb-needbtn.warn { border-color: #78350f; background: #1f1709; color: #fcd34d; }
.lb-needbtn.crit { border-color: #7f1d1d; background: #2a1215; color: #fecaca; }
.lb-pop { position: absolute; right: 0; top: calc(100% + 6px); width: 380px; max-height: 70vh; overflow: auto; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; z-index: 8; }
@media (max-width: 1250px) { .lb-alarm .lb-am { display: none; } }

/* Ebenen area: report list inside the layers, system layers */
.lyr .lyr-items .item { padding: 6px 10px; }
.lylist .list.flat { padding: 0; margin: 0 -14px; }
.lyr.sys .sys-i { width: 18px; text-align: center; }
.sys-tools { padding: 6px 10px; display: flex; flex-direction: column; gap: 6px; border-bottom: 1px solid var(--line); }
.item .t2 .swatch-dot { width: 8px; height: 8px; margin-right: 4px; vertical-align: 0; }
.lyr-row .lyr-count { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; flex-shrink: 0; }
.lyr-row .lyr-name { flex-shrink: 1; }

/* Layer area */
.sec > h3 button, .sec > h3 .btn { text-transform: none; letter-spacing: 0; font-weight: 600; }
.seg.wrap { flex-wrap: wrap; }
.seg.wrap button { flex: 1 1 30%; }
.lyr.mission { border-color: #7c3a0e; }
.lyr-sub { font-size: 11px; color: var(--faint); padding: 0 10px 6px 34px; }
.lyr.course.active { border-color: var(--accent); }
.crs-act { min-height: 0; padding: 0 6px; border: 0; background: none; font-size: 15px; color: var(--muted); }
.crs-act.on { color: var(--accent); }
.swatch-line { display: inline-block; width: 18px; height: 5px; border-radius: 3px; flex: none; }
.crs-body { border-top: 1px solid var(--line); padding: 4px 0 6px; }
.crs-sub { display: flex; align-items: center; gap: 6px; padding: 6px 10px 2px; font-size: 12px; color: var(--muted); }
.crs-sub b { font-weight: 650; }
.crs-sub button { padding: 1px 8px; font-size: 12px; }
.crs-foot { display: flex; align-items: center; gap: 4px; padding: 8px 10px 0; font-size: 12px; }
.crs-foot button { padding: 2px 7px; }
.pulse-ring { width: 18px; height: 18px; border-radius: 50%; border: 3px solid #f97316; animation: pulse-ring 1.2s ease-out 4; pointer-events: none; }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(249, 115, 22, .8); } 100% { box-shadow: 0 0 0 28px rgba(249, 115, 22, 0); } }

.band-pick { display: inline-flex; gap: 4px; }
.band-pick button { min-height: 0; padding: 1px 8px; font-size: 11px; display: inline-flex; align-items: center; gap: 5px; background: transparent; }
.band-pick button.on { background: var(--panel-3); border-color: var(--accent); font-weight: 650; }
