@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --red: #de332c;
  --red2: #8f201d;
  --blue: #39a3db;
  --cyan: #33c6c1;
  --green: #4ed58f;
  --amber: #f0b84b;
  --navy: #f7fbf8;
  --bg: #111716;
  --card: #202927;
  --text: #f7fbf8;
  --muted: #aabbb5;
  --line: #374845;
  --shadow: 0 18px 40px rgba(3, 9, 8, .28);
  --r: 8px;
  --emer-red: #de332c;
  --emer-red-bright: #ff665c;
  --emer-red-deep: #721816;
  --emer-dark: #101615;
  --emer-surface: #111716;
  --emer-panel: #202927;
  --emer-panel-2: #263230;
  --emer-panel-3: #2d3a37;
  --emer-border: #374845;
  --emer-ink: #f7fbf8;
  --emer-muted: #aabbb5;
  --emer-blue: #39a3db;
  --emer-cyan: #33c6c1;
  --emer-green: #4ed58f;
  --emer-amber: #f0b84b;
  --emer-shadow: 0 18px 40px rgba(3, 9, 8, .28);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, #17201f 0, #111716 360px, #151a18 100%);
  color: var(--emer-ink);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, .72), transparent 74%);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(51, 198, 193, .42);
  outline-offset: 2px;
}

.btn {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--emer-border);
  border-radius: var(--r);
  background: #2a3634;
  color: var(--emer-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 820;
  box-shadow: none;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.btn.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--emer-red), #a72522);
  color: #fff;
}

.btn.blue {
  border-color: rgba(51, 198, 193, .48);
  background: rgba(51, 198, 193, .14);
  color: #dcfffa;
}

.btn.quiet {
  border-color: rgba(255, 102, 92, .42);
  background: rgba(222, 51, 44, .12);
  color: #ffd8d5;
}

.emer-header {
  position: sticky;
  top: 0;
  z-index: 30;
  width: 100%;
  min-height: 76px;
  margin: 0;
  padding: 10px max(16px, calc((100vw - 1500px) / 2 + 16px));
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--emer-border);
  background: #1c2523;
  color: var(--emer-ink);
  box-shadow: 0 6px 24px rgba(3, 9, 8, .16);
}

.emer-header::before {
  content: "";
  position: absolute;
  left: max(16px, calc((100vw - 1500px) / 2 + 16px));
  bottom: -1px;
  width: 152px;
  height: 3px;
  background: var(--emer-red);
}

.emer-header::after {
  content: none;
}

.emer-header > * {
  position: relative;
  z-index: 1;
}

.emer-logo-card {
  min-width: 0;
  height: 46px;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.emer-brand-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 6px;
}

.emer-brand-name {
  overflow: hidden;
  color: #ff766b;
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.corps-name {
  min-width: 0;
  min-height: 38px;
  padding-left: 18px;
  display: grid;
  align-content: center;
  gap: 4px;
  border-left: 1px solid var(--emer-border);
}

.corps-name h1 {
  margin: 0;
  overflow: hidden;
  color: var(--emer-ink);
  font-size: .98rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.corps-name small {
  overflow: hidden;
  color: var(--emer-muted);
  font-size: .7rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#mobileSync {
  display: none;
}

.header-status,
.header-actions {
  display: flex;
  align-items: center;
}

.header-status {
  justify-content: flex-end;
  gap: 18px;
  min-height: 46px;
}

.header-connection {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--emer-muted);
  font-size: .73rem;
  font-weight: 800;
  white-space: nowrap;
}

.header-connection span {
  display: none;
}

.header-connection i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--emer-amber);
  box-shadow: 0 0 0 4px rgba(240, 184, 75, .14);
}

.emer-header.is-online .header-connection i {
  background: var(--emer-green);
  box-shadow: 0 0 0 4px rgba(78, 213, 143, .14);
}

.emer-header.is-offline .header-connection i {
  background: var(--emer-red-bright);
  box-shadow: 0 0 0 4px rgba(222, 51, 44, .14);
}

.emer-header.is-stale .header-connection i,
.emer-header.is-local .header-connection i {
  background: var(--emer-amber);
  box-shadow: 0 0 0 4px rgba(240, 184, 75, .14);
}

.header-time {
  min-width: 66px;
  padding-left: 17px;
  display: grid;
  justify-items: end;
  gap: 3px;
  border-left: 1px solid var(--emer-border);
}

.emer-clock {
  color: var(--emer-ink);
  font-size: 1.12rem;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.header-time small {
  color: var(--emer-muted);
  font-size: .64rem;
  font-weight: 700;
  text-transform: lowercase;
}

.header-actions {
  gap: 7px;
  padding-left: 14px;
  border-left: 1px solid var(--emer-border);
}

.header-action.btn {
  min-height: 42px;
  padding: 0 12px;
  border-color: var(--emer-border);
  background: #27322f;
  color: var(--emer-ink);
  font-size: .74rem;
}

.header-action.btn:hover,
.header-action.btn:focus-visible {
  border-color: var(--emer-muted);
  background: #33413c;
  color: var(--emer-ink);
}

.header-action.btn.primary {
  border-color: transparent;
  background: #a72b27;
  color: #fff;
}

.header-action.btn.blue {
  border-color: #216f60;
  background: #174d43;
  color: #e6fff7;
}

.header-action[hidden] {
  display: none !important;
}

.theme-toggle.btn {
  width: 42px;
  padding: 0;
}

.theme-toggle .icon-moon,
html[data-theme="light"] .theme-toggle .icon-sun {
  display: none;
}

html[data-theme="light"] .theme-toggle .icon-moon {
  display: block;
}

@media (display-mode: standalone) {
  #installBtn {
    display: none !important;
  }
}

.shell {
  max-width: 1500px;
  margin: 0 auto;
  padding: 16px 16px 28px;
}

.connection-alert {
  width: 100%;
  min-height: 44px;
  margin: 0 0 12px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(240, 184, 75, .48);
  border-radius: var(--r);
  background: #3a3021;
  color: #ffe5a7;
  text-align: left;
  box-shadow: var(--emer-shadow);
}

.connection-alert[hidden] {
  display: none;
}

.connection-alert span {
  font-size: .78rem;
}

.connection-alert strong {
  flex: 0 0 auto;
  font-size: .72rem;
  white-space: nowrap;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.metric {
  position: relative;
  min-height: 92px;
  padding: 13px 14px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  overflow: hidden;
  border: 1px solid var(--emer-border);
  border-radius: var(--r);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .035), transparent),
    var(--emer-panel);
  color: var(--emer-ink);
  box-shadow: var(--emer-shadow);
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent);
}

.metric::after {
  content: "";
  position: absolute;
  inset: 0 0 auto auto;
  width: 96px;
  height: 100%;
  background: linear-gradient(135deg, transparent 0 42%, color-mix(in srgb, var(--accent) 18%, transparent) 42% 52%, transparent 52%);
  opacity: .72;
  pointer-events: none;
}

.metric-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #c3d0cc;
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.metric-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

.metric-value {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.metric-value strong,
.metric strong {
  margin: 0;
  flex: 0 0 auto;
  color: #fff;
  font-size: 1.7rem;
  font-weight: 950;
  line-height: .95;
  font-variant-numeric: tabular-nums;
}

.metric-value small,
.metric small {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--emer-muted);
  font-size: .7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toolbar {
  position: sticky;
  top: 96px;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(200px, 310px);
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--r);
  background: rgba(17, 23, 22, .88);
  backdrop-filter: blur(14px);
}

.state-switch {
  min-height: 42px;
  padding: 3px;
  display: flex;
  align-items: stretch;
  gap: 2px;
  border: 1px solid var(--emer-border);
  border-radius: var(--r);
  background: #202927;
}

.state-switch button {
  min-height: 34px;
  padding: 0 11px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--emer-muted);
  font-size: .73rem;
  font-weight: 820;
  white-space: nowrap;
}

.state-switch button:hover,
.state-switch button:focus-visible {
  color: var(--emer-ink);
  background: var(--emer-panel-3);
}

.state-switch button[aria-pressed="true"] {
  background: var(--emer-panel-3);
  color: var(--emer-ink);
  box-shadow: inset 0 -2px var(--emer-cyan);
}

.search {
  position: relative;
}

.search svg {
  position: absolute;
  top: 12px;
  left: 13px;
  width: 17px;
  height: 17px;
  color: var(--emer-muted);
  pointer-events: none;
}

input,
select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--emer-border);
  border-radius: var(--r);
  background-color: #202927;
  color: var(--emer-ink);
  box-shadow: none;
  font-size: .8rem;
}

input::placeholder {
  color: #92a49e;
  opacity: 1;
}

select option,
select optgroup {
  background: #202927;
  color: var(--emer-ink);
}

input:focus,
select:focus {
  border-color: var(--emer-cyan);
  box-shadow: 0 0 0 4px rgba(51, 198, 193, .12);
}

.search input {
  padding-left: 40px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.68fr) minmax(360px, .72fr);
  gap: 12px;
}

.panel {
  overflow: hidden;
  border: 1px solid var(--emer-border);
  border-radius: var(--r);
  background: var(--emer-panel);
  color: var(--emer-ink);
  box-shadow: var(--emer-shadow);
}

.panel-head {
  min-height: 52px;
  padding: 0 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--emer-border);
  background: #263230;
}

.panel-head h3 {
  margin: 0;
  color: #fff;
  font-size: .92rem;
  font-weight: 900;
}

.count {
  color: var(--emer-muted);
  font-size: .72rem;
  font-weight: 760;
  white-space: nowrap;
}

.feed {
  padding: 0 12px;
  background: var(--emer-panel);
}

.occurrence {
  position: relative;
  width: 100%;
  min-height: 72px;
  padding: 10px 8px 10px 13px;
  display: grid;
  grid-template-columns: 66px minmax(220px, 1.42fr) minmax(130px, .78fr) 148px 106px 18px;
  gap: 10px;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--emer-border);
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  transition: background .16s ease, transform .16s ease;
}

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

.occurrence::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #65736f;
}

.occurrence.priority-critical::before {
  background: var(--emer-red);
  box-shadow: 0 0 18px rgba(222, 51, 44, .3);
}

.occurrence.priority-active::before {
  background: var(--emer-green);
  box-shadow: 0 0 18px rgba(78, 213, 143, .25);
}

.occurrence:hover,
.occurrence:focus-visible {
  background: #2b3735;
  outline: none;
}

.occurrence.selected {
  background:
    linear-gradient(90deg, rgba(51, 198, 193, .16), transparent 58%),
    #263331;
}

.time {
  display: block;
  color: #fff;
  font-size: .98rem;
  font-weight: 950;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.sub {
  display: block;
  margin-top: 3px;
  color: var(--emer-muted);
  font-size: .66rem;
  line-height: 1.28;
}

.nature {
  display: block;
  overflow: hidden;
  color: #f8fbf9;
  font-size: .84rem;
  font-weight: 820;
  line-height: 1.22;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.occurrence .location strong {
  display: block;
  overflow: hidden;
  color: #f0f6f3;
  font-size: .78rem;
  font-weight: 820;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vehicle {
  max-width: 100%;
  padding: 5px 8px;
  display: inline-flex;
  overflow: hidden;
  border: 1px solid rgba(57, 163, 219, .26);
  border-radius: 6px;
  background: rgba(57, 163, 219, .12);
  color: #cfecff;
  font-size: .68rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #b9c7c2;
  font-size: .69rem;
  font-weight: 900;
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--status);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--status) 16%, transparent);
}

.status.active {
  color: #a8f0ca;
}

.status.closed {
  color: #b7c5c0;
}

.state-age {
  display: block;
  margin-top: 3px;
  color: var(--emer-muted);
  font-size: .65rem;
  font-weight: 750;
}

.mobile-place,
.mobile-meta {
  display: none;
}

.arrow {
  color: #83948f;
  font-size: 1.2rem;
  line-height: 1;
  text-align: right;
}

.empty {
  padding: 46px 20px;
  color: var(--emer-muted);
  font-size: .84rem;
  text-align: center;
}

.empty-action {
  min-height: 38px;
  margin-top: 14px;
  padding: 0 12px;
  border: 1px solid rgba(51, 198, 193, .42);
  border-radius: var(--r);
  background: rgba(51, 198, 193, .12);
  color: #dbfffa;
  font-size: .76rem;
  font-weight: 900;
}

.detail-panel {
  position: sticky;
  top: 160px;
  align-self: start;
  max-height: calc(100vh - 174px);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #5b6d68 transparent;
}

.detail {
  padding: 16px 14px 14px;
  background: var(--emer-panel);
  color: var(--emer-ink);
}

.detail h4 {
  margin: 0 0 3px;
  color: #fff;
  font-size: 1.04rem;
  font-weight: 920;
}

.detail-placeholder {
  min-height: 232px;
  padding: 28px;
  display: grid;
  place-items: center;
  color: var(--emer-muted);
  font-size: .82rem;
  line-height: 1.5;
  text-align: center;
}

.detail-title-row,
.tag-row,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.detail-title-row {
  align-items: flex-start;
}

.detail-title-row .status {
  flex: 0 0 auto;
}

.tag-row {
  justify-content: flex-start;
  margin-top: 8px;
}

.tag,
.duration-badge {
  margin: 0;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: .66rem;
  font-weight: 900;
}

.tag {
  display: inline-flex;
  background: rgba(222, 51, 44, .14);
  color: #ffd7d4;
}

.duration-badge {
  display: inline-flex;
  background: rgba(78, 213, 143, .12);
  color: #cbffe2;
}

.place {
  margin: 14px 0;
  padding: 12px;
  display: flex;
  gap: 10px;
  border: 1px solid var(--emer-border);
  border-radius: var(--r);
  background: #1a2220;
}

.place svg {
  width: 19px;
  flex: 0 0 auto;
  color: var(--emer-red-bright);
}

.place strong {
  display: block;
  color: #fff;
  font-size: .82rem;
  line-height: 1.3;
}

.map-card {
  margin: -2px 0 13px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--emer-border);
  border-radius: var(--r);
  background: #151d1b;
}

.map-card iframe {
  grid-column: 1 / -1;
  width: 100%;
  height: 188px;
  border: 0;
  filter: saturate(.86) contrast(1.02);
}

.map-card a {
  min-height: 34px;
  margin: 6px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  background: #303d39;
  color: #fff;
  font-size: .62rem;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.map-source {
  min-width: 0;
  padding: 6px 10px;
  overflow: hidden;
  color: #d5e4dd;
  font-size: .62rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-loading {
  min-height: 124px;
  margin: -2px 0 13px;
  padding: 18px;
  display: grid;
  place-items: center;
  border: 1px dashed #4a5b57;
  border-radius: var(--r);
  background: #18211f;
  color: var(--emer-muted);
  font-size: .72rem;
  text-align: center;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--emer-border);
  border-radius: var(--r);
}

.fact {
  padding: 10px 6px;
  border: 0;
  border-radius: 0;
  background: #1a2220;
  text-align: center;
}

.fact + .fact {
  border-left: 1px solid var(--emer-border);
}

.fact strong {
  display: block;
  color: #fff;
  font-size: .82rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.fact span {
  color: var(--emer-muted);
  font-size: .58rem;
  font-weight: 850;
  text-transform: uppercase;
}

.section-title {
  margin: 16px 0 7px;
  color: #c5d4ce;
  font-size: .63rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.section-title-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title-count b {
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #33413e;
  color: #effaf5;
  font-size: .64rem;
}

.unit {
  min-height: 56px;
  margin-bottom: 0;
  padding: 10px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-bottom: 1px solid var(--emer-border);
  border-radius: 0;
  background: transparent;
}

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

.unit-rich {
  align-items: flex-start;
}

.unit-content {
  min-width: 0;
  flex: 1;
}

.unit strong {
  display: block;
  color: #f7fbf8;
  font-size: .77rem;
  font-weight: 840;
  overflow-wrap: anywhere;
}

.unit span {
  display: block;
  color: var(--emer-muted);
  font-size: .66rem;
}

.avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(51, 198, 193, .22);
  border-radius: 7px;
  background: #303d3a;
  color: #d9fff8;
  font-size: .62rem;
  font-weight: 950;
}

.info-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.info-chips > span {
  padding: 4px 6px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 6px;
  background: #2d3936;
  color: #e4f0eb;
  font-size: .61rem;
  font-weight: 820;
}

.info-chips small {
  margin-right: 3px;
  color: #9fb0aa;
  font-size: .53rem;
  font-weight: 900;
  text-transform: uppercase;
}

.more-info {
  margin-top: 14px;
  border: 1px solid var(--emer-border);
  border-radius: var(--r);
  background: #1a2220;
}

.more-info summary {
  padding: 10px;
  cursor: pointer;
  color: #d8e7e1;
  font-size: .72rem;
  font-weight: 900;
}

.more-info dl {
  margin: 0;
  padding: 0 10px 10px;
}

.more-info dl div {
  padding: 7px 0;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--emer-border);
}

.more-info dt {
  color: var(--emer-muted);
  font-size: .64rem;
}

.more-info dd {
  margin: 0;
  color: #f7fbf8;
  font-size: .66rem;
  font-weight: 780;
  text-align: right;
}

.notice {
  margin-top: 13px;
  padding: 12px;
  border: 1px solid rgba(240, 184, 75, .42);
  border-radius: var(--r);
  background: #372d21;
  color: #ffe0a1;
  font-size: .73rem;
  line-height: 1.45;
}

.compact-notice {
  margin-top: 7px;
}

.field-label {
  display: block;
  margin-bottom: 7px;
  color: #f7fbf8;
  font-size: .76rem;
  font-weight: 900;
}

.form-help {
  margin: 9px 0 15px;
  color: var(--emer-muted);
  font-size: .76rem;
}

.dialog-actions {
  justify-content: flex-start;
}

.background-note {
  margin: 12px 0 15px;
  padding: 12px;
  display: grid;
  gap: 3px;
  border: 1px solid rgba(78, 213, 143, .36);
  border-radius: var(--r);
  background: rgba(78, 213, 143, .1);
  color: #d9ffe9;
}

.background-note strong {
  font-size: .76rem;
}

.background-note span {
  color: #b8d7c6;
  font-size: .72rem;
}

.privacy-note {
  margin-top: 15px;
}

.sheet {
  width: min(580px, calc(100% - 24px));
  padding: 0;
  border: 1px solid var(--emer-border);
  border-radius: var(--r);
  background: var(--emer-panel);
  color: var(--emer-ink);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .46);
}

.sheet::backdrop {
  background: rgba(5, 10, 10, .68);
  backdrop-filter: blur(6px);
}

.sheet-head {
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid var(--emer-border);
}

.sheet-head h3 {
  margin: 0;
  color: #fff;
}

.sheet-body {
  padding: 20px;
}

.close {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--emer-border);
  border-radius: var(--r);
  background: #2e3a37;
  color: var(--emer-ink);
  font-size: 1.4rem;
  line-height: 1;
}

.install-steps {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.install-steps li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: start;
  margin: 12px 0;
  color: #c7d5cf;
}

.install-steps li::before {
  counter-increment: step;
  content: counter(step);
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(51, 198, 193, .14);
  color: #dffffb;
  font-weight: 950;
}

.toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: 22px;
  max-width: calc(100% - 28px);
  padding: 13px 17px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--r);
  background: #2e3a37;
  color: #fff;
  font-weight: 850;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .34);
  opacity: 0;
  transform: translate(-50%, 100px);
  transition: transform .24s ease, opacity .24s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.footer-note {
  padding: 12px 0 0;
  color: #9aaaa4;
  font-size: .67rem;
  text-align: center;
}
.footer-note a {
  margin-left: 8px;
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.occurrence-dialog {
  width: min(640px, calc(100% - 20px));
  max-height: calc(100dvh - 20px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--emer-border);
  border-radius: var(--r);
  background: var(--emer-panel);
  color: var(--emer-ink);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .5);
}

.occurrence-dialog::backdrop {
  background: rgba(5, 10, 10, .68);
  backdrop-filter: blur(6px);
}

.occurrence-dialog-close {
  position: sticky;
  z-index: 5;
  top: 8px;
  float: right;
  width: 36px;
  height: 36px;
  margin: 8px 8px -44px 0;
  border: 1px solid var(--emer-border);
  border-radius: var(--r);
  background: #2e3a37;
  color: var(--emer-ink);
  font-size: 1.5rem;
  line-height: 1;
}

.occurrence-dialog .detail {
  padding: 18px 16px;
}

.occurrence-dialog .detail-title-row {
  padding-right: 40px;
}

html[data-theme="light"] {
  color-scheme: light;
  --navy: #182523;
  --bg: #f1f5f3;
  --card: #fff;
  --text: #182523;
  --muted: #566861;
  --line: #d6e0db;
  --green: #16865d;
  --blue: #1472a2;
  --cyan: #087e7b;
  --amber: #ad7118;
  --emer-panel: #fff;
  --emer-panel-2: #f5f8f6;
  --emer-panel-3: #e9f0ed;
  --emer-border: #d6e0db;
  --emer-ink: #182523;
  --emer-muted: #566861;
  --emer-cyan: #087e7b;
  --emer-green: #16865d;
  --emer-blue: #1472a2;
  --emer-amber: #ad7118;
  --emer-shadow: 0 10px 26px rgba(25, 48, 42, .08);
}

html[data-theme="light"] body {
  background: linear-gradient(180deg, #eaf1ee 0, #f4f7f5 360px, #f7f9f8 100%);
}

html[data-theme="light"] body::before {
  background:
    linear-gradient(90deg, rgba(31, 70, 57, .045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(31, 70, 57, .035) 1px, transparent 1px);
  background-size: 68px 68px;
}

html[data-theme="light"] button:focus-visible,
html[data-theme="light"] a:focus-visible,
html[data-theme="light"] input:focus-visible,
html[data-theme="light"] select:focus-visible,
html[data-theme="light"] summary:focus-visible {
  outline-color: rgba(8, 126, 123, .55);
}

html[data-theme="light"] .btn {
  background: #f4f7f5;
  color: var(--emer-ink);
}

html[data-theme="light"] .btn.primary {
  background: linear-gradient(135deg, #c42d28, #99231f);
  color: #fff;
}

html[data-theme="light"] .btn.blue {
  border-color: #b5d8d2;
  background: #e4f4f0;
  color: #096454;
}

html[data-theme="light"] .btn.quiet {
  border-color: #e5b8b3;
  background: #fdf0ee;
  color: #a12825;
}

html[data-theme="light"] .emer-header {
  background: #fff;
  box-shadow: 0 6px 24px rgba(25, 48, 42, .07);
}

html[data-theme="light"] .emer-brand-name {
  color: #ac2d28;
}

html[data-theme="light"] .header-action.btn {
  border-color: var(--emer-border);
  background: #f6f8f7;
  color: var(--emer-ink);
}

html[data-theme="light"] .header-action.btn:hover,
html[data-theme="light"] .header-action.btn:focus-visible {
  border-color: #a7bcb1;
  background: #eaf1ed;
}

html[data-theme="light"] .header-action.btn.primary {
  border-color: transparent;
  background: #ac2d28;
  color: #fff;
}

html[data-theme="light"] .header-action.btn.blue {
  border-color: #b5d8d2;
  background: #e4f4f0;
  color: #096454;
}

html[data-theme="light"] .connection-alert,
html[data-theme="light"] .notice {
  border-color: #eacb90;
  background: #fff7e8;
  color: #694615;
}

html[data-theme="light"] .metric {
  background: linear-gradient(180deg, #fff, #fafcfb);
}

html[data-theme="light"] .metric-label {
  color: #495e55;
}

html[data-theme="light"] .metric-value strong,
html[data-theme="light"] .metric strong {
  color: #182523;
}

html[data-theme="light"] .toolbar {
  border-color: #d6e0db;
  background: rgba(245, 249, 247, .94);
}

html[data-theme="light"] .state-switch {
  background: #fff;
}

html[data-theme="light"] .state-switch button[aria-pressed="true"] {
  background: #e9f2ee;
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] select option,
html[data-theme="light"] select optgroup {
  background-color: #fff;
  color: #182523;
}

html[data-theme="light"] input::placeholder {
  color: #65776f;
}

html[data-theme="light"] .panel-head {
  background: #f5f8f6;
}

html[data-theme="light"] .panel-head h3,
html[data-theme="light"] .detail h4,
html[data-theme="light"] .sheet-head h3,
html[data-theme="light"] .place strong,
html[data-theme="light"] .fact strong,
html[data-theme="light"] .unit strong,
html[data-theme="light"] .field-label,
html[data-theme="light"] .time,
html[data-theme="light"] .nature,
html[data-theme="light"] .occurrence .location strong,
html[data-theme="light"] .more-info dd {
  color: #182523;
}

html[data-theme="light"] .feed,
html[data-theme="light"] .detail {
  background: #fff;
}

html[data-theme="light"] .occurrence:hover,
html[data-theme="light"] .occurrence:focus-visible {
  background: #f2f7f4;
}

html[data-theme="light"] .occurrence.selected {
  background: linear-gradient(90deg, rgba(8, 126, 123, .12), transparent 65%), #f2f8f6;
}

html[data-theme="light"] .vehicle {
  border-color: #c4dfea;
  background: #eaf5fa;
  color: #135d83;
}

html[data-theme="light"] .status,
html[data-theme="light"] .status.closed {
  color: #50635b;
}

html[data-theme="light"] .status.active {
  color: #126c4c;
}

html[data-theme="light"] .arrow {
  color: #697b73;
}

html[data-theme="light"] .empty-action {
  border-color: #aad2cb;
  background: #e6f5f1;
  color: #096454;
}

html[data-theme="light"] .tag {
  background: #fde9e6;
  color: #a02925;
}

html[data-theme="light"] .duration-badge {
  background: #e6f4eb;
  color: #126c4c;
}

html[data-theme="light"] .place,
html[data-theme="light"] .fact,
html[data-theme="light"] .more-info {
  background: #f6f9f7;
}

html[data-theme="light"] .place svg {
  color: #b52e29;
}

html[data-theme="light"] .map-card,
html[data-theme="light"] .map-loading {
  background: #edf2ef;
}

html[data-theme="light"] .map-source {
  color: #425b4f;
}

html[data-theme="light"] .map-card a {
  background: #dceae3;
  color: #234336;
}

html[data-theme="light"] .map-loading {
  border-color: #a8bdb3;
}

html[data-theme="light"] .section-title {
  color: #52665c;
}

html[data-theme="light"] .section-title-count b {
  background: #e5eeea;
  color: #294438;
}

html[data-theme="light"] .avatar {
  border-color: #b5d8d2;
  background: #e2f0ec;
  color: #0d665a;
}

html[data-theme="light"] .info-chips > span {
  border-color: #d6e4dd;
  background: #edf4f0;
  color: #253d33;
}

html[data-theme="light"] .info-chips small {
  color: #566861;
}

html[data-theme="light"] .more-info summary {
  color: #263b32;
}

html[data-theme="light"] .background-note {
  border-color: #b5d8c4;
  background: #ecf7ef;
  color: #22563e;
}

html[data-theme="light"] .background-note span {
  color: #40674f;
}

html[data-theme="light"] .sheet,
html[data-theme="light"] .occurrence-dialog {
  box-shadow: 0 28px 80px rgba(18, 42, 32, .22);
}

html[data-theme="light"] .sheet::backdrop,
html[data-theme="light"] .occurrence-dialog::backdrop {
  background: rgba(17, 35, 29, .48);
}

html[data-theme="light"] .close,
html[data-theme="light"] .occurrence-dialog-close {
  background: #f1f5f3;
}

html[data-theme="light"] .install-steps li {
  color: #344b40;
}

html[data-theme="light"] .install-steps li::before {
  background: #e3f1ec;
  color: #0b675a;
}

html[data-theme="light"] .toast {
  background: #263b32;
  color: #fff;
}

html[data-theme="light"] .footer-note {
  color: #64766d;
}

@supports not (color: color-mix(in srgb, #fff 50%, transparent)) {
  .metric-dot {
    box-shadow: none;
  }

  .metric::after {
    opacity: .18;
    background: var(--accent);
  }

  .status::before {
    box-shadow: none;
  }
}

@media (max-width: 1220px) {
  .emer-header {
    grid-template-columns: auto minmax(130px, 1fr) auto auto;
  }

  .layout {
    grid-template-columns: minmax(0, 1.42fr) minmax(340px, .78fr);
  }

  .occurrence {
    grid-template-columns: 64px minmax(200px, 1.36fr) 136px 96px 18px;
  }

  .occurrence .location {
    display: none;
  }
}

@media (max-width: 980px) {
  .emer-header {
    grid-template-columns: auto minmax(120px, 1fr) auto auto;
    gap: 12px;
  }

  .header-connection span {
    display: none;
  }

  .header-action.btn {
    width: 42px;
    padding: 0;
  }

  .header-action.btn span {
    display: none;
  }

  .toolbar {
    position: static;
  }

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

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

  .detail-panel {
    display: none;
  }

  .occurrence {
    grid-template-columns: 64px minmax(190px, 1.2fr) minmax(120px, .8fr) 136px 96px 18px;
  }

  .occurrence .location {
    display: block;
  }
}

@media (max-width: 760px) {
  .emer-header {
    width: 100%;
    min-height: 64px;
    padding: 8px 10px;
    grid-template-columns: 38px minmax(0, 1fr) auto auto;
    gap: 9px;
  }

  .emer-header::before {
    left: 10px;
    width: 92px;
  }

  .emer-logo-card {
    width: 38px;
    height: 38px;
    padding: 0;
    justify-content: center;
  }

  .emer-brand-icon {
    width: 36px;
    height: 36px;
  }

  .emer-brand-name {
    display: none;
  }

  .corps-name {
    min-height: 36px;
    padding-left: 0;
    border-left: 0;
  }

  .corps-name h1 {
    overflow: visible;
    font-size: .78rem;
    line-height: 1.15;
    text-overflow: clip;
    white-space: normal;
  }

  .corps-name small {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    font-size: .63rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .desktop-subtitle {
    display: none;
  }

  #mobileSync {
    display: inline;
  }

  .header-status {
    min-height: 36px;
    gap: 7px;
  }

  .header-time {
    display: none;
  }

  .emer-clock {
    font-size: .94rem;
  }

  .header-time small {
    display: none;
  }

  .header-action.btn {
    width: 36px;
    min-height: 36px;
  }

  .header-actions {
    gap: 5px;
    padding-left: 9px;
  }

  .theme-toggle.btn {
    width: 36px;
  }

  .shell {
    padding: 10px 10px 22px;
  }

  .metrics {
    gap: 8px;
  }

  .metric {
    min-height: 69px;
    padding: 9px 11px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 3px;
  }

  .metric-value {
    order: -1;
    display: block;
  }

  .metric-value small {
    display: none;
  }

  .metric-label {
    font-size: .63rem;
    line-height: 1.18;
  }

  .metric-value strong,
  .metric strong {
    font-size: 1.46rem;
  }

  .metric-value small,
  .metric small {
    white-space: normal;
  }

  .toolbar {
    grid-template-columns: minmax(0, 1fr) 130px;
  }

  .search {
    grid-column: 1;
    grid-row: 1;
  }

  .state-switch {
    width: 100%;
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .toolbar select {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    padding: 0 7px;
    font-size: .72rem;
  }

  .state-switch button {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 5px;
  }

  .layout > .panel:first-child {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .layout > .panel:first-child .panel-head {
    min-height: 44px;
    padding: 0 3px;
    border: 0;
    background: transparent;
  }

  .feed {
    padding: 0;
    background: transparent;
  }

  html[data-theme="light"] .layout > .panel:first-child .feed {
    background: transparent;
  }

  .occurrence {
    min-height: 0;
    margin-bottom: 9px;
    padding: 12px 13px 11px 16px;
    grid-template-columns: minmax(0, 1fr) 18px auto;
    gap: 8px 6px;
    border: 1px solid var(--emer-border);
    border-radius: 8px;
    background: var(--emer-panel);
    box-shadow: var(--emer-shadow);
  }

  .occurrence:last-child {
    border-bottom: 1px solid var(--emer-border);
  }

  .occurrence::before {
    top: 13px;
    bottom: 13px;
    left: -1px;
    border-radius: 0 2px 2px 0;
  }

  .occurrence .location,
  .occurrence .vehicle-cell {
    display: none;
  }

  .occurrence-time {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: baseline;
    gap: 9px;
  }

  .occurrence-time .sub {
    margin: 0;
  }

  .occurrence-main {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .occurrence-main .sub {
    display: none;
  }

  .occurrence .state-cell {
    display: flex;
    align-items: center;
    gap: 5px;
    grid-column: 2 / -1;
    grid-row: 1;
    justify-self: end;
  }

  .occurrence .state-cell .status {
    gap: 6px;
    padding: 4px 7px;
    border: 1px solid var(--emer-border);
    border-radius: 5px;
    font-size: .66rem;
  }

  .occurrence .state-cell .status::before {
    display: block;
    width: 6px;
    height: 6px;
    box-shadow: none;
  }

  .occurrence .state-age {
    margin: 0;
    white-space: nowrap;
  }

  .mobile-place {
    display: block;
    grid-column: 1 / -1;
    grid-row: 3;
    overflow-wrap: anywhere;
    color: var(--emer-muted);
    font-size: .75rem;
    line-height: 1.35;
  }

  .mobile-meta {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    grid-column: 1 / 3;
    grid-row: 4;
  }

  .mobile-meta span {
    max-width: 100%;
    padding: 3px 6px;
    overflow: hidden;
    border: 1px solid var(--emer-border);
    border-radius: 5px;
    color: var(--emer-muted);
    font-size: .68rem;
    font-weight: 780;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-meta .mobile-vehicle {
    color: var(--emer-ink);
  }

  .occurrence .arrow {
    grid-column: 3;
    grid-row: 4;
    align-self: center;
  }

  .nature {
    font-size: .83rem;
    white-space: normal;
  }

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

  .map-card iframe {
    height: 222px;
  }

  .dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .occurrence-dialog {
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - env(safe-area-inset-top) - 12px);
    margin: auto auto 0;
    border-radius: 8px 8px 0 0;
  }

  .occurrence-dialog .detail {
    padding: 16px 14px calc(20px + env(safe-area-inset-bottom));
  }

  .occurrence-dialog .detail-title-row {
    padding-right: 34px;
  }
}

@media (max-width: 520px) {
  .emer-header {
    grid-template-columns: 38px minmax(0, 1fr) auto auto;
    gap: 7px;
  }

  .corps-name h1 {
    font-size: .75rem;
  }

  .header-status {
    gap: 6px;
  }

  .toolbar {
    grid-template-columns: minmax(0, 1fr) 130px;
  }

  .search {
    grid-column: 1;
  }

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

  .map-card iframe {
    height: 236px;
  }

  .sheet {
    align-self: end;
    width: 100%;
    max-width: 100%;
    max-height: 90vh;
    margin: auto auto 0;
    border-radius: 8px 8px 0 0;
  }

  .sheet-body {
    max-height: calc(90vh - 72px);
    overflow: auto;
  }

  .toast {
    width: calc(100% - 28px);
    text-align: center;
  }
}

.operational-band {
  position: relative;
  border-bottom: 3px solid #7e1e24;
  background: linear-gradient(112deg, #721b23, #ac1829 75%, #bf1730);
  color: #fff;
}

.operational-band::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, #f05252 0 32%, #f0b84b 32% 50%, #26aa8c 50% 72%, #329ed3 72%);
}

.operational-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 20px 20px;
}

.operational-kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
  color: #ffe8e7;
  font-size: .75rem;
  font-weight: 650;
}

.push-status {
  min-height: 28px;
  margin-left: auto;
  padding: 4px 9px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 6px;
  background: rgba(0, 0, 0, .14);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.push-status svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.push-status:hover,
.push-status:focus-visible {
  background: rgba(255, 255, 255, .16);
}

.push-status[data-status="subscribed"] {
  border-color: rgba(125, 240, 177, .65);
  background: rgba(14, 95, 65, .32);
  color: #d8ffe8;
}

.push-status[data-status="unconfigured"],
.push-status[data-status="error"],
.push-status[data-status="needs-install"],
.push-status[data-status="blocked"] {
  border-color: rgba(255, 211, 142, .55);
  color: #ffe7b7;
}

#disablePushBtn[hidden] {
  display: none;
}

.operational-live {
  min-height: 28px;
  padding: 3px 9px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 6px;
  background: rgba(0, 0, 0, .13);
  color: #fff;
  font-weight: 800;
}

.operational-live i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #64e6a0;
  box-shadow: 0 0 0 3px rgba(100, 230, 160, .15);
}

body[data-connection="offline"] .operational-live i,
body[data-connection="stale"] .operational-live i,
body[data-connection="local"] .operational-live i {
  background: #f4c14b;
  box-shadow: 0 0 0 3px rgba(244, 193, 75, .18);
}

.operational-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.operational-title > div {
  min-width: 0;
}

.operational-title h2 {
  margin: 0;
  font: 700 2.25rem/1.08 Inter, ui-sans-serif, system-ui, sans-serif;
}

.operational-title p {
  margin: 7px 0 0;
  color: #fff0ee;
  font-size: .82rem;
  font-weight: 600;
}

.operational-caption {
  padding-bottom: 3px;
  color: #ffd7d5;
  font-size: .68rem;
  font-weight: 800;
  white-space: nowrap;
}

.operational-band .metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 0;
}

.operational-band .metric {
  min-width: 0;
  min-height: 112px;
  padding: 13px 15px 12px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  border-color: rgba(255, 255, 255, .1);
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 12%, #20292a), #20292a 75%);
  box-shadow: none;
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.operational-band .metric:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 10px 22px rgba(35, 4, 8, .2);
}

.operational-band .metric[aria-pressed="true"] {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 38%, transparent);
}

.operational-band .metric::before {
  width: 4px;
}

.operational-band .metric::after {
  display: none;
}

.operational-band .metric svg {
  position: absolute;
  top: 13px;
  right: 13px;
  width: 21px;
  height: 21px;
  color: var(--accent);
}

.operational-band .metric strong {
  color: var(--accent);
  font: 700 2.25rem/1 Inter, ui-sans-serif, system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}

.operational-band .metric-label {
  margin-top: 6px;
  color: #c9d3d2;
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

html[data-theme="light"] .operational-band .metric {
  border-color: color-mix(in srgb, var(--accent) 24%, #fff);
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 15%, #fff), #fff 74%);
}

html[data-theme="light"] .operational-band .metric strong {
  color: var(--accent);
}

html[data-theme="light"] .operational-band .metric-label {
  color: #334850;
}

.activity-strip {
  min-width: 0;
  margin-bottom: 12px;
  padding: 9px 10px 9px 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--emer-border);
  border-left: 3px solid var(--emer-amber);
  border-radius: 6px;
  background: var(--emer-panel);
  color: var(--emer-ink);
  box-shadow: var(--emer-shadow);
}

.activity-strip[hidden] {
  display: none;
}

.activity-strip > strong {
  font-size: .76rem;
  white-space: nowrap;
}

.activity-items {
  min-width: 0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.activity-item {
  min-height: 30px;
  padding: 4px 8px;
  flex: 0 0 auto;
  border: 1px solid var(--emer-border);
  border-radius: 5px;
  background: var(--emer-panel-2);
  color: var(--emer-ink);
  font-size: .72rem;
  white-space: nowrap;
}

.activity-item strong {
  margin-left: 3px;
  color: var(--emer-amber);
}

.activity-item[data-kind="new"] strong { color: var(--emer-green); }
.activity-item[data-kind="status"] strong { color: var(--emer-red-bright); }
.activity-item:hover { border-color: var(--emer-amber); }

.activity-dismiss {
  width: 30px;
  height: 30px;
  border: 1px solid var(--emer-border);
  border-radius: 5px;
  background: var(--emer-panel-2);
  color: var(--emer-muted);
  font-size: 1.2rem;
  line-height: 1;
}

html[data-theme="light"] .activity-strip {
  background: #fffdf6;
  border-color: #e7d9b9;
  border-left-color: #c68a24;
}

html[data-theme="light"] .activity-item {
  background: #fff;
}

.shell {
  max-width: 1240px;
  padding: 18px 20px 32px;
}

.toolbar {
  top: 84px;
  gap: 10px;
  margin-bottom: 18px;
  padding: 8px;
  box-shadow: 0 8px 26px rgba(2, 12, 13, .09);
}

html[data-theme="light"] .toolbar {
  border-color: #cbdfe0;
  background: rgba(250, 253, 253, .96);
  box-shadow: 0 8px 26px rgba(20, 89, 100, .1);
}

html[data-theme="light"] .state-switch button[aria-pressed="true"] {
  background: #e0f4f0;
  color: #086c63;
  box-shadow: inset 0 -2px #149b88;
}

.state-switch button {
  font-size: .78rem;
}

html[data-theme="dark"] .state-switch button[aria-pressed="true"] {
  background: rgba(51, 198, 193, .16);
  color: #bff8ef;
  box-shadow: inset 0 -2px #33c6c1;
}

.occurrences-board {
  min-width: 0;
}

.board-head,
.feed-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.board-head {
  position: relative;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--emer-border);
}

.board-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 72px;
  height: 2px;
  background: var(--emer-red);
}

.board-head h2 {
  margin: 0;
  color: var(--emer-ink);
  font: 700 1.13rem/1.25 Inter, ui-sans-serif, system-ui, sans-serif;
}

.board-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sort-control {
  position: relative;
  display: block;
}

.sort-control svg {
  position: absolute;
  top: 9px;
  left: 10px;
  width: 16px;
  height: 16px;
  color: var(--emer-muted);
  pointer-events: none;
}

.sort-control select {
  width: 172px;
  min-height: 34px;
  padding: 0 25px 0 32px;
  font-size: .73rem;
  font-weight: 650;
}

.occurrences-board .feed {
  padding: 0;
  background: transparent;
}

html[data-theme="light"] .occurrences-board .feed {
  background: transparent;
}

.feed-group + .feed-group {
  margin-top: 28px;
}

.feed-group-head {
  min-height: 31px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--emer-border);
}

.feed-group-head h3 {
  margin: 0;
  color: var(--emer-ink);
  font: 700 .98rem/1.25 Inter, ui-sans-serif, system-ui, sans-serif;
}

.feed-group-head span {
  color: var(--emer-muted);
  font-size: .7rem;
  font-weight: 720;
}

.active-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
  gap: 12px;
}

.active-card {
  --kind-color: #6dccc1;
  position: relative;
  min-width: 0;
  min-height: 236px;
  padding: 15px 15px 12px 18px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border: 1px solid var(--emer-border);
  border-radius: 8px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--kind-color) 9%, var(--emer-panel)), var(--emer-panel) 68%);
  color: var(--emer-ink);
  box-shadow: var(--emer-shadow);
  text-align: left;
  transition: border-color .16s ease, transform .16s ease, background .16s ease;
}

.active-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 -1px;
  width: 4px;
  border-radius: 0 3px 3px 0;
  background: var(--kind-color);
}

.kind-health { --kind-color: #f09aa0; }
.kind-fire { --kind-color: #edc065; }
.kind-road { --kind-color: #82b8e8; }
.kind-rescue { --kind-color: #ad99e3; }
.kind-operations { --kind-color: #6dccc1; }

.active-card:hover,
.active-card:focus-visible,
.active-card.selected {
  border-color: var(--kind-color);
  background: var(--emer-panel-2);
  transform: translateY(-2px);
}

.active-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.active-card-top strong {
  font: 700 1.48rem/1 Inter, ui-sans-serif, system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
}

.active-card-status {
  padding: 4px 8px;
  border: 1px solid rgba(78, 213, 143, .35);
  border-radius: 6px;
  background: rgba(78, 213, 143, .12);
  color: #b9f1d4;
  font-size: .69rem;
  font-weight: 700;
  white-space: nowrap;
}

.active-card-status::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 6px;
  display: inline-block;
  border-radius: 50%;
  background: var(--emer-green);
  vertical-align: 1px;
}

.active-card-ref {
  display: block;
  margin: 5px 0 12px;
  color: var(--emer-muted);
  font-size: .71rem;
  font-weight: 500;
}

.active-card-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

.active-card-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--kind-color) 58%, transparent);
  border-radius: 7px;
  background: color-mix(in srgb, var(--kind-color) 20%, transparent);
  color: var(--kind-color);
}

.active-card-icon svg {
  width: 22px;
  height: 22px;
}

.active-card-type {
  color: var(--emer-ink);
  font: 700 .91rem/1.35 Inter, ui-sans-serif, system-ui, sans-serif;
  overflow-wrap: anywhere;
}

.active-card-place {
  min-width: 0;
  margin-top: 10px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--emer-muted);
  font-size: .77rem;
  font-weight: 550;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.active-card-place svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: var(--kind-color);
}

.active-card-footer {
  min-width: 0;
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  border-top: 1px solid var(--emer-border);
  color: var(--emer-muted);
  font-size: .69rem;
  font-weight: 600;
}

.active-card-counts,
.active-card-means {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.active-card-stat,
.active-card-vehicle {
  min-height: 28px;
  padding: 4px 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--emer-border);
  border-radius: 5px;
  background: var(--emer-panel-2);
}

.active-card-stat svg {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
}

.active-card-vehicle {
  max-width: 100%;
  border-color: color-mix(in srgb, var(--kind-color) 48%, var(--emer-border));
  background: color-mix(in srgb, var(--kind-color) 19%, var(--emer-panel));
  color: var(--kind-color);
  font: 700 .72rem/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
  overflow-wrap: anywhere;
}

.active-card-arrow {
  margin-left: auto;
  color: var(--emer-cyan);
  font-size: 1.3rem;
  line-height: 1;
}

html[data-theme="light"] .active-card-status {
  border-color: #9fdcbd;
  background: #e2f7eb;
  color: #0a704b;
}

html[data-theme="light"] .kind-health { --kind-color: #bc5463; }
html[data-theme="light"] .kind-fire { --kind-color: #a86c17; }
html[data-theme="light"] .kind-road { --kind-color: #2d74aa; }
html[data-theme="light"] .kind-rescue { --kind-color: #7258b1; }
html[data-theme="light"] .kind-operations { --kind-color: #238578; }

html[data-theme="light"] .active-card-icon {
  border-color: color-mix(in srgb, var(--kind-color) 48%, #fff);
  background: color-mix(in srgb, var(--kind-color) 17%, #fff);
}

html[data-theme="light"] .active-card {
  border-color: color-mix(in srgb, var(--kind-color) 30%, #fff);
  background: linear-gradient(135deg, color-mix(in srgb, var(--kind-color) 9%, #fff), #fff 64%);
  box-shadow: 0 10px 24px rgba(21, 62, 65, .11);
}

html[data-theme="light"] .active-card-stat {
  border-color: #cbdcdd;
  background: #f2f8f8;
}

html[data-theme="light"] .active-card-vehicle {
  border-color: color-mix(in srgb, var(--kind-color) 40%, #fff);
  background: color-mix(in srgb, var(--kind-color) 15%, #fff);
}

html[data-theme="light"] .active-card:hover,
html[data-theme="light"] .active-card:focus-visible,
html[data-theme="light"] .active-card.selected {
  background: color-mix(in srgb, var(--kind-color) 13%, #fff);
}

.closed-list {
  padding: 0 12px;
  overflow: hidden;
  border: 1px solid var(--emer-border);
  border-radius: 8px;
  background: var(--emer-panel);
}

.vehicle-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.vehicle-list .vehicle {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.closed-list .occurrence:last-child {
  border-bottom: 0;
}

.summary-dialog {
  width: min(640px, calc(100% - 24px));
  max-height: calc(100dvh - 32px);
  overflow: hidden;
}

.summary-body {
  max-height: calc(100dvh - 112px);
  padding: 0 20px 20px;
  overflow-y: auto;
}

.summary-group {
  padding-top: 17px;
}

.summary-group + .summary-group {
  margin-top: 16px;
  border-top: 1px solid var(--emer-border);
}

.summary-group-head {
  min-width: 0;
  margin-bottom: 7px;
  display: grid;
  gap: 2px;
}

.summary-group-head strong {
  color: var(--emer-ink);
  font-size: .84rem;
}

.summary-group-head span {
  color: var(--emer-muted);
  font-size: .72rem;
  line-height: 1.35;
}

.summary-row {
  width: 100%;
  min-height: 50px;
  padding: 9px 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-top: 1px solid var(--emer-border);
  background: transparent;
  color: var(--emer-ink);
  text-align: left;
}

.summary-row:hover,
.summary-row:focus-visible {
  background: var(--emer-panel-2);
}

.summary-row > span:first-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.summary-row strong {
  font-size: .8rem;
  overflow-wrap: anywhere;
}

.summary-row small {
  color: var(--emer-muted);
  font-size: .7rem;
  overflow-wrap: anywhere;
}

.summary-row > span:last-child {
  color: var(--emer-cyan);
  font-size: 1.25rem;
}

.summary-empty {
  margin: 0;
  padding: 32px 6px;
  color: var(--emer-muted);
  font-size: .84rem;
  text-align: center;
}

.occurrence-dialog {
  width: min(760px, calc(100% - 32px));
  max-height: calc(100dvh - 48px);
}

@media (max-width: 1100px) {
  .operational-inner,
  .shell {
    max-width: 100%;
  }
}

@media (max-width: 760px) {
  .operational-interval {
    display: none;
  }

  .push-status {
    font-size: .67rem;
  }

  .activity-strip {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
  }

  .activity-strip > strong {
    grid-column: 1;
    grid-row: 1;
  }

  .activity-items {
    grid-column: 1 / -1;
    grid-row: 2;
    flex-wrap: wrap;
    overflow: visible;
  }

  .activity-dismiss {
    grid-column: 2;
    grid-row: 1;
  }

  .board-head {
    flex-wrap: wrap;
  }

  .board-actions {
    width: 100%;
    justify-content: space-between;
  }

  .summary-dialog {
    width: 100%;
    max-width: 100%;
    max-height: 90dvh;
    margin: auto auto 0;
    border-radius: 8px 8px 0 0;
  }

  .summary-body {
    max-height: calc(90dvh - 80px);
    padding: 0 14px 18px;
  }

  .operational-inner {
    padding: 19px 12px 15px;
  }

  .operational-kicker {
    margin-bottom: 9px;
    font-size: .7rem;
  }

  .operational-title {
    margin-bottom: 12px;
  }

  .operational-title h2 {
    font-size: 1.8rem;
  }

  .operational-caption {
    display: none;
  }

  .operational-band .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .operational-band .metric {
    min-height: 83px;
    padding: 9px 11px;
  }

  .operational-band .metric svg {
    top: 9px;
    right: 9px;
    width: 16px;
    height: 16px;
  }

  .operational-band .metric strong {
    font-size: 1.9rem;
  }

  .operational-band .metric-label {
    margin-top: 2px;
    font-size: .7rem;
  }

  .board-head {
    margin-top: 0;
  }

  .active-grid {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .active-card {
    min-height: 222px;
    padding: 13px 13px 11px 17px;
  }

  .closed-list {
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .closed-list .occurrence:last-child {
    border-bottom: 1px solid var(--emer-border);
  }

  .occurrence-dialog {
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - env(safe-area-inset-top) - 12px);
    margin: auto auto 0;
  }
}

@media (max-width: 380px) {
  .corps-name h1 {
    font-size: .72rem;
  }

  .operational-title h2 {
    font-size: 1.55rem;
  }

  .operational-interval {
    font-size: .65rem;
  }
}

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