/* Lernaia design system, D-47 (22 Nov 2026): neutral and calm. Validated by Younesse on the mock-up
   "Lernaia, nouvelle direction": light page, white cards, one typeface (Inter), one accent to act (teal),
   amber only for what waits for the user, a sober dark theme. No glow, no gradient, no uppercase labels.
   Tokens: light in :root, dark under [data-lernaia-theme="dark"] (set before the first paint by theme-boot.js).
   Every text colour is checked against its background by engine/web/tools/themeshots.js (WCAG 4.5:1). */
:root {
  --bg: #F5F6F7; --surface: #FFFFFF; --surface-2: #F1F3F4; --surface-3: #E6E9EC;
  --line: #E2E5E8; --line-2: #CDD2D6;
  --text: #14191C; --text-2: #4A565C; --text-3: #5F6B72;
  --accent: #0B6B63; --accent-hover: #095A53; --on-accent: #FFFFFF; --accent-soft: #E4F1EF; --accent-text: #0B6B63; --accent-line: #9CCFC7;
  --wait: #8A4B12; --wait-soft: #FCEFDD; --wait-line: #E9C79A; --wait-strong: #9A4A0E; --on-wait: #FFFFFF;
  --danger: #B3261E; --danger-soft: #FBE9E7; --danger-line: #F0B8B1; --on-danger: #FFFFFF;
  --ok: #1E6B43; --ok-soft: #E3F2E8;
  --shadow: 0 1px 2px rgba(20, 25, 28, .05);
  --shadow-pop: 0 12px 32px rgba(20, 25, 28, .16);
  --scrim: rgba(20, 25, 28, .42);
  --r-sm: 8px; --r: 10px; --r-lg: 14px; --r-xl: 16px;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-title: var(--f-body);
  --f-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 62px;
  --ease: cubic-bezier(.2, .8, .3, 1);
  /* avatars: one soft colour per agent, the same on every screen */
  --av0: #DCE8F7; --av0t: #1F4B80; --av1: #E9E2F6; --av1t: #53338A; --av2: #DDF0E4; --av2t: #1F6A3E; --av3: #F7E6D6; --av3t: #8A4B12;
  --av4: #F6DEE6; --av4t: #8A2A4C; --av5: #DDF0EE; --av5t: #0F5C55; --av6: #E3E7EC; --av6t: #36454F; --av7: #F4ECCB; --av7t: #6B5410;
  color-scheme: light;
}
:root[data-lernaia-theme="dark"] {
  --bg: #0F1214; --surface: #171B1E; --surface-2: #1D2226; --surface-3: #262C31;
  --line: #262C30; --line-2: #3A4248;
  --text: #ECEFF1; --text-2: #B0BAC0; --text-3: #949FA6;
  --accent: #5CC8BA; --accent-hover: #7DDBCD; --on-accent: #06231F; --accent-soft: #12302C; --accent-text: #7DDBCD; --accent-line: #2B6B63;
  --wait: #F0B36E; --wait-soft: #33240F; --wait-line: #6B4A1E; --wait-strong: #F0B36E; --on-wait: #2A1A05;
  --danger: #F2A196; --danger-soft: #3A1D19; --danger-line: #6E3329; --on-danger: #2A0E0A;
  --ok: #8FD6A8; --ok-soft: #173023;
  --shadow: none;
  --shadow-pop: 0 14px 36px rgba(0, 0, 0, .5);
  --scrim: rgba(0, 0, 0, .58);
  --av0: #1D2F47; --av0t: #A9C8F0; --av1: #2C2343; --av1t: #C9B5F0; --av2: #1B3526; --av2t: #9FD9B4; --av3: #3A2A18; --av3t: #EFC08E;
  --av4: #3B1F2A; --av4t: #F0A9BF; --av5: #143331; --av5t: #8FD9CF; --av6: #252C33; --av6t: #B9C4CE; --av7: #36301A; --av7t: #E3D08B;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--f-body);
  font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
body { overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-text); }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.ambient { display: none; }

/* ---------- Layout ---------- */
.app { position: relative; z-index: 1; height: 100%; height: 100dvh; display: grid; grid-template-columns: 248px 1fr; grid-template-rows: minmax(0, 1fr); }
.side { display: flex; flex-direction: column; gap: 2px; padding: 18px 12px; border-right: 1px solid var(--line); background: var(--surface); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 12px 18px; font-weight: 600; font-size: 1.06rem; letter-spacing: -.01em; color: var(--text); }
.brand svg { width: 26px; height: 26px; flex: none; color: var(--accent-text); }
.side-link { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: var(--r); border: 0;
  background: none; color: var(--text-2); text-align: left; font-weight: 500; font-size: .95rem; transition: background .15s, color .15s; }
.side-link svg { width: 20px; height: 20px; flex: none; }
.side-link:hover { color: var(--text); background: var(--surface-2); }
.side-link.on { color: var(--accent-text); background: var(--accent-soft); font-weight: 600; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.main { position: relative; overflow: hidden; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.scroll { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.page { max-width: 1040px; margin: 0 auto; padding: 32px 36px 96px; }
.topbar { display: none; }
.tabbar { display: none; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .topbar { display: flex; align-items: center; gap: 8px; padding: calc(8px + var(--safe-t)) 8px 4px 16px; position: relative; z-index: 3; background: var(--bg); }
  .topbar .brand { padding: 0; font-size: 1rem; margin-right: auto; }
  .topbar .brand svg { width: 24px; height: 24px; }
  .page { padding: 8px 16px calc(var(--tabbar-h) + 32px + var(--safe-b)); }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
    padding: 4px 8px calc(4px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--surface); }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 54px;
    background: none; border: none; border-radius: var(--r); color: var(--text-2); font-size: .7rem; font-weight: 500; }
  .tab svg { width: 22px; height: 22px; }
  .tab.on { color: var(--accent-text); font-weight: 600; }
}

/* ---------- Typography ---------- */
.kicker { font-size: .82rem; font-weight: 500; color: var(--text-3); margin: 0; letter-spacing: 0; }
.h1 { font-weight: 600; font-size: clamp(1.6rem, 4.6vw, 2rem); line-height: 1.15; letter-spacing: -.022em; margin: 2px 0 8px; }
.h1 em { font-style: normal; color: var(--accent-text); }
.h2 { font-weight: 600; font-size: 1.25rem; line-height: 1.25; letter-spacing: -.012em; margin: 0; }
.h3 { font-weight: 600; font-size: 1rem; margin: 0; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.mono { font-family: var(--f-mono); font-size: .8rem; letter-spacing: 0; }
.label { font-size: .82rem; font-weight: 600; color: var(--text-2); letter-spacing: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 4px 0 20px; flex-wrap: wrap; }

/* ---------- Surfaces ---------- */
.card { position: relative; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); padding: 16px; }
.card.tap { cursor: pointer; text-align: left; width: 100%; color: inherit; font: inherit; transition: border-color .15s, background .15s; }
.card.tap:hover { border-color: var(--line-2); }
.card.tap:active { background: var(--surface-2); }
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.sep { height: 1px; background: var(--line); margin: 18px 0; border: 0; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  font-weight: 600; font-size: .94rem; text-decoration: none; transition: background .15s, border-color .15s; white-space: nowrap; }
.btn svg { width: 18px; height: 18px; }
.btn:hover { background: var(--surface-2); }
.btn:active { background: var(--surface-3); }
.btn.primary { border-color: transparent; color: var(--on-accent); background: var(--accent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--danger); border-color: var(--danger-line); background: transparent; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { min-height: 40px; padding: 0 13px; font-size: .86rem; border-radius: var(--r-sm); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r);
  border: 0; background: none; color: var(--text-2); transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 21px; height: 21px; }

/* ---------- Chips & badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: .76rem; font-weight: 600;
  border: 0; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.live { color: var(--accent-text); background: var(--accent-soft); }
.chip.wait { color: var(--wait); background: var(--wait-soft); }
.chip.done { color: var(--ok); background: var(--ok-soft); }
.chip.block { color: var(--danger); background: var(--danger-soft); }
.mode { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 0; white-space: nowrap; }
.mode.prudent { color: var(--accent-text); background: var(--accent-soft); }
.mode.personnalise { color: var(--text-2); background: var(--surface-2); }
.mode.full { color: var(--wait); background: var(--wait-soft); }
@keyframes pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }

/* ---------- Agent avatar (D-47: an initial on its own colour) ---------- */
.emblem { position: relative; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 600; line-height: 1;
  background: var(--av6); color: var(--av6t); }
.emblem.av0 { background: var(--av0); color: var(--av0t); } .emblem.av1 { background: var(--av1); color: var(--av1t); }
.emblem.av2 { background: var(--av2); color: var(--av2t); } .emblem.av3 { background: var(--av3); color: var(--av3t); }
.emblem.av4 { background: var(--av4); color: var(--av4t); } .emblem.av5 { background: var(--av5); color: var(--av5t); }
.emblem.av6 { background: var(--av6); color: var(--av6t); } .emblem.av7 { background: var(--av7); color: var(--av7t); }
.emblem svg { width: 58%; height: 58%; }
.emblem.live::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 28%; height: 28%; min-width: 8px; min-height: 8px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--surface); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: .84rem; color: var(--text-2); font-weight: 500; }
.input { width: 100%; min-height: 46px; padding: 11px 14px; border-radius: var(--r); border: 1px solid var(--line-2);
  background: var(--surface); color: var(--text); font-size: 16px; transition: border-color .15s, box-shadow .15s; }
textarea.input { resize: vertical; line-height: 1.5; min-height: 110px; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: var(--text-3); }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r); border: 0; background: var(--surface-3); }
.seg button { border: none; background: none; color: var(--text-2); padding: 0 14px; border-radius: var(--r-sm); font-size: .86rem; font-weight: 500; min-height: 36px; }
.seg button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(20, 25, 28, .12); }
:root[data-lernaia-theme="dark"] .seg { background: var(--surface-2); }
:root[data-lernaia-theme="dark"] .seg button.on { background: var(--surface-3); box-shadow: none; }
.switch { position: relative; width: 48px; height: 28px; border-radius: 999px; border: 0; background: var(--line-2); flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .25s var(--ease); }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(20px); }

/* ---------- Sheets ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: var(--scrim); animation: fade .2s ease; }
.sheet { position: fixed; z-index: 41; left: 50%; bottom: 0; transform: translateX(-50%); width: min(640px, 100%); max-height: 92vh;
  overflow-y: auto; padding: 10px 20px calc(24px + var(--safe-b)); border-radius: 16px 16px 0 0; border: 1px solid var(--line); border-bottom: none;
  background: var(--surface); box-shadow: var(--shadow-pop); animation: rise .32s var(--ease); }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 2px auto 14px; }
@media (min-width: 861px) { .sheet { bottom: auto; top: 50%; transform: translate(-50%, -50%); border-radius: 16px; border-bottom: 1px solid var(--line); animation: pop .25s var(--ease); } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translate(-50%, 30%); opacity: .5; } }
@keyframes pop { from { transform: translate(-50%, -48%) scale(.98); opacity: 0; } }

.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(var(--tabbar-h) + 20px + var(--safe-b)); transform: translateX(-50%); padding: 11px 16px; border-radius: var(--r);
  background: var(--text); color: var(--bg); border: 0; box-shadow: var(--shadow-pop); font-size: .9rem; font-weight: 500; animation: rise2 .3s var(--ease); max-width: 90vw; }
.toast.err { background: var(--danger); color: var(--on-danger); }
@keyframes rise2 { from { transform: translate(-50%, 14px); opacity: 0; } }
@media (min-width: 861px) { .toast { bottom: 28px; } }

/* ---------- Login ---------- */
.login { position: relative; z-index: 1; min-height: 100%; display: grid; grid-template-rows: 1fr auto; padding: calc(24px + var(--safe-t)) 20px calc(28px + var(--safe-b)); overflow-y: auto; height: 100%; }
.login-hero { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 24px 0; }
.login-mark { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--accent-text); margin-bottom: 14px; }
.login-mark svg { width: 34px; height: 34px; }
.login-form { width: min(400px, 100%); margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }

/* ---------- Chat (conversation first) ---------- */
.chat { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 300px; grid-template-rows: minmax(0, 1fr); min-height: 0; }
.chat-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.chat-head .who { display: flex; align-items: center; gap: 10px; margin-right: auto; min-width: 0; background: none; border: none; padding: 4px 2px; text-align: left; color: inherit; }
.who-t { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.who-t > b { font-weight: 600; }
.who-t .st { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 500; color: var(--text-3); }
.who-t .st i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.who-t .st.m-prudent { color: var(--accent-text); } .who-t .st.m-personnalise { color: var(--text-2); } .who-t .st.m-full { color: var(--wait); }
.who-t .st.live { color: var(--accent-text); }
.m-only { display: none !important; }
.core-dot { width: 30px; height: 30px; border-radius: 50%; flex: none; background: var(--text); }
.core-dot.busy { animation: pulse 1.4s ease-in-out infinite; }
.mode-chip { background: none; border: none; padding: 0; }
.chat-tools { display: flex; gap: 2px; }
.chat-tools .icon-btn { position: relative; width: 42px; height: 42px; }
.badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-style: normal; font-size: .68rem; font-weight: 700;
  display: grid; place-items: center; color: var(--on-wait); background: var(--wait-strong); }
.thread { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 12px 24px 16px; }
.thread-inner { max-width: 740px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; min-height: 100%; }
.hello { margin: auto 0; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 12px 8px; }
.hello .h2 { margin: 8px 0 0; font-size: 1.35rem; }
.hello p { margin: 0; max-width: 440px; font-size: .94rem; line-height: 1.5; }
.orb { width: 56px; height: 56px; border-radius: 50%; position: relative; background: var(--text); }
.orb i { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.wait-pill { margin-top: 10px; display: inline-flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 999px; font-size: .86rem; font-weight: 500;
  border: 0; background: var(--wait-soft); color: var(--wait); }
.wait-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.msg-u { align-self: flex-end; max-width: 84%; padding: 10px 14px; border-radius: 16px 16px 4px 16px; color: var(--text);
  background: var(--surface-3); white-space: pre-wrap; word-wrap: break-word; animation: msgin .25s var(--ease); }
.msg-a { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; animation: msgin .3s var(--ease); }
.msg-a .core-dot { width: 28px; height: 28px; margin-top: 2px; }
.msg-a .body { min-width: 0; line-height: 1.6; }
@keyframes msgin { from { opacity: 0; transform: translateY(6px); } }
.md p { margin: 0 0 12px; } .md p:last-child { margin: 0; }
.md ul, .md ol { margin: 4px 0 12px; padding-left: 20px; } .md li { margin: 4px 0; }
.md li::marker { color: var(--text-3); }
.md strong { color: var(--text); font-weight: 600; }
.md h4 { font-size: 1rem; font-weight: 600; margin: 16px 0 6px; color: var(--text); }
.md code { font-family: var(--f-mono); font-size: .86em; background: var(--surface-2); padding: 2px 5px; border-radius: 5px; }
.md pre, .exact { font-family: var(--f-mono); font-size: .8rem; line-height: 1.55; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r); padding: 12px 14px; overflow-x: auto; white-space: pre-wrap; word-break: break-word; margin: 8px 0; color: var(--text); }
/* D-33: a deliverable ready to use, copied in one tap */
.copy-card { margin: 10px 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.copy-card pre { margin: 0; border: 0; border-radius: 0; background: none; font-family: var(--f-body); font-size: .95rem; line-height: 1.55; color: var(--text); padding: 12px 14px 10px; }
.copy-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px 6px 14px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--text-3); }
.copy-foot .btn.sm { min-height: 40px; gap: 6px; } .copy-foot .btn.ok { color: var(--accent-text); border-color: var(--accent-line); }
.md blockquote { margin: 8px 0; padding: 2px 0 2px 12px; border-left: 3px solid var(--line-2); color: var(--text-2); }
.msg-a .body .md + .trail, .msg-a .body .note + .trail { margin-top: 10px; }
.msg-a .body .note { margin-bottom: 10px; }
.trail { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.step { display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; color: var(--text-3); padding: 3px 10px 3px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.step i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); }
.step.run { color: var(--accent-text); border-color: var(--accent-line); } .step.run i { background: var(--accent); animation: pulse 1.2s infinite; }
.step.err { color: var(--danger); } .step.err i { background: var(--danger); }
.typing { display: inline-flex; gap: 5px; padding: 8px 0; } .typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: pulse 1.1s infinite; }
.typing i:nth-child(2) { animation-delay: .18s; } .typing i:nth-child(3) { animation-delay: .36s; }
.approve { margin-top: 12px; border-radius: var(--r-lg); padding: 14px; border: 1px solid var(--wait-line); background: var(--surface); box-shadow: var(--shadow); }
.approve .h3 { color: var(--text); }
.approve .h3 svg, .approve > .row:first-child svg { color: var(--wait); }
.trail.done .step { opacity: 1; }
.approve-actions { display: flex; gap: 8px; margin-top: 12px; position: sticky; bottom: 0; }
.approve-actions .btn { flex: 1 1 0; }
.run-note { margin: 10px 0 0; font-size: .86rem; }
.approve .exact { max-height: 38vh; overflow-y: auto; }
.composer-wrap { padding: 6px 24px calc(14px + var(--safe-b)); background: var(--bg); }
.chips { max-width: 740px; margin: 0 auto 8px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; white-space: nowrap; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); border-radius: 999px; padding: 0 14px; min-height: 40px; font-size: .86rem; font-weight: 500; }
.chips button:hover { background: var(--surface-2); }
.composer { max-width: 740px; margin: 0 auto; display: flex; align-items: flex-end; gap: 8px; padding: 4px 4px 4px 16px; border-radius: 24px;
  border: 1px solid var(--line-2); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer textarea { flex: 1; resize: none; border: none; background: none; outline: none; padding: 10px 0; max-height: 140px; min-height: 24px; font-size: 16px; line-height: 1.45; }
.send { width: 42px; height: 42px; border-radius: 50%; border: none; flex: none; display: grid; place-items: center; color: var(--on-accent);
  background: var(--accent); transition: background .15s; }
.send svg { width: 20px; height: 20px; }
.send[disabled] { background: var(--surface-3); color: var(--text-3); }
.send.stop { background: var(--surface-2); color: var(--text); border: 1px solid var(--line-2); }
.chat-side { border-left: 1px solid var(--line); padding: 20px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.side-hydra { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 14px; }
.side-hydra b { font-size: .96rem; } .side-hydra .faint { font-size: .82rem; }
.list-row.tap { width: 100%; text-align: left; background: none; border: none; border-radius: var(--r); padding: 6px; color: inherit; }
.list-row.tap:hover { background: var(--surface-2); }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; min-width: 0; }
.dense-list { display: flex; flex-direction: column; gap: 0; }
.dense-row { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: var(--r); min-height: 52px; width: 100%; text-align: left; background: none; border: none; color: inherit; }
.dense-row + .dense-row { border-top: 1px solid var(--line); border-radius: 0; }
.dense-row.tap:hover, .dense-row.on { background: var(--surface-2); }
.dense-row svg { width: 20px; height: 20px; color: var(--text-3); flex: none; }
.dr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dr-main b { font-size: .92rem; font-weight: 600; } .dr-main .faint { font-size: .8rem; }
.dr-main b.clamp2 { white-space: normal; line-height: 1.3; }
@media (max-width: 400px) { .mini-progress { display: none; } }
@media (max-width: 1180px) { .chat { grid-template-columns: minmax(0, 1fr); } .chat-side { display: none; } }
@media (max-width: 860px) {
  .chat-head { padding: calc(6px + var(--safe-t)) 6px 6px 12px; gap: 2px; }
  .app.on-chat .topbar { display: none; }
  .m-only { display: inline-flex !important; }
  .chat-tools .icon-btn { width: 42px; height: 42px; }
  .chat-head .core-dot { width: 26px; height: 26px; }
  .thread { padding: 8px 14px 10px; }
  .composer-wrap { padding: 4px 10px calc(var(--tabbar-h) + 10px + var(--safe-b)); }
  html.kb .composer-wrap { padding-bottom: 8px; }
  .chips { margin-bottom: 6px; }
  .hello .h2 { font-size: 1.25rem; }
}

/* ---------- Lists ---------- */
.team-card { display: flex; flex-direction: column; gap: 12px; }
.avatars { display: flex; } .avatars .emblem { margin-left: -8px; box-shadow: 0 0 0 2px var(--surface); } .avatars .emblem:first-child { margin-left: 0; }
.progress { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.mission { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 12px 14px; border-radius: var(--r-lg);
  border: 1px solid var(--line); background: var(--surface); }
.mission + .mission { margin-top: 8px; }
.mission .t { font-weight: 600; } .mission .s { font-size: .82rem; color: var(--text-3); }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); }
.stat b { font-size: 1.7rem; font-weight: 600; line-height: 1.15; letter-spacing: -.02em; }
.stat span { font-size: .82rem; color: var(--text-3); }
.stat.c b { color: var(--wait); } .stat.t b { color: var(--accent-text); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 640px) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .stat { padding: 10px 6px; border-radius: var(--r); text-align: center; align-items: center; min-width: 0; }
  .stat b { font-size: 1.3rem; } .stat b.mono { font-size: .68rem !important; padding-top: 8px !important; overflow-wrap: anywhere; }
  .stat span { font-size: .7rem; }
}
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; } .seg::-webkit-scrollbar { display: none; } .seg button { white-space: nowrap; }
.fab { position: fixed; z-index: 15; right: 16px; bottom: calc(var(--tabbar-h) + 16px + var(--safe-b)); display: inline-flex; align-items: center; gap: 8px; height: 50px; padding: 0 20px;
  border-radius: 25px; border: none; color: var(--on-accent); font-weight: 600; background: var(--accent); box-shadow: var(--shadow-pop); }
.fab svg { width: 20px; height: 20px; }
@media (min-width: 861px) { .fab { bottom: 32px; right: 36px; } }

/* ---------- Agent screens ---------- */
.agent-card { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.agent-card .role { font-size: .86rem; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.new-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 140px; border: 1px dashed var(--line-2);
  background: transparent; box-shadow: none; color: var(--text); font-weight: 600; }
.new-card svg { width: 26px; height: 26px; color: var(--text-2); }
.agent-hero { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; margin-bottom: 20px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button { background: none; border: none; border-bottom: 2px solid transparent; padding: 12px 12px; min-height: 44px; color: var(--text-2); font-weight: 600; white-space: nowrap; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .modes { grid-template-columns: 1fr; } }
.mode-card { text-align: left; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); padding: 16px; display: flex; flex-direction: column; gap: 8px; color: inherit; font: inherit;
  transition: border-color .15s, box-shadow .15s; }
.mode-card .ic { width: 40px; height: 40px; border-radius: var(--r); display: grid; place-items: center; }
.mode-card .ic svg { width: 22px; height: 22px; }
.mode-card p { margin: 0; font-size: .86rem; color: var(--text-2); }
.mode-card.prudent .ic { background: var(--accent-soft); color: var(--accent-text); }
.mode-card.personnalise .ic { background: var(--surface-2); color: var(--text-2); }
.mode-card.full .ic { background: var(--wait-soft); color: var(--wait); }
.mode-card.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.mode-card.on.full { border-color: var(--wait); box-shadow: 0 0 0 1px var(--wait); }
.perm { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.perm:last-child { border-bottom: none; }
.perm small { display: block; color: var(--text-3); font-size: .8rem; }
.tri { display: inline-flex; padding: 3px; border-radius: var(--r); border: 0; background: var(--surface-3); }
.tri button { border: none; background: none; padding: 0 10px; border-radius: var(--r-sm); font-size: .78rem; font-weight: 600; color: var(--text-2); min-height: 34px; }
.tri button.on.a { background: var(--accent-soft); color: var(--accent-text); }
.tri button.on.d { background: var(--wait-soft); color: var(--wait); }
.tri button.on.i { background: var(--danger-soft); color: var(--danger); }
.tri button[disabled] { cursor: default; }
:root[data-lernaia-theme="dark"] .tri { background: var(--surface-2); }
@media (max-width: 520px) { .perm { grid-template-columns: 1fr; } }
.consent { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 14px; border-radius: var(--r-lg); border: 1px solid var(--wait-line); background: var(--wait-soft); font-size: .9rem; }
.consent input { width: 22px; height: 22px; accent-color: var(--accent); margin-top: 1px; }
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.preset { text-align: left; padding: 14px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 6px; min-height: 112px; color: inherit; font: inherit; }
.preset svg { width: 24px; height: 24px; color: var(--accent-text); }
.preset b { font-size: .95rem; } .preset span { font-size: .8rem; color: var(--text-3); }
.preset.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.steps { display: flex; gap: 6px; margin: 4px 0 20px; } .steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-3); }
.steps i.on { background: var(--accent); }

/* ---------- Organisation ---------- */
.org-stage { position: relative; border-radius: var(--r-xl); border: 1px solid var(--line); overflow: hidden; background: var(--surface); }
.org-legend { display: flex; gap: 14px; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--text-3); }
.org-legend i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.skeleton { border-radius: var(--r-lg); background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sk 1.4s infinite; }
@keyframes sk { to { background-position: -200% 0; } }
.notice { padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--text); font-size: .9rem; }
.notice.err { border-color: var(--danger-line); background: var(--danger-soft); }
.notice.warn { border-color: var(--wait-line); background: var(--wait-soft); }
.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: none; }
@keyframes appear { to { opacity: 1; } }

/* ---------- Dense lists, toolbars (D-23) ---------- */
.compact-head { margin-bottom: 14px; align-items: flex-end; }
.compact-head .h1 { margin-bottom: 0; }
.list-tools { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; position: sticky; top: 0; z-index: 4; padding: 8px 0; background: var(--bg); }
.lt-row { display: flex; gap: 8px; align-items: center; }
.lt-search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface); }
.lt-search svg { width: 18px; height: 18px; color: var(--text-3); flex: none; }
.lt-search input { flex: 1; min-width: 0; border: none; background: none; outline: none; color: inherit; font: inherit; font-size: 16px; }
.lt-search input::placeholder { color: var(--text-3); }
.lt-search:focus-within { border-color: var(--accent); }
.lt-density { display: flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; flex: none; background: var(--surface); }
.lt-density button { width: 44px; height: 42px; border: none; background: none; color: var(--text-2); display: grid; place-items: center; }
.lt-density button svg { width: 18px; height: 18px; }
.lt-density button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); }
.lt-filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; align-items: center; }
.lt-filters::-webkit-scrollbar { display: none; }
.lt-filters button { flex: none; white-space: nowrap; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); border-radius: 999px; padding: 0 12px; min-height: 36px; font-size: .84rem; font-weight: 500; }
.lt-filters button small { margin-left: 6px; color: var(--text-3); font-size: .76rem; }
.lt-filters button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.lt-filters button[aria-pressed="true"] small { color: inherit; opacity: .8; }
.lt-count { margin-left: auto; padding-left: 8px; font-size: .8rem; color: var(--text-3); white-space: nowrap; }
.card.flat { padding: 4px 6px; }
.dense-row { position: relative; }
.dr-hit { position: absolute; inset: 0; border: none; background: none; border-radius: var(--r); z-index: 0; padding: 0; cursor: pointer; }
.dr-hit:hover { background: var(--surface-2); }
.dense-row > :not(.dr-hit) { position: relative; z-index: 1; pointer-events: none; }
.dense-row > button:not(.dr-hit), .dense-row > .icon-btn { pointer-events: auto; }
.dense-row.tap > * { pointer-events: none; }
.dr-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; font-size: .76rem; }
.avatars.sm .emblem { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }
.emblem.ghost { border: 1px dashed var(--line-2); background: none; }
.tag { font-size: .7rem; font-weight: 600; color: var(--text-2); background: var(--surface-2); border: 0; border-radius: 999px; padding: 1px 7px; vertical-align: 1px; }
.mini-progress { width: 54px; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; flex: none; }
.mini-progress i { display: block; height: 100%; background: var(--accent); }
.icon-btn.sm { width: 40px; height: 40px; border-radius: var(--r-sm); flex: none; }
.grid.tight { gap: 10px; }
.team-card { position: relative; gap: 12px; padding: 16px; }
.team-card > :not(.dr-hit) { position: relative; z-index: 1; pointer-events: none; }
.team-card .on-top { pointer-events: auto; }
.agent-card { display: flex; flex-direction: column; gap: 12px; padding: 16px; min-height: 0; text-align: left; }
.agent-card .role { font-size: .86rem; color: var(--text-2); margin-top: 4px; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Mobile shell: compact top bar, keyboard-aware (D-23) ---------- */
@media (max-width: 860px) {
  .topbar { min-height: 52px; }
  .topbar .icon-btn { width: 44px; height: 44px; }
  html.kb .tabbar { display: none; }
  html.kb .page { padding-bottom: 24px; }
  html.kb .sv.in-app { --tabbar: 0px; }
  .page-head.compact-head { flex-wrap: nowrap; gap: 12px; }
  .page-head.compact-head .btn { flex: none; min-height: 40px; padding: 0 14px; }
  .sheet { max-height: calc(100dvh - 24px); overflow-y: auto; padding-bottom: calc(20px + var(--safe-b)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* D-29 pending authorisations */
.appr-banner { display: flex; align-items: center; gap: 10px; width: calc(100% - 32px); max-width: 740px; margin: 8px auto 0; padding: 10px 12px; min-height: 48px; border-radius: var(--r-lg);
  border: 1px solid var(--wait-line); background: var(--wait-soft); color: var(--text); text-align: left; font-size: .9rem; cursor: pointer; }
.appr-banner svg { color: var(--wait); flex: none; }
.appr-banner > span:first-of-type { flex: 1; min-width: 0; }
.appr-go { flex: none; font-weight: 700; color: var(--wait); }
.approve.compact { padding: 12px; }
.msg-sys { max-width: 740px; margin: 6px auto; font-size: .84rem; color: var(--text-3); border-left: 2px solid var(--line-2); padding: 2px 10px; }
.side-link .badge, .tab .badge { position: static; margin-left: 6px; }

/* ================= D-30: navigation, data management, Nestor's gaze ================= */
.sheet { padding-top: 0; }
.sheet-top { position: sticky; top: 0; z-index: 3; margin: 0 -20px 6px; padding: 10px 20px 8px; min-height: 52px; background: var(--surface); touch-action: none; }
.sheet-top .grab { margin: 0 auto 8px; }
.sheet-close { position: absolute; top: 10px; right: 12px; width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); border: 0; color: var(--text); display: grid; place-items: center; }
.sheet-close:hover { background: var(--surface-3); }
.sheet-title { margin: 4px 52px 0 0; font-size: 1.2rem; }
@media (min-width: 861px) { .sheet-top .grab { visibility: hidden; margin-bottom: 0; height: 0; } .sheet { max-height: 86vh; } }
.confirm-body { line-height: 1.55; } .confirm-body p { margin: 0 0 8px; } .confirm-body ul { margin: 0 0 8px; padding-left: 20px; } .confirm-body li { margin: 5px 0; } .confirm-body li::marker { color: var(--text-3); }
.keep { flex: 1; display: flex; min-height: 0; min-width: 0; } .keep[hidden] { display: none; }

/* level switch and lists */
.seg.level { flex: none; } .side-foot .seg.level { width: 100%; } .side-foot .seg.level button { flex: 1; }
.seg.scrollx { display: flex; overflow-x: auto; scrollbar-width: none; max-width: 100%; } .seg.scrollx::-webkit-scrollbar { display: none; } .seg.scrollx button { flex: none; white-space: nowrap; }
.seg small { opacity: .75; font-weight: 500; margin-left: 4px; }
.list-row.tap { width: 100%; text-align: left; background: none; border: none; color: inherit; cursor: pointer; border-radius: var(--r); } .list-row.tap:hover { background: var(--surface-2); }
.check { width: 24px; height: 24px; border-radius: 6px; border: 1.5px solid var(--line-2); display: grid; place-items: center; flex: none; background: var(--surface); }
.check.on { background: var(--accent); border-color: var(--accent); } .check svg { width: 16px !important; height: 16px !important; color: var(--on-accent) !important; }
.bulkbar { position: sticky; bottom: calc(var(--tabbar-h) + 16px + var(--safe-b)); z-index: 5; margin: 14px auto 0; width: fit-content; max-width: 100%; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 6px 8px 6px 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); box-shadow: var(--shadow-pop); font-size: .86rem; }
.bulkbar.in-sheet { bottom: 8px; } @media (min-width: 861px) { .bulkbar { bottom: 20px; } }
.activity .dense-row { min-height: 60px; padding: 10px 8px; } .activity .label { display: block; margin: 16px 0 8px; }
.result { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; background: var(--surface-2); max-height: 46vh; overflow-y: auto; font-size: .92rem; }
.mission.tap { cursor: pointer; } .mission.tap:hover { border-color: var(--line-2); }
.side-act { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 14px; } .side-act b { font-size: .96rem; } .side-act .faint { font-size: .82rem; }
.approve .dismiss { margin-left: auto; }
.eye-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; } .eye-cell { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 14px 6px; border: 1px solid var(--line); border-radius: var(--r-lg); font-size: .84rem; }
@media (max-width: 520px) { .eye-grid { grid-template-columns: repeat(2, 1fr); } }

/* readable answers: nothing can push the page wider than the screen; sources are short links */
.md, .msg-u, .msg-sys, .exact, .dr-main { overflow-wrap: anywhere; word-break: break-word; }
.md pre, .exact { white-space: pre-wrap; }
.md a.src { color: var(--accent-text); text-decoration: none; border-bottom: 1px solid var(--accent-line); }
.md a.src.bare { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px 1px 10px; margin: 1px 2px; border: 1px solid var(--line-2); border-radius: 999px; font-size: .84em; background: var(--surface); white-space: nowrap; }
.md a.src svg { width: 11px; height: 11px; flex: none; opacity: .8; vertical-align: -1px; margin-left: 3px; } .md a.src.bare svg { margin-left: 0; }
.md a.src:hover { color: var(--accent-hover); border-color: var(--accent); }
.md ol { margin: 4px 0 12px; padding-left: 22px; }
html, body { max-width: 100%; overflow-x: hidden; }

/* Nestor's gaze: see gaze.css (D-31, flat since D-47). */
.msg-a > .nx { margin-top: 1px; } .hello .nx { margin-bottom: 6px; } .side-link .nx, .tab .nx { flex: none; }
.tab .badge, .side-link .badge { position: static; margin-left: 6px; }
@media (max-width: 860px) { .tab { position: relative; } .tab .badge { position: absolute; top: 3px; left: calc(50% + 7px); right: auto; margin: 0; } }
.side-link .badge { margin-left: auto; }
.sheet .dense-row .icon-btn.sm { width: 36px; height: 36px; }
/* D-31: what waits for the user, said once and the same everywhere (eye, tab, Activité) */
.who-t .st.live.k-attente { color: var(--wait); } .who-t .st.live.k-blocage, .who-t .st.live.k-absent { color: var(--text-3); }
.who-t .st.live.k-reflexion, .who-t .st.live.k-action, .who-t .st.live.k-delegation { color: var(--accent-text); }
.chat-head .ack { flex: none; font: 600 .8rem var(--f-body); color: var(--accent-text); background: var(--accent-soft); border: 0; border-radius: 999px; padding: 0 12px; min-height: 34px; }
.chat-head .ack.wait { color: var(--wait); background: var(--wait-soft); }
.badge.done { background: var(--accent); color: var(--on-accent); }
.seg .badge { position: static; display: inline-grid; place-items: center; flex: none; width: auto; margin-left: 6px; vertical-align: 1px; }
.new-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 7px; vertical-align: 2px; }

/* D-38: an answer read at a glance (sections, titled cards, status lists, tags, choices, tables) */
.md h3.sec { display: flex; align-items: baseline; gap: 10px; font-size: 1.08rem; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; color: var(--text); margin: 22px 0 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.md > h3.sec:first-child { margin-top: 2px; padding-top: 0; border-top: 0; }
.md h3.sec .n { flex: none; min-width: 24px; height: 24px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 6px; background: var(--surface-2); color: var(--text-2); font-size: .8rem; font-weight: 700; transform: translateY(-1px); }
.md h4 { font-size: 1rem; margin: 16px 0 6px; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.md p.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 12px; }
.md .tag { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-family: inherit; font-size: .8rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--accent-text); background: var(--accent-soft); border: 0; }
.md .tag.s-warn, .md .tag.s-wait, .md .tag.s-lock { color: var(--wait); background: var(--wait-soft); }
.md .tag.s-no { color: var(--danger); background: var(--danger-soft); }
.md ul.status { list-style: none; padding: 0; margin: 6px 0 12px; display: grid; gap: 8px; }
.md ul.status li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; align-items: start; margin: 0; }
.md ul.status li > svg, .md ul.status li > i { width: 22px; height: 22px; padding: 3px; border-radius: 50%; box-sizing: border-box; margin-top: 2px; }
.md ul.status li > i { background: var(--surface-3); }
.md ul.status li.s-ok > svg { color: var(--accent-text); background: var(--accent-soft); }
.md ul.status li.s-warn > svg, .md ul.status li.s-wait > svg, .md ul.status li.s-lock > svg { color: var(--wait); background: var(--wait-soft); }
.md ul.status li.s-no > svg { color: var(--danger); background: var(--danger-soft); }
.copy-head { padding: 10px 14px 0; font-size: .84rem; font-weight: 600; color: var(--text-2); }
.copy-head + pre { padding-top: 6px; }
.choices { margin: 14px 0 4px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2); display: grid; gap: 8px; }
.choices-h { font-size: .86rem; font-weight: 600; color: var(--text-2); padding: 0 2px 2px; }
.choice { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 46px; padding: 10px 14px; text-align: left; font: inherit; font-size: .95rem; line-height: 1.35; color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); cursor: pointer; }
.choice svg { flex: none; color: var(--text-3); transform: rotate(90deg); }
.choice:hover, .choice:focus-visible { border-color: var(--accent); outline: none; }
.md .tbl { overflow-x: auto; margin: 8px 0 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); -webkit-overflow-scrolling: touch; }
.md table { border-collapse: collapse; width: 100%; font-size: .88rem; }
.md th, .md td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.md th { font-weight: 600; color: var(--text-2); white-space: nowrap; background: var(--surface-2); }
.md tr:last-child td { border-bottom: 0; }

/* ---- L'Hydre (D-44): one head = one agent. What waits for the user, who works, what each one does. ---- */
.hy { display: flex; flex-direction: column; gap: 22px; max-width: 560px; padding-top: 18px; }
.hy-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.hy-brand { display: flex; align-items: baseline; gap: 10px; }
.hy-brand b { font-weight: 600; font-size: 1.25rem; letter-spacing: -.01em; }
.hy-brand span { font-size: .82rem; color: var(--text-3); }
.hy-sum { font-weight: 500; font-size: 1rem; line-height: 1.45; margin: 0; color: var(--text-2); }
.hy-sum .n-work { color: var(--accent-text); font-weight: 600; }
.hy-sum .n-ask { color: var(--wait); font-weight: 600; }
.hy-sum .n-none { color: var(--text-2); }
.hy-asks { display: flex; flex-direction: column; gap: 10px; }
.hy-asks .approve { margin-top: 0; opacity: 1; }
.hy-question { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: var(--r-lg); border: 1px solid var(--wait-line); background: var(--surface); }
.hy-question div { min-width: 0; flex: 1 1 200px; }
.hy-question b { display: block; }
.hy-question span { color: var(--text-2); font-size: .9rem; }
.hy-h { font-size: .86rem; font-weight: 600; color: var(--text-2); margin: 0; }
.hy-list { display: flex; flex-direction: column; gap: 18px; }
.hy-team { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.hy-team-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 10px 12px 14px; min-height: 56px; border: 0; border-bottom: 1px solid var(--line);
  background: none; color: inherit; font: inherit; text-align: left; width: 100%; }
button.hy-team-head:hover { background: var(--surface-2); }
.hy-team-head > span:first-child { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.hy-team-head b { font-weight: 600; font-size: 1rem; min-width: 0; }
.hy-team-head small { color: var(--text-3); font-size: .84rem; }
.hy-team-head > svg { width: 18px; height: 18px; color: var(--text-3); flex: none; transform: rotate(180deg); }
.hy-agent { border: 0; background: none; }
.hy-agent + .hy-agent { border-top: 1px solid var(--line); }
.hy-agent.on { background: var(--surface-2); }
.hy-row { width: 100%; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; column-gap: 12px; row-gap: 1px; align-items: center; padding: 12px 14px; background: none; border: 0; text-align: left; min-height: 64px; color: inherit; font: inherit; }
.hy-ava { grid-row: 1 / span 2; width: 40px; height: 40px; font-size: 15px; }
.hy-who { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
.hy-who b { font-weight: 600; }
.hy-who span { color: var(--text-3); font-size: .86rem; }
.hy-doing { grid-column: 2 / span 2; color: var(--text-2); font-size: .9rem; min-width: 0; overflow-wrap: anywhere; }
.hy-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.hy-pill::before { content: ""; width: 8px; height: 2px; border-radius: 2px; background: currentColor; }
.hy-pill.s-work { color: var(--accent-text); background: var(--accent-soft); }
.hy-pill.s-work::before { width: 6px; height: 6px; border-radius: 50%; }
.hy-pill.s-ask { color: var(--wait); background: var(--wait-soft); }
.hy-pill.s-ask::before { width: 8px; height: 8px; border-radius: 50%; background: none; border: 2px solid currentColor; box-sizing: border-box; }
.hy-pill.s-queue::before { width: 6px; height: 6px; border-radius: 50%; background: none; border: 1.5px dashed currentColor; }
.hy-agent.on .hy-pill:not(.s-work):not(.s-ask) { background: var(--surface-3); }
.hy-detail { border-top: 1px solid var(--line); padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 12px; }
.hy-facts { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; font-size: .9rem; }
.hy-facts dt { color: var(--text-3); }
.hy-facts dd { margin: 0; overflow-wrap: anywhere; }
.hy-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.hy-rename { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hy-rename .input { flex: 1 1 150px; min-width: 0; min-height: 44px; }
.hy-rename .hy-note { flex: 1 1 100%; }
.hy-note { font-size: .84rem; color: var(--text-3); margin: 0; }
.hy-idle { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0 14px; background: var(--surface); }
.hy-idle summary { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; color: var(--text-2); list-style: none; }
.hy-idle summary::-webkit-details-marker { display: none; }
.hy-idle summary::after { content: "Voir"; font-size: .86rem; color: var(--accent-text); font-weight: 600; }
.hy-idle[open] summary::after { content: "Replier"; }
.hy-idle .hy-list { padding-bottom: 14px; }
.hy-empty { border: 1px dashed var(--line-2); border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.hy-empty p { margin: 0; color: var(--text-2); }
.hy-empty p b { color: var(--text); }

/* D-45: Connexions. Each service has its own logo, in its colour, on a white tile (readable on both themes). */
.cx-page .seg { margin-top: 2px; }
.cx-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.cx-item { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.cx-item.on { border-color: var(--line-2); }
button.cx-item { width: 100%; text-align: left; color: inherit; font: inherit; padding: 0; cursor: pointer; }
.cx-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; min-height: 64px; border: 0; background: none; color: inherit; font: inherit; text-align: left; }
button.cx-row { cursor: pointer; }
button.cx-row:hover, button.cx-item:hover { background: var(--surface-2); }
.cx-tile { flex: none; display: inline-grid; place-items: center; background: #FFFFFF; border: 1px solid #E2E5E8; }
.cx-tile svg { display: block; }
.cx-initial { width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); border-color: var(--line);
  color: var(--text-2); font-weight: 600; font-size: 17px; }
.cx-initial svg { width: 20px; height: 20px; }
.cx-what { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cx-what b { font-weight: 600; }
.cx-what span { color: var(--text-2); font-size: .86rem; line-height: 1.35; }
.cx-what span.wait { color: var(--wait); }
.cx-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--wait); }
.cx-dot.ok { background: var(--accent); }
.cx-chev { flex: none; color: var(--text-3); transform: rotate(180deg); display: inline-flex; }
.cx-chev svg { width: 18px; height: 18px; }
.cx-detail { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 12px; }
.cx-rule { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cx-rule > span { font-size: .9rem; color: var(--text-2); }
.cx-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: .86rem; }
.cx-facts dt { color: var(--text-3); }
.cx-facts dd { margin: 0; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.cx-addr { font-family: var(--f-mono); font-size: .8rem; }
.cx-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.cx-note { margin: 0; font-size: .86rem; line-height: 1.45; }
.cx-field { display: flex; flex-direction: column; gap: 6px; font-size: .88rem; color: var(--text-2); }
.cx-field small { font-size: .8rem; }
.cx-field input[type="password"] { font-family: var(--f-mono); letter-spacing: .02em; }
.cx-lock { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: .84rem; color: var(--text-2); }
.cx-lock svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--accent-text); }
.cx-wait { border: 1px dashed var(--line-2); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.cx-wait p { margin: 0; font-size: .88rem; display: flex; gap: 10px; align-items: flex-start; }
.cx-spin { flex: none; width: 16px; height: 16px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: cx-spin 1s linear infinite; }
@keyframes cx-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cx-spin { animation: none; } }
.cx-card .cx-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.cx-card .cx-facts { margin-bottom: 10px; }
.cx-card .cx-field { margin-bottom: 8px; }
.cx-card .cx-note { margin-bottom: 8px; }
.cx-card .notice { margin: 8px 0 0; }
.cx-card .approve-actions { flex-wrap: wrap; }
.cx-card .approve-actions .btn { flex: 1 1 auto; }

/* D-46: a whole conversation to copy; tables copied for a spreadsheet; a text checked against its channel */
.conv-export { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2); }
.tbl-wrap { margin: 10px 0; }
.tbl-wrap .tbl { margin: 0; }
.tbl-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; font-size: .84rem; color: var(--text-3); }
.copy-foot .fit { display: block; margin-top: 2px; font-size: .8rem; font-weight: 500; }
.copy-foot .fit.ok { color: var(--accent-text); }
.copy-foot .fit.warn { color: var(--wait); }
.copy-foot .fit.no { color: var(--danger); font-weight: 600; }
.copy-card.too-long { border-color: var(--danger-line); }

/* D-46: copy under each answer, as in the assistants people already use */
.msg-actions { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.msg-act { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; min-width: 40px; padding: 0 10px; border-radius: var(--r); border: 0;
  background: none; color: var(--text-2); font: inherit; font-size: .84rem; font-weight: 500; cursor: pointer; }
.msg-act:hover, .msg-act:focus-visible { color: var(--text); background: var(--surface-2); }
.msg-act.wide span { white-space: nowrap; }

/* ---- D-47: Accueil. One sentence, a field to ask Nestor, what to decide, who works, the teams, the last results. ---- */
.home { display: flex; flex-direction: column; gap: 18px; }
.home-head { display: flex; flex-direction: column; gap: 2px; padding-top: 6px; }
.home-head .h1 { margin: 0; }
.home-sum, .eq-sum { margin: 0; color: var(--text-2); font-size: .98rem; line-height: 1.45; }
.home-sum .n-work, .eq-sum .n-work { color: var(--accent-text); font-weight: 600; }
.home-sum .n-ask, .eq-sum .n-ask { color: var(--wait); font-weight: 600; }
.home-ask { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 0 6px 0 10px; border-radius: 26px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--text-3); font: inherit; font-size: 1rem; text-align: left; box-shadow: var(--shadow); transition: border-color .15s; }
.home-ask:hover { border-color: var(--accent); }
.home-ask > span:nth-child(2) { flex: 1; min-width: 0; }
.home-ask-go { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); }
.home-ask-go svg { width: 18px; height: 18px; }
.home-stats { display: none; }
.home-cols { display: flex; flex-direction: column; gap: 22px; }
.home-col { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.home-sec { display: flex; flex-direction: column; gap: 10px; }
.home-sec-h { display: flex; align-items: center; gap: 8px; padding: 0 4px; min-height: 28px; }
.home-sec-h h2 { margin: 0; font-size: .86rem; font-weight: 600; color: var(--text-2); }
.home-count { min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--wait-soft); color: var(--wait); font-size: .76rem; font-weight: 700; }
.home-more { margin-left: auto; border: 0; background: none; color: var(--accent-text); font: inherit; font-size: .86rem; font-weight: 600; min-height: 40px; padding: 0 4px; }
.home-card { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.home-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 12px 10px 12px 14px; border: 0; background: none; color: inherit; font: inherit; text-align: left; }
.home-row + .home-row { border-top: 1px solid var(--line); }
.home-row:hover { background: var(--surface-2); }
.home-row.more { min-height: 48px; color: var(--accent-text); font-weight: 600; font-size: .9rem; }
.home-row-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.home-row-t b { font-weight: 600; overflow-wrap: anywhere; }
.home-row-t small { color: var(--text-3); font-size: .84rem; }
.home-row-l { display: flex; align-items: center; gap: 8px; }
.home-row-l .hy-pill { margin-left: auto; }
.home-row-d { color: var(--text-2); font-size: .9rem; overflow-wrap: anywhere; }
.home-chev { flex: none; display: inline-flex; color: var(--text-3); transform: rotate(180deg); }
.home-chev svg { width: 18px; height: 18px; }
.home-empty { margin: 0; padding: 14px; color: var(--text-2); font-size: .92rem; }
.home-start { padding: 14px; gap: 12px; }
.home-start p { margin: 0; color: var(--text-2); }
.home-starts { display: flex; flex-wrap: wrap; gap: 8px; }
.home .hy-question { box-shadow: var(--shadow); }
.home .approve { margin-top: 0; }
@media (min-width: 861px) {
  .home { gap: 22px; padding-top: 36px; }
  .home-head { flex-direction: row; align-items: baseline; flex-wrap: wrap; column-gap: 16px; }
  .home-ask { max-width: 560px; }
  .home-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .home-stats .stat > span:first-child { font-size: .84rem; font-weight: 500; color: var(--text-2); }
  .home-stats .stat.c > span:first-child { color: var(--wait); }
  .home-stats .stat.c b { color: var(--text); }
  .home-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
}

/* ---- D-47: Équipe. Nestor, his teams under him, their agents; a thin line shows who reports to whom. ---- */
.eq { max-width: 720px; }
.eq .page-head { margin-bottom: 18px; }
.eq-tree { display: flex; flex-direction: column; }
.eq-orch { display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
  box-shadow: var(--shadow); color: inherit; font: inherit; text-align: left; position: relative; z-index: 1; }
.eq-orch:hover { border-color: var(--line-2); }
.eq-orch-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.eq-orch-l { display: flex; align-items: center; gap: 8px; }
.eq-orch-l b { font-weight: 600; font-size: 1.02rem; }
.eq-orch-l .hy-pill { margin-left: auto; }
.eq-orch-t small { color: var(--text-3); font-size: .84rem; }
.eq-orch-d { color: var(--text-2); font-size: .9rem; margin-top: 2px; }
.eq-teams { display: flex; flex-direction: column; }
.eq-branch { position: relative; padding: 14px 0 0 34px; }
.eq-branch::before { content: ""; position: absolute; left: 33px; top: 0; bottom: 0; width: 2px; margin-left: -18px; background: var(--line-2); }
.eq-branch.last::before { bottom: auto; height: 42px; }
.eq-branch::after { content: ""; position: absolute; left: 15px; top: 40px; width: 19px; height: 2px; background: var(--line-2); }
.eq-branch .hy-idle summary { min-height: 56px; }
.eq-add { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.eq-new { flex: 1 1 200px; border-style: dashed; background: transparent; min-height: 48px; }
.eq .hy-note { margin-top: 10px; }
.eq-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.eq .hy-list { gap: 14px; }
@media (max-width: 860px) { .eq { padding-top: 4px; } .eq-branch { padding-left: 26px; } .eq-branch::before { left: 25px; margin-left: -14px; } .eq-branch::after { left: 11px; width: 15px; } }

/* ---- D-49: spending */
.meter { display: block; width: 100%; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; border-radius: 3px; background: var(--accent); transition: width .3s ease; }
.meter.warn i { background: var(--wait); } .meter.over i { background: var(--danger); }
:root[data-lernaia-theme="dark"] .meter { background: var(--surface-2); }
.spend-home { display: flex; flex-direction: column; align-items: stretch; gap: 2px; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.spend-home b { font-size: 1.15rem; } .spend-home small { margin-top: 6px; font-size: .8rem; } .spend-warn { color: var(--wait) !important; }
.spend .spend-h { margin: 20px 0 8px; }
.spend-total { padding: 16px; } .spend-big b { font-size: 1.7rem; font-weight: 600; letter-spacing: -.02em; }
.spend-row { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; font: inherit; color: inherit; text-align: left; }
.spend-row:last-child { border-bottom: 0; } .spend-row.tap { cursor: pointer; }
.spend-row-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; } .spend-row-t .faint { font-size: .84rem; }
.mission-cost { display: flex; flex-direction: column; gap: 2px; font-size: .9rem; }
.budget-card .meter { max-width: 360px; }
.meter.soft i { background: var(--text-3); } .meter.soft.warn i { background: var(--wait); }
.spend-eq { margin-top: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.spend-eqline { font-size: .78rem !important; margin-top: 2px; }
.budget-card .approve-actions { flex-wrap: wrap; position: static; }
.budget-card .approve-actions .btn { flex: 1 1 auto; white-space: normal; }

/* ---- D-51: files and photos in the conversation */
.composer { padding-left: 4px; }
.clip { width: 40px; height: 42px; border: none; background: none; color: var(--text-2); flex: none; display: grid; place-items: center; border-radius: 50%; cursor: pointer; }
.clip:hover:not([disabled]) { color: var(--accent-text); background: var(--accent-soft); } .clip[disabled] { opacity: .4; }
.clip svg { width: 21px; height: 21px; }
.attached { max-width: 740px; margin: 0 auto 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.att { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 6px 6px 6px 8px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); font-size: .84rem; }
.att img { width: 30px; height: 30px; object-fit: cover; border-radius: 6px; flex: none; }
.att svg { flex: none; color: var(--text-2); }
.att-n { max-width: 180px; } .att small { color: var(--text-3); white-space: nowrap; }
.att.busy { opacity: .7; } .att.busy small { color: var(--accent-text); }
.att-x { width: 26px; height: 26px; border: none; background: none; color: var(--text-3); display: grid; place-items: center; border-radius: 50%; cursor: pointer; flex: none; }
.att-x:hover { background: var(--surface-3); color: var(--text); }
.msg-files { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.msg-u:has(.msg-files) { display: flex; flex-direction: column; align-items: flex-end; }
.att.sent { padding: 4px 8px; background: var(--surface); }
.chips button svg { vertical-align: -3px; margin-right: 4px; }
.home-file { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -6px 0 18px; padding: 6px 2px; border: none; background: none; color: var(--accent-text); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; text-align: left; }
.home-file small { font-weight: 400; color: var(--text-3); font-size: .8rem; }

/* D-52 the morning brief and the weekly review (Accueil) */
.brief-now { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .84rem; color: var(--text-2, inherit); padding: 2px 2px 4px; }
.brief-now b { font-weight: 700; color: var(--text, inherit); }
.brief-now .warn b { color: var(--danger); }
.brief { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.brief > * { flex: none; }
.brief-h { display: flex; align-items: center; gap: 10px; }
.brief-ic { display: inline-flex; width: 34px; height: 34px; border-radius: 10px; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.brief-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.brief-t small { font-size: .8rem; opacity: .75; }
.brief-what { margin: 0; font-size: .86rem; line-height: 1.45; }
.brief-run { margin: 0; font-size: .86rem; color: var(--accent-text); display: flex; align-items: center; gap: 8px; }
.brief-body { flex: none; font-size: .9rem; line-height: 1.5; border-top: 1px solid var(--line); padding-top: 8px; overflow-wrap: anywhere; }
.brief-body.brief-cut { max-height: 260px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 75%, transparent); mask-image: linear-gradient(#000 75%, transparent); }
.brief-body h2 { font-size: .95rem; margin: 10px 0 4px; }
.brief-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .8rem; }
.brief-err { margin: 0; font-size: .84rem; color: var(--danger); display: flex; gap: 6px; align-items: flex-start; }
.brief-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.brief-set { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; }
.brief-set input, .brief-set select { font: inherit; padding: 4px 6px; border: 1px solid var(--line-2); border-radius: 8px; background: transparent; color: inherit; }
.brief-zone { font-size: .78rem; }

/* D-53 models: who chooses, which are allowed, a mission's model */
.mm-modes { display: grid; gap: 8px; }
.mm-mode { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 12px; border: 1px solid var(--line-2); border-radius: 12px; background: transparent; color: inherit; font: inherit; cursor: pointer; }
.mm-mode span { font-size: .84rem; opacity: .8; line-height: 1.4; }
.mm-mode.on { border-color: var(--accent); background: var(--accent-soft); }
.mm-prov { border-top: 1px solid var(--line); padding-top: 8px; }
.mm-prov-h { margin-bottom: 4px; }
.mm-model { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: .88rem; flex-wrap: wrap; }
.mm-name { font-family: ui-monospace, monospace; font-size: .84rem; }
.mm-tag { font-size: .74rem; padding: 2px 8px; border-radius: 999px; }
.mm-tag.inc { background: var(--accent-soft); color: var(--accent-text); }
.mm-tag.paid { background: var(--danger-soft); color: var(--danger); }
.mm-tag.off { background: var(--line); color: var(--text-2); }
.mm-item { padding: 2px 0 6px; }
.mm-item + .mm-item { border-top: 1px dashed var(--line); }
.mm-facts { display: flex; flex-direction: column; gap: 2px; font-size: .78rem; opacity: .75; line-height: 1.35; padding-left: 2px; }
.mm-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .88rem; }
.mm-select { font: inherit; padding: 4px 6px; border: 1px solid var(--line-2); border-radius: 8px; background: transparent; color: inherit; max-width: 100%; }

/* D-55: routine monitoring */
.hy-pill.s-stop { color: var(--danger); background: var(--danger-soft); }
.hy-pill.s-stop::before { width: 8px; height: 8px; border-radius: 2px; }
.rt-head { display: flex; align-items: center; gap: 10px; }
.rt-head .hy-pill { margin-left: auto; }
.rt-name { overflow-wrap: anywhere; }
.rt-when, .rt-err { font-size: .82rem; }
.rt-alerts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rt-a { display: flex; gap: 8px; align-items: flex-start; font-size: .86rem; line-height: 1.35; overflow-wrap: anywhere; }
.rt-a svg { flex: none; margin-top: 2px; color: var(--wait); }
.rt-a.echec svg, .rt-a.livraison svg { color: var(--danger); }
.rt-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rt-banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--danger-line); }
.rt-banner svg { flex: none; color: var(--danger); margin-top: 2px; }
.rt-banner-s { display: flex; gap: 8px; align-items: center; margin: 0 0 6px; color: var(--danger); font-size: .86rem; }

/* D-56: a plan to validate */
.plan-card .plan-goal { margin: 0 0 8px; font-weight: 600; overflow-wrap: anywhere; }
.plan-card .plan-line { margin: 6px 0 0; font-size: .86rem; overflow-wrap: anywhere; }
.plan-agents { display: grid; gap: 8px; margin: 8px 0; }
.plan-agent { border: 1px solid var(--line, var(--surface-3)); border-radius: 10px; padding: 8px 10px; font-size: .86rem; display: grid; gap: 3px; overflow-wrap: anywhere; }
.plan-agent-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.plan-model { margin-left: auto; font-size: .76rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); }
.plan-missions { margin: 6px 0 0; padding-left: 20px; font-size: .86rem; display: grid; gap: 3px; }

/* D-59: tests on throwaway data, kept apart */
.ts-mission { border-top: 1px solid var(--line); padding-top: 8px; }
.ts-chip { font-size: .72rem; padding: 2px 8px; border-radius: 999px; background: var(--line); color: var(--text-2); white-space: nowrap; }
.ts-chip.running { background: var(--accent-soft); color: var(--accent-text); }
.ts-chip.done { background: var(--accent-soft); color: var(--accent-text); }
.ts-chip.blocked { background: var(--danger-soft); color: var(--danger); }
.ts-result { font-size: .8rem; line-height: 1.4; margin-top: 4px; }
.tx { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; }
.tx-msg { border-left: 2px solid var(--line-2); padding-left: 8px; }
.tx-msg.assistant { border-left-color: var(--accent); }
.tx-who { font-size: .74rem; }
.tx-text { white-space: pre-wrap; font-size: .84rem; line-height: 1.45; overflow-wrap: anywhere; }
.tx-tools { font-size: .74rem; }
