/* RH L'Arche — rh.ewabi.fr. Jetons, coque et composants repris de l'outil frère event.ewabi.fr (même charte). */
:root {
  --bg: #F7F8F4; --surface: #FFFFFF; --sunk: #F1F3EC; --sage: #EBF1E7; --sage-2: #DCE7D6;
  --ink: #22352F; --ink-2: #3F524C; --muted: #5B6762; --faint: #9AA49F; --line: #E3E7E0; --line-2: #D5DBD2;
  --accent: #2F5D4B; --accent-2: #24493B; --accent-ink: #FFFFFF; --kicker: #5F6F53;
  --amber: #A76B12; --amber-bg: #FBF2E1; --amber-line: #F0DDB6;
  --red: #B03D32; --red-bg: #FCEDEA; --red-line: #F2CFC9;
  --blue: #2F6488; --blue-bg: #E9F1F7; --blue-line: #CFE0EC;
  --green: #2E7D4F; --green-bg: #E6F4EA;
  --violet: #6A4C93; --violet-bg: #F1ECF8;
  --shadow-1: 0 1px 2px rgba(34, 53, 47, .06);
  --shadow-2: 0 1px 2px rgba(34, 53, 47, .05), 0 10px 30px rgba(34, 53, 47, .07);
  --shadow-3: 0 20px 60px rgba(20, 35, 30, .22);
  --r: 14px; --r-s: 10px; --r-xs: 7px;
  --side: 248px;
  --f-display: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-body: 'DM Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font: 14.5px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--f-display); margin: 0; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: 26px; font-weight: 700; line-height: 1.2; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 14.5px; font-weight: 700; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }
svg.i.s { width: 15px; height: 15px; vertical-align: -3px; }
.kicker { font: 600 11px/1.2 var(--f-body); letter-spacing: .09em; text-transform: uppercase; color: var(--kicker); }

/* ── Mise en page ── */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: calc(100vh - var(--bandeau, 0px)); }
.side { position: sticky; top: var(--bandeau, 0px); height: calc(100vh - var(--bandeau, 0px)); display: flex; flex-direction: column; gap: 4px; padding: 18px 14px 14px; background: #F0F2EB; border-right: 1px solid var(--line); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; }
.brand-mark svg { width: 20px; height: 20px; stroke: #fff; fill: none; stroke-width: 2; }
.brand b { display: block; font: 700 15px/1.15 var(--f-display); }
.brand span { display: block; font-size: 12px; color: var(--muted); }
.nav-sec { margin: 14px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: var(--ink-2); font-weight: 500; text-decoration: none; position: relative; }
.nav a:hover { background: rgba(47, 93, 75, .06); }
.nav a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); font-weight: 600; }
.nav a.on svg { color: var(--accent); }
.nav .count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 10px; background: var(--sunk); color: var(--ink-2); font-size: 12px; font-weight: 600; display: inline-grid; place-items: center; }
.nav .count.red { background: var(--red); color: #fff; }
.nav .count.amber { background: var(--amber-bg); color: var(--amber); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 14px; }
.box-pill { display: flex; align-items: center; gap: 9px; padding: 10px 11px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; }
.box-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.box-pill .dot.ok { background: #3BA36A; box-shadow: 0 0 0 3px rgba(59, 163, 106, .15); }
.box-pill .dot.ko { background: var(--red); box-shadow: 0 0 0 3px rgba(176, 61, 50, .15); }
.box-pill .t { min-width: 0; flex: 1; }
.box-pill .t b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.box-pill .t span { color: var(--muted); }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 8px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--sage-2); color: var(--accent-2); display: grid; place-items: center; font: 700 13px var(--f-display); flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.me .t { flex: 1; min-width: 0; line-height: 1.25; }
.me .t b { display: block; font-size: 13.5px; }
.me .t span { font-size: 12px; color: var(--muted); }

.main { min-width: 0; padding: 26px 34px 80px; }
.page { max-width: 1180px; margin: 0 auto; }
.page.narrow { max-width: 860px; }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.top .sub { margin-top: 6px; color: var(--muted); font-size: 15px; }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Boutons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s, transform .05s; text-decoration: none; }
.btn:hover { border-color: #C3CBC0; background: #FBFCF9; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .chip:focus-visible, .row:focus-visible, .field:focus-visible { outline: 3px solid rgba(47, 93, 75, .3); outline-offset: 2px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 0 rgba(0, 0, 0, .08), 0 4px 12px rgba(47, 93, 75, .18); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.warn { background: var(--amber); border-color: var(--amber); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: rgba(47, 93, 75, .07); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn.lg { height: 46px; padding: 0 20px; font-size: 15px; border-radius: 12px; }
.btn[disabled], .btn.busy { opacity: .55; cursor: not-allowed; }
.btn.busy::after { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn.armed { background: var(--red); border-color: var(--red); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(176, 61, 50, .15); } }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; font-size: inherit; }
.link:hover { text-decoration: underline; }
.link.muted { color: var(--muted); font-weight: 500; }

/* ── Cartes ── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); }
.card.pad { padding: 18px 20px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px 0; }
.card-b { padding: 14px 20px 18px; }
.card + .card { margin-top: 16px; }
.stack > * + * { margin-top: 16px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.sep { height: 1px; background: var(--line); margin: 14px 0; border: 0; }

/* ── Pastilles ── */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 12px; background: var(--sunk); color: var(--ink-2); font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.chip.green { background: var(--green-bg); color: var(--green); }
.chip.amber { background: var(--amber-bg); color: var(--amber); }
.chip.red { background: var(--red-bg); color: var(--red); }
.chip.blue { background: var(--blue-bg); color: var(--blue); }
.chip.violet { background: var(--violet-bg); color: var(--violet); }
.chip.dark { background: var(--ink); color: #fff; }
.chip.out { background: transparent; border-color: var(--line-2); }
button.chip { cursor: pointer; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--sunk); border: 1px solid var(--line); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: none; white-space: nowrap; border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.dotlabel { display: inline-flex; align-items: center; gap: 6px; }
.dotlabel::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.dotlabel.ok::before { background: #3BA36A; } .dotlabel.est::before { background: #D49A2A; } .dotlabel.clar::before { background: var(--red); } .dotlabel.eq::before { background: var(--blue); }

/* ── Alertes ── */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 15px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.alert svg { margin-top: 1px; }
.alert.amber { background: var(--amber-bg); border-color: var(--amber-line); color: #6B4507; }
.alert.red { background: var(--red-bg); border-color: var(--red-line); color: #7A251D; }
.alert.blue { background: var(--blue-bg); border-color: var(--blue-line); color: #1F4762; }
.alert.green { background: var(--green-bg); border-color: #C8E6D2; color: #1D5535; }
.alert b { font-weight: 700; }
.alert .grow { flex: 1; min-width: 0; }
.alert .btn { margin-left: auto; }

/* ── Lignes de dossiers ── */
.list { display: flex; flex-direction: column; }
.list.card { overflow: hidden; }
.row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 13px 18px; border-top: 1px solid var(--line); cursor: pointer; text-decoration: none; color: inherit; background: var(--surface); transition: background .1s; }
.row:first-child { border-top: 0; }
.row:hover { background: #FAFBF8; text-decoration: none; }
.row .who { min-width: 0; }
.row .who b { font-weight: 650; font-size: 14.5px; }
.row .who .l1 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row .who .l1 b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .who .l2 { color: var(--muted); font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .who .l3 { font-size: 13px; margin-top: 3px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.row .go { display: flex; align-items: center; gap: 10px; }
.leaf { width: 52px; height: 56px; border-radius: 11px; background: var(--sunk); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; overflow: hidden; }
.leaf .m { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--kicker); }
.leaf .d { font: 700 20px/1.05 var(--f-display); margin: 2px 0 1px; }
.leaf .w { font-size: 10.5px; color: var(--muted); }
.leaf.none .d { font-size: 15px; color: var(--faint); }
.leaf.hot { background: var(--red-bg); border-color: var(--red-line); }
.leaf.hot .m { color: var(--red); }
.leaf.soon { background: var(--sage); border-color: var(--sage-2); }
.sec-title { display: flex; align-items: center; gap: 10px; margin: 26px 2px 10px; }
.sec-title h2 { font-size: 15px; }
.sec-title .n { color: var(--muted); font-weight: 600; font-size: 13px; }
.sec-title .line { flex: 1; height: 1px; background: var(--line); }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); }
.empty .big { width: 52px; height: 52px; border-radius: 16px; margin: 0 auto 12px; background: var(--sage); display: grid; place-items: center; color: var(--accent); }
.empty .big svg { width: 26px; height: 26px; }
.empty h3 { color: var(--ink); margin-bottom: 4px; font-size: 16px; }

/* ── Toast ── */
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 12px; background: #1E2B27; color: #fff; box-shadow: var(--shadow-3); font-size: 14px; max-width: min(560px, calc(100vw - 32px)); animation: up .2s ease-out; }
.toast.err { background: #7A251D; }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }


/* ── Accessibilité de base ── */
:focus-visible { outline: 3px solid rgba(47, 93, 75, .35); outline-offset: 2px; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 600; }
.skip:focus { top: 8px; text-decoration: none; }
.main:focus { outline: none; }

/* ── Connexion ── */
.login { min-height: calc(100vh - var(--bandeau, 0px)); display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 20% -10%, #E3EEDD 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #E9EFE4 0%, transparent 55%), var(--bg); }
.login .box { width: min(440px, 100%); padding: 34px 32px 28px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-2); border: 1px solid var(--line); text-align: center; }
.login .brand-mark { width: 54px; height: 54px; border-radius: 16px; margin: 0 auto 18px; }
.login .brand-mark svg { width: 30px; height: 30px; }
.login h1 { font-size: 25px; }
.login p { color: var(--muted); margin: 8px 0 24px; }
.login .alert { text-align: left; margin-bottom: 18px; }
.login .btn { width: 100%; height: 48px; font-size: 15px; border-radius: 12px; }

/* ── Accueil ── */
.hello { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 22px 24px; border-radius: 18px; background: linear-gradient(135deg, #EEF4EA 0%, #F7F8F4 70%); border: 1px solid var(--sage-2); margin-bottom: 8px; }
.hello h1 { font-size: 24px; }
.hello p { margin: 4px 0 0; color: var(--ink-2); font-size: 15px; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 18px 0 4px; }
.toolbar .search { flex: 1 1 260px; max-width: 420px; }
.row .l2 .sep-dot { margin: 0 6px; color: var(--faint); }

/* ── Formulaires ── */
label.f, .f-group > legend { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); }
label.f { margin-bottom: 5px; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; margin: 0 0 6px; }
.in, select.in, textarea.in { display: block; width: 100%; min-height: 42px; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff; font-size: 15px; font-weight: 400; color: var(--ink); transition: border-color .12s, box-shadow .12s; }
.in:focus { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.in[aria-invalid="true"] { border-color: var(--red); background: #FFFAF9; }
.in[aria-invalid="true"]:focus { outline-color: var(--red); border-color: var(--red); }
textarea.in { resize: vertical; line-height: 1.55; min-height: 96px; }
.in[readonly], .in:disabled, select.in:disabled { background: var(--sunk); color: var(--ink-2); cursor: default; }
.err { margin: 6px 0 0; font-size: 13px; color: var(--red); font-weight: 500; }
.q { padding: 14px 0; border-top: 1px solid var(--line); }
.q:first-child { border-top: 0; padding-top: 4px; }
.f-group { border: 0; margin: 0; padding: 0; min-width: 0; }
.f-group > legend { padding: 0; margin-bottom: 8px; font-size: 14.5px; color: var(--ink); }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; align-items: flex-start; gap: 11px; padding: 11px 13px; border-radius: 11px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; font-size: 14.5px; line-height: 1.4; }
.opt:hover { border-color: #C3CBC0; background: #FBFCF9; }
.opt input { margin: 2px 0 0; width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.opt:has(input:checked) { border-color: var(--accent); background: var(--sage); box-shadow: 0 0 0 1px var(--accent) inset; }
.opt:has(input:focus-visible) { outline: 3px solid rgba(47, 93, 75, .35); outline-offset: 2px; }
.opt:has(input:disabled) { cursor: default; opacity: .85; }
.opt-grp.invalid .opt { border-color: var(--red-line); }
.grid-f { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.grid-f .wide { grid-column: 1 / -1; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ── Parcours ── */
.crumbs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.crumbs li + li::before { content: '›'; margin-right: 6px; color: var(--faint); }
.crumbs li { max-width: 100%; }
.step-q { font-size: 24px; line-height: 1.25; margin: 0 0 8px; }
.aide { margin: 0 0 18px; padding: 12px 14px; border-left: 3px solid var(--sage-2); background: var(--sunk); border-radius: 0 10px 10px 0; color: var(--ink-2); font-size: 14.5px; }
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; padding: 15px 16px; border-radius: 13px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-size: 15.5px; font-weight: 600; color: var(--ink); line-height: 1.35; box-shadow: var(--shadow-1); }
.choice:hover { border-color: var(--accent); background: #FBFDF9; }
.choice svg { color: var(--accent); }
.leaf-card h2 { font-size: 21px; margin: 4px 0 6px; }
.leaf-card .base { font-size: 12.5px; color: var(--muted); margin: 0 0 14px; }
.nav-bas { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.picked { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; border-radius: 12px; background: var(--sage); border: 1px solid var(--sage-2); margin-bottom: 10px; }
.pick-list { display: flex; flex-direction: column; margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pick { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; padding: 12px 14px; border: 0; border-top: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.pick:first-child { border-top: 0; }
.pick:hover { background: #FAFBF8; }
.pick b { font-weight: 650; }
.pick span { color: var(--muted); font-size: 13px; }

/* ── Dossier ── */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: 13.5px; margin-bottom: 14px; }
.d-head { margin-bottom: 16px; }
.d-head h1 { font-size: 26px; }
.d-head .base { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.d-head .meta { display: flex; gap: 8px 14px; flex-wrap: wrap; align-items: center; margin-top: 10px; color: var(--muted); font-size: 13.5px; }
.sauve { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.sauve::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #3BA36A; }
.sauve.en-cours::before { background: #D49A2A; }
.sauve.erreur { color: var(--red); }
.sauve.erreur::before { background: var(--red); }
.bandeau { margin-bottom: 14px; }
.details { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.details > summary { cursor: pointer; padding: 11px 14px; font-weight: 600; font-size: 14px; color: var(--ink-2); list-style: none; display: flex; align-items: center; gap: 8px; }
.details > summary::-webkit-details-marker { display: none; }
.details > summary::before { content: '▸'; color: var(--accent); transition: transform .12s; }
.details[open] > summary::before { transform: rotate(90deg); }
.details > div { padding: 0 14px 14px; white-space: pre-wrap; font-size: 14.5px; color: var(--ink-2); }
.sections > * + * { margin-top: 16px; }
.constats { display: flex; flex-direction: column; gap: 10px; }
.constat .grow b { display: block; }
.constat .actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.constat .btn { margin-left: 0; }
.reste { margin: 0; padding-left: 18px; font-size: 14px; }
.sec-h { margin: 0 0 4px; }
.sec-sub { margin: 0 0 12px; color: var(--muted); font-size: 13.5px; }
.lecture-seule { margin-bottom: 14px; }

/* ── Fenêtre latérale mobile et toasts ── */
.toasts { z-index: 60; }
.toast { cursor: default; }

/* ── Mobile ── */
.mtop, .mtabs { display: none; }
@media (max-width: 1020px) { .grid-f { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .mtop { display: flex; align-items: center; gap: 10px; position: sticky; top: var(--bandeau, 0px); z-index: 20; padding: 10px 16px; background: rgba(247, 248, 244, .94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
  .mtop .brand { padding: 0; flex: 1; }
  .mtop .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
  .mtabs { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: rgba(255, 255, 255, .97); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .mtabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 0; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; }
  .mtabs a.on { color: var(--accent); }
  .mtabs svg.i { width: 22px; height: 22px; }
  .main { padding: 18px 16px 96px; }
  h1 { font-size: 22px; }
  .d-head h1 { font-size: 22px; }
  .step-q { font-size: 21px; }
  .row { grid-template-columns: 46px minmax(0, 1fr); gap: 12px; padding: 12px 14px; }
  .row .go { grid-column: 2; justify-content: flex-start; }
  .leaf { width: 46px; height: 50px; }
  .leaf .d { font-size: 18px; }
  .hello { padding: 16px 18px; }
  .hello h1 { font-size: 20px; }
  .toasts { bottom: 86px; }
  .toolbar .search { max-width: none; }
  .nav-bas .btn { flex: 1 1 auto; }
}
/* Cibles tactiles d'au moins 44 px (téléphone et écrans tactiles). */
@media (max-width: 860px), (pointer: coarse) {
  .btn.sm, .link { min-height: 44px; }
  .link { display: inline-flex; align-items: center; padding: 0 6px; }
  .btn.sm { padding: 0 14px; }
  .check { min-height: 44px; }
  .check input { width: 22px; height: 22px; }
  .opt { min-height: 44px; }
  .pick { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
/* Mode démonstration : bandeau fixe en haut de toutes les pages */
html.demo { --bandeau: 34px; }
.demo-bandeau { position: sticky; top: 0; z-index: 60; height: var(--bandeau); display: flex; align-items: center; justify-content: center; padding: 0 12px; background: var(--amber-bg); border-bottom: 1px solid var(--amber-line); color: var(--amber); font-size: 13px; text-align: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.login .btn + .btn { margin-top: 10px; }
@media print { .demo-bandeau { display: none; } .side, .mtop, .mtabs { display: none; } .shell { display: block; } }

.mt { margin-top: 14px; }
.mt-s { margin-top: 12px; }
.hint.inline { display: inline; margin: 0; }
.with-suffixe { display: flex; align-items: center; gap: 8px; }
.with-suffixe .in { flex: 1; }
.suffixe { color: var(--muted); font-weight: 600; }
.reste li { margin: 4px 0; }
@media (max-width: 860px), (pointer: coarse) { .reste li { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; } }

/* ── Pièces, aperçu, envoi, suivi (Task 11) ── */
.piece { padding: 14px 0; border-top: 1px solid var(--line); }
.piece:first-of-type { border-top: 0; }
.piece-t { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; }
.piece .hint { margin: 4px 0 0; }
.piece .check { margin-top: 8px; }
.depot-bloc { margin-top: 8px; }
.fichiers { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.fichiers li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border-radius: 10px; background: var(--sunk); border: 1px solid var(--line); font-size: 14px; }
.fichiers .nom { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.depot { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 12px 14px; border: 1.5px dashed var(--line-2); border-radius: 12px; background: #FCFDFB; transition: background .12s, border-color .12s; }
.depot.survol { border-color: var(--accent); background: var(--sage); }
.depot.occupe { border-style: solid; }
.depot .hint { flex-basis: 100%; margin: 0; }
progress { width: min(260px, 100%); height: 10px; accent-color: var(--accent); }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pdf-cadre iframe.pdf { display: block; width: 100%; height: min(78vh, 900px); min-height: 460px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--sunk); margin-bottom: 12px; }
.pdf-mobile { display: none; }
.confirmer { padding: 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--sunk); }
.confirmer h3 { margin-bottom: 4px; }
.signataires { list-style: none; margin: 0; padding: 0; }
.titre-exact { margin: 0 0 8px; padding: 9px 12px; border-radius: 9px; background: #fff; border: 1px dashed var(--line-2); font-weight: 600; overflow-wrap: anywhere; }
.etapes { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 14px; }
.etat-ligne { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.etat-ligne .btn { margin-left: auto; }
.faits { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.faits li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.faits .grow { flex: 1; min-width: 0; }
.faits-erreur { display: block; color: var(--red); }
.journal-dossier { list-style: none; margin: 0; padding: 0 14px 14px; display: flex; flex-direction: column; gap: 8px; white-space: normal; }
.journal-dossier li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; font-size: 14px; }
.ok-msg { margin: 8px 0 0; color: var(--green); font-weight: 600; font-size: 13.5px; }
code { font: 600 13px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--sunk); padding: 1px 6px; border-radius: 6px; }
.equipe { list-style: none; margin: 0; padding: 0; }
.equipe li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); }
.equipe li:first-child { border-top: 0; }
.equipe li.inactif { opacity: .75; }
.in.court { width: auto; min-width: 150px; }
.ajout-equipe { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.ajout-equipe .q { border: 0; padding: 0; }
.filtres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; margin-bottom: 12px; }
.filtres .q { border: 0; padding: 0; }
.journal .ligne-journal { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); font-size: 14px; }
.journal .ligne-journal:first-child { border-top: 0; }
@media (max-width: 860px) {
  .pdf-cadre iframe.pdf { display: none; }
  .pdf-mobile { display: block; margin: 0 0 12px; }
  .filtres, .ajout-equipe { grid-template-columns: 1fr; }
  .journal .ligne-journal, .journal-dossier li { grid-template-columns: 1fr; gap: 2px; }
  .etat-ligne .btn { margin-left: 0; }
}
.alert .actions .btn { margin-left: 0; }
