:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #0b0d10;
  --surface: #15191e;
  --line: #2b333d;
  --text: #f5f7f9;
  --muted: #929ca8;
  --orange: #ff6a2a;
  --green: #64d6b2;
  background: var(--bg);
  color: var(--text);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body { margin: 0; background: radial-gradient(circle at 10% 0, rgba(100, 214, 178, .08), transparent 30%), var(--bg); }
button, input { font: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }
.app-shell { width: min(100%, 1500px); min-height: 100dvh; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) clamp(14px, 3vw, 38px) max(18px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
.brand-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand img { width: 46px; height: 46px; object-fit: contain; }
.brand span, .brand small, .brand strong { display: block; }
.brand small { margin-bottom: 2px; color: var(--orange); font-size: .62rem; font-weight: 850; letter-spacing: .16em; }
.brand strong { font-size: 1.05rem; letter-spacing: -.02em; }
.privacy-badge { padding: 8px 11px; border: 1px solid #29433d; border-radius: 999px; background: rgba(100,214,178,.06); color: #8be4c7; font-size: .69rem; font-weight: 750; white-space: nowrap; }
.workspace { display: grid; grid-template-columns: minmax(310px, 390px) minmax(0, 1fr); gap: 18px; min-height: 0; flex: 1; }
.control-panel, .map-panel { border: 1px solid var(--line); border-radius: 25px; background: rgba(20,24,29,.94); box-shadow: 0 24px 70px rgba(0,0,0,.26); }
.control-panel { padding: clamp(20px, 3vw, 30px); overflow: auto; }
.intro { padding-bottom: 24px; }
.eyebrow { margin: 0 0 13px !important; color: var(--green) !important; font-size: .65rem !important; font-weight: 850; letter-spacing: .18em; }
.intro h1 { margin: 0; font-size: clamp(2rem, 3.1vw, 3.15rem); line-height: .97; letter-spacing: -.055em; }
.intro > p:last-child { margin: 16px 0 0; color: var(--muted); font-size: .88rem; line-height: 1.55; }
.panel-section { padding: 22px 0; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-heading > div { display: flex; align-items: center; gap: 9px; }
.section-heading span { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 8px; background: #222a31; color: #8a95a0; font-size: .62rem; font-weight: 850; }
.section-heading h2 { margin: 0; font-size: 1rem; letter-spacing: -.02em; }
.text-button { padding: 5px; border: 0; background: transparent; color: #9aa4af; font-size: .73rem; cursor: pointer; }
.text-button:disabled { opacity: .35; cursor: default; }
.file-drop { min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 18px; border: 1px dashed #46515d; border-radius: 18px; background: #11151a; text-align: center; cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.file-drop:hover, .file-drop.dragging { border-color: var(--green); background: rgba(100,214,178,.05); }
.file-drop:active { transform: scale(.99); }
.file-drop input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.file-drop:focus-within { outline: 3px solid rgba(100,214,178,.32); outline-offset: 3px; }
.upload-icon { width: 34px; height: 34px; display: grid; place-items: center; margin-bottom: 8px; border-radius: 10px; background: rgba(100,214,178,.12); color: var(--green); }
.upload-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.file-drop strong { font-size: .88rem; }
.file-drop small { margin-top: 4px; color: #78838f; font-size: .68rem; }
.message { min-height: 1.2em; margin: 10px 2px 0; color: #77828e; font-size: .7rem; line-height: 1.4; }
.message.error { color: #ff988e; }
.message.success { color: #84dabf; }
.track-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.track-stats span { padding: 10px 12px; border: 1px solid #29333b; border-radius: 12px; background: #11161a; }
.track-stats strong, .track-stats small { display: block; }
.track-stats strong { font-size: 1rem; font-variant-numeric: tabular-nums; }
.track-stats small { margin-top: 3px; color: #78838f; font-size: .63rem; text-transform: uppercase; letter-spacing: .06em; }
.trim-controls { margin-top: 12px; padding: 14px; border: 1px solid #2f3c3a; border-radius: 15px; background: rgba(100,214,178,.045); }
.trim-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.trim-heading strong, .trim-heading small { display: block; }
.trim-heading strong { font-size: .8rem; }
.trim-heading small { margin-top: 3px; color: #75817d; font-size: .64rem; }
.range-label { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 11px 0 3px; color: #aeb8b5; font-size: .68rem; font-weight: 750; }
.range-label output { color: #80d9bd; font-variant-numeric: tabular-nums; }
.range-input { width: 100%; min-height: 28px; height: 28px; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; accent-color: var(--green); cursor: ew-resize; }
.range-input:focus { border: 0; box-shadow: none; outline: 2px solid rgba(100,214,178,.45); outline-offset: 2px; }
.range-input::-webkit-slider-runnable-track { height: 5px; border-radius: 999px; background: #34443f; }
.range-input::-webkit-slider-thumb { width: 18px; height: 18px; margin-top: -6px; border: 3px solid #0e1513; border-radius: 50%; background: var(--green); -webkit-appearance: none; }
.range-input::-moz-range-track { height: 5px; border-radius: 999px; background: #34443f; }
.range-input::-moz-range-thumb { width: 13px; height: 13px; border: 3px solid #0e1513; border-radius: 50%; background: var(--green); }
.trim-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 9px; }
.trim-summary span { padding: 8px 9px; border-radius: 10px; background: #101714; }
.trim-summary strong, .trim-summary small { display: block; }
.trim-summary strong { font-size: .82rem; font-variant-numeric: tabular-nums; }
.trim-summary small { margin-top: 2px; color: #718079; font-size: .57rem; text-transform: uppercase; letter-spacing: .05em; }
.save-track-button { width: 100%; min-height: 42px; margin-top: 10px; border: 0; border-radius: 11px; background: var(--green); color: #0d1714; font-size: .73rem; font-weight: 850; cursor: pointer; }
.save-track-button:disabled { opacity: .38; cursor: default; }
form label { display: block; margin: 0 0 6px; color: #b4bcc5; font-size: .71rem; font-weight: 700; }
form label:not(:first-child) { margin-top: 11px; }
form label small { color: #6f7a86; font-weight: 500; }
input { width: 100%; min-height: 45px; padding: 0 13px; border: 1px solid #333d47; border-radius: 12px; outline: none; background: #0e1216; color: var(--text); }
input::placeholder { color: #59636e; }
input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(100,214,178,.1); }
.form-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.form-row button { min-height: 45px; padding: 0 15px; border: 0; border-radius: 12px; background: var(--green); color: #0d1714; font-weight: 850; cursor: pointer; }
.point-list { display: grid; gap: 7px; margin: 12px 0 0; padding: 0; list-style: none; }
.point-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid #29323a; border-radius: 11px; background: #11161a; }
.point-list strong, .point-list small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.point-list strong { font-size: .72rem; }
.point-list small { margin-top: 2px; color: #78838f; font-size: .64rem; font-variant-numeric: tabular-nums; }
.point-list button { width: 28px; height: 28px; border: 0; border-radius: 8px; background: #252b31; color: #aab2bb; cursor: pointer; }
.point-list button:disabled { opacity: .28; cursor: default; }
.point-actions { display: flex; align-items: center; gap: 4px; }
.route-track-item { border-color: #47564f !important; background: rgba(100,214,178,.07) !important; }
.route-track-item strong { color: var(--green); }
.route-track-item::before { content: "TRACK"; justify-self: start; padding: 4px 6px; border-radius: 6px; background: rgba(100,214,178,.12); color: #8ce0c5; font-size: .5rem; font-weight: 900; letter-spacing: .1em; }
.route-track-item { grid-template-columns: auto minmax(0, 1fr) !important; }
.panel-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.secondary-button { min-height: 42px; padding: 8px 10px; border: 1px solid #3a444e; border-radius: 12px; background: #1a2026; color: #dce1e6; font-weight: 750; font-size: .72rem; cursor: pointer; }
.secondary-button.danger { color: #f2a59d; }
.secondary-button:disabled { opacity: .35; cursor: default; }
.map-panel { min-height: 650px; display: flex; flex-direction: column; overflow: hidden; }
.map-toolbar { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); background: #171c21; }
.map-toolbar > div { display: flex; align-items: center; gap: 8px; font-size: .78rem; }
.map-toolbar > span { color: #7f8994; font-size: .69rem; text-align: right; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(100,214,178,.08); }
#map { min-height: 480px; flex: 1; background: #20262c; }
.leaflet-container { font-family: inherit; }
.leaflet-control-attribution { color: #363d43; }
.leaflet-control-attribution a { color: #275a8a; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: #171c21; color: #f5f7f9; }
.leaflet-popup-content { margin: 12px 14px; }
.popup-name { margin: 0 0 4px; font-weight: 800; }
.popup-coordinates { margin: 0; color: #abb4be; font-size: .76rem; font-variant-numeric: tabular-nums; }
footer { display: flex; justify-content: space-between; gap: 15px; padding: 18px 4px 0; color: #65707c; font-size: .66rem; }
footer a { color: #7b8793; }
@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; }
  .control-panel { overflow: visible; }
  .map-panel { min-height: min(70vh, 650px); order: -1; }
  .intro { display: none; }
}
@media (max-width: 520px) {
  .app-shell { padding-inline: 10px; }
  .brand strong { font-size: .9rem; }
  .privacy-badge { max-width: 130px; white-space: normal; text-align: center; }
  .map-panel, .control-panel { border-radius: 19px; }
  .map-panel { min-height: 57vh; }
  .map-toolbar > span { max-width: 150px; }
  .form-row { grid-template-columns: 1fr; }
  .form-row button { width: 100%; }
  footer { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
