﻿*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #03100f;
  --bg-2: #061b17;
  --surface: #082720;
  --surface-2: #0c382d;
  --surface-3: #114637;
  --line: rgba(36, 213, 176, .58);
  --line-soft: rgba(36, 213, 176, .24);
  --accent: #24e3bc;
  --accent-2: #52d889;
  --warning: #d8b75a;
  --danger: #d96f6f;
  --text: #e7f4f2;
  --text-2: #b2d3d2;
  --muted: #83a6a8;
  --dim: #607d80;
  --shadow: 0 18px 50px rgba(0, 0, 0, .36);
  --font-ui: "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", "Segoe UI", system-ui, sans-serif;
  --font-num: "Segoe UI", "Microsoft YaHei UI", system-ui, sans-serif;
  --font-mono: "Cascadia Mono", "Consolas", "SFMono-Regular", monospace;
  --radius: 8px;
  --radius-sm: 5px;
}

@supports (color: oklch(50% 0.1 180)) {
  :root {
    --bg: oklch(10% 0.025 174);
    --bg-2: oklch(14% 0.034 166);
    --surface: oklch(18% 0.044 166);
    --surface-2: oklch(22% 0.055 160);
    --surface-3: oklch(28% 0.07 155);
    --line: oklch(64% 0.12 170 / .58);
    --line-soft: oklch(60% 0.11 170 / .24);
    --accent: oklch(78% 0.16 172);
    --accent-2: oklch(74% 0.15 148);
    --warning: oklch(78% 0.14 82);
    --danger: oklch(68% 0.17 25);
    --text: oklch(94% 0.018 190);
    --text-2: oklch(78% 0.045 190);
    --muted: oklch(62% 0.038 195);
    --dim: oklch(48% 0.032 198);
    --shadow: 0 18px 50px oklch(6% 0.02 205 / .36);
  }
}

html,
body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}

body {
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  background:
    radial-gradient(circle at 50% -10%, oklch(46% 0.11 155 / .22), transparent 32%),
    radial-gradient(circle at 12% 20%, oklch(34% 0.08 170 / .18), transparent 30%),
    linear-gradient(180deg, var(--bg) 0%, oklch(8% 0.02 176) 100%);
}

button,
input,
select,
textarea {
  font-family: inherit;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: oklch(16% 0.025 205);
}

::-webkit-scrollbar-thumb {
  background: oklch(45% 0.06 190 / .72);
  border-radius: 999px;
}

.app {
  height: 100vh;
  min-width: 1180px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: 64px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 24px;
  border-bottom: 1px solid oklch(58% 0.1 170 / .26);
  background:
    linear-gradient(90deg, transparent 22%, oklch(42% 0.1 162 / .16), transparent 78%),
    linear-gradient(180deg, oklch(13% 0.032 170 / .98), oklch(9% 0.026 176 / .98));
  box-shadow: 0 10px 32px oklch(5% 0.02 170 / .36);
}

.title {
  position: absolute;
  left: 36%;
  right: 36%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  pointer-events: none;
  color: var(--text);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 2px;
  text-shadow: 0 0 18px oklch(78% 0.16 172 / .5), 0 2px 0 oklch(4% 0.02 170 / .7);
}

.top-left,
.top-right {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--text-2);
}

#clock {
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 800;
  white-space: nowrap;
}

#weatherText {
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-ok,
.api-bad {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 850;
  white-space: nowrap;
}

.api-ok {
  color: var(--accent-2);
}

.api-ok::before,
.api-bad::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.api-bad {
  color: var(--danger);
}

.btn {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: oklch(25% 0.035 195);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.btn:hover {
  border-color: var(--accent);
  background: oklch(31% 0.052 188);
}

.btn:focus-visible {
  outline: 3px solid oklch(74% 0.13 182 / .32);
  outline-offset: 2px;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

.btn.primary {
  border-color: oklch(74% 0.14 180 / .8);
  background: linear-gradient(180deg, oklch(46% 0.11 178), oklch(36% 0.08 184));
}

.btn.warn {
  border-color: oklch(76% 0.14 82 / .78);
  background: oklch(35% 0.065 80);
  color: oklch(90% 0.06 82);
}

.stats {
  position: absolute;
  left: 22px;
  right: 22px;
  top: 72px;
  z-index: 22;
  height: 50px;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  border-bottom: 0;
  background: transparent;
  pointer-events: none;
}

.stat {
  min-width: 0;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 0 11px;
  border: 1px solid oklch(63% 0.12 170 / .2);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, oklch(31% 0.08 157 / .16), transparent 36%),
    linear-gradient(180deg, oklch(15% 0.04 166 / .78), oklch(8% 0.024 176 / .64));
  backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 oklch(82% 0.08 160 / .06), 0 12px 30px oklch(4% 0.02 170 / .25);
  pointer-events: auto;
}

.stat .icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: radial-gradient(circle, oklch(35% 0.09 160 / .72), oklch(18% 0.05 166 / .72));
  color: var(--accent);
  font-size: 18px;
}

.stat .icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat .value {
  color: var(--text);
  font-family: var(--font-num);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat .label {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.page {
  display: none;
  height: 100%;
  min-height: 0;
  gap: 16px;
  padding: 16px 24px 86px;
  overflow: hidden;
}

.page.active {
  display: grid;
}

.page.dashboard {
  position: relative;
  display: none;
  grid-template-columns: 1fr;
  padding: 12px 18px 82px;
}

.page.dashboard.active {
  display: block;
}

.page.yolo {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  padding-top: 12px;
}

.app:has(.page.yolo.active) .stats {
  position: relative;
  inset: auto;
  height: 72px;
  margin: 14px 22px 0;
  padding: 0;
}

.inspection-workspace {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(620px, 1fr) minmax(360px, 440px);
  gap: 16px;
  overflow: hidden;
}

.col {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

.dashboard .col:first-child {
  position: absolute;
  left: 24px;
  top: 118px;
  bottom: auto;
  z-index: 10;
  width: min(306px, 20vw);
  max-height: calc(100% - 204px);
  display: grid;
  grid-template-rows: 214px minmax(164px, 224px);
  pointer-events: auto;
}

.dashboard-side {
  position: absolute;
  right: 24px;
  top: 118px;
  bottom: auto;
  z-index: 10;
  width: min(320px, 21vw);
  max-height: calc(100% - 204px);
  display: grid;
  grid-template-rows: 230px minmax(224px, 252px) 176px;
  pointer-events: auto;
}

.panel,
.map {
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), oklch(12% 0.03 170));
  box-shadow: var(--shadow);
}

.dashboard .panel {
  background:
    linear-gradient(90deg, oklch(34% 0.09 154 / .13), transparent 46%),
    linear-gradient(180deg, oklch(15% 0.045 164 / .74), oklch(7% 0.022 174 / .62));
  border-color: oklch(62% 0.12 166 / .34);
  box-shadow:
    0 18px 44px oklch(4% 0.02 170 / .34),
    inset 0 1px 0 oklch(82% 0.06 160 / .08),
    inset 0 0 32px oklch(55% 0.1 160 / .04);
  backdrop-filter: blur(16px);
}

.dashboard .panel-title {
  background:
    linear-gradient(90deg, oklch(28% 0.08 160 / .82), oklch(13% 0.035 170 / .5));
  border-bottom-color: oklch(66% 0.13 166 / .28);
}

.panel {
  display: flex;
  flex-direction: column;
}

.panel-title {
  min-height: 42px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line-soft);
  background: oklch(22% 0.055 162 / .8);
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
}

.panel-title small {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px;
  overflow: auto;
}

.dashboard .panel-body {
  padding: 12px;
  overflow: auto;
}

.dashboard .table th,
.dashboard .table td {
  padding: 8px 6px;
  font-size: 12px;
}

.grow,
.panel.grow {
  min-height: 0;
  flex: 1 1 auto;
}

.grid2 {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.metric {
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: 1px solid oklch(68% 0.12 166 / .24);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, oklch(20% 0.05 164 / .76), oklch(8% 0.028 168 / .82)),
    radial-gradient(circle at 50% 0%, oklch(74% 0.14 168 / .14), transparent 58%);
  box-shadow: inset 0 1px 0 oklch(92% 0.04 166 / .08), 0 10px 26px oklch(4% 0.02 166 / .24);
  backdrop-filter: blur(12px);
}

.metric .micon {
  color: var(--accent);
  font-size: 20px;
}

.metric .mval {
  margin-top: 6px;
  color: var(--text);
  font-family: var(--font-num);
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
}

.metric .mlabel {
  margin-top: 5px;
  color: var(--text-2);
  font-size: 11px;
}

.metric .mstatus {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 13px;
}

.table th,
.table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-2);
  text-align: left;
  white-space: nowrap;
}

.table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.table td {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alert-panel .table {
  table-layout: fixed;
}

.alert-panel .table th:nth-child(1),
.alert-panel .table td:nth-child(1) {
  width: 42%;
}

.alert-panel .table th:nth-child(2),
.alert-panel .table td:nth-child(2) {
  width: 17%;
}

.alert-panel .table th:nth-child(3),
.alert-panel .table td:nth-child(3) {
  width: 17%;
}

.alert-panel .table th:nth-child(4),
.alert-panel .table td:nth-child(4) {
  width: 24%;
}

.alert-panel .table td {
  max-width: none;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.45;
  vertical-align: middle;
}

.alert-panel .table td:nth-child(4) {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  word-break: keep-all;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 9px;
  border: 1px solid oklch(68% 0.12 168 / .56);
  border-radius: 999px;
  background: oklch(30% 0.06 165 / .42);
  color: oklch(82% 0.12 165);
  font-size: 12px;
}

.badge.mid {
  border-color: oklch(76% 0.14 82 / .58);
  background: oklch(31% 0.055 82 / .44);
  color: oklch(86% 0.12 82);
}

.badge.high {
  border-color: oklch(68% 0.17 25 / .58);
  background: oklch(31% 0.065 25 / .44);
  color: oklch(78% 0.15 25);
}

.map {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(ellipse at 50% 58%, oklch(54% 0.13 165 / .22), transparent 38%),
    radial-gradient(ellipse at 50% 18%, oklch(58% 0.08 205 / .12), transparent 34%),
    linear-gradient(oklch(48% 0.08 190 / .09) 1px, transparent 1px),
    linear-gradient(90deg, oklch(48% 0.08 190 / .09) 1px, transparent 1px),
    linear-gradient(160deg, oklch(16% 0.032 205), oklch(9% 0.022 210));
  background-size: auto, 64px 64px, 64px 64px, auto;
}

.dashboard .map {
  position: absolute;
  inset: 0 0 66px;
  z-index: 1;
  border-color: transparent;
  border-radius: 0;
  box-shadow: none;
  background:
    radial-gradient(ellipse at 50% 55%, oklch(42% 0.11 158 / .16), transparent 44%),
    linear-gradient(oklch(46% 0.08 170 / .05) 1px, transparent 1px),
    linear-gradient(90deg, oklch(46% 0.08 170 / .05) 1px, transparent 1px),
    linear-gradient(160deg, oklch(10% 0.026 170), oklch(5% 0.015 176));
  background-size: auto, 72px 72px, 72px 72px, auto;
}

.dashboard .map::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 58%, transparent 30%, oklch(4% 0.018 170 / .18) 64%, oklch(3% 0.015 170 / .62) 100%),
    linear-gradient(90deg, oklch(4% 0.018 170 / .58), transparent 24% 76%, oklch(4% 0.018 170 / .58)),
    linear-gradient(0deg, oklch(4% 0.018 170 / .52), transparent 26% 72%, oklch(4% 0.018 170 / .22));
}

.twin3d-canvas {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.map.three-ready .twin-viewport {
  opacity: 0;
  visibility: hidden;
}

.map::before {
  content: "";
  position: absolute;
  inset: auto 7% 7% 7%;
  height: 34%;
  border-radius: 50%;
  background: radial-gradient(ellipse, oklch(62% 0.12 175 / .2), transparent 68%);
  filter: blur(10px);
  z-index: 0;
}

.scene-title {
  position: absolute;
  top: 122px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  display: grid;
  gap: 3px;
  min-width: 236px;
  padding: 9px 18px 8px;
  border: 1px solid oklch(66% 0.13 166 / .32);
  border-radius: var(--radius);
  background: linear-gradient(180deg, oklch(16% 0.045 164 / .72), oklch(7% 0.022 174 / .52));
  backdrop-filter: blur(12px);
  box-shadow: 0 0 26px oklch(72% 0.16 166 / .14);
  text-align: center;
  pointer-events: none;
}

.scene-title b {
  color: var(--text);
  font-size: 18px;
  letter-spacing: .08em;
  text-shadow: 0 0 14px oklch(78% 0.15 170 / .45);
}

.scene-title span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.skyline {
  position: absolute;
  inset: 12% 8% auto 8%;
  height: 18%;
  z-index: 0;
  background:
    linear-gradient(90deg, transparent, oklch(72% 0.12 180 / .32), transparent),
    repeating-linear-gradient(90deg, transparent 0 38px, oklch(62% 0.1 185 / .16) 38px 40px);
  opacity: .42;
  transform: perspective(700px) rotateX(62deg);
}

.twin-viewport {
  position: absolute;
  inset: 72px calc(min(320px, 21vw) + 34px) 82px calc(min(306px, 20vw) + 34px);
  z-index: 1;
  perspective: 1280px;
}

.terrain-plane {
  position: absolute;
  left: -4%;
  right: -4%;
  top: 2%;
  bottom: 1%;
  transform: rotateX(58deg) rotateZ(-4deg);
  transform-origin: 50% 62%;
  border: 1px solid oklch(64% 0.12 176 / .38);
  border-radius: 38px;
  background:
    linear-gradient(90deg, oklch(70% 0.12 178 / .15), transparent 18% 82%, oklch(70% 0.12 178 / .14)),
    linear-gradient(0deg, oklch(42% 0.09 168 / .08), transparent),
    oklch(18% 0.036 202 / .92);
  box-shadow:
    0 36px 90px oklch(5% 0.02 205 / .62),
    inset 0 0 50px oklch(70% 0.12 175 / .12);
  animation: terrainFloat 8s ease-in-out infinite;
}

@keyframes terrainFloat {
  0%, 100% { transform: rotateX(58deg) rotateZ(-4deg) translateY(0); }
  50% { transform: rotateX(58deg) rotateZ(-4deg) translateY(-6px); }
}

.terrain-plane::before,
.terrain-plane::after {
  content: "";
  position: absolute;
  inset: 6%;
  border: 1px solid oklch(66% 0.11 170 / .24);
  border-radius: 30px;
}

.terrain-plane::after {
  inset: 10%;
  border-style: dashed;
  opacity: .55;
}

.road,
.water-channel {
  position: absolute;
  z-index: 2;
  border-radius: 999px;
  pointer-events: none;
}

.road {
  background: linear-gradient(90deg, oklch(62% 0.018 92 / .72), oklch(80% 0.012 92 / .72), oklch(58% 0.018 92 / .72));
  box-shadow: 0 0 12px oklch(85% 0.02 92 / .18);
}

.road-a { left: 12%; right: 12%; top: 48%; height: 3.5%; transform: rotate(-2deg); }
.road-b { left: 44%; top: 15%; width: 3.2%; height: 70%; transform: rotate(4deg); }
.road-c { left: 15%; right: 18%; top: 69%; height: 3%; transform: rotate(5deg); }

.water-channel {
  left: 3%;
  right: 4%;
  bottom: 7%;
  height: 7%;
  background: linear-gradient(90deg, oklch(52% 0.13 215 / .46), oklch(72% 0.12 190 / .52));
  box-shadow: 0 0 20px oklch(70% 0.12 195 / .28);
}

.map .scan {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  height: 2px;
  background: linear-gradient(90deg, transparent, oklch(76% 0.14 180 / .78), transparent);
  opacity: .42;
  animation: scan 5.8s linear infinite;
}

@keyframes scan {
  from { top: 0; }
  to { top: 100%; }
}

.patch {
  position: absolute;
  z-index: 3;
  border: 1px solid oklch(72% 0.13 160 / .56);
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(90deg, oklch(68% 0.14 145 / .22) 0 6px, oklch(42% 0.11 150 / .2) 6px 12px),
    linear-gradient(135deg, oklch(43% 0.12 148 / .7), oklch(31% 0.09 160 / .5));
  box-shadow:
    0 18px 32px oklch(7% 0.02 205 / .32),
    0 0 22px oklch(72% 0.13 160 / .16),
    inset 0 0 20px oklch(70% 0.12 165 / .1);
}

.patch::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, oklch(88% 0.12 160 / .18), transparent);
  transform: translateX(-120%);
  animation: fieldSweep 5.6s ease-in-out infinite;
}

@keyframes fieldSweep {
  0%, 35% { transform: translateX(-120%); opacity: 0; }
  50% { opacity: 1; }
  72%, 100% { transform: translateX(120%); opacity: 0; }
}

.p1 { left: 10%; top: 15%; width: 28%; height: 23%; }
.p2 { left: 48%; top: 14%; width: 27%; height: 20%; }
.p3 { left: 68%; top: 40%; width: 22%; height: 23%; }
.p4 { left: 12%; top: 52%; width: 25%; height: 20%; }
.p5 { left: 42%; top: 60%; width: 24%; height: 19%; }
.p6 { left: 67%; top: 68%; width: 22%; height: 18%; }

.p3,
.p5 {
  border-color: oklch(78% 0.13 82 / .56);
  background:
    repeating-linear-gradient(90deg, oklch(76% 0.14 82 / .18) 0 6px, oklch(40% 0.09 145 / .2) 6px 12px),
    linear-gradient(135deg, oklch(44% 0.1 130 / .66), oklch(35% 0.08 82 / .48));
}

.field-card {
  position: absolute;
  z-index: 6;
  min-width: 150px;
  padding: 9px 11px;
  border: 1px solid oklch(67% 0.12 180 / .58);
  border-radius: var(--radius-sm);
  background: oklch(18% 0.03 205 / .92);
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.55;
  box-shadow: 0 14px 32px oklch(7% 0.02 205 / .32);
  transform: translateZ(18px);
}

.field-card b {
  color: var(--text);
}

.field-card.watch {
  border-color: oklch(72% 0.14 72 / .72);
  background: linear-gradient(135deg, oklch(25% 0.05 72 / .88), oklch(18% 0.03 205 / .9));
}

.field-card.danger {
  border-color: oklch(66% 0.16 26 / .78);
  background: linear-gradient(135deg, oklch(24% 0.055 26 / .9), oklch(18% 0.03 205 / .9));
}

.map-hud {
  position: absolute;
  left: calc(min(306px, 20vw) + 116px);
  right: calc(min(320px, 21vw) + 116px);
  bottom: 18px;
  z-index: 18;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.drone-node {
  position: absolute;
  left: 50%;
  top: 22%;
  transform: translateX(-50%);
  z-index: 14;
  min-width: 138px;
  padding: 9px 12px;
  border: 1px solid oklch(72% 0.14 166 / .54);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(145deg, oklch(15% 0.044 164 / .88), oklch(6% 0.025 168 / .88)),
    radial-gradient(circle at 0% 0%, oklch(72% 0.14 166 / .12), transparent 62%);
  color: var(--text);
  box-shadow: 0 0 26px oklch(72% 0.14 166 / .24), inset 0 1px 0 oklch(92% 0.04 166 / .1);
  animation: droneHover 3.4s ease-in-out infinite;
}

@keyframes droneHover {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-8px); }
}

.drone-node::before {
  content: "";
  position: absolute;
  left: 40%;
  top: 100%;
  width: 58px;
  height: 190px;
  background: linear-gradient(180deg, oklch(72% 0.14 166 / .34), transparent);
  clip-path: polygon(45% 0, 55% 0, 100% 100%, 0 100%);
}

.drone-node span {
  position: absolute;
  left: -34px;
  top: -28px;
  width: 72px;
  height: 34px;
  background:
    radial-gradient(circle at 16% 50%, oklch(78% 0.02 210), transparent 17%),
    radial-gradient(circle at 84% 50%, oklch(78% 0.02 210), transparent 17%),
    linear-gradient(90deg, transparent 0 12%, oklch(80% 0.016 210) 12% 88%, transparent 88%),
    radial-gradient(ellipse at 50% 50%, oklch(88% 0.012 210), oklch(48% 0.02 210));
  border-radius: 50%;
  filter: drop-shadow(0 10px 12px oklch(5% 0.02 205 / .45));
}

.drone-node b,
.drone-node em {
  display: block;
  position: relative;
  z-index: 1;
}

.drone-node b {
  font-size: 13px;
}

.drone-node em {
  margin-top: 3px;
  color: oklch(80% 0.16 166);
  font-size: 12px;
  font-style: normal;
}

.detection-dot {
  position: absolute;
  z-index: 13;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border: 2px solid oklch(92% 0.09 72);
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 5px oklch(78% 0.15 72 / .18), 0 0 24px oklch(78% 0.15 72 / .58);
  animation: dotPulse 1.7s ease-in-out infinite;
}

.detection-dot.hot {
  border-color: oklch(86% 0.1 25);
  background: var(--danger);
  box-shadow: 0 0 0 6px oklch(68% 0.16 25 / .18), 0 0 26px oklch(68% 0.16 25 / .58);
}

@keyframes dotPulse {
  0%, 100% { transform: scale(.9); opacity: .88; }
  50% { transform: scale(1.35); opacity: 1; }
}

.map-hud div {
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid oklch(67% 0.13 166 / .27);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, oklch(15% 0.044 164 / .78), oklch(6% 0.022 168 / .72)),
    radial-gradient(circle at 10% 0%, oklch(70% 0.13 166 / .11), transparent 64%);
  box-shadow: inset 0 1px 0 oklch(92% 0.04 166 / .08), 0 14px 34px oklch(3% 0.018 166 / .32);
  backdrop-filter: blur(18px) saturate(128%);
}

.map-hud span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.map-hud b {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.insight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.insight {
  min-height: 64px;
  padding: 11px;
  border: 1px solid oklch(67% 0.13 166 / .22);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(145deg, oklch(18% 0.046 164 / .76), oklch(8% 0.024 168 / .82)),
    radial-gradient(circle at 0% 0%, oklch(72% 0.13 166 / .1), transparent 60%);
  box-shadow: inset 0 1px 0 oklch(92% 0.04 166 / .07);
}

.insight span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.insight strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-family: var(--font-num);
  font-size: 20px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.trend-strip {
  margin-top: 12px;
  min-height: 86px;
  padding: 10px 12px;
  border: 1px solid oklch(67% 0.13 166 / .22);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, oklch(16% 0.042 164 / .74), oklch(7% 0.022 168 / .8)),
    radial-gradient(circle at 30% 0%, oklch(74% 0.13 166 / .1), transparent 58%);
  box-shadow: inset 0 1px 0 oklch(92% 0.04 166 / .07);
}

.trend-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.trend-title b {
  color: var(--accent);
}

.trend-bars {
  height: 44px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 7px;
  align-items: end;
  margin-top: 10px;
}

.trend-bars i {
  display: block;
  min-height: 8px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, var(--accent), oklch(50% 0.1 170));
  box-shadow: 0 0 14px oklch(74% 0.14 180 / .28);
}

.donut-block {
  min-height: 104px;
  margin-top: 12px;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid oklch(67% 0.13 166 / .22);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, oklch(16% 0.042 164 / .74), oklch(7% 0.022 168 / .8)),
    radial-gradient(circle at 30% 0%, oklch(74% 0.13 166 / .1), transparent 58%);
  box-shadow: inset 0 1px 0 oklch(92% 0.04 166 / .07);
}

.donut {
  width: 82px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  box-shadow: 0 0 22px oklch(74% 0.14 180 / .18);
}

.donut::before {
  content: "";
  position: absolute;
}

.donut span {
  width: 50px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: oklch(14% 0.026 205);
  color: var(--text);
  font-family: var(--font-num);
  font-weight: 900;
}

.donut-legend {
  display: grid;
  gap: 7px;
}

.donut-legend p {
  min-width: 0;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  color: var(--text-2);
  font-size: 12px;
}

.donut-legend i {
  width: 9px;
  height: 9px;
  border-radius: 2px;
}

.donut-legend b {
  color: var(--text);
  font-weight: 800;
}

.risk-list {
  display: grid;
  gap: 12px;
}

.risk-row {
  padding: 10px 0;
  border-bottom: 1px solid oklch(63% 0.11 166 / .16);
}

.risk-row:last-child {
  border-bottom: 0;
}

.risk-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
}

.risk-head b,
.risk-head span {
  font-size: 13px;
}

.risk-bar {
  height: 7px;
  margin: 8px 0 6px;
  overflow: hidden;
  border-radius: 99px;
  background: oklch(7% 0.022 166 / .95);
  box-shadow: inset 0 0 0 1px oklch(64% 0.1 166 / .08);
}

.risk-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, oklch(67% 0.14 166), oklch(76% 0.16 145), var(--warn));
  box-shadow: 0 0 14px oklch(72% 0.14 166 / .34);
}

.risk-meta {
  color: var(--muted);
  font-size: 12px;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.timeline-item > span {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px oklch(74% 0.14 180 / .45);
}

.timeline-item b {
  color: var(--text);
  font-size: 13px;
}

.timeline-item p {
  margin-top: 2px;
  color: var(--text-2);
  font-size: 12px;
}

.timeline-item em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.empty-state {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.media-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-panel .panel-body {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  overflow: hidden;
}

.inspection-workspace-title {
  position: relative;
  z-index: 2;
  min-height: 48px;
}

.inspection-mode-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(86px, 1fr));
  gap: 2px;
  padding: 3px;
  border: 1px solid oklch(62% 0.1 170 / .32);
  border-radius: var(--radius-sm);
  background: oklch(12% 0.025 178 / .9);
}

.inspection-mode-switch button {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: calc(var(--radius-sm) - 2px);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background .18s ease-out, color .18s ease-out, box-shadow .18s ease-out;
}

.inspection-mode-switch button:hover {
  color: var(--text);
  background: oklch(24% 0.045 170 / .76);
}

.inspection-mode-switch button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.inspection-mode-switch button.active {
  background: oklch(32% 0.075 166);
  color: var(--text);
  box-shadow: inset 0 0 0 1px oklch(76% 0.14 166 / .28);
}

.inspection-media-panel > .panel-body {
  display: block;
}

.inspection-mode-pane {
  height: 100%;
  min-height: 0;
}

.inspection-mode-pane[hidden] {
  display: none !important;
}

.process-steps[hidden],
.inspection-side-panel [data-collapse-panel][hidden] {
  display: none !important;
}

.offline-inspection-pane.active {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
}

.live-inspection-pane.active {
  display: grid;
  grid-template-rows: minmax(280px, 1fr) auto minmax(108px, auto);
  gap: 12px;
}

.live-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 1px solid oklch(65% 0.12 180 / .52);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, oklch(42% 0.08 165 / .09) 1px, transparent 1px),
    linear-gradient(0deg, oklch(42% 0.08 165 / .08) 1px, transparent 1px),
    oklch(8% 0.021 196);
  background-size: 36px 36px;
}

.live-stream-video {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  object-fit: contain;
  background: oklch(7% 0.018 190);
}

.live-annotated-frame {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: none;
  object-fit: contain;
  background: oklch(7% 0.018 190);
}

.live-annotated-frame.active {
  display: block;
}

.live-stream-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  color: var(--text-2);
  text-align: center;
  z-index: 2;
  pointer-events: none;
}

.live-stream-empty[hidden] {
  display: none;
}

.live-stream-empty strong {
  color: var(--text);
  font-size: 19px;
  font-weight: 900;
}

.live-stream-empty > span:last-child {
  color: var(--muted);
  font-size: 13px;
}

.live-signal {
  width: 42px;
  height: 42px;
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid oklch(68% 0.12 170 / .46);
  border-radius: 50%;
  background: oklch(22% 0.055 170 / .82);
}

.live-signal::before,
.live-signal::after {
  content: "";
  position: absolute;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.live-signal::before {
  width: 8px;
  height: 8px;
}

.live-signal::after {
  width: 22px;
  height: 22px;
  border-top-color: transparent;
  border-bottom-color: transparent;
}

.live-signal.waiting,
.live-signal.connecting,
.live-signal.stale {
  color: var(--warning);
}

.live-signal.playing {
  color: var(--accent);
}

.live-signal.error {
  color: var(--danger);
}

.live-stage-toolbar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 7px 6px 12px;
  border: 1px solid oklch(68% 0.1 170 / .28);
  border-radius: var(--radius-sm);
  background: oklch(9% 0.024 180 / .88);
  box-shadow: 0 10px 24px oklch(4% 0.02 180 / .3);
}

.live-stage-toolbar > span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-stage-toolbar i {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted);
}

.live-stage-toolbar i.playing {
  background: var(--accent);
  box-shadow: 0 0 10px oklch(76% 0.16 166 / .55);
}

.live-stage-toolbar i.connecting,
.live-stage-toolbar i.waiting,
.live-stage-toolbar i.stale {
  background: var(--warning);
}

.live-stage-toolbar i.error {
  background: var(--danger);
}

.live-stage-toolbar b {
  min-width: 0;
  color: var(--text-2);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-reconnect-button {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: oklch(20% 0.04 176);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
}

.live-reconnect-button:hover {
  border-color: var(--line);
  background: oklch(26% 0.055 170);
}

.live-reconnect-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.live-metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: oklch(16% 0.032 188);
}

.live-metric-strip > div {
  min-width: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
}

.live-metric-strip > div + div {
  border-left: 1px solid var(--line-soft);
}

.live-metric-strip span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.live-metric-strip strong {
  color: var(--text);
  font-size: 21px;
  font-variant-numeric: tabular-nums;
}

.live-evidence-row {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line-soft);
}

.live-evidence-block {
  min-width: 0;
  padding: 0 14px;
  overflow: hidden;
}

.live-evidence-block + .live-evidence-block {
  border-left: 1px solid var(--line-soft);
}

.live-evidence-title {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.live-evidence-title span {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.live-evidence-title small {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-class-list,
.live-region-list {
  max-height: 80px;
  overflow: auto;
}

.live-class-item,
.live-region-item {
  min-height: 30px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  border-top: 1px solid oklch(60% 0.08 170 / .14);
  color: var(--text-2);
  font-size: 12px;
}

.live-class-item span,
.live-region-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-class-item b,
.live-region-item b {
  color: var(--accent-2);
  font-variant-numeric: tabular-nums;
}

.live-class-item em,
.live-region-item em {
  color: var(--muted);
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.upload-box {
  position: relative;
  min-height: 0;
  height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid oklch(65% 0.12 180 / .52);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, oklch(42% 0.08 165 / .11) 1px, transparent 1px),
    linear-gradient(0deg, oklch(42% 0.08 165 / .1) 1px, transparent 1px),
    oklch(11% 0.024 205);
  background-size: 36px 36px;
  cursor: pointer;
}

.media-preview {
  display: none;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  background: oklch(11% 0.022 210);
}

.media-zoom-layer {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transform-origin: center center;
  will-change: transform;
}

.upload-box.has-zoomable-media .media-zoom-layer {
  cursor: grab;
}

.upload-box.dragging .media-zoom-layer {
  cursor: grabbing;
}

.media-zoom-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  display: none;
  grid-template-columns: 34px minmax(120px, 180px) 34px 54px;
  align-items: center;
  gap: 6px;
  padding: 7px;
  border: 1px solid oklch(68% 0.12 170 / .32);
  border-radius: var(--radius-sm);
  background: oklch(9% 0.024 180 / .86);
  box-shadow: 0 12px 24px oklch(4% 0.02 180 / .28);
}

.upload-box.has-zoomable-media .media-zoom-controls {
  display: grid;
}

.media-zoom-controls button {
  height: 30px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: oklch(20% 0.04 176);
  color: var(--text);
  font-weight: 900;
  cursor: pointer;
}

.media-zoom-controls input {
  width: 100%;
  accent-color: oklch(74% 0.14 166);
}

.detection-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: none;
}

.detection-overlay.active {
  display: block;
}

.detect-box {
  position: absolute;
  min-width: 18px;
  min-height: 18px;
  border: 2px solid oklch(82% 0.18 155);
  box-shadow: 0 0 0 1px oklch(8% 0.02 180 / .78), 0 0 18px oklch(76% 0.18 155 / .28);
  background: oklch(70% 0.18 155 / .08);
}

.detect-box.hot {
  border-color: oklch(78% 0.16 82);
  background: oklch(76% 0.16 82 / .1);
}

.detect-box.plant-box {
  border-color: oklch(82% 0.15 172);
  border-width: 3px;
  background: oklch(72% 0.12 170 / .07);
  box-shadow: 0 0 0 1px oklch(8% 0.02 180 / .84), 0 0 24px oklch(76% 0.18 155 / .34);
}

.detect-box.plant-box.hot {
  border-color: oklch(76% 0.16 82);
}

.detect-box b {
  position: absolute;
  left: -2px;
  bottom: calc(100% + 4px);
  max-width: 220px;
  padding: 3px 7px;
  border: 1px solid oklch(82% 0.18 155 / .42);
  border-radius: var(--radius-sm);
  background: oklch(10% 0.026 180 / .92);
  color: var(--text);
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inspection-actions {
  display: grid;
  grid-template-columns: minmax(150px, .8fr) minmax(220px, 1.2fr);
  gap: 10px;
  align-items: center;
}

.upload-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 22px;
  color: var(--text-2);
}

.upload-empty.has-media {
  inset: auto 12px 12px 12px;
  min-height: 46px;
  flex-direction: row;
  justify-content: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: oklch(16% 0.026 205 / .92);
  pointer-events: none;
}

.upload-symbol {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: oklch(26% 0.045 185);
  color: var(--accent);
  font-size: 30px;
}

.upload-empty.has-media .upload-symbol {
  width: 28px;
  height: 28px;
  font-size: 15px;
}

.upload-box strong {
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
}

.upload-empty.has-media strong {
  font-size: 13px;
}

.upload-box span:last-child {
  max-width: 100%;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.change-media,
.run-main {
  justify-content: center;
}

.change-media {
  height: 38px;
}

.run-main {
  height: 50px;
  font-size: 17px;
}

.process-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
}

.step {
  min-height: 54px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: oklch(18% 0.028 202);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.step span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 12px;
}

.step.active {
  border-color: oklch(74% 0.14 180 / .72);
  background: oklch(28% 0.055 180);
  color: var(--text);
}

.step.done {
  color: var(--accent-2);
}

.step.error {
  border-color: var(--danger);
  background: rgba(126, 45, 52, .42);
  color: #f2b7b4;
}

.step.error span {
  font-size: 0;
}

.step.error span::before {
  content: "\2715";
  font-size: 12px;
}

.step.done span {
  font-size: 0;
}

.step.done span::before {
  content: "\2713";
  font-size: 12px;
}

.result-flow {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: min-content;
  overflow: visible;
}

.result-hero,
.result-block {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: oklch(18% 0.028 202);
  padding: 14px;
}

.result-block {
  transition: border-color .18s ease, background .18s ease;
}

.collapse-toggle {
  width: 100%;
  min-height: 36px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.collapse-toggle span {
  min-width: 0;
  font-size: 14px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collapse-toggle small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.collapse-toggle i {
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  transition: transform .18s ease;
}

.collapse-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

.collapsible-content {
  margin-top: 12px;
}

.result-block.collapsed {
  min-height: 0;
  background:
    linear-gradient(90deg, oklch(20% 0.048 166 / .82), oklch(13% 0.03 176 / .9));
}

.result-block.collapsed .collapsible-content {
  display: none;
}

.result-block.collapsed .collapse-toggle i {
  transform: rotate(-45deg);
}

.result-hero h2 {
  margin-bottom: 6px;
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
}

.result-hero p {
  color: var(--text-2);
  line-height: 1.65;
}

.inspection-side-panel .panel-body {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 10px 10px 24px;
}

.inspection-side-panel {
  height: 100%;
  max-height: calc(100vh - 166px);
}

.inspection-side-panel .panel-title {
  min-height: 36px;
  padding: 0 12px;
  font-size: 14px;
}

.inspection-side-panel .panel-title small {
  font-size: 10px;
}

.inspection-side-panel .result-flow {
  gap: 8px;
  min-height: 0;
}

.inspection-side-panel .result-hero,
.inspection-side-panel .result-block {
  padding: 10px 11px;
}

.inspection-side-panel .result-hero h2 {
  margin-bottom: 4px;
  font-size: 16px;
}

.inspection-side-panel .result-hero p {
  font-size: 12px;
  line-height: 1.45;
}

.inspection-side-panel .process-steps {
  gap: 5px;
}

.inspection-side-panel .step {
  min-height: 42px;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 5px;
  padding: 5px 6px;
  font-size: 10px;
  line-height: 1.2;
}

.inspection-side-panel .step span {
  width: 18px;
  height: 18px;
  font-size: 10px;
}

.inspection-side-panel .step.done span::before,
.inspection-side-panel .step.error span::before {
  font-size: 10px;
}

.inspection-side-panel .collapse-toggle {
  min-height: 30px;
  grid-template-columns: minmax(0, 1fr) auto 14px;
  gap: 7px;
}

.inspection-side-panel .collapse-toggle span {
  font-size: 13px;
}

.inspection-side-panel .collapse-toggle small {
  font-size: 10px;
}

.inspection-side-panel .collapsible-content {
  margin-top: 8px;
}

.inspection-side-panel .result-block.grow {
  min-height: 0;
  overflow: visible;
}

.inspection-report-panel {
  min-height: 260px;
  overflow: visible;
}

.inspection-report-panel .report-box {
  height: auto;
  min-height: 190px;
  max-height: none;
}

.kv {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 8px 12px;
  margin-bottom: 8px;
  align-items: start;
}

.kv .k {
  color: var(--muted);
}

.kv .v {
  color: var(--text);
  text-align: right;
  overflow-wrap: anywhere;
}

.advice-box,
.report-box,
.logbox {
  width: 100%;
  height: 100%;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: oklch(15% 0.024 205);
  color: var(--text-2);
  padding: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.hidden-compat {
  display: none;
}

.agent-consultation-head {
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid oklch(58% 0.13 166 / .26);
  border-radius: var(--radius-sm);
  background: oklch(16% 0.04 166 / .88);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.agent-consultation-grid {
  height: auto;
  max-height: none;
  overflow: visible;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-right: 0;
}

.inspection-side-panel .agent-consultation-head {
  margin-bottom: 7px;
  padding: 7px 9px;
  font-size: 11px;
  line-height: 1.4;
}

.inspection-side-panel .agent-consultation-grid {
  grid-template-columns: 1fr;
  gap: 7px;
}

.inspection-side-panel .consultation-decision {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
}

.inspection-side-panel .decision-line {
  gap: 6px;
  padding: 6px 7px;
}

.inspection-side-panel .decision-line span,
.inspection-side-panel .decision-meta,
.inspection-side-panel .agent-route i,
.inspection-side-panel .decision-list strong,
.inspection-side-panel .decision-list em {
  font-size: 10px;
}

.inspection-side-panel .decision-line b {
  font-size: 11px;
}

.inspection-side-panel .decision-meta {
  line-height: 1.4;
}

.inspection-side-panel .agent-route,
.inspection-side-panel .decision-list {
  gap: 4px;
}

.inspection-side-panel .agent-route i,
.inspection-side-panel .decision-list em {
  padding: 3px 6px;
}

.consultation-decision {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid oklch(68% 0.14 166 / .34);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, oklch(19% 0.046 166 / .96), oklch(13% 0.03 176 / .98));
  padding: 12px;
  box-shadow: inset 0 1px 0 oklch(88% 0.04 166 / .08);
}

.decision-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: oklch(12% 0.026 176 / .68);
}

.decision-line span,
.decision-meta,
.agent-route i,
.decision-list strong {
  color: var(--muted);
  font-size: 12px;
}

.decision-line b {
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.decision-meta,
.agent-route,
.decision-list {
  grid-column: 1 / -1;
}

.decision-meta {
  line-height: 1.55;
}

.agent-route {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.agent-route i,
.decision-list em {
  border: 1px solid oklch(58% 0.13 166 / .24);
  border-radius: 999px;
  background: oklch(12% 0.024 176 / .72);
  font-style: normal;
  padding: 4px 8px;
}

.decision-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.decision-list em {
  color: var(--text-2);
  font-size: 12px;
}

.decision-list.blocked em {
  border-color: oklch(68% 0.11 82 / .28);
  color: oklch(82% 0.12 82);
}

.agent-card {
  min-height: 142px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, oklch(18% 0.038 166 / .94), oklch(12% 0.028 166 / .96));
  padding: 12px;
  box-shadow: inset 0 1px 0 oklch(88% 0.04 166 / .06);
}

.inspection-side-panel .agent-card {
  min-height: 0;
  gap: 6px;
  padding: 9px 10px;
}

.inspection-side-panel .agent-card-top,
.inspection-side-panel .agent-card-foot {
  gap: 7px;
}

.inspection-side-panel .agent-card-top strong {
  font-size: 12px;
}

.inspection-side-panel .agent-card-top span,
.inspection-side-panel .agent-card-foot {
  font-size: 10px;
}

.inspection-side-panel .agent-card p {
  font-size: 11px;
  line-height: 1.5;
}

.inspection-side-panel .agent-card-foot {
  padding-top: 6px;
}

.agent-card.ok {
  border-color: oklch(70% 0.14 158 / .38);
}

.agent-card.bad {
  border-color: oklch(62% 0.18 25 / .48);
}

.agent-card.pending,
.agent-card.muted {
  border-color: oklch(68% 0.11 82 / .28);
}

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

.agent-card-top strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.agent-card-top span,
.agent-card-foot {
  color: var(--muted);
  font-size: 12px;
}

.agent-card p {
  flex: 1;
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.agent-card-foot {
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}

.report-box {
  font-family: var(--font-ui);
  font-size: 14px;
}

.status-line {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-2);
}

.code {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
}

iframe.report-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: oklch(96% 0.008 190);
}

.nav {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: 14px;
  transform: translateX(-50%);
  width: min(420px, calc(100vw - 48px));
  z-index: 50;
  height: 56px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 6px;
  border: 1px solid oklch(66% 0.13 166 / .28);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, oklch(15% 0.044 164 / .92), oklch(5% 0.02 168 / .95)),
    radial-gradient(circle at 50% 0%, oklch(70% 0.14 166 / .12), transparent 68%);
  box-shadow: 0 18px 46px oklch(3% 0.018 166 / .5), inset 0 1px 0 oklch(92% 0.04 166 / .08);
  backdrop-filter: blur(18px) saturate(130%);
}

.nav button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: oklch(74% 0.045 166 / .7);
  cursor: pointer;
  font-size: 16px;
  font-weight: 900;
  transition: background .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.nav button::before {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);

  background: oklch(20% 0.05 164 / .82);
  color: oklch(78% 0.15 166);
  box-shadow: inset 0 0 0 1px oklch(68% 0.12 166 / .16);
  font-size: 16px;
}

.nav button[data-page="dashboard"]::before { content: "\2302"; }
.nav button[data-page="yolo"]::before { content: "\25CE"; }

.nav button:hover,
.nav button.active {
  border-color: oklch(72% 0.14 166 / .44);
  background:
    linear-gradient(180deg, oklch(24% 0.06 164 / .82), oklch(13% 0.04 168 / .88)),
    radial-gradient(circle at 50% 0%, oklch(74% 0.14 166 / .2), transparent 70%);
  color: var(--text);
  box-shadow: 0 0 22px oklch(70% 0.14 166 / .13), inset 0 1px 0 oklch(92% 0.04 166 / .1);
}

@media (max-width: 1500px) {
  .topbar { height: 60px; }
  .title { font-size: 22px; left: 31%; right: 31%; }
  .stats { height: 74px; padding: 10px 16px; gap: 8px; }
  .stat { padding: 0 10px; gap: 10px; }
  .stat .value { font-size: 21px; }
  .page { padding: 12px 16px 78px; gap: 12px; }
  .page.dashboard { grid-template-columns: 285px minmax(500px, 1fr) 300px; }
  .page.yolo {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }
  .inspection-workspace {
    grid-template-columns: minmax(520px, 1fr) minmax(340px, 400px);
    gap: 12px;
  }
  .nav {
    height: 52px;
    width: min(420px, calc(100vw - 32px));
  }

  .dashboard .col:first-child {
    left: 18px;
    top: 108px;
    width: 278px;
  }

  .dashboard-side {
    right: 18px;
    top: 108px;
    width: 292px;
    grid-template-rows: 220px minmax(210px, 236px) 164px;
  }

  .twin-viewport {
    left: 324px;
    right: 338px;
  }

  .map-hud {
    left: 360px;
    right: 372px;
  }
}

@media (max-width: 1400px) {
  .page.yolo {
    grid-template-columns: minmax(0, 1fr);
  }

  .inspection-workspace {
    grid-template-columns: minmax(480px, 1fr) minmax(320px, 380px);
  }

  .process-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1280px) {
  html,
  body {
    overflow: auto;
  }

  .app {
    height: auto;
    min-width: 0;
  }

  .title {
    position: static;
    flex: 1;
    min-width: 0;
    max-width: 100%;
    font-size: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
  }

  .topbar {
    flex-wrap: wrap;
    height: auto;
    min-height: 72px;
    padding: 10px 14px;
  }

  .top-left,
  .top-right {
    font-size: 12px;
  }

  #weatherText {
    display: none;
  }

  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    height: auto;
  }

  .stat {
    min-height: 62px;
  }

  .page {
    grid-template-columns: 1fr !important;
    height: auto;
    overflow: visible;
    padding-bottom: 86px;
  }

  .page.yolo {
    grid-template-rows: auto auto;
    padding-top: 12px;
  }

  .app:has(.page.yolo.active) .stats {
    height: auto;
    margin: 12px 16px 0;
  }

  .inspection-workspace {
    height: auto;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .inspection-media-panel .panel-body {
    min-height: 460px;
  }

  .inspection-actions {
    grid-template-columns: 1fr;
  }

  .process-steps {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .result-flow {
    grid-template-rows: auto auto auto auto auto;
    overflow: visible;
  }

  .inspection-side-panel .result-block.grow {
    max-height: none;
    overflow: visible;
  }

  .inspection-side-panel {
    height: auto;
    max-height: none;
  }

  .agent-consultation-grid {
    max-height: none;
    overflow: visible;
  }

  .inspection-report-panel {
    min-height: 260px;
  }

  .inspection-report-panel .report-box {
    height: auto;
    min-height: 220px;
    max-height: none;
  }

  .dashboard .col:first-child {
    display: flex;
    position: static;
    width: auto;
    max-height: none;
  }

  .dashboard-side {
    display: flex;
    position: static;
    width: auto;
    max-height: none;
  }

  .map {
    min-height: 560px;
  }

  .dashboard .map {
    position: relative;
    inset: auto;
    min-height: 620px;
    order: -1;
  }

  .scene-title {
    top: 22px;
  }

  .twin-viewport {
    inset: 72px 24px 96px;
  }

  .map-hud {
    left: 24px;
    right: 24px;
  }

  .panel {
    min-height: 260px;
  }

  .nav {
    bottom: 10px;
    width: calc(100vw - 24px);
  }
}

/* Final overview-only overrides: keep inspection page untouched. */
.page.dashboard {
  background:
    linear-gradient(90deg, oklch(54% 0.11 168 / .08) 1px, transparent 1px),
    linear-gradient(0deg, oklch(54% 0.11 168 / .07) 1px, transparent 1px),
    radial-gradient(ellipse at 50% 34%, oklch(43% 0.13 154 / .18), transparent 48%),
    linear-gradient(180deg, oklch(9% 0.032 178), oklch(4% 0.018 180));
  background-size: 42px 42px, 42px 42px, auto, auto;
}

@media (max-width: 720px) {
  .inspection-workspace-title {
    min-height: 82px;
    flex-wrap: wrap;
    align-content: center;
  }

  .inspection-workspace-title > span {
    width: 100%;
  }

  .inspection-mode-switch {
    width: 100%;
  }

  .inspection-workspace-title > small {
    display: none;
  }

  .live-inspection-pane.active {
    grid-template-rows: minmax(320px, 52vh) auto auto;
  }

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

  .live-metric-strip > div:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line-soft);
  }

  .live-metric-strip > div:nth-child(4) {
    border-top: 1px solid var(--line-soft);
  }

  .live-evidence-row {
    grid-template-columns: 1fr;
  }

  .live-evidence-block {
    padding: 8px 4px;
  }

  .live-evidence-block + .live-evidence-block {
    border-left: 0;
    border-top: 1px solid var(--line-soft);
  }

  .agent-consultation-grid,
  .consultation-decision {
    grid-template-columns: 1fr;
  }

  .decision-line {
    align-items: flex-start;
  }

  .agent-card-top,
  .agent-card-foot {
    align-items: flex-start;
  }
}

.page.dashboard::before,
.page.dashboard::after {
  content: "";
  position: absolute;
  left: 19%;
  right: 19%;
  z-index: 9;
  height: 34px;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, oklch(73% 0.15 172 / .48), transparent),
    linear-gradient(90deg, transparent 0 7%, oklch(68% 0.14 176 / .34) 7% 19%, transparent 19% 81%, oklch(68% 0.14 176 / .34) 81% 93%, transparent 93%);
  clip-path: polygon(0 45%, 13% 45%, 16% 0, 84% 0, 87% 45%, 100% 45%, 100% 55%, 86% 55%, 83% 100%, 17% 100%, 14% 55%, 0 55%);
  opacity: .78;
}

.page.dashboard::before { top: 70px; }

.page.dashboard::after {
  bottom: 58px;
  transform: rotate(180deg);
  opacity: .46;
}

.dashboard .col:first-child,
.dashboard-side {
  top: 124px;
  width: clamp(292px, 21vw, 342px);
  max-height: calc(100% - 214px);
  gap: 12px;
}

.dashboard .col:first-child { left: 22px; }
.dashboard-side { right: 22px; }

.dashboard .panel {
  position: relative;
  border-radius: 0;
  border-color: oklch(70% 0.14 174 / .36);
  background:
    linear-gradient(135deg, oklch(69% 0.14 174 / .2) 0 1px, transparent 1px 28px),
    linear-gradient(315deg, oklch(69% 0.14 174 / .16) 0 1px, transparent 1px 26px),
    linear-gradient(180deg, oklch(15% 0.048 172 / .82), oklch(5% 0.02 178 / .66));
  box-shadow:
    0 16px 34px oklch(3% 0.018 174 / .44),
    inset 0 0 22px oklch(65% 0.12 170 / .08),
    inset 0 1px 0 oklch(92% 0.04 170 / .08);
  clip-path: polygon(0 12px, 12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px));
}

.dashboard .panel-title {
  min-height: 40px;
  padding: 0 14px 0 18px;
  border-bottom: 0;
  background: linear-gradient(90deg, oklch(23% 0.078 166 / .92), oklch(8% 0.028 178 / .38));
  color: oklch(92% 0.04 178);
  font-size: 15px;
  text-shadow: 0 0 12px oklch(75% 0.15 176 / .36);
}

.dashboard .panel-title::before {
  content: "";
  width: 8px;
  height: 18px;
  flex: 0 0 auto;
  background: linear-gradient(180deg, oklch(82% 0.17 176), oklch(62% 0.13 152));
  box-shadow: 0 0 16px oklch(75% 0.16 176 / .52);
  clip-path: polygon(0 0, 100% 18%, 100% 100%, 0 82%);
}

.dashboard .map {
  inset: 0 0 62px;
  background:
    radial-gradient(ellipse at 50% 56%, oklch(51% 0.15 148 / .24), transparent 42%),
    radial-gradient(ellipse at 50% 17%, oklch(66% 0.12 190 / .1), transparent 32%),
    linear-gradient(90deg, oklch(45% 0.11 170 / .08) 1px, transparent 1px),
    linear-gradient(0deg, oklch(45% 0.11 170 / .08) 1px, transparent 1px),
    linear-gradient(160deg, oklch(11% 0.034 172), oklch(3% 0.016 178));
  background-size: auto, auto, 54px 54px, 54px 54px, auto;
}

.dashboard .map::after {
  z-index: 13;
  background:
    linear-gradient(90deg, oklch(3% 0.015 178 / .78), transparent 23% 77%, oklch(3% 0.015 178 / .78)),
    linear-gradient(0deg, oklch(3% 0.015 178 / .7), transparent 24% 72%, oklch(3% 0.015 178 / .32)),
    radial-gradient(ellipse at 50% 58%, transparent 28%, oklch(3% 0.015 178 / .2) 68%, oklch(2% 0.012 178 / .72) 100%);
}

.agri-map-grid {
  position: absolute;
  inset: 92px calc(clamp(292px, 21vw, 342px) + 56px) 104px calc(clamp(292px, 21vw, 342px) + 56px);
  z-index: 2;
  pointer-events: none;
  border: 1px solid oklch(68% 0.14 174 / .22);
  background:
    linear-gradient(90deg, transparent 0 48%, oklch(74% 0.16 176 / .2) 49% 51%, transparent 52%),
    linear-gradient(0deg, transparent 0 48%, oklch(74% 0.16 176 / .16) 49% 51%, transparent 52%),
    repeating-linear-gradient(90deg, oklch(74% 0.16 176 / .08) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg, oklch(74% 0.16 176 / .08) 0 1px, transparent 1px 72px);
  transform: perspective(900px) rotateX(61deg);
  transform-origin: center bottom;
  opacity: .56;
}

.agri-map-shell {
  position: absolute;
  inset: 96px calc(clamp(292px, 21vw, 342px) + 54px) 96px calc(clamp(292px, 21vw, 342px) + 54px);
  z-index: 14;
  pointer-events: none;
}

.agri-corner {
  position: absolute;
  width: 54px;
  height: 54px;
  border-color: oklch(78% 0.17 176 / .7);
  filter: drop-shadow(0 0 10px oklch(74% 0.16 176 / .42));
}

.agri-corner.c1 { left: 0; top: 0; border-top: 2px solid; border-left: 2px solid; }
.agri-corner.c2 { right: 0; top: 0; border-top: 2px solid; border-right: 2px solid; }
.agri-corner.c3 { left: 0; bottom: 0; border-bottom: 2px solid; border-left: 2px solid; }
.agri-corner.c4 { right: 0; bottom: 0; border-bottom: 2px solid; border-right: 2px solid; }

.farm-beacon {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid oklch(92% 0.08 92);
  border-radius: 50%;
  background: oklch(78% 0.17 98);
  box-shadow: 0 0 0 8px oklch(78% 0.17 98 / .14), 0 0 26px oklch(78% 0.17 98 / .62);
  animation: beaconPing 2.2s ease-in-out infinite;
}

.farm-beacon.b1 { left: 28%; top: 38%; }
.farm-beacon.b2 { left: 54%; top: 28%; animation-delay: .45s; }
.farm-beacon.b3 { right: 26%; top: 55%; animation-delay: .9s; }

.farm-signal {
  position: absolute;
  left: 50%;
  top: 43%;
  width: 220px;
  height: 220px;
  transform: translate(-50%, -50%);
  border: 1px solid oklch(76% 0.16 176 / .22);
  border-radius: 50%;
  box-shadow: inset 0 0 0 28px oklch(76% 0.16 176 / .04), 0 0 30px oklch(76% 0.16 176 / .1);
  animation: signalSweep 7s linear infinite;
}

.farm-signal::before {
  content: "";
  position: absolute;
  inset: 50% 50% auto 50%;
  height: 1px;
  width: 50%;
  background: linear-gradient(90deg, oklch(80% 0.17 176 / .8), transparent);
  transform-origin: left center;
}

@keyframes beaconPing {
  0%, 100% { transform: scale(.82); opacity: .8; }
  50% { transform: scale(1.24); opacity: 1; }
}

@keyframes signalSweep {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.dashboard .scene-title {
  top: 92px;
  min-width: 292px;
  border-radius: 0;
  border-color: oklch(76% 0.16 176 / .44);
  background:
    linear-gradient(90deg, transparent 0 7%, oklch(17% 0.052 172 / .9) 7% 93%, transparent 93%),
    linear-gradient(180deg, oklch(21% 0.062 168 / .88), oklch(6% 0.02 178 / .5));
  clip-path: polygon(0 50%, 8% 0, 92% 0, 100% 50%, 92% 100%, 8% 100%);
  box-shadow: 0 0 28px oklch(73% 0.16 176 / .22);
}

.dashboard .scene-title b {
  font-size: 19px;
  letter-spacing: 0;
}

.dashboard .scene-title span { color: oklch(77% 0.09 182); }

.dashboard .twin-viewport {
  inset: 82px calc(clamp(292px, 21vw, 342px) + 52px) 94px calc(clamp(292px, 21vw, 342px) + 52px);
}

.dashboard .map-hud {
  left: calc(clamp(292px, 21vw, 342px) + 92px);
  right: calc(clamp(292px, 21vw, 342px) + 92px);
  bottom: 16px;
  gap: 12px;
}

.dashboard .map-hud div {
  border-radius: 0;
  border-color: oklch(72% 0.15 176 / .34);
  background:
    linear-gradient(135deg, oklch(69% 0.14 174 / .18) 0 1px, transparent 1px 22px),
    linear-gradient(180deg, oklch(15% 0.048 172 / .84), oklch(5% 0.02 178 / .74));
  clip-path: polygon(0 10px, 10px 0, calc(100% - 10px) 0, 100% 10px, 100% calc(100% - 10px), calc(100% - 10px) 100%, 10px 100%, 0 calc(100% - 10px));
}

.dashboard .map-hud b {
  color: oklch(94% 0.04 178);
  font-size: 16px;
}

@media (max-width: 1280px) {
  .agri-map-grid,
  .agri-map-shell {
    inset-inline: 28px;
  }

  .dashboard .twin-viewport {
    inset-inline: 28px;
  }
}

@media (max-width: 900px) {
  .page.dashboard::before,
  .page.dashboard::after,
  .agri-map-grid,
  .agri-map-shell {
    display: none;
  }

  .dashboard .col:first-child,
  .dashboard-side {
    position: static;
    width: auto;
    max-height: none;
  }

  .dashboard .map,
  .dashboard .twin-viewport,
  .dashboard .map-hud {
    inset-inline: 24px;
  }
}

/* Command cabin v2: obvious 087-style base for the overview screen. */
.app:has(.page.dashboard.active) {
  background:
    linear-gradient(180deg, oklch(8% 0.035 168 / .92), oklch(3% 0.016 175 / .98)),
    url("/assets/media/base087/bg.jpg") center / cover no-repeat;
}

.app:has(.page.dashboard.active)::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, oklch(2% 0.012 170 / .9), transparent 18% 82%, oklch(2% 0.012 170 / .9)),
    radial-gradient(ellipse at 50% 40%, transparent 0 44%, oklch(2% 0.014 176 / .62) 78%);
}

.topbar {
  height: 82px;
  border-bottom-color: oklch(74% 0.16 174 / .42);
  background:
    url("/assets/media/base087/top.png") center top / min(960px, 58vw) 78px no-repeat,
    linear-gradient(90deg, oklch(5% 0.022 170 / .96), oklch(9% 0.04 168 / .9) 50%, oklch(5% 0.022 170 / .96));
  box-shadow:
    inset 0 -1px 0 oklch(82% 0.17 176 / .38),
    0 16px 42px oklch(2% 0.014 170 / .72);
}

.topbar::before,
.topbar::after {
  content: "";
  position: absolute;
  top: 25px;
  width: 26%;
  height: 1px;
  background: linear-gradient(90deg, transparent, oklch(82% 0.18 176 / .72), transparent);
  box-shadow: 0 0 18px oklch(82% 0.18 176 / .42);
}

.topbar::before { left: 20%; }
.topbar::after { right: 20%; }

.title {
  top: 15px;
  left: 25%;
  right: 25%;
  font-size: clamp(16px, 1.25vw, 24px);
  line-height: 1.2;
  letter-spacing: 0;
  color: oklch(94% 0.04 166);
  text-shadow:
    0 0 14px oklch(82% 0.16 166 / .66),
    0 4px 18px oklch(2% 0.01 170 / .78);
}

.stats {
  top: 96px;
  height: 72px;
  padding: 0 28px;
  gap: 14px;
  z-index: 14;
}

.stat {
  border-radius: 4px;
  border-color: oklch(74% 0.15 170 / .32);
  background:
    linear-gradient(135deg, oklch(71% 0.15 172 / .18) 0 1px, transparent 1px 25px),
    linear-gradient(180deg, oklch(13% 0.052 162 / .86), oklch(3% 0.018 174 / .78));
  box-shadow:
    inset 0 0 22px oklch(58% 0.12 154 / .09),
    0 12px 28px oklch(2% 0.014 170 / .44);
  clip-path: polygon(0 10px, 10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
}

.page.dashboard::before {
  top: 146px;
  left: 28%;
  right: 28%;
  height: 44px;
  background:
    linear-gradient(90deg, transparent, oklch(82% 0.18 176 / .88), transparent),
    url("/assets/media/base087/bottom_icons.png") center / 460px 36px no-repeat;
}

.page.dashboard::after {
  left: 29%;
  right: 29%;
  bottom: 86px;
  height: 54px;
  background:
    url("/assets/media/base087/bottom_icons.png") center / contain no-repeat,
    linear-gradient(90deg, transparent, oklch(70% 0.15 176 / .36), transparent);
  opacity: .72;
}

.dashboard .col:first-child,
.dashboard-side {
  top: 188px;
  width: clamp(360px, 20vw, 420px);
  max-height: calc(100% - 276px);
}

.dashboard .col:first-child { left: 30px; }
.dashboard-side { right: 30px; }

.dashboard .panel {
  border-color: oklch(74% 0.16 174 / .5);
  background:
    linear-gradient(90deg, oklch(10% 0.044 152 / .94), oklch(4% 0.018 170 / .84)),
    url("/assets/media/base087/left.png") left top / 88px auto no-repeat;
  box-shadow:
    inset 0 0 28px oklch(62% 0.14 152 / .18),
    0 18px 44px oklch(2% 0.014 170 / .56);
}

.dashboard-side .panel {
  background:
    linear-gradient(270deg, oklch(10% 0.044 152 / .94), oklch(4% 0.018 170 / .84)),
    url("/assets/media/base087/right.png") right top / 88px auto no-repeat;
}

.dashboard .panel-title {
  min-height: 48px;
  padding-left: 20px;
  background: linear-gradient(90deg, oklch(18% 0.07 150 / .96), oklch(6% 0.024 170 / .48));
  font-size: 20px;
}

.dashboard .panel-title::after {
  content: "";
  margin-left: auto;
  width: 88px;
  height: 12px;
  background: linear-gradient(90deg, transparent, oklch(78% 0.16 176 / .72), transparent);
  clip-path: polygon(0 45%, 76% 45%, 82% 0, 100% 50%, 82% 100%, 76% 55%, 0 55%);
}

.dashboard .map {
  inset: 82px 0 84px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 52%, oklch(30% 0.13 142 / .55), transparent 40%),
    linear-gradient(90deg, oklch(42% 0.12 170 / .1) 1px, transparent 1px),
    linear-gradient(0deg, oklch(42% 0.12 170 / .1) 1px, transparent 1px),
    oklch(3% 0.016 176);
  background-size: auto, 48px 48px, 48px 48px, auto;
}

.dashboard .map::before {
  content: "";
  position: absolute;
  left: 21%;
  right: 21%;
  top: 88px;
  height: 50%;
  z-index: 5;
  pointer-events: none;
  background:
    url("/assets/media/base087/landLevel.png") center / contain no-repeat;
  opacity: .7;
  filter: saturate(1.18) contrast(1.05) drop-shadow(0 18px 26px oklch(2% 0.012 160 / .72));
  transform: perspective(1000px) rotateX(58deg) translateY(-34px);
  transform-origin: center bottom;
}

.dashboard .map::after {
  background:
    linear-gradient(90deg, oklch(2% 0.012 175 / .9), transparent 26% 74%, oklch(2% 0.012 175 / .9)),
    linear-gradient(0deg, oklch(2% 0.012 175 / .82), transparent 24% 68%, oklch(2% 0.012 175 / .58)),
    radial-gradient(ellipse at 50% 48%, transparent 22%, oklch(3% 0.016 176 / .22) 55%, oklch(2% 0.012 176 / .84) 100%);
}

.dashboard .twin3d-canvas {
  opacity: .48;
  filter: saturate(.86) contrast(.82) brightness(.68);
}

.agri-map-grid {
  z-index: 7;
  inset: 172px 23% 154px 23%;
  border-color: oklch(80% 0.16 176 / .38);
  opacity: .86;
  background:
    url("/assets/media/base087/landLevel.png") center / contain no-repeat,
    repeating-linear-gradient(90deg, oklch(78% 0.16 176 / .12) 0 1px, transparent 1px 58px),
    repeating-linear-gradient(0deg, oklch(78% 0.16 176 / .1) 0 1px, transparent 1px 58px);
  filter: drop-shadow(0 0 28px oklch(70% 0.15 166 / .28));
}

.agri-map-shell {
  z-index: 16;
  inset: 172px 22% 148px 22%;
}

.agri-corner {
  width: 92px;
  height: 92px;
  border-color: oklch(84% 0.17 176 / .95);
}

.farm-beacon {
  width: 18px;
  height: 18px;
  border-color: oklch(96% 0.08 92);
}

.farm-signal {
  width: 320px;
  height: 320px;
  border-color: oklch(82% 0.17 176 / .42);
}

.dashboard .scene-title {
  top: 174px;
  min-width: 360px;
  padding: 12px 34px 10px;
  border-width: 2px;
  background:
    linear-gradient(90deg, transparent 0 7%, oklch(11% 0.052 158 / .96) 7% 93%, transparent 93%);
}

.dashboard .scene-title b {
  font-size: 26px;
}

.dashboard .map-hud {
  left: 33%;
  right: 33%;
  bottom: 20px;
  z-index: 19;
}

.dashboard .map-hud div {
  min-height: 76px;
  padding: 14px 20px;
  border-color: oklch(78% 0.16 176 / .48);
  background:
    linear-gradient(180deg, oklch(11% 0.05 152 / .92), oklch(3% 0.016 174 / .88));
  box-shadow: inset 0 0 20px oklch(64% 0.14 154 / .14), 0 14px 32px oklch(2% 0.012 170 / .5);
}

.nav {
  bottom: 16px;
  width: min(560px, calc(100vw - 48px));
  height: 76px;
  border-color: oklch(76% 0.16 176 / .5);
  background:
    url("/assets/media/base087/bottom_icons.png") center / 420px 40px no-repeat,
    linear-gradient(180deg, oklch(10% 0.048 152 / .95), oklch(3% 0.016 174 / .92));
  box-shadow:
    inset 0 0 28px oklch(62% 0.14 152 / .16),
    0 0 32px oklch(68% 0.16 176 / .18);
}

.nav button {
  height: 52px;
  border-radius: 4px;
  font-size: 19px;
}

@media (max-width: 1500px) {
  .dashboard .col:first-child,
  .dashboard-side {
    width: 330px;
  }

  .dashboard .map-hud {
    left: 30%;
    right: 30%;
  }
}

/* Old overview layout tuning: only affects the dashboard page. */
@media (min-width: 1281px) {
  .page.dashboard.active {
    --overview-side-width: clamp(340px, 21vw, 382px);
    padding-bottom: 92px;
  }

  .app:has(.page.dashboard.active) .stats {
    top: 94px;
    height: 78px;
    padding: 0 46px;
    gap: 12px;
  }

  .app:has(.page.dashboard.active) .stat {
    min-height: 72px;
  }

  .dashboard .map {
    inset: 40px 0 76px;
  }

  .dashboard .col:first-child,
  .dashboard-side {
    top: 120px;
    width: var(--overview-side-width);
    max-height: calc(100vh - 168px);
    gap: 12px;
  }

  .dashboard .col:first-child {
    left: 48px;
    grid-template-rows: 230px 250px;
  }

  .dashboard-side {
    right: 48px;
    grid-template-rows: 270px 204px 112px;
  }

  .dashboard .panel-title {
    min-height: 52px;
    font-size: 22px;
  }

  .dashboard .panel-body {
    padding: 12px 14px;
  }

  .dashboard-side .panel:nth-child(3) .panel-body {
    padding: 10px 14px;
  }

  .dashboard-side .panel:nth-child(3) .timeline-item {
    padding: 8px 0;
  }

  .dashboard-side .panel:nth-child(3) .timeline-item em {
    font-size: 11px;
  }

  .dashboard-side .panel:first-child .insight-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .dashboard-side .panel:first-child .insight {
    min-height: 50px;
    padding: 7px 8px;
  }

  .dashboard-side .panel:first-child .insight span {
    font-size: 10px;
  }

  .dashboard-side .panel:first-child .insight strong {
    margin-top: 4px;
    font-size: 16px;
  }

  .dashboard-side .panel:first-child .trend-strip {
    min-height: 50px;
    margin-top: 8px;
    padding: 6px 8px;
  }

  .dashboard-side .panel:first-child .trend-title {
    font-size: 10px;
  }

  .dashboard-side .panel:first-child .trend-bars {
    height: 24px;
    gap: 5px;
    margin-top: 6px;
  }

  .dashboard-side .panel:first-child .donut-block {
    min-height: 68px;
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 8px;
    margin-top: 8px;
    padding: 6px 8px;
  }

  .dashboard-side .panel:first-child .donut {
    width: 56px;
  }

  .dashboard-side .panel:first-child .donut span {
    width: 34px;
    font-size: 12px;
  }

  .dashboard-side .panel:first-child .donut-legend {
    gap: 4px;
  }

  .dashboard-side .panel:first-child .donut-legend p {
    gap: 5px;
    font-size: 11px;
  }

  .dashboard .scene-title {
    top: 108px;
  }

  .agri-map-grid {
    inset: 150px calc(var(--overview-side-width) + 72px) 208px calc(var(--overview-side-width) + 72px);
  }

  .agri-map-shell {
    inset: 142px calc(var(--overview-side-width) + 58px) 160px calc(var(--overview-side-width) + 58px);
  }

  .dashboard .map-hud {
    left: calc(var(--overview-side-width) + 130px);
    right: calc(var(--overview-side-width) + 130px);
    bottom: 84px;
  }

  .dashboard .map-hud div {
    min-height: 66px;
  }

  .app:has(.page.dashboard.active) .nav {
    bottom: 10px;
    height: 66px;
  }

  .app:has(.page.dashboard.active) .nav button {
    height: 46px;
    font-size: 18px;
  }
}

@media (min-width: 1600px) {
  .page.dashboard.active {
    --overview-side-width: 420px;
  }

  .dashboard .col:first-child,
  .dashboard-side {
    top: 140px;
    gap: 14px;
  }

  .dashboard .col:first-child {
    left: 48px;
    grid-template-rows: 250px 292px;
  }

  .dashboard-side {
    right: 48px;
    grid-template-rows: 270px 250px 132px;
  }

  .dashboard .scene-title {
    top: 128px;
  }

  .agri-map-grid {
    inset: 170px calc(var(--overview-side-width) + 82px) 226px calc(var(--overview-side-width) + 82px);
  }

  .agri-map-shell {
    inset: 162px calc(var(--overview-side-width) + 68px) 178px calc(var(--overview-side-width) + 68px);
  }

  .dashboard .map-hud {
    left: calc(var(--overview-side-width) + 160px);
    right: calc(var(--overview-side-width) + 160px);
    bottom: 88px;
  }
}

/* Reference-style overview windows: layout and content match the provided dashboard image. */
@media (min-width: 1281px) {
  .page.dashboard.active {
    --ref-left: clamp(340px, 23.2vw, 372px);
    --ref-right: clamp(356px, 24vw, 392px);
    --ref-gap: 12px;
    --ref-top: 108px;
    --ref-bottom: 78px;
    padding: 0;
  }

  .app:has(.page.dashboard.active) .stats {
    top: 82px;
    height: 90px;
    padding: 0 16px;
    gap: 12px;
  }

  .app:has(.page.dashboard.active) .stat {
    min-height: 82px;
    border-radius: 6px;
    border-color: oklch(56% 0.13 168 / .46);
    background:
      linear-gradient(180deg, oklch(16% 0.055 158 / .92), oklch(7% 0.026 170 / .92)),
      radial-gradient(circle at 0 0, oklch(68% 0.16 154 / .14), transparent 58%);
    clip-path: none;
  }

  .dashboard .col:first-child,
  .dashboard-side {
    top: var(--ref-top);
    bottom: var(--ref-bottom);
    max-height: none;
    gap: var(--ref-gap);
  }

  .dashboard .col:first-child {
    left: 16px;
    width: var(--ref-left);
    grid-template-rows: 248px minmax(0, 1fr);
  }

  .dashboard-side {
    right: 16px;
    width: var(--ref-right);
    grid-template-rows: 230px 184px 152px;
  }

  .dashboard .map {
    inset: var(--ref-top) calc(var(--ref-right) + 28px) var(--ref-bottom) calc(var(--ref-left) + 28px);
    border: 1px solid oklch(56% 0.13 168 / .5);
    border-radius: 6px;
    overflow: hidden;
    background:
      linear-gradient(180deg, oklch(13% 0.046 158 / .7), oklch(4% 0.018 170 / .62)),
      url("/assets/media/tobacco-field-aerial.jpg") center / cover no-repeat;
    box-shadow:
      inset 0 0 0 1px oklch(82% 0.12 160 / .08),
      inset 0 0 42px oklch(2% 0.012 170 / .34),
      0 16px 34px oklch(2% 0.012 170 / .5);
  }

  .dashboard .map.has-orthophoto {
    perspective: 1100px;
    transform-style: preserve-3d;
    background:
      radial-gradient(ellipse at 50% 36%, oklch(72% 0.16 160 / .16), transparent 48%),
      oklch(4% 0.018 170);
  }

  .dashboard .map.has-orthophoto::before {
    content: "";
    position: absolute;
    left: 4%;
    right: 4%;
    top: 12%;
    bottom: 2%;
    border: 1px solid oklch(78% 0.12 170 / .36);
    border-radius: 4px;
    background:
      linear-gradient(180deg, oklch(8% 0.03 165 / .24), oklch(3% 0.015 170 / .46)),
      var(--orthophoto-url) center / cover no-repeat;
    box-shadow:
      inset 0 0 0 1px oklch(82% 0.12 160 / .1),
      inset 0 0 54px oklch(2% 0.012 170 / .4),
      0 32px 54px oklch(2% 0.012 170 / .58);
    transform: rotateX(56deg) rotateZ(-1.5deg) translateY(-8%);
    transform-origin: 50% 72%;
    pointer-events: none;
  }

  .dashboard .map.has-orthophoto::after {
    content: "";
    position: absolute;
    left: 10%;
    right: 10%;
    top: 22%;
    bottom: 14%;
    border-radius: 50%;
    border: 1px solid oklch(72% 0.16 170 / .28);
    box-shadow: 0 0 36px oklch(72% 0.16 170 / .13), inset 0 0 28px oklch(72% 0.16 170 / .08);
    transform: rotateX(58deg) translateY(4%);
    transform-origin: 50% 70%;
    pointer-events: none;
  }

  .dashboard .map.has-orthophoto .agri-map-grid,
  .dashboard .map.has-orthophoto .agri-map-shell,
  .dashboard .map.has-orthophoto .terrain-plane {
    opacity: 0;
  }

  .dashboard .map.has-orthophoto #fieldCards,
  .dashboard .map.has-orthophoto .field-card,
  .dashboard .map.has-orthophoto .field-tag,
  .dashboard .map.has-orthophoto .ortho-field-boundary,
  .dashboard .map.has-orthophoto .ortho-field-label {
    display: none;
  }

  .ortho-field-boundary {
    position: absolute;
    inset: 0;
    border: 2px solid oklch(82% 0.16 160 / .72);
    background: oklch(66% 0.13 160 / .08);
    box-shadow: inset 0 0 0 1px oklch(8% 0.02 180 / .5), 0 0 18px oklch(76% 0.18 155 / .18);
    pointer-events: none;
  }

  .ortho-field-label {
    position: absolute;
    transform: translate(-50%, -50%);
    padding: 3px 7px;
    border: 1px solid oklch(82% 0.16 160 / .46);
    border-radius: 4px;
    background: oklch(6% 0.02 170 / .72);
    color: var(--text);
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
    pointer-events: none;
    white-space: nowrap;
  }

  .dashboard .panel {
    clip-path: none;
    border-radius: 6px;
    border-color: oklch(56% 0.13 168 / .5);
    background:
      linear-gradient(180deg, oklch(15% 0.052 158 / .94), oklch(5% 0.02 170 / .92)),
      radial-gradient(circle at 16% 0, oklch(68% 0.15 154 / .12), transparent 58%);
    box-shadow:
      inset 0 0 0 1px oklch(82% 0.12 160 / .06),
      0 14px 28px oklch(2% 0.012 170 / .44);
  }

  .dashboard .panel-title {
    min-height: 46px;
    padding: 0 14px;
    border-bottom: 1px solid oklch(54% 0.12 166 / .34);
    background: linear-gradient(180deg, oklch(17% 0.058 158 / .92), oklch(10% 0.038 168 / .72));
    color: oklch(94% 0.035 160);
    font-size: 18px;
    line-height: 1;
    text-shadow: none;
  }

  .dashboard .panel-title::before,
  .dashboard .panel-title::after {
    display: none;
  }

  .dashboard .panel-title small {
    margin-left: auto;
    color: oklch(76% 0.045 168);
    font-size: 12px;
    font-weight: 700;
  }

  .dashboard .panel-body {
    padding: 12px 14px;
    overflow: hidden;
  }

  .env-panel .grid2 {
    height: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 0;
  }

  .env-panel .metric {
    align-items: flex-start;
    justify-content: center;
    padding: 10px 12px;
    border: 0;
    border-right: 1px solid oklch(52% 0.11 166 / .28);
    border-bottom: 1px solid oklch(52% 0.11 166 / .28);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .env-panel .metric:nth-child(2n) {
    border-right: 0;
  }

  .env-panel .metric:nth-child(n + 3) {
    border-bottom: 0;
  }

  .metric-label {
    color: oklch(76% 0.045 168);
    font-size: 12px;
    font-weight: 750;
  }

  .metric-value {
    margin-top: 8px;
    color: oklch(96% 0.025 160);
    font-family: var(--font-num);
    font-size: 21px;
    font-weight: 900;
    line-height: 1;
  }

  .metric-value span {
    margin-left: 4px;
    font-size: 13px;
    font-weight: 800;
  }

  .metric-status {
    margin-top: 8px;
    color: oklch(74% 0.17 150);
    font-size: 12px;
    font-weight: 800;
  }

  .alert-panel .table th,
  .alert-panel .table td {
    padding: 9px 8px;
    border-bottom-color: oklch(52% 0.11 166 / .28);
    font-size: 12px;
  }

  .alert-panel .badge {
    min-height: 22px;
    border-radius: 4px;
  }

  .map-titlebar {
    position: absolute;
    inset: 0 0 auto;
    z-index: 26;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 16px;
    border-bottom: 1px solid oklch(54% 0.12 166 / .36);
    background: linear-gradient(180deg, oklch(13% 0.046 158 / .9), oklch(7% 0.026 170 / .64));
  }

  .map-titlebar strong {
    color: oklch(94% 0.035 160);
    font-size: 18px;
  }

  .map-titlebar span {
    display: flex;
    align-items: center;
    gap: 9px;
    color: oklch(76% 0.045 168);
    font-size: 12px;
    white-space: nowrap;
  }

  .risk-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: oklch(70% 0.17 150);
  }

  .risk-dot.mid {
    background: oklch(76% 0.16 80);
  }

  .risk-dot.high {
    background: oklch(66% 0.2 28);
  }

  .dashboard .scene-title {
    display: none;
  }

  .dashboard .map::before {
    display: none;
  }

  .dashboard .map::after {
    background:
      linear-gradient(90deg, oklch(2% 0.012 170 / .32), transparent 22% 78%, oklch(2% 0.012 170 / .32)),
      linear-gradient(0deg, oklch(2% 0.012 170 / .35), transparent 18% 72%, oklch(2% 0.012 170 / .18));
  }

  .dashboard .twin-viewport {
    inset: 48px 0 82px;
  }

  .agri-map-grid {
    inset: 54px 18px 92px;
    border-color: oklch(74% 0.16 150 / .3);
    background:
      linear-gradient(90deg, transparent 0 48%, oklch(74% 0.16 150 / .18) 49% 51%, transparent 52%),
      linear-gradient(0deg, transparent 0 48%, oklch(74% 0.16 150 / .13) 49% 51%, transparent 52%),
      repeating-linear-gradient(90deg, oklch(74% 0.16 150 / .1) 0 1px, transparent 1px 64px),
      repeating-linear-gradient(0deg, oklch(74% 0.16 150 / .08) 0 1px, transparent 1px 64px);
  }

  .agri-map-shell {
    inset: 56px 18px 92px;
  }

  .agri-corner {
    width: 92px;
    height: 92px;
    border-color: oklch(92% 0.03 160 / .9);
  }

  .field-card {
    min-width: 82px;
    padding: 5px 9px;
    border-radius: 4px;
    border-color: oklch(68% 0.15 150 / .65);
    background: oklch(10% 0.035 160 / .86);
    color: oklch(86% 0.045 160);
    box-shadow: 0 0 14px oklch(60% 0.14 150 / .18);
    text-align: center;
  }

  .field-card b {
    display: block;
    color: oklch(95% 0.03 160);
    font-size: 12px;
  }

  .field-card span {
    display: block;
    margin-top: 2px;
    color: oklch(74% 0.15 150);
    font-size: 10px;
  }

  .field-card.watch {
    border-color: oklch(76% 0.17 82 / .82);
    background: oklch(17% 0.048 82 / .9);
  }

  .field-card.danger {
    border-color: oklch(66% 0.2 28 / .82);
    background: oklch(18% 0.06 28 / .9);
  }

  .map-field-tags {
    position: absolute;
    inset: 54px 18px 92px;
    z-index: 29;
    pointer-events: none;
  }

  .field-tag {
    position: absolute;
    transform: translate(-50%, -50%);
    min-width: 72px;
    padding: 5px 9px;
    border: 1px solid oklch(70% 0.16 150 / .72);
    border-radius: 4px;
    background: oklch(9% 0.034 158 / .9);
    color: oklch(94% 0.03 160);
    font-size: 12px;
    font-weight: 850;
    text-align: center;
    box-shadow: 0 0 14px oklch(70% 0.16 150 / .24);
  }

  .field-tag::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -14px;
    width: 8px;
    height: 8px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: oklch(70% 0.17 150);
    box-shadow: 0 0 14px oklch(70% 0.17 150 / .5);
  }

  .field-tag.watch {
    border-color: oklch(76% 0.17 82 / .86);
    color: oklch(92% 0.06 82);
  }

  .dashboard .map-hud {
    left: 14px;
    right: 14px;
    bottom: 14px;
    z-index: 28;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
  }

  .dashboard .map-hud div {
    min-height: 66px;
    padding: 10px 12px;
    border-radius: 5px;
    border-color: oklch(55% 0.13 168 / .52);
    background: linear-gradient(180deg, oklch(13% 0.048 158 / .9), oklch(6% 0.022 170 / .88));
    clip-path: none;
    box-shadow: inset 0 0 18px oklch(58% 0.13 154 / .08);
  }

  .dashboard .map-hud div.warn {
    border-color: oklch(76% 0.16 82 / .62);
    background: linear-gradient(180deg, oklch(19% 0.065 82 / .9), oklch(7% 0.024 90 / .88));
  }

  .dashboard .map-hud b {
    margin-top: 7px;
    font-size: 22px;
  }

  .yolo-overview-panel .panel-body {
    display: grid;
    grid-template-rows: auto auto auto;
    gap: 9px;
  }

  .yolo-overview-panel .insight-grid {
    display: block;
  }

  .yolo-detect-main {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
  }

  .yolo-ring {
    width: 88px;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 50%;
    box-shadow: 0 0 20px oklch(68% 0.18 150 / .28);
  }

  .yolo-ring span {
    width: 58px;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: oklch(7% 0.024 170);
  }

  .yolo-ring b {
    color: oklch(96% 0.025 160);
    font-size: 24px;
    line-height: 1;
  }

  .yolo-ring em {
    color: oklch(76% 0.045 168);
    font-size: 10px;
    font-style: normal;
    text-align: center;
  }

  .yolo-legend {
    display: grid;
    gap: 7px;
    min-width: 0;
  }

  .yolo-legend p {
    display: grid;
    grid-template-columns: 9px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    color: oklch(78% 0.045 168);
    font-size: 12px;
    white-space: nowrap;
  }

  .yolo-legend i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: oklch(70% 0.17 150);
  }

  .yolo-legend i.warn {
    background: oklch(76% 0.16 80);
  }

  .yolo-legend i.ok {
    background: oklch(74% 0.13 125);
  }

  .yolo-legend b {
    color: oklch(94% 0.03 160);
    font-weight: 900;
  }

  .yolo-overview-panel .trend-strip,
  .yolo-overview-panel .donut-block {
    min-height: 0;
    margin-top: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .yolo-overview-panel .trend-title {
    margin-bottom: 5px;
  }

  .yolo-overview-panel .trend-bars {
    height: 26px;
    gap: 5px;
    margin-top: 0;
  }

  .panel-link {
    width: 100%;
    height: 30px;
    border: 1px solid oklch(56% 0.13 168 / .48);
    border-radius: 4px;
    background: oklch(12% 0.04 158 / .78);
    color: oklch(82% 0.045 168);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
  }

  .dashboard .risk-list {
    gap: 4px;
  }

  .dashboard .risk-row {
    display: grid;
    grid-template-columns: 20px minmax(72px, 1fr) 48px minmax(82px, 1.35fr) 42px;
    align-items: center;
    gap: 7px;
    padding: 3px 0;
    border-bottom: 0;
  }

  .rank-no {
    width: 17px;
    height: 17px;
    display: grid;
    place-items: center;
    border-radius: 3px;
    background: oklch(35% 0.08 165);
    color: oklch(90% 0.04 160);
    font-size: 11px;
    font-weight: 900;
  }

  .risk-row:nth-child(1) .rank-no {
    background: oklch(60% 0.2 28);
  }

  .risk-row:nth-child(2) .rank-no,
  .risk-row:nth-child(3) .rank-no {
    background: oklch(72% 0.16 82);
    color: oklch(12% 0.04 82);
  }

  .dashboard .risk-row b,
  .dashboard .risk-row strong,
  .dashboard .risk-row em {
    font-size: 11px;
    white-space: nowrap;
  }

  .dashboard .risk-row em {
    color: oklch(70% 0.17 150);
    font-style: normal;
    font-weight: 900;
  }

  .dashboard .risk-row.mid em {
    color: oklch(76% 0.16 82);
  }

  .dashboard .risk-row.high em {
    color: oklch(66% 0.2 28);
  }

  .dashboard .risk-bar {
    height: 6px;
    margin: 0;
    background: oklch(12% 0.035 158);
  }

  .dashboard .risk-bar i {
    background: oklch(70% 0.17 150);
  }

  .dashboard .risk-row.mid .risk-bar i {
    background: oklch(76% 0.16 82);
  }

  .dashboard .risk-row.high .risk-bar i {
    background: oklch(66% 0.2 28);
  }

  .workflow-panel .panel-body {
    display: grid;
    align-items: center;
  }

  .flow-steps {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .flow-steps::before {
    content: "";
    position: absolute;
    top: 20px;
    left: 12%;
    right: 12%;
    height: 2px;
    background: linear-gradient(90deg, oklch(70% 0.17 150), oklch(70% 0.17 150), oklch(40% 0.06 166));
  }

  .flow-step {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: center;
    gap: 4px;
    color: oklch(78% 0.045 168);
    text-align: center;
  }

  .flow-step span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 2px solid oklch(42% 0.07 166);
    border-radius: 50%;
    background: oklch(8% 0.024 168);
    color: oklch(80% 0.04 166);
    font-weight: 900;
  }

  .flow-step.done span {
    border-color: oklch(70% 0.17 150);
    background: oklch(20% 0.07 150);
    color: oklch(78% 0.17 150);
    box-shadow: 0 0 18px oklch(70% 0.17 150 / .24);
  }

  .flow-step b {
    color: oklch(94% 0.03 160);
    font-size: 12px;
    white-space: nowrap;
  }

  .flow-step em,
  .flow-step small {
    color: oklch(76% 0.045 168);
    font-size: 10px;
    font-style: normal;
  }

  .flow-step.done em {
    color: oklch(70% 0.17 150);
  }

  .app:has(.page.dashboard.active) .nav {
    bottom: 2px;
    height: 54px;
    width: min(560px, calc(100vw - 48px));
  }

  .app:has(.page.dashboard.active) .nav button {
    height: 40px;
    font-size: 17px;
  }
}

@media (min-width: 1600px) {
  .page.dashboard.active {
    --ref-left: 420px;
    --ref-right: 420px;
    --ref-top: 112px;
    --ref-bottom: 86px;
  }

  .dashboard .col:first-child {
    grid-template-rows: 296px minmax(0, 1fr);
  }

  .dashboard-side {
    grid-template-rows: 252px 226px 178px;
  }

  .dashboard .map-hud div {
    min-height: 76px;
  }
}

.dashboard .map.has-orthophoto {
  --ortho-scale: 1.22;
  --ortho-pan-x: 0px;
  --ortho-pan-y: 0px;
  cursor: grab;
  perspective: 1300px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 70%, oklch(68% 0.15 165 / .13), transparent 58%),
    linear-gradient(oklch(42% 0.07 170 / .035) 1px, transparent 1px),
    linear-gradient(90deg, oklch(42% 0.07 170 / .035) 1px, transparent 1px),
    oklch(4% 0.016 170) !important;
  background-size: auto, 80px 80px, 80px 80px, auto;
}

.dashboard .map.has-orthophoto.dragging {
  cursor: grabbing;
}

.dashboard .map.has-orthophoto::before {
  display: none !important;
}

.ortho-3d-stage {
  position: absolute;
  left: 3%;
  right: 3%;
  top: 4%;
  bottom: -8%;
  z-index: 4;
  pointer-events: none;
  transform:
    translate3d(var(--ortho-pan-x), var(--ortho-pan-y), 0)
    scale(var(--ortho-scale))
    rotateX(54deg)
    rotateZ(-1.8deg);
  transform-origin: 50% 72%;
  transform-style: preserve-3d;
  transition: transform .12s ease-out, filter .18s ease-out;
}

.ortho-3d-plane {
  position: absolute;
  inset: 0;
  border: 1px solid oklch(84% 0.13 165 / .38);
  border-radius: 8px;
  background:
    linear-gradient(180deg, oklch(74% 0.13 160 / .08), oklch(7% 0.018 170 / .30)),
    var(--orthophoto-url) center / 100% 100% no-repeat,
    oklch(5% 0.018 170);
  filter: brightness(1.04) contrast(1.14) saturate(1.14);
  opacity: .82;
  box-shadow:
    inset 0 0 0 1px oklch(88% 0.12 160 / .1),
    inset 0 0 80px oklch(4% 0.016 170 / .28),
    0 36px 70px oklch(2% 0.012 170 / .62);
}

.ortho-3d-plane::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    linear-gradient(90deg, oklch(70% 0.15 165 / .10), transparent 18% 78%, oklch(70% 0.15 165 / .08)),
    radial-gradient(ellipse at 54% 44%, transparent 40%, oklch(5% 0.018 170 / .20) 100%);
  pointer-events: none;
}

.dashboard .map.has-orthophoto::after {
  display: none !important;
}

.dashboard .map.has-orthophoto .map-field-tags {
  left: 3%;
  right: 3%;
  top: 4%;
  bottom: -8%;
  z-index: 11;
  transform:
    translate3d(var(--ortho-pan-x), var(--ortho-pan-y), 0)
    scale(var(--ortho-scale))
    rotateX(54deg)
    rotateZ(-1.8deg);
  transform-origin: 50% 72%;
  transform-style: preserve-3d;
}

.dashboard .map.has-orthophoto .agri-map-grid,
.dashboard .map.has-orthophoto .agri-map-shell,
.dashboard .map.has-orthophoto .terrain-plane,
.dashboard .map.has-orthophoto .twin-viewport,
.dashboard .map.has-orthophoto #fieldCards,
.dashboard .map.has-orthophoto .field-card,
.dashboard .map.has-orthophoto .field-tag,
.dashboard .map.has-orthophoto .scene-title,
.dashboard .map.has-orthophoto .scan,
.dashboard .map.has-orthophoto .skyline,
.dashboard .map.has-orthophoto .drone-node,
.dashboard .map.has-orthophoto #detectionMarkers {
  display: none !important;
  opacity: 0;
  visibility: hidden;
}

.ortho-field-pin {
  position: absolute;
  display: inline-grid;
  grid-template-columns: 24px auto;
  align-items: center;
  min-width: 86px;
  transform: translate(-50%, -50%);
  border: 1px solid oklch(82% 0.16 156 / .74);
  border-radius: 4px;
  background: linear-gradient(180deg, oklch(10% 0.036 158 / .94), oklch(6% 0.02 170 / .9));
  color: oklch(94% 0.03 160);
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 0 10px oklch(70% 0.17 150 / .18);
  overflow: hidden;
}

.ortho-field-zone {
  position: absolute;
  inset: 0;
  display: grid;
  border: 1px solid oklch(82% 0.14 165 / .56);
  background: oklch(56% 0.14 150 / .20);
  box-shadow: inset 0 0 28px oklch(74% 0.16 150 / .13), 0 0 16px oklch(70% 0.16 150 / .10);
  color: oklch(90% 0.04 160);
  font-size: 12px;
  font-weight: 900;
  text-shadow: 0 1px 8px oklch(3% 0.012 170 / .9);
  pointer-events: none;
}

.ortho-field-zone b {
  position: absolute;
  left: var(--label-left);
  top: var(--label-top);
  max-width: 86%;
  padding: 2px 8px;
  border: 1px solid oklch(92% 0.12 160 / .28);
  border-radius: 3px;
  background: oklch(6% 0.02 170 / .50);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translate(-50%, -50%) rotateZ(1.8deg) rotateX(-54deg);
}

.ortho-field-zone.green {
  background: oklch(58% 0.16 145 / .22);
  border-color: oklch(75% 0.16 145 / .60);
}

.ortho-field-zone.lime {
  background: oklch(70% 0.15 122 / .18);
  border-color: oklch(82% 0.15 122 / .56);
}

.ortho-field-zone.cyan {
  background: oklch(64% 0.14 185 / .20);
  border-color: oklch(78% 0.13 185 / .58);
}

.ortho-field-zone.teal {
  background: oklch(60% 0.14 168 / .20);
  border-color: oklch(78% 0.13 168 / .60);
}

.ortho-field-zone.blue {
  background: oklch(58% 0.13 220 / .18);
  border-color: oklch(76% 0.12 220 / .54);
}

.ortho-field-zone.orange {
  background: oklch(72% 0.14 78 / .18);
  border-color: oklch(82% 0.14 78 / .56);
}

.ortho-field-zone.red {
  background: oklch(62% 0.18 28 / .18);
  border-color: oklch(72% 0.18 28 / .62);
  box-shadow: inset 0 0 28px oklch(68% 0.18 28 / .12), 0 0 18px oklch(68% 0.18 28 / .16);
}

.ortho-field-pin b {
  display: grid;
  place-items: center;
  height: 24px;
  background: oklch(68% 0.17 150);
  color: oklch(8% 0.026 165);
  font-size: 10px;
}

.ortho-field-pin em {
  max-width: 96px;
  padding: 0 7px;
  overflow: hidden;
  color: oklch(90% 0.05 160);
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard .map.has-orthophoto .map-hud {
  z-index: 30;
  backdrop-filter: blur(8px);
}

.dashboard .map.has-orthophoto .map-titlebar {
  background: linear-gradient(180deg, oklch(7% 0.024 170 / .82), oklch(5% 0.018 170 / .54));
  border-bottom-color: oklch(45% 0.08 166 / .34);
}

.map-zoom-controls {
  position: absolute;
  right: 16px;
  top: 58px;
  z-index: 34;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid oklch(55% 0.12 166 / .48);
  border-radius: 6px;
  background: oklch(6% 0.02 170 / .74);
  box-shadow: 0 10px 24px oklch(2% 0.012 170 / .32);
}

.map-zoom-controls button {
  min-width: 32px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid oklch(58% 0.13 166 / .46);
  border-radius: 4px;
  background: oklch(11% 0.035 166 / .88);
  color: oklch(90% 0.04 160);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.map-zoom-controls button:hover {
  border-color: oklch(75% 0.15 160 / .7);
  background: oklch(18% 0.06 160 / .88);
}

.dashboard .risk-row:not(.mid):not(.high) .risk-bar i {
  background: oklch(70% 0.13 150);
}

.dashboard .risk-row.low .rank-no {
  background: oklch(35% 0.08 165);
  color: oklch(90% 0.04 160);
}
