:root {
  --bg: #11151a;
  --panel: #171c22;
  --panel-2: #1e252d;
  --line: #323b45;
  --text: #eef2f5;
  --muted: #94a0ac;
  --accent: #ffb020;
  --accent-2: #d98d00;
  --danger: #ff7b72;
}
* { box-sizing: border-box; }
html, body, #app { margin: 0; width: 100%; height: 100%; }
body { font-family: Inter, "Segoe UI", Arial, sans-serif; background: var(--bg); color: var(--text); overflow: hidden; }
button, input, select { font: inherit; }
#app { display: grid; grid-template-columns: 370px minmax(0, 1fr); }
.sidebar { background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; padding: 18px; z-index: 1000; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.brand-mark { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: #151515; font-weight: 800; }
h1 { margin: 0; font-size: 21px; line-height: 1.1; }
.muted, .hint { color: var(--muted); font-size: 12px; }
.panel-section { border-top: 1px solid var(--line); padding: 14px 0; }
label { color: #c9d1d9; font-size: 13px; }
input, select, button { min-height: 38px; border-radius: 8px; border: 1px solid var(--line); }
input, select { width: 100%; background: var(--panel-2); color: var(--text); padding: 7px 10px; outline: none; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(255,176,32,.14); }
button { cursor: pointer; padding: 7px 12px; font-weight: 650; }
button:disabled { opacity: .55; cursor: wait; }
.search-section > label { display: block; margin-bottom: 7px; }
.search-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.search-row button { background: #28313a; color: var(--text); }
.hint { margin-top: 7px; line-height: 1.35; }
.hint.error { color: var(--danger); }
.controls-grid { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 10px 12px; align-items: center; }
.scale-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px; align-items: center; }
.scale-row span { color: var(--muted); }
.hidden { display: none !important; }
.advanced { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 11px 0; }
.advanced summary { cursor: pointer; color: #cbd3da; font-size: 13px; user-select: none; }
.advanced-body { padding-top: 12px; }
.margins-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.margins-grid label, .stacked { display: grid; gap: 5px; }
.stacked { margin-top: 10px; }
.summary { margin-top: 14px; background: #12171c; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.summary > div:not(.warning) { min-width: 0; display: grid; grid-template-columns: 98px minmax(0, 1fr); gap: 8px; padding: 6px 0; border-bottom: 1px solid #252c33; }
.summary > div:last-of-type { border-bottom: 0; }
.summary span { color: var(--muted); font-size: 12px; }
.summary strong { color: var(--text); font-size: 12.5px; text-align: right; overflow-wrap: anywhere; }
.warning { margin-top: 8px; padding: 8px; border-radius: 7px; background: rgba(255,123,114,.11); color: #ffb3ad; font-size: 12px; line-height: 1.35; }
.actions { display: grid; gap: 8px; margin-top: 14px; }
.secondary { background: #28313a; color: var(--text); }
.primary { background: var(--accent); border-color: var(--accent-2); color: #18130a; min-height: 44px; }
.status { min-height: 22px; padding: 8px 2px 0; color: var(--muted); font-size: 12px; line-height: 1.45; white-space: pre-line; }
.status.error { color: var(--danger); }
.map-wrap { min-width: 0; position: relative; background: #222; }
#map { width: 100%; height: 100%; }
.map-tip { position: absolute; z-index: 600; left: 50%; bottom: 18px; transform: translateX(-50%); background: rgba(17,21,26,.88); color: #e6ebef; padding: 7px 11px; border-radius: 7px; border: 1px solid rgba(255,255,255,.14); font-size: 12px; pointer-events: none; white-space: nowrap; }
.frame-center { width: 16px; height: 16px; position: relative; }
.frame-center::before, .frame-center::after { content: ""; position: absolute; background: #ff2d2d; box-shadow: 0 0 0 1px rgba(255,255,255,.55); }
.frame-center::before { width: 16px; height: 2px; left: 0; top: 7px; }
.frame-center::after { width: 2px; height: 16px; left: 7px; top: 0; }
.leaflet-container { background: #252a30; font-family: inherit; }
.leaflet-control-attribution { font-size: 10px !important; }
.leaflet-control-zoom a { background: #fff; color: #111; }
@media (max-width: 760px) {
  body { overflow: auto; }
  #app { height: auto; min-height: 100%; grid-template-columns: 1fr; grid-template-rows: auto 65vh; }
  .sidebar { overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); }
  .map-wrap { min-height: 520px; }
}
