:root {
  color-scheme: dark;
  --panel: #101714;
  --panel-elevated: #16201c;
  --panel-soft: #1b2621;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f8f6;
  --muted: #91a098;
  --muted-light: #bdc8c1;
  --accent: #b8f25b;
  --accent-strong: #9de13e;
  --danger: #ff8a76;
  --panel-width: 424px;
  font-family: Inter, "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html,
body,
.app-shell,
#map {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: #0b100e;
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.app-shell {
  position: relative;
  isolation: isolate;
}

#map {
  z-index: 0;
  background:
    radial-gradient(circle at 70% 35%, rgba(65, 96, 82, 0.36), transparent 40%),
    #17201c;
}

#map::after {
  position: absolute;
  z-index: 500;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, rgba(4, 8, 6, 0.18), transparent 42%),
    radial-gradient(circle at center, transparent 58%, rgba(7, 10, 8, 0.22));
}

.takeoff-panel {
  position: absolute;
  z-index: 1000;
  top: 18px;
  bottom: 18px;
  left: 18px;
  display: flex;
  width: min(var(--panel-width), calc(100vw - 36px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  background:
    radial-gradient(circle at 105% -4%, rgba(184, 242, 91, 0.1), transparent 29%),
    linear-gradient(160deg, rgba(18, 26, 22, 0.98), rgba(12, 18, 15, 0.98));
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.42),
    0 4px 14px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(24px);
}

.panel-inner {
  display: flex;
  width: 100%;
  min-height: 0;
  flex-direction: column;
  overflow: auto;
  padding: 24px 24px 18px;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
  scrollbar-width: thin;
}

.brand-row,
.brand,
.result-kicker,
.loading-heading,
.source-note,
.result-meta,
.panel-footer {
  display: flex;
  align-items: center;
}

.brand-row {
  min-height: 34px;
  justify-content: space-between;
}

.brand {
  gap: 10px;
  color: #eff5f1;
  font-size: 15px;
  font-weight: 670;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand strong {
  color: var(--accent);
  font-weight: 760;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(184, 242, 91, 0.25);
  border-radius: 10px;
  background: rgba(184, 242, 91, 0.08);
  place-items: center;
}

.brand-mark svg {
  width: 27px;
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.35;
}

.brand-mark svg path:nth-child(n + 2) {
  fill: rgba(184, 242, 91, 0.08);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* model version switcher: same pill language as the mode badge */
.model-picker {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 8px 4px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel-elevated);
}

.model-picker > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 680;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.model-picker select {
  padding: 0 2px;
  border: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 640;
  cursor: pointer;
}

.model-picker select:disabled {
  color: var(--muted);
  cursor: progress;
}

.model-picker select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.model-picker option {
  color: var(--text);
  background: var(--panel-elevated);
}

/* caption for the selected model version, tied to the picker above it */
.model-description {
  margin: 11px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: #7b8a81;
  font-size: 9.5px;
  line-height: 1.55;
}

.mode-badge {
  padding: 5px 9px;
  border: 1px solid rgba(184, 242, 91, 0.2);
  border-radius: 999px;
  color: #ccee98;
  background: rgba(184, 242, 91, 0.07);
  font-size: 10px;
  font-weight: 680;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.intro {
  padding: 36px 0 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: #f7faf8;
  font-size: clamp(35px, 3.1vw, 42px);
  font-weight: 590;
  letter-spacing: -0.052em;
  line-height: 0.98;
}

h1 span {
  color: #a9b6ae;
}

.intro-copy {
  max-width: 345px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.58;
}

.address-form label {
  display: block;
  margin-bottom: 8px;
  color: #c4cec8;
  font-size: 11px;
  font-weight: 630;
  letter-spacing: 0.02em;
}

.input-wrap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.16);
  transition:
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.input-wrap:focus-within {
  border-color: rgba(184, 242, 91, 0.46);
  background: rgba(255, 255, 255, 0.075);
  box-shadow:
    0 0 0 3px rgba(184, 242, 91, 0.07),
    inset 0 1px 1px rgba(0, 0, 0, 0.14);
}

.input-icon {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 15px;
  width: 17px;
  transform: translateY(-50%);
  fill: none;
  stroke: #8d9b93;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  pointer-events: none;
}

#addressInput {
  width: 100%;
  min-width: 0;
  height: 43px;
  padding: 0 10px 0 37px;
  overflow: hidden;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 12.5px;
  font-weight: 490;
  text-overflow: ellipsis;
}

#addressInput::placeholder {
  color: #738078;
}

#submitButton {
  display: flex;
  height: 43px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 15px;
  border: 0;
  border-radius: 10px;
  color: #14200f;
  background: var(--accent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 5px 16px rgba(135, 196, 49, 0.14);
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 740;
  white-space: nowrap;
  transition:
    transform 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease,
    opacity 150ms ease;
}

#submitButton:hover:not(:disabled) {
  background: #c5fa70;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 7px 22px rgba(135, 196, 49, 0.2);
  transform: translateY(-1px);
}

#submitButton:active:not(:disabled) {
  transform: translateY(0);
}

#submitButton:focus-visible,
.timing-toggle:focus-visible,
.layer-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#submitButton:disabled {
  cursor: wait;
  opacity: 0.58;
}

#submitButton svg {
  width: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: transform 150ms ease;
}

#submitButton:hover:not(:disabled) svg {
  transform: translateX(2px);
}

.form-hint {
  margin: 8px 2px 0;
  color: #65736b;
  font-size: 10px;
}

.form-message {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(255, 138, 118, 0.22);
  border-radius: 11px;
  color: #f8c5bb;
  background: rgba(255, 106, 84, 0.07);
  animation: rise-in 240ms ease both;
}

.message-icon {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 138, 118, 0.48);
  border-radius: 50%;
  color: var(--danger);
  font-size: 11px;
  font-weight: 750;
  place-items: center;
}

.form-message strong {
  display: block;
  font-size: 11.5px;
  font-weight: 670;
}

.form-message p {
  margin: 3px 0 0;
  color: #c6958d;
  font-size: 10.5px;
  line-height: 1.45;
}

.loading-state {
  margin-top: 20px;
  padding: 17px 16px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  animation: rise-in 280ms ease both;
}

.loading-heading {
  gap: 11px;
}

.scan-mark {
  position: relative;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid rgba(184, 242, 91, 0.32);
  border-radius: 9px;
  background:
    linear-gradient(rgba(184, 242, 91, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(184, 242, 91, 0.06) 1px, transparent 1px);
  background-size: 8px 8px;
}

.scan-mark::before,
.scan-mark::after {
  position: absolute;
  content: "";
}

.scan-mark::before {
  inset: 8px;
  border: 1px solid rgba(184, 242, 91, 0.75);
  border-radius: 45% 34% 48% 30%;
  transform: rotate(17deg);
}

.scan-mark::after {
  right: 4px;
  left: 4px;
  height: 1px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: scan 1.7s ease-in-out infinite;
}

.loading-heading p {
  margin: 0 0 2px;
  color: #75837a;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.loading-heading strong {
  display: block;
  color: #dce5df;
  font-size: 11.5px;
  font-weight: 590;
}

.loading-percent {
  margin-left: auto;
  color: #829188;
  font-variant-numeric: tabular-nums;
  font-size: 10px;
}

.progress-track {
  height: 2px;
  margin: 15px 0 13px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
}

#progressFill {
  display: block;
  width: 12%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7ec531, var(--accent));
  box-shadow: 0 0 8px rgba(184, 242, 91, 0.35);
  transition: width 520ms cubic-bezier(0.33, 1, 0.68, 1);
}

.stage-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: 0;
  padding: 0;
  color: #59665e;
  font-size: 8px;
  list-style: none;
  text-align: center;
}

.stage-list li {
  position: relative;
  transition: color 220ms ease;
}

.stage-list li:not(:last-child)::after {
  position: absolute;
  top: 3px;
  right: -50%;
  left: 50%;
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
  content: "";
}

.stage-list li > span {
  position: relative;
  z-index: 1;
  display: block;
  width: 7px;
  height: 7px;
  margin: 0 auto 5px;
  border: 1px solid #526058;
  border-radius: 50%;
  background: var(--panel-elevated);
  transition: all 220ms ease;
}

.stage-list li.is-active {
  color: #c7d1cb;
}

.stage-list li.is-active > span {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(184, 242, 91, 0.1);
}

.stage-list li.is-complete {
  color: #819087;
}

.stage-list li.is-complete > span {
  border-color: rgba(184, 242, 91, 0.62);
  background: #82b943;
}

.results-state {
  margin-top: 23px;
  animation: rise-in 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.result-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 19px;
}

.result-kicker {
  gap: 6px;
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 740;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.result-kicker span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(184, 242, 91, 0.09);
}

.result-heading h2 {
  max-width: 285px;
  margin: 0;
  color: #edf3ef;
  font-size: 14px;
  font-weight: 590;
  letter-spacing: -0.025em;
  line-height: 1.35;
}

.layer-count {
  flex: 0 0 auto;
  margin-top: 1px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #89978f;
  background: rgba(255, 255, 255, 0.025);
  font-size: 9px;
  font-weight: 620;
  white-space: nowrap;
}

/* --- parcel provenance + adjustment ---------------------------------------- */

.parcel-bar {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding: 7px 8px 7px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
}

.parcel-bar-text {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.parcel-badge {
  padding: 3px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: #a4b1a9;
  font-size: 8.5px;
  font-weight: 680;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.parcel-badge.is-adjusted {
  border-color: rgba(184, 242, 91, 0.34);
  color: #cdee98;
  background: rgba(184, 242, 91, 0.09);
}

.parcel-area-note {
  overflow: hidden;
  color: #7f8e85;
  font-variant-numeric: tabular-nums;
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.parcel-bar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.parcel-bar.is-editing .parcel-bar-actions {
  display: none;
}

.ghost-button {
  display: flex;
  height: 28px;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: #c2cdc6;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  font-size: 10px;
  font-weight: 640;
  white-space: nowrap;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease;
}

.ghost-button:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
}

.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.ghost-button.is-accent {
  border-color: rgba(184, 242, 91, 0.32);
  color: #d3f39a;
  background: rgba(184, 242, 91, 0.08);
}

.ghost-button.is-accent:hover:not(:disabled) {
  border-color: rgba(184, 242, 91, 0.55);
  color: #e6ffbe;
  background: rgba(184, 242, 91, 0.15);
}

.ghost-button svg {
  width: 14px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linejoin: round;
  stroke-width: 1.25;
}

/* vertex dots read as dots, not rings, at 14px */
.ghost-button svg circle {
  fill: currentColor;
  stroke: none;
}

.ghost-button:focus-visible,
.mini-button:focus-visible,
.editor-primary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.parcel-editor {
  margin-bottom: 15px;
  padding: 13px 13px 12px;
  border: 1px solid rgba(184, 242, 91, 0.26);
  border-radius: 13px;
  background:
    radial-gradient(circle at 100% 0%, rgba(184, 242, 91, 0.07), transparent 55%),
    rgba(184, 242, 91, 0.035);
  animation: rise-in 220ms ease both;
}

.editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.editor-kicker {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 8.5px;
  font-weight: 730;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.editor-readout strong {
  color: #eef4f0;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  font-weight: 640;
  letter-spacing: -0.025em;
}

.editor-delta {
  margin-left: 6px;
  color: #93a29a;
  font-variant-numeric: tabular-nums;
  font-size: 9.5px;
  font-weight: 620;
}

.editor-delta.is-up {
  color: #b8f25b;
}

.editor-delta.is-down {
  color: #f0b48f;
}

.mini-button {
  padding: 5px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: #b9c5be;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-size: 9.5px;
  font-weight: 630;
  white-space: nowrap;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease;
}

.mini-button:hover:not(:disabled) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.09);
}

.mini-button:disabled {
  cursor: default;
  opacity: 0.38;
}

.mini-button.is-danger {
  border-color: rgba(255, 138, 118, 0.3);
  color: #f0b0a2;
  background: rgba(255, 106, 84, 0.07);
}

.mini-button.is-danger:hover:not(:disabled) {
  border-color: rgba(255, 138, 118, 0.5);
  color: #ffd0c5;
  background: rgba(255, 106, 84, 0.14);
}

.mini-button.is-block {
  display: block;
  width: 100%;
  margin-bottom: 9px;
}

.editor-hints {
  margin: 11px 0;
  padding: 0;
  color: #90a097;
  font-size: 9.5px;
  line-height: 1.35;
  list-style: none;
}

.editor-hints li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.editor-hints li + li {
  margin-top: 6px;
}

.hint-mark {
  display: grid;
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  place-items: center;
}

.hint-vertex {
  border: 2px solid #101714;
  border-radius: 50%;
  background: #f5f8f6;
  box-shadow: 0 0 0 1.5px rgba(184, 242, 91, 0.85);
}

.hint-mid {
  border: 1.5px dashed rgba(226, 236, 230, 0.8);
  border-radius: 50%;
  background: rgba(16, 23, 20, 0.5);
}

.hint-key {
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: #b3bfb8;
  background: rgba(255, 255, 255, 0.06);
  font-size: 8px;
}

.editor-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.editor-primary {
  display: flex;
  height: 36px;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  color: #14200f;
  background: var(--accent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    0 5px 16px rgba(135, 196, 49, 0.14);
  cursor: pointer;
  font-size: 10.5px;
  font-weight: 730;
  white-space: nowrap;
  transition:
    transform 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.editor-primary:hover:not(:disabled) {
  background: #c5fa70;
  transform: translateY(-1px);
}

.editor-primary:active:not(:disabled) {
  transform: translateY(0);
}

.editor-primary:disabled {
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.42;
}

.editor-note {
  margin: 10px 0 0;
  padding: 8px 9px;
  border: 1px solid rgba(255, 138, 118, 0.24);
  border-radius: 8px;
  color: #f2c2b7;
  background: rgba(255, 106, 84, 0.07);
  font-size: 9.5px;
  line-height: 1.45;
}

/* the measured surfaces belong to the *previous* boundary while editing */
.results-state.is-editing .table-heading,
.results-state.is-editing .layer-list,
.results-state.is-editing .total-row,
.results-state.is-editing .result-meta,
.results-state.is-editing .timing-details {
  opacity: 0.38;
  filter: saturate(0.55);
  pointer-events: none;
  transition: opacity 200ms ease;
}

.table-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  padding: 0 10px 7px;
  color: #637168;
  font-size: 8.5px;
  font-weight: 680;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.layer-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.layer-row {
  position: relative;
  display: grid;
  min-height: 43px;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  outline: none;
  cursor: default;
  transition:
    background 150ms ease,
    opacity 150ms ease;
}

.layer-row + .layer-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.layer-row:hover,
.layer-row.is-highlighted {
  background: rgba(255, 255, 255, 0.055);
}

.layer-row.is-hidden {
  opacity: 0.47;
}

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

.color-chip {
  position: relative;
  display: grid;
  width: 17px;
  height: 17px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--chip-color) 76%, transparent);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--chip-color) 75%, white),
    0 0 10px color-mix(in srgb, var(--chip-color) 20%, transparent);
  place-items: center;
  transition: transform 150ms ease;
}

.color-chip::after {
  width: 7px;
  height: 4px;
  border-bottom: 1.5px solid #101713;
  border-left: 1.5px solid #101713;
  content: "";
  transform: translateY(-1px) rotate(-45deg);
}

.layer-row.is-hidden .color-chip {
  background: transparent;
  box-shadow: inset 0 0 0 1px #69756e;
}

.layer-row.is-hidden .color-chip::after {
  display: none;
}

.layer-row:hover .color-chip {
  transform: scale(1.08);
}

.layer-name {
  overflow: hidden;
  color: #cfd8d2;
  font-size: 11px;
  font-weight: 540;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-area {
  color: #ebf1ed;
  font-variant-numeric: tabular-nums;
  font-size: 10.5px;
  font-weight: 610;
  white-space: nowrap;
}

.layer-area span {
  margin-left: 2px;
  color: #7a8980;
  font-size: 8.5px;
  font-weight: 510;
}

.empty-layers {
  padding: 18px;
  color: #87968d;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 11px 13px;
  border-bottom: 1px solid var(--line);
}

.total-row span {
  display: block;
  margin-bottom: 2px;
  color: #c9d3cd;
  font-size: 10.5px;
  font-weight: 600;
}

.total-row small {
  display: block;
  color: #617067;
  font-size: 8.5px;
}

.total-row strong {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.result-meta {
  min-height: 40px;
  justify-content: space-between;
  gap: 12px;
}

.source-note {
  min-width: 0;
  gap: 6px;
  color: #6f7e75;
  font-size: 8.5px;
}

.source-note svg {
  width: 13px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.1;
}

.source-note span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timing-toggle {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0;
  border: 0;
  color: #79877f;
  background: transparent;
  cursor: pointer;
  font-size: 8.5px;
  white-space: nowrap;
}

.timing-toggle:hover {
  color: #acb8b1;
}

.timing-toggle svg {
  width: 12px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.3;
  transition: transform 180ms ease;
}

.timing-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.timing-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--line);
  animation: reveal 180ms ease both;
}

.timing-item {
  min-width: 0;
  padding: 8px;
  background: #111a16;
}

.timing-item span,
.timing-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timing-item span {
  margin-bottom: 2px;
  color: #65736b;
  font-size: 7.5px;
  text-transform: capitalize;
}

.timing-item strong {
  color: #aab6af;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  font-weight: 570;
}

.welcome-state {
  margin-top: auto;
  padding-top: 24px;
}

.preview-card {
  position: relative;
  height: 132px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.015) 25%, transparent 25%) 0 0 / 14px 14px,
    linear-gradient(-45deg, rgba(255, 255, 255, 0.015) 25%, transparent 25%) 0 0 / 14px 14px,
    #151e1a;
}

.preview-card::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 35%, rgba(11, 17, 14, 0.5));
}

.preview-card svg {
  width: 100%;
  height: 100%;
}

.preview-road {
  fill: none;
  stroke: rgba(209, 217, 212, 0.1);
  stroke-width: 18;
}

.preview-parcel {
  fill: none;
  stroke: rgba(255, 255, 255, 0.65);
  stroke-dasharray: 4 4;
  stroke-width: 1;
}

.preview-turf {
  fill: rgba(84, 184, 91, 0.42);
  stroke: #79dc7d;
  stroke-width: 1;
}

.preview-bed {
  fill: rgba(213, 147, 76, 0.36);
  stroke: #e4a55e;
  stroke-width: 1;
}

.preview-building {
  fill: #2d3732;
  stroke: #5c6962;
  stroke-width: 1;
}

.preview-tag {
  position: absolute;
  z-index: 1;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 5px;
  color: #dce6df;
  background: rgba(13, 19, 16, 0.78);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  font-size: 7.5px;
  font-weight: 600;
  backdrop-filter: blur(5px);
}

.preview-tag-one {
  top: 40px;
  left: 66px;
}

.preview-tag-two {
  right: 42px;
  bottom: 34px;
}

.welcome-state > p {
  margin: 11px 3px 0;
  color: #6c7971;
  font-size: 9.5px;
}

.welcome-state > p strong {
  color: #9ca9a1;
  font-weight: 600;
}

.panel-footer {
  gap: 9px;
  margin-top: auto;
  padding-top: 19px;
  color: #57645c;
  font-size: 8px;
  letter-spacing: 0.025em;
}

.footer-separator {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #536159;
}

.map-status {
  position: absolute;
  z-index: 800;
  top: 18px;
  left: calc(var(--panel-width) + 34px);
  display: flex;
  height: 32px;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9px;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(13, 19, 16, 0.78);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.19);
  font-size: 9px;
  font-weight: 570;
  backdrop-filter: blur(10px);
  transition: opacity 180ms ease;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(184, 242, 91, 0.1);
}

.map-status.is-working .status-dot {
  animation: soft-pulse 1.3s ease-in-out infinite;
}

.map-status.is-error .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(255, 138, 118, 0.1);
}

.leaflet-control-zoom {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 10px !important;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22) !important;
}

.leaflet-control-zoom a {
  width: 32px !important;
  height: 32px !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: rgba(255, 255, 255, 0.82) !important;
  background: rgba(13, 19, 16, 0.86) !important;
  font: 18px/31px Inter, sans-serif !important;
  backdrop-filter: blur(10px);
}

.leaflet-control-zoom a:hover {
  color: var(--accent) !important;
  background: rgba(24, 34, 29, 0.95) !important;
}

.leaflet-control-attribution {
  padding: 3px 7px !important;
  color: rgba(255, 255, 255, 0.55) !important;
  background: rgba(10, 14, 12, 0.65) !important;
  font-size: 8px !important;
  backdrop-filter: blur(6px);
}

.leaflet-control-attribution a {
  color: rgba(222, 237, 228, 0.7) !important;
}

.surface-tooltip {
  padding: 6px 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 7px !important;
  color: #e9efeb !important;
  background: rgba(12, 18, 15, 0.9) !important;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.24) !important;
  font: 560 9px/1.2 Inter, sans-serif !important;
  backdrop-filter: blur(8px);
}

.surface-tooltip::before {
  display: none;
}

/* --- parcel edit handles ---------------------------------------------------
   Leaflet positions the marker icon with a transform, so the visual dot is an
   inner span: hover/selection can scale it without fighting the map. */
.parcel-handle {
  display: grid;
  touch-action: none;
  place-items: center;
}

.parcel-handle span {
  display: block;
  box-sizing: border-box;
  border-radius: 50%;
  transition:
    transform 120ms ease,
    background 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease,
    opacity 120ms ease;
}

.vertex-wrap {
  cursor: grab;
}

.vertex-dot {
  width: 13px;
  height: 13px;
  border: 2.5px solid #0d1411;
  background: #f5f8f6;
  box-shadow:
    0 0 0 1.5px rgba(184, 242, 91, 0.9),
    0 2px 6px rgba(0, 0, 0, 0.45);
}

.vertex-wrap:hover .vertex-dot {
  background: var(--accent);
  transform: scale(1.25);
}

.vertex-wrap.is-selected .vertex-dot {
  background: var(--accent);
  box-shadow:
    0 0 0 3.5px rgba(184, 242, 91, 0.32),
    0 2px 8px rgba(0, 0, 0, 0.5);
  transform: scale(1.2);
}

.vertex-wrap.leaflet-drag-target,
body.is-dragging-handle .vertex-wrap {
  cursor: grabbing;
}

.mid-wrap {
  cursor: copy;
}

.mid-dot {
  width: 10px;
  height: 10px;
  border: 1.5px dashed rgba(232, 240, 235, 0.85);
  background: rgba(13, 20, 17, 0.5);
  opacity: 0.75;
}

.mid-wrap:hover .mid-dot {
  border-color: var(--accent);
  border-style: solid;
  background: rgba(184, 242, 91, 0.45);
  opacity: 1;
  transform: scale(1.3);
}

/* while a midpoint is being dragged into a new corner, its neighbours would sit
   at stale positions until the handles rebuild — hide them for the gesture */
body.is-inserting .mid-wrap {
  opacity: 0;
  pointer-events: none;
}

body.is-inserting .mid-wrap.leaflet-drag-target {
  opacity: 1;
}

body.is-inserting .mid-wrap.leaflet-drag-target .mid-dot {
  border-color: #0d1411;
  border-style: solid;
  border-width: 2.5px;
  background: var(--accent);
  box-shadow:
    0 0 0 1.5px rgba(184, 242, 91, 0.9),
    0 2px 6px rgba(0, 0, 0, 0.45);
  opacity: 1;
  transform: scale(1.25);
}

@media (pointer: coarse) {
  .vertex-dot {
    width: 17px;
    height: 17px;
  }

  .mid-dot {
    width: 14px;
    height: 14px;
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
}

@keyframes scan {
  0%,
  100% {
    top: 6px;
    opacity: 0.5;
  }
  50% {
    top: 25px;
    opacity: 1;
  }
}

@keyframes soft-pulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 700px) {
  :root {
    --panel-width: 100vw;
  }

  .takeoff-panel {
    top: auto;
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
    max-height: min(62vh, 610px);
    border-radius: 18px;
  }

  .panel-inner {
    padding: 17px 18px 14px;
  }

  .intro {
    padding: 22px 0 18px;
  }

  h1 {
    font-size: 32px;
  }

  .intro-copy,
  .welcome-state,
  .panel-footer {
    display: none;
  }

  .map-status {
    top: 12px;
    left: 12px;
  }

  .leaflet-top.leaflet-right {
    top: 4px;
    right: 4px;
  }
}

@media (max-width: 390px) {
  #submitButton span {
    display: none;
  }

  #submitButton {
    width: 43px;
    padding: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
