:root {
  color-scheme: light;
  --bg: #eef3f6;
  --surface: #ffffff;
  --surface-soft: #f7fafc;
  --ink: #111827;
  --muted: #66727f;
  --line: #d8e1e8;
  --sidebar: #0f1f2a;
  --sidebar-2: #153447;
  --brand: #0f6f8c;
  --brand-strong: #075269;
  --accent: #b7791f;
  --danger: #b42318;
  --warn: #b86b00;
  --ok: #157347;
  --info: #2563eb;
  --shadow-xs: 0 1px 1px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 8px 22px rgba(15, 23, 42, 0.07);
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #f9fbfd 0, #eef3f6 380px),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ui-icon,
.nav-icon svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

button,
.icon-text {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 14px;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
}

button:hover,
.icon-text:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
}

button.primary {
  background: linear-gradient(180deg, #1185a5, var(--brand));
  color: #fff;
  border-color: var(--brand);
}

button.primary:hover {
  background: var(--brand-strong);
  color: #fff;
}

button.danger {
  background: #fff5f3;
  color: var(--danger);
  border-color: rgba(180, 35, 24, 0.35);
}

a {
  color: var(--brand-strong);
}

.primary-link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 6px;
  border: 1px solid var(--brand);
  padding: 0 14px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

.icon-button {
  width: 42px;
  min-width: 42px;
  padding: 0;
  font-size: 18px;
}

.hidden {
  display: none !important;
}

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

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.topbar h1,
.topbar p,
h2,
h3,
h4 {
  margin: 0;
}

.topbar h1 {
  font-size: 23px;
  line-height: 1.15;
}

.topbar p {
  margin-top: 4px;
  color: var(--muted);
}

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

.dashboard-version-pill {
  border-color: rgba(15, 111, 140, 0.32);
  background: #e6f5f8;
  color: var(--brand-strong);
  font-weight: 800;
}

.alarm-bell {
  position: relative;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-color: rgba(180, 35, 24, 0.38);
  background: #fff4f2;
  color: var(--danger);
  box-shadow: 0 0 0 0 rgba(180, 35, 24, 0.42), var(--shadow-sm);
}

.alarm-bell:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.alarm-bell.is-ringing {
  animation: bell-pulse 1s ease-in-out infinite;
}

.alarm-bell.is-ringing .alarm-bell-icon {
  animation: bell-swing 0.72s ease-in-out infinite;
  transform-origin: 50% 8px;
}

.alarm-bell-icon {
  font-size: 22px;
  line-height: 1;
}

.alarm-bell-count {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 21px;
  height: 21px;
  display: inline-grid;
  place-items: center;
  border: 2px solid var(--surface);
  border-radius: 999px;
  padding: 0 5px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

@keyframes bell-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(180, 35, 24, 0.36), var(--shadow-sm);
  }

  50% {
    box-shadow: 0 0 0 9px rgba(180, 35, 24, 0), var(--shadow-sm);
  }
}

@keyframes bell-swing {
  0%,
  100% {
    transform: rotate(0deg);
  }

  20% {
    transform: rotate(14deg);
  }

  40% {
    transform: rotate(-12deg);
  }

  60% {
    transform: rotate(8deg);
  }

  80% {
    transform: rotate(-6deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .alarm-bell.is-ringing,
  .alarm-bell.is-ringing .alarm-bell-icon {
    animation: none;
  }
}

.status-pill,
.count-pill,
.status-badge,
.device-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 13px;
  white-space: nowrap;
}

.admin-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: calc(100vh - 76px);
}

.admin-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: calc(100vh - 76px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  color: #dbe8e5;
  background:
    linear-gradient(180deg, var(--sidebar) 0, var(--sidebar-2) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-title {
  display: grid;
  gap: 6px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.sidebar-title strong {
  font-size: 18px;
}

.nav-icon {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  margin-right: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.10);
  color: #cde7e4;
}

.admin-sidebar .eyebrow,
.admin-sidebar label {
  color: #a9bfba;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.side-nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  color: #eff8f5;
  box-shadow: none;
  font-weight: 750;
}

.side-nav-btn:hover,
.side-nav-btn.active {
  background: rgba(255, 255, 255, 0.96);
  border-color: #ffffff;
  color: var(--brand-strong);
}

.side-nav-btn.active .nav-icon,
.side-nav-btn:hover .nav-icon {
  background: rgba(14, 116, 144, 0.12);
  color: var(--brand-strong);
}

.apk-download-link {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(111, 125, 255, 0.42);
  border-radius: 10px;
  color: #ffffff;
  text-decoration: none;
  background: linear-gradient(135deg, rgba(69, 82, 210, 0.92), rgba(78, 55, 180, 0.92));
}

.apk-download-link:hover {
  border-color: rgba(255, 255, 255, 0.7);
  filter: brightness(1.08);
}

.apk-download-link span:last-child {
  display: grid;
  gap: 2px;
}

.apk-download-link strong {
  font-size: 13px;
}

.apk-download-link small {
  color: rgba(255, 255, 255, 0.75);
  font-size: 11px;
}

.apk-download-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 20px;
  font-weight: 900;
}

.sidebar-token {
  margin-top: auto;
}

.sidebar-token input {
  background: rgba(255, 255, 255, 0.95);
}

.admin-content {
  display: grid;
  gap: 18px;
  align-content: start;
  min-width: 0;
  padding: 24px;
}

.admin-section {
  display: none;
  gap: 18px;
}

.admin-section.active {
  display: grid;
}

.section-head,
.panel,
.event-strip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  background:
    linear-gradient(135deg, rgba(14, 116, 144, 0.06), rgba(183, 121, 31, 0.04)),
    var(--surface);
}

.section-head h2 {
  font-size: 24px;
  line-height: 1.2;
}

.panel {
  padding: 18px;
  overflow: hidden;
}

.panel-head,
.event-strip,
.action-row,
.toolbar-controls,
.search-row,
.form-actions,
.detail-actions,
.device-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toolbar-controls,
.search-row,
.form-actions,
.detail-actions,
.device-actions,
.action-row {
  flex-wrap: wrap;
}

.eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.kpi-card {
  min-height: 96px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.kpi-card::after {
  content: "";
  position: absolute;
  inset: auto 14px 0 14px;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

.kpi-card span {
  color: var(--muted);
  font-size: 13px;
}

.kpi-card strong {
  color: var(--ink);
  font-size: 32px;
  line-height: 1;
}

.kpi-card.urgent {
  border-color: rgba(180, 35, 24, 0.28);
  background: #fff8f6;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
}

input,
select {
  min-height: 42px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(15, 118, 110, 0.16);
  border-color: var(--brand);
}

.form-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.wide-field {
  grid-column: 1 / -1;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

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

.search-field {
  flex: 1 1 380px;
}

.filter-panel {
  padding: 14px 18px;
}

.users-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(380px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.client-search-panel {
  display: grid;
  gap: 14px;
}

.client-directory {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 12px;
}

.client-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(18, 39, 48, 0.05);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.client-card:hover {
  border-color: rgba(14, 116, 144, 0.38);
  box-shadow: 0 10px 24px rgba(18, 39, 48, 0.09);
  transform: translateY(-1px);
}

.client-card.has-sia-conflict {
  border-color: rgba(180, 35, 24, 0.48);
  background: linear-gradient(145deg, #fff8f6, #fff 55%);
  box-shadow: 0 8px 24px rgba(180, 35, 24, 0.10);
}

.directory-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  color: var(--muted);
  font-size: 13px;
}

.directory-footer:empty {
  display: none;
}

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

.client-card-main strong,
.client-card-main small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.client-card-main small {
  margin-top: 4px;
  color: var(--muted);
}

.client-card-stats {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.client-card-stats span {
  display: grid;
  gap: 2px;
  min-height: 52px;
  align-content: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.client-card-stats strong {
  font-size: 18px;
}

.client-card-stats small {
  color: var(--muted);
  font-size: 12px;
}

.client-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.client-open-button {
  min-width: 180px;
}

.client-delete-button {
  width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border-color: rgba(180, 35, 24, 0.24);
  color: var(--danger);
  background: #fff8f6;
}

.client-delete-button:hover {
  border-color: rgba(180, 35, 24, 0.50);
  background: rgba(180, 35, 24, 0.10);
}

.client-delete-button .ui-icon {
  width: 18px;
  height: 18px;
}

.users-table {
  display: grid;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}

.user-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.15fr) minmax(160px, 0.9fr) minmax(120px, 0.62fr) minmax(120px, 0.62fr) minmax(120px, 0.62fr);
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
}

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

.user-row:hover {
  background: #f0f8fb;
}

.user-row.selected {
  background: #e7f5f8;
  box-shadow: inset 4px 0 0 var(--brand);
}

.user-row strong,
.event-card strong {
  display: block;
  font-size: 15px;
}

.user-row small,
.event-card small,
.muted {
  color: var(--muted);
}

.status-active {
  color: var(--ok);
  border-color: rgba(21, 115, 71, 0.25);
  background: rgba(21, 115, 71, 0.08);
}

.status-created,
.status-operator-opened,
.status-live-started,
.status-in-progress {
  color: var(--info);
  border-color: rgba(37, 99, 235, 0.25);
  background: rgba(37, 99, 235, 0.08);
}

.status-suspended,
.status-pending,
.status-pending-activation,
.status-sia-sent {
  color: var(--warn);
  border-color: rgba(184, 107, 0, 0.25);
  background: rgba(184, 107, 0, 0.08);
}

.status-closed,
.status-sia-ack,
.status-safe,
.status-safe-return {
  color: var(--ok);
  border-color: rgba(21, 115, 71, 0.25);
  background: rgba(21, 115, 71, 0.08);
}

.status-escort-active {
  color: #be185d;
  border-color: rgba(219, 39, 119, 0.25);
  background: rgba(219, 39, 119, 0.08);
}

.status-deleted,
.status-revoked,
.status-failed {
  color: var(--danger);
  border-color: rgba(180, 35, 24, 0.25);
  background: rgba(180, 35, 24, 0.08);
}

.detail-panel {
  position: sticky;
  top: 18px;
  max-height: calc(100vh - 36px);
  overflow: auto;
  overscroll-behavior: contain;
}

.detail-block {
  display: grid;
  gap: 16px;
  margin-top: 14px;
}

.facts {
  display: grid;
  grid-template-columns: minmax(110px, 0.75fr) minmax(0, 1fr);
  gap: 8px 12px;
  margin: 14px 0 0;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.device-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.user-recordings,
.user-event-history,
.user-log-history {
  display: grid;
  gap: 10px;
}

.history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.history-row strong,
.history-row small,
.history-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.history-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.history-event-card {
  display: grid;
  gap: 9px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--info);
  border-radius: 9px;
  background: #fff;
}

.history-event-card.status-closed,
.history-event-card.status-sia-ack {
  border-left-color: var(--ok);
}

.history-event-card.status-failed {
  border-left-color: var(--danger);
}

.history-event-card.status-created,
.history-event-card.status-operator-opened,
.history-event-card.status-live-started,
.history-event-card.status-in-progress {
  border-left-color: var(--info);
}

.history-event-card.semantic-sos {
  border-left-color: #dc2626;
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.055), #fff 22%);
}

.history-event-card.semantic-help {
  border-left-color: #f59e0b;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.06), #fff 22%);
}

.history-event-card.semantic-escort-start {
  border-left-color: #db2777;
  background: linear-gradient(90deg, rgba(219, 39, 119, 0.055), #fff 22%);
}

.history-event-card.semantic-safe {
  border-left-color: #16a34a;
  background: linear-gradient(90deg, rgba(22, 163, 74, 0.055), #fff 22%);
}

.history-event-head,
.history-event-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

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

.history-event-symbol {
  width: 38px;
  height: 38px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: rgba(37, 99, 235, 0.09);
  color: var(--info);
  font-size: 11px;
  font-weight: 900;
}

.semantic-sos .history-event-symbol {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.11);
}

.semantic-help .history-event-symbol {
  color: #b45309;
  background: rgba(245, 158, 11, 0.13);
}

.semantic-escort-start .history-event-symbol {
  color: #be185d;
  background: rgba(219, 39, 119, 0.11);
}

.semantic-safe .history-event-symbol {
  color: #15803d;
  background: rgba(22, 163, 74, 0.11);
}

.history-event-badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.mobile-signal-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 8px;
  border: 1px solid rgba(22, 163, 74, 0.22);
  border-radius: 999px;
  color: #15803d;
  background: rgba(22, 163, 74, 0.08);
  font-size: 11px;
  font-weight: 800;
}

.mobile-signal-badge.status-escort-active {
  border-color: rgba(219, 39, 119, 0.24);
  color: #be185d;
  background: rgba(219, 39, 119, 0.09);
}

.history-event-head strong,
.history-event-head small {
  display: block;
}

.history-event-head small {
  margin-top: 3px;
  color: var(--muted);
}

.history-quick-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.history-quick-facts > span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px 10px;
  border-right: 1px solid var(--line);
}

.history-quick-facts > span:last-child {
  border-right: 0;
}

.history-quick-facts small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.history-quick-facts strong {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-fact-battery.has-value,
.history-fact-battery.is-critical {
  background: rgba(245, 158, 11, 0.07);
}

.history-fact-battery.has-value strong {
  color: #c56a00;
}

.history-fact-battery.is-critical {
  background: rgba(234, 88, 12, 0.11);
}

.history-fact-battery.is-critical strong {
  color: #c2410c;
}

.history-event-details {
  min-width: 0;
}

.history-event-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 0;
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.history-event-details summary::-webkit-details-marker {
  display: none;
}

.history-event-details summary::before {
  content: "+";
  width: 22px;
  height: 22px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 999px;
  background: rgba(14, 116, 144, 0.10);
}

.history-event-details[open] summary::before {
  content: "−";
}

.history-detail-hint {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.history-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.history-detail-grid h5 {
  margin: 0 0 8px;
  font-size: 13px;
}

.facts.compact {
  grid-template-columns: minmax(86px, 0.62fr) minmax(0, 1fr);
  margin-top: 0;
  font-size: 13px;
}

.history-mini-timeline {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-mini-timeline li {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 8px;
  padding: 0 0 9px;
  border-top: 0;
}

.timeline-dot {
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--info);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.30);
}

.timeline-proof .timeline-dot {
  background: #7c3aed;
  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.30);
}

.timeline-sia .timeline-dot {
  background: var(--warn);
  box-shadow: 0 0 0 1px rgba(184, 107, 0, 0.30);
}

.timeline-log .timeline-dot {
  background: #64748b;
  box-shadow: 0 0 0 1px rgba(100, 116, 139, 0.30);
}

.timeline-sos .timeline-dot {
  background: #dc2626;
  box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.34);
}

.timeline-help .timeline-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.38);
}

.timeline-escort-start .timeline-dot {
  background: #db2777;
  box-shadow: 0 0 0 1px rgba(219, 39, 119, 0.34);
}

.timeline-safe .timeline-dot,
.timeline-network-restored .timeline-dot {
  background: #16a34a;
  box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.34);
}

.timeline-battery .timeline-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.38);
}

.timeline-network-loss .timeline-dot,
.timeline-warning .timeline-dot {
  background: #c2410c;
  box-shadow: 0 0 0 1px rgba(194, 65, 12, 0.38);
}

.timeline-sos strong {
  color: #b91c1c;
}

.timeline-help strong {
  color: #b45309;
}

.timeline-escort-start strong {
  color: #be185d;
}

.timeline-safe strong,
.timeline-network-restored strong {
  color: #15803d;
}

.timeline-battery strong {
  color: #b45309;
}

.timeline-network-loss strong,
.timeline-warning strong {
  color: #9a3412;
}

.history-mini-timeline strong,
.history-mini-timeline time,
.history-mini-timeline span {
  display: block;
  overflow-wrap: anywhere;
}

.event-evidence-list {
  display: grid;
  gap: 8px;
}

.evidence-proof-card {
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px;
  border: 1px solid rgba(124, 58, 237, 0.18);
  border-radius: 9px;
  background: rgba(124, 58, 237, 0.04);
}

.evidence-player-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 7px;
  background:
    radial-gradient(circle at center, rgba(124, 58, 237, 0.22), transparent 42%),
    #07131e;
}

.evidence-player-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #07131e;
}

.evidence-player-load {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 42px;
  height: 42px;
  min-height: 0;
  padding: 0;
  transform: translate(-50%, -55%);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  color: #fff;
  background: rgba(124, 58, 237, 0.86);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.32);
}

.evidence-player-load:hover {
  background: #6d28d9;
}

.evidence-player-load .ui-icon {
  width: 19px;
  height: 19px;
  margin-left: 2px;
}

.evidence-player-state {
  position: absolute;
  right: 6px;
  bottom: 5px;
  left: 6px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.88);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidence-player-shell.is-unavailable {
  background: #334155;
}

.evidence-proof-meta {
  min-width: 0;
}

.evidence-proof-meta strong,
.evidence-proof-meta small {
  display: block;
  overflow-wrap: anywhere;
}

.evidence-proof-meta small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.evidence-download-icon {
  width: 38px;
  height: 38px;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border-color: rgba(124, 58, 237, 0.24);
  color: #6d28d9;
  background: #fff;
}

.evidence-download-icon .ui-icon {
  width: 18px;
  height: 18px;
}

.history-limit-note,
.history-footer {
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.history-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.history-footer:empty {
  display: none;
}

.history-scroll-region {
  max-height: 660px;
  overflow: auto;
  padding-right: 4px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.detail-section-head {
  display: grid;
  gap: 2px;
}

.detail-section-head h4,
.detail-section-head small {
  margin: 0;
}

.detail-section-head small,
.section-description {
  color: var(--muted);
  font-size: 12px;
}

.history-mini-timeline time,
.history-mini-timeline span {
  color: var(--muted);
  font-size: 13px;
}

.qr-result {
  display: grid;
  gap: 12px;
  padding: 20px;
}

.activation-qr-dialog {
  width: min(620px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 28px 80px rgba(7, 24, 32, 0.28);
}

.activation-qr-dialog::backdrop {
  background: rgba(7, 20, 30, 0.68);
  backdrop-filter: blur(3px);
}

.dialog-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.dialog-head h3 {
  margin: 4px 0 0;
}

.qr-code svg {
  width: min(260px, 100%);
  height: auto;
  display: block;
  background: #fff;
}

.code-block {
  overflow: auto;
  max-height: 220px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
}

.user-editor {
  border-color: rgba(15, 118, 110, 0.28);
  box-shadow: var(--shadow);
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.75fr) minmax(520px, 1.5fr);
  grid-template-areas:
    "admin sia"
    "escort escort";
  gap: 16px;
  align-items: start;
}

.settings-card {
  display: grid;
  gap: 16px;
}

.admin-token-card {
  grid-area: admin;
}

.sia-settings-card {
  grid-area: sia;
}

.escort-settings-card {
  grid-area: escort;
}

.settings-card-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.settings-card-heading h3,
.settings-card-heading p {
  margin: 0;
}

.escort-config-module {
  display: grid;
  gap: 14px;
}

.config-fieldset {
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.config-fieldset legend {
  padding: 0 8px;
  color: var(--brand-strong);
  font-weight: 800;
}

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

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

.settings-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.14), rgba(245, 158, 11, 0.20));
  color: var(--brand-strong);
  font-size: 24px;
}

.settings-icon .ui-icon {
  width: 24px;
  height: 24px;
}

.sia-module {
  display: grid;
  gap: 14px;
}

.sia-status-row,
.sia-tools {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.sia-status-row .check-line {
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.sia-grid {
  margin-top: 0;
}

.sia-grid textarea {
  min-height: 150px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}

.sia-concordance {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.sia-concordance h4 {
  margin: 0 0 4px;
}

.sia-table-wrap {
  max-height: 390px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.sia-concordance-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.sia-concordance-table th,
.sia-concordance-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.sia-concordance-table th {
  position: sticky;
  top: 0;
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
  z-index: 1;
}

.sia-concordance-table td:first-child,
.sia-concordance-table td:nth-child(2) {
  font-family: Consolas, "Courier New", monospace;
  font-weight: 800;
}

.sia-video-config-table input[type="text"],
.sia-video-config-table input:not([type]) {
  width: 100%;
}

.sia-video-config-table .sia-video-code {
  width: 86px;
  font-family: Consolas, "Courier New", monospace;
  font-weight: 800;
}

.sia-video-config-table .compact-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  margin: 0;
}

.activity-feed {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
}

.activity-feed li {
  display: grid;
  grid-template-columns: 164px minmax(0, 1fr) 190px;
  gap: 14px;
  align-items: start;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.activity-feed li:last-child {
  border-bottom: 0;
}

.monitoring-grid {
  display: grid;
  gap: 12px;
}

.monitoring-map-panel {
  margin-bottom: 16px;
  overflow: hidden;
}

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

.admin-live-map {
  width: 100%;
  height: 430px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #dce8e5;
  overflow: hidden;
}

.admin-live-map-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #dce8e5;
}

.event-card {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 0.75fr) minmax(150px, 0.75fr) auto;
  gap: 12px;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.event-card:hover {
  border-color: rgba(15, 118, 110, 0.35);
  background: #ffffff;
}

.event-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.event-purge-button {
  white-space: nowrap;
  font-weight: 750;
}

.empty {
  color: var(--muted);
  padding: 18px 0;
}

.layout {
  width: min(1400px, 100%);
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.live-dashboard {
  width: min(1580px, 100%);
  margin: 0 auto;
  padding: 22px;
  display: grid;
  gap: 16px;
}

.client-dossier {
  width: min(1600px, 100%);
  margin: 0 auto;
  padding: 22px;
  display: grid;
  gap: 16px;
}

.dossier-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(14, 116, 144, 0.08), rgba(217, 119, 6, 0.08)),
    var(--surface);
  box-shadow: var(--shadow-sm);
}

.dossier-sia-editor {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(220px, 360px) auto auto;
  gap: 10px;
  align-items: end;
  padding-top: 14px;
  border-top: 1px solid rgba(14, 116, 144, 0.16);
}

.dossier-sia-editor button {
  min-height: 42px;
}

.dossier-user-search {
  margin: 12px 0;
}

.dossier-hero h2 {
  margin-top: 4px;
  font-size: 30px;
  line-height: 1.15;
}

.dossier-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.dossier-token {
  min-width: min(320px, 100%);
}

.dossier-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.62fr) minmax(0, 1.55fr);
  gap: 16px;
  align-items: start;
}

.dossier-side {
  position: sticky;
  top: 18px;
}

.dossier-main,
.dossier-sites,
.dossier-events {
  display: grid;
  gap: 12px;
}

.dossier-site {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.dossier-site h4,
.dossier-site small {
  display: block;
}

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

.dossier-user-list {
  display: grid;
  gap: 8px;
}

.dossier-user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.dossier-user-row strong,
.dossier-user-row small {
  display: block;
  overflow-wrap: anywhere;
}

.dossier-user-row small {
  margin-top: 3px;
  color: var(--muted);
}

.dossier-event-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.live-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 20px;
  border: 1px solid rgba(180, 35, 24, 0.24);
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(180, 35, 24, 0.10), rgba(255, 255, 255, 0) 48%),
    var(--surface);
  box-shadow: var(--shadow);
}

.live-hero h2 {
  margin-top: 4px;
  font-size: 28px;
  line-height: 1.15;
}

.live-meta,
.live-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.live-meta {
  margin-top: 12px;
  color: var(--muted);
}

.live-actions {
  justify-content: flex-end;
  max-width: 650px;
}

.live-actions button {
  min-height: 44px;
  font-weight: 750;
}

.rescue-dialog {
  width: min(860px, calc(100% - 32px));
  max-height: min(760px, calc(100vh - 32px));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(7, 24, 32, 0.28);
}

.rescue-dialog::backdrop {
  background: rgba(7, 20, 30, 0.68);
  backdrop-filter: blur(3px);
}

.rescue-dialog-head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.rescue-dialog-head h3,
.rescue-dialog-head p {
  margin: 0;
}

.rescue-dialog-head p {
  margin-top: 4px;
  color: var(--muted);
}

.emergency-number-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 20px 0;
}

.emergency-number-card {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid rgba(180, 35, 24, 0.22);
  border-radius: 9px;
  background: #fff8f6;
}

.emergency-number-card strong {
  color: var(--danger);
  font-size: 24px;
}

.emergency-number-card small {
  color: var(--muted);
}

.rescue-loading {
  margin: 16px 20px 0;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
}

.nearby-services-list {
  display: grid;
  gap: 8px;
  padding: 16px 20px 20px;
}

.nearby-service-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.nearby-service-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: rgba(37, 99, 235, 0.10);
  color: var(--info);
  font-weight: 900;
}

.nearby-service-card.is-fire .nearby-service-icon {
  background: rgba(180, 35, 24, 0.10);
  color: var(--danger);
}

.nearby-service-card strong,
.nearby-service-card small {
  display: block;
}

.nearby-service-card small {
  margin-top: 3px;
  color: var(--muted);
}

.nearby-service-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.live-close-warning {
  padding: 12px 14px;
  border: 1px solid rgba(180, 35, 24, 0.26);
  border-radius: 8px;
  background: #fff8f6;
  color: var(--danger);
  font-weight: 700;
}

.live-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.live-kpi {
  display: grid;
  gap: 8px;
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.live-kpi span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.live-kpi strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 22px;
  line-height: 1.1;
}

.live-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(0, 1.55fr);
  gap: 16px;
  align-items: start;
}

.live-side,
.live-main {
  display: grid;
  gap: 16px;
}

.live-main {
  grid-template-columns: minmax(0, 1.06fr) minmax(420px, 0.94fr);
}

.live-card,
.live-media,
.live-map,
.live-history {
  box-shadow: var(--shadow-sm);
}

.live-media .media-stage,
.live-map .map-canvas {
  height: 430px;
}

.live-history {
  grid-column: 1 / -1;
}

.wide {
  grid-column: 1 / -1;
}

.map-canvas {
  position: relative;
  height: 280px;
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  isolation: isolate;
  contain: layout paint;
  background: #dfe8e4;
}

.target-dot {
  display: none;
}

.gps-map {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  z-index: 1;
  opacity: 0;
  background: #dfe8e4;
}

.gps-map-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #dfe8e4;
}

.gps-map.is-ready {
  opacity: 1;
}

.gps-map-empty {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.09) 1px, transparent 1px),
    linear-gradient(0deg, rgba(15, 118, 110, 0.09) 1px, transparent 1px),
    #eef7f5;
  background-size: 32px 32px;
}

.gps-map-empty.hidden {
  display: none;
}

.media-stage {
  position: relative;
  height: 280px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #071015;
}

.media-stage video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #071015;
}

.remote-audio {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.media-placeholder {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  background: #15211f;
  color: #dce6e3;
  text-align: center;
}

.media-stage.has-stream .media-placeholder {
  display: none;
}

.media-toolbar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  padding: 10px;
  border-radius: 10px;
  background: rgba(7, 16, 21, 0.72);
  backdrop-filter: blur(10px);
}

.media-toolbar button {
  min-height: 36px;
}

.media-toolbar .media-icon-btn {
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-color: rgba(220, 230, 227, 0.28);
  background: rgba(255, 255, 255, 0.92);
  color: #172026;
}

.media-toolbar .media-icon-btn svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.media-toolbar .media-icon-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.8);
  background: #fff;
  color: var(--brand-strong);
}

.media-toolbar .media-icon-btn.primary {
  background: linear-gradient(180deg, #18a7c7, var(--brand));
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}

.media-toolbar .media-icon-btn.primary:hover {
  background: var(--brand-strong);
  color: #fff;
}

.media-output-select {
  width: 132px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 8px;
  font-weight: 700;
}

.media-output-select:disabled {
  color: var(--muted);
  background: var(--surface-soft);
}

.media-toolbar .media-icon-btn .icon-audio-off {
  display: none;
}

.media-toolbar .media-icon-btn .icon-mic-off {
  display: none;
}

.media-toolbar .media-icon-btn.is-audio-blocked {
  color: var(--warn);
}

.media-toolbar .media-icon-btn.is-audio-blocked .icon-audio-on {
  display: none;
}

.media-toolbar .media-icon-btn.is-audio-blocked .icon-audio-off {
  display: block;
}

.media-toolbar .media-icon-btn.is-muted {
  color: var(--muted);
}

.media-toolbar .media-icon-btn.is-muted .icon-mic-on {
  display: none;
}

.media-toolbar .media-icon-btn.is-muted .icon-mic-off {
  display: block;
}

.media-toolbar .media-icon-btn.is-speaking {
  color: var(--ok);
  border-color: rgba(21, 115, 71, 0.35);
}

.recording-strip {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.recording-strip span,
.recording-strip strong {
  display: block;
}

.recording-strip strong {
  margin-top: 2px;
}

.interaction-strip {
  min-height: 62px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.interaction-strip span,
.interaction-strip strong,
.interaction-strip small {
  display: block;
}

.interaction-strip span,
.interaction-strip small {
  color: var(--muted);
}

.interaction-strip strong {
  margin-top: 2px;
  font-size: 16px;
}

.interaction-strip button {
  min-height: 40px;
  font-weight: 800;
  white-space: nowrap;
}

.can-speak-status.is-ok {
  color: var(--ok);
}

.can-speak-status.is-danger {
  color: var(--danger);
}

.can-speak-status.is-pending {
  color: var(--ink);
}

.live-chat-panel {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(14, 116, 144, 0.24);
  border-radius: 8px;
  background: #f8fbfc;
}

.live-chat-head span,
.live-chat-head strong {
  display: block;
}

.live-chat-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.live-chat-head strong {
  margin-top: 2px;
}

.live-chat-messages {
  display: grid;
  gap: 8px;
  max-height: 210px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.live-chat-messages.empty {
  color: var(--muted);
  font-size: 14px;
}

.live-chat-message {
  display: grid;
  gap: 3px;
  max-width: 84%;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.live-chat-message.is-operator {
  justify-self: end;
  background: #e8f4f8;
}

.live-chat-message.is-mobile {
  justify-self: start;
  background: #fff4ec;
}

.live-chat-message strong,
.live-chat-message span,
.live-chat-message small {
  overflow-wrap: anywhere;
}

.live-chat-message small {
  color: var(--muted);
  font-size: 12px;
}

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

.live-chat-form input {
  min-height: 40px;
}

.live-chat-form button {
  min-height: 40px;
  font-weight: 800;
}

.evidence-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.evidence-list.empty {
  color: var(--muted);
  font-size: 14px;
}

.camera-symbol {
  width: 70px;
  height: 44px;
  border: 3px solid #dce6e3;
  border-radius: 8px;
  position: relative;
}

.camera-symbol::after {
  content: "";
  position: absolute;
  right: -24px;
  top: 9px;
  border-left: 24px solid #dce6e3;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
}

.comment-form {
  display: flex;
  gap: 8px;
  min-width: min(460px, 100%);
}

.timeline {
  margin: 16px 0 0;
  padding-left: 22px;
}

.timeline li {
  margin: 0 0 12px;
}

.timeline time {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1100px) {
  .settings-grid {
    grid-template-areas:
      "admin"
      "sia"
      "escort";
  }

  .dossier-sia-editor {
    grid-template-columns: 1fr;
  }

  .kpi-strip,
  .live-kpis,
  .live-hero,
  .dossier-hero,
  .dossier-layout,
  .live-layout,
  .live-main,
  .users-workspace,
  .event-card,
  .settings-grid,
  .settings-card-heading,
  .escort-config-grid,
  .escort-score-grid,
  .sia-status-row,
  .sia-tools,
  .activity-feed li {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
  }

  .dossier-side {
    position: static;
  }

  .history-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .admin-shell,
  .layout,
  .client-dossier,
  .live-dashboard {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    min-height: auto;
  }

  .admin-content,
  .layout,
  .client-dossier,
  .live-dashboard {
    padding: 16px;
  }

  .section-head,
  .panel-head,
  .topbar,
  .event-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .form-grid,
  .user-row,
  .client-card,
  .client-card-stats,
  .dossier-user-row,
  .history-row,
  .interaction-strip {
    grid-template-columns: 1fr;
  }

  .history-quick-facts,
  .client-card-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-card-actions {
    justify-content: stretch;
  }

  .client-open-button {
    flex: 1 1 auto;
    min-width: 0;
  }

  .history-quick-facts > span:nth-child(2) {
    border-right: 0;
  }

  .history-quick-facts > span:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

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

  .evidence-player-shell {
    grid-column: 1 / -1;
    max-width: 320px;
  }

  .history-footer,
  .history-event-details summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .emergency-number-grid,
  .nearby-service-card {
    grid-template-columns: 1fr;
  }

  .nearby-service-actions {
    justify-content: flex-start;
  }

  .toolbar-controls,
  .search-row,
  .comment-form {
    width: 100%;
  }

  .panel,
  .wide {
    grid-column: 1;
  }

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

  .interaction-strip button {
    width: 100%;
  }

  .live-media .media-stage,
  .live-map .map-canvas,
  .admin-live-map {
    height: 280px;
  }
}
