/* css/style.css — interface de l'album (index.html).
   Prolonge l'ambiance de la connexion : noir profond, chocolat, ambre,
   or doux, beige chaud ; serif pour les titres, sans-serif pour l'interface.
   Les photos restent les vedettes : l'interface s'efface. */

/* ------------------------------------------------------------------ */
/* Jetons de design                                                    */
/* ------------------------------------------------------------------ */

:root {
  --font-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --amber: #e3a457;
  --amber-strong: #c98236;
  --gold: #d8b277;
  --rose: #c99a9a;
  --bordeaux: #6e2a36;

  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --sidebar-w: 268px;
  --topbar-h: 72px;
  --bottom-h: 68px;
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);

  /* Thème sombre (par défaut) */
  --bg: #0e0a08;
  --bg-elev: #15100c;
  --surface: #1b1410;
  --surface-2: #241a14;
  --surface-hover: #2b2018;
  --border: rgba(232, 190, 130, 0.10);
  --border-strong: rgba(232, 190, 130, 0.22);
  --text: #f3ebe0;
  --text-muted: #b3a191;
  --text-faint: #7d6d60;
  --accent: var(--amber);
  --accent-text: #2a170a;
  --accent-soft: rgba(227, 164, 87, 0.13);
  --danger: #ec8f84;
  --danger-soft: rgba(236, 143, 132, 0.12);
  --success: #a9c79a;
  --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, 0.7);
  --shadow-md: 0 14px 34px -14px rgba(0, 0, 0, 0.6);
  --card-placeholder: #1f1712;
  --glow: radial-gradient(70% 60% at 0% 0%, rgba(227, 164, 87, 0.09), transparent 60%);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f6f0e8;
    --bg-elev: #fbf7f2;
    --surface: #ffffff;
    --surface-2: #f3ebe1;
    --surface-hover: #efe4d7;
    --border: rgba(74, 46, 26, 0.10);
    --border-strong: rgba(74, 46, 26, 0.2);
    --text: #2a1d15;
    --text-muted: #6f5d50;
    --text-faint: #9c8a7c;
    --accent: #b9772f;
    --accent-text: #fffaf3;
    --accent-soft: rgba(185, 119, 47, 0.12);
    --danger: #b4483c;
    --danger-soft: rgba(180, 72, 60, 0.09);
    --success: #4e7a3e;
    --shadow-lg: 0 30px 60px -24px rgba(74, 46, 26, 0.3);
    --shadow-md: 0 12px 28px -14px rgba(74, 46, 26, 0.28);
    --card-placeholder: #ece2d6;
    --glow: radial-gradient(70% 60% at 0% 0%, rgba(201, 130, 54, 0.10), transparent 60%);
    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --bg: #f6f0e8;
  --bg-elev: #fbf7f2;
  --surface: #ffffff;
  --surface-2: #f3ebe1;
  --surface-hover: #efe4d7;
  --border: rgba(74, 46, 26, 0.10);
  --border-strong: rgba(74, 46, 26, 0.2);
  --text: #2a1d15;
  --text-muted: #6f5d50;
  --text-faint: #9c8a7c;
  --accent: #b9772f;
  --accent-text: #fffaf3;
  --accent-soft: rgba(185, 119, 47, 0.12);
  --danger: #b4483c;
  --danger-soft: rgba(180, 72, 60, 0.09);
  --success: #4e7a3e;
  --shadow-lg: 0 30px 60px -24px rgba(74, 46, 26, 0.3);
  --shadow-md: 0 12px 28px -14px rgba(74, 46, 26, 0.28);
  --card-placeholder: #ece2d6;
  --glow: radial-gradient(70% 60% at 0% 0%, rgba(201, 130, 54, 0.10), transparent 60%);
  color-scheme: light;
}

/* ------------------------------------------------------------------ */
/* Base                                                                */
/* ------------------------------------------------------------------ */

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.skip-link:focus {
  top: 12px;
}

.icon {
  flex: none;
  display: block;
}

.icon-wrap {
  display: inline-flex;
}

.eyebrow {
  margin: 0 0 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ------------------------------------------------------------------ */
/* Boutons                                                             */
/* ------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 42px;
  padding: 0 1.05rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: none;
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.12s ease, box-shadow 0.2s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn span[class=""],
.btn > span {
  display: inline-flex;
}

.btn--primary {
  background: linear-gradient(180deg, #efbd78 0%, #e09d52 60%, #c98236 100%);
  color: #2a170a;
  box-shadow: 0 8px 22px -10px rgba(227, 164, 87, 0.7), inset 0 1px 0 rgba(255, 245, 225, 0.55);
}

.btn--primary:hover {
  box-shadow: 0 10px 28px -10px rgba(227, 164, 87, 0.85), inset 0 1px 0 rgba(255, 245, 225, 0.55);
  filter: brightness(1.03);
}

.btn--ghost {
  border-color: var(--border-strong);
  color: var(--text);
}

.btn--ghost:hover {
  background: var(--surface-hover);
}

.btn--danger {
  background: var(--danger);
  color: #1f0d0a;
}

.btn--danger-text {
  color: var(--danger);
}

.btn--danger-text:hover {
  background: var(--danger-soft);
}

.btn--sm {
  min-height: 36px;
  padding: 0 0.8rem;
  font-size: 0.84rem;
}

.btn--xs {
  min-height: 30px;
  padding: 0 0.65rem;
  font-size: 0.78rem;
  border-radius: 8px;
}

.btn--block {
  width: 100%;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.icon-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.icon-btn--sm {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

/* ------------------------------------------------------------------ */
/* Écran d'ouverture                                                   */
/* ------------------------------------------------------------------ */

.boot {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(60% 50% at 50% 40%, rgba(227, 164, 87, 0.12), transparent 70%), var(--bg);
  z-index: 50;
}

.boot-card {
  display: grid;
  justify-items: center;
  gap: 1rem;
  padding: 2rem;
  text-align: center;
  max-width: 420px;
}

.boot-lamp {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffe2b0;
  box-shadow: 0 0 30px 10px rgba(227, 164, 87, 0.5), 0 0 90px 30px rgba(227, 164, 87, 0.18);
  animation: boot-glow 1.8s ease-in-out infinite;
}

.boot-icon {
  color: var(--accent);
}

@keyframes boot-glow {
  50% { opacity: 0.6; transform: scale(0.85); }
}

.boot-text {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-style: italic;
  color: var(--text-muted);
}

.boot-actions {
  display: flex;
  gap: 0.6rem;
}

/* ------------------------------------------------------------------ */
/* Mise en page                                                        */
/* ------------------------------------------------------------------ */

.app {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 22px 16px 16px;
  background: var(--glow), var(--bg-elev);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 4px 8px;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(160deg, #3a2417, #140c08);
  box-shadow: inset 0 0 0 1px rgba(232, 190, 130, 0.25);
}

.brand-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 52%;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: #ffe2b0;
  box-shadow: 0 0 12px 4px rgba(227, 164, 87, 0.55);
}

.brand-text {
  display: grid;
  line-height: 1.15;
  min-width: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 600;
  letter-spacing: 0.005em;
}

.brand-space {
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav {
  display: grid;
  gap: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 11px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  transition: background 0.18s ease, color 0.18s ease;
}

.nav-link:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.nav-link.is-active {
  background: var(--accent-soft);
  color: var(--text);
}

.nav-link.is-active .icon {
  color: var(--accent);
}

.sidebar-albums {
  display: grid;
  gap: 4px;
  min-height: 0;
}

.sidebar-albums-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 0 12px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.sidebar-album-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1px;
}

.sidebar-album {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.86rem;
}

.sidebar-album:hover,
.sidebar-album.is-active {
  background: var(--surface-hover);
  color: var(--text);
}

.sidebar-album-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sidebar-album-count {
  font-size: 0.74rem;
  color: var(--text-faint);
}

.sidebar-empty {
  padding: 4px 12px;
  font-size: 0.82rem;
  color: var(--text-faint);
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.profile {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 6px;
  border-radius: 12px;
  text-decoration: none;
}

.profile:hover {
  background: var(--surface-hover);
}

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(150deg, var(--gold), var(--bordeaux));
  color: #fff7ec;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
}

.profile-text {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}

.profile-name {
  font-weight: 500;
  font-size: 0.9rem;
}

.profile-email {
  font-size: 0.74rem;
  color: var(--text-faint);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.main-col {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--topbar-h);
  padding: 12px clamp(16px, 3vw, 40px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.topbar-brand {
  display: none;
}

.topbar-title {
  flex: 1;
  min-width: 0;
}

.topbar-title h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.5rem, 2.2vw, 1.95rem);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-title p {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.topbar-title p:empty {
  display: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sync-banner {
  position: sticky;
  top: calc(var(--topbar-h) + 8px);
  z-index: 7;
  align-self: center;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 8px 10px 8px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-md);
  font-size: 0.86rem;
}

.view {
  flex: 1;
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: clamp(16px, 2.6vw, 34px) clamp(16px, 3vw, 40px) 120px;
  outline: none;
  animation: view-in 0.35s var(--ease);
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(6px); }
}

.view-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}

.view-toolbar-end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.view-count {
  font-size: 0.84rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.view-hint {
  margin: -0.4rem 0 1.2rem;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.search-field {
  position: relative;
  flex: 1 1 260px;
  max-width: 420px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}

.search-input,
.select,
.field input,
.field textarea {
  width: 100%;
  min-height: 42px;
  padding: 0 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 0.92rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.search-input {
  padding-left: 38px;
}

.select {
  width: auto;
  padding-right: 2rem;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.field textarea {
  padding: 0.7rem 0.9rem;
  resize: vertical;
}

.search-input:focus,
.select:focus,
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.notice {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 1.2rem;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.88rem;
}

.notice p {
  margin: 0;
}

.notice .icon {
  color: var(--accent);
  margin-top: 2px;
}

/* ------------------------------------------------------------------ */
/* Accueil                                                             */
/* ------------------------------------------------------------------ */

.hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 2.4rem;
  padding: clamp(26px, 4vw, 48px);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(60% 120% at 0% 0%, rgba(227, 164, 87, 0.22), transparent 60%),
    radial-gradient(50% 90% at 100% 100%, rgba(110, 42, 54, 0.25), transparent 70%),
    linear-gradient(140deg, #22160f, #120c08);
  color: #f6ede1;
  border: 1px solid rgba(232, 190, 130, 0.12);
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.1rem, 4vw, 3.3rem);
  line-height: 1.05;
}

.hero-title em {
  color: #f3c98a;
}

.hero-text {
  margin: 0.8rem 0 0;
  max-width: 34rem;
  color: rgba(246, 237, 225, 0.72);
}

.hero-stats {
  margin: 0.4rem 0 1.4rem;
  font-size: 0.84rem;
  letter-spacing: 0.02em;
  color: rgba(246, 237, 225, 0.5);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.hero .btn--ghost {
  color: #f6ede1;
  border-color: rgba(246, 237, 225, 0.25);
}

.hero .btn--ghost:hover {
  background: rgba(246, 237, 225, 0.08);
}

.home-section {
  margin-bottom: 2.4rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.55rem;
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.84rem;
  color: var(--text-muted);
  text-decoration: none;
}

.section-link:hover {
  color: var(--accent);
}

.strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(120px, 15vw, 190px);
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.strip-item {
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--card-placeholder);
  cursor: pointer;
  scroll-snap-align: start;
}

.strip-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.5s var(--ease);
}

.strip-item.is-loaded img {
  opacity: 1;
}

.strip-item:hover img {
  transform: scale(1.04);
}

.empty-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-strong);
  color: var(--text-muted);
  font-size: 0.9rem;
  grid-column: 1 / -1;
}

.empty-line p {
  margin: 0;
}

/* ------------------------------------------------------------------ */
/* Grille de photos                                                    */
/* ------------------------------------------------------------------ */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(132px, 15vw, 210px), 1fr));
  gap: 8px;
}

.grid-heading {
  grid-column: 1 / -1;
  margin: 1.2rem 0 0.2rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  text-transform: capitalize;
}

.grid-heading:first-child {
  margin-top: 0;
}

.card {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--card-placeholder);
  isolation: isolate;
}

.card--skeleton {
  background: linear-gradient(100deg, var(--card-placeholder) 30%, var(--surface-hover) 50%, var(--card-placeholder) 70%);
  background-size: 300% 100%;
  animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

.card-open {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}

.card-open img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.45s ease, transform 0.6s var(--ease);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.card.is-loaded .card-open img {
  opacity: 1;
}

.card:hover .card-open img {
  transform: scale(1.03);
}

.card.is-broken::after {
  content: "Image indisponible";
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  color: var(--text-faint);
}

.card::before {
  /* voile discret pour la lisibilité des pastilles */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 30%, transparent 70%, rgba(0, 0, 0, 0.3));
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.card:hover::before,
.card:focus-within::before,
.is-selecting .card::before {
  opacity: 1;
}

.card-check {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 8px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.25);
  color: transparent;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.card:hover .card-check,
.card-check:focus-visible,
.is-selecting .card-check {
  opacity: 1;
  transform: none;
}

.card.is-selected .card-check {
  background: var(--amber);
  border-color: var(--amber);
  color: #2a170a;
}

.card.is-selected {
  box-shadow: 0 0 0 3px var(--amber);
}

.card.is-selected .card-open img {
  transform: scale(0.94);
  border-radius: 6px;
}

.card-fav {
  position: absolute;
  z-index: 2;
  right: 8px;
  bottom: 8px;
  color: #ffd99a;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}

.card-fav .icon {
  fill: currentColor;
}

.card-badge {
  position: absolute;
  z-index: 2;
  left: 8px;
  right: 8px;
  bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(14, 10, 8, 0.72);
  color: #f6ede1;
  font-size: 0.72rem;
  text-align: center;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.photo-grid--trash .card-open img {
  filter: saturate(0.65);
}

.photo-grid--picker {
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
}

.photo-grid--picker .card-open {
  cursor: pointer;
}

.photo-grid--picker .card-check {
  opacity: 1;
}

.grid-status {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  min-height: 2rem;
  padding: 1.2rem 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.grid-sentinel {
  height: 1px;
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.state {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  max-width: 420px;
  margin: 3rem auto;
  text-align: center;
}

.state-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.state-title {
  margin: 0.4rem 0 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--text);
}

.state-text {
  margin: 0 0 0.6rem;
  color: var(--text-muted);
}

.state--error .state-icon {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ------------------------------------------------------------------ */
/* Albums                                                              */
/* ------------------------------------------------------------------ */

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(160px, 20vw, 250px), 1fr));
  gap: 18px;
}

.album-card {
  display: grid;
  gap: 0.7rem;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.album-cover {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, var(--surface-2), var(--card-placeholder));
  color: var(--text-faint);
  box-shadow: var(--shadow-md);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.album-cover::after {
  /* effet « pile de tirages » */
  content: "";
  position: absolute;
  inset: auto 10% -6px;
  height: 10px;
  border-radius: 0 0 12px 12px;
  background: var(--surface-2);
  z-index: -1;
}

.album-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.album-cover.is-loaded img {
  opacity: 1;
}

.album-card:hover .album-cover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.album-card--new .album-cover {
  border: 1.5px dashed var(--border-strong);
  background: transparent;
  box-shadow: none;
  color: var(--accent);
}

.album-card-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 1.2;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.album-card-meta {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.album-grid--compact {
  grid-template-columns: repeat(auto-fill, minmax(clamp(150px, 17vw, 220px), 1fr));
}

.album-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(16px, 3vw, 36px);
  margin-bottom: 1.8rem;
}

.album-hero-cover {
  flex: none;
  width: clamp(120px, 16vw, 200px);
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--text-faint);
  box-shadow: var(--shadow-md);
}

.album-hero-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.album-hero-text {
  flex: 1 1 300px;
  min-width: 0;
}

.album-hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 3.6vw, 3rem);
  line-height: 1.05;
}

.album-hero-desc {
  margin: 0.6rem 0 0;
  max-width: 46rem;
  color: var(--text-muted);
  white-space: pre-line;
}

.album-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.album-picker {
  display: grid;
  gap: 4px;
  max-height: 46vh;
  overflow-y: auto;
}

.album-picker-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.album-picker-row:hover {
  background: var(--surface-hover);
}

.album-picker-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.album-picker-name {
  flex: 1;
  font-weight: 500;
}

.album-picker-meta {
  font-size: 0.8rem;
  color: var(--text-faint);
}

.album-picker-new {
  margin-top: 0.8rem;
}

.picker-count {
  display: block;
  margin-bottom: 0.8rem;
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* ------------------------------------------------------------------ */
/* Barre de sélection                                                  */
/* ------------------------------------------------------------------ */

.selection-bar {
  position: fixed;
  z-index: 20;
  left: calc(var(--sidebar-w) + 50%);
  bottom: 22px;
  transform: translateX(calc(-50% - var(--sidebar-w) / 2));
  max-width: calc(100vw - var(--sidebar-w) - 32px);
  animation: rise 0.25s var(--ease);
}

@keyframes rise {
  from { opacity: 0; transform: translate(calc(-50% - var(--sidebar-w) / 2), 12px); }
}

.selbar-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 8px 10px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  overflow-x: auto;
}

.selbar-count {
  font-weight: 500;
  font-size: 0.88rem;
  white-space: nowrap;
  padding-right: 0.3rem;
}

.selbar-actions {
  display: flex;
  gap: 2px;
}

.selbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 40px;
  padding: 0 0.75rem;
  border: 0;
  border-radius: 11px;
  background: none;
  font-size: 0.84rem;
  cursor: pointer;
  white-space: nowrap;
}

.selbar-btn:hover {
  background: var(--surface-hover);
}

.selbar-btn--danger {
  color: var(--danger);
}

/* ------------------------------------------------------------------ */
/* Visionneuse                                                         */
/* ------------------------------------------------------------------ */

.has-lightbox {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: rgba(8, 6, 5, 0.97);
  color: #f3ebe0;
  outline: none;
  animation: fade-in 0.2s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
}

.lb-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: max(10px, env(safe-area-inset-top)) 14px 10px 20px;
}

.lb-heading {
  flex: 1;
  min-width: 0;
}

.lb-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lb-counter {
  font-size: 0.78rem;
  color: rgba(243, 235, 224, 0.55);
}

.lb-toolbar {
  display: flex;
  gap: 2px;
}

.lb-btn {
  color: rgba(243, 235, 224, 0.8);
}

.lb-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.lb-fav.is-active {
  color: #ffd99a;
}

.lb-fav.is-active .icon {
  fill: currentColor;
}

.lb-body {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
}

.lb-stage {
  position: relative;
  flex: 1;
  min-width: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  touch-action: none;
  cursor: zoom-in;
}

.lightbox.is-zoomed .lb-stage {
  cursor: grab;
}

.lb-img {
  max-width: calc(100% - 32px);
  max-height: calc(100% - 24px);
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  transition: transform 0.12s ease-out, filter 0.3s ease;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox.is-loading .lb-img {
  filter: blur(6px) saturate(0.9);
}

.lb-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-top: -26px;
  border: 0;
  border-radius: 50%;
  background: rgba(20, 14, 10, 0.55);
  color: #f3ebe0;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.lb-nav:hover {
  background: rgba(40, 28, 20, 0.85);
}

.lb-nav:disabled {
  opacity: 0;
  pointer-events: none;
}

.lb-nav--prev {
  left: 14px;
}

.lb-nav--next {
  right: 14px;
}

.lightbox.is-info-open .lb-nav--next {
  right: calc(340px + 14px);
}

.lb-info {
  display: none;
  flex: none;
  width: 340px;
  padding: 18px 22px;
  border-left: 1px solid rgba(232, 190, 130, 0.12);
  background: rgba(24, 17, 12, 0.92);
  overflow-y: auto;
}

.lightbox.is-info-open .lb-info {
  display: block;
}

.lb-info-title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
}

.lb-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem 1rem;
  margin: 0 0 1.4rem;
  font-size: 0.86rem;
}

.lb-meta dt {
  color: rgba(243, 235, 224, 0.5);
}

.lb-meta dd {
  margin: 0;
  word-break: break-word;
}

.lb-actions {
  display: grid;
  gap: 0.45rem;
}

.lb-actions .btn {
  justify-content: flex-start;
  color: #f3ebe0;
  border-color: rgba(232, 190, 130, 0.2);
}

.lb-actions .btn--danger {
  background: transparent;
  color: #ec8f84;
  border-color: rgba(236, 143, 132, 0.35);
}

/* ------------------------------------------------------------------ */
/* Import                                                              */
/* ------------------------------------------------------------------ */

.upload-panel {
  position: fixed;
  z-index: 25;
  right: 20px;
  bottom: 20px;
  width: min(420px, calc(100vw - 32px));
  max-height: min(70vh, 560px);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: rise-simple 0.25s var(--ease);
}

@keyframes rise-simple {
  from { opacity: 0; transform: translateY(12px); }
}

.upload-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 12px 10px 12px 18px;
  border-bottom: 1px solid var(--border);
}

.upload-header > div:first-child {
  flex: 1;
  min-width: 0;
}

.upload-header-actions {
  display: flex;
}

.upload-header-actions .icon-btn:first-child .icon {
  transition: transform 0.2s ease;
}

.upload-panel.is-collapsed .upload-header-actions .icon-btn:first-child .icon {
  transform: rotate(180deg);
}

.upload-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.upload-summary {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.upload-list {
  margin: 0;
  padding: 6px;
  list-style: none;
  overflow-y: auto;
}

.upload-panel.is-collapsed .upload-list {
  display: none;
}

.upload-row {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 0.75rem;
  padding: 10px;
  border-radius: var(--radius-sm);
}

.upload-row + .upload-row {
  border-top: 1px solid var(--border);
}

.upload-thumb {
  width: 48px;
  height: 48px;
  border-radius: 9px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--text-faint);
}

.upload-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-main {
  min-width: 0;
}

.upload-name {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.upload-meta {
  margin: 1px 0 6px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.upload-bar {
  height: 4px;
  border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
}

.upload-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--amber-strong), var(--amber));
  transition: width 0.2s ease;
}

.upload-row[data-status="done"] .upload-bar span {
  background: var(--success);
}

.upload-note {
  margin: 6px 0 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.upload-row[data-status="error"] .upload-note {
  color: var(--danger);
}

.upload-actions {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.upload-actions:empty {
  display: none;
}

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 7, 5, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  pointer-events: none;
}

.drop-card {
  padding: 48px 56px;
  border-radius: var(--radius-xl);
  border: 2px dashed rgba(243, 201, 138, 0.6);
  text-align: center;
  color: #f6ede1;
  background: radial-gradient(circle at 50% 0%, rgba(227, 164, 87, 0.2), transparent 70%);
}

.drop-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
}

.drop-text {
  margin: 0.4rem 0 0;
  color: rgba(246, 237, 225, 0.65);
}

/* ------------------------------------------------------------------ */
/* Modales                                                             */
/* ------------------------------------------------------------------ */

.modal {
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--text);
}

.modal::backdrop {
  background: rgba(8, 6, 5, 0.62);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.modal[open] {
  animation: modal-in 0.22s var(--ease);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
}

.modal--sm {
  width: min(420px, calc(100vw - 24px));
}

.modal--lg {
  width: min(960px, calc(100vw - 24px));
}

.modal-card {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 40px);
  border-radius: var(--radius-lg);
  background: var(--glow), var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 18px 14px 6px 22px;
}

.modal-title {
  flex: 1;
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
}

.modal-description,
.modal-text {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.modal-description {
  padding: 0 22px;
}

.modal-body {
  padding: 14px 22px 4px;
  overflow-y: auto;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 14px 22px 20px;
}

.modal-form {
  display: grid;
  gap: 0.9rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
}

.field-help {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-faint);
}

.form-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.86rem;
}

.modal--sheet .sheet-nav {
  display: grid;
  gap: 2px;
}

.sheet-link {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  min-height: 52px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  text-decoration: none;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
}

.sheet-link:hover {
  background: var(--surface-hover);
}

.sheet-link--danger {
  color: var(--danger);
}

/* ------------------------------------------------------------------ */
/* Notifications                                                       */
/* ------------------------------------------------------------------ */

.toasts {
  position: fixed;
  z-index: 70;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  width: min(440px, calc(100vw - 24px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 12px 14px;
  border-radius: 14px;
  background: #241a14;
  color: #f6ede1;
  border: 1px solid rgba(232, 190, 130, 0.18);
  box-shadow: var(--shadow-lg);
  font-size: 0.88rem;
  pointer-events: auto;
  animation: toast-in 0.25s var(--ease);
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
}

.toast-icon {
  color: #f3c98a;
}

.toast--error .toast-icon {
  color: #ec8f84;
}

.toast--success .toast-icon {
  color: #a9c79a;
}

.toast-text {
  flex: 1;
}

.toast-action {
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: rgba(243, 201, 138, 0.14);
  color: #f3c98a;
  font-weight: 600;
  cursor: pointer;
}

/* ------------------------------------------------------------------ */
/* Paramètres                                                          */
/* ------------------------------------------------------------------ */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 18px;
  align-items: start;
}

.settings-card {
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--glow), var(--surface);
  border: 1px solid var(--border);
}

.settings-card-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.settings-card-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.45rem;
}

.settings-card-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
}

.settings-subtitle {
  margin: 1.2rem 0 0.6rem;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.settings-list {
  margin: 0;
  display: grid;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.settings-row dt {
  color: var(--text-muted);
}

.settings-row dd {
  margin: 0;
  text-align: right;
  word-break: break-word;
}

.settings-details {
  margin-top: 1rem;
}

.settings-details summary {
  cursor: pointer;
  padding: 8px 0;
  font-weight: 500;
  color: var(--accent);
}

.settings-details[open] summary {
  margin-bottom: 0.8rem;
}

.settings-actions {
  margin-top: 1rem;
}

.settings-note {
  margin: 0.8rem 0 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-faint);
}

.members {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.member {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.member-name {
  margin: 0;
  font-weight: 500;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.member-meta {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.tag {
  padding: 1px 8px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
}

.segmented {
  display: inline-flex;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.segmented button {
  min-height: 36px;
  padding: 0 1rem;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
}

.segmented button.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-md);
}

.install-box p {
  margin: 0 0 0.8rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.steps,
.privacy-list {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.45rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ------------------------------------------------------------------ */
/* Navigation mobile                                                   */
/* ------------------------------------------------------------------ */

.bottom-nav {
  display: none;
}

@media (max-width: 900px) {
  .sidebar {
    display: none;
  }

  .main-col {
    margin-left: 0;
  }

  .topbar {
    padding-top: max(10px, env(safe-area-inset-top));
    min-height: 60px;
  }

  .topbar-brand {
    display: block;
  }

  .topbar-add {
    display: none;
  }

  .view {
    padding-bottom: calc(var(--bottom-h) + 90px + env(safe-area-inset-bottom));
  }

  .bottom-nav {
    position: fixed;
    z-index: 15;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    height: calc(var(--bottom-h) + env(safe-area-inset-bottom));
    padding: 0 6px env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--bg-elev) 90%, transparent);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border-top: 1px solid var(--border);
  }

  .bottom-link {
    display: grid;
    justify-items: center;
    gap: 3px;
    padding: 8px 0;
    border: 0;
    background: none;
    color: var(--text-faint);
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 500;
    cursor: pointer;
  }

  .bottom-link.is-active {
    color: var(--accent);
  }

  .bottom-add {
    justify-self: center;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin-top: -18px;
    border: 0;
    border-radius: 18px;
    background: linear-gradient(180deg, #efbd78 0%, #e09d52 60%, #c98236 100%);
    color: #2a170a;
    box-shadow: 0 10px 24px -8px rgba(227, 164, 87, 0.8);
    cursor: pointer;
  }

  .selection-bar {
    left: 8px;
    right: 8px;
    bottom: calc(var(--bottom-h) + 10px + env(safe-area-inset-bottom));
    transform: none;
    max-width: none;
    animation: none;
  }

  .selbar-label {
    display: none;
  }

  .selbar-all {
    display: none;
  }

  .upload-panel {
    left: 8px;
    right: 8px;
    width: auto;
    bottom: calc(var(--bottom-h) + 10px + env(safe-area-inset-bottom));
  }

  .has-selection .upload-panel {
    display: none;
  }

  .toasts {
    bottom: calc(var(--bottom-h) + 16px + env(safe-area-inset-bottom));
  }

  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 3px;
  }

  .card {
    border-radius: 4px;
  }

  .card-check {
    width: 24px;
    height: 24px;
  }

  .view-toolbar .select {
    flex: 1 1 140px;
  }

  .search-field {
    max-width: none;
    flex-basis: 100%;
  }

  .view-toolbar-end {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }

  .lb-toolbar .lb-btn:nth-child(2),
  .lb-toolbar .lb-btn:nth-child(3) {
    display: none;
  }

  .lb-nav {
    display: none;
  }

  .lightbox.is-info-open .lb-info {
    position: absolute;
    inset: auto 0 0 0;
    width: auto;
    max-height: 60%;
    border-left: 0;
    border-top: 1px solid rgba(232, 190, 130, 0.12);
    border-radius: 20px 20px 0 0;
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }

  .modal--sheet {
    margin: auto 0 0;
    width: 100vw;
    max-width: none;
    border-radius: 22px 22px 0 0;
  }

  .modal--sheet .modal-card {
    border-radius: 22px 22px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .settings-card {
    padding: 18px;
  }
}

@media (max-width: 480px) {
  .hero {
    border-radius: var(--radius-lg);
  }

  .album-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Les notifications ne masquent jamais la barre de sélection. */
.has-selection .toasts {
  bottom: 100px;
}

@media (max-width: 900px) {
  .has-selection .toasts {
    bottom: calc(var(--bottom-h) + 84px + env(safe-area-inset-bottom));
  }
}
