:root {
  --bg-deep: #050508;
  --bg-surface: #0a0810;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --glass: rgba(18, 10, 32, 0.55);
  --glass-border: rgba(168, 130, 255, 0.14);
  --glass-border-hover: rgba(168, 130, 255, 0.28);
  --accent: #a855f7;
  --accent-secondary: #7c3aed;
  --accent-dim: rgba(168, 85, 247, 0.16);
  --accent-glow: rgba(124, 58, 237, 0.12);
  --wild-dim: rgba(91, 33, 182, 0.18);
  --text-primary: rgba(255, 255, 255, 0.94);
  --text-secondary: rgba(220, 210, 240, 0.55);
  --text-muted: rgba(180, 170, 210, 0.32);
  --danger: #f87171;
  --success: #a78bfa;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --blur: blur(22px);
  --blur-sm: blur(12px);
  --transition: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --font-display: 'Syne', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* === BACKGROUND === */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 75% 60% at 15% 0%, rgba(124, 58, 237, 0.22) 0%, transparent 55%),
    radial-gradient(ellipse 65% 55% at 85% 100%, rgba(49, 16, 89, 0.35) 0%, transparent 58%),
    linear-gradient(180deg, #0d0618 0%, #050508 45%, #000000 100%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 25% 15%, rgba(168, 85, 247, 0.10) 0%, transparent 38%),
    radial-gradient(circle at 75% 85%, rgba(76, 29, 149, 0.14) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
  animation: bgDrift 14s ease-in-out infinite alternate;
}

@keyframes bgDrift {
  from { transform: translate3d(0, 0, 0) scale(1); opacity: 0.85; }
  to { transform: translate3d(2%, -1%, 0) scale(1.04); opacity: 1; }
}

#app { position: relative; z-index: 1; min-height: 100vh; }

/* === LOADING === */
.loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.4s ease;
}
.loading-screen.fade-out { opacity: 0; pointer-events: none; }
.loader-logo-wrap {
  width: min(300px, 82vw);
  aspect-ratio: 682 / 190;
  overflow: hidden;
  border-radius: 6px;
}
.loader-logo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center center;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 0.4; } 50% { opacity: 1; } }

/* === GLASS CARD === */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition), background var(--transition);
}
.glass:hover { border-color: var(--glass-border-hover); background: var(--bg-card-hover); }

/* === NAV === */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border-bottom: none;
}
.nav-logo {
  display: inline-block;
  width: 148px;
  height: 42px;
  overflow: hidden;
  cursor: pointer;
  line-height: 0;
  flex-shrink: 0;
  border-radius: 4px;
}
.nav-logo-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center center;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.nav-instagram { text-decoration: none; }
.nav-instagram:hover { color: #f472b6; border-color: rgba(244, 114, 182, 0.35); }
.nav-actions { display: flex; align-items: center; gap: 0.75rem; }
.nav-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.nav-user-name { font-size: 0.8rem; color: var(--text-secondary); }
.nav-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, #9333ea 0%, #6d28d9 100%);
  color: #fff;
  border-color: rgba(196, 181, 253, 0.15);
  box-shadow: 0 0 28px rgba(124, 58, 237, 0.28);
}
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-ghost {
  background: var(--glass);
  color: var(--text-secondary);
  border-color: var(--glass-border);
  backdrop-filter: var(--blur-sm);
}
.btn-ghost:hover { color: var(--text-primary); border-color: var(--glass-border-hover); background: var(--bg-card-hover); }
.btn-danger { background: rgba(224, 92, 92, 0.15); color: var(--danger); border-color: rgba(224, 92, 92, 0.3); }
.btn-danger:hover { background: rgba(224, 92, 92, 0.25); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.78rem; }
.btn-icon { padding: 0.5rem; aspect-ratio: 1; justify-content: center; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* === SVG ICONS === */
.icon {
  width: 16px; height: 16px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 20px; height: 20px; }
.icon-xl { width: 24px; height: 24px; }

/* === VIEWS === */
.view { display: none; padding-top: 80px; min-height: 100vh; }
.view.active { display: block; }

/* === AUTH (admin modal) === */
.auth-error {
  font-size: 0.82rem;
  color: var(--danger);
  background: rgba(255, 92, 92, 0.08);
  border: 1px solid rgba(255, 92, 92, 0.2);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  display: none;
}
.auth-error.visible { display: block; }
.modal-lead {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

/* === FORM ELEMENTS === */
.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 0.4rem; font-weight: 500; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.88rem;
  transition: border-color var(--transition), background var(--transition);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  background: rgba(200, 169, 110, 0.05);
}
.form-input::placeholder { color: var(--text-muted); }
.form-select,
select.form-input {
  appearance: none;
  cursor: pointer;
  color-scheme: dark;
  background-color: rgba(18, 10, 32, 0.85);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(220,210,240,0.55)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  padding-right: 2.2rem;
}
.form-select option,
select.form-input option {
  background: #120a20;
  color: var(--text-primary);
}
.form-textarea { resize: vertical; min-height: 80px; }

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  background: rgba(124, 58, 237, 0.08);
}
.form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.form-check input { margin-top: 0.2rem; accent-color: var(--accent); }
.form-check-hint { color: var(--text-muted); font-size: 0.78rem; }

/* === GALLERY GRID === */
.page-header {
  padding: 2rem 2rem 1.5rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.page-title {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.page-subtitle { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.2rem; }
.page-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

.albums-toolbar {
  display: flex;
  gap: 0.75rem;
  padding: 0 2rem 1.25rem;
  flex-wrap: wrap;
}
.albums-search { flex: 1; min-width: 180px; max-width: 360px; }
.albums-sort { width: auto; min-width: 160px; }

.custom-select {
  position: relative;
  min-width: 160px;
}
.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  padding: 0.65rem 0.9rem;
  padding-right: 2.2rem;
  background: rgba(18, 10, 32, 0.85);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.88rem;
  cursor: pointer;
  text-align: left;
  transition: border-color var(--transition), background var(--transition);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(220,210,240,0.55)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
}
.custom-select-trigger:hover,
.custom-select.open .custom-select-trigger {
  border-color: var(--glass-border-hover);
  background-color: rgba(124, 58, 237, 0.12);
}
.custom-select-trigger:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.25);
}
.custom-select-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 50;
  padding: 0.35rem;
  background: rgba(15, 10, 28, 0.98);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.custom-select.open .custom-select-menu { display: block; }
.custom-select-option {
  display: block;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: none;
  border-radius: calc(var(--radius-sm) - 2px);
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.86rem;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.custom-select-option:hover,
.custom-select-option.is-selected {
  background: rgba(124, 58, 237, 0.22);
  color: #fff;
}

.albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  padding: 0 2rem 2rem;
}

.album-card {
  cursor: pointer;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  aspect-ratio: 4/3;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.album-card:hover {
  transform: translateY(-3px);
  border-color: var(--glass-border-hover);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(124, 58, 237, 0.12);
}
.album-card:hover .album-cover { transform: scale(1.03); }

.album-cover {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.album-cover-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.12) 0%, rgba(49, 16, 89, 0.18) 100%);
}

.album-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
  z-index: 1;
}
.album-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: rgba(255,255,255,0.94);
  line-height: 1.3;
}
.album-desc {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.72);
  margin-top: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}
.album-view-desc,
.shared-desc {
  margin-top: 0.35rem;
  max-width: 640px;
  line-height: 1.45;
}
.album-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
}
.album-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  pointer-events: none;
  background: rgba(0,0,0,0.6);
  backdrop-filter: var(--blur-sm);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.album-badge-private {
  background: rgba(91, 33, 182, 0.45);
  border-color: rgba(196, 181, 253, 0.35);
  color: rgba(255, 255, 255, 0.92);
}

.album-card-actions {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 3;
  display: flex;
  gap: 0.4rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.album-card:hover .album-card-actions,
.album-card:focus-within .album-card-actions {
  opacity: 1;
  pointer-events: auto;
}

@media (hover: none) {
  .album-card-actions { opacity: 1; pointer-events: auto; }
  .photo-actions { opacity: 1; pointer-events: auto; }
  body.is-admin .photo-select { opacity: 1; }
}

.photo-card.dragging { opacity: 0.5; border-style: dashed; }
.photos-grid.reorder-mode .photo-card { cursor: grab; }
.photos-grid.reorder-mode .photo-card:active { cursor: grabbing; }
.photo-drag-handle {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 3;
  background: rgba(15,15,22,0.85);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.35rem;
  color: var(--text-muted);
  display: flex;
  pointer-events: none;
}
#reorder-toggle-btn.active { color: var(--accent); border-color: var(--accent); }

.modal-lead {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.45;
}

/* === PHOTOS GRID === */
.photos-toolbar {
  padding: 0 2rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.photos-back { display: flex; align-items: center; gap: 0.5rem; color: var(--text-secondary); font-size: 0.85rem; cursor: pointer; transition: color var(--transition); }
.photos-back:hover { color: var(--accent); }
.photos-back span { color: var(--text-muted); }

.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
  padding: 0 2rem 2rem;
}

.photo-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 3/2;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition);
}
.photo-card:hover {
  transform: translateY(-2px);
  border-color: var(--glass-border-hover);
  box-shadow: 0 8px 28px rgba(0,0,0,0.28);
}
.photo-card:hover .photo-img { transform: scale(1.04); }
.photo-card:hover .photo-actions { opacity: 1; }

.photo-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}
.photo-img-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  color: var(--text-muted);
}

.photo-actions {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0.6rem;
  gap: 0.4rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.photo-card:hover .photo-actions { pointer-events: auto; }

.photo-select {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.6);
  background: transparent;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
}
.photo-card:hover .photo-select, .photo-card.selected .photo-select { opacity: 1; }
.photo-card.selected .photo-select { background: var(--accent); border-color: var(--accent); }
.photo-card.selected { border-color: var(--accent); }

/* === LIGHTBOX === */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  z-index: 500;
  display: none;
  flex-direction: column;
}
.lightbox.open { display: flex; }
.lightbox-header {
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  border-bottom: 1px solid var(--glass-border);
}
.lightbox-title { font-family: var(--font-display); font-size: 1rem; color: var(--text-secondary); }
.lightbox-body {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 1.5rem 2rem;
}
.lightbox-media {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  max-width: min(100%, 1100px);
  width: 100%;
  max-height: 100%;
  min-height: 0;
}
.lightbox-img {
  max-width: 100%;
  max-height: calc(100vh - 22rem);
  object-fit: contain;
  border-radius: var(--radius-sm);
  transition: opacity 0.15s ease;
  flex-shrink: 0;
}
.lightbox-img.is-loading { opacity: 0; }
.lightbox-exif {
  width: 100%;
  padding: 0.85rem 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.55rem 1rem;
  flex-shrink: 1;
  min-height: 0;
  max-height: min(11rem, 38vh);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.lightbox-exif.is-empty { display: none; }
.exif-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.exif-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}
.exif-value {
  font-size: 0.82rem;
  color: var(--text-primary);
  line-height: 1.35;
  word-break: break-word;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition);
  color: var(--text-primary);
}
.lightbox-nav:hover { background: rgba(255,255,255,0.15); }
.lightbox-nav-prev { left: 1rem; }
.lightbox-nav-next { right: 1rem; }
.lightbox-footer {
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  border-top: 1px solid var(--glass-border);
}
.lightbox-meta { display: flex; align-items: center; gap: 1.25rem; }
.lightbox-stat { font-size: 0.78rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.35rem; }
.lightbox-actions { display: flex; gap: 0.5rem; }

/* === MODAL === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.modal-overlay.open { display: flex; }
.modal {
  width: 100%;
  max-width: 480px;
  padding: 2rem;
  animation: modal-in 0.2s ease;
}
@keyframes modal-in { from { opacity: 0; transform: scale(0.96) translateY(8px); } to { opacity: 1; transform: none; } }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.modal-title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; }
.modal-footer { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1.5rem; }

/* === UPLOAD ZONE === */
.upload-zone {
  border: 2px dashed var(--glass-border);
  border-radius: var(--radius-md);
  padding: 2.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-glow);
}
.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.upload-icon { color: var(--text-muted); margin-bottom: 0.75rem; }
.upload-label { font-size: 0.9rem; color: var(--text-secondary); }
.upload-sublabel { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.25rem; }

/* === UPLOAD PROGRESS === */
.upload-queue { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.5rem; max-height: 200px; overflow-y: auto; }
.upload-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.75rem; background: var(--bg-card); border-radius: var(--radius-sm); border: 1px solid var(--glass-border); flex-wrap: wrap; }
.upload-item-name { flex: 1; font-size: 0.8rem; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item-status { font-size: 0.75rem; flex-shrink: 0; }
.upload-item-status.uploading { color: var(--accent); }
.upload-item-status.pending { color: var(--text-muted); }
.upload-item-status.done { color: var(--success); }
.upload-item-status.error { color: var(--danger); }
.upload-progress-bar { height: 2px; background: var(--glass-border); border-radius: 1px; margin-top: 0.25rem; flex-basis: 100%; }
.upload-progress-fill { height: 100%; background: var(--accent); border-radius: 1px; transition: width 0.3s ease; }

/* === BACKGROUND UPLOAD PANEL === */
.upload-panel {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: none;
  flex-direction: column;
  width: min(340px, calc(100vw - 2rem));
  background: rgba(15, 15, 22, 0.96);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--blur);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  z-index: 210;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, width 0.2s ease;
  overflow: hidden;
}
.upload-panel.visible {
  display: flex;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.upload-panel:not(.expanded) {
  width: auto;
  min-width: 240px;
  max-width: min(340px, calc(100vw - 2rem));
}
.upload-panel-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.upload-panel-header:hover { color: var(--text-primary); }
.upload-panel-icon { color: var(--accent); display: flex; flex-shrink: 0; }
.upload-panel-summary {
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-panel-chevron {
  display: flex;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}
.upload-panel.expanded .upload-panel-chevron { transform: rotate(90deg); }
.upload-panel-progress {
  height: 3px;
  background: var(--glass-border);
  flex-shrink: 0;
}
.upload-panel-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #a78bfa);
  width: 0%;
  transition: width 0.3s ease;
}
.upload-panel-body {
  display: none;
  max-height: 220px;
  overflow-y: auto;
  padding: 0.65rem 0.75rem 0;
  border-top: 1px solid var(--glass-border);
}
.upload-panel.expanded .upload-panel-body { display: block; }
.upload-panel-body .upload-item {
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.65rem;
}
.upload-panel-body .upload-item:last-child { margin-bottom: 0; }
.upload-panel-actions {
  display: none;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 0.65rem 0.75rem 0.75rem;
  border-top: 1px solid var(--glass-border);
}
.upload-panel.expanded .upload-panel-actions {
  display: flex;
}
.upload-panel-actions .btn { white-space: nowrap; }

/* === SHARE MODAL === */
.share-link-box {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
}
.share-link-url {
  flex: 1;
  font-size: 0.8rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: monospace;
}

/* === TOAST === */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  background: rgba(20,20,28,0.95);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--blur);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  font-size: 0.82rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  pointer-events: auto;
  animation: toast-in 0.2s ease, toast-out 0.2s ease 2.8s forwards;
  max-width: 300px;
}
.toast.success { border-color: rgba(92, 224, 122, 0.3); }
.toast.error { border-color: rgba(224, 92, 92, 0.3); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { from { opacity: 1; } to { opacity: 0; } }

/* === EMPTY STATE === */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 2rem;
  text-align: center;
  color: var(--text-muted);
  gap: 1rem;
}
.empty-state-icon { opacity: 0.3; }
.empty-state-title { font-size: 1rem; color: var(--text-secondary); font-weight: 500; }
.empty-state-body { font-size: 0.85rem; max-width: 320px; }

/* === BADGE === */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
}
.badge-accent { background: var(--accent-dim); color: #ddd6fe; border: 1px solid rgba(168, 85, 247, 0.28); }
.badge-muted { background: rgba(255,255,255,0.05); color: var(--text-muted); border: 1px solid var(--glass-border); }

/* === DIVIDER === */
.divider { height: 1px; background: var(--glass-border); margin: 1rem 0; }

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

/* === RESPONSIVE === */
@media (max-width: 640px) {
  .nav { padding: 0.75rem 1rem; }
  .nav-logo { width: 120px; height: 34px; }
  .page-header { padding: 1.25rem 1rem 1rem; }
  .albums-toolbar { padding: 0 1rem 1rem; }
  .albums-grid { padding: 0 1rem 1rem; gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .photos-grid { padding: 0 1rem 1rem; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .photos-toolbar { padding: 0 1rem 1rem; }
  .modal { padding: 1.25rem; }
}

/* === SELECTION BAR === */
.selection-bar {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: rgba(15,15,22,0.95);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--blur);
  border-radius: var(--radius-lg);
  padding: 0.65rem 1rem;
  display: none;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 200;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}
body.is-admin .selection-bar.visible {
  display: flex;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.selection-count { font-weight: 600; color: var(--accent); }
.selection-sep { width: 1px; height: 18px; background: var(--glass-border); }

/* === SETTINGS === */
.settings-section { padding: 0 2rem 2rem; max-width: 600px; }
.settings-group { margin-bottom: 1.5rem; }
.settings-group-title { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.75rem; }
.settings-item { display: flex; align-items: center; justify-content: space-between; padding: 0.85rem 1rem; background: var(--bg-card); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); margin-bottom: 0.4rem; }
.settings-item-label { font-size: 0.88rem; }
.settings-item-desc { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.15rem; }

/* === ADMIN / GUEST === */
.admin-only { display: none !important; }
body.is-admin .admin-only { display: flex !important; }
body.is-admin .admin-only.btn-primary,
body.is-admin button.admin-only.btn-primary { display: inline-flex !important; }
body.is-admin .form-check.admin-only { display: flex !important; }

/* selection bar hidden unless photos selected — see .selection-bar.visible above */

/* === ANIMATIONS === */
.fade-up {
  animation: fadeUp 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}