:root {
  --bg: #0b0b0e;
  --panel: #121217;
  --card: #18181f;
  --line: #2a2a33;
  --text: #ecebe7;
  --muted: #9a98a3;
  --accent: #ff6a1f;
  --accent-2: #ffb347;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); }

.app { display: grid; grid-template-columns: 380px 1fr; height: 100vh; }

/* ---------------------------------------------------------------- panel */
.panel {
  background: var(--panel); border-right: 1px solid var(--line);
  overflow-y: auto; padding: 20px 16px 16px; display: flex; flex-direction: column; gap: 14px;
}
.brand h1 {
  margin: 0; font-size: 22px; letter-spacing: .14em; text-transform: uppercase;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text;
  background-clip: text; color: transparent;
}
.brand p { margin: 6px 0 0; color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.card h2 { margin: 0 0 10px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.step {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #140800; font-size: 12px; font-weight: 700;
}
.hint, .note, .privacy { color: var(--muted); font-size: 12.5px; margin: 6px 0; }
.note { color: #ffcf9e; }
.stats { margin: 0 0 10px; font-weight: 600; letter-spacing: .02em; }

.drop {
  border: 1.5px dashed #3a3a46; border-radius: 10px; padding: 16px; text-align: center;
  transition: border-color .15s, background .15s;
}
.drop p { margin: 0 0 4px; }
body.dragging .drop { border-color: var(--accent); background: rgba(255, 106, 31, .07); }

.buttons { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 12px; }
.btn {
  appearance: none; border: 1px solid #3a3a46; background: #22222b; color: var(--text);
  padding: 8px 14px; border-radius: 8px; font: 600 13px var(--font); cursor: pointer; text-decoration: none;
  display: inline-block; text-align: center;
}
.btn:hover { border-color: #55556a; background: #2a2a35; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #140800; }
.btn.primary:hover { background: #ff7d3a; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.block { display: block; width: 100%; margin-top: 12px; padding: 11px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: progress; }
.btn:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.grid label.wide { grid-column: 1 / -1; }
.grid label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 13px; }
select, input[type=text], input[type=date] {
  background: #0f0f14; color: var(--text); border: 1px solid #33333f; border-radius: 7px;
  padding: 7px 8px; font: 13px var(--font); width: 100%; min-width: 0;
}
input[type=range] { accent-color: var(--accent); width: 100%; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }

.status { margin-top: 12px; }
.status p { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.bar { height: 6px; border-radius: 3px; background: #262630; overflow: hidden; }
.bar > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .2s; }
.bar > div.indeterminate { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.result { margin-top: 14px; }
.result img { width: 100%; border-radius: 6px; border: 1px solid var(--line); display: block; background: #000; }

.foot { color: #6d6b76; font-size: 11px; margin-top: auto; padding-top: 6px; }

/* ---------------------------------------------------------------- map */
.stage { position: relative; min-height: 0; }
#map { position: absolute; inset: 0; background: #050508; }
.leaflet-container { font: 12px var(--font); }
.leaflet-control-attribution { background: rgba(10, 10, 14, .7) !important; color: #888 !important; }
.leaflet-control-attribution a { color: #aaa !important; }
.leaflet-bar a { background: #1c1c24; color: var(--text); border-color: #2c2c36; }
.leaflet-bar a:hover { background: #262630; }

.empty {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  pointer-events: none; color: var(--muted); z-index: 500;
  background: radial-gradient(ellipse at center, rgba(5, 5, 8, .35), rgba(5, 5, 8, .85));
}
.empty .big { font-size: 22px; color: var(--text); margin: 0 0 6px; letter-spacing: .04em; }
.empty[hidden] { display: none; }

.dropveil {
  position: fixed; inset: 0; z-index: 2000; display: none; place-items: center;
  background: rgba(255, 106, 31, .12); border: 3px dashed var(--accent); pointer-events: none;
}
.dropveil p { font-size: 24px; font-weight: 700; background: var(--panel); padding: 14px 22px; border-radius: 12px; }
body.dragging .dropveil { display: grid; }

/* ---------------------------------------------------------------- small screens */
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 70vh; height: auto; }
  .panel { border-right: 0; border-bottom: 1px solid var(--line); overflow: visible; }
  .stage { height: 70vh; }
}
.note a { color: var(--accent-2); }
