/* ============================================================================
   Pro Re Nata — Styles spécifiques à la consultation TDAH (arc 1, 2026-10-12)
   ----------------------------------------------------------------------------
   Palette : violet (#9333ea) — neurodéveloppement. Choix d'identité assumé
   (peau délibérée du module ; aucune autre consultation ne porte ce violet :
   l'indigo est à la dépression, le cyan à l'anxiété, le teal reste la couleur
   des actions génériques du site) — ne pas « corriger » par zèle :
     · --tdah-accent        → fonds, bordures, anneaux (interface : 5,38:1
                              sur blanc, au-delà du seuil WCAG 1.4.11 de 3:1) ;
     · --tdah-accent-strong → tout TEXTE d'accent et le canal --suivi-accent
                              du socle, qui peint aussi les choix
                              sélectionnés sous texte blanc : #7e22ce =
                              6,96:1 sur blanc ; en sombre #d8b4fe sous
                              l'encre #0d1219.
   La peau passe par les canaux des briques partagées (accordéon, volet
   suivi, « Portée et sources ») : patron anxiete.css, jamais re-skinné.
   UNE couleur de sélection (C65, clôture 2026-10-13) : les puces et cartes
   cochées du socle (prn-chip, prn-mc, jetons --prn-int-*, teal du site)
   sont remappées au violet du module sous le volet, comme les radios
   .tdah-opt — recette de l'étalon hta.css (« Sélection à l'accent du
   module »). En sombre la coche pleine est le violet éclairci : ✓ et point
   à l'encre sombre (jamais du blanc sur violet clair). Les boutons
   d'action restent au teal du site. Arc 2 (lot 4) : `--tdah-danger` (rouge
   sémantique de la contre-indication, carte d'association exclue) — un sens,
   jamais une décoration.
   ========================================================================== */

.tdah-page { --tdah-accent: #9333ea; --tdah-accent-strong: #7e22ce; --tdah-accent-soft: #faf5ff; --tdah-accent-line: #e9d5ff;
             --tdah-warn: #b45309; --tdah-danger: #b91c1c; }

.tdah-page .page-header h1 { color: var(--tdah-accent-strong); }
.tdah-page .progress-bar { background: var(--tdah-accent); }

/* ── La peau par les canaux des briques partagées ─────────────────── */
.tdah-page {
    --prn-acc-accent:        var(--tdah-accent);
    --prn-acc-accent-strong: var(--tdah-accent-strong);
    --prn-acc-accent-soft:   var(--tdah-accent-soft);
    --prn-acc-accent-line:   var(--tdah-accent-line);
}
.tdah-page .page-header { --portee-accent: var(--tdah-accent); }
.tdah-page [id$="SuiviStepWrap"] {
    --suivi-accent: var(--tdah-accent-strong);
    --suivi-accent-soft: var(--tdah-accent-soft);
    --suivi-accent-strong: var(--tdah-accent-strong);
}
/* C65 : une seule teinte de sélection sur l'étape 1 (recette hta.css).
   Passe esthétique 2026-10-18, E-1 : le stepper vit HORS du volet
   (`.voyage-progress`) ; son cran courant restait au teal du site
   (rgb(26,107,90) clair, rgb(110,224,222) sombre). Mêmes jetons, même peau
   (recette anticoag.css, posée sur la page entière là-bas). */
.tdah-page .voyage-progress,
.tdah-page [id$="SuiviStepWrap"] {
    --prn-int-hover-bg: var(--tdah-accent-soft);
    --prn-int-hover-border: var(--tdah-accent-line);
    --prn-int-selected-bg: var(--tdah-accent-soft);
    --prn-int-selected-border: var(--tdah-accent);
    --prn-int-strong: var(--tdah-accent);
    --prn-int-strong-on: #fff;
    --prn-int-text: var(--tdah-accent-strong);
}
/* Un seul indicateur de progression : le stepper libellé dit déjà l'étape. */
.tdah-page #tdahSuiviStepWrap .step-label { display: none; }
.tdah-page .tdah-resp-grid .prn-chip-sub,
.tdah-page .tdah-checks-row .prn-mc-sub,
.tdah-page [data-host^="terrain-"] .prn-mc-sub { display: block; }   /* Q-5 : critères en sous-ligne… */
.tdah-page [data-host^="terrain-"] .prn-mc-sub { font-weight: 400; }  /* …en texte courant sous le titre gras */
/* Q-6 (owner, 2026-10-18, « Une puce par mesure ») : mesures non pharmacologiques en liste. */
.tdah-page .tdah-mnp-list { margin: 0.5rem 0 0.4rem; padding-left: 1.2rem; font-size: 0.85rem; line-height: 1.45; }
.tdah-page .tdah-mnp-list li { margin-bottom: 0.2rem; }
.tdah-page .tdah-se-grades { margin-top: 0.5rem; }

.tdah-help {
    margin: 0 0 0.7rem;
    font-size: 0.82rem;
    color: var(--prn-muted);
    line-height: 1.45;
}
.tdah-action-hint {
    margin: 1.2rem 0 0;
    text-align: center;
    font-size: 0.82rem;
    color: var(--tdah-warn);
    font-weight: 600;
}
.tdah-action-hint:empty { display: none; }

/* E-6 (passe esthétique 2026-10-18) : pistes FIXES, partagées par toutes les
   rangées de champs — en `auto-fit … 1fr`, l'âge (2 chiffres) s'étirait à
   479 px, la taille seule à 969 px, et les colonnes ne s'alignaient pas d'une
   rangée à l'autre (pistes de 479 px sous l'âge, de 315 px sous la TA). Au
   mobile, une piste : rien ne change. */
.tdah-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 260px));
    gap: 0.6rem 0.7rem;
    margin-bottom: 0.6rem;
}
/* E-5 : trois colonnes au bureau (recette anticoag.css, tour 2) — à quatre,
   une case de 235 px portait jusqu'à huit lignes (« Inhibiteur modéré ou
   puissant du CYP3A4 : … ») et les signes d'alarme laissaient deux cases
   seules sur leur rangée. Les cases d'une rangée gardent la même hauteur. */
.tdah-grid-checks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr));
    gap: 0.45rem;
}
/* E-4 : sur une case de plusieurs lignes, la coche s'aligne sur la PREMIÈRE
   ligne du titre, jamais au milieu (78 px du haut mesurés) — patron HTA B5. */
.tdah-page [id$="SuiviStepWrap"] label.prn-mc,
.tdah-page [id$="SuiviStepWrap"] label.prn-chip { align-items: flex-start; }
.tdah-page [id$="SuiviStepWrap"] label.prn-mc .prn-check-box,
.tdah-page [id$="SuiviStepWrap"] label.prn-chip .prn-check-box,
.tdah-page [id$="SuiviStepWrap"] label.prn-chip .prn-radio-dot { margin-top: 0.15rem; }
.tdah-checks-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.4rem 0 0.6rem;
}
.tdah-resp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.tdah-page .p-field--wide { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 0.6rem; }

/* ── Questions à choix (radios du module) ─────────────────────────── */
.tdah-q-table { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0.6rem; }
.tdah-q-row {
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--prn-line);
    border-radius: var(--radius);
    background: var(--prn-surface);
}
.tdah-q { font-size: 0.85rem; color: var(--prn-navy); margin-bottom: 0.5rem; line-height: 1.4; }
.tdah-opts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
    gap: 0.35rem;
}
.tdah-opt {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--prn-line);
    border-radius: var(--radius);
    background: var(--prn-surface);
    cursor: pointer;
    font-size: 0.82rem;
    min-height: 44px;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
@media (prefers-reduced-motion: reduce) {
    .tdah-opt { transition: none; }
}
.tdah-opt:hover { border-color: var(--tdah-accent-line); background: var(--tdah-accent-soft); }
.tdah-opt:focus-visible { outline: 2px solid var(--tdah-accent-strong); outline-offset: 2px; }
.tdah-opt.is-selected {
    background: var(--tdah-accent-strong);
    color: white;
    border-color: var(--tdah-accent-strong);
}
.tdah-opt.is-selected .tdah-dot { background: white; border-color: white; }
.tdah-opt.is-selected .tdah-opt-label { color: white; }
.tdah-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--prn-line);
    flex-shrink: 0;
}
.tdah-page [data-tdah-resp][aria-disabled="true"] { cursor: default; }

.tdah-page .tdah-untreated { margin: 0.4rem 0 0; font-size: 0.9rem; color: var(--prn-muted); }
.tdah-page .tdah-autonomy { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.4rem; }
.tdah-page .tdah-autonomy > .tdah-help { margin: 0.5rem 0 0; }
.tdah-page [data-tdah-out] { margin-top: 0.6rem; }
.tdah-page .prn-callout { margin: 0.5rem 0 0; }

/* Échelle facultative : repliée, le pharmacien pressé ne la voit pas. */
.tdah-page .tdah-scale { margin: 0.6rem 0; }
/* E-8 (passe esthétique 2026-10-18) : `display: flex` effaçait le triangle du
   <summary> — l'échelle se lisait comme un titre violet, pas comme un dépli.
   Contrat du socle (`details.suivi-fold`, suivi.css) : list-item, 44 px. */
.tdah-page .tdah-scale > summary { cursor: pointer; min-height: 44px; display: list-item; padding-block: 0.7rem; box-sizing: border-box; font-weight: 600; color: var(--tdah-accent-strong); }

@media (max-width: 640px) {
    .tdah-opts { grid-template-columns: 1fr 1fr; }
}

/* ── Décisions par carte (brique partagée PRN_SUIVI_DECISIONS, préfixe
   tdah-dec) : réplique du patron anxiete.css, jetons génériques du site. */
.tdah-page .tdah-decisions .tdah-dec-sub { margin: 0 0 0.6rem; font-size: 0.85rem; color: var(--prn-muted); }
/* E-2 (passe esthétique 2026-10-18) : Retenir / Reporter / Refus étaient des
   radios natives nues (bleu du navigateur, 22 px de haut) — pilules dessinées
   à l'accent, radio native masquée (recette .hta-dec-opt de l'étalon, reprise
   par anticoag.css) ; au mobile une décision par ligne, cible ≥ 44 px. */
.tdah-page .tdah-dec-opts { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tdah-page .tdah-dec-opt {
    display: inline-flex; align-items: center; gap: 0.35rem;
    font-size: 0.88rem; cursor: pointer;
    min-height: 36px;
    padding: 0.2rem 0.75rem 0.2rem 0.5rem;
    border: 1px solid var(--prn-line-strong);
    border-radius: 999px;
    background: var(--prn-surface);
    transition: border-color 0.12s ease-out, background-color 0.12s ease-out;
}
.tdah-page .tdah-dec-opt:hover { border-color: var(--tdah-accent-line); background: var(--tdah-accent-soft); }
.tdah-page .tdah-dec-opt:has(input:checked) {
    border-color: var(--tdah-accent);
    background: var(--tdah-accent-soft);
    font-weight: 600;
}
.tdah-page .tdah-dec-opt:has(input:focus-visible) { outline: 2px solid var(--tdah-accent); outline-offset: 2px; }
.tdah-page .tdah-dec-opt input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    flex: none;
    width: 18px; height: 18px;
    margin: 0;
    border: 2px solid var(--prn-line-strong);
    border-radius: 50%;
    background: var(--prn-surface);
    outline: none;
    cursor: inherit;
}
.tdah-page .tdah-dec-opt input[type="radio"]:checked {
    border-color: var(--tdah-accent);
    background: radial-gradient(circle, var(--tdah-accent) 0 4px, var(--prn-surface) 4.6px);
}
@media (prefers-reduced-motion: reduce) { .tdah-page .tdah-dec-opt { transition: none; } }
@media (max-width: 480px) {
    .tdah-page .tdah-dec-opts { flex-direction: column; gap: 0.4rem; align-items: stretch; }
    .tdah-page .tdah-dec-opt { width: 100%; border-radius: 12px; min-height: 44px; box-sizing: border-box; }
}
.tdah-page .tdah-dec-reason { display: block; margin-top: 0.45rem; font-size: 0.85rem; }
.tdah-page .tdah-dec-reason[hidden] { display: none; }
.tdah-page .tdah-dec-linked { display: block; margin-top: 0.4rem; font-size: 0.85rem; font-weight: 600; color: var(--prn-muted); }
.tdah-page .tdah-dec-linked[hidden] { display: none; }
.tdah-page .tdah-dec-row[data-dec-linked-on] .tdah-dec-opt { opacity: 0.55; cursor: not-allowed; }
.tdah-page .tdah-dec-reason input {
    width: 100%;
    margin-top: 0.2rem;
    padding: 0.5rem 0.7rem;
    font-size: 1rem;
    border: 1px solid var(--prn-line-strong);
    border-radius: 8px;
    background: var(--prn-surface, #fff);
    color: inherit;
}
.tdah-page .tdah-dec-reason input:focus-visible { outline: 2px solid var(--prn-accent); outline-offset: 1px; }
.tdah-page .suivi-rec .tdah-dec-inline {
    margin-top: 0.6rem;
    padding: 0.55rem 0 0;
    border: none;
    border-top: 1px dashed var(--prn-line);
    border-radius: 0;
}
.tdah-page .tdah-dec-lead {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--tdah-accent-strong);   /* E-2 : était le teal du site */
    align-self: center;
}
.tdah-page .suivi-rec[data-dec-status] > .suivi-rec-rationale,
.tdah-page .suivi-rec[data-dec-status] > .suivi-rec-rows,
.tdah-page .suivi-rec[data-dec-status] > .suivi-rec-src {
    color: var(--prn-muted);
    filter: grayscale(1);
}
.tdah-page .tdah-dec-recap { margin: 0.2rem 0 0; padding-left: 1.15rem; }
.tdah-page .tdah-dec-recap li { margin-bottom: 0.45rem; line-height: 1.5; }
.tdah-page .tdah-dec-recap-why { margin-top: 0.15rem; }
.tdah-page .tdah-dec-recap-why > summary { font-size: 0.82rem; cursor: pointer; }
.tdah-page .tdah-dec-recap-reason { color: var(--prn-muted); }
.tdah-page .cons-card { margin: 1.35rem 0; }
.tdah-page .suivi-rec { margin: 0 0 1.1rem; padding: 1rem 1.15rem; }
.tdah-page .suivi-card { margin: 0 0 1.15rem; padding: 1rem 1.15rem; }
.tdah-page .suivi-card > :last-child { margin-bottom: 0; }
.tdah-page .tdah-dec-row { margin-bottom: 0.6rem; }
/* E-3 (passe esthétique 2026-10-18) : les titres de carte de l'étape 3
   parlaient trois voix — « Décisions du jour » et « Plan de re-suivi » au
   teal du site (Inter 15,2 px), « Ordonnance — vérifier… » en serif marine
   17 px. Une seule voix, à l'accent fort du module (recette anticoag.css) ;
   le teal reste aux commandes du site. */
.tdah-page .suivi-card > h3,
.tdah-page .cons-card h3,
[data-theme="dark"] .tdah-page .suivi-card > h3,
[data-theme="dark"] .tdah-page .cons-card h3 { color: var(--tdah-accent-strong); }
.tdah-page .cons-card h3 { font-family: var(--font-sans); font-size: 0.95rem; font-weight: 700; letter-spacing: 0; }

/* E-7 (passe esthétique 2026-10-18) : la quantité s'imprime en chiffres ET
   en lettres (« 30 (trente) comprimés ») ; dans sa case de 178 px elle se
   rognait (« 30 (trente) comprim »). Posologie pleine largeur, quantité et
   renouvellements dessous (recette anticoag.css / asthme.css). */
.tdah-page .prn-rx-editor .prn-rx-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem 1rem; }
.tdah-page .prn-rx-editor .prn-rx-fields > :has([data-rx-field="posology"]) { grid-column: 1 / -1; }
@media (max-width: 560px) {
    .tdah-page .prn-rx-editor .prn-rx-fields { grid-template-columns: 1fr; }
}

/* Choix du produit par le pharmacien (P10) et motif d'écart. */
.tdah-page .tdah-product-choice { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: flex-end; margin-top: 0.6rem; }
/* C42 (zéro débordement horizontal) : le libellé ne dépasse jamais la carte, et le sélecteur s'y étire — à 375 px, un
   nom de produit long (« Guanfacine XR (précaution) ») se rognait sous `overflow-x: clip`. Une borne posée aussi sur
   le sélecteur restait sans effet sous mutation (sonde E2E du 2026-10-17) : purgée (leçon 7). */
.tdah-page .tdah-product-choice label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.85rem; flex: 0 1 auto; min-width: 0; max-width: 100%; }
.tdah-page .tdah-product-choice select,
.tdah-page .tdah-product-choice input { font-size: 16px; min-height: 44px; }
.tdah-page .tdah-product-choice [hidden] { display: none; }

/* ── Continuité — mémoire de poste, fiche chiffrée, rappels de reprise :
   recettes de l'anxiété à la peau du module ; bord COMPLET teinté. */
.tdah-page .tdah-memo {
    margin: 0 0 1rem;
    padding: 0.9rem 1.1rem;
    border: 1px solid var(--tdah-accent-line);
    border-radius: 10px;
    background: var(--tdah-accent-soft);
}
.tdah-page .tdah-memo h3 { margin: 0 0 0.35rem; color: var(--tdah-accent-strong); font-size: 1rem; }
.tdah-page .tdah-memo-sub { margin: 0 0 0.35rem; font-size: 0.9rem; }
.tdah-page .tdah-memo-list { margin: 0 0 0.5rem; padding-left: 1.2rem; font-size: 0.9rem; }
.tdah-page .tdah-memo-warn {
    margin: 0 0 0.6rem;
    padding: 0.45rem 0.6rem;
    font-size: 0.82rem;
    color: var(--tdah-warn);
    background: color-mix(in srgb, var(--tdah-warn) 12%, transparent);
    border-radius: 8px;
}
.tdah-page .tdah-memo-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tdah-page .tdah-memo-done { font-size: 0.9rem; font-weight: 600; color: var(--tdah-accent-strong); }
.tdah-page .tdah-memo-fold { margin: 0 0 1rem; }
.tdah-page .tdah-memo-fold > summary { cursor: pointer; font-size: 0.9rem; font-weight: 600; color: var(--tdah-accent-strong); min-height: 44px; display: flex; align-items: center; gap: 0.4rem; list-style: none; }
.tdah-page .tdah-memo-fold > summary::-webkit-details-marker { display: none; }
.tdah-page .tdah-memo-fold > .tdah-memo { margin-top: 0.45rem; }
.tdah-page .tdah-fiche h3 { margin: 0; font-size: 0.98rem; }
.tdah-page .tdah-fiche-fold > summary {
    display: flex; align-items: center; gap: 0.4rem;
    cursor: pointer; list-style: none;
    padding: 0.35rem 0; min-height: 44px;
}
.tdah-page .tdah-fiche-fold > summary::-webkit-details-marker { display: none; }
/* E-8 : la fiche et la mémoire de poste se repliaient SANS chevron (marqueur
   retiré, aucun dessiné) ; chevron de la recette anxiete.css / .prn-portee. */
.tdah-page .tdah-fiche-fold > summary::before,
.tdah-page .tdah-memo-fold > summary::before {
    content: ""; flex: 0 0 auto; width: 0.5rem; height: 0.5rem;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(-45deg); transition: transform 120ms ease;
}
.tdah-page .tdah-fiche-fold[open] > summary::before,
.tdah-page .tdah-memo-fold[open] > summary::before { transform: rotate(45deg); }
@media (prefers-reduced-motion: reduce) {
    .tdah-page .tdah-fiche-fold > summary::before,
    .tdah-page .tdah-memo-fold > summary::before { transition: none; }
}
.tdah-page .tdah-fiche-fold > summary:focus-visible { outline: 2px solid var(--prn-int-strong); outline-offset: 2px; }
.tdah-page .tdah-fiche-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.5rem 0 0.2rem; }
.tdah-page .tdah-fiche-row input { flex: 0 1 14rem; min-width: 9rem; }
.tdah-page .tdah-fiche-status { margin: 0.45rem 0 0; font-size: 0.88rem; font-weight: 600; }
.tdah-page .tdah-fiche-rem {
    margin: 0 0 1rem;
    padding: 0.7rem 1rem;
    border: 1px solid var(--tdah-accent-line);
    border-radius: 10px;
}
.tdah-page .tdah-fiche-rem-title { margin: 0 0 0.2rem; font-size: 0.85rem; font-weight: 700; }
.tdah-page .tdah-fiche-rem ul { margin: 0; padding-left: 1.2rem; font-size: 0.85rem; }

/* ── Arc 2 (lot 4) : le régime non stimulant, à côté du stimulant ; la carte
   ROUGE d'une association exclue (deux agonistes alpha-2) : bord complet et
   fond teintés + pilule « Association exclue » (point + mots, jamais la
   couleur seule). Le rouge est sémantique (contre-indication), pas une peau. */
.tdah-page .tdah-ns-block { margin-top: 1rem; padding-top: 0.9rem; border-top: 1px dashed var(--tdah-accent-line); }
.tdah-page .suivi-rec.tdah-rec-ci {
    border-color: color-mix(in srgb, var(--tdah-danger) 45%, var(--prn-surface));
    background: color-mix(in srgb, var(--tdah-danger) 6%, var(--prn-surface));
}
.tdah-page .tdah-ci-badge {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.15rem 0.6rem; border-radius: 999px;
    font-size: 0.78rem; font-weight: 700; color: var(--tdah-danger);
    border: 1px solid color-mix(in srgb, var(--tdah-danger) 55%, transparent);
    background: color-mix(in srgb, var(--tdah-danger) 10%, transparent);
}
.tdah-page .tdah-ci-badge::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: currentColor; }

/* ── Mode sombre : accents éclaircis, fonds translucides ───────────── */
[data-theme="dark"] .tdah-page {
    --tdah-accent: #c084fc;
    --tdah-accent-strong: #d8b4fe;
    --tdah-accent-soft: rgba(192, 132, 252, 0.12);
    --tdah-accent-line: rgba(192, 132, 252, 0.38);
    --tdah-warn: #fcd34d;
    --tdah-danger: #fca5a5;
}
[data-theme="dark"] .tdah-page .voyage-progress,
[data-theme="dark"] .tdah-page [id$="SuiviStepWrap"] { --prn-int-strong-on: #0d1219; }
[data-theme="dark"] .tdah-opt.is-selected,
[data-theme="dark"] .tdah-opt.is-selected .tdah-opt-label { color: #0d1219; }
[data-theme="dark"] .tdah-opt.is-selected .tdah-dot { background: #0d1219; border-color: #0d1219; }
