:root {
  --bg: #111111;
  --panel: #1b1b1b;
  --panel-2: #242424;
  --line: #2f2f2f;
  --text: #ececec;
  --muted: #9a9a9a;
  --accent: #ff4d6d;
  --star: #ffc94d;
  --final: #3ecf8e;
  --danger: #ff6b5b;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* --- Boutons / champs --- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 14px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: #555; }
.btn.primary { background: var(--text); color: #111; border-color: var(--text); font-weight: 600; }
.btn.danger { color: var(--danger); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn:disabled, .btn.disabled { opacity: .4; pointer-events: none; }
.link-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 4px 6px; }
.link-btn:hover { color: var(--text); }
input[type=text], input[type=password], input[type=email], input[type=date], select, textarea {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%;
}
textarea { resize: vertical; min-height: 64px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }

/* --- Barre du haut --- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: 10px 20px; background: rgba(17,17,17,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; text-decoration: none; letter-spacing: .02em; }
.brand span { color: var(--accent); font-weight: 500; margin-left: 6px; }
.crumbs { flex: 1; min-width: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs a { text-decoration: none; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.me-btn { display: flex; align-items: center; gap: 8px; background: none; border: 0; cursor: pointer; padding: 2px; }

/* --- Avatars --- */
.avatar {
  --c: #666; width: 30px; height: 30px; border-radius: 50%; background: var(--c); color: #fff;
  display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; flex: none;
}
.avatar.sm { width: 22px; height: 22px; font-size: 10px; }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }

/* --- Pages centrees --- */
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.card-box { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; width: 100%; max-width: 420px; }
.card-box.wide { max-width: 720px; }
.card-box h1 { margin: 0 0 6px; font-size: 22px; }
.sub { color: var(--muted); margin: 0 0 16px; }
.error { color: var(--danger); min-height: 1.4em; margin-top: 8px; font-size: 14px; }
.who-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin: 16px 0 22px; }
.who {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; text-align: center;
}
.who:hover, .who.current { border-color: var(--text); }
.who small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 160px; }
.divider { border-top: 1px solid var(--line); margin: 18px 0 6px; padding-top: 12px; color: var(--muted); font-size: 13px; }

/* --- Accueil --- */
.page { max-width: 1600px; margin: 0 auto; padding: 20px; }
.page h1 { font-size: 24px; margin: 4px 0 18px; }
.shoot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.shoot {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  text-decoration: none; display: flex; flex-direction: column;
}
.shoot:hover { border-color: #555; }
.shoot .cover { aspect-ratio: 3/2; background: var(--panel-2) center/cover no-repeat; }
.shoot .info { padding: 12px 14px; }
.shoot .info strong { display: block; font-size: 16px; }
.shoot .meta { color: var(--muted); font-size: 13px; }
.new-shoot { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 22px; }
.new-shoot > div { flex: 1 1 200px; max-width: 360px; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }

/* --- Page shooting --- */
.shoot-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.shoot-head h1 { margin: 0; }
.tabs, .seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.tabs a, .seg button {
  border: 0; background: none; padding: 6px 12px; border-radius: 7px; cursor: pointer; text-decoration: none; color: var(--muted); white-space: nowrap;
}
.tabs a.on, .seg button.on { background: var(--panel-2); color: var(--text); }
.seg button.on.mode-select { color: var(--accent); }
.seg button.on.mode-final { color: var(--final); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.toolbar .grow { flex: 1; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel);
  border-radius: 999px; padding: 4px 11px 4px 5px; cursor: pointer; white-space: nowrap; font-size: 13px; color: var(--muted);
}
.chip.plain { padding-left: 11px; }
.chip.on { border-color: var(--text); color: var(--text); background: var(--panel-2); }
.chip .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.filters-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 6px 0 4px; }
.banner { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--final); border-radius: 8px; padding: 10px 14px; margin: 10px 0 4px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.banner.select { border-left-color: var(--accent); }
.banner .grow { flex: 1 1 260px; color: var(--muted); font-size: 14px; }

.look { margin: 22px 0 8px; }
.look-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-bottom: 10px; position: sticky; top: 53px; background: var(--bg); padding: 6px 0; z-index: 5; }
.look-head h2 { font-size: 17px; margin: 0; }
.look-head .meta { color: var(--muted); font-size: 13px; flex: 1; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--thumb, 200px), 1fr)); gap: 10px; }

.ph { position: relative; background: var(--panel); border-radius: 8px; overflow: hidden; border: 2px solid transparent; cursor: zoom-in; aspect-ratio: 2/3; }
.ph img { width: 100%; height: 100%; object-fit: contain; display: block; background: #0b0b0b; }
.ph.final { border-color: var(--final); }
.ph .ov { position: absolute; inset: 0; pointer-events: none; }
.ph .ov > * { pointer-events: auto; }
.ph .who-picked { position: absolute; left: 6px; bottom: 6px; display: flex; flex-wrap: wrap; gap: 3px; max-width: calc(100% - 50px); }
.pk { display: inline-flex; align-items: center; gap: 2px; background: rgba(0,0,0,.7); border-radius: 999px; padding: 1px 6px 1px 1px; font-size: 11px; }
.pk .h { color: var(--accent); }
.pk .s { color: var(--star); letter-spacing: -1px; }
.ph .tags { position: absolute; right: 6px; bottom: 6px; display: flex; gap: 4px; }
.tag { background: rgba(0,0,0,.7); border-radius: 6px; padding: 1px 6px; font-size: 11px; }
.tag.final { background: var(--final); color: #04140c; font-weight: 700; }
.ph .acts { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; }
.ico-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: rgba(0,0,0,.6); color: #fff; font-size: 17px; line-height: 1;
}
.ico-btn.on.heart { color: var(--accent); background: rgba(0,0,0,.8); }
.ico-btn.final-toggle { width: auto; border-radius: 999px; padding: 0 12px; font-size: 13px; font-weight: 600; }
.ico-btn.final-toggle.on { background: var(--final); color: #04140c; }
.ph .fname { position: absolute; left: 0; right: 0; top: 0; padding: 4px 8px; font-size: 11px; background: linear-gradient(rgba(0,0,0,.65), transparent); opacity: 0; transition: opacity .15s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ph:hover .fname { opacity: 1; }

/* --- Upload / retouches --- */
.drop {
  border: 2px dashed #444; border-radius: 14px; padding: 36px 20px; text-align: center; background: var(--panel); transition: border-color .15s, background .15s;
}
.drop.over { border-color: var(--accent); background: #22161a; }
.drop p { color: var(--muted); margin: 6px 0 16px; }
.drop .row { justify-content: center; }
.drop .row > * { flex: 0 0 auto; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-top: 16px; }
.panel h3 { margin: 0 0 10px; font-size: 16px; }
table.simple { width: 100%; border-collapse: collapse; font-size: 14px; }
table.simple td, table.simple th { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.simple th { color: var(--muted); font-weight: 500; }
table.simple td.num { text-align: right; font-variant-numeric: tabular-nums; }
.progress { height: 8px; background: var(--panel-2); border-radius: 99px; overflow: hidden; margin: 10px 0; }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.log { max-height: 200px; overflow: auto; font-size: 13px; color: var(--danger); margin: 8px 0 0; padding-left: 18px; }
.muted { color: var(--muted); }
.ok { color: var(--final); }
.missing-list { columns: 3 220px; font-size: 13px; color: var(--muted); padding-left: 18px; }

/* --- Visionneuse --- */
.lb { position: fixed; inset: 0; z-index: 50; background: #050505; display: grid; grid-template-columns: 1fr 360px; }
.lb-stage { position: relative; display: grid; place-items: center; min-height: 0; min-width: 0; padding: 12px; }
.lb-stage img { max-width: 100%; max-height: calc(100vh - 24px); object-fit: contain; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255,255,255,.08); color: #fff; font-size: 22px; cursor: pointer; }
.lb-nav:hover { background: rgba(255,255,255,.18); }
.lb-nav.prev { left: 12px; } .lb-nav.next { right: 12px; }
.lb-side { background: var(--panel); border-left: 1px solid var(--line); overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.lb-top { display: flex; align-items: start; gap: 10px; }
.lb-top .t { flex: 1; min-width: 0; }
.lb-top strong { display: block; overflow-wrap: anywhere; }
.lb-top .muted { font-size: 13px; }
.lb-section h4 { margin: 0 0 8px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.mine { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.big-heart { font-size: 20px; padding: 6px 14px; }
.big-heart.on { color: var(--accent); border-color: var(--accent); }
.stars { display: inline-flex; }
.stars button { background: none; border: 0; font-size: 24px; cursor: pointer; color: #555; padding: 0 2px; }
.stars button.on { color: var(--star); }
.final-big { width: 100%; padding: 10px; font-weight: 700; }
.final-big.on { background: var(--final); color: #04140c; border-color: var(--final); }
.team-list { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.team-list > div { display: flex; align-items: center; gap: 8px; }
.team-list .h { color: var(--accent); } .team-list .s { color: var(--star); }
.comments { display: flex; flex-direction: column; gap: 10px; }
.cmt { display: flex; gap: 8px; }
.cmt .body { flex: 1; min-width: 0; background: var(--panel-2); border-radius: 8px; padding: 7px 10px; }
.cmt .body .meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; }
.cmt .body p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.cmt.reply { margin-left: 30px; }
.cmt .acts { font-size: 12px; }
.reply-to { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }
.kbd { font-size: 12px; color: var(--muted); }
.kbd b { border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; font-weight: 500; }
.version-switch { display: flex; gap: 6px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: #111; padding: 10px 16px; border-radius: 8px; z-index: 100; max-width: calc(100vw - 32px); box-shadow: 0 6px 24px rgba(0,0,0,.4); }
.toast.err { background: var(--danger); color: #fff; }

@media (max-width: 860px) {
  .topbar { padding: 8px 16px; gap: 10px; }
  .crumbs { display: none; }
  .page { padding: 16px; }
  .grid { --thumb: 140px; gap: 6px; }
  .look-head { top: 49px; }
  .lb { grid-template-columns: 1fr; grid-template-rows: 58vh 1fr; }
  .lb-side { border-left: 0; border-top: 1px solid var(--line); }
  .lb-stage img { max-height: calc(58vh - 24px); }
  .lb-nav { width: 38px; height: 38px; }
  .ph .fname { opacity: 1; }
  .me-btn .name { display: none; }
}
