*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #f1f5f9;
  color: #1e293b;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  overflow: hidden;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

/* ── Map ──────────────────────────────────────────────────────── */
#map {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #e2e8f0;
  z-index: 1;
}

/* ── Loading ─────────────────────────────────────────────────── */
#loadingOverlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(255,255,255,.82);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 14px;
}
#loadingOverlay.hidden { display: none; }

/* ── Search bar ──────────────────────────────────────────────── */
#searchBar {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, calc(100% - 24px));
  z-index: 60;
}
#searchWrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 26px;
  padding: 0 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,.12);
  transition: box-shadow .15s, border-color .15s;
}
#searchWrap:focus-within {
  border-color: #93c5fd;
  box-shadow: 0 2px 16px rgba(37,99,235,.14);
}
#searchInput {
  flex: 1; background: none; border: none; outline: none;
  color: #0f172a; font-size: 15px; padding: 13px 0;
  min-width: 0; -webkit-appearance: none;
  -webkit-user-select: text; user-select: text;
}
#searchInput::placeholder { color: #94a3b8; }
#searchInput::-webkit-search-cancel-button { display: none; }
#searchClear {
  background: #dc2626; border: none; color: #fff;
  padding: 0; cursor: pointer;
  flex-shrink: 0; border-radius: 50%;
  width: 28px; height: 28px; min-width: 28px; min-height: 28px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(220,38,38,.35);
  transition: background .12s, transform .1s;
}
#searchClear svg { width: 16px; height: 16px; }
#searchClear:hover { background: #b91c1c; transform: scale(1.1); }

#searchResults {
  margin-top: 6px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
  max-height: 52vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #e2e8f0 transparent;
}
.sr-item {
  padding: 11px 16px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 3px;
  transition: background .1s;
  -webkit-user-select: none; user-select: none;
}
.sr-item:last-child { border-bottom: none; }
.sr-item:active, .sr-item:hover { background: #f8fafc; }
.sr-code  { font-weight: 700; font-size: 13px; color: #1d4ed8; display: flex; align-items: center; gap: 8px; }
.sr-speed { font-size: 11px; font-weight: 500; color: #94a3b8; }
.sr-addr  { font-size: 12px; color: #475569; }
.sr-partner { font-size: 11px; color: #64748b; font-style: italic; }
.sr-empty { padding: 14px 16px; color: #94a3b8; font-size: 13px; }

/* ── Logo bar ────────────────────────────────────────────────── */
/* Mobitel: desno, ispod search bara, vertikalno (Koshchall gore, RadarSpy dolje) */
.map-logo-bar {
  position: fixed;
  top: 74px;
  right: 2px;
  gap: 3px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.map-logo-link img {
  display: block;
  width: auto;
  opacity: .88;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,.22));
  transition: opacity .15s;
}
.map-logo-link:hover img { opacity: 1; }

/* Mobile: Koshchall manji od RadarSpy */
.map-logo-bar .map-logo-link:first-child img {
  height: 25px;
  width: auto;
}
.map-logo-bar .map-logo-link:last-child img {
  height: 40px;
  width: auto;
}

/* Desktop: horizontalno, iste i veće */
@media (min-width: 600px) {
  .map-logo-bar {
    top: 14px;
    right: 14px;
    flex-direction: row;
    align-items: center;
    gap: 14px;
  }
  .map-logo-bar .map-logo-link:first-child img {
    height: 34px;
    width: auto;
  }
  .map-logo-bar .map-logo-link:last-child img {
    height: 61px;
    width: auto;
  }
}

/* ── Search panel (lijevi overlay) ──────────────────────────── */
/*
  Dva sloja:
  sp-content: vizualni sloj, puna sirina, pass-through na kartu, BEZ pozadine
  sp-strip:   interaktivni sloj, 10vw, scroll+klik
*/
.search-panel {
  position: fixed;
  top: 100px;
  bottom: 96px;
  left: 0;
  width: min(240px, 48vw);
  z-index: 58;
  pointer-events: none;
  border-radius: 0 14px 14px 0;
  overflow: hidden;
  transform: translateX(0);
  transition: transform .24s cubic-bezier(.32,.72,0,1);
}
.search-panel[aria-hidden="true"] { transform: translateX(-100%); }



.sp-wrap {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
}


/* Dekorativni scroll indikator — lijeva strana liste */
.sp-scroll-track {
  position: absolute;
  left: 2px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: linear-gradient(to bottom, rgba(0,0,0,.35) 0%, rgba(0,0,0,.55) 50%, rgba(0,0,0,.35) 100%);
  border-radius: 2px;
  pointer-events: none;
  z-index: 15;
  box-shadow: 0 0 3px rgba(255,255,255,.4);
}

/* Vizualni sloj — bez pozadine, karta potpuno vidljiva */
.sp-content {
  position: absolute;
  inset: 0;
  overflow-y: scroll;
  pointer-events: none;
  background: transparent;
  scrollbar-width: none;
}
.sp-content::-webkit-scrollbar { display: none; }

/* Interaktivni sloj — 10vw, prima scroll i klik */
.sp-strip {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 10vw;
  pointer-events: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  background: transparent;
  z-index: 10;
}
.sp-strip::-webkit-scrollbar { display: none; }

/* Vizualni item — puna sirina panela */
.sp-vitem {
  height: 48px;
  padding: 0 8px 0 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-bottom: 1px solid rgba(0,0,0,.08);
  border-left: 3px solid transparent;
  background: transparent;
  pointer-events: none;
}
.sp-vitem.sp-sel {
  border-left-color: #FFD600;
  background: rgba(255,214,0,.15);
}

.sp-hitem {
  height: 48px;
  cursor: pointer;
  border-bottom: 1px solid transparent;
}
.sp-hitem:hover, .sp-hitem:active { background: rgba(255,255,255,.12); }

/* Tekst — bijeli s crnim outlineom, citljiv na bilo kojoj podlozi */
.sp-city {
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  text-shadow:
    -1px -1px 0 rgba(0,0,0,.9),
     1px -1px 0 rgba(0,0,0,.9),
    -1px  1px 0 rgba(0,0,0,.9),
     1px  1px 0 rgba(0,0,0,.9),
     0 0 8px rgba(0,0,0,.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.sp-addr {
  font-size: 10px;
  font-weight: 600;
  color: #ffe;
  text-shadow:
    -1px -1px 0 rgba(0,0,0,.85),
     1px -1px 0 rgba(0,0,0,.85),
    -1px  1px 0 rgba(0,0,0,.85),
     1px  1px 0 rgba(0,0,0,.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.sp-empty {
  padding: 12px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
  pointer-events: none;
  height: 48px;
  display: flex; align-items: center;
}

@media (min-width: 600px) {
  .search-panel { width: 300px; top: 106px; bottom: 80px; }
  .sp-strip { width: 100%; }
  .sp-vitem { height: 56px; padding: 0 12px 0 14px; }
  .sp-hitem { height: 56px; }
  .sp-city { font-size: 13px; }
  .sp-addr { font-size: 11px; }
}


#refreshBtn {
  position: fixed;
  bottom: 308px;
  right: 14px;
  z-index: 60;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255,255,255,.55);
  color: #475569;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  cursor: pointer;
  transition: background .12s, transform .3s;
}
#refreshBtn svg { width: 20px; height: 20px; }
#refreshBtn:hover { background: rgba(255,255,255,.85); }
#refreshBtn.spinning svg { animation: spin .7s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ── Info gumb — centriran iznad GPS gumba ───────────────────── */
/* GPS: bottom:32px, right:14px, width:54px → centar od desna: 41px
   Info: width:34px → right:24px da se centar poklopi */
#infoBtn {
  position: fixed;
  bottom: 252px;
  right: 14px;
  z-index: 60;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255,255,255,.55);
  color: #475569;
  font-size: 20px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  transition: background .12s, color .12s;
}
#infoBtn:hover { background: rgba(255,255,255,.85); color: #1e293b; }

#downloadExportBtn {
  position: fixed;
  bottom: 306px;
  right: 14px;
  z-index: 60;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255,255,255,.55);
  color: #475569;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  transition: background .12s, color .12s;
}
#downloadExportBtn:hover { background: rgba(255,255,255,.85); color: #0f172a; }

/* Info modal body */
.info-body { font-size: 13px; color: #334155; line-height: 1.55; }
.info-body h4 {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 14px 0 5px;
}
.info-body h4:first-child { margin-top: 4px; }
.info-body p { margin-bottom: 4px; }
.info-body strong { color: #0f172a; }

/* Desktop: search panel malo širi, info btn uz search bar */
@media (min-width: 600px) {
  .search-panel {
    width: 270px;
    top: 72px;
  }
  /* info btn: bottom-based, nema posebnog desktop overridea */
}

/* ── GPS button ──────────────────────────────────────────────── */
#gpsBtn {
  position: fixed;
  bottom: 196px; right: 14px;
  z-index: 60;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255,255,255,.55);
  color: #1d4ed8;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 14px rgba(0,0,0,.14);
  cursor: pointer;
  transition: background .15s, color .15s;
}
#gpsBtn svg { width: 22px; height: 22px; }
#gpsBtn:hover  { background: rgba(255,255,255,.82); }
#gpsBtn.active { color: #059669; border-color: rgba(110,231,183,.7); }

/* ════════════════════════════════════════════════════════════════
   MARKERI — SVG inline (stil prometnog znaka + strelica azimuta)
   Sve boje/oblici su definirani direktno u JS makeIcon funkciji
   ════════════════════════════════════════════════════════════════ */

/* User location */
.user-marker {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #2563eb;
  border: 3px solid #fff;
  box-shadow: 0 0 8px rgba(37,99,235,.5);
}

/* ════════════════════════════════════════════════════════════════
   BOTTOM CARD — spartanski
   ════════════════════════════════════════════════════════════════ */
.bottom-card {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 45;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -3px 14px rgba(0,0,0,.1);
  padding: 0 14px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  transform: translateY(0);
  transition: transform .26s cubic-bezier(.32,.72,0,1);
}
.bottom-card[aria-hidden="true"] {
  transform: translateY(110%);
  pointer-events: none;
}
.bottom-card::-webkit-scrollbar { display: none; }

#cardHandle {
  width: 30px; height: 3px;
  background: #cbd5e1;
  border-radius: 2px;
  margin: 6px auto 0;
  cursor: grab;
}
#cardClose {
  position: absolute;
  top: 12px; right: 12px;
  background: #f1f5f9;
  border: none;
  color: #64748b;
  font-size: 11px;
  width: 24px; height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
#cardClose:hover { background: #e2e8f0; }

/* Card content */
.card-head {
  padding: 6px 24px 6px 0;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 4px;
}
.card-code {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}
.card-partner {
  font-size: 13px;
  font-weight: 600;
  color: #1d4ed8;
  margin-top: 2px;
}
.card-addr {
  font-size: 12px;
  color: #64748b;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}



.card-sv-btn {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px 6px 10px;
  background: #1a73e8; color: #fff;
  border: none; border-radius: 20px;
  font-size: 13px; font-weight: 700;
  text-decoration: none; cursor: pointer;
  flex-shrink: 0; white-space: nowrap;
  box-shadow: 0 1px 4px rgba(26,115,232,.35);
  transition: background .12s;
}
.card-sv-btn:hover { background: #1558b0; }
.card-sv-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.card-dates {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  color: #64748b;
  margin-bottom: 2px;
}
.card-dates b {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .05em;
}

/* Dva gumba usporedno */
.card-btns { display: none; }
.btn-report, .btn-comments {
  padding: 10px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .1s;
  text-align: center;
}
.btn-report {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
}
.btn-report:hover { background: #f1f5f9; color: #1e293b; }
.btn-comments {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}
.btn-comments:hover { background: #dbeafe; }


/* ── Action modal (komentar / nova kamera) ───────────────────────*/
.modal-action-box { padding-bottom: calc(20px + env(safe-area-inset-bottom,0px)); }

.action-header { margin-bottom: 10px; padding-right: 30px; }
.action-type-label {
  font-size: 15px; font-weight: 900; letter-spacing: .08em;
  color: #0f172a; text-transform: uppercase; margin-bottom: 4px;
  border-left: 4px solid #dc2626; padding-left: 8px;
}
.action-cam-info { font-size: 15px; font-weight: 700; color: #0f172a; line-height: 1.3; }
.action-cam-partner { font-size: 12px; color: #1d4ed8; font-weight: 600; margin-top: 1px; }

/* Hint tekst */
.action-hint { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.hint-speed, .hint-az {
  font-size: 11px; color: #64748b;
}
.hint-speed::before { content: ""; }

/* Marker wrapper + compass */
.action-marker-section { display: flex; flex-direction: column; align-items: center; margin-bottom: 10px; }
.action-marker-wrap {
  position: relative;
  width: 160px; height: 160px;
  touch-action: none;
  user-select: none; -webkit-user-select: none;
}
.action-svg {
  width: 160px; height: 160px;
  cursor: pointer;
  display: block;
}
/* Compass oznake */
.compass-label {
  position: absolute;
  font-size: 10px; font-weight: 700; color: #94a3b8;
  pointer-events: none;
}
.compass-n { top: -2px;  left: 50%; transform: translateX(-50%); }
.compass-s { bottom: -2px; left: 50%; transform: translateX(-50%); }
.compass-e { right: -6px; top: 50%; transform: translateY(-50%); }
.compass-w { left: -6px;  top: 50%; transform: translateY(-50%); }

.action-values {
  display: flex; gap: 14px; margin-top: 6px;
}
.action-val-item { font-size: 12px; color: #475569; }
.action-val-item b { color: #0f172a; }

/* Speed picker */

.subtype-wrap { margin-bottom: 8px; }
.sub-chip-lbl {
  display: inline-flex; align-items: center;
  padding: 6px 12px; border-radius: 20px;
  background: #f1f5f9; border: 1.5px solid #e2e8f0;
  color: #475569; font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all .12s; -webkit-user-select: none; user-select: none;
}
.sub-chip-lbl input[type=radio] { display: none; }
.sub-chip-lbl:hover { border-color: #94a3b8; color: #1e293b; }
.sub-chip-lbl:has(input:checked) { background: #fef3c7; border-color: #f59e0b; color: #92400e; }
.subtype-wrap[hidden] { display: none !important; }
.subtype-label { font-size: 11px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 5px; }
.subtype-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sub-chip {
  padding: 6px 12px; border-radius: 20px;
  background: #f1f5f9; border: 1.5px solid #e2e8f0;
  color: #475569; font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all .12s; -webkit-user-select: none; user-select: none;
}
.sub-chip:hover  { border-color: #94a3b8; color: #1e293b; }
.sub-chip.active { background: #fef3c7; border-color: #f59e0b; color: #92400e; }

.speed-picker-wrap {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.speed-picker-wrap[hidden] { display: none !important; }
.speed-picker-title { font-size: 11px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.speed-picker-grid { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 7px; }
.spd-chip {
  padding: 6px 10px;
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 8px; color: #475569;
  font-size: 13px; font-weight: 700; cursor: pointer;
  -webkit-user-select: none; user-select: none;
  transition: background .1s, border-color .1s;
}
.spd-chip:hover  { border-color: #3b82f6; color: #1d4ed8; background: #eff6ff; }
.spd-chip.active { background: #dbeafe; border-color: #3b82f6; color: #1d4ed8; }
.spd-unknown {
  width: 100%; padding: 6px;
  background: none; border: 1px dashed #cbd5e1;
  border-radius: 8px; color: #94a3b8;
  font-size: 12px; cursor: pointer;
  -webkit-user-select: none; user-select: none;
}
.spd-unknown:hover { border-color: #94a3b8; color: #64748b; }

/* Comment label */
#actionCommentLabel { display: block; font-size: 11px; color: #64748b; margin: 10px 0 4px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }

/* ── Modals ───────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  z-index: 200;
  background: rgba(15,23,42,.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay[hidden] { display: none; }

.modal-box {
  background: #fff;
  border-radius: 20px 20px 0 0;
  border-top: 1px solid #e2e8f0;
  width: 100%;
  max-width: 520px;
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  max-height: 88vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  position: relative;
  box-shadow: 0 -4px 24px rgba(0,0,0,.1);
}
.modal-close {
  position: absolute; top: 16px; right: 14px;
  background: #f1f5f9; border: none;
  color: #64748b; font-size: 11px;
  width: 24px; height: 24px;
  border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: #e2e8f0; }

.modal-box h3 { font-size: 16px; font-weight: 700; color: #0f172a; margin-bottom: 4px; padding-right: 30px; }
.modal-info   { font-size: 12px; color: #64748b; margin-bottom: 16px; }
.modal-box label {
  display: block; font-size: 11px; color: #64748b;
  margin: 12px 0 4px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
}
.modal-box textarea, .modal-box select {
  width: 100%; background: #f8fafc;
  border: 1px solid #e2e8f0; border-radius: 10px;
  color: #0f172a; font-size: 14px; padding: 10px 12px;
  outline: none; resize: vertical; font-family: inherit;
}
.modal-box textarea { min-height: 84px; }
.modal-box textarea:focus, .modal-box select:focus { border-color: #3b82f6; background: #fff; }

.speed-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.speed-chip {
  padding: 7px 10px;
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 8px; color: #475569;
  font-size: 13px; font-weight: 700; cursor: pointer;
  -webkit-user-select: none; user-select: none;
}
.speed-chip:hover  { border-color: #3b82f6; color: #1d4ed8; background: #eff6ff; }
.speed-chip.active { background: #dbeafe; border-color: #3b82f6; color: #1d4ed8; }

.modal-actions { margin-top: 14px; }
.modal-actions button[type=submit] {
  width: 100%; padding: 13px;
  background: #2563eb; border: none;
  border-radius: 12px; color: #fff;
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.modal-actions button[type=submit]:hover    { background: #1d4ed8; }
.modal-actions button[type=submit]:disabled { background: #e2e8f0; color: #94a3b8; cursor: default; }

.msg { font-size: 13px; margin-top: 10px; min-height: 18px; }
.msg.ok    { color: #059669; }
.msg.error { color: #dc2626; }
.req { color: #dc2626; }


/* ── Marker clusters ─────────────────────────────────────────────
   Prekriva default MarkerCluster.Default.css stilove
   ════════════════════════════════════════════════════════════════ */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background: rgba(220, 38, 38, 0.18) !important;
}
.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background: rgba(220, 38, 38, 0.82) !important;
  color: #fff !important;
  font-weight: 800 !important;
  font-size: 13px !important;
  font-family: Arial, sans-serif !important;
  border: 2.5px solid #fff !important;
  box-shadow: 0 2px 6px rgba(0,0,0,.25) !important;
}
.marker-cluster-small div  { width: 30px !important; height: 30px !important; margin: 5px !important; line-height: 26px !important; border-radius: 50% !important; }
.marker-cluster-medium div { width: 36px !important; height: 36px !important; margin: 7px !important; line-height: 32px !important; border-radius: 50% !important; }
.marker-cluster-large div  { width: 44px !important; height: 44px !important; margin: 3px !important; line-height: 40px !important; border-radius: 50% !important; }




/* TEMP: Zoom kalibracija */
#calibToggle { display: none !important; } #calibToggle_DISABLED {
  position: fixed;
  bottom: 154px;
  right: 14px;
  z-index: 201;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(0,0,0,.15);
  color: #475569;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
#calibPanel[hidden] { display: none !important; }
#calibPanel {
  position: fixed;
  bottom: 160px;
  right: 14px;
  z-index: 200;
  background: rgba(15,23,42,.88);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 10px;
  padding: 8px 10px;
  min-width: 140px;
  box-shadow: 0 3px 12px rgba(0,0,0,.4);
}
.calib-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 5px;
}
.calib-row label {
  font-size: 11px; font-weight: 600; color: rgba(255,255,255,.7);
  white-space: nowrap;
}
.calib-row input {
  width: 48px; padding: 3px 5px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 5px;
  color: #fff; font-size: 13px; font-weight: 700;
  text-align: center; outline: none;
  -webkit-user-select: text; user-select: text;
}
.calib-row input:focus { border-color: #60a5fa; background: rgba(96,165,250,.15); }
#calibLog {
  font-size: 9px; color: rgba(255,255,255,.4);
  margin-top: 4px; line-height: 1.4;
}

/* ── Zoom indicator ──────────────────────────────────────────────*/
.zoom-indicator {
  position: fixed;
  bottom: 260px;
  left: 8px;
  z-index: 60;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  pointer-events: none;
}

/* ── Custom cluster markeri ──────────────────────────────────────*/
.cc-country {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  background: rgba(220,38,38,.9);
  border: 3px solid #fff;
  border-radius: 14px;
  padding: 5px 12px;
  box-shadow: 0 3px 10px rgba(0,0,0,.35);
  cursor: pointer;
  min-width: 64px;
}
.cc-country-name {
  font-size: 14px; font-weight: 900; color: #fff;
  letter-spacing: .08em; line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.cc-country-count {
  font-size: 12px; font-weight: 700; color: rgba(255,255,255,.9);
  line-height: 1.2;
}

.cc-zip {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(37,99,235,.85);
  border: 2.5px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
  cursor: pointer;
  width: 44px; height: 44px;
}
.cc-zip-code  { font-size: 11px; font-weight: 900; color: #fff; line-height: 1.2; }
.cc-zip-count { font-size: 10px; font-weight: 600; color: rgba(255,255,255,.8); line-height: 1.1; }

/* Leaflet */
.leaflet-control-attribution {
  background: rgba(255,255,255,.7) !important;
  color: #94a3b8 !important; font-size: 9px !important;
}
.leaflet-control-attribution a { color: #64748b !important; }
.leaflet-attribution-flag { display: none !important; }

/* Desktop */
@media (min-width: 600px) {
  .bottom-card {
    left: 50%; right: auto; width: 380px;
    transform: translateX(-50%) translateY(0);
  }
  .bottom-card[aria-hidden="true"] {
    transform: translateX(-50%) translateY(110%);
  }
  .modal-overlay { align-items: center; }
  .modal-box { border-radius: 16px; max-height: 82vh; padding-bottom: 24px; }
  #gpsBtn { bottom: 28px; right: 14px; }
  #downloadExportBtn { bottom: 134px; right: 14px; }
  #infoBtn { bottom: 80px; right: 14px; }
}

.card-section {
  font-size: 11px;
  color: #c084fc;
  margin-top: 3px;
  letter-spacing: .02em;
}

.card-section-lbl {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  color: #7c3aed;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ── Layer switch gumb ──────────────────────────────────────── */
#layerBtn {
  position: fixed;
  bottom: 360px; right: 14px;
  z-index: 60;
  width: 44px; height: 44px;
  border-radius: 10px;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1.5px solid rgba(255,255,255,.55);
  color: #475569;
  font-size: 11px; font-weight: 800; letter-spacing: .04em;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.14);
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
#layerBtn:hover { background: rgba(255,255,255,.95); }
#layerBtn.active {
  background: #1e293b;
  color: #fff;
  border-color: #1e293b;
}
@media (min-width: 600px) {
  #layerBtn { bottom: 188px; }
}

/* ── Status badge u bottom cardu ────────────────────────────── */
.card-status-badge {
  font-size: 11px; font-weight: 700;
  border-radius: 6px;
  padding: 2px 7px;
  display: inline-block;
  margin: 3px 0 2px;
}
.badge-review {
  background: #fef3c7;
  color: #92400e;
}
.badge-user {
  background: #f0fdf4;
  color: #166534;
}

.badge-comment {
  background: #eff6ff;
  color: #1d4ed8;
}

/* ── Quick filter chips ──────────────────────────────────────── */
#quickFilters {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, calc(100% - 24px));
  z-index: 60;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 6px 4px 2px;
}
#quickFilters[hidden] { display: none !important; }

.qf-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 20px;
  font-size: 12px; font-weight: 600; color: #475569;
  cursor: pointer;
  box-shadow: 0 1px 6px rgba(0,0,0,.10);
  transition: border-color .12s, background .12s, color .12s;
  white-space: nowrap;
  -webkit-user-select: none; user-select: none;
}
.qf-chip:hover { border-color: #94a3b8; color: #1e293b; }
.qf-chip.active {
  background: #1e293b;
  border-color: #1e293b;
  color: #fff;
}
.qf-chip.active .qf-dot { border-color: rgba(255,255,255,.4); }

.qf-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1.5px solid rgba(0,0,0,.08);
}


/* Exit toast */
#exitToast {
  position: fixed;
  bottom: 180px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15,23,42,.88);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 24px;
  z-index: 300;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  white-space: nowrap;
}
#exitToast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* Export modal */
.export-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.export-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 12px;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
  cursor: pointer; transition: background .12s, border-color .12s;
}
.export-item:hover, .export-item:active { background: #e8f0fe; border-color: #c5d5f8; }
.export-meta { flex: 1; min-width: 0; }
.export-name { display: block; font-size: 13px; font-weight: 700; color: #0f172a; word-break: break-all; }
.export-sub  { display: block; font-size: 11px; color: #64748b; margin-top: 2px; }
.export-dl   { flex-shrink: 0; color: #1a73e8; }
.export-dl svg { width: 20px; height: 20px; display: block; }
.export-loading { font-size: 13px; color: #64748b; padding: 12px 0; }

/* ── Edit mode: korekcija na karti ─────────────────────────── */
.edit-marker-icon { touch-action: none; }
.edit-marker-icon svg { overflow: visible; }
.edit-marker-icon svg * { pointer-events: none; }
.edit-marker-icon svg .em-circle,
.edit-marker-icon svg .em-text,
.edit-marker-icon svg .em-handle { pointer-events: auto; }
.edit-marker-icon svg .em-handle { cursor: grab; }
.edit-marker-icon svg .em-circle { cursor: pointer; }

#editSheet {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 70;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -3px 14px rgba(0,0,0,.18);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
}
#editSheet[hidden] { display: none; }
@media (min-width: 600px) {
  #editSheet { left: 50%; right: auto; width: 380px; transform: translateX(-50%); }
}
.es-head { display: flex; align-items: baseline; gap: 8px; }
.es-title { font-size: 12px; font-weight: 800; color: #dc2626; letter-spacing: .05em; }
.es-info  { font-size: 12px; color: #475569; font-weight: 700; }
.es-hint  { font-size: 10px; color: #94a3b8; margin: 2px 0 6px; }
.es-vals  { display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
            font-size: 12px; color: #334155; margin-bottom: 6px; }
.es-vals b { color: #0f172a; }
.es-moved { color: #dc2626; font-weight: 800; font-size: 11px; }
.es-speed-grid { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0 8px; }
.es-speed-grid .spd-chip { padding: 7px 11px; }
.es-sub-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.es-sub {
  padding: 5px 10px; border: 1px solid #e2e8f0; border-radius: 14px;
  font-size: 11px; font-weight: 700; color: #475569; background: #fff; cursor: pointer;
}
.es-sub.active { background: #fee2e2; border-color: #dc2626; color: #dc2626; }
#esComment {
  width: 100%; box-sizing: border-box;
  border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 8px; font-size: 13px; font-family: inherit;
  min-height: 40px; resize: none;
}
.es-btns { display: flex; gap: 8px; margin-top: 8px; }
.es-btns button {
  flex: 1; padding: 11px; border-radius: 10px;
  font-weight: 800; font-size: 13px; cursor: pointer; border: none;
}
#esCancel { background: #f1f5f9; color: #475569; }
#esSend   { background: #dc2626; color: #fff; }
#esSend:disabled { opacity: .6; }
#esMsg { margin-top: 4px; min-height: 14px; }

/* Gumb korekcije u kartici */
.card-actions-row { margin-top: 8px; }
#cardCorrBtn {
  width: 100%; padding: 9px; border-radius: 10px;
  border: 1.5px solid #dc2626; background: #fff; color: #dc2626;
  font-weight: 800; font-size: 13px; cursor: pointer;
}
#cardCorrBtn:active { background: #fee2e2; }

/* Speed overlay (edit mode) */
#speedOverlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(15,23,42,.45);
  display: flex; align-items: center; justify-content: center;
}
#speedOverlay[hidden] { display: none; }
.so-box {
  background: #fff; border-radius: 14px;
  padding: 14px; width: min(320px, 86vw);
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
}
.so-title { font-size: 12px; font-weight: 800; color: #475569;
            text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px; }
.so-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.so-grid .spd-chip { padding: 11px 0; text-align: center; font-size: 14px; }

/* Kompaktniji edit sheet */
#editSheet { padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); }
#editSheet .es-vals { margin: 4px 0 6px; }
#editSheet #esComment { min-height: 34px; padding: 6px 8px; }
#editSheet .es-btns { margin-top: 6px; }
#editSheet .es-btns button { padding: 9px; }

/* Dodaj kameru gumb */
#addCamBtn {
  position: fixed;
  bottom: 412px; right: 14px;
  z-index: 60;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #dc2626; color: #fff;
  border: none; cursor: pointer;
  box-shadow: 0 2px 10px rgba(220,38,38,.4);
  display: flex; align-items: center; justify-content: center;
}
#addCamBtn svg { width: 22px; height: 22px; }
#addCamBtn:active { transform: scale(.94); }

/* Add sheet */
#addSheet {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 70;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -3px 14px rgba(0,0,0,.18);
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px));
}
#addSheet[hidden] { display: none; }
@media (min-width: 600px) {
  #addSheet { left: 50%; right: auto; width: 380px; transform: translateX(-50%); }
}
.as-title { font-size: 12px; font-weight: 800; color: #dc2626; letter-spacing: .05em; margin-bottom: 10px; }
.as-opt {
  display: block; width: 100%; text-align: left;
  padding: 12px; margin-bottom: 7px;
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px;
  font-size: 13px; font-weight: 700; color: #0f172a; cursor: pointer;
}
.as-opt:active { background: #e8f0fe; }
.as-coord-line { display: flex; gap: 7px; margin-bottom: 6px; }
#asCoordInput {
  flex: 1; min-width: 0;
  border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 9px; font-size: 13px;
}
#asCoordGo {
  padding: 9px 14px; border: none; border-radius: 8px;
  background: #dc2626; color: #fff; font-weight: 800; font-size: 13px; cursor: pointer;
}
.as-coord-msg { font-size: 11px; color: #dc2626; min-height: 14px; margin-bottom: 4px; }
.as-cancel {
  display: block; width: 100%; padding: 10px; margin-top: 2px;
  background: #f1f5f9; border: none; border-radius: 10px;
  font-weight: 800; font-size: 13px; color: #475569; cursor: pointer;
}
.es-near { color: #d97706; font-weight: 800; font-size: 11px; }

/* Share gumb — dijeli link karte */
#shareBtn {
  position: fixed;
  bottom: 464px; right: 14px;
  z-index: 60;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.62);
  backdrop-filter: blur(6px);
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.22);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #1e293b;
  transition: background .15s;
}
#shareBtn svg { width: 20px; height: 20px; }
#shareBtn:active { transform: scale(.94); }
#shareBtn.shared { background: #dcfce7; color: #16a34a; }

/* Welcome overlay */
.welcome-box { max-width: 340px; }
.welcome-lead { font-size: 13px; color: #334155; line-height: 1.5; margin: 8px 0 14px; }
.welcome-item {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 12.5px; color: #334155; line-height: 1.45;
  margin-bottom: 10px;
}
.welcome-ico {
  flex-shrink: 0;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 15px; font-weight: 800;
}
#welcomeOk {
  display: block; width: 100%;
  margin-top: 14px; padding: 12px;
  background: #dc2626; color: #fff;
  border: none; border-radius: 10px;
  font-weight: 800; font-size: 14px; cursor: pointer;
}
#welcomeOk:active { background: #b91c1c; }

/* Vanjski link u export modalu */
.export-ext-link {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px;
  background: #eef2ff; border: 1px solid #c7d2fe; border-radius: 10px;
  font-size: 13px; font-weight: 700; color: #3730a3;
  text-decoration: none;
  transition: background .12s;
}
.export-ext-link:hover, .export-ext-link:active { background: #e0e7ff; }
.export-ext-link svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ═══ UNIFICIRANI DESNI STUPAC GUMBA (override) ═══════════════ */
#shareBtn, #addCamBtn, #layerBtn, #refreshBtn,
#downloadExportBtn, #infoBtn, #gpsBtn {
  right: 12px;
  width: 42px; height: 42px;
  min-width: 42px; min-height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(6px);
  border: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  display: flex; align-items: center; justify-content: center;
  color: #1e293b;
  padding: 0;
}
/* Razmak: pitch 46px od dna prema gore */
#gpsBtn            { bottom: 188px; }
#infoBtn           { bottom: 234px; }
#downloadExportBtn { bottom: 280px; }
#refreshBtn        { bottom: 326px; }
#layerBtn          { bottom: 372px; }
#addCamBtn         { bottom: 418px; }
#shareBtn          { bottom: 464px; }

/* Posebnosti */
#addCamBtn { background: #dc2626; color: #fff; box-shadow: 0 2px 10px rgba(220,38,38,.4); }
#layerBtn  { font-size: 11px; font-weight: 800; }
#layerBtn #layerBtnLabel { font-size: 11px; font-weight: 800; letter-spacing: .02em; }
#shareBtn svg, #refreshBtn svg, #gpsBtn svg { width: 20px; height: 20px; }
#addCamBtn svg { width: 22px; height: 22px; }
#infoBtn { font-size: 20px; }
#downloadExportBtn { font-size: 18px; }

/* Search panel ispod kartice kamere + nize od gumba */
.search-panel { z-index: 44; }

/* ═══ SEARCH SUZEN + RADARSPY LOGO GORE DESNO (override) ═══════ */
#searchBar {
  left: 12px;
  right: 84px;
  transform: none;
  width: auto;
  max-width: 480px;
}
#quickFilters {
  left: 12px;
  right: 84px;
  transform: none;
  width: auto;
  max-width: 480px;
}
.map-logo-bar {
  top: 13px;
  right: 10px;
  flex-direction: row;
  align-items: center;
}
.map-logo-bar .map-logo-link img,
.map-logo-bar .map-logo-link:first-child img,
.map-logo-bar .map-logo-link:last-child img {
  width: 66px;
  height: auto;
  opacity: .95;
}
