/* Les styles existants du site restent inchangés. Tous les ajouts sont limités au portail. */
#espace-client{background:var(--bg);scroll-margin-top:110px}
#portal-root{margin-top:28px;min-height:280px}
#portal-root *,#portal-root *::before,#portal-root *::after{box-sizing:border-box}
#portal-root .portal-layout>*,#portal-root .field,#portal-root .form-grid>*{min-width:0}
#portal-root input,#portal-root select,#portal-root textarea{max-width:100%;font-size:16px!important}
#portal-root .btn{white-space:normal;text-align:center;overflow-wrap:normal;min-height:44px}
#portal-root button,#portal-root input,#portal-root select,#portal-root textarea{font:inherit}
#portal-root button{cursor:pointer}
#portal-root button:disabled{opacity:.55;cursor:wait;transform:none}
#portal-root input:not([type=checkbox]),#portal-root select,#portal-root textarea{width:100%;min-height:48px;border:1px solid #9aa8b7;border-radius:8px;padding:11px 13px;background:#fff;color:var(--ink)}
#portal-root textarea{min-height:100px;resize:vertical}
#portal-root input:focus-visible,#portal-root select:focus-visible,#portal-root textarea:focus-visible,#portal-root button:focus-visible{outline:3px solid #0e8c82;outline-offset:3px}
#portal-root input[type=checkbox]{width:22px;height:22px;accent-color:var(--accent);flex-shrink:0}
#portal-root .portal-card{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:28px}
#portal-root .auth-card{max-width:570px}
#portal-root .form-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px}
#portal-root .field{display:flex;flex-direction:column;gap:7px;margin-bottom:20px}
#portal-root .field>label{font-weight:600;line-height:1.45}
#portal-root .field small{color:var(--muted)}
#portal-root .full{grid-column:1/-1}
#portal-root .toolbar{display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap;margin:0 0 22px}
#portal-root .actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:22px;align-items:center}
#portal-root .message{padding:14px 18px;border-radius:8px;background:var(--accent-soft);border-left:3px solid var(--accent);margin:16px 0;overflow-wrap:anywhere}
#portal-root .error{background:#fff0ef;border-color:#b22f27;color:#84241e}
#portal-root .preview-banner{background:#fff6da;border:1px solid #dec274;border-radius:8px;padding:14px 18px;margin:0 0 20px}
#portal-root .portal-layout{display:grid;grid-template-columns:260px minmax(0,1fr);gap:24px;align-items:start}
#portal-root .steps{display:flex;flex-direction:column;gap:5px}
#portal-root .step{background:transparent;color:var(--muted);border:0;border-radius:8px;text-align:left;padding:10px 12px;line-height:1.4;font-size:14px}
#portal-root .step[aria-current=step]{background:var(--accent-soft);color:var(--accent);font-weight:700}
#portal-root .steps-title{font-weight:700;margin:18px 10px 6px;font-size:13px}
#portal-root .step-count{color:var(--muted);font-size:13px;margin-bottom:8px}
#portal-root progress{width:100%;height:9px;accent-color:var(--accent);margin-bottom:22px}
#portal-root h3{font-size:23px;margin-bottom:18px}
#portal-root .help{color:var(--muted);font-size:14px;margin:0 0 18px}
#portal-root .repeat-row{background:var(--card);border:1px solid var(--line);border-radius:10px;padding:18px;margin-bottom:16px}
#portal-root .repeat-row .form-grid{gap:12px}
#portal-root .repeat-row .field{margin-bottom:8px}
#portal-root .link-button{border:0;background:transparent;color:var(--accent);text-decoration:underline;padding:8px 4px;min-height:44px}
#portal-root .summary-section{margin:20px 0;padding-top:18px;border-top:1px solid var(--line)}
#portal-root .summary-section dl{margin:0}
#portal-root .summary-section dt{font-weight:600;margin-top:12px}
#portal-root .summary-section dd{margin:4px 0 0;white-space:pre-wrap;overflow-wrap:anywhere;color:var(--muted)}
#portal-root .consent{display:flex;gap:12px;align-items:flex-start;line-height:1.6;margin:20px 0}
#portal-root .save-state{font-size:13px;color:var(--muted)}
#portal-root .dossier-list{display:grid;gap:12px}
#portal-root .dossier-item{border:1px solid var(--line);border-radius:10px;padding:18px;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
#portal-root .status{font-size:13px;padding:5px 10px;border-radius:6px;background:var(--accent-soft);color:var(--accent)}
#portal-root .danger{color:#84241e}
#portal-root .section-select{display:none}
#portal-root .business-manager{padding:20px;border:1px solid var(--line);border-radius:10px;margin-bottom:22px}
#portal-root .business-manager .field{margin:12px 0}
#portal-root .privacy{font-size:14px;color:var(--muted);line-height:1.6}
#portal-root .sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:860px){#portal-root .portal-layout{grid-template-columns:1fr}#portal-root .steps{display:none}#portal-root .section-select{display:block}#espace-client{scroll-margin-top:155px}}
@media(max-width:560px){#portal-root .form-grid{grid-template-columns:1fr}#portal-root .portal-card{padding:20px}#portal-root .actions .btn{flex:1}#portal-root .toolbar{align-items:flex-start}#portal-root .repeat-row{padding:14px}}
@media(max-width:560px){#portal-root .actions{width:100%}#portal-root .actions .btn{flex:1 1 100%;width:100%}#portal-root .save-state{flex-basis:100%;white-space:normal}#portal-root #current-step-title{scroll-margin-top:210px}}
@media print{body>header,main>section:not(#espace-client),footer,#portal-root .toolbar,#portal-root .actions,#portal-root .steps,#portal-root .section-select{display:none!important}#portal-root .portal-layout{display:block}#portal-root .portal-card{border:0;padding:0}#espace-client{padding:0}#espace-client>.wrap>.lead,#espace-client>.wrap>.eyebrow{display:none}}

#rendez-vous,#appointment-help{scroll-margin-top:110px}
@media(max-width:860px){#rendez-vous,#appointment-help{scroll-margin-top:155px}}

/* Espace dédié : le questionnaire garde la palette et les composants du site. */
.questionnaire-bar{display:none}
html.questionnaire-mode{scroll-behavior:auto;scroll-padding-top:16px}
body.questionnaire-mode>header,body.questionnaire-mode>footer,body.questionnaire-mode>.skip,
body.questionnaire-mode main> :not(#rendez-vous),
body.questionnaire-mode #rendez-vous>.wrap> :not(#espace-client),
body.questionnaire-mode #espace-client> :not(#portal-root):not(#questionnaire-bar){display:none!important}
body.questionnaire-mode #rendez-vous{padding:20px 0;min-height:100dvh;background:var(--bg)}
body.questionnaire-mode #espace-client{margin-top:0!important;scroll-margin-top:16px}
body.questionnaire-mode #portal-root{margin-top:20px}
body.questionnaire-mode .questionnaire-bar{display:flex;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid var(--line);padding-bottom:16px;color:var(--ink)}
.questionnaire-bar span,.questionnaire-bar a{font-size:14px;color:var(--muted)}
.questionnaire-bar>div:last-child{display:flex;gap:14px;align-items:center;flex-wrap:wrap}
.questionnaire-bar .btn{white-space:normal;text-align:center}
body.questionnaire-mode #portal-root .portal-card,body.questionnaire-mode #portal-root #current-step-title{scroll-margin-top:16px}
@media(max-width:560px){body.questionnaire-mode .questionnaire-bar{align-items:flex-start;flex-direction:column}.questionnaire-bar>div:last-child{width:100%;justify-content:space-between}.questionnaire-bar .btn{font-size:13px;max-width:220px}body.questionnaire-mode #rendez-vous{padding-top:16px}}
@media print{#questionnaire-bar{display:none!important}main>section:not(#rendez-vous){display:none!important}#rendez-vous>.wrap> :not(#espace-client){display:none!important}}
@media print{body #rendez-vous{display:block!important}}
.field:has(>.field-info)>label:first-child{display:inline;margin-right:6px}
.field-info{display:inline-block;border:0!important;background:transparent!important;margin:0 0 8px!important;vertical-align:middle;box-shadow:none!important}
.field-info>summary{display:inline-flex!important;align-items:center;justify-content:center;list-style:none;padding:0!important;width:30px;height:30px;min-height:30px;border:1px solid var(--accent);border-radius:50%;color:var(--accent);font-weight:700;cursor:pointer;background:var(--accent-soft)}
.field-info>summary::-webkit-details-marker{display:none}.field-info>summary::after{display:none!important}.field-info[open]{display:block}.field-info p{padding:12px 14px;background:var(--accent-soft);border-left:3px solid var(--accent);border-radius:4px;line-height:1.6;font-size:14px;margin:8px 0;overflow-wrap:anywhere}
.family-summary{border-top:3px solid var(--accent);margin-top:32px;padding-top:20px}
#family-button{margin:8px 0 8px 12px}.dossier-item .actions{flex-wrap:wrap}
@media(max-width:560px){#family-button{margin-left:0;display:block}.field-info>summary{width:36px;height:36px}.dossier-item{align-items:flex-start;gap:12px}.dossier-item .actions{margin:0}}
/* Montants : le signe $ est affiché dans la case. */
#portal-root .money-input{position:relative;display:block}
#portal-root .money-input input{padding-right:38px}
#portal-root .money-unit{position:absolute;right:14px;top:50%;transform:translateY(-50%);color:var(--muted);font-weight:600;pointer-events:none}
/* Champs à corriger : fond rouge pâle et liste cliquable en haut. */
#portal-root .field-invalid input:not([type=checkbox]),#portal-root .field-invalid select,#portal-root .field-invalid textarea{background:#fdeceb;border-color:#b22f27}
#portal-root .field-invalid>label,#portal-root .field-invalid .field-heading>label,#portal-root label.field-invalid{color:#84241e}
#portal-root label.field-invalid{background:#fdeceb;border-radius:8px;padding:8px}
#portal-root .error-list{margin:8px 0 0;padding-left:20px}
#portal-root .error-list li{margin:2px 0}
#portal-root .error-list .link-button{color:#84241e;text-align:left;min-height:36px;padding:4px 2px}
/* Durée estimée et temps restant. */
.duree-estimee{display:inline-block;background:var(--accent-soft);color:var(--ink);border-radius:12px;padding:10px 16px;font-size:14px;line-height:1.5;margin:14px 0 0}
#portal-root .duree-estimee{border-radius:10px;margin:0 0 18px}
#portal-root .etape-entete{display:flex;justify-content:space-between;align-items:center;gap:8px 16px;flex-wrap:wrap;margin-bottom:8px}
#portal-root .etape-entete .step-count{margin:0}
#portal-root .temps-restant{font-size:13px;font-weight:700;color:var(--accent);background:var(--accent-soft);border-radius:999px;padding:5px 12px;white-space:nowrap}
/* État de l’export pour TaxTron dans l’administration. */
#portal-root .export-etat{display:inline-block;font-size:13px;font-weight:700;border-radius:12px;padding:4px 12px;margin:0 0 8px;line-height:1.4}
#portal-root .dossier-item .export-etat{display:table}
#portal-root .export-etat.exporte{background:#e3f4ea;color:#1d6b3c;border:1px solid #9fd3b2}
#portal-root .export-etat.a-exporter{background:#fff1dc;color:#8a4b00;border:1px solid #f0c27a}
#portal-root .export-etat.a-exporter::before{content:'';display:inline-block;width:8px;height:8px;border-radius:50%;background:#e08a00;margin-right:7px;vertical-align:1px}
#portal-root .dossiers-test{border:1px dashed var(--line);border-radius:10px;padding:12px 16px;margin:18px 0}
#portal-root .dossiers-test summary{cursor:pointer;font-weight:600}
#portal-root .dossiers-test .help{margin:10px 0 0}
#portal-root .dossiers-test .actions{margin-top:12px}
/* Disponibilités : un jour par ligne, des moments à cocher. */
#portal-root .dispos{display:grid;gap:10px}
#portal-root .dispos .help{margin:0 0 4px}
#portal-root .dispo-jour{border:1px solid var(--line);border-radius:10px;padding:12px 14px;margin:0;display:grid;grid-template-columns:96px minmax(0,1fr);gap:10px 14px;align-items:center}
#portal-root .dispo-jour legend{float:left;font-weight:700;padding:0;margin:0}
#portal-root .dispo-choix{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
#portal-root .dispo-chip{position:relative;display:block;cursor:pointer}
#portal-root .dispo-chip input{position:absolute;opacity:0;width:1px;height:1px}
#portal-root .dispo-chip span{display:flex;flex-direction:column;justify-content:center;min-height:52px;height:100%;border:1px solid #9aa8b7;border-radius:8px;padding:6px 10px;background:#fff;line-height:1.25;transition:background .15s,border-color .15s}
#portal-root .dispo-chip strong{font-size:14px}
#portal-root .dispo-chip small{font-size:12px;color:var(--muted)}
#portal-root .dispo-chip:hover span{border-color:var(--accent)}
#portal-root .dispo-chip input:checked+span{background:var(--accent);border-color:var(--accent);color:#fff}
#portal-root .dispo-chip input:checked+span small{color:#ffffffd9}
#portal-root .dispo-chip input:checked+span strong::before{content:'✓ '}
#portal-root .dispo-chip input:focus-visible+span{outline:3px solid #0e8c82;outline-offset:2px}
#portal-root .dispo-heures{grid-column:2;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
#portal-root .dispo-heures[hidden]{display:none}
#portal-root .dispo-heures label{font-weight:600}
#portal-root .dispo-heures input{width:auto!important;min-width:130px;flex:1 1 130px;max-width:180px}
#portal-root .dispos [data-dispos-copie]{justify-self:start;text-align:left}
#portal-root .dispos-admin{white-space:pre-line}
@media(max-width:700px){#portal-root .dispo-jour{grid-template-columns:1fr}#portal-root .dispo-choix{grid-template-columns:repeat(2,minmax(0,1fr))}#portal-root .dispo-heures{grid-column:1;display:grid;grid-template-columns:auto minmax(0,1fr) auto minmax(0,1fr);gap:8px}#portal-root .dispo-heures input{min-width:0;max-width:none}}
.field-heading{display:flex;align-items:flex-start;gap:8px;position:relative}.field-heading>label{flex:1;margin:0!important}.field-heading>.field-info{flex-shrink:0;margin:0!important}.field-heading .field-info p{position:absolute;right:0;top:100%;z-index:10;width:min(300px,calc(100vw - 90px));box-shadow:0 8px 24px #16233f24;max-height:300px;overflow:auto;color:var(--ink)}

/* Fiche admin : documents à demander et lettre de mandat */
#portal-root .documents-admin{border:1px solid var(--line,#d9e2e8);border-radius:8px;padding:12px 16px;margin:16px 0}
#portal-root .documents-admin summary{cursor:pointer}
#portal-root .documents-admin h4{margin:14px 0 6px}
#portal-root .documents-admin ul{margin:0;padding-left:20px}
#portal-root .documents-admin li{margin:6px 0;line-height:1.45}
#portal-root .documents-admin small{color:#5b6670}
#portal-root .doc-statut{display:inline-block;font-size:.78rem;font-weight:600;padding:1px 8px;border-radius:999px;margin-right:4px;background:#fff4e0;color:#7a4a00}
#portal-root .doc-a-confirmer .doc-statut{background:#eef2f6;color:#33404c}
#portal-root .doc-pret .doc-statut{background:#e5f4ea;color:#1d5c33}
#portal-root .mandat-resume{border:1px solid var(--line,#d9e2e8);border-radius:8px;padding:14px 18px;margin:20px 0}
#portal-root .mandat-resume h4{margin:0 0 8px}
#portal-root .mandat-resume ul{margin:6px 0 10px;padding-left:20px}
#portal-root .mandat-resume li{margin:3px 0}

/* Pages légales affichées par-dessus le formulaire */
.page-legale-dialog{width:min(920px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:0;border:0;border-radius:12px;box-shadow:0 20px 60px rgba(15,25,40,.35);background:var(--bg,#fbfcfd);color:inherit;overflow:auto}
.page-legale-dialog::backdrop{background:rgba(15,25,40,.55)}
.page-legale-barre{position:sticky;top:0;z-index:1;display:flex;justify-content:flex-end;padding:12px 16px;background:var(--bg,#fbfcfd);border-bottom:1px solid var(--line,#d9e2e8)}
.page-legale-contenu{padding:8px 24px 24px}
.page-legale-contenu h1{margin-top:12px}
@media(max-width:560px){.page-legale-contenu{padding:4px 16px 20px}.page-legale-barre{padding:10px 12px}.page-legale-barre .btn{width:100%}}

/* Étape « Lettre de mandat » */
#portal-root .mandat-texte{padding:0}
#portal-root .mandat-texte h1{font-size:clamp(26px,4vw,36px);margin:8px 0 12px}
#portal-root .mandat-confirmation{position:sticky;bottom:0;background:var(--surface,#fff);border-top:1px solid var(--line,#d9e2e8);padding:14px 0 6px;margin-top:20px}
#portal-root .mandat-confirmation .btn{width:100%;white-space:normal}
#portal-root .mandat-confirmation .note{margin:8px 0 0}

/* Suggestions d’adresses */
#portal-root .adresse-champ{position:relative}
#portal-root .adresse-suggestions{position:absolute;left:0;right:0;top:100%;z-index:20;margin:4px 0 0;padding:4px 0;list-style:none;background:#fff;border:1px solid var(--line,#d9e2e8);border-radius:8px;box-shadow:0 10px 30px rgba(15,25,40,.15);max-height:320px;overflow:auto}
#portal-root .adresse-suggestions li[role=option]{display:flex;flex-direction:column;gap:2px;padding:10px 14px;cursor:pointer;line-height:1.35}
#portal-root .adresse-suggestions li[role=option] span{font-size:.88rem;color:#5b6670}
#portal-root .adresse-suggestions li[aria-selected=true],#portal-root .adresse-suggestions li[role=option]:hover{background:var(--accent-soft,#e9f3f2)}
#portal-root .adresse-source{padding:6px 14px 4px;font-size:.75rem;color:#6b7680;text-align:right}

/* Registre des revenus et dépenses */
#portal-root .registre-bloc{border:1px solid var(--accent);background:var(--accent-soft);border-radius:12px;padding:18px 20px;margin:0 0 24px}
#portal-root .registre-titre{font-weight:700;margin:0 0 6px}
#portal-root .registre-bloc .field{margin:14px 0 6px}
#portal-root .registre-bloc input[type=file]{min-height:0;padding:10px;background:#fff}
#portal-root .registre-bloc .consent{margin:12px 0 16px}
#portal-root .registre-liste,#portal-root .registres-admin ul,#portal-root .signatures-accueil ul{list-style:none;padding:0;margin:10px 0}
#portal-root .registre-liste li,#portal-root .registres-admin li,#portal-root .signatures-accueil li{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 12px;background:#fff;border:1px solid var(--line);border-radius:8px;margin-bottom:8px;overflow-wrap:anywhere}
#portal-root .registre-liste li .link-button{flex-shrink:0;white-space:nowrap}
#portal-root .registre-ajout{background:transparent;border:0;margin:4px 0 0;overflow:visible}
#portal-root .registre-ajout>summary{padding:8px 0;color:var(--accent);justify-content:flex-start}
#portal-root .registres-admin{margin:16px 0}
#portal-root .signatures-accueil{margin:16px 0;padding:12px 16px;border:1px solid var(--line);border-radius:10px;background:#f7fbfb}#portal-root .signatures-accueil summary{cursor:pointer;padding:4px 0}
#portal-root .registre-rappel{border-left:3px solid var(--accent);padding-left:12px}
@media(max-width:560px){#portal-root .registre-bloc{padding:16px}#portal-root .registre-bloc .btn{width:100%}#portal-root .registres-admin li,#portal-root .signatures-accueil li{flex-direction:column;align-items:stretch}}

/* Téléphone : barre du haut centrée, boutons homogènes et compacts */
@media(max-width:560px){
body.questionnaire-mode .questionnaire-bar{align-items:center;text-align:center;gap:12px}
.questionnaire-bar>div:last-child{display:grid;grid-template-columns:1fr 1fr;gap:4px 10px;justify-content:stretch}
.questionnaire-bar>div:last-child a{display:inline-flex;align-items:center;justify-content:center;min-height:44px}
.questionnaire-bar .btn{grid-column:1/-1;max-width:none;width:100%;font-size:14px;font-weight:600;font-family:inherit}
#portal-root .btn{font-size:14px;font-weight:600}
#portal-root .toolbar{flex-direction:column;align-items:stretch;text-align:center}
#portal-root .toolbar .actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
#portal-root .toolbar .actions .btn{width:100%;padding:8px 6px}
#portal-root .actions .btn:only-child{grid-column:1/-1}
}

/* Documents fiscaux déposés par le client */
#portal-root .pieces-depot{border:1px solid var(--accent);background:var(--accent-soft);border-radius:12px;padding:18px 20px;margin:8px 0 24px}
#portal-root .pieces-depot .field{margin:0 0 14px}
#portal-root .pieces-boutons{display:flex;flex-wrap:wrap;gap:10px;margin:0 0 12px}
#portal-root .pieces-progression{font-weight:700;color:var(--accent);margin:8px 0 0;min-height:1.5em}
#portal-root .pieces-progression:empty{display:none}
#portal-root .pieces-securite{border:1px solid var(--line);border-radius:12px;padding:16px 20px;margin:24px 0;background:var(--card)}
#portal-root .pieces-securite ul{margin:6px 0 0;padding-left:20px;line-height:1.6;font-size:14px}
#portal-root .pieces-invitation{border:1px solid var(--accent);background:var(--accent-soft);border-radius:12px;padding:18px 20px;margin:20px 0}
#portal-root .pieces-invitation p{margin:0 0 12px}
#portal-root .pieces-admin li{justify-content:flex-start}
#portal-root .piece-vignette{flex-shrink:0;width:96px;height:96px;padding:0;border:1px solid var(--line);border-radius:8px;background:var(--card);overflow:hidden;display:flex;align-items:center;justify-content:center;font-size:12px;color:var(--muted);cursor:zoom-in}
#portal-root .piece-vignette[disabled]{cursor:default}
#portal-root .piece-vignette img{width:100%;height:100%;object-fit:cover;display:block}
#portal-root .piece-infos{flex:1;min-width:0}
#portal-root .piece-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}
#portal-root .piece-dialog{border:0;border-radius:12px;padding:12px;max-width:min(96vw,1100px);max-height:94vh}
#portal-root .piece-dialog::backdrop{background:rgba(10,20,16,.7)}
#portal-root .piece-dialog img{display:block;max-width:100%;max-height:80vh;margin:auto}
@media(max-width:560px){#portal-root .pieces-depot,#portal-root .pieces-invitation{padding:16px}#portal-root .pieces-boutons .btn,#portal-root .pieces-invitation .btn{width:100%}#portal-root .toolbar .actions #pieces-button{grid-column:1/-1}#portal-root .pieces-admin li{flex-wrap:wrap}#portal-root .piece-actions{width:100%}#portal-root .piece-actions .btn{flex:1}}
#portal-root .note-securite{display:block;font-size:13px;line-height:1.5;color:var(--accent);margin:6px 0 0}
#portal-root .pieces-depot .note-securite,#portal-root .pieces-invitation .note-securite{margin:0 0 10px}
#portal-root .prochaine-etape{border:1px solid var(--accent);background:var(--accent-soft);border-radius:12px;padding:16px 20px;margin:16px 0}
#portal-root .prochaine-etape p{margin:0 0 6px}#portal-root .prochaine-etape p:last-child{margin:0}
#portal-root .envoi-recu:focus{outline:none}

/* Type de document choisi après le dépôt */
.pieces-etapes{margin:0 0 12px}
.piece-type{display:grid;gap:4px;margin-top:8px;font-size:14px}
.piece-type select{min-height:44px;max-width:100%}
.pieces-liste li.piece-a-preciser{border-left:4px solid #b7791f;padding-left:10px}
.pieces-liste li>span{flex:1 1 auto;min-width:0}
.piece-type select{width:100%}
.piece-type-ok{color:var(--accent,#1f6f52);font-weight:600}
.pieces-liste li{position:relative}
.pieces-liste li>span{flex-basis:100%}
.pieces-liste li>span>strong{display:inline-block;padding-right:70px;overflow-wrap:anywhere}
.pieces-liste li>[data-retirer-piece]{position:absolute;top:10px;right:12px}


/* Signature à distance */
.pdf-page{position:relative;margin:0 0 10px;background:#fff;box-shadow:0 1px 4px rgba(22,35,63,.25)}
.pdf-page canvas{display:block;width:100%;height:auto}
.sig-apercu{margin:10px 0;max-width:900px}
.sig-apercu .pdf-page{cursor:crosshair}
.sig-zone{position:absolute;aspect-ratio:3/1;border:2px dashed #0e8c82;background:rgba(14,140,130,.14);color:#0b5f58;font:600 12px/1 Arial,sans-serif;cursor:pointer;padding:0;border-radius:3px}
.signer-pdf{max-height:70vh;overflow:auto;border:1px solid #d5dbe3;border-radius:8px;padding:8px;background:#eef1f5;margin:12px 0;-webkit-overflow-scrolling:touch}
.signer-trace{display:block;width:100%;height:180px;border:2px solid #16233f;border-radius:8px;background:#fff;touch-action:none;cursor:crosshair}
.sig-check{display:flex;gap:10px;align-items:flex-start;margin:12px 0;line-height:1.45;font-weight:normal}
.sig-check input{margin-top:3px;width:20px;height:20px;flex:none}
.signature-banniere .btn{margin-top:10px}
.signature-taxtron{color:#16233f}
.signatures-admin code,.signatures-accueil code{font-size:11px;word-break:break-all}
.signature-nouveau{margin-top:14px}
.signature-nouveau summary{cursor:pointer;font-weight:600;padding:6px 0}
.signatures-liste li{flex-wrap:wrap;gap:8px}

/* Espace administrateur : menu simple */
#portal-root .admin-nav{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:10px;margin-bottom:16px;padding-bottom:10px;border-bottom:1px solid var(--line)}
#portal-root .admin-onglets,#portal-root .dossier-onglets{display:flex;flex-wrap:wrap;gap:6px}
#portal-root .dossier-onglets{margin:12px 0 20px;border-bottom:1px solid var(--line);padding-bottom:10px}
#portal-root .admin-onglet{appearance:none;border:0;background:transparent;font:inherit;font-weight:600;color:var(--ink,#16233f);padding:9px 14px;border-radius:8px;cursor:pointer}
#portal-root .admin-onglet:hover{background:#e8f5f4}
#portal-root .admin-onglet.actif{background:#16233f;color:#fff}
#portal-root .admin-tuiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin:14px 0 22px}
#portal-root .admin-tuile{appearance:none;font:inherit;text-align:left;background:#fff;border:1px solid var(--line);border-radius:10px;padding:14px 16px;cursor:pointer;color:inherit;display:flex;flex-direction:column;gap:2px}
#portal-root .admin-tuile strong{font-size:28px;line-height:1.1}
#portal-root .admin-tuile span{font-size:14px}
#portal-root .admin-tuile.active{border-color:#0e8c82;background:#e8f5f4}
#portal-root .admin-tuile:hover,#portal-root .admin-action:hover{border-color:#16233f}
#portal-root .admin-actions{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;margin:12px 0 22px}
#portal-root .admin-action{appearance:none;font:inherit;text-align:left;background:#fff;border:1px solid var(--line);border-radius:10px;padding:14px 16px;cursor:pointer;color:inherit;display:flex;flex-direction:column;gap:3px}
#portal-root .admin-action span{font-size:14px;opacity:.8}
#portal-root .admin-action.actif{border-color:#0e8c82;background:#e8f5f4}
#portal-root .admin-recherche .field{margin-bottom:10px}
#portal-root .admin-filtres{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:10px}
#portal-root .admin-filtre{appearance:none;font:inherit;font-size:14px;background:#fff;border:1px solid var(--line);border-radius:999px;padding:6px 14px;cursor:pointer;color:inherit}
#portal-root .admin-filtre.actif{background:#16233f;color:#fff;border-color:#16233f}
#portal-root .client-fiche{display:block}
#portal-root .client-fiche[hidden]{display:none}
#portal-root .client-tete{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px;margin-bottom:6px}
#portal-root .client-liens{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-start}
#portal-root .client-dossier{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:10px;padding:8px 0;border-top:1px solid var(--line)}
#portal-root .client-dossier-actions{display:flex;flex-wrap:wrap;gap:8px}
#portal-root .client-sans{margin:6px 0 0}
#portal-root .export-etat.brouillon{background:#eef1f6;color:#16233f}
#portal-root .admin-agents-ligne{display:flex;flex-wrap:wrap;gap:14px;align-items:center;margin-top:22px;padding-top:12px;border-top:1px solid var(--line);font-size:14px}
#portal-root .agent-point::before{content:"";display:inline-block;width:9px;height:9px;border-radius:50%;background:#b8bfcc;margin-right:7px}
#portal-root .agent-point.ok::before{background:#0e8c82}
#portal-root .agent-carte{background:#fff;border:1px solid var(--line);border-radius:10px;padding:14px 16px}
#portal-root .sig-zone-lecture{position:absolute;box-sizing:border-box;min-height:26px;padding:2px 6px;border:2px dashed #0e8c82;background:rgba(14,140,130,.12);color:#0b6f67;font-size:12px;font-weight:700;pointer-events:none}
#portal-root .pin-carte{max-width:420px;margin-inline:auto}
#portal-root .kiosque-code{border:1px solid var(--line);border-radius:12px;padding:22px;max-width:360px}
body.page-admin #leave-questionnaire,body.kiosque #leave-questionnaire{display:none}
body.kiosque #questionnaire-bar a{display:none}
@media print{#portal-root .admin-nav,#portal-root .dossier-onglets,#portal-root .dossier-panneau>.actions{display:none}}
@media(max-width:560px){#portal-root .client-dossier-actions .btn{width:100%}}

.portal-card>.signatures-accueil{border:0;background:none;padding:0;margin:0}

/* Zone de suppression : un cadre clair, le texte et le bouton respirent, ordinateur et téléphone. */
#portal-root .zone-danger{margin:24px 0 0;border:1px solid #e3c5c2;border-radius:12px;background:#fff;padding:0;overflow:hidden}
#portal-root details.zone-danger>summary{color:#84241e;padding:12px 16px;min-height:44px;box-sizing:border-box}
#portal-root details.zone-danger>summary::after{color:#84241e}
#portal-root .zone-danger-corps{padding:16px}
#portal-root details.zone-danger .zone-danger-corps{border-top:1px solid #e3c5c2}
#portal-root .zone-danger-corps h4{margin:0 0 8px;color:#84241e}
#portal-root .zone-danger-corps p{margin:0 0 16px}
#portal-root .btn.danger{color:#84241e;border-color:#84241e}
#portal-root .btn.danger:hover{background:#fdeceb;color:#84241e;border-color:#84241e}
#portal-root #dossier-plus-actions{margin-bottom:0}
#portal-root #admin-history-panel:empty{display:none}
/* Blocs repliables de l’administration : le contenu ne touche jamais le cadre. */
#portal-root .admin-repli{margin:16px 0 0}
#portal-root .signature-nouveau{padding:0 16px 16px}
#portal-root .signature-nouveau>summary{padding:12px 0}
#portal-root .documents-admin{padding:0 16px 16px}
#portal-root .documents-admin>summary{padding:12px 0}
/* Accueil. */
#portal-root .admin-echeances{border:1px solid var(--line);border-radius:12px;padding:12px 16px;margin:12px 0 16px;display:grid;gap:4px}
#portal-root .admin-echeances p{margin:0;font-size:14px;line-height:20px}
#portal-root .admin-echeances strong{margin-right:4px}
#portal-root .admin-lignes .client-dossier{border-top:1px solid var(--line);padding:12px 0}
#portal-root .admin-lignes .client-dossier:first-child{border-top:0}
#portal-root .admin-lignes .client-dossier-actions{display:flex;flex-wrap:wrap;gap:8px}
/* Suivi. */
#portal-root .suivi-coches{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:0 16px}
#portal-root .suivi-coches .sig-check{margin:8px 0}
#portal-root .admin-contact{margin:12px 0}
#portal-root #resume-suivi{margin:12px 0}
#portal-root #suivi-rdv{max-width:320px}
#portal-root .actions .link-button{align-self:center}
/* Signature : aucun geste du doigt ne sélectionne, ne fait défiler ni n’ouvre de menu dans le cadre. */
.signer-trace{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;height:200px}
.pdf-page{width:calc(var(--zoom,1)*100%)}
.pdf-zoom{display:none}
body.appareil-mobile .bloc-agents,body.appareil-mobile #agents-resume,body.appareil-mobile #download-export{display:none}
@media(max-width:700px){
#portal-root input:not([type=checkbox]):not([type=radio]):not([type=file]),#portal-root select,#portal-root textarea{font-size:16px}
#portal-root .admin-page{padding:16px}
/* Menu : tous les onglets visibles, assez grands pour le pouce. */
#portal-root .admin-nav{display:block}
#portal-root .admin-onglets{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;gap:4px}
#portal-root .admin-nav .admin-onglet{padding:8px 2px;min-height:44px;font-size:14px;text-align:center}
#portal-root .admin-nav #logout-button{display:block;margin:4px 0 0 auto;min-height:44px}
/* Onglets d’un dossier : une seule ligne qui défile. */
#portal-root .dossier-onglets{flex-wrap:nowrap;overflow-x:auto;margin:12px -16px 16px;padding:0 16px 8px;scrollbar-width:none;-webkit-overflow-scrolling:touch}
#portal-root .dossier-onglets::-webkit-scrollbar{display:none}
#portal-root .dossier-onglets .admin-onglet{flex:none;white-space:nowrap;min-height:44px}
#portal-root .admin-contact .btn{flex:1 1 0;width:auto;min-width:0}
#portal-root .admin-lignes .client-dossier-actions .btn{flex:1 1 0;width:auto;min-width:88px}
#portal-root .zone-danger .btn{width:100%}
#portal-root #suivi-rdv{max-width:none;width:100%;box-sizing:border-box}
/* Formulaire à lire : la page défile d’un seul tenant, pas de zone de défilement dans une autre. */
#portal-root .signer-page{padding:12px}
.signer-pdf{max-height:none;overflow-x:auto;overflow-y:hidden;padding:4px 0;margin:8px -12px;border-left:0;border-right:0;border-radius:0}
.sig-apercu{overflow-x:auto}
.pdf-zoom{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:8px 0}
.pdf-zoom .btn{flex:1 1 0;min-height:44px}
.pdf-zoom span{flex:none;min-width:56px;text-align:center;font-size:14px;font-variant-numeric:tabular-nums}
.signer-trace{height:220px;height:clamp(160px,30svh,240px)}
#portal-root .sig-check{padding:4px 0}
#portal-root .sig-check input{width:24px;height:24px}
#portal-root .signer-zone .link-button{min-height:44px}
#portal-root .kiosque-code{width:calc(100vw - 32px);max-width:360px;box-sizing:border-box;padding:16px}
}
/* Panneaux d'un dossier : pas de grand vide sous les onglets (la marge générale des sections ne s'applique pas ici). */
#portal-root .dossier-panneau{padding:0;margin:0}
#portal-root #suivi-compte{margin:0 0 8px}
body.page-admin #questionnaire-bar a{display:none}
#portal-root details.zone-danger>summary::after,#portal-root .admin-repli>summary::after{content:"\203A";display:inline-block;flex:none;width:12px;font-size:20px;line-height:20px;text-align:center}
@media(max-width:700px){#portal-root .sig-zone-lecture{font-size:10px;line-height:14px;min-height:0;padding:1px 4px;white-space:nowrap;overflow:hidden}}
#portal-root details.zone-danger>summary::after,#portal-root .admin-repli>summary::after{content:"";width:8px;height:8px;margin-right:4px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(-45deg);transition:transform .16s}
#portal-root details.zone-danger[open]>summary::after,#portal-root .admin-repli[open]>summary::after{transform:rotate(45deg)}
