/* ============================================
   📸 Семейный альбом — Modern Design
   Тёмная тема по умолчанию + светлая по data-theme
   ============================================ */

:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --display: 'Playfair Display', Georgia, 'Times New Roman', serif;

  --bg0: #0f0c0b;
  --bg1: #16110f;
  --surface: #1c1613;
  --surface-2: #251d18;
  --surface-3: #2d241e;

  --text: #f2ece6;
  --text-2: #b0a398;
  --text-3: #7f7266;

  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --accent1: #ffb86b;
  --accent2: #ff7e5f;
  --accent-grad: linear-gradient(135deg, #ffb86b 0%, #ff7e5f 100%);
  --glow: rgba(255, 130, 90, 0.28);

  --danger: #ff6b6b;
  --ok: #69d68a;

  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
  --ring: 0 0 0 4px rgba(255, 126, 95, 0.18);

  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 28px;

  --header-h: 64px;
  --ease: cubic-bezier(0.33, 1, 0.68, 1);
  --fast: 150ms;
  --mid: 300ms;
}

[data-theme="light"] {
  --bg0: #faf6f1;
  --bg1: #f2ebe1;
  --surface: #ffffff;
  --surface-2: #fff6ee;
  --surface-3: #f8ecdc;

  --text: #2b231e;
  --text-2: #6f6258;
  --text-3: #a19284;

  --border: rgba(90, 66, 48, 0.12);
  --border-strong: rgba(90, 66, 48, 0.22);

  --accent1: #e8853f;
  --accent2: #ef6351;
  --accent-grad: linear-gradient(135deg, #eea24b 0%, #ef6351 100%);
  --glow: rgba(232, 133, 63, 0.25);

  --shadow: 0 12px 30px rgba(120, 82, 50, 0.14);
  --shadow-lg: 0 26px 60px rgba(120, 82, 50, 0.22);
  --ring: 0 0 0 4px rgba(239, 99, 81, 0.15);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 16px;
  color: var(--text);
  background: var(--bg0);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--mid) var(--ease), color var(--mid) var(--ease);
}

::selection { background: var(--accent2); color: #fff; }

/* СКРОЛЛ */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background-color: var(--accent2); }

/* ─── ФОНОВЫЕ ОРБЫ ─── */
.bg-orbs {
  position: fixed; inset: 0; z-index: -1;
  overflow: hidden; pointer-events: none;
}
.orb {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: 0.5;
  animation: drift 26s ease-in-out infinite alternate;
}
.orb-1 { width: 60vmax; height: 60vmax; top: -20vmax; left: -15vmax; background: radial-gradient(circle, #3a2a1c 0%, transparent 60%); }
.orb-2 { width: 50vmax; height: 50vmax; bottom: -22vmax; right: -12vmax; background: radial-gradient(circle, #3d241b 0%, transparent 60%); animation-delay: -8s; }
.orb-3 { width: 34vmax; height: 34vmax; top: 30%; left: 55%; background: radial-gradient(circle, rgba(139, 78, 40, 0.5) 0%, transparent 65%); animation-delay: -16s; }
[data-theme="light"] .orb-1 { background: radial-gradient(circle, #f6ddc0 0%, transparent 60%); }
[data-theme="light"] .orb-2 { background: radial-gradient(circle, #f6cdbb 0%, transparent 60%); }
[data-theme="light"] .orb-3 { background: radial-gradient(circle, rgba(255, 190, 140, 0.6) 0%, transparent 65%); }

@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(6vmax, -4vmax) scale(1.12); }
}

/* ─── КНОПКИ ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  border: none; border-radius: 999px;
  font-family: var(--font);
  font-size: 14px; font-weight: 600;
  cursor: pointer; user-select: none;
  color: var(--text);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border);
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease),
    background var(--fast) var(--ease), opacity var(--fast) var(--ease), color var(--fast) var(--ease);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--border-strong), 0 8px 22px rgba(0,0,0,0.18); background: var(--surface-3); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: default; transform: none; }

.btn-primary {
  color: #fff;
  background: var(--accent-grad);
  box-shadow: 0 10px 26px var(--glow), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.btn-primary:hover { box-shadow: 0 14px 34px var(--glow), inset 0 0 0 1px rgba(255,255,255,0.22); transform: translateY(-2px); }

.btn-ghost { background: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }

.btn-outline { background: transparent; box-shadow: inset 0 0 0 1.5px var(--border-strong); color: var(--text); }
.btn-outline:hover { box-shadow: inset 0 0 0 1.5px var(--accent2); color: var(--accent2); background: transparent; }

.btn-danger { background: linear-gradient(135deg, #ff6b6b, #e63946); color: #fff; box-shadow: 0 8px 22px rgba(230, 57, 70, 0.3); }

.btn-warm { color: #fff; background: var(--accent-grad); box-shadow: 0 8px 22px var(--glow); }
.btn-warm:hover { box-shadow: 0 12px 30px var(--glow); }

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 50%; font-size: 17px; }
.btn-icon-lg { width: 46px; height: 46px; border-radius: 50%; font-size: 20px; }

/* ─── ФОРМЫ ─── */
.form-group { margin-bottom: 16px; text-align: left; }
.form-group label {
  display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.4px;
  margin-bottom: 7px; color: var(--text-2); text-transform: uppercase;
}
.form-group input {
  width: 100%; padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font); font-size: 15px;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.form-group input::placeholder { color: var(--text-3); }
.form-group input:focus {
  outline: none; border-color: var(--accent2);
  box-shadow: var(--ring);
}

.error-message { color: var(--danger); font-size: 13px; margin-top: 10px; font-weight: 500; min-height: 18px; }
.auth-link { margin-top: 20px; font-size: 13.5px; color: var(--text-2); }
.auth-link a { color: var(--accent2); font-weight: 700; cursor: pointer; }

/* ─── АВТОРИЗАЦИЯ ─── */
.auth-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px; position: relative;
}
.auth-box {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
  animation: rise 0.6s var(--ease) both;
}
.auth-box .logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 74px; height: 74px; border-radius: 24px;
  background: var(--accent-grad);
  box-shadow: 0 14px 34px var(--glow);
  font-size: 36px; margin-bottom: 18px;
  transform: rotate(-6deg);
}
.auth-box h1 {
  font-family: var(--display);
  font-size: 30px; font-weight: 800;
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px; letter-spacing: -0.5px;
}
.auth-box .subtitle { color: var(--text-2); font-size: 14px; margin-bottom: 26px; }
.auth-box .btn-primary { width: 100%; padding: 13px; font-size: 15px; }

.theme-toggle-inline { margin-top: 22px; }

/* ─── ТЕМА-ТОГГЛ ─── */
.theme-toggle {
  position: relative; width: 60px; height: 32px;
  border-radius: 999px; border: none; cursor: pointer;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border-strong);
  transition: background var(--mid) var(--ease);
}
.theme-toggle .knob {
  position: absolute; top: 3px; left: 3px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: #fff;
  transition: transform var(--mid) var(--ease);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
[data-theme="light"] .theme-toggle .knob { transform: translateX(28px); }

/* ─── ШАПКА ─── */
.header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  padding: 0 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: color-mix(in srgb, var(--bg0) 72%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.header-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand .logo {
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; box-shadow: 0 6px 16px var(--glow);
}
.brand-title {
  font-family: var(--display); font-size: 20px; font-weight: 800;
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}
.header-right { display: flex; align-items: center; gap: 8px; }
.header-right .username {
  font-size: 13px; color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 999px;
  display: flex; align-items: center; gap: 6px;
  max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ─── КОНТЕЙНЕР ─── */
.container { max-width: 1280px; margin: 0 auto; padding: 26px 22px; }

/* ─── ТУЛБАР ─── */
.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.toolbar-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar h2 { font-family: var(--display); font-size: 22px; font-weight: 700; }
.toolbar .stats {
  font-size: 13px; color: var(--text-2);
  background: var(--surface-2); padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--border);
}

.view-btn {
  width: 38px; height: 38px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface-2);
  cursor: pointer; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2); transition: all var(--fast) var(--ease);
}
.view-btn:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px); }
.view-btn.active {
  background: var(--accent-grad); color: #fff; border-color: transparent;
  box-shadow: 0 8px 20px var(--glow);
}
.toolbar .divider { width: 1px; height: 24px; background: var(--border); margin: 0 4px; }

/* ─── ОБЛАСТЬ ЗАГРУЗКИ ─── */
.upload-area {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 30px 20px; text-align: center; cursor: pointer;
  margin-bottom: 24px;
  transition: all var(--mid) var(--ease);
  background: var(--surface);
}
.upload-area:hover, .upload-area.dragover {
  border-color: var(--accent2);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 4px var(--glow);
  transform: translateY(-2px);
}
.upload-area .icon { font-size: 42px; margin-bottom: 10px; filter: drop-shadow(0 6px 14px var(--glow)); animation: float 3.5s ease-in-out infinite; }
.upload-area p { color: var(--text-2); font-size: 14.5px; line-height: 1.6; }
.upload-area strong { color: var(--text); }

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ─── СЕТКИ ФОТО ─── */
.photo-grid { position: relative; }

.photo-grid.masonry { column-count: 4; column-gap: 16px; }
.photo-grid.masonry .photo-card { break-inside: avoid; margin-bottom: 16px; display: inline-block; width: 100%; }
.photo-grid.masonry .photo-card .card-img img { height: auto; max-height: none; }

.photo-grid.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; column-count: unset; }
.photo-grid.grid .photo-card .card-img img { height: 200px; }

.photo-grid.timeline { display: flex; flex-direction: column; gap: 12px; }
.photo-grid.timeline .photo-card { display: flex; flex-direction: row; }
.photo-grid.timeline .photo-card .card-img { width: 140px; flex-shrink: 0; }
.photo-grid.timeline .photo-card .card-img img { height: 140px; }
.photo-grid.timeline .photo-card .info { flex: 1; display: flex; flex-direction: column; justify-content: center; }

/* ─── КАРТОЧКА ─── */
.photo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform var(--mid) var(--ease), box-shadow var(--mid) var(--ease), border-color var(--mid) var(--ease);
  animation: rise 0.5s var(--ease) both;
}
.photo-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}
.card-img { position: relative; overflow: hidden; background: var(--surface-2); aspect-ratio: 4 / 5; }
.card-img img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transform: scale(1.001);
  transition: transform var(--mid) var(--ease), opacity var(--mid) var(--ease);
}
.photo-card:hover .card-img img { transform: scale(1.07); }
.card-img .zoom-badge {
  position: absolute; top: 10px; right: 10px;
  width: 30px; height: 30px; border-radius: 50%;
  background: color-mix(in srgb, #000 35%, transparent);
  backdrop-filter: blur(6px);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 14px; opacity: 0; transform: scale(0.7);
  transition: all var(--mid) var(--ease);
}
.photo-card:hover .zoom-badge { opacity: 1; transform: scale(1); }
.photo-card.is-video .card-img::after {
  content: '▶';
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  color: #fff; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  padding-left: 3px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  transition: transform var(--mid) var(--ease), background var(--mid) var(--ease);
}
.photo-card.is-video:hover .card-img::after { transform: translate(-50%, -50%) scale(1.12); background: var(--accent2); }

.photo-card .info { padding: 11px 14px 13px; }
.photo-card .info .caption {
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px;
}
.photo-card .info .meta { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }

/* ─── ГОДОВЫЕ ЗАГОЛОВКИ ─── */
.year-header {
  font-family: var(--display); font-size: 26px; font-weight: 700; color: var(--text);
  margin: 22px 0 14px; display: flex; align-items: center; gap: 12px;
  grid-column: 1 / -1;
  animation: rise 0.5s var(--ease) both;
}
.year-header::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--accent1), transparent);
  opacity: 0.5;
}
.timeline .year-header { margin: 14px 0 10px; }

/* ─── СКЕЛЕТОНЫ ─── */
.skeleton-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px;
}
.skeleton-card {
  border-radius: var(--radius); overflow: hidden; background: var(--surface);
  border: 1px solid var(--border);
}
.skeleton-card .sk-img { height: 240px; }
.skeleton-card .sk-line { height: 12px; border-radius: 6px; margin: 12px 14px; }
.skeleton-card .sk-line.short { width: 60%; margin-top: 0; }
.sk-img, .sk-line, .sk-block {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite linear;
  border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ─── ПОКАЗАТЕЛЬ ЗАГРУЗКИ ─── */
.loader-wrap { display: flex; align-items: center; justify-content: center; padding: 34px 0; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--border-strong);
  border-top-color: var(--accent2);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-banner { text-align: center; padding: 46px 0; color: var(--text-2); }
.loading-banner .pulse { font-size: 44px; animation: float 2s ease-in-out infinite; display: inline-block; }
.loading-banner p { margin-top: 10px; font-size: 14px; }

/* ─── ПУСТО ─── */
.empty {
  text-align: center; padding: 64px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: rise 0.5s var(--ease) both;
}
.empty .icon { font-size: 68px; margin-bottom: 14px; filter: drop-shadow(0 10px 24px var(--glow)); animation: float 3s ease-in-out infinite; }
.empty h3 { font-family: var(--display); font-size: 24px; margin-bottom: 8px; }
.empty p { color: var(--text-2); font-size: 14px; margin-bottom: 18px; }

/* ─── МОДАЛ (ЛАЙТБОКС) ─── */
.modal {
  position: fixed; inset: 0; z-index: 1200;
  display: none; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--bg0) 88%, transparent);
  backdrop-filter: blur(14px);
}
.modal.active { display: flex; animation: fade 0.25s var(--ease) both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal-stage {
  max-width: 96vw; max-height: 96vh;
  overflow: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}
.modal-stage img { display: block; }
.modal-stage img.fit { max-width: 100%; max-height: 100%; object-fit: contain; width: auto; height: auto; }
.modal-stage video.fit { display: block; max-width: 100%; max-height: 100%; object-fit: contain; margin: auto; }

.modal-info {
  position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%);
  width: min(480px, calc(100vw - 40px));
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  text-align: center;
  transition: opacity var(--mid) var(--ease), transform var(--mid) var(--ease);
}
.modal-info .caption { font-size: 15.5px; font-weight: 600; margin-bottom: 4px; }
.modal-info .meta { font-size: 12px; color: var(--text-3); }
.modal-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; justify-content: center; }
.modal-actions .btn { font-size: 13px; }
.zoom-info {
  font-size: 12px; color: var(--text-3); margin-left: 4px;
  min-width: 44px; font-variant-numeric: tabular-nums;
}

.modal-close, .modal-nav, .zoom-btn {
  position: fixed; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text); background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--border-strong), var(--shadow);
  transition: all var(--fast) var(--ease);
}
.modal-close:hover, .modal-nav:hover, .zoom-btn:hover { background: var(--surface-3); transform: translateY(-2px); }

.modal-close { top: 18px; right: 18px; width: 44px; height: 44px; border-radius: 50%; font-size: 22px; z-index: 10; }
.modal-nav { top: 50%; transform: translateY(-50%); width: 50px; height: 50px; border-radius: 50%; font-size: 26px; z-index: 5; }
.modal-nav:hover { transform: translateY(-50%) scale(1.06); }
.modal-nav-left { left: 20px; }
.modal-nav-right { right: 20px; }
.modal-nav.hidden { opacity: 0; pointer-events: none; }

.zoom-bar {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 999px; padding: 6px;
  box-shadow: var(--shadow);
  z-index: 8;
}
.zoom-btn { position: static; width: 36px; height: 36px; border-radius: 50%; font-size: 16px; }

/* Полный экран: прячем панели */
.modal.fullscreen .modal-info,
.modal.fullscreen .zoom-bar { opacity: 0; transform: translate(-50%, 20px); pointer-events: none; }
.modal.fullscreen .modal-stage { max-width: 100vw; max-height: 100vh; border-radius: 0; border: none; }
.mbtn-fullscreen { color: var(--text); }

/* ─── СЛАЙД-ШОУ ─── */
.slideshow-overlay {
  position: fixed; inset: 0; z-index: 3000;
  display: none; align-items: center; justify-content: center;
  background: #050403;
}
.slideshow-overlay.active { display: flex; }
.slideshow-overlay img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; border-radius: 0;
  animation: fadeScale 0.5s var(--ease) both;
}
.slideshow-overlay video {
  max-width: 100%; max-height: 100%;
  object-fit: contain; border-radius: 0; outline: none;
}
@keyframes fadeScale { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
.slideshow-overlay .slideshow-ui {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(12px);
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
}
.slideshow-overlay .slideshow-ui .btn { background: transparent; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25); color: #fff; }
.slideshow-overlay .slideshow-ui .btn:hover { background: rgba(255,255,255,0.1); }
.slideshow-overlay .slideshow-close {
  position: absolute; top: 20px; right: 26px;
  font-size: 34px; color: #fff; cursor: pointer; opacity: 0.6;
  background: none; border: none; z-index: 10; line-height: 1;
  transition: opacity var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.slideshow-overlay .slideshow-close:hover { opacity: 1; transform: rotate(90deg); }
.slideshow-overlay .slideshow-counter { color: rgba(255,255,255,0.7); font-size: 13px; padding: 0 6px; font-variant-numeric: tabular-nums; }

/* ─── ТОСТ ─── */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--surface-2);
  color: var(--text);
  padding: 12px 22px; border-radius: 999px; font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-strong);
  z-index: 4000;
  opacity: 0; pointer-events: none;
  transition: all var(--mid) var(--ease);
  display: flex; align-items: center; gap: 8px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success::before { content: '✅'; }
.toast.error::before { content: '⚠️'; }

/* ─── АНИМАЦИЯ ПОЯВЛЕНИЯ ─── */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.entered .photo-card { opacity: 0; }
.entered .photo-card.in { opacity: 1; transition: opacity 0.4s var(--ease); }

/* ─── АДАПТИВ ─── */
@media (max-width: 1024px) { .photo-grid.masonry { column-count: 3; } }
@media (max-width: 720px) {
  .container { padding: 16px 14px; }
  .header { padding: 0 14px; }
  .brand-title { font-size: 17px; }
  .header-right .username { display: none; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-left, .toolbar-right { justify-content: center; }
  .toolbar-right .divider { display: none; }
  .photo-grid.masonry { column-count: 2; column-gap: 10px; }
  .photo-grid.masonry .photo-card { margin-bottom: 10px; }
  .photo-grid.grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .photo-grid.timeline .photo-card .card-img { width: 90px; }
  .photo-grid.timeline .photo-card .card-img img { height: 90px; }
  .upload-area { padding: 22px 14px; }
  .auth-box { padding: 30px 22px; margin: 8px; }
  .modal-nav { width: 42px; height: 42px; font-size: 22px; }
  .modal-nav-left { left: 6px; }
  .modal-nav-right { right: 6px; }
  .modal-info { width: calc(100vw - 24px); }
  .zoom-bar { gap: 4px; }
  .skeleton-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
}
@media (max-width: 400px) { .photo-grid.masonry { column-count: 1; } }

/* Небольшие плавные переходы темы */
body, .header, .toolbar, .empty, .auth-box, .modal-stage, .modal-info, .toast,
.upload-area, .form-group input {
  transition: background var(--mid) var(--ease), color var(--mid) var(--ease),
    border-color var(--mid) var(--ease), box-shadow var(--mid) var(--ease);
}
