/* Docarter — charte graphique « santé » : bleus francs, surfaces claires, cartes arrondies.
   Aucune ressource externe (polices système, icônes SVG en ligne). */

:root {
  --brand: #0b5ed7;
  --brand-600: #094db3;
  --brand-700: #083e8f;
  --brand-50: #eef5ff;
  --brand-100: #d9e8ff;
  --brand-200: #b7d2ff;
  --teal: #12b3a8;
  --ink: #0b1f3a;
  --ink-2: #34496a;
  --muted: #6a7b95;
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --line: #e2e9f3;
  --line-2: #cfd9e7;
  --success: #0b8a5f;
  --success-50: #e5f6ef;
  --warning: #b36b00;
  --warning-50: #fff4dc;
  --danger: #d62839;
  --danger-50: #fdebed;
  --info: #1d5fd1;
  --info-50: #e8f0ff;
  --neutral: #5d6b80;
  --neutral-50: #eef1f6;
  --highlight: #ffd84d;
  --mark: #fff0b3;
  --radius: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(11, 31, 58, .06);
  --shadow: 0 6px 24px rgba(11, 31, 58, .07), 0 1px 2px rgba(11, 31, 58, .05);
  --shadow-lg: 0 18px 48px rgba(11, 31, 58, .14);
  --header-grad: linear-gradient(120deg, #0a4fc0 0%, #0b5ed7 55%, #1185d6 100%);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "SF Pro Text", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "SF Pro Display", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #4c8dff; --brand-600: #6aa0ff; --brand-700: #8fb7ff; --brand-50: #12213b; --brand-100: #172b4d; --brand-200: #24406f;
    --teal: #2fd0c4; --ink: #e7eefb; --ink-2: #c3d0e6; --muted: #8fa0bb;
    --bg: #0b1322; --surface: #111c30; --surface-2: #15223a; --line: #213252; --line-2: #2c4168;
    --success: #4fd39c; --success-50: #10291f; --warning: #f3b54a; --warning-50: #2e2410; --danger: #ff6b78; --danger-50: #351419;
    --info: #79a8ff; --info-50: #13233f; --neutral: #a3b0c4; --neutral-50: #1a2538; --mark: #5a4a10;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 6px 24px rgba(0, 0, 0, .35); --shadow-lg: 0 18px 48px rgba(0, 0, 0, .5);
    --header-grad: linear-gradient(120deg, #0a2f6e 0%, #0b3f8f 60%, #0c5a8f 100%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #4c8dff; --brand-600: #6aa0ff; --brand-700: #8fb7ff; --brand-50: #12213b; --brand-100: #172b4d; --brand-200: #24406f;
  --teal: #2fd0c4; --ink: #e7eefb; --ink-2: #c3d0e6; --muted: #8fa0bb;
  --bg: #0b1322; --surface: #111c30; --surface-2: #15223a; --line: #213252; --line-2: #2c4168;
  --success: #4fd39c; --success-50: #10291f; --warning: #f3b54a; --warning-50: #2e2410; --danger: #ff6b78; --danger-50: #351419;
  --info: #79a8ff; --info-50: #13233f; --neutral: #a3b0c4; --neutral-50: #1a2538; --mark: #5a4a10;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 6px 24px rgba(0, 0, 0, .35); --shadow-lg: 0 18px 48px rgba(0, 0, 0, .5);
  --header-grad: linear-gradient(120deg, #0a2f6e 0%, #0b3f8f 60%, #0c5a8f 100%);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.25; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.12rem; font-weight: 700; }
h3 { font-size: .95rem; font-weight: 650; color: var(--ink-2); }
p { margin: 0 0 .75rem; }
a { color: var(--brand); }
svg.i { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); }
mark { background: var(--mark); color: inherit; border-radius: 4px; padding: 0 3px; }

/* ======================================================================= en-tête */
.app-header { background: var(--header-grad); color: #fff; position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 12px rgba(8, 40, 100, .25); }
.app-header-inner { max-width: 1280px; margin: 0 auto; padding: .75rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .75rem; min-width: 0; color: inherit; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; background: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 4px 12px rgba(0, 0, 0, .15); }
.brand-mark svg { width: 24px; height: 24px; }
.brand-text strong { display: block; font-family: var(--font-display); font-size: 1.15rem; letter-spacing: .01em; white-space: nowrap; }
.brand-text span { display: block; font-size: .8rem; opacity: .85; white-space: nowrap; }
.header-right { display: flex; align-items: center; gap: .6rem; }
.user-chip { display: flex; align-items: center; gap: .5rem; padding: .3rem .8rem .3rem .35rem; border-radius: 999px; background: rgba(255, 255, 255, .14); font-size: .88rem; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: #fff; color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: .78rem; }
.app-header .btn-header { background: rgba(255, 255, 255, .14); color: #fff; border: 1px solid rgba(255, 255, 255, .25); }
.app-header .btn-header:hover:not(:disabled) { background: rgba(255, 255, 255, .24); }
.badge-demo { background: var(--highlight); color: #3d2e00; font-weight: 800; font-size: .7rem; letter-spacing: .06em; padding: .2rem .55rem; border-radius: 999px; }
.demo-strip { background: #fff7d6; color: #6b5200; text-align: center; font-size: .86rem; padding: .45rem 1rem; border-bottom: 1px solid #f3e3a1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .demo-strip { background: #2e2710; color: #f3d77a; border-color: #4a3d14; } }

/* ======================================================================= étapes */
.stepper { max-width: 1280px; margin: 1.4rem auto .4rem; padding: 0 1.5rem; }
.stepper ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; position: relative; }
.stepper li { display: flex; align-items: center; gap: .65rem; color: var(--muted); font-weight: 600; font-size: .92rem; position: relative; padding-right: 1rem; }
.stepper li::after { content: ""; flex: 1; height: 2px; background: var(--line-2); border-radius: 2px; margin-left: .25rem; }
.stepper li:last-child::after { display: none; }
.stepper .dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface); border: 2px solid var(--line-2); color: var(--muted); font-weight: 700; transition: all .2s; }
.stepper li[aria-current="step"] { color: var(--ink); }
.stepper li[aria-current="step"] .dot { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 0 0 5px var(--brand-100); }
.stepper li.done { color: var(--ink-2); }
.stepper li.done .dot { background: var(--success-50); border-color: var(--success); color: var(--success); }
.stepper li.done::after { background: var(--success); }

main { max-width: 1280px; margin: 0 auto; padding: 1rem 1.5rem 4rem; }

/* ======================================================================= cartes */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.35rem; box-shadow: var(--shadow); }
.card + .card { margin-top: 1rem; }
.card-head { display: flex; align-items: center; gap: .7rem; margin-bottom: 1rem; }
.card-head h2 { margin: 0; }
.card-head p { margin: .1rem 0 0; }
.icon-badge { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--brand-50); color: var(--brand); }
.icon-badge svg { width: 20px; height: 20px; }
.icon-badge.teal { background: #e3f8f6; color: #0b8f86; }
.icon-badge.amber { background: var(--warning-50); color: var(--warning); }
.icon-badge.red { background: var(--danger-50); color: var(--danger); }
.icon-badge.green { background: var(--success-50); color: var(--success); }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.25rem; align-items: start; }
.side { position: sticky; top: 6.2rem; display: grid; gap: 1rem; }
.side .card + .card { margin-top: 0; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; }

/* ================================================================== formulaires */
label { display: block; font-size: .86rem; font-weight: 600; color: var(--ink-2); margin: 0 0 .85rem; }
input[type="text"], input[type="password"], input[type="number"], input:not([type]), select, textarea {
  display: block; width: 100%; margin-top: .35rem; padding: .65rem .85rem; min-height: 44px;
  font: inherit; font-weight: 400; color: var(--ink); background: var(--surface-2);
  border: 1.5px solid var(--line-2); border-radius: var(--radius-sm); transition: border-color .15s, box-shadow .15s, background .15s;
}
input:hover, select:hover, textarea:hover { border-color: var(--brand-200); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 4px var(--brand-100); }
textarea { resize: vertical; line-height: 1.6; min-height: 8rem; }
#transcript, #pseudo-text { min-height: 22rem; font-size: .95rem; }
button:focus-visible, .btn:focus-visible, .seg-btn:focus-visible, .module-card:focus-visible { outline: 3px solid var(--brand-200); outline-offset: 2px; }
.check { display: flex; align-items: flex-start; gap: .65rem; font-size: .93rem; font-weight: 500; color: var(--ink); margin: 1rem 0 0; padding: .85rem 1rem; background: var(--brand-50); border-radius: var(--radius-sm); }
.check input { margin-top: .2rem; width: 1.1rem; height: 1.1rem; accent-color: var(--brand); flex: none; }

.btn, button {
  font: inherit; font-size: .93rem; font-weight: 650; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 42px; padding: .55rem 1.1rem; border-radius: var(--radius-sm); border: 1.5px solid transparent;
  background: var(--neutral-50); color: var(--ink); white-space: nowrap; transition: background .15s, transform .05s, box-shadow .15s;
}
button:active:not(:disabled) { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(11, 94, 215, .28); }
.btn-primary:hover:not(:disabled) { background: var(--brand-600); }
.btn-secondary { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-secondary:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--brand-50); color: var(--brand); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-lg { min-height: 50px; padding: .7rem 1.5rem; font-size: 1rem; border-radius: 12px; }
button:disabled, .btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
label.btn { margin: 0; }
.link { background: none; border: none; padding: 0; min-height: 0; color: var(--brand); font-weight: 600; cursor: pointer; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.footer-actions { display: flex; justify-content: flex-end; align-items: center; gap: .6rem; margin-top: 1.25rem; }
.footer-actions .hint { margin-right: auto; color: var(--muted); font-size: .86rem; }

/* ======================================================================= onglets */
.tabs { display: inline-flex; gap: .25rem; padding: .3rem; background: var(--neutral-50); border-radius: 12px; margin-bottom: 1.1rem; max-width: 100%; overflow-x: auto; }
.tabs button { background: transparent; border: none; min-height: 38px; padding: .45rem 1rem; color: var(--ink-2); font-weight: 650; border-radius: 9px; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .85rem; }
.panel-head p { margin: 0; }
.sample-select { width: auto; min-height: 42px; margin: 0; padding-right: 2rem; }

/* ================================================================= questionnaire */
.q-block { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); margin-bottom: .7rem; overflow: hidden; }
.q-block > summary { cursor: pointer; padding: .85rem 1rem; font-weight: 650; list-style: none; display: flex; align-items: center; gap: .6rem; }
.q-block > summary::-webkit-details-marker { display: none; }
.q-block > summary::after { content: ""; margin-left: auto; width: .55rem; height: .55rem; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
.q-block:not([open]) > summary::after { transform: rotate(-45deg); }
.q-block > summary .count { margin-left: auto; font-size: .75rem; font-weight: 700; color: var(--brand); background: var(--brand-50); padding: .1rem .55rem; border-radius: 999px; }
.q-block > summary .count:empty { display: none; }
.q-body { padding: .2rem 1rem 1rem; }
.q-sub { font-size: .78rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1rem 0 .35rem; }
.q-sub:first-child { margin-top: .3rem; }

.finding-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .5rem 0; border-top: 1px solid var(--line); }
.finding-row:first-of-type { border-top: none; }
.finding-label { font-size: .92rem; }
.finding-controls { display: flex; gap: .5rem; align-items: center; flex: none; }
.finding-controls select { width: auto; min-height: 34px; margin: 0; padding: .25rem .5rem; font-size: .82rem; }
.seg { display: inline-flex; background: var(--neutral-50); border-radius: 999px; padding: 3px; flex: none; }
.seg-btn { border: none; min-height: 30px; padding: .2rem .8rem; border-radius: 999px; font-size: .82rem; font-weight: 650; background: transparent; color: var(--muted); }
.seg-btn[aria-pressed="true"] { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.seg-btn[data-value="absent"][aria-pressed="true"] { background: var(--ink-2); color: var(--surface); }
.seg-btn[data-value=""][aria-pressed="true"] { background: var(--surface); color: var(--ink-2); }
.field-row { display: flex; align-items: center; gap: 1rem; margin-bottom: .9rem; flex-wrap: wrap; }
.field-label { font-size: .86rem; font-weight: 600; color: var(--ink-2); min-width: 3.5rem; }
.measure-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .1rem .9rem; }
.measure { margin-bottom: .55rem; }
.input-unit { position: relative; }
.input-unit input { padding-right: 3.8rem; }
.unit { position: absolute; right: .8rem; top: 50%; transform: translateY(-15%); color: var(--muted); font-size: .78rem; font-weight: 600; pointer-events: none; }
.computed { display: inline-flex; align-items: center; gap: .4rem; font-size: .9rem; font-weight: 600; padding: .45rem .8rem; background: var(--brand-50); color: var(--brand-700); border-radius: 999px; }

.module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .7rem; margin-bottom: 1rem; }
.module-card { text-align: left; display: flex; flex-direction: column; align-items: flex-start; gap: .45rem; min-height: 0; padding: .9rem; border-radius: var(--radius-md); background: var(--surface); border: 1.5px solid var(--line); white-space: normal; position: relative; }
.module-card:hover { border-color: var(--brand-200); box-shadow: var(--shadow); }
.module-card .m-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }
.module-card .m-icon svg { width: 20px; height: 20px; }
.module-card strong { font-size: .93rem; color: var(--ink); }
.module-card small { color: var(--muted); font-weight: 400; font-size: .78rem; line-height: 1.4; }
.module-card[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 3px var(--brand-100); }
.module-card[aria-pressed="true"] .m-icon { background: var(--brand); color: #fff; }
.module-card .m-flag { position: absolute; top: .6rem; right: .6rem; font-size: .68rem; font-weight: 750; padding: .1rem .45rem; border-radius: 999px; background: #e3f8f6; color: #0b8f86; }
.module-panel { border: 1.5px solid var(--brand-100); border-radius: var(--radius-md); padding: .4rem 1rem 1rem; margin-bottom: .8rem; background: var(--surface); }
.module-panel > h3 { display: flex; align-items: center; gap: .5rem; color: var(--brand-700); margin: .7rem 0 .2rem; }

.table-wrap { overflow-x: auto; }
table.epworth { width: 100%; border-collapse: collapse; font-size: .88rem; }
table.epworth th, table.epworth td { padding: .45rem .35rem; border-bottom: 1px solid var(--line); text-align: center; }
table.epworth th:first-child, table.epworth td:first-child { text-align: left; }
table.epworth input { width: 1.1rem; height: 1.1rem; accent-color: var(--brand); }

/* ============================================================ scores en direct */
.live-modules { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .75rem; }
.live-score { padding: .7rem .8rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); margin-bottom: .5rem; }
.live-score .top { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.live-score .name { font-weight: 650; font-size: .88rem; }
.live-score .value { font-family: var(--mono); font-weight: 700; font-size: .92rem; }
.live-score .interp { font-size: .8rem; color: var(--muted); margin-top: .25rem; }
.gauge { height: 6px; border-radius: 99px; background: var(--neutral-50); overflow: hidden; margin-top: .45rem; }
.gauge > span { display: block; height: 100%; border-radius: 99px; background: var(--neutral); }
.lvl-bas .gauge > span, .gauge.lvl-bas > span { background: var(--success); }
.lvl-intermediaire .gauge > span, .gauge.lvl-intermediaire > span { background: var(--warning); }
.lvl-eleve .gauge > span, .gauge.lvl-eleve > span { background: var(--danger); }
.empty { text-align: center; color: var(--muted); font-size: .86rem; padding: 1rem .5rem; }
.empty svg { width: 28px; height: 28px; color: var(--brand-200); display: block; margin: 0 auto .4rem; }

.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .6rem; border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.pill-bas, .pill-ok { background: var(--success-50); color: var(--success); }
.pill-intermediaire, .pill-warn { background: var(--warning-50); color: var(--warning); }
.pill-eleve, .pill-danger { background: var(--danger-50); color: var(--danger); }
.pill-indetermine, .pill-neutral { background: var(--neutral-50); color: var(--neutral); }
.pill-brand { background: var(--brand-50); color: var(--brand); }

/* ========================================================================= audio */
.recorder { display: flex; align-items: center; gap: 1rem; margin: 1rem 0; flex-wrap: wrap; padding: 1rem; border-radius: var(--radius-md); background: var(--surface-2); border: 1px dashed var(--line-2); }
.rec-button { width: 64px; height: 64px; border-radius: 50%; padding: 0; background: var(--danger); color: #fff; box-shadow: 0 8px 20px rgba(214, 40, 57, .3); }
.rec-button svg { width: 26px; height: 26px; }
.rec-button.stop { background: var(--ink); }
#rec-timer { font-size: 1.4rem; font-weight: 700; color: var(--ink-2); }
.rec-dot { width: .7rem; height: .7rem; border-radius: 50%; background: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.or { margin: 1rem 0; color: var(--muted); font-size: .85rem; display: flex; align-items: center; gap: .75rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
audio { width: 100%; margin-bottom: .5rem; }
.banner { display: flex; gap: .6rem; align-items: flex-start; padding: .8rem 1rem; border-radius: var(--radius-sm); font-size: .9rem; margin-bottom: 1rem; }
.banner svg { margin-top: .1rem; }
.banner-info { background: var(--info-50); color: var(--info); }
.banner-warn { background: var(--warning-50); color: var(--warning); }
.banner-danger { background: var(--danger-50); color: var(--danger); }

/* ================================================================== vérification */
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .7rem; border-radius: 999px; background: var(--brand-50); color: var(--brand); font-size: .8rem; font-weight: 700; }
.preview { white-space: pre-wrap; font-size: .93rem; line-height: 1.6; padding: .85rem; margin-top: .35rem; background: var(--surface-2); border: 1.5px solid var(--line); border-radius: var(--radius-sm); min-height: 22rem; max-height: 36rem; overflow: auto; }

/* ====================================================================== pipeline */
.pipeline { list-style: none; padding: 0; margin: 1.2rem 0 0; position: relative; }
.pipeline::before { content: ""; position: absolute; left: 21px; top: 22px; bottom: 22px; width: 2px; background: var(--line); }
.pipeline li { display: grid; grid-template-columns: 44px 1fr auto; gap: 1rem; align-items: center; padding: .65rem 0; position: relative; }
.pipeline .icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line-2); color: var(--muted); z-index: 1; }
.pipeline .icon svg { width: 20px; height: 20px; }
.pipeline .label { font-weight: 700; }
.pipeline .desc { font-size: .84rem; color: var(--muted); }
.pipeline .status { font-size: .8rem; font-weight: 700; color: var(--muted); }
.pipeline li.running .icon { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 6px var(--brand-100); animation: breathe 1.4s ease-in-out infinite; }
.pipeline li.running .status { color: var(--brand); }
.pipeline li.done .icon { background: var(--success); border-color: var(--success); color: #fff; }
.pipeline li.done .status { color: var(--success); }
.pipeline li.error .icon { background: var(--danger); border-color: var(--danger); color: #fff; }
.pipeline li.skipped { opacity: .5; }
@keyframes breathe { 50% { box-shadow: 0 0 0 10px var(--brand-50); } }
.progress-hero { display: flex; align-items: center; gap: 1rem; }
.progress-bar { height: 8px; border-radius: 99px; background: var(--neutral-50); overflow: hidden; margin-top: .9rem; }
.progress-bar > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--teal)); border-radius: 99px; transition: width .4s; }
@media (prefers-reduced-motion: reduce) { .pipeline li.running .icon, .rec-dot { animation: none; } }

/* ======================================================================= rapport */
.report-toolbar { display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; margin-bottom: 1rem; }
.report { display: grid; gap: 1rem; }
.report > section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.35rem; box-shadow: var(--shadow); }
.section-title { display: flex; align-items: center; gap: .65rem; margin-bottom: 1rem; }
.section-title h2 { margin: 0; }
.report-meta { color: var(--muted); font-size: .82rem; }
.hero { position: relative; overflow: hidden; border: none !important; color: #fff; background: linear-gradient(125deg, #0a4fc0, #0b5ed7 60%, #12a0c9) !important; }
.hero.v-ok { background: linear-gradient(125deg, #08734f, #0b8a5f 60%, #12b3a8) !important; }
.hero.v-warn { background: linear-gradient(125deg, #9a5a00, #c27803 60%, #e39b1c) !important; }
.hero.v-danger { background: linear-gradient(125deg, #a51d2b, #d62839 60%, #ec5a4f) !important; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.hero .eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 800; opacity: .85; }
.hero .verdict-title { font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; margin: .2rem 0 .3rem; }
.hero p { opacity: .95; position: relative; z-index: 1; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin-top: 1rem; position: relative; z-index: 1; }
.kpi { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); border-radius: var(--radius-md); padding: .8rem .95rem; backdrop-filter: blur(4px); }
.kpi .k { font-size: .76rem; opacity: .85; font-weight: 600; }
.kpi .v { font-size: 1.02rem; font-weight: 750; margin-top: .15rem; }
.module-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .9rem; position: relative; z-index: 1; }
.module-tags span { background: rgba(255, 255, 255, .18); padding: .2rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 650; }

.alerts { display: grid; gap: .55rem; }
.alert { display: grid; grid-template-columns: auto 1fr; gap: .75rem; padding: .8rem 1rem; border-radius: var(--radius-sm); font-size: .92rem; border-left: 4px solid; }
.alert svg { margin-top: .12rem; }
.alert-critique { background: var(--danger-50); color: var(--danger); border-color: var(--danger); }
.alert-important { background: var(--warning-50); color: var(--warning); border-color: var(--warning); }
.alert-information { background: var(--info-50); color: var(--info); border-color: var(--info); }
.alert .msg { color: var(--ink); }
.alert .tag { display: block; font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; margin-bottom: .1rem; }

.score-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .8rem; }
.score-card { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 1rem; background: var(--surface-2); }
.score-card .mod { font-size: .72rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.score-card .name { font-weight: 700; margin-top: .1rem; }
.score-card .big { font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; margin: .3rem 0 0; line-height: 1.2; }
.score-card .big.text { font-size: 1.1rem; }
.score-card .big small { font-size: .9rem; color: var(--muted); font-weight: 600; }
.score-card .interp { font-size: .84rem; color: var(--ink-2); margin-top: .5rem; }
.score-card details { margin-top: .5rem; font-size: .82rem; }
.score-card summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.score-card ul { padding-left: 1.1rem; margin: .4rem 0 0; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.report ul, .report ol { margin: .25rem 0 .5rem; padding-left: 1.2rem; }
.report li { margin: .25rem 0; }
.list-pour, .list-contre, .list-check { list-style: none; padding-left: 0 !important; }
.list-pour li, .list-contre li, .list-check li { position: relative; padding-left: 1.5rem; }
.list-pour li::before, .list-contre li::before, .list-check li::before { position: absolute; left: 0; top: .05rem; width: 1.1rem; height: 1.1rem; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 800; }
.list-pour li::before { content: "+"; background: var(--success-50); color: var(--success); }
.list-contre li::before { content: "−"; background: var(--danger-50); color: var(--danger); }
.list-check li::before { content: "✓"; background: var(--brand-50); color: var(--brand); }
.sub { margin-top: 1rem; }
.sub:first-child { margin-top: 0; }
.urgency { display: flex; align-items: center; gap: .8rem; padding: .9rem 1rem; border-radius: var(--radius-md); margin-bottom: 1rem; }
.urgency strong { display: block; }
.urgency.u-urgence_immediate { background: var(--danger-50); color: var(--danger); }
.urgency.u-consultation_rapide { background: var(--warning-50); color: var(--warning); }
.urgency.u-prise_en_charge_habituelle { background: var(--success-50); color: var(--success); }
.urgency span { color: var(--ink-2); font-size: .9rem; }
table.data { width: 100%; border-collapse: collapse; font-size: .87rem; }
table.data th, table.data td { text-align: left; padding: .5rem .55rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { color: var(--muted); font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.hyp-card { border: 1px solid var(--line); border-radius: var(--radius-md); padding: .95rem 1rem; margin-top: .7rem; background: var(--surface-2); }
.hyp-card.grave { border-color: var(--danger); background: var(--danger-50); }
.hyp-title { display: flex; justify-content: space-between; gap: .75rem; align-items: center; font-weight: 700; flex-wrap: wrap; }
.hyp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; font-size: .88rem; margin-top: .5rem; }
.hyp-grid h4 { font-size: .74rem; color: var(--muted); margin: 0; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; }
.advice { background: linear-gradient(135deg, var(--brand-50), var(--surface)); border: 1px solid var(--brand-100); border-radius: var(--radius-md); padding: 1rem 1.1rem; }
.letter { white-space: pre-wrap; font-family: Georgia, Cambria, "Times New Roman", serif; font-size: .97rem; line-height: 1.7; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 1.4rem 1.6rem; box-shadow: inset 0 0 0 6px var(--surface-2); }
.quote { color: var(--muted); font-style: italic; }
.disclaimer { font-size: .82rem; color: var(--muted); background: var(--surface-2) !important; box-shadow: none !important; display: flex; gap: .6rem; }

/* ========================================================================= toast */
#toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%); z-index: 60; padding: .8rem 1.2rem; border-radius: 12px; background: var(--ink); color: var(--surface); font-size: .9rem; font-weight: 600; box-shadow: var(--shadow-lg); max-width: calc(100vw - 2rem); }
#toast.error { background: var(--danger); color: #fff; }

/* ========================================================================= login */
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-aside { background: var(--header-grad); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-aside::before, .login-aside::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .07); }
.login-aside::before { width: 420px; height: 420px; right: -140px; top: -120px; }
.login-aside::after { width: 300px; height: 300px; left: -100px; bottom: -110px; }
.login-aside > * { position: relative; z-index: 1; }
.login-aside h1 { font-size: 2.1rem; font-weight: 800; margin: 2.5rem 0 .8rem; max-width: 26rem; }
.login-aside p { opacity: .9; max-width: 28rem; font-size: 1.02rem; }
.benefits { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; gap: .9rem; }
.benefits li { display: flex; gap: .8rem; align-items: flex-start; }
.benefits .b-icon { width: 36px; height: 36px; border-radius: 10px; background: rgba(255, 255, 255, .16); display: grid; place-items: center; flex: none; }
.benefits strong { display: block; }
.benefits span { opacity: .85; font-size: .9rem; }
.login-foot { font-size: .8rem; opacity: .75; }
.login-main { display: grid; place-items: center; padding: 2rem 1.25rem; }
.login-card { width: 100%; max-width: 410px; }
.login-card h2 { font-size: 1.5rem; margin-bottom: .3rem; }
.login-card .btn-primary { width: 100%; margin-top: .4rem; }
.secure-note { display: flex; align-items: center; gap: .5rem; justify-content: center; font-size: .8rem; color: var(--muted); margin-top: 1.2rem; }

/* ==================================================================== responsive */
@media (max-width: 1080px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; }
}
@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-aside { padding: 2rem 1.5rem; }
  .login-aside h1 { font-size: 1.6rem; margin-top: 1.5rem; }
  .benefits, .login-foot { display: none; }
}
@media (max-width: 680px) {
  .app-header-inner { padding: .6rem 1rem; }
  .brand-text span, .user-chip .name { display: none; }
  .user-chip { padding: .3rem; }
  .stepper, main { padding-left: 1rem; padding-right: 1rem; }
  .stepper li { font-size: 0; padding-right: .4rem; }
  .grid-2, .two-col, .hyp-grid, .kpis { grid-template-columns: minmax(0, 1fr); }
  .finding-row { flex-direction: column; align-items: flex-start; }
  .card, .report > section { padding: 1rem; }
  #transcript, #pseudo-text { min-height: 14rem; }
  .preview { min-height: 10rem; }
  .hero .verdict-title { font-size: 1.35rem; }
  .footer-actions { flex-wrap: wrap; }
  .footer-actions .hint { width: 100%; }
}

/* ===================================================================== impression */
@media print {
  body { background: #fff; color: #000; font-size: 12px; }
  .app-header, .stepper, .report-toolbar, .demo-strip, #toast { display: none !important; }
  main { padding: 0; max-width: none; }
  .report > section { box-shadow: none; break-inside: avoid; border-color: #bbb; }
  .hero { color: #000 !important; background: #fff !important; border: 2px solid #000 !important; }
  .kpi { border-color: #999; }
}
