:root {
  --bg: #0d1117;
  --panel: rgba(18, 24, 32, 0.92);
  --panel-solid: #121820;
  --panel-soft: #18212c;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f5f7fb;
  --muted: #9aa8b8;
  --faint: #687586;
  --accent: #ff5a2f;
  --accent-2: #29cc8b;
  --warning: #ffbd52;
  --danger: #ff3f3f;
  --blue: #65a8ff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 90, 47, 0.16), transparent 28%),
    radial-gradient(circle at 72% 5%, rgba(41, 204, 139, 0.12), transparent 30%),
    var(--bg);
  color: var(--text);
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

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

button {
  border: 0;
  cursor: pointer;
  min-height: 40px;
  touch-action: manipulation;
}

.shell {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  grid-template-rows: 76px minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.command-bar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 17, 23, 0.84);
  backdrop-filter: blur(18px);
  z-index: 20;
}

.identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #ff8b42);
  color: #220b04;
  font-weight: 950;
  letter-spacing: 0.03em;
  box-shadow: 0 10px 34px rgba(255, 90, 47, 0.28);
}

h1,
h2,
h3,
p {
  margin: 0;
}

.identity h1 {
  font-size: 18px;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.identity p,
.small-note {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.text-link {
  color: var(--accent-2);
  font-weight: 800;
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

.source-breakdown {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid rgba(126, 169, 210, 0.18);
  border-radius: 8px;
  background: rgba(4, 9, 14, 0.42);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.source-breakdown strong {
  color: var(--text);
}

.source-breakdown div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.source-breakdown span {
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(46, 230, 128, 0.09);
  color: #bfead6;
  font-weight: 800;
}

.tabs {
  justify-self: center;
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.tab {
  flex: 0 0 auto;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 800;
}

.tab.active {
  color: #09100d;
  background: var(--accent-2);
}

.system-state,
.button-row,
.panel-head,
.sync-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.system-state {
  justify-content: end;
}

.state-dot {
  position: relative;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.state-dot::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 18px rgba(255, 189, 82, 0.7);
}

.state-dot.online::before {
  background: var(--accent-2);
  box-shadow: 0 0 18px rgba(41, 204, 139, 0.7);
}

.left-rail {
  overflow: auto;
  padding: 16px;
  border-right: 1px solid var(--line);
  background: rgba(9, 12, 17, 0.5);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.panel,
.floating-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel {
  padding: 16px;
  margin-bottom: 14px;
}

.dark-panel {
  background: rgba(15, 20, 28, 0.92);
}

.section-label {
  display: block;
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0;
}

.score {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.045);
}

.score strong {
  display: block;
  font-size: 30px;
  line-height: 1;
}

.score span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  margin-top: 6px;
  text-transform: uppercase;
}

.score.danger strong {
  color: var(--accent);
}

.score.warning strong {
  color: var(--warning);
}

.sync-line {
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.panel-head {
  justify-content: space-between;
  margin-bottom: 12px;
}

.mini-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  padding: 5px 8px;
}

.live-mode-pill {
  align-items: center;
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.42);
  border-radius: 12px;
  color: var(--green);
  display: flex;
  font-size: 13px;
  font-weight: 900;
  min-height: 38px;
  padding: 0 12px;
}

.field {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.inline-field {
  min-width: 110px;
  margin-top: 0;
}

.field span {
  color: var(--faint);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: rgba(4, 8, 12, 0.68);
  color: var(--text);
  outline: none;
  padding: 11px 12px;
}

textarea {
  resize: vertical;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(41, 204, 139, 0.68);
  box-shadow: 0 0 0 3px rgba(41, 204, 139, 0.14);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 92px;
  gap: 10px;
}

.toggle {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.toggle:last-child {
  border-bottom: 0;
}

.toggle input {
  width: auto;
  accent-color: var(--accent-2);
}

.fire-curtain-toggle {
  margin: 7px 0;
  padding: 10px 12px;
  border: 1px solid rgba(183, 255, 0, 0.55);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(183, 255, 0, 0.18), rgba(183, 255, 0, 0.05));
  color: #eaff9a;
  font-weight: 950;
  box-shadow: 0 0 0 1px rgba(183, 255, 0, 0.08), 0 0 22px rgba(183, 255, 0, 0.16);
}

.fire-curtain-toggle input {
  accent-color: #b7ff00;
}

.fire-curtain-controls {
  margin: -3px 0 8px;
  padding: 8px 10px 10px;
  border: 1px solid rgba(183, 255, 0, 0.22);
  border-radius: 8px;
  background: rgba(183, 255, 0, 0.06);
}

.fire-curtain-controls span {
  color: #dfff3f;
}

.fire-curtain-controls select {
  border-color: rgba(183, 255, 0, 0.44);
  background: rgba(5, 12, 4, 0.88);
  color: #efff7a;
  font-weight: 900;
}

.fire-curtain-controls select:focus {
  border-color: rgba(183, 255, 0, 0.82);
  box-shadow: 0 0 0 3px rgba(183, 255, 0, 0.16);
}

.primary-button,
.ghost-button,
.wide-action,
.link-button {
  border-radius: 9px;
  font-weight: 900;
}

.primary-button {
  background: var(--accent);
  color: #fff;
  padding: 11px 14px;
  box-shadow: 0 10px 26px rgba(255, 90, 47, 0.22);
}

.as-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.primary-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ghost-button {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 10px 13px;
}

.link-button {
  background: transparent;
  color: var(--muted);
  padding: 0;
  text-transform: uppercase;
  font-size: 11px;
}

.wide-action {
  width: 100%;
  border: 1px solid rgba(255, 90, 47, 0.42);
  background: rgba(255, 90, 47, 0.14);
  color: #ffd4c8;
  padding: 13px;
  margin-top: 10px;
  text-align: left;
}

.wide-action.secondary {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
}

.overlay-panel {
  position: relative;
  margin-top: 10px;
}

.overlay-main-button {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(124, 58, 237, 0.5);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.28), rgba(79, 70, 229, 0.2));
  color: #ddd6fe;
  padding: 11px 12px;
  font-weight: 900;
}

.overlay-main-button.active {
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.45), 0 14px 34px rgba(124, 58, 237, 0.22);
}

.overlay-main-button strong {
  color: #a78bfa;
  font-size: 11px;
  text-transform: uppercase;
}

.overlay-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 9000;
  overflow: hidden;
  border: 1px solid rgba(124, 58, 237, 0.35);
  border-radius: 10px;
  background: rgba(14, 20, 32, 0.98);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
}

.overlay-menu-title {
  padding: 9px 12px 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.overlay-option {
  width: 100%;
  min-height: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
}

.overlay-option:hover {
  background: rgba(124, 58, 237, 0.13);
}

.overlay-option.danger {
  color: var(--danger);
}

.overlay-option .opt-icon {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(101, 168, 255, 0.12);
  color: #93c5fd;
  font-weight: 950;
}

.overlay-option span:last-child {
  display: grid;
  gap: 2px;
}

.overlay-option strong {
  font-size: 13px;
}

.overlay-option small {
  color: var(--muted);
  font-size: 11px;
}

.main-stage {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.map-stage {
  position: relative;
  height: calc(100vh - 76px);
  height: calc(100dvh - 76px);
  overflow: hidden;
}

#map {
  position: absolute;
  inset: 0;
  background: #18251f;
}

.map-overlay-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.overlay-opacity-bar {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 9800;
  display: none;
  overflow: hidden;
  border: 1px solid rgba(124, 58, 237, 0.5);
  border-radius: 10px;
  background: rgba(6, 11, 20, 0.96);
  box-shadow: 0 20px 54px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px);
}

.overlay-opacity-bar.active {
  display: block;
}

.overlay-opacity-bar.minimized .overlay-bar-body {
  display: none;
}

.overlay-bar-top,
.overlay-bar-actions,
.overlay-slider-row,
.overlay-controls {
  display: flex;
  align-items: center;
}

.overlay-bar-top {
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.overlay-bar-title {
  display: block;
  color: #c4b5fd;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.overlay-bar-top strong {
  color: #ffffff;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

.overlay-bar-actions {
  gap: 6px;
}

.overlay-bar-actions button,
.overlay-controls button {
  min-height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 900;
}

.overlay-bar-actions button.active,
.overlay-controls button.active,
.overlay-controls button.locked {
  border-color: #7c3aed;
  background: #7c3aed;
  color: #ffffff;
}

.overlay-bar-body {
  padding: 9px 12px 11px;
}

.overlay-slider-row {
  gap: 10px;
}

.overlay-slider-row span,
.overlay-controls span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.overlay-slider-row input {
  flex: 1;
  accent-color: #7c3aed;
}

.overlay-controls {
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.overlay-slot.loaded {
  border-color: #a78bfa;
  color: #ddd6fe;
}

.leaflet-container {
  font-family: inherit;
}

.leaflet-control-attribution {
  background: rgba(8, 12, 16, 0.74) !important;
  color: var(--muted) !important;
}

.floating-card {
  position: absolute;
  left: 22px;
  bottom: 22px;
  z-index: 500;
  width: min(620px, calc(100% - 420px));
  padding: 18px;
  backdrop-filter: blur(18px);
}

.selected-card {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
}

.selected-card h2 {
  margin-top: 6px;
  font-size: 22px;
}

.selected-card p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px;
}

.right-stack {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 500;
  width: 360px;
  max-height: calc(100dvh - 112px);
  overflow: auto;
  padding-right: 2px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.stack-list {
  display: grid;
  gap: 10px;
}

.item-card {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.055);
  padding: 12px;
}

.item-card.interactive {
  cursor: pointer;
}

.item-card h3,
.item-card h4 {
  margin: 0;
  font-size: 14px;
}

.item-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 5px;
}

.tag-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 9px;
}

.tag {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  padding: 5px 8px;
  text-transform: uppercase;
}

.tag.danger {
  background: rgba(255, 63, 63, 0.14);
  color: #ffb5b5;
}

.tag.warning {
  background: rgba(255, 189, 82, 0.14);
  color: #ffe0a8;
}

.tag.ok {
  background: rgba(41, 204, 139, 0.14);
  color: #aaf2d2;
}

.content-view {
  min-height: calc(100vh - 76px);
  min-height: calc(100dvh - 76px);
  padding: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 240px),
    rgba(6, 9, 13, 0.16);
}

.content-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.content-head h2 {
  font-size: 28px;
  letter-spacing: -0.02em;
  margin-top: 5px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.two-pane {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
  gap: 16px;
}

.effis-layout {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 16px;
}

.effis-map-panel {
  position: relative;
  min-height: calc(100vh - 205px);
  padding: 0;
  overflow: hidden;
}

.effis-map {
  width: 100%;
  height: calc(100vh - 205px);
  min-height: 560px;
  background: #0b1016;
}

.effis-legend {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 500;
}

.legend-ramp {
  width: 120px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2dcc70, #f2d94e, #f08a34, #d6422f, #7b1f8c);
}

.ine-layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 16px;
}

.ine-summary-panel,
.ine-table-panel {
  margin: 0;
}

.ine-score-grid {
  grid-template-columns: 1fr;
}

.ine-chart {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.bar-row {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr) 74px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.bar-track {
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--warning));
}

.ine-table {
  display: grid;
  gap: 7px;
}

.ine-row {
  display: grid;
  grid-template-columns: 1fr 90px 90px;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.ine-row strong {
  color: var(--text);
}

.ine-row.focused {
  margin: 2px -8px;
  padding: 12px 8px;
  border: 1px solid rgba(41, 204, 139, 0.45);
  border-radius: 9px;
  background: rgba(41, 204, 139, 0.11);
}

.iframe-view {
  padding-bottom: 18px;
}

.iframe-shell {
  height: calc(100vh - 185px);
  height: calc(100dvh - 185px);
  min-height: 560px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #05070a;
  box-shadow: var(--shadow);
}

.iframe-shell iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: #05070a;
}

.iframe-note {
  margin-top: 10px;
}

.external-source-panel,
.external-source-workbench {
  display: grid;
  grid-template-columns: minmax(340px, 1.1fr) minmax(300px, 0.9fr);
  gap: 16px;
}

.external-source-card,
.external-source-tools {
  min-height: 260px;
}

.external-source-workbench {
  grid-template-columns: minmax(0, 1fr) 300px;
  margin-bottom: 16px;
}

.external-source-tools {
  min-height: auto;
}

.external-source-tools.compact {
  display: grid;
  align-content: center;
  gap: 12px;
}

.external-source-card h3 {
  margin: 8px 0 10px;
  font-size: 28px;
}

.external-source-card p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
  max-width: 760px;
}

.big-source-link {
  min-height: 46px;
  padding-inline: 22px;
}

.wrap {
  flex-wrap: wrap;
}

.external-embed-host {
  height: calc(100vh - 250px);
  height: calc(100dvh - 250px);
  min-height: 540px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #05070a;
  box-shadow: var(--shadow);
}

.external-embed-host iframe,
.external-embed-host object,
.external-embed-host embed {
  width: 100%;
  height: 100%;
  border: 0;
  background: #05070a;
}

.community-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.protocol-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.protocol-list article {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.055);
}

.protocol-list strong {
  color: var(--text);
}

.protocol-list span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.community-frame {
  height: 48vh;
  min-height: 420px;
}

.camera-detail {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.dispatch-options {
  display: flex;
  gap: 10px;
  margin: 8px 0 10px;
}

.dispatch-recipients {
  display: grid;
  gap: 7px;
  max-height: 190px;
  overflow: auto;
  padding-right: 4px;
}

.dispatch-recipient {
  display: flex;
  gap: 8px;
  align-items: start;
  color: var(--muted);
  font-size: 12px;
}

.dispatch-recipient input {
  width: auto;
  margin-top: 2px;
}

.modal {
  border: 0;
  padding: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(6px);
}

.modal-card {
  width: min(560px, calc(100vw - 28px));
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--panel-solid);
  color: var(--text);
  padding: 18px;
  box-shadow: var(--shadow);
}

.list-panel,
.composer-panel {
  margin: 0;
}

.composer-panel textarea {
  min-height: 260px;
  margin-top: 14px;
}

.button-row.end {
  justify-content: flex-end;
  margin-top: 12px;
}

.fire-marker {
  width: 22px;
  height: 22px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  background: var(--accent);
  box-shadow:
    0 0 0 9px rgba(255, 90, 47, 0.22),
    0 0 32px rgba(255, 90, 47, 0.72);
}

.critical-fire-marker {
  width: 34px;
  height: 34px;
  border: 3px solid #fff;
  background: #ff8a00;
  box-shadow:
    0 0 0 10px rgba(255, 138, 0, 0.24),
    0 0 0 20px rgba(255, 138, 0, 0.12),
    0 0 40px rgba(255, 138, 0, 0.94);
  position: relative;
}

.weather-badge {
  min-width: 52px;
  padding: 5px 8px;
  border: 2px solid #ff8a00;
  border-radius: 999px;
  background: rgba(6, 9, 13, 0.86);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  backdrop-filter: blur(8px);
}

.weather-wind {
  width: 0;
  height: 0;
  margin: 0 auto;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 28px solid #45b7ff;
  filter: drop-shadow(0 0 12px rgba(69, 183, 255, 0.9));
  transform-origin: center 22px;
}

.weather-wind-label {
  margin-top: 2px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(6, 9, 13, 0.78);
  color: #dcecff;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

.fire-curtain-label {
  border: 1px solid rgba(183, 255, 0, 0.82);
  border-radius: 999px;
  background: rgba(8, 14, 6, 0.92);
  color: #efff7a;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0;
  text-shadow: 0 0 10px rgba(183, 255, 0, 0.72);
  box-shadow: 0 0 0 1px rgba(183, 255, 0, 0.16), 0 0 18px rgba(183, 255, 0, 0.48), 0 8px 22px rgba(0, 0, 0, 0.34);
}

.fire-curtain-title {
  border: 1px solid rgba(183, 255, 0, 0.92);
  border-radius: 999px;
  background: rgba(5, 12, 4, 0.94);
  color: #dfff3f;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(183, 255, 0, 0.86);
  box-shadow: 0 0 24px rgba(183, 255, 0, 0.56);
}

.fire-curtain-label::before,
.fire-curtain-title::before {
  display: none;
}

.popup-note {
  display: block;
  margin-top: 6px;
  color: #6b4a00;
  font-size: 12px;
  line-height: 1.35;
}

.weather-panel-list {
  display: grid;
  gap: 8px;
}

.weather-mini-card {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid rgba(255, 138, 0, 0.24);
  border-radius: 9px;
  background: rgba(255, 138, 0, 0.08);
}

.weather-mini-card strong {
  color: var(--text);
}

.weather-mini-card span {
  color: var(--muted);
  font-size: 12px;
}

.critical-fire-marker::after {
  content: "!";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 21px;
  font-weight: 1000;
  line-height: 1;
}

.client-marker,
.authority-marker {
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-radius: 5px;
  background: var(--accent-2);
  box-shadow: 0 0 22px rgba(41, 204, 139, 0.45);
}

.authority-marker {
  background: var(--blue);
  transform: rotate(45deg);
}

.search-marker {
  width: 30px;
  height: 30px;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 4px;
  background: var(--accent-2);
  box-shadow:
    0 0 0 9px rgba(41, 204, 139, 0.22),
    0 0 34px rgba(41, 204, 139, 0.78);
  transform: rotate(-45deg);
  position: relative;
}

.search-marker::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: #061019;
}

@media (min-width: 1600px) and (max-width: 2199px) {
  .shell {
    grid-template-columns: 300px minmax(0, 1fr);
    grid-template-rows: 64px minmax(0, 1fr);
  }

  .command-bar {
    grid-template-columns: minmax(210px, 280px) minmax(0, 1fr) auto;
    gap: 12px;
    padding: 8px 12px;
  }

  .identity h1 {
    font-size: 17px;
  }

  .identity p {
    font-size: 11px;
    line-height: 1.25;
  }

  .tab {
    padding: 8px 11px;
    font-size: 12px;
  }

  .primary-button {
    padding: 10px 13px;
  }

  .left-rail {
    padding: 14px;
  }

  .panel {
    padding: 14px;
    margin-bottom: 12px;
  }

  .score strong {
    font-size: 28px;
  }

  .map-stage {
    height: calc(100dvh - 64px);
  }

  .right-stack {
    top: 16px;
    right: 16px;
    width: 340px;
    max-height: calc(100dvh - 96px);
  }

  .floating-card {
    left: 18px;
    bottom: 18px;
    width: min(580px, calc(100% - 390px));
  }
}

@media (min-width: 2200px) {
  :root {
    font-size: 17px;
  }

  .shell {
    grid-template-columns: 420px minmax(0, 1fr);
    grid-template-rows: 96px minmax(0, 1fr);
  }

  .command-bar {
    grid-template-columns: minmax(330px, 520px) minmax(0, 1fr) auto;
    gap: 26px;
    padding: 20px 30px;
  }

  .mark {
    width: 56px;
    height: 56px;
  }

  .identity h1 {
    font-size: 26px;
  }

  .identity p {
    font-size: 14px;
  }

  .tab {
    padding: 14px 20px;
    font-size: 15px;
  }

  .left-rail {
    padding: 26px;
  }

  .panel {
    padding: 20px;
  }

  .score strong {
    font-size: 40px;
  }

  .map-stage {
    height: calc(100dvh - 96px);
  }

  .right-stack {
    top: 26px;
    right: 26px;
    width: 460px;
    max-height: calc(100dvh - 150px);
  }

  .floating-card {
    left: 32px;
    bottom: 32px;
    width: min(820px, calc(100% - 540px));
  }
}

@media (max-width: 1120px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .command-bar {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 12px;
    padding: 12px;
    position: sticky;
    top: 0;
  }

  .tabs {
    justify-self: stretch;
    overflow-x: auto;
  }

  .system-state {
    display: grid;
    grid-template-columns: 1fr auto;
    justify-content: stretch;
  }

  .left-rail {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    max-height: 42dvh;
    padding: 12px;
  }

  .left-rail .panel {
    margin: 0;
  }

  .map-stage {
    height: auto;
    min-height: calc(100dvh - 76px);
  }

  .right-stack,
  .floating-card {
    position: static;
    width: auto;
    margin: 14px;
    max-height: none;
    overflow: visible;
  }

  .map-stage {
    overflow: auto;
  }

  #map {
    position: relative;
    height: 62dvh;
    min-height: 460px;
  }

  .two-pane {
    grid-template-columns: 1fr;
  }

  .ine-layout {
    grid-template-columns: 1fr;
  }

  .content-view {
    padding: 18px;
  }

  .content-head {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .external-source-workbench,
  .effis-layout {
    grid-template-columns: 1fr;
  }

  .iframe-shell,
  .external-embed-host,
  .effis-map {
    min-height: 520px;
  }
}

@media (max-width: 680px) {
  body {
    background: var(--bg);
  }

  .command-bar {
    padding: 10px;
  }

  .identity h1 {
    font-size: 16px;
  }

  .identity p {
    font-size: 11px;
    line-height: 1.25;
  }

  .mark {
    width: 38px;
    height: 38px;
  }

  .tab {
    padding: 10px 12px;
    font-size: 12px;
  }

  .left-rail {
    grid-template-columns: 1fr;
    max-height: none;
    order: 3;
  }

  .main-stage {
    order: 2;
  }

  .panel {
    padding: 14px;
    margin-bottom: 10px;
  }

  .score-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .selected-card,
  .content-head,
  .system-state,
  .button-row {
    align-items: stretch;
    flex-direction: column;
  }

  .system-state {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button-row > *,
  .system-state > *,
  .content-head .button-row,
  .content-head a,
  .content-head button {
    width: 100%;
  }

  #map {
    height: 58dvh;
    min-height: 380px;
  }

  .floating-card,
  .right-stack {
    margin: 10px;
  }

  .selected-card h2 {
    font-size: 19px;
  }

  .content-view {
    padding: 12px;
  }

  .content-head h2 {
    font-size: 23px;
  }

  .cards-grid,
  .community-grid {
    grid-template-columns: 1fr;
  }

  .iframe-shell,
  .external-embed-host,
  .effis-map {
    height: 68dvh;
    min-height: 430px;
  }

  .modal {
    width: calc(100vw - 20px);
    max-width: none;
  }
}

@media (max-width: 420px) {
  .score {
    padding: 10px;
  }

  .score strong {
    font-size: 26px;
  }

  input,
  select,
  textarea,
  .primary-button,
  .ghost-button,
  .wide-action {
    padding: 12px;
  }

  .weather-badge {
    min-width: 46px;
    font-size: 11px;
  }
}
