:root {
  color-scheme: dark;
  --bg: #040a11;
  --panel: rgba(9, 20, 31, 0.88);
  --panel-2: rgba(12, 27, 42, 0.9);
  --line: rgba(130, 165, 200, 0.22);
  --line-strong: rgba(145, 178, 220, 0.34);
  --text: #edf5ff;
  --muted: #9aadc1;
  --green: #52dc80;
  --blue: #39a2ff;
  --violet: #865cff;
  --amber: #ffba2d;
  --red: #ff5b4f;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-width: 1180px;
  min-height: 100vh;
  overflow: auto;
  background:
    radial-gradient(circle at 52% 36%, rgba(42, 120, 145, 0.18), transparent 38%),
    linear-gradient(135deg, #02060b 0%, #06101a 48%, #03070d 100%);
  color: var(--text);
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  letter-spacing: 0;
}

body.auth-active {
  min-width: 0;
  overflow: auto;
}

body.auth-active .app-shell {
  display: none;
}

body:not(.auth-active) .auth-gate {
  display: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.auth-gate {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1.1fr) minmax(360px, 520px);
  gap: 28px;
  align-items: stretch;
  padding: 34px;
  background:
    linear-gradient(90deg, rgba(3, 9, 16, 0.86), rgba(3, 10, 18, 0.62)),
    repeating-linear-gradient(90deg, rgba(130, 165, 200, 0.05) 0 1px, transparent 1px 74px),
    repeating-linear-gradient(0deg, rgba(130, 165, 200, 0.04) 0 1px, transparent 1px 74px);
}

.auth-visual,
.auth-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(7, 17, 28, 0.84);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

.auth-visual {
  display: grid;
  align-content: space-between;
  min-height: 680px;
  padding: 34px;
  overflow: hidden;
}

.auth-visual .brand {
  height: auto;
  padding: 0;
  border: 0;
}

.auth-copy {
  max-width: 760px;
}

.auth-copy h1 {
  margin: 10px 0 16px;
  max-width: 760px;
  font-size: clamp(42px, 5vw, 78px);
  line-height: 0.96;
}

.auth-copy p {
  max-width: 620px;
  margin: 0;
  color: #bfd0e1;
  font-size: 18px;
  line-height: 1.55;
}

.auth-metrics,
.mission-home-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.auth-metrics span,
.mission-home-metrics span {
  display: grid;
  gap: 5px;
  min-height: 78px;
  padding: 14px;
  border: 1px solid rgba(130, 165, 200, 0.18);
  border-radius: 8px;
  background: rgba(3, 12, 20, 0.52);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-metrics b,
.mission-home-metrics b {
  color: var(--text);
  font-size: 24px;
  text-transform: none;
}

.auth-panel {
  align-self: center;
  display: grid;
  gap: 18px;
  padding: 22px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 5px;
  border: 1px solid rgba(130, 165, 200, 0.16);
  border-radius: 8px;
  background: rgba(3, 12, 20, 0.56);
}

.auth-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-tabs button.active {
  color: #e9fff0;
  background: rgba(29, 126, 67, 0.46);
}

.auth-form {
  display: none;
  gap: 14px;
}

.auth-form.active {
  display: grid;
}

.auth-form h2 {
  margin: 0;
  font-size: 30px;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: #cbd9e8;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-form input,
.auth-form select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(3, 12, 20, 0.82);
}

.auth-message {
  margin: 0;
  min-height: 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.app-shell {
  display: grid;
  grid-template-columns: 282px 1fr;
  grid-template-rows: 70px minmax(0, 1fr);
  width: 100vw;
  min-height: 100vh;
  height: auto;
  overflow: visible;
}

.topbar {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 282px minmax(430px, 1fr) 170px 150px 200px 220px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(3, 9, 16, 0.92);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.34);
}

.brand,
.product,
.clock,
.top-icons,
.profile {
  height: 100%;
  display: flex;
  align-items: center;
  border-right: 1px solid rgba(130, 165, 200, 0.11);
}

.brand {
  gap: 12px;
  padding: 0 25px;
}

.brand strong {
  font-size: 22px;
  line-height: 1;
}

.brand-mark {
  position: relative;
  width: 34px;
  height: 25px;
}

.brand-mark span {
  position: absolute;
  height: 4px;
  border-radius: 999px;
  background: #fff;
  transform-origin: left center;
}

.brand-mark span:nth-child(1) {
  width: 34px;
  left: 0;
  top: 1px;
  transform: skewX(-30deg);
}

.brand-mark span:nth-child(2) {
  width: 25px;
  left: 7px;
  top: 10px;
  transform: skewX(-20deg);
}

.brand-mark span:nth-child(3) {
  width: 15px;
  left: 14px;
  top: 19px;
  transform: skewX(-12deg);
}

.product {
  gap: 14px;
  padding-left: 28px;
}

.product strong {
  font-size: 28px;
}

.product span,
.clock span,
.profile span,
.health small {
  color: var(--muted);
  font-size: 12px;
}

.health {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 160px;
  padding: 8px 14px;
  border: 1px solid rgba(82, 220, 128, 0.28);
  border-radius: 11px;
  background: rgba(25, 47, 45, 0.45);
}

.health strong {
  display: block;
  color: var(--green);
  font-size: 12px;
}

.pulse {
  width: 15px;
  height: 15px;
  border: 2px solid var(--green);
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(82, 220, 128, 0.75);
}

.clock {
  justify-content: center;
  flex-direction: column;
  gap: 3px;
}

.clock strong {
  font-size: 16px;
}

.top-icons {
  justify-content: center;
  gap: 18px;
}

.top-icons button,
.profile button,
.map-toolbar button,
.map-tools button {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #dcecff;
  background: rgba(11, 23, 35, 0.85);
}

.top-icons button,
.profile button {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-color: transparent;
}

.profile {
  gap: 10px;
  padding: 0 16px;
  border-right: 0;
}

.profile .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 31%, #ffd6c2 0 16%, transparent 17%),
    linear-gradient(#1e3150 0 52%, #203f69 53%),
    radial-gradient(circle at 50% 38%, #673522 0 28%, #0b1221 29%);
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.profile strong {
  display: block;
  font-size: 14px;
}

.profile button {
  margin-left: auto;
}

.sidebar {
  grid-row: 2;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(5, 13, 22, 0.96), rgba(4, 11, 18, 0.96)),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 11px);
}

.mission-card {
  margin: 16px 12px 18px;
  padding: 17px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(9, 22, 35, 0.76);
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
}

.mission-card h1 {
  margin: 14px 0 8px;
  font-size: 18px;
}

.mission-card p {
  margin: 0 0 17px;
  color: #c5d3e5;
}

.mission-status {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.mission-status strong {
  display: grid;
  place-items: center;
  background: rgba(106, 78, 212, 0.32);
  color: #a993ff;
  font-size: 13px;
}

.mission-status span {
  padding: 11px 13px;
  text-align: center;
}

.mission-back {
  width: 100%;
  min-height: 38px;
  margin-top: 12px;
  border: 1px solid rgba(57, 162, 255, 0.34);
  border-radius: 8px;
  color: #dcecff;
  background: rgba(20, 62, 100, 0.38);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.mission-back:hover {
  border-color: rgba(57, 162, 255, 0.7);
  background: rgba(37, 94, 145, 0.5);
}

.nav {
  display: grid;
  gap: 7px;
  padding: 0 12px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 17px;
  min-height: 52px;
  padding: 0 17px;
  border-radius: 8px;
  color: #c4d1e2;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 14px;
}

.nav a.active {
  color: #fff;
  font-weight: 700;
  background: linear-gradient(90deg, rgba(54, 151, 255, 0.24), rgba(54, 151, 255, 0.06));
}

.nav b {
  margin-left: auto;
  width: 28px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(240, 83, 73, 0.78);
  font-size: 12px;
}

.icon {
  width: 19px;
  height: 19px;
  display: inline-block;
  border: 1px solid #d4e3f8;
  border-radius: 4px;
  opacity: 0.9;
}

.grid {
  border: 0;
  background:
    linear-gradient(90deg, var(--blue) 0 7px, transparent 7px 12px, var(--blue) 12px),
    linear-gradient(var(--blue) 0 7px, transparent 7px 12px, var(--blue) 12px);
}

.pin { border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.route { border-style: dashed; }
.drone { border-radius: 50%; }
.box { border-radius: 2px; }
.shield { border-radius: 50% 50% 8px 8px; }
.alert { clip-path: polygon(50% 0, 100% 100%, 0 100%); border-radius: 0; }
.log { border-radius: 3px; }
.gear { border-radius: 50%; }

.planner {
  width: calc(100% - 40px);
  margin: auto 20px 50px;
  padding: 15px;
  border: 1px solid rgba(162, 117, 255, 0.7);
  border-radius: 8px;
  color: #d5bfff;
  background: linear-gradient(90deg, rgba(116, 68, 225, 0.72), rgba(87, 55, 169, 0.72));
  text-transform: uppercase;
}

.planner.active {
  box-shadow: 0 0 0 1px rgba(162, 117, 255, 0.45), 0 0 24px rgba(116, 68, 225, 0.28);
  color: #fff;
}

.planner span {
  margin-right: 10px;
}

.side-footer {
  padding: 28px 25px 34px;
  border-top: 1px solid rgba(130, 165, 200, 0.12);
}

.side-footer strong {
  display: block;
  font-size: 23px;
}

.side-footer span {
  color: var(--muted);
  font-size: 12px;
}

.dashboard {
  display: grid;
  grid-template-columns: minmax(610px, 1.82fr) minmax(280px, 0.78fr) minmax(250px, 0.62fr);
  grid-template-rows: minmax(325px, 1.3fr) 215px 1fr;
  gap: 12px;
  padding: 12px;
  height: auto;
  min-height: 0;
  overflow: visible;
}

.mobile-command-dock {
  display: none;
}

.dashboard.workspace-mode {
  display: block;
  height: calc(100vh - 70px);
  overflow: auto;
  align-content: start;
}

.dashboard.workspace-mode > :not(.workspace-view) {
  display: none;
}

.app-shell.missions-home,
.app-shell.planner-home,
.app-shell.drone-setup-home {
  grid-template-columns: 1fr;
}

.app-shell.missions-home .topbar,
.app-shell.planner-home .topbar,
.app-shell.drone-setup-home .topbar {
  grid-column: 1;
}

.app-shell.missions-home .sidebar,
.app-shell.planner-home .sidebar,
.app-shell.drone-setup-home .sidebar {
  display: none;
}

.app-shell.missions-home .dashboard,
.app-shell.planner-home .dashboard,
.app-shell.drone-setup-home .dashboard {
  grid-column: 1;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  padding: 24px;
  overflow: auto;
}

.mission-start,
.mission-planner-screen,
.drone-setup-screen {
  display: none;
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  min-height: 0;
}

.app-shell.missions-home .dashboard > :not(.mission-start),
.app-shell.planner-home .dashboard > :not(.mission-planner-screen),
.app-shell.drone-setup-home .dashboard > :not(.drone-setup-screen) {
  display: none;
}

.app-shell.missions-home .mission-start,
.app-shell.planner-home .mission-planner-screen,
.app-shell.drone-setup-home .drone-setup-screen {
  display: grid;
}

.mission-start,
.mission-planner-screen,
.drone-setup-screen {
  align-content: start;
  gap: 16px;
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
}

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

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

.mission-start-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(9, 20, 31, 0.78);
}

.mission-command-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.85fr);
  gap: 20px;
  align-items: end;
  min-height: 230px;
  padding: 24px;
  border: 1px solid rgba(57, 162, 255, 0.24);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(11, 30, 46, 0.95), rgba(5, 14, 24, 0.94)),
    repeating-linear-gradient(90deg, rgba(82, 220, 128, 0.06) 0 1px, transparent 1px 58px),
    repeating-linear-gradient(0deg, rgba(57, 162, 255, 0.05) 0 1px, transparent 1px 58px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03), 0 24px 55px rgba(0, 0, 0, 0.26);
}

.mission-command-hero h2 {
  max-width: 740px;
  margin: 8px 0 10px;
  font-size: 44px;
  line-height: 1.02;
}

.mission-command-hero p {
  max-width: 720px;
  margin: 0;
  color: #c5d7ea;
  font-size: 16px;
  line-height: 1.55;
}

.mission-start-header h1 {
  margin: 6px 0 0;
  font-size: 30px;
}

.primary-action,
.secondary-action,
.danger-action {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(82, 220, 128, 0.42);
  border-radius: 8px;
  color: #e9fff0;
  background: rgba(29, 126, 67, 0.46);
  font-weight: 800;
  text-transform: uppercase;
}

.secondary-action {
  border-color: var(--line);
  color: #dcecff;
  background: rgba(11, 23, 35, 0.88);
}

.danger-action {
  border-color: rgba(255, 91, 79, 0.42);
  color: #ffd9d6;
  background: rgba(116, 30, 28, 0.42);
}

.mission-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
}

.mission-tile {
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  gap: 16px;
  padding: 20px;
  min-height: 300px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(12, 28, 43, 0.95), rgba(7, 17, 28, 0.95)),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 12px);
  text-align: left;
  color: var(--text);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.mission-tile:hover {
  border-color: rgba(57, 162, 255, 0.55);
  background:
    linear-gradient(145deg, rgba(14, 34, 52, 0.98), rgba(7, 17, 28, 0.96)),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 12px);
  box-shadow: 0 0 0 1px rgba(57, 162, 255, 0.18), 0 18px 45px rgba(0, 0, 0, 0.22);
}

.mission-tile h2 {
  margin: 0;
  font-size: 22px;
}

.mission-tile p {
  margin: 0;
  color: #bfd0e1;
  line-height: 1.45;
}

.mission-tile-meta,
.mission-tile-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mission-tile-meta span,
.mission-tile-stats span {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(130, 165, 200, 0.14);
  border-radius: 8px;
  background: rgba(3, 12, 20, 0.45);
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.mission-tile-meta b,
.mission-tile-stats b {
  color: #fff;
  font-size: 13px;
  text-transform: none;
}

.mission-status-pill {
  justify-self: start;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(82, 220, 128, 0.16);
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.mission-tile-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.mission-tile-actions button {
  flex: 1 1 150px;
}

.planner-layout {
  display: grid;
  grid-template-columns: minmax(420px, 0.85fr) minmax(360px, 1fr);
  gap: 16px;
}

.planner-form,
.planner-preview,
.planner-map-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(9, 20, 31, 0.82);
}

.planner-form {
  display: grid;
  gap: 14px;
}

.planner-form label {
  display: grid;
  gap: 7px;
  color: #cbd9e8;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.planner-form input,
.planner-form select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(3, 12, 20, 0.76);
}

.drone-assignment {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 10px;
  border: 1px solid rgba(130, 165, 200, 0.2);
  border-radius: 8px;
  background: rgba(3, 12, 20, 0.46);
}

.transit-orbit-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(82, 220, 128, 0.28);
  border-radius: 8px;
  background: rgba(5, 25, 30, 0.55);
}

.transit-orbit-fields[hidden] {
  display: none;
}

.transit-orbit-fields legend {
  padding: 0 6px;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

@media (max-width: 620px) {
  .transit-orbit-fields {
    grid-template-columns: 1fr;
  }
}

.drone-assignment legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.drone-assignment label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  color: #d7e6f6;
  font-size: 12px;
  font-weight: 800;
  text-transform: none;
}

.drone-assignment input {
  width: 15px;
  height: 15px;
  min-height: 0;
  padding: 0;
  accent-color: var(--green);
}

.planner-preview {
  display: grid;
  align-content: start;
  gap: 16px;
}

.planner-side {
  display: grid;
  gap: 16px;
  align-content: start;
}

.planner-map-panel {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 16px;
}

.planner-map-panel h2 {
  margin: 5px 0 0;
  font-size: 24px;
}

.planner-map-panel #plannerAreaMap {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 260px;
  border: 1px solid rgba(130, 165, 200, 0.22);
  border-radius: 8px;
  background: #071827;
  cursor: crosshair;
  overflow: hidden;
}

.planner-map-panel #plannerAreaMap.box-mode {
  cursor: crosshair;
  box-shadow: 0 0 0 2px rgba(255, 186, 45, 0.35), 0 0 28px rgba(255, 186, 45, 0.18);
}

.planner-map-panel #plannerAreaMap.zoom-locked {
  border-color: rgba(255, 186, 45, 0.68);
  box-shadow: inset 0 0 0 1px rgba(255, 186, 45, 0.25);
}

.planner-map-panel #plannerAreaMap.box-mode.zoom-locked {
  box-shadow: inset 0 0 0 1px rgba(255, 186, 45, 0.25), 0 0 0 2px rgba(255, 186, 45, 0.35), 0 0 28px rgba(255, 186, 45, 0.18);
}

.planner-map-panel .leaflet-container {
  background: #071827;
  color: #172535;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
}

.planner-map-panel .leaflet-control-zoom a {
  color: #edf5ff;
  background: rgba(7, 17, 28, 0.94);
  border-color: rgba(130, 165, 200, 0.26);
}

.planner-map-panel .leaflet-control-attribution {
  color: #6f8094;
  background: rgba(3, 12, 20, 0.72);
}

.planner-map-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.planner-map-toolbar button,
.planner-map-toolbar label {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #dcecff;
  background: rgba(11, 23, 35, 0.88);
  font-weight: 800;
  text-transform: uppercase;
}

.planner-map-toolbar button.active {
  border-color: rgba(255, 186, 45, 0.58);
  color: #fff4ca;
  background: rgba(132, 91, 19, 0.56);
}

.planner-map-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.planner-map-toolbar input {
  width: 52px;
  min-height: 26px;
  padding: 0 6px;
  border: 1px solid rgba(130, 165, 200, 0.22);
  border-radius: 6px;
  color: var(--text);
  background: rgba(3, 12, 20, 0.82);
}

.planner-map-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.planner-map-panel::before {
  content: "1. Select country  /  2. Select city  /  3. Draw geofence  /  4. Build grid";
  display: block;
  padding: 9px 10px;
  border: 1px solid rgba(82, 220, 128, 0.18);
  border-radius: 8px;
  color: #bfffd1;
  background: rgba(29, 126, 67, 0.12);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.planner-preview h2 {
  margin: 0;
  font-size: 26px;
}

.planner-preview p {
  margin: 0;
  color: #c4d3e4;
  line-height: 1.5;
}

.planner-preview div {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(130, 165, 200, 0.16);
  border-radius: 8px;
  background: rgba(3, 12, 20, 0.45);
}

.planner-preview span {
  color: var(--green);
}

.workspace-view {
  display: block;
  min-height: max-content;
  overflow: visible;
}

.workspace-view[hidden] {
  display: none;
}

.workspace-shell {
  display: grid;
  grid-template-rows: auto auto;
  gap: 12px;
  min-height: 0;
  padding-bottom: 18px;
}

.workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 74px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(15, 29, 43, 0.94), rgba(7, 18, 29, 0.96));
}

.workspace-header h2 {
  margin: 4px 0 0;
  font-size: 24px;
}

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

.workspace-actions button,
.workspace-control button {
  min-height: 34px;
  border: 1px solid rgba(139, 93, 255, 0.55);
  border-radius: 6px;
  color: #eee8ff;
  background: linear-gradient(180deg, rgba(98, 70, 194, 0.88), rgba(70, 48, 150, 0.88));
  font-size: 12px;
  font-weight: 800;
}

.workspace-control button.off {
  border-color: rgba(130, 165, 200, 0.25);
  color: #9fb0c3;
  background: rgba(11, 23, 35, 0.88);
}

.workspace-actions button {
  padding: 0 12px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.workspace-grid.two {
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
}

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

.workspace-panel {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(15, 29, 43, 0.9), rgba(7, 18, 29, 0.92));
}

.workspace-panel.full {
  grid-column: 1 / -1;
}

.workspace-panel h3 {
  margin: 0;
  min-height: 42px;
  padding: 13px 16px 0;
  border-bottom: 1px solid rgba(130, 165, 200, 0.15);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.workspace-panel .detail-table-wrap,
.workspace-panel .detail-grid,
.workspace-panel .timeline,
.workspace-panel .workspace-copy,
.workspace-panel .workspace-controls {
  margin: 14px;
}

.workspace-copy {
  color: #c8d6e6;
  font-size: 13px;
  line-height: 1.5;
}

.workspace-map {
  min-height: 420px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #061522;
}

.live-workspace-map {
  min-height: min(62vh, 680px);
}

#workspaceLeafletMap {
  position: absolute;
  inset: 0;
  z-index: 1;
  min-height: inherit;
  background: #061420;
}

.live-workspace-map #workspaceMapCanvas {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.live-workspace-map .leaflet-control-zoom a {
  border-color: rgba(130, 165, 200, 0.28);
  background: rgba(4, 15, 24, 0.9);
  color: #e8f2ff;
}

.live-workspace-map .leaflet-control-zoom a:hover {
  background: rgba(20, 45, 70, 0.96);
  color: var(--green);
}

.live-workspace-map .live-map-tools {
  z-index: 4;
  top: 86px;
  left: 10px;
}

.live-workspace-map .live-map-tools button {
  border-color: rgba(130, 165, 200, 0.32);
  background: rgba(4, 15, 24, 0.92);
  box-shadow: 0 4px 12px rgba(2, 8, 14, 0.3);
}

.live-workspace-map .live-map-tools button:hover {
  border-color: rgba(82, 220, 128, 0.65);
  color: var(--green);
  background: rgba(13, 35, 48, 0.96);
}

.workspace-map canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
}

.workspace-map-readout {
  position: absolute;
  z-index: 4;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(130, 165, 200, 0.2);
  border-radius: 6px;
  color: #dcecff;
  background: rgba(3, 10, 18, 0.76);
  font: 11px/1.3 monospace;
}

.live-track-panel {
  margin-top: 12px;
}

.live-map-sidebar {
  display: grid;
  min-width: 0;
  gap: 12px;
  align-content: start;
}

.live-map-drone-list {
  display: grid;
  gap: 6px;
  max-height: 330px;
  overflow: auto;
  padding: 10px;
  scrollbar-width: thin;
}

.live-map-drone-row {
  position: relative;
  width: 100%;
  min-height: 58px;
  padding: 0;
  border: 1px solid rgba(130, 165, 200, 0.2);
  border-radius: 6px;
  color: #dcecff;
  background: rgba(6, 18, 29, 0.86);
  text-align: left;
}

.live-map-drone-row:hover,
.live-map-drone-row:focus-within,
.live-map-drone-row.following {
  border-color: rgba(82, 220, 128, 0.68);
  background: rgba(12, 34, 46, 0.96);
  outline: none;
}

.live-map-drone-open {
  display: grid;
  grid-template-columns: minmax(118px, 1.25fr) repeat(3, minmax(52px, 0.6fr));
  gap: 8px;
  width: 100%;
  min-height: 58px;
  padding: 8px 45px 8px 9px;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.live-map-drone-open > span {
  display: grid;
  min-width: 0;
  align-content: center;
}

.live-map-follow {
  position: absolute;
  top: 11px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(130, 165, 200, 0.28);
  border-radius: 6px;
  color: #b9cce0;
  background: rgba(3, 12, 20, 0.82);
  font-size: 17px;
}

.live-map-follow:hover,
.live-map-follow.active {
  border-color: var(--green);
  color: var(--green);
  background: rgba(7, 31, 32, 0.96);
}

.live-map-drone-row b,
.live-map-drone-row small,
.live-map-drone-row em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-map-drone-row b {
  font-size: 11px;
}

.live-map-drone-row small {
  color: #8297ad;
  font-size: 9px;
  text-transform: uppercase;
}

.live-map-drone-identity {
  grid-template-columns: 8px 1fr;
  column-gap: 7px;
}

.live-map-drone-identity i {
  grid-row: 1 / 3;
  align-self: center;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(82, 220, 128, 0.7);
}

.live-map-drone-identity strong {
  font-size: 12px;
}

.live-map-drone-identity em {
  color: var(--green);
  font-size: 8px;
  font-style: normal;
  text-transform: uppercase;
}

.live-map-drone-identity em.warning {
  color: var(--amber);
}

.live-map-drone-task {
  grid-column: 1 / -1;
  display: block !important;
  overflow: hidden;
  color: #9eb1c5;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.vision-pipeline-status {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 12px 12px 0;
  padding: 8px 10px;
  border: 1px solid rgba(82, 220, 128, 0.26);
  border-radius: 5px;
  color: #a8b9c9;
  background: rgba(5, 20, 27, 0.78);
  font: 11px/1.3 monospace;
}

.vision-pipeline-status b {
  color: var(--green);
}

.track-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 180px;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 191, 42, 0.3);
  border-radius: 6px;
  background: rgba(20, 24, 27, 0.72);
}

.track-row.following {
  border-color: rgba(255, 93, 85, 0.55);
  background: rgba(48, 20, 23, 0.55);
}

.track-row > div,
.track-confidence,
.track-assignment {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.track-row span,
.track-row small {
  color: #9fb0c3;
  font-size: 11px;
}

.track-confidence b {
  color: #ffbf2a;
  font-size: 16px;
}

.track-assignment button {
  min-height: 32px;
  border: 1px solid rgba(255, 191, 42, 0.45);
  border-radius: 5px;
  color: #ffe3a0;
  background: rgba(70, 50, 10, 0.72);
}

.track-row.following .track-assignment button {
  border-color: rgba(255, 93, 85, 0.55);
  color: #ffd2cf;
  background: rgba(90, 28, 28, 0.7);
}

.track-assignment button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.planner-checkbox {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.planner-checkbox input {
  width: 16px;
  height: 16px;
  margin: 0;
}

@media (max-width: 700px) {
  .track-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.workspace-control {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(130, 165, 200, 0.12);
}

.workspace-control:last-child {
  border-bottom: 0;
}

.workspace-control span {
  color: #c8d6e6;
  font-size: 13px;
}

.workspace-control small {
  display: block;
  color: #8ea2b7;
}

.workspace-status {
  margin: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(82, 220, 128, 0.24);
  border-radius: 7px;
  color: #d9ffe5;
  background: rgba(82, 220, 128, 0.08);
  font-size: 13px;
  line-height: 1.45;
}

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

.machine-form label {
  display: grid;
  gap: 6px;
  color: #8ea2b7;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.machine-form input,
.machine-form select {
  width: 100%;
  min-height: 36px;
  border: 1px solid rgba(130, 165, 200, 0.22);
  border-radius: 6px;
  color: var(--text);
  background: rgba(3, 12, 20, 0.82);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
}

.fleet-editor {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.fleet-editor-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.fleet-editor-title strong {
  color: var(--text);
  font-size: 13px;
  text-transform: uppercase;
}

.fleet-editor-title span {
  color: var(--muted);
  font-size: 11px;
}

.fleet-editor-grid {
  display: grid;
  grid-template-columns: 72px minmax(170px, 1.15fr) minmax(130px, 0.9fr) minmax(180px, 1.25fr) repeat(7, minmax(72px, 0.55fr));
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.fleet-editor-grid b {
  color: #8ea2b7;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.fleet-editor-grid input {
  min-width: 0;
  min-height: 34px;
  padding: 0 8px;
}

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

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(15, 29, 43, 0.9), rgba(7, 18, 29, 0.92)),
    repeating-linear-gradient(90deg, transparent 0 19px, rgba(255, 255, 255, 0.018) 19px 20px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 16px 34px rgba(0, 0, 0, 0.2);
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 17px;
  border-bottom: 1px solid rgba(130, 165, 200, 0.15);
  color: #e8f0fb;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.panel-title a,
.panel-title b,
.panel-title button {
  color: #8e65ff;
  text-decoration: none;
  font-size: 11px;
}

.panel-title button {
  border: 0;
  padding: 5px 0;
  background: transparent;
  font-weight: 800;
}

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

.feed-count {
  color: var(--purple);
  font-size: 11px;
  font-weight: 800;
}

.panel-title em {
  color: var(--green);
  font-style: normal;
  font-size: 12px;
}

.panel-title em.offline {
  color: var(--amber);
}

.map-panel {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  min-height: 0;
}

#dashboardMapTiles {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #061420;
}

.dashboard-map-drone {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(232, 255, 240, 0.72);
  background: rgba(4, 15, 24, 0.76);
  box-shadow: 0 0 16px rgba(82, 220, 128, 0.34);
  color: #8cffae;
  font-size: 16px;
}

.dashboard-map-drone span {
  display: block;
  transform: rotate(var(--heading, 0deg));
}

.dashboard-map-drone.followed {
  border-color: #ffffff;
  box-shadow: 0 0 0 4px rgba(82, 220, 128, 0.3), 0 0 24px rgba(82, 220, 128, 0.82);
}

.map-tools button.active,
.live-map-tools button.active {
  border-color: var(--green);
  color: var(--green);
  background: rgba(7, 31, 32, 0.96);
}

.live-map-drone {
  grid-template-columns: 34px auto;
  gap: 5px;
  width: 76px;
  height: 34px;
  padding-right: 7px;
  border-color: rgba(174, 238, 255, 0.82);
  border-radius: 999px;
  box-shadow: 0 0 18px rgba(82, 220, 128, 0.42), 0 0 0 4px rgba(82, 220, 128, 0.12);
}

.live-map-drone strong {
  color: #e8f2ff;
  font: 800 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.dashboard-map-label {
  padding: 3px 6px;
  border: 1px solid rgba(130, 165, 200, 0.24);
  border-radius: 5px;
  background: rgba(3, 10, 17, 0.72);
  color: #e8f2ff;
  font: 700 10px/1.1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.map-panel .leaflet-control-attribution {
  display: none;
}

#mapCanvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #061420;
  cursor: grab;
  touch-action: none;
  position: relative;
  z-index: 0;
}

#mapCanvas.is-panning {
  cursor: grabbing;
}

.map-toolbar {
  position: absolute;
  z-index: 3;
  top: 10px;
  left: 12px;
  right: 154px;
  display: flex;
  gap: 5px;
  max-width: calc(100% - 166px);
  overflow-x: auto;
  scrollbar-width: none;
}

.map-toolbar::-webkit-scrollbar {
  display: none;
}

.map-toolbar button {
  flex: 0 0 auto;
  min-width: 31px;
  height: 37px;
  padding: 0 8px;
}

.map-toolbar button:first-child {
  min-width: 132px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.map-toolbar .wide {
  min-width: 34px;
}

.wind {
  position: absolute;
  z-index: 3;
  top: 10px;
  right: 10px;
  width: 132px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(6, 13, 21, 0.76);
  text-align: right;
  font-size: 12px;
  pointer-events: none;
}

.wind span {
  color: var(--green);
}

.telemetry-live {
  position: absolute;
  z-index: 3;
  top: 58px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 132px;
  padding: 8px 10px;
  border: 1px solid rgba(83, 215, 124, 0.32);
  border-radius: 8px;
  background: rgba(3, 12, 20, 0.74);
  color: var(--green);
  font-size: 10px;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.telemetry-live span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(83, 215, 124, 0.72);
  animation: telemetryPulse 1.4s ease-out infinite;
}

.telemetry-ticker {
  position: absolute;
  z-index: 3;
  left: 28px;
  right: 14px;
  bottom: 52px;
  max-width: none;
  overflow: hidden;
  white-space: nowrap;
  padding: 7px 11px;
  border: 1px solid rgba(47, 211, 255, 0.24);
  border-radius: 8px;
  background: rgba(3, 12, 20, 0.68);
  color: #aeeeff;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  pointer-events: none;
}

@keyframes telemetryPulse {
  0% { box-shadow: 0 0 0 0 rgba(83, 215, 124, 0.72); }
  80% { box-shadow: 0 0 0 9px rgba(83, 215, 124, 0); }
  100% { box-shadow: 0 0 0 0 rgba(83, 215, 124, 0); }
}

.map-scale {
  position: absolute;
  z-index: 3;
  bottom: 15px;
  left: 28px;
  padding: 5px 10px;
  border-left: 2px solid #d8e7fb;
  border-bottom: 2px solid #d8e7fb;
  background: rgba(0, 0, 0, 0.35);
  font-size: 12px;
  pointer-events: none;
}

.map-readout {
  position: absolute;
  z-index: 3;
  right: 14px;
  bottom: 15px;
  max-width: 370px;
  padding: 7px 11px;
  border: 1px solid rgba(130, 165, 200, 0.22);
  border-radius: 7px;
  color: #cbd9e9;
  background: rgba(4, 12, 19, 0.68);
  font-size: 11px;
  pointer-events: none;
}

.map-tools {
  position: absolute;
  z-index: 3;
  top: 115px;
  left: 16px;
  display: grid;
  gap: 5px;
}

.map-tools button {
  width: 34px;
  height: 34px;
}

.swarm {
  grid-column: 2;
  grid-row: 1;
}

.health-grid {
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: 17px;
  height: calc(100% - 42px);
  align-items: center;
  padding: 18px;
}

.ring {
  position: relative;
  --degrees: calc(var(--value) * 3.6deg);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--ring) var(--degrees), rgba(116, 145, 178, 0.18) 0);
}

.ring::before {
  content: "";
  position: absolute;
  width: 72%;
  height: 72%;
  border-radius: 50%;
  background: #091522;
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.5);
}

.ring > div {
  position: relative;
  text-align: center;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 2px;
}

.ring strong {
  color: #ffffff;
  font-size: 36px;
  line-height: 0.95;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.18), 0 1px 2px rgba(0, 0, 0, 0.75);
}

.ring span {
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.ring small {
  display: inline-block;
  margin-top: 5px;
  padding: 3px 7px;
  border: 1px solid rgba(213, 228, 242, 0.2);
  border-radius: 999px;
  color: #f3f9ff;
  background: rgba(3, 12, 20, 0.72);
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.35);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

.ring.small {
  width: 124px;
}

.ring.small strong {
  font-size: 28px;
}

.ring.small small {
  font-size: 10px;
  padding-inline: 6px;
}

.stat-stack {
  display: grid;
  gap: 15px;
}

.stat-stack div {
  display: grid;
  grid-template-columns: 30px 34px 1fr;
  align-items: center;
  gap: 8px;
}

.stat-stack i {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(82, 220, 128, 0.25);
  border-radius: 7px;
  color: var(--green);
  background: rgba(82, 220, 128, 0.1);
  font-style: normal;
}

.stat-stack i.amber {
  border-color: rgba(255, 186, 45, 0.35);
  color: var(--amber);
  background: rgba(255, 186, 45, 0.12);
}

.stat-stack i.red {
  border-color: rgba(255, 91, 79, 0.35);
  color: var(--red);
  background: rgba(255, 91, 79, 0.12);
}

.stat-stack strong {
  font-size: 22px;
}

.stat-stack span {
  color: #c8d5e4;
  font-size: 11px;
}

.mid-stack {
  grid-column: 2;
  grid-row: 2 / 4;
  display: grid;
  grid-template-rows: 1fr 0.58fr 0.9fr;
  gap: 12px;
  min-height: 0;
}

.mid-stack .panel {
  min-height: 0;
}

.mid-stack .swarm {
  grid-column: auto;
  grid-row: auto;
  width: auto;
  justify-self: stretch;
}

.drone-status {
  grid-column: auto;
  grid-row: auto;
}

.drone-status-row {
  cursor: pointer;
}

.drone-status-row:hover,
.drone-status-row:focus-visible {
  outline: none;
  background: rgba(82, 220, 128, 0.09);
}

.drone-status-row:focus-visible {
  box-shadow: inset 3px 0 0 var(--green);
}

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

th,
td {
  padding: 5px 9px;
  border-bottom: 1px solid rgba(130, 165, 200, 0.1);
  text-align: left;
}

th {
  color: #aab8c8;
  font-weight: 500;
}

.badge {
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(82, 220, 128, 0.14);
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
}

.badge.low {
  background: rgba(255, 186, 45, 0.14);
  color: var(--amber);
}

.battery-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border: 2px solid currentColor;
  border-radius: 50%;
  color: var(--green);
}

.battery-dot.low {
  color: var(--red);
}

.mission-progress,
.battery,
.link {
  grid-row: 2;
}

.mini-track {
  position: absolute;
  left: 17px;
  right: 17px;
  bottom: 13px;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(121, 150, 179, 0.18);
}

.mini-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), #62a7ff);
}

.mission-progress {
  grid-column: 1;
  justify-self: start;
  width: calc((100% - 24px) / 3);
}

.battery {
  grid-column: 1;
  justify-self: center;
  width: calc((100% - 24px) / 3);
}

.link {
  grid-column: 1;
  justify-self: end;
  width: calc((100% - 24px) / 3);
}

.payloads {
  grid-column: auto;
  align-self: stretch;
  height: auto;
}

.metric-row {
  display: flex;
  align-items: center;
  gap: 21px;
  height: calc(100% - 42px);
  padding: 14px 17px;
}

dl {
  margin: 0;
}

dt {
  color: #9fb0c3;
  font-size: 10px;
  font-weight: 700;
}

dd {
  margin: 0 0 10px;
  font-size: 14px;
}

.levels {
  flex: 1;
}

.levels p {
  display: grid;
  grid-template-columns: 1fr 24px;
  gap: 3px;
  margin: 0 0 12px;
  font-size: 12px;
}

.levels span {
  grid-column: 2;
  color: #c9d5e3;
  font-size: 10px;
}

.green { color: var(--green); }
.amber-text { color: var(--amber); }
.red-text { color: var(--red); }

.link-bars {
  padding: 14px 17px;
}

.link-bars label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  color: #e0e9f6;
  font-size: 12px;
}

.bar {
  height: 11px;
  margin-bottom: 10px;
  background:
    repeating-linear-gradient(90deg, var(--bar-color) 0 5px, transparent 5px 9px),
    linear-gradient(90deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
}

.green-bars { --bar-color: var(--green); }
.blue-bars { --bar-color: var(--blue); }
.violet-bars { --bar-color: var(--violet); }

.payloads ul {
  margin: 8px 16px 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
}

.payloads li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  color: #d6e1ee;
}

.payloads li span {
  display: grid;
  gap: 2px;
}

.payloads li small {
  color: #8ea2b7;
  font-size: 10px;
}

.payloads li::before {
  content: "◉";
  margin-right: 8px;
  color: #cfd9e6;
}

.feeds {
  grid-column: 1 / 2;
  grid-row: 3;
}

.feed-console {
  display: grid;
  grid-template-columns: minmax(230px, 1.15fr) minmax(180px, 0.85fr) 170px;
  gap: 12px;
  height: calc(100% - 86px);
  padding: 12px 14px 0;
}

.feed-viewer {
  position: relative;
  overflow: hidden;
  min-height: 150px;
  border: 1px solid rgba(130, 165, 200, 0.25);
  border-radius: 7px;
  background: #071522;
}

.feed-viewer video,
.feed-viewer canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: translate3d(var(--video-pan-x, 0), var(--video-pan-y, 0), 0) scale(var(--video-zoom, 1));
  transform-origin: center;
  transition: transform 180ms ease-out;
}

.feed-viewer video {
  filter: saturate(0.85) contrast(1.08) brightness(0.88);
}

[data-video-zoom-stage].is-video-zoomed {
  cursor: grab;
  touch-action: none;
}

[data-video-zoom-stage].is-video-panning {
  cursor: grabbing;
  user-select: none;
}

[data-video-zoom-stage].is-video-panning video,
[data-video-zoom-stage].is-video-panning canvas {
  transition: none;
}

.feed-viewer canvas {
  z-index: 1;
  pointer-events: none;
}

.feed-video-overlay {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 7px 9px;
  border: 1px solid rgba(130, 165, 200, 0.22);
  border-radius: 6px;
  background: rgba(3, 10, 17, 0.72);
  color: #e8f2ff;
  font-size: 11px;
  pointer-events: none;
  z-index: 2;
}

.feed-video-overlay strong {
  color: var(--green);
}

.feed-video-overlay small {
  color: #a9b9c9;
}

.feed-expand {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(207, 225, 244, 0.42);
  border-radius: 6px;
  color: #f1f7ff;
  background: rgba(3, 10, 17, 0.78);
  font-size: 19px;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.32);
}

.feed-expand:hover,
.feed-expand:focus-visible {
  border-color: var(--green);
  color: var(--green);
  background: rgba(7, 25, 34, 0.96);
  outline: none;
}

.video-zoom-controls {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 4;
  display: grid;
  grid-template-columns: 32px 48px 32px;
  overflow: hidden;
  border: 1px solid rgba(207, 225, 244, 0.42);
  border-radius: 6px;
  background: rgba(3, 10, 17, 0.84);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.32);
}

.video-zoom-controls button {
  display: grid;
  place-items: center;
  width: 100%;
  height: 32px;
  padding: 0;
  border: 0;
  border-right: 1px solid rgba(207, 225, 244, 0.18);
  border-radius: 0;
  color: #f1f7ff;
  background: transparent;
  font-size: 16px;
  line-height: 1;
}

.video-zoom-controls button:last-child {
  border-right: 0;
}

.video-zoom-controls button:hover,
.video-zoom-controls button:focus-visible {
  color: var(--green);
  background: rgba(32, 73, 88, 0.74);
  outline: none;
}

.video-zoom-controls button:disabled {
  color: #526475;
  cursor: default;
  background: transparent;
}

.video-zoom-controls .video-zoom-value {
  color: #b9d8f5;
  font: 700 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.feed-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(68px, 1fr);
  gap: 12px;
  height: 100%;
  padding: 0;
  overflow: auto;
  scrollbar-width: thin;
}

.feed {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(130, 165, 200, 0.25);
  border-radius: 7px;
  background: #122334;
}

.feed {
  cursor: pointer;
}

.feed:hover {
  border-color: rgba(82, 220, 128, 0.65);
  box-shadow: 0 0 0 1px rgba(82, 220, 128, 0.2), 0 0 24px rgba(82, 220, 128, 0.12);
}

.feed.active {
  border-color: rgba(82, 220, 128, 0.85);
  box-shadow: inset 0 0 0 1px rgba(82, 220, 128, 0.35), 0 0 22px rgba(82, 220, 128, 0.16);
}

.feed b,
.feed span,
.feed em {
  position: relative;
  z-index: 2;
  display: block;
  padding-left: 12px;
  text-shadow: 0 1px 2px #000;
}

.feed b {
  padding-top: 10px;
  font-size: 12px;
}

.feed span {
  font-size: 10px;
}

.feed em {
  position: absolute;
  left: 0;
  right: 8px;
  bottom: 9px;
  overflow: hidden;
  color: #d8e8f8;
  font-size: 10px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed::after {
  content: "";
  position: absolute;
  inset: 0;
}

.eo::after {
  background:
    linear-gradient(168deg, transparent 0 48%, rgba(60, 105, 70, 0.86) 49% 61%, transparent 62%),
    radial-gradient(ellipse at 34% 76%, rgba(238, 238, 216, 0.45) 0 14%, transparent 15%),
    repeating-linear-gradient(176deg, rgba(210, 238, 255, 0.18) 0 2px, transparent 2px 18px),
    linear-gradient(160deg, #73a4c4 0 38%, #13506a 39% 64%, #083049 65% 100%);
}

.coast::after {
  background:
    radial-gradient(circle at 32% 35%, rgba(74, 136, 255, 0.95) 0 3px, transparent 4px),
    radial-gradient(circle at 62% 58%, rgba(74, 136, 255, 0.95) 0 3px, transparent 4px),
    radial-gradient(circle at 78% 25%, rgba(255, 191, 42, 0.85) 0 3px, transparent 4px),
    linear-gradient(28deg, transparent 0 40%, rgba(85, 220, 130, 0.28) 41% 44%, transparent 45%),
    linear-gradient(154deg, transparent 0 32%, rgba(255, 191, 42, 0.24) 33% 36%, transparent 37%),
    repeating-linear-gradient(0deg, rgba(74, 136, 255, 0.14) 0 1px, transparent 1px 18px),
    repeating-linear-gradient(90deg, rgba(74, 136, 255, 0.12) 0 1px, transparent 1px 22px),
    linear-gradient(160deg, #071827, #03101b);
}

.thermal::after {
  background:
    radial-gradient(ellipse at 48% 64%, #ffd45d 0 8%, #ff5a2e 9% 18%, transparent 19%),
    radial-gradient(ellipse at 58% 76%, #ffbb37 0 5%, transparent 15%),
    linear-gradient(160deg, #251356, #b01885 48%, #f75c26 100%);
}

.radar::after {
  background:
    radial-gradient(circle at 68% 34%, #ffbf2a 0 3px, transparent 4px),
    radial-gradient(circle at 42% 64%, #53d77c 0 3px, transparent 4px),
    radial-gradient(circle at 50% 54%, rgba(85, 220, 130, 0.85) 0 2px, transparent 3px),
    repeating-radial-gradient(circle at 50% 54%, rgba(85, 220, 130, 0.42) 0 1px, transparent 1px 18px),
    conic-gradient(from 30deg at 50% 54%, rgba(85, 220, 130, 0.5), transparent 18%, transparent 100%),
    linear-gradient(160deg, #03171e, #071c20 52%, #0b2a22);
}

.lidar::after {
  background:
    linear-gradient(90deg, transparent 0 13%, rgba(48, 214, 219, 0.75) 14% 16%, transparent 17%),
    linear-gradient(90deg, transparent 0 36%, rgba(255, 191, 42, 0.86) 37% 40%, transparent 41%),
    linear-gradient(90deg, transparent 0 68%, rgba(48, 214, 219, 0.65) 69% 71%, transparent 72%),
    repeating-linear-gradient(0deg, rgba(48, 214, 219, 0.14) 0 1px, transparent 1px 16px),
    repeating-linear-gradient(90deg, rgba(159, 134, 255, 0.12) 0 1px, transparent 1px 24px),
    linear-gradient(#031018, #061724);
}

.stream-thermal {
  filter: saturate(1.4) contrast(1.18) hue-rotate(145deg) brightness(0.82);
}

.stream-radar,
.stream-lidar {
  filter: saturate(0.45) contrast(1.35) hue-rotate(80deg) brightness(0.7);
}

.stream-coast {
  filter: saturate(0.65) contrast(1.14) brightness(0.82);
}

.feed-detail {
  overflow: hidden;
  border: 1px solid rgba(130, 165, 200, 0.18);
  border-radius: 7px;
  background: rgba(10, 24, 38, 0.72);
  padding: 12px;
}

.feed-detail strong {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
}

.feed-detail > span {
  display: block;
  margin-bottom: 10px;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.feed-detail dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
}

.feed-detail dt,
.feed-detail dd {
  margin: 0;
  font-size: 10px;
}

.feed-detail dd {
  color: #dce8f6;
  text-align: right;
}

.drone-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 14px;
}

.drone-detail-video {
  position: relative;
  grid-row: span 2;
  overflow: hidden;
  min-width: 0;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(130, 165, 200, 0.28);
  border-radius: 7px;
  background: #031018;
}

.drone-detail-video video,
.drone-detail-video canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translate3d(var(--video-pan-x, 0), var(--video-pan-y, 0), 0) scale(var(--video-zoom, 1));
  transform-origin: center;
  transition: transform 180ms ease-out;
}

.drone-detail-video canvas {
  z-index: 1;
  pointer-events: none;
}

.drone-detail-live {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(130, 165, 200, 0.24);
  border-radius: 6px;
  background: rgba(3, 10, 17, 0.78);
  font-size: 11px;
  z-index: 2;
}

.drone-detail-live i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(82, 220, 128, 0.8);
}

.drone-detail-live strong {
  color: var(--green);
}

.drone-detail-live span {
  overflow: hidden;
  color: #bdcde0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drone-detail-section {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(130, 165, 200, 0.2);
  border-radius: 7px;
  background: rgba(7, 19, 31, 0.72);
}

.drone-detail-section.wide {
  grid-column: 1 / -1;
}

.drone-detail-section h3 {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(130, 165, 200, 0.16);
  color: #e8f2ff;
  font-size: 12px;
  text-transform: uppercase;
}

.drone-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: rgba(130, 165, 200, 0.12);
}

.drone-detail-grid > div {
  min-width: 0;
  padding: 9px 11px;
  background: rgba(6, 17, 28, 0.96);
}

.drone-detail-grid > .wide {
  grid-column: 1 / -1;
}

.drone-detail-grid dd {
  overflow-wrap: anywhere;
  margin: 3px 0 0;
  color: #e7f1fd;
  font: 700 11px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.modal-video {
  display: grid;
  gap: 12px;
}

.modal-video-stage {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(130, 165, 200, 0.24);
  border-radius: 8px;
  background: #06101c;
}

.modal-video-stage video,
.modal-video-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translate3d(var(--video-pan-x, 0), var(--video-pan-y, 0), 0) scale(var(--video-zoom, 1));
  transform-origin: center;
  transition: transform 180ms ease-out;
}

.modal-video-stage canvas {
  z-index: 1;
  pointer-events: none;
}

.modal-video-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(130, 165, 200, 0.18);
  border-radius: 8px;
  background: rgba(12, 27, 42, 0.74);
}

.modal-video-meta span {
  color: #b9c9dc;
}

.feed-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 8px 14px 0;
}

.feed-controls button {
  min-height: 30px;
  border: 1px solid rgba(130, 165, 200, 0.24);
  border-radius: 6px;
  color: #dcecff;
  background: rgba(11, 23, 35, 0.85);
  font-size: 11px;
  font-weight: 800;
}

.feed-controls button:hover {
  border-color: rgba(82, 220, 128, 0.55);
}

.command-target {
  display: grid;
  gap: 7px;
  width: calc(100% - 32px);
  margin: 10px 16px 8px;
  color: #9fb0c3;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.command-target select {
  width: 100%;
  min-height: 34px;
  border: 1px solid rgba(130, 165, 200, 0.24);
  border-radius: 6px;
  color: var(--text);
  background: rgba(3, 12, 20, 0.82);
  font-size: 12px;
  font-weight: 800;
}

.operator-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: calc(100% - 32px);
  margin: 8px 16px 10px;
}

.operator-checklist span {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 25px;
  padding: 0 8px;
  border: 1px solid rgba(130, 165, 200, 0.16);
  border-radius: 6px;
  color: #c9d8e8;
  background: rgba(6, 17, 28, 0.64);
  font-size: 10px;
  font-weight: 800;
}

.operator-checklist i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--amber);
  box-shadow: 0 0 10px rgba(255, 186, 45, 0.6);
}

.operator-checklist .ok i {
  background: var(--green);
  box-shadow: 0 0 10px rgba(82, 220, 128, 0.7);
}

.operator-checklist .warn {
  color: #ffdb91;
}

.quick button.confirming {
  border-color: rgba(255, 255, 255, 0.68);
  color: #fff;
  animation: confirmPulse 0.8s infinite alternate;
}

@keyframes confirmPulse {
  from { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); }
  to { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45), 0 0 22px rgba(255, 91, 79, 0.34); }
}

.feed-dots {
  display: flex;
  justify-content: center;
  gap: 9px;
  padding-top: 8px;
}

.feed-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(201, 216, 232, 0.42);
}

.feed-dots .active {
  background: #e6efff;
}

.assistant {
  grid-column: auto;
  grid-row: auto;
  display: grid;
  grid-template-rows: 42px auto minmax(0, 1fr) auto auto;
}

.assistant-message {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  margin: 0;
}

.bot {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.24);
  border-radius: 7px;
  background: rgba(255,255,255,0.1);
}

.assistant-message p {
  margin: 0;
  padding: 9px;
  border: 1px solid rgba(130, 165, 200, 0.14);
  border-radius: 7px;
  background: rgba(13, 28, 42, 0.9);
  font-size: 12px;
  line-height: 1.3;
}

.assistant-context {
  display: flex;
  gap: 6px;
  overflow: hidden;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(130, 165, 200, 0.12);
}

.assistant-context span {
  flex: 1;
  min-width: 0;
  padding: 5px 7px;
  overflow: hidden;
  border: 1px solid rgba(130, 165, 200, 0.16);
  border-radius: 6px;
  color: #cbd9e9;
  background: rgba(10, 24, 38, 0.82);
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-log {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding: 10px 12px;
}

.assistant-entry.user {
  grid-template-columns: 1fr 28px;
}

.assistant-entry.user .bot {
  order: 2;
  background: rgba(57, 162, 255, 0.15);
}

.assistant-entry.user p {
  text-align: right;
  background: rgba(35, 63, 96, 0.9);
}

.assistant-entry p small {
  display: block;
  margin-top: 5px;
  color: #8ea2b7;
  font-size: 10px;
}

.assistant-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 0 12px;
}

.assistant-actions button,
.insights button {
  border: 1px solid rgba(139, 93, 255, 0.55);
  border-radius: 6px;
  color: #eee8ff;
  background: linear-gradient(180deg, rgba(98, 70, 194, 0.88), rgba(70, 48, 150, 0.88));
  font-size: 12px;
}

.assistant-actions button {
  min-height: 31px;
  padding: 0 6px;
}

.command {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 7px;
  padding: 8px 12px 10px;
}

.command input {
  min-width: 0;
  border: 1px solid rgba(130, 165, 200, 0.18);
  border-radius: 7px;
  padding: 0 15px;
  color: var(--text);
  background: rgba(7, 19, 30, 0.8);
}

.command button {
  border: 0;
  border-radius: 7px;
  color: white;
  background: linear-gradient(180deg, #7147cf, #5534aa);
  font-size: 28px;
}

.right-rail {
  grid-column: 3;
  grid-row: 1 / 4;
  display: grid;
  grid-template-rows: 1fr 1fr 0.86fr 0.86fr;
  gap: 14px;
  min-height: 0;
  max-height: none;
  overflow: visible;
  padding-right: 2px;
}

.insights {
  padding-bottom: 14px;
}

.insights article {
  display: grid;
  grid-template-columns: 36px 1fr;
  align-items: center;
  min-height: 62px;
  margin: 12px 16px;
  padding: 0 14px;
  border: 1px solid rgba(130, 165, 200, 0.13);
  border-radius: 8px;
  background: rgba(18, 35, 50, 0.72);
  font-size: 13px;
  line-height: 1.35;
}

.insights i {
  width: 27px;
  height: 27px;
  border-radius: 50%;
}

.green-dot { background: radial-gradient(circle, var(--green) 0 28%, rgba(82, 220, 128, 0.18) 30% 100%); }
.blue-dot { background: radial-gradient(circle, var(--blue) 0 28%, rgba(57, 162, 255, 0.18) 30% 100%); }
.amber-dot { background: radial-gradient(circle, var(--amber) 0 28%, rgba(255, 186, 45, 0.18) 30% 100%); }

.insights button {
  width: calc(100% - 32px);
  min-height: 43px;
  margin: 0 16px;
  background: rgba(45, 28, 93, 0.42);
}

.alert-card {
  margin: 11px 14px;
  padding: 13px 14px 13px 46px;
  min-height: 58px;
  border-radius: 7px;
  font-size: 12px;
}

.alert-card::before {
  content: "!";
  position: absolute;
  left: 26px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 900;
}

.alert-card strong {
  display: inline-block;
  max-width: 68%;
  font-size: 13px;
}

.alert-card span {
  float: right;
  color: #d5deea;
  font-size: 10px;
}

.alert-card p {
  margin: 6px 0 0;
  color: #d5deea;
}

.alert-card.red {
  border: 1px solid rgba(255, 91, 79, 0.78);
  background: rgba(92, 25, 30, 0.42);
}

.alert-card.red strong,
.alert-card.red::before {
  color: var(--red);
}

.alert-card.amber {
  border: 1px solid rgba(255, 186, 45, 0.7);
  background: rgba(84, 58, 17, 0.34);
}

.alert-card.amber strong,
.alert-card.amber::before {
  color: var(--amber);
}

.alert-card.blue {
  border: 1px solid rgba(57, 162, 255, 0.62);
  background: rgba(18, 49, 83, 0.42);
}

.alert-card.blue strong,
.alert-card.blue::before {
  color: var(--blue);
}

.weather {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 42px 1fr 35px;
}

.weather .panel-title {
  grid-column: 1 / -1;
}

.weather-main {
  display: grid;
  place-items: center;
  align-content: center;
  border-right: 1px solid rgba(130, 165, 200, 0.13);
}

.weather-icon {
  position: relative;
  width: 68px;
  height: 52px;
  color: #dcecff;
  filter: drop-shadow(0 0 18px rgba(88, 183, 255, 0.24));
}

.weather-icon::before,
.weather-icon::after {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 43px;
  line-height: 1;
}

.weather-clear::before {
  content: "☀";
  color: #ffd86b;
  text-shadow: 0 0 22px rgba(255, 191, 42, 0.52);
}

.weather-cloud::before {
  content: "☁";
  color: #d9e8f8;
}

.weather-rain::before {
  content: "☁";
  color: #d9e8f8;
  transform: translateY(-5px);
}

.weather-rain::after {
  content: "///";
  top: 30px;
  color: #58b7ff;
  font-size: 20px;
  letter-spacing: 2px;
}

.weather-storm::before {
  content: "☁";
  color: #cfdcff;
  transform: translateY(-5px);
}

.weather-storm::after {
  content: "⚡";
  top: 24px;
  color: #ffbf2a;
  font-size: 29px;
  text-shadow: 0 0 16px rgba(255, 191, 42, 0.55);
}

.weather-fog::before,
.weather-hazy::before {
  content: "☁";
  color: #d9e8f8;
  transform: translateY(-8px);
}

.weather-fog::after,
.weather-hazy::after {
  content: "≋≋";
  top: 28px;
  color: #9fb0c3;
  font-size: 24px;
  letter-spacing: 2px;
}

.weather-snow::before {
  content: "☁";
  color: #e7f3ff;
  transform: translateY(-5px);
}

.weather-snow::after {
  content: "✻";
  top: 26px;
  color: #d8f6ff;
  font-size: 24px;
}

.weather-main strong {
  margin-top: 14px;
  font-size: 27px;
}

.weather-main span {
  color: #b8c8dc;
  font-size: 11px;
}

.weather dl {
  padding: 18px 18px 0;
}

.weather p {
  grid-column: 1 / -1;
  margin: 0;
  padding: 9px 17px;
  border-top: 1px solid rgba(130, 165, 200, 0.13);
  color: var(--green);
  font-size: 13px;
}

.weather p b {
  margin-right: 25px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(144, 169, 198, 0.12);
  color: #d4dfed;
}

.quick {
  padding-bottom: 16px;
}

.quick button {
  display: block;
  width: calc(100% - 32px);
  min-height: 48px;
  margin: 13px 16px 0;
  border-radius: 7px;
  background: rgba(12, 28, 42, 0.88);
  font-weight: 800;
  text-align: left;
  padding-left: 48px;
}

.extend-controls {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 8px;
  width: calc(100% - 32px);
  margin: 12px 16px 0;
}

.extend-controls label {
  display: grid;
  gap: 5px;
  color: #9fb0c3;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.extend-controls select {
  min-height: 38px;
  border: 1px solid rgba(130, 165, 200, 0.24);
  border-radius: 7px;
  color: var(--text);
  background: rgba(3, 12, 20, 0.82);
  font-size: 12px;
  font-weight: 800;
}

.quick .extend-controls .extend {
  width: 100%;
  min-height: 38px;
  margin: 17px 0 0;
  padding: 0 10px;
  border: 1px solid rgba(134, 92, 255, 0.58);
  color: #cdbdff;
  background: rgba(48, 28, 101, 0.72);
  text-align: center;
}

.quick .return { border: 1px solid rgba(82, 220, 128, 0.45); color: var(--green); }
.quick .resume { border: 1px solid rgba(82, 220, 128, 0.55); color: #a8ffbf; background: rgba(18, 67, 40, 0.58); }
.quick .end-mission { border: 1px solid rgba(255, 186, 45, 0.6); color: #ffd37a; background: rgba(55, 39, 13, 0.72); }
.quick .hold { border: 1px solid rgba(57, 162, 255, 0.45); color: var(--blue); }
.quick .land { border: 1px solid rgba(255, 186, 45, 0.55); color: var(--amber); }
.quick .stop { border: 1px solid rgba(255, 91, 79, 0.55); color: var(--red); }

.mobile-command-dock {
  position: sticky;
  bottom: 0;
  z-index: 20;
  grid-column: 1 / -1;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(130, 165, 200, 0.24);
  border-radius: 9px;
  background: rgba(3, 10, 18, 0.94);
  box-shadow: 0 -12px 28px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(16px);
}

.mobile-command-dock button {
  min-height: 42px;
  border-radius: 7px;
  background: rgba(12, 28, 42, 0.92);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.mobile-command-dock .return { border: 1px solid rgba(82, 220, 128, 0.5); color: var(--green); }
.mobile-command-dock .resume { border: 1px solid rgba(82, 220, 128, 0.55); color: #a8ffbf; }
.mobile-command-dock .hold { border: 1px solid rgba(57, 162, 255, 0.5); color: var(--blue); }
.mobile-command-dock .end-mission { border: 1px solid rgba(255, 186, 45, 0.58); color: #ffd37a; }
.mobile-command-dock .stop { border: 1px solid rgba(255, 91, 79, 0.58); color: var(--red); }

.target-readout {
  display: block;
  margin-top: 2px;
  color: #9f86ff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 32px;
  background: rgba(1, 6, 11, 0.76);
  backdrop-filter: blur(10px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-panel {
  width: min(1040px, 92vw);
  max-height: min(760px, 86vh);
  overflow: hidden;
  border: 1px solid rgba(145, 178, 220, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(15, 29, 43, 0.98), rgba(7, 18, 29, 0.98)),
    repeating-linear-gradient(90deg, transparent 0 19px, rgba(255, 255, 255, 0.018) 19px 20px);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
}

.modal-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(130, 165, 200, 0.18);
}

.modal-panel h2 {
  margin: 4px 0 0;
  font-size: 23px;
}

.modal-close {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(130, 165, 200, 0.28);
  border-radius: 7px;
  color: #e9f3ff;
  background: rgba(11, 23, 35, 0.88);
  font-size: 25px;
  line-height: 1;
}

.modal-body {
  max-height: calc(min(760px, 86vh) - 82px);
  overflow: auto;
  padding: 18px 20px 22px;
}

.detail-table-wrap {
  overflow: auto;
  border: 1px solid rgba(130, 165, 200, 0.18);
  border-radius: 8px;
}

.detail-table {
  min-width: 820px;
  font-size: 13px;
}

.detail-table th,
.detail-table td {
  padding: 11px 13px;
}

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

.detail-card {
  min-height: 112px;
  padding: 15px;
  border: 1px solid rgba(130, 165, 200, 0.18);
  border-radius: 8px;
  background: rgba(12, 27, 42, 0.74);
}

.detail-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

.detail-card span {
  display: block;
  margin-bottom: 10px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.detail-card p {
  margin: 0;
  color: #c8d6e6;
  font-size: 13px;
  line-height: 1.45;
}

.detail-split {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 18px;
}

.timeline {
  margin: 0;
  padding: 4px 0 4px 24px;
  border-left: 1px solid rgba(130, 165, 200, 0.18);
}

.timeline li {
  margin-bottom: 16px;
  color: #d5e2f1;
}

.timeline b {
  display: inline-block;
  min-width: 48px;
  color: var(--blue);
}

.timeline span {
  color: #c6d3e3;
}

@media (max-width: 1300px) {
  .auth-gate {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .auth-visual {
    min-height: 380px;
  }

  .mission-command-hero {
    grid-template-columns: 1fr;
  }

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

  .mission-list,
  .planner-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 1300px), (max-height: 900px) {
  html,
  body {
    height: auto;
    min-height: 100%;
  }

  body {
    overflow: auto;
  }

  .app-shell {
    min-height: 100vh;
    height: auto;
    overflow: visible;
    grid-template-rows: 70px auto;
  }

  .sidebar {
    min-height: 100%;
  }

  .dashboard {
    height: auto;
    min-height: 0;
    overflow: visible;
    align-items: start;
    grid-template-rows: 355px max-content max-content;
    padding-bottom: 76px;
  }

  .dashboard.workspace-mode {
    height: auto;
    min-height: calc(100vh - 70px);
    overflow: visible;
  }

  .right-rail,
  .mid-stack {
    align-self: start;
    min-height: 0;
    height: auto;
  }

  .right-rail {
    grid-template-rows: repeat(4, max-content);
  }

  .mid-stack {
    grid-template-rows: repeat(3, max-content);
  }

  .assistant {
    min-height: 230px;
  }

  .assistant-log {
    max-height: none;
  }

  .feeds {
    min-height: 320px;
  }

  .feed-console {
    grid-template-columns: 1fr;
    height: auto;
  }

  .feed-viewer {
    min-height: 240px;
  }

  .feed-strip {
    min-height: 170px;
    height: auto;
  }

  .feed-detail {
    min-height: 105px;
  }

  .weather {
    grid-template-rows: 42px minmax(150px, auto) auto;
    min-height: 260px;
  }

  .quick {
    padding-bottom: 16px;
  }

  .mobile-command-dock {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 1300px) {
  body:not(.auth-active) .app-shell {
    width: 1180px;
  }
}

@media (max-width: 760px) {
  .auth-gate {
    padding: 12px;
  }

  .auth-visual,
  .auth-panel {
    padding: 18px;
  }

  .auth-copy h1 {
    font-size: 38px;
  }

  .auth-metrics,
  .mission-home-metrics,
  .mission-tile-meta,
  .mission-tile-stats {
    grid-template-columns: 1fr;
  }

  .mission-start-header {
    align-items: stretch;
    flex-direction: column;
  }

  .mission-command-hero h2 {
    font-size: 32px;
  }

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

@media (max-width: 1470px) {
  body {
    min-width: 0;
  }

  body:not(.auth-active) .app-shell {
    width: 100vw;
  }

  .app-shell {
    width: 100vw;
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .topbar {
    grid-template-columns: 220px minmax(230px, 1fr) 130px 170px;
  }

  .brand {
    padding: 0 16px;
  }

  .brand strong {
    font-size: 18px;
  }

  .product {
    padding-left: 16px;
  }

  .product strong {
    font-size: 22px;
  }

  .health,
  .top-icons {
    display: none;
  }

  .sidebar {
    width: 220px;
  }

  .nav a {
    gap: 12px;
    min-height: 46px;
    padding: 0 13px;
    font-size: 12px;
  }

  .planner {
    width: calc(100% - 24px);
    margin: 16px 12px 28px;
  }

  .dashboard {
    grid-template-columns: minmax(0, 1fr) minmax(286px, 320px);
    grid-template-rows: max-content max-content max-content max-content;
    gap: 12px;
    padding: 10px 10px 76px;
  }

  .map-panel {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    height: clamp(300px, 48vh, 380px);
    min-height: 300px;
  }

  .swarm {
    grid-column: 1;
    grid-row: 4;
  }

  .mission-progress,
  .battery,
  .link {
    grid-column: 1;
    grid-row: 2;
    min-height: 0;
  }

  .mission-progress {
    justify-self: start;
    width: calc((100% - 24px) / 3);
  }

  .battery {
    justify-self: center;
    width: calc((100% - 24px) / 3);
  }

  .link {
    justify-self: end;
    width: calc((100% - 24px) / 3);
  }

  .feeds {
    grid-column: 1 / 2;
    grid-row: 3;
    min-height: 520px;
  }

  .feed-console {
    grid-template-columns: minmax(0, 1fr) 168px;
    grid-template-rows: minmax(250px, 1fr) auto;
    height: 410px;
  }

  .feed-viewer {
    min-height: 250px;
  }

  .feed-strip {
    grid-template-columns: 1fr;
    min-height: 0;
    height: 100%;
    overflow: auto;
  }

  .feed-detail {
    grid-column: 1 / -1;
    min-height: 92px;
  }

  .mid-stack {
    grid-column: 1;
    grid-row: 5;
  }

  .right-rail {
    grid-column: 2;
    grid-row: 1 / 6;
    position: static;
    grid-template-rows: repeat(4, max-content);
    align-self: start;
    max-height: none;
    overflow: visible;
  }

  .quick {
    order: -1;
  }

  .app-shell.missions-home,
  .app-shell.planner-home {
    grid-template-columns: 1fr;
  }

  .mission-start {
    padding: 14px;
  }

  .mission-command-hero {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.52fr);
    align-items: center;
    min-height: 168px;
    padding: 16px;
  }

  .mission-command-hero h2 {
    font-size: 32px;
  }

  .mission-command-hero p {
    font-size: 14px;
    line-height: 1.4;
  }

  .mission-list {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }

  .mission-tile {
    position: relative;
    min-height: 0;
    gap: 10px;
    padding: 56px 14px 14px;
  }

  .mission-tile-actions {
    position: absolute;
    top: 14px;
    right: 14px;
    left: 118px;
    justify-content: flex-end;
  }

  .mission-tile-actions button {
    min-height: 34px;
    padding: 0 12px;
    font-size: 11px;
  }

  .mission-tile p {
    line-height: 1.35;
  }

  .mission-tile-meta,
  .mission-tile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .mission-tile-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mission-tile-meta span,
  .mission-tile-stats span {
    padding: 8px;
  }

  .mission-tile-stats b {
    font-size: 12px;
    line-height: 1.25;
  }
}

@media (max-width: 1180px) {
  body {
    min-width: 0;
    overflow: auto;
  }

  body:not(.auth-active) .app-shell {
    width: 100vw;
  }

  .app-shell {
    display: block;
    width: 100vw;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 12;
    grid-template-columns: 220px minmax(0, 1fr) auto;
    min-height: 64px;
  }

  .clock {
    display: none;
  }

  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .mission-card,
  .planner,
  .side-footer {
    display: none;
  }

  .nav {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding: 10px;
  }

  .nav a {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 12px;
    white-space: nowrap;
  }

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

  .dashboard {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: repeat(8, max-content);
    gap: 12px;
    width: 100%;
    padding: 10px 10px 76px;
  }

  .dashboard:not(.workspace-mode) {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.72fr);
    grid-template-rows: max-content max-content max-content max-content;
  }

  .map-panel,
  .swarm,
  .mission-progress,
  .battery,
  .link,
  .feeds,
  .mid-stack,
  .right-rail {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
    justify-self: stretch;
  }

  .map-panel {
    grid-column: 1 / -1;
    grid-row: 1;
    height: min(58vh, 430px);
    min-height: 350px;
  }

  .mission-progress,
  .battery,
  .link {
    grid-row: 2;
    min-height: 215px;
  }

  .mission-progress {
    grid-column: 1;
    justify-self: start;
    width: calc((100% - 24px) / 3);
  }

  .battery {
    grid-column: 1;
    justify-self: center;
    width: calc((100% - 24px) / 3);
  }

  .link {
    grid-column: 1;
    justify-self: end;
    width: calc((100% - 24px) / 3);
  }

  .feeds {
    grid-column: 1;
    grid-row: 3;
    min-height: 520px;
  }

  .swarm {
    grid-column: 2;
    grid-row: 2;
  }

  .mid-stack {
    grid-column: 2;
    grid-row: 3;
  }

  .right-rail {
    grid-column: 1 / -1;
    grid-row: 4;
    position: static;
    max-height: none;
  }

  .right-rail,
  .mid-stack {
    grid-template-rows: repeat(4, max-content);
  }

  .app-shell.missions-home,
  .app-shell.planner-home,
  .app-shell.drone-setup-home {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {
  .dashboard-main {
    grid-template-rows: clamp(350px, 58vh, 430px) max-content max-content max-content;
  }
}

@media (min-width: 901px) {
  body:not(.auth-active) .mobile-command-dock {
    display: none;
  }
}

@media (max-width: 900px) {
  .mission-start-header,
  .modal-video-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .panel-actions {
    gap: 8px;
  }

  .mission-start-header {
    padding: 14px;
  }

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

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

@media (max-width: 760px) {
  body {
    min-width: 0;
    overflow: auto;
  }

  .app-shell {
    display: block;
    width: 100vw;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 12;
    display: grid;
    grid-template-columns: 1fr auto;
    min-height: 60px;
  }

  .brand {
    min-width: 0;
  }

  .product,
  .clock,
  .profile {
    display: none;
  }

  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .mission-card {
    margin: 10px;
  }

  .nav {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding: 0 10px 10px;
  }

  .nav a {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 12px;
    white-space: nowrap;
  }

  .planner,
  .side-footer {
    display: none;
  }

  .dashboard {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    min-height: calc(100vh - 60px);
    overflow: visible;
    padding: 10px 10px 76px;
  }

  .dashboard:not(.workspace-mode) {
    grid-template-columns: minmax(0, 1fr);
  }

  .swarm,
  .mission-progress,
  .battery,
  .link,
  .feeds,
  .mid-stack,
  .right-rail {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
  }

  .map-panel {
    min-height: 380px;
    height: 58vh;
  }

  .map-toolbar {
    max-width: calc(100% - 20px);
    overflow-x: auto;
  }

  .telemetry-ticker {
    left: 10px;
    right: 10px;
    max-width: none;
  }

  .feeds {
    min-height: 760px;
  }

  .feed-viewer {
    min-height: 260px;
  }

  .feed-strip {
    grid-template-columns: 1fr;
    min-height: 360px;
  }

  .mission-start,
  .mission-planner-screen {
    padding: 10px;
  }

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

  .workspace-grid,
  .workspace-grid.two,
  .workspace-grid.four,
  .drone-setup-layout {
    grid-template-columns: 1fr;
  }

  .machine-form {
    grid-template-columns: 1fr;
  }

  .workspace-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px;
  }
}

/* Layout guard: keep the authenticated app bounded to the viewport.
   Responsive sections can stack, but the dashboard pane owns vertical scroll. */
html,
body {
  height: 100%;
}

body:not(.auth-active) {
  overflow: hidden;
}

body:not(.auth-active) .app-shell {
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

body:not(.auth-active) .dashboard {
  height: calc(100vh - 70px);
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

body:not(.auth-active) .dashboard:not(.workspace-mode) {
  align-items: start;
  grid-template-rows: minmax(325px, min(42vh, 390px)) max-content max-content;
}

body:not(.auth-active) .right-rail {
  align-self: start;
  grid-template-rows: repeat(4, max-content);
  height: auto;
  min-height: 0;
}

body:not(.auth-active) .right-rail .panel {
  min-height: 0;
}

body:not(.auth-active) .weather {
  grid-template-rows: 42px auto auto;
}

body:not(.auth-active) .quick {
  overflow: visible;
}

body:not(.auth-active) .dashboard.workspace-mode,
.app-shell.missions-home .dashboard,
.app-shell.planner-home .dashboard,
.app-shell.drone-setup-home .dashboard {
  height: calc(100vh - 70px);
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

@media (max-width: 1180px) {
  body:not(.auth-active) {
    overflow: hidden;
  }

  body:not(.auth-active) .app-shell {
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
  }

  body:not(.auth-active) .dashboard {
    height: calc(100vh - 124px);
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app-shell.missions-home .dashboard,
  .app-shell.planner-home .dashboard,
  .app-shell.drone-setup-home .dashboard {
    height: calc(100vh - 64px);
  }
}

@media (max-width: 760px) {
  body:not(.auth-active) .dashboard {
    height: calc(100vh - 118px);
  }

  .app-shell.missions-home .dashboard,
  .app-shell.planner-home .dashboard,
  .app-shell.drone-setup-home .dashboard {
    height: calc(100vh - 60px);
  }
}

/* Keep the operational canvas and command rail as independent columns. */
body:not(.auth-active) .dashboard:not(.workspace-mode) {
  grid-template-columns: minmax(0, 1fr) minmax(286px, 320px);
  grid-template-rows: max-content max-content;
}

.dashboard-main {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  grid-template-columns: minmax(610px, 1.82fr) minmax(280px, 0.78fr);
  grid-template-rows: minmax(325px, min(42vh, 390px)) 215px minmax(320px, auto);
  gap: 12px;
  min-width: 0;
}

body:not(.auth-active) .dashboard:not(.workspace-mode) > .right-rail {
  grid-column: 2;
  grid-row: 1;
}

body:not(.auth-active) .dashboard:not(.workspace-mode) > .mobile-command-dock {
  grid-column: 1 / -1;
  grid-row: 2;
}

@media (max-width: 1470px) {
  .dashboard-main {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 355px max-content max-content max-content;
  }

  .dashboard-main .map-panel {
    grid-column: 1;
    grid-row: 1;
  }

  .dashboard-main .mission-progress,
  .dashboard-main .battery,
  .dashboard-main .link {
    grid-column: 1;
    grid-row: 2;
  }

  .dashboard-main .feeds {
    grid-column: 1;
    grid-row: 3;
  }

  .dashboard-main .mid-stack {
    grid-column: 1;
    grid-row: 4;
  }
}

@media (max-width: 1180px) {
  .dashboard-main {
    grid-template-rows: clamp(350px, 58vh, 430px) max-content max-content max-content;
  }
}

@media (max-width: 900px) {
  body:not(.auth-active) .dashboard:not(.workspace-mode) {
    grid-template-columns: minmax(0, 1fr);
  }

  body:not(.auth-active) .dashboard:not(.workspace-mode) > .right-rail {
    grid-column: 1;
    grid-row: 2;
  }

  body:not(.auth-active) .dashboard:not(.workspace-mode) > .mobile-command-dock {
    grid-column: 1;
    grid-row: 3;
  }
}

@media (max-width: 760px) {
  .dashboard-main {
    grid-template-rows: max(380px, 58vh) max-content max-content max-content;
  }

  .dashboard-main .mission-progress,
  .dashboard-main .battery,
  .dashboard-main .link {
    grid-row: auto;
    width: 100%;
    justify-self: stretch;
  }
}

@media (min-width: 1301px) and (min-height: 901px) {
  body:not(.auth-active) .dashboard:not(.workspace-mode) {
    grid-template-rows: minmax(455px, 46vh) 225px minmax(320px, auto);
  }

  body:not(.auth-active) .map-panel {
    height: auto;
    min-height: 430px;
  }

  body:not(.auth-active) .panel-title {
    min-height: 38px;
    padding: 0 14px;
    font-size: 12px;
  }

  body:not(.auth-active) .mission-progress,
  body:not(.auth-active) .battery,
  body:not(.auth-active) .link {
    min-height: 190px;
  }

  body:not(.auth-active) .metric-row {
    gap: 14px;
    padding: 11px 14px;
  }

  body:not(.auth-active) .link-bars {
    padding: 11px 14px;
  }

  body:not(.auth-active) .right-rail {
    gap: 10px;
    max-height: none;
    overflow: visible;
    padding-right: 5px;
  }

  body:not(.auth-active) .right-rail .panel {
    overflow: visible;
  }

  body:not(.auth-active) .mid-stack {
    grid-column: 2;
    grid-row: 1 / 4;
    align-self: start;
    height: auto;
    grid-template-rows: max-content max-content max-content minmax(250px, auto);
  }

  body:not(.auth-active) .mid-stack .swarm {
    min-height: 220px;
  }

  body:not(.auth-active) .mid-stack .health-grid {
    min-height: 180px;
    height: auto;
    gap: 12px;
    padding: 14px;
  }

  body:not(.auth-active) .mid-stack .ring {
    width: min(118px, 100%);
  }

  body:not(.auth-active) .mid-stack .stat-stack {
    gap: 10px;
  }

  body:not(.auth-active) .insights {
    padding-bottom: 10px;
  }

  body:not(.auth-active) .insights article {
    grid-template-columns: 28px 1fr;
    min-height: 50px;
    margin: 8px 12px;
    padding: 8px 10px;
    font-size: 12px;
  }

  body:not(.auth-active) .insights i {
    width: 22px;
    height: 22px;
  }

  body:not(.auth-active) .insights button {
    width: calc(100% - 24px);
    min-height: 36px;
    margin: 0 12px;
    font-size: 11px;
  }

  body:not(.auth-active) .alert-card {
    min-height: 50px;
    margin: 8px 12px;
    padding: 10px 10px 10px 38px;
  }

  body:not(.auth-active) .alert-card::before {
    left: 20px;
    width: 23px;
    height: 23px;
  }

  body:not(.auth-active) .alert-card strong {
    max-width: 100%;
    font-size: 12px;
  }

  body:not(.auth-active) .alert-card span {
    float: none;
    display: block;
    margin-top: 2px;
  }

  body:not(.auth-active) .alert-card p {
    margin-top: 4px;
  }

  body:not(.auth-active) .weather-main strong {
    margin-top: 8px;
    font-size: 24px;
  }

  body:not(.auth-active) .weather dl {
    padding: 12px 12px 0;
  }

  body:not(.auth-active) .weather p {
    padding: 8px 12px;
  }

  body:not(.auth-active) .quick {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 8px;
    padding: 0 12px 12px;
  }

  body:not(.auth-active) .quick .panel-title,
  body:not(.auth-active) .quick .command-target,
  body:not(.auth-active) .quick .operator-checklist,
  body:not(.auth-active) .quick .extend-controls {
    grid-column: 1 / -1;
    width: auto;
    margin: 0;
  }

  body:not(.auth-active) .quick .command-target {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
  }

  body:not(.auth-active) .quick .command-target select {
    min-height: 30px;
  }

  body:not(.auth-active) .quick .operator-checklist {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  body:not(.auth-active) .quick .operator-checklist span {
    justify-content: center;
    min-height: 22px;
    padding: 0 5px;
    font-size: 9px;
  }

  body:not(.auth-active) .quick .extend-controls {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  body:not(.auth-active) .quick .extend-controls .extend {
    min-width: 92px;
    margin: 0;
  }

  body:not(.auth-active) .quick > button {
    width: 100%;
    min-height: 38px;
    margin: 0;
    padding: 0 8px;
    font-size: 11px;
    text-align: center;
  }

  body:not(.auth-active) .quick > .end-mission,
  body:not(.auth-active) .quick > .stop {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1180px) {
  body:not(.auth-active) .dashboard:not(.workspace-mode) {
    grid-template-rows:
      clamp(350px, 58vh, 430px)
      minmax(240px, max-content)
      max-content
      max-content;
  }

  body:not(.auth-active) .map-panel {
    height: clamp(350px, 58vh, 430px);
  }

  body:not(.auth-active) .mid-stack .swarm {
    grid-column: auto;
    grid-row: auto;
    width: auto;
    justify-self: stretch;
  }
}

@media (max-width: 760px) {
  body:not(.auth-active) .dashboard:not(.workspace-mode) {
    grid-template-rows:
      max(380px, 58vh)
      max-content
      max-content
      max-content;
  }

  body:not(.auth-active) .map-panel {
    height: max(380px, 58vh);
  }
}

@media (max-width: 900px) {
  body:not(.auth-active) .dashboard:not(.workspace-mode) {
    grid-template-rows: max-content max-content max-content;
  }
}

/* Keep live telemetry redraws from participating in an auto-track sizing loop. */
@media (min-width: 1471px) {
  .dashboard-main {
    grid-template-rows: minmax(325px, min(42vh, 390px)) 215px 390px;
  }

  .dashboard-main .feeds {
    align-self: start;
    height: 390px;
    min-height: 0;
    contain: layout;
  }

  .dashboard-main .feed-console {
    height: 304px;
    min-height: 0;
  }

  .dashboard-main .feed-viewer,
  .dashboard-main .feed-strip,
  .dashboard-main .feed-detail {
    min-height: 0;
  }

  .dashboard-main .feed-detail {
    overflow: auto;
  }
}

@media (max-width: 900px) {
  .drone-detail-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .drone-detail-video {
    grid-row: auto;
  }

  .drone-detail-section.wide {
    grid-column: 1;
  }
}

@media (max-width: 760px) {
  .nav {
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .detail-table th:last-child,
  .detail-table td:last-child {
    position: sticky;
    right: 0;
    z-index: 1;
    background: #0a1928;
    box-shadow: -10px 0 18px rgba(3, 10, 17, 0.72);
  }
}

@media (max-width: 560px) {
  .map-toolbar {
    left: 10px;
    right: 10px;
    gap: 4px;
    max-width: none;
    overflow: visible;
  }

  .map-toolbar button {
    min-width: 28px;
    height: 34px;
    padding: 0 5px;
    font-size: 10px;
  }

  .map-toolbar button:first-child {
    min-width: 94px;
  }

  .wind {
    top: 52px;
  }

  .telemetry-live {
    top: 98px;
  }

  .mobile-command-dock {
    position: static;
  }

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

  .drone-detail-grid > .wide {
    grid-column: 1;
  }
}
