/* ──────────────────────────────────────────
   Photo Map — Stylesheet
   ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sidebar-w:    300px;
  --bg-dark:      #1e293b;
  --bg-darker:    #0f172a;
  --bg-card:      #334155;
  --border:       #475569;
  --accent:       #3b82f6;
  --accent-h:     #2563eb;
  --amber:        #f59e0b;
  --amber-h:      #d97706;
  --danger:       #ef4444;
  --danger-h:     #dc2626;
  --success:      #22c55e;
  --text-1:       #f8fafc;
  --text-2:       #94a3b8;
  --radius:       10px;
  --shadow:       0 4px 24px rgba(0,0,0,.35);
}

html, body { height: 100%; font-family: 'Segoe UI', Tahoma, sans-serif; }

body {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: #e2e8f0;
}

/* ── Sidebar ───────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  background: var(--bg-dark);
  color: var(--text-1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
  z-index: 200;
  box-shadow: 3px 0 12px rgba(0,0,0,.4);
}

.sidebar-header {
  padding: 18px 16px 14px;
  background: var(--bg-darker);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-header h1 { font-size: 1.25rem; font-weight: 700; letter-spacing: .4px; }
.version { font-size: .7rem; color: var(--text-2); }

.sidebar-section {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.section-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-2);
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hidden { display: none !important; }

/* ── Map ───────────────────────────────── */
#map { flex: 1; height: 100vh; }

/* ── Buttons ───────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border: none;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, transform .1s;
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-primary   { background: var(--accent);  color: #fff; width: 100%; }
.btn-primary:hover  { background: var(--accent-h); }

.btn-secondary { background: var(--bg-card); color: var(--text-1); }
.btn-secondary:hover { background: #475569; }

.btn-accent    { background: var(--amber);  color: #fff; width: 100%; }
.btn-accent:hover  { background: var(--amber-h); }

.btn-danger    { background: var(--danger); color: #fff; width: 100%; }
.btn-danger:hover  { background: var(--danger-h); }

.btn-export        { background: #0f766e; color: #fff; width: 100%; }
.btn-export:hover  { background: #0d9488; }
.btn-export-folder { background: #1d4ed8; color: #fff; width: 100%; }
.btn-export-folder:hover { background: #2563eb; }

.btn-mode-view { background: #475569; color: #fff; width: 100%; }
.btn-mode-view:hover { background: #334155; }
.btn-mode-edit { background: var(--amber); color: #fff; width: 100%; }
.btn-mode-edit:hover { background: var(--amber-h); }

/* ── View mode: nascondi controlli di editing ───── */
body.view-mode .edit-only   { display: none !important; }
body.view-mode #add-marker-hint { display: none !important; }

/* Popup con solo "Apri" in view mode: centra il bottone */
body.view-mode .popup-actions { justify-content: center; }

.btn-sm { padding: 6px 10px; font-size: .8rem; width: auto; }

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px 7px;
  border-radius: 6px;
  font-size: 1.1rem;
  color: var(--text-2);
  transition: background .15s;
}
.btn-icon:hover { background: rgba(255,255,255,.1); }

/* ── Track stats ───────────────────────── */
.track-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--bg-darker);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
}
.stat-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .8rem;
  color: var(--text-1);
}
.stat-icon { font-size: .95rem; flex-shrink: 0; }

/* Route actions */
.route-actions { display: flex; flex-direction: column; gap: 7px; }
.route-actions label.btn { cursor: pointer; text-align: center; }

/* ── Route list ────────────────────────── */
.route-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
  margin-bottom: 3px;
}
.route-item:hover  { background: var(--bg-card); }
.route-item.active { background: var(--accent); }
.route-item .ri-name {
  flex: 1;
  font-size: .88rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Marker list ───────────────────────── */
.marker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s;
  margin-bottom: 3px;
  border-left: 3px solid transparent;
}
.marker-item:hover { background: var(--bg-card); }
.marker-item[draggable="true"] { cursor: grab; }
.marker-item.dragging   { opacity: .35; cursor: grabbing; }
.marker-item.drag-over-marker { border-left-color: #8b5cf6; background: rgba(139,92,246,.12); }

.marker-info { flex: 1; min-width: 0; }
.marker-info .mi-name {
  display: block;
  font-size: .87rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.marker-info .mi-count { font-size: .74rem; color: var(--text-2); }

.mi-num {
  width: 22px; height: 22px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700;
  flex-shrink: 0;
}

/* Number badge in popup */
.popup-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px;
  background: var(--accent);
  color: #fff; border-radius: 50%;
  font-size: .7rem; font-weight: 700;
  margin-right: 4px; vertical-align: middle; flex-shrink: 0;
}

.empty-msg { font-size: .82rem; color: var(--text-2); padding: 4px 0; text-align: center; }

/* ── Hint bar ──────────────────────────── */
.hint-bar {
  position: fixed;
  bottom: 22px;
  left: calc(var(--sidebar-w) + 50%);
  transform: translateX(-50%);
  background: var(--bg-darker);
  color: var(--text-1);
  padding: 10px 18px;
  border-radius: 24px;
  font-size: .88rem;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 1000;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

/* ── Modals ────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
  backdrop-filter: blur(2px);
}
.modal-content {
  background: #fff;
  border-radius: var(--radius);
  padding: 26px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,.35);
  animation: pop-in .18s ease;
}
@keyframes pop-in { from { transform: scale(.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-content h2 { font-size: 1.15rem; color: #1e293b; margin-bottom: 16px; }

.input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: .9rem;
  margin-bottom: 12px;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
  background: #f8fafc;
  color: #1e293b;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
textarea.input { resize: vertical; min-height: 80px; }

.modal-actions { display: flex; gap: 8px; }
.modal-actions .btn { flex: 1; }
.modal-actions .btn-secondary { background: #f1f5f9; color: #475569; }
.modal-actions .btn-secondary:hover { background: #e2e8f0; }

/* ── Carousel modal ────────────────────── */
.modal-carousel {
  max-width: 860px;
  padding: 0;
  overflow: hidden;
}

.carousel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #e2e8f0;
  gap: 10px;
}
.carousel-title-block { flex: 1; min-width: 0; }
.carousel-title-block h2 { font-size: 1.05rem; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0 0 2px; }
.carousel-counter { font-size: .78rem; color: #64748b; font-weight: 600; }

.carousel-header-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.carousel-header-actions label.btn { cursor: pointer; }

.carousel-body { padding: 14px 18px 18px; }

/* Drop zone (empty) */
.carousel-drop-zone {
  text-align: center;
  padding: 50px 20px;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius);
  color: #94a3b8;
  transition: border-color .2s, background .2s;
}
.carousel-drop-zone.drag-over { border-color: var(--accent); background: rgba(59,130,246,.05); }
.drop-icon { font-size: 2.5rem; margin-bottom: 10px; }
.carousel-drop-zone p { font-size: .9rem; line-height: 1.6; }

/* Stage */
.carousel-stage {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.carousel-media-wrap {
  position: relative;
  flex: 1;
  background: #0f172a;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  max-height: 55vh;
}
.carousel-media {
  max-width: 100%;
  max-height: 55vh;
  object-fit: contain;
  display: block;
}

.carousel-nav {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  border: none;
  background: #e2e8f0;
  color: #1e293b;
  font-size: 1.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  line-height: 1;
}
.carousel-nav:hover { background: #cbd5e1; }

/* Caption row */
.carousel-caption-row {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 10px;
}
.carousel-caption-row .input { flex: 1; margin: 0; padding: 7px 10px; font-size: .84rem; }

/* Dots */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
}
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
  cursor: pointer;
  transition: background .15s, transform .15s;
  border: none;
}
.dot.active { background: var(--accent); transform: scale(1.35); }

/* Thumbnails */
.carousel-thumbs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-behavior: smooth;
}
.carousel-thumbs::-webkit-scrollbar { height: 4px; }
.carousel-thumbs::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }

.thumb {
  width: 64px; height: 64px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 2.5px solid transparent;
  transition: border-color .15s, transform .1s;
  background: #e2e8f0;
}
.thumb:hover { transform: scale(1.06); }
.thumb.active { border-color: var(--accent); }
.thumb[draggable="true"] { cursor: grab; }
.thumb.dragging  { opacity: .3; cursor: grabbing; transform: scale(.95); }
.thumb.drag-over { border-color: #8b5cf6 !important; transform: scale(1.12); box-shadow: 0 0 0 3px rgba(139,92,246,.35); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .video-icon {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: #1e293b; color: #fff; font-size: 1.4rem;
}

/* ── Language switcher ───────────────────── */
#lang-switcher {
  display: flex;
  gap: 3px;
  background: rgba(255,255,255,.92);
  border-radius: 20px;
  padding: 4px 6px;
  box-shadow: 0 2px 10px rgba(0,0,0,.2);
  border: 1px solid #e2e8f0;
}
.lang-btn {
  background: none;
  border: none;
  cursor: pointer;
  width: 32px; height: 30px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, transform .1s;
  opacity: .55;
  padding: 0;
}
.lang-btn img { border-radius: 2px; display: block; width: 24px; height: 16px; object-fit: cover; }
.lang-btn:hover  { opacity: 1; background: #f1f5f9; }
.lang-btn.active { opacity: 1; background: #e0f2fe; transform: scale(1.15); box-shadow: 0 0 0 2px var(--accent); }

/* ── Map search box ───────────────────── */
#map-search-box {
  position: absolute;
  top: 12px;
  left: calc(var(--sidebar-w) + 50px);
  z-index: 500;
  width: 300px;
}
#map-search-wrap {
  display: flex;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
  overflow: hidden;
  border: 1.5px solid #e2e8f0;
}
#map-search-input {
  flex: 1;
  padding: 9px 14px;
  border: none;
  font-size: .88rem;
  background: transparent;
  color: #1e293b;
  outline: none;
  font-family: inherit;
}
#map-search-btn {
  padding: 0 14px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: background .15s;
  flex-shrink: 0;
}
#map-search-btn:hover { background: var(--accent-h); }
#map-search-results {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  margin-top: 5px;
  overflow: hidden;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
}
#map-search-results li {
  list-style: none;
  padding: 9px 14px;
  font-size: .84rem;
  color: #1e293b;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  line-height: 1.35;
  transition: background .12s;
}
#map-search-results li:last-child { border-bottom: none; }
#map-search-results li:hover { background: #f0f9ff; }
#map-search-results li .sr-type { font-size: .72rem; color: #94a3b8; display: block; }
#map-search-results .sr-empty { color: #94a3b8; font-style: italic; cursor: default; }
#map-search-results .sr-empty:hover { background: none; }
.search-pin {
  width: 12px; height: 12px;
  background: #8b5cf6;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(139,92,246,.35);
}

/* ── Map popup ─────────────────────────── */
.leaflet-popup-content-wrapper { border-radius: 10px !important; padding: 0 !important; overflow: hidden; }
.leaflet-popup-content { margin: 0 !important; }

.map-popup {
  min-width: 190px;
  padding: 12px 14px;
  font-family: 'Segoe UI', sans-serif;
}
.map-popup strong { display: block; font-size: .95rem; color: #0f172a; margin-bottom: 4px; }
.map-popup p     { font-size: .82rem; color: #64748b; margin-bottom: 3px; line-height: 1.4; }
.map-popup .media-badge { color: var(--accent); font-weight: 600; font-size: .8rem; margin-bottom: 8px; }
.popup-actions { display: flex; gap: 5px; }
.popup-btn {
  flex: 1;
  padding: 5px 4px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  cursor: pointer;
  font-size: .78rem;
  transition: background .15s;
  text-align: center;
}
.popup-btn:hover { background: #e2e8f0; }
.popup-btn.danger { color: var(--danger); }
.popup-btn.danger:hover { background: #fee2e2; }

/* ── Custom map marker ─────────────────── */
.map-pin {
  width: 34px; height: 34px;
  background: var(--accent);
  border: 2.5px solid #fff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
  position: relative;
}
.map-pin.has-media { background: var(--amber); }
.pin-icon { transform: rotate(45deg); font-size: .95rem; line-height: 1; }
.pin-num  { transform: rotate(45deg); font-size: .78rem; font-weight: 800; line-height: 1; color: #fff; letter-spacing: -.5px; }
.pin-badge {
  position: absolute;
  top: -9px; right: -9px;
  transform: rotate(45deg);
  background: var(--accent);
  color: #fff;
  font-size: .62rem; font-weight: 700;
  width: 17px; height: 17px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}
.map-pin.has-media .pin-badge { background: var(--amber); }

/* ── Fullscreen overlay ─────────────────── */
.btn-fullscreen {
  position: absolute;
  bottom: 8px; right: 8px;
  width: 32px; height: 32px;
  background: rgba(0,0,0,.55);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity .2s, background .15s;
  z-index: 10;
}
.carousel-media-wrap:hover .btn-fullscreen { opacity: 1; }
.btn-fullscreen:hover { background: rgba(0,0,0,.8); }

.fs-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.96);
  z-index: 5000;
  display: flex; align-items: center; justify-content: center;
  animation: fadein .15s;
}
.fs-overlay.hidden { display: none !important; }

.fs-stage {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: calc(100vw - 120px);
  height: calc(100vh - 90px);
  overflow: hidden;
}
.fs-stage img {
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  display: block;
  cursor: zoom-in;
  transition: transform .25s ease;
  transform-origin: center center;
  user-select: none;
}
.fs-stage img.zoomed { cursor: zoom-out; }
.fs-stage video { max-width: 100%; max-height: 100%; display: block; }

.fs-close {
  position: fixed; top: 14px; right: 18px;
  background: rgba(255,255,255,.12);
  border: none; color: #fff;
  width: 40px; height: 40px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
  z-index: 5001;
}
.fs-close:hover { background: rgba(255,255,255,.25); }

.fs-nav {
  position: fixed; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.12);
  border: none; color: #fff;
  width: 46px; height: 46px;
  border-radius: 50%;
  font-size: 2rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
  z-index: 5001;
  line-height: 1;
}
.fs-nav:hover { background: rgba(255,255,255,.28); }
.fs-prev { left: 12px; }
.fs-next { right: 12px; }

.fs-caption {
  position: fixed; bottom: 36px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.85);
  font-size: .9rem;
  max-width: 70vw;
  text-align: center;
  pointer-events: none;
}
.fs-counter {
  position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.5);
  font-size: .78rem;
  pointer-events: none;
}

/* ── Loading overlay ───────────────────── */
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
.spinner {
  width: 48px; height: 48px;
  border: 4px solid rgba(255,255,255,.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ─────────────────────────────── */
.toast {
  position: fixed;
  bottom: 28px;
  left: calc(var(--sidebar-w) + 50%);
  transform: translateX(-50%) translateY(16px);
  padding: 10px 22px;
  border-radius: 24px;
  font-size: .87rem;
  color: #fff;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  z-index: 9998;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-success { background: #22c55e; }
.toast-error   { background: #ef4444; }
.toast-warning { background: #f59e0b; }
.toast-info    { background: #3b82f6; }

/* ── Scrollbars ────────────────────────── */
#sidebar::-webkit-scrollbar { width: 5px; }
#sidebar::-webkit-scrollbar-track { background: var(--bg-darker); }
#sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Auth page ─────────────────────────── */
body.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 24px 64px rgba(0,0,0,.4);
}
.auth-card h1 { font-size: 1.4rem; color: #1e293b; margin-bottom: 4px; }
.auth-sub { color: #64748b; font-size: .9rem; margin-bottom: 20px; }
.auth-tabs { display: flex; gap: 4px; margin-bottom: 16px; background: #f1f5f9; padding: 4px; border-radius: 8px; }
.auth-tab {
  flex: 1; border: none; background: transparent; padding: 8px;
  border-radius: 6px; cursor: pointer; font-weight: 600; color: #64748b;
}
.auth-tab.active { background: #fff; color: #1e293b; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.auth-form .input { margin-bottom: 10px; background: #fff; }
.auth-submit { width: 100%; margin-top: 4px; }
.auth-error { color: var(--danger); font-size: .85rem; margin-top: 12px; text-align: center; }

/* ── User bar ──────────────────────────── */
.sidebar-header { flex-wrap: wrap; gap: 8px; }
.user-bar { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 4px; }

.account-section { margin-top: auto; border-top: 1px solid var(--border); }
.account-actions { display: flex; flex-direction: column; gap: 6px; }
.account-actions .btn { width: 100%; text-align: center; justify-content: center; }

.modal-warn {
  font-size: .9rem;
  line-height: 1.45;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.user-name { font-size: .78rem; color: var(--text-2); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Share panel ───────────────────────── */
.share-panel {
  margin-top: 8px;
  padding: 10px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.share-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: .84rem;
  color: var(--text-1);
}
.share-toggle input { width: 16px; height: 16px; accent-color: var(--accent); }
.share-hint { font-size: .72rem; color: var(--text-2); margin: 6px 0 8px; line-height: 1.4; }
.share-link-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.share-friendly-link {
  flex: 1 1 100%;
  display: block;
  font-size: .95rem;
  font-weight: 600;
  color: #93c5fd;
  text-decoration: none;
  line-height: 1.35;
  word-break: break-word;
}
.share-friendly-link:hover { text-decoration: underline; color: #bfdbfe; }
.share-link-input { flex: 1; margin: 0 !important; padding: 6px 8px !important; font-size: .72rem !important; background: #0f172a !important; color: var(--text-2) !important; border-color: var(--border) !important; }

/* ── Public view page ──────────────────── */
body.view-page { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.view-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; background: var(--bg-darker); color: var(--text-1);
  border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.view-header h1 { font-size: 1.1rem; margin: 0; }
.view-badge {
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  background: rgba(59,130,246,.2); color: #93c5fd; padding: 4px 8px; border-radius: 999px;
}
body.view-page #map { flex: 1; height: auto; }
.carousel-caption-readonly {
  text-align: center; color: #475569; font-size: .88rem;
  min-height: 1.4em; margin-bottom: 10px; padding: 0 4px;
}

/* Lang switcher on auth / view pages — see tutorial.css (.auth-tools, .lang-switcher-view) */
