:root {
  --bg: #0d0e14;
  --bg2: #14161f;
  --panel: #1a1d29;
  --panel2: #222636;
  --border: #2c3147;
  --text: #e8eaf2;
  --muted: #8d93a8;
  --accent: #f0a832;
  --accent-fg: #1a1407; /* text on accent surfaces — 9.03:1 on #f0a832 */
  /* Orange TEXT on the page ground (links, active tab, key figures). In dark
     it is the brand orange itself (9.5:1 on --bg); light redefines it darker
     because #f0a832-as-text fails on white. --accent stays the ACTION color. */
  --accent-text: #f0a832;
  --accent2: #8b5cf6;
  --danger: #ef4444;
  --ok: #22c55e;
  --info: #3b82f6;
  /* Badge palette, one variable pair per family, retinted per theme. Dark
     keeps the rgba washes; worst-case computed contrast (fg on wash over
     --panel2 #222636): blue 5.6, amber 5.4, green 6.6, grey 5.0, violet 5.3,
     red 6.5 — all ≥ 4.5:1. */
  --badge-blue-bg: rgba(59,130,246,.16);
  --badge-blue-fg: #7eb1ff;
  --badge-amber-bg: rgba(240,168,50,.16);
  --badge-amber-fg: #f0a832;
  --badge-green-bg: rgba(34,197,94,.16);
  --badge-green-fg: #5fdc8d;
  --badge-grey-bg: rgba(141,147,168,.16);
  --badge-grey-fg: #a2a9bd;
  --badge-violet-bg: rgba(139,92,246,.18);
  --badge-violet-fg: #b79bff;
  --badge-red-bg: rgba(239,68,68,.14);
  --badge-red-fg: #ff9a9a;
  --radius: 10px;
  font-size: 15px;
  /* Modular scale — major third (×1.25) — and an 8px spacing grid. Eight
     orphan numbers become one family the eye recognizes without computing:
     the difference between a web page and a printed spread. */
  --fs--1: .8rem;
  --fs-0: 1rem;
  --fs-1: 1.25rem;
  --fs-2: 1.563rem;
  --fs-3: 1.953rem;
  --fs-4: 2.441rem;
  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 32px;
  --sp-5: 40px;
  --sp-6: 48px;
}

/* High-visibility mode for daylight exteriors: strong contrast, light ground. */
:root[data-theme="light"] {
  --bg: #f4f2ec;
  --bg2: #ffffff;
  --panel: #ffffff;
  --panel2: #ece9e0;
  --border: #8a8471; /* 3.34:1 on --bg, 3.74:1 on #fff — targets keep their
                        edges in full sun (≥3:1 non-text) */
  --text: #17181d;
  --muted: #565b6b;
  /* The SAME brand orange as dark — the accent is the signature, not a theme
     variable. Dark text on it: #1a1407 on #f0a832 = 9.03:1 (identical ratio
     both themes, recomputed 2026). The old #a86a00 turned every CTA brown. */
  --accent: #f0a832;
  --accent-fg: #1a1407; /* 9.03:1 on #f0a832 */
  --accent-text: #8a5a00; /* orange AS TEXT: 5.29:1 on --bg, 5.93:1 on #fff */
  --accent2: #6d28d9; /* 7.10:1 on #fff, 6.35:1 on --bg */
  --danger: #b91c1c;
  --ok: #15803d;
  --info: #1d4ed8;
  /* Solid light grounds (no composited rgba) + dark text of the same hue.
     Computed WCAG contrast, fg on bg, next to each pair. */
  --badge-blue-bg: #d9e6fb;
  --badge-blue-fg: #1a4fc4; /* 5.63:1 */
  --badge-amber-bg: #f7e3bd;
  --badge-amber-fg: #7a4a00; /* 5.94:1 */
  --badge-green-bg: #d5eedd;
  --badge-green-fg: #116932; /* 5.53:1 */
  --badge-grey-bg: #e5e2d8;
  --badge-grey-fg: #4c5164; /* 6.07:1 */
  --badge-violet-bg: #e9e1f9;
  --badge-violet-fg: #5b21b6; /* 7.10:1 */
  --badge-red-bg: #f8dcdc;
  --badge-red-fg: #a51212; /* 6.03:1 (6.42:1 on --panel2 for toasts) */
}

/* Daylight legibility: secondary buttons keep a firm 2px edge outdoors
   (padding compensated so the box stays the same size). */
:root[data-theme="light"] .btn:not(.btn-primary):not(.btn-ghost):not(.btn-danger-ghost) {
  border-width: 2px;
  padding: 7px 15px;
}
:root[data-theme="light"] .btn-sm:not(.btn-primary):not(.btn-ghost):not(.btn-danger-ghost) { padding: 3px 9px; }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}

button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
a { color: var(--accent-text); text-decoration: none; }

/* Icon sprite (icons.js): stroke glyphs on currentColor, three sizes. */
.ic { width: 20px; height: 20px; vertical-align: -4px; flex-shrink: 0; }
.ic-xs { width: 13px; height: 13px; vertical-align: -2px; }
.ic-sm { width: 16px; height: 16px; vertical-align: -3px; }
.ic-lg { width: 28px; height: 28px; vertical-align: -6px; }
.ic-xl { width: 42px; height: 42px; }

/* ------------------------------ action hierarchy ---------------------------
   RULE: ONE .btn-primary per view, and it is the CTA of that view's job
   (create the look, upload the photo, invite the department). Everything else
   is .btn (secondary) or .btn-ghost (tertiary). Destructive actions never sit
   on the surface as red blocks: .btn-danger-ghost (red only on hover/focus)
   in tables and toolbars, .btn-danger only inside a modal that is ABOUT the
   destruction. Status indicators are badges, never button anatomy. */
.btn {
  background: var(--panel2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 16px;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--border); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); font-weight: 600; }
.btn-primary:hover { background: #ffc14d; }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: rgba(239,68,68,.12); }
/* Destructive-out-of-surface: quiet at rest, red on intent. */
.btn-danger-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-danger-ghost:hover, .btn-danger-ghost:focus-visible { color: var(--danger); background: var(--badge-red-bg); }
.btn-sm { padding: 4px 10px; font-size: .85rem; min-width: 44px; }
.btn-lg { padding: 13px 26px; font-size: 1.05rem; font-weight: 700; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--panel2); }
/* A disabled control must LOOK disabled — no more silently-dead buttons. */
.btn:disabled, button:disabled {
  opacity: .38;
  cursor: not-allowed;
  filter: saturate(.4);
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Anchors don't center their content the way buttons do; with the 44px
   min-height they need flex alignment to keep the label on the midline. */
a.btn { display: inline-flex; align-items: center; text-decoration: none; }

input, select, textarea {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 9px 12px;
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
/* Touch targets: 44px at every width — a finger is the same size at a desk. */
.btn, .chip-btn, select, input:not([type=checkbox]):not([type=color]):not([type=range]) { min-height: 44px; }
textarea { resize: vertical; min-height: 70px; }
label { display: block; font-size: .82rem; color: var(--muted); margin: 12px 0 4px; font-weight: 600; letter-spacing: .02em; }
input[type="color"] { padding: 2px; height: 44px; width: 60px; }
input[type="checkbox"] { width: auto; }

/* ------------------------------- auth screen ------------------------------ */

.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
.auth-hero {
  background: linear-gradient(160deg, #16131f 0%, #0d0e14 60%), radial-gradient(circle at 20% 20%, rgba(240,168,50,.25), transparent 50%);
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--border);
}
.auth-hero .logo { font-size: 2.6rem; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.auth-hero .logo span { color: var(--accent); }
.auth-hero h2 { margin-top: 18px; font-size: 1.4rem; font-weight: 600; color: var(--text); }
.auth-hero p { margin-top: 14px; color: var(--muted); line-height: 1.65; max-width: 480px; }
.auth-hero ul { margin-top: 26px; list-style: none; display: grid; gap: 12px; }
.auth-hero li { color: var(--muted); padding-left: 28px; position: relative; }
.auth-hero li::before { content: ''; position: absolute; left: 2px; top: .55em; width: 14px; border-top: 2px solid var(--accent); border-radius: 2px; }
.auth-form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { font-size: 1.5rem; margin-bottom: 4px; }
.auth-card .sub { color: var(--muted); margin-bottom: 18px; font-size: .9rem; }
.auth-card .btn { width: 100%; margin-top: 18px; padding: 11px; }
.auth-switch { margin-top: 16px; text-align: center; color: var(--muted); font-size: .9rem; }
.field-hint { font-size: .78rem; color: var(--muted); margin-top: 4px; }

/* --------------------------------- layout --------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar .logo { font-weight: 800; font-size: 1.2rem; cursor: pointer; white-space: nowrap; }
.topbar .logo span { color: var(--accent-text); }
.topbar .logo .logo-mark, .logo .logo-mark { color: var(--accent-text); margin-right: 2px; }
.topbar .spacer { flex: 1; }
.topbar .user { color: var(--muted); font-size: .9rem; }
/* Mobile-only affordance that unfolds the search row (see ≤700px block). */
.search-toggle { display: none; }

/* Language is a setting, not a set action: quiet text toggle, no brand fill. */
.lang-toggle { display: inline-flex; gap: 2px; }
.lang-toggle button {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  padding: 4px 10px;
  min-height: 44px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.lang-toggle button.active { background: var(--panel2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.lang-toggle button:hover { color: var(--text); }

.container { max-width: 1200px; margin: 0 auto; padding: 28px 24px 80px; }
.page-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font-size: 1.5rem; flex: 1; }
/* Project header, one line: truncated title · status · pending chip · the
   on-set readiness reflex · a ⋯ menu for the weekly actions. */
.project-head { flex-wrap: nowrap; gap: 10px; margin-bottom: 14px; }
.project-head h1 { flex: 0 1 auto; min-width: 40px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-head .badge { flex-shrink: 0; }
.ph-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; position: relative; margin-left: auto; }
.pending-pill { white-space: nowrap; }
.menu-pop {
  position: absolute;
  top: calc(100% + 6px); right: 0;
  min-width: 240px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .35);
  padding: 6px;
  display: grid;
  z-index: 60;
}
.menu-pop[hidden] { display: none; }
.menu-pop .btn { justify-content: flex-start; text-align: left; background: transparent; border-color: transparent; display: flex; align-items: center; gap: 10px; }
.menu-pop .btn:hover, .menu-pop .btn:focus-visible { background: var(--panel2); }

/* ------------------------------- project grid ----------------------------- */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.card.clickable { cursor: pointer; transition: border-color .15s, transform .15s; }
.card.clickable:hover { border-color: var(--accent); transform: translateY(-2px); }
.card h3 { font-size: 1.1rem; margin-bottom: 6px; }
.card .meta { color: var(--muted); font-size: .85rem; display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.empty { color: var(--muted); text-align: center; padding: 60px 20px; line-height: 1.6; }

.badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.badge.prep, .badge.todo { background: var(--badge-blue-bg); color: var(--badge-blue-fg); }
.badge.shooting, .badge.scheduled { background: var(--badge-amber-bg); color: var(--badge-amber-fg); }
.badge.wrapped, .badge.shot { background: var(--badge-green-bg); color: var(--badge-green-fg); }
.badge.archived, .badge.omitted { background: var(--badge-grey-bg); color: var(--badge-grey-fg); }
.badge.dept { background: var(--badge-violet-bg); color: var(--badge-violet-fg); }

/* ---------------------------------- tabs ---------------------------------- */

/* Desktop: sticky under the topbar (69px) and WRAPPING — every tab reachable
   at any width, no invisible horizontal scroll. Mobile ≤700px hides this bar
   entirely (the bottom-nav is the project navigation there). */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
  flex-wrap: wrap;
  position: sticky;
  top: 68px; /* topbar: 12px padding ×2 + 44px controls + 1px border */
  z-index: 40;
  background: var(--bg);
}
.tabs button {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  padding: 10px 16px;
  min-height: 44px;
  font-weight: 600;
  white-space: nowrap;
}
.tabs button.active { color: var(--accent-text); border-bottom-color: var(--accent); }
.tabs button:hover { color: var(--text); }

/* --------------------------------- tables --------------------------------- */

table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; padding: 10px 12px; border-bottom: 1px solid var(--border); }
td { padding: 12px; border-bottom: 1px solid var(--bg2); vertical-align: middle; }
tbody tr { transition: background .1s; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--panel2); }

.chip {
  display: inline-block;
  font-size: .78rem;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid;
  margin: 2px 3px 2px 0;
  /* A pill is one line: a long character name is clipped, never folded. */
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

/* --------------------------------- modal ---------------------------------- */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(5,6,10,.72);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 5vh 16px;
  z-index: 100;
  overflow-y: auto;
}
.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px;
  width: 100%;
  max-width: 560px;
}
.modal h2 { font-size: 1.2rem; margin-bottom: 8px; }
/* Footers wrap as whole buttons: a label never breaks mid-word, a row never
   leaves the frame (the character sheet carries six of them in French). */
.modal .actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 24px; }
.modal .actions .btn, .modal .row .btn { white-space: nowrap; }
.modal .actions .actions-nav { display: flex; gap: 10px; margin-left: auto; }
.modal .notice { font-size: .88rem; line-height: 1.5; padding: 10px 12px; border-radius: var(--radius); background: var(--badge-violet-bg); color: var(--text); margin: 8px 0 12px; }
.modal .notice.warn { background: var(--badge-amber-bg, rgba(240,168,50,.14)); }
.modal .row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.checklist { max-height: 180px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; margin-top: 4px; background: var(--bg2); }
.checklist label { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-weight: 400; font-size: .92rem; color: var(--text); }

.form-error { color: var(--danger); font-size: .88rem; margin-top: 12px; min-height: 1.2em; }

/* --------------------------------- photos --------------------------------- */

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.photo-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.photo-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; cursor: zoom-in; background: var(--bg2); }
.photo-card .pbody { padding: 10px 12px; font-size: .85rem; }
.photo-card .pmeta { color: var(--muted); font-size: .78rem; margin-top: 6px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.lightbox { position: fixed; inset: 0; background: rgba(3,4,7,.92); z-index: 200; display: flex; align-items: center; justify-content: center; cursor: zoom-out; padding: 24px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.lightbox-close {
  position: absolute;
  top: 14px; right: 14px;
  min-width: 44px; min-height: 44px;
  background: rgba(5, 6, 10, .72); /* #fff on this pill: 8.6:1 worst case */
  border: 1px solid var(--border);
  color: #fff;
  border-radius: 999px;
  font-size: 1rem;
}
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.filter-bar select { width: auto; min-width: 150px; }

/* -------------------------------- timeline -------------------------------- */

.tl-scene {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--bg2);
}
.tl-day { text-align: center; }
.tl-day .d { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.tl-day .n { font-size: 1.5rem; font-weight: 800; color: var(--accent-text); }
.tl-photos { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.tl-photos img { height: 86px; border-radius: 6px; cursor: zoom-in; border: 1px solid var(--border); }
.tl-empty-photos { color: var(--muted); font-size: .82rem; font-style: italic; margin-top: 8px; }

/* --------------------------------- stats ---------------------------------- */

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px; margin-bottom: 24px; }
/* Stats fold away behind a one-line summary so the day's work — not the
   dashboard — starts on screen one of a phone. */
.stat-details { margin-bottom: 16px; }
.stat-details > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 44px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 600;
}
.stat-details > summary::-webkit-details-marker { display: none; }
.stat-details > summary::before { content: '▸'; transition: transform .12s; }
.stat-details[open] > summary::before { transform: rotate(90deg); }
.stat-details[open] > .stat-row { margin: 10px 0 0; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; }
/* Numbers are information, not brand: orange stays reserved for actions. */
.stat .v { font-size: 1.7rem; font-weight: 800; color: var(--text); }
.stat .l { color: var(--muted); font-size: .8rem; margin-top: 4px; }
.progress-bar { height: 8px; background: var(--bg2); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.progress-bar > div { height: 100%; background: var(--ok); border-radius: 999px; transition: width .3s; }

/* ------------------------------ notes/activity ---------------------------- */

.note-item { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.note-item .nmeta { color: var(--muted); font-size: .8rem; margin-top: 8px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.act-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--bg2); font-size: .92rem; }
.act-item .when { color: var(--muted); font-size: .8rem; white-space: nowrap; }

/* --------------------------------- search --------------------------------- */

.search-box { position: relative; min-width: 260px; }
.search-results {
  position: absolute; top: 110%; left: 0; right: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 80;
  max-height: 380px;
  overflow-y: auto;
  box-shadow: 0 12px 32px rgba(0,0,0,.5);
}
.search-results .sr-group { padding: 8px 12px 2px; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.search-results .sr-item { padding: 8px 12px; cursor: pointer; font-size: .9rem; }
.search-results .sr-item:hover { background: var(--panel2); }

.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  background: var(--panel2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 22px;
  z-index: 300;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
}
.toast.error { border-color: var(--danger); color: var(--badge-red-fg); }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: baseline; }

/* ------------------------- offline / notifications ------------------------- */

.net-banner {
  position: fixed;
  top: 0; left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 700;
  font-size: .82rem;
  padding: 4px 18px;
  border-radius: 0 0 10px 10px;
  z-index: 400;
}
.bell { position: relative; font-size: 1rem; }
.bell-badge {
  position: absolute;
  top: -2px; right: -2px;
  background: var(--danger);
  color: #fff;
  font-size: .62rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 1px 5px;
  line-height: 1.2;
}
/* Readiness reflex button: amber WASH while something blocks (a status tint,
   not a primary), plain secondary once the day is clear. */
.warn-btn { background: var(--badge-amber-bg); border-color: transparent; color: var(--badge-amber-fg); font-weight: 600; }
.warn-btn:hover { background: var(--badge-amber-bg); filter: brightness(1.12); }
/* Waiting is a STATUS: amber wash + round dot + chevron — badge anatomy that
   happens to be clickable, never an outline-button anatomy. */
.pending-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--badge-amber-bg);
  color: var(--badge-amber-fg);
  border: 0;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: .82rem;
  font-weight: 600;
  min-height: 32px;
  cursor: pointer;
}
.pending-pill:hover { filter: brightness(1.12); }
.pending-pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--badge-amber-fg); flex-shrink: 0; }
.pending-pill::after { content: '›'; font-size: 1rem; line-height: 1; opacity: .7; }

/* --------------------------------- compare --------------------------------- */

.compare-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  max-width: 96vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  cursor: default;
}
.compare-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.compare-toolbar .btn.active { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.compare-imgs { overflow: auto; }
.compare-imgs.side { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.compare-imgs.side img { width: 100%; max-height: 74vh; object-fit: contain; border-radius: 8px; background: var(--bg2); }
.compare-imgs.overlay { position: relative; display: grid; }
.compare-imgs.overlay img { grid-area: 1 / 1; width: 100%; max-height: 74vh; object-fit: contain; border-radius: 8px; }
.compare-imgs.overlay img:last-child { opacity: .5; }
/* Blink and wipe stack like the overlay, but B stays fully opaque:
   visibility (blink) or clip-path (wipe) does the comparing. */
.compare-imgs.blink, .compare-imgs.wipe { position: relative; display: grid; cursor: pointer; }
.compare-imgs.blink img, .compare-imgs.wipe img { grid-area: 1 / 1; width: 100%; max-height: 74vh; object-fit: contain; border-radius: 8px; }
.compare-imgs.blink { user-select: none; -webkit-user-select: none; touch-action: none; }
.compare-imgs.blink img { -webkit-touch-callout: none; }

/* Ghost capture: the reference photo floats over the live camera preview. */
.ghost-cap { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.ghost-stage { position: relative; display: grid; max-width: 96vw; }
.ghost-stage video, .ghost-stage img { grid-area: 1 / 1; width: 100%; max-height: 76vh; object-fit: contain; border-radius: 8px; }
.ghost-stage img { pointer-events: none; }
.ghost-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; }

.photo-card { position: relative; }
.photo-card .cmp-check {
  position: absolute;
  top: 8px; left: 8px;
  width: 20px; height: 20px;
  accent-color: var(--accent);
  z-index: 2;
}

/* -------------------------------- annotation ------------------------------- */

.anno-toolbar { display: flex; gap: 8px; align-items: center; margin: 12px 0; flex-wrap: wrap; }
.anno-toolbar .btn.active { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.anno-canvas {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg2);
  touch-action: none;
  cursor: crosshair;
}

/* -------------------------------- day sheet -------------------------------- */

.day-chars { display: grid; gap: 12px; margin-top: 14px; }
.day-char { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.day-section { margin-top: 8px; font-size: .9rem; }
.day-section em { color: var(--muted); font-style: normal; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.day-look { margin-top: 6px; }

/* --------------------------- timeline elapsed ------------------------------ */

.tl-elapsed {
  color: var(--accent-text);
  font-size: .78rem;
  font-weight: 700;
  padding: 6px 0 0 14px;
  border-left: 2px dashed var(--border);
  margin-left: 44px;
}

/* --------------------------------- landing --------------------------------- */

.landing { min-height: 100vh; }
.landing-top { display: flex; align-items: center; gap: 14px; padding: 16px 6vw; }
.landing-top .logo { font-weight: 800; font-size: 1.3rem; white-space: nowrap; }
.landing-top .logo span { color: var(--accent-text); }
.landing-hero { text-align: center; padding: 9vh 6vw 6vh; }
.landing-hero h1 { font-size: clamp(1.9rem, 5vw, 3.4rem); letter-spacing: -.02em; max-width: 800px; margin: 0 auto; }
.landing-hero p { color: var(--muted); max-width: 640px; margin: 20px auto 0; line-height: 1.7; font-size: 1.05rem; }
.landing-ctas { display: flex; gap: 14px; justify-content: center; margin-top: 34px; flex-wrap: wrap; }
.landing-feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; padding: 3vh 6vw; max-width: 1200px; margin: 0 auto; }
.landing-feats .feat-icon { font-size: 1.9rem; margin-bottom: 8px; }
.landing-feats p { color: var(--muted); font-size: .92rem; margin-top: 8px; line-height: 1.55; }
.landing-pricing { padding: 5vh 6vw 8vh; max-width: 1000px; margin: 0 auto; text-align: center; }
.landing-pricing h2 { margin-bottom: 24px; }
.landing-pricing .price { font-size: 1.25rem; font-weight: 800; color: var(--accent-text); margin: 10px 0; }
.landing-pricing .plan-hot { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.landing-pricing p { color: var(--muted); font-size: .9rem; }
.landing-foot { text-align: center; color: var(--muted); padding: 24px; border-top: 1px solid var(--border); }

/* ------------------------------ capture (FAB) ------------------------------ */

.capture-fab {
  position: fixed;
  right: 20px; bottom: calc(20px + env(safe-area-inset-bottom));
  width: 62px; height: 62px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-fg); /* 9.03:1 — the camera glyph reads in full sun */
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
  z-index: 90;
  cursor: pointer;
}
.capture-fab .ic { width: 30px; height: 30px; vertical-align: 0; }
.capture-fab:active { transform: scale(.94); }
.capture-preview { width: 100%; max-height: 34vh; object-fit: contain; border-radius: 10px; background: var(--bg2); margin-top: 10px; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; max-height: 130px; overflow-y: auto; }
.chip-btn {
  background: var(--bg2);
  border: 2px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 16px;
  min-height: 44px;
  font-size: .95rem;
}
.chip-btn.active { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 700; }

/* --------------------------- states & feedback ----------------------------- */

.page-loading {
  text-align: center;
  color: var(--muted);
  padding: 70px 20px;
}
.page-loading::before {
  content: '';
  display: block;
  width: 34px; height: 34px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.live-toasts {
  position: fixed;
  top: 64px; right: 16px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 250;
  max-width: 320px;
}
.live-toast {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent2);
  border-radius: 8px;
  padding: 9px 14px;
  font-size: .85rem;
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
  animation: slide-in .2s ease-out;
}
@keyframes slide-in { from { transform: translateX(30px); opacity: 0; } }

.demo-banner {
  background: rgba(139,92,246,.16);
  color: var(--text);
  text-align: center;
  padding: 7px 14px;
  font-size: .88rem;
  border-bottom: 1px solid var(--border);
}

.invite-grid { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 10px; align-items: end; }
.invite-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.invite-url {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: .78rem;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------- mobile set mode (≤700px) ------------------------ */

@media (max-width: 700px) {
  /* Topbar: ONE row — wordmark · search glyph · bell · profile. Theme and
     language are settings: they live in the profile menu on a phone. */
  .topbar { flex-wrap: wrap; padding: 10px 12px; gap: 6px; }
  .topbar .search-box { order: 10; flex-basis: 100%; min-width: 0; display: none; }
  .topbar.search-open .search-box { display: block; }
  .search-toggle { display: inline-flex; }
  .topbar .lang-toggle, .topbar .theme-btn { display: none; }
  .topbar .user { display: none; }
  /* The top tab bar is redundant with the bottom-nav on a phone. */
  .tabs { display: none; }
  /* Every vertical crumb above the fold counts on set: the day sheet must
     start on screen one of an 844px-tall phone. */
  .page-head { margin-bottom: 10px; gap: 8px; }
  .page-head h1 { font-size: 1.25rem; }
  .project-head h1 { flex: 1 1 auto; }
  /* Compact chips on a 390px line: the readiness keeps glyph + count, the
     pending pill keeps dot + count + chevron. */
  .project-head .readiness-btn .wb-txt, .project-head .pending-pill .pp-txt { display: none; }
  .project-head { gap: 6px; }
  .project-head .ph-actions { gap: 4px; }
  .project-head .pending-pill { padding: 4px 9px; }
  .stat-details { margin-bottom: 8px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  /* Thumb-zone furniture: bottom-nav (fixed) + FAB above it, and the scroll
     container reserves the room so nothing ever hides under them. */
  .container { padding-bottom: calc(120px + env(safe-area-inset-bottom)); }
  .capture-fab { right: 16px; bottom: calc(72px + env(safe-area-inset-bottom)); }
  .undo-toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
  /* Tables become cards: each row is a tappable block, cells stack with their
     column label. No 8-column horizontal scroll one-handed on a phone. */
  table.responsive, table.responsive tbody, table.responsive tr, table.responsive td { display: block; width: 100%; }
  table.responsive thead { display: none; }
  table.responsive tr {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
    padding: 10px 12px;
  }
  table.responsive td { border: none; padding: 4px 0; }
  table.responsive td:empty { display: none; }
  table.responsive td[data-label]::before {
    content: attr(data-label) ' ';
    color: var(--muted);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    display: block;
  }
  .compare-imgs.side { grid-template-columns: 1fr; }
  .invite-grid { grid-template-columns: 1fr; }
  .modal { padding: 18px; }
  .modal-backdrop { padding: 2vh 8px; }
}

@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { padding: 36px 28px; border-right: 0; border-bottom: 1px solid var(--border); }
  .modal .row { grid-template-columns: 1fr; }
  .container { padding: 18px 14px 60px; }
  td, th { padding: 8px 6px; }
}

/* --------------------------------- print ---------------------------------- */

.pr-photos { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.pr-photos img { height: 110px; border-radius: 6px; border: 1px solid var(--border); }
.pr-cont { margin-bottom: 14px; }

@media print {
  body { background: #fff; color: #111; }
  .topbar, .tabs, .page-head .btn, .filter-bar, .toast, .net-banner, .stat-row, .stat-details, .undo-toast { display: none !important; }
  .modal-backdrop { position: static; background: none; padding: 0; }
  .modal { border: none; max-width: none; color: #111; background: #fff; }
  .pr-photos img { border-color: #999; }
  .card, .stat, .note-item { border-color: #ccc; background: #fff; }
  .print-report { display: block !important; }
  #app > :not(.print-report) { display: none; }
  .print-report h1 { font-size: 20pt; }
  .print-report h2 { font-size: 14pt; margin: 18pt 0 6pt; border-bottom: 1pt solid #888; }
  .print-report table { font-size: 9pt; }
  .print-report th, .print-report td { border: .5pt solid #999; padding: 4pt 6pt; color: #111; }
  .print-report .badge, .print-report .chip { border: .5pt solid #555; color: #111 !important; background: none !important; }

  /* ------------------------- printed lookbook ------------------------------
     Film-lookbook conventions on paper: a cover page, one section per
     character (or scene), a hero image per look, thin rules, letterspaced
     labels, and a signature block on anything not yet approved. */
  @page { margin: 14mm; }
  .pr-lb { color: #111; }
  .pr-lb .pr-label {
    font-size: 7.5pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .16em;
    color: #666;
    margin-bottom: 4pt;
  }
  .pr-cover-page {
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    break-after: page;
  }
  .pr-cover-page h1 {
    font-family: var(--font-display);
    font-size: 38pt;
    font-weight: 700;
    letter-spacing: .01em;
    line-height: 1.15;
    border: none;
    margin: 8pt 0 0;
  }
  .pr-cover-sub { font-family: var(--font-display); font-size: 15pt; margin-top: 10pt; color: #333; }
  .pr-cover-rule { width: 60pt; border-top: 1pt solid #111; margin: 22pt auto; }
  .pr-cover-meta { font-size: 9pt; color: #666; letter-spacing: .06em; text-transform: uppercase; }
  .pr-char { break-before: page; }
  .pr-char:first-of-type { break-before: auto; }
  .pr-char-head { padding-bottom: 8pt; border-bottom: 1pt solid #111; margin-bottom: 14pt; }
  .pr-char-head h2 {
    font-family: var(--font-display);
    font-size: 24pt;
    font-weight: 700;
    border: none;
    margin: 0;
  }
  .pr-actor { font-size: 10.5pt; color: #444; margin-top: 2pt; font-style: italic; }
  .pr-desc { font-size: 9.5pt; color: #333; line-height: 1.55; margin-top: 6pt; max-width: 150mm; }
  .pr-look { break-inside: avoid; padding: 12pt 0 14pt; border-bottom: .5pt solid #bbb; }
  .pr-look:last-child { border-bottom: none; }
  .pr-look h3 { font-family: var(--font-display); font-size: 15pt; font-weight: 700; margin: 0 0 4pt; }
  .pr-hero { width: 100%; max-height: 150mm; object-fit: cover; border-radius: 3pt; margin: 8pt 0; }
  .pr-lb-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6pt; margin: 6pt 0; }
  .pr-lb-photos img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 2pt; }
  .pr-scenes { font-size: 9pt; color: #333; margin-top: 6pt; }
  .pr-stamp {
    display: inline-block;
    margin-top: 10pt;
    padding: 4pt 10pt;
    border: 1.2pt solid #15803d;
    color: #15803d;
    font-size: 9pt;
    font-weight: 700;
    letter-spacing: .1em;
    border-radius: 3pt;
  }
  .pr-sign { margin-top: 16pt; max-width: 90mm; }
  .pr-sign-line { border-bottom: .75pt solid #555; height: 26pt; }
  .pr-sign .pr-label { margin-top: 4pt; }
  /* Section opener: the actor's face beside the character's name, and the
     moodboard as a printed collage. */
  .pr-char-id { display: flex; gap: 10pt; align-items: center; }
  .pr-headshot { width: 24mm; height: 24mm; object-fit: cover; border-radius: 50%; }
  .pr-mood { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4pt; margin-top: 6pt; break-inside: avoid; }
  .pr-mood img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 2pt; }
  .pr-foot {
    margin-top: 24pt;
    padding-top: 6pt;
    border-top: .5pt solid #bbb;
    font-size: 8pt;
    color: #888;
    text-align: center;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
  /* Colophon: the quiet second line where a book names its printer. One
     occurrence, last page only, never on the cover. */
  .pr-colophon {
    margin-top: 4pt;
    font-size: 7pt;
    color: #999;
    letter-spacing: .14em;
  }

  /* ------------------ the editorial apparatus (acte III) ------------------ */

  /* Four cover identities. Gallery: full-frame photo, title in white reserve.
     Archive: purely typographic, hairlines — the Criterion register. Pantone:
     one vertical band in the lead character's color. */
  .pr-cover-page { position: relative; overflow: hidden; }
  .pr-cover-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
  }
  .pr-cover-content { position: relative; z-index: 1; }
  .theme-gallery .pr-cover-content {
    color: #fff;
    background: linear-gradient(transparent, rgba(0, 0, 0, .55));
    padding: 30pt 20pt 20pt;
    margin-top: auto;
    width: 100%;
  }
  .theme-gallery { justify-content: flex-end; }
  .theme-gallery .pr-cover-sub { color: #eee; }
  .theme-gallery .pr-cover-meta { color: #ddd; }
  .theme-gallery .pr-cover-rule { border-color: #fff; }
  .theme-gallery .pr-lb .pr-label, .theme-gallery .pr-label { color: #eee; }
  .theme-archive .pr-cover-content { border: .5pt solid #111; padding: 40pt 30pt; }
  .theme-archive h1 { letter-spacing: .04em; }
  .theme-archive .pr-cover-rule { border-top-width: .5pt; }
  .theme-pantone { align-items: flex-start; text-align: left; }
  .theme-pantone .pr-cover-band {
    position: absolute;
    top: 0; bottom: 0; left: 0;
    width: 22mm;
    background: var(--band, #f0a832);
  }
  .theme-pantone .pr-cover-content { margin-left: 32mm; text-align: left; }
  .theme-pantone .pr-cover-rule { margin: 22pt 0; }

  /* Table of contents: display names, dotted leaders, counts. */
  .pr-toc { break-after: page; padding-top: 20pt; }
  .pr-toc-row { display: flex; align-items: baseline; gap: 6pt; margin-top: 10pt; }
  .pr-toc-name { font-family: var(--font-display); font-size: 14pt; font-weight: 700; }
  .pr-toc-dots { flex: 1; border-bottom: 1pt dotted #999; transform: translateY(-3pt); }
  .pr-toc-meta { font-size: 9pt; color: #555; }

  /* Full-bleed opener page per character (graceful where margins persist). */
  .pr-opener {
    break-before: page;
    break-after: page;
    position: relative;
    height: 92vh;
    overflow: hidden;
    border-radius: 2pt;
  }
  .pr-opener img { width: 100%; height: 100%; object-fit: cover; }
  .pr-opener-name {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 40pt 16pt 16pt;
    background: linear-gradient(transparent, rgba(0, 0, 0, .6));
    color: #fff;
  }
  .pr-opener-name h2 {
    font-family: var(--font-display);
    font-size: 30pt;
    font-weight: 700;
    border: none;
    margin: 0;
    color: #fff;
  }
  .pr-opener-name .pr-actor { color: #eee; }

  /* The approval synthesis page. */
  .pr-synth { break-before: page; padding-top: 16pt; }
  .pr-synth-counts { display: flex; gap: 22pt; margin: 10pt 0 14pt; font-size: 10pt; }
  .pr-synth-counts strong { font-size: 17pt; display: block; }
  .pr-synth-table { width: 100%; border-collapse: collapse; font-size: 8.5pt; }
  .pr-synth-table th, .pr-synth-table td { border: .5pt solid #999; padding: 3pt 6pt; text-align: left; }

  /* The handwritten mark above the signature line. */
  .pr-sig-img { max-height: 14mm; max-width: 60mm; display: block; margin-bottom: -6pt; }
  .pr-sig-text {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 16pt;
    margin-bottom: -4pt;
  }
  .pr-sign-approved .pr-sign-line { height: auto; }

  /* The look's palette, printed: swatch + hex, so the information survives
     even a printer that drops backgrounds. */
  .pr-swatches { display: flex; gap: 8pt; margin: 2pt 0 6pt; }
  .pr-swatch { font-size: 7pt; color: #555; display: inline-flex; align-items: center; gap: 3pt; }
  .pr-swatch i { width: 9pt; height: 9pt; border-radius: 2pt; border: .5pt solid #999; display: inline-block; }

  /* Contact sheet: the exhaustive annex, 5-up squares with legends. */
  .pr-contact { break-before: page; padding-top: 16pt; }
  .pr-contact-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6pt; margin-top: 8pt; }
  .pr-contact-grid figure { margin: 0; break-inside: avoid; }
  .pr-contact-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 2pt; }
  .pr-contact-grid figcaption { font-size: 6.5pt; color: #555; margin-top: 2pt; }
}
.print-report { display: none; }

/* Readiness header: the day picker, the percentage and the scene count read as
   one line on a phone, wrapping instead of overflowing. */
.readiness-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; }
/* The headline figure: green when truly clear, neutral otherwise — never the
   brand orange (orange = action; "ready" = --ok). */
.readiness-head .rd-pct { font-size: 18px; color: var(--text); }
.readiness-head .rd-pct.rd-ok { color: var(--ok); }
.readiness-head select { min-width: 150px; }

/* State-before: two panels side by side on a laptop, stacked on a phone, so
   the comparison never forces a horizontal scroll. */
.sb-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 720px) { .sb-grid { grid-template-columns: 1fr 1fr; } }
.sb-side h3 { font-size: 15px; margin: 0 0 8px; color: var(--muted); }
.sb-scene { border-bottom: 1px solid var(--border); padding-bottom: 8px; margin-bottom: 10px; }
.sb-look { padding: 8px 0; border-bottom: 1px solid var(--border); }
.sb-look:last-child { border-bottom: 0; }

/* A queued shot is unmistakably present but visually distinct from a synced
   one: dashed outline, no compare/annotate affordances. */
.photo-card.pending { outline: 2px dashed var(--accent); outline-offset: -2px; }
.photo-card.pending img { opacity: .9; }
.pending-badge { color: var(--badge-amber-fg); }

/* Inline delete on a chip (look states): 44px hit zone padded out from the
   glyph, negative margins keep the chip itself visually unchanged. */
.chip-x { background: none; border: 0; color: var(--muted); cursor: pointer; min-width: 44px; min-height: 44px; padding: 2px 6px; margin: -12px -14px -12px -6px; vertical-align: middle; font-size: 13px; }
.chip-x:hover { color: var(--danger); }

/* --------------------------------- lookbook --------------------------------
   The presentation surface. Editorial conventions borrowed from film
   lookbooks: a display serif for titles, letterspaced uppercase labels,
   large imagery, sparse text. */

@font-face {
  font-family: 'Playfair Display';
  src: url('/fonts/playfair-display-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
/* DOCTRINE --font-display : réservé aux NOMS d'œuvres, de personnages, de
   looks et de boards — lookbook, boards, projection, partage public, bible,
   impression. JAMAIS le chrome, l'onboarding, les modales de saisie ou les
   libellés d'interface : le serif signale « éditorial », pas « widget ». */
:root { --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif; }

.lb-kicker {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted);
}
.lb-muted { color: var(--muted); }

.lb-section { margin-bottom: 34px; }
.lb-char-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.lb-char-head h2 { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; letter-spacing: .01em; }
.lb-actor { color: var(--muted); font-size: .92rem; }
.lb-count { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.lb-bulk { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.lb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.lb-look {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.lb-look:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,.28); }
.lb-cover { position: relative; aspect-ratio: 4 / 5; background: var(--bg2); }
.lb-cover img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.lb-cover-empty { display: flex; align-items: center; justify-content: center; font-size: 2.6rem; opacity: .45; }
.lb-cover-badge { position: absolute; top: 10px; right: 10px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); }
.lb-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.lb-name { font-family: var(--font-display); font-size: 1.22rem; font-weight: 700; line-height: 1.25; }
.lb-desc { color: var(--muted); font-size: .88rem; line-height: 1.55; }
.lb-scenes { display: flex; flex-wrap: wrap; gap: 4px; }
.lb-shot { font-size: .84rem; }
.lb-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.lb-thumb { position: relative; }
.lb-thumb img { height: 64px; border-radius: 6px; border: 1px solid var(--border); cursor: zoom-in; display: block; }
/* Same treatment as .mb-x: resting visibility + padded 44px hit zone. */
.lb-star {
  position: absolute;
  top: -14px; right: -10px;
  background: rgba(5,6,10,.72); /* #ffd76e on this pill: 6.2:1 worst case */
  background-clip: padding-box;
  border: solid transparent;
  border-width: 16px 12px;
  color: #ffd76e;
  border-radius: 999px;
  font-size: .72rem;
  padding: 1px 5px;
  opacity: .8;
  transition: opacity .12s;
}
.lb-thumb:hover .lb-star, .lb-star:hover, .lb-star:focus-visible { opacity: 1; }
.lb-approved-line { color: var(--ok); font-size: .84rem; }
.lb-note {
  border-left: 3px solid var(--accent);
  background: rgba(240,168,50,.08);
  border-radius: 0 8px 8px 0;
  padding: 7px 10px;
  font-size: .86rem;
}
.lb-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.badge.changes { background: var(--badge-red-bg); color: var(--badge-red-fg); }
/* A board's KIND is not a department: the neutral family, so « Moodboard »
   and « Maquillage » never read as two identical pills. */
.badge.kind { background: var(--badge-grey-bg); color: var(--badge-grey-fg); }
/* The visa's caveat: content that moved after the signature. */
.lb-edited-line { color: var(--badge-amber-fg); font-size: .82rem; margin-top: 4px; }
.cs-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; color: var(--muted); font-size: .86rem; margin-top: 10px; }
.lb-inline-check { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: .84rem; color: var(--muted); font-weight: 400; }

/* by-scene grouping: one collapsible per scene — 60 scenes stay navigable */
details.lb-scene {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
}
details.lb-scene > summary {
  cursor: pointer;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  list-style: none;
}
details.lb-scene > summary::-webkit-details-marker { display: none; }
details.lb-scene > summary::before { content: '▸'; color: var(--muted); transition: transform .12s; }
details.lb-scene[open] > summary::before { transform: rotate(90deg); }
.lb-scene-body { padding: 4px 16px 16px; display: grid; gap: 12px; }
.lb-date-sep {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-text);
  margin: 22px 0 10px;
}

/* drag-and-drop target feedback */
.drop-target { outline: 2px dashed var(--accent); outline-offset: 2px; border-radius: 6px; }
.chip-link, .loc-link { cursor: pointer; }
.loc-link { text-decoration: underline dotted; text-underline-offset: 3px; }
.loc-link:hover { color: var(--accent-text); }

/* bible-dashboard sheets */
.sheet-char { padding: 10px 0; border-bottom: 1px solid var(--bg2); }
.sheet-char:last-of-type { border-bottom: 0; }
.sheet-look { margin: 8px 0 4px 6px; }
.modal h3 { font-size: .95rem; }

/* ---------------------------- presentation mode ---------------------------- */

.lb-present {
  position: fixed; inset: 0;
  background: #06070b;
  z-index: 95;
  display: grid;
  grid-template-columns: 1fr minmax(280px, 380px);
  grid-template-rows: 1fr;
}
.lb-p-stage { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 46px 60px 20px; min-width: 0; }
.lb-p-hero { max-width: 100%; max-height: 74vh; object-fit: contain; border-radius: 10px; box-shadow: 0 18px 60px rgba(0,0,0,.6); }
.lb-p-empty { display: flex; align-items: center; justify-content: center; width: 320px; height: 400px; background: var(--panel); font-size: 4rem; opacity: .4; }
.lb-p-strip { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.lb-p-strip img { height: 56px; border-radius: 5px; border: 2px solid transparent; cursor: pointer; opacity: .65; }
.lb-p-strip img.active, .lb-p-strip img:hover { border-color: var(--accent); opacity: 1; }
.lb-p-panel {
  background: var(--panel);
  border-left: 1px solid var(--border);
  padding: 54px 28px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lb-p-panel h2 { font-family: var(--font-display); font-size: 1.7rem; line-height: 1.2; }
.lb-p-panel p { color: var(--muted); line-height: 1.6; font-size: .92rem; }
.lb-p-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 16px; }
.lb-p-close {
  position: absolute; top: 14px; right: 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  width: 44px; height: 44px;
  font-size: 1rem;
  z-index: 2;
}
.lb-p-nav {
  position: absolute; top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  width: 46px; height: 46px;
  font-size: 1.5rem;
  line-height: 1;
}
.lb-p-prev { left: 14px; }
.lb-p-next { right: calc(min(380px, 34vw) + 14px); }
.lb-p-counter {
  position: absolute; bottom: 14px; left: 20px;
  color: var(--muted);
  font-size: .82rem;
  letter-spacing: .08em;
}

@media (max-width: 860px) {
  .lb-present { grid-template-columns: 1fr; grid-template-rows: 1fr auto; overflow-y: auto; }
  .lb-p-stage { padding: 54px 16px 10px; }
  .lb-p-hero { max-height: 52vh; }
  .lb-p-panel { border-left: 0; border-top: 1px solid var(--border); padding: 18px; }
  .lb-p-nav { display: none; }
  .lb-grid { grid-template-columns: 1fr; }
}

/* ------------------------------- sprint wow -------------------------------- */

/* Skeleton: same geometry as the real cards, so data replaces it without a
   single layout shift. */
.lb-skel .lb-cover, .lb-skel-line, .lb-skel-pill {
  background: linear-gradient(100deg, var(--panel) 40%, var(--panel2) 50%, var(--panel) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.lb-skel-line { display: block; height: 12px; border-radius: 6px; }
.lb-skel-pill { display: inline-block; width: 120px; height: 38px; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Photos emerge from a photographic grey instead of popping in raw. */
.lb-cover img, .lb-thumbs img, .photo-grid img, .lb-p-strip img, .sv-photos img {
  opacity: 0;
  transition: opacity .45s ease;
}
.lb-cover img.loaded, .lb-thumbs img.loaded, .photo-grid img.loaded, .lb-p-strip img.loaded, .sv-photos img.loaded { opacity: 1; }

/* The character's colour as a guiding rail: card top edge, section rule,
   presentation panel — readable in peripheral vision across 40 looks. */
.lb-look { border-top: 3px solid var(--border); border-top-color: var(--char, var(--border)); }
.lb-look:hover {
  border-top-color: var(--char, var(--accent));
  box-shadow: 0 10px 28px color-mix(in srgb, var(--char, #000) 14%, rgba(0, 0, 0, .28));
}
.lb-char-head { border-bottom-color: color-mix(in srgb, var(--char, var(--border)) 45%, var(--border)); }
.lb-p-panel { border-left: 3px solid var(--char, var(--border)); }

/* Presentation header + first-time coach marks. */
.lb-p-head {
  position: absolute;
  top: 18px; left: 22px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: .95rem;
  color: var(--muted);
  z-index: 1;
}
.lb-p-coach {
  position: absolute; inset: 0;
  background: rgba(4, 5, 9, .55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 56px;
  z-index: 3;
  cursor: pointer;
}
.lb-p-coach-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 26px;
  display: grid;
  gap: 10px;
  font-size: .95rem;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .6);
  animation: slide-in .25s ease-out;
}

/* The wrap-up card: the emotional peak of a review. */
.lb-p-wrap {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  padding: 40px 24px;
  overflow-y: auto;
}
.lb-p-wrap-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 700;
}
.lb-p-wrap-counts {
  font-size: 1.05rem;
  color: var(--accent-text);
  letter-spacing: .04em;
}
.lb-p-wrap-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  max-width: 720px;
}
.lb-p-wrap-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: .85rem;
}
.lb-p-wrap-note { color: var(--muted); font-size: .9rem; }
.lb-p-wrap-actions { margin-top: 6px; }
.lb-p-expansion {
  margin-top: 26px;
  max-width: 460px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
}
.lb-p-expansion p { color: var(--muted); font-size: .92rem; line-height: 1.6; margin-bottom: 14px; }
.lb-p-expansion strong { color: var(--text); }

/* Bulk triage: selection mode + the thumb-zone action bar. */
.triage .photo-card { cursor: pointer; }
.triage .photo-card .cmp-check, .triage .photo-card .pmeta button, .triage .photo-card .ph-star { display: none; }
.triage .photo-card img { cursor: pointer; }
.photo-card.sel { outline: 3px solid var(--accent); outline-offset: -3px; }
.photo-card.sel::after {
  content: '✓';
  position: absolute;
  top: 8px; right: 8px;
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 800;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
}
/* display:flex would defeat the hidden attribute; state must win. */
.triage-bar[hidden] { display: none; }
.triage-bar {
  position: fixed;
  left: 50%; bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: min(96vw, 900px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .5);
  z-index: 95;
}
.triage-bar select { width: auto; min-width: 130px; }
.triage-count { font-weight: 700; font-size: .9rem; white-space: nowrap; }
@media (max-width: 700px) {
  /* Above the bottom-nav, never under it. */
  .triage-bar { left: 8px; right: 8px; transform: none; bottom: calc(64px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .lb-skel .lb-cover, .lb-skel-line, .lb-skel-pill { animation: none; }
  .lb-cover img, .lb-thumbs img, .photo-grid img, .lb-p-strip img { transition: none; opacity: 1; }
  .lb-p-coach-card { animation: none; }
}

/* --------------------------- portraits & moodboards ------------------------ */

/* The actor's face, wherever the character's name appears. */
.avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  margin-right: 8px;
  border: 1px solid var(--border);
}
.avatar-lg {
  width: 72px; height: 72px;
  cursor: zoom-in;
  flex-shrink: 0;
}
.avatar-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg2);
  border: 2px solid var(--border);
  font-size: 1.6rem;
  cursor: default;
}
.cs-head { display: flex; gap: 14px; align-items: center; margin-top: 8px; }

/* Moodboard masonry: variable-height inspiration images in columns, the
   StudioBinder collage feel without a library. */
.mb-zone { margin-top: 6px; }
.mb-grid { columns: 3 140px; column-gap: 10px; }
.mb-item { position: relative; display: block; break-inside: avoid; margin-bottom: 10px; }
.mb-item img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  display: block;
}
/* Visible at rest (touch has no hover) and a 44px hit zone: the transparent
   border pads the tap area while background-clip keeps the pill small. */
.mb-x {
  position: absolute;
  top: -10px; right: -6px;
  background: rgba(5, 6, 10, .78); /* #ff9a9a on this pill: 5.35:1 worst case */
  background-clip: padding-box;
  border: solid transparent;
  border-width: 16px 12px;
  color: #ff9a9a;
  border-radius: 999px;
  font-size: .72rem;
  padding: 2px 7px;
  opacity: .8;
  transition: opacity .12s;
}
.mb-item:hover .mb-x, .mb-x:hover, .mb-x:focus-visible { opacity: 1; }

/* The scene's screenplay text, set like a page: courier, preserved breaks. */
.scene-body {
  white-space: pre-wrap;
  font-family: 'Courier New', Courier, monospace;
  font-size: .88rem;
  line-height: 1.55;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  max-height: 46vh;
  overflow-y: auto;
  margin-top: 6px;
}
.scene-body-edit { font-family: 'Courier New', Courier, monospace; font-size: .88rem; }

/* ------------------------------ acte II & III ------------------------------ */

/* The badge that follows the producer everywhere (anatomy defined with the
   readiness button, top of file). */
.card .pending-pill { margin-top: 6px; }
.stat-click { cursor: pointer; }
.stat-click:hover { border-color: var(--accent); }

/* The signature canvas: paper-colored, pen-shaped cursor. */
.sig-canvas {
  width: 100%;
  height: 130px;
  background: var(--bg2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  cursor: crosshair;
  touch-action: none;
  margin-top: var(--sp-2);
}

/* The costume arc: the character's evolution on one line, gaps included. */
.lb-arc {
  display: flex;
  gap: var(--sp-1);
  align-items: flex-start;
  overflow-x: auto;
  padding: var(--sp-1) 0 var(--sp-2);
}
.arc-cell {
  background: none;
  border: 0;
  padding: 0;
  text-align: center;
  flex-shrink: 0;
  width: 52px;
  position: relative;
}
.arc-img {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg2);
  overflow: hidden;
  font-size: 1.1rem;
  color: var(--muted);
}
.arc-img img { width: 100%; height: 100%; object-fit: cover; }
.arc-cell:hover .arc-img { border-color: var(--accent); }
.arc-gap .arc-img { border-style: dashed; }
.arc-dot {
  position: absolute;
  top: 3px; right: 3px;
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, .4);
}
.arc-dot.shot { background: var(--ok); }
.arc-dot.scheduled { background: var(--accent); }
.arc-dot.todo { background: var(--info); }
.arc-dot.changes { background: var(--danger); }
.arc-dot.dept { background: var(--badge-violet-fg); }
.arc-label {
  display: block;
  font-size: .62rem;
  color: var(--muted);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.arc-more { color: var(--muted); font-size: .78rem; align-self: center; }

/* A found look glows for a beat. */
.lb-flash { outline: 2px solid var(--accent); outline-offset: 3px; transition: outline-color 1.2s; }

/* Dominant-color swatches under a look. */
.lb-swatches { display: flex; gap: 6px; margin-top: var(--sp-1); }
.lb-swatch {
  width: 22px; height: 22px;
  border-radius: 6px;
  border: 1px solid var(--border);
  padding: 0;
  cursor: copy;
}
.lb-swatch:hover { transform: scale(1.15); }

/* The approval board: four columns, drag to decide. */
.lb-kanban { /* five columns: the lock is one of them */
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: var(--sp-2);
  align-items: start;
  overflow-x: auto;
}
.kb-col {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-1);
  min-height: 160px;
}
.kb-col.drop-target { border-color: var(--accent); background: rgba(240, 168, 50, .06); }
.kb-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 8px; }
.kb-count {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 999px;
  min-width: 30px;
  padding: 2px 8px;
  font-weight: 700;
}
.kb-count:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-text); }
.kb-cards { display: grid; gap: var(--sp-1); }
.kb-card {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--char, var(--border));
  border-radius: 8px;
  padding: 6px;
  cursor: grab;
}
.kb-card img, .kb-empty {
  width: 42px; height: 42px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg2);
}
.kb-name { font-weight: 600; font-size: .86rem; }
.kb-char { color: var(--muted); font-size: .76rem; }
@media (max-width: 800px) { .lb-kanban { grid-template-columns: repeat(2, 1fr); } }

/* "The tab is already ready" — the furnished-house empty state. */
.lb-ready {
  text-align: center;
  padding: var(--sp-6) var(--sp-3);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
}
.lb-ready h3 { color: var(--text); font-size: var(--fs-1); margin-bottom: var(--sp-1); }
.lb-ready .btn { margin-top: var(--sp-2); }

/* The scene picker: tools row over the checklist. */
.sp-tools { display: flex; flex-wrap: wrap; gap: var(--sp-1); align-items: center; margin: 4px 0 6px; }
.sp-list { max-height: 180px; }

/* Starter kit rows. */
.sk-row {
  display: grid;
  grid-template-columns: 1fr 64px auto;
  gap: var(--sp-1);
  align-items: center;
  margin-top: var(--sp-1);
}
.sk-count { text-align: center; }

/* Sticky day separators inside the photo grid. */
.ph-day-sep {
  grid-column: 1 / -1;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
  padding: var(--sp-1) 2px;
  font-weight: 700;
  font-size: .88rem;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

/* ⌘K — the command palette. */
.cp-back {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 10, .6);
  z-index: 220;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 12vh;
}
.cp {
  width: min(560px, 92vw);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .5);
  overflow: hidden;
}
.cp-input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: var(--fs-1);
  padding: 14px 16px;
  outline: none;
}
.cp-list { max-height: 46vh; overflow-y: auto; }
.cp-item { padding: 9px 16px; cursor: pointer; font-size: .95rem; }
.cp-item.active, .cp-item:hover { background: var(--panel2); }
.cp-hint { padding: 7px 16px; font-size: .74rem; color: var(--muted); border-top: 1px solid var(--border); }

/* Projection mode: chrome recedes, the photo owns the black. */
.lb-p-hero { opacity: 0; transition: opacity .28s ease; }
.lb-p-hero.loaded { opacity: 1; animation: kenburns 14s ease-in-out infinite alternate; }
@keyframes kenburns {
  from { transform: scale(1); }
  to { transform: scale(1.035); }
}
.lb-present.projection .lb-p-panel,
.lb-present.projection .lb-p-head,
.lb-present.projection .lb-p-counter,
.lb-present.projection .lb-p-nav,
.lb-present.projection .lb-p-strip,
.lb-present.projection .lb-p-close {
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s;
}
.lb-present.projection.chrome-awake .lb-p-nav,
.lb-present.projection.chrome-awake .lb-p-close,
.lb-present.projection.chrome-awake .lb-p-counter {
  opacity: 1;
  pointer-events: auto;
}
.lb-present.projection .lb-p-stage { inset: 0; width: 100%; }

/* Cover-theme picker in the print modal. */
.theme-row { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin: 6px 0 10px; }
.theme-pick { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.theme-pick input { position: absolute; opacity: 0; }
.theme-prev {
  width: 52px; height: 68px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg2);
  position: relative;
  overflow: hidden;
  display: block;
}
.theme-pick input:checked + .theme-prev { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-prev i { position: absolute; display: block; }
.theme-prev-classic i { left: 25%; right: 25%; top: 46%; border-top: 1px solid var(--text); }
.theme-prev-gallery { background: linear-gradient(160deg, #6b7d92, #2c3548); }
.theme-prev-gallery i { left: 6px; right: 6px; bottom: 6px; height: 8px; background: rgba(255, 255, 255, .8); border-radius: 1px; }
.theme-prev-archive i { inset: 5px; border: 1px solid var(--text); }
.theme-prev-pantone i { left: 0; top: 0; bottom: 0; width: 12px; background: var(--accent); }
.theme-name { font-size: .74rem; color: var(--muted); }

/* The destination hint in the print modal. */
.print-hint {
  margin-top: var(--sp-2);
  padding: var(--sp-1) var(--sp-2);
  border: 1px dashed var(--border);
  border-radius: 8px;
  font-size: .8rem;
  color: var(--muted);
}

/* View transitions: quick, discreet morphs; stillness for those who ask. */
::view-transition-old(*), ::view-transition-new(*) { animation-duration: .24s; }
@media (prefers-reduced-motion: reduce) {
  .lb-p-hero.loaded { animation: none; }
  ::view-transition-old(*), ::view-transition-new(*) { animation: none; }
}

/* ============================ Palier 1 additions ============================ */

/* ------------------------- public share view (#/s/) -------------------------
   The showroom register: its OWN dark tokens, whatever the app theme — an
   anonymous producer always lands in the presentation salon, phone first. */
.share-view {
  --bg: #0d0e14;
  --bg2: #14161f;
  --panel: #1a1d29;
  --panel2: #222636;
  --border: #2c3147;
  --text: #e8eaf2;
  --muted: #8d93a8;
  --accent: #f0a832;
  --accent-fg: #1a1407;
  --accent-text: #f0a832; /* own dark register: orange-as-text stays legible */
  --danger: #ef4444;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  padding: 26px 16px 40px;
}
.share-view.sv-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
}
.sv-card {
  width: min(420px, 94vw);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px 24px;
  text-align: center;
}
.sv-card h1 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; }
.sv-card form { text-align: left; }
.sv-logo { color: var(--accent); margin-bottom: 10px; }
.sv-head { max-width: 860px; margin: 0 auto 30px; text-align: center; }
.sv-head h1 { font-family: var(--font-display); font-size: clamp(1.7rem, 6vw, 2.441rem); font-weight: 700; margin-top: 6px; }
.sv-sub { color: var(--muted); margin-top: 6px; font-size: .9rem; }
.sv-char { max-width: 980px; margin: 0 auto 38px; }
.sv-char-head {
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid var(--char, var(--border));
  padding: 8px 0 10px 12px;
  margin-bottom: 16px;
}
.sv-char-head h2 { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }
.sv-actor { color: var(--muted); font-size: .88rem; margin-top: 2px; }
.sv-look { margin-bottom: 26px; }
.sv-look h3 { font-family: var(--font-display); font-size: 1.18rem; font-weight: 700; }
.sv-approved { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.sv-visa { color: var(--muted); font-size: .84rem; }
.sv-desc { color: var(--muted); font-size: .92rem; line-height: 1.6; margin-top: 8px; max-width: 68ch; }
/* A presentation salon, not a contact sheet (critique-jtbd 24): two columns
   MAX on any width — the images stay large, the way they are judged. */
.sv-photos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 12px;
}
.sv-photos figure { margin: 0; }
.sv-photos img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg2);
  cursor: zoom-in;
  display: block;
}
.sv-photos figcaption { color: var(--muted); font-size: .78rem; margin-top: 4px; line-height: 1.4; }
.sv-foot {
  text-align: center;
  color: var(--muted);
  font-size: .8rem;
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.sv-foot span { color: var(--accent); }
@media (max-width: 700px) {
  .sv-photos { gap: 10px; }
}

/* ------------------------------- share modal ------------------------------- */
.sh-created {
  margin-top: 14px;
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.sh-url {
  flex: 1 1 220px;
  font-size: .82rem;
  word-break: break-all;
  background: var(--bg2);
  border-radius: 6px;
  padding: 8px 10px;
  user-select: all;
}
.sh-warn { flex-basis: 100%; color: var(--badge-amber-fg); font-size: .82rem; }
.sh-log { margin-top: 8px; border-top: 1px dashed var(--border); padding-top: 6px; }
.sh-log-row { font-size: .78rem; color: var(--muted); padding: 2px 0; }

/* --------------------------- unsorted drawer (📥) --------------------------- */
.unsorted-banner {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--badge-amber-bg);
  color: var(--badge-amber-fg);
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-weight: 700;
  margin-bottom: 16px;
  min-height: 44px;
}
.unsorted-banner:hover { filter: brightness(1.1); }

/* ------------------------ inline captions (photos/mood) --------------------- */
.mb-cap, .ph-cap, .bd-cap {
  display: block;
  font-size: .82rem;
  line-height: 1.4;
  margin-top: 3px;
  padding: 2px 4px;
  border-radius: 6px;
  cursor: text;
}
.mb-cap:hover, .ph-cap:hover, .bd-cap:hover, .mb-cap:focus-visible, .ph-cap:focus-visible, .bd-cap:focus-visible { background: var(--panel2); }
.cap-empty { color: var(--muted); font-style: italic; }
.cap-input {
  width: 100%;
  font-size: .82rem;
  padding: 4px 6px;
  min-height: 34px;
}

/* -------------------------- swatch promotion / naming ----------------------- */
.lb-swatch-wrap { position: relative; display: inline-flex; }
/* Same treatment as .lb-star/.chip-x: a 20px chip inside a 44px hit zone
   (transparent border, background clipped to the visual circle). */
.swatch-add {
  position: absolute;
  top: -21px; right: -21px;
  width: 44px; height: 44px;
  padding: 0;
  border: 12px solid transparent;
  border-radius: 50%;
  background: var(--panel2);
  background-clip: padding-box;
  box-shadow: inset 0 0 0 1px var(--border);
  color: var(--muted);
  font-size: .72rem;
  line-height: 1;
  opacity: .55;
  transition: opacity .12s, color .12s;
}
.lb-swatch-wrap:hover .swatch-add, .swatch-add:hover, .swatch-add:focus-visible {
  opacity: 1;
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.swatch-namer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.swatch-namer input { flex: 1; min-height: 38px; font-size: .86rem; }
.swatch-dot {
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  display: inline-block;
}
.lb-named-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.lb-named-swatches .lb-swatch { box-shadow: 0 0 0 2px var(--panel), 0 0 0 3px var(--border); }
.sw-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.sw-row .sw-name { flex: 1; min-height: 38px; font-size: .88rem; }

/* --------------------------- disabled modules (tabs) ------------------------ */
.tabs button.tab-disabled { opacity: .42; filter: saturate(.4); }
.tabs button.tab-disabled:hover { color: var(--muted); }
.module-off {
  text-align: center;
  padding: var(--sp-6) var(--sp-3);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
}
.module-off-icon { font-size: 2rem; margin-bottom: 10px; }
.module-off h3 { color: var(--text); font-size: var(--fs-1); margin-bottom: var(--sp-1); }
.module-off .btn { margin-top: var(--sp-2); }

/* ----------------------- kanban locked for non-approvers -------------------- */
.kb-lock { font-size: .8rem; margin-left: auto; margin-right: 6px; cursor: help; }
.kb-col.kb-locked { background: var(--bg); border-style: dashed; }
.kb-col.kb-locked .kb-cards { opacity: .85; }

/* --------------------------- printed named swatches ------------------------- */
@media print {
  .pr-swatch-named { align-items: flex-start; }
  .pr-swatch-named .pr-sw-txt { line-height: 1.35; }
  .pr-sw-norm {
    font-style: normal;
    font-size: 5.5pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    border: .5pt solid #555;
    border-radius: 2pt;
    padding: 0 2pt;
    color: #333;
  }
  /* The public share view never prints app chrome oddities. */
  .sv-foot { border-top: none; }
}

/* ------------------------- responsive dept shorthand ------------------------ */
/* deptBadge(): full name wide, trade shorthand (COST, MU, DÉCO…) ≤700px. */
.badge .d-short { display: none; }
@media (max-width: 700px) {
  .badge .d-long { display: none; }
  .badge .d-short { display: inline; }
}

/* ----------------------------------- todos ---------------------------------- */
.tab-badge {
  display: inline-block;
  margin-left: 6px;
  background: var(--accent);
  color: var(--accent-fg);
  border-radius: 10px;
  padding: 0 6px;
  font-size: .7rem;
  font-weight: 700;
  vertical-align: 1px;
}
.todo-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.todo-group-head {
  margin: 14px 0 8px;
  font-size: .82rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.todo-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.todo-row .todo-check { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--ok); flex-shrink: 0; }
.todo-main { flex: 1; min-width: 0; }
.todo-title {
  background: none;
  border: 0;
  color: var(--text);
  font-weight: 600;
  font-size: .95rem;
  text-align: left;
  padding: 2px 0;
  min-height: 28px;
  cursor: pointer;
}
.todo-title:hover, .todo-title:focus-visible { color: var(--accent-text); }
.todo-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 5px; font-size: .8rem; color: var(--muted); }
.todo-meta .chip { cursor: pointer; }
.todo-due { white-space: nowrap; }
.todo-ass { white-space: nowrap; }
.todo-muted { opacity: .62; }
.todo-muted .todo-title { text-decoration: line-through; }
.todo-prio { color: var(--danger); margin-right: 2px; }
.todo-fold { margin-bottom: 18px; }
.todo-fold summary {
  cursor: pointer;
  color: var(--muted);
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 8px 0;
  min-height: 36px;
}
.todo-fold .todo-group { margin-top: 8px; }
.td-due { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 10px; }
.td-due-opt { display: inline-flex; gap: 6px; align-items: center; }

/* Readiness → "take it on" inline form */
.take-form { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.take-form .tk-title { flex: 2; min-width: 180px; }
.take-form .tk-ass { flex: 1; min-width: 140px; }

/* -------------------------- multi-department picker ------------------------- */
.mdept-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mdept-legend { color: var(--muted); font-size: .78rem; margin-bottom: 4px; }
.mdept-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px; align-items: center; }
.mdept-row .lb-inline-check { margin: 0; }
.invite-depts { grid-column: 1 / -1; }
.invite-depts summary {
  cursor: pointer;
  color: var(--muted);
  font-size: .86rem;
  min-height: 36px;
  display: flex;
  align-items: center;
}
.team-vis { margin-bottom: 12px; }

/* --------------------------- onboarding welcome card ------------------------ */
.onboard-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--accent2);
  border-radius: var(--radius);
  padding: 16px 56px 16px 16px;
  margin-bottom: 16px;
}
/* Utility card = sans + letterspaced kicker (the public-screen pattern);
   Playfair would claim an editorial register this card has no right to. */
.onboard-card .onboard-kicker {
  font-size: .74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--accent2);
}
.onboard-card h3 { font-size: 1.02rem; margin-top: 4px; }
.onboard-x {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 44px; min-height: 44px;
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
}
.onboard-x:hover, .onboard-x:focus-visible { color: var(--text); }
.onboard-stats { display: flex; gap: 16px; margin: 8px 0 12px; color: var(--muted); font-size: .9rem; flex-wrap: wrap; }
.onboard-ctas { display: flex; gap: 8px; flex-wrap: wrap; }

/* --------------------------- anchored photo comments ------------------------ */
/* Card pill: 💬n, amber while something is unresolved. */
.cmt-pill {
  border: 0;
  background: var(--badge-violet-bg);
  color: var(--badge-violet-fg);
  border-radius: 20px;
  padding: 3px 9px;
  font-size: .74rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 26px;
  vertical-align: middle;
}
.cmt-pill.unres { background: var(--badge-amber-bg); color: var(--badge-amber-fg); }

.lb-stage { position: relative; display: inline-flex; max-width: 100%; }
.lb-stage img { max-width: 100%; max-height: calc(100vh - 48px); border-radius: 8px; }
.cmt-placing .lb-stage img { cursor: crosshair; }
.cmt-markers { position: absolute; inset: 0; pointer-events: none; }
/* A 28px pin inside a 44px hit zone (transparent border, clipped background). */
.cmt-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 44px; height: 44px;
  padding: 0;
  border: 8px solid transparent;
  border-radius: 50%;
  background: var(--accent);
  background-clip: padding-box;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.85);
  color: var(--accent-fg);
  font-size: .8rem;
  font-weight: 700;
  line-height: 1;
  pointer-events: auto;
  cursor: pointer;
  z-index: 2;
}
.cmt-pin.resolved { background: var(--badge-grey-bg); background-clip: padding-box; color: var(--badge-grey-fg); }
.cmt-pin-new { background: var(--accent2); background-clip: padding-box; color: #fff; display: inline-flex; align-items: center; justify-content: center; }

.lightbox-cmt {
  position: absolute;
  top: 14px; right: 72px;
  min-width: 44px; min-height: 44px;
  background: rgba(5, 6, 10, .72);
  border: 1px solid var(--border);
  color: #fff;
  border-radius: 22px;
  cursor: pointer;
  font-size: 1rem;
  z-index: 4;
}
.cmt-count {
  background: var(--accent);
  color: var(--accent-fg);
  border-radius: 10px;
  padding: 0 6px;
  font-size: .72rem;
  font-weight: 700;
  margin-left: 4px;
}

.cmt-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(380px, 92vw);
  background: var(--panel);
  color: var(--text);
  border-left: 1px solid var(--border);
  z-index: 3;
  padding: 60px 14px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: auto;
  text-align: left;
}
.cmt-panel[hidden] { display: none; }
.cmt-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cmt-hint { color: var(--muted); font-size: .84rem; }
.cmt-list { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.cmt-empty { color: var(--muted); font-size: .88rem; padding: 12px 0; }
.cmt-item { background: var(--panel2); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; }
.cmt-item.cmt-resolved { opacity: .68; }
.cmt-item.cmt-flash { outline: 2px solid var(--accent); }
.cmt-reply { margin: 8px 0 0 16px; }
.cmt-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .84rem; }
.cmt-when { color: var(--muted); font-size: .76rem; }
.cmt-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-fg);
  font-size: .72rem;
  font-weight: 700;
  flex-shrink: 0;
}
.cmt-no-new { background: var(--accent2); color: #fff; }
.cmt-body { margin-top: 4px; font-size: .9rem; line-height: 1.5; overflow-wrap: anywhere; }
.cmt-mention { background: var(--badge-violet-bg); color: var(--badge-violet-fg); border-radius: 4px; padding: 0 2px; }
.cmt-actions { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.cmt-del:hover { color: var(--danger); }
.cmt-replybox { display: flex; gap: 6px; margin-top: 6px; }
.cmt-replybox[hidden] { display: none; }
.cmt-replybox input { flex: 1; min-height: 38px; font-size: .88rem; }
.cmt-compose { display: flex; gap: 6px; align-items: center; }
.cmt-compose input { flex: 1; min-height: 44px; }

@media (max-width: 700px) {
  .cmt-panel {
    top: auto; left: 0; right: 0;
    width: auto;
    max-height: 55vh;
    border-left: none;
    border-top: 1px solid var(--border);
    padding: 14px;
  }
  .lightbox-cmt { right: 68px; }
}

/* ================================ Palier 3 ================================= */

/* ------------------------------ undo toast --------------------------------- */
.undo-toast {
  position: fixed;
  bottom: 78px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 8px 8px 14px;
  z-index: 310;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .38);
  max-width: min(92vw, 480px);
}
.undo-toast .undo-msg { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --------------------------- photo card reactions --------------------------- */
.ph-star {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 44px; min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: rgba(5, 6, 10, .62);
  background-clip: padding-box;
  border: 6px solid transparent;
  border-radius: 999px;
  color: #cfd3e0;
  font-size: 1rem;
  z-index: 2;
  cursor: pointer;
}
.ph-star.on { color: #ffd76e; }
.ph-star-n, .bd-star-n { font-size: .74rem; font-weight: 700; }

/* ------------------------------- boards list -------------------------------- */
.bd-card .bd-cover {
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}
.bd-card .bd-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bd-card .bd-cover-empty { font-size: 2rem; opacity: .45; }
.bd-card-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* ------------------------------ board detail -------------------------------- */
.bd-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.bd-title-wrap { min-width: 0; flex: 1; }
.bd-title {
  font-family: var(--font-display);
  font-size: var(--fs-2);
  line-height: 1.2;
  border-radius: 6px;
  padding: 2px 6px;
  margin-left: -6px;
}
.bd-title[role="button"] { cursor: text; }
.bd-title[role="button"]:hover, .bd-title[role="button"]:focus-visible { background: var(--panel2); }
.bd-title-input { font: inherit; width: 100%; min-height: 44px; }
.bd-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.bd-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bd-note { min-height: 54px; margin-bottom: 14px; }
.bd-note-ro { color: var(--muted); line-height: 1.6; margin-bottom: 14px; max-width: 76ch; }

.bd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  align-items: start;
}
.bd-tile {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 44px;
}
.bd-tile.bd-dragging { opacity: .45; }
.bd-tile.bd-drop-before { box-shadow: -3px 0 0 var(--accent); }
.bd-tile > img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  background: var(--bg2);
}
.bd-body { padding: 8px 10px 4px; font-size: .85rem; }
.bd-tile.bd-heading { grid-column: 1 / -1; background: transparent; border: none; overflow: visible; }
.bd-h-input, .bd-h-ro {
  font-family: var(--font-display);
  font-size: var(--fs-1);
  font-weight: 700;
  background: transparent;
  border: none;
  padding: 6px 4px;
  color: var(--text);
}
.bd-h-input:focus { outline: 2px solid var(--accent); border-radius: 6px; }
.bd-text {
  width: 100%;
  border: none;
  background: transparent;
  min-height: 120px;
  padding: 10px 12px;
  font-size: .9rem;
  line-height: 1.55;
  resize: vertical;
}
.bd-text:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.bd-text-ro { padding: 10px 12px; font-size: .9rem; line-height: 1.55; white-space: pre-wrap; }
.bd-swatch {
  border: none;
  background: transparent;
  padding: 10px 10px 0;
  cursor: pointer;
  align-self: flex-start;
  min-width: 44px; min-height: 44px;
}
.bd-swatch i {
  display: block;
  width: 100%;
  min-width: 72px;
  height: 64px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.bd-sw-name { color: var(--muted); font-size: .82rem; line-height: 1.45; }
.bd-link { display: block; padding: 2px 0 4px; overflow-wrap: anywhere; }
.bd-link-src { color: var(--muted); font-size: .76rem; margin-top: 4px; overflow-wrap: anywhere; }
.bd-src {
  position: absolute;
  top: 6px; left: 6px;
  background: rgba(5, 6, 10, .72);
  color: #fff;
  border-radius: 999px;
  font-size: .72rem;
  padding: 4px 10px;
  z-index: 2;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
}
.bd-star {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 44px; min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: rgba(5, 6, 10, .62);
  background-clip: padding-box;
  border: 6px solid transparent;
  border-radius: 999px;
  color: #cfd3e0;
  font-size: 1rem;
  z-index: 2;
  cursor: pointer;
}
.bd-star.on { color: #ffd76e; }
.bd-ctrl {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px 4px;
  margin-top: auto;
}
.bd-ctrl .btn { min-width: 44px; min-height: 44px; }
.bd-handle {
  cursor: grab;
  color: var(--muted);
  padding: 0 6px;
  user-select: none;
  font-size: .95rem;
}
.bd-grid.bd-engaged .bd-handle,
.bd-grid.bd-engaged [data-bd-up],
.bd-grid.bd-engaged [data-bd-down] { visibility: hidden; }
.bd-addbar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

/* photo picker mini-grid */
.bd-pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  max-height: 46vh;
  overflow-y: auto;
  margin-top: 12px;
}
.bd-pick {
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  background: var(--bg2);
  overflow: hidden;
  cursor: pointer;
  min-height: 44px;
}
.bd-pick img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.bd-pick.picked { border-color: var(--ok); opacity: .55; }
.bd-pick:hover, .bd-pick:focus-visible { border-color: var(--accent); }

/* ------------------------- lookbook intro banner ---------------------------- */
.lb-intro {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent2);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.lb-intro-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lb-intro-open { margin-left: auto; }
.lb-intro-note { color: var(--muted); line-height: 1.6; margin-top: 8px; max-width: 76ch; }
.lb-intro-strip { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.lb-intro-strip img {
  height: 92px;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  flex-shrink: 0;
}
.lb-intro .lb-named-swatches { margin-top: 10px; }

/* ----------------------- projection: generic slides ------------------------ */
.lb-present.lb-p-solo { grid-template-columns: 1fr; }
.lb-p-cap { color: var(--muted); font-size: .95rem; text-align: center; max-width: 70ch; }
.lb-p-carton {
  max-width: 780px;
  padding: 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.lb-p-carton h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4.5vw, 2.8rem);
  line-height: 1.25;
  color: #e8eaf2;
}
.lb-p-carton p { color: #a9aec2; font-size: clamp(1rem, 2.2vw, 1.3rem); line-height: 1.65; overflow-wrap: anywhere; }
.lb-p-carton-swatch {
  display: block;
  width: 140px; height: 140px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .18);
}

/* ------------------------------ shared board -------------------------------- */
.sv-board {
  max-width: 860px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  align-items: start;
}
.svb-tile { margin: 0; }
.svb-photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  display: block;
}
.svb-photo figcaption { color: var(--muted); font-size: .78rem; margin-top: 4px; line-height: 1.4; }
.svb-heading {
  grid-column: 1 / -1;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  margin-top: 8px;
}
.svb-text { color: var(--muted); line-height: 1.65; font-size: .95rem; white-space: pre-wrap; }
.svb-swatch { display: flex; align-items: center; gap: 10px; font-size: .88rem; line-height: 1.4; }
.svb-swatch i {
  width: 52px; height: 52px;
  border-radius: 10px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.svb-link { overflow-wrap: anywhere; font-size: .92rem; }
.svb-src { color: var(--muted); font-size: .76rem; margin-top: 4px; overflow-wrap: anywhere; }
.sv-note { margin: 10px auto 0; max-width: 68ch; }

/* --------------------------------- trash ----------------------------------- */
.trash-fold { margin-top: 26px; }
.trash-fold > summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 0;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.trash-list { margin-top: 8px; }

@media (max-width: 700px) {
  .bd-head { flex-direction: column; }
  .bd-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .lb-intro-strip img { height: 72px; }
}

/* ============================ Palier UI (lots 1+2) ========================= */

/* ------------------------- bottom-nav (mobile, 4+1) ------------------------
   The project's thumb navigation: Jour · Looks · Tâches · Boards · Plus.
   Per-project only (dashboard and #/s never show it); the top .tabs keep the
   tablist semantics on desktop, this bar is plain navigation. */
.bottom-nav {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 85;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: transparent;
  border: 0;
  color: var(--muted);
  min-height: 56px;
  font-size: .68rem;
  font-weight: 600;
  padding: 6px 2px;
}
.bottom-nav button .ic { vertical-align: 0; }
.bottom-nav button[aria-current="page"] { color: var(--accent-text); }
.bottom-nav button.bn-disabled { opacity: .42; }
@media (max-width: 700px) {
  .bottom-nav { display: flex; }
}

/* "Plus" sheet: the remaining sections, bottom-anchored on a phone. */
.sheet-backdrop { align-items: flex-end; padding: 0; }
.sheet-backdrop .modal { max-width: none; border-radius: 16px 16px 0 0; border-bottom: 0; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
@media (min-width: 701px) {
  .sheet-backdrop { align-items: flex-start; padding: 5vh 16px; }
  .sheet-backdrop .modal { max-width: 420px; border-radius: 14px; }
}
.nav-sheet-grid { display: grid; gap: 4px; margin-top: 10px; }
.nav-sheet-grid button {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  color: var(--text);
  min-height: 48px;
  padding: 6px 10px;
  font-weight: 600;
  text-align: left;
}
.nav-sheet-grid button .ic { color: var(--muted); }
.nav-sheet-grid button:hover { background: var(--panel2); }
.nav-sheet-grid button[aria-current="page"] { color: var(--accent-text); }
.nav-sheet-grid button[aria-current="page"] .ic { color: var(--accent-text); }
.nav-sheet-grid button.bn-disabled { opacity: .42; }

/* Big stroke glyphs used by empty covers and empty states. */
.lb-cover-empty .ic-xl, .lb-p-empty .ic-xl, .bd-cover-empty .ic, .kb-empty .ic { opacity: .8; color: var(--muted); }
.module-off-icon .ic-xl { color: var(--muted); }

/* Compact icon-only buttons of the topbar keep a square 44px footprint. */
.btn-icon { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; padding: 4px 8px; }

/* ===================== Palier UI — lots 3+4 (flows & registre) ===================== */

/* Desktop-only drag hints: a drag-and-drop instruction on a touch screen is a
   promise the device cannot keep (critique-plateau §8). */
@media (pointer: coarse) {
  .drop-hint { display: none !important; }
}

/* Day sheet empty state — the next gesture, not a dead sentence (3a). */
.day-empty p { margin-bottom: 4px; }
.day-empty-ctas { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }

/* Dashboard hero (3d): looks waiting for an approver — one gesture to the
   projection. Holds the dashboard's single primary. */
.dash-hero {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.dash-hero-kicker {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .72rem;
  font-weight: 700;
  color: var(--badge-amber-fg);
}
.dash-hero h2 { font-size: 1.22rem; line-height: 1.35; }

/* Readiness header (3e): neutral by default — green is EARNED (no blocker,
   no pending sign-off), never the color of a number above a list of alerts. */
.readiness-head .rd-pct { font-size: 16px; }

/* Scene sheet (3f): looks first, big enough to check a sleeve; the
   documentary sections fold below. */
.sheet-photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.sheet-photos img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg2);
  cursor: zoom-in;
  display: block;
}
@media (max-width: 700px) {
  .sheet-photos { grid-template-columns: repeat(2, 1fr); }
}
.sheet-fold { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.sheet-fold > summary {
  cursor: pointer;
  font-weight: 600;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sheet-fold > summary:hover { color: var(--accent-text); }

/* Lookbook toolbar (4a): one compact row — the weekly verbs are ghost icons
   on the right, the first image rises above the fold. */
.lb-toolbar { gap: 8px; }
.lb-toolbar select { min-width: 0; font-size: .88rem; }
.lb-toolbar #lb-q { width: 150px; flex: 0 1 150px; font-size: .88rem; }
.lb-more-wrap { position: relative; margin-left: auto; display: flex; gap: 8px; align-items: center; }
@media (max-width: 700px) {
  .lb-toolbar { gap: 6px; }
  .lb-toolbar .btn-primary { flex: 1 1 100%; }
  .lb-toolbar select { flex: 1 1 42%; }
  .lb-toolbar #lb-q { flex: 1 1 40%; width: auto; }
  .lb-more-wrap { margin-left: auto; }
}
.lb-dept-kicker {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  margin: -8px 0 14px;
}

/* Board header (4b): [Present] · one state action · ⋯ menu. */
.bd-actions { position: relative; }
.menu-pop .btn.menu-on, .btn-icon.menu-on { color: var(--accent-text); }

/* Team (3g): merged invitation block. */
.invite-ctas { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; grid-column: 1 / -1; }

.sv-visa.lb-edited-line, .sv-approved .lb-edited-line { color: var(--badge-amber-fg); font-size: .84rem; }
