:root {
  --green-950: #052e24;
  --green-900: #064e3b;
  --green-800: #0b5d46;
  --green-700: #0f7454;
  --lime: #8bc64a;
  --panel: #132b30;
  --panel-2: #17363c;
  --text: #edf7f1;
  --muted: #a8c0b8;
  --border: rgba(255,255,255,.12);
  --danger: #f87171;
  --warning: #fbbf24;
  --shadow: 0 16px 42px rgba(0,0,0,.24);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: Inter, "Segoe UI", Arial, sans-serif; background: #0b1c20; color: var(--text); overflow: hidden; }
button, input, select { font: inherit; }
.app { height: 100vh; display: grid; grid-template-rows: 72px 1fr; }
.topbar { display: flex; align-items: center; gap: 20px; padding: 0 20px; background: linear-gradient(90deg, #073b2f, #0b5360); border-bottom: 1px solid rgba(255,255,255,.12); z-index: 1100; }
.brand { display: flex; align-items: center; min-width: 300px; }
.brand img { width: 245px; max-height: 54px; object-fit: contain; object-position: left center; filter: drop-shadow(0 3px 5px rgba(0,0,0,.24)); }
.title-block { border-left: 1px solid rgba(255,255,255,.24); padding-left: 20px; }
.title-block strong { display: block; font-size: 18px; letter-spacing: .2px; }
.title-block span { color: #c8ded7; font-size: 12px; }
.local-badge { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid rgba(139,198,74,.48); background: rgba(139,198,74,.12); border-radius: 999px; font-size: 12px; color: #dbf5bf; }
.local-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(139,198,74,.15); }
.workspace { min-height: 0; display: grid; grid-template-columns: minmax(0,1fr) 420px; }
.map-wrap { position: relative; min-width: 0; background: #d8e2db; }
#map { width: 100%; height: 100%; }
.search-box { position: absolute; top: 14px; left: 58px; right: 190px; max-width: 600px; z-index: 1000; display: flex; background: rgba(255,255,255,.96); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; }
.search-box input { flex: 1; border: 0; padding: 12px 14px; outline: none; color: #1f2937; min-width: 0; }
.search-box button { border: 0; padding: 0 16px; background: var(--green-800); color: #fff; cursor: pointer; }
.map-tools { position: absolute; left: 14px; top: 78px; z-index: 1000; display: grid; gap: 8px; }
.map-tool { width: 38px; height: 38px; border: 1px solid rgba(0,0,0,.15); border-radius: 7px; background: rgba(255,255,255,.96); color: #17363c; box-shadow: 0 5px 14px rgba(0,0,0,.18); cursor: pointer; font-weight: 800; }
.map-tool.active { background: var(--lime); color: #09281e; }
.map-hint { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 1000; padding: 10px 14px; border-radius: 8px; background: rgba(5,46,36,.92); color: white; font-size: 13px; box-shadow: var(--shadow); display: none; }
.map-hint.visible { display: block; }
.sidebar { min-height: 0; overflow-y: auto; background: linear-gradient(180deg, var(--panel), #0e2428); border-left: 1px solid rgba(255,255,255,.12); }
.sidebar-head { position: sticky; top: 0; z-index: 4; padding: 18px 20px 14px; background: rgba(19,43,48,.97); border-bottom: 1px solid var(--border); backdrop-filter: blur(8px); }
.sidebar-head h1 { margin: 0; font-size: 22px; }
.sidebar-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.panel { padding: 18px 20px; border-bottom: 1px solid var(--border); }
.panel-title { display: flex; align-items: center; gap: 9px; margin: 0 0 14px; font-size: 13px; text-transform: uppercase; letter-spacing: .8px; color: #d8eee7; }
.panel-title .step { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--lime); color: #17351f; font-weight: 800; }
.field { margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; margin-bottom: 6px; color: #c8ddd6; font-size: 12px; font-weight: 650; }
.field input, .field select { width: 100%; border: 1px solid var(--border); border-radius: 7px; padding: 10px 11px; background: rgba(255,255,255,.07); color: white; outline: none; }
.field input:focus, .field select:focus { border-color: var(--lime); box-shadow: 0 0 0 3px rgba(139,198,74,.12); }
.field select option { color: #111827; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.file-row { display: flex; gap: 8px; }
.file-row input[type=file], #fileInput { display: none !important; }
.btn { border: 0; border-radius: 7px; padding: 11px 13px; cursor: pointer; font-weight: 750; transition: transform .12s ease, filter .12s ease; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn-primary { width: 100%; background: linear-gradient(135deg, var(--lime), #70b33d); color: #13301d; padding: 14px; font-size: 15px; }
.btn-reverse { width: 100%; margin-top: 9px; background: rgba(14,165,167,.16); color: #b9ffff; border: 1px solid rgba(14,165,167,.42); }
.btn-reverse:not(:disabled):hover { background: rgba(14,165,167,.26); }
.btn:disabled { cursor: not-allowed; opacity: .45; filter: none; transform: none; }
.route-direction-note { margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.btn-secondary { background: rgba(255,255,255,.1); color: white; border: 1px solid var(--border); }
.btn-danger { background: rgba(248,113,113,.15); color: #fecaca; border: 1px solid rgba(248,113,113,.3); }
.draw-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.status { margin-top: 10px; padding: 10px 12px; border-radius: 7px; font-size: 12px; color: var(--muted); background: rgba(0,0,0,.15); }
.status.ok { color: #d9f99d; border: 1px solid rgba(139,198,74,.25); }
.status.error { color: #fecaca; border: 1px solid rgba(248,113,113,.28); }
.results { display: none; }
.results.visible { display: block; }
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.metric { padding: 10px; border: 1px solid var(--border); background: rgba(255,255,255,.05); border-radius: 7px; }
.metric span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .5px; }
.metric strong { display: block; margin-top: 4px; font-size: 15px; }
.downloads { display: grid; gap: 8px; margin-top: 12px; }
.downloads .btn:first-child { background: #0ea5a7; color: white; }
.downloads .btn:last-child { background: rgba(255,255,255,.11); color: white; border: 1px solid var(--border); }
.notice { color: #b8cec7; font-size: 11px; line-height: 1.45; }
.leaflet-control-layers { border: 0 !important; border-radius: 8px !important; box-shadow: var(--shadow) !important; background: rgba(255,255,255,.97) !important; color: #17363c; }
.leaflet-control-layers-expanded { padding: 10px 12px !important; min-width: 132px; }
.leaflet-control-layers-base label { margin: 4px 0; font-size: 13px; font-weight: 650; }
.leaflet-control-layers-separator { border-top-color: rgba(23,54,60,.18) !important; }
.leaflet-control-attribution { font-size: 10px; }
.waypoint-dot { width: 8px; height: 8px; border: 2px solid white; background: #f59e0b; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.start-dot { width: 16px; height: 16px; border: 3px solid white; background: #22c55e; border-radius: 50%; box-shadow: 0 2px 7px rgba(0,0,0,.45); }
.end-dot { width: 16px; height: 16px; border: 3px solid white; background: #ef4444; border-radius: 50%; box-shadow: 0 2px 7px rgba(0,0,0,.45); }
@media (max-width: 980px) {
  body { overflow: auto; }
  .app { height: auto; min-height: 100vh; grid-template-rows: auto auto; }
  .topbar { min-height: 68px; flex-wrap: wrap; padding: 9px 14px; gap: 10px; }
  .brand { min-width: 0; }
  .brand img { width: 190px; }
  .title-block { display: none; }
  .local-badge { font-size: 10px; }
  .workspace { grid-template-columns: 1fr; grid-template-rows: 58vh auto; }
  .sidebar { overflow: visible; border-left: 0; }
  .search-box { left: 58px; right: 14px; top: 76px; }
  .leaflet-top.leaflet-right { top: 4px; right: 4px; }
}
