:root {
  --bg: #12100e;
  --bg-2: #1c1814;
  --panel: #241f1a;
  --line: #3c342c;
  --text: #f4efe6;
  --muted: #b2a596;
  --brass: #e2a85a;
  --brass-deep: #a86b28;
  --ink: #1a120c;
  --danger: #e07a68;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(226, 168, 90, 0.16), transparent 50%),
    var(--bg);
  color: var(--text);
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  padding: 22px 28px 8px;
}
.brand { display: flex; gap: 14px; align-items: center; }
.mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 3px solid var(--brass);
  display: grid;
  place-items: center;
  font-family: Palatino, "Iowan Old Style", Georgia, serif;
  letter-spacing: 0.04em;
  color: var(--brass);
  box-shadow: inset 0 0 0 4px #2a2118;
}
h1 {
  margin: 0;
  font-family: Palatino, "Iowan Old Style", Georgia, serif;
  font-weight: 600;
  font-size: 1.7rem;
  letter-spacing: -0.02em;
}
.brand p, .printer, .hint, .status, .stage-caption {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.printer { letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.75rem; max-width: 28rem; text-align: right; }

main {
  display: grid;
  grid-template-columns: minmax(300px, 400px) 1fr;
  gap: 18px;
  padding: 12px 28px 28px;
}
@media (max-width: 900px) {
  main { grid-template-columns: 1fr; }
  .top { flex-direction: column; align-items: flex-start; }
  .printer { text-align: left; }
}

.panel, .stage-wrap {
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent 80px), var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.panel { padding: 8px 16px 16px; }
fieldset {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
  padding: 12px 0;
}
legend {
  padding-right: 8px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brass);
}

.address input, .lookup, .download {
  width: 100%;
  border-radius: 12px;
  font-size: 1rem;
}
.address input {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 10px 12px;
}
.lookup, .download {
  margin-top: 8px;
  border: 0;
  font-weight: 700;
  padding: 12px 16px;
  cursor: pointer;
}
.lookup {
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--line);
}
.download {
  background: linear-gradient(180deg, #f0c27a, var(--brass) 40%, var(--brass-deep));
  color: var(--ink);
}
.lookup:disabled, .download:disabled { opacity: 0.6; cursor: progress; }

.slider { display: block; margin-top: 4px; }
.slider span { display: flex; justify-content: space-between; font-size: 0.92rem; }
.slider output { color: var(--brass); font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; accent-color: var(--brass); }

.check {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  font-weight: 650;
}
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--brass); }

.status { min-height: 2.6em; }
.status.err { color: var(--danger); }

.stage-wrap {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  padding: 12px;
}
#map {
  flex: 1;
  min-height: 480px;
  border-radius: 12px;
  background: #1a2420;
}
.stage-caption { text-align: center; padding-top: 8px; }
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.leaflet-container { font-family: inherit; background: #1a2420; }
