/* ── Variables ────────────────────────────────────────────────────────────── */
:root {
  --bg:       #f4f1ec;
  --card:     #ffffff;
  --nav:      #1c2741;
  --nav-txt:  #ddd8cc;
  --accent:   #c8572a;
  --accent-h: #a6421e;
  --text:     #1a1a1a;
  --muted:    #6e6863;
  --border:   #ddd8d0;
  --ok:       #2a7a3b;
  --err:      #c0392b;
  --err-bg:   #fdf0ee;
  --radius:   10px;
  --shadow:   0 2px 12px rgba(0,0,0,.08);
  --max:      1100px;
}

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
       background: var(--bg); color: var(--text);
       min-height: 100vh; display: flex; flex-direction: column; }
img { max-width: 100%; display: block; }
a { color: inherit; }

/* ── Navigation ───────────────────────────────────────────────────────────── */
.nav { background: var(--nav); position: sticky; top: 0; z-index: 200; }
.nav-inner { max-width: var(--max); margin: 0 auto; padding: 0 1rem;
             display: flex; align-items: center; height: 54px; gap: .5rem; }
.nav-brand { color: #fff; text-decoration: none; font-size: 1.05rem;
             font-weight: 700; letter-spacing: -.02em; flex: 1; }
.nav-brand em { color: var(--accent); font-style: normal; }
.nav-toggle { background: none; border: none; color: var(--nav-txt);
              font-size: 1.5rem; cursor: pointer; padding: .3rem .5rem;
              line-height: 1; }
.nav-menu { display: none; position: absolute; top: 54px; left: 0; right: 0;
            background: var(--nav); padding: .5rem 1rem 1rem; }
.nav-menu.open { display: block; }
.nav-menu a { display: block; color: var(--nav-txt); text-decoration: none;
              padding: .65rem .5rem; font-size: .92rem;
              border-bottom: 1px solid rgba(255,255,255,.06); }
.nav-menu a:last-child { border: none; }
.nav-menu a.active,
.nav-menu a:hover { color: #fff; }
.nav-logout button { background: none; border: none; color: var(--nav-txt);
                     font-size: .92rem; cursor: pointer; padding: .65rem .5rem;
                     width: 100%; text-align: left; }
.nav-logout button:hover { color: #fff; }
.nav-user  { color: rgba(255,255,255,.35); font-size: .8rem;
             padding: .75rem .5rem .25rem; border-top: 1px solid rgba(255,255,255,.08); }

@media (min-width: 680px) {
  .nav-toggle { display: none; }
  .nav-menu   { display: flex !important; position: static; padding: 0;
                align-items: center; gap: .15rem; }
  .nav-menu a { display: inline-block; border: none; padding: .35rem .8rem;
                border-radius: 6px; }
  .nav-menu a.active { background: rgba(255,255,255,.12); color: #fff; }
  .nav-user   { border: none; padding: .35rem .8rem; }
  .nav-logout button { width: auto; padding: .3rem .8rem; border-radius: 6px;
                       border: 1px solid rgba(255,255,255,.2) !important; }
  .nav-logout button:hover { border-color: rgba(255,255,255,.5) !important; color: #fff; }
}

/* ── Layout ───────────────────────────────────────────────────────────────── */
.main { flex: 1; max-width: var(--max); margin: 0 auto;
        padding: 2rem 1rem; width: 100%; }

/* ── Page header ──────────────────────────────────────────────────────────── */
.page-hd { margin-bottom: 2rem; }
.page-hd h1 { font-size: 1.65rem; font-weight: 700; }
.page-hd p  { color: var(--muted); margin-top: .4rem; }
.breadcrumb { font-size: .82rem; color: var(--muted); margin-bottom: 1.4rem; }
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: 1fr; gap: 1.1rem; }
@media (min-width: 480px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 800px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.card { background: var(--card); border-radius: var(--radius);
        box-shadow: var(--shadow); overflow: hidden; text-decoration: none;
        color: inherit; display: flex; flex-direction: column;
        transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.card-thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--border); }
.card-ph    { width: 100%; aspect-ratio: 16/9;
              background: linear-gradient(135deg, #e8e3db 0%, #cec8be 100%);
              display: flex; align-items: center; justify-content: center;
              font-size: 2.5rem; opacity: .5; }
.card-body  { padding: 1rem; flex: 1; }
.card-title { font-weight: 600; font-size: .98rem; margin-bottom: .3rem; }
.card-desc  { color: var(--muted); font-size: .85rem; line-height: 1.5; }
.card-meta  { font-size: .78rem; color: var(--muted); margin-top: .5rem; }

/* ── Section ──────────────────────────────────────────────────────────────── */
.section { margin-bottom: 2.75rem; }
.section-hd { display: flex; align-items: baseline; gap: 1rem; margin-bottom: 1.2rem; }
.section-hd h2 { font-size: 1.2rem; font-weight: 700; }
.section-more  { font-size: .85rem; color: var(--accent);
                 text-decoration: none; margin-left: auto; }
.section-more:hover { text-decoration: underline; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn { display: inline-block; padding: .6rem 1.4rem; border-radius: 8px;
       font-size: .92rem; font-weight: 600; cursor: pointer;
       text-decoration: none; border: none; transition: background .15s; }
.btn-primary { background: var(--accent); color: #fff; }
/* Bottom bar wraps comment form (+ mobile toggle/report). On desktop it's not a
   layout box — the comment form keeps its own fixed positioning; the mobile-only
   toggle + report button are hidden. */
.lb-bottombar { display: contents; }
.lb-comments-toggle { display: none; }
.lb-comments-close { display: none; }
.lb-bottombar .lb-flag-toggle { display: none; }
@media (max-width: 768px) {
  /* Comments list: collapsed; opens as a bottom sheet above the bar */
  .lb-comments.has-comments { display: none; }
  .lightbox.has-comments .lb-img { margin-right: 0; }
  /* Unified bottom bar: [💬] [ comment input ] [Envoyer] [♥] [⚑] */
  .lb-bottombar { display: flex; position: fixed; left: 0; right: 0; bottom: 0;
    z-index: 118; gap: .35rem; align-items: center; padding: .5rem .6rem;
    background: rgba(0,0,0,.72); box-sizing: border-box; }
  .lb-bottombar .lb-comment-form { position: static; transform: none; left: auto;
    flex: 1; min-width: 0; display: flex; gap: .35rem; padding: 0; background: none;
    width: auto; max-width: none; }
  .lightbox.has-comments .lb-bottombar .lb-comment-form { left: auto; }
  .lb-bottombar .lb-comment-form textarea { flex: 1; min-width: 0; font-size: .72rem; padding: .4rem .5rem; }
  .lb-bottombar .lb-comment-form textarea::placeholder { font-size: .72rem; }
  .lb-comments-toggle { display: inline-flex; align-items: center; gap: .2rem;
    background: none; color: #fff; border: none; font-size: 1.1rem; cursor: pointer;
    padding: 0 .2rem; flex: 0 0 auto; }
  .lb-bottombar .lb-flag-toggle { display: inline-flex; background: none; border: none;
    color: rgba(255,255,255,.75); font-size: 1.1rem; cursor: pointer; padding: 0 .2rem;
    flex: 0 0 auto; }
  .lb-comment-btn { padding: .4rem .6rem; font-size: .8rem; }
  /* the report reason field, when expanded, sits just above the bar */
  .lb-flag { position: fixed; left: .6rem; right: .6rem; bottom: 3.4rem; top: auto;
    justify-content: center; }
  .lb-flag-toggle-desktop { display: none; }
  .lb-flag-expand { width: 100%; }
  .lb-flag-reason { flex: 1; }
  /* comments sheet opens above the bar */
  .lightbox.mcomments-open .lb-comments.has-comments {
    display: flex; top: auto; bottom: 3.2rem; left: 0; right: 0; width: 100%; max-width: 100%;
    height: 55vh; border-left: none; border-top: 1px solid rgba(255,255,255,.12);
    border-radius: 14px 14px 0 0; padding: 1rem 1rem 1.2rem; }
  .lb-comments-close { display: inline-flex; float: right; background: none; border: none;
    color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; }
  .lb-prev, .lb-next { width: 2.4rem; height: 2.4rem; font-size: 1.1rem; }
  .lightbox.has-comments .lb-next { right: .6rem; }
  .lb-info { bottom: 3.4rem; }
}
.lb-nav-hint { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 122;
  background: rgba(0,0,0,.78); color: #fff; padding: .5rem 1rem; border-radius: 999px;
  font-size: .85rem; box-shadow: 0 2px 10px rgba(0,0,0,.4); animation: navHintFade .4s ease; }
@keyframes navHintFade { from { opacity: 0; transform: translate(-50%,-8px); } to { opacity: 1; } }
.nav-badge { display:inline-block; min-width:1.1rem; padding:0 .3rem; border-radius:999px;
  background:#ef4444; color:#fff; font-size:.7rem; font-weight:700; text-align:center; line-height:1.1rem; }
.unlock-hint { text-align:center; background:#fef3c7; color:#92400e; border:1px solid #fcd34d;
  border-radius:8px; padding:.6rem 1rem; margin-bottom:1rem; font-size:.95rem; }
.event-card-quizz { outline:3px solid #f59e0b; box-shadow:0 0 20px rgba(245,158,11,.5);
  animation:quizzGlow 2s ease-in-out infinite; }
@keyframes quizzGlow { 0%,100%{box-shadow:0 0 16px rgba(245,158,11,.4)} 50%{box-shadow:0 0 28px rgba(245,158,11,.75)} }
.event-card-locked { cursor:not-allowed; background:#1f2937; color:#9ca3af; }
.event-card-locked .event-card-body { align-items:center; text-align:center; justify-content:center; }
.event-lock { font-size:2.2rem; opacity:.85; }
.event-card-locked .event-name { color:#d1d5db; }
.event-card-locked .event-desc { color:#9ca3af; }
.quiz-q-text { white-space: pre-line; line-height: 1.5; }
.quiz-choices { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .8rem; }
.quiz-choices .choice { margin-bottom: 0; }
@media (max-width: 520px) { .quiz-choices { grid-template-columns: 1fr; } }
/* ── Save the Date banner ── */
.std-banner { position:relative; overflow:hidden; border-radius:16px; margin-top:.5rem;
  padding:2.4rem 1.5rem; text-align:center; color:#fff;
  background:linear-gradient(120deg,#6d28d9,#db2777,#f59e0b,#2563eb);
  background-size:300% 300%; animation:stdGradient 12s ease infinite;
  box-shadow:0 8px 30px rgba(0,0,0,.3); }
@keyframes stdGradient { 0%{background-position:0% 50%} 50%{background-position:100% 50%} 100%{background-position:0% 50%} }
.std-inner { position:relative; z-index:2; }
.std-kicker { font-size:1rem; letter-spacing:.05em; opacity:.95; animation:stdBob 2.2s ease-in-out infinite; }
@keyframes stdBob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-5px)} }
.std-title { font-size:2.6rem; font-weight:900; letter-spacing:.14em; margin:.2rem 0;
  text-shadow:0 2px 12px rgba(0,0,0,.35); animation:stdPulse 2.6s ease-in-out infinite; }
@keyframes stdPulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.04)} }
.std-sub { font-size:1.05rem; opacity:.95; margin-bottom:1rem; }
.std-date { display:flex; align-items:center; justify-content:center; gap:.5rem; flex-wrap:wrap;
  margin:.6rem 0; }
.std-day { font-size:3rem; font-weight:900; line-height:1; padding:.2rem .6rem; border-radius:10px;
  background:rgba(255,255,255,.18); border:2px solid rgba(255,255,255,.5); }
.std-amp { font-size:1.8rem; font-weight:700; opacity:.9; }
.std-mon { font-size:1.4rem; font-weight:800; letter-spacing:.1em; margin-left:.4rem;
  background:linear-gradient(90deg,#fff,#fde68a,#fff); background-size:200% auto; color:transparent;
  -webkit-background-clip:text; background-clip:text; animation:stdShimmer 3s linear infinite; }
@keyframes stdShimmer { to { background-position:200% center; } }
.std-note { font-size:.92rem; opacity:.92; margin-top:.6rem; }
.std-confetti { position:absolute; inset:0; z-index:1; pointer-events:none; overflow:hidden; }
.std-conf-piece { position:absolute; top:-12px; width:9px; height:14px; border-radius:2px; opacity:.9;
  animation-name:stdFall; animation-timing-function:linear; animation-iteration-count:infinite; }
@keyframes stdFall { 0%{transform:translateY(-20px) rotate(0)} 100%{transform:translateY(340px) rotate(540deg); opacity:.2} }
@media (prefers-reduced-motion: reduce) {
  .std-banner, .std-kicker, .std-title, .std-mon, .std-conf-piece { animation:none; }
}
.lb-person { flex-direction: column !important; align-items: stretch !important; gap:.15rem; }
.lb-person-row1 { display:flex; align-items:center; gap:.4rem; }
.lb-person-row1 a.lb-person-name-edit { min-width:0; max-width:11rem; overflow:hidden; text-overflow:ellipsis;
  white-space:nowrap; color:#fff; text-decoration:none; cursor:pointer; }
.lb-person-row1 a.lb-person-name-edit:hover { text-decoration:underline; color:#93c5fd; }
.lb-person-clust { display:inline-flex; align-items:center; gap:.35rem; }
.lb-person-row1 .lb-person-rm, .lb-person-row1 .lb-person-ignore { margin-left:auto; }
.lb-person-row1 .lb-person-ignore { margin-left:0; }
.lb-cluster-badge { font-size:.72rem; color:#93c5fd; background:rgba(96,165,250,.15);
  padding:0 .35rem; border-radius:4px; text-decoration:none; white-space:nowrap; }
.lb-cluster-badge:hover { background:rgba(96,165,250,.35); color:#fff; }
.lb-det { font-size:.7rem; color:rgba(255,255,255,.45); }
.vid-comments-hd { display:flex; align-items:center; justify-content:space-between; gap:.6rem; }
.card-hidden { opacity:.62; outline:2px dashed rgba(239,68,68,.5); }
.card { position: relative; }
.album-hidden-flag { position:absolute; top:6px; left:6px; z-index:4; background:rgba(239,68,68,.9);
  color:#fff; font-size:.68rem; padding:.1rem .4rem; border-radius:5px; }
.photo-flag-ind { position:absolute; z-index:4; top:4px; font-size:1rem; text-shadow:0 1px 3px #000;
  background:rgba(0,0,0,.45); border-radius:5px; padding:0 .15rem; }
.photo-flag-ind.flagged { right:4px; }
.photo-flag-ind.hiddenind { right:4px; top:auto; bottom:4px; }
.trombi-nameline { display:flex; align-items:baseline; justify-content:space-between; gap:.4rem; }
.trombi-nameline strong { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.trombi-nick { color:var(--muted); font-size:.8rem; white-space:nowrap; flex:0 0 auto; }
.person-names-form { display:flex; gap:.4rem; align-items:center; flex-wrap:wrap; margin:.4rem 0; }
.person-names-form .pn-field { flex:1 1 110px; min-width:90px; padding:.4rem .5rem;
  border:1px solid rgba(128,128,128,.4); border-radius:6px; font-size:.9rem; }
.lb-addface-btn { margin-top:.5rem; width:100%; background:rgba(96,165,250,.2); color:#dbeafe;
  border:1px solid rgba(96,165,250,.5); border-radius:6px; padding:.4rem; cursor:pointer; font-size:.82rem; }
.lb-addface-btn:hover { background:rgba(96,165,250,.35); }
.lb-drawbox { position:fixed; z-index:130; border:2px dashed #60a5fa; background:rgba(96,165,250,.15);
  pointer-events:none; }
.lb-addface-hint { position:fixed; top:12px; left:50%; transform:translateX(-50%); z-index:131;
  background:rgba(0,0,0,.85); color:#fff; padding:.5rem .9rem; border-radius:8px; font-size:.85rem; }
.lb-addface-hint a { color:#93c5fd; }
.consent-badge { display:inline-block; padding:.05rem .45rem; border-radius:6px; font-size:.78rem; font-weight:600; }
.cb-yes { background:#dcfce7; color:#166534; }
.cb-no  { background:#fee2e2; color:#991b1b; }
.cb-unk { background:#fef9c3; color:#854d0e; }
.consent-flag { position:absolute; bottom:6px; left:6px; z-index:4; width:20px; height:20px;
  line-height:20px; text-align:center; border-radius:50%; font-size:.72rem; font-weight:700; }
.cf-yes { background:rgba(34,197,94,.9); color:#052e16; }
.cf-no  { background:rgba(239,68,68,.9); color:#fff; }
.cf-unk { background:rgba(234,179,8,.9); color:#422006; }
/* Face-naming modal — top-level, large, high-contrast */
.nameface-modal { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.15);
  display: none; }
.nameface-box { background: #fff; color: #111; width: min(460px, 92vw); border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5); overflow: visible; }
.nameface-hd { display: flex; justify-content: space-between; align-items: center;
  padding: .9rem 1.1rem; border-bottom: 1px solid #eee; font-weight: 600; }
.nameface-x { border: none; background: none; font-size: 1.4rem; cursor: pointer; color: #666; }
#nameface-form { padding: 1.1rem; display: flex; flex-direction: column; gap: .7rem; }
.nameface-input { width: 100%; padding: .7rem .9rem; font-size: 1.05rem; border-radius: 8px;
  border: 1px solid #cbd5e1; background: #fff; color: #111; }
.nameface-input:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.nameface-suggest { display: flex; flex-direction: column; max-height: 220px; overflow-y: auto;
  border-radius: 8px; }
.nameface-opt { padding: .55rem .8rem; cursor: pointer; color: #111; background: #fff;
  border: 1px solid #eef2f7; font-size: .95rem; }
.nameface-opt:hover { background: #eff6ff; color: #1e40af; }
.nameface-scope { display: flex; align-items: center; gap: .4rem; font-size: .85rem; color: #444; }
.nameface-scope-hint { color: #888; font-size: .78rem; }
.nameface-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: .3rem; }
.consent-note { background:#eff6ff; border:1px solid #bfdbfe; color:#1e40af;
  padding:.6rem .9rem; border-radius:8px; font-size:.85rem; margin:.6rem 0; }
.consent-note a { color:#1e40af; font-weight:600; }
.viewas-banner { background:#fef3c7; color:#92400e; text-align:center; padding:.5rem 1rem;
  font-size:.88rem; border-bottom:1px solid #fcd34d; }
.viewas-banner a { color:#92400e; font-weight:600; margin-left:.5rem; }
.consent-box, .account-box { max-width: 640px; margin: 0 auto; line-height: 1.5; }
.consent-form { display: flex; flex-direction: column; gap: .9rem; margin-top: 1.2rem; }
.consent-choice { display: flex; gap: .6rem; align-items: flex-start; padding: .8rem 1rem;
  border: 1px solid rgba(128,128,128,.3); border-radius: 8px; cursor: pointer; }
.consent-choice:hover { border-color: var(--accent); }
.consent-choice input { margin-top: .25rem; }
.consent-current { margin-top: 1rem; }
.event-hub { margin-bottom: 1.6rem; }
.event-hd { text-align: center; margin-bottom: 1.1rem; }
.event-kicker { font-size: .85rem; letter-spacing: .05em; color: var(--muted); }
.event-title { font-size: 1.9rem; margin: .2rem 0; }
.event-sub { color: var(--muted); margin: 0; }
.event-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.event-card { position: relative; display: block; min-height: 160px; border-radius: 12px;
  overflow: hidden; text-decoration: none; box-shadow: 0 3px 14px rgba(0,0,0,.22); }
.event-card-bg { position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; filter: brightness(.45); }
.event-card-body { position: relative; height: 100%; min-height: 160px; padding: 1rem;
  display: flex; flex-direction: column; justify-content: flex-end; gap: .2rem; color: #fff; }
.event-icon { font-size: 1.6rem; }
.event-name { font-size: 1.15rem; font-weight: 600; }
.event-desc { font-size: .82rem; opacity: .9; }
.event-desc a { color: #fff; text-decoration: underline; }
.slideshow { max-width: 1000px; margin: 0 auto; }
.slide-stage { position: relative; display: flex; align-items: center; justify-content: center;
  background: #000; border-radius: 10px; overflow: hidden; }
.slide-stage img { max-width: 100%; max-height: 75vh; display: block; }
.slide-nav { position: absolute; top: 0; bottom: 0; width: 15%; border: none; cursor: pointer;
  background: transparent; color: #fff; font-size: 3rem; opacity: .55; transition: opacity .15s; }
.slide-nav:hover { opacity: 1; background: rgba(0,0,0,.25); }
.slide-nav.prev { left: 0; } .slide-nav.next { right: 0; }
.slide-meta { text-align: center; color: var(--muted); font-size: .85rem; margin-top: .5rem; }
.cover-star { position:absolute; top:6px; right:6px; z-index:5; width:26px; height:26px;
  border:none; border-radius:50%; background:rgba(0,0,0,.5); color:#fff; font-size:15px;
  line-height:26px; text-align:center; cursor:pointer; padding:0; }
.cover-star:hover { background:rgba(0,0,0,.75); }
.cover-star.is-cover { background:rgba(251,191,36,.9); color:#1f2937; }
.btn-ignore { background: transparent; color: var(--muted); border: 1px solid rgba(255,255,255,.18);
  margin-top: .3rem; cursor: pointer; padding: .3rem; border-radius: 6px; font-size: .8rem; }
.btn-ignore:hover { background: rgba(239,68,68,.15); color: #fca5a5; border-color: rgba(239,68,68,.4); }
.btn-primary:hover { background: var(--accent-h); }
.btn-outline { background: transparent; border: 2px solid var(--accent);
               color: var(--accent); }
.btn-outline:hover { background: var(--accent); color: #fff; }

/* ── Login ────────────────────────────────────────────────────────────────── */
.login-bg { min-height: 100vh; background: var(--nav);
            display: flex; align-items: center; justify-content: center; padding: 1rem; }
.login-card { background: #fff; border-radius: 16px; padding: 2.5rem 2rem;
              width: 100%; max-width: 400px;
              box-shadow: 0 10px 50px rgba(0,0,0,.35); }
.login-brand { text-align: center; margin-bottom: 2rem; }
.login-brand h1 { font-size: 1.45rem; color: var(--nav); }
.login-brand h1 em { color: var(--accent); font-style: normal; }
.login-brand p  { color: var(--muted); font-size: .88rem; margin-top: .35rem; }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.fg { margin-bottom: 1.2rem; }
label.fl { display: block; font-size: .85rem; font-weight: 600;
           margin-bottom: .4rem; }
.fi { width: 100%; padding: .7rem 1rem; border: 2px solid var(--border);
      border-radius: 8px; font-size: 1rem; outline: none;
      transition: border-color .15s; }
.fi:focus { border-color: var(--accent); }
.alert-err { background: var(--err-bg); color: var(--err);
             padding: .75rem 1rem; border-radius: 8px; font-size: .875rem;
             margin-bottom: 1.1rem; border-left: 3px solid var(--err); }

/* ── Photo grid & lightbox ────────────────────────────────────────────────── */
.photo-grid  { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
@media (min-width: 560px) { .photo-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 880px) { .photo-grid { grid-template-columns: repeat(4, 1fr); } }
.photo-item { cursor: pointer; border-radius: 6px; overflow: hidden; display: block;
              aspect-ratio: 1 / 1; position: relative; }
.photo-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px;
                  transition: opacity .2s; }
.photo-item:hover img { opacity: .82; }
/* Subtle contributor label in the lightbox (bottom-left), shown to all users. */
.lb-contrib {
  position: fixed; left: 14px; bottom: 1rem; z-index: 120;
  font-size: .78rem; color: rgba(255,255,255,.8);
  background: rgba(0,0,0,.5); padding: .25rem .6rem; border-radius: 6px;
  pointer-events: none; max-width: 60vw; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }

.lightbox { display: none; position: fixed; inset: 0; z-index: 1000;
            background: rgba(0,0,0,.93);
            align-items: center; justify-content: center; }
.lightbox.open { display: flex; }
/* Image is full-size; only reserve room for the comments panel when it's shown
   (lightbox gets .has-comments). */
.lb-img   { max-width: 94vw; max-height: 86vh; object-fit: contain; border-radius: 4px; }
.lightbox.has-comments .lb-img { max-width: min(94vw, calc(100vw - 380px)); margin-right: 340px; }
@media (max-width: 640px) {
  .lightbox.has-comments .lb-img { margin-right: 0; }
}
.lb-close { position: fixed; top: .9rem; right: .9rem; width: 2.5rem; height: 2.5rem;
            border-radius: 50%; background: rgba(255,255,255,.14); border: none;
            color: #fff; font-size: 1.4rem; cursor: pointer; z-index: 120;
            display: flex; align-items: center; justify-content: center; }
.lb-close:hover { background: rgba(255,255,255,.26); }
.lb-prev, .lb-next { position: fixed; top: 50%; transform: translateY(-50%);
                      width: 2.8rem; height: 2.8rem; border-radius: 50%;
                      background: rgba(255,255,255,.14); border: none;
                      color: #fff; font-size: 1.3rem; cursor: pointer; z-index: 120;
                      display: flex; align-items: center; justify-content: center; }
.lb-prev { left: .6rem; }
.lb-next { right: .6rem; }
/* When the comments panel is open, keep Next clear of it. */
.lightbox.has-comments .lb-next { right: calc(340px + .6rem); }
.lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,.28); }
.lb-info  { position: fixed; bottom: 4rem; left: 50%; transform: translateX(-50%);
            color: #fff; font-size: .82rem; font-weight: 600; text-align: center; z-index: 120;
            background: rgba(0,0,0,.6); padding: .25rem .7rem; border-radius: 999px;
            text-shadow: 0 1px 3px rgba(0,0,0,.8); backdrop-filter: blur(2px); }
.lb-path { position: fixed; bottom: 5rem; left: 50%; transform: translateX(-50%);
           z-index: 120; max-width: min(80vw, 700px); color: rgba(255,255,255,.75);
           font-size: .74rem; font-family: ui-monospace, monospace; text-align: center;
           background: rgba(0,0,0,.5); padding: .2rem .6rem; border-radius: 6px;
           user-select: all; white-space: normal; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; }
.lb-path-hash { color: rgba(255,255,255,.5); font-size: .68rem; word-break: break-all; }

/* ── Video ────────────────────────────────────────────────────────────────── */
.video-shell { background: #000; border-radius: var(--radius); overflow: hidden;
               aspect-ratio: 16/9; }
.video-shell video { width: 100%; height: 100%; display: block; }

/* ── Quiz ─────────────────────────────────────────────────────────────────── */
.quiz-q { background: var(--card); border-radius: var(--radius);
          padding: 1.5rem; margin-bottom: 1.1rem; box-shadow: var(--shadow); }
.quiz-q .qn { color: var(--muted); font-size: .78rem; font-weight: 600;
              text-transform: uppercase; letter-spacing: .05em; margin-bottom: .5rem; }
.quiz-q h3  { font-size: 1rem; font-weight: 600; line-height: 1.55;
              margin-bottom: 1rem; }
.quiz-q img { margin-bottom: 1rem; border-radius: 8px; }
.choice { display: flex; align-items: center; gap: .75rem; padding: .7rem 1rem;
          border: 2px solid var(--border); border-radius: 8px; margin-bottom: .45rem;
          cursor: pointer; transition: border-color .12s, background .12s;
          font-size: .92rem; line-height: 1.4; }
.choice:hover { border-color: var(--accent); background: #fdf5f2; }
.choice input { accent-color: var(--accent); width: 1rem; height: 1rem; flex-shrink: 0; }
.choice.chosen { border-color: var(--accent); background: #fdf5f2; }

/* Quiz result */
.res-score { text-align: center; padding: 2.25rem 1.5rem; background: var(--card);
             border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 2rem; }
.res-num   { font-size: 4rem; font-weight: 800; line-height: 1; margin-bottom: .4rem; }
.res-lbl   { color: var(--muted); font-size: .95rem; }
.c-great   { color: var(--ok); }
.c-ok      { color: #c8820a; }
.c-low     { color: var(--err); }
.res-q     { background: var(--card); border-radius: var(--radius);
             padding: 1.25rem 1.5rem; margin-bottom: .9rem;
             box-shadow: var(--shadow); border-left: 4px solid var(--border); }
.res-q.correct { border-left-color: var(--ok); }
.res-q.wrong   { border-left-color: var(--err); }
.res-q h4      { font-size: .95rem; margin-bottom: .75rem; line-height: 1.5; }
.res-choice    { padding: .5rem .75rem; border-radius: 6px; font-size: .88rem;
                 margin-bottom: .3rem; border: 1px solid transparent; }
.res-choice.was-chosen.is-correct { background: #e4f7e9; border-color: var(--ok);
                                     font-weight: 600; }
.res-choice.was-chosen.is-wrong   { background: var(--err-bg); border-color: var(--err); }
.res-choice.is-correct-ans        { border-color: var(--ok); color: var(--ok); }

/* ── Markdown page ────────────────────────────────────────────────────────── */
.md-content { background: var(--card); border-radius: var(--radius);
              padding: 2rem; box-shadow: var(--shadow); max-width: 760px; }
.md-content h1,.md-content h2,.md-content h3 { margin: 1.5rem 0 .7rem; font-weight: 700; }
.md-content h1 { font-size: 1.65rem; }
.md-content h2 { font-size: 1.3rem; }
.md-content h3 { font-size: 1.05rem; }
.md-content p  { margin-bottom: 1rem; line-height: 1.75; }
.md-content ul,.md-content ol { margin: .5rem 0 1rem 1.5rem; line-height: 1.7; }
.md-content img { border-radius: 8px; margin: 1rem 0; }
.md-content a   { color: var(--accent); }
.md-content blockquote { border-left: 3px solid var(--border);
                         padding-left: 1rem; color: var(--muted); margin: 1rem 0; }
.md-content hr  { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.md-content table { border-collapse: collapse; width: 100%; margin: 1rem 0; }
.md-content td,.md-content th { border: 1px solid var(--border); padding: .5rem .75rem; }
.md-content th { background: var(--bg); font-weight: 600; }

/* ── Pages list ───────────────────────────────────────────────────────────── */
.pages-list { list-style: none; }
.pages-list li { background: var(--card); border-radius: var(--radius);
                 box-shadow: var(--shadow); margin-bottom: .75rem; }
.pages-list a { display: flex; align-items: center; padding: 1rem 1.25rem;
                text-decoration: none; color: var(--text); gap: .75rem; }
.pages-list a:hover .pl-title { color: var(--accent); }
.pl-icon  { font-size: 1.3rem; opacity: .5; }
.pl-title { font-weight: 600; font-size: .95rem; }
.pl-arrow { margin-left: auto; color: var(--muted); font-size: .9rem; }

/* Quiz list badges */
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 20px;
         font-size: .75rem; font-weight: 600; margin-left: .5rem; }
.badge-ok  { background: #e4f7e9; color: var(--ok); }
.badge-new { background: #fdf5f2; color: var(--accent); }

/* ── Empty state ──────────────────────────────────────────────────────────── */
.empty { text-align: center; padding: 4rem 1rem; color: var(--muted); }
.empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: .35; }

/* ── Home greeting ────────────────────────────────────────────────────────── */
.greeting { margin-bottom: 2.5rem; padding-bottom: 1.5rem;
            border-bottom: 1px solid var(--border); }
.greeting h1 { font-size: 1.75rem; font-weight: 700; }
.greeting p  { color: var(--muted); margin-top: .35rem; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.footer { background: var(--nav); color: rgba(255,255,255,.3);
          text-align: center; padding: 1.1rem; font-size: .78rem; }

/* ── Photo flagging & moderation ─────────────────────────────────────────── */
.flag-banner {
  background: #e7f6ec; border: 1px solid #b6e0c4; color: #1c6b3a;
  padding: .7rem 1rem; border-radius: var(--radius); margin-bottom: 1.2rem;
  font-size: .9rem;
}

/* Lightbox flag control */
.lb-flag {
  position: fixed; right: .8rem; bottom: .8rem; left: auto; transform: none;
  display: flex; gap: .4rem; align-items: center; z-index: 125;
}
.lb-flag-toggle {
  background: rgba(0,0,0,.5); color: rgba(255,255,255,.85); border: 1px solid rgba(255,255,255,.25);
  cursor: pointer; padding: .4rem .8rem; border-radius: 8px; font-size: .82rem; line-height: 1;
  white-space: nowrap;
}
.lb-flag-toggle:hover { background: rgba(0,0,0,.75); color: #fff; }
.lb-flag-expand { display: inline-flex; gap: .4rem; align-items: center;
  background: rgba(0,0,0,.6); padding: .35rem .5rem; border-radius: 8px; }
.lb-flag-reason {
  border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.1);
  color: #fff; padding: .4rem .6rem; border-radius: 6px; font-size: .85rem;
  width: 170px;
}
.lb-flag-reason::placeholder { color: rgba(255,255,255,.6); }
.lb-flag-btn {
  background: var(--accent); color: #fff; border: none; cursor: pointer;
  padding: .45rem .8rem; border-radius: 6px; font-size: .85rem; white-space: nowrap;
}
.lb-flag-btn:hover { background: var(--accent-h); }

/* Admin flag list */
.flag-list { display: flex; flex-direction: column; gap: 1rem; }
.flag-card {
  display: flex; gap: 1rem; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem;
}
.flag-thumb {
  width: 120px; height: 120px; object-fit: cover; border-radius: 6px;
  background: var(--border); flex-shrink: 0;
}
.flag-meta { flex: 1; }
.flag-actions { display: flex; gap: .6rem; margin-top: .7rem; }
.hidden-list { display: flex; flex-direction: column; gap: .5rem; }
.hidden-row {
  display: flex; align-items: center; gap: 1rem; justify-content: space-between;
  background: var(--card); border: 1px solid var(--border); border-radius: 6px;
  padding: .5rem .8rem; font-size: .88rem;
}
.btn-secondary {
  background: transparent; border: 1px solid var(--border); color: var(--text);
  cursor: pointer; padding: .4rem .8rem; border-radius: 6px; font-size: .85rem;
}
.btn-secondary:hover { background: var(--border); }
.btn-danger {
  background: #c0392b; border: none; color: #fff; cursor: pointer;
  padding: .4rem .8rem; border-radius: 6px; font-size: .85rem;
}
.btn-danger:hover { background: #a5301f; }

/* Lightbox comments panel — only occupies space when there are comments. */
.lb-comments {
  position: fixed; top: 0; right: 0; height: 100%; width: 340px; max-width: 88vw;
  background: rgba(18,16,14,.96); color: #f3f0ec; z-index: 55;
  display: none; flex-direction: column; padding: 1.25rem 1.25rem 5rem; box-sizing: border-box;
  overflow: hidden; border-left: 1px solid rgba(255,255,255,.08);
  box-shadow: -8px 0 30px rgba(0,0,0,.4);
}
.lb-comments.has-comments { display: flex; }
.lb-comments-title {
  font-size: 1.05rem; font-weight: 600; margin-bottom: 1rem;
  padding-bottom: .75rem; border-bottom: 1px solid rgba(255,255,255,.1);
}
.lb-comments-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: .8rem; }
.lb-comments-empty { color: rgba(255,255,255,.45); font-size: .85rem; text-align: center; padding: 1.5rem 0; }
.lb-comment { display: flex; gap: .6rem; }
.lb-comment .avatar {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: #fff; display: flex; align-items: center;
  justify-content: center; font-weight: 600; font-size: .85rem; text-transform: uppercase;
}
.lb-comment-main {
  flex: 1; min-width: 0; background: rgba(255,255,255,.07);
  border-radius: 10px; padding: .55rem .7rem;
}
.lb-comment-head { display: flex; justify-content: space-between; align-items: center; gap: .4rem; }
.lb-comment-author { font-weight: 600; font-size: .85rem; }
.lb-comment-date { color: rgba(255,255,255,.45); font-size: .72rem; margin-left: auto;
                   white-space: nowrap; }
.lb-comment-del-btn {
  background: none; border: none; color: rgba(255,255,255,.5); cursor: pointer;
  font-size: 1.05rem; line-height: 1; padding: 0 .15rem; margin-left: .3rem;
}
.lb-comment-del-btn:hover { color: #e06a54; }
/* ── Likes ─────────────────────────────────────────────────────────────── */
.lb-like { display: flex; gap: .3rem; align-items: center; background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25); cursor: pointer; color: #fff;
  padding: .4rem .7rem; border-radius: 8px; font-size: 1rem; flex: 0 0 auto; }
.lb-like:hover { background: rgba(255,255,255,.22); }
.lb-like.liked { color: #f43f5e; border-color: rgba(244,63,94,.6); }
.lb-like .heart { font-size: 1.25rem; line-height: 1; }
.lb-like-count { font-size: .95rem; font-weight: 600; }
/* Video page: comment form is on a LIGHT background — make like + Envoyer visible/normal size */
.vid-comment-actions { display: flex; justify-content: flex-end; align-items: center; gap: .6rem; }
.vid-comment-actions .btn-primary { align-self: auto; padding: .5rem 1.1rem; font-size: .95rem;
  border-radius: 8px; }
.vid-comment-actions .lb-like { background: #fff; color: #444; border: 1px solid #cbd5e1; }
.vid-comment-actions .lb-like:hover { background: #f8fafc; }
.vid-comment-actions .lb-like.liked { color: #f43f5e; border-color: #f43f5e; background:#fff; }
.lb-comment-body { font-size: .9rem; margin-top: .2rem; line-height: 1.45;
                   white-space: pre-wrap; word-break: break-word; }
.lb-comment-del { margin: 0; }
.lb-comment-del button {
  background: none; border: none; color: rgba(255,255,255,.5); cursor: pointer;
  font-size: 1.05rem; line-height: 1; padding: 0 .15rem;
}
.lb-comment-del button:hover { color: #e06a54; }
.lb-comment-form { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%);
  z-index: 115; display: flex; gap: .5rem; align-items: center;
  width: min(560px, 92vw); background: rgba(0,0,0,.6); padding: .5rem;
  border-radius: 12px; box-sizing: border-box; }
.lightbox.has-comments .lb-comment-form { left: calc((100vw - 340px) / 2); }
.lb-comment-form textarea {
  flex: 1; resize: none; border-radius: 8px; padding: .55rem .7rem;
  border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.1);
  color: #fff; font-family: inherit; font-size: .9rem; box-sizing: border-box;
  transition: border-color .15s; line-height: 1.3;
}
.lb-comment-form textarea:focus { outline: none; border-color: var(--accent); }
.lb-comment-form textarea::placeholder { color: rgba(255,255,255,.55); }
.lb-comment-btn {
  align-self: stretch; background: var(--accent); color: #fff; border: none;
  cursor: pointer; padding: .5rem 1.1rem; border-radius: 8px; font-size: .85rem;
  font-weight: 600; transition: background .15s; white-space: nowrap;
}
.lb-comment-btn:hover { background: var(--accent-h); }
@media (max-width: 768px) {
  /* Comments visibility on mobile is governed by the collapse/toggle rules
     earlier in this file (.mcomments-open). Here we only keep control tweaks. */
  .lightbox.has-comments .lb-next { right: .6rem; }
  .lightbox.has-comments .lb-like { right: 16px; }
}

/* Video watch layout: video left, comments in a side column on wide screens */
.watch-layout { display: flex; flex-direction: column; gap: 1.75rem; }
.watch-main { min-width: 0; flex: 1; }
.watch-side { min-width: 0; }
@media (min-width: 900px) {
  .watch-layout { flex-direction: row; align-items: flex-start; }
  .watch-main { flex: 1 1 auto; }
  .watch-side { flex: 0 0 340px; width: 340px; position: sticky; top: 70px; }
}

/* Video page comments */
.vid-comments {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.1rem; display: flex; flex-direction: column;
}
.vid-comments-title {
  font-size: 1.05rem; font-weight: 700; margin-bottom: 1rem;
  display: flex; align-items: center; gap: .4rem;
}
.vid-comments-list {
  display: flex; flex-direction: column; gap: .9rem;
  max-height: 60vh; overflow-y: auto;
}
.vid-comments-empty {
  color: var(--muted); font-size: .88rem; text-align: center; padding: 1.25rem .5rem;
}
.vid-comment { background: var(--bg); border-radius: 10px; padding: .55rem .75rem;
  margin-bottom: .5rem; }
.vid-comment-head { display: flex; align-items: baseline; gap: .5rem; }
.vid-comment-author { font-weight: 600; font-size: .9rem; }
.vid-comment-date { color: var(--muted); font-size: .72rem; }
.vid-comment-del { margin-left: auto; }
.vid-comment-body { margin-top: .2rem; line-height: 1.5; font-size: .9rem;
                    white-space: pre-wrap; word-break: break-word; }
.vid-comment-del button {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 1.1rem; line-height: 1; padding: 0 .15rem; border-radius: 4px;
  transition: color .15s;
}
.vid-comment-del button:hover { color: var(--err); }
.vid-comment-form {
  display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1.1rem;
  padding-bottom: 1.1rem; border-bottom: 1px solid var(--border);
}
.vid-comment-form textarea {
  width: 100%; resize: vertical; border-radius: 8px; padding: .65rem .75rem;
  border: 1px solid var(--border); font-family: inherit; font-size: .9rem;
  line-height: 1.5; box-sizing: border-box; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.vid-comment-form textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,87,42,.12);
}
.vid-comment-form .btn-primary { align-self: flex-end; }

/* Accounts table (admin) */
.user-table-wrap { overflow-x: auto; }
.user-table {
  width: 100%; border-collapse: collapse; background: var(--card);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.user-table th, .user-table td {
  text-align: left; padding: .65rem .9rem; font-size: .88rem;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.user-table th { font-weight: 600; background: var(--bg); color: var(--muted); }
.user-table tr:last-child td { border-bottom: none; }
.badge {
  display: inline-block; padding: .15rem .55rem; border-radius: 999px;
  font-size: .75rem; font-weight: 600; background: var(--border); color: var(--text);
}
.badge-admin { background: var(--nav); color: #fff; }
.badge-ok   { background: #e7f6ec; color: var(--ok); }
.badge-warn { background: #fdf3e0; color: #a6651e; }
.badge-err  { background: var(--err-bg); color: var(--err); }

/* ── Inline album videos ───────────────────────────────────────────────── */
.photo-item.is-video { position: relative; }
.photo-item video { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; display: block;
                    background: #000; transition: opacity .2s; }
.photo-item.is-video:hover video { opacity: .82; }
.photo-item .video-badge {
  position: absolute; inset: 0; margin: auto; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; color: #fff; pointer-events: none;
  background: rgba(0,0,0,.55); border-radius: 50%;
}
video.lb-img { background: #000; }
/* PDF album items */
.photo-item.is-pdf { position: relative; }
.photo-item.is-pdf img { object-fit: cover; object-position: top; background: #fff; }
/* 1996-05 Sélection: document scans — show the top of the page in thumbnails. */
.card.tag-1996-05-selection .card-thumb,
.album-view.tag-1996-05-selection .photo-item img { object-position: top; }
.photo-item .pdf-badge {
  position: absolute; bottom: 6px; left: 6px; font-size: .7rem; font-weight: 600;
  color: #fff; background: rgba(200,30,30,.85); padding: .12rem .4rem; border-radius: 4px;
  pointer-events: none; }
/* Inline PDF viewer in the lightbox */
.lb-pdf { flex-direction: column; align-items: center; gap: .5rem;
  width: 94vw; max-width: 900px; height: 86vh; }
.lb-pdf iframe { flex: 1; width: 100%; border: none; border-radius: 4px; background: #fff; }
.lb-pdf-open { color: #cbd5e1; font-size: .85rem; text-decoration: none;
  background: rgba(0,0,0,.5); padding: .3rem .7rem; border-radius: 6px; }
.lb-pdf-open:hover { color: #fff; }

/* ── Manual tagging UI ─────────────────────────────────────────────────── */
.tagbar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap;
          margin: 0 0 1rem; }
.photo-item { position: relative; }
.photo-item .sel-box { position: absolute; top: 6px; left: 6px; width: 20px;
          height: 20px; z-index: 3; cursor: pointer; }
.photo-item .sel-box:checked ~ img,
.photo-item .sel-box:checked ~ video { outline: 3px solid #60a5fa; outline-offset: -3px; }
.lb-tags { position: fixed; top: 4.5rem; left: 14px;
          display: none; flex-direction: column; gap: .3rem; z-index: 118;
          max-height: 30vh; overflow-y: auto; width: 300px;
          background: rgba(0,0,0,.82); padding: .7rem .9rem; border-radius: 10px; }
.lb-tags.open { display: flex; }
.lb-tags-title { color: #cbd5e1; font-size: .72rem; text-transform: uppercase;
          letter-spacing: .04em; margin-bottom: .3rem; }
#lb-tags-list { display: flex; flex-direction: column; gap: .35rem; }
.lb-tag { color: #f1f5f9; font-size: .85rem; display: flex;
          gap: .45rem; align-items: center; cursor: pointer; }
.lb-tag input { width: 16px; height: 16px; cursor: pointer; }
.lb-tag-ro { color: #e4e4e7; font-size: .82rem; background: rgba(255,255,255,.12);
          padding: .2rem .55rem; border-radius: 999px; display: inline-block; }
/* Both side panels are top-anchored on the left, stacked (Thèmes then
   Qui est là), 300px wide. Shift the prev arrow clear of whichever is open. */
.lightbox.tags-open .lb-prev,
.lightbox.people-open .lb-prev { left: calc(300px + 24px); }
/* People panel: TOP-level, directly under the Thèmes panel. */
.lb-people { position: fixed; left: 14px; top: 4.5rem; display: none;
          flex-direction: column; gap: .35rem; z-index: 119; width: 300px;
          max-height: 60vh; overflow-y: auto;
          background: rgba(0,0,0,.82); padding: .7rem .9rem; border-radius: 10px; }
/* When Thèmes is also open, push Qui est là below it. */
.lightbox.tags-open .lb-people { top: calc(4.5rem + 32vh); }
.lb-people.open { display: flex; }
#lb-people-list { display: flex; flex-direction: column; gap: .45rem; }
/* Collapsible "Qui est là ?" header + toggle */
.lb-people-hd { display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; cursor: pointer; user-select: none; }
.lb-people-collapse { background: none; border: none; color: #fff; cursor: pointer;
  font-size: 1.5rem; line-height: 1; padding: .1rem .4rem; }
.lb-people-chev { display: inline-block; transition: transform .15s ease; }
.lb-people.collapsed #lb-people-list { display: none; }
.lb-people.collapsed .lb-people-chev { transform: rotate(-90deg); }
.lb-tags.collapsed #lb-tags-list { display: none; }
.lb-tags.collapsed .lb-people-chev { transform: rotate(-90deg); }
.lb-noface { color: rgba(255,255,255,.6); font-size: .82rem; padding: .1rem 0 .3rem; }
.lb-people.collapsed { max-height: none; }
.lb-person { display: flex; align-items: center; justify-content: flex-start;
          gap: .45rem; font-size: .92rem; flex-wrap: nowrap; }
.lb-person a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
          white-space: nowrap; }
/* the admin action icons (✎ ✗ 🚯) sit right-aligned + consistent width per row */
.lb-person .lb-person-edit { margin-left: auto; }
.lb-person .lb-person-edit,
.lb-person .lb-person-rm,
.lb-person .lb-person-ignore { flex: 0 0 1.4rem; text-align: center; padding: 0; }
.lb-person a { color: #ffffff; text-decoration: none; }
.lb-person a:hover { text-decoration: underline; color: #93c5fd; }
.lb-person-id { color: rgba(255,255,255,.45); font-size: .72rem; }
.lb-person-unknown { color: rgba(255,255,255,.6); font-style: italic; }
.person-name-form { display: flex; gap: .5rem; align-items: center; margin: .6rem 0 .2rem; flex-wrap: wrap; }
.person-name-input { padding: .45rem .6rem; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg); color: var(--fg); min-width: 16rem; font-size: .95rem; }
.lb-person-edit { background: none; border: none; color: rgba(255,255,255,.55); cursor: pointer;
  font-size: .8rem; padding: 0 .15rem; }
.lb-person-edit:hover { color: #fff; }
.lb-person-name-form { display: flex; gap: .25rem; margin-top: .3rem; width: 100%; flex-wrap: wrap; }
.lb-scope-face { font-size:.7rem; color:#cbd5e1; display:flex; align-items:center; gap:.2rem;
  white-space:nowrap; cursor:pointer; width:100%; }
.lb-scope-face input { margin:0; }
.lb-person-name-input { flex: 1; padding: .25rem .4rem; border-radius: 5px;
  border: 1px solid rgba(255,255,255,.25); background: rgba(0,0,0,.4); color: #fff; font-size: .85rem; }
.cluster-badge { display:inline-block; padding:0 .3rem; margin:0 .1rem; border-radius:4px;
  background: rgba(96,165,250,.18); color:#93c5fd; font-size:.7rem; }
.cluster-badge-link { cursor:pointer; text-decoration:none; }
.cluster-badge-link:hover { background: rgba(96,165,250,.38); color:#fff; }
.album-card .album-cover { position: relative; }
.suggest-flag { position:absolute; top:.4rem; right:.4rem; z-index:2;
  background:#f59e0b; color:#1a1a1a; font-size:.72rem; font-weight:600;
  padding:.1rem .4rem; border-radius:10px; box-shadow:0 1px 3px rgba(0,0,0,.4); }
.hidden-flag { position:absolute; top:.4rem; left:.4rem; z-index:2;
  background:#6b7280; color:#fff; font-size:.68rem; font-weight:600;
  padding:.1rem .4rem; border-radius:10px; box-shadow:0 1px 3px rgba(0,0,0,.4); }
/* Trombinoscope: FX2001/All toggle + portrait-pair cards */
.tb-toggle { display:inline-block; padding:.2rem .7rem; margin-right:.3rem; border-radius:16px;
  border:1px solid var(--border); color:var(--muted); text-decoration:none; font-size:.82rem; }
.tb-toggle.active { background:var(--accent); color:#fff; border-color:var(--accent); }
.trombi-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:1rem; }
.trombi-card { display:block; border:1px solid var(--border); border-radius:10px; overflow:hidden;
  background:var(--card,#1a1a1a); text-decoration:none; color:inherit; }
.trombi-portraits { position:relative; display:flex; gap:2px; background:#000;
  justify-content:center; }
.trombi-portraits .tp { position:relative; flex:1 1 50%; aspect-ratio:1/1; overflow:hidden; }
/* A lone portrait keeps the SAME square size as one half of a pair (so single
   and paired tiles are visually consistent), centred in the 2:1 strip. */
.trombi-portraits .tp.tp-single { flex:0 0 50%; }
.trombi-portraits .tp-none { flex:1 1 100%; aspect-ratio:2/1; display:flex; align-items:center;
  justify-content:center; background:rgba(255,255,255,.05); color:var(--muted); font-size:2.4rem; }
.trombi-portraits .tp img { width:100%; height:100%; object-fit:cover; display:block; }
.trombi-portraits .tp-empty { width:100%; height:100%; display:flex; align-items:center;
  justify-content:center; background:rgba(255,255,255,.06); color:var(--muted); font-size:2rem; }
.trombi-portraits .tp-year { position:absolute; bottom:4px; left:4px; font-size:.65rem;
  background:rgba(0,0,0,.6); color:#fff; padding:0 .3rem; border-radius:4px; }
.trombi-info { padding:.5rem .6rem; }
.trombi-info strong { display:block; }
.photo-item.is-video { position:relative; }
.photo-item .video-play { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
  width:2.6rem; height:2.6rem; display:flex; align-items:center; justify-content:center;
  background:rgba(0,0,0,.55); color:#fff; border-radius:50%; font-size:1.1rem; pointer-events:none; }
.suggestion-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:1.2rem; }
.suggestion-card { border:1px solid var(--border); border-radius:8px; padding:.7rem; background:var(--card,#1a1a1a); }
.suggestion-card img { width:100%; height:340px; object-fit:cover; border-radius:6px; display:block; }
.suggestion-noimg { width:100%; height:340px; display:flex; align-items:center; justify-content:center;
  background:rgba(255,255,255,.06); border-radius:6px; color:var(--muted); font-size:2.2rem; }
.suggestion-meta { display:flex; align-items:center; justify-content:space-between; margin:.6rem 0; }
.qual-badge { display:inline-block; padding:0 .35rem; border-radius:4px; margin-left:.2rem;
  background: rgba(245,158,11,.18); color:#fbbf24; font-size:.72rem; }
.lb-person-rm { background: none; border: none; color: rgba(255,255,255,.65);
          cursor: pointer; font-size: 1.05rem; line-height: 1; padding: 0 .2rem; }
.lb-person-rm:hover { color: #f87171; }
.lb-person-ignore { background: none; border: none; color: rgba(255,255,255,.55);
  cursor: pointer; font-size: .95rem; line-height: 1; padding: 0 .15rem; }
.lb-person-ignore:hover { color: #fbbf24; }
/* Face highlight box (shown on hover of a person in the lightbox). */
.lb-facebox { position: fixed; z-index: 121; pointer-events: none;
          border: 3px solid #fbbf24; border-radius: 4px;
          box-shadow: 0 0 0 9999px rgba(0,0,0,.35); transition: all .08s ease-out; }
/* Suggested (auto-proposed) associations */
.lb-suggest-boxes { position: fixed; inset: 0; z-index: 121; pointer-events: none; }
.lb-suggest-box { position: fixed; border: 2px dashed #38bdf8; border-radius: 4px;
  box-shadow: 0 0 0 2px rgba(0,0,0,.35) inset; }
.lb-person-suggested { background: rgba(56,189,248,.10); border-radius: 6px; }
.lb-proposed-tag { color: #38bdf8; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .03em; }
.lb-person-proposed a { color: #e0f2fe; }
.lb-person-confirm { background: none; border: none; color: #4ade80; cursor: pointer;
  font-size: 1rem; line-height: 1; padding: 0 .2rem; }
.lb-person-confirm:hover { color: #86efac; }

/* ── Thumbnail like/comment badges ─────────────────────────────────────── */
.photo-item .thumb-stats {
  position: absolute; bottom: 6px; left: 6px; display: flex; gap: .35rem;
  pointer-events: none;
}
.photo-item .thumb-stats .ts {
  background: rgba(0,0,0,.6); color: #fff; font-size: .72rem; line-height: 1;
  padding: .2rem .4rem; border-radius: 6px; backdrop-filter: blur(2px);
}

/* Trombi: non-consented people — tile visible but not clickable */
.trombi-card-locked { cursor: default; }

/* Self-service portrait editor (account page) */
.portrait-edit { display:flex; gap:1.2rem; flex-wrap:wrap; margin-top:.6rem; }
.pe-slot { display:flex; flex-direction:column; align-items:center; gap:.4rem; width:160px; }
.pe-label { font-size:.8rem; color:var(--muted); font-weight:600; }
.pe-thumb { width:160px; height:160px; border-radius:10px; overflow:hidden;
  background:#000; display:flex; align-items:center; justify-content:center;
  border:1px solid var(--border); }
.pe-thumb img { width:100%; height:100%; object-fit:cover; }
.pe-empty { color:var(--muted); font-size:1.6rem; }
.pe-processing { font-size:2rem; }
.pe-pending-note { font-size:.85rem; color:var(--accent); margin:.3rem 0 .2rem; }
.spinner { width:34px; height:34px; border-radius:50%;
  border:3px solid rgba(255,255,255,.25); border-top-color:#fff;
  animation:spin 0.8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.pe-choose { cursor:pointer; font-size:.82rem; padding:.4rem .8rem; }
.pe-remove { background:none; border:none; color:var(--err); cursor:pointer;
  font-size:.8rem; text-decoration:underline; }

/* ── Admin nav dropdown (keeps the bar from overflowing) ──────────────────── */
.nav-admin { position: relative; }
.nav-admin-toggle {
  background: none; border: none; color: var(--nav-txt); cursor: pointer;
  font-size: .92rem; font-family: inherit; padding: .65rem .5rem;
}
.nav-admin-toggle:hover { color: #fff; }
.nav-admin-menu { display: none; }
.nav-admin.open > .nav-admin-menu { display: block; }
.nav-admin-menu a { display: block; color: var(--nav-txt); text-decoration: none;
  padding: .55rem .6rem; font-size: .9rem; white-space: nowrap; }
.nav-admin-menu a:hover { color: #fff; }

@media (min-width: 680px) {
  .nav-admin-toggle { padding: .35rem .8rem; border-radius: 6px; }
  .nav-admin-menu {
    position: absolute; top: 100%; right: 0; min-width: 220px;
    background: var(--nav); border: 1px solid rgba(255,255,255,.12);
    border-radius: 8px; padding: .35rem; margin-top: .25rem;
    box-shadow: 0 8px 24px rgba(0,0,0,.35); z-index: 300;
  }
  /* open on hover (desktop) as well as click */
  .nav-admin:hover > .nav-admin-menu { display: block; }
  .nav-admin-menu a { border-radius: 6px; }
  .nav-admin-menu a:hover { background: rgba(255,255,255,.12); }
}

/* ── Contribution uploader (drag/drop + queue) ────────────────────────────── */
.dropzone { border: 2px dashed var(--border); border-radius: 12px;
  padding: 2rem 1rem; text-align: center; background: var(--bg);
  transition: border-color .15s, background .15s; }
.dropzone.dz-over { border-color: var(--accent); background: rgba(200,87,42,.06); }
.dz-icon { font-size: 2.4rem; }
.dz-buttons { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin-top: .5rem; }
.dz-buttons .btn { cursor: pointer; }
.upload-queue { list-style: none; margin: 1rem 0 0; padding: 0;
  display: flex; flex-direction: column; gap: .35rem; }
.uq-row { display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; padding: .45rem .7rem; font-size: .88rem; }
.uq-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uq-status { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.uq-status.uq-ok { color: var(--ok); }
.uq-status.uq-err { color: var(--err); }

/* ── Face-name hotspots (lightbox, all users) ─────────────────────────────── */
.lb-face-hotspots { position: fixed; inset: 0; z-index: 122; pointer-events: none; }
.lb-face-hotspot {
  position: fixed; pointer-events: auto; cursor: pointer;
  /* No visible box around the face — only the name tooltip appears on hover. */
}
.lb-face-tip {
  position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%);
  margin-bottom: 4px; white-space: nowrap; pointer-events: none;
  background: rgba(0,0,0,.82); color: #fff; font-size: .78rem; font-weight: 600;
  padding: .15rem .45rem; border-radius: 5px; opacity: 0; transition: opacity .12s;
}
.lb-face-hotspot:hover .lb-face-tip { opacity: 1; }

/* ── Contributor stats page ───────────────────────────────────────────────── */
.stat-tiles { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.stat-tile {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1rem 1.4rem; text-align: center; min-width: 110px;
}
.stat-num { display: block; font-size: 1.9rem; font-weight: 700; color: var(--accent); line-height: 1; }
.stat-lbl { display: block; font-size: .8rem; color: var(--muted); margin-top: .35rem; }
.contrib-board { display: flex; flex-direction: column; gap: .5rem; }
.contrib-row {
  display: grid; grid-template-columns: 1.6rem minmax(90px, 1fr) 2fr auto;
  align-items: center; gap: .6rem; font-size: .9rem;
}
.contrib-rank { color: var(--muted); font-size: .8rem; text-align: right; }
.contrib-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contrib-bar-wrap { background: var(--border); border-radius: 999px; height: 10px; overflow: hidden; }
.contrib-bar { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.contrib-count { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 2.5rem; text-align: right; }
@media (max-width: 560px) {
  .contrib-row { grid-template-columns: 1.4rem 1fr auto; }
  .contrib-bar-wrap { display: none; }
}

/* Portrait catalogue picker (account page) */
.pe-pick-btn { font-size:.78rem; padding:.35rem .7rem; }
.pe-picker { position:fixed; inset:0; z-index:400; background:rgba(0,0,0,.6);
  display:flex; align-items:center; justify-content:center; padding:1rem; }
.pe-picker-box { background:var(--card); border-radius:var(--radius); box-shadow:var(--shadow);
  width:100%; max-width:720px; max-height:80vh; display:flex; flex-direction:column; overflow:hidden; }
.pe-picker-head { display:flex; justify-content:space-between; align-items:center;
  padding:.8rem 1rem; border-bottom:1px solid var(--border); font-weight:600; }
.pe-picker-close { background:none; border:none; font-size:1.5rem; cursor:pointer; color:var(--muted); line-height:1; }
.pe-picker-grid { overflow-y:auto; padding:.8rem; display:grid; gap:.5rem;
  grid-template-columns:repeat(auto-fill, minmax(90px, 1fr)); }
.pe-pick-form { margin:0; }
.pe-pick-cell { padding:0; border:2px solid transparent; border-radius:8px; background:none;
  cursor:pointer; overflow:hidden; width:100%; aspect-ratio:1/1; }
.pe-pick-cell:hover { border-color:var(--accent); }
.pe-pick-cell img { width:100%; height:100%; object-fit:cover; display:block; }

/* Admin current-portraits strip (person page) */
.admin-portraits { display:flex; align-items:center; gap:.6rem; flex-wrap:wrap; margin-top:.4rem; }
.ap-slot { display:inline-flex; align-items:center; gap:.3rem; }
.ap-label { font-size:.74rem; color:var(--muted); }
.ap-thumb { width:38px; height:38px; border-radius:5px; object-fit:cover; border:1px solid var(--border); }
.ap-empty { color:var(--muted); }
.ap-remove { background:rgba(239,68,68,.12); color:var(--err); border:1px solid rgba(239,68,68,.4);
  border-radius:5px; cursor:pointer; font-size:.75rem; line-height:1; padding:.2rem .4rem; }
.ap-remove:hover { background:rgba(239,68,68,.25); }
