:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1c2430;
  --muted: #5d6b7c;
  --line: #dde2e8;
  --brand: #ff5a5f;
  --charcoal: #220d38;
  --accent: #220d38;
  --accent-text: #ffffff;
  --site: #ff5a5f;
  --adjacent: #0b6bcb;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151a;
    --panel: #1a2027;
    --text: #e6ebf0;
    --muted: #94a3b4;
    --line: #2c3540;
    --accent: #ff5a5f;
    --accent-text: #220d38;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  display: flex;
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}
#panel {
  width: 360px;
  flex: none;
  overflow-y: auto;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 16px;
}
#map { flex: 1; height: 100%; }
h1 { font-size: 18px; margin: 0 0 4px; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 8px; }
.sub { margin: 0; color: var(--muted); }
section { border-top: 1px solid var(--line); padding: 14px 0; }
header { padding-bottom: 12px; }
.muted { color: var(--muted); }
footer { font-size: 12px; border-top: 1px solid var(--line); padding-top: 12px; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0; }
.row label { flex: 1; }
input[type=number] { width: 80px; }
input[type=number], select {
  padding: 5px 6px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--text); font: inherit;
}
select { max-width: 190px; }

button, .file span {
  display: inline-block; padding: 8px 14px; border-radius: 6px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-text); font: inherit; font-weight: 600; cursor: pointer;
}
button:disabled { opacity: .45; cursor: not-allowed; }
button.secondary, .file.small span { background: transparent; color: var(--accent); font-weight: 500; }
.file input { display: none; }
.file.small span { padding: 5px 10px; font-size: 13px; margin-top: 6px; }
.buttons { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
#runBtn { margin-top: 4px; width: 100%; }
#status { margin-top: 8px; min-height: 1.4em; }
#status.error { color: #d0342c; }

ul { list-style: none; padding: 0; margin: 8px 0 0; }
#featureList li, #rasterList li { padding: 3px 0; font-size: 13px; overflow-wrap: anywhere; }
#featureList label { display: flex; gap: 6px; align-items: baseline; }
.tag { font-size: 11px; padding: 1px 6px; border-radius: 10px; background: var(--line); color: var(--text); margin-left: 4px; white-space: nowrap; }
.tag.used { background: #1f9d55; color: #fff; }

.headline { background: var(--bg); border-radius: 8px; padding: 12px; margin-bottom: 10px; }
.big { font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; }
.unit { color: var(--muted); }
.band { margin-top: 6px; font-weight: 600; }
table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
td:first-child { width: 58%; }
td { padding: 4px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
td:last-child { text-align: right; font-variant-numeric: tabular-nums; padding-left: 8px; overflow-wrap: anywhere; }

#legend { font-size: 12px; margin-top: 6px; }
#legend .item { display: flex; align-items: center; gap: 6px; padding: 1px 0; }
#legend .sw { width: 18px; height: 12px; border-radius: 2px; flex: none; }
.leaflet-container { background: #ddd; }
.pixelated { image-rendering: pixelated; }

@media (max-width: 760px) {
  body { flex-direction: column; }
  #panel { width: 100%; max-height: 50vh; border-right: 0; border-bottom: 1px solid var(--line); }
  #map { height: 50vh; flex: none; }
}
.hint { display: block; font-size: 12px; color: var(--muted); }

.logo { height: 34px; width: auto; display: block; margin-bottom: 10px; }
h3 { font-size: 13px; margin: 14px 0 4px; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cards .headline { margin: 0; padding: 10px; border-top: 3px solid var(--brand); }
.cards .headline.adj { border-top-color: #0b6bcb; }
.cards .label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.cards .big { font-size: 24px; }
.cards .unit, .cards .band { font-size: 12px; }
input[type=text], textarea {
  width: 170px; padding: 5px 6px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--text); font: inherit;
}
#dlReport { width: 100%; margin-top: 6px; }
.map-badge {
  display: flex; align-items: center; gap: 8px; padding: 5px 10px;
  background: rgba(255,255,255,.92); border-radius: 6px; border-left: 3px solid var(--brand);
  box-shadow: 0 1px 4px rgba(0,0,0,.2); font: 600 12px system-ui, sans-serif; color: var(--charcoal);
}
.map-badge img { height: 20px; width: auto; }
p.hint { margin: 0 0 6px; }
.warn { margin: 6px 0; padding: 8px 10px; border-radius: 6px; font-size: 13px;
  background: color-mix(in srgb, var(--brand) 14%, transparent); border-left: 3px solid var(--brand); }
input.attention { outline: 2px solid var(--brand); outline-offset: 1px; }
label.src { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; font-size: 13px; }
label.src > input { margin-top: 3px; }
input.mini { width: 52px; padding: 2px 4px; font-size: 12px; }
table.three { table-layout: auto; }
table.three th { text-align: right; font-size: 11px; color: var(--muted); font-weight: 600; padding: 4px 0 4px 6px; }
table.three th:first-child { text-align: left; padding-left: 0; }
table.three td:first-child { width: auto; }
table.three td { text-align: right; padding-left: 6px; }
table.three td:first-child { text-align: left; padding-left: 0; }
ul.sites { margin: 4px 0 8px; }
ul.sites li { font-size: 12.5px; padding: 2px 0; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.lead { background: var(--bg); border-radius: 8px; padding: 10px 12px; margin: 10px 0; border-left: 3px solid var(--brand); }
.lead h3 { margin-top: 0; }
.lead input[type=text], .lead input[type=email] { width: 190px; padding: 5px 6px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--panel); color: var(--text); font: inherit; }
.lead #leadBtn { width: 100%; margin-top: 4px; }
#leadMsg.error { color: #d0342c; }
#leadDone { margin: 8px 0; font-size: 13px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.lead a { color: var(--brand); font-weight: 600; }
.logo-link { display: inline-block; }
.logo-link:focus-visible, .map-badge a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.map-badge a { display: flex; }
