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

:root {
  --xbg: #f4f2ec;
  --xsurface: #ffffff;
  --xink: #1f2a2e;
  --xmuted: #667276;
  --xline: #d9ded8;
  --xgreen: #2f7a5a;
  --xgreen-dark: #20533e;
  --xnav: #213531;
  --xtap: 56px;
  --xshadow: 0 16px 35px rgba(31, 42, 46, 0.1);
}

html { font-size: 16px; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--xink);
}

/* ============================================
   App shell (authenticated) — ported from Afmelden
   ============================================ */
body.exp-body {
  background:
    linear-gradient(135deg, rgba(47, 122, 90, 0.08), transparent 38%),
    linear-gradient(45deg, rgba(50, 106, 145, 0.08), transparent 45%),
    var(--xbg);
}

.exp-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.exp-sidebar {
  background: var(--xnav);
  color: #f7fbf7;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.exp-club-mark { display: flex; gap: 14px; align-items: center; }

.exp-club-logo {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.1);
  color: #f7fbf7;
}

.exp-eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  opacity: 0.65;
  letter-spacing: 0.04em;
}

.exp-club-title { margin: 0; font-size: 1.1rem; font-weight: 700; }

.exp-nav-section { display: grid; gap: 6px; }

.exp-section-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.5;
  padding: 0 4px;
  margin: 0 0 4px;
}

.exp-nav-item {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  min-height: var(--xtap);
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(247, 251, 247, 0.85);
  padding: 10px 12px;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border 0.15s;
}

.exp-nav-icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.11);
}

.exp-nav-item.active, .exp-nav-item:hover {
  background: #f7fbf7;
  color: var(--xnav);
  border-color: transparent;
}

.exp-nav-item.active .exp-nav-icon, .exp-nav-item:hover .exp-nav-icon {
  background: rgba(33, 53, 49, 0.1);
}

.exp-main-wrapper { min-width: 0; display: flex; flex-direction: column; }

.exp-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 28px 30px 0;
  margin-bottom: 24px;
}

.exp-topbar-left h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  line-height: 1;
  font-weight: 700;
  color: var(--xink);
}

.exp-topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.exp-user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--xline);
  border-radius: 8px;
  background: var(--xsurface);
  padding: 8px 12px;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 8px 20px rgba(31, 42, 46, 0.06);
  color: var(--xink);
}

.exp-avatar {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: #d9ece2;
  color: var(--xgreen-dark);
  font-size: 0.82rem;
  font-weight: 700;
}

.exp-logout-btn {
  min-height: 42px;
  border: 1px solid var(--xline);
  border-radius: 8px;
  background: var(--xsurface);
  color: var(--xink);
  padding: 0 16px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(31, 42, 46, 0.06);
}
.exp-logout-btn:hover { background: #f0ede6; }

.exp-exp-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  background: #f4c15d;
  color: var(--xnav);
  padding: 2px 10px;
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
}

.exp-main-content { flex: 1; padding: 0 30px 30px; overflow: auto; }

.exp-mobile-bar { display: none; }

/* Content helpers */
.exp-muted { color: var(--xmuted); margin: 0; }

.exp-panel {
  background: var(--xsurface);
  border: 1px solid var(--xline);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 10px 24px rgba(31, 42, 46, 0.07);
}

.exp-empty {
  display: grid;
  place-items: center;
  gap: 14px;
  text-align: center;
  padding: 60px 24px;
  color: var(--xmuted);
}
.exp-empty svg { color: var(--xline); }
.exp-empty h3 { margin: 0; color: var(--xink); font-size: 1.25rem; font-weight: 700; }

@media (max-width: 980px) {
  body.exp-body { background: var(--xbg); }

  .exp-shell { display: block; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .exp-sidebar { display: none; }

  .exp-mobile-bar {
    display: flex;
    position: fixed;
    inset: auto 0 0 0;
    z-index: 10;
    background: var(--xnav);
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 -10px 24px rgba(31, 42, 46, 0.18);
  }

  .exp-mobile-nav {
    display: grid;
    grid-template-columns: repeat(var(--mobile-cols, 3), minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }

  .exp-mobile-bar .exp-nav-item {
    grid-template-columns: 1fr;
    justify-items: center;
    align-content: center;
    gap: 5px;
    min-height: 60px;
    border: 0;
    padding: 6px 4px;
    text-align: center;
    font-size: 0.72rem;
    background: transparent;
    color: rgba(247, 251, 247, 0.7);
  }
  .exp-mobile-bar .exp-nav-item.active, .exp-mobile-bar .exp-nav-item:hover {
    background: rgba(247, 251, 247, 0.12);
    color: #f7fbf7;
  }

  .exp-topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: calc(16px + env(safe-area-inset-top)) 16px 14px;
    margin: 0 0 16px;
    background: rgba(244, 242, 236, 0.94);
    border-bottom: 1px solid rgba(217, 222, 216, 0.8);
    backdrop-filter: blur(12px);
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .exp-topbar-left h2 { font-size: 1.9rem; }
  .exp-topbar-right { width: 100%; }
  .exp-user-badge { flex: 1; }
  .exp-main-content { padding: 0 16px 16px; }
}

@media (max-width: 620px) {
  .exp-main-content { padding: 0 12px 12px; }
}

/* ============================================
   Landing page (anonymous, fullscreen hero)
   ============================================ */
.landing {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: #f7fbf7;
  isolation: isolate;
  overflow: hidden;
}

.landing::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: var(--hero-image), linear-gradient(135deg, #20533e, #213531 55%, #142b3a);
  background-size: cover;
  background-position: center;
}

.landing::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(20, 30, 33, 0.35), rgba(20, 30, 33, 0.75));
}

.landing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px clamp(20px, 5vw, 64px);
}

.landing-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: 0.01em;
}
.landing-brand svg { opacity: 0.95; }

.landing-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  max-width: 720px;
  padding: 0 clamp(20px, 5vw, 64px) 12vh;
}

.landing-eyebrow {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.85;
}

.landing-hero h1 {
  margin: 0;
  font-size: clamp(2.6rem, 7vw, 5rem);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.landing-hero p {
  margin: 0;
  max-width: 46ch;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.5;
  opacity: 0.92;
}

.landing-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  min-height: 54px;
  margin-top: 8px;
  padding: 0 28px;
  border-radius: 999px;
  background: #f7fbf7;
  color: var(--xnav);
  font-weight: 800;
  font-size: 1rem;
  text-decoration: none;
  transition: transform 0.12s ease, background 0.15s ease;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}
.landing-cta:hover { transform: translateY(-1px); background: #ffffff; }

/* ============================================
   Login page (anonymous, standalone)
   ============================================ */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(47, 122, 90, 0.15), transparent 40%),
    linear-gradient(45deg, rgba(50, 106, 145, 0.15), transparent 45%),
    var(--xbg);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--xsurface);
  border: 1px solid var(--xline);
  border-radius: 14px;
  box-shadow: var(--xshadow);
  overflow: hidden;
}

.login-head {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--xnav);
  color: #f7fbf7;
  padding: 22px 26px;
}
.login-head svg { opacity: 0.95; }
.login-head h1 { margin: 0; font-size: 1.15rem; font-weight: 800; }

.login-body { padding: 26px; }
.login-body h2 { margin: 0 0 18px; font-size: 1.05rem; font-weight: 700; }

.login-error {
  border: 1px solid #f0c4c0;
  background: #fbe9e7;
  color: #a0443d;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.88rem;
  margin-bottom: 16px;
}

.login-field { display: grid; gap: 6px; margin-bottom: 16px; }
.login-field label { font-weight: 700; font-size: 0.9rem; color: var(--xink); }
.login-field input {
  width: 100%;
  border: 1px solid #cdd6d0;
  border-radius: 8px;
  background: #fff;
  color: var(--xink);
  padding: 12px 14px;
  font: inherit;
  font-size: 0.95rem;
  min-height: 48px;
}
.login-field input:focus {
  outline: none;
  border-color: var(--xgreen);
  box-shadow: 0 0 0 3px rgba(47, 122, 90, 0.18);
}

.login-submit {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  background: var(--xgreen);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s;
}
.login-submit:hover { background: var(--xgreen-dark); }

.login-back {
  display: block;
  margin-top: 16px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--xmuted);
  text-decoration: none;
}
.login-back:hover { color: var(--xink); }

/* ---- Admin / user management ---- */
.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.admin-panel-head h3 { margin: 0; color: var(--xink); font-size: 1.25rem; font-weight: 700; }

.admin-btn {
  display: inline-flex;
  align-items: center;
  padding: 9px 16px;
  border-radius: 8px;
  background: var(--xgreen);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.15s;
}
.admin-btn:hover { background: var(--xgreen-dark); }

.admin-status {
  padding: 10px 14px;
  margin-bottom: 16px;
  border-radius: 8px;
  background: rgba(47, 122, 90, 0.1);
  color: var(--xgreen-dark);
  font-size: 0.9rem;
  font-weight: 600;
}

.admin-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.admin-table th,
.admin-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--xline);
  white-space: nowrap;
}
.admin-table th {
  color: var(--xmuted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.admin-table td { color: var(--xink); }

.admin-tag {
  display: inline-block;
  padding: 2px 10px;
  margin-right: 6px;
  border-radius: 999px;
  background: var(--xnav);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}

.admin-row-actions {
  display: flex;
  gap: 14px;
  align-items: center;
}
.admin-row-actions form { margin: 0; }
.admin-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--xgreen);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
}
.admin-link:hover { text-decoration: underline; }
.admin-link-danger { color: #b3261e; }

.admin-form-panel { max-width: 480px; }
.admin-divider { border: 0; border-top: 1px solid var(--xline); margin: 28px 0; }

.login-field select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--xline);
  border-radius: 8px;
  background: var(--xsurface);
  color: var(--xink);
  font-size: 1rem;
}
.login-field select:focus {
  outline: none;
  border-color: var(--xgreen);
}

/* Storage page */
.storage-panel { max-width: 560px; }

.storage-form { margin-top: 1.25rem; }

.storage-section-label {
  margin: 0 0 10px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--xmuted);
}

.storage-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* SSL toggle */
.storage-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--xink);
  margin-bottom: 1rem;
  user-select: none;
}
.storage-toggle input[type="checkbox"] { display: none; }
.storage-toggle-track {
  position: relative;
  width: 36px;
  height: 20px;
  background: var(--xline);
  border-radius: 999px;
  flex-shrink: 0;
  transition: background 0.2s;
}
.storage-toggle input:checked + .storage-toggle-track { background: var(--xgreen); }
.storage-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.storage-toggle input:checked + .storage-toggle-track .storage-toggle-thumb {
  transform: translateX(16px);
}

/* Status bar */
.admin-storage-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 4px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}
.admin-storage-status.storage-ok {
  background: rgba(47, 122, 90, 0.1);
  color: var(--xgreen-dark);
}
.admin-storage-status.storage-err {
  background: rgba(179, 38, 30, 0.08);
  color: #b3261e;
}
.storage-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.storage-ok .storage-dot { background: var(--xgreen-dark); }
.storage-err .storage-dot { background: #b3261e; }
.storage-stats {
  margin-left: auto;
  font-weight: 400;
  opacity: .75;
  font-size: 0.85rem;
}
.storage-sep { margin: 0 4px; }

.storage-conn {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.storage-conn-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.storage-conn-head strong { color: var(--xink); font-size: 1rem; }
.storage-conn-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.storage-conn-actions form { display: inline; margin: 0; }
.storage-conn-meta {
  margin-top: 6px;
  font-size: 0.8rem;
  opacity: 0.6;
  word-break: break-all;
}
.storage-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.07);
  color: var(--xink);
  vertical-align: middle;
}
.link-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: var(--xgreen-dark);
  text-decoration: underline;
}
.link-btn.link-danger { color: #b3261e; }

/* Album photo picker */
.album-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 1.5rem 0 0.75rem;
}
.album-filter { font-size: 0.85rem; color: var(--xink); display: flex; align-items: center; gap: 6px; }
.album-filter select { padding: 4px 8px; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.photo-pick { cursor: pointer; margin: 0; display: block; }
.photo-pick input { position: absolute; opacity: 0; pointer-events: none; }
.photo-pick-frame {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.06);
  border: 4px solid var(--bucket, transparent);
}
.photo-pick-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-noimg {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 0.72rem;
  opacity: 0.5;
}
.photo-vid-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.6rem;
  padding-left: 2px;
  pointer-events: none;
}
.photo-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.2);
}
.photo-pick input:checked + .photo-pick-frame { border-color: var(--xgreen); }
.photo-pick input:checked + .photo-pick-frame .photo-check {
  background: var(--xgreen);
  border-color: var(--xgreen);
}
.photo-pick input:checked + .photo-pick-frame .photo-check::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.photo-meta {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  opacity: 0.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
a.photo-pick { text-decoration: none; color: inherit; }
a.photo-pick:hover .photo-pick-frame { border-color: var(--xgreen); }

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 16px;
}
.pager-btn {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid rgba(127, 127, 127, 0.3);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  background: none;
  font-size: 0.85rem;
}
.pager-btn:hover { border-color: var(--xgreen); }
.pager-btn.disabled { opacity: 0.4; pointer-events: none; }
.pager-info { font-size: 0.85rem; opacity: 0.7; }

/* Photo details + EXIF */
.photo-details {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 640px) {
  .photo-details { grid-template-columns: 1fr; }
}
.photo-details-preview img {
  width: 100%;
  border-radius: 10px;
  display: block;
  background: rgba(0, 0, 0, 0.06);
}
.exif-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.exif-table th,
.exif-table td {
  text-align: left;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  vertical-align: top;
}
.exif-table th {
  width: 34%;
  font-weight: 600;
  color: var(--xink);
  opacity: 0.75;
}
.exif-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; word-break: break-all; }
.photo-map {
  width: 100%;
  height: 220px;
  margin-top: 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
}

/* Full-image viewer */
.viewer { display: flex; flex-direction: column; gap: 12px; }
.viewer-bar {
  display: flex;
  align-items: center;
  gap: 16px;
}
.viewer-title {
  font-weight: 600;
  color: var(--xink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.viewer-pos { margin-left: auto; font-size: 0.85rem; opacity: 0.6; }
.viewer-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
  border-radius: 12px;
  min-height: 60vh;
  overflow: hidden;
}
/* Frame shrink-wraps the displayed photo so the caption anchors to the image, not the stage. */
.ss-frame {
  position: relative;
  z-index: 1;
  display: inline-block;
  margin: 0;
  line-height: 0;
}
.viewer-img {
  max-width: 92vw;
  max-height: 82vh;
  object-fit: contain;
  display: block;
}
/* Blurred cover backdrop fills the letterbox area with the photo's own colors. */
.ss-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(38px) brightness(0.55) saturate(1.2);
  transform: scale(1.15);
}
/* Photo description: slanted serif, lower corner, lifted off the image. */
.ss-caption {
  position: absolute;
  z-index: 2;
  right: 16px;
  bottom: 14px;
  max-width: 70%;
  margin: 0;
  text-align: right;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 1.4rem;
  line-height: 1.35;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7), 0 3px 12px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}
.viewer-nav {
  position: absolute;
  z-index: 2;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  line-height: 1;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 50%;
  text-decoration: none;
  user-select: none;
}
.viewer-nav:hover { background: rgba(0, 0, 0, 0.7); }
.viewer-prev { left: 14px; }
.viewer-next { right: 14px; }
.viewer-nav-off { opacity: 0.2; pointer-events: none; }
.viewer-foot { display: flex; justify-content: center; }
.slideshow-controls { gap: 16px; align-items: center; }

/* Slideshow fullscreen — chrome auto-hides, reveals near top/bottom edges */
.viewer:fullscreen,
.viewer:-webkit-full-screen {
  background: #000;
  padding: 0;
  gap: 0;
}
.viewer:fullscreen .viewer-stage,
.viewer:-webkit-full-screen .viewer-stage {
  flex: 1;
  min-height: 0;
  border-radius: 0;
}
.viewer:fullscreen .viewer-img,
.viewer:-webkit-full-screen .viewer-img { max-height: 96vh; }

.viewer:fullscreen .viewer-bar,
.viewer:-webkit-full-screen .viewer-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 5;
  margin: 0;
  padding: 14px 20px;
  color: #fff;
  background: linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
  opacity: 0;
  transform: translateY(-100%);
  transition: opacity 0.25s, transform 0.25s;
}
.viewer:fullscreen .viewer-title,
.viewer:-webkit-full-screen .viewer-title { color: #fff; }
.viewer:fullscreen .slideshow-controls,
.viewer:-webkit-full-screen .slideshow-controls {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 5;
  margin: 0;
  padding: 16px;
  background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.55));
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.25s, transform 0.25s;
}
.viewer:fullscreen.show-chrome .viewer-bar,
.viewer:fullscreen.show-chrome .slideshow-controls,
.viewer:-webkit-full-screen.show-chrome .viewer-bar,
.viewer:-webkit-full-screen.show-chrome .slideshow-controls {
  opacity: 1;
  transform: none;
}

/* Faux fullscreen — for iOS standalone PWA where the Fullscreen API is unavailable.
   Pins the viewer over everything; tap toggles chrome (no pointer to hover). */
.viewer.faux-fs {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  padding: 0;
  gap: 0;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
body.faux-fs-lock { overflow: hidden; }
.viewer.faux-fs .viewer-stage { flex: 1; min-height: 0; border-radius: 0; }
.viewer.faux-fs .viewer-img { max-height: 96vh; }
.viewer.faux-fs .viewer-bar {
  position: absolute;
  top: env(safe-area-inset-top); left: 0; right: 0;
  z-index: 5;
  margin: 0;
  padding: 14px 20px;
  color: #fff;
  background: linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
  opacity: 0;
  transform: translateY(-100%);
  transition: opacity 0.25s, transform 0.25s;
}
.viewer.faux-fs .viewer-title { color: #fff; }
.viewer.faux-fs .slideshow-controls {
  position: absolute;
  bottom: env(safe-area-inset-bottom); left: 0; right: 0;
  z-index: 5;
  margin: 0;
  padding: 16px;
  background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.55));
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.25s, transform 0.25s;
}
.viewer.faux-fs.show-chrome .viewer-bar,
.viewer.faux-fs.show-chrome .slideshow-controls {
  opacity: 1;
  transform: none;
}

/* Bucket color legend */
.bucket-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.8rem;
}
.bucket-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.bucket-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

/* Album access checklist */
.access-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px 16px;
  margin-top: 6px;
}
.access-item { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; cursor: pointer; }

/* Gallery album cards */
.album-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
.album-card {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.08);
  transition: transform 0.12s, box-shadow 0.12s;
}
.album-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12); }
.album-card-cover {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  background: rgba(0, 0, 0, 0.06);
}
.album-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.album-card-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.album-card-name { font-weight: 700; color: var(--xink); }
.album-card-meta { font-size: 0.78rem; opacity: 0.6; }
.album-card-desc {
  font-size: 0.8rem;
  opacity: 0.75;
  margin-top: 2px;
  white-space: pre-wrap;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Reveal full multiline description on hover/focus. */
.album-card:hover .album-card-desc,
.album-card:focus .album-card-desc {
  -webkit-line-clamp: unset;
  overflow: visible;
}
.album-card-tags { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }

/* Tags + search */
.tag-chip {
  display: inline-block;
  padding: 1px 8px;
  margin: 1px 2px 1px 0;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.07);
  color: var(--xink);
}
.album-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.album-search input[type="search"] { flex: 1; min-width: 180px; padding: 8px 12px; }
.album-search select { padding: 8px 12px; }
.login-field textarea {
  width: 100%;
  padding: 8px 12px;
  font: inherit;
  resize: vertical;
}
.exif-table td { white-space: pre-wrap; }
