:root {
  --red: #ed1b2e;
  --red-dark: #6d0714;
  --ink: #f4f1ee;
  --muted: #a8a09a;
  --subtle: #716b66;
  --bg: #11100f;
  --panel: #191817;
  --panel-2: #211f1e;
  --line: #35312e;
  --field: #0c0b0b;
  --amber: #f0b84f;
  --blue: #6ea8de;
  --green: #62bf8a;
  --violet: #a986e8;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  --hud: 56px;
  --rail: 62px;
  --desktop-rail: 88px;
  --radius: 8px;
  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus {
  outline: none;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.86);
  outline-offset: 2px;
}

.hud {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--hud);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(12px, env(safe-area-inset-left)) 0 max(12px, env(safe-area-inset-right));
  background: color-mix(in oklch, var(--bg) 92%, black);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2.2px;
  text-transform: uppercase;
}

.cross-mark {
  position: relative;
  display: inline-block;
  width: 24px;
  height: 24px;
  background: var(--red);
}

.cross-mark::before,
.cross-mark::after {
  content: "";
  position: absolute;
  background: var(--ink);
}

.cross-mark::before {
  width: 6px;
  height: 18px;
  left: 9px;
  top: 3px;
}

.cross-mark::after {
  width: 18px;
  height: 6px;
  left: 3px;
  top: 9px;
}

.icon-button,
.mini-button,
.map-choice-button,
.rail-button {
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: transparent;
  opacity: 0.78;
}

.icon-button:active,
.map-choice-button:active,
.rail-button:active,
.mini-button:active {
  transform: translateY(1px);
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-stage {
  position: fixed;
  inset: var(--hud) 0 var(--rail) 0;
}

#map {
  position: absolute;
  inset: 0;
}

.ops-ribbon {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 12px;
  z-index: 12;
  display: grid;
  gap: 8px;
  max-width: 720px;
  pointer-events: none;
}

.ops-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.42);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(14px);
}

.ops-metric {
  min-width: 0;
  padding: 10px 11px;
  background: rgba(25, 24, 23, 0.82);
}

.ops-metric span {
  display: block;
  margin-bottom: 6px;
  color: var(--subtle);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.ops-metric strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.12;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ops-metric--threat strong {
  color: #ffb0b8;
  font-size: 15px;
  font-weight: 900;
  text-transform: uppercase;
}

.ops-presets {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  pointer-events: auto;
  scrollbar-width: none;
}

.ops-presets::-webkit-scrollbar {
  display: none;
}

.ops-preset {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 6px;
  background: rgba(25, 24, 23, 0.88);
  color: #d7d1cc;
  cursor: pointer;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.26);
}

.ops-preset:hover,
.ops-preset.is-active {
  border-color: rgba(237, 27, 46, 0.65);
  background: rgba(237, 27, 46, 0.18);
  color: #ffe7ea;
}

.notice {
  position: absolute;
  top: 126px;
  left: 14px;
  right: 14px;
  z-index: 10;
  display: none;
  max-width: 520px;
  padding: 10px 12px;
  background: rgba(25, 24, 23, 0.96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 13px;
}

.notice.show {
  display: block;
}

.feature-panel,
.side-panel,
.search-panel,
.control-sheet,
.briefing {
  background: rgba(25, 24, 23, 0.97);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.feature-panel {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 20;
  display: none;
  max-height: 48vh;
  overflow: auto;
  border-radius: var(--radius);
}

.feature-panel.open {
  display: block;
}

.feature-panel__head,
.side-panel__head,
.control-sheet__head,
.briefing__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.feature-panel p,
.side-panel p,
.control-sheet p,
.briefing p {
  margin: 0;
}

.feature-panel__head p,
.side-panel__head p,
.control-sheet__head p,
.briefing__head p,
#panel-kicker {
  color: var(--red);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

.feature-panel h2,
.side-panel h2,
.control-sheet h2,
.briefing h2 {
  margin: 3px 0 0;
  font-size: 16px;
  line-height: 1.2;
}

.feature-panel__body {
  padding: 8px 14px 14px;
}

.feature-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px 0 12px;
}

.feature-kpi {
  min-height: 86px;
  padding: 12px;
  border: 1px solid rgba(237, 27, 46, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(237, 27, 46, 0.16), rgba(255, 255, 255, 0.035) 42%),
    rgba(255, 255, 255, 0.045);
}

.feature-kpi span {
  display: block;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.feature-kpi strong {
  display: block;
  margin-top: 10px;
  color: var(--ink);
  font-size: clamp(22px, 6vw, 38px);
  line-height: 0.95;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.feature-detail-list {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.risk-focus {
  display: grid;
  gap: 14px;
  padding-top: 4px;
}

.risk-context-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.risk-context-meta span {
  padding: 4px 7px;
  border-radius: 4px;
  background: rgba(237, 27, 46, 0.16);
  color: #ffc2c8;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.risk-summary {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.risk-layer-block {
  display: grid;
  gap: 8px;
}

.risk-layer-block h3 {
  margin: 0;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.risk-layer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.risk-layer-chip {
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  line-height: 1.1;
  cursor: pointer;
}

.risk-layer-chip.active {
  border-color: rgba(237, 27, 46, 0.86);
  background: var(--red);
  color: white;
}

.mini-button {
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.kv {
  display: grid;
  grid-template-columns: minmax(90px, 0.9fr) minmax(0, 1.4fr);
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
}

.kv span:first-child {
  color: var(--subtle);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.kv span:last-child {
  color: var(--ink);
  text-align: right;
  word-break: break-word;
}

.side-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 30;
  display: none;
  width: min(430px, calc(100vw - 24px));
  overflow: hidden;
  border-radius: var(--radius);
}

.side-panel.open {
  display: flex;
  flex-direction: column;
}

.side-panel__body {
  overflow: auto;
  padding: 12px;
}

.layer-group {
  margin-bottom: 18px;
}

.layer-group h3 {
  margin: 0 0 8px;
  color: var(--subtle);
  font-size: 10px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

.layer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.layer-card {
  min-height: 82px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  cursor: pointer;
  text-align: left;
}

.layer-card.active {
  border-color: color-mix(in oklch, var(--red) 65%, white);
  background: color-mix(in oklch, var(--panel-2) 82%, var(--red));
}

.layer-card__top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.layer-card strong {
  color: var(--ink);
  font-size: 13px;
}

.layer-card b {
  flex: 0 0 auto;
  padding: 2px 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--subtle);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.9px;
  text-transform: uppercase;
}

.layer-card.active b {
  background: rgba(237, 27, 46, 0.24);
  color: #ffd3d8;
}

.layer-card span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  line-height: 1.35;
}

.layer-card small {
  display: block;
  margin-top: 8px;
  color: var(--subtle);
  font-size: 10px;
  line-height: 1.25;
}

.layer-card em {
  display: inline-flex;
  margin-top: 8px;
  color: var(--red);
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.search-panel {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 35;
  display: none;
  max-width: 580px;
  padding: 10px;
  border-radius: var(--radius);
}

.search-panel.open {
  display: block;
}

#search-form,
.ask-form {
  display: flex;
  gap: 8px;
}

input {
  min-width: 0;
  flex: 1;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  background: var(--field);
  color: var(--ink);
}

input:focus {
  border-color: color-mix(in oklch, var(--red) 60%, white);
}

form button {
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: var(--red);
  color: white;
  cursor: pointer;
  font-weight: 850;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

#search-results {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.result-row {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-size: 13px;
}

.control-sheet {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 25;
  display: none;
  max-height: 46vh;
  overflow: auto;
  border-radius: var(--radius);
}

.control-sheet.open {
  display: block;
}

.map-choice-button {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 24;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(25, 24, 23, 0.9);
  color: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(12px);
}

.map-choice-button:hover,
.map-choice-button.is-active {
  border-color: rgba(237, 27, 46, 0.62);
  background: rgba(237, 27, 46, 0.18);
  color: #fff;
}

.map-choice-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.basemap-popover {
  position: absolute;
  right: 14px;
  bottom: 64px;
  z-index: 26;
  display: none;
  width: min(270px, calc(100vw - 28px));
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(18, 17, 16, 0.96);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(12px);
}

.basemap-popover.open {
  display: block;
}

.basemap-popover__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 2px 8px;
}

.basemap-popover__head strong {
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.basemap-popover__head button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.basemap-options {
  display: grid;
  gap: 5px;
}

.basemap-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  text-align: left;
}

.basemap-option.active {
  border-color: rgba(237, 27, 46, 0.46);
  background: rgba(237, 27, 46, 0.11);
}

.basemap-option strong,
.basemap-option span {
  display: block;
}

.basemap-option strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.15;
}

.basemap-option span {
  margin-top: 2px;
  color: var(--subtle);
  font-size: 11px;
  line-height: 1.1;
}

.basemap-option em {
  padding: 4px 7px;
  border-radius: 4px;
  background: var(--red);
  color: white;
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.map-status-strip {
  position: absolute;
  left: 12px;
  right: 66px;
  bottom: 14px;
  z-index: 23;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(10, 10, 10, 0.86);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

.active-layer-strip {
  display: flex;
  min-width: 0;
  flex: 1;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}

.active-layer-strip::-webkit-scrollbar {
  display: none;
}

.active-layer-strip > span {
  padding: 6px 8px;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
}

.active-layer-pill {
  flex: 0 0 auto;
  max-width: 170px;
  padding: 6px 9px;
  overflow: hidden;
  border: 1px solid rgba(237, 27, 46, 0.28);
  border-radius: 4px;
  background: rgba(237, 27, 46, 0.18);
  color: #ff4f5f;
  cursor: pointer;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1px;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.map-status-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.strip-filter-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--ink);
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.6px;
}

.strip-filter-button svg {
  width: 12px;
  height: 12px;
}

.coordinate-readout {
  color: #ff4f5f;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

#control-body {
  padding: 12px 14px 14px;
}

.control-block {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.chip.active {
  border-color: var(--red);
  background: var(--red);
  color: white;
}

.slider-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

input[type="range"] {
  width: 100%;
  padding: 0;
  accent-color: var(--red);
}

.briefing {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 22;
  display: none;
  max-width: 760px;
  margin: 0 auto;
  border-radius: 12px 12px var(--radius) var(--radius);
  overflow: hidden;
}

.briefing.open {
  display: block;
}

.briefing[data-state="peek"] {
  max-height: 164px;
}

.briefing[data-state="half"] {
  max-height: min(58vh, 520px);
}

.briefing[data-state="full"] {
  top: 12px;
  max-height: none;
}

.briefing__handle {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 9px 0 4px;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.briefing__handle::before {
  content: "";
  width: 44px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
}

#briefing-status {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(237, 27, 46, 0.12);
  color: #ff9aa5;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 1px;
  text-transform: uppercase;
}

#briefing-status[data-level="high"],
#briefing-status[data-level="critical"] {
  background: rgba(237, 27, 46, 0.2);
  color: #ffd0d5;
}

#briefing-status[data-level="moderate"] {
  background: rgba(214, 168, 0, 0.18);
  color: #ffe3a2;
}

.briefing__body {
  max-height: 42vh;
  overflow: auto;
  padding: 0 14px 12px;
  color: #ded8d2;
  font-size: 13px;
  line-height: 1.55;
}

.brief-meta {
  padding: 2px 0 16px;
  color: var(--subtle);
  font-size: 11px;
  letter-spacing: 0.4px;
}

.brief-hygiene {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
  padding: 8px 10px;
  border: 1px solid rgba(214, 168, 0, 0.32);
  border-radius: 6px;
  background: rgba(214, 168, 0, 0.08);
  color: #e8c66c;
  font-size: 11px;
  line-height: 1.35;
}

.brief-section {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.brief-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brief-section__head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.brief-section__head h3::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 2px;
  margin-right: 8px;
  vertical-align: 4px;
  background: var(--red);
}

.brief-link {
  padding: 5px 8px;
  border: 1px solid rgba(237, 27, 46, 0.45);
  border-radius: 4px;
  background: rgba(237, 27, 46, 0.1);
  color: #ff9ca7;
  cursor: pointer;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.ranking-list,
.action-list {
  display: grid;
  gap: 8px;
}

.ranking-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 10px;
  width: 100%;
  padding: 9px 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.ranking-item:hover {
  background: rgba(255, 255, 255, 0.035);
}

.ranking-rank {
  color: var(--red);
  font-weight: 900;
}

.ranking-copy {
  display: grid;
  gap: 4px;
}

.ranking-copy strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.18;
}

.ranking-copy span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.42;
}

.severity {
  align-self: start;
  padding: 3px 7px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
}

.severity--critical {
  background: rgba(237, 27, 46, 0.18);
  color: #ff9ca7;
}

.severity--high {
  background: rgba(217, 92, 24, 0.18);
  color: #ffbd8f;
}

.severity--moderate,
.severity--medium {
  background: rgba(214, 168, 0, 0.18);
  color: #f7d878;
}

.brief-narrative {
  color: #d8d1cb;
  font-size: 13px;
}

.brief-narrative p {
  margin: 0 0 10px;
}

.brief-narrative ul {
  margin: 0;
  padding-left: 18px;
}

.brief-narrative li {
  margin: 0 0 8px;
}

.action-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
}

.action-item p {
  margin: 0;
  color: #d8d1cb;
  font-size: 12px;
  line-height: 1.45;
}

.brief-empty {
  display: grid;
  gap: 4px;
  padding: 18px 0;
  color: var(--muted);
}

.brief-empty strong {
  color: var(--ink);
}

.briefing__body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.briefing__body th,
.briefing__body td {
  padding: 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.muted {
  color: var(--muted);
}

.ask-form {
  padding: 0 14px 14px;
}

.command-rail {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 60;
  height: var(--rail);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--red-dark);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.rail-button {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.9px;
  text-transform: uppercase;
}

.rail-button svg {
  width: 19px;
  height: 19px;
}

.rail-button.is-active {
  background: color-mix(in oklch, var(--red-dark) 76%, black);
  color: white;
}

.rail-button:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px rgba(237, 27, 46, 0.72);
}

.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  background: var(--bg);
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.boot.hidden {
  display: none;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--line);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 599px) {
  .ops-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ops-ribbon {
    max-width: none;
  }

  .map-status-strip {
    right: 60px;
  }

  .coordinate-readout {
    display: none;
  }
}

@media (min-width: 600px) {
  :root {
    --hud: 60px;
    --rail: 0px;
  }

  .hud {
    justify-content: flex-start;
    gap: 22px;
    padding-left: 18px;
  }

  .hud .icon-button:first-child {
    order: 2;
    margin-left: auto;
  }

  .hud .brand {
    order: 1;
  }

  .hud #search-toggle {
    order: 3;
  }

  .map-stage {
    inset: var(--hud) 0 0 var(--desktop-rail);
  }

  .ops-ribbon {
    left: 16px;
    right: auto;
    top: 16px;
    width: min(430px, calc(100vw - var(--desktop-rail) - 32px));
  }

  .ops-metric {
    padding: 11px 12px;
  }

  .command-rail {
    inset: var(--hud) auto 0 0;
    width: var(--desktop-rail);
    height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, minmax(74px, auto));
    padding-bottom: 0;
    background: #151211;
    border-top: 0;
    border-right: 1px solid var(--line);
  }

  .rail-button {
    gap: 7px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--muted);
  }

  .rail-button:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--ink);
  }

  .rail-button.is-active {
    background: rgba(237, 27, 46, 0.12);
    color: #ffb0b8;
  }

  .feature-panel {
    right: auto;
    width: 430px;
  }

  .side-panel {
    top: 16px;
    left: 16px;
    right: auto;
    bottom: 16px;
    width: min(410px, calc(100vw - var(--desktop-rail) - 40px));
  }

  .side-panel.open {
    display: flex;
  }

  .side-panel__head {
    padding: 16px;
  }

  .side-panel__body {
    padding: 14px;
  }

  .layer-grid {
    grid-template-columns: 1fr;
  }

  .layer-card {
    min-height: 72px;
    padding: 12px;
  }

  .notice {
    left: 438px;
    top: 118px;
    right: auto;
    width: min(460px, calc(100vw - var(--desktop-rail) - 470px));
  }

  .control-sheet {
    left: 438px;
    right: 72px;
    bottom: 16px;
    width: auto;
    max-height: 42vh;
    transform: none;
  }

  .briefing {
    top: 16px;
    left: auto;
    right: 16px;
    bottom: auto;
    width: min(430px, calc(100vw - var(--desktop-rail) - 470px));
    min-width: 360px;
    max-height: calc(100vh - var(--hud) - 32px);
    transform: none;
  }

  .briefing[data-state="peek"],
  .briefing[data-state="half"] {
    max-height: calc(100vh - var(--hud) - 32px);
  }

  .briefing[data-state="full"] {
    top: 16px;
    left: 438px;
    right: 16px;
    bottom: auto;
    width: auto;
    max-height: calc(100vh - var(--hud) - 32px);
  }

  .briefing__handle {
    padding-top: 8px;
  }

  .briefing__body {
    max-height: calc(100vh - var(--hud) - 206px);
  }

  .search-panel {
    top: 118px;
    left: 438px;
    right: auto;
    width: min(520px, calc(100vw - var(--desktop-rail) - 470px));
  }

  .map-choice-button {
    right: 18px;
    bottom: 18px;
    width: 44px;
    height: 44px;
  }

  .basemap-popover {
    right: 18px;
    bottom: 70px;
  }

  .map-status-strip {
    left: 18px;
    right: 76px;
    bottom: 18px;
  }
}

@media (min-width: 1160px) {
  .layer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .side-panel {
    width: 430px;
  }

  .notice,
  .control-sheet,
  .search-panel {
    left: 458px;
  }

  .ops-ribbon {
    width: min(700px, calc(100vw - var(--desktop-rail) - 506px));
  }

  .briefing[data-state="full"] {
    left: 458px;
  }
}
