/* =====================================================================
   Studio : les pages. Chaque bloc porte le nom de la page ou de la fonction qu'il habille.
   Les jetons, les composants communs et l'enveloppe sont dans style.css.
   ===================================================================== */

body.member .admin-only { display: none !important; }

/* ---------- Connexion ---------- */
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, 440px); gap: clamp(32px, 6vw, 96px); align-items: center; padding: clamp(24px, 6vw, 96px); }
.login-story { display: flex; flex-direction: column; gap: 22px; align-items: flex-start; }
.login-story h1 { font-size: clamp(44px, 6.4vw, 88px); }
.login-orbs { display: flex; gap: 12px; margin-top: 8px; }
.login-orbs span { width: 46px; height: 46px; border-radius: 50%; background: var(--c); animation: floaty 6s ease-in-out infinite; }
.login-orbs span:nth-child(2) { animation-delay: 0.6s; } .login-orbs span:nth-child(3) { animation-delay: 1.2s; } .login-orbs span:nth-child(4) { animation-delay: 1.8s; } .login-orbs span:nth-child(5) { animation-delay: 2.4s; } .login-orbs span:nth-child(6) { animation-delay: 3s; }
.login-card { display: flex; flex-direction: column; gap: 4px; padding: 34px; border-radius: 34px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--lift); animation: rise 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
.login-card h2 { font: 700 30px/1.1 var(--display); letter-spacing: -0.03em; margin-top: 8px; }
.login-card > p { color: var(--muted); }
.login-card .primary { margin-top: 22px; }
.login-card small, .login-help { font-size: 13px; color: var(--muted); line-height: 1.5; margin-top: 6px; }
#login-error, #invite-error { color: var(--bad); font-weight: 650; font-size: 14px; min-height: 20px; margin-top: 10px; }
@media (max-width: 860px) { .login-shell { grid-template-columns: 1fr; padding: 24px 16px; gap: 28px; } }

/* ---------- Accueil : la zone de lancement ---------- */
.hero { display: flex; flex-wrap: wrap; gap: 24px 36px; align-items: flex-start; padding: 6px 0 44px; }
.hero-left { flex: 1 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.hero-right { flex: 0 1 400px; min-width: 0; margin: 0 auto; }
.composer { position: relative; padding: 26px; display: flex; flex-direction: column; gap: 18px; border-radius: 34px; box-shadow: 0 2px 6px oklch(0.3 0.05 285 / 0.08), 0 34px 64px -26px oklch(0.5 0.2 285 / 0.55); margin-top: 10px; }
.composer::before { content: ""; position: absolute; inset: -7px; border-radius: 40px; border: 2px solid var(--c); opacity: 0.2; pointer-events: none; animation: halo 3.4s ease-in-out infinite; }
.composer-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.mode-hint { font-size: 15px; color: var(--muted); }
.composer .field { width: 100%; border: 0; background: transparent; resize: none; box-shadow: none; font: 500 23px/1.4 var(--display); letter-spacing: -0.015em; color: var(--ink); min-height: 84px; padding: 0; border-radius: 0; }
.composer .field:focus { box-shadow: none; }
.composer .field:focus-visible { outline: none; }
.composer:focus-within::before { opacity: 0.55; }
.composer #mission-form { display: flex; flex-direction: column; gap: 18px; }
.composer #mission-templates { gap: 6px; }
.composer #mission-templates .eyebrow { font-size: 14px; margin-right: 4px; }
.composer #mission-templates .chip { min-height: 38px; font-size: 14px; }
.ribbon { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 8px 8px 14px; border-radius: 99px; background: var(--c-soft); color: var(--c-ink); font-size: 15px; align-self: flex-start; animation: pop 0.5s cubic-bezier(0.3, 1.4, 0.5, 1) backwards; }
.ribbon svg.i { width: 18px; height: 18px; }
.ribbon .linklike { min-height: 36px; font-size: 14px; }
.step-prompt { display: flex; flex-direction: column; gap: 10px; }
.step-engine, #project-step { display: flex; flex-direction: column; gap: 8px; }
.picks { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 -6px; }
.pick { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 82px; padding: 10px 6px 8px; border-radius: 22px; border: 2px solid transparent; background: transparent; transition: background 0.2s, border-color 0.2s, transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1); }
.pick:hover:not(:disabled) { background: var(--soft); transform: translateY(-3px); }
.pick .av { transition: transform 0.3s cubic-bezier(0.3, 1.6, 0.5, 1); }
.pick:hover:not(:disabled) .av { transform: scale(1.08) rotate(-4deg); }
.pick-n { font-size: 14px; font-weight: 700; color: var(--muted); }
.pick.sel { border-color: var(--c); background: var(--c-soft); }
.pick.sel .pick-n { color: var(--c-ink); }
.pick.offline { opacity: 0.5; cursor: not-allowed; }
.pick-r { position: absolute; top: -9px; right: -2px; background: var(--c); color: var(--c-on); font-size: 12px; font-weight: 800; padding: 2px 10px; border-radius: 99px; }
.note { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--muted); padding: 12px 16px; border-radius: 18px; background: var(--soft); }
.trio-line { flex-wrap: wrap; }
.trio-line a { font-weight: 700; color: var(--c-ink); text-decoration: underline; text-underline-offset: 3px; }
.project-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.new-project { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px; border-radius: 20px; background: var(--soft); }
.new-project input { flex: 1 1 200px; }
.long-mission { display: flex; align-items: flex-start; gap: 12px; margin: 6px 0 0; padding: 14px 16px; border-radius: 18px; background: var(--soft); font-size: 14px; font-weight: 500; line-height: 1.5; color: var(--muted); }
.long-mission input { margin-top: 2px; }
.long-mission b { color: var(--ink); }
.opts { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; border-radius: 22px; background: var(--soft); animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
.opts .step-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 4px 14px; }
.opts .setting label { margin-top: 6px; }
.opts .field-help { margin-top: 4px; }
.opts label { margin: 10px 0 6px; }
.composer-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.foot-l { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.extras-summary { font-size: 14px; color: var(--muted); font-weight: 600; }
.go-wrap { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; margin-left: auto; }
.mission-help { margin: -4px 0 0; font-size: 14px; color: var(--muted); line-height: 1.4; }
.opts #mission-save-template { align-self: flex-start; margin-top: 8px; }
.go { transition: transform 0.2s, box-shadow 0.25s, background 0.4s; }
.go .i { transition: transform 0.3s; }
.go:hover:not(:disabled) .i { transform: translateX(4px); }
.launch-note { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 16px; border-radius: 18px; background: oklch(0.955 0.04 150); color: oklch(0.4 0.11 150); font-weight: 650; font-size: 15px; animation: pop 0.5s cubic-bezier(0.3, 1.4, 0.5, 1) backwards; }
.launch-note a { text-decoration: underline; text-underline-offset: 3px; }
.launch-error { margin: 0; }
.attachment-list { display: flex; flex-direction: column; gap: 10px; }
.attachment-item { display: flex; gap: 14px; padding: 12px; border-radius: 18px; background: var(--soft); align-items: flex-start; }
.attachment-item img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; flex: none; }
.attachment-doc { width: 72px; height: 72px; border-radius: 12px; background: var(--c-soft); color: var(--c-ink); display: grid; place-items: center; font-weight: 800; flex: none; }
.attachment-item > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.attachment-integrate { display: flex; gap: 10px; font-weight: 500; margin: 0; font-size: 13.5px; }
/* Selon le mode, certaines lignes n'ont pas de sens. */
.composer[data-mode="question"] #project-step, .composer[data-mode="question"] #composer-options, .composer[data-mode="question"] #options-toggle, .composer[data-mode="question"] #mission-templates,
.composer[data-mode="comparer"] #project-step, .composer[data-mode="comparer"] #composer-options, .composer[data-mode="comparer"] #options-toggle, .composer[data-mode="comparer"] #mission-templates,
.composer[data-mode="comparer"] #engine-cards, .composer[data-mode="comparer"] .step-extras .chip, .composer[data-mode="question"] .step-extras .chip { display: none; }
.composer[data-mode="question"] #composer-options, .composer[data-mode="comparer"] #composer-options { display: none; }
.composer[data-mode="comparer"] .step-engine .label { margin-bottom: 0; }
.composer[data-view="card"] #composer-modes, .composer[data-view="card"] #composer-hint, .composer[data-view="card"] #mission-templates { display: none; }
.composer[data-free="no"]:not([data-view="card"]) { display: none; }
.card-form { display: flex; flex-direction: column; gap: 6px; }
.card-usage { font-size: 16px; color: var(--muted); margin-bottom: 8px; }
.card-question { margin: 8px 0; }
.card-question label, .card-label { margin-top: 8px; }
.card-question input[type="file"] { margin-top: 4px; }
.chosen-files { margin: 8px 0; padding-left: 18px; list-style: disc; font-size: 14px; color: var(--muted); }
.card-engine-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.card-ready { margin: 10px 0 4px; padding: 14px 16px; border-radius: 18px; background: var(--soft); display: flex; flex-direction: column; gap: 6px; }
.card-ready .eyebrow { font-size: 13px; }
.ready-line { display: flex; gap: 10px; font-size: 14.5px; align-items: flex-start; }
.ready-line span:first-child { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: none; background: oklch(0.5 0.13 150); color: #fff; }
.ready-line.warn span:first-child { background: oklch(0.82 0.16 80); color: oklch(0.25 0.05 70); }
.card-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.card-help { color: var(--bad); }

/* Les moteurs en constellation */
.const { position: relative; width: 100%; max-width: 400px; aspect-ratio: 1 / 1; margin: 0 auto; }
.orb { position: absolute; border-radius: 50%; }
.orb.o1 { inset: 2%; border: 1.5px dashed var(--line); animation: spin 90s linear infinite; }
.orb.o2 { inset: 20%; border: 1.5px dashed var(--line); animation: spin 60s linear infinite reverse; }
.orb.o3 { inset: 33%; border: 12px solid var(--c-soft); opacity: 0.9; }
.ray { position: absolute; left: 50%; top: 50%; width: 38%; height: 3px; margin-top: -1.5px; transform-origin: 0 50%; border-radius: 3px; background: var(--line); transition: background 0.3s; }
.ray.on { background: repeating-linear-gradient(90deg, var(--c) 0 8px, transparent 8px 16px); background-size: 16px 3px; animation: flow 0.9s linear infinite; }
.core { position: absolute; left: 50%; top: 50%; width: 30%; aspect-ratio: 1 / 1; transform: translate(-50%, -50%); border-radius: 50%; background: var(--card); box-shadow: var(--shadow), 0 0 0 9px var(--c-soft); display: grid; place-content: center; text-align: center; z-index: 2; }
.core.busy::after { content: ""; position: absolute; inset: -16px; border-radius: 50%; border: 3px solid var(--c); animation: ping 1.6s ease-out infinite; }
.core-mark { font: 800 38px/1 var(--display); color: var(--c); transform: rotate(-6deg); }
.core-t { font-size: 13px; font-weight: 750; color: var(--muted); }
.node { position: absolute; width: 96px; margin: -28px 0 0 -48px; display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 3; animation: floaty 6s ease-in-out infinite; }
.node-n { font-size: 13px; font-weight: 750; padding: 2px 10px; border-radius: 99px; background: var(--card); box-shadow: var(--shadow); color: var(--ink); }
.node .av { box-shadow: 0 8px 18px -8px var(--c); transition: box-shadow 0.3s, transform 0.3s; }
.node.sel .av { box-shadow: 0 0 0 4px var(--bg), 0 0 0 7px var(--c), 0 14px 26px -10px var(--c); transform: scale(1.12); }
.node.off .av { filter: grayscale(1); opacity: 0.55; box-shadow: none; }
.const-cap { text-align: center; margin-top: 10px; font-size: 15px; font-weight: 650; color: var(--muted); }
.plan2 { margin-top: 18px; padding: 24px; }
.plan-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.eta { font-size: 14px; font-weight: 750; color: var(--muted); }
.plan-list { display: flex; flex-direction: column; gap: 16px; }
.plan-s { display: flex; align-items: flex-start; gap: 14px; font-size: 16px; color: var(--ink); }
.plan-n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 800; background: var(--card); color: var(--muted); border: 1.5px solid var(--line); flex: none; }
.plan-x { display: flex; flex-direction: column; gap: 2px; }
.plan-x b { font-weight: 700; line-height: 1.3; }
.plan-x small { font-size: 14px; line-height: 1.4; color: var(--muted); font-weight: 500; }

/* Modèles en tuiles, forfaits en ligne, à traiter, mémoire */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 16px; }
.tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; text-align: left; padding: 22px; min-height: 236px; border-radius: 28px; background: var(--c-soft); border: 2px solid transparent; color: var(--c-ink); transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s, border-color 0.2s; }
.tile:hover:not(:disabled) { transform: translateY(-6px); box-shadow: var(--lift); }
.tile.on { border-color: var(--c); }
.tile .glyph, .mcard .glyph { width: 58px; height: 58px; border-radius: 19px; display: grid; place-items: center; background: var(--c); color: var(--c-on); margin-bottom: 6px; transition: transform 0.45s cubic-bezier(0.3, 1.6, 0.5, 1); flex: none; }
.tile .glyph svg.i { width: 28px; height: 28px; }
.tile:hover:not(:disabled) .glyph { transform: rotate(-9deg) scale(1.12); }
.tile-t { font: 700 20px/1.15 var(--display); letter-spacing: -0.02em; color: var(--ink); }
.tile-p { font-size: 15px; line-height: 1.4; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.tile-m { margin-top: auto; font-size: 13px; font-weight: 750; color: var(--c-ink); }
.tile.dashed { background: transparent; border: 2px dashed var(--line); color: var(--muted); }
.tile.dashed .glyph { background: var(--c-soft); color: var(--c-ink); }
.tile.dashed:hover { border-color: var(--c); }
.tile.blocked { opacity: 0.6; }
.fr { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(176px, 100%), 1fr)); gap: 4px 0; padding: 10px 6px; border-radius: 30px; }
.fr-h { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-right: auto; }
.fr-i { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-width: 0; }
.fr-i + .fr-i { border-left: 1.5px solid var(--line); }
.fr-i .ring-box { width: 62px; max-width: 62px; flex: none; }
.fr-i .ring-n { font-size: 17px; }
.fr-i .ring-n small { font-size: 11px; }
.fr-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.fr-t b { font: 700 16px/1.25 var(--display); letter-spacing: -0.015em; }
.fr-t .fr-k { font-size: 14px; font-weight: 700; color: var(--c-ink, var(--ink)); }
.fr-t span { font-size: 13px; color: var(--muted); }
.fr .tile-empty { padding: 20px; }
/* Un relevé ancien (le fournisseur ne répond plus) : estompé, et sa ligne le dit. */
.fr-i.stale .ring-box, .fr-i.stale .fr-t b, .fr-i.stale .fr-k { opacity: 0.45; }
.fr-i.stale .fr-t span:last-child { color: var(--bad); font-weight: 700; }
.todo-m { display: none; flex-direction: column; gap: 8px; margin: 0 0 28px; }
.map-card { display: flex; flex-direction: column; }
.home-map { width: 100%; min-height: 150px; }
.home-map svg, .memory-map svg { width: 100%; height: auto; display: block; }
@media (max-width: 1180px) { .fr-i + .fr-i { border-left: 0; } }
@media (max-width: 920px) {
  .hero-right { flex-basis: 100%; }
  .const, .const-cap { display: none; }
  .todo-m { display: flex; }
  .composer { padding: 20px; }
  .go-wrap { margin-left: 0; width: 100%; }
  .go-wrap .go { width: 100%; }
  .composer-top .seg { width: 100%; flex-wrap: nowrap; }
  .composer-top .seg button { flex: 1 1 0; padding: 0 8px; }
  .picks { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 6px 6px 4px; }
  .pick { flex: none; }
}

/* ---------- Missions : le fil, le volet de suivi ---------- */
.masterdetail { align-items: flex-start; }
.history { padding: 22px; }
.history .template-chips { margin-bottom: 16px; }
.mission-row { margin-bottom: 10px; box-shadow: none; }
.mission-row.selected { border-color: var(--c); box-shadow: 0 0 0 4px var(--c-soft); }
.mission-row.status-running { background: var(--c-soft); border-color: transparent; }
.mission-row .badge { align-self: center; }
.detail { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 24px; border-radius: 28px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.detail { overflow-x: hidden; }
.detail > h3 { font: 700 26px/1.15 var(--display); letter-spacing: -0.025em; text-wrap: balance; }
.detail .badge { align-self: flex-start; max-width: 100%; white-space: normal; text-align: left; line-height: 1.35; }
.detail .section-top { margin-bottom: 0; }
.detail-attachments { display: flex; flex-direction: column; gap: 10px; }
.detail-attachments figure { margin: 0; }
.detail-attachments img { max-width: 100%; border-radius: 16px; display: block; }
.detail-attachments figcaption { font-size: 13px; color: var(--muted); margin-top: 4px; }
.detail-document { font-weight: 700; color: var(--c-ink); }
#events { display: flex; flex-direction: column; margin: 4px 0 0; padding: 0; position: relative; }
#events li { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 0 14px; padding: 0 0 18px 22px; position: relative; font-size: 15px; line-height: 1.45; }
#events li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--c); }
#events li::after { content: ""; position: absolute; left: 9px; top: 22px; bottom: -4px; width: 2.5px; border-radius: 2px; background: var(--line); }
#events li:last-child { padding-bottom: 0; }
#events li:last-child::after { display: none; }
#events time { font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 1px; }
#result { margin: 0; padding: 16px 18px; border-radius: 20px; background: var(--soft); font-size: 15px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
#result:empty { display: none; }
.detail-notes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); }
.detail-notes a { color: var(--c-ink); font-weight: 700; text-decoration: underline; }
.memorize { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--card); font-weight: 700; font-size: 14px; color: var(--ink); }
.memorize:hover { border-color: var(--c); }
.chain-box { padding: 16px 18px; border-radius: 20px; background: var(--soft); display: flex; flex-direction: column; gap: 10px; }
.chain-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.chain-line, .chain-reason { font-size: 14px; color: var(--muted); }
.chain-bar { height: 10px; border-radius: 99px; background: var(--card); overflow: hidden; }
.chain-bar span { display: block; height: 100%; background: var(--c); border-radius: inherit; transition: width 0.6s; }
.chain-steps, .chain-actions, .chain-resume { display: flex; flex-wrap: wrap; gap: 8px; }
.chain-resume { flex-direction: column; }
.chain-plan { white-space: pre-wrap; font-size: 13px; background: var(--card); padding: 12px; border-radius: 12px; overflow-x: auto; }
.chain-box details { font-size: 14px; }
.chain-box summary { cursor: pointer; font-weight: 700; min-height: 32px; }
.detail-card, .delivered, .share-box { display: flex; flex-direction: column; gap: 10px; }
.detail-card:empty { display: none; }
.detail-card-line { font-size: 14px; color: var(--muted); }
.detail-answers { font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.detail-checks { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.delivered { padding: 14px 16px; border-radius: 18px; background: var(--c-soft); }
.delivered-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.delivered-actions, .share-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (max-width: 920px) {
  .detail { position: fixed; inset: 0; z-index: 25; max-height: none; border-radius: 0; padding: 18px 16px 90px; }
  body:not(.drawer-open) .detail { display: none; }
}

/* ---------- Modèles ---------- */
.create { display: flex; flex-direction: column; gap: 14px; padding: 30px; border-radius: 34px; margin-bottom: 28px; }
.create-row { display: flex; flex-wrap: wrap; gap: 12px; }
.create-in { flex: 1 1 360px; min-height: 60px; padding: 0 24px; border-radius: 99px; font-size: 18px; }
.card-catalog { margin-bottom: 28px; }
.catalog-intro { margin-bottom: 14px; color: var(--muted); font-size: 16px; }
.mcard { display: flex; flex-direction: column; gap: 12px; padding: 24px; border-radius: 30px; background: var(--card); border: 1.5px solid var(--line); box-shadow: var(--shadow); transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s; }
.mcard:hover { transform: translateY(-5px); box-shadow: var(--lift); }
.mcard:hover .glyph { transform: rotate(-9deg) scale(1.1); }
.mcard .top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mcard-t { font: 700 21px/1.15 var(--display); letter-spacing: -0.02em; }
.mcard-p { font-size: 15px; color: var(--muted); line-height: 1.45; flex: 1; }
.mcard .foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.state, .card-state { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--muted); margin-right: auto; }
.card-state.ok { color: var(--good); }
.card-state.warn { color: oklch(0.5 0.12 70); }
.card-warn { color: var(--bad); font-size: 13.5px; font-weight: 600; }
.templates-panel { margin-top: 8px; }
.routine-card { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border-radius: 22px; background: var(--soft); margin-bottom: 12px; }
.routine-card > strong, .routine-head strong { font: 700 18px/1.25 var(--display); }
.routine-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.routine-card.paused { opacity: 0.7; }
#template-form, #routine-form, #project-form, #skill-form { margin-bottom: 22px; padding-bottom: 20px; border-bottom: 2px dashed var(--line); }
.routine-card small { font-size: 14px; color: var(--muted); }
.routine-description { font-size: 15px; }
.routine-prompt { font-size: 14px; color: var(--muted); background: var(--card); padding: 10px 14px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.routine-lines { display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: var(--muted); }
.routine-error { color: var(--bad); font-weight: 600; font-size: 14px; }
.routine-card .routine-actions { margin-top: 8px; }
.badge.on { background: var(--c-soft); color: var(--c-ink); }

/* ---------- Fabriquer un modèle ---------- */
.builder-section .ph { margin-bottom: 18px; }
.builder-draft { margin-bottom: 20px; }
.builder-inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.builder-inline input:not([type="checkbox"]) { flex: 1 1 280px; }
.builder-inline.skills { gap: 4px 18px; }
.builder-inline.skills .check-row { min-height: 40px; margin: 0; font-size: 14px; }
.builder-inline.skills input { flex: none; }
.builder-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: 24px; align-items: start; }
.builder-form { display: flex; flex-direction: column; gap: 18px; }
.builder-block { margin: 0 !important; }
.block-top { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 14px; }
.block-top b { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--c); color: var(--c-on); font-weight: 800; flex: none; align-self: center; }
.block-top h3 { font: 700 20px/1.2 var(--display); }
.block-top span { font-size: 13.5px; color: var(--muted); flex-basis: 100%; padding-left: 46px; margin-top: -6px; }
.builder-pair, .builder-quad { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.builder-radios { display: flex; flex-wrap: wrap; gap: 8px; }
.builder-radio { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 18px; border-radius: 20px; border: 2px solid var(--line); background: var(--card); text-align: left; min-width: 150px; }
.builder-radio.on { border-color: var(--c); background: var(--c-soft); }
.builder-radio small { color: var(--muted); font-weight: 500; }
.radio-label { font-weight: 700; }
.question-rows { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.question-row { padding: 14px; border-radius: 20px; background: var(--soft); display: flex; flex-direction: column; gap: 8px; }
.question-main { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px 14px; align-items: center; }
.question-main > input { grid-column: 1 / -1; }
.question-main .check-row { margin: 0; min-height: 40px; font-size: 14px; }
.question-tools { display: flex; gap: 4px; justify-content: flex-end; }
.codes, .skills { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.code-chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--card); font-family: Consolas, monospace; font-size: 13px; font-weight: 700; }
.code-chip.static { background: var(--soft); border-color: transparent; }
.builder-checks { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.builder-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.builder-error { color: var(--bad); font-weight: 650; }
.builder-ok { color: var(--good); font-weight: 650; }
.builder-deduced { position: sticky; top: 16px; }
.builder-deduced h4 { font: 700 16px var(--display); margin: 18px 0 8px; }
.deduced-line { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 14px; background: var(--soft); margin-bottom: 6px; font-size: 14px; }
.deduced-line.warn { background: oklch(0.96 0.05 85); }
.deduced-steps { display: flex; flex-direction: column; gap: 10px; list-style: decimal; padding-left: 22px; font-size: 14.5px; }
.deduced-steps li { padding-left: 4px; }
.deduced-steps li > span { display: block; }
.who { display: inline-flex; align-items: center; min-height: 22px; margin-top: 4px; padding: 0 10px; border-radius: 99px; background: var(--soft); color: var(--muted); font-size: 12px; font-weight: 750; }
.who.engine { background: var(--c-soft); color: var(--c-ink); }
.deduced-checks { display: flex; flex-direction: column; gap: 4px; list-style: disc; padding-left: 20px; font-size: 14.5px; }
.card-states { display: flex; gap: 8px; flex-wrap: wrap; }
.card-states span { padding: 4px 12px; border-radius: 99px; background: var(--soft); font-size: 13px; font-weight: 700; color: var(--muted); }
.card-states span.on { background: var(--c); color: var(--c-on); }
@media (max-width: 1100px) { .builder-grid { grid-template-columns: 1fr; } .builder-deduced { position: static; } }

/* ---------- Discussions ---------- */
.chat-grid { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 24px; align-items: start; }
.chat-side { display: flex; flex-direction: column; gap: 20px; }
.chat-side .panel { margin: 0; }
.home-engines.compact { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.eb, .engine-chip { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px 8px; border-radius: 20px; border: 2px solid transparent; background: transparent; font-size: 13px; font-weight: 700; color: var(--muted); transition: background 0.2s, transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1); min-width: 0; }
.eb:hover:not(:disabled) { background: var(--soft); transform: translateY(-3px); }
.eb.offline { opacity: 0.5; }
.chat-row { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; width: 100%; text-align: left; padding: 14px 16px; min-height: 64px; border-radius: 20px; border: 1.5px solid transparent; background: transparent; margin-bottom: 4px; color: inherit; transition: background 0.2s; }
.chat-row:hover { background: var(--soft); }
.chat-row.selected { background: var(--c-soft); }
.chat-row strong { font-size: 15px; line-height: 1.3; }
.chat-row small { font-size: 13px; color: var(--muted); }
.chat-thread { padding: 0; overflow: hidden; display: flex; flex-direction: column; min-height: 560px; }
.chat-head { display: flex; align-items: center; gap: 14px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.chat-head h2 { font: 700 20px/1.2 var(--display); letter-spacing: -0.015em; }
.chat-head span { font-size: 14px; color: var(--muted); }
.chat-messages { flex: 1; display: flex; flex-direction: column; gap: 16px; padding: 24px; min-height: 340px; max-height: 62vh; overflow-y: auto; background: var(--bg); }
.bubble { max-width: 720px; padding: 15px 20px; border-radius: 24px; line-height: 1.55; font-size: 16px; white-space: pre-wrap; overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.bubble.user { align-self: flex-end; background: var(--c); color: var(--c-on); border-bottom-right-radius: 8px; }
.bubble.assistant { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 8px; box-shadow: var(--shadow); }
.bubble.error { align-self: flex-start; background: oklch(0.955 0.03 18); color: oklch(0.45 0.18 18); }
.bubble small { font-size: 13px; opacity: 0.8; font-weight: 600; }
.bubble.user .memorize { color: var(--ink); }
.chat-thread > .chat-status { padding: 8px 24px 0; }
#chat-send { padding: 16px 20px 20px; border-top: 1px solid var(--line); background: var(--card); }
#chat-send textarea { background: var(--soft); border: 0; border-radius: 22px; min-height: 84px; }
#chat-send .form-footer { margin-top: 12px; }
@media (max-width: 920px) { .chat-grid { grid-template-columns: 1fr; } .chat-messages { max-height: 55vh; } }

/* Comparer trois moteurs (module consultation) */
.ask-box { display: flex; flex-direction: column; gap: 16px; padding: 28px; border-radius: 34px; background: var(--hl); color: var(--hl-ink); box-shadow: var(--shadow); border: 1px solid var(--line); --card: #fff; --soft: oklch(0.962 0.009 285); --ink: oklch(0.25 0.05 285); --muted: oklch(0.46 0.035 285); --line: oklch(0.915 0.011 285); --c-soft: oklch(0.955 0.03 250); --c-ink: oklch(0.4 0.15 250); }
.ask-head { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.ask-hint { color: var(--muted); font-size: 14px; }
.ask-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
.ask-form textarea { flex: 1 1 360px; min-height: 80px; border-radius: 24px; font: 500 19px/1.4 var(--display); }
.ask-form .primary { align-self: flex-end; min-height: 58px; }
.ask-trio, .ask-progress { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ask-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 14px; border-radius: 99px; background: var(--c-soft); color: var(--c-ink); font-size: 14px; }
.ask-chip.ko { background: oklch(0.955 0.03 18); color: oklch(0.45 0.18 18); }
.ask-chip.ok { background: oklch(0.955 0.04 150); color: oklch(0.4 0.11 150); }
.ask-chip.run { background: oklch(0.955 0.035 285); color: oklch(0.4 0.19 285); }
.ask-chip small { opacity: 0.85; }
.ask-arrow { color: var(--muted); font-size: 14px; font-weight: 650; }
.ask-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px 14px; padding: 16px; border-radius: 20px; background: var(--soft); }
.ask-field span { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.ask-field { margin: 0; }
.ask-notice { padding: 10px 14px; border-radius: 14px; background: oklch(0.955 0.04 150); color: oklch(0.4 0.11 150); font-weight: 650; margin: 0; }
.ask-notice.bad, .ask-failure { background: oklch(0.955 0.03 18); color: oklch(0.45 0.18 18); }
.ask-failure { padding: 10px 14px; border-radius: 14px; font-size: 14px; }
.ask-result { display: flex; flex-direction: column; gap: 14px; padding-top: 6px; border-top: 1px solid var(--line); }
.ask-result-head { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.ask-question-line { font: 700 22px/1.2 var(--display); letter-spacing: -0.02em; margin-right: auto; }
.ask-when { color: var(--muted); }
.ask-synthesis { max-height: 380px; overflow: hidden; position: relative; padding: 20px 24px; border-radius: 22px; background: var(--c-soft); }
.ask-synthesis.open { max-height: none; }
.ask-answers { display: flex; flex-direction: column; gap: 8px; }
.ask-answers details { border-radius: 20px; background: var(--soft); padding: 4px 18px; }
.ask-answers summary { min-height: 48px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 700; }
.ask-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ask-redo-select { width: auto; min-width: 200px; }
.ask-history { border-radius: 20px; background: var(--soft); padding: 4px 16px; }
.ask-history summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; }
.ask-history-row { display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: 10px 4px; border: 0; background: transparent; text-align: left; gap: 2px; }
.ask-history-question { font-weight: 650; }
.ask-wait { color: var(--muted); font-size: 15px; }
.ask-state.run { --c-soft: oklch(0.955 0.035 285); --c-ink: oklch(0.4 0.19 285); }
.ask-state.ok { --c-soft: oklch(0.955 0.04 150); --c-ink: oklch(0.4 0.11 150); }
.ask-state.ko { --c-soft: oklch(0.955 0.03 18); --c-ink: oklch(0.45 0.18 18); }

/* ---------- Mémoire ---------- */
.props-block { margin-bottom: 8px; }
.proposals { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 16px; margin-bottom: 28px; }
.proposal { display: flex; flex-direction: column; gap: 10px; padding: 22px; border-radius: 28px; background: oklch(0.955 0.04 150); animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; --c-soft: oklch(0.955 0.04 150); }
html[data-theme="dark"] .proposal { background: oklch(0.33 0.07 150); }
.proposal strong { font: 700 20px/1.2 var(--display); }
.proposal small { color: var(--muted); font-size: 13.5px; }
.proposal-body { max-height: 140px; overflow: hidden; font-size: 15px; }
.proposal .form-footer { margin-top: 4px; justify-content: flex-start; }
.map-panel { padding: 22px; border-radius: 34px; margin-bottom: 28px; }
.map-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 6px; }
.msearch { flex: 1 1 380px; min-height: 60px; display: flex; align-items: center; gap: 12px; padding: 0 20px; margin: 0; border-radius: 99px; border: 2px solid var(--line); background: var(--card); color: var(--muted); transition: border-color 0.2s, box-shadow 0.2s; }
.msearch:focus-within { border-color: var(--c); box-shadow: 0 0 0 5px var(--c-soft); }
.msearch input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; box-shadow: none; font-size: 18px; min-height: 44px; padding: 0; border-radius: 0; }
.legend { margin-top: 10px; font-size: 14px; color: var(--muted); font-weight: 600; }
.memory-map { min-height: 280px; position: relative; }
.map-edge { stroke: var(--line); stroke-width: 2.5; stroke-dasharray: 6 8; animation: dash 4s linear infinite; }
.map-edge.active { stroke: var(--c); }
.map-node { cursor: pointer; outline: none; }
.map-node circle { fill: var(--c); transition: r 0.2s; }
.map-node:nth-of-type(6n+1) circle { fill: oklch(0.52 0.105 190); }
.map-node:nth-of-type(6n+2) circle { fill: oklch(0.5 0.13 150); }
.map-node:nth-of-type(6n+3) circle { fill: oklch(0.56 0.22 285); }
.map-node:nth-of-type(6n+4) circle { fill: oklch(0.56 0.16 48); }
.map-node:nth-of-type(6n+5) circle { fill: oklch(0.56 0.19 250); }
.map-node:nth-of-type(6n) circle { fill: oklch(0.7 0.16 80); }
.map-node text { fill: var(--ink); font: 700 12.5px var(--body); text-anchor: middle; paint-order: stroke; stroke: var(--card); stroke-width: 4px; stroke-linejoin: round; }
.map-node.missing circle { fill: var(--card); stroke: var(--muted); stroke-width: 2.5; stroke-dasharray: 3 4; }
.map-node.selected circle { stroke: var(--ink); stroke-width: 4; }
.map-node:focus-visible circle, .map-node:hover circle { filter: drop-shadow(0 0 6px var(--c)); }
.memory-grid { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 24px; align-items: start; }
.memory-grid .panel { margin: 0; }
.memory-list #memory-list { display: flex; flex-direction: column; gap: 10px; }
.note-row { border: 1.5px solid var(--line); background: var(--card); box-shadow: var(--shadow); margin: 0; }
.note-row:hover { transform: translateX(4px); border-color: var(--c); background: var(--card); }
.note-row.selected { border-color: var(--c); box-shadow: 0 0 0 4px var(--c-soft); background: var(--card); }
.note-excerpt { font-size: 14px; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.note-matched { color: var(--c-ink) !important; font-weight: 700; background: var(--c-soft); padding: 2px 10px; border-radius: 99px; }
.memory-reader { padding: 34px; border-radius: 34px; background: var(--hl); color: var(--hl-ink); min-height: 420px; --card: #fff; --soft: oklch(0.962 0.009 285); --ink: oklch(0.25 0.05 285); --muted: oklch(0.46 0.035 285); --line: oklch(0.915 0.011 285); --c-soft: oklch(0.955 0.04 150); --c-ink: oklch(0.4 0.11 150); }
.memory-reader #memory-title { font: 700 clamp(30px, 3.4vw, 44px)/1.05 var(--display); letter-spacing: -0.03em; }
.memory-reader .section-top { align-items: flex-start; }
.note-body { font-size: 18px; line-height: 1.6; max-width: 68ch; text-wrap: pretty; }
.note-body p, .note-body ul, .note-body ol, .note-body pre, .note-body table, .note-body blockquote { margin: 0 0 14px; }
.note-body h3, .note-body h4, .note-body h5 { font: 700 22px/1.25 var(--display); margin: 22px 0 10px; letter-spacing: -0.02em; }
.note-body ul, .note-body ol { padding-left: 24px; }
.note-body ul { list-style: disc; } .note-body ol { list-style: decimal; }
.note-body li { margin-bottom: 4px; }
.note-body pre { background: var(--soft); padding: 14px 16px; border-radius: 16px; overflow-x: auto; font-size: 14px; }
.note-body blockquote { padding: 4px 18px; border-radius: 14px; background: var(--c-soft); color: var(--c-ink); }
.note-body table { border-collapse: collapse; width: 100%; font-size: 15px; }
.note-body th, .note-body td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.note-body a, .wikilink { color: var(--c-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.wikilink { border: 0; background: var(--c-soft); border-radius: 8px; padding: 0 8px; text-decoration: none; font-size: inherit; min-height: 0; }
.wikilink.missing { background: transparent; border: 1.5px dashed var(--muted); color: var(--muted); }
.related { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 18px; }
.related-label { font-size: 14px; font-weight: 700; color: var(--muted); }
.related .subtle { min-height: 40px; padding: 0 16px; font-size: 14px; }
.related .subtle.missing { border-style: dashed; }
.reader-empty { min-height: 340px; }
#memory-editor { display: flex; flex-direction: column; }
.note-picker { border-radius: 20px; background: var(--soft); padding: 4px 16px; margin: 8px 0; }
.note-picker summary { display: flex; align-items: center; gap: 10px; min-height: 48px; cursor: pointer; font-weight: 700; font-size: 15px; }
.note-picker summary .count { color: var(--c-ink); }
.note-picker input[type="search"] { margin: 6px 0; }
.note-picker-list { max-height: 200px; overflow-y: auto; display: flex; flex-direction: column; padding-bottom: 8px; }
.note-option { display: flex; align-items: center; gap: 10px; margin: 0; padding: 6px 4px; min-height: 44px; font-weight: 600; color: var(--ink); font-size: 15px; }
.note-option small { color: var(--muted); font-weight: 500; }
@media (max-width: 920px) { .memory-grid { grid-template-columns: 1fr; } .memory-reader { padding: 22px; } }

/* ---------- Santé ---------- */
.banner { position: relative; overflow: hidden; display: flex; flex-wrap: wrap; align-items: center; gap: 20px 40px; padding: 34px 38px; border-radius: 36px; margin-bottom: 24px; }
.banner-t { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 12px; position: relative; z-index: 1; }
.banner-t h2 { font: 700 clamp(30px, 3.6vw, 46px)/1.05 var(--display); letter-spacing: -0.03em; text-wrap: balance; }
.banner-t p { font-size: 18px; color: var(--muted); max-width: 44ch; }
.banner-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.ecg { flex: 1 1 380px; min-width: 0; height: 150px; }
.ecg svg { width: 100%; height: 100%; display: block; overflow: visible; }
.ecg .base { fill: none; stroke: var(--c-soft); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.ecg .live { fill: none; stroke: var(--c); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24 76; animation: trace 2.6s linear infinite; }
.ecg .live.bad { stroke: var(--bad); animation-duration: 1.4s; }
.health-engines { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 12px; }
.engc { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 10px; border-radius: 24px; background: var(--soft); text-align: center; font-weight: 700; font-size: 15px; }
.engc small { font-size: 13px; color: var(--muted); font-weight: 650; }
.engc.down { background: var(--c-soft); color: var(--c-ink); }
.monitor-row, .resource { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 14px 18px; border-radius: 22px; background: var(--soft); margin-bottom: 10px; }
.monitor-row { flex-direction: column; align-items: flex-start; }
.monitor-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.monitor-row small { color: var(--muted); font-size: 14px; }
.monitor-row a { color: var(--c-ink); font-weight: 650; font-size: 14px; }
.monitor-row.ok .dot { background: oklch(0.55 0.15 150); }
.monitor-row.bad .dot { background: var(--bad); }
.monitor-row.muted .dot { background: var(--muted); }
.dot.ok { background: oklch(0.55 0.15 150); }
.dot.bad { background: var(--bad); }
.dot.warn { background: oklch(0.82 0.16 80); }
.dot.muted { background: var(--muted); opacity: 0.6; }
.instance { margin-bottom: 18px; }
.instance-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 10px; }
.instance-head h3 { font: 700 18px var(--display); margin-right: auto; }
.instance-head small, .instance-head a { font-size: 13.5px; color: var(--muted); }
.instance-head a { color: var(--c-ink); font-weight: 700; }
.resource-info { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; }
.resource-info small, .resource-info a { font-size: 13.5px; color: var(--muted); }
.resource-info a { color: var(--c-ink); font-weight: 650; }
.resource-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.resource-actions button { min-height: 44px; padding: 0 16px; font-size: 14px; }
.activity-list { display: flex; flex-direction: column; gap: 8px; }
.activity-row { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 2px 12px; align-items: start; text-align: left; padding: 12px 14px; border-radius: 18px; border: 0; background: var(--soft); color: inherit; }
.activity-row b { grid-row: 1 / 3; color: var(--c-ink); font-size: 18px; }
.activity-row strong { font-weight: 700; font-size: 15px; line-height: 1.3; }
.activity-row small { color: var(--muted); font-size: 13px; }
.activity-row.status-failed b { color: var(--bad); }
.apps { display: flex; flex-direction: column; gap: 8px; }
.apps a { display: flex; flex-direction: column; padding: 12px 16px; border-radius: 18px; background: var(--soft); font-weight: 700; }
.apps a small { color: var(--muted); font-weight: 500; }
.alert-row strong { font-weight: 700; }

/* ---------- Réglages ---------- */
.hub { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 16px; margin-bottom: 28px; }
.hubt { min-height: 200px; }
.hubt:hover { transform: translateY(-6px); }
.settings-tabs { margin-bottom: 22px; }
.engines { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 18px; }
.engines > .engine { display: flex; flex-direction: column; gap: 14px; padding: 24px; border-radius: 30px; background: var(--card); border: 1.5px solid var(--line); box-shadow: var(--shadow); transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s; }
.engines > .engine:hover { transform: translateY(-4px); box-shadow: var(--lift); }
.engines > .engine.down { border-color: oklch(0.55 0.21 18 / 0.45); }
.ec-h { display: flex; align-items: center; gap: 14px; }
.ec-h .t { display: flex; flex-direction: column; margin-right: auto; min-width: 0; }
.ec-h .t h3 { font: 700 21px/1.2 var(--display); letter-spacing: -0.02em; }
.ec-h .t span { font-size: 14px; color: var(--muted); }
.engine-capabilities { font-size: 15px; color: var(--muted); }
.engine-links { display: flex; flex-wrap: wrap; gap: 8px; }
.engine-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--card); font-weight: 700; font-size: 14px; color: var(--ink); }
.engine-link:hover { border-color: var(--c); }
.engine-link.primary-link { background: var(--c); color: var(--c-on); border-color: transparent; }
.engine-remote { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 20px; background: var(--soft); }
.remote-head { display: flex; align-items: center; gap: 10px; }
.remote-state { margin-left: auto; font-size: 13px; font-weight: 750; color: var(--muted); }
.remote-detail { font-size: 14px; color: var(--muted); line-height: 1.5; }
.remote-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.remote-foot { color: var(--muted); }
.remote-lines pre { white-space: pre-wrap; font-size: 12.5px; background: var(--card); padding: 10px; border-radius: 12px; max-height: 200px; overflow: auto; }
.engine-remote[data-state="on"] .remote-state { color: var(--good); }
.engine-remote[data-state="error"] .remote-state { color: var(--bad); }
.consumption-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 18px; margin-top: 12px; }
.consumption-card { display: flex; flex-direction: column; gap: 6px; padding: 24px; border-radius: 30px; background: var(--card); border: 1.5px solid var(--line); box-shadow: var(--shadow); }
.consumption-card h3 { font: 700 22px/1.2 var(--display); letter-spacing: -0.02em; }
.consumption-value { font: 700 40px/1.1 var(--display); letter-spacing: -0.03em; color: var(--c-ink); }
.quota-label { font-weight: 700; font-size: 15px; margin-top: 8px; }
.quota-unavailable { font-size: 14px; font-weight: 700; color: var(--muted); }
.consumption-card progress { margin: 4px 0 2px; }
.consumption-card a { color: var(--c-ink); font-weight: 700; margin-top: 6px; }
.accounts-list { display: flex; flex-direction: column; }
.access-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr)); gap: 18px; align-items: start; }
.account-form { display: flex; flex-direction: column; }
.invite-box { padding: 14px 16px; border-radius: 18px; background: var(--c-soft); overflow-wrap: anywhere; font-size: 14px; }
.builder-intro { font-size: 17px; color: var(--muted); max-width: 70ch; margin-bottom: 22px; }
.project-hosting, .project-more, .project-keys, .project-key, .public-key { font-size: 14px; color: var(--muted); }
.public-key { font-family: Consolas, monospace; background: var(--card); padding: 10px 12px; border-radius: 12px; overflow-wrap: anywhere; display: block; }
.skill-engine { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 20px; background: var(--soft); margin-bottom: 10px; }
.skill-engine > small { color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.skill-foreign { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 14px; background: var(--card); }
.skill-foreign small { display: block; color: var(--muted); }
.skill-states { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.skill-state { display: inline-flex; padding: 3px 10px; border-radius: 99px; background: var(--card); color: var(--muted); font-size: 13px; font-weight: 650; }
.skill-state.ok { background: oklch(0.955 0.04 150); color: oklch(0.4 0.11 150); }
.skill-state.warn { background: oklch(0.96 0.05 85); color: oklch(0.45 0.1 65); }
.skill-translations { display: flex; flex-direction: column; gap: 6px; }
.skill-translations pre { white-space: pre-wrap; font-size: 12.5px; background: var(--soft); padding: 10px; border-radius: 12px; max-height: 240px; overflow: auto; }
.alerts-section .panel { max-width: 860px; }
/* Membres */
.account-card { display: flex; flex-direction: column; gap: 6px; padding: 22px 24px; border-radius: 28px; background: var(--card); border: 1.5px solid var(--line); box-shadow: var(--shadow); margin-bottom: 14px; }
.account-card.suspended { opacity: 0.7; }
.account-card.editing { border-color: var(--c); box-shadow: 0 0 0 4px var(--c-soft); }
.account-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.account-head strong { font: 700 20px/1.2 var(--display); letter-spacing: -0.02em; margin-right: auto; }
.account-line { font-size: 15px; color: var(--muted); line-height: 1.5; }
.account-line b { color: var(--ink); }
.account-budget { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; font-size: 14px; color: var(--muted); }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.account-form h3 { font: 700 22px/1.2 var(--display); letter-spacing: -0.02em; }
.account-form > p { color: var(--muted); font-size: 15px; margin-top: 4px; }
.account-form fieldset { margin: 18px 0 0; padding: 12px 18px 10px; border: 1.5px solid var(--line); border-radius: 22px; min-width: 0; }
.account-form legend { padding: 0 8px; font-weight: 750; font-size: 14px; color: var(--c-ink); }
.account-form .check-row { align-items: flex-start; margin: 4px 0; }
.account-form .check-row small { display: block; font-weight: 500; color: var(--muted); font-size: 13px; line-height: 1.4; }
.access-group { margin: 8px 0; padding: 2px 14px; border-radius: 18px; background: var(--soft); }
.access-group summary { display: flex; align-items: center; min-height: 46px; cursor: pointer; font-weight: 700; }
.access-group summary small { margin-left: 6px; font-weight: 500; color: var(--muted); }
.invite-box code { display: block; margin: 8px 0; padding: 10px 12px; overflow-wrap: anywhere; }
/* Accès */
.access-card { display: flex; flex-direction: column; gap: 10px; padding: 24px; border-radius: 28px; background: var(--card); border: 1.5px solid var(--line); box-shadow: var(--shadow); }
.access-card.ok { border-color: oklch(0.5 0.13 150 / 0.5); }
.access-card h3 { display: flex; align-items: center; gap: 10px; font: 700 21px/1.2 var(--display); letter-spacing: -0.02em; }
.access-card h3 .card-state { margin-left: auto; }
.access-card p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--muted); }
.access-card form { display: flex; flex-wrap: wrap; gap: 10px; }
.access-card form input { flex: 1 1 240px; width: auto; }
.access-state { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 14px; color: var(--muted); }
.access-actions { display: flex; flex-wrap: wrap; gap: 8px; }
/* Projets */
.project-triggers { flex-direction: column; gap: 8px; }
.project-triggers label { align-items: flex-start; border-radius: 18px; line-height: 1.5; }
.project-triggers input { margin-top: 3px; }
.project-more { margin-top: 8px; }
.project-more > summary { display: flex; align-items: center; min-height: 40px; cursor: pointer; font-weight: 650; font-size: 15px; color: var(--c-ink); }
.project-more > small, .project-more > .project-hosting, .project-more > .project-keys { display: block; margin-top: 10px; }
.project-hosting, .project-key { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 18px; background: var(--card); margin-top: 10px; }
.project-keys { display: flex; flex-direction: column; gap: 4px; }
.ok-text { color: var(--good); font-weight: 650; }
.warn-text { color: oklch(0.5 0.13 60); font-weight: 650; }
html[data-theme="dark"] .warn-text { color: oklch(0.82 0.13 75); }
.chain-images { display: grid; gap: 8px; }
.ask-more { justify-self: start; font-size: 14px; }
/* Mémoire : le lecteur vide disparaît dès qu'une note ou l'éditeur est ouvert */
#memory-view:not([hidden]) ~ .reader-empty, #memory-editor:not([hidden]) ~ .reader-empty { display: none; }
#memory-list { max-height: 640px; overflow-y: auto; padding: 2px 6px 6px 2px; margin: 0 -6px 0 -2px; }
.map-top { margin-bottom: 14px; }
/* Mission : contrôles livrés */
.detail-checks li { display: flex; align-items: flex-start; gap: 10px; }
.detail-checks li > span:last-child small { display: block; color: var(--muted); }
.detail-checks .mark { width: 18px; flex: none; font-weight: 800; }
.detail-checks li.ok .mark { color: var(--good); }
.detail-checks li.ko .mark, .detail-checks li.ko { color: var(--bad); }
.detail-checks li.unknown .mark { color: oklch(0.62 0.15 70); }
/* ---------- Accueil : le lanceur, et la salle des machines (décision 0052) ---------- */
/* Ce qui n'est montré qu'à un membre : son bouton « Nouvelle mission » et son lien « Mes missions ». */
.member-only { display: none !important; }
body.member .member-only:not([hidden]) { display: flex !important; }
/* Sur le lanceur, pas de champ de recherche : il n'y a rien à chercher, tout est à un clic. */
/* Ni le rappel des moteurs en ligne : les portes le disent déjà. */
body[data-rubric="accueil"] #omni, body[data-rubric="accueil"] #top-engines, body[data-rubric="accueil"] #home-online { display: none; }
.pill { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 18px; border-radius: 99px; background: var(--c-soft); color: var(--c-ink); font-weight: 700; font-size: 15px; }
.lanceur .ph-t em { font-style: normal; color: var(--c); }
.doors { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 18px; }
.door { display: flex; flex-direction: column; gap: 14px; padding: 26px; border-radius: 32px; background: var(--card); border: 1.5px solid var(--line); box-shadow: var(--shadow); transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s, border-color 0.2s; }
.door:hover { transform: translateY(-6px); box-shadow: var(--lift); border-color: var(--c); }
.door.down { border-color: oklch(0.55 0.21 18 / 0.45); }
.door .av { transition: transform 0.45s cubic-bezier(0.3, 1.6, 0.5, 1); }
.door:hover .av { transform: rotate(-6deg) scale(1.08); }
.door-h { display: flex; align-items: center; gap: 16px; }
.door-t { display: flex; flex-direction: column; min-width: 0; margin-right: auto; line-height: 1.2; }
.door-t b { font: 700 26px/1.1 var(--display); letter-spacing: -0.025em; }
.door-t span { font-size: 14px; font-weight: 650; color: var(--c-ink); margin-top: 4px; }
.door > p { font-size: 16px; line-height: 1.45; color: var(--muted); flex: 1; }
.door-a { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.door-a .primary { min-height: 52px; }
.off-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 14px 18px; border-radius: 22px; background: var(--soft); font-size: 15px; color: var(--muted); }
.off-line b { color: var(--ink); }
.off-line a { margin-left: auto; min-height: 44px; display: inline-flex; align-items: center; font-weight: 700; color: var(--c-ink); text-decoration: underline; text-underline-offset: 4px; }
.fns { display: flex; flex-direction: column; gap: 12px; }
.fn { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; padding: 26px; border-radius: 32px; transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s; }
.fn:hover { transform: translateY(-5px); box-shadow: var(--lift); }
.fn .glyph { width: 64px; height: 64px; border-radius: 21px; display: grid; place-items: center; background: var(--c); color: var(--c-on); flex: none; }
.fn .glyph svg.i { width: 30px; height: 30px; }
.fn-t { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.fn-t b { font: 700 26px/1.1 var(--display); letter-spacing: -0.025em; }
.fn-t span { font-size: 16px; line-height: 1.4; color: var(--muted); }
.gate { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 24px; padding: 24px 26px; border-radius: 32px; }
.gate-t { flex: 0 1 280px; display: flex; flex-direction: column; gap: 4px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr)); gap: 12px; flex: 1 1 520px; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 20px; background: var(--soft); transition: background 0.2s; }
.stat:hover { background: var(--c-soft); }
.stat b { font: 700 21px/1.2 var(--display); letter-spacing: -0.02em; }
.stat span { font-size: 14px; color: var(--muted); }
.hub-groups { display: flex; flex-direction: column; gap: 12px; }
.hub-group .sec-h { flex-wrap: wrap; margin-bottom: 14px; }
.hub-group .hubt { min-height: 176px; }

/* ---------- Devis et factures (décision 0053) ---------- */
.devis-section .ph-t em { font-style: normal; color: var(--c); }
.strip { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; padding: 16px 22px; margin-bottom: 16px; border-radius: 24px; background: var(--c-soft); color: var(--c-ink); font-size: 15px; }
.strip b { font: 700 19px var(--display); font-variant-numeric: tabular-nums; margin-left: 6px; }
.strip small { flex: 1 1 280px; font-size: 14px; }
.numeros-form { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 18px; padding-top: 10px; }
.numeros-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 700; }
.numeros-form input { width: 150px; }
.devis-status { margin: 0 0 12px; font-weight: 700; color: var(--c-ink); }
.devis-status:empty { display: none; }
.devis-form, .devis-detail { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.dv-group { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 12px 18px; border: 0; padding: 0; margin: 0; min-width: 0; }
.dv-group legend { font: 700 17px var(--display); padding: 0; margin-bottom: 8px; }
.dv-group > label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 700; color: var(--muted); }
.dv-checks, .dv-articles { grid-template-columns: 1fr; }
.dv-checks .check-row { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 600; color: var(--ink); }
.dv-rows { display: flex; flex-direction: column; gap: 8px; }
.dv-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.3fr) 84px 150px auto; gap: 8px; align-items: center; }
.dv-articles > button { justify-self: start; }
@media (max-width: 820px) { .dv-row { grid-template-columns: 1fr 1fr; } }
.docs { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 20px; }
.doc, .doc-h { display: grid; grid-template-columns: 140px minmax(0, 1.4fr) 100px 124px 150px minmax(0, 0.9fr); gap: 6px 14px; align-items: center; }
.doc-h { padding: 0 20px; font-size: 13px; font-weight: 700; color: var(--muted); }
.doc { padding: 14px 20px; min-height: 76px; border-radius: 24px; background: var(--card); border: 1.5px solid var(--line); box-shadow: var(--shadow); transition: transform 0.25s, border-color 0.2s; }
.doc:hover { transform: translateX(4px); border-color: var(--c); }
.doc.on { border-color: var(--c); box-shadow: 0 0 0 4px var(--c-soft); }
.doc.draft { background: var(--c-soft); border-color: transparent; box-shadow: none; }
.doc-n { font: 700 17px var(--display); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.doc-c { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.doc-c small { font-size: 14px; color: var(--muted); }
.doc-d { font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }
.amt { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.doc-a { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
@media (max-width: 1080px) { .doc-h { display: none; } .doc { grid-template-columns: 1fr 1fr; } .amt { text-align: left; } .doc-a { justify-content: flex-start; grid-column: 1 / -1; } }
.lines-box { overflow-x: auto; }
.lines { min-width: 520px; font-size: 15px; }
.ln { display: grid; grid-template-columns: minmax(0, 1fr) 84px 140px 120px; gap: 4px 14px; padding: 12px 6px; border-top: 1px solid var(--line); align-items: start; }
.ln-h { border-top: 0; padding: 0 6px 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.ln .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ln small { display: block; font-size: 13px; color: var(--muted); }
.tot { display: flex; flex-direction: column; gap: 6px; padding: 16px 20px; border-radius: 22px; background: var(--soft); max-width: 520px; margin-left: auto; width: 100%; }
.tot-l { display: flex; justify-content: space-between; gap: 16px; font-size: 15px; }
.tot-l b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tot-l.big { font: 700 21px var(--display); padding-top: 10px; margin-top: 4px; border-top: 1.5px solid var(--line); }
.refus { padding: 12px 16px; border-radius: 18px; background: oklch(0.96 0.05 85); color: oklch(0.36 0.09 70); font-size: 15px; font-weight: 600; }
.refus-case { display: flex; align-items: center; gap: 14px; min-height: 52px; cursor: pointer; }
.refus-case input { flex: none; width: 24px; height: 24px; margin: 0; accent-color: oklch(0.5 0.13 70); cursor: pointer; }
.regle { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; padding: 12px 16px; margin-top: 12px; border-radius: 18px; background: oklch(0.96 0.05 85); color: oklch(0.36 0.09 70); font-size: 15px; font-weight: 600; }
.regle.ok { background: oklch(0.955 0.04 150); color: oklch(0.36 0.11 150); }
.regle > span { flex: 1 1 320px; }
.regle label { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; white-space: nowrap; }
.regle input[type="checkbox"] { flex: none; width: 24px; height: 24px; margin: 0; accent-color: oklch(0.5 0.13 70); cursor: pointer; }
.regle input[type="number"] { width: 140px; }
.regle input[type="number"], .regle input[type="date"] { min-height: 40px; padding: 6px 10px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font: inherit; }
.travaux { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; color: var(--muted); }
.dv-photo { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; }
.dv-photo select { width: auto; }
.dv-notes { display: flex; flex-direction: column; gap: 8px; }
.devis-portes { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.porte-url { display: flex; flex-wrap: wrap; gap: 8px; }
.porte-url input { flex: 1 1 320px; font-family: ui-monospace, Consolas, monospace; font-size: 14px; }
.porte-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.devis-demande { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.devis-demande textarea { min-height: 96px; font-size: 17px; }
.demande-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: space-between; }
