:root {
  color-scheme: light;
  --ink: #1b2430;
  --muted: #667282;
  --line: #d7dee8;
  --paper: #f4f6f8;
  --panel: #ffffff;
  --panel-soft: #edf1f5;
  --nav: #121923;
  --nav-2: #243142;
  --green: #526981;
  --green-2: #e4ebf2;
  --amber: #b66a12;
  --amber-2: #fff0d8;
  --red: #b33b32;
  --red-2: #f9dfdc;
  --blue: #266f9d;
  --blue-2: #e0eef7;
  --violet: #6b5aa7;
  --shadow: 0 18px 44px rgba(17, 28, 24, 0.1);
  --shadow-soft: 0 8px 24px rgba(17, 28, 24, 0.08);
  --radius: 8px;
  --sidebar: 286px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #edf4f8;
  --muted: #9fafbd;
  --line: #334252;
  --paper: #0d131b;
  --panel: #151d27;
  --panel-soft: #1d2835;
  --nav: #080d13;
  --nav-2: #121b27;
  --green: #7f98b0;
  --green-2: #223244;
  --amber: #d7963f;
  --amber-2: #3d2a16;
  --red: #e06b63;
  --red-2: #3d1f22;
  --blue: #68a9cf;
  --blue-2: #183044;
  --violet: #a596dc;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 30% 0%, rgba(82, 105, 129, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(245, 247, 244, 0.94)),
    var(--paper);
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at 30% 0%, rgba(104, 169, 207, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(20, 30, 42, 0.88), rgba(8, 13, 19, 0.96)),
    var(--paper);
}

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

button {
  cursor: pointer;
}

button,
input,
select,
textarea {
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease, transform 140ms ease;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(82, 105, 129, 0.24);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

body.auth-required .app-shell {
  grid-template-columns: minmax(0, 1fr);
}

body.auth-required .sidebar,
body.auth-required #logoutButton,
body.auth-required .current-user {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  max-height: 100dvh;
  padding: 18px;
  color: #f7f5ef;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 34%),
    linear-gradient(180deg, var(--nav), var(--nav-2));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  z-index: 20;
  overflow: hidden;
  min-height: 0;
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 15;
  display: none;
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: rgba(12, 23, 34, 0.36);
  cursor: pointer;
}

body.auth-required .nav-backdrop {
  display: none;
}

.brand {
  width: 100%;
  min-height: 64px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  padding: 8px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  color: inherit;
  background: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-decoration: none;
  text-align: left;
}

.brand img {
  width: 48px;
  height: 48px;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.2;
}

.brand strong {
  font-size: 15px;
}

.brand small {
  margin-top: 3px;
  color: #b8c9c0;
}

.sidebar-scroll {
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-gutter: stable;
  padding-right: 3px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.nav {
  display: grid;
  gap: 7px;
  align-content: start;
}

.nav button,
.sidebar-action-button {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
  text-decoration: none;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  column-gap: 10px;
  align-items: center;
  align-content: center;
  justify-items: start;
  text-align: left;
  line-height: 1.15;
}

.nav button:hover,
.nav button.active,
.sidebar-action-button:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

.nav button.active {
  box-shadow: inset 3px 0 0 #78d9b6, 0 10px 24px rgba(0, 0, 0, 0.12);
}

.nav button span:last-child,
.sidebar-action-button span:last-child {
  min-width: 0;
  align-self: center;
  justify-self: start;
  font-weight: 760;
  line-height: 1.15;
}

.nav .nav-icon,
.sidebar-action-button .nav-icon {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  font-size: 14px;
  font-weight: 800;
}

.sidebar-actions {
  flex: 0 0 auto;
  display: grid;
  gap: 7px;
  padding-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.connection-card {
  flex: 0 0 auto;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.07);
  display: grid;
  gap: 4px;
}

.sidebar-identity {
  display: grid;
  gap: 6px;
}

.sidebar-identity:not(:empty) {
  margin-bottom: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-identity label {
  display: grid;
  gap: 4px;
}

.sidebar-identity span {
  color: #b8c9c0;
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.sidebar-identity select {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  padding: 6px 9px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-identity select option {
  color: var(--ink);
}

.connection-card > div:not(.sidebar-identity) {
  display: flex;
  gap: 7px;
  align-items: center;
}

.connection-card small {
  display: block;
  margin-top: 6px;
  color: #b8c9c0;
}

.connection-card .connection-user {
  width: 100%;
  border: 0;
  max-width: none;
  min-height: 26px;
  padding: 2px 2px 0;
  color: #ffffff;
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  align-items: center;
  justify-content: center;
  line-height: 1.15;
}

.connection-card .connection-user .pulse {
  flex: 0 0 auto;
}

.connection-card.offline .pulse {
  background: #d89345;
  box-shadow: 0 0 0 6px rgba(216, 147, 69, 0.16);
}

.pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #71d69e;
  box-shadow: 0 0 0 6px rgba(113, 214, 158, 0.14);
}

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  min-height: 78px;
  padding: 14px clamp(16px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  z-index: 10;
}

.route-title span,
.section-kicker,
.metric span,
.card-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.route-title h1 {
  margin: 1px 0 0;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.05;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.current-user {
  max-width: 220px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button,
.icon-round {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--panel);
}

.icon-button {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: none;
  place-items: center;
}

.icon-button span {
  width: 18px;
  height: 2px;
  display: block;
  margin: 2px 0;
  background: currentColor;
}

.icon-round {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
}

.primary-button,
.signal-button,
.ghost-button,
.tool-button {
  min-height: 40px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 0 14px;
  font-weight: 760;
}

.primary-button {
  color: #ffffff;
  background: linear-gradient(180deg, #667f99, var(--green));
  box-shadow: 0 10px 22px rgba(82, 105, 129, 0.2);
}

.signal-button {
  color: var(--ink);
  background: #fff7e8;
  border-color: #edcf9d;
}

.ghost-button,
.tool-button {
  color: var(--ink);
  background: var(--panel);
  border-color: var(--line);
}

.primary-button:hover,
.signal-button:hover,
.ghost-button:hover,
.tool-button:hover,
.icon-round:hover,
.icon-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.tool-button[aria-pressed="true"] {
  color: #ffffff;
  background: var(--ink);
  border-color: var(--ink);
}

.content {
  padding: clamp(16px, 3vw, 34px);
}

.login-view {
  min-height: calc(100vh - 140px);
  display: grid;
  place-items: center;
}

.login-panel {
  width: min(420px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
}

.login-panel h2,
.login-panel p {
  margin: 0;
}

.login-panel label {
  display: grid;
  gap: 6px;
  font-weight: 800;
}

.login-panel input {
  min-height: 42px;
}

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.password-field input {
  min-width: 0;
}

.fms-kennung-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.fms-kennung-field input {
  min-width: 0;
  text-transform: uppercase;
}

.fms-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--panel-soft);
  display: grid;
  gap: 4px;
}

.fms-preview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.fms-preview strong {
  font-size: 22px;
}

.fms-preview strong.invalid {
  color: var(--red);
}

.fms-input-table {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #ffffff;
}

.fms-input-row {
  min-height: 42px;
  display: grid;
  grid-template-columns: 92px minmax(160px, 1fr) minmax(120px, 0.8fr) 120px minmax(160px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.fms-input-row:first-child {
  border-top: 0;
}

.fms-input-row.head {
  min-height: 36px;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 12px;
  text-transform: uppercase;
}

.fms-input-row.accepted {
  background: #eefaf4;
}

.fms-input-row.skipped {
  background: #f7f9fb;
}

.fms-input-row.unknown,
.fms-input-row.error {
  background: #fff1ef;
}

.fms-input-row.ignored {
  background: #fff8e8;
}

.settings-section {
  display: grid;
  gap: 10px;
}

.settings-section h3 {
  margin: 0;
}

.settings-inline-actions {
  display: flex;
  justify-content: flex-start;
}

.alarm-tone-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #ffffff;
  display: grid;
  gap: 10px;
}

.alarm-tone-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.alarm-tone-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.alarm-tone-row input {
  text-transform: uppercase;
}

.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 850;
}

.check-inline input {
  width: 18px;
  height: 18px;
}

.wake-lock-option {
  width: fit-content;
  max-width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  font-size: 14px;
}

.settings-option {
  width: fit-content;
  max-width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  font-size: 14px;
}

#wakeLockStatus:empty {
  display: none;
}

.alarm-dispatch-panel {
  width: min(640px, calc(100vw - 28px));
}

.alarm-dispatch-list,
.alarm-log-list {
  display: grid;
  gap: 8px;
}

.alarm-dispatch-row,
.alarm-log-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: #ffffff;
  display: grid;
  gap: 10px;
}

.alarm-dispatch-row {
  grid-template-columns: minmax(220px, 1fr) 170px;
  align-items: center;
}

.alarm-dispatch-check {
  justify-content: flex-start;
  font-size: 14px;
}

.alarm-log-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.password-toggle {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--ink);
  background: var(--panel-soft);
  font-size: 12px;
  font-weight: 800;
}

.login-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.imprint-content {
  max-height: min(58vh, 520px);
  overflow: auto;
  display: grid;
  gap: 8px;
  color: var(--ink);
}

.imprint-content p {
  margin: 0;
  white-space: pre-wrap;
}

.view {
  display: grid;
  gap: 20px;
}

.hero-band {
  min-height: 246px;
  padding: clamp(20px, 4vw, 36px);
  border-radius: var(--radius);
  color: #ffffff;
  background:
    linear-gradient(90deg, rgba(27, 36, 48, 0.92), rgba(82, 105, 129, 0.74)),
    url("../assets/logo/emc_logo_rect.svg") right 24px center / min(420px, 44vw) auto no-repeat,
    var(--ink);
  display: grid;
  align-content: end;
}

.hero-band h2 {
  max-width: 780px;
  margin: 8px 0;
  font-size: clamp(30px, 5vw, 58px);
  line-height: 0.98;
}

.hero-band .section-kicker {
  color: #c7ead9;
}

.hero-band p {
  max-width: 660px;
  margin: 0;
  color: #dae8df;
  font-size: clamp(16px, 1.7vw, 20px);
}

.grid-4,
.grid-3,
.split-grid {
  display: grid;
  gap: 16px;
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.split-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
}

.panel,
.metric,
.incident-card,
.resource-card,
.voice-group,
.tableau,
.list-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.panel {
  padding: 18px;
  min-width: 0;
}

.panel-head {
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.panel-head h2,
.panel-head h3,
.modal-head h2 {
  margin: 2px 0 0;
  line-height: 1.14;
}

.panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.metric {
  min-height: 122px;
  padding: 18px;
  display: grid;
  align-content: space-between;
}

.metric strong {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
}

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

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.status-filter > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.status-filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.panel-stack {
  display: grid;
  gap: 12px;
}

.pill {
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  background: var(--pill-bg, var(--panel-soft));
  font-size: 13px;
  font-weight: 720;
}

.pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pill-dot, var(--muted));
}

.pill.green {
  background: var(--green-2);
}

.pill.green::before {
  background: var(--green);
}

.pill.amber {
  background: var(--amber-2);
}

.pill.amber::before {
  background: var(--amber);
}

.pill.red {
  background: var(--red-2);
}

.pill.red::before {
  background: var(--red);
}

.pill.blue {
  background: var(--blue-2);
}

.pill.blue::before {
  background: var(--blue);
}

.incident-list,
.resource-list,
.voice-grid,
.tableau-grid,
.list-stack,
.chat-log,
.section-stack,
.section-grid,
.assigned-list {
  display: grid;
  gap: 10px;
}

.incident-card,
.resource-card,
.voice-group,
.tableau,
.list-row {
  padding: 14px;
}

.incident-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.incident-card.active {
  border-color: rgba(82, 105, 129, 0.46);
  background: linear-gradient(180deg, #ffffff, #f1faf6);
}

.incident-actions {
  min-width: 132px;
  display: grid;
  gap: 8px;
  justify-items: end;
  align-content: start;
}

.incident-card h3,
.resource-card h3,
.voice-group h3,
.tableau h3 {
  margin: 0 0 5px;
  font-size: 17px;
}

.incident-card p,
.resource-card p,
.voice-group p,
.tableau p,
.list-row p {
  margin: 0;
  color: var(--muted);
}

.timeline {
  position: relative;
  display: grid;
  gap: 14px;
}

.command-lage-panel {
  display: grid;
  gap: 14px;
}

.lage-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.active-lage {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--panel-soft);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.active-lage strong,
.active-lage span {
  display: block;
}

.active-lage span {
  margin-top: 4px;
  color: var(--muted);
}

.timeline-item {
  padding-left: 24px;
  position: relative;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
}

.timeline-item strong,
.timeline-item span {
  display: block;
}

.timeline-item span {
  margin-top: 3px;
  color: var(--muted);
}

.section-incident,
.section-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfaf7;
}

.section-incident {
  padding: 12px;
}

.section-incident-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

.section-incident-head strong,
.section-incident-head span {
  display: block;
}

.section-incident-head span,
.muted {
  color: var(--muted);
}

.section-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.section-card {
  padding: 12px;
}

.assigned-resource {
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.9fr);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.assigned-resource span {
  font-weight: 760;
}

.compact-label {
  margin-top: 4px;
  font-size: 13px;
}

.tabs,
.toolbar,
.filter-row,
.ptt-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: end;
  align-items: center;
}

.tabs {
  margin-bottom: 14px;
}

.filter-row input,
.filter-row select,
label input,
label select,
label textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--ink);
  background: #fbfdfb;
}

:root[data-theme="dark"] .filter-row input,
:root[data-theme="dark"] .filter-row select,
:root[data-theme="dark"] label input,
:root[data-theme="dark"] label select,
:root[data-theme="dark"] label textarea {
  color: var(--ink);
  background: #111a24;
  border-color: var(--line);
}

.filter-row input:focus,
.filter-row select:focus,
label input:focus,
label select:focus,
label textarea:focus {
  border-color: rgba(82, 105, 129, 0.55);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(82, 105, 129, 0.09);
}

label textarea {
  resize: vertical;
}

:root[data-theme="dark"] .filter-row input:focus,
:root[data-theme="dark"] .filter-row select:focus,
:root[data-theme="dark"] label input:focus,
:root[data-theme="dark"] label select:focus,
:root[data-theme="dark"] label textarea:focus {
  background: #172232;
  box-shadow: 0 0 0 4px rgba(104, 169, 207, 0.14);
}

select[multiple] {
  min-height: 120px;
}

.filter-row input {
  min-width: min(340px, 100%);
  flex: 1;
}

.list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.list-row strong {
  display: block;
}

.list-row small {
  color: var(--muted);
}

.voice-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.comm-identity {
  display: grid;
  gap: 12px;
}

.comm-identity-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.comm-identity-controls label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.comm-fixed-user {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  background: var(--panel-soft);
  display: grid;
  align-content: center;
  gap: 3px;
}

.comm-fixed-user span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.comm-fixed-user strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comm-identity-controls select {
  min-width: 0;
}

.comm-current-resource {
  min-height: 58px;
  border: 1px solid rgba(82, 105, 129, 0.22);
  border-radius: 6px;
  padding: 8px;
  background: #fbfdfb;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 8px;
  align-items: center;
}

.comm-current-resource strong,
.comm-current-resource span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comm-current-resource span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.comm-status-pad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-width: 560px;
}

.comm-status-key {
  min-height: 74px;
  border: 1px solid rgba(27, 36, 48, 0.2);
  border-radius: 6px;
  padding: 8px;
  background: #f8fafc;
  display: grid;
  align-content: center;
  gap: 4px;
  color: var(--ink);
  text-align: center;
}

.comm-status-key.active {
  border-width: 4px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7), 0 0 0 2px rgba(27, 36, 48, 0.18);
}

.comm-status-key.signal-active {
  animation: status-signal-button-blink 0.9s ease-in-out infinite;
  border-width: 3px;
}

@keyframes status-signal-button-blink {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(27, 36, 48, 0);
    filter: brightness(1);
  }

  50% {
    box-shadow: 0 0 0 5px var(--signal-soft, rgba(27, 36, 48, 0.22));
    filter: brightness(1.16);
  }
}

.comm-status-key strong {
  font-size: 22px;
  line-height: 1;
}

.comm-status-key span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
  font-size: 11px;
  font-weight: 760;
}

.comm-status-key.talk {
  color: #111111;
  background: #9f7617;
  border-color: #8a6511;
}

.comm-status-key.emergency {
  color: #ffffff;
  background: #842f31;
  border-color: #702527;
}

.comm-status-key.gps {
  color: #d9e0e8;
  background: #3f4b56;
  border-color: #536171;
}

.comm-status-key:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.statusgabe-user-row {
  grid-template-columns: minmax(0, 1fr);
}

.voice-group {
  min-height: 138px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: contain;
  touch-action: none;
  border-color: var(--voice-color);
  background:
    linear-gradient(180deg, var(--voice-soft), rgba(255, 255, 255, 0.94)),
    var(--panel);
}

.voice-group.live {
  color: var(--voice-fg);
  background: var(--voice-color);
  box-shadow: 0 0 0 4px var(--voice-soft), var(--shadow-soft);
}

.voice-group.vox-enabled {
  box-shadow: inset 0 0 0 2px rgba(45, 125, 210, 0.26), var(--shadow-soft);
}

.voice-group:active {
  transform: translateY(1px);
}

.voice-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.voice-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.voice-menu-button {
  width: 34px;
  height: 34px;
  display: grid;
  flex: 0 0 34px;
  border-radius: 6px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  cursor: grab;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.voice-menu-button:active {
  cursor: grabbing;
  transform: none;
}

.voice-group.live .voice-menu-button {
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.58);
  background: rgba(255, 255, 255, 0.9);
}

.voice-group.dragging {
  opacity: 0.54;
}

.voice-group.drag-over-before,
.voice-group.drag-over-after {
  position: relative;
  outline: 2px solid rgba(82, 105, 129, 0.45);
  outline-offset: 2px;
}

.voice-group.drag-over-before::before,
.voice-group.drag-over-after::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  height: 4px;
  border-radius: 999px;
  background: var(--voice-color, #526981);
  box-shadow: 0 0 0 3px var(--voice-soft, rgba(82, 105, 129, 0.16));
  pointer-events: none;
}

.voice-group.drag-over-before::before {
  top: -8px;
}

.voice-group.drag-over-after::after {
  bottom: -8px;
}

.voice-vox-badge {
  min-height: 26px;
  border-radius: 999px;
  padding: 5px 9px;
  color: #ffffff;
  background: var(--blue);
  font-size: 12px;
  font-weight: 860;
}

.voice-group-description {
  min-height: 18px;
  margin: 8px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-group.live .voice-group-description {
  color: currentColor;
  opacity: 0.84;
}

.voice-speaker {
  margin-top: 7px;
  min-height: 48px;
  border-top: 1px solid rgba(82, 105, 129, 0.18);
  padding-top: 8px;
  display: grid;
  grid-template-rows: 15px 19px;
  gap: 2px;
}

.voice-speaker span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.voice-speaker strong {
  min-height: 19px;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-speaker-empty {
  visibility: hidden;
}

.voice-group.live .voice-speaker {
  border-color: rgba(255, 255, 255, 0.34);
}

.voice-group.live .voice-speaker span {
  color: currentColor;
  opacity: 0.82;
}

.voice-ptt {
  margin-top: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.voice-ptt small {
  color: var(--muted);
}

.toggle {
  min-width: 74px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 9px 3px 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.toggle span {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid var(--line);
}

.toggle.on {
  color: #ffffff;
  background: var(--green);
  border-color: var(--green);
}

.toggle.on span {
  border-color: #ffffff;
}

.ptt {
  width: 112px;
  height: 112px;
  border: 0;
  border-radius: 50%;
  color: #ffffff;
  background: var(--red);
  font-size: 18px;
  font-weight: 850;
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.14);
}

.ptt:active,
.ptt.live {
  background: var(--green);
}

.chat-panel {
  display: grid;
  grid-template-rows: minmax(260px, 1fr) auto;
  gap: 12px;
}

.chat-log {
  max-height: 430px;
  overflow: auto;
  padding-right: 4px;
}

.message {
  width: min(92%, 560px);
  padding: 11px 12px;
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.message.own {
  margin-left: auto;
  color: #ffffff;
  background: var(--green);
}

.message strong {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.chat-form input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
}

.map-shell {
  min-height: min(74vh, 720px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
}

.map-canvas {
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background:
    linear-gradient(180deg, #dcecf2, #eef4f0 55%, #f7f5ef);
  position: relative;
}

.map-canvas svg {
  width: 100%;
  height: 100%;
  display: block;
}

.county {
  fill: #d7e3da;
  stroke: #ffffff;
  stroke-width: 0.08;
  transition: fill 140ms ease;
}

.county:hover,
.county.selected {
  fill: #e4b16a;
}

.map-pin {
  fill: var(--red);
  stroke: #ffffff;
  stroke-width: 2;
}

.map-info {
  position: absolute;
  left: 14px;
  bottom: 14px;
  width: min(360px, calc(100% - 28px));
  padding: 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.map-info strong,
.map-info span {
  display: block;
}

.map-info span {
  color: var(--muted);
}

.resource-card {
  display: grid;
  gap: 10px;
}

.em-view {
  min-height: calc(100vh - 128px);
  border: 1px solid #c9d3cc;
  border-radius: var(--radius);
  background: #d6ddd8;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.em-top-tabs {
  min-height: 42px;
  padding: 8px 10px 0;
  display: flex;
  gap: 6px;
  align-items: end;
  overflow-x: auto;
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid #c8d2cb;
}

.em-tab {
  min-height: 30px;
  min-width: 96px;
  border: 1px solid #c2cbc4;
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  background: linear-gradient(#ffffff, #edf2ee);
  color: #111;
  font-size: 12px;
  font-weight: 760;
}

.em-tab.muted-tab {
  background: linear-gradient(#f5f7f5, #e2e8e3);
}

.em-tab.active {
  color: #ffffff;
  background: linear-gradient(#667f99, #43566c);
  border-color: #43566c;
}

.em-blue-strip {
  min-height: 34px;
  padding: 6px 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  color: #ffffff;
  background: linear-gradient(90deg, #1b2430, #526981);
  font-size: 12px;
  font-weight: 800;
}

.em-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.em-action-button {
  min-height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  padding: 2px 8px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.13);
  font-size: 11px;
  font-weight: 800;
}

.em-action-button:hover {
  background: rgba(255, 255, 255, 0.28);
}

.em-board {
  min-height: 620px;
  overflow: auto;
}

.em-status-rail {
  padding: 4px 3px;
  border-right: 1px solid #7d817d;
  background: #e3e4e3;
  display: grid;
  align-content: start;
  gap: 5px;
}

.em-rail-label {
  height: 22px;
  display: grid;
  place-items: center;
  color: #000;
  font-size: 10px;
  font-weight: 900;
}

.em-status-button {
  width: 22px;
  height: 22px;
  border: 1px solid #4f534f;
  border-radius: 3px;
  color: #000;
  background: #ffffff;
  font-size: 12px;
  font-weight: 900;
  padding: 0;
}

.em-status-button.green {
  background: #9cf090;
}

.em-status-button.amber {
  background: #ffd86b;
}

.em-status-button.red {
  background: #ff7777;
}

.em-status-button.blue {
  background: #9cc8ff;
}

.em-tableau {
  padding: 10px 10px 22px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  align-content: start;
  gap: 14px 18px;
}

.em-tableau-raster {
  --em-cell: 116px;
  --em-gap: 10px;
  width: max-content;
  min-width: 100%;
  min-height: 640px;
  grid-template-columns: repeat(var(--em-cols), var(--em-cell));
  grid-template-rows: repeat(var(--em-rows), var(--em-cell));
  grid-auto-columns: var(--em-cell);
  grid-auto-rows: var(--em-cell);
  grid-auto-flow: dense;
  justify-content: start;
  align-content: start;
  gap: var(--em-gap);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-position: 10px 10px;
  background-size: calc(var(--em-cell) + var(--em-gap)) calc(var(--em-cell) + var(--em-gap));
  transition: box-shadow 140ms ease, outline-color 140ms ease;
}

.em-tableau-raster.subgroup-drag-active {
  outline: 2px solid rgba(67, 86, 108, 0.48);
  outline-offset: -2px;
  background-color: rgba(255, 255, 255, 0.12);
  background-image:
    linear-gradient(rgba(67, 86, 108, 0.36) 2px, transparent 2px),
    linear-gradient(90deg, rgba(67, 86, 108, 0.36) 2px, transparent 2px);
  box-shadow: inset 0 0 0 9999px rgba(255, 255, 255, 0.08);
}

.em-tableau-scale-large {
  --em-cell: 152px;
  --em-gap: 12px;
}

.em-tableau-scale-compact .em-station-head {
  min-height: 24px;
  padding: 5px 8px;
  font-size: 13px;
}

.em-tableau-scale-compact .em-units {
  gap: 5px;
  padding: 5px;
}

.em-tableau-scale-compact .em-unit {
  height: 62px;
  min-height: 62px;
  grid-template-columns: minmax(0, 1fr) 32px;
  padding: 6px;
  gap: 4px;
}

.em-tableau-scale-compact .em-unit-main strong {
  font-size: 13px;
}

.em-tableau-scale-compact .em-unit-main span,
.em-tableau-scale-compact .em-unit small {
  font-size: 11px;
}

.em-tableau-scale-compact .em-unit-status {
  min-height: 38px;
  font-size: 16px;
}

.em-tableau-scale-large .em-station-head {
  min-height: 30px;
  padding: 7px 10px;
  font-size: 15px;
}

.em-tableau-scale-large .em-units {
  gap: 7px;
  padding: 7px;
}

.em-tableau-scale-large .em-unit {
  height: 84px;
  min-height: 84px;
  grid-template-columns: minmax(0, 1fr) 42px;
  padding: 8px;
  gap: 6px;
}

.em-tableau-scale-large .em-unit-main strong {
  font-size: 16px;
}

.em-tableau-scale-large .em-unit-main span,
.em-tableau-scale-large .em-unit small {
  font-size: 13px;
}

.em-tableau-scale-large .em-unit-status {
  min-height: 52px;
  font-size: 20px;
}

.em-station {
  min-width: 0;
}

.em-subgroup {
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(22, 32, 30, 0.18);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.28);
  box-shadow: 0 8px 18px rgba(20, 30, 27, 0.08);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.em-station-head {
  min-height: 18px;
  padding: 3px 7px;
  color: #ffffff;
  background: #0b0b0b;
  border: 0;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
}

.em-station-head[draggable="true"] {
  cursor: move;
}

.em-station-head.rescue {
  background: #526981;
}

.em-station-head.fire {
  background: #d71920;
}

.em-station-head.seg {
  background: #1a1a1a;
}

.em-station-head.command {
  background: #1d4ca3;
}

.em-station-head.transport {
  color: #111;
  background: #f2dc3d;
}

.em-units {
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 3px;
  padding: 3px;
}

.em-unit {
  height: 46px;
  min-height: 46px;
  align-self: start;
  border: 1px solid #1d2522;
  border-left-width: 4px;
  border-radius: 4px;
  padding: 4px;
  background: #fbfcfb;
  color: #111111;
  cursor: grab;
  user-select: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 2px;
  text-align: left;
}

.em-unit:active {
  cursor: grabbing;
}

.em-unit:hover {
  outline: 2px solid rgba(82, 105, 129, 0.42);
  outline-offset: 1px;
}

.em-unit-main {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.em-unit-main strong,
.em-unit-main span,
.em-unit small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.em-unit-main strong {
  font-size: 11px;
  line-height: 1.05;
}

.em-unit-main span,
.em-unit small {
  font-size: 10px;
}

.em-unit-status {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-height: 28px;
  border: 1px solid #222;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 950;
  background: #ffffff;
}

.em-unit-status.green {
  background: #5fe05a;
}

.em-unit-status.amber {
  background: #ffd45c;
}

.em-unit-status.red {
  background: #f44747;
}

.em-unit-status.blue {
  background: #9cc8ff;
}

.em-unit small {
  grid-column: 1;
  color: #111111;
}

.em-subgroup-special .em-unit {
  cursor: default;
}

.em-unit.signal-talk {
  border-color: #5f6561;
  border-left-color: #777d78;
  animation: signal-talk-blink 1.15s ease-in-out infinite;
}

.em-unit.signal-emergency {
  border-color: #7d1218;
  border-left-color: #e01b24;
  animation: signal-emergency-blink 0.78s ease-in-out infinite;
}

@keyframes signal-talk-blink {
  0%,
  100% {
    background: #fbfcfb;
    box-shadow: 0 0 0 rgba(95, 101, 97, 0);
  }

  50% {
    background: #d7dbd8;
    box-shadow: 0 0 0 3px rgba(95, 101, 97, 0.22);
  }
}

@keyframes signal-emergency-blink {
  0%,
  100% {
    background: #fff5f5;
    box-shadow: 0 0 0 rgba(224, 27, 36, 0);
  }

  50% {
    background: #ff6b6b;
    box-shadow: 0 0 0 3px rgba(224, 27, 36, 0.3);
  }
}

@media (prefers-reduced-motion: reduce) {
  .comm-status-key.signal-active,
  .em-unit.signal-talk,
  .em-unit.signal-emergency {
    animation: none;
  }

  .em-unit.signal-talk {
    background: #d7dbd8;
  }

  .em-unit.signal-emergency {
    background: #ff8a8a;
  }
}

.em-special-empty {
  min-height: 46px;
  border: 1px dashed rgba(22, 32, 30, 0.32);
  border-radius: 4px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.58);
  color: #4f5d55;
  font-size: 11px;
  font-weight: 760;
  display: grid;
  place-items: center;
  text-align: center;
}

.em-status-log-list {
  min-height: 0;
  overflow: auto;
  align-content: start;
}

.em-status-log-row {
  min-height: 38px;
  border: 1px solid rgba(29, 37, 34, 0.34);
  border-left-width: 4px;
  border-radius: 4px;
  padding: 5px 6px;
  background: #fbfcfb;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px auto;
  gap: 1px 6px;
}

.em-status-log-row strong,
.em-status-log-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.em-status-log-row strong {
  font-size: 11px;
  line-height: 1.1;
}

.em-status-log-row span,
.em-status-log-row small,
.em-status-log-status {
  font-size: 10px;
}

.em-status-log-status {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-height: 24px;
  border: 1px solid #222;
  display: grid;
  place-items: center;
  align-self: center;
  font-weight: 950;
  background: #ffffff;
}

.em-status-log-row small {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
  color: #4f5d55;
  font-weight: 800;
}

.em-status-log-row.talk {
  border-left-color: #777d78;
  background: #eef0ee;
}

.em-status-log-row.emergency {
  border-left-color: #e01b24;
  background: #fff0f0;
}

.em-status-log-row.status {
  border-left-color: #1d4ca3;
}

.context-menu {
  position: fixed;
  z-index: 1000;
  width: min(260px, calc(100vw - 16px));
  padding: 5px;
  border: 1px solid #4e544f;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
  display: grid;
  gap: 3px;
}

.context-menu button {
  min-height: 30px;
  border: 0;
  border-radius: 4px;
  padding: 6px 9px;
  color: #111111;
  background: transparent;
  text-align: left;
  font-size: 13px;
  font-weight: 720;
}

.context-menu button:hover {
  background: #e9eef8;
}

.context-menu-submenu {
  position: relative;
}

.context-menu .has-submenu {
  width: 100%;
}

.context-menu .has-submenu::after {
  content: "›";
  float: right;
}

.context-submenu {
  position: absolute;
  left: calc(100% - 10px);
  top: 0;
  width: min(260px, calc(100vw - 16px));
  max-height: min(420px, calc(100vh - 16px));
  overflow: auto;
  padding: 5px;
  border: 1px solid #4e544f;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
  display: none;
  gap: 3px;
}

.context-submenu.open-left {
  left: auto;
  right: calc(100% - 10px);
}

.context-submenu.open-up {
  top: auto;
  bottom: 0;
}

.context-menu-submenu:hover .context-submenu,
.context-menu-submenu:focus-within .context-submenu {
  display: grid;
}

.resource-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.tableau-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.status-cell {
  min-height: 58px;
  padding: 8px;
  border-radius: var(--radius);
  background: var(--panel-soft);
  display: grid;
  align-content: center;
  gap: 3px;
}

.status-cell strong {
  font-size: 13px;
}

.status-cell span {
  color: var(--muted);
  font-size: 12px;
}

.modal {
  width: min(860px, calc(100vw - 28px));
  border: 0;
  padding: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.data-modal {
  width: min(760px, calc(100vw - 28px));
}

#voicePickerDialog .modal-panel {
  min-height: min(650px, calc(100vh - 36px));
  grid-template-rows: auto minmax(0, 1fr) auto;
}

#voicePickerList {
  min-height: 0;
  display: grid;
}

.incident-modal {
  width: min(1160px, calc(100vw - 28px));
}

.modal::backdrop {
  background: rgba(17, 28, 24, 0.5);
  backdrop-filter: blur(3px);
}

.modal-panel {
  padding: 22px;
  background: linear-gradient(180deg, #ffffff, #f9fbf9);
  display: grid;
  gap: 14px;
}

:root[data-theme="dark"] .modal-panel {
  color: var(--ink);
  background: linear-gradient(180deg, #182231, #111923);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.modal-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.field-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.callgroup-clip-list {
  max-height: min(58vh, 520px);
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-right: 4px;
}

.callgroup-clip-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
}

.callgroup-clip-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.callgroup-clip-title,
.callgroup-clip-meta {
  margin: 0;
}

.callgroup-clip-title {
  font-size: 14px;
  font-weight: 820;
}

.callgroup-clip-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.callgroup-clip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.callgroup-clip-actions .ghost-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.callgroup-clip-audio {
  width: 100%;
  height: 34px;
}

.weather-location-form,
.beacon-form {
  display: grid;
  gap: 12px;
}

.weather-location-form {
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
}

.weather-location-actions,
.beacon-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.weather-current-card,
.weather-warning-card,
.beacon-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--panel-soft);
}

.weather-current-head,
.weather-warning-head,
.beacon-card-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.weather-current-head span,
.weather-warning-head span,
.beacon-card p,
.beacon-card small {
  color: var(--muted);
}

.weather-temp {
  min-width: 90px;
  text-align: right;
  font-size: 34px;
  font-weight: 860;
  line-height: 1;
}

.weather-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.weather-metric {
  min-height: 62px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.weather-metric span,
.weather-metric strong {
  display: block;
}

.weather-metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.weather-metric strong {
  margin-top: 3px;
}

.weather-warning-list,
.beacon-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.weather-warning-card p,
.beacon-card p,
.beacon-card small {
  margin: 3px 0 0;
}

.weather-warning-card.level-3,
.weather-warning-card.level-4 {
  border-color: rgba(179, 59, 50, 0.42);
  background: var(--red-2);
}

.beacon-form-grid,
.beacon-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.beacon-card.disabled {
  opacity: 0.68;
}

.beacon-card-actions .primary-button,
.beacon-card-actions .ghost-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

label {
  display: grid;
  gap: 6px;
  font-weight: 760;
}

.modal-section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.modal-section-head h3 {
  margin: 2px 0 0;
}

.incident-section-editor {
  display: grid;
  gap: 8px;
}

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

.data-form-grid label:has(textarea),
.data-form-grid .check-label,
.data-form-grid .check-list-field,
.data-form-grid .resource-strength-group {
  grid-column: 1 / -1;
}

.resource-strength-group {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fbfdfb;
  display: grid;
  gap: 10px;
}

.resource-strength-group legend {
  padding: 0 6px;
  color: var(--ink);
  font-weight: 850;
}

.resource-strength-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.resource-strength-group p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.check-label {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 11px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  background: #ffffff;
}

.check-label input {
  width: 18px;
  min-height: 18px;
}

.check-list-field {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: #fbfdfb;
  display: grid;
  gap: 10px;
}

.check-list-field legend {
  padding: 0 6px;
  color: var(--ink);
  font-weight: 800;
}

.check-list-filter {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: #ffffff;
  font-weight: 720;
}

.check-list {
  max-height: min(34vh, 320px);
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.check-list-item {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 9px;
  background: #ffffff;
  font-weight: 720;
}

.check-list-item input {
  width: 18px;
  min-height: 18px;
}

.check-list-item:has(input:checked) {
  border-color: rgba(82, 105, 129, 0.46);
  background: var(--green-2);
}

.voice-tree-list {
  min-height: clamp(360px, calc(100vh - 300px), 560px);
  max-height: min(64vh, 620px);
  overflow: auto;
  display: grid;
  gap: 8px;
  align-content: start;
}

.voice-tree-field {
  min-height: clamp(440px, calc(100vh - 220px), 640px);
  grid-template-rows: auto auto minmax(0, 1fr);
}

.voice-picker-tree {
  min-height: 0;
  max-height: min(64vh, 620px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  overflow: auto;
}

.voice-picker-tree .force-table-head,
.voice-picker-tree .force-row {
  grid-template-columns: 34px minmax(260px, 1fr) 88px;
}

.voice-picker-tree .force-table-head {
  position: sticky;
  top: 0;
  z-index: 2;
}

.voice-picker-tree [hidden] {
  display: none !important;
}

.voice-picker-folder-row {
  min-height: 34px;
  border-left: 4px solid var(--folder-color, #526981);
  background:
    linear-gradient(90deg, var(--folder-soft, #eef3f7), #f5f7f9 44%);
  font-weight: 850;
  cursor: default;
}

.voice-picker-folder-row.collapsed {
  opacity: 0.96;
}

.voice-picker-group-row {
  min-height: 34px;
  border-left: 4px solid var(--voice-group-color, #cbd6e2);
  background:
    linear-gradient(90deg, var(--voice-group-soft, rgba(82, 105, 129, 0.08)), #ffffff 34%);
  cursor: pointer;
}

.voice-picker-group-row:hover {
  background:
    linear-gradient(90deg, var(--voice-group-soft, rgba(82, 105, 129, 0.12)), #f8fafc 48%);
}

.voice-picker-group-row:has(input:checked) {
  border-color: color-mix(in srgb, var(--voice-group-color, #526981) 70%, var(--line));
  background: var(--voice-group-soft, #e9f3ef);
}

.voice-picker-check {
  display: grid;
  place-items: center;
}

.voice-picker-check input {
  width: 18px;
  min-height: 18px;
}

.voice-picker-folder-tag {
  border-color: var(--folder-color, #526981);
  background: var(--folder-color, #526981);
  color: var(--folder-fg, #ffffff);
}

.voice-picker-group-tag {
  border-color: var(--voice-group-color, #cbd6e2);
  background: var(--voice-group-color, #526981);
  color: var(--voice-group-fg, #ffffff);
}

.voice-tree-folder {
  min-height: 44px;
  border: 1px solid color-mix(in srgb, var(--folder-color, #526981) 38%, var(--line));
  border-radius: var(--radius);
  background: #ffffff;
  overflow: hidden;
}

.voice-tree-folder[open] {
  min-height: 116px;
}

.voice-tree-folder summary {
  min-height: 42px;
  padding: 9px 12px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  font-weight: 840;
  cursor: pointer;
  color: var(--ink);
  background:
    linear-gradient(90deg, var(--folder-soft, var(--panel-soft)), var(--panel-soft));
  box-shadow: inset 5px 0 0 var(--folder-color, #526981);
}

.voice-tree-folder-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-tree-count,
.voice-tree-shortcut {
  border-radius: 999px;
  color: var(--ink);
  background: #e7edf3;
  font-size: 12px;
  font-weight: 840;
}

.voice-tree-count {
  padding: 3px 8px;
}

.voice-tree-group-list {
  min-height: 64px;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-content: start;
}

.voice-tree-item {
  min-height: 44px;
  border: 1px solid color-mix(in srgb, var(--voice-group-color, #cbd6e2) 32%, var(--line));
  border-radius: var(--radius);
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 18px auto minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  background: #ffffff;
  box-shadow: inset 4px 0 0 var(--voice-group-color, #cbd6e2);
  font-weight: 720;
}

.voice-tree-item input {
  width: 18px;
  min-height: 18px;
}

.voice-tree-shortcut {
  min-width: 28px;
  padding: 3px 7px;
  text-align: center;
}

.voice-tree-item:has(input:checked) {
  border-color: color-mix(in srgb, var(--voice-group-color, #526981) 58%, var(--line));
  background: var(--voice-group-soft, var(--green-2));
}

.voice-tree-item:has(input:checked) .voice-tree-shortcut {
  color: var(--voice-group-fg, #ffffff);
  background: var(--voice-group-color, #526981);
}

.resource-picker-list {
  max-height: min(52vh, 440px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  overflow: auto;
  display: grid;
}

.resource-picker-row {
  min-height: 48px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.resource-picker-row:last-child {
  border-bottom: 0;
}

.resource-picker-row input {
  width: 18px;
  min-height: 18px;
}

.resource-picker-row span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.resource-picker-row small {
  color: var(--muted);
  font-weight: 650;
}

.resource-picker-row b {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 4px;
  display: grid;
  place-items: center;
  background: var(--panel-soft);
}

.resource-picker-row.disabled {
  color: var(--muted);
  background: #f6f6f2;
}

.force-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfaf7;
  overflow: hidden;
}

.force-section-tree {
  background: #fbfaf7;
}

.force-section-head {
  min-height: 34px;
  padding: 5px 8px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  background: #e7e7e4;
}

.force-section-title {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr);
  gap: 6px;
  align-items: center;
}

.force-section-title div {
  min-width: 0;
  display: grid;
  gap: 0;
}

.force-section-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.force-section-title small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.force-section-title input,
.force-section-note textarea,
.force-add-row select,
.force-row select {
  min-height: 34px;
  padding: 6px 9px;
  border-radius: 4px;
  background: #ffffff;
}

.force-section-number {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.force-section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.force-section-meta {
  min-width: min(420px, 48%);
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: end;
  gap: 5px 12px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.force-section-meta strong {
  color: var(--ink);
}

.force-section-note {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.force-section-note textarea {
  min-height: 38px;
  resize: vertical;
}

.force-table {
  display: grid;
}

.force-table-head,
.force-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) 44px 112px 44px minmax(260px, 1fr);
  gap: 6px;
  align-items: center;
}

.force-table-head {
  min-height: 24px;
  padding: 0 8px;
  color: var(--muted);
  background: #f2f2ef;
  font-size: 11px;
  font-weight: 850;
}

.force-row {
  min-height: 28px;
  padding: 2px 8px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.force-row-section {
  min-height: 27px;
  background: #eeeeeb;
  cursor: grab;
  font-weight: 820;
}

.force-row-section:active {
  cursor: grabbing;
}

.force-row-section.drag-over {
  outline: 2px solid rgba(82, 105, 129, 0.55);
  outline-offset: -2px;
  background: #e4f5ec;
}

.force-section-order-dropzone {
  min-height: 6px;
  margin-left: calc(8px + var(--force-depth, 0) * 18px);
  border-top: 1px solid transparent;
}

.force-section-order-dropzone.drag-over {
  min-height: 16px;
  border-top-color: rgba(82, 105, 129, 0.8);
  background: #e4f5ec;
}

.force-row-resource {
  cursor: grab;
}

.force-row-resource:active {
  cursor: grabbing;
}

.force-tree-name {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  padding-left: calc(var(--force-depth, 0) * 18px);
}

.force-tree-name small {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.force-tree-toggle,
.force-tree-branch {
  width: 14px;
  flex: 0 0 14px;
  color: var(--muted);
  text-align: center;
}

.force-tree-toggle {
  min-height: 20px;
  border: 0;
  border-radius: 3px;
  padding: 0;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}

.force-tree-toggle:hover {
  background: #d9ddd6;
}

.force-section-tag {
  min-width: 28px;
  min-height: 18px;
  border: 1px solid #ad9a00;
  border-radius: 3px;
  display: inline-grid;
  place-items: center;
  background: #fff176;
  color: #1c1c12;
  font-size: 9px;
  font-weight: 950;
}

.force-section-index {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.force-section-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comm-tree .force-table-head,
.comm-tree .force-row {
  grid-template-columns: minmax(260px, 1.4fr) 86px 88px minmax(220px, 1fr) minmax(240px, auto);
}

.comm-tree .force-row {
  min-height: 42px;
}

.comm-tree .comm-folder-row {
  border-left: 4px solid var(--comm-folder-color, #526981);
  background: var(--comm-folder-soft, #eef3f7);
  cursor: default;
}

.comm-tree .comm-folder-row.drag-over,
.comm-tree-empty.drag-over {
  outline: 2px solid rgba(82, 105, 129, 0.65);
  outline-offset: -2px;
  background: #e4f5ec;
}

.comm-tree .comm-group-row {
  border-left: 4px solid var(--comm-group-color, #cbd6e2);
  background:
    linear-gradient(90deg, var(--comm-group-soft, rgba(82, 105, 129, 0.08)), #ffffff 42%);
  cursor: grab;
}

.comm-tree .comm-group-row:active {
  cursor: grabbing;
}

.comm-tree .comm-group-row.disabled {
  color: var(--muted);
  background: #f7f9fb;
}

.comm-tree .comm-folder-tag {
  border-color: var(--comm-folder-color, #526981);
  background: var(--comm-folder-color, #526981);
  color: var(--comm-folder-fg, #ffffff);
}

.comm-tree .comm-group-tag {
  border-color: var(--comm-group-color, #cbd6e2);
  background: var(--comm-group-color, #edf1f5);
  color: var(--comm-group-fg, #ffffff);
}

.comm-tree .comm-tree-desc,
.comm-tree .comm-tree-shortcut {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comm-tree .comm-tree-shortcut {
  color: var(--ink);
  font-weight: 850;
}

.comm-tree .comm-tree-actions {
  justify-content: end;
}

.comm-tree-empty {
  min-height: 34px;
  padding: 8px 10px 8px calc(28px + var(--force-depth, 1) * 18px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #ffffff;
  font-size: 12px;
  font-weight: 760;
}

.force-call {
  min-height: 22px;
  min-width: 170px;
  border: 1px solid transparent;
  border-radius: 4px;
  display: block;
  padding: 3px 7px;
  background: transparent;
  font-size: 12px;
}

.force-status {
  min-height: 22px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  color: #101614;
  background: #ffffff;
  font-weight: 950;
}

.force-status.green {
  background: #5fe05a;
}

.force-status.amber {
  background: #ffe850;
}

.force-status.red {
  background: #ff5555;
}

.force-status.blue {
  background: #9cc8ff;
}

.muted-status {
  background: #ffffff;
  color: var(--muted);
}

.force-empty {
  padding: 7px 8px 7px calc(8px + var(--force-depth, 0) * 18px);
  color: var(--muted);
  font-size: 12px;
}

.force-root-dropzone {
  min-height: 26px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: grid;
  place-items: center;
  padding: 4px 8px;
  color: var(--muted);
  background: #f7f8f5;
  font-size: 11px;
  font-weight: 800;
}

.force-root-dropzone.drag-over {
  color: var(--ink);
  background: #e4f5ec;
  outline: 2px solid rgba(82, 105, 129, 0.55);
  outline-offset: -2px;
}

.force-assignment-cell,
.force-task-cell {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.force-assignment-cell span,
.force-task-cell span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.force-section-info span:first-child {
  color: var(--ink);
  font-weight: 850;
}

.force-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.force-row-actions .ghost-button,
.force-assignment-cell .ghost-button {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 12px;
}

.force-add-row {
  padding: 8px;
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(180px, 280px) auto;
  gap: 8px;
  align-items: center;
  border-top: 1px solid var(--line);
}

.force-add-row button {
  min-height: 34px;
  white-space: nowrap;
}

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

.optional-color-field {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: center;
  background: var(--panel-soft);
}

.optional-color-field legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.optional-color-field .check-label {
  margin: 0;
}

.optional-color-field input[type="color"] {
  width: 48px;
  min-height: 36px;
  padding: 2px;
}

.optional-color-field small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 760;
}

.address-grid {
  grid-template-columns: 1.4fr 0.6fr 0.7fr 1fr;
}

.modal-actions {
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: end;
  gap: 8px;
}

.empty-state {
  min-height: 190px;
  border: 1px dashed #bfc4bc;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.empty-state.small {
  min-height: 82px;
  margin-top: 14px;
  padding: 14px;
}

:root[data-theme="dark"] .metric,
:root[data-theme="dark"] .incident-card,
:root[data-theme="dark"] .resource-card,
:root[data-theme="dark"] .tableau,
:root[data-theme="dark"] .list-row,
:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .section-incident,
:root[data-theme="dark"] .section-card,
:root[data-theme="dark"] .force-section,
:root[data-theme="dark"] .force-section-tree,
:root[data-theme="dark"] .resource-picker-list,
:root[data-theme="dark"] .alarm-tone-card,
:root[data-theme="dark"] .alarm-dispatch-row,
:root[data-theme="dark"] .alarm-log-card,
:root[data-theme="dark"] .chat-panel,
:root[data-theme="dark"] .chat-log,
:root[data-theme="dark"] .status-board,
:root[data-theme="dark"] .status-cell,
:root[data-theme="dark"] .resource-picker-row,
:root[data-theme="dark"] .force-row,
:root[data-theme="dark"] .force-add-row,
:root[data-theme="dark"] .force-table-head,
:root[data-theme="dark"] .voice-picker-tree,
:root[data-theme="dark"] .voice-picker-tree .force-table-head,
:root[data-theme="dark"] .voice-tree-folder,
:root[data-theme="dark"] .voice-tree-item,
:root[data-theme="dark"] .comm-tree .force-row {
  color: var(--ink);
  background: var(--panel);
  border-color: var(--line);
}

:root[data-theme="dark"] .topbar {
  background: rgba(13, 19, 27, 0.88);
  backdrop-filter: blur(16px);
}

:root[data-theme="dark"] .route-title span,
:root[data-theme="dark"] .section-kicker,
:root[data-theme="dark"] .metric span,
:root[data-theme="dark"] .card-label,
:root[data-theme="dark"] .force-table-head {
  color: #9fb2c5;
}

:root[data-theme="dark"] .tool-button[aria-pressed="true"] {
  color: #ffffff;
  background: #526981;
  border-color: #6f879d;
}

:root[data-theme="dark"] .signal-button {
  color: var(--ink);
  background: #3d2a16;
  border-color: #80592a;
}

:root[data-theme="dark"] .voice-group {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--voice-soft) 58%, rgba(17, 25, 35, 0.96)), rgba(17, 25, 35, 0.94)),
    var(--panel);
}

:root[data-theme="dark"] .voice-group.live {
  background: var(--voice-color);
}

:root[data-theme="dark"] .voice-menu-button,
:root[data-theme="dark"] .icon-round,
:root[data-theme="dark"] .icon-button {
  color: var(--ink);
  background: rgba(237, 244, 248, 0.08);
  border-color: var(--line);
}

:root[data-theme="dark"] .voice-picker-folder-row,
:root[data-theme="dark"] .force-row-section,
:root[data-theme="dark"] .force-section-head,
:root[data-theme="dark"] .comm-tree .comm-folder-row {
  background:
    linear-gradient(90deg, var(--folder-soft, rgba(104, 169, 207, 0.14)), rgba(29, 40, 53, 0.95) 44%);
}

:root[data-theme="dark"] .voice-picker-group-row,
:root[data-theme="dark"] .comm-group-row,
:root[data-theme="dark"] .comm-tree .comm-group-row {
  background:
    linear-gradient(90deg, var(--voice-group-soft, rgba(104, 169, 207, 0.1)), rgba(21, 29, 39, 0.96) 42%);
}

:root[data-theme="dark"] .voice-picker-group-row:hover,
:root[data-theme="dark"] .comm-group-row:hover,
:root[data-theme="dark"] .comm-tree .comm-group-row:hover {
  background:
    linear-gradient(90deg, var(--voice-group-soft, rgba(104, 169, 207, 0.16)), rgba(29, 40, 53, 0.98) 48%);
}

:root[data-theme="dark"] .voice-tree-count,
:root[data-theme="dark"] .voice-tree-shortcut,
:root[data-theme="dark"] .force-section-tag,
:root[data-theme="dark"] .force-status {
  color: var(--ink);
  background: #233142;
}

:root[data-theme="dark"] .resource-strength-group,
:root[data-theme="dark"] .optional-color-field,
:root[data-theme="dark"] .settings-option,
:root[data-theme="dark"] .wake-lock-option,
:root[data-theme="dark"] .empty-state,
:root[data-theme="dark"] .status-filter,
:root[data-theme="dark"] .fms-input-row,
:root[data-theme="dark"] .alarm-log-item,
:root[data-theme="dark"] .check-list-filter,
:root[data-theme="dark"] .check-list-item,
:root[data-theme="dark"] .comm-current-resource,
:root[data-theme="dark"] .comm-status-key,
:root[data-theme="dark"] .weather-card,
:root[data-theme="dark"] .beacon-card {
  color: var(--ink);
  background: var(--panel-soft);
  border-color: var(--line);
}

:root[data-theme="dark"] .fms-input-row.unknown,
:root[data-theme="dark"] .fms-input-row.error {
  background: #3d1f22;
}

:root[data-theme="dark"] .fms-input-row.ignored {
  background: #3d2f16;
}

:root[data-theme="dark"] .county-map,
:root[data-theme="dark"] .map-canvas {
  background: #111923;
}

:root[data-theme="dark"] .subgroup,
:root[data-theme="dark"] .tableau-row,
:root[data-theme="dark"] .em-status-log-row,
:root[data-theme="dark"] .em-tableau,
:root[data-theme="dark"] .em-status-rail,
:root[data-theme="dark"] .em-top-tabs,
:root[data-theme="dark"] .callgroup-clip-item {
  color: var(--ink);
  background: #121b26;
  border-color: var(--line);
}

:root[data-theme="dark"] .em-tab {
  color: var(--ink);
  background: linear-gradient(#1d2835, #151d27);
  border-color: var(--line);
}

:root[data-theme="dark"] .em-tab.muted-tab {
  color: var(--muted);
  background: linear-gradient(#172232, #121b26);
}

:root[data-theme="dark"] .em-tab.active {
  color: #ffffff;
  background: linear-gradient(#526981, #34475b);
  border-color: #526981;
}

:root[data-theme="dark"] .em-rail-label,
:root[data-theme="dark"] .em-unit small {
  color: var(--ink);
}

:root[data-theme="dark"] .em-unit-status,
:root[data-theme="dark"] .em-status-log-status,
:root[data-theme="dark"] .em-status-button {
  color: #0f1720;
  border-color: rgba(237, 244, 248, 0.34);
}

:root[data-theme="dark"] .context-menu,
:root[data-theme="dark"] .context-submenu {
  color: var(--ink);
  background: #121b26;
  border-color: var(--line);
}

:root[data-theme="dark"] .context-menu button {
  color: var(--ink);
  background: #182231;
  border-color: var(--line);
}

:root[data-theme="dark"] .context-menu button:hover {
  background: #223142;
}

:root[data-theme="dark"] ::placeholder {
  color: #7f8f9f;
}

@media (max-width: 1120px) {
  .grid-4,
  .grid-3,
  .split-grid,
  .map-shell,
  .section-grid,
  .address-grid {
    grid-template-columns: 1fr;
  }

  .grid-4,
  .grid-3,
  .voice-grid,
  .tableau-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .resource-strength-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .map-shell {
    min-height: 0;
  }

  .force-table-head,
  .force-row {
    grid-template-columns: minmax(180px, 1.1fr) 44px 112px 44px minmax(220px, 1fr);
  }
}

@media (max-width: 1200px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(var(--sidebar), calc(100vw - 42px));
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  body.nav-open:not(.auth-required) .nav-backdrop {
    display: block;
  }

  .icon-button {
    display: grid;
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .topbar-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .topbar-actions button {
    flex: 1;
  }
}

@media (max-width: 620px) {
  .content {
    padding: 14px;
  }

  .hero-band {
    min-height: 320px;
    background:
      linear-gradient(180deg, rgba(27, 36, 48, 0.9), rgba(82, 105, 129, 0.72)),
      var(--ink);
  }

  .grid-4,
  .grid-3,
  .voice-grid,
  .tableau-grid,
  .check-list,
  .voice-tree-group-list,
  .fms-input-row,
  .alarm-tone-grid,
  .alarm-dispatch-row,
  .alarm-log-card,
  .field-grid,
  .data-form-grid,
  .resource-strength-grid,
  .status-board,
  .weather-location-form {
    grid-template-columns: 1fr;
  }

  .incident-card,
  .active-lage,
  .list-row,
  .chat-form,
  .assigned-resource,
  .force-add-row {
    grid-template-columns: 1fr;
  }

  .force-table-head {
    display: none;
  }

  .force-row {
    grid-template-columns: minmax(0, 1fr) 42px;
    align-items: stretch;
  }

  .force-row > strong,
  .force-row > div:not(.force-tree-name),
  .force-row > span:not(.force-status),
  .force-row > select,
  .force-row > button {
    grid-column: 1 / -1;
  }

  .voice-picker-tree .force-table-head {
    display: none;
  }

  .voice-picker-tree .force-row {
    min-height: 38px;
    grid-template-columns: 34px minmax(0, 1fr) 64px;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
  }

  .voice-picker-tree .force-row > button,
  .voice-picker-tree .force-row > div,
  .voice-picker-tree .force-row > span {
    grid-column: auto;
  }

  .voice-picker-tree .force-tree-name {
    gap: 4px;
    padding-left: 0;
  }

  .voice-picker-tree .force-tree-branch,
  .voice-picker-tree .force-section-tag,
  .voice-picker-tree .force-section-index,
  .voice-picker-tree .force-tree-name small {
    display: none;
  }

  .voice-picker-tree .force-section-label {
    display: block;
    font-size: 14px;
    font-weight: 850;
  }

  .voice-picker-tree .voice-tree-count,
  .voice-picker-tree .voice-tree-shortcut {
    min-width: 52px;
    padding: 4px 7px;
    font-size: 12px;
  }

  .voice-picker-tree .voice-picker-check input {
    width: 22px;
    min-height: 22px;
  }

  .voice-picker-folder-row {
    grid-template-columns: 28px minmax(0, 1fr) 58px;
  }

  .voice-picker-folder-row .force-section-label {
    font-size: 13px;
  }

  .voice-picker-group-row {
    grid-template-columns: 34px minmax(0, 1fr) 58px;
  }

  .force-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .force-section-meta {
    min-width: 0;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .incident-actions {
    justify-items: stretch;
  }

  .weather-location-actions,
  .beacon-card-actions {
    justify-content: stretch;
  }

  .weather-location-actions > button,
  .beacon-card-actions > button {
    flex: 1 1 140px;
  }

  .weather-current-head,
  .weather-warning-head,
  .beacon-card-head {
    flex-direction: column;
  }

  .weather-temp {
    min-width: 0;
    text-align: left;
  }

  .map-canvas {
    min-height: 430px;
  }

  .em-view {
    min-height: 70vh;
  }

  .em-tableau {
    grid-template-columns: 1fr;
    padding: 8px;
  }

  .em-tab {
    min-width: 118px;
  }
}
