:root {
  color-scheme: dark;
  --bg: #07090c;
  --panel: rgba(13, 17, 22, 0.9);
  --panel-solid: #0d1116;
  --line: rgba(195, 215, 226, 0.13);
  --line-strong: rgba(195, 215, 226, 0.26);
  --text: #f1f5f7;
  --muted: #86939d;
  --red: #ff5c35;
  --amber: #ffcf4a;
  --blue: #6fc8ff;
  --purple: #b892ff;
  --green: #68e7a1;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 0 0, rgba(61, 111, 130, 0.12), transparent 38rem),
    linear-gradient(145deg, #090d11, #050608 60%);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  overflow-x: hidden;
}

button, input, select { font: inherit; }
button { color: inherit; }

.noise {
  position: fixed;
  inset: 0;
  opacity: 0.035;
  pointer-events: none;
  z-index: 20;
  background-image:
    radial-gradient(circle at 20% 30%, #fff 0 .35px, transparent .7px),
    radial-gradient(circle at 70% 60%, #fff 0 .25px, transparent .65px);
  background-size: 9px 11px, 13px 7px;
}

.topbar {
  min-height: 72px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(18px);
  background: rgba(7, 9, 12, 0.84);
}

.brand {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
}

.brand > span:last-child { display: grid; gap: 1px; }
.brand strong { font-size: 20px; line-height: 1; letter-spacing: 0.08em; }
.brand small { color: var(--muted); font-size: 8px; letter-spacing: 0.22em; }

.brand-mark {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 92, 53, 0.55);
  position: relative;
  transform: rotate(45deg);
  background: linear-gradient(135deg, rgba(255, 92, 53, 0.18), transparent);
}

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

.brand-mark::before { width: 18px; height: 2px; left: 9px; top: 17px; }
.brand-mark::after { width: 2px; height: 18px; left: 17px; top: 9px; }
.brand-mark i, .brand-mark b { position: absolute; width: 5px; height: 5px; border: 1px solid var(--amber); }
.brand-mark i { left: 3px; top: 3px; }
.brand-mark b { right: 3px; bottom: 3px; }

.topbar-center { display: flex; align-items: baseline; gap: 12px; }
.eyebrow, .section-code { color: var(--muted); font: 700 10px/1.2 ui-monospace, Consolas, monospace; letter-spacing: 0.16em; }
.clock { font: 600 14px/1 ui-monospace, Consolas, monospace; letter-spacing: 0.12em; }
.timezone { color: var(--red); font: 700 9px/1 ui-monospace, Consolas, monospace; }

.connection {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 12px var(--amber);
}

.status-dot.online { background: var(--green); box-shadow: 0 0 12px var(--green); }
.status-dot.offline { background: var(--red); box-shadow: 0 0 12px var(--red); }

.workspace {
  width: min(1880px, 100%);
  min-height: calc(100vh - 72px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
}

.map-column { padding: 22px 24px 16px; min-width: 0; }
.intel-panel { border-left: 1px solid var(--line); padding: 22px; display: grid; align-content: start; gap: 14px; background: rgba(6, 8, 10, 0.46); }

.map-toolbar {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.map-toolbar h1 { margin: 6px 0 0; font-size: clamp(23px, 2.2vw, 35px); line-height: 1; letter-spacing: -0.04em; }
.map-actions { display: flex; align-items: center; gap: 7px; }

.tool-button, .icon-button {
  border: 1px solid var(--line-strong);
  background: rgba(14, 19, 24, 0.88);
  border-radius: 8px;
  cursor: pointer;
  height: 36px;
  transition: border-color .2s, background .2s, color .2s;
}

.tool-button { padding: 0 13px; color: #b9c3ca; font-size: 11px; font-weight: 700; }
.icon-button { width: 36px; font-size: 18px; }
.tool-button:hover, .icon-button:hover { border-color: var(--red); color: white; background: rgba(255, 92, 53, 0.12); }
.zoom-value { width: 44px; text-align: center; color: var(--muted); font: 700 10px ui-monospace, Consolas, monospace; }
.control-only { display: none; border-color: rgba(255, 92, 53, 0.52); color: #ff9a7f; }
body.control-mode .control-only { display: inline-flex; align-items: center; }

.map-shell {
  position: relative;
  overflow: hidden;
  min-height: 680px;
  height: calc(100vh - 195px);
  border: 1px solid var(--line-strong);
  background: #05080a;
  box-shadow: var(--shadow);
}

.map-scene {
  position: absolute;
  width: min(100%, calc(100vh - 195px));
  aspect-ratio: 1;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(var(--zoom, 1));
  transform-origin: center;
  transition: transform .25s ease;
  overflow: hidden;
}

.map-image, .map-tint, .grid-overlay, #trajectoryCanvas, .landmark-layer, .threat-layer, .sector-overlay, .map-scan, .map-corners {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.map-image { display: block; object-fit: cover; filter: saturate(.74) contrast(1.12) brightness(.72); }
.map-tint { background: radial-gradient(circle at 37% 48%, transparent 0 28%, rgba(3, 8, 12, .17) 68%), linear-gradient(145deg, rgba(8, 18, 20, .05), rgba(3, 7, 10, .34)); }
.grid-overlay {
  opacity: .26;
  background-image: linear-gradient(rgba(150, 198, 214, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(150, 198, 214, .08) 1px, transparent 1px);
  background-size: 10% 10%;
}

.map-scan {
  height: 2px;
  top: -3px;
  background: linear-gradient(90deg, transparent 5%, rgba(111, 200, 255, .55), transparent 92%);
  box-shadow: 0 0 18px rgba(111, 200, 255, .38);
  animation: scan 7s linear infinite;
  opacity: .58;
}

@keyframes scan { to { top: calc(100% + 3px); } }

.map-corners i { position: absolute; width: 28px; height: 28px; border-color: rgba(255, 207, 74, .56); }
.map-corners i:nth-child(1) { left: 12px; top: 12px; border-left: 1px solid; border-top: 1px solid; }
.map-corners i:nth-child(2) { right: 12px; top: 12px; border-right: 1px solid; border-top: 1px solid; }
.map-corners i:nth-child(3) { right: 12px; bottom: 12px; border-right: 1px solid; border-bottom: 1px solid; }
.map-corners i:nth-child(4) { left: 12px; bottom: 12px; border-left: 1px solid; border-bottom: 1px solid; }

.sector { position: absolute; padding: 5px 7px; border-left: 2px solid rgba(111, 200, 255, .48); color: rgba(196, 224, 235, .8); background: rgba(4, 11, 15, .63); font: 700 8px/1 ui-monospace, Consolas, monospace; letter-spacing: .13em; text-transform: uppercase; }
.sector-north { left: 27%; top: 8%; }
.sector-hydro { left: 71%; top: 32%; border-color: rgba(111, 200, 255, .72); }
.sector-center { left: 15%; top: 48%; border-color: rgba(255, 207, 74, .62); }
.sector-south { left: 27%; top: 72%; border-color: rgba(255, 92, 53, .48); }
.sector-overlay.hidden, .zone-layer.hidden, .landmark-layer.hidden { display: none; }

.landmark {
  position: absolute;
  width: 9px;
  height: 9px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(220, 238, 245, .75);
  border-radius: 50%;
  background: rgba(5, 10, 14, .82);
  box-shadow: 0 0 0 4px rgba(4, 10, 14, .4);
  cursor: pointer;
  z-index: 4;
}

.landmark::after {
  content: attr(data-name);
  position: absolute;
  left: 12px;
  top: -4px;
  white-space: nowrap;
  background: rgba(3, 8, 11, .72);
  border: 1px solid rgba(197, 220, 229, .13);
  padding: 3px 5px;
  color: #c9d4da;
  font: 650 7px ui-monospace, Consolas, monospace;
  letter-spacing: .04em;
  opacity: .72;
}

.landmark.hot {
  border-color: var(--red);
  box-shadow: 0 0 0 5px rgba(255, 92, 53, .15), 0 0 24px rgba(255, 92, 53, .5);
  animation: targetPulse 1.1s ease-in-out infinite;
}

@keyframes targetPulse { 50% { transform: translate(-50%, -50%) scale(1.5); } }

#trajectoryCanvas { pointer-events: none; z-index: 5; }
.threat-layer { pointer-events: none; z-index: 7; }
.effect-layer { position: absolute; inset: 0; z-index: 11; pointer-events: none; overflow: visible; }

.threat {
  position: absolute;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  pointer-events: auto;
  cursor: pointer;
  filter: drop-shadow(0 0 7px currentColor);
  z-index: 8;
}

.threat.drone { color: var(--red); }
.threat.missile { color: var(--amber); }
.threat.aircraft { color: var(--blue); }
.threat.recon { color: var(--purple); }

.threat-label {
  position: absolute;
  left: 26px;
  top: -3px;
  min-width: 76px;
  padding: 5px 7px;
  border: 1px solid currentColor;
  background: rgba(4, 7, 9, .9);
  color: inherit;
  font: 700 8px/1.15 ui-monospace, Consolas, monospace;
  letter-spacing: .05em;
  white-space: nowrap;
}

.map-readout {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 12;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  background: rgba(5, 8, 11, .88);
  backdrop-filter: blur(10px);
  width: max-content;
  max-width: calc(100% - 24px);
}

.map-readout span { color: #a8b3ba; font-size: 9px; font-weight: 700; }
.legend-dot { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: currentColor; box-shadow: 0 0 7px currentColor; }
.legend-dot.drone { color: var(--red); }
.legend-dot.missile { color: var(--amber); }
.legend-dot.aircraft { color: var(--blue); }
.legend-dot.recon { color: var(--purple); }
.fiction-note { margin: 10px 0 0; color: #69757d; font-size: 10px; }

.summary-card, .feed-card, .detail-card, .source-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 16px 42px rgba(0, 0, 0, .2);
}

.summary-card, .feed-card, .detail-card { padding: 15px; }
.card-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.freshness { color: #66737c; font-size: 9px; }

.threat-status {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px;
  background: linear-gradient(120deg, rgba(104, 231, 161, .08), rgba(104, 231, 161, .015));
  border: 1px solid rgba(104, 231, 161, .19);
}

.threat-status.warning { background: linear-gradient(120deg, rgba(255, 92, 53, .14), rgba(255, 92, 53, .025)); border-color: rgba(255, 92, 53, .28); }
.threat-level { width: 24px; height: 24px; border: 1px solid var(--green); transform: rotate(45deg); position: relative; }
.threat-level::after { content: ""; position: absolute; inset: 7px; background: var(--green); }
.threat-status.warning .threat-level { border-color: var(--red); animation: rotatePulse 2s ease-in-out infinite; }
.threat-status.warning .threat-level::after { background: var(--red); }
@keyframes rotatePulse { 50% { transform: rotate(135deg) scale(.8); } }
.threat-status div { display: grid; gap: 5px; }
.threat-status small { color: var(--muted); font-size: 9px; }
.threat-status strong { font-size: 14px; }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-top: 0; }
.metrics article { padding: 12px 8px; display: grid; gap: 3px; text-align: center; border-right: 1px solid var(--line); }
.metrics article:last-child { border-right: 0; }
.metrics span { font: 700 21px ui-monospace, Consolas, monospace; }
.metrics small { color: var(--muted); font-size: 8px; line-height: 1.25; }

.feed-card { min-height: 260px; }
.pulse-label { color: var(--green); font: 700 8px ui-monospace, Consolas, monospace; text-transform: uppercase; }
.pulse-label i { display: inline-block; width: 5px; height: 5px; margin-right: 5px; background: var(--green); border-radius: 50%; box-shadow: 0 0 8px var(--green); }
.event-feed { max-height: 340px; overflow: auto; scrollbar-color: #303b43 transparent; }
.empty-state { min-height: 190px; display: grid; place-content: center; justify-items: center; color: #67747c; }
.empty-state span { width: 36px; height: 36px; border: 1px solid #344048; border-radius: 50%; position: relative; }
.empty-state span::after { content: ""; position: absolute; inset: 9px; border: 1px dashed #52616b; border-radius: 50%; }
.empty-state p { font-size: 11px; }

.event-row {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 11px 2px;
  background: transparent;
  text-align: left;
  display: grid;
  grid-template-columns: 33px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}

.event-row:hover { background: rgba(255,255,255,.025); }
.event-symbol { width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid currentColor; font-size: 11px; font-weight: 900; }
.event-row.drone { color: var(--red); }
.event-row.missile { color: var(--amber); }
.event-row.aircraft { color: var(--blue); }
.event-row.recon { color: var(--purple); }
.event-main { min-width: 0; display: grid; gap: 3px; color: var(--text); }
.event-main strong { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-main small { color: var(--muted); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.event-time { color: var(--muted); font: 700 8px ui-monospace, Consolas, monospace; }

.detail-card { min-height: 165px; }
.detail-empty { min-height: 100px; display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 13px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.reticle { width: 40px; height: 40px; border: 1px solid #45535c; border-radius: 50%; position: relative; }
.reticle::before, .reticle::after { content: ""; position: absolute; background: #45535c; }
.reticle::before { width: 54px; height: 1px; left: -7px; top: 19px; }
.reticle::after { height: 54px; width: 1px; left: 19px; top: -7px; }

.detail-content { display: grid; gap: 11px; }
.detail-title { display: flex; justify-content: space-between; align-items: center; }
.detail-title strong { font-size: 14px; }
.detail-title span { color: var(--red); font: 700 9px ui-monospace, Consolas, monospace; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.detail-grid div { border: 1px solid var(--line); padding: 8px; display: grid; gap: 3px; }
.detail-grid small { color: var(--muted); font-size: 8px; }
.detail-grid b { font-size: 10px; }

.source-card { padding: 12px 14px; display: flex; align-items: center; gap: 11px; }
.source-card div { display: grid; gap: 3px; }
.source-card strong { font-size: 10px; }
.source-card small { color: var(--muted); font-size: 8px; }
.source-icon { width: 24px; height: 18px; border: 1px solid #65757f; position: relative; border-radius: 5px; }
.source-icon::before, .source-icon::after { content: ""; position: absolute; width: 4px; height: 4px; background: #65757f; border-radius: 50%; top: 6px; }
.source-icon::before { left: 5px; }
.source-icon::after { right: 5px; }

.control-dialog {
  width: min(610px, calc(100% - 24px));
  padding: 0;
  border: 1px solid var(--line-strong);
  background: #0b0f13;
  color: var(--text);
  box-shadow: 0 35px 100px rgba(0, 0, 0, .78);
}

.control-dialog::backdrop { background: rgba(2, 4, 6, .78); backdrop-filter: blur(8px); }
.dialog-shell { padding: 22px; }
.dialog-header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 20px; }
.dialog-header h2 { margin: 6px 0 0; font-size: 21px; }
.close-button { border: 1px solid var(--line); background: transparent; width: 34px; height: 34px; cursor: pointer; font-size: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.preset-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin: 0 0 16px;
}
.preset-button {
  min-height: 76px;
  padding: 9px;
  border: 1px solid var(--line);
  background: #090d10;
  color: #8d9aa2;
  text-align: left;
  display: grid;
  align-content: space-between;
  gap: 4px;
  cursor: pointer;
}
.preset-button i { color: #59656d; font: 700 8px ui-monospace, Consolas, monospace; font-style: normal; }
.preset-button strong { color: #dce4e8; font-size: 9px; }
.preset-button small { color: #66737b; font-size: 7px; line-height: 1.3; }
.preset-button.active { border-color: var(--red); background: rgba(255, 92, 53, .09); }
.preset-button.active i { color: var(--red); }
.preset-button.wide { grid-column: 1 / -1; min-height: 54px; grid-template-columns: 25px 1fr; align-items: center; }
.preset-button.wide small { grid-column: 2; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; margin-bottom: 12px; }
.field span { color: var(--muted); font-size: 9px; font-weight: 700; }
.field input, .field select { width: 100%; height: 42px; border: 1px solid var(--line-strong); background: #080b0e; color: var(--text); padding: 0 11px; outline: none; border-radius: 0; }
.field input:focus, .field select:focus { border-color: var(--red); }
.form-message { min-height: 16px; color: #ff9277; font-size: 10px; }
.dialog-actions { display: flex; justify-content: space-between; gap: 10px; }
.danger-button, .primary-button { min-height: 43px; padding: 0 15px; border: 1px solid var(--line-strong); cursor: pointer; font-weight: 800; font-size: 11px; }
.danger-button { background: transparent; color: #ff9277; }
.primary-button { margin-left: auto; background: var(--red); color: #08090a; border-color: var(--red); }
.primary-button span { margin-left: 20px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  z-index: 50;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  background: #11171c;
  box-shadow: var(--shadow);
  color: #dce5e9;
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1100px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 330px; }
  .intel-panel { padding: 14px; }
  .map-column { padding: 16px; }
}

@media (max-width: 820px) {
  .topbar { min-height: 62px; padding: 0 14px; grid-template-columns: 1fr auto; }
  .topbar-center { display: none; }
  .brand-mark { width: 32px; height: 32px; }
  .brand strong { font-size: 17px; }
  .workspace { display: block; }
  .map-column { padding: 12px; }
  .map-toolbar { min-height: 54px; margin-bottom: 9px; align-items: end; }
  .map-toolbar h1 { font-size: 22px; }
  .map-actions { gap: 5px; }
  .tool-button { padding: 0 9px; }
  .zoom-value { display: none; }
  .map-shell { height: auto; min-height: 0; aspect-ratio: 1; }
  .map-scene { width: 100%; height: 100%; }
  .map-readout { gap: 8px; bottom: 8px; left: 8px; right: 8px; padding: 7px 8px; }
  .map-readout span { font-size: 7px; }
  .intel-panel { border: 0; border-top: 1px solid var(--line); padding: 12px; grid-template-columns: 1fr 1fr; }
  .summary-card, .feed-card { grid-column: 1 / -1; }
  .detail-card, .source-card { min-height: auto; }
  .event-feed { max-height: 290px; }
  .fiction-note { padding: 0 2px; }
}

@media (max-width: 560px) {
  .connection span:last-child { display: none; }
  .map-toolbar { display: grid; grid-template-columns: 1fr auto; }
  .map-toolbar .section-code { display: none; }
  .map-actions .tool-button:first-child { display: none; }
  .icon-button { width: 32px; height: 32px; }
  .map-shell { margin-inline: -12px; width: calc(100% + 24px); border-left: 0; border-right: 0; }
  .landmark::after, .sector { font-size: 6px; padding: 2px 3px; }
  .landmark::after { left: 8px; }
  .threat { width: 20px; height: 20px; margin: -10px 0 0 -10px; }
  .threat-label { left: 19px; min-width: 58px; padding: 4px; font-size: 6px; }
  .map-readout { overflow-x: auto; flex-wrap: nowrap; width: auto; }
  .intel-panel { grid-template-columns: 1fr; }
  .summary-card, .feed-card { grid-column: auto; }
  .detail-card { order: 2; }
  .source-card { order: 3; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .dialog-actions { display: grid; }
  .primary-button { margin: 0; order: -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* Full-map interface */
.noise { display: none; }
body { background: #05080a; }
.workspace {
  width: 100%;
  display: block;
  min-height: calc(100vh - 72px);
  position: relative;
  overflow: hidden;
}
.map-column { padding: 0; height: calc(100vh - 72px); }
.map-toolbar {
  position: absolute;
  z-index: 18;
  left: 20px;
  top: 17px;
  margin: 0;
  width: calc(100% - 420px);
  pointer-events: none;
}
.map-toolbar > * { pointer-events: auto; }
.map-toolbar > div:first-child {
  padding: 11px 14px;
  border: 1px solid rgba(183, 207, 217, .18);
  background: rgba(5, 9, 12, .84);
  backdrop-filter: blur(12px);
}
.map-toolbar h1 { font-size: clamp(21px, 2vw, 31px); }
.map-actions {
  padding: 6px;
  border: 1px solid rgba(183, 207, 217, .18);
  background: rgba(5, 9, 12, .84);
  backdrop-filter: blur(12px);
}
.map-shell {
  height: 100%;
  min-height: 0;
  border: 0;
  background:
    linear-gradient(rgba(5, 10, 12, .45), rgba(5, 10, 12, .45)),
    url("/zarechensk-map-clean-v2.png") center / cover;
  box-shadow: none;
  cursor: grab;
  touch-action: none;
}
.map-shell.dragging { cursor: grabbing; }
.map-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 14;
  background: radial-gradient(circle at center, transparent 45%, rgba(2, 5, 7, .42) 100%);
}
.map-scene {
  width: min(100%, 1100px);
  top: 50%;
  left: calc(50% - 170px);
  transform: translate(-50%, -50%) translate(var(--pan-x, 0px), var(--pan-y, 0px)) scale(var(--zoom, 1));
  transition: none;
  will-change: transform;
  user-select: none;
}
.map-image { filter: saturate(.76) contrast(1.18) brightness(.7); pointer-events: none; }
.map-tint { background: rgba(4, 10, 12, .12); pointer-events: none; }
.grid-overlay {
  opacity: .66;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(133, 174, 188, .11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(133, 174, 188, .11) 1px, transparent 1px),
    linear-gradient(rgba(133, 174, 188, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(133, 174, 188, .035) 1px, transparent 1px);
  background-size: 10% 10%, 10% 10%, 2% 2%, 2% 2%;
}
.zone-layer { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.zone-shape {
  position: absolute;
  border: 1px solid rgba(131, 178, 194, .28);
  background: rgba(28, 72, 82, .08);
  color: rgba(203, 224, 230, .66);
  pointer-events: none;
  transition: background .2s, border-color .2s, filter .2s;
}
.zone-shape span {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(var(--inverse-zoom, 1));
  transform-origin: center;
  padding: 4px 7px;
  border: 1px solid rgba(161, 201, 213, .18);
  background: rgba(4, 9, 12, .72);
  white-space: nowrap;
  text-transform: uppercase;
  font: 750 7px/1 ui-monospace, Consolas, monospace;
  letter-spacing: .16em;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  backface-visibility: hidden;
}
.zone-shape.hot {
  background: rgba(255, 81, 50, .18);
  border-color: rgba(255, 100, 70, .8);
  filter: drop-shadow(0 0 9px rgba(255, 73, 40, .3));
  animation: zoneWarning 1.7s ease-in-out infinite;
}
@keyframes zoneWarning { 50% { background: rgba(255, 81, 50, .27); } }
.zone-rural { left: 2%; top: 2%; width: 35%; height: 95%; clip-path: polygon(0 0, 100% 0, 89% 22%, 73% 36%, 78% 100%, 0 100%); }
.zone-north { left: 28%; top: 1%; width: 44%; height: 35%; clip-path: polygon(0 0, 100% 0, 96% 70%, 77% 100%, 20% 82%); }
.zone-hydro { left: 68%; top: 1%; width: 31%; height: 49%; clip-path: polygon(0 0, 100% 0, 100% 100%, 28% 92%, 8% 45%); }
.zone-center { left: 17%; top: 32%; width: 43%; height: 42%; clip-path: polygon(12% 0, 90% 2%, 100% 48%, 82% 100%, 8% 93%, 0 34%); }
.zone-south { left: 18%; top: 67%; width: 45%; height: 30%; clip-path: polygon(7% 0, 82% 0, 100% 47%, 85% 100%, 0 100%); }
.landmark {
  z-index: 6;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: translate(-50%, -50%) scale(var(--inverse-zoom, 1));
  transform-origin: center;
  display: grid;
  place-items: center;
  backface-visibility: hidden;
}
.landmark-icon {
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(198, 222, 231, .72);
  background: rgba(4, 10, 13, .92);
  color: #d9e6eb;
  box-shadow: 0 0 0 3px rgba(4, 9, 12, .45);
  font: 800 9px/1 ui-monospace, Consolas, monospace;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}
.landmark[data-kind="power"] .landmark-icon { color: var(--amber); border-color: var(--amber); transform: rotate(45deg); }
.landmark[data-kind="power"] .landmark-icon b { transform: rotate(-45deg); }
.landmark[data-kind="service"] .landmark-icon { color: var(--red); border-color: rgba(255, 92, 53, .8); }
.landmark[data-kind="civic"] .landmark-icon { color: var(--blue); border-color: rgba(111, 200, 255, .75); }
.landmark[data-kind="village"] .landmark-icon { color: #b7c2c8; border-style: dashed; }
.landmark.hot {
  border-color: transparent;
  box-shadow: none;
  animation: landmarkSignal 1.1s ease-in-out infinite;
}
@keyframes landmarkSignal { 50% { filter: drop-shadow(0 0 11px var(--red)); } }
.landmark::after {
  opacity: 0;
  transform: translateY(2px);
  transition: opacity .15s, transform .15s;
  font-size: 8px;
}
.landmark:hover::after, .landmark:focus-visible::after, .landmark.hot::after {
  opacity: 1;
  transform: translateY(0);
}
.threat {
  width: 38px;
  height: 38px;
  margin: -19px 0 0 -19px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  filter: none;
  transform-origin: center;
}
.threat::before, .threat::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.threat::before {
  inset: 4px;
  border: 1px solid currentColor;
  opacity: .22;
  box-shadow: 0 0 10px color-mix(in srgb, currentColor 42%, transparent);
}
.threat::after {
  inset: -5px;
  border: 1px dashed currentColor;
  opacity: 0;
  animation: ringSpin 5s linear infinite;
}
@keyframes ringSpin { to { transform: rotate(360deg); } }
.threat.selected::before {
  inset: -6px;
  border-width: 2px;
  opacity: 1;
  box-shadow: 0 0 22px currentColor;
}
.threat.selected::after { inset: -13px; opacity: .7; }
.threat-image {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: brightness(0) invert(1) drop-shadow(0 0 4px currentColor);
  pointer-events: none;
}
.threat.missile .threat-image { width: 34px; height: 34px; }
.air-missile {
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  pointer-events: none;
}
.air-missile::before, .air-missile::after { display: none; }
.air-missile .threat-image { width: 28px; height: 28px; }
.threat-label {
  left: 42px;
  top: 3px;
  min-width: 85px;
  border-radius: 3px;
  backdrop-filter: blur(8px);
}
.map-popup {
  position: absolute;
  z-index: 13;
  width: 270px;
  min-height: 170px;
  padding: 15px;
  border: 1px solid rgba(190, 211, 220, .24);
  border-top: 2px solid var(--red);
  background: rgba(10, 13, 16, .96);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .62);
  opacity: 0;
  pointer-events: none;
  transform: translate(18px, -50%) scale(var(--inverse-zoom, 1));
  transform-origin: left center;
  transition: opacity .16s;
}
.map-popup.show { opacity: 1; pointer-events: auto; }
.map-popup::after {
  content: "";
  position: absolute;
  left: -7px;
  top: calc(50% - 7px);
  width: 12px;
  height: 12px;
  border-left: 1px solid rgba(190, 211, 220, .24);
  border-bottom: 1px solid rgba(190, 211, 220, .24);
  background: #0a0d10;
  transform: rotate(45deg);
}
.impact {
  position: absolute;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  color: var(--amber);
  transform: scale(var(--impact-scale, 1));
}
.impact-core, .impact-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.impact-core {
  width: 10px;
  height: 10px;
  background: white;
  box-shadow: 0 0 7px 3px var(--amber), 0 0 22px 8px var(--red);
  animation: impactCore .8s ease-out forwards;
}
.impact-ring {
  width: 10px;
  height: 10px;
  border: 2px solid white;
  box-shadow: 0 0 9px currentColor;
  animation: impactRing 1.2s cubic-bezier(.1,.65,.25,1) forwards;
}
.impact-ring.second { animation-delay: .13s; border-color: currentColor; }
.impact-fragment {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 12px;
  margin: -6px 0 0 -1px;
  background: linear-gradient(white, currentColor, transparent);
  transform-origin: 1px 6px;
  animation: impactFragment 1s ease-out forwards;
}
@keyframes impactCore { 0% { transform: translate(-50%,-50%) scale(.2); opacity: 0; } 18% { opacity: 1; } 100% { transform: translate(-50%,-50%) scale(3.7); opacity: 0; } }
@keyframes impactRing { 0% { transform: translate(-50%,-50%) scale(.2); opacity: 1; } 100% { transform: translate(-50%,-50%) scale(8); opacity: 0; } }
@keyframes impactFragment { 0% { opacity: 1; transform: rotate(var(--fragment-angle)) translateY(0) scaleY(.4); } 100% { opacity: 0; transform: rotate(var(--fragment-angle)) translateY(-46px) scaleY(1.2); } }
.map-scene.impact-shake { animation: impactShake .38s linear; }
@keyframes impactShake {
  0%,100% { margin: 0; }
  20% { margin: -2px 0 0 2px; }
  40% { margin: 2px 0 0 -2px; }
  60% { margin: 0 0 -2px 2px; }
  80% { margin: 1px 0 0 -1px; }
}
.popup-head { display: grid; grid-template-columns: 39px 1fr auto; gap: 9px; align-items: center; }
.popup-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 7px; background: var(--red); }
.popup-icon img { width: 29px; height: 29px; object-fit: contain; filter: brightness(0) invert(1); }
.popup-title { display: grid; gap: 3px; }
.popup-title strong { font-size: 13px; }
.popup-title small { color: var(--muted); font-size: 9px; }
.popup-close { width: 27px; height: 27px; border: 1px solid var(--line-strong); background: transparent; cursor: pointer; }
.popup-text { margin: 13px 0; color: #bdc8cd; font-size: 10px; line-height: 1.5; }
.confidence-pill { display: inline-flex; padding: 6px 8px; border-radius: 20px; background: rgba(255, 207, 74, .14); color: var(--amber); font-size: 9px; font-weight: 800; }
.popup-meta { margin-top: 11px; color: #606c74; font: 700 8px ui-monospace, Consolas, monospace; }
.coordinate-readout {
  position: absolute;
  z-index: 17;
  left: 18px;
  bottom: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(183, 207, 217, .18);
  background: rgba(5, 9, 12, .82);
  color: #b9c6cc;
  font: 700 9px ui-monospace, Consolas, monospace;
}
.coordinate-readout small { color: #66747b; }
.intel-panel {
  position: absolute;
  z-index: 18;
  right: 16px;
  top: 16px;
  bottom: 16px;
  width: 360px;
  border: 0;
  padding: 0;
  overflow-y: auto;
  background: transparent;
  scrollbar-width: thin;
}
.summary-card, .feed-card, .detail-card, .source-card {
  background: rgba(8, 12, 15, .91);
  backdrop-filter: blur(14px);
}
.feed-card { min-height: 220px; }
.event-feed { max-height: 265px; }
.fiction-note {
  position: absolute;
  z-index: 18;
  left: 18px;
  bottom: 15px;
  margin: 0;
  padding: 5px 8px;
  background: rgba(5, 9, 12, .72);
}
.map-readout { bottom: 80px; }

@media (max-width: 900px) {
  .workspace { overflow: visible; }
  .map-column { height: auto; }
  .map-toolbar {
    top: 10px;
    left: 10px;
    width: calc(100% - 20px);
  }
  .map-toolbar > div:first-child { background: rgba(5, 9, 12, .72); }
  .map-toolbar > div:first-child .section-code { display: none; }
  .map-toolbar h1 { font-size: 18px; margin: 0; }
  .map-shell { height: auto; min-height: 0; aspect-ratio: 1; }
  .map-scene { left: 50%; width: 100%; height: 100%; }
  .intel-panel {
    position: relative;
    inset: auto;
    width: auto;
    padding: 12px;
    display: grid;
    background: #070a0d;
  }
  .coordinate-readout { bottom: 47px; left: 8px; padding: 6px 8px; }
  .coordinate-readout small { display: none; }
  .fiction-note { position: static; display: block; padding: 10px 12px; background: #070a0d; }
  .map-readout { bottom: 8px; }
}

@media (max-width: 560px) {
  .preset-grid { grid-template-columns: 1fr 1fr; }
  .preset-button.wide { grid-column: 1 / -1; }
  .map-toolbar { grid-template-columns: 1fr auto; align-items: center; }
  .map-toolbar > div:first-child { padding: 8px 10px; }
  .map-toolbar h1 { font-size: 15px; }
  .map-actions { padding: 4px; }
  .map-actions .tool-button:first-child { display: inline-flex; }
  .map-shell { width: 100%; margin: 0; }
  .zone-shape span { font-size: 5px; padding: 2px 3px; }
  .landmark { width: 20px; height: 20px; }
  .landmark-icon { width: 15px; height: 15px; font-size: 8px; }
  .threat { width: 31px; height: 31px; margin: -15px 0 0 -15px; }
  .threat-image { width: 23px; height: 23px; }
  .threat-label { display: none; }
  .map-popup {
    position: fixed;
    left: 10px !important;
    right: 10px;
    bottom: 12px;
    top: auto !important;
    width: auto;
    transform: scale(var(--inverse-zoom, 1));
    transform-origin: center bottom;
    z-index: 45;
  }
  .map-popup::after { display: none; }
  .coordinate-readout { display: none; }
}
