.dispatch-map { margin: 18px 0; border: 1px solid var(--border); border-radius: 8px; background: var(--input); overflow: hidden; }
.dispatch-map svg { width: 100%; min-height: 280px; height: 420px; display: block; background: #142329; }
.map-toolbar { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; }
.map-land path { fill: #30432f; stroke: #798675; stroke-width: .07; vector-effect: non-scaling-stroke; }
.map-grid line { stroke: #90a4a622; stroke-width: .5; vector-effect: non-scaling-stroke; }
.map-unit circle { fill: #FF860A; stroke: #ffead3; stroke-width: 2; vector-effect: non-scaling-stroke; }
.map-unit text { fill: #fff; font-family: sans-serif; font-weight: 650; paint-order: stroke; stroke: #111612; stroke-width: .5px; vector-effect: non-scaling-stroke; }
.map-unit.stale { opacity: .55; }
.map-note { color: var(--muted); font-size: 11px; margin: 12px; }
.ops-main { max-width: 1450px; margin: auto; padding: 24px; overflow: auto; height: calc(100svh - 96px); }
.ops-main h1 { font-size: 24px; margin-bottom: 14px; }
.ops-controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.ops-groups { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0; }
.ops-groups span { padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); font-size: 13px; }
.ops-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ops-table td, .ops-table th { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); }
.recovery-controls { padding: 14px; border: 1px solid var(--border); border-radius: 8px; margin-top: 18px; }
.ops-main .table-wrap { overflow-x: auto; }
.admin-history-body { white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; font-size: 13px; line-height: 1.6; }
html { --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px); }
html[data-native] .comms-bar { padding-top: calc(8px + var(--safe-top)); height: calc(40px + var(--safe-top)); }
html[data-native] .app-shell, html[data-native] .access-panel { height: calc(100dvh - 40px - var(--safe-top)); }
html[data-native] .composer-area { padding-bottom: calc(8px + var(--safe-bottom)); }
html[data-native] .access-panel { padding-bottom: calc(30px + var(--safe-bottom)); }
html[data-native] .browser-only { display: none !important; }
.access-panel p { overflow-wrap: anywhere; }
/* The header can wrap. Flex reserves its real height instead of assuming 40px. */
html { width: 100%; min-width: 0; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { display: flex; flex-direction: column; width: 100%; max-width: 100%; min-width: 0; height: var(--client-height, 100dvh); overflow: hidden; }
html[data-client-viewport="fixed"] { height: 100%; overflow: hidden; }
html[data-client-viewport="fixed"] > body:not(.admin-body) { position: fixed; inset: var(--client-top, 0px) 0 auto; height: var(--client-height, 100dvh); }
.comms-bar { flex: 0 0 auto; }
.app-shell, html[data-native] .app-shell { flex: 1 1 0; width: 100%; min-height: 0; height: auto; }
.access-panel, html[data-native] .access-panel { flex: 1 1 0; width: min(100%, 520px); min-height: 0; height: auto; margin: 0 auto; overflow-x: hidden; overscroll-behavior: contain; }
.sidebar, .group-list, .group-copy, .conversation, .composer, .medical-fields > label { min-width: 0; max-width: 100%; }
.brand-mark { flex-shrink: 0; object-fit: contain; }
.message-entry { position: relative; display: flex; flex: 1 1 0; min-width: 0; width: 0; }
.composer .message-entry textarea { flex: 1 1 auto; min-width: 0; width: 100%; padding: 5px 43px 5px 0; }
.radio-message-count { position: absolute; right: 2px; bottom: 2px; z-index: 1; padding: 1px 2px; border-radius: 3px; background: color-mix(in srgb, var(--input) 88%, transparent); color: var(--muted); font-size: 8px; line-height: 1; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; pointer-events: none; }
.radio-message-count[data-state="full"] { color: var(--signal-average); }
.radio-message-count[data-state="over"] { color: var(--bad); font-weight: 700; }
.form-dialog { max-height: calc(var(--client-height, 100dvh) - 24px); }
#form-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
#medical-form { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scroll-padding-block: 12px 76px; }
html[data-native] input:not([type="checkbox"]):not([type="radio"]),
html[data-native] textarea, html[data-native] select { font-size: 16px !important; }
/* Shared compact chat layout: groups above the thread, tools beside the composer. */
.app-shell { display: flex; max-width: 1200px; }
.conversation { flex: 1; width: 100%; }
.conversation-header { min-height: 52px; padding: 6px 14px; gap: 9px; }
.conversation-header, .composer-area { flex: 0 0 auto; }
.thread { padding-top: 14px; padding-bottom: 8px; overscroll-behavior: contain; }
.chat-system-notice { margin-bottom: 14px; padding: 8px 11px; }
.message { margin-bottom: 16px; }
.message-label { margin-bottom: 5px; }
.bubble { padding: 10px 14px; line-height: 1.5; }
.message-receipt { margin-top: 5px; }
/* Typing row sits directly above the keyboard, not above home-indicator padding. */
html[data-client-occluded="true"] .composer-area, html[data-native][data-client-occluded="true"] .composer-area { padding-bottom: 5px; }
html[data-client-occluded="true"] .thread { scroll-behavior: auto; }
.composer-caption { display: none; }
.compact-menu { position: relative; min-width: 0; }
.compact-menu > summary { list-style: none; cursor: pointer; }
.compact-menu > summary::-webkit-details-marker { display: none; }
.compact-menu > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.group-picker { flex: 1; max-width: 560px; }
.group-heading { min-height: 44px; gap: 8px; padding: 0; }
.group-heading-copy { display: flex; flex-direction: column; min-width: 0; gap: 3px; }
.group-heading-copy strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-heading-copy > span { color: var(--muted); font-size: 11px; }
.header-symbol { width: 32px; height: 32px; font-size: 17px; border-radius: 7px; }
.menu-chevron { color: var(--muted); margin-left: 4px; font-size: 16px; line-height: 1; }
.chat-menu > summary { display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 9px; font-size: 21px; }
.menu-panel { position: absolute; z-index: 8; top: calc(100% + 7px); right: 0; min-width: 190px; max-width: calc(100vw - 32px); padding: 5px; border: 1px solid var(--control-border); border-radius: 8px; background: var(--nav); box-shadow: 0 8px 24px #0008; }
.menu-panel > button { display: flex; align-items: center; justify-content: space-between; gap: 18px; width: 100%; min-height: 40px; padding: 9px 11px; border: none; border-radius: 5px; color: var(--text); background: transparent; text-align: left; font-size: 13px; }
.menu-panel > button:not(:disabled):hover { background: var(--hover); }
.menu-panel > button > span { font-size: 11px; color: var(--muted); }
.menu-label { display: flex; justify-content: space-between; padding: 8px 11px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.menu-setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 42px; padding: 8px 11px; font-size: 13px; cursor: pointer; }
.menu-setting input { width: 18px; height: 18px; accent-color: var(--accent); }
.menu-status { display: block; max-width: 240px; padding: 2px 11px 8px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.group-panel { left: 0; right: auto; width: min(360px, calc(100vw - 32px)); }
.group-panel .group-list { display: grid; max-height: min(45dvh, 360px); overflow: auto; gap: 3px; }
.group-panel .group-button { flex: none; width: 100%; min-height: 44px; padding: 8px; align-items: center; gap: 9px; }
.group-panel .group-button.active { border-left: 3px solid var(--accent); padding-left: 6px; }
.group-panel .group-copy strong { margin: 0 0 3px; font-size: 12px; }
.group-panel .group-copy > span { display: block; font-size: 11px; }
.group-panel .group-symbol { width: 29px; height: 29px; font-size: 12px; }
.composer-area { padding: 6px 14px 7px; }
.composer-tools { gap: 6px; margin-bottom: 5px; justify-content: flex-start; }
.composer { gap: 6px; padding: 3px 5px 3px 10px; }
.send-button { display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 9px 11px; }
.form-picker > summary { min-height: 34px; padding: 7px 10px; font-size: 12px; }
.form-picker > .menu-panel { top: auto; bottom: calc(100% + 7px); left: 0; right: auto; min-width: 220px; }
.transport-switch { position: relative; display: block; flex: 0 1 164px; min-width: 126px; height: 34px; margin-left: auto; border-radius: 7px; cursor: pointer; }
.transport-switch > input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.transport-track { position: relative; display: flex; width: 100%; height: 100%; align-items: center; border: 1px solid var(--control-border); border-radius: inherit; background: var(--input); font-size: 11px; }
.transport-track::before { content: ''; position: absolute; top: 2px; bottom: 2px; left: 2px; width: calc(50% - 2px); border-radius: 4px; background: var(--brand); transition: transform .15s ease; }
.transport-track > span { position: relative; flex: 1; text-align: center; }
.transport-switch input:checked + .transport-track::before { transform: translateX(100%); background: var(--control); }
.transport-switch input:disabled + .transport-track > span:last-child { color: var(--muted); opacity: .55; }
.transport-switch input:disabled { cursor: not-allowed; }
.transport-switch input:focus-visible + .transport-track { outline: 2px solid var(--accent); outline-offset: 3px; }
.radio-receive-button { flex: 0 0 72px; height: 34px; padding: 4px 6px; border: 1px solid var(--control-border); border-radius: 7px; background: var(--input); color: var(--muted); font-size: 10px; font-weight: 700; white-space: nowrap; }
.radio-receive-copy { display: flex; min-height: 13px; align-items: center; justify-content: center; gap: 4px; line-height: 1; }
.radio-receive-copy strong { font-size: 11px; }
.radio-signal-scale { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 1px; width: 100%; height: 4px; margin-top: 3px; }
.radio-signal-scale i { min-width: 0; border-radius: 1px; background: var(--control-border); opacity: .3; }
.radio-signal-scale i[data-active="true"][data-zone="low"] { background: var(--signal-low); opacity: 1; }
.radio-signal-scale i[data-active="true"][data-zone="average"] { background: var(--signal-average); opacity: 1; }
.radio-signal-scale i[data-active="true"][data-zone="good"] { background: var(--signal-good); opacity: 1; }
.radio-receive-button[data-state="starting"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--input)); color: var(--accent); }
.radio-receive-button[aria-pressed="true"][data-state="on"] { background: var(--brand); box-shadow: inset 0 0 0 1px currentColor; }
.radio-receive-button[data-signal-zone="low"] { border-color: var(--signal-low); color: var(--signal-low); }
.radio-receive-button[data-signal-zone="average"] { border-color: var(--signal-average); color: var(--signal-average); }
.radio-receive-button[data-signal-zone="good"] { border-color: var(--signal-good); color: var(--signal-good); }
.radio-receive-button:disabled { opacity: .65; }
.radio-receive-button[aria-pressed="true"]:disabled { cursor: default; opacity: 1; }
.radio-receive-status { margin: -2px 0 7px; color: var(--accent); font-size: 11px; line-height: 1.35; }
.composer-caption { justify-content: flex-end; margin-top: 6px; }
.composer-caption > span:last-child { display: inline; }
.casevac-field { margin: 0; padding: 8px 10px 10px; border: 1px solid var(--border); border-radius: 8px; }
.casevac-field legend { max-width: 100%; padding: 0 5px; font-size: 13px; font-weight: 650; line-height: 1.5; }
.casevac-field .line-number { display: inline-grid; margin-right: 6px; }
.casevac-controls { display: grid; gap: 8px; }
.casevac-controls.casevac-counts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.medical-field label.casevac-input-label { display: flex; flex-direction: column; align-items: stretch; gap: 5px; margin: 0; font-size: 12px; font-weight: 400; }
.casevac-field input:not([type="checkbox"]), .casevac-field textarea, .casevac-field select { width: 100%; min-width: 0; max-width: 100%; min-height: 42px; margin: 0; padding: 9px 10px; border: 1px solid var(--input-border); border-radius: 6px; background: var(--input); color: var(--text); font-size: 14px; }
.casevac-field textarea { resize: vertical; }
.casevac-stepper { display: grid; grid-template-columns: 44px minmax(44px, 1fr) 44px; min-height: 44px; border: 1px solid var(--input-border); border-radius: 6px; overflow: hidden; background: var(--input); }
.casevac-field .casevac-stepper input { min-height: 42px; padding: 7px 4px; border: 0; border-radius: 0; text-align: center; font-variant-numeric: tabular-nums; }
.casevac-stepper-button { min-width: 44px; min-height: 44px; padding: 0; border: 0; background: var(--control); color: var(--text); font-size: 20px; line-height: 1; }
.casevac-stepper-button:first-child { border-right: 1px solid var(--input-border); }
.casevac-stepper-button:last-child { border-left: 1px solid var(--input-border); }
.casevac-location-actions { display: flex; align-items: center; gap: 8px; min-width: 0; }
.casevac-location-actions button { flex: 0 0 auto; min-height: 36px; padding: 6px 9px; }
.casevac-location-status { min-width: 0; color: var(--muted); font-size: 10px; line-height: 1.3; overflow-wrap: anywhere; }
.medical-field label.casevac-choice { display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 0; font-size: 12px; font-weight: 400; }
.casevac-choice input { flex: 0 0 18px; width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.casevac-field :disabled { opacity: .5; }
.received-field dd:empty { min-height: 1.4em; }
@media (prefers-reduced-motion: reduce) { .transport-track::before { transition: none; } }
@media (pointer: coarse) {
  input:not([type="checkbox"]):not([type="radio"]), textarea, select { font-size: 16px !important; }
}
@media (max-width: 600px) {
  .comms-bar { gap: 5px; padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); justify-content: flex-start; align-content: center; }
  .comms-bar .status-chip { gap: 3px; font-size: 0; }
  .comms-bar .status-chip strong { max-width: 96px; overflow: hidden; text-overflow: ellipsis; font-size: 10px; }
  .comms-bar .status-dot { width: 6px; height: 6px; }
  html[data-native] .comms-bar { flex-wrap: nowrap; height: auto; min-height: calc(40px + var(--safe-top)); }
  .comms-bar .quiet-button { padding: 6px 8px; min-height: 30px; }
  .group-list { scrollbar-width: thin; }
  .group-button { min-height: 44px; }
  .conversation-header { min-width: 0; min-height: 48px; padding: 2px 10px; gap: 7px; }
  .group-heading { min-width: 0; }
  .group-heading h1 { overflow-wrap: anywhere; }
  .header-symbol { flex-shrink: 0; width: 28px; height: 28px; font-size: 15px; }
  .group-heading-copy { gap: 1px; }
  .group-heading-copy strong { font-size: 13px; }
  .group-heading-copy > span { font-size: 10px; }
  .thread { padding: 8px 10px 4px; }
  .chat-system-notice { margin-bottom: 10px; padding: 6px 9px; }
  .message { gap: 6px; margin-bottom: 12px; }
  .message-label { margin-bottom: 4px; }
  .bubble { padding: 8px 11px; line-height: 1.45; }
  .message-receipt { margin-top: 4px; }
  .message-location { margin-top: 4px; }
  .form-card-main { gap: 9px; padding: 11px 12px 8px; }
  .form-card-status { padding: 0 12px 9px; }
  .form-card-actions { padding: 8px 12px; }
  .composer-area { padding: 5px 10px; }
  .composer-tools { flex-wrap: nowrap; gap: 5px; }
  .transport-switch { flex-basis: 126px; min-width: 112px; }
  .radio-receive-button { flex-basis: 72px; padding: 0 5px; font-size: 10px; }
  .composer { padding: 2px 4px 2px 9px; gap: 5px; }
  .composer .message-entry textarea { padding-top: 4px; padding-bottom: 4px; }
  /* iOS focus-zooms controls below 16px; specificity must beat form/composer rules. */
  input:not([type="checkbox"]):not([type="radio"]), textarea, select { font-size: 16px !important; }
  .status-chip { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .form-dialog { width: calc(100vw - 16px); max-height: calc(var(--client-height, 100dvh) - var(--safe-top) - var(--safe-bottom) - 16px); }
  .dialog-header > div { min-width: 0; }
  .dialog-header { padding: 8px 10px 7px; }
  .dialog-header h2 { margin: 2px 0 3px; font-size: 18px; }
  .dialog-comms { gap: 8px; padding: 5px 10px; }
  .form-toolbar { flex-direction: row; align-items: center; padding: 7px 10px 2px; }
  .medical-fields, .received-fields { padding: 8px 10px; gap: 8px; }
  .dialog-actions { padding: 8px 10px; gap: 8px; }
  #medical-form { scroll-padding-block: 8px 70px; }
  .casevac-field { padding: 6px 8px 8px; }
  .casevac-field textarea { resize: none; }
  .access-alerts { bottom: calc(12px + var(--safe-bottom)); right: 8px; width: calc(100vw - 16px); }
}
