:root {
  --panel-bg: #f7f8fa;
  --panel-border: #d9dee7;
  --text: #17202a;
  --muted: #5b6472;
  --accent: #126a64;
  --accent-hover: #0d5752;
  --focus: #2c7be5;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
}

body {
  background: #ffffff;
}

.app-shell {
  display: grid;
  grid-template-columns: 75% 25%;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.map-pane,
#map {
  width: 100%;
  height: 100%;
}

#geoTiffCanvas {
  display: none;
}

.control-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 260px;
  padding: 24px;
  overflow-y: auto;
  background: var(--panel-bg);
  border-left: 1px solid var(--panel-border);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.2;
}

h2 {
  font-size: 16px;
}

a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.primary-button {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  background: var(--accent);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.secondary-button {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 9px 14px;
  background: #ffffff;
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.primary-button:hover:not(:disabled) {
  background: var(--accent-hover);
}

.secondary-button:hover {
  background: #eaf4f2;
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.control-row,
.slider-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-size: 15px;
}

.control-row {
  justify-content: flex-start;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

output {
  min-width: 42px;
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.legend {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.legend-swatch {
  width: 22px;
  height: 16px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.legend-swatch.green {
  background: rgb(0, 180, 0);
}

.legend-swatch.yellow {
  background: rgb(255, 210, 0);
}

.legend-swatch.red {
  background: rgb(220, 30, 30);
}

.status-text {
  margin-top: auto;
  padding-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.step-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(12, 18, 24, 0.56);
}

.step-modal {
  width: min(420px, 100%);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 22px;
  background: #ffffff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

.step-modal h2 {
  margin-bottom: 10px;
  font-size: 20px;
}

.step-modal p {
  color: var(--muted);
  line-height: 1.45;
}

.step-modal button {
  width: 100%;
  min-height: 40px;
  margin-top: 18px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.step-modal button:hover {
  background: var(--accent-hover);
}

.placeholder-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: #eef2f4;
}

.placeholder-content {
  width: min(440px, 100%);
  padding: 28px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: #ffffff;
}

.placeholder-content p {
  margin: 12px 0 18px;
  color: var(--muted);
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 68vh 32vh;
  }

  .control-panel {
    min-width: 0;
    border-left: 0;
    border-top: 1px solid var(--panel-border);
    padding: 16px;
  }
}
