/* Direction artistique « Régie » : la meme pour l'espace client, l'espace du monteur et le Studio.
   Chargee APRES app.css : elle redefinit les couleurs et les composants de base, sans toucher aux pages.
   Idee : une regie de montage. Chaque projet est une PISTE ; une tete de lecture rouge (le voyant « tally ») dit ou il en est. */
@font-face { font-family: "Regie Titre"; src: url("/static/fonts/ArchivoBlack-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Regie Texte"; src: url("/static/fonts/Rubik-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Regie Texte"; src: url("/static/fonts/Rubik-Bold.ttf") format("truetype"); font-weight: 600 800; font-display: swap; }

:root {
  --ink: #17142b; --muted: #6b6785; --line: #e2def0; --bg: #f3f1fa; --card: #ffffff; --soft: #f8f6fd;
  --brand: #4b4ded; --brand-ink: #3537c9; --brand-soft: #e9e9ff; --on-brand: #ffffff;
  --ok: #0f8f6f; --ok-soft: #dff5ee; --warn: #a86400; --warn-soft: #fff0d6;
  --err: #c9283a; --err-soft: #ffe6e9; --info: #3b56b8; --info-soft: #e7ecff;
  --tally: #ff4d5e; --side: #100e1f; --side-ink: #b9b4d6; --radius: 16px;
  --shadow: 0 1px 2px rgba(23, 20, 43, .05), 0 8px 24px rgba(23, 20, 43, .06);
  --titre: "Regie Titre", "Arial Black", system-ui, sans-serif; --texte: "Regie Texte", system-ui, "Segoe UI", sans-serif;
  --chiffres: "Cascadia Mono", Consolas, ui-monospace, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eeebfa; --muted: #9d98bb; --line: #2c2848; --bg: #100e1f; --card: #1a1730; --soft: #15122a;
    --brand: #8a8cff; --brand-ink: #b3b4ff; --brand-soft: #25234f; --on-brand: #100e1f;
    --ok: #3ddbb4; --ok-soft: #10332c; --warn: #ffb84d; --warn-soft: #3a2a0c;
    --err: #ff7a88; --err-soft: #3d1620; --info: #9db0ff; --info-soft: #1b2248;
    --side: #0b0a17; --side-ink: #a7a2c6; --shadow: none;
  }
}

body { font-family: var(--texte); font-size: 15.5px; }
h1, h2, .brand, .side .brand, .top .brand { font-family: var(--titre); font-weight: 400; letter-spacing: -.015em; }
h1 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); } h2 { font-size: 1.12rem; letter-spacing: -.005em; }
.mono, .tc { font-family: var(--chiffres); }
::selection { background: var(--brand); color: var(--on-brand); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Barres de navigation */
.top { border-bottom: 0; background: transparent; padding-top: 10px; }
.top .in { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 8px 10px 8px 20px; box-shadow: var(--shadow); max-width: 1080px; }
.top .brand, .side .brand { display: inline-flex; align-items: center; gap: 9px; font-size: 1rem; }
.top .brand::before, .side .brand::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--tally); box-shadow: 0 0 0 4px color-mix(in srgb, var(--tally) 22%, transparent); }
.top nav a { border-radius: 999px; padding: 6px 13px; font-weight: 600; font-size: .92rem; }
.top nav a.on { background: var(--ink); color: var(--bg); }
.side { padding: 20px 12px; border-right: 1px solid color-mix(in srgb, #fff 6%, transparent); }
.side a.nav { border-radius: 10px; font-weight: 600; }
.side a.nav.on { background: var(--brand); color: #fff; }
.side .sep { font-family: var(--chiffres); letter-spacing: .14em; }

/* Cartes, tuiles, pastilles */
.card { border-radius: var(--radius); padding: 20px 22px; }
.kpi { border-radius: var(--radius); padding: 14px 16px; }
.kpi b { font-family: var(--titre); font-weight: 400; font-size: 1.7rem; letter-spacing: -.02em; }
.kpi span { font-size: .8rem; }
.badge { font-size: .74rem; padding: 3px 10px; letter-spacing: .01em; }
.note { border-radius: 14px; padding: 12px 16px; }

/* Boutons : arrondis, francs, un leger enfoncement au clic */
.btn { border-radius: 999px; padding: 9px 18px; font-weight: 700; transition: transform .08s ease, background .15s ease, box-shadow .15s ease; box-shadow: 0 2px 0 color-mix(in srgb, var(--brand) 55%, #000); }
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn.ghost, .btn.sm { box-shadow: none; } .btn.sm { padding: 5px 12px; }
.btn.ok { box-shadow: 0 2px 0 color-mix(in srgb, var(--ok) 55%, #000); color: #06231c; } .btn.danger { box-shadow: 0 2px 0 color-mix(in srgb, var(--err) 55%, #000); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=search], select, textarea { border-radius: 12px; padding: 10px 12px; }
table th { font-family: var(--chiffres); font-weight: 600; letter-spacing: .08em; }

/* ------------------------------------------------------------------ la PISTE : ou en est un projet */
.track { --n: 5; display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 4px; margin: 14px 0 4px; }
.track .seg { position: relative; padding-top: 16px; font-size: .74rem; color: var(--muted); font-weight: 600; line-height: 1.2; min-width: 0; }
.track .seg::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px; border-radius: 4px; background: var(--line); }
.track .seg.done::before { background: var(--brand); }
.track .seg.cur { color: var(--ink); }
.track .seg.cur::before { background: linear-gradient(90deg, var(--brand) 0 50%, var(--line) 50% 100%); }
.track .seg.cur::after { content: ""; position: absolute; left: 50%; top: -5px; width: 4px; height: 18px; margin-left: -2px; border-radius: 2px; background: var(--tally); box-shadow: 0 0 0 4px color-mix(in srgb, var(--tally) 20%, transparent); }
.track .seg.final.done::before, .track.finished .seg::before { background: var(--ok); }
/* une seule etiquette lisible : celle de l'etape en cours (les autres se lisent au survol de la piste) */
.track .seg span { display: flex; white-space: nowrap; visibility: hidden; }
.track .seg.cur span, .track.finished .seg:last-child span { visibility: visible; }
.track .seg:nth-last-child(-n+3) span { justify-content: flex-end; }
.track.finished .seg:last-child { color: var(--ok); }
@media (prefers-reduced-motion: no-preference) {
  .track .seg.cur::after { animation: tally 1.8s ease-in-out infinite; }
  @keyframes tally { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--tally) 0%, transparent); } }
}

/* ------------------------------------------------------------------ accueil client */
.hello { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin: 6px 0 22px; }
.hello h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); line-height: 1.02; margin: 0; }
.hello p { margin: 6px 0 0; }
.drop-cta { display: flex; align-items: center; gap: 18px; padding: 20px 24px; border-radius: 22px; background: var(--ink); color: var(--bg); margin-bottom: 22px; text-decoration: none; position: relative; overflow: hidden; }
.drop-cta:hover { text-decoration: none; } .drop-cta:hover .go { transform: translateX(4px); }
.drop-cta b { font-family: var(--titre); font-weight: 400; font-size: 1.35rem; display: block; letter-spacing: -.01em; }
.drop-cta span { opacity: .78; font-size: .93rem; }
.drop-cta .rec { flex: 0 0 auto; width: 54px; height: 54px; border-radius: 50%; background: var(--tally); display: grid; place-items: center; color: #fff; font: 700 1.6rem/1 var(--texte); }
.drop-cta .go { margin-left: auto; font: 700 1.5rem/1 var(--texte); transition: transform .18s ease; }
.todo-list { display: grid; gap: 10px; margin-bottom: 24px; }
.todo { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--radius); background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); }
.todo b { display: block; } .todo .btn { margin-left: auto; flex: 0 0 auto; }
.projects { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.project { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 18px 20px 14px; color: var(--ink); box-shadow: var(--shadow); transition: transform .14s ease, border-color .14s ease; }
.project:hover { text-decoration: none; border-color: var(--brand); transform: translateY(-2px); }
.project .ref { font: 600 .74rem/1 var(--chiffres); color: var(--muted); letter-spacing: .08em; }
.project h3 { font-family: var(--titre); font-weight: 400; font-size: 1.12rem; margin: 6px 0 2px; letter-spacing: -.01em; }
.project .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .84rem; color: var(--muted); }
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 12px; }
.empty-state { border: 2px dashed var(--line); border-radius: 22px; padding: 34px 24px; text-align: center; }
.empty-state b { font-family: var(--titre); font-weight: 400; font-size: 1.2rem; display: block; margin-bottom: 6px; }

/* ------------------------------------------------------------------ regie du monteur : toutes les pistes d'un coup d'oeil */
.regie { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 6px 0; margin-bottom: 18px; box-shadow: var(--shadow); overflow: hidden; }
.regie-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px 8px; }
.regie-head h2 { margin: 0; }
.regie-row { display: grid; grid-template-columns: minmax(170px, 250px) 1fr auto; gap: 18px; align-items: center; padding: 10px 20px; border-top: 1px solid var(--line); color: var(--ink); }
.regie-row:hover { background: var(--soft); text-decoration: none; }
.regie-row .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.regie-row .who span { font: 600 .72rem/1.4 var(--chiffres); color: var(--muted); letter-spacing: .06em; }
.regie-row .track { margin: 0; } .regie-row .track .seg { padding-top: 13px; font-size: .7rem; }
.regie-row .flags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; min-width: 120px; }
@media (max-width: 900px) { .regie-row { grid-template-columns: 1fr; gap: 6px; } .regie-row .flags { justify-content: flex-start; } }

.code-input { font: 700 1.7rem/1.2 var(--chiffres); letter-spacing: .35em; text-align: center; padding: 14px 10px; }

/* ------------------------------------------------------------------ presence du studio : pastille, carte, bouton a trois positions */
.presence { display: inline-flex; align-items: center; gap: 7px; font: 600 .78rem/1 var(--texte); padding: 6px 11px; border-radius: 999px; background: var(--soft); color: var(--muted); border: 1px solid var(--line); }
.presence:hover { text-decoration: none; border-color: var(--brand); }
.presence .dot, .presence-card .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.presence.online .dot, .presence-card.online .dot { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 25%, transparent); }
.presence.busy .dot, .presence-card.busy .dot { background: var(--warn); }
.presence.online { color: var(--ok); } .presence.busy { color: var(--warn); }
.presence-card { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: var(--soft); border: 1px solid var(--line); }
.presence-card b { display: block; font-size: .92rem; } .presence-card span:not(.dot) { font-size: .82rem; color: var(--muted); }
.presence-card.online { background: var(--ok-soft); border-color: transparent; }
.presence-switch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 3px; margin: 0 0 14px !important; border-radius: 12px; background: rgba(255, 255, 255, .07); }
.presence-switch button { font: 600 .74rem/1 var(--texte); padding: 8px 2px; border: 0; border-radius: 9px; background: transparent; color: var(--side-ink); cursor: pointer; }
.presence-switch button:hover { color: #fff; }
.presence-switch button.on { background: #fff; color: #100e1f; }
.presence-switch button.on[value=online] { background: #3ddbb4; } .presence-switch button.on[value=busy] { background: #ffb84d; }
.chat-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--tally); color: #fff; font: 700 .72rem/1 var(--texte); }

/* ------------------------------------------------------------------ messagerie */
.chat { display: grid; gap: 18px; height: calc(100vh - 150px); min-height: 460px; }
.chat.with-inbox { grid-template-columns: 300px minmax(0, 1fr); height: calc(100vh - 90px); }
@media (max-width: 900px) { .chat.with-inbox { grid-template-columns: 1fr; height: auto; } }
.chat-inbox { overflow: auto; } .chat-inbox h1 { margin-bottom: 14px; }
.chat-conv { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 11px 13px; border-radius: 14px; color: var(--ink); border: 1px solid transparent; }
.chat-conv:hover { background: var(--soft); text-decoration: none; } .chat-conv.on { background: var(--card); border-color: var(--line); box-shadow: var(--shadow); }
.chat-conv span:last-child { grid-column: 1 / -1; font-size: .82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-main { display: flex; flex-direction: column; min-height: 0; background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.chat-head h1, .chat-head h2 { margin: 0; } .chat-head p { margin: 2px 0 0; }
.chat-flow { flex: 1; overflow: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: min(640px, 82%); } .msg.mine { align-self: flex-end; }
.msg-meta { font-size: .74rem; color: var(--muted); margin: 0 6px 3px; } .msg.mine .msg-meta { text-align: right; }
.msg-body { padding: 10px 14px; border-radius: 18px 18px 18px 6px; background: var(--soft); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.mine .msg-body { border-radius: 18px 18px 6px 18px; background: var(--brand); border-color: transparent; color: var(--on-brand); }
@media (prefers-reduced-motion: no-preference) { .msg.fresh { animation: arrive .25s ease-out; } @keyframes arrive { from { opacity: 0; transform: translateY(8px); } } }
.chat-empty { margin: auto; text-align: center; max-width: 380px; } .chat-empty b { font-family: var(--titre); font-weight: 400; font-size: 1.15rem; }
.chat-write { display: flex; gap: 8px; align-items: flex-end; padding: 12px 14px; border-top: 1px solid var(--line); background: var(--soft); }
.chat-write textarea { flex: 1; min-height: 44px; max-height: 180px; resize: none; }
.chat-write select { width: auto; max-width: 200px; }

/* ------------------------------------------------------------------ fiche client */
.swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.swatch { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: .9rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ nouvelle commande, pas a pas (wizard.js) */
.wz-bar { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 22px; padding: 6px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); width: fit-content; max-width: 100%; }
.wz-dot { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 7px; border-radius: 999px; border: 0; background: transparent; color: var(--muted); font: 600 .9rem/1 var(--texte); cursor: pointer; }
.wz-dot i { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--line); color: var(--ink); font: 700 .78rem/1 var(--chiffres); font-style: normal; }
.wz-dot.done i { background: var(--brand); color: var(--on-brand); } .wz-dot.done { color: var(--ink); }
.wz-dot.on { background: var(--ink); color: var(--bg); } .wz-dot.on i { background: var(--tally); color: #fff; }
form[data-wz] > [data-wz-step] { display: none !important; }
form[data-wz="1"] > [data-wz-step="1"]:not([hidden]), form[data-wz="2"] > [data-wz-step="2"]:not([hidden]), form[data-wz="3"] > [data-wz-step="3"]:not([hidden]),
form[data-wz="4"] > [data-wz-step="4"]:not([hidden]), form[data-wz="5"] > [data-wz-step="5"]:not([hidden]), form[data-wz="6"] > [data-wz-step="6"]:not([hidden]) { display: revert !important; }
form[data-wz="1"] > .formulas[data-wz-step="1"]:not([hidden]) { display: grid !important; }
.wz-nav { display: flex; align-items: center; gap: 14px; margin: 18px 0 8px; position: sticky; bottom: 0; padding: 14px 16px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 -6px 24px rgba(16, 14, 31, .12); z-index: 5; }
.wz-nav .wz-hint { flex: 1; } .wz-nav .btn[hidden] { display: none; }
.formula { transition: transform .12s ease, border-color .12s ease; } .formula:hover { transform: translateY(-2px); }

[hidden] { display: none !important; }
.btn { justify-content: center; }

/* ---------------------------------------------------------------- fiche de brief (formulaire client, lecture côté Régie) */
.brief-h { margin: 22px 0 10px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 1rem; }
.brief-fields > .brief-h:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.brief-set { border: 0; padding: 0; margin: 0 0 12px; } .brief-set legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.brief-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.brief-chip { position: relative; margin: 0; font-weight: 500; cursor: pointer; }
.brief-chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.brief-chip span { display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); transition: background .12s ease, border-color .12s ease; }
.brief-chip input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.brief-chip input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.brief-links.drag { outline: 2px dashed var(--brand); outline-offset: 6px; border-radius: 12px; }
.brief-paste { display: flex; gap: 8px; } .brief-paste input { flex: 1; min-width: 0; }
.brief-msg { min-height: 1.3em; margin: 6px 0 0; color: var(--muted); }
.brief-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.brief-list li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.brief-list a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.brief-list select { width: auto; padding: 4px 8px; font-size: .85rem; }
.brief-service { flex: none; font-weight: 700; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; padding: 4px 8px; border-radius: 6px; background: var(--soft); }
.brief-remove { flex: none; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: .85rem; text-decoration: underline; }
.brief-remove:hover { color: var(--ink); }
.brief-view section { margin: 0 0 14px; } .brief-view h3 { margin: 0 0 6px; font-size: .95rem; }
.brief-view dl { display: grid; grid-template-columns: minmax(150px, 230px) 1fr; gap: 4px 14px; margin: 0; }
.brief-view dt { color: var(--muted); font-size: .88rem; } .brief-view dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.brief-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--line); vertical-align: -2px; margin-right: 5px; }
.brief-text { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: .82rem; }
@media (max-width: 640px) { .brief-view dl { grid-template-columns: 1fr; } .brief-list li { flex-wrap: wrap; } .brief-list a { flex-basis: 100%; } }

/* ================================================================================================================================
   EFFICIENCER (19/11) : noir et blanc, clair par défaut, sombre au choix (bouton de la barre du haut, attribut data-theme posé par
   theme.js). Dense mais rangé : filets fins plutôt qu'ombres, angles peu arrondis, titres très typographiés, étiquettes en capitales.
   Une seule couleur vive, le jaune « surligneur » (--hl), réservée à ce qui est actif ou important. Le rouge reste le voyant « en direct ».
   ================================================================================================================================ */
:root, :root[data-theme="light"] {
  --ink: #0c0c0c; --muted: #66665f; --line: #deded8; --bg: #f5f5f2; --card: #ffffff; --soft: #efefeb;
  --brand: #0c0c0c; --brand-ink: #0c0c0c; --brand-soft: #e9e9e4; --on-brand: #ffffff;
  --hl: #e8ff3a; --on-hl: #0c0c0c;
  --ok: #0b7a55; --ok-soft: #e1f3ea; --warn: #8a5a00; --warn-soft: #fbf0cf; --err: #c22a1e; --err-soft: #fde7e3; --info: #1f4fbf; --info-soft: #e6edfb;
  --tally: #ff3b2e; --side: #0c0c0c; --side-ink: #a9a9a2; --side-line: #262626; --radius: 10px; --shadow: none;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --ink: #f3f3ef; --muted: #9b9b94; --line: #2a2a28; --bg: #0c0c0c; --card: #141413; --soft: #1b1b1a;
  --brand: #f3f3ef; --brand-ink: #ffffff; --brand-soft: #262624; --on-brand: #0c0c0c;
  --ok: #4fd6a2; --ok-soft: #10291f; --warn: #f0b84a; --warn-soft: #2e230a; --err: #ff7a6b; --err-soft: #33140f; --info: #8fb0ff; --info-soft: #131d36;
  --side: #000000; --side-ink: #8f8f88; --side-line: #1f1f1e; --shadow: none;
  color-scheme: dark;
}
html { background: var(--bg); }
body { background: var(--bg); color: var(--ink); font-size: 15px; }
a { color: var(--ink); text-decoration: none; }
p a, .note a, li > a:not(.btn), td a:not(.btn), dd a, .hint a, .head a:not(.btn), h2 a { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--ink) 35%, transparent); text-underline-offset: 3px; }
.side a, .top a, .brief-list a, a.kpi, a.btn { text-decoration: none; }
a:hover { text-decoration-color: var(--ink); }
::selection { background: var(--hl); color: var(--on-hl); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
h1 { font-size: clamp(2rem, 3.4vw, 2.9rem); line-height: .98; letter-spacing: -.03em; text-transform: none; margin-bottom: 6px; }
h2 { font-size: 1.02rem; letter-spacing: -.005em; }
.brief-h, .brief-view h3, .group-title { font-family: var(--chiffres); font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.project, .drop-cta, .todo, .empty-state { border-radius: var(--radius); box-shadow: none; text-decoration: none; }
.project { padding: 16px 18px 12px; } .project:hover { border-color: var(--ink); transform: none; box-shadow: 5px 5px 0 var(--hl); }
.project h3 { font-size: 1.18rem; letter-spacing: -.02em; text-transform: none; color: var(--ink); }
.drop-cta { background: var(--ink); color: var(--bg); } .drop-cta .rec { background: var(--hl); color: var(--on-hl); border-radius: 8px; box-shadow: none; animation: none; }
.section-title h2 { font-family: var(--chiffres); font-size: .74rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.section-title { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.head { align-items: flex-end; padding-bottom: 16px; margin-bottom: 20px; border-bottom: 2px solid var(--ink); }
.head .muted { margin: 0; }

/* marque : « EFFICIENCER » en petites capitales, le nom du logiciel en titre */
.brand { text-decoration: none; }
.top .brand, .side .brand { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 3px; line-height: 1; }
.top .brand::before, .side .brand::before { display: none; }
.ef-mark { font-family: var(--chiffres); font-size: .62rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.brand b { font-family: var(--titre); font-weight: 400; font-size: 1.12rem; letter-spacing: -.02em; color: var(--ink); }
.side .brand { padding: 2px 10px 18px; } .side .brand b { color: #fff; font-size: 1.5rem; } .side .ef-mark { color: var(--side-ink); }

/* Espace client : une barre pleine largeur, soulignée, onglets marqués au surligneur */
.top { position: sticky; top: 0; z-index: 40; padding: 0; background: var(--card); border-bottom: 1px solid var(--line); }
.top .in { max-width: 1240px; border: 0; border-radius: 0; box-shadow: none; background: transparent; padding: 10px 20px; gap: 18px; }
.top nav { gap: 2px; }
.top nav a { border-radius: 6px; padding: 7px 11px; font-weight: 600; font-size: .9rem; color: var(--muted); text-decoration: none; }
.top nav a:hover { color: var(--ink); background: var(--soft); }
.top nav a.on { background: transparent; color: var(--ink); box-shadow: inset 0 -3px 0 var(--hl), inset 0 -4px 0 var(--ink); border-radius: 0; }
.wrap { max-width: 1240px; padding-top: 30px; }

/* Régie : rail noir à gauche, barre du haut fine, contenu sur toute la largeur */
.shell { grid-template-columns: 224px 1fr; }
.side { padding: 18px 10px; border-right: 1px solid var(--side-line); }
.side a.nav { border-radius: 6px; padding: 7px 10px; font-weight: 500; font-size: .9rem; text-decoration: none; color: var(--side-ink); }
.side a.nav:hover { background: var(--side-line); color: #fff; }
.side a.nav.on { background: var(--hl); color: var(--on-hl); font-weight: 700; }
.side .sep { font-size: .62rem; letter-spacing: .2em; opacity: 1; color: #6f6f69; padding: 18px 10px 6px; border-top: 1px solid var(--side-line); margin-top: 10px; }
.side .btn.ghost { color: #fff; border-color: #3a3a38; background: transparent; }
.side .btn.ghost:hover { border-color: #fff; background: transparent; }
.main { max-width: none; padding: 0 clamp(18px, 2.6vw, 40px) 70px; }
.ef-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; margin: 0 calc(-1 * clamp(18px, 2.6vw, 40px)) 26px;
  padding: 9px clamp(18px, 2.6vw, 40px); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.ef-grow { flex: 1; }
.ef-bar-link { font-size: .86rem; font-weight: 600; text-decoration: none; color: var(--muted); } .ef-bar-link:hover { color: var(--ink); }
.ef-bar .presence-switch { margin: 0; padding: 0; }
.presence-switch { display: inline-flex; gap: 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--card); }
.presence-switch button { border: 0; border-radius: 0; background: transparent; color: var(--muted); font: 600 .8rem/1 var(--texte); padding: 8px 12px; cursor: pointer; }
.presence-switch button + button { border-left: 1px solid var(--line); }
.presence-switch button:hover { color: var(--ink); }
.presence-switch button.on { background: var(--ink); color: var(--bg); }
.presence-switch button.on[value="online"] { background: var(--ok); color: #fff; } .presence-switch button.on[value="busy"] { background: var(--warn); color: #fff; }
.flash { top: 54px; }

/* bascule clair / sombre */
.ef-theme { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; flex: none; }
.ef-theme:hover { border-color: var(--ink); }
.ef-theme svg { transition: transform .35s cubic-bezier(.3, 1.4, .5, 1); } :root[data-theme="dark"] .ef-theme svg { transform: rotate(180deg); }
.ef-float { position: fixed; top: 14px; right: 14px; z-index: 50; }

/* composants : filets, angles nets, noir plein pour l'action principale */
.card { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: none; padding: 18px 20px; background: var(--card); }
.card > h2:first-child { padding-bottom: 10px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.kpi { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: none; background: var(--card); padding: 14px 16px; }
.kpi b { font-size: 1.9rem; letter-spacing: -.03em; } .kpi span { font-family: var(--chiffres); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.btn { border-radius: 8px; padding: 9px 16px; font-weight: 700; background: var(--brand); color: var(--on-brand); border: 1px solid var(--brand); box-shadow: none; text-decoration: none; transition: background .12s ease, color .12s ease, transform .08s ease; }
.btn:hover { background: var(--hl); color: var(--on-hl); border-color: var(--ink); text-decoration: none; }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); } .btn.ghost:hover { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn.sm { padding: 5px 11px; font-size: .84rem; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; box-shadow: none; } .btn.danger { background: transparent; color: var(--err); border-color: var(--err); box-shadow: none; }
.btn.danger:hover { background: var(--err); color: #fff; border-color: var(--err); }
.badge { border-radius: 4px; font-family: var(--chiffres); font-size: .66rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 3px 7px; }
.note { border-radius: 8px; border: 1px solid transparent; border-left: 3px solid currentColor; padding: 10px 14px; }
.note a { color: inherit; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=search], input[type=url], select, textarea {
  border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); padding: 9px 11px; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: 0; box-shadow: 0 0 0 3px var(--hl); }
label { font-size: .86rem; }
table th { font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--ink); }
table td { border-bottom: 1px solid var(--line); }
details > summary { cursor: pointer; font-weight: 600; }
.formula { border-width: 1px; border-radius: var(--radius); } .formula:has(input:checked) { border-color: var(--ink); background: var(--card); box-shadow: inset 0 0 0 2px var(--ink), 6px 6px 0 var(--hl); }
.brief-chip span { border-radius: 6px; }
.chat-count { background: var(--tally); color: #fff; }
.side a.nav.on .chat-count { background: var(--ink); color: #fff; }

/* piste d'avancement : segments noirs, tête de lecture au surligneur */
.track i, .track span { border-radius: 2px; }

/* ---------- ouverture : le nom s'écrit, un trait de surligneur passe, le rideau se lève (une fois par session) */
html.ef-boot body::before { content: attr(data-brand); position: fixed; inset: 0; z-index: 999; display: grid; place-items: center; background: #0c0c0c; color: #f3f3ef;
  font: 400 clamp(2.2rem, 7vw, 5.2rem)/1 var(--titre); letter-spacing: -.04em; text-transform: uppercase; animation: ef-curtain 1.3s cubic-bezier(.7, 0, .2, 1) forwards; }
html.ef-boot body::after { content: attr(data-app); position: fixed; left: 50%; top: calc(50% + clamp(1.8rem, 5vw, 3.6rem)); z-index: 1000; transform: translateX(-50%);
  padding: 4px 12px; background: #e8ff3a; color: #0c0c0c; font: 600 .78rem/1.2 var(--chiffres); letter-spacing: .24em; text-transform: uppercase; white-space: nowrap;
  animation: ef-tag 1.3s cubic-bezier(.7, 0, .2, 1) forwards; }
html.ef-boot body[data-app=""]::after { display: none; }
@keyframes ef-curtain { 0% { clip-path: inset(0 0 0 0); letter-spacing: .12em; opacity: 1; } 45% { letter-spacing: -.04em; } 70% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(0 0 100% 0); letter-spacing: -.04em; } }
@keyframes ef-tag { 0%, 25% { clip-path: inset(0 100% 0 0); opacity: 1; } 55% { clip-path: inset(0 0 0 0); } 70% { opacity: 1; } 85%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { html.ef-boot body::before, html.ef-boot body::after { display: none; } .ef-theme svg { transition: none; } }
@media print { .ef-bar, .ef-float, .ef-theme { display: none !important; } }
@media (max-width: 860px) { .ef-bar { position: static; flex-wrap: wrap; } .top { position: static; } }

/* mot de passe : bouton « Afficher » dans le champ */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 92px; }
.pw-show { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--soft); color: var(--ink);
  font: 600 .74rem/1 var(--texte); cursor: pointer; }
.pw-show:hover { border-color: var(--ink); } .pw-show[aria-pressed="true"] { background: var(--hl); color: var(--on-hl); border-color: var(--ink); }

/* offre « tarif de base » : rappel que le reste se chiffre au devis */
.quote-card { display: flex; gap: 14px; align-items: center; margin: 14px 0 6px; padding: 16px 18px; border: 1px dashed var(--ink); border-radius: var(--radius); background: var(--card); }
.quote-card b { display: block; font-family: var(--titre); font-weight: 400; font-size: 1.05rem; margin-bottom: 3px; }
.quote-card span { color: var(--muted); font-size: .9rem; }

/* Grille tarifaire : les tarifs en clair, les anciennes formules repliées */
.tarif-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; }
.tarif-grid > div { display: grid; gap: 4px; padding: 16px 18px; border-right: 1px solid var(--line); }
.tarif-grid > div:last-child { border-right: 0; }
.tarif-label { font: 600 .68rem/1 var(--chiffres); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.tarif-grid b { font: 400 2rem/1.05 var(--titre); letter-spacing: -.03em; }
.show-old { position: absolute; opacity: 0; }
.show-old-label { display: inline-block; margin: 0 0 16px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: .86rem; font-weight: 600; cursor: pointer; }
.show-old-label::before { content: "+ "; } .show-old:checked + .show-old-label::before { content: "− "; }
.show-old:focus-visible + .show-old-label { outline: 2px solid var(--ink); outline-offset: 2px; }
.show-old:not(:checked) ~ .card tr[data-retired] { display: none; }
