/* L'espace BailCom en miniature (src/lib/v4/espace.ts), maquette v9 du 19/11 : la démo de l'accueil (#comment), qui se
   joue seule, et l'aperçu de « Mon espace », avec des données d'exemple. L'espace n'existe pas encore : il est seulement
   montré. Sobre et clair, l'orange de BailCom en petit. La miniature suit la largeur de sa fenêtre (requêtes de
   conteneur) : les onglets en bas quand elle est étroite, le rail, les dossiers et l'article à droite quand elle est large. */
.dm-win, .sx-win { container: mini / inline-size; }
.dm-app { --a: #C2410C; --soft: #FDEEE4; --rl: #F1F4F4; --ln: #E1E5E5; --mu: #5C656E; position: relative; display: flex; flex-direction: column; height: 486px; background: #FFFFFF; color: #121820; font: 400 15px/1.5 var(--text); color-scheme: light; }
.dm-app svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.dm-app :where(button.it) { margin: 0; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.dm-app button.it:hover { color: #121820; }
.dm-app button.it:focus-visible { outline: 2px solid #1D4ED8; outline-offset: 2px; }
.dm-rail, .dm-list, .dm-head, .dm-paper { display: none; }
.dm-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.dm-ph { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px; border-bottom: 1px solid var(--ln); font-weight: 700; font-size: 14px; }
.dm-ph svg { width: 17px; height: 17px; color: var(--mu); }
.dm-ph .s0 { display: inline-flex; align-items: center; gap: 8px; }
.dm-ph .s1, .dm-ph .s2 { display: none; }
.dm-app:not([data-step="0"]) .dm-ph .s0 { display: none; }
.dm-app[data-step="1"] .dm-ph .s1, .dm-app[data-step="2"] .dm-ph .s2 { display: inline-flex; }
.dm-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.dm-scs { position: relative; min-width: 0; }
.dm-sc { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 12px; padding: 16px; overflow: hidden; opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity .45s, transform .45s cubic-bezier(.2,.7,.2,1), visibility 0s .45s; }
.dm-sc.on { opacity: 1; visibility: visible; transform: none; transition: opacity .45s, transform .45s cubic-bezier(.2,.7,.2,1); }
.dm-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 6px 4px 8px; border-top: 1px solid var(--ln); background: var(--rl); }
.dm-tabs .it { display: grid; justify-items: center; gap: 3px; font-size: 10.5px; line-height: 1.2; color: var(--mu); transition: color .3s; }
.dm-tabs .it.on { color: #121820; font-weight: 700; } .dm-tabs .it.on svg { color: var(--a); }
/* Questions : la question, la réponse courte, UNE ligne de source, l'article cité et sa phrase surlignée, UNE action */
.dm-u { align-self: flex-end; max-width: 88%; padding: 9px 14px; border-radius: 16px; background: #F1F3F3; font-size: 14.5px; line-height: 1.5; opacity: 0; transform: translateY(8px); transition: opacity .35s, transform .35s; }
.dm-a { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; max-width: 520px; opacity: 0; transition: opacity .35s; }
.dm-a p { margin: 0; font-size: 15px; line-height: 1.6; }
.dm-a p.ty { min-height: 1.6em; }
.dm-a b { font-weight: 700; }
.dm-src { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--a); opacity: 0; transition: opacity .35s; }
.dm-app .dm-src svg { width: 14px; height: 14px; }
.dm-act { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid var(--ln); border-radius: 9px; font-size: 13.5px; font-weight: 600; opacity: 0; transition: opacity .35s, border-color .35s; }
.dm-app .dm-act svg { width: 15px; height: 15px; color: var(--mu); }
.dm-mini { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid #ECEFF0; border-radius: 6px; background: #FFFFFF; box-shadow: 0 12px 28px -20px rgba(0,0,0,.35); font: 12.5px/1.5 Georgia, "Times New Roman", serif; color: #3A3A40; opacity: 0; transform: translateY(10px); transition: opacity .4s, transform .45s cubic-bezier(.2,.7,.2,1); }
.dm-mini b { color: #111111; }
.dm-comp { display: none; }
.dm-app .mk { padding: 6px 9px; transition: background-color .6s, box-shadow .6s; }
.dm-app.k3 .mk, .dm-app:not([data-step="0"]) .mk { background: var(--soft); box-shadow: inset 3px 0 0 var(--a); color: #222222; }
.dm-sc.k1 .dm-u { opacity: 1; transform: none; }
.dm-sc.k2 .dm-a { opacity: 1; }
.dm-sc.k3 .dm-src, .dm-sc.k3 .dm-mini { opacity: 1; transform: none; }
.dm-sc.k4 .dm-act { opacity: 1; border-color: #121820; }
/* Dates : la prochaine en gros, une ligne par date */
.dm-big { margin: 0; font: 700 26px/1.1 var(--display); font-stretch: 112%; letter-spacing: -.01em; opacity: 0; transform: translateY(8px); transition: opacity .4s, transform .45s; }
.dm-bigc { margin: -4px 0 0; font-size: 13.5px; color: var(--mu); opacity: 0; transition: opacity .4s .1s; }
.dm-a .dm-big { font-size: 22px; }
.dm-lines, .dm-mods { list-style: none; margin: 2px 0 0; padding: 0; border-top: 1px solid var(--ln); }
.dm-lines li, .dm-mods li { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--ln); opacity: 0; transform: translateY(6px); transition: opacity .35s, transform .35s; }
.dm-lines li > svg:first-child { color: var(--mu); }
.dm-lines li span, .dm-mods li span.t { flex: 1; min-width: 0; display: grid; }
.dm-lines b, .dm-mods b { font-size: 14px; } .dm-lines small, .dm-mods small { font-size: 12.5px; color: var(--mu); }
.dm-lines .past { color: var(--mu); } .dm-lines .past b { font-weight: 600; } .dm-app .dm-lines .ok { color: #1F7A45; }
.dm-lines .next > svg:first-child { color: var(--a); }
.dm-note { margin: 0; font-size: 12.5px; color: var(--mu); opacity: 0; transition: opacity .35s; }
.dm-sc.k1 .dm-big, .dm-sc.k1 .dm-bigc, .dm-sc.k2 .dm-a .dm-big, .dm-sc.k2 .dm-a .dm-bigc { opacity: 1; transform: none; }
.dm-sc.k2 .dm-lines li { opacity: 1; transform: none; }
.dm-sc.k2 .dm-lines li:nth-child(2) { transition-delay: .12s; } .dm-sc.k2 .dm-lines li:nth-child(3) { transition-delay: .24s; }
.dm-sc.k3 .dm-note { opacity: 1; }
/* Courriers : celui de la question en premier */
.dm-mods .mp { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: #F4F6F6; flex: none; }
.dm-mods li.on .mp { background: var(--soft); color: var(--a); }
.dm-mods em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--a); opacity: 0; transition: opacity .35s; }
.dm-sc.k1 .dm-mods li.on { opacity: 1; transform: none; }
.dm-sc.k2 .dm-mods em { opacity: 1; }
.dm-sc.k3 .dm-mods li { opacity: 1; transform: none; }
.dm-sc.k3 .dm-mods li:nth-child(3) { transition-delay: .1s; } .dm-sc.k3 .dm-mods li:nth-child(4) { transition-delay: .2s; }

/* Large : le rail de pictos, le bail et ses 9 années en haut, l'article à droite */
@container mini (min-width: 620px) {
  .dm-app { display: grid; grid-template-columns: 64px 0 minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); height: 480px; transition: grid-template-columns .45s cubic-bezier(.2,.7,.2,1); }
  .dm-app.pv { height: 520px; }
  .dm-rail { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 0; background: var(--rl); border-right: 1px solid var(--ln); }
  .dm-logo { margin-bottom: 8px; } .dm-app .dm-logo svg { display: block; width: 28px; height: 28px; }
  .dm-rail .it { position: relative; width: 54px; display: grid; justify-items: center; gap: 3px; padding: 7px 0; border-radius: 10px; font-size: 10px; line-height: 1.2; color: var(--mu); transition: background-color .3s, color .3s; }
  .dm-rail .it.on { background: #FFFFFF; color: #121820; font-weight: 700; box-shadow: 0 1px 0 var(--ln); }
  .dm-rail .it.on::before { content: ""; position: absolute; left: -5px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--a); }
  .dm-me { margin-top: auto; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #DFE4E4; }
  .dm-app .dm-me svg { width: 15px; height: 15px; }
  .dm-list { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 12px 0; border-right: 0 solid var(--ln); font-size: 12.5px; white-space: nowrap; overflow: hidden; opacity: 0; transition: opacity .3s, padding .45s; }
  .dm-list .new { display: flex; align-items: center; gap: 7px; padding: 7px 8px; margin-bottom: 6px; border: 1px solid var(--ln); border-radius: 8px; font-weight: 600; }
  .dm-list .lh { padding: 8px 6px 3px; font-size: 11px; color: var(--mu); }
  .dm-list .f { display: flex; align-items: center; gap: 7px; padding: 6px; font-weight: 600; } .dm-list .f small { margin-left: auto; font-weight: 400; color: var(--mu); }
  .dm-app .dm-list svg { width: 15px; height: 15px; color: var(--mu); }
  .dm-list .f.mu { font-weight: 400; color: var(--mu); }
  .dm-list .c { padding: 6px 6px 6px 28px; border-radius: 7px; overflow: hidden; text-overflow: ellipsis; }
  .dm-list .c.pl { padding-left: 6px; }
  .dm-list .c.on { background: #F1F3F3; font-weight: 600; opacity: 0; transition: opacity .35s; }
  .dm-app.k1 .dm-list .c.on { opacity: 1; }
  .dm-ph, .dm-tabs, .dm-mini { display: none; }
  .dm-head { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 16px; border-bottom: 1px solid var(--ln); font-size: 12px; color: var(--mu); white-space: nowrap; }
  .dm-head .bail { display: flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid var(--ln); border-radius: 10px; font-size: 13px; color: #121820; }
  .dm-head .bail b { font-weight: 700; } .dm-app .dm-head .bail svg { width: 16px; height: 16px; color: var(--a); }
  .dm-head .nd { font-weight: 600; color: #121820; text-decoration: underline; text-decoration-color: #B9C2C6; text-underline-offset: 3px; }
  .dm-head .y9 { display: none; align-items: center; gap: 8px; }
  .dm-app:not([data-step="0"]) .dm-head .nd, .dm-app.pv .dm-head .nd { display: none; }
  .dm-app:not([data-step="0"]) .dm-head .y9, .dm-app.pv .dm-head .y9 { display: flex; }
  .dm-head .y { display: grid; grid-template-columns: repeat(9, 11px); gap: 2px; }
  .dm-head .y i { height: 7px; border-radius: 2px; background: #E3E7E8; } .dm-head .y i.p { background: #B9C2C6; } .dm-head .y i.n { background: var(--a); }
  .dm-head .add { margin-left: auto; display: none; align-items: center; gap: 5px; }
  .dm-app .dm-head .add svg { width: 14px; height: 14px; }
  .dm-body { grid-template-columns: minmax(0, 1fr) 200px; }
  .dm-sc { padding: 20px 22px; gap: 13px; }
  .dm-comp { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border: 1px solid var(--ln); border-radius: 12px; font-size: 13.5px; color: #8E979E; }
  .dm-comp span { flex: 1; }
  .dm-comp i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--a); color: #FFFFFF; }
  .dm-app .dm-comp svg { width: 14px; height: 14px; stroke-width: 2.4; }
  .dm-paper { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 12px 14px; background: #EEF1F1; border-left: 1px solid var(--ln); overflow: hidden; }
  .dm-paper .sg { display: inline-flex; align-self: flex-start; gap: 2px; padding: 2px; border-radius: 8px; background: #E2E7E7; font-size: 10.5px; font-weight: 600; color: var(--mu); }
  .dm-paper .sg i { padding: 4px 8px; border-radius: 6px; font-style: normal; } .dm-paper .sg i.on { background: #FFFFFF; color: #121820; }
  .dm-sheet { display: flex; flex-direction: column; gap: 7px; padding: 16px 14px; border-radius: 3px; background: #FFFFFF; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 12px 28px -18px rgba(0,0,0,.35); font: 11.5px/1.55 Georgia, "Times New Roman", serif; color: #3A3A40; }
  .dm-sheet b { font: 700 12px/1.3 Georgia, serif; color: #111111; }
  .dm-sheet .dl { display: block; height: 6px; border-radius: 4px; background: #ECECEF; }
}
/* Plus large : les dossiers à côté du rail, sur l'onglet Questions */
@container mini (min-width: 740px) {
  .dm-app[data-step="0"] { grid-template-columns: 64px 168px minmax(0, 1fr); }
  .dm-app[data-step="0"] .dm-list { padding: 12px 8px; border-right-width: 1px; opacity: 1; }
  .dm-body { grid-template-columns: minmax(0, 1fr) 212px; }
}
@container mini (min-width: 900px) {
  .dm-head .add { display: inline-flex; }
}
@media (prefers-reduced-motion: reduce) { .dm-app, .dm-app * { transition: none !important; } }
