/* ── Design tokens ─────────────────────────────────────────────────────────── */

:root {
  color-scheme: light dark;

  /* Neutrals */
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-alt: #f2ede3;
  --border: rgba(20, 18, 12, 0.10);
  --text: #1f1d17;
  --text-muted: #6a655a;
  --text-inverse: #f7f3ea;

  /* Ocean theme (Galápagos default): warm sand + pacific + ochre */
  --accent: #1a6b7f;
  --accent-hover: #145566;
  --warm: #c8891f;
  --shadow: 0 12px 40px -12px rgba(20, 18, 12, 0.25);

  /* Typography */
  --font-serif: "Fraunces", "Playfair Display", Georgia, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

  /* Spacing scale */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px;  --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;  --sp-8: 64px; --sp-9: 96px;

  /* Radius */
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-xl: 24px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16150f;
    --surface: #201e17;
    --surface-alt: #2a2820;
    --border: rgba(240, 236, 222, 0.10);
    --text: #f0ecde;
    --text-muted: #a9a397;
    --text-inverse: #16150f;
    --accent: #4fb3c8;
    --accent-hover: #6cc0d2;
    --warm: #e3a749;
    --shadow: 0 12px 40px -12px rgba(0, 0, 0, 0.5);
  }
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
}
p { margin: 0; }
a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent-hover); }
button { font-family: inherit; }
img { display: block; max-width: 100%; }

.loading, .empty { color: var(--text-muted); padding: var(--sp-6); text-align: center; }

/* ── Landing ───────────────────────────────────────────────────────────────── */

.landing { max-width: 960px; margin: 0 auto; padding: var(--sp-8) var(--sp-5); }

.landing-header { margin-bottom: var(--sp-8); text-align: center; }
.wordmark {
  display: inline-flex; align-items: center; gap: var(--sp-3);
  font-family: var(--font-serif); font-size: 32px; font-weight: 600;
  letter-spacing: -0.02em;
}
.wordmark-mark { color: var(--warm); font-size: 24px; }
.landing-tagline {
  margin-top: var(--sp-3); color: var(--text-muted);
  font-style: italic; font-family: var(--font-serif); font-size: 18px;
}

.trip-sort { display: flex; justify-content: flex-end; margin-bottom: var(--sp-4); }
.sort-btn {
  font-family: var(--font-serif); font-size: 14px; color: var(--text-muted);
  background: transparent; border: 1px solid var(--border, rgba(255,255,255,.18));
  border-radius: 999px; padding: 6px 14px; cursor: pointer;
  transition: color .15s, border-color .15s;
}
.sort-btn:hover { color: var(--text); border-color: currentColor; }

.trip-cards { display: grid; gap: var(--sp-5); }

.trip-card {
  position: relative;
  display: block;
  min-height: 240px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--warm) 100%);
  border-radius: var(--r-lg);
  overflow: hidden;
  color: var(--text-inverse);
  box-shadow: var(--shadow);
  transition: transform 0.25s, box-shadow 0.25s;
}
.trip-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 50px -12px rgba(20, 18, 12, 0.35);
}
.trip-card-cover {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  display: block;
}
.trip-card-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
}
.trip-card-body {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: var(--sp-6);
}
.trip-card-title {
  color: #fff;
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 800;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.trip-card-subtitle {
  color: rgba(255, 255, 255, 0.85);
  font-size: 15px;
  margin-top: var(--sp-2);
  text-shadow: 0 1px 6px rgba(0,0,0,0.4);
}

/* ── Login card ────────────────────────────────────────────────────────────── */

.login-page {
  min-height: 100vh;
  display: grid; place-items: center;
  position: relative;
  padding: var(--sp-5);
  overflow: hidden;
}
.login-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: blur(24px) brightness(0.6);
  transform: scale(1.1);
  z-index: 0;
}
.login-bg-fallback {
  background: linear-gradient(135deg, var(--accent) 0%, var(--warm) 100%);
}
.login-card {
  position: relative; z-index: 1;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: var(--sp-7);
  width: min(420px, 100%);
  box-shadow: var(--shadow);
  animation: fadeUp 0.4s ease-out;
}
.login-card h1 { font-size: 28px; margin-bottom: var(--sp-2); }
.login-card p { color: var(--text-muted); font-size: 14px; margin-bottom: var(--sp-5); }
.login-input {
  width: 100%; padding: var(--sp-4);
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-md);
  font-size: 16px; font-family: inherit;
  transition: border-color 0.15s;
}
.login-input:focus { outline: none; border-color: var(--accent); }
.login-btn {
  width: 100%; padding: var(--sp-4);
  margin-top: var(--sp-3);
  background: var(--accent); color: var(--text-inverse);
  border: none; border-radius: var(--r-md);
  font-size: 16px; font-weight: 600; cursor: pointer;
  transition: background 0.15s;
}
.login-btn:hover:not(:disabled) { background: var(--accent-hover); }
.login-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.login-error {
  color: #e11d48; font-size: 14px; margin-top: var(--sp-3);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Trip page — hero ──────────────────────────────────────────────────────── */

.trip-hero {
  position: relative;
  min-height: 60vh;
  padding: var(--sp-9) var(--sp-5) var(--sp-8);
  color: #fff;
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.trip-hero-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--accent) 0%, var(--warm) 100%);
  background-size: cover; background-position: center;
  z-index: 0;
}
.trip-hero-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.7) 100%);
  z-index: 1;
}
.trip-hero-inner {
  position: relative; z-index: 2;
  max-width: 1000px; margin: 0 auto; width: 100%;
}
.trip-hero-eyebrow {
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 12px; font-weight: 600;
  opacity: 0.85;
  margin-bottom: var(--sp-3);
}
.trip-hero-eyebrow a { color: rgba(255,255,255,0.9); }
.trip-hero-title {
  font-size: clamp(36px, 6vw, 68px);
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 20px rgba(0,0,0,0.4);
  max-width: 900px;
}
.trip-hero-subtitle {
  font-family: var(--font-serif); font-style: italic;
  font-size: clamp(16px, 2vw, 22px);
  color: rgba(255,255,255,0.9);
  margin-top: var(--sp-4);
}

/* ── Trip page — body ──────────────────────────────────────────────────────── */

.trip-body {
  max-width: 1200px; margin: 0 auto;
  padding: var(--sp-8) var(--sp-5);
}
.trip-section { margin-bottom: var(--sp-8); }
.section-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 12px; font-weight: 600;
  color: var(--text-muted);
  margin-bottom: var(--sp-3);
}
.section-title {
  font-size: clamp(24px, 3vw, 32px);
  margin-bottom: var(--sp-4);
}
.trip-overview {
  font-family: var(--font-serif);
  font-size: 20px; line-height: 1.55;
  color: var(--text);
  max-width: 720px;
}
.trip-overview::first-letter {
  font-size: 60px; font-weight: 800;
  float: left; line-height: 0.9;
  padding-right: 12px; padding-top: 4px;
  color: var(--warm);
}

.trip-map {
  height: 500px;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #1a2a34;
  position: relative;
  z-index: 0;
}
@media (max-width: 640px) {
  .trip-map { height: 380px; }
}
.boat-marker {
  font-size: 20px; line-height: 26px; text-align: center;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6));
  pointer-events: none;
}
.plane-marker {
  font-size: 18px; line-height: 24px; text-align: center;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6));
  pointer-events: none;
}
.plane-glyph, .boat-glyph { display: inline-block; }
.gw-label {
  font-size: 12px; font-weight: 600; color: #f0ead8;
  text-align: right; white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  pointer-events: none;
}
.leaflet-popup-content {
  font-family: var(--font-sans); font-size: 13px; line-height: 1.4;
}
.leaflet-popup-content strong {
  font-family: var(--font-serif); font-size: 14px;
}

.itinerary {
  border-top: 1px solid var(--border);
}
.itinerary details {
  border-bottom: 1px solid var(--border);
}
.itinerary summary {
  padding: var(--sp-4) 0;
  cursor: pointer;
  font-family: var(--font-serif); font-size: 18px; font-weight: 600;
  display: flex; align-items: baseline; gap: var(--sp-4);
  list-style: none;
}
.itinerary summary::-webkit-details-marker { display: none; }
.itinerary summary::before {
  content: "+";
  color: var(--warm); font-size: 24px;
  transition: transform 0.2s;
}
.itinerary details[open] summary::before {
  content: "−";
}
.itinerary .day-num {
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  min-width: 50px;
}

/* ── Photo grid (CSS columns for masonry) ──────────────────────────────────── */

.gallery-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); flex-wrap: wrap;
}
.gallery-head .section-eyebrow { margin: 0; }
.sort-control {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-muted);
}
.sort-control select {
  font: inherit; text-transform: none; letter-spacing: normal; font-size: 14px;
  color: var(--text); background: var(--surface-alt);
  border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 6px 10px; cursor: pointer;
}
.sort-control select:focus { outline: none; border-color: var(--accent); }

.uploader-filter {
  display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center;
  margin: var(--sp-4) 0 var(--sp-2);
}
.filter-label { color: var(--text-muted); font-size: 14px; margin-right: 2px; }
.chip {
  font: inherit; font-size: 13px; cursor: pointer;
  padding: 5px 14px; border-radius: 999px;
  background: var(--surface-alt); color: var(--text-muted);
  border: 1px solid var(--border);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip:hover { color: var(--text); }
.chip.active {
  background: var(--accent); color: var(--text-inverse); border-color: var(--accent);
}

.tag-filter {
  display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center;
  margin: var(--sp-3) 0 var(--sp-2);
}
.tag-filter-label { color: var(--text-muted); font-size: 15px; margin-right: 2px; }
.tag-select {
  font: inherit; font-size: 14px; cursor: pointer;
  padding: 6px 12px; border-radius: 999px;
  background: var(--surface-alt); color: var(--text); border: 1px solid var(--border);
  max-width: 200px;
}
.tag-active {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 6px 5px 14px; border-radius: 999px;
  background: var(--accent); color: var(--text-inverse); font-size: 14px;
}
.tag-clear {
  background: none; border: none; cursor: pointer;
  color: var(--text-inverse); font-size: 16px; line-height: 1;
  width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
}
.tag-clear:hover { background: rgba(0,0,0,0.15); }
.tag-clear-all {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font: inherit; font-size: 13px;
  text-decoration: underline; padding: 4px 6px;
}
.tag-clear-all:hover { color: var(--text); }

.lightbox-tags {
  display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: center;
  max-width: 92vw;
}
.ltag {
  display: inline-flex; align-items: center;
  background: rgba(255,255,255,0.12); border-radius: 999px; overflow: hidden;
}
.ltag-name {
  background: none; border: none; cursor: pointer;
  color: #fff; font: inherit; font-size: 13px; padding: 4px 4px 4px 12px;
}
.ltag-name:hover { text-decoration: underline; }
.ltag-remove {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.55); font-size: 15px; line-height: 1; padding: 4px 10px 4px 4px;
}
.ltag-remove:hover { color: #fff; }
.ltag-add {
  background: none; border: 1px dashed rgba(255,255,255,0.3); cursor: pointer;
  color: rgba(255,255,255,0.7); font: inherit; font-size: 13px;
  padding: 4px 12px; border-radius: 999px;
}
.ltag-add:hover { color: #fff; border-color: rgba(255,255,255,0.6); }
.ltag-input {
  background: rgba(255,255,255,0.15); border: 1px solid var(--accent);
  color: #fff; font: inherit; font-size: 13px;
  padding: 4px 12px; border-radius: 999px; width: 110px;
}
.ltag-input:focus { outline: none; }

.gallery {
  display: flex; gap: 8px; align-items: flex-start;
}
.gallery-col {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; gap: 8px;
}
@media (max-width: 640px) {
  .gallery { gap: 6px; }
  .gallery-col { gap: 6px; }
}
.gallery .thumb {
  position: relative; cursor: pointer;
}
.gallery .thumb img {
  width: 100%; height: auto; display: block;
  border-radius: var(--r-md);
  background: var(--surface-alt);
  transition: transform 0.2s;
}
.gallery .thumb:hover img { transform: scale(1.02); }
.gallery.selecting .thumb:hover img { transform: none; }
.thumb-check {
  display: none; position: absolute; top: 8px; left: 8px;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(0,0,0,0.45); border: 2px solid #fff; color: #fff;
  place-items: center; font-size: 13px; line-height: 1;
}
.gallery.selecting .thumb-check { display: grid; }
.thumb.selected img { outline: 3px solid var(--accent); outline-offset: -3px; }
.thumb.selected .thumb-check { background: var(--accent); color: var(--text-inverse); border-color: var(--accent); }
.video-badge {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(0,0,0,0.5); color: #fff;
  display: grid; place-items: center; font-size: 17px;
  padding-left: 3px; pointer-events: none;
}

.gallery-tools { display: inline-flex; align-items: center; gap: var(--sp-4); }
.tool-btn {
  font: inherit; font-size: 14px; cursor: pointer;
  padding: 6px 14px; border-radius: var(--r-md);
  background: var(--surface-alt); color: var(--text); border: 1px solid var(--border);
}
.tool-btn:hover { background: var(--border); }
.tool-btn.active { background: var(--accent); color: var(--text-inverse); border-color: var(--accent); }

.select-bar {
  position: fixed; bottom: var(--sp-6); left: 50%; transform: translateX(-50%);
  z-index: 55; display: flex; align-items: center; gap: var(--sp-5);
  background: var(--surface); color: var(--text);
  padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-5); border-radius: 999px;
  box-shadow: var(--shadow); border: 1px solid var(--border);
}
.sb-count { font-size: 14px; font-weight: 600; white-space: nowrap; }
.sb-actions { display: flex; gap: var(--sp-2); align-items: center; }
.sb-download {
  background: var(--accent); color: var(--text-inverse); border: none;
  border-radius: 999px; padding: 8px 18px; font: inherit; font-weight: 600; cursor: pointer;
}
.sb-download:disabled { opacity: 0.5; cursor: default; }
.sb-cancel {
  background: none; border: none; color: var(--text-muted);
  font: inherit; cursor: pointer; padding: 8px 12px;
}
.sb-cancel:hover { color: var(--text); }
.sb-tag {
  background: var(--surface-alt); color: var(--text); border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 18px; font: inherit; font-weight: 600; cursor: pointer;
}
.sb-tag:hover:not(:disabled) { background: var(--border); }
.sb-tag:disabled { opacity: 0.5; cursor: default; }

.ctx-menu {
  position: fixed; z-index: 200;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow); padding: var(--sp-2); min-width: 190px;
  animation: fadeIn 0.1s ease-out;
}
.ctx-item {
  display: block; width: 100%; text-align: left;
  background: none; border: none; cursor: pointer;
  font: inherit; font-size: 14px; color: var(--text);
  padding: 9px 12px; border-radius: 6px;
}
.ctx-item:hover { background: var(--surface-alt); }
.ctx-item.danger { color: #dc2626; }
.ctx-item.danger:hover { background: rgba(220,38,38,0.1); }
.ctx-sep { height: 1px; background: var(--border); margin: var(--sp-2) 0; }

.gallery-empty {
  width: 100%;
  padding: var(--sp-8) 0;
  text-align: center; color: var(--text-muted);
  font-family: var(--font-serif); font-style: italic; font-size: 18px;
}

#scroll-sentinel { height: 1px; }

/* ── Name modal (uploader identity) ──────────────────────────────────────── */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 300; /* above the lightbox (100) and map modal (120) */
  display: grid; place-items: center;
  padding: var(--sp-5);
  background: rgba(0,0,0,0.5);
}
.modal-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: var(--sp-7);
  width: min(420px, 100%);
  box-shadow: var(--shadow);
  animation: fadeUp 0.3s ease-out;
}
.modal-card h2 { font-size: 24px; margin-bottom: var(--sp-2); }
.modal-card p { color: var(--text-muted); font-size: 14px; margin-bottom: var(--sp-5); }
.modal-input {
  width: 100%; padding: var(--sp-4);
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-md);
  font-size: 16px; font-family: inherit;
  transition: border-color 0.15s;
}
.modal-input:focus { outline: none; border-color: var(--accent); }
.modal-btn {
  width: 100%; padding: var(--sp-4);
  margin-top: var(--sp-3);
  background: var(--accent); color: var(--text-inverse);
  border: none; border-radius: var(--r-md);
  font-size: 16px; font-weight: 600; cursor: pointer;
  transition: background 0.15s;
}
.modal-btn:hover { background: var(--accent-hover); }
.modal-actions {
  display: flex; gap: var(--sp-3); margin-top: var(--sp-5);
}
.modal-actions .modal-btn { margin-top: 0; flex: 1; }
.modal-btn-secondary {
  flex: 1; padding: var(--sp-4);
  background: var(--surface-alt); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-md);
  font-size: 16px; font-weight: 600; cursor: pointer;
  transition: background 0.15s;
}
.modal-btn-secondary:hover { background: var(--border); }
.modal-btn-danger { background: #dc2626; }
.modal-btn-danger:hover { background: #b91c1c; }

/* ── Who was there ──────────────────────────────────────────────────────────── */

.who-was-there { padding-top: var(--sp-2); }
.people { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.person-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 6px 5px 13px; border-radius: 999px;
  background: var(--surface-alt); color: var(--text);
  border: 1px solid var(--border); font-size: 14px;
}
.person-remove {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 16px; line-height: 1;
  width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center;
}
.person-remove:hover { color: var(--text); background: var(--border); }
.person-add {
  padding: 5px 13px; border-radius: 999px;
  background: none; border: 1px dashed var(--border); color: var(--text-muted);
  font: inherit; font-size: 14px; cursor: pointer;
}
.person-add:hover { color: var(--text); border-color: var(--text-muted); }
.person-input {
  padding: 5px 13px; border-radius: 999px; width: 130px;
  background: var(--surface); border: 1px solid var(--accent); color: var(--text);
  font: inherit; font-size: 14px;
}
.person-input:focus { outline: none; }

/* ── Upload FAB ────────────────────────────────────────────────────────────── */

.fab {
  position: fixed; bottom: var(--sp-6); right: var(--sp-6);
  z-index: 50;
  width: 64px; height: 64px;
  background: var(--accent); color: var(--text-inverse);
  border: none; border-radius: 50%;
  font-size: 28px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  cursor: pointer;
  display: grid; place-items: center;
  transition: transform 0.15s, background 0.15s;
}
.fab:hover { transform: scale(1.05); background: var(--accent-hover); }
.fab input { display: none; }

.dropzone-overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0, 0, 0, 0.75);
  display: none;
  align-items: center; justify-content: center;
  color: #fff;
  font-family: var(--font-serif); font-size: 28px; font-style: italic;
  text-align: center;
  pointer-events: none;
}
.dropzone-overlay.active { display: flex; }

.upload-toast {
  position: fixed; bottom: 100px; right: var(--sp-6);
  z-index: 60;
  background: var(--surface); color: var(--text);
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  font-size: 14px;
  min-width: 200px;
  animation: fadeUp 0.2s ease-out;
}
.upload-toast .bar {
  height: 4px; background: var(--border); border-radius: 2px;
  margin-top: var(--sp-3); overflow: hidden;
}
.upload-toast .bar-fill {
  height: 100%; background: var(--accent);
  transition: width 0.2s;
}
.upload-toast-error { border-left: 3px solid #dc2626; }
.toast-actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); }
.toast-retry {
  background: var(--accent); color: var(--text-inverse); border: none;
  border-radius: var(--r-md); padding: 6px 16px; font: inherit; font-weight: 600; cursor: pointer;
}
.toast-dismiss {
  background: none; border: none; color: var(--text-muted);
  font: inherit; padding: 6px 10px; cursor: pointer;
}
.toast-dismiss:hover { color: var(--text); }

/* ── Lightbox ──────────────────────────────────────────────────────────────── */

.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, 0.95);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: var(--sp-4);
  animation: fadeIn 0.15s ease-out;
}
.lightbox img {
  max-width: 95vw; max-height: 80vh;
  object-fit: contain; border-radius: var(--r-md);
  background-position: center; background-repeat: no-repeat; background-size: contain;
}
.lightbox-video {
  max-width: 95vw; max-height: 80vh;
  border-radius: var(--r-md); background: #000;
}
.lightbox-close, .lightbox-nav {
  position: absolute; background: rgba(255,255,255,0.1);
  color: #fff; border: none; cursor: pointer;
  display: grid; place-items: center;
  transition: background 0.15s;
  backdrop-filter: blur(8px);
}
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255,255,255,0.2); }
.lightbox-close {
  top: var(--sp-4); right: var(--sp-4);
  width: 44px; height: 44px; border-radius: 50%;
  font-size: 22px;
}
.lightbox-nav {
  top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%;
  font-size: 24px;
}
.lightbox-nav.prev { left: var(--sp-4); }
.lightbox-nav.next { right: var(--sp-4); }
.lightbox-meta {
  color: rgba(255,255,255,0.85); font-size: 13px;
  display: flex; gap: var(--sp-4) var(--sp-5); align-items: center;
  flex-wrap: wrap; justify-content: center; max-width: 92vw;
  background: rgba(0,0,0,0.5); padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-md); backdrop-filter: blur(8px);
  flex: 0 0 auto;
}
.lightbox-meta > span { white-space: nowrap; }
.lightbox-download {
  color: #fff; text-decoration: none;
  padding: 4px 12px; border-radius: 4px;
  background: rgba(255,255,255,0.15);
}
.lightbox-download:hover { background: rgba(255,255,255,0.25); color: #fff; }
.lightbox-actions { display: flex; gap: var(--sp-3); align-items: center; }
.lightbox-download, .lightbox-map, .lightbox-cover, .lightbox-delete, .lightbox-comments-btn { white-space: nowrap; line-height: 1.4; }
.lightbox-map, .lightbox-cover {
  color: #fff; font: inherit; font-size: 13px; cursor: pointer;
  padding: 4px 12px; border: none; border-radius: 4px;
  background: rgba(255,255,255,0.15);
}
.lightbox-map:hover, .lightbox-cover:hover { background: rgba(255,255,255,0.25); }
.lightbox-map:hover { background: rgba(255,255,255,0.25); }
.lightbox-delete {
  color: #fff; font: inherit; font-size: 13px; cursor: pointer;
  padding: 4px 12px; border: none; border-radius: 4px;
  background: rgba(220,38,38,0.65);
}
.lightbox-delete:hover:not(:disabled) { background: rgba(220,38,38,0.9); }
.lightbox-delete:disabled { opacity: 0.6; cursor: default; }

.lightbox-comments-btn {
  color: #fff; font: inherit; font-size: 13px; cursor: pointer;
  padding: 4px 12px; border: none; border-radius: 4px;
  background: rgba(255,255,255,0.15);
}
.lightbox-comments-btn:hover { background: rgba(255,255,255,0.25); }

.lightbox.comments-open { padding-right: 360px; }
.lightbox.comments-open img { max-width: calc(95vw - 360px); }
.lightbox-comments {
  display: none;
  position: fixed; top: 0; right: 0; bottom: 0; width: 360px; max-width: 90vw;
  background: rgba(20,19,15,0.97); backdrop-filter: blur(10px);
  border-left: 1px solid rgba(255,255,255,0.12);
  flex-direction: column; z-index: 110;
}
.lightbox.comments-open .lightbox-comments { display: flex; }
.lc-head {
  flex: 0 0 auto; padding: var(--sp-4) var(--sp-5);
  font-weight: 600; color: #f7f3ea;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.lc-list { flex: 1 1 auto; overflow-y: auto; padding: var(--sp-4) var(--sp-5); }
.lc-empty { color: rgba(255,255,255,0.5); font-size: 14px; font-style: italic; text-align: center; padding: var(--sp-6) 0; }
.lc-item { margin-bottom: var(--sp-4); }
.lc-item-head { display: flex; align-items: baseline; gap: var(--sp-2); }
.lc-author { color: #f0c260; font-weight: 600; font-size: 14px; }
.lc-time { color: rgba(255,255,255,0.4); font-size: 12px; }
.lc-del {
  margin-left: auto; background: none; border: none; color: rgba(255,255,255,0.35);
  cursor: pointer; font-size: 16px; line-height: 1; padding: 0 4px;
}
.lc-del:hover { color: #e0533d; }
.lc-body { color: rgba(255,255,255,0.9); font-size: 14px; line-height: 1.5; margin-top: 2px; white-space: pre-wrap; word-break: break-word; }
.lc-form {
  flex: 0 0 auto; display: flex; gap: var(--sp-2);
  padding: var(--sp-4); border-top: 1px solid rgba(255,255,255,0.1);
}
.lc-form input {
  flex: 1; min-width: 0; background: rgba(255,255,255,0.08); color: #fff;
  border: 1px solid rgba(255,255,255,0.15); border-radius: var(--r-md);
  padding: 10px 12px; font: inherit; font-size: 14px;
}
.lc-form input:focus { outline: none; border-color: var(--accent); }
.lc-form button {
  background: var(--accent); color: var(--text-inverse); border: none;
  border-radius: var(--r-md); padding: 0 16px; font: inherit; font-weight: 600; cursor: pointer;
}
.lc-form button:disabled { opacity: 0.5; cursor: default; }
@media (max-width: 640px) {
  .lightbox.comments-open { padding-right: 0; padding-bottom: 55vh; }
  .lightbox.comments-open img { max-width: 95vw; max-height: 40vh; }
  .lightbox-comments {
    top: auto; width: 100%; max-width: 100%; height: 55vh;
    border-left: none; border-top: 1px solid rgba(255,255,255,0.12);
  }
}

.map-modal {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(0,0,0,0.9);
  display: grid; place-items: center;
  animation: fadeIn 0.15s ease-out;
}
.map-modal-inner {
  position: relative;
  width: min(92vw, 900px); height: min(80vh, 600px);
  border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow);
}
.photo-map { width: 100%; height: 100%; }
.map-modal-close {
  position: absolute; top: 10px; right: 10px; z-index: 1000;
  width: 40px; height: 40px; border-radius: 50%;
  border: none; background: rgba(0,0,0,0.6); color: #fff;
  font-size: 22px; cursor: pointer; display: grid; place-items: center;
}
.map-modal-close:hover { background: rgba(0,0,0,0.85); }

.flash-toast {
  position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%);
  z-index: 400;
  background: var(--surface); color: var(--text);
  padding: 10px 18px; border-radius: 999px;
  box-shadow: var(--shadow); border: 1px solid var(--border);
  font-size: 14px; font-weight: 600;
  animation: fadeUp 0.2s ease-out;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Root loading ──────────────────────────────────────────────────────────── */

.root-loading { min-height: 100vh; display: grid; place-items: center; }
