/* miniclaude — interface web */
:root {
  --fond: #f8f7f4;
  --barre: #f0eee9;
  --surface: #ffffff;
  --texte: #1f2328;
  --texte-doux: #5f636a;
  --texte-faible: #8b8f96;
  --bordure: #e3e0d8;
  --survol: #e7e4dd;
  --bulle: #ebe8e1;
  --accent: #1f9e83;
  --accent-fort: #17806a;
  --accent-texte: #ffffff;
  --erreur: #c0392b;
  --code-fond: #f1efea;
  --ombre: 0 2px 12px rgba(30, 30, 20, 0.07), 0 1px 2px rgba(30, 30, 20, 0.06);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --largeur-fil: 760px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #1e1f22;
    --barre: #18191c;
    --surface: #2a2b2f;
    --texte: #ececec;
    --texte-doux: #b4b6bc;
    --texte-faible: #8a8c93;
    --bordure: #36383d;
    --survol: #2c2e33;
    --bulle: #32343a;
    --accent: #45c9ac;
    --accent-fort: #5fd6bb;
    --accent-texte: #10201c;
    --erreur: #ff7b6b;
    --code-fond: #232428;
    --ombre: 0 2px 14px rgba(0, 0, 0, 0.35);
  }
  .logo-barre, .logo-auth { filter: invert(1) hue-rotate(180deg) brightness(1.1); }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--fond); color: var(--texte); font-family: var(--sans); font-size: 15px;
       -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8;
      stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- connexion / invitation ---------- */
.vue-auth { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; }
.carte-auth { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--bordure);
              border-radius: 16px; padding: 32px 28px; box-shadow: var(--ombre); display: flex;
              flex-direction: column; gap: 14px; }
.logo-auth { width: 220px; align-self: center; margin-bottom: 4px; }
.carte-auth h1 { font-family: var(--serif); font-weight: 500; font-size: 24px; margin: 0; text-align: center; }
.carte-auth label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--texte-doux); }
.carte-auth input { padding: 11px 12px; border: 1px solid var(--bordure); border-radius: 10px;
                    background: var(--fond); font-size: 16px; outline: none; }
.carte-auth input:focus { border-color: var(--accent); }
.aide { font-size: 14px; color: var(--texte-doux); margin: 0; line-height: 1.5; text-align: center; }
.erreur { color: var(--erreur); font-size: 14px; margin: 0; }
.btn-principal { padding: 12px; border: 0; border-radius: 10px; background: var(--texte); color: var(--fond);
                 font-weight: 600; margin-top: 4px; }
.btn-principal:disabled { opacity: .5; }

/* ---------- structure ---------- */
#vue-app { display: flex; height: 100%; height: 100dvh; }
#barre { width: 272px; flex: none; background: var(--barre); border-right: 1px solid var(--bordure);
         display: flex; flex-direction: column; padding: 12px 10px; gap: 6px; }
#principal { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
#depot { display: none; position: absolute; inset: 10px; z-index: 45; border: 2px dashed var(--accent); border-radius: 16px;
  background: color-mix(in srgb, var(--fond) 95%, transparent); align-items: center; justify-content: center; pointer-events: none; }
#depot div { font-size: 1.1rem; color: var(--accent-fort); font-weight: 600; }
#principal.depot #depot { display: flex; }
.mobile-seul { display: none !important; }

/* ---------- barre latérale ---------- */
.barre-haut { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 10px; }
.logo-barre { height: 34px; }
.btn-nouvelle { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--bordure);
                border-radius: 10px; background: var(--surface); font-weight: 500; text-align: left; }
.btn-nouvelle:hover { border-color: var(--accent); }
.btn-nouvelle svg { color: var(--accent); }
.titre-liste[hidden] { display: none; }
.titre-liste { font-size: 12px; color: var(--texte-faible); padding: 14px 10px 4px; font-weight: 500; }
#liste-conversations { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.conv { display: flex; align-items: center; border-radius: 8px; position: relative; }
.conv a { flex: 1; min-width: 0; padding: 8px 10px; color: var(--texte); text-decoration: none; white-space: nowrap;
          overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.conv:hover, .conv.active { background: var(--survol); }
.conv.active a { font-weight: 500; }
.conv .en-cours { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 4px;
                  animation: pulse 1.2s infinite; flex: none; }
.conv .btn-conv { opacity: 0; border: 0; background: none; padding: 6px; color: var(--texte-faible); border-radius: 6px; }
.conv:hover .btn-conv, .conv.active .btn-conv { opacity: 1; }
.conv .btn-conv:hover { color: var(--texte); }
.conv .btn-conv svg { width: 16px; height: 16px; }
.barre-bas { border-top: 1px solid var(--bordure); padding-top: 8px; position: relative; }
.btn-compte { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0;
              background: none; border-radius: 10px; text-align: left; }
.btn-compte:hover { background: var(--survol); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--texte); color: var(--fond);
          display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex: none; }
.nom-utilisateur { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu { position: absolute; background: var(--surface); border: 1px solid var(--bordure); border-radius: 10px;
        box-shadow: var(--ombre); padding: 4px; z-index: 30; min-width: 180px; }
#menu-compte { bottom: 54px; left: 0; right: 0; }
.menu.flottant { z-index: 50; }  /* au-dessus de la barre latérale mobile (40) et de son voile (35) */
.menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: none;
               border-radius: 7px; font-size: 14px; }
.menu button:hover { background: var(--survol); }
.menu button.danger { color: var(--erreur); }

/* ---------- en-tête ---------- */
#entete { height: 52px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 16px; }
#titre-conversation { flex: 1; min-width: 0; font-size: 14px; color: var(--texte-doux); white-space: nowrap;
                      overflow: hidden; text-overflow: ellipsis; text-align: center; }
.btn-icone { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
             border: 0; background: none; border-radius: 9px; color: var(--texte-doux); }
.btn-icone:hover { background: var(--survol); color: var(--texte); }

/* ---------- fil de discussion ---------- */
#fil { flex: 1; overflow-y: auto; padding: 8px 16px 24px; scroll-behavior: auto; }
#messages { max-width: var(--largeur-fil); margin: 0 auto; display: flex; flex-direction: column; gap: 26px; }
#accueil { max-width: var(--largeur-fil); margin: 14vh auto 0; text-align: center; }
.robot-accueil { width: 72px; height: 72px; }
#salutation { font-family: var(--serif); font-weight: 400; font-size: 30px; margin: 14px 0 0; }

.msg-user { align-self: flex-end; max-width: 85%; background: var(--bulle); padding: 10px 16px;
            border-radius: 18px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.55; }
.msg-user .pj { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.msg-assistant { display: flex; gap: 14px; }
.msg-assistant .pastille { width: 28px; height: 28px; flex: none; margin-top: 2px; }
.msg-assistant .corps { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.msg-assistant .actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.msg-assistant:hover .actions, .msg-assistant.dernier .actions { opacity: 1; }
.actions .btn-icone { width: 30px; height: 30px; }
.actions svg { width: 16px; height: 16px; }
.note-fin { font-size: 13px; color: var(--texte-faible); font-style: italic; }

/* texte rendu (Markdown) */
.md { font-family: var(--serif); font-size: 16.5px; line-height: 1.68; word-wrap: break-word; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 .85em; }
.md h1, .md h2, .md h3, .md h4 { font-family: var(--serif); font-weight: 600; line-height: 1.3; margin: 1.3em 0 .5em; }
.md h1 { font-size: 1.45em; } .md h2 { font-size: 1.28em; } .md h3 { font-size: 1.12em; } .md h4 { font-size: 1em; }
.md ul, .md ol { margin: 0 0 .85em; padding-left: 1.5em; }
.md li { margin: .25em 0; }
.md li > ul, .md li > ol { margin: .2em 0; }
.md a { color: var(--accent-fort); text-decoration: underline; text-underline-offset: 2px; }
.md strong { font-weight: 650; }
.md blockquote { margin: 0 0 .85em; padding: .1em 1em; border-left: 3px solid var(--bordure); color: var(--texte-doux); }
.md hr { border: 0; border-top: 1px solid var(--bordure); margin: 1.4em 0; }
.md code { font-family: var(--mono); font-size: .84em; background: var(--code-fond); padding: .12em .38em;
           border-radius: 5px; border: 1px solid var(--bordure); }
.md .bloc-code { margin: 0 0 .9em; border: 1px solid var(--bordure); border-radius: 10px; overflow: hidden;
                 background: var(--code-fond); }
.md .bloc-code .bc-entete { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 6px 14px;
                            font-family: var(--sans); font-size: 12px; color: var(--texte-faible);
                            border-bottom: 1px solid var(--bordure); }
.md .bloc-code button { border: 0; background: none; font-size: 12px; color: var(--texte-doux); padding: 3px 8px; border-radius: 6px; }
.md .bloc-code button:hover { background: var(--survol); }
.md pre { margin: 0; padding: 12px 14px; overflow-x: auto; }
.md pre code { background: none; border: 0; padding: 0; font-size: 13.5px; line-height: 1.55; }
.md .tableau { overflow-x: auto; margin: 0 0 .9em; }
.md table { border-collapse: collapse; font-family: var(--sans); font-size: 14px; min-width: 50%; }
.md th, .md td { border: 1px solid var(--bordure); padding: 7px 11px; text-align: left; vertical-align: top; }
.md th { background: var(--code-fond); font-weight: 600; }

/* curseur pendant l'écriture */
.ecrit:empty::after, .ecrit > :last-child:not(ul):not(ol):not(.bloc-code):not(.tableau)::after, .ecrit > ul:last-child > li:last-child::after,
.ecrit > ol:last-child > li:last-child::after { content: ""; display: inline-block; width: .5em; height: 1em; background: var(--accent);
                vertical-align: -0.12em; margin-left: 2px; border-radius: 2px; animation: clignote 1s steps(2) infinite; }
@keyframes clignote { 50% { opacity: 0; } }
@keyframes pulse { 50% { opacity: .35; } }

/* étapes (outils) */
.etapes { border: 1px solid var(--bordure); border-radius: 12px; background: var(--surface); font-size: 14px; overflow: hidden; }
.etapes summary { list-style: none; cursor: pointer; padding: 9px 14px; display: flex; align-items: center; gap: 8px;
                  color: var(--texte-doux); user-select: none; }
.etapes summary::-webkit-details-marker { display: none; }
.etapes summary .chevron { margin-left: auto; transition: transform .15s; width: 16px; height: 16px; }
.etapes[open] summary .chevron { transform: rotate(180deg); }
.etapes ol { list-style: none; margin: 0; padding: 4px 14px 10px; border-top: 1px solid var(--bordure);
             display: flex; flex-direction: column; gap: 6px; }
.etape { display: flex; gap: 10px; align-items: flex-start; color: var(--texte-doux); }
.etape .ic { width: 16px; height: 16px; margin-top: 2px; }
.etape .lib { color: var(--texte); }
.etape .det { color: var(--texte-faible); word-break: break-word; }
.etape.failed .ic { color: var(--erreur); }
.etape.finished .ic { color: var(--accent); }
.rond { width: 14px; height: 14px; border: 2px solid var(--bordure); border-top-color: var(--accent);
        border-radius: 50%; animation: tourne .8s linear infinite; flex: none; margin-top: 3px; }
@keyframes tourne { to { transform: rotate(360deg); } }
.reflexion { display: flex; align-items: center; gap: 10px; color: var(--texte-faible); font-size: 14px; }

/* fichiers */
.fichiers { display: flex; flex-wrap: wrap; gap: 8px; }
.carte-fichier { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 10px; border: 1px solid var(--bordure);
                 border-radius: 10px; background: var(--surface); text-decoration: none; color: var(--texte);
                 font-size: 14px; max-width: 100%; }
.carte-fichier:hover { border-color: var(--accent); }
.carte-fichier .ext { width: 34px; height: 34px; border-radius: 7px; background: var(--code-fond); display: flex;
                      align-items: center; justify-content: center; font-size: 10px; font-weight: 700;
                      color: var(--texte-doux); text-transform: uppercase; flex: none; }
.carte-fichier .nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-produite { display: block; max-width: min(100%, 520px); border-radius: 12px; border: 1px solid var(--bordure); }

/* écran d'accueil : salutation et saisie au centre */
#principal.vide #fil { flex: 0 0 auto; padding-top: 0; }
#principal.vide #accueil { margin-top: 22vh; margin-bottom: 28px; }
#principal.vide #zone-saisie { flex: 1; }

/* ---------- saisie ---------- */
#zone-saisie { flex: none; padding: 0 16px calc(10px + env(safe-area-inset-bottom)); }
.compositeur { max-width: var(--largeur-fil); margin: 0 auto; background: var(--surface); border: 1px solid var(--bordure);
               border-radius: 20px; box-shadow: var(--ombre); padding: 12px 12px 8px 16px; display: flex;
               flex-direction: column; gap: 6px; }
.compositeur:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--bordure)); }
#saisie { border: 0; outline: none; resize: none; background: none; font-size: 16px; line-height: 1.5;
          max-height: 40vh; min-height: 26px; padding: 2px 0; }
.compositeur-bas { display: flex; align-items: center; gap: 4px; }
.compositeur-bas .btn-icone { margin-left: -8px; }
.btn-envoyer { margin-left: auto; width: 34px; height: 34px; border-radius: 10px; border: 0; background: var(--accent);
               color: var(--accent-texte); display: inline-flex; align-items: center; justify-content: center; }
.btn-envoyer svg { stroke-width: 2.2; }
.btn-envoyer:disabled { background: var(--survol); color: var(--texte-faible); cursor: default; }
.btn-envoyer.arreter { background: var(--texte); color: var(--fond); }
.btn-envoyer.arreter svg { fill: currentColor; stroke: none; }
.pieces { display: flex; flex-wrap: wrap; gap: 6px; }
.pieces:empty { display: none; }
.piece { display: inline-flex; align-items: center; gap: 6px; padding: 5px 6px 5px 10px; background: var(--code-fond);
         border: 1px solid var(--bordure); border-radius: 8px; font-size: 13px; max-width: 260px; }
.piece .nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.piece .etat { color: var(--texte-faible); font-size: 12px; }
.piece button { border: 0; background: none; padding: 2px; color: var(--texte-faible); display: inline-flex; }
.piece button svg { width: 14px; height: 14px; }
.avertissement { text-align: center; font-size: 12px; color: var(--texte-faible); margin: 8px 0 0; }

/* ---------- paramètres ---------- */
.modale-fond { position: fixed; inset: 0; z-index: 60; background: rgba(20, 20, 15, .38); display: flex;
               align-items: center; justify-content: center; padding: 24px; }
.modale { width: 100%; max-width: 860px; height: min(720px, 100%); background: var(--fond); border: 1px solid var(--bordure);
          border-radius: 16px; box-shadow: 0 10px 40px rgba(0, 0, 0, .18); display: flex; flex-direction: column; overflow: hidden; }
.modale-entete { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px 24px; flex: none; }
.modale-entete h2 { font-family: var(--serif); font-weight: 500; font-size: 22px; margin: 0; }
.modale-corps { flex: 1; min-height: 0; display: flex; }
.onglets { width: 190px; flex: none; display: flex; flex-direction: column; gap: 2px; padding: 4px 12px 16px 16px; }
.onglets button { text-align: left; padding: 9px 12px; border: 0; border-radius: 8px; background: none; font-size: 14px;
                  color: var(--texte-doux); }
.onglets button:hover { background: var(--survol); color: var(--texte); }
.onglets button.actif { background: var(--survol); color: var(--texte); font-weight: 600; }
.panneau { flex: 1; min-width: 0; overflow-y: auto; padding: 4px 28px 28px 12px; }
.intro { margin: 0 0 18px; color: var(--texte-doux); font-size: 14px; line-height: 1.55; }

.formulaire { display: flex; flex-direction: column; gap: 14px; }
.formulaire .rangee { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.formulaire label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--texte-doux);
                    position: relative; }
.formulaire input, .formulaire textarea, .ajout-souvenir input, .souvenir textarea {
  padding: 10px 12px; border: 1px solid var(--bordure); border-radius: 10px; background: var(--surface);
  font-size: 15px; font-weight: 400; color: var(--texte); outline: none; resize: vertical; line-height: 1.45; width: 100%; }
.formulaire input:focus, .formulaire textarea:focus, .ajout-souvenir input:focus, .souvenir textarea:focus { border-color: var(--accent); }
.formulaire ::placeholder, .ajout-souvenir ::placeholder { color: var(--texte-faible); }
.compteur { position: absolute; right: 2px; top: 0; font-size: 12px; font-weight: 400; color: var(--texte-faible); }
.pied-formulaire { display: flex; align-items: center; justify-content: flex-end; gap: 14px; position: sticky; bottom: -28px;
                   background: var(--fond); padding: 10px 0 2px; }
.pied-formulaire .btn-principal { margin: 0; padding: 10px 20px; }
.etat-enregistrement { font-size: 14px; color: var(--texte-doux); }
.etat-enregistrement.ko { color: var(--erreur); }

.reglage { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 14px 0;
           border-bottom: 1px solid var(--bordure); }
.reglage:first-child { padding-top: 4px; }
.reglage-titre { font-weight: 600; font-size: 14.5px; margin-bottom: 3px; }
.reglage-aide { font-size: 13.5px; color: var(--texte-doux); line-height: 1.5; }
.interrupteur { position: relative; flex: none; width: 42px; height: 24px; margin-top: 2px; cursor: pointer; }
.interrupteur input { position: absolute; opacity: 0; width: 0; height: 0; }
.interrupteur span { position: absolute; inset: 0; background: var(--bordure); border-radius: 12px; transition: background .15s; }
.interrupteur span::after { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; border-radius: 50%;
                            background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.interrupteur input:checked + span { background: var(--accent); }
.interrupteur input:checked + span::after { transform: translateX(18px); }
.interrupteur input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.titre-section { display: flex; align-items: baseline; gap: 8px; margin: 22px 0 10px; font-weight: 600; font-size: 14.5px; }
.titre-section .compte { font-weight: 400; color: var(--texte-faible); font-size: 13px; }
.ajout-souvenir { display: flex; gap: 8px; margin-bottom: 12px; }
.btn-secondaire { padding: 9px 16px; border: 1px solid var(--bordure); border-radius: 10px; background: var(--surface);
                  font-weight: 500; font-size: 14px; flex: none; }
.btn-secondaire:hover { border-color: var(--accent); }
.btn-secondaire:disabled { opacity: .5; }
.liste-souvenirs, .liste-appareils { list-style: none; margin: 0; padding: 0; border: 1px solid var(--bordure); border-radius: 12px;
                                     background: var(--surface); overflow: hidden; }
.liste-souvenirs:empty, .liste-appareils:empty { display: none; }
.souvenir, .appareil { display: flex; align-items: flex-start; gap: 10px; padding: 11px 10px 11px 14px; }
.souvenir + .souvenir, .appareil + .appareil { border-top: 1px solid var(--bordure); }
.souvenir .contenu, .appareil .contenu { flex: 1; min-width: 0; }
.souvenir .texte { font-size: 14.5px; line-height: 1.5; word-wrap: break-word; }
.souvenir .meta, .appareil .meta { font-size: 12.5px; color: var(--texte-faible); margin-top: 3px; }
.souvenir .meta a { color: var(--texte-faible); }
.souvenir .boutons { display: flex; gap: 0; flex: none; opacity: .55; }
.souvenir:hover .boutons { opacity: 1; }
.souvenir .boutons .btn-icone { width: 30px; height: 30px; }
.souvenir .boutons svg { width: 16px; height: 16px; }
.souvenir .boutons .supprimer:hover { color: var(--erreur); }
.souvenir textarea { margin-bottom: 8px; }
.souvenir .edition-boutons { display: flex; gap: 8px; justify-content: flex-end; }
.appareil .nom { font-size: 14.5px; font-weight: 500; }
.appareil .badge { font-size: 11.5px; font-weight: 600; color: var(--accent-fort); margin-left: 6px; }
.conso-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.conso-libelle { font-size: 13px; color: var(--texte-doux); font-weight: 500; }
.conso-total { font-family: var(--serif); font-size: 34px; margin: 2px 0 4px; }
.conso-raz { font-size: 13px; color: var(--texte-doux); background: var(--surface); border: 1px solid var(--bordure);
             border-radius: 10px; padding: 8px 12px; }
.conso-jours { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 170px; margin-bottom: 10px; }
.conso-jour { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.conso-valeur { font-size: 11.5px; color: var(--texte-doux); height: 16px; white-space: nowrap; }
.conso-barre { flex: 1; width: 100%; max-width: 46px; display: flex; flex-direction: column; justify-content: flex-end;
               background: var(--code-fond); border-radius: 7px; overflow: hidden; }
.conso-barre .lus { background: color-mix(in srgb, var(--accent) 45%, var(--code-fond)); }
.conso-barre .ecrits { background: var(--accent); }
.conso-nom { font-size: 12.5px; color: var(--texte-doux); }
.conso-jour.aujourdhui .conso-nom { color: var(--texte); font-weight: 650; }
.conso-jour.futur { opacity: .45; }
.conso-table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface);
               border: 1px solid var(--bordure); border-radius: 12px; overflow: hidden; }
.conso-table th, .conso-table td { padding: 8px 12px; text-align: left; border-top: 1px solid var(--bordure); }
.conso-table tr:first-child th { border-top: 0; background: var(--code-fond); font-weight: 600; font-size: 13px; }
.conso-table .nb { text-align: right; font-variant-numeric: tabular-nums; }
.conso-note { margin-top: 18px; font-size: 13px; }
.lien-apk { margin-top: 18px; }
.lien-apk a { color: var(--accent-fort); }
.vide-liste { color: var(--texte-faible); font-size: 14px; margin: 4px 0 0; }
.zone-danger { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--bordure); }
.btn-danger { padding: 9px 14px; border: 1px solid color-mix(in srgb, var(--erreur) 45%, var(--bordure)); border-radius: 10px;
              background: none; color: var(--erreur); font-size: 14px; font-weight: 500; }
.btn-danger:hover { background: color-mix(in srgb, var(--erreur) 8%, transparent); }
.btn-danger.petit { padding: 6px 10px; font-size: 13px; flex: none; }

/* ---------- mobile ---------- */
@media (max-width: 820px) {
  .mobile-seul { display: inline-flex !important; }
  #barre { position: fixed; inset: 0 auto 0 0; z-index: 40; transform: translateX(-100%); transition: transform .2s ease;
           width: min(86vw, 320px); box-shadow: var(--ombre); }
  #barre.ouverte { transform: none; }
  #voile { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 35; }
  #entete { padding: 0 6px; border-bottom: 1px solid var(--bordure); }
  #fil { padding: 14px 12px 20px; }
  #zone-saisie { padding: 0 10px calc(8px + env(safe-area-inset-bottom)); }
  .msg-user { max-width: 90%; }
  .msg-assistant .pastille { display: none; }
  .md { font-size: 16px; }
  #accueil { margin-top: 10vh; }
  #principal.vide #accueil { margin-top: 16vh; }
  #salutation { font-size: 26px; }
  .conv .btn-conv { opacity: 1; }
  .modale-fond { padding: 0; }
  .modale { max-width: none; height: 100%; border-radius: 0; border: 0; }
  .modale-entete { padding: 8px 6px 6px 16px; }
  .modale-corps { flex-direction: column; }
  .onglets { width: auto; flex-direction: row; padding: 0 12px 8px; gap: 4px; border-bottom: 1px solid var(--bordure); }
  .onglets button { padding: 8px 12px; }
  .panneau { padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); }
  .formulaire .rangee { grid-template-columns: 1fr; }
  .pied-formulaire { bottom: calc(-24px - env(safe-area-inset-bottom)); padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .souvenir .boutons { opacity: 1; }
}
