@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/source-sans-3-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/source-sans-3-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  --navy: #0e1628;
  --navy-soft: #162033;
  --ink: #e8eef8;
  --muted: #8b97ad;
  --gold: #e23b4a;
  --ember: #e23b4a;
  --ember-hot: #ff6b78;
  --ok: #3dbe7a;
  --warn: #e23b4a;
  --line: rgba(255, 255, 255, 0.1);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--navy);
  color: var(--ink);
  font-family: "Source Sans 3", ui-sans-serif, system-ui, sans-serif;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

.login-body {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) 1.1fr;
  background: var(--navy);
}

.login-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 64px;
  background: #000;
  border-right: 1px solid var(--line);
}

.login-hero img {
  width: 148px;
  height: 148px;
  object-fit: contain;
}

.eyebrow {
  margin: 16px 0 0;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.login-hero h1 {
  margin: 6px 0 0;
  font-size: 56px;
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.district {
  margin: 12px 0 0;
  max-width: 16rem;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.35;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  background: #000;
}

.login-card {
  width: 100%;
  max-width: 420px;
}

.login-card h2 {
  margin: 0;
  font-size: 32px;
  letter-spacing: -0.02em;
}

.login-lead {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 16px;
}

.login-card label { display: block; margin-top: 20px; }

@media (max-width: 800px) {
  .login-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .login-hero {
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .login-hero img { width: 72px; height: 72px; }
  .login-hero .eyebrow { margin: 0; font-size: 11px; letter-spacing: 0.18em; }
  .login-hero h1 { margin-top: 2px; font-size: 28px; }
  .district { display: none; }
  .login-panel { align-items: flex-start; padding: 28px 20px 40px; }
}
.field-name {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.user-box, .field {
  margin-top: 8px;
  height: 48px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(14, 22, 40, 0.8);
  outline: none;
}
.user-box { display: flex; align-items: center; }
.user-box input, .field {
  padding: 0 14px;
}
.user-box input {
  height: 100%;
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
}
.user-box:focus-within, .field:focus { border-color: rgba(226, 59, 74, 0.7); }
.domain {
  margin-right: 8px;
  padding: 4px 10px;
  border: 1px solid rgba(226, 59, 74, 0.2);
  border-radius: 8px;
  background: rgba(226, 59, 74, 0.1);
  color: var(--gold);
  font-size: 13px;
  white-space: nowrap;
}
.primary, .send {
  border: 0;
  border-radius: 12px;
  background: var(--ember);
  color: white;
  font-size: 14px;
  font-weight: 700;
}
.primary { margin-top: 20px; height: 48px; width: 100%; }
.primary:disabled { opacity: 0.7; }
.respond-start { margin-top: 0; }
.respond-form { display: flex; gap: 8px; align-items: stretch; }
.respond-form[hidden] { display: none; }
.respond-form select {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(14, 22, 40, 0.8);
}
.respond-go { flex: none; width: auto; margin: 0; padding: 0 16px; }
.error { color: var(--ember-hot); font-size: 14px; }
.login-card .error { margin: 12px 0 0; }

.app { height: 100svh; display: flex; flex-direction: column; }
.top {
  height: 56px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  background: #000;
  border-bottom: 1px solid var(--line);
}
@keyframes status-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.15; }
}
.dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex: none;
  background: var(--ember);
  animation: status-blink 1.2s ease-in-out infinite;
}
.dot.live { background: var(--ok); }
.dot.connecting { background: var(--warn); }
.logo { width: 32px; height: 32px; object-fit: contain; }
.brand { min-width: 0; }
.brand strong, .brand span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand strong { font-size: 14px; line-height: 1.2; }
.brand span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.15;
  letter-spacing: 0.01em;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}
.tools { margin-left: auto; display: flex; gap: 4px; }
.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}
.icon-btn.active { background: rgba(255, 255, 255, 0.1); color: var(--gold); }
.icon-btn:hover { background: rgba(255, 255, 255, 0.05); }
.icon { width: 20px; height: 20px; }
.badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--ember);
  color: white;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
.stage { min-height: 0; flex: 1; }
.split { display: flex; height: 100%; min-height: 0; }
.list-pane { display: flex; flex-direction: column; width: 100%; min-height: 0; background: #000; }
.map-pane { display: none; position: relative; min-width: 0; min-height: 0; flex: 1; }
@media (min-width: 1024px) {
  .list-pane { width: 24rem; flex: none; border-right: 1px solid var(--line); }
  .map-pane { display: block; }
}
@media (max-width: 1023px) {
  .split.is-map .list-pane { display: none; }
  .split.is-map .map-pane { display: block; }
}
#map { position: absolute; inset: 0; background: #0b1220; }
.leaflet-container { height: 100%; width: 100%; background: #0b1220; font-family: inherit; }
.basemap {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 400;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(22, 32, 51, 0.95);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.list-head, .section-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
}
.list-head { border-bottom: 1px solid var(--line); background: #0c0c0c; }
.list-head:has(.radio-btn),
.detail-head:has(.radio-btn) { padding: 6px 8px 6px 12px; }
.head-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  margin-left: auto;
}
.calls-btn,
.calls-back,
.radio-btn,
.media-btn {
  width: 56px;
  height: 56px;
  flex: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  line-height: 1;
}
.calls-btn .icon,
.calls-back .icon,
.radio-btn .icon,
.media-btn .icon { width: 20px; height: 20px; }
.calls-btn span,
.calls-back span,
.radio-btn span {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.calls-btn[aria-expanded="true"],
.calls-back,
.radio-btn[aria-expanded="true"],
.media-btn[aria-expanded="true"] {
  background: rgba(226, 59, 74, 0.16);
  border-color: rgba(226, 59, 74, 0.45);
}
.calls-panel {
  display: flex;
  gap: 8px;
  flex: none;
  width: 100%;
  margin: 0;
  padding: 14px 16px 12px;
  border-top: 0;
  border-right: 5px solid #0c0c0c;
  border-bottom: 5px solid #0c0c0c;
  border-left: 5px solid #0c0c0c;
  border-radius: 0 0 12px 12px;
  background: #000;
}
.calls-panel[hidden] { display: none; }
.calls-filter {
  flex: 1;
  height: 36px;
  margin: 0;
  padding: 0 8px;
  border: 0.5px solid #fff;
  border-radius: 8px;
  background: transparent;
  color: #f3f3f3;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.calls-filter[aria-pressed="true"] {
  background: rgba(226, 59, 74, 0.16);
  border-color: rgba(226, 59, 74, 0.45);
}
section[data-call-group][hidden] { display: none; }
.radio-player,
.media-player {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  column-gap: 16px;
  row-gap: 10px;
  align-items: center;
  flex: none;
  width: 100%;
  margin: 0;
  padding: 14px 16px 12px;
  border-top: 0;
  border-right: 5px solid #0c0c0c;
  border-bottom: 5px solid #0c0c0c;
  border-left: 5px solid #0c0c0c;
  border-radius: 0 0 12px 12px;
  background: #000;
  color: #f3f3f3;
}
.radio-player[hidden],
.media-player[hidden] { display: none; }
.media-title {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  height: 36px;
  margin: 0;
  padding: 0 10px;
  border: 0.5px solid #fff;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.radio-play {
  grid-column: 1;
  grid-row: 1;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  box-shadow: none;
  line-height: 0;
}
.radio-play span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  line-height: 0;
}
.radio-play .icon { display: block; width: 36px; height: 36px; margin: 0; }
.radio-player-meta { display: contents; }
.radio-player-title {
  grid-column: 2;
  grid-row: 1;
  display: block;
  width: 100%;
  height: 36px;
  margin: 0;
  padding: 0 22px 0 10px;
  border: 0.5px solid #fff;
  border-radius: 8px;
  appearance: none;
  background-color: transparent;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 10px) 50%, calc(100% - 6px) 50%;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  color: inherit;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-align: left;
  text-align-last: left;
  cursor: pointer;
}
.radio-track {
  grid-column: 2;
  grid-row: 2;
  position: relative;
  height: 3px;
  margin: 2px 0 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}
.radio-track-fill {
  position: relative;
  display: block;
  width: 28%;
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
}
.radio-track-fill::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(226, 59, 74, 0.28);
}
.radio-times {
  grid-column: 2;
  grid-row: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.radio-live {
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.kicker, .section-h {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.section-h { position: sticky; top: 0; background: #000; color: var(--ember); }
.text-btn, .gold {
  border: 0;
  background: transparent;
  color: var(--gold);
  font-size: 12px;
  font-weight: 600;
}
.gold { font-size: 14px; }
.calls { min-height: 0; flex: 1; overflow-y: auto; background: #000; }
.call { display: flex; align-items: stretch; margin-bottom: 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.call-live { animation: call-pulse 1.4s ease-in-out infinite; }
.call-closed { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4); }
@keyframes call-pulse {
  0%, 100% { background: transparent; }
  50% { background: rgba(226, 59, 74, 0.35); }
}
.call-main { min-width: 0; flex: 1; padding: 10px 12px; }
.call-main:hover, .pin:hover, .thread:hover { background: rgba(255, 255, 255, 0.05); }
.call-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.call-type { margin: 0; font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-time, .call-meta, .muted { color: var(--muted); }
.call-time, .call-meta { font-size: 11px; }
.call-address { margin: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-meta { margin: 0; letter-spacing: 0.04em; text-transform: uppercase; }
.pin { width: 48px; display: inline-flex; align-items: center; justify-content: center; color: var(--gold); }
.empty { margin: 0; padding: 12px; color: var(--muted); font-size: 14px; }
.more { display: block; padding: 12px; color: var(--gold); font-size: 14px; font-weight: 600; }
.pad-error { margin: 0; padding: 8px 12px; }

.page { height: 100%; overflow-y: auto; padding: 16px; }
.page h1, .detail h1 { margin: 4px 0 0; font-size: 24px; line-height: 1.2; }
.back { color: var(--gold); font-size: 14px; font-weight: 600; }
.detail { min-height: 0; flex: 1; overflow-y: auto; }
.detail-head { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: #0c0c0c; }
.status { color: var(--muted); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.detail-body { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.number-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.number-row .muted { margin: 0; }
.number-row .status { flex: none; }
.number { margin: 0; color: var(--gold); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; }
.priority { margin: 0; color: var(--warn); font-size: 14px; }
.copy {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}
.copy p { margin: 0; }
.copy .hint { color: var(--muted); font-size: 12px; }
.detail h2, .subhead {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.notes { margin: 4px 0 0; white-space: pre-wrap; font-size: 14px; }
.crew {
  width: 100%;
  margin: 8px 0 0;
  border-collapse: collapse;
  font-size: 13px;
}
.crew th {
  padding: 6px 8px 6px 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.crew td {
  padding: 8px 8px 8px 0;
  vertical-align: top;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  overflow-wrap: anywhere;
}
.crew th:last-child, .crew td:last-child { padding-right: 0; }
.crew strong, .roster strong { display: block; }
.crew .muted { display: block; font-size: 12px; }
.roster p { margin: 0; }

.menu, .roster { margin: 16px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.menu a, .roster li, .stock li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.menu li:last-child a, .roster li:last-child, .stock li:last-child { border-bottom: 0; }
.menu small, .roster .meta, .stock small { display: block; color: var(--muted); font-size: 12px; }
.chevron { color: var(--muted); }
.signout {
  margin-top: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ember-hot);
  font-size: 14px;
  font-weight: 600;
}
.admin-label { margin: 24px 0 0; }
.facts { margin: 0; }
.facts div { margin-bottom: 12px; }
.facts dt { color: var(--muted); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
.facts dd { margin: 0; font-size: 14px; }
.test-alarm { margin-top: 24px; }
.test-alarm .primary { margin-top: 8px; }
.test-alarm p { margin: 8px 0 0; }
.unit-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.qty { color: var(--gold); font-size: 14px; white-space: nowrap; }
.day { margin-bottom: 16px; }
.day p { margin: 4px 0 0; font-size: 14px; }
.day .gold { font-weight: 600; }

.chat { display: flex; height: 100%; min-height: 0; }
.threads {
  width: 10rem;
  flex: none;
  overflow-y: auto;
  border-right: 1px solid var(--line);
}
@media (min-width: 640px) { .threads { width: 16rem; } }
.thread { display: block; width: 100%; padding: 8px 12px; text-align: left; }
.thread.active { background: rgba(255, 255, 255, 0.1); }
.thread strong, .thread span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread strong { font-size: 14px; }
.thread span { color: var(--muted); font-size: 12px; }
.conversation { display: flex; min-width: 0; flex: 1; flex-direction: column; }
#transcript { min-height: 0; flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.bubble-row { display: flex; }
.bubble-row.mine { justify-content: flex-end; }
.bubble-row.theirs { justify-content: flex-start; }
.bubble { max-width: 80%; padding: 8px 12px; border-radius: 16px; }
.bubble.mine { background: var(--ember); color: white; }
.bubble.theirs { background: var(--navy-soft); }
.who { margin: 0; color: var(--gold); font-size: 11px; font-weight: 600; }
.bubble p { margin: 0; white-space: pre-wrap; font-size: 14px; }
.when { margin: 0; font-size: 10px; }
.bubble.mine .when { color: rgba(255, 255, 255, 0.7); }
.bubble.theirs .when { color: var(--muted); }
.composer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.composer input {
  height: 44px;
  min-width: 0;
  flex: 1;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--navy-soft);
  outline: none;
}
.send { padding: 0 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
