:root {
  color-scheme: light;
  --bg: #eef2f5;
  --surface: #ffffff;
  --surface-soft: #f7f9fb;
  --ink: #17212b;
  --muted: #657386;
  --line: #d8e0e8;
  --primary: #0b5cab;
  --primary-dark: #07467f;
  --ok: #197955;
  --warn: #a65c00;
  --danger: #b42318;
  --shadow: 0 14px 40px rgba(18, 32, 46, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

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

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

button:hover {
  border-color: #9eacba;
}

button.primary,
button.danger {
  color: #fff;
  border-color: transparent;
}

button.primary {
  background: var(--primary);
}

button.primary:hover {
  background: var(--primary-dark);
}

button.danger {
  background: var(--danger);
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.predictive-3d-btn.trajectory-available {
  border-color: transparent;
  background: #178447;
  color: #fff;
}

.predictive-3d-btn.trajectory-available:hover {
  background: #106b39;
}

.predictive-3d-btn.trajectory-unavailable {
  border-color: transparent;
  background: var(--danger);
  color: #fff;
}

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

textarea {
  resize: vertical;
}

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

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 22px;
  background: #101923;
  color: #eef5fb;
}

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

.brand-mark {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 6px;
  object-fit: contain;
}

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

.brand h1 {
  font-size: 20px;
  line-height: 1.1;
}

.brand p {
  color: #aebcca;
  font-size: 13px;
  line-height: 1.25;
  max-width: 190px;
  overflow-wrap: anywhere;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  border-color: transparent;
  background: transparent;
  color: #cbd5df;
}

.nav-item.active,
.nav-item:hover {
  background: #223142;
  color: #fff;
}

.connection-panel {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.connection-panel label {
  color: #cbd5df;
  font-size: 13px;
}

.auth-grid,
.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.button-row.compact {
  display: flex;
  flex-wrap: wrap;
}

.compact-select {
  width: auto;
  min-width: 160px;
}

.status-pill {
  min-height: 32px;
  border-radius: 999px;
  padding: 7px 10px;
  background: #26394d;
  color: #d8e6f2;
  font-size: 13px;
  text-align: center;
}

.status-pill.ok {
  background: #155c43;
}

.status-pill.error {
  background: #8f1d15;
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.topbar-heading {
  display: flex;
  align-items: center;
  flex: 1 1 300px;
  gap: 18px;
  min-width: 0;
}

.topbar-logo {
  display: block;
  flex: 0 1 210px;
  width: min(210px, 20vw);
  height: 68px;
  object-fit: contain;
  object-position: left center;
}

.report-cover-logo {
  display: block;
  width: 270px;
  max-width: 45vw;
  height: auto;
  margin-bottom: 18px;
}

.eyebrow {
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.topbar h2 {
  font-size: 28px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.topbar-actions {
  display: flex;
  align-items: center;
  flex: 1 1 520px;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  min-width: min(100%, 520px);
}

.topbar-actions > * {
  flex: 0 0 auto;
  width: auto;
}

.topbar-actions select {
  flex: 0 0 auto;
  width: auto;
  min-width: 150px;
}

.topbar-actions #refreshRate {
  width: 78px;
  min-width: 78px;
}

.topbar-actions .map-source {
  width: 195px;
  min-width: 170px;
}

.topbar-actions .unit-select {
  width: 160px;
  min-width: 132px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  white-space: nowrap;
}

.toggle input {
  width: auto;
  min-height: auto;
}

.toggle.inline {
  color: var(--ink);
}

.proxy-toggle {
  color: #cbd5df;
  font-size: 13px;
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 18px;
}

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

.metric,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  display: grid;
  gap: 6px;
  padding: 18px;
}

.metric span,
.empty-state {
  color: var(--muted);
}

.metric strong {
  font-size: 30px;
  line-height: 1;
}

.content-grid {
  display: grid;
  gap: 18px;
}

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

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

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

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 9px;
  background: #e3f2eb;
  color: var(--ok);
  font-size: 12px;
  font-weight: 700;
}

.badge.success {
  background: #e3f2eb;
  color: var(--ok);
}

.badge.warn {
  background: #fff3df;
  color: var(--warn);
}

.badge.danger {
  background: #fde8e5;
  color: var(--danger);
}

.badge.muted {
  background: #edf1f5;
  color: var(--muted);
}

.device-list,
.sensor-stack {
  display: grid;
  gap: 10px;
}

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

.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-weight: 800;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.filters,
.form-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

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

.raw-form {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
}

.raw-form textarea,
.raw-form button {
  grid-column: 1 / -1;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 800;
}

.json-box {
  overflow: auto;
  max-height: 360px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e1721;
  color: #d7e4ef;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.download-grid,
.button-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

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

.report-controls label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.report-controls input {
  width: auto;
  min-height: auto;
}


.admin-tabs,
.predictive-tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(18, 32, 46, 0.08);
  backdrop-filter: blur(8px);
}

.admin-tab,
.predictive-tab {
  min-height: 34px;
  padding: 0 13px;
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.admin-tab.active,
.admin-tab[aria-selected="true"],
.predictive-tab.active,
.predictive-tab[aria-selected="true"] {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.admin-tab-panels,
.predictive-tab-panels {
  display: grid;
  gap: 18px;
}

.admin-tab-panel,
.predictive-tab-panel {
  display: none;
}

.admin-tab-panel.active,
.predictive-tab-panel.active {
  display: grid;
  gap: 18px;
}

.admin-connection-tab .connection-panel {
  width: min(100%, 560px);
  margin-top: 0;
  padding: 22px;
  border: 1px solid #243548;
  border-radius: 8px;
  background: #101923;
  color: #eef5fb;
}

.admin-connection-tab .connection-panel label {
  color: #cbd5df;
}

.admin-connection-tab .status-pill {
  margin-top: 2px;
}

.server-status-panel .metric strong {
  font-size: 22px;
  line-height: 1.1;
}

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

.server-readiness-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.readiness-item {
  min-height: 76px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

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

.readiness-item strong {
  font-size: 12px;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--muted);
}

.readiness-item span {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.3;
  color: var(--ink);
}

.readiness-item.ready {
  border-left-color: var(--ok);
  background: #f5fbf7;
}

.readiness-item.attention {
  border-left-color: var(--warn);
  background: #fffaf2;
}

.readiness-item.pending {
  border-left-color: #9aa8b5;
  background: #f7f9fc;
}

.server-ops-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.server-ops-summary article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}

.server-ops-summary span,
.server-ops-summary em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  font-style: normal;
}

.server-ops-summary strong {
  display: block;
  margin: 4px 0 3px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.admin-guided-setup-panel {
  margin-top: 16px;
}

.setup-wizard-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.setup-wizard-step {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 86px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.setup-wizard-step.complete {
  border-left-color: var(--ok);
  background: #f5fbf7;
}

.setup-wizard-step.attention {
  border-left-color: var(--warn);
  background: #fffaf2;
}

.setup-step-index {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e8edf3;
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
}

.setup-wizard-step.complete .setup-step-index {
  background: #dff3e6;
  color: #146c43;
}

.setup-wizard-step.attention .setup-step-index {
  background: #fff1cf;
  color: #8a5500;
}

.setup-step-body {
  min-width: 0;
}

.setup-step-body strong,
.setup-step-body span {
  display: block;
}

.setup-step-body strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
}

.setup-step-body span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.status-ok {
  color: #146c43;
}

.status-warn {
  color: #a15c00;
}

.server-log-box {
  min-height: 420px;
  white-space: pre-wrap;
}

.server-backup-panel {
  margin-top: 16px;
}

.server-data-panel {
  margin-top: 16px;
}

.server-clients-panel {
  margin-top: 16px;
}

.server-retention-panel {
  margin-top: 16px;
}

.client-registration-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 10px;
}

.server-backup-table td {
  vertical-align: top;
}

.server-data-table td {
  vertical-align: top;
}

.server-clients-table td {
  vertical-align: top;
}

.server-sync-head {
  margin-top: 18px;
}

.server-sync-table td {
  vertical-align: top;
}

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

.server-retention-table td {
  vertical-align: top;
}

.server-backup-table td:nth-child(1),
.server-backup-table td:nth-child(4),
.server-data-table td:nth-child(1),
.server-data-table td:nth-child(4),
.server-clients-table td:nth-child(1),
.server-sync-table td:nth-child(1),
.server-sync-table td:nth-child(4),
.server-sync-table td:nth-child(5),
.server-retention-table td:nth-child(2),
.server-retention-table td:nth-child(5) {
  max-width: 280px;
  overflow-wrap: anywhere;
}

.server-clients-table code,
#serverClientTokenBox code {
  overflow-wrap: anywhere;
}

.server-restore-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.server-restore-row input[type="file"] {
  max-width: 360px;
}


.report-tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(18, 32, 46, 0.08);
  backdrop-filter: blur(8px);
}

.report-tab {
  min-height: 34px;
  padding: 0 13px;
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.report-tab.active,
.report-tab[aria-selected="true"] {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.report-tab-panels {
  display: grid;
  gap: 18px;
}

.report-tab-panel {
  display: none;
}

.report-tab-panel.active {
  display: grid;
  gap: 18px;
}

.report-tab-panel .content-grid {
  display: grid;
  gap: 18px;
}

.report-tab-panel[data-report-tab-panel="builder"] {
  grid-template-columns: minmax(0, 1fr);
}

.report-output {
  display: grid;
  gap: 18px;
}

.report-cover {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.report-cover-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.report-cover h3 {
  margin-top: 4px;
  font-size: 24px;
}

.report-cover p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.osm-map {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 560px;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #dfe8ec;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.report-map-panel,
.report-combinations-panel {
  grid-column: 1 / -1;
}

.report-map-panel .osm-map {
  min-height: 680px;
  aspect-ratio: 16 / 8;
}

.osm-map.dragging,
.map-product.dragging {
  cursor: grabbing;
}

.osm-map:fullscreen,
.trajectory-map:fullscreen,
.map-product:fullscreen {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  aspect-ratio: auto;
  border-radius: 0;
  border: 0;
}

.map-tiles,
.heat-canvas,
.map-vectors,
.map-markers {
  position: absolute;
  inset: 0;
}

.heat-canvas {
  width: 100%;
  height: 100%;
  pointer-events: none;
  mix-blend-mode: multiply;
}

.map-vectors {
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.map-tiles img {
  position: absolute;
  width: 256px;
  height: 256px;
}

.map-marker {
  position: absolute;
  transform: translate(-50%, -100%);
  min-width: 24px;
  min-height: 24px;
  border: 2px solid #fff;
  border-radius: 999px 999px 999px 2px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.28);
  rotate: -45deg;
  cursor: pointer;
}

.map-marker span {
  display: none;
}

.map-marker.selected {
  outline: 3px solid rgba(11, 92, 171, 0.35);
  outline-offset: 4px;
}

.map-marker.sensor {
  background: var(--primary);
}

.map-marker.drone {
  background: var(--danger);
}

.map-marker.other {
  background: var(--primary);
}

.map-marker.home {
  background: #6f42c1;
}

.map-marker.nearest {
  background: #a65c00;
}

.map-marker.rc {
  background: #a65c00;
}

.direction-line {
  stroke: #b42318;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 10 8;
  fill: none;
}

.direction-arrow {
  fill: #b42318;
}

.direction-sector-label {
  fill: #17212b;
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 3px;
  paint-order: stroke;
  font-size: 12px;
  font-weight: 800;
}

.map-attribution {
  position: absolute;
  right: 6px;
  bottom: 4px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  font-size: 11px;
}

.map-detail {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 13px;
}

.saved-import-fields {
  grid-template-columns: minmax(260px, 1fr);
}

.saved-import-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.saved-import-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

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

.saved-import-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.case-fields {
  grid-template-columns: minmax(260px, 1fr) minmax(160px, 220px);
}

.case-notes {
  width: 100%;
  margin: 12px 0;
}

.case-workspace-grid {
  margin-top: 14px;
}

.case-subsection {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
}

.case-activity-list {
  display: grid;
  gap: 10px;
}

.case-activity-item {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

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

.case-activity-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.case-activity-item p {
  margin: 7px 0 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.case-exhibits-panel {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.case-exhibit-fields {
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 1fr) minmax(220px, 1.2fr) auto auto;
}

.case-exhibit-list {
  display: grid;
  gap: 10px;
}

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

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

.case-exhibit-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.case-exhibit-item p {
  margin: 7px 0 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.badge.primary-soft {
  margin-left: 6px;
  background: #e0f2fe;
  color: #075985;
}

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

.map-layer-controls label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  font-size: 13px;
}

.map-layer-controls input {
  width: auto;
  min-height: auto;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--primary);
}

.report-sections {
  display: grid;
  gap: 14px;
}

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

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

.report-section h4 {
  margin: 0;
  font-size: 17px;
}

.print-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.print-toggle input {
  width: auto;
  min-height: auto;
}

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

.section-chart-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(120px, 3fr) minmax(40px, auto);
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.section-chart-track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: #d8e3ea;
}

.section-chart-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.section-mini-map {
  display: grid;
  gap: 6px;
}

.section-mini-map svg {
  width: 100%;
  min-height: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #dfe8ec;
}

.section-mini-map rect {
  fill: #dfe8ec;
}

.section-mini-map circle {
  fill: var(--primary);
  stroke: #fff;
  stroke-width: 2;
}

.section-mini-map circle.drone {
  fill: var(--danger);
}

.section-mini-map circle.home {
  fill: #6f42c1;
}

.section-mini-map circle.sensor {
  fill: var(--primary);
}

.section-osm-map {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #dfe8ec;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.section-osm-map.dragging {
  cursor: grabbing;
}

.section-map-controls {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 6px;
}

.section-map-controls button {
  min-width: 34px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.trajectory-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 14px;
  min-height: 620px;
}

.trajectory-list {
  overflow: auto;
  max-height: 720px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.trajectory-item {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 12px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.trajectory-item:hover,
.trajectory-item.active {
  background: #e8f1fb;
}

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

.trajectory-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.trajectory-map-panel {
  min-width: 0;
}

.rc-trajectory-workspace > .trajectory-wide-panel {
  grid-column: 1 / -1;
  min-width: 0;
}

.trajectory-map {
  position: relative;
  overflow: hidden;
  min-height: 620px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #dfe8ec;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.trajectory-map.dragging {
  cursor: grabbing;
}

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

.trajectory-overview-filters {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
}

.date-filter-field {
  display: grid;
  gap: 4px;
}

.date-filter-field > span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.rc-trajectory-date-filters {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
}

.trajectory-overview-map {
  min-height: 420px;
}

.trajectory-overview-panel.expanded .trajectory-overview-map {
  min-height: min(78vh, 920px);
}

.trajectory-overview-panel:not(.expanded) #allTrajectoriesCollapseBtn,
.trajectory-overview-panel.expanded #allTrajectoriesExpandBtn {
  display: none;
}

.trajectory-line {
  stroke: #b42318;
  stroke-width: 4;
  stroke-linecap: round;
  fill: none;
}

.trajectory-line.overview-line {
  stroke: var(--danger);
  stroke-width: 3;
  stroke-opacity: 0.82;
  pointer-events: stroke;
}

.trajectory-start-pin {
  fill: #111827;
  stroke: #ffffff;
  stroke-width: 2;
  pointer-events: all;
}

.trajectory-arrow {
  fill: #b42318;
}

.rc-trajectory-map {
  min-height: 560px;
}

.rc-trajectory-line {
  stroke: #a65c00;
  stroke-width: 4;
  stroke-linecap: round;
  fill: none;
  pointer-events: stroke;
}

.rc-trajectory-arrow {
  fill: #a65c00;
}

.rc-trajectory-waypoint {
  fill: #a65c00;
  stroke: #fff;
  stroke-width: 2;
  pointer-events: all;
}

.rc-trajectory-start {
  fill: #111827;
}

.rc-trajectory-end {
  fill: var(--primary);
}

.map-replay-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.replay-marker {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: #f0a51b;
  box-shadow: 0 0 0 3px rgba(240, 165, 27, 0.32), 0 7px 16px rgba(0, 0, 0, 0.28);
  transform: translate(-50%, -50%);
}

.replay-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #172331;
  transform: translate(-50%, -50%);
}

.replay-dot {
  background: #f0a51b;
  box-shadow: 0 0 0 2px rgba(240, 165, 27, 0.28);
}

.trajectory-replay-controls {
  display: grid;
  grid-template-columns: auto auto minmax(180px, 1fr) auto auto minmax(220px, 1.4fr);
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.trajectory-replay-controls input[type="range"] {
  min-width: 0;
}

.trajectory-replay-controls .meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rc-max-height-marker {
  fill: #b42318;
  stroke: #fff;
  stroke-width: 2.5;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.28));
  pointer-events: all;
}

.rc-max-height-label {
  fill: #17212b;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 3px;
  paint-order: stroke;
  font-size: 13px;
  font-weight: 800;
}

.compact-head {
  margin-bottom: 8px;
}

.trajectory-iso-panel {
  margin-top: 12px;
}

.rc-trajectory-workspace > .trajectory-iso-panel {
  margin-top: 0;
}

.trajectory-iso-view {
  width: 100%;
  height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fbfd 0%, #dfe8ec 100%);
}

.trajectory-3d-view {
  display: block;
  width: 100%;
  height: 520px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #dfe8ec;
  cursor: grab;
  touch-action: none;
}

.trajectory-terrain-view {
  width: 100%;
  height: 580px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #dfe8ec;
}

.trajectory-terrain-view .maplibregl-ctrl-top-right {
  top: 8px;
  right: 8px;
}

.trajectory-3d-view.dragging {
  cursor: grabbing;
}

.compact-range {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.compact-range input {
  width: 132px;
}

.trajectory-height-profile {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.iso-grid {
  stroke: #cfd9e2;
  stroke-width: 1;
}

.iso-satellite-tile {
  opacity: 0.9;
}

.iso-satellite-labels {
  opacity: 0.58;
}

.iso-satellite-wash {
  fill: rgba(255, 255, 255, 0.18);
  pointer-events: none;
}

.iso-grid-overlay .iso-grid {
  stroke: rgba(255, 255, 255, 0.72);
  stroke-width: 1.2;
}

.iso-drop {
  stroke: #7a8796;
  stroke-width: 1.3;
  stroke-dasharray: 4 4;
  opacity: 0.72;
}

.iso-path {
  fill: none;
  stroke: var(--danger);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.iso-point {
  fill: var(--danger);
  stroke: #ffffff;
  stroke-width: 2;
}

.iso-label {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.iso-muted {
  fill: var(--muted);
  font-size: 11px;
}

.summary-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.summary-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.summary-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.summary-item strong {
  display: block;
  margin-top: 4px;
}

.compact-table {
  max-height: 430px;
}

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

.chart-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.chart-card h4 {
  margin: 0 0 8px;
  font-size: 15px;
}

.chart-card canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  background: #fff;
}

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

.matrix-heatmap {
  overflow: auto;
  max-height: 440px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.matrix-heatmap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.matrix-heatmap th,
.matrix-heatmap td {
  border: 1px solid var(--line);
  padding: 7px 8px;
  text-align: center;
  font-size: 12px;
}

.matrix-heatmap th {
  position: sticky;
  top: 0;
  background: #f7f9fb;
  z-index: 1;
}

.matrix-heatmap th:first-child {
  left: 0;
  z-index: 2;
  text-align: left;
}

.matrix-heatmap td:first-child {
  position: sticky;
  left: 0;
  background: #fff;
  text-align: left;
  font-weight: 700;
}

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

.map-product-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.map-product-card h4 {
  margin: 0 0 8px;
  font-size: 15px;
}

.map-product-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.map-product-head h4 {
  margin: 0;
}

.map-product-head button {
  min-height: 32px;
  font-size: 13px;
}

.map-product-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.map-product {
  position: relative;
  overflow: hidden;
  min-height: 380px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #dfe8ec;
  user-select: none;
}

.map-product-chart {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.toast {
  position: sticky;
  top: 12px;
  z-index: 3;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--primary);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.toast.error {
  border-left-color: var(--danger);
}

.hidden {
  display: none;
}

.import-quality-panel { border-color: rgba(47, 111, 143, 0.35); }
.import-quality-metrics { margin-bottom: 16px; }
.import-session-file-list, .sensor-registry-list, .quality-issue-list { display: grid; gap: 8px; margin: 12px 0; }
.import-session-file, .sensor-registry-item, .quality-issue {
  display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: rgba(255, 255, 255, 0.65);
}
.import-session-file span, .sensor-registry-item span, .quality-issue span { color: var(--muted); font-size: 0.86rem; }
.quality-issue.error { border-left: 4px solid var(--danger); }
.quality-issue.warning { border-left: 4px solid #d09b2c; }
.import-quality-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; }
.mapping-file { display: grid; gap: 8px; margin-bottom: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.mapping-file label { display: grid; grid-template-columns: minmax(130px, 0.8fr) minmax(170px, 1.2fr); align-items: center; gap: 10px; }
.active-sensor-registry { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.case-handover-panel, .case-integrity-panel { margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.integrity-verified { border-left: 4px solid #18743b; background: #f0fff5; }
.integrity-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.integrity-metrics > div, .integrity-source-list > div { display: grid; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
.integrity-metrics span, .integrity-source-list span { color: var(--muted); font-size: 0.82rem; }
.integrity-source-list { display: grid; gap: 8px; margin-bottom: 14px; }

@media (max-width: 900px) {
  .import-quality-grid { grid-template-columns: 1fr; }
  .mapping-file label { grid-template-columns: 1fr; }
  .integrity-metrics { grid-template-columns: 1fr 1fr; }
}

.predictive-config-panel {
  margin-bottom: 18px;
}

.predictive-overview-panel {
  margin-bottom: 18px;
}

.predictive-overview-metrics .metric strong {
  font-size: 24px;
}

.predictive-overview-table td {
  vertical-align: top;
}

.predictive-filters {
  align-items: end;
}

.field-stack {
  display: grid;
  gap: 6px;
  min-width: 180px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field-stack input,
.field-stack select {
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
}

.predictive-disclaimer {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #e5c76b;
  border-radius: 8px;
  background: #fff9df;
  color: #664d03;
  line-height: 1.45;
}

.predictive-table td {
  vertical-align: top;
}

.predictive-return-panel {
  margin-top: 18px;
}

.predictive-return-table details ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.predictive-return-table details li {
  margin: 5px 0;
}

.return-high { background: #fde0de; color: #8f1d15; }
.return-medium { background: #ffe2c2; color: #8a4200; }
.return-low { background: #fff4d6; color: #7a5200; }
.return-limited { background: #edf1f5; color: var(--muted); }

.predictive-watchlist-panel {
  margin-top: 18px;
}

.predictive-watchlist-form {
  grid-template-columns: minmax(260px, 1.4fr) minmax(150px, 0.7fr) minmax(160px, 0.7fr) minmax(150px, 0.7fr);
}

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

.predictive-watchlist-table td,
.predictive-watch-alert-table td {
  vertical-align: top;
}

.watch-escalate { background: #fde0de; color: #8f1d15; }
.watch-alert { background: #ffe2c2; color: #8a4200; }
.watch-monitor { background: #e9f5ef; color: #155c43; }

.predictive-rule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.predictive-rule-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.predictive-rule-card strong,
.predictive-rule-card span {
  display: block;
}

.predictive-rule-card span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.predictive-score {
  margin-top: 8px;
  color: var(--primary);
  font-size: 18px;
  font-weight: 800;
}

.risk-normal { background: #e9f5ef; color: #155c43; }
.risk-monitor { background: #fff4d6; color: #7a5200; }
.risk-possible { background: #ffe2c2; color: #8a4200; }
.risk-probable { background: #fde0de; color: #8f1d15; }

.confidence-high { background: #e0f2fe; color: #075985; }
.confidence-medium { background: #ecfccb; color: #3f6212; }
.confidence-low { background: #fee2e2; color: #991b1b; }

.confidence-details {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.confidence-details summary {
  cursor: pointer;
  font-weight: 800;
}

.confidence-details ul {
  display: grid;
  gap: 4px;
  margin: 6px 0 0;
  padding-left: 16px;
  min-width: 220px;
}

.incident-details {
  margin-top: 7px;
}

.incident-timeline-mini {
  display: grid;
  gap: 6px;
  margin: 7px 0 0;
  padding-left: 18px;
  min-width: 260px;
}

.incident-timeline-mini li {
  padding-left: 2px;
}

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

.incident-timeline-mini strong {
  color: var(--text);
  font-size: 12px;
}

.incident-timeline-mini .timeline-time {
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
}

.incident-timeline-mini li.timeline-warn::marker {
  color: #c98a14;
}

.incident-timeline-mini li.timeline-high::marker {
  color: #a72020;
}

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

  .sidebar {
    min-height: auto;
  }

  .content-grid.two,
  .metric-grid,
  .download-grid,
  .button-grid,
  .report-controls,
  .map-layer-controls,
  .summary-list,
  .chart-grid,
  .map-product-grid,
  .server-readiness-grid,
  .server-ops-summary,
  .setup-wizard-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }


  .admin-tabs,
  .predictive-tabs {
    position: static;
  }

.report-tabs {
    position: static;
  }

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

  .rc-trajectory-date-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-map-panel .osm-map {
    min-height: 560px;
    aspect-ratio: 16 / 10;
  }
}

.predictive-report-dialog {
  width: min(1180px, 96vw);
  height: 94vh;
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(15, 25, 38, 0.35);
  overflow: hidden;
}

.predictive-loaded-files {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft, #f7f9fc);
  font-size: 13px;
}

.predictive-loaded-files > div {
  display: grid;
  grid-template-columns: 145px 1fr;
  gap: 12px;
}

.predictive-loaded-files > div > span:first-child {
  color: var(--muted);
  font-weight: 700;
}

.drone-library-panel {
  margin-top: 18px;
}

.drone-library-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
}

.drone-library-browser {
  min-width: 0;
  padding-right: 16px;
  border-right: 1px solid var(--line);
}

.drone-library-list {
  display: grid;
  gap: 7px;
  max-height: 760px;
  margin-top: 10px;
  overflow: auto;
}

.drone-library-list button {
  height: auto;
  min-height: 54px;
  padding: 9px 10px;
  text-align: left;
}

.drone-library-list button.active {
  border-color: var(--primary);
  background: #edf5fd;
}

.drone-library-list button strong,
.drone-library-list button span {
  display: block;
}

.drone-library-list button span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.drone-library-workspace,
.drone-research-tools {
  display: grid;
  gap: 14px;
}

.drone-research-tools {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fc;
}

.drone-research-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.drone-research-sources {
  display: grid;
  gap: 6px;
}

.drone-research-sources a,
.drone-research-sources .source-item {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

.drone-library-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.drone-library-fields {
  display: contents;
}

.drone-library-form .full {
  grid-column: 1 / -1;
}


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

.drone-image-url-row button {
  white-space: nowrap;
}

.drone-image-preview {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.drone-image-preview img {
  width: 160px;
  height: 105px;
  object-fit: contain;
  border-radius: 6px;
  background: #f2f6fa;
}

.drone-image-preview span {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1000px) {
  .drone-library-layout { grid-template-columns: 1fr; }
  .drone-library-browser { padding-right: 0; border-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
  .drone-library-list { max-height: 260px; }
}

.predictive-report-dialog::backdrop {
  background: rgba(15, 25, 38, 0.7);
}

.predictive-report-dialog-head {
  height: 64px;
  padding: 12px 18px;
  background: #172331;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.predictive-report-dialog iframe {
  display: block;
  width: 100%;
  height: calc(94vh - 64px);
  border: 0;
  background: #edf1f5;
}

@media (max-width: 720px) {
  .workspace {
    padding: 16px;
  }

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

  .topbar-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .topbar-logo {
    width: 210px;
    height: 62px;
  }

  .metric-grid,
  .content-grid.two,
  .trajectory-workspace,
  .trajectory-replay-controls,
  .filters,
  .form-grid,
  .download-grid,
  .button-grid,
  .report-controls,
  .map-layer-controls,
  .summary-list,
  .chart-grid,
  .map-product-grid,
  .auth-grid,
  .setup-wizard-steps,
  .button-row,
  .raw-form {
    grid-template-columns: 1fr;
  }

  .setup-wizard-step {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .setup-wizard-step button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media print {
  body {
    background: #fff;
  }

  .sidebar,
  .topbar,
  #toast,
  .report-tabs,
  .view:not(#reports) {
    display: none !important;
  }

  .app-shell,
  .workspace {
    display: block;
    padding: 0;
  }

  #reports,
  #reports.view {
    display: block;
  }

  .report-tab-panel {
    display: block !important;
  }

  .report-tab-panel[data-report-tab-panel="builder"],
  .report-tab-panel[data-report-tab-panel="trajectories"],
  .report-tab-panel[data-report-tab-panel="cases"],
  .report-tab-panel[data-report-tab-panel="saved-reports"],
  .report-tab-panel[data-report-tab-panel="exports"] {
    display: none !important;
  }

  .print-toggle,
  .report-section.print-excluded,
  .printable-section.print-excluded {
    display: none !important;
  }

  h2,
  h3 {
    break-after: avoid;
    page-break-after: avoid;
  }

  .panel,
  .metric,
  .report-section,
  .printable-section,
  .section-map,
  .section-osm-map,
  .chart-card,
  .map-card,
  .timeline-card,
  .profile-card,
  .content-card {
    break-inside: avoid;
    page-break-inside: avoid;
    box-shadow: none;
  }
}
.operator-preferences-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.operator-preferences-grid .checkbox-label { flex-direction: row; align-items: center; gap: 8px; padding-top: 25px; }
.operator-preferences-grid .checkbox-label input { width: auto; }
.demo-pack-head { margin-top: 20px; }
.demo-pack-list { display: grid; gap: 10px; margin-top: 10px; }
.demo-pack-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.demo-pack-item > div:first-child { display: grid; gap: 4px; }
.demo-pack-item span { color: var(--muted); font-size: 12px; }
.server-m4-output-grid { margin-top: 18px; }
.compact-list { display: grid; gap: 8px; }
.compact-list article { padding: 10px; border: 1px solid var(--line); border-radius: 8px; }
body.demo-mode .demo-sensitive { display: none !important; }
body.demo-mode button.danger:not([data-demo-pack]) { display: none !important; }
body.demo-mode::before { content: "DEMO MODE — TRAINING DATA ONLY"; position: sticky; top: 0; z-index: 9999; display: block; padding: 6px 12px; text-align: center; font-weight: 800; letter-spacing: .08em; color: #713f12; background: #fef3c7; border-bottom: 1px solid #f59e0b; }
body[data-theme="dark"] { --bg: #111827; --surface: #1f2937; --surface-soft: #273449; --ink: #f3f4f6; --muted: #bdc7d5; --line: #435066; color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  body[data-theme="system"] { --bg: #111827; --surface: #1f2937; --surface-soft: #273449; --ink: #f3f4f6; --muted: #bdc7d5; --line: #435066; color-scheme: dark; }
}
/* Product information dialogs share the standalone branded, scrollable layout. */
.release-dialog { width: min(820px, calc(100vw - 32px)); max-height: 88vh; box-sizing: border-box; overflow: auto; padding: 24px; border: 1px solid #657c85; border-radius: 16px; background: #10202c; color: #eef6fa; }
.release-dialog::backdrop { background: rgba(0, 9, 17, .76); }
.release-dialog-head { display: flex; gap: 20px; justify-content: space-between; align-items: start; }
.release-dialog h2 { margin: 4px 0 16px; }
.release-dialog a { color: #7fe2d8; }
.release-brand { display: flex; align-items: center; gap: 24px; margin: 16px 0 24px; }
.release-brand img { width: 220px; max-width: 45%; background: white; padding: 12px; border-radius: 8px; }
.release-status { padding: 12px 16px; background: #463820; border-left: 3px solid #e5bd64; color: #ffe2a0; }
.release-highlights { display: grid; gap: 10px; }
.release-highlights article { padding: 12px 16px; background: #1b3040; border-radius: 8px; line-height: 1.5; }
.release-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.release-details div { background: #1b3040; padding: 12px; border-radius: 8px; }
.release-details dt { color: #abc0cb; font-size: .85rem; }
.release-details dd { margin: 5px 0 0; overflow-wrap: anywhere; }
.release-dialog li { margin-bottom: 10px; line-height: 1.5; }
@media (max-width: 600px) { .release-details { grid-template-columns: 1fr; } .release-brand { flex-direction: column; align-items: start; } .release-brand img { max-width: 85%; } .release-dialog { padding: 16px; } }
