/* GPX QR Tracker — Plugin Styles */

.gpxqr-root {
  display: flex;
  flex-direction: column;
  /* overflow:hidden removed — would trap position:fixed children (lightbox) */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  position: relative;
}

.gpxqr-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg, #1a1a2e);
  color: #e8eaf6;
  /* No transform/filter/backdrop-filter here — would create new stacking context
     and break position:fixed on lightbox */
}

/* ── Header ── */
.gpxqr-header {
  background: rgba(0,0,0,0.3);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
  z-index: 100;
}
.gpxqr-title { font-size: 15px; font-weight: 600; flex: 1; }
.gpxqr-offline-badge {
  display: none;
  font-size: 10px;
  background: #1a2a0a;
  color: #80c060;
  border: 1px solid #3a5a1a;
  border-radius: 6px;
  padding: 2px 8px;
}
.gpxqr-hbtn {
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  color: #a0a8e0;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
}
.gpxqr-hbtn:hover { background: rgba(255,255,255,0.06); }

/* ── Screens ── */
.gpxqr-screen {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
.gpxqr-active { display: flex !important; }

/* Scan screen scrollable */
#scan { overflow-y: auto; }
.gpxqr-screen:first-of-type { /* scan */
  align-items: center;
  justify-content: flex-start;
  padding: 16px;
  gap: 14px;
  overflow-y: auto;
}

/* ── Cards ── */
.gpxqr-card {
  width: 100%;
  max-width: 380px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 18px;
}
.gpxqr-card h2 { font-size: 15px; font-weight: 600; margin: 0 0 6px; }
.gpxqr-card p  { font-size: 12px; color: #8090c0; line-height: 1.5; margin: 0 0 14px; }

/* ── Video ── */
.gpxqr-video-wrap {
  display: none;
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: #0a0a14;
  margin-bottom: 12px;
}
.gpxqr-video-wrap video { width: 100%; height: 100%; object-fit: cover; }
.gpxqr-video-wrap .sc {
  position: absolute; width: 26px; height: 26px;
  border-style: solid; border-width: 0;
  border-color: var(--accent, #7c83ff);
}
.sc.tl { top:6px;left:6px;border-top-width:3px;border-left-width:3px;border-radius:3px 0 0 0 }
.sc.tr { top:6px;right:6px;border-top-width:3px;border-right-width:3px;border-radius:0 3px 0 0 }
.sc.bl { bottom:6px;left:6px;border-bottom-width:3px;border-left-width:3px;border-radius:0 0 0 3px }
.sc.br { bottom:6px;right:6px;border-bottom-width:3px;border-right-width:3px;border-radius:0 0 3px 0 }
.gpxqr-scanline {
  display: none;
  position: absolute; left: 10px; right: 10px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent, #7c83ff), transparent);
  animation: gpxqr-scan 2s linear infinite;
}
@keyframes gpxqr-scan { 0% { top: 10px } 100% { top: calc(100% - 12px) } }

/* ── Buttons ── */
.gpxqr-btn {
  width: 100%; padding: 9px;
  border: none; border-radius: 9px;
  font-size: 13px; font-weight: 600;
  cursor: pointer; display: flex;
  align-items: center; justify-content: center; gap: 6px;
}
.gpxqr-btn:active { opacity: 0.8; transform: scale(0.99); }
.gpxqr-btn-primary   { background: var(--accent, #7c83ff); color: #fff; }
.gpxqr-btn-secondary { background: rgba(255,255,255,0.07); color: #a0a8e0; border: 1px solid rgba(255,255,255,0.1); }
.gpxqr-btn-danger    { background: rgba(255,60,60,0.1); color: #f08080; border: 1px solid rgba(255,60,60,0.2); }
.gpxqr-btn-gps       { background: rgba(80,192,80,0.1); color: #80c880; border: 1px solid rgba(80,192,80,0.2); }
.gpxqr-btn-gps.gpxqr-gps-active { background: rgba(60,180,60,0.2); color: #50e050; }
.gpxqr-btn-sos {
  background: #e5484d;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  font-weight: 700;
  animation: gpxqr-sos-pulse 2s ease-in-out infinite;
}
.gpxqr-btn-sos:hover { background: #d43c41; }
.gpxqr-btn-sos:disabled { animation: none; opacity: .6; }
@keyframes gpxqr-sos-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229,72,77,0.5); }
  50%      { box-shadow: 0 0 0 6px rgba(229,72,77,0); }
}

/* ── Input / Label ── */
.gpxqr-label { font-size: 11px; color: #8090c0; display: block; margin-bottom: 6px; font-weight: 500; }
.gpxqr-input {
  width: 100%; background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  color: #e8eaf6; border-radius: 8px;
  padding: 9px 11px; font-size: 13px; outline: none;
}
.gpxqr-input:focus { border-color: var(--accent, #7c83ff); }

/* ── Divider ── */
.gpxqr-divider {
  display: flex; align-items: center; gap: 8px;
  width: 100%; max-width: 380px;
}
.gpxqr-divider::before,
.gpxqr-divider::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.08); }
.gpxqr-divider span { font-size: 11px; color: #4a5080; white-space: nowrap; }

/* ── QR result ── */
.gpxqr-qr-result { display: none; margin-top: 14px; text-align: center; }
.gpxqr-qr-result canvas { border-radius: 8px; background: #fff; padding: 8px; }
.gpxqr-qr-url { font-size: 11px; color: #6070a0; margin-top: 6px; word-break: break-all; }

/* ── Loading ── */
.gpxqr-screen[id$="-loading"] {
  align-items: center; justify-content: center; gap: 14px;
}
.gpxqr-spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent, #7c83ff);
  border-radius: 50%;
  animation: gpxqr-spin 0.8s linear infinite;
}
@keyframes gpxqr-spin { to { transform: rotate(360deg); } }
.gpxqr-loading-text { color: #8090c0; font-size: 13px; }

/* ── Map ── */
.gpxqr-screen[id$="-map"] { position: relative; }
.gpxqr-map { width: 100%; flex-shrink: 0; }

/* ── Bottom panel ── */
.gpxqr-panel {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(26,26,46,0.94);
  border-top: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(8px);
  z-index: 400;
}
.gpxqr-tabs { display: flex; border-bottom: 1px solid rgba(255,255,255,0.07); }
.gpxqr-tab {
  flex: 1; padding: 9px; font-size: 12px; font-weight: 500;
  text-align: center; cursor: pointer; background: none;
  border: none; color: #5060a0;
}
.gpxqr-tab-active { color: var(--accent, #7c83ff); border-bottom: 2px solid var(--accent, #7c83ff); }
.gpxqr-tab-content { padding: 8px 12px 10px; }

/* ── Track stats ── */
.gpxqr-track-name {
  font-size: 12px; font-weight: 600; margin-bottom: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #e8eaf6;
}
.gpxqr-stats { display: grid; grid-template-columns: repeat(5,1fr); gap: 4px; margin-bottom: 6px; }
.gpxqr-stat { background: rgba(0,0,0,0.25); border-radius: 6px; padding: 5px 2px; text-align: center; }
.gpxqr-stat .sv { display: block; font-size: 12px; font-weight: 700; color: var(--accent, #7c83ff); }
.gpxqr-stat .sl { display: block; font-size: 7.5px; color: #5060a0; margin-top: 0; line-height: 1.3; }

/* ── Progress ── */
.gpxqr-prog-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.gpxqr-prog-bg  { flex: 1; height: 5px; background: rgba(255,255,255,0.07); border-radius: 3px; overflow: hidden; }
.gpxqr-prog-fill { height: 100%; background: var(--accent, #7c83ff); border-radius: 3px; width: 0%; transition: width 0.5s ease; }
.gpxqr-prog-pct { font-size: 11px; font-weight: 700; color: var(--accent, #7c83ff); min-width: 32px; text-align: right; }

/* ── Elevation ── */
.gpxqr-elev-wrap { position: relative; height: 130px; }
.gpxqr-elev-wrap canvas { width: 100%; height: 100%; border-radius: 6px; cursor: crosshair; }

/* ── Toast ── */
.gpxqr-toast {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #2a1a1a; color: #f08080; padding: 9px 18px;
  border-radius: 10px; font-size: 13px; border: 1px solid rgba(255,100,100,0.3);
  z-index: 99999; max-width: 90%; text-align: center;
  opacity: 0; transition: opacity 0.2s, transform 0.2s; pointer-events: none;
}
.gpxqr-toast.gpxqr-toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Responsive ── */
@media (max-width: 480px) {
  .gpxqr-stats { grid-template-columns: repeat(3,1fr); }
}

/* ── Detail pills (header row) ── */
.gpxqr-detail-pills {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 6px 14px;
  background: rgba(0,0,0,0.2);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.gpxqr-pill {
  font-size: 11px; font-weight: 500;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 2px 10px; color: #c0c8f0;
}

/* ── Description tab ── */
.gpxqr-desc-tab {
  overflow-y: auto;
  max-height: 260px;
}
.gpxqr-description {
  font-size: 13px; line-height: 1.7; color: #c8d0e8;
  padding-bottom: 12px;
}
.gpxqr-description p  { margin: 0 0 10px; }
.gpxqr-description h2,
.gpxqr-description h3 { color: #e8eaf6; margin: 12px 0 6px; font-size: 14px; }
.gpxqr-description ul,
.gpxqr-description ol { padding-left: 18px; margin: 0 0 10px; }
.gpxqr-description a  { color: var(--accent, #7c83ff); }

/* ── Gallery strip ── */
.gpxqr-gallery-section { padding-top: 10px; }
.gpxqr-gallery-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 6px;
}
.gpxqr-gthumb {
  aspect-ratio: 1; border-radius: 6px; overflow: hidden;
  cursor: pointer; background: rgba(255,255,255,0.05);
  border: 2px solid transparent; transition: border-color .15s, transform .15s;
}
.gpxqr-gthumb:hover { border-color: var(--accent, #7c83ff); transform: scale(1.04); }
.gpxqr-gthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── Lightbox ── */
.gpxqr-lightbox {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(0,0,0,0.95);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  /* No backdrop-filter here — keeps stacking context clean */
}
.gpxqr-lb-img {
  max-width: 92vw; max-height: 78vh;
  border-radius: 8px; object-fit: contain;
  box-shadow: 0 4px 40px rgba(0,0,0,.6);
}
.gpxqr-lb-close {
  position: absolute; top: 14px; right: 18px;
  background: none; border: none; color: #fff;
  font-size: 28px; cursor: pointer; line-height: 1; padding: 4px 8px;
}
.gpxqr-lb-prev,
.gpxqr-lb-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.12); border: none; color: #fff;
  font-size: 32px; cursor: pointer; padding: 8px 14px;
  border-radius: 6px; line-height: 1;
}
.gpxqr-lb-prev { left: 12px; }
.gpxqr-lb-next { right: 12px; }
.gpxqr-lb-prev:hover,
.gpxqr-lb-next:hover { background: rgba(255,255,255,0.25); }
.gpxqr-lb-counter {
  position: absolute; bottom: 18px;
  color: rgba(255,255,255,.6); font-size: 13px;
}

/* ── Activity pills (distinct style) ── */
.gpxqr-pill-activity {
  background: rgba(80,192,130,0.12);
  border-color: rgba(80,192,130,0.25);
  color: #80e8b0;
}

/* ── Off-track badge ── */
.gpxqr-offtrack-badge {
  display: none;
  align-items: center;
  gap: 6px;
  background: rgba(255,149,0,0.15);
  border: 1px solid rgba(255,149,0,0.35);
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #ffb340;
  animation: gpxqr-pulse 2s ease-in-out infinite;
}
.gpxqr-offtrack-icon { font-size: 14px; }
@keyframes gpxqr-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

/* ── Live stats row ── */
.gpxqr-stats-live { margin-top: 6px; }
.gpxqr-stat-bearing .sv { display: flex; align-items: center; justify-content: center; }
.gpxqr-bearing-arrow {
  display: inline-block;
  font-size: 18px;
  transition: transform 0.4s ease;
  line-height: 1;
}

/* ── GPS row (button + icon buttons) ── */
.gpxqr-gps-row {
  display: flex; gap: 5px; align-items: stretch; margin-bottom: 6px;
}
.gpxqr-gps-row:last-child { margin-bottom: 0; }
.gpxqr-gps-row .gpxqr-btn-gps { flex: 1; }

.gpxqr-icon-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 9px;
  color: #a0a8e0;
  font-size: 15px;
  width: 36px; min-width: 36px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  transition: background .15s;
}
.gpxqr-icon-btn:active { opacity: 0.7; }
.gpxqr-icon-btn-active {
  background: rgba(124,131,255,0.2);
  border-color: var(--accent, #7c83ff);
  color: var(--accent, #7c83ff);
}

/* ── Share modal ── */
.gpxqr-share-modal {
  position: fixed; inset: 0; z-index: 99998;
  background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.gpxqr-share-box {
  background: #1a1a2e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 20px;
  width: 100%; max-width: 300px;
  display: flex; flex-direction: column; gap: 12px;
}
.gpxqr-share-header {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 14px; font-weight: 600; color: #e8eaf6;
}
.gpxqr-share-header button {
  background: none; border: none; color: #8090c0;
  font-size: 18px; cursor: pointer; padding: 0;
}
.gpxqr-share-url {
  font-size: 10px; color: #6070a0;
  word-break: break-all;
  background: rgba(0,0,0,0.3);
  border-radius: 6px; padding: 6px 8px;
  max-height: 48px; overflow: hidden;
}

/* ── Lock button pulse when unlocked ── */
#gpxqr-lockBtn:not(.gpxqr-icon-btn-active) {
  animation: gpxqr-lock-pulse 2s ease-in-out infinite;
}
@keyframes gpxqr-lock-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

/* ── Fullscreen button (on map) ── */
.gpxqr-fs-btn {
  position: absolute;
  top: 10px; right: 10px;
  z-index: 410;
  width: 36px; height: 36px;
  background: rgba(26,26,46,0.88);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: #e8eaf6;
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  transition: background .15s;
}
.gpxqr-fs-btn:hover { background: rgba(124,131,255,0.3); }
.gpxqr-fs-btn:active { opacity: 0.7; }
.gpxqr-3d-btn {
  top: 52px;
  font-size: 13px;
  font-weight: 800;
}

/* ── HUD overlay ── */
.gpxqr-hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 405;
  display: flex;
  flex-direction: column;
  gap: 0;
  pointer-events: none;
}

/* Top row: 5 stat pills */
.gpxqr-hud > .gpxqr-hud-item {
  /* arranged in a row via flex on parent — override below */
}
.gpxqr-hud {
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  background: rgba(15,17,23,0.78);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 6px 8px 4px;
  gap: 4px;
}

.gpxqr-hud-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 0;
}
.gpxqr-hud-val {
  font-size: 20px;
  font-weight: 700;
  color: #e8eaf6;
  line-height: 1.1;
  white-space: nowrap;
}
.gpxqr-hud-lbl {
  font-size: 11px;
  color: #6070a0;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.gpxqr-hud-arrow {
  display: inline-block;
  transition: transform 0.3s ease;
  font-size: 20px;
}

/* Progress bar inside HUD — full width below the row */
.gpxqr-hud-prog {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(255,255,255,0.08);
  pointer-events: none;
  display: flex; align-items: center;
}
.gpxqr-hud-prog-fill {
  height: 100%;
  background: var(--accent, #7c83ff);
  width: 0%;
  transition: width 0.5s ease;
  border-radius: 0 2px 2px 0;
}
.gpxqr-hud-prog-pct {
  position: absolute;
  right: 4px;
  font-size: 8px;
  color: rgba(255,255,255,0.4);
  line-height: 1;
}

/* Fullscreen: map fills everything */
.gpxqr-screen:-webkit-full-screen { height: 100vh !important; }
.gpxqr-screen:fullscreen           { height: 100vh !important; }
.gpxqr-screen:fullscreen .gpxqr-map,
.gpxqr-screen:-webkit-full-screen .gpxqr-map { height: 100% !important; }

/* ── Fullscreen: HUD отдолу на картата ── */
.gpxqr-hud {
  /* По подразбиране е отгоре — при fullscreen го местим отдолу чрез order */
  order: 3;
}

/* В fullscreen панелът е компактен — само табовете + активното съдържание */
.gpxqr-panel-fs {
  order: 2;
  max-height: 52vh;   /* достатъчно за описание + галерия */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* При fullscreen: map screen е flex-column */
#gpxqr-map-screen-wrap,
.gpxqr-screen[id$="-map"] {
  display: flex;
  flex-direction: column;
}

/* HUD при fullscreen — отдолу, по-малък шрифт */
.gpxqr-panel-fs ~ * .gpxqr-hud,
.gpxqr-hud[style*="flex"] {
  order: 3;
}

/* Компактен панел при fullscreen — по-малки табове и съдържание */
.gpxqr-panel-fs .gpxqr-tab {
  font-size: 10px;
  padding: 6px 4px;
}
.gpxqr-panel-fs .gpxqr-track-name { font-size: 11px; margin-bottom: 6px; }
.gpxqr-panel-fs .gpxqr-stats      { gap: 4px; margin-bottom: 6px; }
.gpxqr-panel-fs .gpxqr-stat       { padding: 5px 3px; border-radius: 5px; }
.gpxqr-panel-fs .sv               { font-size: 11px; }
.gpxqr-panel-fs .sl               { font-size: 8px; }
.gpxqr-panel-fs .gpxqr-stats-live { margin-top: 4px; }
.gpxqr-panel-fs .gpxqr-prog-row   { margin-bottom: 6px; }
.gpxqr-panel-fs .gpxqr-prog-pct   { font-size: 10px; }
.gpxqr-panel-fs .gpxqr-btn        { padding: 8px; font-size: 11px; }
.gpxqr-panel-fs .gpxqr-icon-btn   { width: 34px; min-width: 34px; font-size: 15px; }
.gpxqr-panel-fs .gpxqr-tab-content { padding: 8px 10px; }
.gpxqr-panel-fs .gpxqr-description { font-size: 11px; line-height: 1.5; }
.gpxqr-panel-fs .gpxqr-desc-tab    { max-height: none; overflow-y: visible; }
.gpxqr-panel-fs .gpxqr-gthumb     { /* галерията остава нормална */ }
.gpxqr-panel-fs .gpxqr-offtrack-badge { font-size: 10px; padding: 4px 8px; }

/* HUD отдолу — по-малък шрифт */
.gpxqr-hud {
  position: relative;  /* не absolute — в нормален flow при fullscreen */
  top: auto; left: auto; right: auto;
}
/* Когато е показан (fullscreen активен) — стилове за долната лента */
.gpxqr-hud[style*="flex"] {
  border-top: 1px solid rgba(255,255,255,0.08);
  border-bottom: none;
  padding: 4px 6px 6px;
}
.gpxqr-hud[style*="flex"] .gpxqr-hud-val  { font-size: 20px; }
.gpxqr-hud[style*="flex"] .gpxqr-hud-lbl  { font-size: 11px; }
.gpxqr-hud[style*="flex"] .gpxqr-hud-arrow { font-size: 20px; }
.gpxqr-hud-prog { bottom: auto; top: 0; }

/* ── Presence badge ── */
.gpxqr-presence-badge {
  font-size: 11px; font-weight: 600;
  background: rgba(255,107,205,0.15);
  border: 1px solid rgba(255,107,205,0.3);
  color: #ff6bcd; border-radius: 20px;
  padding: 2px 8px;
  animation: gpxqr-pulse 2s ease-in-out infinite;
}

/* ── Layer controls (selectable chips with stats) ── */
.gpxqr-layer-controls {
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
}
.gpxqr-layer-controls:empty { display: none; padding: 0; margin: 0; border: none; }
.gpxqr-layer-controls-title {
  font-size: 11px; font-weight: 600;
  color: #8090c0; margin-bottom: 8px;
  text-transform: uppercase; letter-spacing: 0.4px;
}
.gpxqr-layer-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.gpxqr-layer-chip {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: #c0c8e8;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 5px 10px 5px 8px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  font-family: inherit;
}
.gpxqr-layer-chip:hover {
  background: rgba(255,255,255,0.1);
}
.gpxqr-layer-chip-active {
  background: rgba(124,131,255,0.18);
  border-color: var(--accent, #7c83ff);
  color: #fff;
  font-weight: 600;
}
.gpxqr-layer-dot {
  width: 11px; height: 11px;
  border-radius: 50%; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.35);
}
.gpxqr-layer-vis {
  font-size: 12px;
  margin-left: 2px;
  opacity: 0.7;
  cursor: pointer;
}
.gpxqr-layer-vis:hover { opacity: 1; }

/* ── POI markers ── */
.gpxqr-poi-marker { background: none; border: none; }
.gpxqr-poi-pin {
  width: 32px; height: 32px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.gpxqr-poi-pin span {
  transform: rotate(45deg);
  font-size: 15px;
  line-height: 1;
}

/* ── POI popup ── */
.gpxqr-poi-popup-wrap .leaflet-popup-content-wrapper {
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
}
.gpxqr-poi-popup-wrap .leaflet-popup-content {
  margin: 0; width: 220px !important;
}
.gpxqr-poi-popup-img {
  width: 100%; height: 120px;
  object-fit: cover; display: block;
}
.gpxqr-poi-popup-body { padding: 10px 12px; }
.gpxqr-poi-popup-title {
  font-size: 13px; font-weight: 700;
  color: #1a1a3a; margin-bottom: 4px;
}
.gpxqr-poi-popup-desc {
  font-size: 12px; color: #666; line-height: 1.4;
}

/* ── 360° badge on POI pin ── */
.gpxqr-poi-360-badge {
  position: absolute;
  top: -6px; right: -8px;
  background: #6c5ce7;
  color: #fff;
  font-size: 7px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
  line-height: 1.4;
  border: 1px solid #fff;
}
.gpxqr-poi-pin { position: relative; }

/* ── 360° view button in popup ── */
.gpxqr-poi-360-btn {
  display: block; width: 100%; margin-top: 8px;
  padding: 8px; border: none; border-radius: 8px;
  background: linear-gradient(135deg, #6c5ce7, #a29bfe);
  color: #fff; font-size: 13px; font-weight: 600;
  cursor: pointer; text-align: center;
}
.gpxqr-poi-360-btn:hover { opacity: 0.9; }

/* ── POI top overlay card (заменя leaflet попъпа) ── */
.gpxqr-poi-topcard {
  position: absolute;
  top: 10px; left: 12px; right: 56px; /* оставя място за .gpxqr-fs-btn вдясно */
  z-index: 460; /* над HUD (405) и fs-btn (410) */
  display: none;
  align-items: center;
  gap: 10px;
  background: rgba(20,20,25,0.92);
  backdrop-filter: blur(6px);
  border-radius: 14px;
  padding: 8px 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
  color: #fff;
}
.gpxqr-poi-topcard-nav {
  flex: 0 0 auto;
  width: 32px; height: 32px;
  border: none; border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 19px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.gpxqr-poi-topcard-nav:hover { background: rgba(255,255,255,0.22); }
.gpxqr-poi-topcard-thumb {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.gpxqr-poi-topcard-body { flex: 1 1 auto; min-width: 0; }
.gpxqr-poi-topcard-cat {
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #aaa;
  font-weight: 600;
}
.gpxqr-poi-topcard-name {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gpxqr-poi-topcard-dist {
  font-size: 17px;
  font-weight: 800;
  color: #ffd43b;
  margin-top: 1px;
}
.gpxqr-poi-topcard-mode {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: #bbb;
  margin-left: 6px;
  vertical-align: middle;
}
.gpxqr-poi-topcard-actions { margin-top: 2px; }
.gpxqr-poi-topcard-link {
  display: inline-block;
  background: none; border: none;
  color: #a29bfe;
  font-size: 11px; font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  padding: 0;
}
.gpxqr-poi-topcard-link:hover { text-decoration: underline; }
.gpxqr-poi-topcard-close {
  flex: 0 0 auto;
  width: 24px; height: 24px;
  border: none; border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: #ccc;
  font-size: 12px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.gpxqr-poi-topcard-close:hover { background: rgba(255,255,255,0.22); color: #fff; }

/* ── 360° modal ── */
.gpxqr-360-modal {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(0,0,0,0.92);
  display: none;
  flex-direction: column;
  align-items: stretch;
}
.gpxqr-360-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: rgba(0,0,0,0.6);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.gpxqr-360-title {
  font-size: 15px; font-weight: 600; color: #fff;
  font-family: system-ui, sans-serif;
}
.gpxqr-360-close {
  background: none; border: none; color: #aaa;
  font-size: 22px; cursor: pointer; padding: 0 4px;
  line-height: 1;
}
.gpxqr-360-close:hover { color: #fff; }
#gpxqr-360-viewer {
  flex: 1;
  width: 100%;
  min-height: 0;
}

/* ── Turn-by-turn HUD indicator ── */
.gpxqr-hud-turn {
  display: none;
  align-items: center;
  gap: 4px;
  background: rgba(124,131,255,0.25);
  border: 1px solid rgba(124,131,255,0.4);
  border-radius: 8px;
  padding: 4px 10px;
  margin-left: auto;
  flex-shrink: 0;
}
.gpxqr-hud-turn-arrow {
  font-size: 22px;
  line-height: 1;
}
.gpxqr-hud-turn-dist {
  font-size: 13px;
  font-weight: 700;
  color: #e8eaf6;
  white-space: nowrap;
}

/* ── Elevation map tooltip ── */
.gpxqr-elev-map-tip {
  background: rgba(15, 17, 23, 0.92) !important;
  border: 1px solid rgba(255, 215, 0, 0.6) !important;
  border-radius: 6px !important;
  color: #ffd700 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  padding: 4px 10px !important;
  white-space: nowrap !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5) !important;
}
.gpxqr-elev-map-tip::before { display: none !important; }
