/* ============================================================================
   Pro Re Nata — Styles spécifiques à la consultation Hypertension artérielle
   ----------------------------------------------------------------------------
   Réutilise au max les classes partagées :
     - .voyage-shell + .voyage-step + .voyage-actions (voyage.css)
     - .prn-chip, .prn-mc, .prn-callout-* (voyage.css / components.css)
   Palette : rouge sang (#dc2626) pour la PA, vert pour cible atteinte, ambre
   pour limite, bleu indigo pour info. Cohérence visuelle avec contraception.
   ========================================================================== */

.hta-page { --hta-accent: #dc2626; --hta-accent-strong: #b91c1c; --hta-accent-soft: #fef2f2; --hta-accent-line: #fecaca;
            --hta-good: #16a34a; --hta-warn: #b45309; --hta-info: #2563eb; } /* WCAG AA Sprint 6 M5 R1 — était #d97706 */

.hta-page .page-header h1 { color: var(--hta-accent); }
.hta-page .progress-bar { background: linear-gradient(90deg, var(--hta-accent), #f87171); }
.hta-page .source-note { font-size: 12px; color: var(--prn-muted); margin-top: 6px; font-style: italic; }

/* ── Blocs (rappelle .con-block) ──────────────────────────────────── */
.hta-block {
    margin: 1rem 0 1.25rem;
    padding: 0.85rem 1rem;
    background: var(--prn-surface);
    border: 1px solid var(--prn-line);
    border-radius: var(--radius);
}
.hta-block-emph { background: var(--hta-accent-soft); border-color: var(--hta-accent-line); }
.hta-block h3 {
    margin: 0 0 0.55rem;
    font-size: 0.95rem;
    color: var(--hta-accent);
    font-weight: 700;
    font-family: var(--font-sans);
}
.hta-help {
    margin: 0 0 0.7rem;
    font-size: 0.82rem;
    color: var(--prn-muted);
    line-height: 1.45;
}
.hta-help-inline {
    font-size: 0.72rem;
    color: var(--prn-muted);
    font-weight: 500;
    margin-left: 0.3rem;
}

/* ── Grilles ──────────────────────────────────────────────────────── */
.hta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.6rem 0.7rem;
}
.hta-grid-checks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.45rem;
}
.hta-checks-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ── Inputs : 16px iOS no-zoom + 44pt tap targets ─────────────────── */
.hta-block .p-field { display: flex; flex-direction: column; gap: 0.25rem; }
.hta-block .p-field > span {
    font-size: 0.78rem;
    color: var(--prn-muted);
    font-weight: 600;
}
.hta-block input[type="number"],
.hta-block input[type="text"],
.hta-block input[type="date"],
.hta-block select {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--prn-line);
    border-radius: var(--radius);
    font-size: 16px;
    font-family: inherit;
    color: var(--prn-navy);
    background: var(--prn-surface);
    min-height: 44px;
    box-sizing: border-box;
}
.hta-block input:focus,
.hta-block select:focus {
    outline: none;
    border-color: var(--hta-accent);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

/* ── Détails (expanders) ──────────────────────────────────────────── */
.hta-details {
    margin: 0.7rem 0 0;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--prn-line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--prn-surface) 70%, transparent);
    font-size: 0.85rem;
}
.hta-details summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--prn-ink);
}
.hta-details[open] { background: var(--prn-surface); }

/* ── Action hint (sticky bar helper) ──────────────────────────────── */
.hta-action-hint {
    margin: 1.2rem 0 0;
    text-align: center;
    font-size: 0.82rem;
    color: var(--hta-warn);
    font-weight: 600;
}
.hta-action-hint:empty { display: none; }

/* ── Smooth fade on step ──────────────────────────────────────────── */
#htaStepWrap > .prn-step { animation: htaFadeIn 0.25s ease; }
@keyframes htaFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Cible thérapeutique — justification (déplacée en fin de consultation :
      recommandation + plan de suivi + ordonnance) ─────────────────────── */
.hta-target-info,
.hta-target-justify {
    margin-top: 1rem;
    padding: 0.7rem 0.9rem;
    background: var(--hta-accent-soft);
    border: 1px solid var(--hta-accent-line);
    border-left: 4px solid var(--hta-accent);
    border-radius: var(--radius);
    font-size: 0.88rem;
    color: var(--prn-ink);
}
.hta-target-info strong,
.hta-target-justify strong { color: var(--hta-accent-strong); }  /* WCAG AA Sprint 6 M5 R1 */
.hta-target-info .muted,
.hta-target-justify .muted { font-size: 0.8rem; }

/* ── Bullets ──────────────────────────────────────────────────────── */
.hta-bullets {
    margin: 0.3rem 0 0;
    padding-left: 1.2rem;
    font-size: 0.85rem;
    line-height: 1.5;
}
.hta-bullets li { padding: 0.15rem 0; }
.hta-meta-note { font-size: 0.72rem; color: var(--prn-muted); margin: 0.4rem 0 0; }

/* ── Tabs (méthode de mesure) ─────────────────────────────────────── */
.hta-tabs {
    display: flex;
    gap: 0.4rem;
    margin: 0.4rem 0 0.85rem;
    flex-wrap: wrap;
}
.hta-method-tabs .hta-tab {
    flex: 1 1 200px;
    min-height: 60px;
}
.hta-tab {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.6rem 0.9rem;
    background: var(--prn-surface);
    border: 1px solid var(--prn-line);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.86rem;
    color: var(--prn-ink);
    font-family: inherit;
    font-weight: 600;
    min-height: 44px;
    transition: border-color 0.15s, background 0.15s;
    text-align: center;
}
.hta-tab:hover { border-color: var(--hta-accent-line); background: var(--hta-accent-soft); }
.hta-tab.is-active {
    background: var(--hta-accent);
    border-color: var(--hta-accent);
    color: #fff;
}
.hta-tab-icon { font-size: 1.2rem; }
.hta-tab-label { font-size: 0.82rem; }

/* ── Tip box ──────────────────────────────────────────────────────── */
.hta-tip {
    background: color-mix(in srgb, var(--hta-info) 8%, var(--prn-surface));
    border: 1px solid color-mix(in srgb, var(--hta-info) 25%, transparent);
    border-left: 3px solid var(--hta-info);
    padding: 0.55rem 0.8rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    margin-bottom: 0.6rem;
    line-height: 1.45;
}
.hta-tip-thr { margin-top: 0.3rem; font-size: 0.78rem; color: var(--prn-muted); }
.hta-tip-prefer {
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 1px dashed color-mix(in srgb, var(--hta-info) 30%, transparent);
    font-size: 0.82rem;
}

/* ── Consultation dédiée (comorbidité → module ; p. ex. IC → ic.html) ── */
.hta-refer-banner { display: block; margin-top: 0.6rem; line-height: 1.5; }
.hta-refer-module-btn {
    display: inline-block;
    margin-top: 0.4rem;
    padding: 0.35rem 0.7rem;
    background: var(--hta-accent, #b91c1c);
    color: #fff;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.hta-refer-module-btn:hover { filter: brightness(1.08); }

/* ── IMC callout ──────────────────────────────────────────────────── */
.hta-bmi-callout {
    margin-top: 0.5rem;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    display: inline-block;
}
.hta-bmi-callout.is-normal { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.hta-bmi-callout.is-over   { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.hta-bmi-callout.is-obese  { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ── Mesures (rangées de PA) ──────────────────────────────────────── */
.hta-measures-card {
    margin-top: 0.5rem;
    padding: 0.65rem;
    border: 1px solid var(--prn-line);
    border-radius: var(--radius);
    background: var(--prn-surface);
}
.hta-measures-head {
    display: grid;
    grid-template-columns: 42px 1fr 1fr 1fr 1.2fr 30px;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    font-size: 0.7rem;
    color: var(--prn-muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.hta-measure-row {
    display: grid;
    grid-template-columns: 42px 1fr 1fr 1fr 1.2fr 30px;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.35rem;
}
.hta-measure-time {
    padding: 0.5rem 0.55rem !important;
    min-height: 40px;
    border-radius: 8px;
    text-align: center;
    font-size: 0.85rem;
}
.hta-measure-row input {
    padding: 0.5rem 0.55rem !important;
    min-height: 40px;
    border-radius: 8px;
    text-align: center;
}
.hta-measure-i {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--prn-muted);
    text-align: center;
}
.hta-rm-measure {
    background: transparent;
    border: 1px solid var(--prn-line);
    width: 28px; height: 28px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--prn-muted);
    font-size: 0.78rem;
    padding: 0;
}
.hta-rm-measure:hover { color: var(--hta-accent); border-color: var(--hta-accent); }

/* AMPA : colonne AM/PM supplémentaire (calendrier + toggle AM|PM). */
.hta-measures-head.has-ampm,
.hta-measure-row.has-ampm {
    grid-template-columns: 42px 1fr 1fr 1fr 1.3fr 0.9fr 30px;
}
.hta-ampm {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
}
.hta-ampm-btn {
    flex: 1;
    min-height: 40px;
    padding: 0.3rem 0.35rem;
    border: 1px solid var(--prn-line);
    border-radius: 8px;
    background: transparent;
    color: var(--prn-muted);
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
}
.hta-ampm-btn.is-active {
    background: var(--hta-accent);
    border-color: var(--hta-accent);
    color: #fff;
}
.hta-measure-date { font-size: 0.78rem !important; }

@media (max-width: 520px) {
    .hta-measures-head { display: none; }
    .hta-measure-row,
    .hta-measure-row.has-ampm {
        grid-template-columns: 1fr 1fr 1fr 28px;
        gap: 0.4rem;
    }
    .hta-measure-i {
        grid-column: 1 / -1;
        text-align: left;
        font-size: 0.72rem;
        margin-bottom: -0.2rem;
    }
    /* La colonne « Prise à » passe sur sa propre ligne (pleine largeur). */
    .hta-measure-time { grid-column: 1 / -1; }
    .hta-ampm { grid-column: 1 / -1; }
}

/* ── Bilan biologique (carte embellie) ────────────────────────────── */
.hta-labs-card {
    border: 1px solid var(--prn-line);
    border-radius: var(--radius);
    background: var(--prn-surface);
    padding: 0.7rem 0.9rem;
}
.hta-labs-card > summary {
    font-weight: 700;
    cursor: pointer;
}
.hta-labs-grid { margin-top: 0.6rem; }
.hta-lab-input {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.hta-lab-input input { flex: 1; min-width: 0; }
.hta-lab-unit {
    font-size: 0.72rem;
    color: var(--prn-muted);
    white-space: nowrap;
    font-weight: 600;
}
.hta-required {
    font-size: 0.72rem;
    font-weight: 700;
    color: #b45309;
    margin-left: 0.35rem;
}
.hta-labs-grid.is-disabled { opacity: 0.5; }
.hta-nolabs { margin-top: 0.6rem; }

/* (Signaux d'alarme cochables retirés — 2026-07-23 : détection automatique
   par le moteur.) */

/* ── CI structurées : classes touchées + pourquoi ─────────────────── */
.hta-ci-targets { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.25rem; }
.hta-ci-target {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    border: 1px solid transparent;
}
.hta-ci-target.is-absolute {
    color: #b91c1c;
    border-color: rgba(185, 28, 28, 0.45);
    background: rgba(185, 28, 28, 0.08);
}
.hta-ci-target.is-avoid {
    color: #b45309;
    border-color: rgba(180, 83, 9, 0.45);
    background: rgba(180, 83, 9, 0.08);
}
.hta-ci-why { margin-top: 0.25rem; font-style: italic; }

/* ── Lettre de référence (étape 5 suivi) ──────────────────────────── */
.hta-letter-block { border-left: 4px solid var(--hta-accent); }
.hta-letter-block.is-urgent { border-left-color: #b91c1c; }
.hta-letter-block .hta-bullets { margin: 0.4rem 0 0.8rem; }

/* ── Moyenne PA (callout) ─────────────────────────────────────────── */
.hta-avg {
    margin-top: 0.7rem;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--prn-line);
    border-left: 4px solid var(--prn-line);
    border-radius: var(--radius);
    background: var(--prn-surface);
}
.hta-avg-row {
    display: flex;
    align-items: baseline;
    gap: 0.8rem;
    flex-wrap: wrap;
}
.hta-avg-label {
    font-size: 0.74rem;
    color: var(--prn-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
}
.hta-avg-val {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--prn-ink);
    font-family: var(--font-serif);
}
.hta-avg-fc { font-size: 0.85rem; color: var(--prn-muted); }
.hta-avg-interp { margin-top: 0.4rem; font-size: 0.86rem; font-weight: 600; }

.hta-avg.is-urgence    { border-left-color: #b91c1c; background: #fef2f2; }
.hta-avg.is-urgence .hta-avg-val,
.hta-avg.is-urgence .hta-avg-interp { color: #991b1b; }
.hta-avg.is-severe     { border-left-color: var(--hta-accent); background: #fff5f5; }
.hta-avg.is-severe .hta-avg-val { color: var(--hta-accent); }
.hta-avg.is-stage1     { border-left-color: #ea580c; background: #fff7ed; }
.hta-avg.is-stage1 .hta-avg-val { color: #c2410c; }
.hta-avg.is-borderline { border-left-color: #f59e0b; background: #fffbeb; }
.hta-avg.is-normal     { border-left-color: var(--hta-good); background: #f0fdf4; }
.hta-avg.is-normal .hta-avg-val { color: var(--hta-good); }

/* ── Alerte danger ────────────────────────────────────────────────── */
.hta-alert {
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.88rem;
    margin: 0.5rem 0;
}
.hta-alert--danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #b91c1c;
    color: #991b1b;
}

/* ── Cards comorbidités ───────────────────────────────────────────── */
.hta-cond-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.35rem;
}
.hta-cond-tag {
    display: inline-block;
    font-size: 0.68rem;
    padding: 0.12rem 0.5rem;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.hta-cond-tag--good { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.hta-cond-tag--bad  { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.hta-cond-tag--warn { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.hta-cond-tag--info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* ── Allergies / CI structurées colored ───────────────────────────── */
.hta-ci-allerg.is-selected { background: #fef2f2 !important; border-color: #fecaca !important; }
.hta-ci-struct.is-selected  { background: #fefce8 !important; border-color: #fef08a !important; }

/* ── Habitudes ────────────────────────────────────────────────────── */
.hta-habit .hta-habit-effet {
    display: inline-block;
    margin-top: 0.3rem;
    padding: 0.18rem 0.55rem;
    background: color-mix(in srgb, var(--hta-good) 12%, transparent);
    color: var(--hta-good);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}
.hta-habit-counter {
    margin-top: 0.7rem;
    padding: 0.6rem 0.85rem;
    background: var(--hta-accent-soft);
    border: 1px solid var(--hta-accent-line);
    border-radius: var(--radius);
    font-size: 0.86rem;
    text-align: center;
}
.hta-habit-counter strong { color: var(--hta-accent); font-size: 1.05rem; }

/* ── Médication actuelle (suivi) ──────────────────────────────────── */
.hta-curmeds {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.hta-curmed-row {
    border: 1px solid var(--prn-line);
    border-radius: var(--radius);
    padding: 0.6rem 0.7rem;
    background: var(--prn-surface);
    transition: border-color 0.15s, background 0.15s;
}
.hta-curmed-row.is-selected {
    border-color: var(--hta-accent);
    background: var(--hta-accent-soft);
}
.hta-curmed-toggle { margin: 0 !important; }
.hta-curmed-detail {
    margin-top: 0.6rem;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 0.5rem;
}
@media (max-width: 640px) {
    .hta-curmed-detail { grid-template-columns: 1fr 1fr; }
}

/* ── Recommandation callout (étape 5) ─────────────────────────────── */
.hta-rec-card {
    margin: 0.5rem 0 1rem;
    padding: 0.9rem 1rem;
    background: linear-gradient(135deg, var(--hta-accent-soft), #fff5f5);
    border: 1px solid var(--hta-accent-line);
    border-left: 4px solid var(--hta-accent);
    border-radius: var(--radius);
}
.hta-rec-card.hta-rec-lifestyle {
    background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
    border-color: #bbf7d0;
    border-left-color: var(--hta-good);
}
.hta-rec-head {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    margin-bottom: 0.4rem;
}
.hta-rec-icon { font-size: 1.6rem; line-height: 1.2; }
.hta-rec-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--prn-navy);
    font-family: var(--font-serif);
}
.hta-rec-rat {
    font-size: 0.82rem;
    color: var(--prn-muted);
    margin-top: 2px;
}
/* Justification condensée (owner 2026-07-23) : la carte montre la décision,
   les notes cliniques empilées se déplient à la demande. */
.hta-rec-details {
    margin-top: 0.45rem;
    border: 1px solid var(--prn-line);
    border-radius: var(--radius);
    background: var(--prn-surface-2);
}
.hta-rec-details summary {
    cursor: pointer;
    padding: 0.4rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--prn-navy);
    list-style: none;
}
.hta-rec-details summary::before { content: "▸ "; }
.hta-rec-details[open] summary::before { content: "▾ "; }
.hta-rec-details[open] { background: var(--prn-surface); }
.hta-rec-notes {
    margin: 0 0 0.5rem;
    padding: 0 0.9rem 0 1.7rem;
    display: grid;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--prn-muted);
}
.hta-rec-notes li { line-height: 1.45; }
.hta-rec-tip {
    margin: 0.4rem 0 0;
    font-size: 0.84rem;
    color: var(--prn-ink);
}
/* Liste des agents + dose recommandés (init bithérapie / monothérapie) */
.hta-rec-agents {
    list-style: none;
    margin: 0.6rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.4rem;
}
.hta-rec-agents li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0.5rem 0.7rem;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid var(--hta-accent-line);
    border-radius: var(--radius);
    font-size: 0.92rem;
}
.hta-rec-agents .hta-rec-emoji {
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
}
.hta-rec-agent-note {
    flex-basis: 100%;
    font-size: 0.75rem;
    color: var(--prn-muted);
    margin-top: 2px;
    font-style: italic;
}
/* Suggestion monocomprimé (SPC) */
.hta-rec-spc {
    margin-top: 0.6rem;
    padding: 0.55rem 0.7rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1px dashed var(--hta-info);
    border-radius: var(--radius);
    font-size: 0.88rem;
    color: var(--prn-ink);
    line-height: 1.45;
}
/* Monocomprimé = PREMIER CHOIX pré-sélectionné (mise en avant) */
.hta-rec-spc--primary {
    border: 2px solid var(--hta-success, #15803d);
    background: color-mix(in srgb, var(--hta-success, #15803d) 10%, var(--prn-surface));
    font-size: 0.95rem;
}
.hta-rec-alt-label {
    margin-top: 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
}
/* Action concrète follow-up (titrate / add / switch) */
.hta-rec-action {
    margin-top: 0.6rem;
    padding: 0.55rem 0.7rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--hta-accent-line);
    border-radius: var(--radius);
    font-size: 0.95rem;
    color: var(--prn-ink);
    line-height: 1.55;
}
.hta-rec-arrow {
    display: inline-block;
    margin: 0 0.25rem;
    color: var(--hta-accent);
    font-weight: 700;
}

/* ── Classes (étape 5) ────────────────────────────────────────────── */
.hta-classes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 0.85rem;
}
.hta-classes-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    margin-bottom: 0.25rem;
}
.hta-classes-head h3 { margin: 0; }
.hta-class-card {
    --cls-color: var(--hta-accent);
    border: 1px solid var(--prn-line);
    border-left: 4px solid var(--cls-color);
    border-radius: var(--radius);
    padding: 0;
    background: var(--prn-surface);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.hta-class-card.is-fav {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--cls-color) 25%, transparent) inset;
}
.hta-class-card.is-avoid { opacity: 0.78; background: #fafafa; }
.hta-class-card.is-ci-absolute {
    border-color: #fecaca;
    background: #fef9f9;
    opacity: 0.65;
}
.hta-class-head {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.85rem 0.95rem;
    background: transparent;
    border: 0;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
    transition: background-color 0.15s;
}
.hta-class-head:hover { background: color-mix(in srgb, var(--cls-color) 6%, transparent); }
.hta-class-head:focus-visible {
    outline: 2px solid var(--cls-color);
    outline-offset: -2px;
}
.hta-class-chevron {
    font-size: 1rem;
    color: var(--prn-muted);
    transition: transform 0.18s ease;
    align-self: center;
    flex-shrink: 0;
}
.hta-class-card.is-expanded .hta-class-chevron { transform: rotate(180deg); }
.hta-class-body {
    display: none;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0 0.95rem 0.85rem;
    border-top: 1px solid color-mix(in srgb, var(--prn-line) 70%, transparent);
    padding-top: 0.6rem;
    margin-top: 0;
}
.hta-class-card.is-expanded .hta-class-body { display: flex; }
.hta-class-sel-badge {
    background: color-mix(in srgb, var(--cls-color) 18%, transparent);
    color: var(--cls-color);
    border: 1px solid color-mix(in srgb, var(--cls-color) 35%, transparent);
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 600;
}
[data-theme="dark"] .hta-class-head:hover { background: color-mix(in srgb, var(--cls-color) 12%, transparent); }
.hta-dfge-auto {
    margin-top: 0.6rem;
    padding: 0.65rem 0.85rem;
    background: color-mix(in srgb, var(--prn-accent) 7%, var(--prn-surface));
    border: 1px solid color-mix(in srgb, var(--prn-accent) 25%, var(--prn-line));
    border-radius: var(--radius);
}
.hta-dfge-row {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    font-size: 0.85rem;
    line-height: 1.5;
}
.hta-dfge-val {
    font-weight: 700;
    color: var(--prn-navy);
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
}
.hta-class-emoji { font-size: 1.7rem; line-height: 1; }
.hta-class-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.hta-class-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--prn-navy);
    font-family: var(--font-serif);
}
.hta-class-short {
    font-size: 0.78rem;
    color: var(--prn-muted);
}
.hta-class-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.25rem;
}
.hta-class-pos {
    font-size: 0.74rem;
    color: var(--prn-muted);
    font-style: italic;
    margin-top: 0.2rem;
}
.hta-ci-callout {
    padding: 0.45rem 0.7rem;
    border-radius: 8px;
    font-size: 0.82rem;
    line-height: 1.4;
}
.hta-ci-callout--abs   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.hta-ci-callout--avoid { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.hta-class-foot { font-size: 0.74rem; margin-top: 0.25rem; }
.hta-int {
    display: inline-block;
    background: color-mix(in srgb, var(--hta-info) 8%, transparent);
    color: var(--hta-info);
    padding: 0.1rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    margin: 1px;
}

/* ── Agents ───────────────────────────────────────────────────────── */
.hta-class-agents {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.hta-agent {
    display: flex;
    gap: 0.55rem;
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--prn-line);
    border-radius: 8px;
    background: var(--prn-surface);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    align-items: flex-start;
}
.hta-agent:hover { border-color: var(--hta-accent-line); }
.hta-agent input[type="checkbox"] {
    margin-top: 3px;
    accent-color: var(--hta-accent);
    width: 18px; height: 18px;
}
.hta-agent.is-selected {
    background: color-mix(in srgb, var(--hta-accent) 6%, transparent);
    border-color: var(--hta-accent);
    box-shadow: 0 0 0 1px var(--hta-accent) inset;
}
.hta-agent.is-blocked {
    opacity: 0.55;
    cursor: not-allowed;
    background: #fef9f9;
}
.hta-agent.is-avoid { background: #fffbeb; }
.hta-agent-body { flex: 1; }
.hta-agent-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--prn-ink);
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}
.hta-agent-doses {
    font-size: 0.76rem;
    color: var(--prn-muted);
    margin-top: 0.15rem;
}
.hta-dose {
    display: inline-block;
    padding: 1px 6px;
    background: var(--prn-bg-elev, #f9fafb);
    border-radius: 4px;
    font-size: 0.74rem;
    margin: 0 1px;
}
.hta-dose.is-start  { background: color-mix(in srgb, var(--hta-good) 14%, transparent); color: var(--hta-good); font-weight: 700; }
.hta-dose.is-target { background: color-mix(in srgb, var(--hta-accent) 14%, transparent); color: var(--hta-accent); font-weight: 700; }

/* ── Rx summary ───────────────────────────────────────────────────── */
.hta-rx-summary {
    margin: 0.8rem 0;
    padding: 0.7rem 0.9rem;
    background: var(--hta-accent-soft);
    border: 1px solid var(--hta-accent-line);
    border-left: 4px solid var(--hta-accent);
    border-radius: var(--radius);
}
.hta-rx-summary.is-empty {
    background: var(--prn-surface);
    border-style: dashed;
}
.hta-rx-summary strong { color: var(--hta-accent); font-size: 0.88rem; }
.hta-rx-summary ul {
    list-style: none;
    margin: 0.4rem 0 0;
    padding: 0;
    font-size: 0.88rem;
}
.hta-rx-summary ul li { padding: 0.18rem 0; }

/* ── Timeline / Labs ──────────────────────────────────────────────── */
.hta-timeline-list {
    list-style: none;
    margin: 0.4rem 0 0;
    padding: 0;
}
.hta-timeline-list li {
    position: relative;
    padding: 0.4rem 0 0.4rem 1.6rem;
    font-size: 0.86rem;
    border-left: 2px solid var(--hta-accent-line);
    margin-left: 0.5rem;
}
.hta-timeline-list li::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 0.55rem;
    width: 12px; height: 12px;
    background: var(--hta-accent);
    border-radius: 50%;
    box-shadow: 0 0 0 3px var(--prn-surface);
}
.hta-timeline-list li:last-child { border-left-color: transparent; }

/* ── Drapeaux bloquants (suivi) ───────────────────────────────────── */
.hta-flag-blocking {
    border-left: 3px solid #b91c1c !important;
}
.hta-flag-blocking.is-selected {
    background: #fef2f2 !important;
    border-color: #fecaca !important;
}

/* ── Pharma block ─────────────────────────────────────────────────── */
.hta-pharma { background: #f8fafa; border-color: var(--prn-line); }

/* ── Femme bloc (init) ────────────────────────────────────────────── */
.hta-women .prn-mc { flex: 1 1 200px; }

/* ── Sticky bar (legacy mobile-nav compat) ────────────────────────── */
@media (max-width: 720px) {
    .hta-classes { grid-template-columns: 1fr; }
}

/* ── Dark mode tweaks ─────────────────────────────────────────────── */
[data-theme="dark"] .hta-rec-card {
    background: linear-gradient(135deg, #2a1414, #311818);
    border-color: #5b2424;
}
[data-theme="dark"] .hta-rec-card.hta-rec-lifestyle {
    background: linear-gradient(135deg, #0a2e1a, #0d3520);
    border-color: #1a5c34;
}
[data-theme="dark"] .hta-rec-agents li,
[data-theme="dark"] .hta-rec-spc,
[data-theme="dark"] .hta-rec-action {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(252, 165, 165, 0.25);
    color: var(--prn-ink);
}
[data-theme="dark"] .hta-rec-spc { border-style: dashed; border-color: rgba(96, 165, 250, 0.45); }
[data-theme="dark"] .hta-rec-spc--primary {
    border-style: solid;
    border-color: rgba(74, 222, 128, 0.6);
    background: rgba(34, 197, 94, 0.12);
}
[data-theme="dark"] .hta-rec-arrow { color: #fca5a5; }
[data-theme="dark"] .hta-target-info,
[data-theme="dark"] .hta-target-justify,
[data-theme="dark"] .hta-block-emph {
    background: rgba(220, 38, 38, 0.08);
    border-color: rgba(220, 38, 38, 0.25);
}
/* Sprint 6 M5 R2 : surcharger --hta-accent-strong en dark pour lisibilité
   (le rouge sombre original #b91c1c ne contraste pas sur fond sombre). */
[data-theme="dark"] .hta-page {
    --hta-accent-strong: #fca5a5;  /* rouge clair WCAG sur dark bg */
    --hta-warn:          #fbbf24;  /* WCAG : 4.5:1+ sur dark bg */
    --hta-accent-soft:   rgba(220, 38, 38, 0.08);  /* était #fef2f2 (clair) */
    --hta-accent-line:   rgba(220, 38, 38, 0.28);  /* était #fecaca (clair) */
    --hta-info:          #93c5fd;  /* était #2563eb, illisible sur dark bg */
    --hta-good:          #4ade80;  /* était #16a34a, <4.5:1 sur dark bg */
}
[data-theme="dark"] .hta-ci-callout--abs   { background: rgba(220, 38, 38, 0.15); color: #fca5a5; }
[data-theme="dark"] .hta-ci-callout--avoid { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
[data-theme="dark"] .hta-class-card.is-avoid { background: rgba(255,255,255,0.02); }
[data-theme="dark"] .hta-class-card.is-ci-absolute { background: rgba(220, 38, 38, 0.05); }
[data-theme="dark"] .hta-avg.is-normal     { background: rgba(22, 163, 74, 0.08); }
[data-theme="dark"] .hta-avg.is-stage1     { background: rgba(234, 88, 12, 0.10); }
[data-theme="dark"] .hta-avg.is-stage1 .hta-avg-val { color: #fdba74; }
[data-theme="dark"] .hta-avg.is-severe     { background: rgba(220, 38, 38, 0.10); }
[data-theme="dark"] .hta-avg.is-urgence    { background: rgba(185, 28, 28, 0.15); }
[data-theme="dark"] .hta-avg.is-urgence .hta-avg-val,
[data-theme="dark"] .hta-avg.is-urgence .hta-avg-interp { color: #fca5a5; }
[data-theme="dark"] .hta-avg.is-borderline { background: rgba(245, 158, 11, 0.10); }
[data-theme="dark"] .hta-agent.is-avoid    { background: rgba(245, 158, 11, 0.08); }
[data-theme="dark"] .hta-agent.is-blocked  { background: rgba(220, 38, 38, 0.06); }
[data-theme="dark"] .hta-bmi-callout.is-normal { background: rgba(22, 163, 74, 0.10); color: #86efac; border-color: rgba(34, 197, 94, 0.3); }
[data-theme="dark"] .hta-bmi-callout.is-over   { background: rgba(245, 158, 11, 0.12); color: #fbbf24; border-color: rgba(245, 158, 11, 0.3); }
[data-theme="dark"] .hta-bmi-callout.is-obese  { background: rgba(220, 38, 38, 0.12); color: #fca5a5; border-color: rgba(220, 38, 38, 0.3); }
/* Revue contraste dark : fonds clairs hardcodés + accents mi-tons restés light */
[data-theme="dark"] .hta-block h3 { color: var(--hta-accent-strong); }
[data-theme="dark"] .hta-alert--danger { background: #2a1414; border-color: rgba(252, 165, 165, 0.3); border-left-color: #fca5a5; color: #ffe7e7; }
[data-theme="dark"] .hta-cond-tag--good { background: rgba(22, 163, 74, 0.15); color: #86efac; border-color: rgba(34, 197, 94, 0.3); }
[data-theme="dark"] .hta-cond-tag--bad  { background: rgba(220, 38, 38, 0.15); color: #fca5a5; border-color: rgba(220, 38, 38, 0.3); }
[data-theme="dark"] .hta-cond-tag--warn { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border-color: rgba(245, 158, 11, 0.3); }
[data-theme="dark"] .hta-cond-tag--info { background: rgba(37, 99, 235, 0.18); color: #93c5fd; border-color: rgba(96, 165, 250, 0.3); }
[data-theme="dark"] .hta-ci-allerg.is-selected { background: rgba(220, 38, 38, 0.12) !important; border-color: rgba(252, 165, 165, 0.4) !important; }
[data-theme="dark"] .hta-ci-struct.is-selected  { background: rgba(245, 158, 11, 0.12) !important; border-color: rgba(252, 211, 77, 0.4) !important; }
[data-theme="dark"] .hta-habit-counter strong { color: var(--hta-accent-strong); }
[data-theme="dark"] .hta-class-sel-badge { color: color-mix(in srgb, var(--cls-color) 50%, #fff); }
[data-theme="dark"] .hta-dose.is-target { color: #fca5a5; }
[data-theme="dark"] .hta-rx-summary strong { color: var(--hta-accent-strong); }
[data-theme="dark"] .hta-flag-blocking { border-left-color: #ef4444 !important; }
[data-theme="dark"] .hta-flag-blocking.is-selected { background: rgba(220, 38, 38, 0.12) !important; border-color: rgba(252, 165, 165, 0.4) !important; }
[data-theme="dark"] .hta-pharma { background: var(--prn-surface-2); }
/* Couleurs de classe mi-tons (--cls-color) : éclaircir focus + liseré en dark (WCAG 1.4.11 ≥ 3:1) */
[data-theme="dark"] .hta-class-head:focus-visible { outline-color: color-mix(in srgb, var(--cls-color) 60%, #fff); }
[data-theme="dark"] .hta-class-card { border-left-color: color-mix(in srgb, var(--cls-color) 80%, #fff); }
