/* Oarva Studio. Polices hébergées ici (licence SIL OFL 1.1, voir fonts/OFL-*.txt) : aucune requête vers l'extérieur.
   Aucun style en ligne dans les pages (CSP style-src 'self') : tout passe par des classes de ce fichier. */
@font-face { font-family: "Instrument Sans"; font-weight: 400; font-display: swap; src: url("../fonts/instrument-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 500; font-display: swap; src: url("../fonts/instrument-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-weight: 600; font-display: swap; src: url("../fonts/instrument-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Newsreader"; font-weight: 600; font-display: swap; src: url("../fonts/newsreader-latin-600-normal.woff2") format("woff2"); }

:root {
  --bg: #FFFFFF; --side: #F7F7F5; --surface: #FFFFFF; --surface-2: #F7F6F3; --hover: #EFEFEC; --active: #EAE9E6;
  --border: #E9E8E5; --border-soft: #F1F0EE; --text: #2F2E2B; --muted: #6F6E69; --faint: #8E8D88; --ink: #2F2E2B; --on-ink: #FFFFFF;
  --accent: #2F6FC9; --accent-strong: #1F4F94; --accent-soft: #E7EFFA;
  --green: #2F6440; --green-soft: #E8F1EA; --warn: #8A5212; --warn-soft: #FAF1E6; --red: #A13E2B; --red-soft: #FBECE9;
  --purple: #5B4290; --purple-soft: #F0EBF7; --dot-on: #3B7A4E; --dot-off: #B04632;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
/* Thème sombre : seulement si le client le choisit (bouton du menu du compte) ; clair par défaut. */
:root[data-theme="nuit"] {
  --bg: #1C1B19; --side: #222120; --surface: #232220; --surface-2: #2A2926; --hover: #2F2E2B; --active: #353431;
  --border: #3A3935; --border-soft: #302F2C; --text: #ECEAE5; --muted: #ABA9A2; --faint: #8C8A84; --ink: #ECEAE5; --on-ink: #1C1B19;
  --accent: #8DB4EA; --accent-strong: #B5CEF2; --accent-soft: #24303F;
  --green: #9CCBA8; --green-soft: #213026; --warn: #E3B07A; --warn-soft: #382C1E; --red: #EBA394; --red-soft: #3B2420;
  --purple: #C3B2E6; --purple-soft: #2D2639; --dot-on: #7FB08E; --dot-off: #E08A78;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ─── Boutons, champs, pastilles ─── */
.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 13px; font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.btn-primary:hover { background: var(--ink); filter: brightness(1.15); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn[disabled] { opacity: .55; cursor: default; }
.field { display: block; margin: 0 0 14px; }
.field > span { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.code { font-size: 20px; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.chip { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 4px; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.blue { background: var(--accent-soft); color: var(--accent-strong); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.purple { background: var(--purple-soft); color: var(--purple); }
.note { padding: 10px 14px; border-radius: 8px; background: var(--surface-2); color: var(--muted); font-size: 13px; }
.note.err { background: var(--red-soft); color: var(--red); }
.note.ok { background: var(--green-soft); color: var(--green); }

/* ─── Connexion ─── */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.login-form { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(20px, 6vw, 88px); }
.login-form .login-card { width: 100%; max-width: 380px; }
.login-side { background: var(--side); border-left: 1px solid var(--border); display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(24px, 6vw, 80px); }
.login-side h2 { font-family: var(--serif); font-weight: 600; font-size: 30px; line-height: 1.2; margin: 0 0 14px; letter-spacing: -.3px; }
.login-side ul { margin: 20px 0 0; padding: 0 0 0 18px; color: var(--muted); }
.login h1 { font-family: var(--serif); font-weight: 600; font-size: 30px; margin: 22px 0 4px; letter-spacing: -.3px; }
.login .lead { color: var(--muted); margin: 0 0 24px; }
.login .actions { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.login .actions .btn { height: 42px; font-size: 14px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font-size: 13px; text-align: left; }
@media (max-width: 760px) { .login { grid-template-columns: 1fr; } .login-side { display: none; } }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }
.brand img { width: 26px; height: 26px; border-radius: 7px; }
.brand .studio { color: var(--muted); font-weight: 500; }

/* ─── Coquille de l'application ─── */
.shell { display: flex; min-height: 100vh; }
.side { width: 248px; flex: none; background: var(--side); border-right: 1px solid var(--border); display: flex; flex-direction: column;
  gap: 2px; padding: 16px 10px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { padding: 4px 8px 14px; }
.org { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 0 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.ini { width: 26px; height: 26px; border-radius: 6px; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; background: var(--accent-soft); color: var(--accent-strong); }
.org b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org small { display: block; font-size: 12px; color: var(--muted); }
.nav-label { font-size: 12px; font-weight: 500; color: var(--faint); padding: 14px 10px 4px; }
.nav { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; min-height: 34px; border: 0; border-radius: 6px;
  background: transparent; color: var(--text); font-size: 14px; text-align: left; }
.nav:hover { background: var(--hover); }
.nav.on { background: var(--active); font-weight: 600; }
.nav svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.nav .grow { flex: 1; }
.nav .soon { font-size: 11px; color: var(--faint); }
.badge { font-size: 12px; font-weight: 600; min-width: 18px; text-align: center; padding: 0 6px; border-radius: 4px; background: var(--warn-soft); color: var(--warn); }
.badge:empty { display: none; }
.side .spacer { flex: 1; min-height: 16px; }
.me { position: relative; }
.me-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; min-height: 48px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); text-align: left; }
.me-btn:hover { background: var(--hover); }
.me-btn .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; flex: none; }
.me-btn b { display: block; font-size: 13px; }
.me-btn small { display: block; font-size: 12px; color: var(--muted); }
.menu { position: absolute; left: 0; right: 0; bottom: 56px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.12); padding: 6px; z-index: 20; }
.menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--border-soft); margin-bottom: 4px; }
.menu button { display: flex; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; font-size: 13px; text-align: left; }
.menu button:hover { background: var(--hover); }
.menu .danger { color: var(--red); }

.main { flex: 1; min-width: 0; padding: 28px 44px 56px; }
.head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.head .titles { flex: 1; min-width: 260px; }
.head h1 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 34px; line-height: 1.15; letter-spacing: -.3px; }
.head .sub { font-size: 14px; color: var(--muted); margin-top: 4px; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; }
.pill:hover { background: var(--hover); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dot-on); flex: none; }
.dot.off { background: var(--dot-off); }
.dot.gray { background: var(--faint); }
.burger { display: none; }
@media (max-width: 900px) {
  .side { position: fixed; z-index: 30; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.15); }
  .side.open { transform: none; }
  .main { padding: 18px 16px 40px; }
  .burger { display: inline-flex; }
  .head h1 { font-size: 28px; }
}

/* ─── Contenu ─── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; }
.stat .label { font-size: 13px; color: var(--muted); }
.stat .value { font-size: 28px; font-weight: 600; letter-spacing: -.5px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .hint { font-size: 13px; color: var(--muted); }
.cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.cols > .wide { flex: 999 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.cols > .narrow { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.card { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border-soft); }
.card-head h2 { margin: 0; font-size: 15px; font-weight: 600; flex: 1; }
.card-body { padding: 16px 18px; }
.row { display: flex; gap: 14px; align-items: flex-start; width: 100%; padding: 12px 18px; border: 0; border-bottom: 1px solid var(--border-soft);
  background: transparent; text-align: left; }
.row:last-child { border-bottom: 0; }
button.row:hover { background: var(--surface-2); }
.row .grow { flex: 1; min-width: 0; }
.row .title { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-weight: 600; }
.row .text { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.row .when { font-size: 12px; color: var(--faint); white-space: nowrap; }
.icon-box { width: 30px; height: 30px; border-radius: 8px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--muted); }
.icon-box.warn { background: var(--warn-soft); color: var(--warn); }
.icon-box.blue { background: var(--accent-soft); color: var(--accent-strong); }
.icon-box.green { background: var(--green-soft); color: var(--green); }
.icon-box svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.empty { padding: 28px 18px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); margin-bottom: 4px; }
.side-card { border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; background: var(--surface-2); }
.side-card h2 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }

/* Onglets */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab { border: 0; background: none; padding: 10px 12px; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); font-weight: 600; border-bottom-color: var(--ink); }
.tab .soon { font-size: 11px; color: var(--faint); margin-left: 4px; }

/* Modules */
.mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.mod { border: 1px solid var(--border); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.mod h3 { margin: 0; font-size: 15px; font-weight: 600; }
.mod p { margin: 0; color: var(--muted); font-size: 13px; }
.mod .foot { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }

/* Choix (vouvoiement) */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.choice { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; text-align: left; background: var(--surface); }
.choice:hover { background: var(--surface-2); }
.choice.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.choice b { display: block; margin-bottom: 4px; }
.choice q { display: block; color: var(--muted); font-size: 13px; quotes: "« " " »"; }
.choice[disabled] { cursor: default; }

/* Tableau simple */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); padding: 10px 18px; border-bottom: 1px solid var(--border-soft); }
.table td { padding: 12px 18px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Conversations */
.split { display: grid; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }
.row.sel { background: var(--surface-2); }
.thread { display: flex; flex-direction: column; gap: 12px; padding: 18px; }
.msg { max-width: 80%; padding: 10px 14px; border-radius: 12px; white-space: pre-wrap; word-wrap: break-word; }
.msg.user { align-self: flex-end; background: var(--accent-soft); color: var(--text); border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.msg .meta { display: block; font-size: 11px; color: var(--faint); margin-top: 4px; }
.msg .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

/* À traiter */
.todo { padding: 14px 18px; border-bottom: 1px solid var(--border-soft); }
.todo:last-child { border-bottom: 0; }
.todo-main { display: flex; gap: 14px; align-items: flex-start; }
.todo-main .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.todo-main .title { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-weight: 600; }
.todo-main .text.full { color: var(--text); }
.todo-main .when { font-size: 12px; color: var(--faint); white-space: nowrap; }
.todo-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0 0 44px; }
.todo-actions .grow { flex: 1 1 220px; min-width: 160px; }
.inline-field { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.input-sm { height: 32px; font-size: 13px; padding: 0 10px; }
select.input { width: auto; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; }
.filters .grow { flex: 1 1 240px; }

/* Journal */
details.jr { border-bottom: 1px solid var(--border-soft); }
details.jr:last-child { border-bottom: 0; }
details.jr > summary { display: flex; gap: 14px; align-items: flex-start; padding: 12px 18px; cursor: pointer; list-style: none; }
details.jr > summary::-webkit-details-marker { display: none; }
details.jr > summary:hover { background: var(--surface-2); }
details.jr .grow { flex: 1; min-width: 0; }
details.jr .title { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-weight: 600; }
details.jr .text { display: block; color: var(--muted); font-size: 13px; }
details.jr .when { font-size: 12px; color: var(--faint); white-space: nowrap; }
.events { margin: 0; padding: 0 18px 12px 32px; font-size: 13px; }
.events li { margin: 4px 0; }
.jr-reason { margin: 0; padding: 0 18px 12px 18px; }

/* Choix du niveau d'un module */

/* Module autonome + avertissement « Seul » */
.mod.auto { border-color: var(--warn); }
.dlg { border: 1px solid var(--border); border-radius: 12px; padding: 22px 24px; width: min(560px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.dlg::backdrop { background: rgba(0,0,0,.4); }
.dlg h2 { font-family: var(--serif); font-weight: 600; font-size: 22px; line-height: 1.25; margin: 12px 0 8px; }
.dlg p { margin: 0 0 10px; }
.dlg ul { margin: 0 0 14px; padding-left: 18px; color: var(--muted); }
.dlg li { margin: 4px 0; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; background: var(--warn-soft); font-size: 13px; cursor: pointer; }
.check input { margin-top: 2px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.btn-warn { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn-warn:hover { background: var(--warn); filter: brightness(1.1); }
:root[data-theme="nuit"] .btn-warn { color: #1C1B19; }

/* Documents */
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.file-btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.drop-hint { display: none; padding: 26px 18px; text-align: center; color: var(--accent-strong); background: var(--accent-soft); border-top: 1px dashed var(--accent); font-weight: 500; }
#docs-card.dragging .drop-hint { display: block; }
#docs-card.dragging { border-color: var(--accent); }
.err-text { color: var(--red); margin-top: 2px; }
textarea.input.area { height: auto; min-height: 180px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.dlg .field input, .dlg .field textarea { width: 100%; }

/* Bibliothèque */
.section-title { font-size: 17px; font-weight: 600; margin: 28px 0 4px; }
.mod.lib { background: var(--surface-2); }
.mod-del { margin-left: auto; font-size: 12px; color: var(--muted); }
.mod-del:hover { color: var(--red); }

/* Bientôt */
.soon-page { max-width: 560px; padding: 36px 0; }
.soon-page h2 { font-family: var(--serif); font-weight: 600; font-size: 24px; margin: 0 0 8px; }

/* Notification */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--on-ink); padding: 10px 16px; border-radius: 8px; font-size: 13px; z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.toast.err { background: var(--red); color: #fff; }
.loading { padding: 40px 0; color: var(--muted); }
/* Espacement entre blocs empilés dans une page */
#page > * + * { margin-top: 20px; }

/* Invitation et sécurité du compte : code QR, codes de secours */
.steps { font-size: 12px; font-weight: 600; color: var(--accent-strong); margin: 22px 0 -14px; text-transform: uppercase; letter-spacing: .06em; }
.qr { display: flex; justify-content: center; padding: 14px; margin: 4px 0 14px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.qr img { width: 200px; height: 200px; image-rendering: pixelated; }
.secret { display: inline-block; font-size: 15px; letter-spacing: .04em; padding: 6px 10px; border-radius: 6px; background: var(--surface-2); word-break: break-all; }
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; list-style: none; padding: 0; margin: 0 0 14px; }
.codes li { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; white-space: nowrap; text-align: center; padding: 8px; border-radius: 6px; background: var(--surface-2); }
.row-actions { flex-direction: row !important; margin-bottom: 12px; }
.login .check { margin: 6px 0 10px; }
details.small summary { cursor: pointer; color: var(--accent); margin-bottom: 6px; }

.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; align-items: start; }
.account-grid .card-body .btn { margin-top: 2px; }
.copy-row { display: flex; gap: 8px; margin: 6px 0 10px; }
.copy-row .input { flex: 1; font-size: 13px; }
.dlg-sm { width: min(440px, calc(100vw - 32px)); }
.dlg-sm h2 { font-size: 20px; }
.dlg-sm p { color: var(--muted); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: var(--red); filter: brightness(1.1); }
:root[data-theme="nuit"] .btn-danger { color: #1C1B19; }
.dlg[open] { animation: dlg-in .14s ease-out; }
.dlg::backdrop { animation: fade-in .14s ease-out; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dlg[open], .dlg::backdrop { animation: none; } }

/* ─── Lot 5 : rapport, mes données, support, aide ─── */
.badge.blue { background: var(--accent-soft); color: var(--accent-strong); }
.chart { display: block; width: 100%; height: auto; max-height: 220px; margin-bottom: 8px; }
.chart .bar { fill: var(--accent); }
.chart .hit { fill: transparent; }
.chart .bar-hit:hover .bar { fill: var(--accent-strong); }
.chart .bar-hit:hover .hit { fill: var(--surface-2); }
.chart .axis { stroke: var(--border); stroke-width: 1; }
.chart .grid { stroke: var(--border-soft); stroke-width: 1; stroke-dasharray: 3 4; }
.chart .tick { fill: var(--muted); font-size: 9px; text-anchor: middle; font-family: var(--sans); }
.chart .tick.start { text-anchor: start; }
.table.compact td { padding: 4px 18px 4px 0; border: 0; }
.score { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.score .big { font-family: var(--serif); font-size: 52px; font-weight: 600; line-height: 1; letter-spacing: -1px; }
.score .big small { font-size: 22px; color: var(--faint); }
.score .grow { flex: 1 1 260px; }
.score p { margin: 8px 0 0; font-size: 14px; }
.meter { height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; margin-top: 12px; }
.meter i { display: block; height: 100%; background: var(--green); border-radius: 999px; }
.meter i.w0 { width: 0%; }
.meter i.w5 { width: 5%; }
.meter i.w10 { width: 10%; }
.meter i.w15 { width: 15%; }
.meter i.w20 { width: 20%; }
.meter i.w25 { width: 25%; }
.meter i.w30 { width: 30%; }
.meter i.w35 { width: 35%; }
.meter i.w40 { width: 40%; }
.meter i.w45 { width: 45%; }
.meter i.w50 { width: 50%; }
.meter i.w55 { width: 55%; }
.meter i.w60 { width: 60%; }
.meter i.w65 { width: 65%; }
.meter i.w70 { width: 70%; }
.meter i.w75 { width: 75%; }
.meter i.w80 { width: 80%; }
.meter i.w85 { width: 85%; }
.meter i.w90 { width: 90%; }
.meter i.w95 { width: 95%; }
.meter i.w100 { width: 100%; }
.list { margin: 6px 0 12px; padding-left: 18px; font-size: 13px; }
.list li { margin: 4px 0; }
.side-card .btn { margin-top: 4px; }
.filters .grow { flex: 1; }
.reply { border-top: 1px solid var(--border-soft); }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
textarea.input.area.short { min-height: 90px; }
.help { display: flex; flex-direction: column; gap: 10px; max-width: 820px; }
#page .help > * + * { margin-top: 0; }
.help-item > summary { list-style: none; cursor: pointer; padding: 14px 18px; }
.help-item > summary::-webkit-details-marker { display: none; }
.help-item > summary h2 { margin: 0; font-size: 15px; font-weight: 600; display: flex; justify-content: space-between; }
.help-item > summary h2::after { content: "+"; color: var(--faint); font-weight: 400; }
.help-item[open] > summary h2::after { content: "–"; }
.help-item[open] > summary { border-bottom: 1px solid var(--border-soft); }
.help-item .card-body p { margin: 0 0 10px; }
.help-item .card-body p:last-child { margin-bottom: 0; }
.print-only { display: none; }
@media print {
  .side, .head .pill, .burger, .no-print, .toast { display: none !important; }
  .main { padding: 0; }
  .print-only { display: block; }
  .card, .stat, .side-card { break-inside: avoid; }
}

/* ─── Lot 6 : branchements, tests, parler à l'agent ─── */
.integ-top { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; }
.integ-top h3 { flex: 1; }
.side-card.cta { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.side-card.cta .grow { flex: 1 1 260px; }
.side-card.cta h2 { margin-bottom: 2px; }
.jr-body { padding: 0 18px 14px; }
.jr-body .msg { max-width: 100%; }
.try .thread { min-height: 260px; max-height: 52vh; overflow-y: auto; }
.try-note { margin: 14px 18px 0; }
.try-form { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border-soft); }
.try-form .input { flex: 1; }
.try-left { margin: 0; padding: 0 18px 12px; }
.msg.pending { color: var(--muted); font-style: italic; }
.chips { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.chip-btn { height: auto; min-height: 34px; padding: 6px 10px; white-space: normal; text-align: left; justify-content: flex-start; line-height: 1.35; }
.dlg-actions.wrap { flex-wrap: wrap; }

/* ─── Modules : « Seul » pas possible, configurer, sur mesure ─── */
.mod-cfg { margin-left: auto; font-size: 12px; }
.mod-cfg + .mod-del { margin-left: 8px; }
.lib-tabs { margin: 6px 0 14px; }
.custom-card { border-style: dashed; background: var(--surface); }
.dlg .cfg-fields { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-direction: column; gap: 8px; }
.cfg-fields li { display: flex; gap: 10px; align-items: center; }
.cfg-fields li .input { flex: 1; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .two-cols { grid-template-columns: 1fr; } }

/* ─── Mon agent → Modules, au style de la maquette ─── */
.section-title.first { margin-top: 4px; }
.section-row { display: flex; align-items: baseline; gap: 12px; margin: 28px 0 10px; }
.section-row .section-title { margin: 0; flex: 1; }
.section-row.first { margin-top: 4px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg-btn { border: 0; background: var(--surface); padding: 5px 10px; font-size: 12px; color: var(--muted); border-right: 1px solid var(--border); }
.seg-btn:last-child { border-right: 0; }
.seg-btn:hover { background: var(--hover); }
.seg-btn.on { background: var(--ink); color: var(--on-ink); font-weight: 600; }
.seg-btn[disabled] { cursor: default; }
.seg-btn.na { color: var(--faint); background: var(--surface-2); text-decoration: line-through; text-decoration-color: var(--border); cursor: help; }
.seg-btn.na:hover { background: var(--hover); color: var(--muted); }
.mod.add { border-style: dashed; background: var(--surface); align-items: center; justify-content: center; gap: 4px; min-height: 170px; cursor: pointer; font: inherit; color: var(--text); }
.mod.add:hover { background: var(--hover); }
.mod.add .plus { font-size: 26px; line-height: 1; }
.mod.add span:last-child { font-size: 12px; color: var(--muted); }
.note.warn-note { background: var(--warn-soft); color: var(--warn); margin-bottom: 12px; }
.levels-note { margin-top: 14px; color: var(--text); }
.levels-note .tiny { margin-top: 6px; }
/* Bibliothèque en fenêtre */
.dlg-lg { width: min(900px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
.lib-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.lib-head h2 { flex: 1; margin: 4px 0; }
.fchips { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 14px; }
.fchip { height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 13px; }
.fchip:hover { background: var(--hover); }
.fchip.on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.lib-card { border: 1px solid var(--border); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); }
.lib-card p { margin: 0; flex: 1; font-size: 13px; color: var(--muted); }
.lib-card .btn { margin-top: 6px; }
.lib-card.custom { border-style: dashed; }
.lib-has { color: var(--muted); }
.dlg-actions .grow { flex: 1; }
.danger-link { color: var(--red); font-size: 13px; }
.mchips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }

/* ─── Pages des modules ─── */
.page-intro { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.page-intro p { margin: 0; color: var(--muted); font-size: 14px; flex: 1 1 320px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; margin: 8px 0 0; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
