:root {
  color-scheme: light;
  --forest-950: #0a241c;
  --forest-900: #102f25;
  --forest-850: #153d30;
  --forest-800: #1b4939;
  --forest-700: #2d604d;
  --leaf-500: #87ad47;
  --leaf-400: #a9ce63;
  --leaf-300: #c1df82;
  --cream-50: #fbfcf7;
  --cream-100: #f4f5ed;
  --cream-200: #e8eadd;
  --ink-900: #18231e;
  --ink-700: #405148;
  --ink-500: #6b7a72;
  --line: #dfe4da;
  --coffee: #a86d43;
  --coffee-soft: #f1e1d4;
  --sky: #3d8790;
  --gold: #d4a84d;
  --danger: #ba5149;
  --white: #ffffff;
  --sidebar-width: 356px;
  --topbar-height: 68px;
  --status-height: 34px;
  --shadow-sm: 0 3px 12px rgba(12, 35, 27, 0.08);
  --shadow-md: 0 14px 36px rgba(9, 35, 26, 0.14);
  --shadow-lg: 0 28px 72px rgba(8, 29, 22, 0.24);
  font-family: Inter, "Avenir Next", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--ink-900);
  background: var(--forest-950);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

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

button {
  color: inherit;
}

button:not(:disabled),
a:not([aria-disabled="true"]) {
  cursor: pointer;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
#map:focus-visible {
  outline: 3px solid rgba(169, 206, 99, 0.48);
  outline-offset: 2px;
}

svg {
  display: block;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 9999;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--forest-950);
  background: var(--leaf-300);
  font-size: 13px;
  font-weight: 800;
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.sidebar {
  position: relative;
  z-index: 30;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  color: var(--cream-50);
  background:
    radial-gradient(circle at 12% -4%, rgba(169, 206, 99, 0.18), transparent 25%),
    linear-gradient(175deg, var(--forest-850) 0%, var(--forest-900) 50%, var(--forest-950) 100%);
  border-right: 1px solid rgba(193, 223, 130, 0.16);
}

.brand-header {
  display: flex;
  flex: 0 0 82px;
  align-items: center;
  gap: 11px;
  padding: 9px 20px;
  border-bottom: 1px solid rgba(232, 234, 221, 0.12);
}

.brand-symbol {
  display: flex;
  width: 58px;
  height: 64px;
  flex: 0 0 58px;
  align-items: center;
  justify-content: center;
}

.brand-symbol img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(4, 20, 14, 0.28));
}

.brand-copy {
  min-width: 0;
}

.brand-name {
  font-size: 19px;
  font-weight: 790;
  letter-spacing: -0.55px;
  line-height: 1.1;
}

.brand-name span {
  color: var(--leaf-300);
}

.brand-tagline {
  margin-top: 4px;
  color: #aebdb5;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-700);
  background: var(--white);
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease, transform 140ms ease;
}

.icon-button:hover {
  color: var(--forest-800);
  border-color: #becabb;
  transform: translateY(-1px);
}

.icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.sidebar-close {
  display: none;
  margin-left: auto;
  color: var(--cream-200);
  border-color: rgba(232, 234, 221, 0.16);
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(169, 206, 99, 0.35) transparent;
  scrollbar-width: thin;
}

.sidebar-scroll::-webkit-scrollbar {
  width: 6px;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
  border-radius: 20px;
  background: rgba(169, 206, 99, 0.28);
}

.plot-card {
  margin: 16px 16px 4px;
  padding: 16px;
  border: 1px solid rgba(193, 223, 130, 0.16);
  border-radius: 15px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.plot-card-topline,
.section-heading-row,
.legend-title-row,
.pixel-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow,
.section-kicker {
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.25;
  text-transform: uppercase;
}

.plot-card .eyebrow,
.control-section .section-kicker {
  color: var(--leaf-300);
}

.data-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #b7c4bd;
  font-size: 10px;
  font-weight: 650;
}

.data-status i,
.status-message i {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(212, 168, 77, 0.12);
}

.data-status.is-ready i,
.status-message.is-ready i {
  background: var(--leaf-400);
  box-shadow: 0 0 0 4px rgba(169, 206, 99, 0.12);
}

.data-status.is-error i,
.status-message.is-error i {
  background: #e07d72;
  box-shadow: 0 0 0 4px rgba(224, 125, 114, 0.12);
}

.plot-card h1 {
  margin: 10px 0 4px;
  color: var(--cream-50);
  font-size: 19px;
  font-weight: 740;
  letter-spacing: -0.35px;
}

.plot-card > p {
  min-height: 16px;
  margin: 0;
  color: #aebdb5;
  font-size: 11px;
  line-height: 1.45;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 14px;
}

.summary-item {
  min-width: 0;
  padding: 9px 8px;
  border: 1px solid rgba(232, 234, 221, 0.1);
  border-radius: 9px;
  background: rgba(5, 27, 20, 0.2);
}

.summary-item strong {
  display: block;
  overflow: hidden;
  color: var(--cream-50);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-item span {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: #96aaa0;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.summary-placeholder,
.skeleton-line {
  overflow: hidden;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
}

.summary-placeholder {
  height: 49px;
}

.summary-placeholder::after,
.skeleton-line::after {
  display: block;
  width: 60%;
  height: 100%;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.09), transparent);
  animation: shimmer 1.35s infinite linear;
}

@keyframes shimmer {
  from { transform: translateX(-120%); }
  to { transform: translateX(220%); }
}

.control-section {
  display: grid;
  gap: 12px;
  margin: 0 16px;
  padding: 20px 0;
  border-bottom: 1px solid rgba(232, 234, 221, 0.1);
}

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

.section-heading-row > div {
  min-width: 0;
}

.section-heading-row h2 {
  margin: 3px 0 0;
  color: var(--cream-50);
  font-size: 14px;
  font-weight: 710;
  letter-spacing: -0.15px;
}

.section-copy {
  margin: -3px 0 0;
  color: #9eafa6;
  font-size: 11px;
  line-height: 1.5;
}

.text-button {
  padding: 5px 0;
  border: 0;
  color: var(--leaf-300);
  background: transparent;
  font-size: 10px;
  font-weight: 750;
}

.text-button:hover {
  color: var(--cream-50);
}

.beta-pill,
.quality-pill {
  padding: 4px 7px;
  border: 1px solid rgba(169, 206, 99, 0.25);
  border-radius: 999px;
  color: var(--leaf-300);
  background: rgba(169, 206, 99, 0.08);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quality-pill {
  color: #b9c7bf;
  border-color: rgba(232, 234, 221, 0.13);
  background: rgba(255, 255, 255, 0.04);
}

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

.skeleton-line {
  height: 48px;
}

.skeleton-line.short {
  width: 78%;
}

.layer-group-title {
  margin: 9px 0 2px;
  color: #82968c;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.layer-group-title:first-child {
  margin-top: 0;
}

.layer-row {
  padding: 8px 9px 7px;
  border: 1px solid transparent;
  border-radius: 10px;
  transition: background 130ms ease, border-color 130ms ease;
}

.layer-row:hover,
.layer-row.is-visible {
  border-color: rgba(232, 234, 221, 0.09);
  background: rgba(255, 255, 255, 0.045);
}

.layer-main {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.layer-toggle {
  position: relative;
  display: inline-flex;
  width: 28px;
  height: 17px;
  flex: 0 0 28px;
}

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

.layer-toggle span {
  width: 100%;
  height: 100%;
  border: 1px solid rgba(232, 234, 221, 0.25);
  border-radius: 999px;
  background: rgba(6, 27, 20, 0.45);
  transition: all 150ms ease;
}

.layer-toggle span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #a7b3ad;
  content: "";
  transition: all 150ms ease;
}

.layer-toggle input:checked + span {
  border-color: var(--leaf-400);
  background: var(--leaf-400);
}

.layer-toggle input:checked + span::after {
  background: var(--forest-950);
  transform: translateX(11px);
}

.layer-toggle input:focus-visible + span {
  outline: 3px solid rgba(169, 206, 99, 0.35);
  outline-offset: 2px;
}

.layer-swatch {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 3px;
  background: var(--layer-color, #728d78);
}

.layer-copy {
  min-width: 0;
  flex: 1;
}

.layer-copy strong {
  display: block;
  overflow: hidden;
  color: #eef1e9;
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-copy span {
  display: block;
  margin-top: 2px;
  color: #83978c;
  font-size: 9px;
}

.legend-button {
  display: grid;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 7px;
  color: #95a79d;
  background: transparent;
}

.legend-button:hover {
  color: var(--leaf-300);
  background: rgba(255, 255, 255, 0.06);
}

.legend-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.layer-opacity {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: center;
  gap: 8px;
  max-height: 0;
  margin: 0 0 0 47px;
  overflow: hidden;
  opacity: 0;
  transition: max-height 160ms ease, opacity 160ms ease, margin-top 160ms ease;
}

.layer-row.is-visible .layer-opacity {
  max-height: 24px;
  margin-top: 7px;
  opacity: 1;
}

input[type="range"] {
  width: 100%;
  height: 3px;
  margin: 0;
  accent-color: var(--leaf-400);
}

.layer-opacity output {
  color: #8ea198;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.band-mapping {
  padding: 9px 10px;
  border: 1px solid rgba(232, 234, 221, 0.1);
  border-radius: 9px;
  color: #8fa299;
  background: rgba(0, 0, 0, 0.08);
  font-size: 9px;
  line-height: 1.5;
}

.band-mapping strong {
  color: #bdc9c2;
  font-weight: 700;
}

.query-form {
  display: grid;
  gap: 9px;
}

.query-domain {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.query-domain legend {
  margin-bottom: 6px;
  padding: 0;
  color: #aebbb4;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.query-domain-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(232, 234, 221, 0.12);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.1);
}

.query-domain-option {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.query-domain-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.query-domain-control {
  display: flex;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 7px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #aebbb4;
  background: transparent;
  font-size: 9px;
  font-weight: 650;
  line-height: 1.25;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.query-domain-control svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.query-domain-option:hover .query-domain-control {
  color: #dce4db;
  background: rgba(255, 255, 255, 0.045);
}

.query-domain-option input:checked + .query-domain-control {
  color: var(--forest-950);
  border-color: rgba(193, 223, 130, 0.75);
  background: var(--leaf-300);
  box-shadow: 0 4px 12px rgba(4, 20, 14, 0.2);
}

.query-domain-option input:focus-visible + .query-domain-control {
  outline: 3px solid rgba(169, 206, 99, 0.48);
  outline-offset: 2px;
}

.query-domain:disabled .query-domain-option {
  cursor: not-allowed;
}

.query-domain:disabled .query-domain-control {
  opacity: 0.55;
}

.prompt-field {
  position: relative;
}

.prompt-field textarea {
  display: block;
  width: 100%;
  min-height: 80px;
  resize: vertical;
  padding: 11px 46px 11px 12px;
  border: 1px solid rgba(232, 234, 221, 0.19);
  border-radius: 12px;
  outline: none;
  color: var(--ink-900);
  background: #f8f9f3;
  font-size: 11px;
  line-height: 1.5;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.prompt-field textarea::placeholder {
  color: #8b9890;
}

.prompt-field textarea:focus {
  border-color: var(--leaf-400);
  box-shadow: 0 0 0 3px rgba(169, 206, 99, 0.13);
}

.send-button {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 9px;
  color: var(--forest-950);
  background: var(--leaf-400);
  box-shadow: 0 4px 12px rgba(37, 70, 33, 0.25);
  transition: background 140ms ease, transform 140ms ease;
}

.send-button:hover {
  background: var(--leaf-300);
  transform: translateY(-1px);
}

.send-button.is-loading svg {
  animation: send-spin 800ms infinite linear;
}

@keyframes send-spin {
  to { transform: rotate(360deg); }
}

.send-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.quick-prompts button {
  min-height: 27px;
  padding: 5px 8px;
  border: 1px solid rgba(232, 234, 221, 0.13);
  border-radius: 999px;
  color: #b2c0b8;
  background: rgba(255, 255, 255, 0.035);
  font-size: 9px;
  font-weight: 600;
  transition: all 130ms ease;
}

.quick-prompts button:hover {
  color: var(--forest-950);
  border-color: var(--leaf-300);
  background: var(--leaf-300);
}

.quick-prompts button[hidden] {
  display: none;
}

.aoi-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid rgba(232, 234, 221, 0.11);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.aoi-control > div:first-child {
  min-width: 0;
}

.aoi-control strong,
.aoi-control span {
  display: block;
}

.aoi-control strong {
  color: #dce2d9;
  font-size: 10px;
  font-weight: 670;
}

.aoi-control span {
  margin-top: 3px;
  overflow: hidden;
  color: #8ea197;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.compact-button {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid rgba(232, 234, 221, 0.17);
  border-radius: 8px;
  color: #d6ded9;
  background: rgba(255, 255, 255, 0.055);
  font-size: 9px;
  font-weight: 650;
}

.compact-button:hover,
.compact-button.is-active {
  color: var(--forest-950);
  border-color: var(--leaf-400);
  background: var(--leaf-400);
}

.compact-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.compact-icon {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
  border-radius: 8px;
}

.compact-icon svg {
  width: 15px;
  height: 15px;
}

.aoi-control .compact-icon {
  color: #b2c0b8;
  border-color: rgba(232, 234, 221, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  color: #82978c;
  font-size: 9px;
  line-height: 1.45;
}

.privacy-note svg {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  margin-top: 1px;
  fill: none;
  stroke: var(--leaf-400);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

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

.tool-card {
  display: grid;
  min-height: 64px;
  place-items: center;
  align-content: center;
  gap: 6px;
  padding: 8px 5px;
  border: 1px solid rgba(232, 234, 221, 0.12);
  border-radius: 10px;
  color: #acbbb3;
  background: rgba(255, 255, 255, 0.035);
  font-size: 9px;
  font-weight: 650;
  transition: all 130ms ease;
}

.tool-card:hover,
.tool-card.is-active {
  color: var(--forest-950);
  border-color: var(--leaf-400);
  background: var(--leaf-400);
}

.tool-card svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

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

.field-row label,
.range-field {
  display: grid;
  min-width: 0;
  gap: 5px;
  color: #94a69d;
  font-size: 9px;
  font-weight: 650;
}

.field-row select {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 8px;
  border: 1px solid rgba(232, 234, 221, 0.14);
  border-radius: 8px;
  outline: 0;
  color: #dde3df;
  background: var(--forest-900);
  font-size: 9px;
}

.field-row select:focus {
  border-color: var(--leaf-400);
}

.range-field {
  gap: 8px;
}

.range-field > span {
  display: flex;
  justify-content: space-between;
}

.range-field output {
  color: var(--leaf-300);
  font-variant-numeric: tabular-nums;
}

.sidebar-footer {
  display: flex;
  min-height: 37px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 16px;
  border-top: 1px solid rgba(232, 234, 221, 0.1);
  color: #70887d;
  background: rgba(5, 24, 18, 0.36);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.workspace {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: var(--topbar-height) minmax(0, 1fr) var(--status-height);
  overflow: hidden;
  background: var(--cream-100);
}

.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 252, 247, 0.96);
  box-shadow: 0 3px 14px rgba(20, 45, 35, 0.05);
  backdrop-filter: blur(12px);
}

.topbar-left,
.topbar-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.menu-button {
  display: none;
}

.view-title {
  min-width: 0;
}

.view-title .eyebrow {
  display: block;
  margin-bottom: 3px;
}

.view-title strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 720;
  letter-spacing: -0.15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subtle-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-700);
  background: var(--white);
  font-size: 10px;
  font-weight: 680;
  transition: border-color 130ms ease, color 130ms ease, transform 130ms ease;
}

.subtle-button:hover {
  color: var(--forest-800);
  border-color: #bdc8ba;
  transform: translateY(-1px);
}

.subtle-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.view-switch {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
  padding: 3px;
  border: 1px solid #d8ded4;
  border-radius: 11px;
  background: #edf0e8;
}

.view-switch button {
  display: inline-flex;
  min-width: 67px;
  min-height: 31px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 9px;
  border: 0;
  border-radius: 8px;
  color: var(--ink-500);
  background: transparent;
  font-size: 10px;
  font-weight: 750;
  transition: color 130ms ease, background 130ms ease, box-shadow 130ms ease;
}

.view-switch button.is-active {
  color: var(--forest-850);
  background: var(--white);
  box-shadow: 0 2px 7px rgba(25, 47, 38, 0.12);
}

.view-switch button:disabled {
  background: transparent;
}

.view-switch svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.viewer-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  background: #d7ded4;
}

.viewer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.viewer.is-hidden,
.is-hidden {
  display: none !important;
}

.terrain-viewer {
  z-index: 2;
  background: #dce3d8;
}

.terrain-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  color: var(--forest-900);
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.92), rgba(244, 245, 237, 0.92)),
    var(--cream-100);
  transition: opacity 280ms ease, visibility 280ms ease;
}

.loading-overlay.is-complete {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.loading-overlay.is-error {
  padding: 24px;
  text-align: center;
}

.loading-overlay strong {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 740;
}

.loading-overlay > span {
  color: var(--ink-500);
  font-size: 11px;
}

.loader-mark {
  display: flex;
  height: 30px;
  align-items: flex-end;
  gap: 4px;
}

.loader-mark i {
  width: 7px;
  height: 16px;
  border-radius: 5px;
  background: var(--forest-800);
  animation: loader-grow 900ms infinite ease-in-out alternate;
}

.loader-mark i:nth-child(2) {
  height: 27px;
  background: var(--leaf-500);
  animation-delay: 150ms;
}

.loader-mark i:nth-child(3) {
  height: 21px;
  background: var(--coffee);
  animation-delay: 300ms;
}

@keyframes loader-grow {
  to { height: 8px; opacity: 0.55; }
}

.map-action-rail {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 8;
  display: grid;
  gap: 5px;
}

.map-icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(203, 211, 200, 0.9);
  border-radius: 10px;
  color: var(--ink-700);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
  transition: color 130ms ease, border-color 130ms ease, background 130ms ease, transform 130ms ease;
}

.map-icon-button:hover,
.map-icon-button.is-active {
  color: var(--forest-900);
  border-color: var(--leaf-500);
  background: #f5faea;
  transform: translateY(-1px);
}

.map-icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
}

.draw-hint {
  position: absolute;
  top: 16px;
  left: 50%;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid rgba(193, 223, 130, 0.36);
  border-radius: 9px;
  color: var(--cream-50);
  background: rgba(10, 36, 28, 0.9);
  box-shadow: var(--shadow-md);
  font-size: 10px;
  transform: translateX(-50%);
  backdrop-filter: blur(9px);
}

.draw-hint span {
  font-weight: 650;
}

.draw-hint kbd {
  padding: 2px 4px;
  border: 1px solid rgba(255, 255, 255, 0.23);
  border-radius: 4px;
  color: #c8d3cc;
  background: rgba(255, 255, 255, 0.08);
  font: inherit;
  font-size: 8px;
}

.legend-panel,
.pixel-card {
  position: absolute;
  z-index: 8;
  width: min(252px, calc(100% - 32px));
  overflow: hidden;
  border: 1px solid rgba(207, 216, 204, 0.94);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
}

.legend-panel {
  right: 16px;
  bottom: 16px;
}

.legend-title-row,
.pixel-card-header {
  padding: 11px 12px;
  border-bottom: 1px solid #e7ebe3;
}

.legend-title-row > div,
.pixel-card-header > div {
  min-width: 0;
}

.legend-title-row span,
.pixel-card-header span {
  display: block;
  color: var(--ink-500);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.legend-title-row strong,
.pixel-card-header strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--ink-900);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-content {
  display: grid;
  max-height: 260px;
  gap: 6px;
  overflow-y: auto;
  padding: 11px 12px 12px;
}

.legend-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  color: var(--ink-700);
  font-size: 9px;
}

.legend-chip {
  width: 14px;
  height: 9px;
  border: 1px solid rgba(26, 40, 33, 0.16);
  border-radius: 3px;
}

.legend-row small {
  color: var(--ink-500);
  font-size: 8px;
}

.legend-gradient {
  height: 12px;
  margin-bottom: 2px;
  border: 1px solid rgba(26, 40, 33, 0.13);
  border-radius: 4px;
}

.legend-range {
  display: flex;
  justify-content: space-between;
  color: var(--ink-500);
  font-size: 8px;
}

.pixel-card {
  left: 66px;
  bottom: 16px;
  width: 280px;
}

.pixel-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 220px;
  gap: 1px;
  overflow-y: auto;
  background: #e9ede6;
}

.pixel-value {
  min-width: 0;
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.97);
}

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

.pixel-value span {
  color: var(--ink-500);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pixel-value strong {
  margin-top: 3px;
  color: var(--ink-900);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 720;
}

.terrain-hud {
  position: absolute;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 9;
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 9px 8px 13px;
  border: 1px solid rgba(232, 234, 221, 0.15);
  border-radius: 12px;
  color: var(--cream-50);
  background: rgba(10, 36, 28, 0.87);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
}

.terrain-hud > div,
.terrain-hud-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.terrain-hud strong {
  font-size: 10px;
}

.dimension-badge {
  display: inline-grid;
  min-width: 29px;
  min-height: 25px;
  place-items: center;
  border-radius: 7px;
  color: var(--forest-950);
  background: var(--leaf-300);
  font-size: 9px;
  font-weight: 850;
}

.terrain-hud-actions > span {
  color: #b2c0b8;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.terrain-hud .subtle-button {
  min-height: 33px;
  color: #dce3dd;
  border-color: rgba(232, 234, 221, 0.16);
  background: rgba(255, 255, 255, 0.06);
}

.result-drawer {
  position: absolute;
  z-index: 18;
  top: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  width: min(380px, calc(100% - 24px));
  flex-direction: column;
  border: 1px solid rgba(214, 221, 211, 0.96);
  border-radius: 17px;
  background: rgba(251, 252, 247, 0.98);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateX(calc(100% + 24px));
  pointer-events: none;
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 180ms ease;
  backdrop-filter: blur(14px);
}

.result-drawer.is-open {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.drawer-handle {
  display: none;
}

.result-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.result-header h2 {
  margin: 4px 0 0;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.35px;
}

.result-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 18px 20px;
}

.result-summary {
  padding-bottom: 16px;
}

.operation-pill,
.ai-badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--forest-800);
  background: #e5efd2;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.ai-badge {
  margin-left: 4px;
  color: #83502e;
  background: var(--coffee-soft);
}

.result-summary p {
  margin: 13px 0 0;
  color: var(--ink-700);
  font-size: 11px;
  line-height: 1.58;
}

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

.metric-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--white);
  box-shadow: 0 3px 10px rgba(16, 48, 37, 0.035);
}

.metric-card span,
.metric-card strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-card span {
  color: var(--ink-500);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.metric-card strong {
  margin-top: 6px;
  color: var(--forest-850);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  letter-spacing: -0.3px;
  line-height: 1.1;
}

.metric-card small {
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 600;
}

.result-caveats,
.result-feature-info {
  margin-top: 16px;
  padding: 12px 13px;
  border: 1px solid #eadcbc;
  border-radius: 10px;
  color: #765f34;
  background: #fff8e8;
  font-size: 9px;
  line-height: 1.5;
}

.result-caveats strong,
.result-feature-info strong {
  display: block;
  margin-bottom: 5px;
  color: #624b22;
  font-size: 9px;
  text-transform: uppercase;
}

.result-caveats ul {
  margin: 0;
  padding-left: 15px;
}

.result-caveats li + li {
  margin-top: 4px;
}

.result-feature-info {
  border-color: #dce4d9;
  color: var(--ink-700);
  background: #f2f6ef;
}

.result-feature-info strong {
  color: var(--forest-800);
}

.feature-properties {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  margin: 0;
}

.feature-properties dt {
  overflow: hidden;
  color: var(--ink-500);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feature-properties dd {
  margin: 0;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  text-align: right;
}

.result-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 38px;
  flex: 0 0 auto;
  gap: 7px;
  padding: 13px 18px 16px;
  border-top: 1px solid var(--line);
}

.primary-download,
.secondary-download {
  display: inline-flex;
  min-width: 0;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid var(--forest-850);
  border-radius: 10px;
  color: var(--white);
  background: var(--forest-850);
  font-size: 9px;
  font-weight: 750;
  text-decoration: none;
  transition: transform 130ms ease, background 130ms ease, opacity 130ms ease;
}

.secondary-download {
  color: var(--forest-850);
  border-color: #cfd8cc;
  background: var(--white);
}

.primary-download:hover,
.secondary-download:hover {
  transform: translateY(-1px);
}

.primary-download svg,
.secondary-download svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.statusbar {
  position: relative;
  z-index: 20;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 20px;
  padding: 0 16px;
  border-top: 1px solid var(--line);
  color: var(--ink-500);
  background: var(--cream-50);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.statusbar > span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-message {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  color: var(--ink-700);
  font-weight: 650;
}

.sidebar-scrim {
  position: fixed;
  inset: 0;
  z-index: 25;
  visibility: hidden;
  background: rgba(5, 24, 18, 0.48);
  opacity: 0;
  transition: opacity 180ms ease, visibility 180ms ease;
  backdrop-filter: blur(2px);
}

.toast-region {
  position: fixed;
  top: 82px;
  right: 18px;
  z-index: 100;
  display: grid;
  width: min(340px, calc(100vw - 36px));
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid #d8dfd4;
  border-radius: 11px;
  color: var(--ink-700);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow-md);
  font-size: 10px;
  line-height: 1.4;
  animation: toast-in 200ms ease both;
  pointer-events: auto;
  backdrop-filter: blur(9px);
}

.toast::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--leaf-500);
  content: "";
}

.toast.is-error::before {
  background: var(--danger);
}

.toast.is-warning::before {
  background: var(--gold);
}

.toast button {
  padding: 3px;
  border: 0;
  color: var(--ink-500);
  background: transparent;
  font-size: 15px;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
}

/* OpenLayers refinements */
.ol-viewport {
  background: #d6ddd3;
}

.ol-control {
  padding: 0;
  border-radius: 10px;
  background: transparent;
}

.ol-zoom {
  top: 16px;
  right: 16px;
  left: auto;
  overflow: hidden;
  border: 1px solid rgba(203, 211, 200, 0.92);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

.ol-zoom button {
  width: 38px;
  height: 36px;
  margin: 0;
  border: 0;
  border-radius: 0;
  color: var(--ink-700);
  background: rgba(255, 255, 255, 0.94);
  font: 20px/1 Inter, sans-serif;
}

.ol-zoom button + button {
  border-top: 1px solid #e1e6de;
}

.ol-zoom button:hover {
  color: var(--forest-900);
  background: #f5faea;
}

.ol-rotate {
  display: none;
}

.ol-attribution {
  right: 9px;
  bottom: 8px;
  border-radius: 7px 0 0;
  color: var(--ink-500);
  background: rgba(255, 255, 255, 0.82);
  font-size: 8px;
}

.ol-attribution button {
  color: var(--forest-800);
  background: transparent;
}

.ol-scale-bar {
  right: 16px;
  bottom: 14px;
  left: auto;
  padding: 6px 8px 5px;
  border: 1px solid rgba(203, 211, 200, 0.85);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}

.ol-scale-step-marker {
  border-color: var(--forest-900);
}

.ol-scale-step-text,
.ol-scale-text {
  color: var(--forest-900);
  font-size: 8px;
  text-shadow: 0 1px white;
}

.measure-tooltip {
  position: relative;
  padding: 5px 7px;
  border: 1px solid rgba(193, 223, 130, 0.35);
  border-radius: 6px;
  color: var(--cream-50);
  background: rgba(10, 36, 28, 0.9);
  box-shadow: var(--shadow-sm);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
}

.measure-tooltip::after {
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -4px;
  border: 4px solid transparent;
  border-top-color: rgba(10, 36, 28, 0.9);
  content: "";
}

.measure-tooltip.is-static {
  color: var(--forest-950);
  border-color: #cfdacb;
  background: rgba(246, 249, 238, 0.96);
}

.measure-tooltip.is-static::after {
  border-top-color: rgba(246, 249, 238, 0.96);
}

@media (max-width: 1100px) {
  :root {
    --sidebar-width: 330px;
  }

  .statusbar {
    gap: 13px;
  }

  #elevationStatus {
    display: none;
  }
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: min(362px, calc(100vw - 44px));
    box-shadow: var(--shadow-lg);
    transform: translateX(-102%);
    transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .sidebar-scrim {
    visibility: visible;
    opacity: 1;
  }

  .sidebar-close,
  .menu-button {
    display: inline-grid;
  }

  .workspace {
    width: 100%;
    height: 100%;
  }

  .topbar {
    padding-left: 12px;
  }

  .map-action-rail {
    left: 12px;
  }

  .pixel-card {
    left: 58px;
  }
}

@media (max-width: 620px) {
  :root {
    --topbar-height: 61px;
    --status-height: 31px;
  }

  .topbar {
    gap: 8px;
    padding: 0 9px;
  }

  .topbar-left,
  .topbar-actions {
    gap: 7px;
  }

  .view-title .eyebrow,
  .desktop-action {
    display: none;
  }

  .view-title strong {
    max-width: 145px;
    font-size: 12px;
  }

  .view-switch button {
    min-width: 53px;
    padding: 5px 7px;
  }

  .map-action-rail {
    top: 10px;
    left: 10px;
  }

  .ol-zoom {
    top: 10px;
    right: 10px;
  }

  .draw-hint {
    top: 10px;
    max-width: calc(100% - 116px);
  }

  .draw-hint kbd,
  .draw-hint kbd + * {
    display: none;
  }

  .legend-panel {
    right: 10px;
    bottom: 10px;
  }

  .pixel-card {
    right: 10px;
    bottom: 10px;
    left: 10px;
    width: auto;
  }

  .terrain-hud {
    right: 10px;
    bottom: 10px;
    left: 10px;
  }

  .terrain-hud-actions > span {
    display: none;
  }

  .result-drawer {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: min(72%, 610px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 18px 18px 0 0;
    transform: translateY(calc(100% + 12px));
  }

  .result-drawer.is-open {
    transform: translateY(0);
  }

  .drawer-handle {
    display: block;
    width: 38px;
    height: 4px;
    flex: 0 0 4px;
    margin: 8px auto 0;
    border-radius: 9px;
    background: #d5dbd1;
  }

  .result-header {
    padding-top: 11px;
  }

  .statusbar {
    gap: 8px;
    padding: 0 9px;
  }

  #resolutionStatus {
    display: none;
  }

  .status-message {
    max-width: 52%;
  }

  .ol-scale-bar {
    right: 10px;
    bottom: 10px;
  }

  .toast-region {
    top: 70px;
    right: 10px;
    width: calc(100vw - 20px);
  }
}

@media (max-height: 680px) and (min-width: 861px) {
  .plot-card {
    margin-top: 10px;
  }

  .control-section {
    padding: 15px 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;
  }
}
