/* ==========================================================================
   KentraPix — Thème « Moderne & Esthétique »
   Couche chargée EN DERNIER : elle redéfinit les tokens et affine les
   composants. Pour revenir à l'ancien style, retirez simplement le
   <link rel="stylesheet" href="css/modern.css"> des fichiers HTML.

   Cohérence du bleu : une seule famille, le bleu Kentra (#1265d8) et ses
   déclinaisons. Toute action, tout état actif, tout accent utilise ces
   tokens — jamais un autre bleu, jamais du noir ou du rouge à la place.
   Le vert du logo (--accent) reste un détail rare.
   ========================================================================== */

:root {
  /* Bleu Kentra — mêmes valeurs que Kentra Gestion */
  --blue: #1265d8;
  --blue-hover: #0d50b2;
  --blue-light: #1c77ee;
  --blue-deep: #0c4088;
  --blue-soft: #e8f1ff;
  --blue-line: #c4d9f7;
  --blue-glow: rgba(18, 101, 216, 0.18);
  --gradient-primary: linear-gradient(115deg, #1c77ee, #1056bf);
  --gradient-sidebar: linear-gradient(165deg, #0c4088 0%, #1466d3 100%);
  --gradient-feature: linear-gradient(130deg, #10458c, #1670df);
  --accent: #a8ed00;

  /* Toile & neutres teintés de bleu */
  --bg: #f4f7fc;
  --surface: #ffffff;
  --surface-2: #f2f6fd;
  --ink: #082445;
  --text: #172b46;
  --muted: #5d6f88;
  --subtle: #8a9ab3;
  --label: #3c577c;
  --border: rgba(8, 36, 69, 0.08);
  --border-strong: rgba(8, 36, 69, 0.16);
  --navy: #082445;

  /* Typo : serif éditorial pour les titres */
  --font-sans: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --text-3xl: clamp(2.3rem, 1.4rem + 3vw, 3.9rem);

  /* Formes */
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Ombres douces, teintées du bleu nuit */
  --shadow-xs: 0 1px 2px rgba(8, 36, 69, 0.04);
  --shadow-sm: 0 1px 2px rgba(8, 36, 69, 0.04), 0 8px 24px -12px rgba(8, 36, 69, 0.12);
  --shadow-md: 0 2px 6px rgba(8, 36, 69, 0.04), 0 24px 48px -20px rgba(8, 36, 69, 0.24);
  --shadow-lg: 0 4px 12px rgba(8, 36, 69, 0.06), 0 40px 80px -24px rgba(8, 36, 69, 0.35);
  --shadow-btn: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 8px 20px -8px rgba(18, 101, 216, 0.55);
  --ring: 0 0 0 4px var(--blue-glow);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sidebar-w: 264px;
}

/* ---------- Base ---------- */
body {
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(18, 101, 216, 0.07), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(28, 119, 238, 0.05), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  font-feature-settings: "cv11", "ss01", "ss03";
  letter-spacing: -0.005em;
}

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

h1, h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: "opsz" 144;
  letter-spacing: -0.025em;
}

h3 { font-weight: 650; letter-spacing: -0.015em; }

h1 em,
h2 em,
.editorial-heading em {
  font-style: italic;
  font-weight: 400;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: var(--blue);
}

.eyebrow {
  gap: 10px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--blue);
}

input,
select,
textarea {
  border-color: var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

input:hover,
select:hover,
textarea:hover { border-color: var(--blue-line); }

input:focus,
select:focus,
textarea:focus { border-color: var(--blue); box-shadow: var(--ring); }

:focus-visible { outline-color: var(--blue); }

/* Fine barre de défilement */
* { scrollbar-width: thin; scrollbar-color: rgba(8, 36, 69, 0.18) transparent; }

/* ---------- Barre latérale (bleu Kentra) ---------- */
.sidebar {
  padding: var(--space-8) var(--space-4) var(--space-5);
  background: var(--gradient-sidebar);
}

/* Halo lumineux discret */
.sidebar::before {
  content: "";
  position: absolute;
  inset: -120px -80px auto auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 70%);
  pointer-events: none;
}

/* Logo officiel (logo/kentrapix-icon.svg) : icône + « Kentra » + « Pix »,
   même typo et mêmes couleurs que logo/kentrapix-logo-*.svg */
.brandmark {
  width: 40px;
  height: 40px;
  border-radius: 10px; /* même arrondi que l'icône (30/128) */
  background: none;
  transform: none;
  /* liseré clair : l'icône bleue reste lisible sur la barre bleue */
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.28), 0 10px 24px -8px rgba(8, 36, 69, 0.6);
}

.brand strong {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: -0.035em;
  color: var(--ink);
}

.brand strong span { color: var(--blue); }

/* Version « dark » du logo sur la barre latérale bleue */
.sidebar .brand strong { color: #fff; }
.sidebar .brand strong span { color: #6fb0ff !important; }

.nav { gap: 4px; }

.nav button {
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--radius-full);
  color: rgba(217, 231, 255, 0.82);
  font-weight: 500;
  transition: background var(--fast), color var(--fast), transform var(--fast) var(--ease);
}

.nav button:hover { background: rgba(255, 255, 255, 0.10); color: #fff; transform: translateX(2px); }

.nav button.active {
  background: #fff;
  box-shadow: 0 8px 24px -10px rgba(8, 36, 69, 0.55);
  color: var(--blue);
  font-weight: 600;
}

.nav button.active .small { background: var(--blue); color: #fff; }

.sidebar > .badge { background: rgba(255, 255, 255, 0.16); color: #fff; }

.sidebar-foot {
  display: grid;
  justify-items: start;
  border-radius: var(--radius-lg);
  background: rgba(8, 36, 69, 0.22);
  border-color: rgba(255, 255, 255, 0.14);
}

.sidebar-foot .text-link { color: #fff; text-decoration-color: rgba(255, 255, 255, 0.35); }
.sidebar-foot p,
.sidebar-foot p:last-child { margin-top: var(--space-3); color: rgba(217, 231, 255, 0.6); }

/* ---------- Barre du haut ---------- */
.topbar {
  background: rgba(244, 247, 252, 0.75);
  border-bottom-color: transparent;
  box-shadow: 0 1px 0 var(--border);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}

.search input {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: none;
}

.search input:focus { background: #fff; }

.avatar {
  border-radius: 50%;
  background: var(--gradient-primary);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--blue-line);
}

/* ---------- Boutons ---------- */
.btn {
  border-color: var(--border-strong);
  border-radius: var(--radius-full);
  padding: 10px 20px;
  font-weight: 600;
  letter-spacing: -0.005em;
  box-shadow: none;
}

.btn:hover {
  border-color: var(--blue-line);
  background: var(--blue-soft);
  color: var(--blue-hover);
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: var(--shadow-btn);
}

.btn.primary:hover {
  background: var(--gradient-primary);
  color: #fff;
  filter: brightness(1.08);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 14px 28px -10px rgba(18, 101, 216, 0.6);
}

.icon:hover { background: var(--blue-soft); color: var(--blue); }

.text-link {
  color: var(--blue);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--blue-line);
}

.text-link:hover { color: var(--blue-hover); text-decoration-color: currentColor; }

/* ---------- Badges & puces ---------- */
.badge {
  padding: 5px 11px;
  background: var(--blue-soft);
  color: var(--blue-hover);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.chip {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

.chip:hover { border-color: var(--blue-line); color: var(--blue); }

.chip.active {
  background: var(--gradient-primary);
  font-weight: 600;
  box-shadow: var(--shadow-btn);
}

/* ---------- Cartes événements ---------- */
.events-grid { gap: var(--space-10) var(--space-6); }

.event-cover { border-radius: var(--radius-lg); box-shadow: none; }

.event-cover::after {
  background: linear-gradient(180deg, transparent 50%, rgba(8, 36, 69, 0.4));
  opacity: 0.6;
  transition: opacity var(--slow) var(--ease);
}

.event-card:hover .event-cover { box-shadow: var(--shadow-md); transform: translateY(-6px); }
.event-card:hover .event-cover::after { opacity: 1; }
.event-card:hover .event-cover img { transform: scale(1.06); }
.event-card:hover h3 { color: var(--blue); }
.event-info h3 { transition: color var(--fast); }

.event-cover .badge {
  background: rgba(255, 255, 255, 0.85);
  color: var(--blue-hover);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  backdrop-filter: blur(12px) saturate(160%);
}

.event-info h3 {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

/* ---------- Vedette & panneaux ---------- */
.feature { border-radius: var(--radius-xl); }
.feature-info h2 { font-family: var(--font-display); font-weight: 400; }

.memory-note,
.settings,
.table-wrap,
.empty,
.quick-tools button,
.upload-row {
  border-color: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.memory-note > svg,
.empty > svg,
.dropzone > svg,
.tool-icon {
  background: var(--blue-soft);
  color: var(--blue);
}

.empty { border-style: solid; background: rgba(255, 255, 255, 0.7); }

/* ---------- Accueil client ---------- */
.editorial-heading h1 {
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.memory-hero { border: 0; box-shadow: var(--shadow-lg); }

.hero-story h2 { font-weight: 400; letter-spacing: -0.03em; }
.story-meta svg { color: var(--blue); }
.hero-story > .btn { border-radius: var(--radius-full); }

.quick-tools button:hover {
  border-color: var(--blue-line);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.quick-tools strong { font-weight: 600; }
.quick-tools small { font-variant-numeric: tabular-nums; }
.quick-tools button:hover > svg { color: var(--blue); }
.quick-tools button:hover .tool-icon { background: var(--blue); color: #fff; }
.tool-icon { transition: background var(--fast), color var(--fast); }

.collection-heading h2 { font-weight: 400; }

/* ---------- Galerie ---------- */
.gallery-header h1 { font-weight: 400; letter-spacing: -0.035em; }

.photo-tile { border-radius: var(--radius-sm); background: var(--blue-soft); }

.photo-tile::after {
  background: linear-gradient(180deg, rgba(8, 36, 69, 0.35), transparent 35%, transparent 70%, rgba(8, 36, 69, 0.15));
}

.photo-tile.selected { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--blue); }

.photo-check,
.photo-heart {
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.photo-check:hover,
.photo-heart:hover { color: var(--blue); }

.photo-tile.selected .photo-check,
.photo-heart.favorite { background: var(--blue); color: #fff; }

.selectionbar {
  border-radius: var(--radius-full);
  padding-left: var(--space-6);
  background: var(--gradient-sidebar);
}

.selectionbar .btn.primary { background: #fff; color: var(--blue); box-shadow: none; }
.selectionbar .btn.primary:hover { background: var(--blue-soft); filter: none; }
.selectionbar .btn:not(.primary):hover { color: #fff; }

.viewer { background: #04101f; }
.viewer-stage img { border-radius: 2px; box-shadow: 0 40px 120px rgba(0, 0, 0, 0.7); }
.viewer-prev:hover,
.viewer-next:hover { background: var(--blue); border-color: var(--blue); }

/* ---------- Studio (admin) ---------- */
.stat { border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.stat:first-child { border-color: transparent; background: var(--gradient-feature); }
.stat:first-child p { color: rgba(217, 231, 255, 0.8) !important; }

.stat strong {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 400;
  letter-spacing: -0.03em;
}

th { background: var(--surface-2); color: var(--label); font-weight: 600; letter-spacing: 0.12em; }
tbody tr:hover { background: var(--surface-2); }

.dropzone {
  border: 1.5px dashed var(--blue-line);
  background:
    radial-gradient(circle at 50% 0%, rgba(18, 101, 216, 0.08), transparent 60%),
    rgba(255, 255, 255, 0.7);
}

.dropzone.drag { border-color: var(--blue); background: var(--blue-soft); }
.progress-bar { height: 4px; background: var(--blue-soft); }
.progress-bar span { background: var(--gradient-primary); }

.switch:checked { background: var(--blue); }

/* ---------- Modale & toast ---------- */
.modal-backdrop {
  background: rgba(8, 36, 69, 0.45);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.modal { border-radius: var(--radius-xl); }
.modal form label:has(> input[type="checkbox"]) { border-radius: var(--radius); }

#toast {
  border-radius: 10px; /* rectangle à petits coins, pas de forme en pastille */
  padding: 12px 20px;
  background: rgba(8, 36, 69, 0.94);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

/* ---------- Connexion ---------- */
.login { background: var(--bg); }

.login-caption h1 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.035em;
}

.login-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.login-panel h1 { font-weight: 400; }

/* ---------- Navigation mobile ---------- */
@media (max-width: 800px) {
  .bottomnav {
    inset: auto 12px max(12px, env(safe-area-inset-bottom)) 12px;
    padding: 6px;
    border: 0;
    border-radius: var(--radius-full);
    background: var(--gradient-sidebar);
    box-shadow: var(--shadow-lg);
  }

  .bottomnav button {
    min-height: 52px;
    border-radius: var(--radius-full);
    color: rgba(217, 231, 255, 0.8);
    font-weight: 500;
  }

  .bottomnav button.active { color: var(--blue); background: #fff; }
  .bottomnav button.active::after { display: none; }

  #toast { bottom: 104px; }
}

/* ---------- Aperçu admin de l'espace client ---------- */
.preview-banner {
  position: sticky;
  top: calc(var(--topbar-h) + var(--space-3));
  z-index: 14;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-5);
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  color: #fff;
  font-size: var(--text-sm);
  box-shadow: var(--shadow-btn);
}

.preview-banner > svg { width: 18px; height: 18px; }
.preview-banner > span { flex: 1; min-width: 0; }
.preview-banner strong { color: #fff; }
.preview-banner .btn { border-color: transparent; background: #fff; color: var(--blue); }
.preview-banner .btn:hover { background: var(--blue-soft); color: var(--blue-hover); }

@media (max-width: 580px) {
  .preview-banner { flex-wrap: wrap; border-radius: var(--radius-lg); padding: var(--space-3) var(--space-4); }
  .preview-banner .btn { width: 100%; }
}

/* ==========================================================================
   Studio v2 — en-têtes, personnes, badges, équipe, e-mails, finitions
   (toujours la famille du bleu Kentra : --blue, --blue-soft, --blue-line…)
   ========================================================================== */

/* Entrée douce du contenu */
.main > * { animation: rise-in 0.45s var(--ease) both; }
.main > *:nth-child(2) { animation-delay: 0.04s; }
.main > *:nth-child(3) { animation-delay: 0.08s; }
.main > *:nth-child(4) { animation-delay: 0.12s; }
.main > *:nth-child(n+5) { animation-delay: 0.16s; }

/* En-tête de page */
.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.page-head h1 { font-size: var(--text-3xl); font-weight: 400; letter-spacing: -0.035em; line-height: 1; }
.page-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* Petits boutons d'action */
.btn.sm { min-height: 36px; padding: 7px 14px; gap: 6px; font-size: var(--text-xs); }
.btn.sm svg { width: 15px; height: 15px; }
.page-actions .btn.sm { min-height: 44px; padding: 10px 18px; font-size: var(--text-sm); }
td.actions { white-space: nowrap; text-align: right; }
td.actions .btn + .btn { margin-left: 6px; }

/* Personne : avatar + nom + ligne secondaire */
.person { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.person .avatar { flex-shrink: 0; width: 38px; height: 38px; font-size: var(--text-xs); }
.person strong { display: block; color: var(--ink); font-weight: 600; }
.person span:not(.avatar):not(.thumb) { display: block; color: var(--muted); font-size: var(--text-xs); }

.thumb {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 56px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--blue-soft);
  color: var(--blue);
  object-fit: cover;
}

td .thumb { margin: 0; }

/* Badges d'état */
.badge.is-live { background: var(--blue); color: #fff; }
.badge.is-draft { background: var(--blue-soft); color: var(--blue-hover); }
.badge.is-muted { background: rgba(8, 36, 69, 0.06); color: var(--muted); }
td .badge + .small { margin-top: 4px; }

/* Encadré d'information */
.callout {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  padding: var(--space-4) var(--space-5);
  border: 1px dashed var(--blue-line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  font-size: var(--text-sm);
}

.callout > svg { width: 22px; height: 22px; color: var(--blue); }
.callout > span { flex: 1; }
.callout.is-ok { border-style: solid; border-color: var(--blue-line); background: var(--blue-soft); }
.callout code,
.settings code {
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(18, 101, 216, 0.08);
  color: var(--blue-hover);
  font-size: 0.85em;
}

/* Statistiques avec icône */
.stat > svg {
  position: absolute;
  top: var(--space-5);
  right: var(--space-5);
  width: 22px;
  height: 22px;
  color: var(--blue);
  opacity: 0.55;
}

.stat:first-child > svg { color: #fff; opacity: 0.7; }

/* Listes dans un panneau */
.settings.list > .row.between { padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
.settings.list > .row.between:last-child { border-bottom: 0; }

/* Équipe */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-5);
}

.team-card {
  display: grid;
  gap: var(--space-4);
  align-content: start;
  padding: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(220px 120px at 100% 0%, rgba(18, 101, 216, 0.08), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform var(--fast) var(--ease), box-shadow var(--fast);
}

.team-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.team-card .person .avatar { width: 48px; height: 48px; font-size: var(--text-sm); }
.team-card .row { flex-wrap: wrap; gap: 6px; }
.team-card.is-off { opacity: 0.6; }
.team-actions { display: flex; flex-wrap: wrap; gap: 6px; padding-top: var(--space-4); border-top: 1px solid var(--border); }

/* Passage studio <-> mes photos dans la barre latérale */
.sidebar-foot .switch-space {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--space-3);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.14);
  text-decoration: none;
}

.sidebar-foot .switch-space:hover { background: rgba(255, 255, 255, 0.22); color: #fff; }
.sidebar-foot .switch-space svg { width: 16px; height: 16px; }

/* Tableaux plus aérés */
th { font-size: 0.6875rem; }
td { padding-top: var(--space-3); padding-bottom: var(--space-3); }
tbody tr { transition: background var(--fast); }

/* Connexion : halo bleu derrière le panneau */
.login > main {
  position: relative;
  isolation: isolate;
}

.login > main::before {
  content: "";
  position: absolute;
  inset: -60px -40px auto auto;
  z-index: -1;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(28, 119, 238, 0.18), transparent 70%);
  pointer-events: none;
}

/* Modales : cases à cocher plus lisibles */
.modal form label:has(> input[type="checkbox"]):hover { border-color: var(--blue-line); background: var(--surface-2); }
.modal optgroup { font-weight: 700; color: var(--label); }

@media (max-width: 800px) {
  td.actions { white-space: normal; text-align: left; }
  td.actions .btn { margin: 0 6px 6px 0 !important; }
  .page-head { margin-bottom: var(--space-6); }
}

@media (prefers-reduced-motion: reduce) {
  .main > * { animation: none; }
}

/* Espace test des e-mails */
.email-test { margin-bottom: var(--space-4); }
.email-test h2 { font-size: var(--text-xl); }
.test-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); }
.test-row label { flex: 1 1 220px; }
.email-frame { display: grid; gap: var(--space-2); }
.email-frame iframe {
  width: 100%;
  height: 560px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #f4f7fc;
}

/* ==========================================================================
   Profil, photos de profil et commentaires
   ========================================================================== */

/* Avatar image (même forme que l'avatar à initiales) */
img.avatar { padding: 0; object-fit: cover; background: var(--blue-soft); }
.avatar.xl { width: 96px; height: 96px; font-size: 1.75rem; box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--blue-line), var(--shadow-md); }

/* Page profil */
.profile-page { display: grid; gap: var(--space-6); max-width: 1040px; }

/* En-tête : bandeau bleu + avatar qui le chevauche */
.profile-hero { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow-sm); }
.profile-cover {
  height: 132px;
  background:
    radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.18), transparent 40%),
    radial-gradient(circle at 10% 110%, rgba(28, 119, 238, 0.9), transparent 55%),
    var(--gradient-feature);
}
.profile-id { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-5); padding: 0 var(--space-8) var(--space-6); }
.profile-avatar { position: relative; flex-shrink: 0; margin-top: -56px; }
.profile-avatar .avatar.xl { width: 120px; height: 120px; font-size: 2.1rem; box-shadow: 0 0 0 5px var(--surface), var(--shadow-md); }
.profile-avatar-edit {
  position: absolute; right: 2px; bottom: 2px; display: grid; place-items: center; width: 36px; height: 36px;
  border: 3px solid var(--surface); border-radius: 50%; background: var(--gradient-primary); color: #fff;
  box-shadow: var(--shadow-btn); cursor: pointer; transition: transform var(--fast) var(--ease);
}
.profile-avatar-edit:hover { transform: scale(1.08); }
.profile-avatar-edit svg { width: 16px; height: 16px; }
.profile-meta { flex: 1; min-width: 220px; padding-bottom: var(--space-1); }
.profile-meta h1 { margin: 6px 0 2px; font-size: var(--text-2xl); line-height: 1.1; overflow-wrap: anywhere; }
.profile-meta p { margin: 0; color: var(--muted); font-size: var(--text-md); overflow-wrap: anywhere; }
.profile-role {
  display: inline-block; padding: 3px 10px; border-radius: var(--radius-full); background: var(--blue-soft);
  color: var(--blue); font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.profile-photo-actions { flex-wrap: wrap; gap: var(--space-2); }
.profile-photo-actions label.btn { display: inline-flex; font-weight: 600; color: var(--ink); cursor: pointer; }

/* Panneaux */
.profile-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; gap: var(--space-6); }
.profile-side { display: grid; gap: var(--space-6); }
.profile-panel { gap: var(--space-5); }
.profile-panel > header { padding-bottom: var(--space-4); border-bottom: 1px solid var(--border); }
.profile-panel h2 { margin: 0; font-size: var(--text-lg); }
.profile-panel header p { margin: 4px 0 0; color: var(--muted); }
.profile-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.profile-form .full, .profile-form .profile-save { grid-column: 1 / -1; }
.profile-form input:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.profile-save { justify-content: flex-end; }

.profile-action {
  display: flex; align-items: center; gap: var(--space-3); width: 100%; padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
  color: var(--ink); text-align: left; cursor: pointer;
  transition: border-color var(--fast), background var(--fast), transform var(--fast) var(--ease);
}
.profile-action:hover { border-color: var(--blue-line); background: var(--blue-soft); transform: translateY(-1px); }
.profile-action > svg { flex-shrink: 0; width: 38px; height: 38px; padding: 9px; border-radius: 10px; background: var(--surface); color: var(--blue); box-shadow: var(--shadow-xs); }
.profile-action span { display: grid; gap: 2px; }
.profile-action strong { font-size: var(--text-md); }
.profile-action small { color: var(--muted); font-size: var(--text-xs); }
.profile-action.danger > svg { color: var(--danger); }
.profile-action.danger:hover { border-color: var(--border-strong); background: var(--surface); }

/* Ordinateur : informations personnelles à gauche ; à droite, notifications puis apparence et sécurité (plus de vide sous la colonne de droite). */
@media (min-width: 901px) {
  .profile-grid { grid-template-rows: auto 1fr; }
  .profile-grid .profile-main { grid-column: 1; grid-row: 1 / span 2; }
  .profile-grid #push-box { grid-column: 2; grid-row: 1; }
  .profile-grid .profile-side { grid-column: 2; grid-row: 2; }
}
@media (max-width: 900px) {
  .profile-grid { grid-template-columns: 1fr; }
  .profile-grid .profile-main { order: -1; }
}
@media (max-width: 600px) {
  .profile-cover { height: 96px; }
  .profile-id { flex-direction: column; align-items: center; padding: 0 var(--space-4) var(--space-5); text-align: center; }
  .profile-meta { min-width: 0; }
  .profile-photo-actions { justify-content: center; }
  .profile-form { grid-template-columns: 1fr; }
  .profile-save .btn { width: 100%; justify-content: center; }
}

/* Pastille « commentaires » sur les vignettes */
.photo-comments {
  position: absolute;
  left: var(--space-2);
  bottom: var(--space-2);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px 3px 7px;
  border-radius: var(--radius-full);
  background: rgba(8, 36, 69, 0.72);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 600;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.photo-comments svg { width: 13px; height: 13px; }

/* Visionneuse avec panneau de commentaires */
.viewer-body { position: relative; flex: 1; min-height: 0; display: flex; }
.viewer-body .viewer-stage { flex: 1; min-width: 0; }
.vc-toggle { position: relative; }
.vc-toggle.is-on { background: var(--blue); color: #fff; }
.vc-count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: var(--blue-light);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 18px;
}

.viewer-comments {
  display: flex;
  flex-direction: column;
  width: min(380px, 100%);
  margin: 0 var(--space-4) var(--space-2) 0;
  border-radius: var(--radius-lg);
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-lg);
  animation: rise-in 0.25s var(--ease);
  overflow: hidden;
}

.vc-head { display: flex; align-items: center; justify-content: space-between; padding: var(--space-3) var(--space-3) var(--space-3) var(--space-5); border-bottom: 1px solid var(--border); }
.vc-head strong { color: var(--ink); }
.viewer .viewer-comments .icon { color: var(--muted); }
.viewer .viewer-comments .icon:hover { background: var(--blue-soft); color: var(--blue); }

.vc-list { flex: 1; min-height: 0; margin: 0; padding: var(--space-4) var(--space-5); overflow-y: auto; list-style: none; display: grid; align-content: start; gap: var(--space-4); }
.vc-item { display: flex; gap: var(--space-3); }
.vc-item .avatar { flex-shrink: 0; width: 32px; height: 32px; font-size: 0.6875rem; }
.vc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--ink); font-size: var(--text-sm); }
.vc-meta time { color: var(--subtle); font-size: var(--text-xs); }
.vc-meta .badge { padding: 1px 8px; font-size: 0.625rem; }
.vc-body { margin-top: 2px; color: var(--text); font-size: var(--text-sm); line-height: 1.5; overflow-wrap: anywhere; }
.vc-item.is-staff .vc-body { padding: 8px 12px; border-radius: 4px 14px 14px 14px; background: var(--blue-soft); }
.vc-item .text-link { margin-top: 4px; font-size: var(--text-xs); color: var(--muted); }
.vc-empty { color: var(--muted); font-size: var(--text-sm); text-align: center; padding: var(--space-8) 0; }

.vc-form { display: flex; align-items: flex-end; gap: var(--space-2); padding: var(--space-3); border-top: 1px solid var(--border); }
.vc-form textarea { min-height: 44px; max-height: 140px; padding: 10px 14px; border-radius: var(--radius); resize: none; font-size: var(--text-sm); }
.vc-form .btn { flex-shrink: 0; width: 44px; min-height: 44px; padding: 0; }

@media (max-width: 800px) {
  .viewer.with-comments .viewer-body { flex-direction: column; }
  .viewer-comments { width: auto; max-height: 55vh; margin: 0 var(--space-2) var(--space-2); }
}

/* Studio : liste des commentaires */
.thumb.lg { width: 96px; height: 72px; border-radius: var(--radius); }
.comment-list { display: grid; gap: var(--space-3); }
.comment-row {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.comment-row.is-staff { background: linear-gradient(90deg, var(--blue-soft), var(--surface) 40%); }
.comment-main { flex: 1; min-width: 0; display: grid; gap: var(--space-2); }
.comment-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--text-sm); }
.comment-meta .avatar { width: 28px; height: 28px; font-size: 0.625rem; }
.comment-meta strong { color: var(--ink); }
.comment-meta span:not(.avatar):not(.badge) { color: var(--muted); }
.comment-meta time { margin-left: auto; color: var(--subtle); font-size: var(--text-xs); }
.comment-main > p { color: var(--text); overflow-wrap: anywhere; }
.comment-main .row { gap: 6px; }

@media (max-width: 580px) {
  .comment-row { flex-direction: column; }
  .thumb.lg { width: 100%; height: 160px; }
}

/* ==========================================================================
   Connexion v2 : voir le mot de passe, créer un compte, mot de passe oublié
   ========================================================================== */
.pw-field { position: relative; display: block; }
.pw-field input { padding-right: 48px; }
.pw-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--subtle);
  transform: translateY(-50%);
  transition: background var(--fast), color var(--fast);
}
.pw-toggle:hover { background: var(--blue-soft); color: var(--blue); }
.pw-toggle.is-on { color: var(--blue); }
.pw-toggle.is-on::after { content: ""; position: absolute; width: 22px; height: 2px; border-radius: 2px; background: currentColor; transform: rotate(-40deg); }
.pw-toggle svg { width: 19px; height: 19px; }

.login-switch { margin-top: var(--space-6); text-align: center; color: var(--muted); font-size: var(--text-sm); }
.login-note { display: flex; gap: var(--space-3); align-items: flex-start; margin-top: var(--space-6); padding: var(--space-5); border-radius: var(--radius-lg); background: var(--blue-soft); }
.login-note svg { width: 22px; height: 22px; color: var(--blue); }
.login-note p { color: var(--ink); }
.optional { font-weight: 400; color: var(--subtle); }
label small { font-weight: 400; color: var(--muted); }

/* ==========================================================================
   Mode sélection (épreuves)
   ========================================================================== */
.badge.is-proof { gap: 4px; background: var(--blue); color: #fff; }
.badge.is-proof svg { width: 12px; height: 12px; }
.event-cover .badge.is-proof { left: auto; right: var(--space-3); background: var(--blue); color: #fff; }

.pick-panel {
  position: sticky;
  top: calc(var(--topbar-h) + var(--space-3));
  z-index: 12;
  display: grid;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  padding: var(--space-5);
  border: 1px solid var(--blue-line);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(300px 140px at 100% 0%, rgba(18, 101, 216, 0.10), transparent 70%),
    rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-md);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.pick-head { display: flex; align-items: center; gap: var(--space-4); }
.pick-head > div { flex: 1; min-width: 0; }
.pick-head strong { color: var(--ink); font-size: var(--text-lg); }
.pick-icon { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border-radius: 14px; background: var(--gradient-primary); color: #fff; box-shadow: var(--shadow-btn); }
.pick-count { flex-shrink: 0; color: var(--muted); font-size: var(--text-lg); font-variant-numeric: tabular-nums; }
.pick-count b { color: var(--blue); font-size: 2rem; font-family: var(--font-display); font-weight: 500; }
.pick-form { display: flex; gap: var(--space-2); }
.pick-form input { flex: 1; border-radius: var(--radius-full); }
.pick-list { padding: 10px 14px; border-radius: var(--radius); background: var(--blue-soft); color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pick-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); }
.pick-foot .small { display: inline-flex; align-items: center; gap: 6px; color: var(--blue-hover); }
.pick-foot .small svg { width: 16px; height: 16px; }
.pick-foot .row { gap: var(--space-2); }

.photo-grid.is-proof img { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.photo-number {
  position: absolute;
  left: var(--space-2);
  top: var(--space-2);
  z-index: 2;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: rgba(8, 36, 69, 0.75);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.photo-pick {
  position: absolute;
  right: var(--space-2);
  bottom: var(--space-2);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--blue);
  box-shadow: var(--shadow-sm);
  transition: transform var(--fast) var(--ease), background var(--fast);
}
.photo-pick:hover { transform: scale(1.08); }
.photo-pick svg { width: 20px; height: 20px; stroke-width: 2.2; }
.photo-tile.picked { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--blue); }
.photo-tile.picked .photo-pick { background: var(--blue); color: #fff; }
.photo-tile.picked .photo-number { background: var(--blue); }
.photo-grid.is-proof .photo-comments { left: auto; right: 56px; }

.vpick { border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.1); color: #fff; }
.vpick:hover { background: rgba(255, 255, 255, 0.2); color: #fff; border-color: transparent; }
.vpick.is-on { border-color: transparent; background: var(--blue); }

/* Studio : sélection reçue */
.sel-block { display: grid; gap: var(--space-3); margin-top: var(--space-5); padding-top: var(--space-5); border-top: 1px solid var(--border); }
.sel-block .btn { justify-self: start; }
.sel-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: var(--space-2); }
.sel-thumbs figure { margin: 0; }
.sel-thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); }
.sel-thumbs figcaption { margin-top: 2px; color: var(--muted); font-size: var(--text-xs); font-weight: 600; text-align: center; }
.sel-block blockquote { margin: 0; padding: 10px 14px; border-left: 3px solid var(--blue); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--surface-2); color: var(--text); }
.modal:has(.sel-block) { width: min(720px, 100%); }

/* ==========================================================================
   Mobile v2 : barre de navigation flottante claire + finitions
   ========================================================================== */
@media (max-width: 800px) {
  .bottomnav {
    inset: auto 12px calc(10px + env(safe-area-inset-bottom)) 12px;
    gap: 4px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 18px 40px -16px rgba(8, 36, 69, 0.38), 0 2px 6px rgba(8, 36, 69, 0.06), inset 0 1px 0 #fff;
    -webkit-backdrop-filter: saturate(180%) blur(22px);
    backdrop-filter: saturate(180%) blur(22px);
  }

  .bottomnav button {
    flex: 1;
    min-width: 0;
    min-height: 58px;
    gap: 3px;
    padding: 6px 2px;
    border-radius: 20px;
    background: none;
    color: var(--subtle);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: color var(--fast), transform var(--fast) var(--ease);
  }

  .bottomnav button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Icône dans une pilule bleu clair quand l'onglet est actif */
  .bottomnav button svg {
    box-sizing: content-box;
    width: 22px;
    height: 22px;
    padding: 4px 16px;
    border-radius: var(--radius-full);
    transition: background var(--fast), color var(--fast);
  }

  .bottomnav button:active { transform: scale(0.94); }
  .bottomnav button.active { background: none; color: var(--blue); }
  .bottomnav button.active svg { background: var(--blue-soft); stroke-width: 2; }
  .bottomnav button.active span { font-weight: 700; }

  /* Finitions */
  .topbar { height: 60px; gap: var(--space-3); }
  .topbar > .row > span[style] { display: none; }
  .search input { min-height: 40px; }
  .main { padding-top: var(--space-6); padding-bottom: 130px; }
  .page-head h1, .gallery-header h1, .editorial-heading h1 { font-size: clamp(2rem, 1.4rem + 3vw, 2.6rem); }
  .greeting h1 { font-size: 2rem; }
  .pick-panel { top: calc(60px + var(--space-2)); padding: var(--space-4); border-radius: var(--radius-lg); }
  .pick-head p.small { display: none; }
  .preview-banner { top: calc(60px + var(--space-2)); }
  .viewer-top .vpick { padding: 6px 10px; font-size: 0.6875rem; }
  #toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
  .modal { border-radius: var(--radius-xl) var(--radius-xl) var(--radius-lg) var(--radius-lg); }
}

@media (max-width: 420px) {
  .bottomnav button svg { padding: 4px 12px; }
  .pick-form .btn { padding-inline: 14px; }
  .pick-count b { font-size: 1.6rem; }
}

/* ==========================================================================
   Connexion : photo du studio + titre placé en haut
   (le bas de la photo porte la signature du photographe et, sur mobile,
   il passe sous le panneau : le titre ne doit jamais s'y trouver)
   ========================================================================== */
.login-visual img {
  object-fit: cover;
  object-position: 50% 30%; /* portrait : le visage reste sous le titre, au-dessus du panneau */
}

.login-visual::after {
  background:
    linear-gradient(180deg, rgba(8, 36, 69, 0.78) 0%, rgba(8, 36, 69, 0.35) 34%, transparent 58%),
    linear-gradient(0deg, rgba(8, 36, 69, 0.35), transparent 30%);
}

.login-caption {
  top: var(--space-12);
  bottom: auto;
  max-width: 560px;
}

.login-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 var(--space-4);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.login-kicker::before {
  content: "";
  width: 28px;
  height: 2px;
  border-radius: 2px;
  background: #6fb0ff;
}

.login-caption h1 {
  max-width: 13ch;
  font-size: clamp(2.4rem, 1.2rem + 3vw, 4rem);
  line-height: 1.02;
  text-shadow: 0 2px 24px rgba(8, 36, 69, 0.45);
}

/* Les deux lignes du titre apparaissent l'une après l'autre. */
.login-line {
  display: block;
  animation: rise-in 0.9s var(--ease) both;
}
.login-line + .login-line { animation-delay: 0.18s; }

/* « beaux moments » : italique Fraunces, dégradé bleu Kentra et trait de pinceau qui se dessine. */
.login-caption h1 em {
  position: relative;
  display: inline-block;
  padding-right: 0.06em; /* l'italique ne touche pas le point */
  font-style: italic;
  font-weight: 400;
  font-variation-settings: "opsz" 144;
  letter-spacing: -0.02em;
  color: #cfe3ff;
  background: linear-gradient(100deg, #ffffff 0%, #cfe3ff 38%, #6fb0ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 2px 18px rgba(8, 36, 69, 0.55));
}
.login-caption h1 em::after {
  content: "";
  position: absolute;
  left: 0.04em;
  right: 0.1em;
  bottom: -0.07em;
  height: 0.09em;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue-light), #6fb0ff 60%, rgba(111, 176, 255, 0));
  box-shadow: 0 0 16px rgba(28, 119, 238, 0.55);
  transform-origin: left center;
  animation: login-stroke 1.1s 0.75s cubic-bezier(0.65, 0, 0.35, 1) both;
}
@keyframes login-stroke { from { transform: scaleX(0); opacity: 0; } }

@media (max-width: 900px) {
  .login-visual { height: 44vh; min-height: 280px; }
  .login-visual img { object-position: 50% 30%; }
  .login-caption { top: var(--space-6); left: var(--space-5); right: var(--space-5); }
  .login-kicker { margin-bottom: var(--space-2); font-size: 0.6875rem; }
  .login-caption h1 { max-width: 16ch; font-size: clamp(1.9rem, 1.3rem + 3vw, 2.5rem); }
  .login-panel { margin-top: -32px; box-shadow: 0 -12px 30px -18px rgba(8, 36, 69, 0.35); }
}

/* ==========================================================================
   Clients : une carte par client (pas de défilement horizontal)
   ========================================================================== */
.clients-wrap { overflow: visible; }
.clients-table, .clients-table tbody { display: block; width: 100%; }
.clients-table thead { display: none; }
.clients-table tr {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--space-2) var(--space-5);
  padding: var(--space-5);
  border-bottom: 1px solid var(--border);
}
.clients-table tr:last-child { border-bottom: 0; }
.clients-table td { display: block; padding: 0; border: 0; }
.clients-table td:first-child .person { gap: var(--space-3); }
.clients-table td:first-child .avatar { width: 52px; height: 52px; font-size: 1rem; }
.clients-table td:first-child strong { font-size: 1.0625rem; }
.clients-table td:nth-child(2) { color: var(--muted); font-size: var(--text-sm); white-space: nowrap; }
.clients-table td:nth-child(2)::after { content: " galerie(s)"; }
.clients-table td:nth-child(3) { display: flex; align-items: center; gap: var(--space-2); }
.clients-table td:nth-child(3) .small { margin: 0; white-space: nowrap; }
.clients-table td.actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px dashed var(--border);
  white-space: normal;
  text-align: left;
}
.clients-table td.actions .btn { margin: 0 !important; }

@media (max-width: 800px) {
  .clients-table tr { grid-template-columns: minmax(0, 1fr) auto; padding: var(--space-4); }
  .clients-table td:first-child { grid-column: 1 / -1; }
  .clients-table td:nth-child(3) { justify-content: flex-end; }
  .clients-table td.actions .btn { flex: 1 1 calc(50% - var(--space-2)); justify-content: center; }
}

/* ==========================================================================
   Barre mobile : flottante, bleu Kentra légèrement transparent, icônes blanches.
   Onglet actif : icône blanche + trait blanc droit (aucune pastille arrondie).
   ========================================================================== */
.mobile-only { display: none; }
@media (max-width: 800px) {
  .mobile-only { display: inline-flex; }
  .bottomnav,
  [data-theme="dark"] .bottomnav {
    inset: auto 12px calc(10px + env(safe-area-inset-bottom)) 12px;
    gap: 2px;
    padding: 4px 10px; /* bouts arrondis : les onglets extrêmes ne touchent pas la courbe */
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-full); /* même forme que le bouton « Se connecter » */
    background: linear-gradient(90deg, rgba(12, 64, 136, 0.86), rgba(18, 101, 216, 0.84) 55%, rgba(28, 119, 238, 0.84));
    box-shadow: 0 18px 40px -16px rgba(8, 36, 69, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.16);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
    backdrop-filter: saturate(160%) blur(16px);
  }
  .bottomnav button, .bottomnav .nav-switch {
    position: relative;
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 58px;
    gap: 5px;
    padding: 6px 2px 8px;
    border-radius: 0;
    background: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.6875rem;
    font-weight: 600;
    text-decoration: none;
    transition: color var(--fast), transform var(--fast) var(--ease);
  }
  .bottomnav button span, .bottomnav .nav-switch span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bottomnav button svg, .bottomnav .nav-switch svg { width: 22px; height: 22px; padding: 0; border-radius: 0; background: none; }
  .bottomnav button:active { transform: scale(0.94); }
  .bottomnav button.active,
  [data-theme="dark"] .bottomnav button.active { color: #fff; background: none; }
  .bottomnav button.active svg { background: none; stroke-width: 2.2; filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.45)); }
  .bottomnav button.active span { font-weight: 700; }
  /* Repère de l'onglet actif : trait blanc droit sous l'icône */
  .bottomnav button.active::after,
  [data-theme="dark"] .bottomnav button.active::after {
    content: "";
    display: block;
    position: absolute;
    top: 33px;
    left: 50%;
    width: 18px;
    height: 2px;
    margin-left: -9px;
    border-radius: 0;
    background: #fff;
  }
  .bottomnav .nav-switch { border-left: 1px solid rgba(255, 255, 255, 0.18); color: #fff; }
  .main { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
  #toast { bottom: calc(88px + env(safe-area-inset-bottom)); }
}
@media (max-width: 420px) {
  .bottomnav button svg { padding: 0; }
}
.clients-table .person div { min-width: 0; } .clients-table .person span { overflow-wrap: anywhere; }

/* ==========================================================================
   Photos de profil : partout dans le studio + recadrage
   ========================================================================== */
img.avatar { object-fit: cover; object-position: center; background: var(--blue-soft); }
.avatar.xs { display: inline-grid; place-items: center; width: 26px; height: 26px; flex-shrink: 0; font-size: 0.625rem; color: #fff; }
.owner-cell { display: inline-flex; align-items: center; gap: 8px; }

.modal:has(.crop-stage) { width: min(420px, 100%); }
.crop-stage {
  position: relative;
  width: min(300px, 100%);
  aspect-ratio: 1;
  margin: var(--space-4) auto var(--space-3);
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: #0b1a30;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.crop-stage:active { cursor: grabbing; }
.crop-stage img { position: absolute; top: 0; left: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
/* Cercle de recadrage : l'extérieur est assombri */
.crop-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 999px rgba(8, 36, 69, 0.55), inset 0 0 0 2px rgba(255, 255, 255, 0.9);
  pointer-events: none;
}
.crop-zoom { display: flex; align-items: center; gap: var(--space-2); width: min(300px, 100%); margin: 0 auto; }
.crop-zoom svg { width: 18px; height: 18px; color: var(--blue); flex-shrink: 0; }
.crop-zoom input { flex: 1; accent-color: var(--blue); min-height: auto; padding: 0; border: 0; box-shadow: none; }
.crop-help { margin-top: var(--space-2); text-align: center; }

/* ==========================================================================
   Pas de barres de défilement visibles (le défilement reste possible)
   ========================================================================== */
html, body, * { scrollbar-width: none; }
::-webkit-scrollbar { width: 0; height: 0; display: none; }
html, body { overflow-x: hidden; }

/* Tableaux du studio : le texte passe à la ligne au lieu de déborder */
.table-wrap { overflow: visible; }
.table-wrap table { white-space: normal; }
.table-wrap td, .table-wrap th { overflow-wrap: anywhere; }

/* ==========================================================================
   Studio : actions en icônes (infobulle au survol)
   ========================================================================== */
.btn.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 12px;
  color: var(--blue);
  background: var(--surface);
}
.btn.icon-btn svg { width: 18px; height: 18px; margin: 0; }
.btn.icon-btn:hover { border-color: var(--blue-line); background: var(--blue-soft); color: var(--blue-hover); }
.btn.icon-btn.danger { color: #c2410c; }
.btn.icon-btn.danger:hover { border-color: #fdba74; background: #fff7ed; }
.btn.icon-btn.is-off { color: var(--subtle); }
.icon-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--blue);
  color: #fff;
  font-size: 0.625rem;
  line-height: 18px;
  text-align: center;
}
/* Infobulle */
.btn.icon-btn[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  z-index: 30;
  padding: 5px 9px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity var(--fast), transform var(--fast);
}
.btn.icon-btn[data-tip]:hover::after, .btn.icon-btn[data-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
@media (hover: none) { .btn.icon-btn[data-tip]::after { display: none; } }

td.actions { white-space: nowrap; }
td.actions .btn.icon-btn + .btn.icon-btn { margin-left: 6px; }
.clients-table td.actions { gap: 8px; }
.comment-actions, .comment-item .actions { display: flex; gap: 6px; }

/* ==========================================================================
   Mobile : chaque ligne de tableau devient une carte
   ========================================================================== */
@media (max-width: 800px) {
  .table-wrap table, .table-wrap tbody { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    padding: var(--space-4);
    border-bottom: 1px solid var(--border);
  }
  .table-wrap tr:last-child { border-bottom: 0; }
  .table-wrap td { display: block; padding: 0; border: 0; color: var(--muted); font-size: var(--text-sm); }
  .table-wrap td:first-child { flex: 1 1 100%; color: var(--ink); }
  .table-wrap td:empty { display: none; }
  .table-wrap td.actions {
    display: flex;
    flex: 1 1 100%;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
    padding-top: var(--space-3);
    border-top: 1px dashed var(--border);
    text-align: left;
  }
  .table-wrap td.actions .btn { margin: 0 !important; }
  .table-wrap td.actions .btn.icon-btn { flex: 0 0 auto; width: 42px; height: 42px; }
  .clients-table td.actions .btn.icon-btn { flex: 0 0 auto; }
  .table-wrap td input { width: 100%; }
}

/* Aide sous un champ (ex. nom d’expéditeur) */
.field-hint { display: block; margin-top: 4px; color: var(--muted); font-size: var(--text-xs); font-weight: 500; }

/* ==========================================================================
   Diaporama plein écran (fondu + musique)
   ========================================================================== */
.slideshow { position: fixed; inset: 0; z-index: 200; background: #050d1a; color: #fff; user-select: none; -webkit-user-select: none; }
.ss-stage { position: absolute; inset: 0; overflow: hidden; }
.ss-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transform: scale(1.02); transition: opacity 1.1s var(--ease), transform 6s linear; pointer-events: none; -webkit-touch-callout: none; }
.ss-img.on { opacity: 1; transform: scale(1.07); }
.slideshow.paused .ss-img.on { transform: scale(1.02); transition: opacity 1.1s var(--ease), transform 0.6s var(--ease); }
.ss-top, .ss-controls { position: absolute; left: 0; right: 0; display: flex; align-items: center; transition: opacity 0.4s var(--ease); }
.ss-top { top: 0; justify-content: space-between; gap: 16px; padding: calc(16px + env(safe-area-inset-top)) 20px 40px; background: linear-gradient(rgba(5, 13, 26, 0.7), transparent); }
.ss-title { margin: 0; font-family: var(--font-serif); font-size: 1.25rem; }
.ss-count { margin: 2px 0 0; color: rgba(255, 255, 255, 0.7); font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.06em; }
.ss-controls { bottom: 0; justify-content: center; gap: 12px; padding: 40px 20px calc(24px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(5, 13, 26, 0.75)); }
.ss-btn { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 50%; background: rgba(255, 255, 255, 0.1); color: #fff; cursor: pointer; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: background var(--fast), transform var(--fast); }
.ss-btn:hover { background: rgba(255, 255, 255, 0.2); }
.ss-btn:active { transform: scale(0.94); }
.ss-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ss-main { width: 58px; height: 58px; border: 0; background: var(--gradient-primary); box-shadow: 0 10px 30px -8px rgba(18, 101, 216, 0.8); }
.ss-main:hover { background: var(--gradient-primary); filter: brightness(1.08); }
.ss-bar { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: rgba(255, 255, 255, 0.12); }
.ss-progress { display: block; width: 0; height: 100%; background: var(--blue-light); }
.slideshow.idle { cursor: none; }
.slideshow.idle .ss-top, .slideshow.idle .ss-controls { opacity: 0; pointer-events: none; }

/* ==========================================================================
   Expiration, partage famille, installation
   ========================================================================== */
.expiry-note { display: inline-flex; align-items: center; gap: 8px; margin: 6px 0 14px; padding: 7px 14px; border-radius: var(--radius-full); background: var(--blue-soft); color: var(--blue-hover); font-size: var(--text-sm); font-weight: 600; }
.expiry-note svg { width: 16px; height: 16px; }
.expiry-note.soon { background: var(--warning-soft); color: var(--warning); }

.modal:has(.share-form) { width: min(560px, 100%); }
.share-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; margin: 16px 0; padding: 16px; border-radius: var(--radius-lg); background: var(--blue-soft); }
.share-form .btn { grid-column: 1 / -1; justify-content: center; }
.share-list { display: grid; gap: 8px; }
.share-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); }
.share-item > div:first-child { display: grid; flex: 1; min-width: 0; gap: 2px; }
.share-url { min-height: 32px; margin-top: 4px; padding: 4px 10px; border-radius: var(--radius-sm); background: #f6f9fe; color: var(--muted); font-size: var(--text-xs); }
.share-actions { display: flex; gap: 6px; }
@media (max-width: 560px) {
  .share-form { grid-template-columns: 1fr; }
  .share-item { flex-wrap: wrap; }
}

.install-card { display: flex; align-items: center; gap: 16px; margin: 20px 0; padding: 16px 20px; border: 1px solid var(--blue-line); border-radius: var(--radius-lg); background: linear-gradient(120deg, var(--blue-soft), #fff); }
.install-card > svg { flex-shrink: 0; width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: var(--gradient-primary); color: #fff; }
.install-card > div { flex: 1; }
.install-card p { margin: 2px 0 0; }
.install-card p svg { width: 14px; height: 14px; vertical-align: -2px; }
@media (max-width: 560px) { .install-card { flex-wrap: wrap; } .install-card .btn { width: 100%; justify-content: center; } }

/* ----- Page publique du lien de partage ----- */
.share-page { min-height: 100vh; background: radial-gradient(1200px 500px at 50% -10%, #dce9ff, transparent), var(--bg); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.share-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; text-decoration: none; }
.share-brand b { color: var(--blue); font-weight: 800; }
.share-gate { display: grid; place-items: center; align-content: center; gap: 24px; min-height: 100vh; padding: 24px 16px; }
.share-card { display: grid; justify-items: center; gap: 12px; width: min(420px, 100%); padding: 36px 28px; border: 1px solid var(--border); border-radius: var(--radius-xl); background: #fff; box-shadow: var(--shadow-md); text-align: center; }
.share-card h1 { margin: 0; font-family: var(--font-serif); font-size: 1.9rem; font-weight: 400; color: var(--ink); }
.share-card p { margin: 0; color: var(--muted); }
.share-card > svg, .share-lock svg { width: 26px; height: 26px; }
.share-lock { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 18px; background: var(--gradient-primary); color: #fff; box-shadow: var(--shadow-btn); }
.share-card form { display: grid; gap: 12px; width: 100%; margin-top: 8px; }
.share-card .btn { justify-content: center; }
.share-foot { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; color: var(--subtle); font-size: var(--text-xs); }
.share-foot svg { width: 14px; height: 14px; }
.share-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px max(16px, calc((100vw - 1400px) / 2)); border-bottom: 1px solid var(--border); background: rgba(255, 255, 255, 0.85); -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px); }
.share-main { width: min(1400px, 100%); margin: 0 auto; padding: 32px 16px 48px; }
.share-head { margin-bottom: 24px; }
.share-kicker { margin: 0 0 6px; color: var(--blue); font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.share-head h1 { margin: 0; font-family: var(--font-serif); font-size: clamp(2rem, 1.4rem + 3vw, 3.2rem); font-weight: 400; color: var(--ink); }
.share-meta { margin: 6px 0 0; color: var(--muted); }
.share-grid { columns: 4 260px; column-gap: 12px; }
.share-tile { display: block; width: 100%; margin: 0 0 12px; padding: 0; overflow: hidden; border: 0; border-radius: var(--radius); background: var(--blue-soft); cursor: zoom-in; break-inside: avoid; }
.share-tile img { display: block; width: 100%; height: auto; transition: transform 0.5s var(--ease); -webkit-touch-callout: none; pointer-events: none; }
.share-tile:hover img { transform: scale(1.03); }
.share-main .share-foot { margin-top: 32px; }
@media (max-width: 560px) { .share-grid { columns: 2 140px; column-gap: 8px; } .share-tile { margin-bottom: 8px; } }

/* ==========================================================================
   Barre latérale : carte « Mon profil » (sans flèche) + déconnexion discrète
   ========================================================================== */
.sidebar-foot { gap: 6px; justify-items: stretch; padding: 10px; }
.sidebar-foot .switch-space {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.1); color: #fff; font-size: var(--text-sm); font-weight: 600; text-decoration: none;
  transition: background var(--fast);
}
.sidebar-foot .switch-space:hover { background: rgba(255, 255, 255, 0.18); }
.sidebar-foot .switch-space svg { width: 18px; height: 18px; color: #bcd6fb; }
.sidebar-profile {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 16px; background: rgba(255, 255, 255, 0.08);
  color: #fff; text-align: left; cursor: pointer;
  transition: background var(--fast), border-color var(--fast), transform var(--fast) var(--ease);
}
.sidebar-profile:hover { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.28); transform: translateY(-1px); }
.sidebar-profile.active { background: #fff; border-color: #fff; color: var(--ink); }
.sidebar-profile .avatar { flex-shrink: 0; width: 40px; height: 40px; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85); font-size: 0.8125rem; }
.sidebar-profile.active .avatar { box-shadow: 0 0 0 2px var(--blue-line); }
.sidebar-profile span { display: grid; min-width: 0; line-height: 1.25; }
.sidebar-profile strong { overflow: hidden; font-size: var(--text-sm); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-profile small { color: rgba(217, 231, 255, 0.75); font-size: var(--text-xs); font-weight: 500; }
.sidebar-profile.active small { color: var(--blue); }
.sidebar-logout {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 0; border-radius: 12px; background: none;
  color: rgba(217, 231, 255, 0.75); font-size: var(--text-xs); font-weight: 600; cursor: pointer; transition: color var(--fast), background var(--fast);
}
.sidebar-logout:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.sidebar-logout svg { width: 16px; height: 16px; }
.sidebar-foot p, .sidebar-foot p:last-child { margin: 4px 12px 2px; }

/* ----- Lien de partage : téléchargement ----- */
.share-top-actions { display: flex; gap: 8px; }
.share-cell { position: relative; margin: 0 0 12px; break-inside: avoid; }
.share-cell .share-tile { margin: 0; }
.share-dl {
  position: absolute; right: 10px; bottom: 10px; display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 12px; background: rgba(255, 255, 255, 0.92); color: var(--blue); box-shadow: 0 6px 18px rgba(8, 36, 69, 0.25);
  opacity: 0; transform: translateY(4px); transition: opacity var(--fast), transform var(--fast);
}
.share-dl svg { width: 18px; height: 18px; }
.share-cell:hover .share-dl, .share-dl:focus-visible { opacity: 1; transform: none; }
@media (hover: none) { .share-dl { opacity: 1; transform: none; width: 36px; height: 36px; } }
@media (max-width: 560px) {
  .share-cell { margin-bottom: 8px; }
  .share-top-actions .btn span { display: none; }
  .share-top-actions .btn { padding-inline: 12px; }
}

/* ----- Partage : choix du téléchargement par lien ----- */
.share-toggle {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 14px; border: 1px solid var(--blue-line); border-radius: var(--radius); background: #fff; cursor: pointer;
}
.share-toggle span { display: grid; gap: 2px; }
.share-toggle strong { color: var(--ink); font-size: var(--text-sm); }
.share-toggle small { color: var(--muted); font-size: var(--text-xs); font-weight: 500; }
.share-toggle .switch { flex-shrink: 0; }
.share-badge { display: inline-block; padding: 1px 8px; border-radius: var(--radius-full); background: #eef2f8; color: var(--muted); font-size: 0.6875rem; font-weight: 700; }
.share-badge.is-dl { background: var(--blue-soft); color: var(--blue); }
.btn.icon-btn.is-on { border-color: transparent; background: var(--gradient-primary); color: #fff; }
.btn.icon-btn.is-on:hover { background: var(--gradient-primary); color: #fff; filter: brightness(1.06); }

/* ==========================================================================
   Notifications : pastille sur la cloche + liste
   ========================================================================== */
.notif-bell { position: relative; }
.notif-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 800;
  line-height: 1;
  animation: notif-pop 0.35s var(--ease) both;
}
@keyframes notif-pop { from { transform: scale(0.4); opacity: 0; } }

.notif-list { display: grid; gap: 4px; max-height: min(64vh, 520px); margin: var(--space-4) calc(-1 * var(--space-2)) 0; padding: 0; overflow-y: auto; list-style: none; }
.notif-item {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  width: 100%;
  padding: var(--space-3);
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: background var(--fast);
}
.notif-item:hover, .notif-item:focus-visible { background: var(--surface-2); }
.notif-item.is-new { background: var(--blue-soft); }
.notif-item.is-new strong::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--blue);
  vertical-align: middle;
}
.notif-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue);
}
.notif-icon svg { width: 19px; height: 19px; }
.notif-item.is-new .notif-icon { background: var(--blue); color: #fff; }
.notif-icon.is-expiry { color: #b45309; background: #fef3c7; }
.notif-item.is-new .notif-icon.is-expiry { background: #d97706; color: #fff; }
.notif-text { display: grid; gap: 2px; min-width: 0; }
.notif-text strong { font-size: var(--text-sm); }
.notif-text small { color: var(--muted); font-size: var(--text-sm); overflow-wrap: anywhere; }
.notif-text time { color: var(--subtle); font-size: var(--text-xs); }
.notif-empty { display: grid; justify-items: center; gap: var(--space-2); padding: var(--space-8) var(--space-4); color: var(--muted); text-align: center; }
.notif-empty svg { width: 34px; height: 34px; color: var(--blue); }
.notif-empty p { color: var(--ink); font-weight: 600; }
[data-theme="dark"] .notif-item.is-new { background: rgba(28, 119, 238, 0.16); }
[data-theme="dark"] .notif-icon { background: rgba(28, 119, 238, 0.18); color: #8fc0ff; }
[data-theme="dark"] .notif-icon.is-expiry { background: rgba(217, 119, 6, 0.2); color: #fbbf24; }

/* ----- Notifications écrites par le studio ----- */
.modal [hidden] { display: none !important; }
.ann-clients {
  display: grid;
  gap: var(--space-2);
  max-height: 220px;
  overflow-y: auto;
  margin: 0;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.ann-clients legend { padding: 0 6px; font-size: var(--text-sm); font-weight: 700; color: var(--label); }
.ann-clients label small { display: block; }
.notice-quota { margin-bottom: var(--space-3); }
.notice-list { display: grid; gap: var(--space-3); }
.notice-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.notice-row.is-later { border-style: dashed; border-color: var(--blue-line); background: linear-gradient(90deg, var(--blue-soft), var(--surface) 45%); }
.notice-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
}
.notice-icon svg { width: 20px; height: 20px; }
.notice-row.is-later .notice-icon { background: var(--blue-soft); color: var(--blue); }
.notice-main { flex: 1; min-width: 0; display: grid; gap: var(--space-2); }
.notice-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.notice-meta strong { color: var(--ink); }
.notice-main > p:not(.small) { color: var(--text); overflow-wrap: anywhere; }
.notice-body { display: grid; gap: var(--space-3); margin-top: var(--space-4); }
.notice-body p { color: var(--text); line-height: 1.65; overflow-wrap: anywhere; }
.notice-body time { color: var(--subtle); font-size: var(--text-xs); }
.notice-body + .actions { margin-top: var(--space-5); }
[data-theme="dark"] .notice-row.is-later { background: linear-gradient(90deg, rgba(28, 119, 238, 0.14), var(--surface) 45%); }
[data-theme="dark"] .notice-row.is-later .notice-icon { background: rgba(28, 119, 238, 0.18); color: #8fc0ff; }
@media (max-width: 580px) {
  .notice-row { flex-wrap: wrap; }
  .notice-row > .actions { width: 100%; justify-content: flex-end; }
}

/* ----- Boutons de suppression ----- */
.btn.danger { color: #b42318; border-color: #f3c5c0; }
.btn.danger:hover { color: #912018; border-color: #eba59d; background: #fff4f2; }
.btn.danger.ghost { border-color: transparent; background: transparent; }
.btn.danger.ghost:hover { border-color: #f3c5c0; background: #fff4f2; }
.btn.danger-fill { border-color: transparent; background: #c4282b; color: #fff; box-shadow: 0 10px 22px -12px rgba(196, 40, 43, 0.7); }
.btn.danger-fill:hover { background: #a91f22; color: #fff; border-color: transparent; }
.btn:disabled { opacity: 0.6; pointer-events: none; }
[data-theme="dark"] .btn.danger { color: #ff9b94; border-color: rgba(242, 107, 110, 0.35); }
[data-theme="dark"] .btn.danger:hover,
[data-theme="dark"] .btn.danger.ghost:hover { background: rgba(242, 107, 110, 0.12); border-color: rgba(242, 107, 110, 0.45); }

/* ----- Studio : page « Photos » (sélection, album, suppression) ----- */
.lib-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-4); margin-bottom: var(--space-5); }
.lib-filters > label { flex: 0 1 380px; }
.lib-albums { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.lib-albums .chip small { margin-left: 4px; opacity: 0.7; font-weight: 600; }
.lib-bar {
  position: sticky;
  top: calc(var(--topbar-h) + var(--space-3));
  z-index: 15;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}
.lib-all { display: flex; align-items: center; gap: var(--space-3); min-height: 44px; font-weight: 600; color: var(--ink); cursor: pointer; }
.lib-all b { color: var(--blue); }
.lib-all small { color: var(--muted); font-weight: 500; }
.lib-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.lib-hint { margin-right: var(--space-2); }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); gap: var(--space-4); }
.lib-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.lib-card:hover { border-color: var(--blue-line); box-shadow: var(--shadow-sm); }
.lib-card.is-selected { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(18, 101, 216, 0.22); }
.lib-pick { position: relative; display: block; width: 100%; min-width: 0; aspect-ratio: 1; overflow: hidden; padding: 0; border: 0; background: var(--blue-soft); cursor: pointer; }
.lib-pick img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.2s, opacity 0.2s; }
.lib-card.is-selected .lib-pick img { transform: scale(0.92); border-radius: 10px; }
.lib-check {
  position: absolute;
  top: 10px;
  left: 10px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgba(8, 36, 69, 0.28);
  color: transparent;
  box-shadow: 0 2px 8px rgba(8, 36, 69, 0.3);
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}
.lib-check svg { width: 15px; height: 15px; }
.lib-card:hover .lib-check,
.lib-pick:focus-visible .lib-check,
.lib-grid:has(.is-selected) .lib-check { opacity: 1; }
.lib-card.is-selected .lib-check { background: var(--blue); border-color: #fff; color: #fff; opacity: 1; }
.lib-num, .lib-cover {
  position: absolute;
  bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(8, 36, 69, 0.62);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 700;
}
.lib-num { left: 8px; }
.lib-cover { right: 8px; display: inline-flex; align-items: center; gap: 4px; background: var(--blue); }
.lib-cover svg { width: 12px; height: 12px; }
.lib-card { position: relative; }
.lib-meta { min-width: 0; padding: var(--space-2) var(--space-3) var(--space-3); }
.lib-meta strong { display: block; overflow: hidden; color: var(--ink); font-size: var(--text-sm); text-overflow: ellipsis; white-space: nowrap; }
.lib-meta span { display: block; overflow: hidden; color: var(--muted); font-size: var(--text-xs); text-overflow: ellipsis; white-space: nowrap; }
/* Actions d'une photo : en haut à droite de l'image, au survol. */
.lib-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; opacity: 0; transform: translateY(-4px); transition: opacity 0.15s, transform 0.15s; }
.lib-card:hover .lib-tools, .lib-tools:focus-within { opacity: 1; transform: none; }
.lib-tools .btn.icon-btn { width: 32px; height: 32px; min-height: 32px; padding: 0; border-color: transparent; background: rgba(255, 255, 255, 0.94); box-shadow: 0 2px 8px rgba(8, 36, 69, 0.18); }
.lib-tools .btn.icon-btn:hover { background: #fff; border-color: var(--blue-line); }
.lib-tools svg { width: 15px; height: 15px; }
.lib-confirm-strip { display: flex; gap: 6px; margin-top: var(--space-4); }
.lib-confirm-strip img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; }
.lib-confirm-strip span { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); font-weight: 700; }
[data-theme="dark"] .lib-bar { background: rgba(14, 27, 48, 0.9); }
@media (max-width: 760px) {
  .lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
  .lib-bar { top: calc(var(--topbar-h) + var(--space-2)); padding-left: var(--space-3); }
  .lib-hint { display: none; }
  .lib-tools { display: none; }
  /* Sélection en cours : la barre reste visible au-dessus du menu du bas. */
  .lib-bar.has-selection { position: fixed; top: auto; left: 12px; right: 12px; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 30; box-shadow: var(--shadow-lg); }
  .lib-grid:has(.is-selected) { padding-bottom: 150px; }
  .lib-check { opacity: 1; }
  .lib-actions { width: 100%; }
  .lib-actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* ----- Studio : page « Sélections » ----- */
@media (min-width: 1100px) {
  .quick-tools:has(> :nth-child(4)) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.sel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); gap: var(--space-4); align-items: start; }
.sel-card {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.sel-card.is-open { border-left-color: var(--blue-line); }
.sel-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.sel-status { display: grid; justify-items: end; gap: 4px; text-align: right; }
.sel-count { color: var(--muted); font-size: var(--text-sm); }
.sel-count strong { color: var(--ink); font-size: var(--text-xl); font-variant-numeric: tabular-nums; }
.sel-card blockquote { margin: 0; padding: 10px 14px; border-left: 3px solid var(--blue); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--surface-2); color: var(--text); }
.sel-card .sel-thumbs[hidden] { display: none; }
.sel-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.lib-albums .chip small:empty { display: none; }
@media (max-width: 580px) {
  .sel-status { justify-items: start; text-align: left; }
  .sel-actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* ----- Partage famille : gestion des liens (client et studio) ----- */
.share-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.share-meta .share-badge svg { width: 11px; height: 11px; vertical-align: -1px; }
.share-pw { display: flex; gap: 6px; }
.share-pw input { flex: 1; min-width: 0; font-family: Consolas, ui-monospace, monospace; letter-spacing: 0.02em; }
.share-pw .btn.icon-btn { flex-shrink: 0; width: 44px; height: auto; }
.share-created { display: grid; gap: 8px; margin: 14px 0 4px; padding: 14px 16px; border: 1px solid var(--blue-line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.share-created strong { display: flex; align-items: center; gap: 6px; color: var(--ink); }
.share-created strong svg { width: 18px; height: 18px; color: var(--blue); }
.share-created textarea { min-height: 0; field-sizing: content; resize: none; font-size: var(--text-sm); background: var(--surface-2); }
.share-created .share-actions { flex-wrap: wrap; }
.modal .callout { margin-bottom: 12px; }

/* ----- Partage famille : commentaires sur la page du lien ----- */
.share-hint { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 10px; padding: 6px 12px; border-radius: var(--radius-full); background: var(--blue-soft); color: var(--blue-hover); font-size: var(--text-xs); font-weight: 600; }
.share-hint svg { width: 14px; height: 14px; }
.share-chat {
  position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px; height: 40px; min-width: 40px;
  padding: 0 12px; border: 0; border-radius: var(--radius-full); background: rgba(255, 255, 255, 0.94); color: var(--blue);
  box-shadow: 0 6px 18px rgba(8, 36, 69, 0.25); font-weight: 700; font-size: var(--text-sm); cursor: pointer;
}
.share-chat svg { width: 18px; height: 18px; }
.share-chat b:empty { display: none; }
.share-chat:hover { background: #fff; transform: translateY(-1px); }
.sc-backdrop { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(4, 14, 30, 0.82); backdrop-filter: blur(6px); }
.sc-sheet { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); width: min(1100px, 100%); height: min(760px, calc(100vh - 40px)); overflow: hidden; border-radius: var(--radius-xl); background: var(--surface); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45); }
.sc-photo { position: relative; display: grid; place-items: center; min-height: 0; overflow: hidden; background: #061224; }
.sc-photo img { width: 100%; height: 100%; min-height: 0; object-fit: contain; -webkit-user-select: none; user-select: none; }
.sc-num { position: absolute; left: 14px; top: 14px; padding: 4px 10px; border-radius: var(--radius-full); background: rgba(255, 255, 255, 0.9); color: var(--ink); font-size: var(--text-xs); font-weight: 700; }
.sc-nav { position: absolute; top: 50%; display: grid; place-items: center; width: 44px; height: 44px; margin-top: -22px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.9); color: var(--ink); cursor: pointer; }
.sc-nav.is-prev { left: 12px; }
.sc-nav.is-next { right: 12px; }
.sc-nav svg { width: 20px; height: 20px; }
.sc-side { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-height: 0; }
.sc-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.sc-head h2 { margin: 0; font-family: var(--font-serif); font-size: var(--text-xl); font-weight: 400; color: var(--ink); }
.sc-close { display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--ink); cursor: pointer; }
.sc-close svg { width: 18px; height: 18px; }
.sc-list { display: grid; align-content: start; gap: 14px; margin: 0; padding: 16px 18px; overflow-y: auto; list-style: none; }
.sc-item { display: flex; gap: 10px; }
.sc-item > div { min-width: 0; }
.sc-item p { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.sc-avatar { display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-size: 0.7rem; font-weight: 800; }
.sc-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.sc-meta strong { color: var(--ink); font-size: var(--text-sm); }
.sc-meta time { color: var(--subtle); font-size: var(--text-xs); }
.sc-empty { color: var(--muted); font-size: var(--text-sm); }
.sc-form { display: grid; gap: 8px; padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--surface-2); }
.sc-row { display: flex; gap: 8px; align-items: flex-end; }
.sc-row textarea { flex: 1; min-height: 44px; resize: none; }
.sc-row .btn { flex-shrink: 0; width: 48px; height: 48px; padding: 0; justify-content: center; }
@media (max-width: 760px) {
  .sc-backdrop { padding: 0; place-items: end stretch; }
  .sc-sheet { grid-template-columns: 1fr; grid-template-rows: 36dvh minmax(0, 1fr); width: 100%; height: 100dvh; border-radius: 0; }
  .sc-head { padding: 10px 14px; }
  .sc-list { padding: 12px 14px; }
}
[data-theme="dark"] .share-chat { background: rgba(14, 27, 48, 0.92); color: #8fc0ff; }

/* ==========================================================================
   Galerie : barre d'actions — actions principales à gauche, outils d'affichage
   groupés dans une pilule à droite. Mobile : deux rangées, rien ne déborde.
   ========================================================================== */
.gallery-actions { align-items: center; justify-content: space-between; gap: var(--space-3); }
.ga-main { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.ga-main .btn { min-height: 46px; padding: 10px 20px; }
.ga-main .btn svg { width: 18px; height: 18px; }
.ga-primary { padding-inline: 24px !important; }
.ga-tools {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.ga-tool {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--fast), color var(--fast);
}
.ga-tool svg { width: 17px; height: 17px; }
.ga-tool:hover { background: var(--blue-soft); color: var(--blue-hover); }
.ga-tool.is-on { background: var(--blue); color: #fff; box-shadow: 0 6px 16px -8px rgba(18, 101, 216, 0.8); }
.ga-tool:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
[data-theme="dark"] .ga-tools { background: var(--surface); border-color: var(--border); }

@media (max-width: 1100px) {
  /* Écran moyen : les outils gardent leur icône, le texte disparaît (infobulle au survol). */
  .ga-tool span { display: none; }
  .ga-tool { width: 42px; padding: 0; justify-content: center; }
}

@media (max-width: 640px) {
  .gallery-actions { display: grid; grid-template-columns: minmax(0, 1fr); justify-content: stretch; gap: var(--space-3); margin-top: var(--space-4); padding-bottom: var(--space-4); }
  /* Rangée 1 : « Tout télécharger » prend la place, Diaporama et Partager en boutons ronds. */
  .ga-main { flex-wrap: nowrap; }
  .ga-main .btn { min-height: 50px; }
  .ga-primary { flex: 1; justify-content: center; }
  .ga-round { flex-shrink: 0; width: 50px; padding: 0 !important; justify-content: center; }
  .ga-round .ga-label { display: none; }
  /* Rangée 2 : les outils en segments égaux, icône + petit libellé. */
  .ga-tools { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; border-radius: 18px; }
  .ga-tool { flex-direction: column; gap: 3px; width: auto; min-height: 54px; padding: 6px 2px; border-radius: 14px; font-size: 0.6875rem; }
  .ga-tool span { display: block; }
  .ga-tool svg { width: 19px; height: 19px; }
}

/* Connexion : logo KentraPix sur la photo (à la place du nom du studio). */
.login-kicker.login-logo { gap: 10px; color: #fff; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; text-transform: none; }
.login-kicker.login-logo::before { display: none; }
.login-logo img { width: 30px; height: 30px; border-radius: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3); }
.login-logo b { color: #8fc0ff; font-weight: 800; }
.sidebar-foot a, .sidebar p a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ----- Installer l'application (ordinateur et téléphone) ----- */
.login-foot { display: grid; justify-items: center; margin-top: var(--space-6); padding-top: var(--space-5); border-top: 1px solid var(--border); text-align: center; }
.login-foot p { margin: 0; color: var(--subtle); font-size: var(--text-xs); line-height: 1.6; }
.login-foot a { color: var(--muted); }
/* Installer l'application : une toute petite icône devant le copyright (infobulle au survol). */
.mini-install {
  display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 6px; padding: 0; vertical-align: -5px;
  border: 1px solid var(--blue-line); border-radius: 50%; background: var(--blue-soft); color: var(--blue); cursor: pointer;
  transition: transform var(--fast), background var(--fast);
}
.mini-install svg { width: 11px; height: 11px; }
.mini-install:hover { transform: translateY(-1px); background: var(--blue); color: #fff; }
.sidebar-foot .mini-install { border-color: rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.16); color: #fff; }
.sidebar-foot .mini-install:hover { background: #fff; color: var(--blue); }
.install-help { display: grid; gap: 14px; margin-top: 12px; }
.install-step { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.install-step.is-current { border-color: var(--blue-line); background: var(--blue-soft); }
.install-step h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; color: var(--ink); font-size: var(--text-md); }
.install-step h3 svg { width: 17px; height: 17px; color: var(--blue); }
.install-step ol { display: grid; gap: 6px; margin: 0; padding-left: 20px; color: var(--text); font-size: var(--text-sm); }
.install-step li svg { width: 15px; height: 15px; vertical-align: -2px; color: var(--blue); }
.install-help details { display: grid; gap: 10px; }
.install-help summary { cursor: pointer; color: var(--blue); font-weight: 600; font-size: var(--text-sm); }
.install-help details[open] .install-step { margin-top: 10px; }
[data-theme="dark"] .mini-install { background: rgba(28, 119, 238, 0.18); color: #8fc0ff; }
.terms-ok { align-items: flex-start; gap: 10px; font-weight: 500; color: var(--muted); line-height: 1.5; }
.terms-ok a { color: var(--blue); }

/* ----- Studio : gérer un client (pause, photos, suppression) ----- */
.mc-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.mc-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.mc-stats span { padding: 6px 12px; border-radius: var(--radius-full); background: var(--surface-2); color: var(--muted); font-size: var(--text-sm); }
.mc-stats b { color: var(--ink); }
.mc-gals { display: grid; gap: 6px; margin: 0 0 14px; padding: 0; list-style: none; }
.mc-gals li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.mc-gals li > span { min-width: 0; overflow: hidden; color: var(--ink); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.mc-gals small { color: var(--muted); font-weight: 500; }
.mc-gals .text-link { display: inline-flex; flex-shrink: 0; align-items: center; gap: 4px; }
.mc-gals .text-link svg { width: 14px; height: 14px; }
.mc-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mc-action { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); text-align: left; cursor: pointer; transition: border-color var(--fast), background var(--fast); }
.mc-action:hover { border-color: var(--blue-line); background: var(--blue-soft); }
.mc-action > svg { flex-shrink: 0; width: 20px; height: 20px; color: var(--blue); }
.mc-action span { display: grid; gap: 2px; min-width: 0; }
.mc-action strong { font-size: var(--text-sm); }
.mc-action small { color: var(--muted); font-size: var(--text-xs); }
.mc-action.danger > svg, .mc-action.danger strong { color: #b42318; }
.mc-action.danger:hover { border-color: #f3c5c0; background: #fff4f2; }
.modal:has(.mc-actions) { width: min(620px, 100%); }
.del-choice { display: grid; gap: 8px; margin: 14px 0; padding: 0; border: 0; }
.del-choice legend { margin-bottom: 8px; color: var(--ink); font-weight: 700; font-size: var(--text-sm); }
.modal form .del-choice label:has(> input[type="radio"]) { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; }
.del-choice label:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.del-choice span { display: grid; gap: 2px; }
.del-choice small { color: var(--muted); font-weight: 500; }
.ap-new { display: grid; gap: var(--space-4); }
@media (max-width: 560px) { .mc-actions { grid-template-columns: 1fr; } }
[data-theme="dark"] .mc-action.danger:hover { background: rgba(242, 107, 110, 0.12); }

/* ==========================================================================
   Connexion sur ordinateur : le panneau tient dans la hauteur de la photo.
   Même style ; seuls les espacements suivent la hauteur de l'écran, et le
   formulaire d'inscription passe sur deux colonnes.
   ========================================================================== */
@media (min-width: 901px) {
  .login { height: 100vh; min-height: 0; overflow: hidden; }
  .login > main.login-panel {
    max-height: calc(100vh - 2 * clamp(12px, 3vh, 32px));
    margin: auto;
    padding: clamp(20px, 3.6vh, 40px) clamp(26px, 2.8vw, 40px);
    overflow: hidden;
  }
  body[data-page="login"] { overflow: hidden; }
  .login-panel .brandmark { width: clamp(32px, 4.4vh, 40px); height: clamp(32px, 4.4vh, 40px); }
  .login-panel h1 { margin-top: clamp(12px, 3vh, 36px); font-size: clamp(1.6rem, 1rem + 1.6vh, 2rem); }
  .login-panel h1 + p { margin-top: 6px; }
  .login-panel form { gap: clamp(10px, 1.8vh, 20px); margin-top: clamp(12px, 2.4vh, 28px); }
  .login-panel form label { gap: 6px; }
  .login-panel input:not([type="checkbox"]) { min-height: clamp(42px, 5.4vh, 48px); }
  .login-panel .btn.primary { min-height: clamp(44px, 5.8vh, 52px); margin-top: 0; }
  .login-switch { margin-top: clamp(10px, 2vh, 24px); }
  .login-foot { margin-top: clamp(10px, 2vh, 24px); padding-top: clamp(10px, 2vh, 20px); }

  /* Inscription : deux colonnes (nom | e-mail, mot de passe | confirmation). */
  #signup-form { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 14px; }
  #signup-form > label:nth-child(3),
  #signup-form > .terms-ok,
  #signup-form > .btn { grid-column: 1 / -1; }
  .login-panel:has(#signup-form) h1 { margin-top: clamp(10px, 2vh, 24px); }
}

/* ----- Client : espace « Commentaires » (mots de la famille) ----- */
.greeting-sub { margin-top: 8px; color: var(--muted); font-size: var(--text-md); }
.family-bar { margin-bottom: var(--space-5); }
.family-bar .chip small, .comment-filters .chip small { margin-left: 4px; opacity: 0.7; font-weight: 600; }
.comment-filters { margin-bottom: var(--space-5); }
.family-list { display: grid; gap: var(--space-3); max-width: 880px; }
.family-item { display: flex; gap: var(--space-4); padding: var(--space-4); border: 1px solid var(--border); border-left: 4px solid var(--blue); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.family-thumb { position: relative; flex-shrink: 0; width: 112px; height: 112px; padding: 0; overflow: hidden; border: 0; border-radius: var(--radius); background: var(--blue-soft); cursor: zoom-in; }
.family-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s; }
.family-thumb:hover img { transform: scale(1.05); }
.family-thumb span { position: absolute; left: 6px; bottom: 6px; padding: 2px 8px; border-radius: var(--radius-full); background: rgba(8, 36, 69, 0.65); color: #fff; font-size: var(--text-xs); font-weight: 700; }
.family-main { display: grid; align-content: start; gap: 6px; min-width: 0; flex: 1; }
.family-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.family-meta strong { color: var(--ink); }
.family-meta time { margin-left: auto; color: var(--subtle); font-size: var(--text-xs); }
.family-avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-size: 0.65rem; font-weight: 800; }
.family-body { margin: 0; color: var(--text); font-size: var(--text-md); line-height: 1.55; overflow-wrap: anywhere; }
.family-where { margin: 0; color: var(--muted); font-size: var(--text-xs); }
.family-actions { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-top: 2px; }
.family-actions .text-link { display: inline-flex; align-items: center; gap: 5px; font-size: var(--text-sm); }
.family-actions svg { width: 15px; height: 15px; }
.family-actions .text-link.danger { color: #b42318; }
.family-empty .btn { margin-top: var(--space-4); }
@media (max-width: 580px) {
  .family-item { gap: var(--space-3); padding: var(--space-3); }
  .family-thumb { width: 84px; height: 84px; }
  .family-meta time { margin-left: 0; width: 100%; }
}

/* Puce active survolée : le texte reste blanc (sinon bleu sur bleu). */
.chip.active:hover { color: #fff; }

/* ==========================================================================
   Galeries : grandes cartes photo, catégories, progression de sélection
   ========================================================================== */
.events-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-6); }
.event-card .event-cover { aspect-ratio: 4 / 5; border-radius: 22px; box-shadow: var(--shadow-sm); background: var(--gradient-sidebar); }
.event-card .event-cover::after { opacity: 1; background: linear-gradient(180deg, transparent 38%, rgba(8, 36, 69, 0.88)); }
.event-overlay { position: absolute; inset: auto 0 0 0; z-index: 1; padding: 22px 20px 20px; color: #fff; text-align: left; }
.event-overlay h3 { margin: 0; color: #fff; font-family: var(--font-display); font-size: 1.45rem; font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35); }
.event-overlay p { margin: 6px 0 0; color: rgba(255, 255, 255, 0.82); font-size: var(--text-sm); }
.event-card:hover h3 { color: #fff; }
.event-cover .badge { background: var(--blue); color: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 4px 14px rgba(18, 101, 216, 0.4); }
[data-theme="dark"] .event-cover .badge { background: var(--blue); color: #fff; }
@keyframes card-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.events-grid > .event-card { animation: card-in 0.55s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); }
@media (prefers-reduced-motion: reduce) { .events-grid > .event-card { animation: none; } }
@media (max-width: 560px) { .events-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); } .event-overlay { padding: 14px 12px 12px; } .event-overlay h3 { font-size: 1.05rem; } .event-overlay p { font-size: var(--text-xs); } }

.type-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 var(--space-6); }
.chip small { margin-left: 4px; opacity: 0.7; font-weight: 600; }

.pick-bar { height: 8px; overflow: hidden; border-radius: 999px; background: var(--blue-soft); }
.pick-bar i { display: block; height: 100%; border-radius: inherit; background: var(--gradient-primary); transition: width 0.4s var(--ease); }
.pick-bar-text { margin: 0; color: var(--muted); font-size: var(--text-sm); font-weight: 600; }

.empty { padding: var(--space-12) var(--space-6); }
.empty > svg { width: 72px; height: 72px; padding: 20px; box-shadow: 0 0 0 10px var(--blue-soft); }
.empty h2 { color: var(--ink); }

/* ==========================================================================
   Barres de défilement fines, visibles seulement là où l'on doit défiler
   (fenêtres, tableaux, listes). Le reste de la page reste sans barre.
   ========================================================================== */
.modal, .table-wrap, .vc-list, .notif-list, .ann-clients, .sc-list {
  scrollbar-width: thin;
  scrollbar-color: var(--blue-line) transparent;
}
.modal::-webkit-scrollbar, .table-wrap::-webkit-scrollbar,
.vc-list::-webkit-scrollbar, .notif-list::-webkit-scrollbar, .ann-clients::-webkit-scrollbar, .sc-list::-webkit-scrollbar {
  display: block; width: 8px; height: 8px;
}
.modal::-webkit-scrollbar-thumb, .table-wrap::-webkit-scrollbar-thumb,
.vc-list::-webkit-scrollbar-thumb, .notif-list::-webkit-scrollbar-thumb, .ann-clients::-webkit-scrollbar-thumb, .sc-list::-webkit-scrollbar-thumb {
  background: var(--blue-line); border-radius: 99px;
}
.modal::-webkit-scrollbar-thumb:hover, .table-wrap::-webkit-scrollbar-thumb:hover,
.vc-list::-webkit-scrollbar-thumb:hover, .notif-list::-webkit-scrollbar-thumb:hover { background: var(--blue); }
.modal::-webkit-scrollbar-track, .table-wrap::-webkit-scrollbar-track { background: transparent; }

/* ==========================================================================
   Carte « Mon photographe » (accueil et profil du client)
   ========================================================================== */
.photographer-card { margin: var(--space-6, 24px) 0; padding: var(--space-5, 20px); border: 1px solid var(--border); border-radius: var(--radius-lg, 20px); background: var(--surface, #fff); box-shadow: var(--shadow-sm, 0 2px 10px rgba(8, 36, 69, 0.06)); }
.pc-head { display: flex; align-items: center; gap: 16px; }
.pc-head h2 { margin: 6px 0 0; font-size: 1.25rem; color: var(--ink); }
.pc-avatar { flex: none; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; box-shadow: 0 6px 16px rgba(8, 36, 69, 0.18); }
.pc-initials { display: grid; place-items: center; background: var(--gradient-primary); color: #fff; font-weight: 700; font-size: 1.2rem; }
.pc-studio { margin: 2px 0 0; color: var(--muted); font-size: var(--text-sm, 14px); }
.pc-bio { margin: 14px 0 0; color: var(--text); line-height: 1.55; }
.pc-address { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; color: var(--muted); font-size: var(--text-sm, 14px); }
.pc-address svg { width: 16px; height: 16px; color: var(--blue); flex: none; }
.pc-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pc-link { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-weight: 600; font-size: var(--text-sm, 14px); text-decoration: none; transition: background .15s, transform .15s, color .15s; }
.pc-link svg { width: 16px; height: 16px; }
.pc-link:hover { background: var(--blue); color: #fff; transform: translateY(-1px); }
[data-theme="dark"] .photographer-card { background: rgba(14, 27, 46, 0.72); }
[data-theme="dark"] .pc-link { background: rgba(28, 119, 238, 0.18); color: #9cc6ff; }
.pc-add h2 { margin: 0 0 6px; font-size: 1.1rem; color: var(--ink); }
.pc-add-form { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.pc-add-form input { flex: 1; min-width: 120px; max-width: 220px; text-transform: uppercase; letter-spacing: 0.3em; text-align: center; font-weight: 700; }

/* Menu du bas sur téléphone : 6 entrées (client) ou 7 (équipe sur l'espace client) tiennent sur une ligne. */
@media (max-width: 800px) {
  .bottomnav { gap: 2px; padding-left: 4px; padding-right: 4px; }
  .bottomnav button, .bottomnav .nav-switch { flex: 1 1 0; min-width: 0; padding-left: 2px; padding-right: 2px; font-size: 0.625rem; }
  .bottomnav button span, .bottomnav .nav-switch span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* Nom du photographe sur les galeries du client */
.ev-by { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 0.8125rem; opacity: 0.92; }
.ev-by svg { width: 14px; height: 14px; flex: none; }
.gallery-by { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; color: var(--muted); font-size: var(--text-sm, 14px); }
.gallery-by svg { width: 16px; height: 16px; color: var(--blue); flex: none; }
.gallery-by strong { color: var(--ink); }

/* ==========================================================================
   Photos verrouillées par le photographe (N premières photos débloquées)
   ========================================================================== */
.photo-tile.locked { position: relative; display: grid; place-content: center; justify-items: center; gap: 8px; min-height: 120px; overflow: hidden; background: #cfdcef; border-radius: var(--radius, 14px); cursor: not-allowed; transition: transform 0.15s; }
.photo-tile.locked .lk-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; user-select: none; } /* le flou est déjà dans l'image (niveau choisi par le photographe) */
.photo-tile.locked .lk-badge { position: relative; z-index: 1; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: rgba(8, 36, 69, 0.62); box-shadow: 0 6px 18px rgba(0, 20, 70, 0.35); color: #fff; backdrop-filter: blur(2px); }
.photo-tile.locked .lk-badge svg { width: 26px; height: 26px; stroke: #fff; }
.photo-tile.locked .lk-num { position: relative; z-index: 1; padding: 2px 11px; border-radius: 99px; background: rgba(8, 36, 69, 0.62); color: #fff; font-size: 0.78rem; font-weight: 700; }
.photo-tile.locked:hover { transform: translateY(-2px); }
.lock-banner { display: flex; align-items: flex-start; gap: 12px; margin: 10px 0 14px; padding: 12px 16px; border: 1px solid var(--blue-line, #c4d9f7); border-radius: var(--radius-lg, 16px); background: var(--blue-soft, #e8f1ff); color: var(--ink, #082445); }
.lock-banner svg { flex: none; width: 22px; height: 22px; margin-top: 2px; color: var(--blue, #1265d8); }
.lock-banner div { display: grid; gap: 2px; }
.lock-banner span { color: var(--text, #172b46); font-size: var(--text-sm, 14px); line-height: 1.45; }
[data-theme="dark"] .lock-banner { background: rgba(28, 119, 238, 0.14); border-color: rgba(28, 119, 238, 0.35); color: #fff; }
[data-theme="dark"] .lock-banner span { color: #cfe0fb; }

/* ==========================================================================
   Ordinateur : barre de défilement visible au bord de la page et dans le menu bleu
   (sur téléphone elles restent cachées : le doigt suffit).
   ========================================================================== */
@media (min-width: 801px) {
  html { scrollbar-width: thin; scrollbar-color: var(--blue-line) transparent; }
  html::-webkit-scrollbar { display: block; width: 12px; height: 12px; }
  html::-webkit-scrollbar-track { background: transparent; }
  html::-webkit-scrollbar-thumb { background: var(--blue-line); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
  html::-webkit-scrollbar-thumb:hover { background: var(--blue); background-clip: content-box; }
  .sidebar { overflow-y: auto; overflow-x: hidden; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.45) transparent; }
  .sidebar::-webkit-scrollbar { display: block; width: 8px; }
  .sidebar::-webkit-scrollbar-track { background: transparent; }
  .sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.4); border-radius: 99px; }
  .sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.7); }
}
[data-theme="dark"] html { scrollbar-color: #2a4a78 transparent; }
[data-theme="dark"] html::-webkit-scrollbar-thumb { background: #2a4a78; background-clip: content-box; }

/* ---------- Sections repliables des fenêtres (galerie, partage famille…) — partagées par le studio et l’espace client : fermées par défaut, la fenêtre reste courte ---------- */
.acc { margin: 10px 0 0; border: 1px solid var(--border, #e0eaf8); border-radius: 14px; background: var(--surface, #fff); }
.acc > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; font-weight: 600; color: var(--ink, #082445); }
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary::after { content: "▾"; flex: none; color: var(--blue, #1265d8); transition: transform 0.2s; }
.acc[open] > summary::after { transform: rotate(180deg); }
.acc > summary small { margin-left: auto; padding: 2px 10px; border-radius: 99px; background: var(--blue-soft, #e8f1ff); color: var(--blue, #1265d8); font-weight: 600; font-size: 0.75rem; }
.acc[open] > summary { border-bottom: 1px solid var(--border, #e0eaf8); }
.acc-body { display: grid; gap: 12px; padding: 12px 14px 14px; }
.acc-danger > summary { color: #b42318; }
.opt-row { display: flex; flex-wrap: wrap; gap: 8px; }
.opt-row .opt { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1.5px solid var(--border, #e0eaf8); border-radius: 99px; cursor: pointer; font-weight: 600; }
.opt-row .opt:has(input:checked) { border-color: var(--blue, #1265d8); background: var(--blue-soft, #e8f1ff); color: var(--blue, #1265d8); }
.opt-row .opt input { accent-color: var(--blue, #1265d8); }
.up-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 10px 0 8px; font-size: 0.85rem; }
.up-tools #up-count { margin-left: auto; color: var(--muted, #64748b); }
.up-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; max-height: 280px; overflow: auto; padding: 4px; border: 1px solid var(--border, #e0eaf8); border-radius: 12px; background: var(--surface-2, #f5f8fd); scrollbar-width: thin; }
.up-tile { position: relative; display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; cursor: pointer; margin: 0; }
.up-tile img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0.55; transition: opacity 0.15s, transform 0.15s; }
.up-tile input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.up-tile span { position: absolute; left: 4px; bottom: 4px; padding: 1px 7px; border-radius: 99px; background: rgba(8, 36, 69, 0.78); color: #fff; font-size: 0.72rem; font-weight: 700; }
.up-tile:has(input:checked) img { opacity: 1; }
.up-tile:has(input:checked) { outline: 3px solid var(--blue, #1265d8); outline-offset: -3px; }
.up-tile:has(input:checked) span { background: var(--blue, #1265d8); }
.up-tile:has(input:focus-visible) { outline: 3px solid #7db6ff; outline-offset: -3px; }
[data-theme="dark"] .acc { background: rgba(14, 27, 46, 0.6); }
[data-theme="dark"] .up-grid { background: #0a1626; }

/* Fenêtre de partage plus simple : le formulaire garde l'essentiel visible, le reste est replié */
.share-form .acc { margin: 6px 0; }
.share-list { gap: 10px; }

/* ---------- Import : vignette de la photo entourée d'un anneau de progression (compte à rebours circulaire) ---------- */
#upload-dock .upload-row .progress-bar { display: none; }
.ud-thumb { position: relative; flex: none; width: 52px; height: 52px; display: grid; place-items: center; }
.ud-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ud-ring circle { fill: none; stroke-width: 3.5; }
.ud-ring .trk { stroke: var(--blue-soft, #e8f1ff); }
.ud-ring .arc { stroke: var(--blue, #1265d8); stroke-linecap: round; transition: stroke-dasharray 0.35s ease; }
.upload-row.is-done .ud-ring .arc { stroke: #13804b; }
.upload-row[data-state="fail"] .ud-ring .arc { stroke: #b42318; }
.ud-img { width: 38px; height: 38px; border-radius: 50%; background: var(--blue-soft, #e8f1ff) center / cover no-repeat; }
.ud-pct { position: absolute; right: -4px; bottom: -3px; padding: 0 5px; min-width: 24px; text-align: center; border-radius: 99px; background: var(--ink, #082445); color: #fff; font-size: 0.64rem; font-weight: 700; line-height: 17px; }
.upload-row.is-done .ud-pct { background: #13804b; }
[data-theme="dark"] .ud-ring .trk { stroke: #1d3253; }

/* Galerie sans photos : pas encore prêtes / en mise à jour (toujours dans le bleu Kentra) */
.badge.is-soon { gap: 4px; background: #fff; color: var(--blue); }
.badge.is-soon svg { width: 12px; height: 12px; }
.empty.not-ready { border: 1px dashed var(--blue); background: color-mix(in srgb, var(--blue) 6%, transparent); border-radius: 16px; padding: 36px 20px; }
.empty.not-ready > svg { color: var(--blue); }
.empty.not-ready h2 { color: var(--blue); }
.not-ready-note { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--blue) 8%, transparent); color: var(--blue); }
.not-ready-note svg { width: 16px; height: 16px; flex: none; }

/* Menu déroulant à cocher : galerie pour plusieurs clients */
.cpick { display: grid; gap: 6px; margin-bottom: 4px; }
.cpick-label { font-weight: 600; font-size: 0.9rem; }
.cpick-box { border: 1px solid var(--line, #d7e3f5); border-radius: 12px; background: var(--surface, #fff); }
.cpick-box > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; cursor: pointer; font-weight: 600; color: var(--blue); }
.cpick-box > summary::-webkit-details-marker { display: none; }
.cpick-chev { width: 8px; height: 8px; border-right: 2px solid var(--blue); border-bottom: 2px solid var(--blue); transform: rotate(45deg); transition: transform 0.2s; margin-right: 4px; }
.cpick-box[open] .cpick-chev { transform: rotate(-135deg); }
.cpick-body { padding: 0 12px 12px; display: grid; gap: 8px; }
.cpick-search { width: 100%; }
.cpick-actions { display: flex; gap: 16px; font-size: 0.85rem; }
.cpick-list { display: grid; gap: 2px; max-height: 240px; overflow: auto; }
.cpick-row { display: flex !important; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; cursor: pointer; flex-direction: row !important; }
.cpick-row:hover { background: color-mix(in srgb, var(--blue) 8%, transparent); }
.cpick-row[hidden] { display: none !important; }
.cpick-row input[type="checkbox"] { appearance: auto; -webkit-appearance: checkbox; width: 18px; height: 18px; flex: none; accent-color: var(--blue); margin: 0; }
.cpick-row span { display: grid; min-width: 0; }
.cpick-row small { color: var(--muted, #5a6b85); overflow: hidden; text-overflow: ellipsis; }
.modal .cpick-row { justify-content: flex-start; border: 0; background: transparent; box-shadow: none; padding: 8px; min-height: 0; text-align: left; }
.modal .cpick-row:hover { background: color-mix(in srgb, var(--blue) 8%, transparent); }
.modal .cpick-row span { text-align: left; justify-items: start; flex: 1; }
.modal .cpick-row strong { color: var(--ink, #082445); }
.modal .cpick-list .cpick-row { border: 0 !important; border-radius: 10px; padding: 10px 8px !important; background: transparent !important; }
.modal .cpick-list .cpick-row:hover { background: color-mix(in srgb, var(--blue) 8%, transparent) !important; }

/* Fenêtre « Partager » : sobre, sans sous-titres, bien alignée */
.share-form > .acc { grid-column: 1 / -1; margin: 0; }
.share-form .share-toggle { padding: 10px 12px; }
.share-form .share-toggle small, .share-form .acc > summary small:not(#sp-sum) { display: none; }
.share-form { margin: 12px 0 16px; }
.share-created textarea { margin: 8px 0; }
.share-form .opt-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.share-form .opt { display: flex !important; flex-direction: row !important; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 12px; border-radius: 12px; text-align: center; }
.share-form .opt input[type="radio"] { width: 18px; height: 18px; flex: none; margin: 0; }
.share-form .opt span { font-size: 0.92rem; font-weight: 600; }
.share-form #sp-some { display: grid; gap: 12px; }
.share-form #sp-some[hidden] { display: none; }
.share-form #sp-open { width: 100%; justify-content: center; }
.share-form .up-tools { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 8px; }

/* Couverture absente ou illisible : fond bleu Kentra + appareil photo, jamais d'image cassée */
.event-cover, .hero-image { background: linear-gradient(135deg, #1265d8, #0a3a85); }
.event-cover.no-cover::before, .hero-image.no-cover::before { content: ""; position: absolute; inset: 0; margin: auto; width: 56px; height: 56px; opacity: 0.55;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8h3l2-3h6l2 3h3v11H4z'/%3E%3Ccircle cx='12' cy='13' r='3.5'/%3E%3C/svg%3E"); }
.event-cover, .hero-image { position: relative; }

/* ---------- Nom « KentraPix » : lettres nettes et élégantes (Sora), « Pix » en dégradé bleu Kentra ---------- */
:root { --font-brand: "Sora", var(--font-sans); }
.brand strong, .share-brand, .brand b {
  font-family: var(--font-brand);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}
.brand strong { font-size: 1.6rem; color: #082445; }
.brand strong span, .share-brand b, .brand b span {
  font-weight: 800;
  background: linear-gradient(120deg, #1265d8 10%, #3d94ff 90%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.share-brand { font-size: 1.35rem; }
/* Sur la barre latérale bleue : texte blanc, « Pix » bleu clair bien lisible */
.sidebar .brand strong { color: #fff; }
.sidebar .brand strong span { background: linear-gradient(120deg, #9fd0ff, #6fb0ff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent !important; }
[data-theme="dark"] .brand strong { color: #fff; }
[data-theme="dark"] .brand strong span, [data-theme="dark"] .share-brand b { background: linear-gradient(120deg, #7ab8ff, #a9d3ff); -webkit-background-clip: text; background-clip: text; }
/* En-tête de facture (fond bleu) */
.brand b { color: #fff; font-size: 1.6rem; }
.brand b span { background: linear-gradient(120deg, #bfe0ff, #8fc4ff); -webkit-background-clip: text; background-clip: text; }

/* ---------- Titres (Connexion, Bonjour…, galeries) : Sora, plus vivant et plus lisible que le serif léger ---------- */
:root { --font-display: "Sora", var(--font-sans); }
h1, h2, .share-card h1, .share-head h1, .sc-head h2, .ss-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-variation-settings: normal;
  letter-spacing: -0.035em;
  line-height: 1.12;
  -webkit-font-smoothing: antialiased;
}
h1 em, h2 em, .editorial-heading em, .login-caption h1 em {
  font-style: normal;
  font-weight: 700;
  background: linear-gradient(120deg, #1265d8 10%, #3d94ff 90%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
[data-theme="dark"] h1 em, [data-theme="dark"] h2 em { background: linear-gradient(120deg, #7ab8ff, #b6dbff); -webkit-background-clip: text; background-clip: text; }
.login-panel h1 { font-size: clamp(2rem, 1.6rem + 1.6vw, 2.6rem); }

/* Sélection : demandes de retouche par photo */
.pick-notes { margin-top: 12px; }
.pick-note { display: grid; grid-template-columns: 48px auto 1fr; align-items: center; gap: 10px; padding: 6px 0; }
.pick-note img { width: 48px; height: 48px; object-fit: cover; border-radius: 10px; }
.pick-note .pn-num { font-weight: 700; color: var(--blue); white-space: nowrap; }
.pick-note input { min-width: 0; }
@media (max-width: 520px) { .pick-note { grid-template-columns: 44px 1fr; } .pick-note input { grid-column: 1 / -1; } }
.pick-recap { margin: 4px 0 12px; padding-left: 18px; line-height: 1.7; }
.sel-requests { margin: 10px 0; padding: 10px 14px; border-radius: 12px; background: color-mix(in srgb, var(--blue) 8%, transparent); }
.sel-requests ul { margin: 6px 0 0; padding-left: 18px; line-height: 1.7; }
.sel-requests b { color: var(--blue); }

/* Sauvegardes */
.bk-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--border, #e0eaf8); }
.bk-row > div:first-child { display: grid; gap: 2px; min-width: 0; }
.bk-row > div:first-child span { color: var(--muted, #5a6b85); font-size: 0.88rem; }
.storage-backup .row { margin: 12px 0 4px; }

/* ---------- Rendez-vous : calendrier et créneaux (bleu Kentra) ---------- */
.bk-month { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0 8px; }
.bk-month strong { text-transform: capitalize; font-family: var(--font-display); font-size: 1.1rem; }
.bk-week, .bk-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.bk-week span { text-align: center; font-size: 0.75rem; font-weight: 600; color: var(--muted, #5a6b85); text-transform: uppercase; }
.bk-grid { margin-top: 6px; transition: opacity 0.2s; }
.bk-grid.is-loading { opacity: 0.45; }
.bk-cell { position: relative; aspect-ratio: 1; min-height: 40px; display: grid; place-items: center; border: 1.5px solid transparent; border-radius: 12px; background: transparent; color: #9fb0c8; font-weight: 600; font-size: 0.95rem; padding: 0; }
.bk-cell.is-empty { pointer-events: none; }
.bk-cell:disabled { cursor: default; }
.bk-cell.is-free { color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, transparent); cursor: pointer; }
.bk-cell.is-free:hover { border-color: var(--blue); }
.bk-cell.is-today { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--blue) 35%, transparent); }
.bk-cell.is-picked { background: var(--blue) !important; color: #fff !important; }
.bk-cell.bk-adm { color: var(--ink, #082445); background: #fff; border-color: var(--border, #e0eaf8); cursor: pointer; }
.bk-cell.bk-adm.has-bk { background: color-mix(in srgb, var(--blue) 12%, #fff); color: var(--blue); }
.bk-cell.bk-adm.is-blocked { background: repeating-linear-gradient(135deg, #eef2f8, #eef2f8 6px, #e1e8f2 6px, #e1e8f2 12px); color: #8a9ab3; }
.bk-cell i { position: absolute; top: 3px; right: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px; background: var(--blue); color: #fff; font-size: 0.65rem; font-style: normal; line-height: 16px; text-align: center; }
.bk-slots { margin-top: 16px; display: grid; gap: 10px; }
.bk-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bk-form { display: grid; gap: 12px; margin-top: 14px; }
.bk-days { display: flex; flex-wrap: wrap; gap: 6px; }
.bk-days .chip { cursor: pointer; user-select: none; }
.bk-legend { display: flex; gap: 14px; align-items: center; margin: 10px 0 0; }
.bk-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; }
.bk-dot.has { background: var(--blue); } .bk-dot.blk { background: #c9d4e4; }
.bk-pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 0.75rem; font-weight: 700; background: color-mix(in srgb, var(--blue) 10%, transparent); color: var(--blue); }
.bk-pill.is-confirmed { background: #e3f6ec; color: #13804b; } .bk-pill.is-declined, .bk-pill.is-cancelled { background: #f1f3f7; color: #6b7a90; }
.count-pill { display: inline-block; min-width: 22px; padding: 0 8px; border-radius: 99px; background: var(--blue); color: #fff; font-size: 0.8rem; line-height: 22px; text-align: center; vertical-align: middle; }
.bk-none { text-align: center; margin: 12px 0 0; }

/* ---------- Commandes d'albums et de tirages ---------- */
.ord-products { display: grid; gap: 10px; }
.ord-product { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border: 1px solid var(--border, #e0eaf8); border-radius: 16px; background: #fff; }
.ord-product > div:first-child { display: grid; gap: 2px; min-width: 0; }
.ord-product span { color: var(--muted, #5a6b85); font-size: 0.9rem; }
.ord-product .ord-meta { color: var(--blue); font-weight: 600; }
.ord-buy { display: grid; gap: 8px; justify-items: end; flex: none; }
.ord-buy b { font-size: 1.15rem; color: var(--ink, #082445); }
.ord-count { font-weight: 600; color: var(--blue); }
.ord-count.is-bad { color: #b42318; }
.ord-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; max-height: 280px; overflow: auto; padding: 4px; margin: 6px 0 10px; border: 1px solid var(--border, #e0eaf8); border-radius: 14px; }
.ord-photo { position: relative; padding: 0; border: 2px solid transparent; border-radius: 12px; overflow: hidden; background: #eef3fb; aspect-ratio: 1; cursor: pointer; }
.ord-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ord-photo span { position: absolute; left: 4px; bottom: 4px; padding: 1px 7px; border-radius: 99px; background: rgba(8, 36, 69, 0.78); color: #fff; font-size: 0.7rem; font-weight: 700; }
.ord-photo i { position: absolute; right: 4px; top: 4px; width: 22px; height: 22px; border-radius: 99px; background: var(--blue); color: #fff; display: none; place-items: center; }
.ord-photo i svg { width: 14px; height: 14px; }
.ord-photo.is-on { border-color: var(--blue); }
.ord-photo.is-on i { display: grid; }
.bk-pill.ord-accepted, .bk-pill.ord-production { background: color-mix(in srgb, var(--blue) 14%, transparent); }
.bk-pill.ord-ready, .bk-pill.ord-delivered { background: #e3f6ec; color: #13804b; }
.bk-pill.ord-cancelled { background: #f1f3f7; color: #6b7a90; }
.ord-grid { align-content: start; grid-auto-rows: max-content; }
.ord-photo { display: block; width: 100%; height: auto; min-height: 0; }
.ord-photo img { aspect-ratio: 1; }

/* Rendez-vous / commandes : champs et boutons qui ne dépassent jamais l'écran */
.bk-form select, .bk-form input, .bk-form .btn, .ord-grid + .row2 input, .row2 > label { max-width: 100%; min-width: 0; }
.bk-month strong { text-align: center; flex: 1; }
@media (max-width: 400px) {
  .bk-week, .bk-grid { gap: 4px; }
  .bk-cell { min-height: 36px; border-radius: 10px; font-size: 0.88rem; }
  .bk-chips .chip { flex: 1 1 calc(50% - 8px); justify-content: center; }
  .ord-product { flex-direction: column; align-items: stretch; }
  .ord-buy { grid-auto-flow: column; justify-content: space-between; align-items: center; }
  .share-toggle { gap: 10px; }
}
.bk-week, .bk-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.bk-cell { min-width: 0; }
@media (max-width: 420px) {
  .bk-cell { min-height: 0; font-size: 0.85rem; border-radius: 9px; }
  .bk-cell i { top: 1px; right: 2px; min-width: 14px; height: 14px; line-height: 14px; font-size: 0.6rem; }
  .settings.bill-block { padding: 18px 14px; }
}
.workspace, .main { min-width: 0; }
.bk-slots .row, .storage-backup .row, .bk-book .row, #bka-root .row, #ordA-root .row { flex-wrap: wrap; gap: 8px; }
@media (max-width: 800px) { .bk-month strong { font-size: 1rem; white-space: nowrap; } }

/* ---------- Album : couverture et photos composées par le photographe ---------- */
.ord-cover { flex: none; width: 46px; height: 46px; border-radius: 12px; object-fit: cover; background: var(--blue-soft, #e8f1ff); }
.inv-card header .ord-cover { width: 52px; height: 52px; }
.alb-cover { display: grid; place-items: center; width: 100%; max-width: 220px; aspect-ratio: 4 / 3; margin: 6px 0 10px; border-radius: 16px; overflow: hidden; background: linear-gradient(135deg, #1265d8, #0a3a85); color: #fff; font-weight: 600; font-size: 0.9rem; }
.alb-cover img { width: 100%; height: 100%; object-fit: cover; }
.ord-photo.is-cover { box-shadow: 0 0 0 3px #f5b301; }
.alb-star { position: absolute; left: 4px; top: 4px; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 99px; display: grid; place-items: center; background: rgba(8, 36, 69, 0.78); color: #fff; cursor: pointer; }
.alb-star svg { width: 14px; height: 14px; }
.ord-photo.is-cover .alb-star { background: #f5b301; color: #082445; }
div.ord-photo { cursor: pointer; }

/* Sélecteur de clients : chaque ligne garde sa hauteur (nom + email empilés, sans chevauchement) */
.modal .cpick-list { display: flex; flex-direction: column; gap: 2px; }
.modal .cpick-list .cpick-row { flex: 0 0 auto; height: auto !important; min-height: 52px !important; align-items: center; }
.modal .cpick-row span { display: flex; flex-direction: column; gap: 2px; min-width: 0; height: auto; line-height: 1.3; }
.modal .cpick-row strong, .modal .cpick-row small { display: block; position: static; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==========================================================================
   Barre mobile — version droite : collée en bas, pleine largeur, AUCUN arrondi.
   Icônes réparties à parts égales, tailles qui s'adaptent à l'écran, même dégradé bleu Kentra que le reste du site.
   ========================================================================== */
@media (max-width: 800px) {
  .bottomnav,
  [data-theme="dark"] .bottomnav {
    inset: auto 0 0 0;
    gap: 0;
    padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0;
    background: linear-gradient(90deg, #0c4088, #1265d8 55%, #1c77ee);
    box-shadow: 0 -10px 28px -18px rgba(8, 36, 69, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.14);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .bottomnav button, .bottomnav .nav-switch {
    flex: 1 1 0;
    min-width: 0;
    min-height: 60px;
    gap: 4px;
    padding: 8px 2px 7px;
    border-radius: 0;
    font-size: clamp(0.5625rem, 2.7vw, 0.6875rem);
    line-height: 1.1;
  }
  .bottomnav button svg, .bottomnav .nav-switch svg {
    width: clamp(20px, 5.8vw, 24px);
    height: clamp(20px, 5.8vw, 24px);
    flex: none;
  }
  .bottomnav button.active::after,
  [data-theme="dark"] .bottomnav button.active::after {
    top: auto;
    bottom: 0;
    width: clamp(20px, 6vw, 28px);
    height: 3px;
    margin-left: calc(clamp(20px, 6vw, 28px) / -2);
    border-radius: 0;
    background: #fff;
  }
  .bottomnav .nav-switch { border-left: 1px solid rgba(255, 255, 255, 0.2); }
  .main { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  #toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
}

/* Visionneuse photo sur téléphone : la barre du haut (fermer, nom, commentaires, favori, partager, télécharger, zoom)
   tient toujours sur une ligne. Le nom du fichier rétrécit (…) et les boutons s'adaptent à la largeur, donc
   « Télécharger » reste visible et touchable sur tous les écrans. */
@media (max-width: 800px) {
  .viewer-top {
    flex-wrap: nowrap;
    gap: 4px;
    padding: calc(6px + env(safe-area-inset-top)) calc(6px + env(safe-area-inset-right)) 6px calc(6px + env(safe-area-inset-left));
  }
  .viewer-top > .row:first-child { flex: 1 1 0; min-width: 0; }
  .viewer-top > .row:last-child { flex: none; gap: 0; }
  .viewer .filename { flex: 1 1 auto; min-width: 0; max-width: none; margin-left: 2px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .viewer-top .icon { flex: none; width: clamp(34px, 10.5vw, 42px); height: clamp(34px, 10.5vw, 42px); }
  .viewer-top .icon svg { width: clamp(18px, 5.4vw, 22px); height: clamp(18px, 5.4vw, 22px); }
  .viewer-top .vpick { flex: none; white-space: nowrap; }
}
@media (max-width: 380px) {
  .viewer .filename { font-size: 0.75rem; }
}

/* Barre du haut sur téléphone : accès direct à Statistiques et Administration (propriétaire et admins). */
.topbar .icon.is-current { background: var(--blue-soft); color: var(--blue); }
@media (max-width: 800px) {
  .topbar .row { gap: 2px; }
  .topbar .icon.mobile-only { flex: none; width: 38px; height: 38px; }
  .topbar .search { min-width: 0; flex: 1 1 0; }
}

/* ==========================================================================
   Menu hamburger mobile : tiroir bleu Kentra qui glisse depuis la gauche.
   Remplace la barre du bas ; contient toute la navigation, le profil, etc.
   ========================================================================== */
.burger, .drawer-close, .drawer-backdrop { display: none; }
@media (max-width: 800px) {
  .main { padding-bottom: var(--space-12); }
  .topbar .burger {
    display: inline-flex; flex: none; width: 40px; height: 40px;
    background: var(--gradient-sidebar); color: #fff; border-radius: 14px;
    box-shadow: 0 6px 16px rgba(18, 101, 216, 0.35);
  }
  .topbar .burger:active { transform: scale(0.92); }
  .topbar .burger svg { width: 22px; height: 22px; }

  .sidebar {
    display: flex; width: min(84vw, 320px); z-index: 60;
    padding-top: max(var(--space-8), env(safe-area-inset-top));
    padding-bottom: max(var(--space-5), env(safe-area-inset-bottom));
    border-radius: 0 28px 28px 0;
    transform: translateX(-105%); visibility: hidden;
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.32s;
    box-shadow: none; overflow-y: auto; overscroll-behavior: contain;
  }
  .menu-open .sidebar {
    transform: none; visibility: visible; transition-delay: 0s;
    box-shadow: 18px 0 50px rgba(8, 36, 69, 0.4);
  }
  .sidebar .nav button { min-height: 48px; font-size: 1rem; border-radius: 14px; }
  .menu-open .sidebar .nav button { animation: drawer-in 0.4s both; }
  .menu-open .sidebar .nav button:nth-child(2) { animation-delay: 0.03s; }
  .menu-open .sidebar .nav button:nth-child(3) { animation-delay: 0.06s; }
  .menu-open .sidebar .nav button:nth-child(4) { animation-delay: 0.09s; }
  .menu-open .sidebar .nav button:nth-child(5) { animation-delay: 0.12s; }
  .menu-open .sidebar .nav button:nth-child(n+6) { animation-delay: 0.15s; }
  @keyframes drawer-in { from { opacity: 0; transform: translateX(-14px); } }

  .drawer-close {
    position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px;
    display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px;
    background: rgba(255, 255, 255, 0.16); color: #fff;
  }
  .drawer-close svg { width: 18px; height: 18px; }

  .drawer-backdrop {
    display: block; position: fixed; inset: 0; z-index: 55;
    background: rgba(6, 24, 52, 0.5);
    -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
    opacity: 0; pointer-events: none; transition: opacity 0.3s;
  }
  .menu-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
  .menu-open { overflow: hidden; }
}
@media (max-width: 800px) { .focus-mode .topbar .burger { display: none; } }

/* Hamburger classique : 3 traits égaux, bouton net, bien proportionné sur tous les écrans. */
@media (max-width: 800px) {
  .topbar { gap: 10px; padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .topbar .burger {
    width: 42px; height: 42px; border-radius: 13px; padding: 0;
    background: linear-gradient(145deg, #1a78f0 0%, #1265d8 55%, #0c4088 100%);
    box-shadow: 0 4px 12px rgba(18, 101, 216, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.22);
    transition: transform 0.15s, box-shadow 0.2s;
  }
  .topbar .burger svg { width: 22px; height: 22px; stroke-width: 2.2; }
  .topbar .burger:hover { box-shadow: 0 6px 16px rgba(18, 101, 216, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.22); }
  .sidebar { width: clamp(264px, 82vw, 340px); padding-left: 14px; padding-right: 14px; }
  .sidebar .brand { padding-right: 44px; }
  .sidebar .nav { gap: 2px; }
  .sidebar .nav button { padding-left: 14px; }
  .sidebar .nav button svg { width: 20px; height: 20px; }
  .sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.14); }
}
@media (max-width: 800px) and (max-height: 560px) {
  .sidebar .nav button { min-height: 40px; font-size: 0.9375rem; }
  .sidebar { padding-top: 14px; }
}
@media (max-width: 360px) {
  .topbar .burger { width: 38px; height: 38px; border-radius: 12px; }
  .topbar { gap: 6px; }
}

/* Hamburger : bleu uni, sans halo ni ombre bleue dessous. */
@media (max-width: 800px) {
  .topbar .burger,
  .topbar .burger:hover,
  .topbar .burger:active,
  .topbar .burger:focus-visible {
    background: #1265d8; box-shadow: none; filter: none; border: 0;
    width: 42px; height: 42px; border-radius: 12px; flex: none; align-self: center;
  }
  .topbar .burger:active { background: #0f55b5; }
  .topbar .burger:focus-visible { outline: 2px solid #1265d8; outline-offset: 2px; }
}

/* Hamburger : tuile bleue arrondie, double cadre fin, trois traits parfaitement centrés. */
@media (max-width: 800px) {
  .topbar .burger {
    display: inline-grid; place-items: center; padding: 0; margin: 0 2px 0 0;
    width: 44px; height: 44px; border-radius: 14px; line-height: 0;
    background: #1265d8;
    box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.28), inset 0 0 0 4px #1265d8, inset 0 0 0 5px rgba(255, 255, 255, 0.16);
  }
  .topbar .burger svg { display: block; width: 20px; height: 20px; margin: 0; stroke-width: 2.4; stroke-linecap: round; }
  .topbar .burger:hover, .topbar .burger:active {
    box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.28), inset 0 0 0 4px #1265d8, inset 0 0 0 5px rgba(255, 255, 255, 0.16);
  }
}
@media (max-width: 360px) { .topbar .burger { width: 40px; height: 40px; border-radius: 12px; } }

/* Finitions du tiroir mobile : éléments plus compacts, pied (profil / déconnexion) toujours accessible. */
@media (max-width: 800px) {
  .sidebar .nav button { min-height: 44px; font-size: 0.96875rem; }
  .sidebar .nav { margin-top: 14px; }
  .sidebar-foot {
    position: sticky; bottom: calc(-1 * max(var(--space-5), env(safe-area-inset-bottom)));
    margin-left: -14px; margin-right: -14px; padding: 14px 14px 10px;
    background: linear-gradient(to top, #1466d3 72%, rgba(20, 102, 211, 0));
    border-top: 0;
  }
  .sidebar-foot::before { content: ""; display: block; height: 1px; margin: 0 4px 10px; background: rgba(255, 255, 255, 0.16); }
}
@media (max-width: 800px) { .sidebar-foot { border-radius: 0 0 28px 0; box-shadow: none; } }

/* Studio : photos du portfolio public. */
.pfa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.pfa-item { position: relative; margin: 0; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; background: var(--blue-soft, #e8f1ff); }
.pfa-item img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pfa-item .btn { position: absolute; right: 6px; top: 6px; min-height: 32px; padding: 6px; background: rgba(255, 255, 255, 0.92); }
