/* ═══════════════════════════════════════════════════════════
   NOTRE MÉMOIRE — Design System
   Palette : encre #1C1917 · parchemin #FAF7F2 · or #C9A96E
             bois #8B6F5C · lin #E8DDD0
   Typo    : Playfair Display (display) + Inter (corps)
   ═══════════════════════════════════════════════════════════ */

/* ─── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink:        #1C1917;
  --ink-muted:  #57534e;
  --parchment:  #FAF7F2;
  --parch-warm: #F5EFE6;
  --gold:       #C9A96E;
  --gold-light: #DFC090;
  --gold-muted: #E8D5B5;
  --rosewood:   #8B6F5C;
  --linen:      #E8DDD0;
  --linen-dark: #D4C4B2;

  --bg:           var(--parchment);
  --surface:      #FFFFFF;
  --surface-2:    #FAFAF8;
  --border:       var(--linen);
  --border-mid:   var(--linen-dark);
  --text:         var(--ink);
  --text-muted:   var(--ink-muted);
  --accent:       var(--gold);

  --sidebar-w: 240px;
  --header-h:  56px;
  --mobile-nav-h: 64px;
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(28,25,23,.07), 0 1px 2px rgba(28,25,23,.05);
  --shadow:    0 4px 12px rgba(28,25,23,.08), 0 2px 4px rgba(28,25,23,.05);
  --shadow-lg: 0 16px 40px rgba(28,25,23,.12), 0 4px 8px rgba(28,25,23,.07);
  --transition: 150ms ease;
}

/* Dark mode */
body.dark-mode {
  --bg:        #141210;
  --surface:   #1C1917;
  --surface-2: #211E1B;
  --border:    #292524;
  --border-mid:#3a3633;
  --text:      #FAF7F2;
  --text-muted:#a8a29e;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

h1,h2,h3,h4 { font-family: 'Playfair Display', Georgia, serif; font-weight: 500; line-height: 1.25; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }
img, video { display: block; max-width: 100%; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ─── Typography helpers ────────────────────────────────── */
.view-title    { font-size: 1.875rem; color: var(--text); }
.view-subtitle { font-size: .875rem; color: var(--text-muted); margin-top: .25rem; }
.section-title { font-size: 1.125rem; color: var(--text); }

/* ─── Buttons ───────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .625rem 1.25rem;
  background: var(--ink); color: var(--parchment);
  border-radius: var(--radius-sm); font-size: .875rem; font-weight: 500;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: #2c2826; box-shadow: var(--shadow); }
.btn-primary:active { transform: scale(.98); }
.btn-primary svg { stroke: var(--gold); }
.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: .4rem .875rem; font-size: .8125rem; }

.btn-ghost {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem .875rem;
  color: var(--text-muted); border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.btn-ghost:hover { background: var(--linen); color: var(--text); }
body.dark-mode .btn-ghost:hover { background: var(--border); }
.btn-back { gap: .25rem; padding-left: 0; }

/* ─── Form elements ─────────────────────────────────────── */
.field-group { display: flex; flex-direction: column; gap: .375rem; }
.field-group label {
  font-size: .75rem; font-weight: 500; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-muted);
}
.field-group input,
.field-group select,
.field-group textarea {
  width: 100%; padding: .625rem .875rem;
  background: var(--surface); color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: .9375rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.field-group input:focus,
.field-group select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,169,110,.15); }
.field-group input::placeholder { color: var(--border-mid); }

.field-wrap { position: relative; }
.field-wrap .field-icon { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.field-wrap input { padding-left: 2.5rem; }
.pwd-toggle {
  position: absolute; right: .75rem; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); padding: .25rem;
  transition: color var(--transition);
}
.pwd-toggle:hover { color: var(--text); }

/* ─── Login Screen ──────────────────────────────────────── */
.login-screen { display: flex; min-height: 100vh; }

.login-left {
  width: 50%; position: relative; overflow: hidden;
  background: var(--ink);
}
.login-deco-grid {
  position: absolute; inset: 0; display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: .75rem; padding: 2.5rem; opacity: .12;
}
.login-deco-grid div { background: #fff; border-radius: var(--radius); }
.login-deco-grid div:nth-child(2) { transform: scaleY(1.3); }
.login-deco-grid div:nth-child(4) { transform: scaleY(.8); }
.login-deco-grid div:nth-child(8) { transform: scaleY(1.5); }

.login-left-content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; justify-content: center;
  height: 100%; padding: 4rem;
}
.login-logo {
  display: flex; align-items: center; gap: .75rem;
  font-family: 'Playfair Display', serif; font-size: 1.25rem;
  color: var(--parchment); margin-bottom: 3.5rem;
}
.login-headline {
  font-size: 3rem; color: var(--parchment); line-height: 1.15; margin-bottom: 1.25rem;
}
.login-headline em { color: var(--gold); font-style: italic; }
.login-sub { font-size: 1rem; color: rgba(250,247,242,.55); line-height: 1.65; max-width: 26rem; }
.login-divider {
  display: flex; align-items: center; gap: 1rem; margin-top: 3rem;
  color: rgba(201,169,110,.4);
}
.login-divider span { flex: 1; height: 1px; background: rgba(201,169,110,.25); }

.login-right {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 2.5rem;
}
.login-form-wrap { width: 100%; max-width: 380px; }
.login-mobile-logo {
  display: none; align-items: center; gap: .5rem;
  font-family: 'Playfair Display', serif; font-size: 1.1rem;
  color: var(--text); margin-bottom: 2.5rem; justify-content: center;
}
.login-form-wrap h2 { font-size: 1.875rem; color: var(--text); margin-bottom: .375rem; }
.login-form-sub { font-size: .875rem; color: var(--text-muted); margin-bottom: 2rem; }
.login-form-wrap form { display: flex; flex-direction: column; gap: 1.125rem; }
.login-error { font-size: .8125rem; color: #c0392b; min-height: 1.2rem; }
.login-footnote {
  margin-top: 2rem; text-align: center;
  font-size: .75rem; color: var(--border-mid);
}

/* ─── App Shell ─────────────────────────────────────────── */
.app { min-height: 100vh; }

/* Sidebar */
.sidebar {
  position: fixed; left: 0; top: 0; height: 100vh;
  width: var(--sidebar-w); z-index: 100;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: transform var(--transition), background var(--transition);
}
.sidebar-logo {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}
.nav-logo-link {
  display: flex; align-items: center; gap: .625rem;
}
.logo-top, .logo-bottom {
  display: block; font-family: 'Playfair Display', serif;
  font-size: 1rem; line-height: 1.1;
}
.logo-top  { color: var(--text); }
.logo-bottom { color: var(--gold); font-style: italic; }

.sidebar-nav { flex: 1; padding: .75rem .75rem; display: flex; flex-direction: column; gap: .125rem; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .5625rem .875rem; border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 500; color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
  line-height: 1;
}
.nav-item:hover { background: var(--parch-warm); color: var(--text); }
body.dark-mode .nav-item:hover { background: var(--border); }
.nav-item.active { background: var(--ink); color: var(--parchment); }
body.dark-mode .nav-item.active { background: var(--surface-2); color: var(--text); }
.nav-item.active svg { color: var(--gold); }
.nav-upload {
  margin-top: auto;
  background: var(--gold-muted); color: var(--ink) !important;
}
.nav-upload:hover { background: var(--gold-light) !important; }
body.dark-mode .nav-upload { background: rgba(201,169,110,.15); color: var(--gold) !important; }

.sidebar-bottom { padding: .75rem .75rem 1rem; }
.sidebar-divider { height: 1px; background: var(--border); margin-bottom: .75rem; }
.theme-toggle { width: 100%; }
.theme-label { font-size: .8125rem; }
.sidebar-user {
  display: flex; align-items: center; gap: .625rem;
  padding: .5rem .625rem; border-radius: var(--radius-sm);
  background: var(--parch-warm); margin-top: .25rem;
}
body.dark-mode .sidebar-user { background: var(--surface-2); }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--ink); color: var(--gold);
  font-family: 'Playfair Display', serif; font-size: .875rem;
  display: flex; align-items: center; justify-content: center; shrink: 0;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { font-size: .8125rem; font-weight: 500; color: var(--text); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logout-btn { color: var(--text-muted); padding: .25rem; transition: color var(--transition); }
.logout-btn:hover { color: #c0392b; }

/* Mobile header */
.mobile-header {
  display: none; position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  height: var(--header-h); background: var(--surface);
  border-bottom: 1px solid var(--border);
  align-items: center; justify-content: space-between; padding: 0 1rem;
}
.mobile-logo { font-family: 'Playfair Display', serif; font-size: 1.0625rem; color: var(--text); }
.mobile-menu-btn, .mobile-upload-btn {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); color: var(--text);
  transition: background var(--transition);
}
.mobile-menu-btn:hover, .mobile-upload-btn:hover { background: var(--linen); }
.sidebar-overlay {
  display: none; position: fixed; inset: 0; z-index: 99;
  background: rgba(28,25,23,.45); backdrop-filter: blur(2px);
}
.sidebar-overlay.show { display: block; }
@media (max-width: 768px) {
  .sidebar { display: none; transform: translateX(-100%); transition: transform .25s ease; }
  .sidebar.open { display: flex; transform: translateX(0); }
  .mobile-header { display: flex; }
  .mobile-upload-btn { background: var(--ink); border-radius: 50%; }
  .mobile-upload-btn svg { stroke: var(--gold); }
}

/* Mobile bottom nav */
.mobile-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
  height: var(--mobile-nav-h); background: var(--surface);
  border-top: 1px solid var(--border);
  align-items: center; justify-content: space-around; padding: 0 .5rem;
}
.mob-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: .25rem;
  padding: .5rem .625rem; border-radius: var(--radius-sm);
  font-size: .6875rem; font-weight: 500; color: var(--text-muted);
  transition: color var(--transition);
  min-width: 52px; text-align: center;
}
.mob-nav-item.active { color: var(--ink); }
body.dark-mode .mob-nav-item.active { color: var(--parchment); }
.mob-nav-item.active svg { stroke: var(--gold); }
.mob-upload-center {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--ink); color: var(--parchment) !important; min-width: 0;
  box-shadow: 0 2px 12px rgba(28,25,23,.2);
  padding: 0; justify-content: center;
}
.mob-upload-center svg { stroke: var(--gold); }
@media (max-width: 768px) {
  .mobile-nav { display: flex; }
}

/* Main content */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  transition: background var(--transition);
}
@media (max-width: 768px) {
  .main-content { margin-left: 0; padding-top: var(--header-h); padding-bottom: var(--mobile-nav-h); }
}

/* Views */
.view { display: none; padding: 2rem 2.5rem 3rem; animation: fadeUp .3s ease; }
.view.active { display: block; }
@media (max-width: 768px) { .view { padding: 1.25rem 1rem 1.5rem; } }

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

.view-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 2rem; gap: 1rem; flex-wrap: wrap;
}
.header-actions { display: flex; align-items: center; gap: .75rem; flex-shrink: 0; }

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem; margin-top: 2.5rem;
}

/* ─── Home view ─────────────────────────────────────────── */
.home-grid { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: stretch; }
@media (max-width: 900px) { .home-grid { grid-template-columns: 1fr; } }

.counter-card {
  background: var(--ink); color: var(--parchment);
  border-radius: var(--radius-lg); padding: 2rem 2.25rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 180px; text-align: center; position: relative; overflow: hidden;
}
.counter-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 40%, rgba(201,169,110,.12) 0%, transparent 70%);
  pointer-events: none;
}
.counter-number {
  font-family: 'Playfair Display', serif; font-size: 3.5rem;
  font-weight: 600; color: var(--gold); line-height: 1;
  margin-bottom: .375rem;
}
.counter-label { font-size: .8125rem; color: rgba(250,247,242,.6); text-transform: uppercase; letter-spacing: .08em; }
.counter-since { font-size: .75rem; color: rgba(250,247,242,.35); margin-top: .5rem; }

.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.25rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.stat-card:hover { border-color: var(--gold-muted); box-shadow: var(--shadow-sm); }
.stat-num {
  font-family: 'Playfair Display', serif; font-size: 1.75rem;
  color: var(--text); font-weight: 500;
}
.stat-label { font-size: .75rem; color: var(--text-muted); margin-top: .125rem; }

/* Random memory */
.random-memory-wrap { border-radius: var(--radius-lg); overflow: hidden; }
.random-memory {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
}
.random-memory-img {
  width: 100%; max-height: 420px; object-fit: cover; display: block;
}
.random-memory-info {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 1.5rem;
  background: linear-gradient(to top, rgba(28,25,23,.8) 0%, transparent 100%);
}
.random-memory-caption { font-size: 1rem; color: #fff; font-family: 'Playfair Display', serif; font-style: italic; }
.random-memory-date { font-size: .75rem; color: rgba(255,255,255,.6); margin-top: .25rem; }

/* Recent grid */
.recent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .75rem; }
.recent-item { position: relative; border-radius: var(--radius); overflow: hidden; cursor: pointer; aspect-ratio: 1; background: var(--linen); }
.recent-item img, .recent-item video { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.recent-item:hover img, .recent-item:hover video { transform: scale(1.04); }
.recent-item .fav-badge { position: absolute; top: .4rem; right: .4rem; color: #e74c3c; filter: drop-shadow(0 1px 2px rgba(0,0,0,.3)); }

/* ─── Gallery view ──────────────────────────────────────── */
.search-wrap { position: relative; }
.search-icon { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.search-input {
  padding: .5rem .75rem .5rem 2.25rem;
  background: var(--surface); color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: .875rem; width: 200px;
  transition: border-color var(--transition), box-shadow var(--transition); outline: none;
}
.search-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,169,110,.15); width: 260px; }

/* Month group */
.month-group { margin-bottom: 2.5rem; }
.month-label {
  font-family: 'Playfair Display', serif; font-size: 1.0625rem;
  color: var(--text); margin-bottom: .875rem; padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}
.masonry-grid { columns: 4 160px; column-gap: .75rem; }
.masonry-item { break-inside: avoid; margin-bottom: .75rem; }
.media-card {
  position: relative; border-radius: var(--radius); overflow: hidden;
  cursor: pointer; background: var(--linen); display: block;
  transition: box-shadow .2s ease, transform .2s ease;
}
.media-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.media-card img, .media-card video { width: 100%; display: block; object-fit: cover; }
.media-overlay {
  position: absolute; inset: 0; opacity: 0; transition: opacity .2s ease;
  background: linear-gradient(to top, rgba(28,25,23,.65) 0%, transparent 55%);
  display: flex; align-items: flex-end; padding: .625rem;
}
.media-card:hover .media-overlay { opacity: 1; }
.media-actions { display: flex; gap: .375rem; margin-left: auto; }
.media-action {
  width: 30px; height: 30px; border-radius: 50%; background: rgba(250,247,242,.15);
  backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center;
  color: #fff; transition: background var(--transition);
}
.media-action:hover { background: rgba(250,247,242,.3); }
.media-action.fav.active { color: #e74c3c; }
.video-badge {
  position: absolute; top: .5rem; left: .5rem;
  background: rgba(28,25,23,.7); color: #fff;
  font-size: .6875rem; padding: .2rem .5rem; border-radius: 4px;
  display: flex; align-items: center; gap: .25rem;
}

/* ─── Albums ────────────────────────────────────────────── */
.albums-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.album-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform .2s ease;
}
.album-card:hover { border-color: var(--gold-muted); box-shadow: var(--shadow); transform: translateY(-2px); }
.album-cover {
  width: 100%; aspect-ratio: 4/3; background: var(--parch-warm);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
.album-cover img { width: 100%; height: 100%; object-fit: cover; }
.album-cover-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px; width: 100%; height: 100%;
}
.album-cover-grid img { width: 100%; height: 100%; object-fit: cover; }
.album-emoji-cover { font-size: 2.5rem; }
.album-info { padding: .875rem 1rem 1rem; }
.album-info-emoji { font-size: 1.125rem; margin-bottom: .125rem; }
.album-name {
  font-family: 'Playfair Display', serif; font-size: .9375rem;
  font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.album-meta { font-size: .75rem; color: var(--text-muted); margin-top: .25rem; }

/* Album detail */
.album-detail-header { text-align: center; padding: 2rem 1rem; }
.album-emoji-large { font-size: 3rem; margin-bottom: .75rem; }
.album-detail-title { font-size: 2rem; color: var(--text); margin-bottom: .375rem; }
.album-detail-desc { font-size: .9375rem; color: var(--text-muted); font-style: italic; margin-bottom: .375rem; }
.album-detail-count { font-size: .8125rem; color: var(--text-muted); }

/* ─── Timeline ──────────────────────────────────────────── */
.timeline-content { position: relative; padding-left: 3.5rem; }
.timeline-content::before {
  content: ''; position: absolute; left: 1.5rem; top: 0; bottom: 0; width: 1px;
  background: linear-gradient(to bottom, transparent, var(--gold-muted) 8%, var(--gold-muted) 92%, transparent);
}
.timeline-month { margin-bottom: 2.5rem; }
.timeline-month-header {
  display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem;
  position: relative;
}
.timeline-dot {
  position: absolute; left: -2.375rem; width: 14px; height: 14px; border-radius: 50%;
  background: var(--gold); border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--gold-muted);
}
.timeline-month-label {
  font-family: 'Playfair Display', serif; font-size: 1.0625rem; color: var(--text);
}
.timeline-count { font-size: .75rem; color: var(--text-muted); }
.timeline-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .625rem; }
.timeline-photo { border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; aspect-ratio: 1; background: var(--linen); }
.timeline-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.timeline-photo:hover img { transform: scale(1.05); }

/* ─── Upload view ───────────────────────────────────────── */
.upload-layout { display: flex; flex-direction: column; gap: 1.5rem; max-width: 680px; }
.dropzone {
  border: 2px dashed var(--linen-dark); border-radius: var(--radius-lg);
  padding: 3rem 2rem; text-align: center; cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  position: relative;
}
.dropzone:hover, .dropzone.drag-over { border-color: var(--gold); background: rgba(201,169,110,.04); }
.dropzone-icon { margin: 0 auto 1.25rem; color: var(--text-muted); opacity: .5; }
.dropzone-title { font-family: 'Playfair Display', serif; font-size: 1.125rem; color: var(--text); margin-bottom: .375rem; }
.dropzone-sub { font-size: .875rem; color: var(--text-muted); }
.dropzone-hint { font-size: .75rem; color: var(--border-mid); margin-top: .5rem; }

.upload-queue { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.upload-queue-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.upload-queue-header h3 { font-size: .9375rem; font-weight: 500; color: var(--text); }

.queue-list { padding: .75rem 1.25rem; display: flex; flex-direction: column; gap: .625rem; max-height: 280px; overflow-y: auto; }
.queue-item { display: flex; align-items: center; gap: .75rem; padding: .5rem .75rem; background: var(--parch-warm); border-radius: var(--radius-sm); }
body.dark-mode .queue-item { background: var(--surface-2); }
.queue-thumb { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; flex-shrink: 0; background: var(--linen); }
.queue-name { font-size: .8125rem; color: var(--text); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-size { font-size: .75rem; color: var(--text-muted); flex-shrink: 0; }
.queue-remove { color: var(--text-muted); padding: .25rem; border-radius: 4px; transition: color var(--transition), background var(--transition); }
.queue-remove:hover { color: #c0392b; background: rgba(192,57,43,.08); }

.upload-meta-form { padding: 1rem 1.25rem 0; display: flex; flex-direction: column; gap: .875rem; border-top: 1px solid var(--border); margin-top: .75rem; }
.upload-actions { padding: 1rem 1.25rem 1.25rem; }

/* ─── Lightbox ──────────────────────────────────────────── */
.lightbox-backdrop {
  position: fixed; inset: 0; background: rgba(15,12,10,.92);
  z-index: 200; backdrop-filter: blur(4px);
}
.lightbox-backdrop.show { display: block !important; }
.lightbox {
  position: fixed; inset: 0; z-index: 201;
  display: flex; align-items: center; justify-content: center;
}
.lightbox.show { display: flex !important; }
.lightbox-content {
  display: flex; flex-direction: column;
  max-width: min(92vw, 1100px); width: 100%;
  max-height: 92vh;
}
.lightbox-image { max-height: 80vh; object-fit: contain; border-radius: var(--radius); width: 100%; }
.lightbox-info {
  display: flex; align-items: center; justify-content: space-between;
  padding: .875rem 0 0; gap: 1rem;
}
.lightbox-meta { flex: 1; min-width: 0; }
.lightbox-caption { font-family: 'Playfair Display', serif; font-style: italic; color: rgba(250,247,242,.9); font-size: 1rem; }
.lightbox-date { font-size: .75rem; color: rgba(250,247,242,.45); margin-top: .25rem; }
.lightbox-actions { display: flex; gap: .5rem; flex-shrink: 0; }
.lightbox-action-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(250,247,242,.1); color: rgba(250,247,242,.8);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.lightbox-action-btn:hover { background: rgba(250,247,242,.2); color: #fff; }
.lightbox-action-btn.fav-active { color: #e74c3c; }

.lightbox-close {
  position: fixed; top: 1.25rem; right: 1.25rem; z-index: 202;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(250,247,242,.1); color: rgba(250,247,242,.8);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.lightbox-close:hover { background: rgba(250,247,242,.2); }
.lightbox-nav {
  position: fixed; top: 50%; transform: translateY(-50%); z-index: 202;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(250,247,242,.1); color: rgba(250,247,242,.8);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.lightbox-nav:hover { background: rgba(250,247,242,.2); }
.lightbox-prev { left: 1.25rem; }
.lightbox-next { right: 1.25rem; }
@media (max-width: 768px) {
  .lightbox-prev { left: .5rem; }
  .lightbox-next { right: .5rem; }
}

/* ─── Modals ────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(28,25,23,.5);
  z-index: 300; backdrop-filter: blur(3px);
}
.modal-backdrop.show { display: block !important; }
.modal {
  position: fixed; inset: 0; z-index: 301;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal.show { display: flex !important; }
.modal-box {
  background: var(--surface); border-radius: var(--radius-lg);
  width: 100%; max-width: 480px; max-height: 90vh;
  overflow-y: auto; box-shadow: var(--shadow-lg);
  animation: scaleIn .2s ease;
}
.modal-box-sm { max-width: 380px; }
@keyframes scaleIn {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: scale(1); }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 1.125rem; color: var(--text); }
.modal-close {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: background var(--transition);
}
.modal-close:hover { background: var(--linen); }
.modal-sub { padding: .75rem 1.5rem 0; font-size: .875rem; color: var(--text-muted); }
.modal-footer {
  display: flex; justify-content: flex-end; gap: .75rem;
  padding: 1.25rem 1.5rem; border-top: 1px solid var(--border); margin-top: 1.25rem;
}

.modal-box form { padding: 1.25rem 1.5rem; display: flex; flex-direction: column; gap: 1rem; }

/* Emoji picker */
.emoji-picker-wrap label { display: block; font-size: .75rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: .5rem; }
.emoji-grid { display: flex; flex-wrap: wrap; gap: .375rem; }
.emoji-btn {
  width: 40px; height: 40px; border-radius: var(--radius-sm); font-size: 1.25rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--parch-warm); border: 2px solid transparent;
  transition: background var(--transition), border-color var(--transition);
  cursor: pointer;
}
body.dark-mode .emoji-btn { background: var(--surface-2); }
.emoji-btn:hover { background: var(--linen); }
.emoji-btn.selected { border-color: var(--gold); background: rgba(201,169,110,.12); }

/* Add to album grid */
.add-to-album-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: .5rem;
  padding: 1rem 1.5rem; max-height: 340px; overflow-y: auto;
}
.add-album-item {
  aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden;
  cursor: pointer; position: relative; background: var(--linen);
  border: 2.5px solid transparent; transition: border-color var(--transition);
}
.add-album-item.selected { border-color: var(--gold); }
.add-album-item img { width: 100%; height: 100%; object-fit: cover; }
.add-album-check {
  position: absolute; inset: 0; background: rgba(201,169,110,.35);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity var(--transition);
}
.add-album-item.selected .add-album-check { opacity: 1; }
.add-album-check svg { stroke: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }

/* ─── Empty state ───────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1rem; padding: 4rem 2rem; text-align: center; color: var(--text-muted);
}
.empty-state p { font-size: .9375rem; line-height: 1.65; max-width: 280px; }

/* ─── Toast ─────────────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 5rem; right: 1.25rem; z-index: 500;
  display: flex; flex-direction: column; gap: .5rem; pointer-events: none;
}
@media (min-width: 769px) { .toast-container { bottom: 1.5rem; } }
.toast {
  background: var(--ink); color: var(--parchment);
  padding: .75rem 1.125rem; border-radius: var(--radius);
  font-size: .875rem; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: .625rem;
  pointer-events: all; animation: toastIn .25s ease;
  border-left: 3px solid var(--gold);
}
.toast.error { border-left-color: #e74c3c; }
.toast.success { border-left-color: #27ae60; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─── Progress bar (upload) ─────────────────────────────── */
.upload-progress {
  height: 3px; background: var(--linen); border-radius: 2px; overflow: hidden; margin: .5rem 0;
}
.upload-progress-bar {
  height: 100%; background: var(--gold); border-radius: 2px;
  transition: width .3s ease;
}

/* ─── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--linen-dark); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-muted); }

/* ─── Focus ring ─────────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ─── Selection ──────────────────────────────────────────── */
::selection { background: rgba(201,169,110,.2); }

/* ─── Required marker ────────────────────────────────────── */
.required { color: #c0392b; }

/* ─── Login screen responsive ────────────────────────────── */
@media (max-width: 800px) {
  .login-left { display: none; }
  .login-right { width: 100%; }
  .login-mobile-logo { display: flex; }
}
