/* Flightline — dark UI */

:root {
  --bg: #0a0d12;
  --panel: #10151c;
  --panel-2: #151b24;
  --panel-3: #1b2330;
  --line: #222c3a;
  --line-2: #2c394b;
  --text: #e7edf5;
  --text-2: #b4c0cf;
  --muted: #7d8a9c;
  --accent: #38d6ff;
  --accent-ink: #04141a;
  --ok: #4ade80;
  --warn: #fbbf24;
  --error: #f87171;
  --radius: 10px;
  --radius-sm: 7px;
  --sidebar-w: 352px;
  --topbar-h: 56px;
  --font: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

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

/* ---------- Layout ---------- */

.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.workspace { flex: 1; display: flex; min-height: 0; position: relative; }
.map-wrap { flex: 1; position: relative; min-width: 0; }
#map { position: absolute; inset: 0; background: #0b0f14; }

/* ---------- Top bar ---------- */

.topbar {
  height: var(--topbar-h);
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 1300;
}
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand-mark { color: var(--accent); flex: none; }
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand-sub {
  color: var(--muted); font-size: 12.5px; padding-left: 10px; margin-left: 2px;
  border-left: 1px solid var(--line-2); white-space: nowrap;
}
.topbar-spacer { flex: 1; }
.export-group { display: flex; align-items: center; gap: 8px; }
.topbar-sep { width: 1px; height: 22px; background: var(--line-2); margin: 0 4px; }
.dz-sub b { color: var(--text-2); font-weight: 600; }
.export-label { color: var(--muted); font-size: 12px; margin-right: 2px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 13px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600; font-size: 13px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #6ae1ff; }
.btn-outline { background: var(--panel-2); border-color: var(--line-2); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: transparent; border: 1px solid transparent;
  color: var(--text-2); cursor: pointer; flex: none;
}
.icon-btn:hover { background: var(--panel-3); color: var(--text); }
.icon-btn-sm { width: 28px; height: 28px; }

.chip {
  height: 28px; padding: 0 11px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  color: var(--text-2);
  font-size: 12.5px; font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}
.chip:hover { color: var(--text); border-color: #3b4b61; background: var(--panel-3); }
.chip-danger:hover { color: var(--error); border-color: rgba(248, 113, 113, .5); }
.chip-danger.confirm { background: var(--error); color: #2a0707; border-color: var(--error); font-weight: 600; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Sidebar ---------- */

.sidebar {
  width: var(--sidebar-w);
  flex: none;
  display: flex; flex-direction: column;
  background: var(--panel);
  border-right: 1px solid var(--line);
  transition: margin-left .26s ease;
  z-index: 1100;
  min-height: 0;
}
.app.sidebar-collapsed .sidebar { margin-left: calc(-1 * var(--sidebar-w)); }

.sidebar-scroll {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 14px;
  display: flex; flex-direction: column; gap: 14px;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.sidebar-scroll::-webkit-scrollbar { width: 8px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; }

.sidebar-foot {
  flex: none;
  display: flex; align-items: center; gap: 7px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 11.5px;
}

.backdrop { display: none; }

/* Dropzone */
.dropzone {
  position: relative;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 5px;
  padding: 20px 16px 18px;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(56, 214, 255, .04), transparent);
  color: var(--accent);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, body.dragging .dropzone { border-color: var(--accent); background: rgba(56, 214, 255, .07); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dz-title { color: var(--text); font-weight: 600; font-size: 14.5px; margin-top: 3px; }
.dz-sub { color: var(--muted); font-size: 12px; }

/* Panels */
.panel { display: flex; flex-direction: column; gap: 10px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; }
.panel h2 {
  margin: 0;
  font-size: 11.5px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
  display: flex; align-items: center; gap: 7px;
}
.count {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0;
  background: var(--panel-3); color: var(--text-2);
  padding: 1px 7px; border-radius: 999px;
}

/* Stats */
.stats {
  margin: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.stats > div { background: var(--panel-2); padding: 9px 11px; }
.stats dt { color: var(--muted); font-size: 11.5px; }
.stats dd { margin: 2px 0 0; font-family: var(--mono); font-size: 15px; font-weight: 500; color: var(--text); }
.stats-note { margin: 0; color: var(--muted); font-size: 11.5px; }

/* File list */
.list-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.list-actions.is-disabled .chip { opacity: .45; pointer-events: none; }

.file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

.file-item {
  --c: var(--accent);
  position: relative;
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start;
  padding: 10px 8px 10px 10px;
  border-radius: var(--radius);
  background: var(--panel-2);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color .15s, background .15s, opacity .15s;
}
.file-item::before {
  content: ''; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--c); opacity: 0; transition: opacity .15s;
}
.file-item:hover { border-color: var(--line-2); background: var(--panel-3); }
.file-item.selected {
  border-color: color-mix(in srgb, var(--c) 60%, transparent);
  background: color-mix(in srgb, var(--c) 9%, var(--panel-2));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent) inset;
}
.file-item.selected::before { opacity: 1; }
.file-item.is-hidden .fi-main { opacity: .45; }

.fi-check { display: grid; place-items: center; padding-top: 1px; cursor: pointer; }
.fi-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fi-check .cb {
  width: 18px; height: 18px; border-radius: 5px;
  border: 1.5px solid var(--line-2); background: var(--panel);
  display: grid; place-items: center; transition: all .12s;
}
.fi-check input:checked + .cb { background: var(--c); border-color: var(--c); }
.fi-check input:checked + .cb::after {
  content: ''; width: 9px; height: 5px; margin-top: -2px;
  border-left: 2px solid #0a0d12; border-bottom: 2px solid #0a0d12; transform: rotate(-45deg);
}
.fi-check input:disabled + .cb { opacity: .35; cursor: not-allowed; }
.fi-check input:focus-visible + .cb { outline: 2px solid var(--accent); outline-offset: 2px; }

.fi-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.fi-name { display: flex; align-items: center; gap: 7px; min-width: 0; font-weight: 600; font-size: 13px; }
.fi-name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-weight: 500; font-size: 12.5px; }
.swatch {
  flex: none; width: 10px; height: 10px; border-radius: 3px;
  background: var(--c); box-shadow: 0 0 0 2px rgba(0, 0, 0, .35);
}
.fi-meta { color: var(--text-2); font-size: 12px; font-family: var(--mono); }
.fi-meta .dot { color: var(--muted); margin: 0 6px; }
.fi-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.fi-date { color: var(--muted); font-size: 11px; font-family: var(--mono); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 20px; padding: 0 8px;
  border-radius: 999px; border: 1px solid transparent;
  font-size: 11px; font-weight: 600; line-height: 1;
  background: transparent;
}
button.badge { cursor: pointer; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { color: var(--ok); background: rgba(74, 222, 128, .09); border-color: rgba(74, 222, 128, .22); }
.badge-warn { color: var(--warn); background: rgba(251, 191, 36, .09); border-color: rgba(251, 191, 36, .25); }
.badge-error { color: var(--error); background: rgba(248, 113, 113, .09); border-color: rgba(248, 113, 113, .28); }

.fi-warnings {
  display: none;
  margin: 6px 0 0; padding: 8px 10px 8px 24px;
  border-radius: var(--radius-sm);
  background: var(--panel); border: 1px solid var(--line);
  font-size: 12px; color: var(--text-2);
}
.fi-warnings li + li { margin-top: 4px; }
.fi-warnings .w-error { color: #fca5a5; }
.fi-warnings .w-warn { color: #fcd57a; }
.file-item.show-warn .fi-warnings { display: block; }

.fi-remove { color: var(--muted); opacity: .7; }
.file-item:hover .fi-remove { opacity: 1; }
.fi-remove:hover { color: var(--error); background: rgba(248, 113, 113, .1); }

.list-empty {
  padding: 16px 14px;
  border-radius: var(--radius);
  border: 1px dashed var(--line);
  color: var(--muted); font-size: 12.5px; line-height: 1.55;
}
.list-empty b { color: var(--text-2); }

/* ---------- Map overlays ---------- */

.map-notice {
  position: absolute; top: 12px; left: 12px; z-index: 600;
  display: flex; align-items: center; gap: 8px;
  max-width: calc(100% - 210px);
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(10, 13, 18, .82);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: var(--text-2); font-size: 12.5px;
  box-shadow: var(--shadow);
}
.map-notice b { color: var(--text); font-weight: 600; }
.notice-dot {
  flex: none; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 3px rgba(56, 214, 255, .22);
}

.basemap-switch {
  position: absolute; top: 12px; right: 12px; z-index: 600;
  display: flex; padding: 3px; gap: 2px;
  border-radius: 999px;
  background: rgba(10, 13, 18, .85);
  border: 1px solid var(--line-2);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}
.basemap-switch button {
  height: 28px; padding: 0 13px; border: 0; border-radius: 999px;
  background: transparent; color: var(--text-2);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.basemap-switch button.active { background: var(--text); color: var(--bg); }
.basemap-switch button:not(.active):hover { color: var(--text); }

.map-empty {
  position: absolute; inset: 0; z-index: 550;
  display: grid; place-items: center;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(10, 13, 18, .55), rgba(10, 13, 18, .15) 70%);
}
.map-empty-card {
  pointer-events: auto;
  max-width: 340px; margin: 16px; text-align: center;
  padding: 26px 26px 22px;
  border-radius: 14px;
  background: rgba(16, 21, 28, .92);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  color: var(--accent);
}
.map-empty-card h3 { margin: 10px 0 6px; font-size: 16px; color: var(--text); }
.map-empty-card p { margin: 0 0 16px; color: var(--text-2); font-size: 13px; }

.drop-overlay {
  position: absolute; inset: 10px; z-index: 1500;
  display: none; place-items: center;
  border: 2px dashed var(--accent); border-radius: 14px;
  background: rgba(10, 13, 18, .7);
  color: var(--text); font-weight: 600; font-size: 17px;
  pointer-events: none;
}
body.dragging .drop-overlay { display: grid; }

.loading {
  position: absolute; top: 58px; left: 50%; transform: translateX(-50%); z-index: 1400;
  display: flex; align-items: center; gap: 10px;
  max-width: calc(100% - 32px);
  padding: 9px 15px;
  border-radius: 999px;
  background: rgba(16, 21, 28, .95); border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  font-size: 13px; color: var(--text-2);
}
#loadingText { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spinner {
  flex: none; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--line-2); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toasts {
  position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%);
  z-index: 1600;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: max-content; max-width: calc(100% - 32px);
  pointer-events: none;
}
body.has-playback .toasts { bottom: 200px; }
.toast {
  padding: 9px 14px; border-radius: 9px;
  background: rgba(21, 27, 36, .97);
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--ok);
  box-shadow: var(--shadow);
  font-size: 13px; color: var(--text);
  opacity: 0; transform: translateY(8px);
  transition: opacity .25s, transform .25s;
}
.toast.in { opacity: 1; transform: none; }
.toast-warn { border-left-color: var(--warn); }
.toast-error { border-left-color: var(--error); }

/* ---------- Playback ---------- */

.playback {
  --c: var(--accent);
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  z-index: 700;
  width: min(760px, calc(100% - 120px));
  padding: 10px 14px 12px;
  border-radius: 14px;
  background: rgba(12, 16, 22, .93);
  border: 1px solid var(--line-2);
  border-top: 2px solid var(--c);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}
.pb-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pb-name {
  flex: 1; min-width: 0;
  font-family: var(--mono); font-size: 12.5px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pb-controls { display: flex; align-items: center; gap: 10px; }
.pb-play {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  border: 0; background: var(--c); color: #0a0d12;
  display: grid; place-items: center; cursor: pointer;
  transition: transform .1s, filter .15s;
}
.pb-play:hover { filter: brightness(1.12); }
.pb-play:active { transform: scale(.95); }
.pb-play .i-pause { display: none; }
.playback.playing .pb-play .i-play { display: none; }
.playback.playing .pb-play .i-pause { display: block; }
.pb-time { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); min-width: 44px; text-align: center; }

.pb-slider {
  --p: 0%;
  flex: 1; min-width: 60px; height: 22px; margin: 0;
  -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer;
}
.pb-slider::-webkit-slider-runnable-track {
  height: 5px; border-radius: 5px;
  background: linear-gradient(to right, var(--c) var(--p), var(--line-2) var(--p));
}
.pb-slider::-moz-range-track { height: 5px; border-radius: 5px; background: var(--line-2); }
.pb-slider::-moz-range-progress { height: 5px; border-radius: 5px; background: var(--c); }
.pb-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 15px; height: 15px; margin-top: -5px; border-radius: 50%;
  background: #fff; border: 3px solid var(--c); box-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}
.pb-slider::-moz-range-thumb {
  width: 11px; height: 11px; border-radius: 50%;
  background: #fff; border: 3px solid var(--c);
}

.pb-speed { display: flex; padding: 2px; gap: 2px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); }
.pb-speed button {
  border: 0; background: transparent; color: var(--text-2);
  height: 26px; min-width: 32px; padding: 0 6px; border-radius: 6px;
  font-family: var(--mono); font-size: 12px; cursor: pointer;
}
.pb-speed button.active { background: var(--panel-3); color: var(--text); box-shadow: 0 0 0 1px var(--line-2) inset; }

.pb-readout {
  margin: 10px 0 0;
  display: grid; grid-template-columns: repeat(6, auto); gap: 4px 18px; justify-content: start;
}
.pb-readout dt { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; }
.pb-readout dd { margin: 1px 0 0; font-family: var(--mono); font-size: 12.5px; color: var(--text); white-space: nowrap; }

.pb-note {
  margin: 8px 0 0; padding: 6px 10px; border-radius: 7px;
  background: rgba(251, 191, 36, .08); border: 1px solid rgba(251, 191, 36, .22);
  color: #fcd57a; font-size: 12px;
}
.playback.disabled .pb-controls { opacity: .4; }
.playback.disabled .pb-play, .playback.disabled .pb-slider { cursor: not-allowed; }

/* Drone marker */
.drone-icon { --c: var(--accent); }
.drone-dot {
  position: absolute; left: 6px; top: 6px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 3px solid var(--c);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .6);
}
.drone-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--c);
  animation: ping 1.6s ease-out infinite;
}
@keyframes ping { 0% { transform: scale(.5); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }

/* ---------- Leaflet theming ---------- */

.leaflet-container { font-family: var(--font); background: #0b0f14; }
.leaflet-bar { border: 1px solid var(--line-2) !important; box-shadow: var(--shadow) !important; border-radius: 9px !important; overflow: hidden; }
.leaflet-bar a, .leaflet-bar a:hover {
  background: rgba(16, 21, 28, .94); color: var(--text); border-bottom-color: var(--line-2);
  width: 34px; height: 34px; line-height: 34px;
}
.leaflet-bar a:hover { background: var(--panel-3); }
.leaflet-bar a.leaflet-disabled { background: rgba(16, 21, 28, .94); color: var(--muted); }
.leaflet-control-scale-line {
  background: rgba(10, 13, 18, .75); color: var(--text-2);
  border-color: var(--text-2); font-family: var(--mono); font-size: 10.5px;
}
.leaflet-control-attribution {
  background: rgba(10, 13, 18, .72) !important; color: var(--muted) !important; font-size: 10.5px;
}
.leaflet-control-attribution a { color: var(--text-2) !important; }

.fl-popup .leaflet-popup-content-wrapper {
  background: rgba(16, 21, 28, .97); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow);
}
.fl-popup .leaflet-popup-tip { background: rgba(16, 21, 28, .97); border: 1px solid var(--line-2); }
.fl-popup .leaflet-popup-content { margin: 13px 15px; font-size: 13px; line-height: 1.45; }
.fl-popup a.leaflet-popup-close-button { color: var(--muted); top: 6px; right: 6px; }
.pop-title { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12.5px; font-weight: 500; margin-bottom: 10px; padding-right: 14px; word-break: break-all; }
.pop-grid { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; }
.pop-grid dt { color: var(--muted); font-size: 12px; }
.pop-grid dd { margin: 0; font-family: var(--mono); font-size: 12.5px; }
.pop-warn { margin: 10px 0 0; padding: 7px 10px 7px 22px; border-radius: 7px; background: rgba(251, 191, 36, .08); color: #fcd57a; font-size: 12px; }
.pop-note { margin: 10px 0 0; color: var(--muted); font-size: 11.5px; }

.fl-tip {
  background: rgba(16, 21, 28, .95); color: var(--text); border: 1px solid var(--line-2);
  border-radius: 6px; box-shadow: none; font-size: 11.5px; padding: 3px 7px;
}
.fl-tip::before { display: none; }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .brand-sub { display: none; }
  .pb-readout { grid-template-columns: repeat(3, auto); }
}

@media (max-width: 820px) {
  :root { --topbar-h: 52px; }
  .export-label { display: none; }
  .btn-session span { display: none; }
  .topbar-sep { display: none; }
  .btn { padding: 0 10px; }

  .sidebar {
    position: absolute; top: 0; bottom: 0; left: 0;
    width: min(88vw, 370px);
    margin-left: 0 !important;
    transform: translateX(-102%);
    transition: transform .26s ease;
    box-shadow: var(--shadow);
    z-index: 1250;
  }
  .app.sidebar-open .sidebar { transform: none; }
  .backdrop {
    display: block; position: absolute; inset: 0; z-index: 1200;
    background: rgba(0, 0, 0, .5);
    opacity: 0; pointer-events: none; transition: opacity .2s;
  }
  .app.sidebar-open .backdrop { opacity: 1; pointer-events: auto; }

  .map-notice { top: auto; bottom: 26px; left: 10px; max-width: calc(100% - 70px); font-size: 11.5px; border-radius: 10px; }
  body.has-playback .map-notice { display: none; }
  .basemap-switch { top: 10px; right: 10px; }

  .playback {
    left: 8px; right: 8px; bottom: 8px; transform: none;
    width: auto; padding: 9px 11px 10px;
  }
  .pb-controls { flex-wrap: wrap; row-gap: 6px; }
  .pb-slider { order: 5; flex-basis: 100%; }
  .pb-time-total { margin-right: auto; }
  .pb-readout { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 12px; }
  .pb-readout .pb-wide { grid-column: span 2; }
  body.has-playback .toasts { bottom: 230px; }
  .leaflet-bottom.leaflet-right { margin-bottom: 0; }
  body.has-playback .leaflet-bottom { display: none; }
}

@media (max-width: 420px) {
  .brand-name { font-size: 15.5px; }
  .export-group { gap: 5px; }
  .btn:not(.btn-session) svg { display: none; }
}

/* ---------- Sesije na serveru ---------- */

.session-title {
  min-width: 0; max-width: 34vw;
  padding: 4px 10px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line-2);
  color: var(--text-2); font-size: 12.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.session-title b { color: var(--text); font-weight: 600; }

.save-wrap { position: relative; }
.save-pop {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 1400;
  width: 320px; max-width: calc(100vw - 24px);
  padding: 14px;
  border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px;
}
.sp-cloud { display: flex; flex-direction: column; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field span { color: var(--muted); font-size: 11.5px; }
.field input, .sp-result input, .cloud-login input {
  height: 34px; padding: 0 10px; min-width: 0;
  border-radius: var(--radius-sm);
  background: var(--panel-2); border: 1px solid var(--line-2);
  color: var(--text); font: inherit; font-size: 13px;
}
.field input:focus, .sp-result input:focus, .cloud-login input:focus { outline: none; border-color: var(--accent); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: wait; }
.sp-hint { margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.sp-result { display: flex; gap: 6px; }
.sp-result input { flex: 1; font-family: var(--mono); font-size: 12px; color: var(--accent); }
.sp-error { margin: 0; color: var(--error); font-size: 12px; }
.sp-offline { margin: 0; color: var(--muted); font-size: 12px; }
.sp-alt {
  border: 0; border-top: 1px solid var(--line); background: transparent;
  padding: 10px 0 0; margin: 0; text-align: left;
  color: var(--text-2); font-size: 12.5px; cursor: pointer;
}
.sp-alt:hover { color: var(--accent); }

.panel-head-actions { display: flex; gap: 10px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--muted); font-size: 12px; cursor: pointer; }
.link-btn:hover { color: var(--accent); }

.cloud-login { display: flex; gap: 6px; }
.cloud-login input { flex: 1; }
.cloud-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cloud-item {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center;
  padding: 9px 10px; border-radius: var(--radius);
  background: var(--panel-2); border: 1px solid var(--line);
}
.cloud-item.current { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.ci-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); text-decoration: none; }
.ci-name:hover { color: var(--accent); }
.ci-meta { grid-column: 1; color: var(--muted); font-size: 11.5px; font-family: var(--mono); }
.ci-actions { grid-row: 1 / span 2; grid-column: 2; display: flex; gap: 2px; }
.ci-actions .icon-btn { color: var(--muted); }
.ci-actions .icon-btn:hover { color: var(--text); }
.ci-actions .ci-del:hover, .ci-actions .ci-del.confirm { color: var(--error); background: rgba(248, 113, 113, .12); }
.cloud-empty { margin: 0; color: var(--muted); font-size: 12.5px; }

@media (max-width: 820px) {
  .session-title { display: none; }
}
