/* Setting Rivia : jetons de design (voir DESIGN.md). Les couleurs ne s'écrivent QU'ICI ; partout ailleurs, des variables.
   Clair par défaut, sombre selon le système, ou forcé avec data-theme="light" / "dark" sur <html>.
   Contrôle : python3 ~/Outils/audit-design/audit_couleurs.py public/style.css */
@font-face { font-family: 'Plus Jakarta Sans'; src: url('/fonts/PlusJakartaSans-500.woff2') format('woff2'); font-weight: 500 500; font-display: swap; }
@font-face { font-family: 'Plus Jakarta Sans'; src: url('/fonts/PlusJakartaSans-600.woff2') format('woff2'); font-weight: 700 700; font-display: swap; }

:root {
  color-scheme: light;
  /* Neutres */
  --bg: #FFFFFF; --surface: #EDEFF3; --surface-raised: #FFFFFF;
  --border: #CDD2DB; --border-strong: #7A8496;
  --text: #0B1020; --text-2: #2F3846; --text-3: #465061;
  --ink: #111827; --on-ink: #FFFFFF;
  /* Marque et états : 4 teintes distinctes */
  --brand: #1536E8; --brand-hover: #102BC0; --on-brand: #FFFFFF;
  --success: #146C34; --warning: #A34A0A; --danger: #B91C1C; --info: #1536E8;
  --success-bg: #E8F6EC; --warning-bg: #FDF1E3; --danger-bg: #FCEBEB; --info-bg: #E8EFFD;
  /* Effets */
  --focus-ring: rgba(21, 54, 232, .45); --focus-soft: rgba(21, 54, 232, .16);
  --overlay: rgba(17, 24, 39, .4); --shadow-c: rgba(17, 24, 39, .08);
  --shadow: none; --shadow-up: 0 8px 24px var(--shadow-c);
  /* Échelles : espacement 4 px, 6 tailles de texte, 2 graisses (500 et 700), 2 rayons */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-6: 24px; --space-8: 32px; --space-12: 48px; --space-16: 64px;
  --text-xs: 12px; --text-sm: 13px; --text-base: 14px; --text-lg: 16px; --text-xl: 20px; --text-2xl: 24px;
  --radius-sm: 10px; --radius-md: 14px; --pill: 999px;
  /* Mouvement : 3 durées, 1 courbe */
  --dur-court: 150ms; --dur-moyen: 200ms; --dur-long: 240ms; --dur-sortie: 160ms; --ease-sortie: cubic-bezier(.2, .8, .2, 1);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B0D12; --surface: #0F1218; --surface-raised: #181C25;
  --border: #343A49; --border-strong: #6B7385;
  --text: #F1F3F6; --text-2: #C3C9D4; --text-3: #AAB2C0;
  --ink: #F1F3F6; --on-ink: #0B0D12;
  --brand: #6EA0FF; --brand-hover: #94B8FF; --on-brand: #0B0D12;
  --success: #4ADE80; --warning: #FBBF24; --danger: #F87171; --info: #6EA0FF;
  --success-bg: #10281A; --warning-bg: #2D2108; --danger-bg: #2E1214; --info-bg: #111F3D;
  --focus-ring: rgba(110, 160, 255, .55); --focus-soft: rgba(110, 160, 255, .2);
  --overlay: rgba(0, 0, 0, .6); --shadow-c: rgba(0, 0, 0, .4);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0B0D12; --surface: #0F1218; --surface-raised: #181C25;
    --border: #343A49; --border-strong: #6B7385;
    --text: #F1F3F6; --text-2: #C3C9D4; --text-3: #AAB2C0;
    --ink: #F1F3F6; --on-ink: #0B0D12;
    --brand: #6EA0FF; --brand-hover: #94B8FF; --on-brand: #0B0D12;
    --success: #4ADE80; --warning: #FBBF24; --danger: #F87171; --info: #6EA0FF;
    --success-bg: #10281A; --warning-bg: #2D2108; --danger-bg: #2E1214; --info-bg: #111F3D;
    --focus-ring: rgba(110, 160, 255, .55); --focus-soft: rgba(110, 160, 255, .2);
    --overlay: rgba(0, 0, 0, .6); --shadow-c: rgba(0, 0, 0, .4);
  }
}
/* Plus de contraste (réglage « Augmenter le contraste » du système, plein soleil) : textes proches de 7:1, bords à 4,5:1 */
@media (prefers-contrast: more) {
  :root { --text-2: #1F2937; --text-3: #374151; --border: #6B7280; --border-strong: #374151; }
  :root[data-theme="dark"] { --text-2: #D1D5DB; --text-3: #BCC3CF; --border: #6B7385; --border-strong: #A6ADBB; }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --text-2: #D1D5DB; --text-3: #BCC3CF; --border: #6B7385; --border-strong: #A6ADBB; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif; font-size: var(--text-sm); font-weight: 500; line-height: 1.55; color: var(--text-2); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { color: var(--text); font-weight: 700; line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--brand); }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--text-sm); background: var(--surface); padding: 0px var(--space-1); border-radius: var(--radius-sm); word-break: break-all; }
.hidden { display: none !important; }
.muted { color: var(--text-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 44px; padding: var(--space-2) var(--space-4); border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-raised); color: var(--text); font-weight: 700; font-size: var(--text-sm); text-decoration: none; cursor: pointer; transition: background var(--dur-court) var(--ease-sortie), border-color var(--dur-court) var(--ease-sortie), transform var(--dur-court) var(--ease-sortie); white-space: nowrap; }
.btn:hover { border-color: var(--border-strong); background: var(--surface); }
.btn:active { transform: scale(.97); }
.btn:focus-visible, .input:focus-visible, .chip:focus-visible, .post:focus-visible, .tab:focus-visible, .switch input:focus-visible + span { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-lg { min-height: 52px; padding: var(--space-3) var(--space-6); font-size: var(--text-base); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface); border-color: transparent; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn-icon { width: 44px; padding: 0; }
.btn, .cal-post, .nav-i, .bnav a, .bnav button { -webkit-tap-highlight-color: transparent; }
.btn svg, .ico { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn[disabled] { opacity: .75; cursor: not-allowed; }

/* Champs */
.field { display: grid; gap: var(--space-1); }
.label { font-weight: 700; color: var(--text); font-size: var(--text-sm); }
.help { font-size: var(--text-sm); color: var(--text-3); }
.input { width: 100%; min-height: 48px; padding: var(--space-3) var(--space-3); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-raised); font-size: var(--text-base); transition: border-color var(--dur-court) var(--ease-sortie), box-shadow var(--dur-court) var(--ease-sortie); }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus-soft); }
textarea.input { min-height: 120px; resize: vertical; line-height: 1.5; }
.input-kw { text-transform: uppercase; font-weight: 700; letter-spacing: .04em; font-size: var(--text-lg); }
.count { font-size: var(--text-xs); color: var(--text-3); text-align: right; }
.count.over { color: var(--danger); font-weight: 700; }

/* Pastilles */
.pill { display: inline-flex; align-items: center; gap: var(--space-1); padding: var(--space-1) var(--space-2); border-radius: var(--pill); font-size: var(--text-xs); font-weight: 700; background: var(--surface); color: var(--text-2); white-space: nowrap; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: var(--pill); background: currentColor; }
.pill-ok { background: var(--success-bg); color: var(--success); }
.pill-warn { background: var(--warning-bg); color: var(--warning); }
.pill-err { background: var(--danger-bg); color: var(--danger); }
.pill-off { color: var(--text-3); }
.kw { display: inline-flex; align-items: center; padding: var(--space-1) var(--space-3); border-radius: var(--pill); background: var(--info-bg); color: var(--brand); font-weight: 700; letter-spacing: .04em; font-size: var(--text-sm); }

/* Interrupteur */
.switch { position: relative; display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; min-height: 44px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch span { position: relative; width: 44px; height: 26px; border-radius: var(--pill); background: var(--border-strong); transition: background var(--dur-moyen) var(--ease-sortie); flex: none; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: var(--pill); background: var(--surface-raised); box-shadow: 0 1px 3px var(--shadow-c); transition: transform var(--dur-moyen) var(--ease-sortie); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(18px); }

/* Marque */
.brand { display: inline-flex; align-items: center; gap: var(--space-2); text-decoration: none; color: var(--text); font-weight: 700; font-size: var(--text-lg); }
.brand img { height: 24px; width: auto; }
.brand span { padding: 0px var(--space-2); border-radius: var(--radius-sm); background: var(--info-bg); color: var(--brand); font-size: var(--text-sm); }
.avatar { width: 32px; height: 32px; border-radius: var(--pill); background: var(--info-bg); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: var(--text-xs); flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.alert { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); margin-bottom: var(--space-4); font-size: var(--text-sm); }
.alert .ico { margin-top: 0px; }
.alert-warn { background: var(--warning-bg); color: var(--warning); }
.alert-err { background: var(--danger-bg); color: var(--danger); }
.alert-info { background: var(--info-bg); color: var(--text); }
.alert .btn { margin-left: auto; }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); margin-bottom: var(--space-6); }
.kpi { background: var(--info-bg); border-radius: var(--radius-md); padding: var(--space-4); }
.kpi b { display: block; font-size: var(--text-xl); color: var(--brand); font-weight: 700; line-height: 1.1; }
.kpi span { font-size: var(--text-sm); color: var(--text-2); }
.kpi.neutral { background: var(--surface); }
.kpi.neutral b { color: var(--text); }
.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.table th { text-align: left; font-size: var(--text-xs); color: var(--text-3); font-weight: 700; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border); }
.table td { padding: var(--space-3); border-bottom: 1px solid var(--border); vertical-align: top; }
.table td.t { max-width: 360px; overflow-wrap: anywhere; }
.card { background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-4); box-shadow: var(--shadow); }
.card + .card { margin-top: var(--space-4); }
.card h2 { font-size: var(--text-lg); }
.card p { margin-top: var(--space-1); }
.copy { display: flex; gap: var(--space-2); margin-top: var(--space-3); }
.copy .input { font-family: ui-monospace, Menlo, monospace; font-size: var(--text-sm); }
.howto { margin: var(--space-3) 0 0; padding-left: var(--space-4); display: grid; gap: var(--space-1); }
.examples { display: grid; gap: var(--space-2); margin-top: var(--space-3); }
.example { background: var(--info-bg); color: var(--text); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); font-size: var(--text-sm); }
.row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; margin-top: var(--space-3); }
.danger-zone { border-color: var(--danger); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 80; background: var(--text); color: var(--surface-raised); padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); font-weight: 700; font-size: var(--text-sm); box-shadow: var(--shadow-up); width: max-content; max-width: calc(100% - 32px); animation: toast-in var(--dur-moyen) var(--ease-sortie); }
.pv-seg { display: inline-grid; grid-template-columns: repeat(4, auto); gap: var(--space-1); padding: var(--space-1); background: var(--surface); border-radius: var(--radius-md); }
.pv-b { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 40px; padding: var(--space-2) var(--space-4); border: 0; border-radius: var(--radius-md); background: transparent; color: var(--text-2); font-weight: 700; font-size: var(--text-sm); cursor: pointer; white-space: nowrap; transition: background var(--dur-court) var(--ease-sortie), color var(--dur-court) var(--ease-sortie); }
.pv-b:hover { color: var(--text); }
.pv-b[aria-selected="true"] { background: var(--surface-raised); color: var(--brand); box-shadow: var(--shadow); }
/* ── Structure de l'espace : barre latérale (ordinateur), barre du bas (téléphone), contenu sur toute la largeur ── */
body:has(.shell) { background: var(--surface); }
.skip { position: absolute; left: var(--space-2); top: -64px; z-index: 100; padding: var(--space-3) var(--space-4); background: var(--brand); color: var(--on-brand); border-radius: var(--radius-sm); font-weight: 700; }
.skip:focus { top: var(--space-2); }
.shell { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100vh; }
.side { display: none; }
.logo-sombre { display: none; }
:root[data-theme="dark"] .logo-clair { display: none; }
:root[data-theme="dark"] .logo-sombre { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-clair { display: none; } :root:not([data-theme="light"]) .logo-sombre { display: block; } }
.brand-mark { display: none; }
.acc-btn { width: 100%; display: flex; align-items: center; gap: var(--space-3); min-height: 56px; padding: var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-raised); text-align: left; }
.acc-btn .avatar { width: 36px; height: 36px; }
.acc-id { display: grid; min-width: 0; flex: 1; gap: var(--space-1); }
.acc-id .name { font-size: var(--text-sm); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-id .pill { font-size: var(--text-xs); padding: 0 var(--space-2); justify-self: start; }
select.acc-sel { width: 100%; min-height: 48px; font-weight: 700; color: var(--text); }
.nav { display: grid; gap: var(--space-1); }
.nav-i { display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 44px; padding: var(--space-3); border: 0; border-radius: var(--radius-sm); background: none; color: var(--text-2); font-weight: 700; font-size: var(--text-sm); cursor: pointer; text-align: left; white-space: nowrap; position: relative; }
.nav-i .ico { width: 20px; height: 20px; color: var(--text-3); }
.nav-i:hover { background: var(--surface); color: var(--text); }
.nav-i[aria-current="page"] { background: var(--info-bg); color: var(--brand); }
.nav-i[aria-current="page"] .ico { color: var(--brand); }
.nav-i:focus-visible, .acc-btn:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: -2px; }
.side-foot { margin-top: auto; display: grid; gap: var(--space-1); border-top: 1px solid var(--border); padding-top: var(--space-3); }
.conn-dot { width: 8px; height: 8px; border-radius: var(--pill); background: var(--border-strong); flex: none; display: inline-block; }
.conn-dot.ok { background: var(--success); }
.conn-dot.warn { background: var(--warning); }
.conn-dot.err { background: var(--danger); }
.nav-out { color: var(--text-3); }
.main { min-width: 0; display: flex; flex-direction: column; }
.mtop { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-4); background: var(--surface-raised); border-bottom: 1px solid var(--border); }
.mtop .brand { margin-right: auto; }
.mtop-acc { min-width: 0; max-width: 55%; }
.mtop .acc-btn { min-height: 44px; padding: var(--space-1) var(--space-3); }
.mtop .acc-btn .pill, .mtop .avatar { display: none; }
.mtop select.acc-sel { min-height: 44px; }
.bnav { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; background: var(--surface-raised); border-top: 1px solid var(--border); padding: var(--space-1) var(--space-1) max(var(--space-1), env(safe-area-inset-bottom)); }
.bnav .nav-i { flex-direction: column; justify-content: center; gap: var(--space-1); padding: var(--space-1) 0; min-height: 56px; font-size: var(--text-xs); text-align: center; border-radius: var(--radius-sm); }
.bnav .nav-n { position: absolute; top: var(--space-1); left: 55%; min-width: 16px; line-height: 16px; padding: 0 var(--space-1); font-size: var(--text-xs); margin: 0; }
.shell .wrap { width: 100%; max-width: 1680px; margin: 0 auto; padding: var(--space-6) var(--space-4) calc(var(--space-16) + var(--space-8)); min-height: 100vh; }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-6); }
.head h1 { font-size: var(--text-xl); }
.head p { margin-top: var(--space-1); }
.head-act { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
@media (min-width: 1024px) {
  .shell { grid-template-columns: 264px minmax(0, 1fr); }
  .side { display: flex; flex-direction: column; gap: var(--space-4); position: sticky; top: 0; height: 100vh; padding: var(--space-4) var(--space-3); background: var(--surface-raised); border-right: 1px solid var(--border); overflow-y: auto; }
  .side-top { padding: var(--space-1) var(--space-2) 0; min-height: 44px; display: flex; align-items: center; }
  .mtop, .bnav { display: none; }
  .shell .wrap { padding: var(--space-8) var(--space-8) var(--space-12); }
  .head h1 { font-size: var(--text-xl); }
}
@media (min-width: 1800px) { .shell .wrap { padding: var(--space-8) var(--space-12) var(--space-12); } }

@keyframes toast-in { from { transform: translate(-50%, 8px); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }
.chip { min-height: 36px; padding: var(--space-1) var(--space-3); border-radius: var(--pill); border: 1px solid var(--border); background: var(--surface-raised); font-size: var(--text-sm); font-weight: 700; cursor: pointer; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
@media (prefers-reduced-motion: reduce) { :root { --dur-court: 0ms; --dur-moyen: 0ms; --dur-long: 0ms; --dur-sortie: 0ms; } *, *::before, *::after { transition: none !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
.btn-sm { min-height: 44px; padding: var(--space-2) var(--space-3); font-size: var(--text-sm); }
.btn-block { width: 100%; }
select.input { appearance: none; background-image: none; padding-right: var(--space-8); }
.sel { position: relative; display: inline-block; }
.sel .ico { position: absolute; right: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); pointer-events: none; color: var(--text-3); }
.sel select { min-width: 150px; }

/* Page de connexion */
.auth { min-height: 100vh; display: grid; place-items: center; padding: var(--space-6) var(--space-4); background: var(--surface); }
.auth-card { width: 100%; max-width: 420px; display: grid; gap: var(--space-4); }
.auth-card .brand { justify-self: start; }
.auth-card h1 { font-size: var(--text-xl); }
.auth-card form { display: grid; gap: var(--space-3); }
.profils-liste { display: grid; gap: var(--space-2); }
.profil { display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 64px; padding: var(--space-3) var(--space-3); text-align: left; font: inherit; color: var(--text-2); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.profil:hover, .profil:focus-visible { border-color: var(--brand); }
.profil:disabled { opacity: .6; cursor: default; }
.profil-i { flex: none; width: 40px; height: 40px; border-radius: var(--pill); display: grid; place-items: center; background: var(--info-bg); color: var(--brand); font-weight: 700; }
.profil-t { display: grid; gap: 0px; min-width: 0; }
.profil-t strong { color: var(--text); font-size: var(--text-base); }
.profil-t span { font-size: var(--text-sm); color: var(--text-3); }
.auth-err { margin: 0; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); background: var(--danger-bg); color: var(--danger); font-size: var(--text-sm); font-weight: 700; }

/* Structure : badge du menu et pied */
.nav-n { margin-left: auto; min-width: 22px; padding: 0 var(--space-2); border-radius: var(--pill); background: var(--info-bg); color: var(--brand); font-size: var(--text-xs); font-weight: 700; text-align: center; line-height: 22px; }
.nav-i[aria-current="page"] .nav-n { background: var(--surface-raised); }
.who { display: grid; gap: 0px; padding: var(--space-1) var(--space-3); min-width: 0; }
.who b { color: var(--text); font-size: var(--text-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who span { font-size: var(--text-xs); color: var(--text-3); }
.sync { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-1) var(--space-3); font-size: var(--text-xs); color: var(--text-3); }
.sync .conn-dot { flex: none; }
.simu { margin: 0 var(--space-1); padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); background: var(--info-bg); color: var(--text); font-size: var(--text-xs); font-weight: 700; }
select.acc-sel { width: 100%; min-height: 48px; border-radius: var(--radius-md); font-weight: 700; color: var(--text); }

/* Chiffres */
.kts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); margin-bottom: var(--space-4); }
.kt { background: var(--info-bg); border-radius: var(--radius-md); padding: var(--space-4); display: grid; gap: 0px; align-content: start; min-width: 0; }
.kt-l { font-size: var(--text-sm); color: var(--text-2); font-weight: 700; }
.kt-v { font-size: var(--text-xl); line-height: 1.15; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.kt-s { font-size: var(--text-xs); color: var(--text-3); }
.kt.neutral { background: var(--surface); }
.kt.neutral .kt-v { color: var(--text); }
.kt.warn .kt-v { color: var(--warning); }
.nd { color: var(--text-3); font-weight: 700; font-size: var(--text-xs); }

/* Boîte de réception */
.bar { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin-bottom: var(--space-3); }
.bar .grow { flex: 1 1 200px; min-width: 160px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: var(--space-1); padding: var(--space-1); background: var(--surface); border-radius: var(--radius-md); }
.seg .pv-b[disabled] { cursor: not-allowed; color: var(--text-3); }
.pv-b .n { min-width: 22px; padding: 0 var(--space-1); border-radius: var(--pill); background: var(--surface-raised); color: var(--text-2); font-size: var(--text-xs); line-height: 20px; }
.pv-b[aria-selected="true"] .n { background: var(--info-bg); color: var(--brand); }
.main-split { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.panel { background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow); min-width: 0; }
.panel-l { display: grid; padding: var(--space-2); }
.list { display: grid; gap: 0px; max-height: calc(100vh - 330px); min-height: 260px; overflow-y: auto; }
.item { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: var(--space-2); align-items: start; width: 100%; padding: var(--space-2); border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text-2); text-align: left; cursor: pointer; }
.item:hover { background: var(--surface); }
.item.on { background: var(--info-bg); }
.item:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: -2px; }
.av { width: 44px; height: 44px; border-radius: var(--pill); display: grid; place-items: center; background: var(--info-bg); color: var(--brand); font-weight: 700; font-size: var(--text-sm); flex: none; }
.it-main { display: grid; gap: 0px; min-width: 0; }
.it-top { display: flex; justify-content: space-between; gap: var(--space-2); min-width: 0; }
.it-top b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: var(--text-sm); }
.when { flex: none; font-size: var(--text-xs); color: var(--text-3); }
.it-last { font-size: var(--text-sm); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item.unread .it-last { color: var(--text); font-weight: 700; }
.tags { display: flex; flex-wrap: wrap; gap: var(--space-1); align-items: center; margin-top: var(--space-1); }
.tag { font-size: var(--text-xs); font-weight: 700; padding: 0px var(--space-2); border-radius: var(--pill); background: var(--surface); color: var(--text-2); white-space: nowrap; }
.tag.toi { background: var(--info-bg); color: var(--brand); }
.tag.ok { background: var(--success-bg); color: var(--success); }
.tag.warn { background: var(--warning-bg); color: var(--warning); }
.tag.err { background: var(--danger-bg); color: var(--danger); }
.tag.prive { background: var(--text); color: var(--surface-raised); }
.dot { width: 10px; height: 10px; border-radius: var(--pill); background: var(--brand); margin-left: auto; }
.empty { display: grid; gap: var(--space-2); justify-items: center; text-align: center; padding: var(--space-8) var(--space-3); }
.empty .ico { width: 32px; height: 32px; color: var(--brand); }
.empty p { max-width: 420px; }

.conv { display: grid; gap: var(--space-3); padding: var(--space-4); }
.conv-none { min-height: 200px; place-items: center; align-content: center; text-align: center; color: var(--text-3); }
.conv-none .ico { width: 36px; height: 36px; }
.conv-head { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: var(--space-3); align-items: center; padding-bottom: var(--space-3); border-bottom: 1px solid var(--border); }
.conv-back { display: none; }
.who-l { display: grid; min-width: 0; line-height: 1.3; }
.who-l b { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-l a, .who-l span { font-size: var(--text-sm); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-tools { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.conv-tools .input { min-height: 44px; font-size: var(--text-sm); padding: var(--space-2) var(--space-3); }
.msgs { display: flex; flex-direction: column; gap: var(--space-1); max-height: clamp(240px, 48vh, 560px); min-height: 180px; overflow-y: auto; padding: var(--space-1) 0px; }
.day { align-self: center; margin: var(--space-2) 0 var(--space-1); font-size: var(--text-xs); font-weight: 700; color: var(--text-3); }
.day::first-letter { text-transform: uppercase; }
.b { max-width: min(78%, 520px); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); display: grid; gap: 0px; }
.b p { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--text-sm); line-height: 1.45; }
.b.in { align-self: flex-start; background: var(--surface); color: var(--text); border-bottom-left-radius: 6px; }
.b.out { align-self: flex-end; background: var(--info-bg); color: var(--text); border-bottom-right-radius: 6px; }
.b.out.auto { background: var(--surface-raised); border: 1px solid var(--border); }
.b .meta { font-size: var(--text-xs); opacity: .8; justify-self: end; }
.b.in .meta { justify-self: start; }
.win { display: flex; gap: var(--space-2); align-items: flex-start; padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); font-size: var(--text-sm); }
.win .ico { flex: none; width: 18px; height: 18px; margin-top: 0px; }
.win.ok { background: var(--success-bg); color: var(--success); }
.win.off { background: var(--surface); color: var(--text-2); }
.win.draft { background: var(--warning-bg); color: var(--warning); }
.compose { display: grid; gap: var(--space-2); }
.compose textarea { min-height: 84px; font-size: var(--text-base); }
.acts { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; align-items: center; }
.acts .grow { margin-right: auto; font-size: var(--text-xs); color: var(--text-3); }
.fiche { display: grid; gap: var(--space-3); padding: var(--space-3); border-radius: var(--radius-sm); background: var(--surface); }
.fiche h3 { font-size: var(--text-sm); }
.fiche dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: var(--space-2); margin: 0; }
.fiche dt { font-size: var(--text-xs); color: var(--text-3); font-weight: 700; }
.fiche dd { margin: 0; color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.fiche ul { margin: 0; padding-left: var(--space-4); display: grid; gap: 0px; font-size: var(--text-sm); }
.fiche textarea { min-height: 72px; font-size: var(--text-base); }

/* Listes (relances, commentaires, réglages) */
.rows { display: grid; }
.row-i { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: var(--space-3); align-items: center; padding: var(--space-3) var(--space-1); border-bottom: 1px solid var(--border); }
.row-i:last-child { border-bottom: 0; }
.row-i .it-last { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.row-act { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; }
.reply-form { grid-column: 1 / -1; display: grid; gap: var(--space-2); padding: var(--space-2) 0 var(--space-1); }
.sec { display: grid; gap: var(--space-3); }
.sec + .sec { margin-top: var(--space-4); }
.sec h2 { font-size: var(--text-lg); }
.sec-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.note { padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm); background: var(--surface); font-size: var(--text-sm); }
.how summary { cursor: pointer; font-weight: 700; font-size: var(--text-sm); color: var(--brand); min-height: 44px; display: flex; align-items: center; }
.how ul { margin: 0; padding-left: var(--space-4); display: grid; gap: var(--space-1); font-size: var(--text-sm); }

/* Statistiques */
.scroll-x { overflow-x: auto; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.zero td { color: var(--text-3); }
.bars { display: grid; gap: var(--space-2); }
.bar-r { display: grid; grid-template-columns: 150px minmax(0, 1fr) 90px; gap: var(--space-3); align-items: center; font-size: var(--text-sm); }
.bar-t { height: 12px; border-radius: var(--pill); background: var(--surface); overflow: hidden; }
.bar-f { height: 100%; border-radius: var(--pill); background: var(--brand); }
.bar-r b { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }

/* Réglages */
.mbr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--space-3); align-items: center; padding: var(--space-2) 0; border-bottom: 1px solid var(--border); }
.mbr:last-child { border-bottom: 0; }
.mbr b { color: var(--text); }
.mbr .muted { font-size: var(--text-sm); overflow-wrap: anywhere; }
.form-row { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: flex-end; }
.form-row .field { flex: 1 1 180px; }
.secret { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; padding: var(--space-3); border-radius: var(--radius-sm); background: var(--success-bg); color: var(--success); font-weight: 700; }
.secret code { background: var(--surface-raised); color: var(--text); font-size: var(--text-base); }
.roles-l { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-2); }
.roles-l li { display: grid; gap: 0px; font-size: var(--text-sm); }
.roles-l b { color: var(--text); }

@media (max-width: 1100px) {
  .kts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .main-split { grid-template-columns: 1fr; }
  .main-split.has-conv .panel-l { display: none; }
  .main-split:not(.has-conv) .conv { display: none; }
  .conv-back { display: inline-flex; }
  .list { max-height: none; }
  .msgs { max-height: 70vh; }
  .conv-open .kts, .conv-open .bar, .conv-open .head, .conv-open .alert { display: none; }
  .b { max-width: 88%; }
  .bar-r { grid-template-columns: 96px minmax(0, 1fr) 70px; }
  .mbr { grid-template-columns: 1fr auto; }
  .mbr > :nth-child(3) { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .kt-v { font-size: var(--text-xl); }
  .row-i { grid-template-columns: 44px minmax(0, 1fr); }
  .row-i .row-act .btn, .ia-carte .row-act .btn { flex: 1 1 100%; }
  .row-i .row-act { grid-column: 1 / -1; justify-content: flex-start; }
  .acts .btn { flex: 1 1 auto; }
  .conv-tools .sel, .conv-tools select { width: 100%; }
}

/* Corrections du contrôle visuel */
.shell .wrap:focus, .wrap:focus-visible, main:focus { outline: none; }
.shell .wrap { min-height: calc(100vh - 0px); }
.tag.prive { background: var(--surface-raised); color: var(--text); border: 1px solid var(--border); }
.kt { border: 1px solid transparent; }
.kt.neutral { background: var(--surface-raised); border-color: var(--border); }
.note { background: var(--info-bg); color: var(--text); margin-bottom: var(--space-3); }
.nd { color: var(--text-2); font-weight: 700; font-size: var(--text-xs); }
.conv-tools { padding-bottom: var(--space-3); border-bottom: 1px solid var(--border); }
.msgs { padding: var(--space-2) var(--space-1); }
.fiche { background: transparent; border-radius: 0; border-top: 1px solid var(--border); padding: var(--space-4) 0 0; }
.table td.jour, .table th.jour { white-space: nowrap; position: sticky; left: 0; background: var(--surface-raised); }
.table tfoot th { border-top: 2px solid var(--border); border-bottom: 0; color: var(--text); font-size: var(--text-sm); }
.table { min-width: 560px; }
.hint { display: none; font-size: var(--text-xs); color: var(--text-3); }
.form-row { align-items: flex-end; }
.form-row .btn { min-height: 48px; }
.form-row + .help { margin-top: -4px; }
@media (max-width: 860px) {
  .hint { display: block; }
  .bar .grow { flex: 1 1 100%; order: 5; }
  .bar { gap: var(--space-2); }
  .seg { max-width: 100%; }
  .chip { min-height: 44px; }
  .sel select { min-width: 0; }
  .mtop .btn-icon { width: 44px; height: 44px; }
}

.btn-filtres { display: none; }
.filtres { display: contents; }
.chip[disabled] { cursor: not-allowed; color: var(--text-3); background: var(--surface); }
.chip[disabled] .nd { color: var(--text-2); }
@media (hover: none) { .btn-ghost:hover { background: transparent; } .btn:hover { background: var(--surface-raised); } .btn-primary:hover { background: var(--brand); } .nav-i:hover { background: none; } .item:hover { background: transparent; } .item.on { background: var(--info-bg); } }
.table-j td::before { display: none; }
@media (max-width: 640px) {
  .btn-filtres { display: inline-flex; }
  .filtres { display: none; width: 100%; gap: var(--space-2); flex-wrap: wrap; }
  .filtres.open { display: flex; }
  .seg { flex-wrap: wrap; max-width: 100%; }
  .table { min-width: 0; }
  .table thead, .table tfoot { display: none; }
  .table tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0px var(--space-3); padding: var(--space-2) 0; border-bottom: 1px solid var(--border); }
  .table tbody td { display: flex; justify-content: space-between; gap: var(--space-2); padding: 0px 0; border: 0; text-align: right; }
  .table tbody td::before { content: attr(data-label); color: var(--text-3); font-size: var(--text-xs); text-align: left; }
  .table tbody td.jour { grid-column: 1 / -1; position: static; justify-content: flex-start; font-weight: 700; color: var(--text); padding-bottom: var(--space-1); }
  .table tbody td.jour::before { display: none; }
  .hint { display: none; }
}

.seg.seg-wrap { flex-wrap: wrap; }
.seg.seg-wrap .pv-b { white-space: normal; text-align: left; }
.table tbody td .nd { margin-left: auto; }
@media (max-width: 860px) {
  .btn, .chip, .pv-b, .input, select.input { min-height: 44px; }
  .btn-sm { min-height: 44px; }
}

.conv-none { align-self: stretch; }
@media (max-width: 520px) { .kt { padding: var(--space-3); } .kts { gap: var(--space-2); } }


/* ── Écrans de la refonte (13/11) : chiffres, entonnoir, états, analyse, brouillons ── */
.pv-b[aria-pressed="true"] { background: var(--surface-raised); color: var(--brand); box-shadow: var(--shadow); }
.seg { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.seg .pv-b { border-radius: var(--radius-sm); min-height: 44px; }
.lien { font-weight: 700; font-size: var(--text-sm); }
.kts { gap: var(--space-4); margin-bottom: var(--space-6); }
.kt, .kt.neutral { background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-6); gap: var(--space-2); box-shadow: var(--shadow); }
.kt-l { font-size: var(--text-sm); color: var(--text-2); font-weight: 700; }
.kt-v, .kt.neutral .kt-v { display: block; font-size: var(--text-2xl); line-height: 1.1; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.kt-v.nd { font-size: var(--text-lg); color: var(--text-3); }
.kt-s { font-size: var(--text-xs); color: var(--text-3); }
.var { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); font-size: var(--text-xs); color: var(--text-3); }
.var .ico { width: 16px; height: 16px; }
.var b { font-weight: 700; }
.var-ok b, .var-ok .ico { color: var(--success); }
.var-ko b, .var-ko .ico { color: var(--danger); }
.duo { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--space-4); align-items: start; }
.card.sec { display: grid; gap: var(--space-4); }
.card + .card { margin-top: 0; }
.sec + .sec { margin-top: 0; }
.funnel { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4); }
.fn-ligne { display: grid; grid-template-columns: minmax(96px, 1fr) minmax(0, 3fr) auto; grid-template-areas: "nom piste val" ". perte perte"; column-gap: var(--space-4); row-gap: var(--space-1); align-items: center; }
.fn-nom { grid-area: nom; font-size: var(--text-sm); font-weight: 700; color: var(--text); }
.fn-piste { grid-area: piste; display: block; height: 24px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.fn-barre { display: block; height: 100%; border-radius: var(--radius-sm); min-width: var(--space-1); }
.fn-0 { background: color-mix(in oklab, var(--brand) 78%, var(--surface)); }
.fn-1 { background: color-mix(in oklab, var(--brand) 72%, var(--surface)); }
.fn-2 { background: color-mix(in oklab, var(--brand) 66%, var(--surface)); }
.fn-3 { background: color-mix(in oklab, var(--brand) 62%, var(--surface)); }
.fn-4 { background: color-mix(in oklab, var(--brand) 58%, var(--surface)); }
.fn-5 { background: color-mix(in oklab, var(--brand) 54%, var(--surface)); }
.fn-val { grid-area: val; display: flex; gap: var(--space-2); align-items: baseline; justify-content: flex-end; min-width: 72px; font-variant-numeric: tabular-nums; font-size: var(--text-sm); }
.fn-val b { color: var(--text); font-size: var(--text-base); }
.fn-perte { grid-area: perte; font-size: var(--text-xs); color: var(--warning); }
.fn-perte.fn-rien { color: var(--text-3); }
.rows .item { padding: var(--space-3); }
.item { border-radius: var(--radius-sm); }
.item.on { background: var(--info-bg); }
.sk-card { display: grid; gap: var(--space-6); }
.sk-bloc { display: grid; gap: var(--space-2); }
.sk { display: block; height: 14px; border-radius: var(--radius-sm); background: var(--surface); animation: sk-pulse 1.4s ease-in-out infinite; }
.sk-l { width: 40%; height: 18px; } .sk-m { width: 90%; } .sk-s { width: 65%; }
@keyframes sk-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
.empty { padding: var(--space-12) var(--space-6); }
.empty h2 { font-size: var(--text-lg); }
.empty .ico { width: 32px; height: 32px; color: var(--brand); }
.etat-erreur .ico { color: var(--danger); }
.alert-info { background: var(--info-bg); color: var(--text); }
.alert-info .ico { color: var(--brand); }
.alert-warn { background: var(--warning-bg); color: var(--text); }
.alert-warn .ico { color: var(--warning); }
.alert-err { background: var(--danger-bg); color: var(--text); }
.alert-err .ico { color: var(--danger); }
.ptabs { display: flex; overflow-x: auto; white-space: nowrap; scrollbar-width: thin; gap: var(--space-1); border-bottom: 1px solid var(--border); margin-bottom: var(--space-6); }
.ptab { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; padding: var(--space-2) var(--space-4); border: 0; border-bottom: 0; background: none; color: var(--text-2); font-weight: 700; font-size: var(--text-sm); cursor: pointer; }
.ptab:hover { color: var(--text); }
.ptab[aria-current="page"] { color: var(--brand); box-shadow: inset 0 -2px 0 var(--brand); }
.ptab:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: -2px; }
.ptab .n { min-width: 20px; padding: 0 var(--space-2); border-radius: var(--pill); background: var(--info-bg); color: var(--brand); font-size: var(--text-xs); text-align: center; line-height: 20px; }
/* Analyse d'une conversation */
.analyse { display: grid; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.analyse > summary { display: flex; align-items: center; gap: var(--space-2); font-weight: 700; font-size: var(--text-sm); cursor: pointer; min-height: 44px; color: var(--text); }
.analyse > summary:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.constats { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.constat { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: var(--space-3); align-items: start; }
.constat .ico { width: 20px; height: 20px; margin-top: var(--space-1); }
.constat b { display: block; font-size: var(--text-sm); color: var(--text); }
.constat p { font-size: var(--text-sm); color: var(--text-2); margin: 0; }
.constat small { display: block; font-size: var(--text-xs); color: var(--text-3); margin-top: var(--space-1); }
.constat.bien .ico { color: var(--success); }
.constat.moyen .ico { color: var(--warning); }
.constat.a_corriger .ico { color: var(--danger); }
.constat .niv { font-size: var(--text-xs); font-weight: 700; }
.constat.bien .niv { color: var(--success); } .constat.moyen .niv { color: var(--warning); } .constat.a_corriger .niv { color: var(--danger); }
/* Brouillons de relance */
.brouillon { grid-column: 1 / -1; display: grid; gap: var(--space-2); padding: var(--space-3) 0 var(--space-1); }
.etat-enreg { font-size: var(--text-xs); color: var(--text-3); }
@media (max-width: 1100px) { .duo { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) {
  .kts { gap: var(--space-3); }
  .kt, .kt.neutral { padding: var(--space-4); }
  .kt-v, .kt.neutral .kt-v { font-size: var(--text-xl); }
  .head-act { width: 100%; }
  .head-act .seg { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); }
  .head-act .btn-primary { width: 100%; }
  .fn-ligne { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "nom val" "piste piste" "perte perte"; }
}

/* Titres plus gros et en gras, contenu plus petit (veille multi-appareils 13/11) : page 24 px sur téléphone, 32 px dès 840 px ; section 18 px puis 24 px */
h1, .head h1 { font-size: var(--text-xl); font-weight: 700; letter-spacing: -0.02em; }
.card h2, .sec h2, .empty h2 { font-size: var(--text-lg); font-weight: 700; }
.input, textarea.input, select.input { font-size: var(--text-base); }
@media (min-width: 840px) {
  h1, .head h1 { font-size: var(--text-2xl); }
  .card h2, .sec h2, .empty h2 { font-size: var(--text-xl); }
}
/* Sous-titres de bloc (fiche, analyse) au niveau 16 px gras : plus gros que le contenu à 14 px. Seuls pastilles et compteurs restent à 12 px. */
.card h3, .panel h3, .fiche h3, .analyse summary, details > summary { font-size: var(--text-base); font-weight: 700; color: var(--text); }
.kt-s, .meta, .when, .day, .nd, .niv, small, dt, .jour, .num { font-size: var(--text-sm); }
#page > .card + .card, #page > .card + .duo, #page > .duo + .card { margin-top: var(--space-4); }
.kts .kt-l { min-height: calc(var(--space-6) + var(--space-6)); }
/* Finitions : lien d'action lisible, valeur « non disponible » calée à droite, cartes espacées sur téléphone */
.btn-ghost { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.table tbody td .nd { margin-left: auto; text-align: right; }
@media (max-width: 839px) { #page > .card + .card, #page > .card + .duo, #page > .duo + .card, .kts + .duo { margin-top: var(--space-4); } .duo, .kts { row-gap: var(--space-4); } }
.fn-raison { color: var(--text); font-weight: 700; }
.citation { margin: var(--space-2) 0 0; padding: var(--space-2) var(--space-3); border-left: 3px solid var(--border-strong); background: var(--surface); border-radius: var(--radius-sm); color: var(--text); font-size: var(--text-sm); overflow-wrap: anywhere; }
.citation span { font-weight: 700; }
.input-sm { width: auto; min-height: 44px; padding: var(--space-2) var(--space-3); font-size: var(--text-sm); }

/* Relances : compteur en pastille dans le filtre, lien tactile */
.chip { display: inline-flex; align-items: center; gap: var(--space-2); }
.chip .n { min-width: 22px; padding: 0 var(--space-1); border-radius: var(--pill); background: var(--surface); color: var(--text-2); font-size: var(--text-xs); line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] .n { background: var(--info-bg); color: var(--brand); }
.lien { display: inline-flex; align-items: center; min-height: 44px; }

/* ── Refonte du 14/11 : plus rond, plus contrasté, plus petit, menu à sous-menus, recherche (mesures d'Insyder relevées dans Chrome) ──
   Rayons : cartes 14, champs 10, boutons et filtres en pilule. Actif = pilule sombre (--ink). Ombres seulement sur ce qui flotte. */
.btn { border-radius: var(--pill); border-color: var(--border-strong); }
.btn-primary { border-color: var(--brand); }
.btn-ghost { border-color: transparent; }
.input { border-radius: var(--radius-sm); border-color: var(--border-strong); min-height: 44px; }
.card, .panel, .kt, .kt.neutral, .analyse, .acc-btn { border-radius: var(--radius-md); box-shadow: none; }
.card { padding: var(--space-6); }
.chip { border-color: var(--border-strong); min-height: 36px; }
.chip:hover { border-color: var(--ink); color: var(--text); }
.chip[aria-pressed="true"], .pv-b[aria-pressed="true"], .pv-b[aria-selected="true"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); box-shadow: none; }
.chip[aria-pressed="true"] .n, .pv-b[aria-pressed="true"] .n, .pv-b[aria-selected="true"] .n { background: var(--on-ink); color: var(--ink); }
.seg { border-radius: var(--pill); }
.seg .pv-b, .pv-b { border-radius: var(--pill); }
.tag, .pill, .kw { border-radius: var(--pill); }
.b { border-radius: var(--radius-md); }
.b.in { border-bottom-left-radius: 4px; } .b.out { border-bottom-right-radius: 4px; }
.item { border-radius: var(--radius-sm); }
.item.on { background: var(--surface); box-shadow: inset 3px 0 0 var(--ink); }
.toast, .pal { box-shadow: var(--shadow-up); }
.kt-v, .kt.neutral .kt-v { font-size: var(--text-2xl); }
.kts .kt-l { min-height: 0; }
.ptab[aria-current="page"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--ink); }

/* Menu latéral : groupes, sous-menus repliables, recherche */
.nav { gap: var(--space-4); }
.nav-g { display: grid; gap: var(--space-1); }
.nav-t { padding: 0 var(--space-3); font-size: var(--text-xs); font-weight: 700; color: var(--text-3); letter-spacing: .04em; text-transform: uppercase; margin-bottom: var(--space-1); }
.nav-i { border-radius: var(--pill); font-size: var(--text-sm); }
.nav-i[aria-current="page"] { background: var(--ink); color: var(--on-ink); }
.nav-i[aria-current="page"] .ico { color: var(--on-ink); }
.nav-i[aria-current="page"] .nav-n { background: var(--on-ink); color: var(--ink); }
.nav-i:hover { background: var(--surface); }
.nav-i[aria-current="page"]:hover { background: var(--ink); color: var(--on-ink); }
.nav-i .chev { margin-left: auto; width: 16px; height: 16px; transition: transform var(--dur-court) var(--ease-sortie); }
.nav-i .nav-n:not(.hidden) { margin-left: auto; }
.nav-i .nav-n:not(.hidden) + .chev { margin-left: var(--space-1); }
.nav-i[aria-expanded="true"] .chev { transform: rotate(90deg); }
.nav-sub { display: none; margin: var(--space-1) 0 var(--space-1) var(--space-6); padding-left: var(--space-2); border-left: 1px solid var(--border); gap: 0; }
.nav-sub.open { display: grid; }
.nav-s { display: flex; align-items: center; min-height: 44px; padding: var(--space-2) var(--space-3); border-radius: var(--pill); color: var(--text-2); font-weight: 700; font-size: var(--text-sm); text-decoration: none; }
.nav-s:hover { background: var(--surface); color: var(--text); }
.nav-s[aria-current="page"] { color: var(--text); background: var(--surface); box-shadow: inset 0 0 0 1px var(--border-strong); }
.nav-s:focus-visible, .nav-search:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: -2px; }
.nav-search { display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 44px; padding: var(--space-2) var(--space-3); border: 1px solid var(--border-strong); border-radius: var(--pill); background: var(--surface-raised); color: var(--text-3); font-size: var(--text-sm); cursor: pointer; text-align: left; }
.nav-search:hover { color: var(--text); border-color: var(--ink); }
.nav-search span { flex: 1; }
kbd { font-family: inherit; font-size: var(--text-xs); font-weight: 700; color: var(--text-3); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 var(--space-2); background: var(--surface); }
.bnav .nav-i[aria-current="page"] { background: var(--ink); color: var(--on-ink); border-radius: var(--radius-md); }
.mtop .btn-icon { flex: none; }

/* Palette de recherche */
.pal-fond { position: fixed; inset: 0; z-index: 90; background: var(--overlay); display: grid; justify-items: center; align-items: start; padding: 12vh var(--space-4) var(--space-4); }
.pal { width: 100%; max-width: 560px; max-height: 70vh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.pal-top { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border); }
.pal-top .ico { color: var(--text-3); }
.pal-in { flex: 1; min-width: 0; min-height: 44px; border: 0; background: transparent; color: var(--text); font-size: var(--text-lg); outline: none; }
.pal-liste { overflow-y: auto; padding: var(--space-2); display: grid; align-content: start; }
.pal-t { padding: var(--space-3) var(--space-3) var(--space-1); font-size: var(--text-xs); font-weight: 700; color: var(--text-3); }
.pal-i { display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 44px; padding: var(--space-2) var(--space-3); border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text); font-size: var(--text-base); text-align: left; cursor: pointer; }
.pal-i[aria-selected="true"] { background: var(--ink); color: var(--on-ink); }
.pal-i .ico { color: var(--text-3); }
.pal-i[aria-selected="true"] .ico, .pal-i[aria-selected="true"] .pal-s { color: var(--on-ink); }
.pal-l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-s { color: var(--text-3); font-size: var(--text-sm); }
.pal-vide { padding: var(--space-6); text-align: center; color: var(--text-3); }
.pal-pied { padding: var(--space-2) var(--space-4); border-top: 1px solid var(--border); font-size: var(--text-xs); color: var(--text-3); }

/* Téléphone : les champs restent à 16 px (sinon iOS zoome) */
@media (max-width: 839px) { .input, textarea.input, select.input, .pal-in, .compose textarea, .fiche textarea { font-size: var(--text-lg); } .card { padding: var(--space-4); } }

/* Corrections après contrôle visuel (14/11) */
.side-foot { position: sticky; bottom: 0; background: var(--surface-raised); padding-bottom: var(--space-1); }
.nav-i[aria-expanded="true"][aria-current="page"] { background: transparent; color: var(--text); }
.nav-i[aria-expanded="true"][aria-current="page"] .ico { color: var(--text); }
.nav-i[aria-expanded="true"][aria-current="page"] .nav-n { background: var(--ink); color: var(--on-ink); }
.nav-s[aria-current="page"] { background: var(--ink); color: var(--on-ink); box-shadow: none; }
.input:not(textarea), select.input { border-radius: var(--pill); padding-left: var(--space-4); }
textarea.input { border-radius: var(--radius-md); padding-left: var(--space-4); }
.row-act { align-items: center; flex-wrap: nowrap; }
.row-act select.input { width: auto; min-width: 150px; flex: none; }
.row-act .btn { flex: none; }
@media (max-width: 1100px) { .row-act { flex-wrap: wrap; } }
.fn-0, .fn-1, .fn-2, .fn-3, .fn-4, .fn-5 { background: var(--brand); }
input::placeholder, textarea::placeholder { color: var(--text-3); opacity: 1; }
@media (min-width: 840px) { .side { overflow: hidden; } .side .nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; align-content: start; } .side-foot { position: static; margin-top: 0; flex: none; } }
.row-act select.input { min-width: 176px; text-overflow: clip; }
@media (min-width: 840px) { .side { gap: var(--space-2); } .side .nav { gap: var(--space-3); } .side-foot { gap: 0; padding-top: var(--space-2); } .simu { padding: var(--space-1) var(--space-3); } }

/* File « À relancer maintenant » */
.todo { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) 0; border-top: 1px solid var(--border); }
.todo:first-child { border-top: 0; }
.todo-main { flex: 1 1 auto; min-width: 0; display: grid; gap: var(--space-1); }
.todo-prop { font-size: var(--text-sm); color: var(--text-2); overflow-wrap: anywhere; }
.score { flex: 0 0 auto; min-width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--pill); font-weight: 700; font-size: var(--text-base); font-variant-numeric: tabular-nums; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.score-el { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.score-mo { background: var(--warning-bg); color: var(--warning); border-color: var(--warning); }
@media (max-width: 599px) { .todo { flex-wrap: wrap; } .todo .btn { width: 100%; } }

.todo-main .it-top { justify-content: flex-start; flex-wrap: wrap; gap: var(--space-2); }
.todo-prop { padding: var(--space-2) var(--space-3); background: var(--surface); border-radius: var(--radius-sm); color: var(--text); }

/* Fiche offre */
.check { display: flex; align-items: center; gap: var(--space-2); min-height: 44px; font-size: var(--text-base); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--brand); }
#offre-page, .offre-page { max-width: 720px; }
.offre-page .card.sec { max-width: 720px; }
.row-i-col { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); align-items: stretch; }
.offre-page > p.muted { margin-bottom: var(--space-4); }
.row-i-col .row-act { justify-content: flex-end; }

/* Proposition de l'IA */
.ia-carte { display: grid; gap: var(--space-2); margin-bottom: var(--space-3); }
.ia-texte { font-size: var(--text-base); color: var(--text); white-space: pre-wrap; }
