:root {
  --bg: #dff1fb;
  --panel: #ffffff;
  --ink: #081a38;
  --muted: #61708a;
  --line: #d7e2ef;
  --brand: #0b63bd;
  --brand-2: #22a4d8;
  --brand-3: #063963;
  --success: #27885d;
  --danger: #b6493c;
  --shadow: 0 18px 52px rgba(5, 49, 92, 0.16);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

/* Critical Leaflet fallback: keeps map panes and tiles positioned even if the CDN CSS is unavailable. */
.leaflet-container {
  position: relative;
  overflow: hidden;
  background: #dfe7eb;
  outline-offset: 1px;
  touch-action: pan-x pan-y;
}

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
  position: absolute;
  left: 0;
  top: 0;
}

.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
  user-select: none;
  -webkit-user-drag: none;
}

.leaflet-tile {
  border: 0;
  filter: inherit;
  visibility: hidden;
}

.leaflet-tile-loaded {
  visibility: inherit;
}

.leaflet-pane {
  z-index: 400;
}

.leaflet-tile-pane {
  z-index: 200;
}

.leaflet-overlay-pane {
  z-index: 400;
}

.leaflet-shadow-pane {
  z-index: 500;
}

.leaflet-marker-pane {
  z-index: 600;
}

.leaflet-tooltip-pane {
  z-index: 650;
}

.leaflet-popup-pane {
  z-index: 700;
}

.leaflet-control {
  position: relative;
  z-index: 800;
  pointer-events: auto;
}

.leaflet-top,
.leaflet-bottom {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
}

.leaflet-top {
  top: 0;
}

.leaflet-right {
  right: 0;
}

.leaflet-bottom {
  bottom: 0;
}

.leaflet-left {
  left: 0;
}

.leaflet-control-zoom {
  margin: 18px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(5, 49, 92, 0.18);
}

.leaflet-control-zoom a {
  display: block;
  width: 42px;
  height: 42px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--brand);
  line-height: 42px;
  text-align: center;
  text-decoration: none;
  font-weight: 900;
}

.leaflet-control-zoom a:first-child {
  border-radius: 6px 6px 0 0;
}

.leaflet-control-zoom a:last-child {
  border-bottom: 0;
  border-radius: 0 0 6px 6px;
}

.leaflet-interactive {
  cursor: pointer;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  overflow: auto;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.7), rgba(219, 241, 252, 0.9)),
    url("assets/terrasis-dashboard-theme.png") left center / cover fixed;
  color: var(--ink);
}

body.auth-open {
  overflow: hidden;
}

body.terrain-3d-open {
  overflow: hidden;
}

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

button,
input {
  font: inherit;
}

[hidden] {
  display: none !important;
}

button {
  cursor: pointer;
}

.home-screen {
  min-height: 100vh;
  padding: 38px 54px;
  background:
    radial-gradient(circle at 82% 24%, rgba(120, 188, 239, 0.22), transparent 35%),
    linear-gradient(135deg, #ffffff 0%, #f8fbff 48%, #e9f5ff 100%);
  color: #061735;
  overflow: hidden;
}

.home-nav {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 34px;
  max-width: 1540px;
  margin: 0 auto;
}

.home-brand {
  display: inline-grid;
  grid-template-columns: 56px auto;
  align-items: center;
  gap: 14px;
}

.home-brand-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.home-brand-icon img,
.brand-mark img,
.auth-logo-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.home-brand strong {
  display: block;
  color: #0c3a6f;
  font-size: 3.2rem;
  line-height: 0.9;
  letter-spacing: 0;
}

.home-brand span {
  color: #173862;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.home-links {
  display: flex;
  justify-content: center;
  gap: 28px;
}

.home-links button {
  min-height: 38px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #0a1731;
  font-weight: 800;
}

.home-links button.active {
  border-color: #0b63bd;
}

.home-actions,
.home-cta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.home-login-button,
.home-primary-button,
.home-secondary-button {
  min-height: 52px;
  border-radius: 14px;
  padding: 0 24px;
  font-weight: 900;
}

.home-login-button {
  border: 1px solid #bfd6f2;
  background: #fff;
  color: #0b63bd;
}

.home-primary-button {
  border: 0;
  background: linear-gradient(135deg, #0b63bd, #0f77d4);
  color: #fff;
  box-shadow: 0 14px 28px rgba(11, 99, 189, 0.24);
}

.home-secondary-button {
  border: 1px solid #0b63bd;
  background: rgba(255, 255, 255, 0.82);
  color: #0b63bd;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(420px, 0.86fr) minmax(520px, 1.14fr);
  align-items: center;
  gap: 22px;
  max-width: 1540px;
  min-height: calc(100vh - 132px);
  margin: 0 auto;
}

.home-copy h1 {
  max-width: 720px;
  margin: 0;
  color: #061735;
  font-size: clamp(3.1rem, 5.5vw, 5.4rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.home-copy h1 span {
  display: block;
  color: #0b63bd;
}

.home-copy p {
  max-width: 610px;
  margin: 24px 0 30px;
  color: #40506a;
  font-size: 1.35rem;
  line-height: 1.55;
}

.home-features {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  max-width: 730px;
  margin-top: 50px;
}

.home-features div {
  display: grid;
  gap: 7px;
}

.home-features strong {
  color: #061735;
  font-size: 0.94rem;
}

.home-features span {
  color: #40506a;
  font-size: 0.86rem;
  line-height: 1.45;
}

.home-stats {
  display: grid;
  grid-template-columns: minmax(140px, 1.2fr) repeat(4, minmax(70px, 1fr));
  align-items: center;
  gap: 12px;
  max-width: 100%;
  margin-top: 58px;
  padding: 20px 22px;
  border: 1px solid rgba(195, 216, 237, 0.75);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 18px 60px rgba(21, 90, 148, 0.13);
}

.home-stats div {
  display: grid;
  gap: 4px;
  justify-items: center;
  min-width: 0;
  border-left: 1px solid #d7e2ef;
}

.home-stats strong {
  color: #0b63bd;
  font-size: 1.45rem;
}

.home-stats span {
  color: #40506a;
  font-size: 0.9rem;
}

.home-visual {
  position: relative;
  min-height: 650px;
}

.home-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 28px 44px rgba(13, 69, 112, 0.22));
}

.app-shell {
  display: grid;
  grid-template-columns: 318px minmax(0, 1fr);
  width: min(1280px, calc(100vw - 64px));
  height: calc(100vh - 72px);
  min-height: 0;
  margin: 36px auto;
  border: 1px solid rgba(190, 215, 237, 0.82);
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 24px 70px rgba(4, 43, 82, 0.2);
  backdrop-filter: blur(12px);
}

.sidebar {
  height: 100%;
  border-right: 0;
  background: linear-gradient(180deg, #063963, #042a4b);
  padding: 18px 14px;
  overflow: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 4px 20px;
  color: #ffffff;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-size: 1.45rem;
  font-weight: 800;
}

.brand h1,
.brand p,
.workspace h2,
.workspace h3,
.eyebrow {
  margin: 0;
}

.brand h1 {
  color: #ffffff;
  font-size: 1.45rem;
  line-height: 1;
}

.brand h1 span {
  color: var(--brand-2);
  font-size: 0.8rem;
  margin-left: 2px;
  vertical-align: top;
}

.brand p,
.eyebrow,
.panel-title,
.field span,
.metrics span,
#selectionStatus,
.measure-result,
td {
  color: var(--muted);
}

.panel {
  border: 1px solid rgba(212, 226, 240, 0.78);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 10px 26px rgba(0, 31, 61, 0.12);
}

.panel-title,
.dock-header,
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-title {
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar .panel {
  box-shadow: none;
  background: rgba(255, 255, 255, 0.98);
}

.icon-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.field {
  display: grid;
  gap: 7px;
  font-size: 0.86rem;
}

.field input,
.search-box input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.field input {
  min-height: 40px;
  padding: 8px 10px;
}

.field input:focus,
.search-box input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 110, 105, 0.14);
}

.metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.metrics div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f7faf9;
}

.metrics strong {
  display: block;
  font-size: 1.35rem;
}

.account-view {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7fbff;
}

.plans-panel {
  position: fixed;
  right: 18px;
  z-index: 2500;
  width: min(360px, calc(100vw - 28px));
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.2);
}

.auth-panel {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3000;
  width: auto;
  min-height: 100vh;
  padding: 28px;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.92), rgba(216, 239, 252, 0.82)),
    url("assets/terrasis-dashboard-theme.png") center / cover fixed;
  box-shadow: none;
}

.auth-panel.open {
  display: grid;
  place-items: center;
}

.plans-panel {
  top: 410px;
  display: none;
  max-height: calc(100vh - 430px);
  overflow: auto;
}

.plans-panel.open:not([hidden]) {
  display: block;
}

.account-view strong {
  font-size: 0.9rem;
}

.account-view span,
.auth-status,
.plan-card span,
.plan-card li {
  color: var(--muted);
  font-size: 0.78rem;
}

.auth-modal {
  display: grid;
  grid-template-columns: minmax(390px, 480px) minmax(520px, 760px);
  width: min(1280px, calc(100vw - 56px));
  min-height: min(820px, calc(100vh - 56px));
  border-radius: 28px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 28px 80px rgba(5, 49, 92, 0.22);
}

.auth-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 50px 42px 34px;
  background: rgba(255, 255, 255, 0.97);
}

.auth-close-button,
.auth-logout-button {
  border: 1px solid #c9d9ec;
  border-radius: 12px;
  background: #fff;
  color: #0a2348;
  font-weight: 1000;
  cursor: pointer;
}

.auth-close-button {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 36px;
  height: 36px;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #062d63;
  text-align: left;
}

.auth-logo-mark {
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.auth-logo strong {
  display: block;
  font-size: clamp(2.2rem, 4vw, 3.8rem);
  line-height: 0.95;
}

.auth-logo span {
  display: block;
  margin-top: 8px;
  color: #0b63bd;
  font-weight: 900;
}

.auth-heading {
  text-align: center;
}

.auth-heading h2 {
  margin: 0;
  color: #071a38;
  font-size: 1.8rem;
}

.auth-heading p {
  margin: 8px 0 0;
  color: #61708a;
  font-size: 1rem;
}

.auth-tabs {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 0;
}

.auth-tabs button:last-child {
  grid-column: auto;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 0;
}

.auth-form label {
  display: grid;
  gap: 8px;
  color: #16294a;
  font-size: 0.92rem;
  font-weight: 850;
}

.auth-form input {
  min-height: 54px;
  border: 1px solid #d5e0ee;
  border-radius: 12px;
  padding: 12px 16px;
  color: #071a38;
  font: inherit;
  font-weight: 700;
  outline: none;
}

.auth-form input:focus {
  border-color: #0b63bd;
  box-shadow: 0 0 0 4px rgba(11, 99, 189, 0.12);
}

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #263a5a;
  font-size: 0.9rem;
}

.auth-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: inherit;
}

.auth-options input {
  width: 18px;
  height: 18px;
  min-height: 0;
  accent-color: #0b63bd;
}

.auth-options button,
.auth-switch-copy button {
  border: 0;
  background: transparent;
  color: #0b63bd;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.auth-form button,
.plan-card button {
  min-height: 54px;
  border: 0;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(11, 99, 189, 0.24);
}

.auth-form .auth-options button {
  min-height: auto;
  border-radius: 0;
  background: transparent;
  color: #0b63bd;
  box-shadow: none;
  font-weight: 900;
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  color: #61708a;
  font-size: 0.88rem;
}

.auth-divider::before,
.auth-divider::after {
  height: 1px;
  background: #d7e2ef;
  content: "";
}

.auth-social {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.auth-social button {
  min-height: 50px;
  border: 1px solid #d5e0ee;
  border-radius: 12px;
  background: #fff;
  color: #152643;
  font-weight: 900;
  cursor: pointer;
}

.auth-switch-copy {
  margin: 0;
  color: #263a5a;
  text-align: center;
}

.auth-status {
  min-height: 22px;
  margin-top: 0;
  text-align: center;
}

.auth-status.error {
  color: #9f2d25;
}

.auth-logout-button {
  min-height: 42px;
}

.auth-visual-panel {
  position: relative;
  display: grid;
  align-content: space-between;
  min-height: 100%;
  padding: 56px 52px 34px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(237, 248, 255, 0.78) 0%, rgba(237, 248, 255, 0.18) 42%, rgba(237, 248, 255, 0) 72%),
    url("assets/terrasis-auth-scene.png") center right / cover;
}

.auth-scene-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center right;
}

.auth-visual-panel::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(90deg, rgba(237, 248, 255, 0.86) 0%, rgba(237, 248, 255, 0.28) 44%, rgba(237, 248, 255, 0.02) 100%);
  content: "";
}

.auth-visual-copy {
  position: relative;
  z-index: 1;
  max-width: 460px;
}

.auth-visual-copy h3 {
  margin: 0;
  color: #071a38;
  font-size: clamp(2.1rem, 4vw, 3.35rem);
  line-height: 1.08;
}

.auth-visual-copy p {
  margin: 18px 0 0;
  color: #152b50;
  font-size: 1.18rem;
  line-height: 1.55;
}

.auth-floating-icons {
  position: absolute;
  z-index: 1;
  right: 28px;
  top: 36%;
  display: grid;
  gap: 14px;
}

.auth-floating-icons span {
  display: grid;
  min-width: 72px;
  min-height: 56px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #0b63bd;
  font-size: 0.75rem;
  font-weight: 1000;
  box-shadow: 0 14px 32px rgba(6, 42, 78, 0.16);
}

.auth-benefits {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border-radius: 22px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 48px rgba(6, 42, 78, 0.16);
}

.auth-benefits div {
  display: grid;
  gap: 8px;
  min-height: 132px;
  align-content: center;
  padding: 20px 16px;
  border-left: 1px solid #d7e2ef;
  text-align: center;
}

.auth-benefits div:first-child {
  border-left: 0;
}

.auth-benefits strong {
  color: #071a38;
  font-size: 0.95rem;
}

.auth-benefits span {
  color: #405372;
  font-size: 0.82rem;
  line-height: 1.45;
}

.plan-list {
  display: grid;
  gap: 9px;
}

.plan-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfd;
}

.plan-card strong {
  font-size: 0.95rem;
}

.plan-card ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 16px;
}

.plan-card.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 110, 105, 0.14);
}

.plan-card.active button {
  background: #87908d;
  cursor: default;
}

.segmented,
.tool-grid {
  display: grid;
  gap: 8px;
}

.segmented {
  grid-template-columns: repeat(2, 1fr);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 4px;
  background: #f0f6fb;
}

.segmented button {
  min-height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 0.86rem;
}

.segmented button:last-child {
  grid-column: 1 / -1;
}

.weather-segmented {
  grid-template-columns: repeat(3, 1fr);
}

.weather-segmented button:last-child {
  grid-column: auto;
}

.segmented button.active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 5px 16px rgba(11, 99, 189, 0.16);
}

.auth-panel .auth-tabs {
  grid-template-columns: repeat(3, 1fr);
}

.auth-panel .auth-tabs button:last-child {
  grid-column: auto;
}

.layer-list {
  display: grid;
  gap: 9px;
}

.layer-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #d9e6f2;
  border-radius: 13px;
  padding: 10px;
  background: #fbfdff;
}

.operation-layer-row {
  background: #f7fbfa;
  border-style: dashed;
}

.layer-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 2px solid currentColor;
  background: color-mix(in srgb, currentColor 22%, transparent);
}

.layer-meta strong {
  display: block;
  font-size: 0.91rem;
}

.layer-meta span {
  color: var(--muted);
  font-size: 0.78rem;
}

.layer-actions {
  display: inline-grid;
  grid-template-columns: 38px 28px;
  align-items: center;
  gap: 7px;
}

.layer-delete {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #9f2d25;
  font-size: 0.72rem;
  font-weight: 900;
  cursor: pointer;
}

.layer-delete:hover {
  border-color: #b6493c;
  background: #fff5f3;
}

.toggle {
  position: relative;
  width: 38px;
  height: 22px;
}

.toggle input {
  position: absolute;
  opacity: 0;
}

.toggle span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #cfd8de;
}

.toggle span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
}

.toggle input:checked + span {
  background: var(--brand);
}

.toggle input:checked + span::after {
  transform: translateX(16px);
}

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

.tool-button {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  padding: 10px;
}

.tool-button.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 99, 189, 0.14);
}

.tool-button span {
  display: block;
  color: var(--brand);
  font-size: 1.15rem;
  line-height: 1;
}

.tool-button strong {
  display: block;
  margin-top: 8px;
  font-size: 0.86rem;
}

.tool-button.locked,
.secondary-button.locked {
  opacity: 0.56;
}

.tool-button.locked::after,
.secondary-button.locked::after {
  content: " LOCKED";
  display: inline-block;
  margin-left: 4px;
  color: #8a5b00;
  font-size: 0.64rem;
  font-weight: 900;
}

.control-stack {
  display: grid;
  gap: 12px;
}

.range-field {
  display: grid;
  gap: 8px;
}

.range-field span {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.84rem;
}

.range-field strong {
  color: var(--ink);
}

.range-field input {
  accent-color: var(--brand);
}

.robot-form {
  display: grid;
  gap: 10px;
}

.robot-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.robot-form input,
.robot-form select {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px 9px;
  color: var(--ink);
}

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

.robot-route-status {
  min-height: 42px;
  margin-top: 12px;
  border-left: 3px solid var(--brand);
  padding-left: 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.telemetry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.telemetry-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
  padding: 9px;
}

.telemetry-grid span,
.waypoint-list span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
}

.telemetry-grid strong {
  display: block;
  margin-top: 2px;
  font-size: 0.9rem;
}

.waypoint-list {
  display: grid;
  gap: 7px;
  max-height: 124px;
  margin: 12px 0 0;
  padding-left: 20px;
  overflow: auto;
  color: var(--ink);
  font-size: 0.82rem;
}

.waypoint-list li {
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}

.drawing-list {
  display: grid;
  gap: 8px;
  max-height: 190px;
  overflow: auto;
}

.drawing-list > span {
  color: var(--muted);
  font-size: 0.82rem;
}

.drawing-item {
  display: grid;
  gap: 7px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.drawing-item strong {
  font-size: 0.84rem;
}

.drawing-item span {
  color: var(--muted);
  font-size: 0.74rem;
}

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

.drawing-actions button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 900;
  cursor: pointer;
}

.drawing-actions button:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.measure-result {
  min-height: 38px;
  margin-top: 12px;
  border-left: 3px solid var(--brand-2);
  padding-left: 10px;
  font-size: 0.86rem;
}

.weather-readout {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  border-left: 3px solid var(--brand);
  padding-left: 10px;
}

.weather-readout strong {
  font-size: 0.92rem;
}

.weather-readout span,
.weather-alerts,
.weather-legend {
  color: var(--muted);
  font-size: 0.82rem;
}

.terrain-controls {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.terrain-controls label {
  display: grid;
  grid-template-columns: 72px minmax(72px, 1fr) 46px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.terrain-controls input {
  width: 100%;
}

.terrain-controls span {
  color: var(--ink);
  text-align: right;
}

.terrain-boundary {
  display: grid;
  gap: 6px;
  padding: 10px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.terrain-boundary strong {
  font-size: 0.88rem;
}

.terrain-boundary span,
.terrain-progress > span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.terrain-boundary-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.terrain-boundary-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.terrain-boundary-actions button:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.terrain-progress {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.terrain-progress[hidden] {
  display: none;
}

.terrain-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #d8e4e3;
}

.terrain-progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--orange));
  transition: width 0.16s ease;
}

.terrain-readout {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  border-left: 3px solid var(--brand-2);
  padding-left: 10px;
}

.terrain-readout strong {
  font-size: 0.92rem;
}

.terrain-readout span,
.terrain-legend {
  color: var(--muted);
  font-size: 0.82rem;
}

.weather-legend {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.terrain-legend {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.terrain-output-button {
  display: inline-grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  margin-top: 12px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #0b63bd, #1496d4);
  color: #fff;
  font-weight: 1000;
  box-shadow: 0 12px 24px rgba(11, 99, 189, 0.2);
}

.terrain-output-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.legend-ramp {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #22c55e, #facc15, #f97316, #dc2626);
}

.legend-labels {
  display: flex;
  justify-content: space-between;
}

.weather-alerts {
  display: grid;
  gap: 6px;
  max-height: 120px;
  margin-top: 12px;
  overflow: auto;
}

.weather-alert {
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-2);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) 210px;
  height: 100%;
  min-width: 0;
  min-height: 0;
  background: #f6fbff;
}

.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  padding: 12px 18px;
}

.eyebrow {
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.workspace h2 {
  margin-top: 2px;
  font-size: 1.25rem;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workspace-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.workspace-nav button {
  min-height: 34px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #071a38;
  font-weight: 800;
}

.workspace-nav button.active {
  border-color: var(--brand);
  color: var(--brand);
}

.primary-button,
.secondary-button,
.search-box button {
  min-height: 38px;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 800;
}

.primary-button,
.search-box button {
  border: 1px solid var(--brand);
  background: linear-gradient(135deg, #0b63bd, #1685dc);
  color: #fff;
}

.secondary-button {
  border: 1px solid #d3e2f0;
  background: #fff;
  color: var(--ink);
}

.secondary-button.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 110, 105, 0.14);
}

.map-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border: 12px solid #eef6fc;
  border-radius: 0 0 22px 0;
}

#map {
  width: 100%;
  height: 100%;
  border-radius: 16px;
}

.weather-canvas {
  position: absolute;
  inset: 0;
  z-index: 430;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.terrain-analysis-canvas {
  position: absolute;
  inset: 0;
  z-index: 420;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.map-overlay {
  position: absolute;
  z-index: 600;
  border: 1px solid rgba(194, 216, 237, 0.8);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.search-box {
  top: 18px;
  left: 72px;
  right: 18px;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 8px;
  max-width: 620px;
  padding: 8px;
}

.search-results {
  grid-column: 1 / -1;
  display: grid;
  gap: 4px;
  max-height: 220px;
  overflow: auto;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.search-result {
  display: grid;
  gap: 3px;
  border: 0;
  border-radius: 7px;
  background: #f5f8f9;
  color: var(--ink);
  padding: 9px;
  text-align: left;
}

.search-result:hover,
.search-result:focus {
  background: rgba(11, 110, 105, 0.1);
}

.search-result strong {
  font-size: 0.82rem;
}

.search-result span {
  color: var(--muted);
  font-size: 0.74rem;
}

.search-box input {
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #d7e2ef;
  border-radius: 12px;
}

.coordinate-box {
  left: 18px;
  right: auto;
  bottom: 144px;
  padding: 10px 14px;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 800;
}

.map-control-dock {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 620;
  display: grid;
  width: min(760px, calc(100% - 72px));
  transform: translateX(-50%);
  gap: 10px;
  border: 1px solid rgba(194, 216, 237, 0.82);
  border-radius: 18px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 48px rgba(5, 49, 92, 0.18);
}

.map-control-dock strong {
  text-align: center;
  color: #071a38;
}

.map-control-dock div {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
}

.map-control-dock button {
  display: grid;
  place-items: center;
  gap: 5px;
  min-height: 58px;
  border: 0;
  border-left: 1px solid #d7e2ef;
  background: transparent;
  color: var(--brand);
  font-weight: 1000;
}

.map-control-dock button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.map-control-dock button:first-child {
  border-left: 0;
}

.map-control-dock button span {
  color: #071a38;
  font-size: 0.72rem;
  font-weight: 800;
}

.three-d-panel {
  position: fixed;
  inset: 42px;
  z-index: 3200;
  display: grid;
  grid-template-rows: auto minmax(360px, 1fr) auto auto auto;
  gap: 10px;
  width: auto;
  min-height: 520px;
  padding: 16px;
  border-radius: 20px;
  background: #08131b;
  color: #f8fbfa;
  box-shadow: 0 30px 90px rgba(2, 15, 28, 0.48);
}

.three-d-panel[hidden] {
  display: none;
}

.three-d-header,
.horizon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.three-d-header {
  font-size: 1rem;
  font-weight: 900;
}

#terrainCanvas {
  width: 100%;
  height: 100%;
  min-height: 280px;
  border: 1px solid rgba(248, 251, 250, 0.16);
  border-radius: 8px;
  background: #08131b;
  touch-action: none;
}

.globe-search {
  position: absolute;
  top: 56px;
  left: 24px;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  gap: 8px;
  width: min(430px, calc(100% - 48px));
}

.globe-search-results {
  grid-column: 1 / -1;
  display: grid;
  gap: 5px;
  max-height: 240px;
  overflow: auto;
  padding: 6px;
  border: 1px solid rgba(248, 251, 250, 0.14);
  border-radius: 7px;
  background: rgba(8, 19, 27, 0.92);
}

.globe-search-results[hidden] {
  display: none;
}

.globe-search-result {
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  padding: 8px;
  text-align: left;
  cursor: pointer;
}

.globe-search-result:hover,
.globe-search-result:focus {
  background: rgba(11, 110, 105, 0.68);
}

.globe-search-result strong {
  display: block;
  font-size: 0.82rem;
}

.globe-search-result span {
  color: #d9e5e3;
  font-size: 0.72rem;
}

.globe-search input,
.globe-search button {
  min-height: 36px;
  border-radius: 7px;
}

.globe-controls {
  position: absolute;
  right: 24px;
  bottom: 74px;
  z-index: 2;
  display: grid;
  gap: 8px;
  width: min(310px, calc(100% - 48px));
  padding: 10px;
  border: 1px solid rgba(248, 251, 250, 0.15);
  border-radius: 8px;
  background: rgba(8, 19, 27, 0.78);
}

.globe-controls label {
  display: grid;
  grid-template-columns: 38px 1fr 48px;
  align-items: center;
  gap: 8px;
  color: #d9e5e3;
  font-size: 0.78rem;
  font-weight: 900;
}

.globe-controls span {
  text-align: right;
}

.horizon {
  color: #d9e5e3;
  font-size: 0.78rem;
  font-weight: 800;
}

.terrain-3d-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.terrain-3d-actions button {
  min-height: 32px;
  border: 1px solid rgba(248, 251, 250, 0.18);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
}

.terrain-3d-actions span {
  color: #d9e5e3;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: right;
}

.traffic-line-slow {
  animation: trafficPulse 1.2s ease-in-out infinite;
}

.traffic-line-mid {
  animation: trafficPulse 1.8s ease-in-out infinite;
}

.traffic-line-fast {
  animation: trafficPulse 2.4s ease-in-out infinite;
}

.drone-marker {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  box-shadow: 0 6px 18px rgba(23, 32, 39, 0.28);
  font-size: 0.7rem;
  font-weight: 900;
}

@keyframes trafficPulse {
  0%,
  100% {
    stroke-opacity: 0.45;
  }
  50% {
    stroke-opacity: 1;
  }
}

.data-dock {
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  min-width: 0;
}

.dock-header {
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
}

.workspace h3 {
  margin-top: 2px;
  font-size: 1rem;
}

.table-wrap {
  height: 172px;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

th,
td {
  padding: 10px 22px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafb;
  color: var(--ink);
  font-size: 0.76rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  background: rgba(39, 136, 93, 0.12);
  color: var(--success);
  font-size: 0.78rem;
  font-weight: 800;
}

.status-pill.review {
  background: rgba(217, 137, 43, 0.16);
  color: #9a5a13;
}

.leaflet-popup-content-wrapper {
  border-radius: 8px;
}

.popup-title {
  margin: 0 0 6px;
  font-weight: 900;
}

.popup-list {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  body.auth-open {
    overflow: hidden;
  }

  .home-screen {
    padding: 26px 22px;
  }

  .app-shell {
    width: min(100vw - 22px, 1280px);
    margin: 18px auto;
  }

  .home-nav {
    grid-template-columns: 1fr auto;
  }

  .home-links {
    display: none;
  }

  .home-hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 44px;
  }

  .home-brand strong {
    font-size: 2.2rem;
  }

  .home-copy h1 {
    font-size: 3rem;
  }

  .home-visual {
    min-height: 430px;
  }

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

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .sidebar {
    height: auto;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workspace {
    height: auto;
    grid-template-rows: auto minmax(520px, 64vh) 260px;
  }

  .auth-panel {
    padding: 18px;
  }

  .auth-modal {
    grid-template-columns: 1fr;
    width: min(100%, 560px);
    min-height: auto;
  }

  .auth-card {
    padding: 44px 24px 28px;
  }

  .auth-visual-panel {
    min-height: 420px;
    padding: 34px 26px 24px;
  }

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

  .auth-benefits div:nth-child(3) {
    border-left: 0;
  }
}

@media (max-width: 600px) {
  .home-screen {
    padding: 18px 14px;
  }

  .home-nav,
  .home-actions,
  .home-cta {
    align-items: stretch;
  }

  .home-actions {
    flex-direction: column;
  }

  .home-copy h1 {
    font-size: 2.35rem;
  }

  .home-copy p {
    font-size: 1.02rem;
  }

  .home-features,
  .home-stats {
    grid-template-columns: 1fr;
  }

  .home-visual {
    min-height: 300px;
  }

  .workspace-nav,
  .map-control-dock {
    display: none;
  }

  .sidebar,
  .topbar,
  .dock-header {
    padding: 14px;
  }

  .topbar,
  .dock-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .search-box {
    left: 12px;
    grid-template-columns: 1fr;
  }

  .workspace {
    grid-template-rows: auto minmax(470px, 60vh) 280px;
  }

  .auth-panel {
    padding: 10px;
  }

  .auth-modal {
    width: 100%;
    border-radius: 20px;
  }

  .auth-card {
    gap: 14px;
    padding: 42px 18px 24px;
  }

  .auth-logo {
    justify-content: flex-start;
  }

  .auth-logo-mark {
    width: 58px;
    height: 58px;
    border-radius: 18px;
  }

  .auth-logo strong {
    font-size: 2rem;
  }

  .auth-social,
  .auth-benefits {
    grid-template-columns: 1fr;
  }

  .auth-benefits div,
  .auth-benefits div:nth-child(3) {
    border-left: 0;
    border-top: 1px solid #d7e2ef;
  }

  .auth-benefits div:first-child {
    border-top: 0;
  }

  .auth-visual-panel {
    min-height: 360px;
  }

  .auth-floating-icons {
    display: none;
  }

  th,
  td {
    padding: 10px 14px;
  }
}
