:root {
    --primary: #294c77;
    --background: #f5f7fa;
    --border: #d9e0e8;
    --text: #1d2733;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: Arial, sans-serif;
    line-height: 1.5;
}
.container {
    width: min(100% - 24px, 960px);
    margin: 0 auto;
    padding: 20px 0 40px;
}
h1, h2 { margin: 0 0 16px; font-size: 1.4rem; }
.practice-card {
    margin-bottom: 18px;
    padding: 16px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
}
.practice-label {
    font-weight: 700;
    margin-bottom: 12px;
    font-size: 1.05rem;
}
.question-row, .answer-row { margin-bottom: 12px; }
.question-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.95rem;
}
.form-control, textarea.form-control {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #b9c3cf;
    border-radius: 8px;
    font-size: 16px;
    background: white;
}
.btn-primary, .btn-secondary, .btn-danger, .btn-success, .admin-navigation a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 16px;
    cursor: pointer;
    border: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-secondary { background: #6c757d; color: white; }
.btn-danger { background: #dc3545; color: white; }
.btn-success { background: #198754; color: white; }
.admin-navigation {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.admin-navigation a { background: var(--primary); color: white; }
.sort-controls {
    margin-bottom: 20px;
    padding: 10px 14px;
    background: #f0f4f8;
    border: 1px solid #d9e0e8;
    border-radius: 8px;
    font-size: 0.95rem;
}
.sort-controls button, .sort-controls a {
    background: none;
    border: none;
    color: #294c77;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
}
.sort-controls button.active, .sort-controls a.active { text-decoration: underline; }
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.auth-form { max-width: 400px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; }
.form-group small { display: block; margin-top: 4px; color: #5a6675; font-size: 0.85rem; }
.auth-note { margin-top: 16px; color: #5a6675; }
.auth-note a { color: #294c77; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td {
    border: 1px solid #d9e0e8;
    padding: 8px 12px;
    text-align: left;
}
.admin-table th { background: #f0f4f8; }
.info-box {
    background: #f0f4f8;
    border: 1px solid #d9e0e8;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}
.share-link-block {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 16px 0;
    flex-wrap: wrap;
}
.share-link-block label { font-weight: 600; }
.share-link-block input { flex: 1; min-width: 200px; }
.draft-notice {
    background: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}
.save-status {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #5a6675;
}
.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.admin-signature {
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid #d9e0e8;
    font-size: 0.9rem;
    color: #5a6675;
}
.admin-signature a { color: #294c77; text-decoration: none; }
.admin-signature a:hover { text-decoration: underline; }
@media (max-width: 600px) {
    .admin-navigation { flex-direction: column; }
    .admin-navigation a, .btn-primary, .btn-secondary, .btn-danger, .btn-success { width: 100%; }
    .practice-card { padding: 13px; }
    .share-link-block { flex-direction: column; align-items: stretch; }
    .share-link-block input { min-width: auto; }
}

.save-status[data-type="success"] { color: #155724; }
.save-status[data-type="error"] { color: #721c24; font-weight: bold; }
.danger-zone {
    margin-top: 30px;
    padding: 16px;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    background: #fff5f5;
}
.danger-zone h2 { color: #721c24; margin-top: 0; }
.inline-form { display: inline; }

/* =====================================================================
   Accessibilité
   ===================================================================== */
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =====================================================================
   Questionnaire : catégories repliables, définitions sur demande
   ===================================================================== */
.q-category {
    margin-bottom: 10px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
}
.q-category > summary {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 12px 16px;
    cursor: pointer;
    list-style: none;
    font-weight: 700;
    font-size: 1.05rem;
}
.q-category > summary::-webkit-details-marker { display: none; }
.q-category > summary::after {
    content: "";
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    margin-left: 2px;
    border-right: 2px solid #5a6675;
    border-bottom: 2px solid #5a6675;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.15s ease;
}
.q-category[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.q-category > summary:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 12px; }
.q-category-name { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.q-category-progress {
    flex: 0 0 auto;
    padding: 2px 10px;
    border-radius: 999px;
    background: #f0f4f8;
    color: #5a6675;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}
.q-category.is-complete .q-category-progress { background: #d4edda; color: #155724; }
.q-category-body { padding: 0 12px 4px; }
.q-category-body .practice-card { margin-bottom: 12px; padding: 14px; }

.practice-card { min-width: 0; }
.practice-card .practice-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    padding: 0;
    margin-bottom: 10px;
}
.practice-card .practice-label > span { padding-top: 3px; overflow-wrap: anywhere; }

.info-btn {
    position: relative;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1.5px solid var(--primary);
    border-radius: 50%;
    background: white;
    color: var(--primary);
    font: italic 700 14px/1 Georgia, "Times New Roman", serif;
    cursor: pointer;
}
/* Zone de toucher agrandie (44 px) sans grossir le sigle. */
.info-btn::before {
    content: "";
    position: absolute;
    inset: -9px;
}
.info-btn[aria-expanded="true"] { background: var(--primary); color: white; }
.info-btn:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

.practice-definition {
    margin: -2px 0 12px;
    padding: 10px 12px;
    background: #f0f4f8;
    border-left: 3px solid var(--primary);
    border-radius: 6px;
    color: #3a4552;
    font-size: 0.95rem;
}

.practice-fields .question-row { margin-bottom: 10px; }
.practice-fields .question-row:last-child { margin-bottom: 0; }

/* Tablette et ordinateur : « Déjà essayé » et « Envie » côte à côte,
   « Difficulté » (réponses longues) sur toute la largeur. */
@media (min-width: 640px) {
    .practice-fields {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 10px 12px;
    }
    .practice-fields .question-row { margin-bottom: 0; }
    .practice-fields .question-row:nth-child(3) { grid-column: 1 / -1; }
}

/* =====================================================================
   Résultats : envie par catégorie
   Palette du niveau 0 (Aucun intérêt) au niveau 5 (Récompense)
   ===================================================================== */
.lvl-0 { --lvl: #d9dce1; --lvl-text: #1d2733; }
.lvl-1 { --lvl: #b9bec6; --lvl-text: #1d2733; }
.lvl-2 { --lvl: #d7b3cb; --lvl-text: #1d2733; }
.lvl-3 { --lvl: #d97fa8; --lvl-text: #1d2733; }
.lvl-4 { --lvl: #c2417a; --lvl-text: #ffffff; }
.lvl-5 { --lvl: #8e0f45; --lvl-text: #ffffff; }

.cat-chart {
    margin-bottom: 24px;
    padding: 16px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
}
.cat-chart h2 { margin-bottom: 12px; }
.cat-chart-empty { margin: 0; color: #5a6675; }

.cat-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin: 0 0 8px;
    padding: 0;
    list-style: none;
    font-size: 0.85rem;
    color: #3a4552;
}
.cat-legend li { display: inline-flex; align-items: center; gap: 6px; }
.cat-swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    background: var(--lvl);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.cat-chart-hint { margin: 0 0 12px; font-size: 0.85rem; color: #5a6675; }

.cat-rows { border-top: 1px solid var(--border); }
.cat-row { border-bottom: 1px solid var(--border); }
.cat-row > summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "name score"
        "bar  bar"
        "meta meta";
    align-items: center;
    gap: 6px 12px;
    padding: 12px 4px;
    cursor: pointer;
    list-style: none;
}
.cat-row > summary::-webkit-details-marker { display: none; }
.cat-row > summary:hover { background: #f8fafc; }
.cat-row > summary:focus-visible { outline: 3px solid var(--primary); outline-offset: -3px; border-radius: 6px; }

.cat-name {
    grid-area: name;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-weight: 700;
    overflow-wrap: anywhere;
}
.cat-name::before {
    content: "";
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    border-right: 2px solid #5a6675;
    border-bottom: 2px solid #5a6675;
    transform: rotate(-45deg);
    transition: transform 0.15s ease;
}
.cat-row[open] .cat-name::before { transform: rotate(45deg); }

.cat-score {
    grid-area: score;
    font-weight: 700;
    font-size: 1.05rem;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.cat-score-max { font-weight: 400; font-size: 0.85rem; color: #5a6675; }

.cat-bar {
    grid-area: bar;
    display: flex;
    height: 22px;
    overflow: hidden;
    border-radius: 6px;
    background: #f0f2f5;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.cat-seg { display: block; height: 100%; background: var(--lvl); }
.segment-width-0 { width: 0%; }
.segment-width-1 { width: 1%; }
.segment-width-2 { width: 2%; }
.segment-width-3 { width: 3%; }
.segment-width-4 { width: 4%; }
.segment-width-5 { width: 5%; }
.segment-width-6 { width: 6%; }
.segment-width-7 { width: 7%; }
.segment-width-8 { width: 8%; }
.segment-width-9 { width: 9%; }
.segment-width-10 { width: 10%; }
.segment-width-11 { width: 11%; }
.segment-width-12 { width: 12%; }
.segment-width-13 { width: 13%; }
.segment-width-14 { width: 14%; }
.segment-width-15 { width: 15%; }
.segment-width-16 { width: 16%; }
.segment-width-17 { width: 17%; }
.segment-width-18 { width: 18%; }
.segment-width-19 { width: 19%; }
.segment-width-20 { width: 20%; }
.segment-width-21 { width: 21%; }
.segment-width-22 { width: 22%; }
.segment-width-23 { width: 23%; }
.segment-width-24 { width: 24%; }
.segment-width-25 { width: 25%; }
.segment-width-26 { width: 26%; }
.segment-width-27 { width: 27%; }
.segment-width-28 { width: 28%; }
.segment-width-29 { width: 29%; }
.segment-width-30 { width: 30%; }
.segment-width-31 { width: 31%; }
.segment-width-32 { width: 32%; }
.segment-width-33 { width: 33%; }
.segment-width-34 { width: 34%; }
.segment-width-35 { width: 35%; }
.segment-width-36 { width: 36%; }
.segment-width-37 { width: 37%; }
.segment-width-38 { width: 38%; }
.segment-width-39 { width: 39%; }
.segment-width-40 { width: 40%; }
.segment-width-41 { width: 41%; }
.segment-width-42 { width: 42%; }
.segment-width-43 { width: 43%; }
.segment-width-44 { width: 44%; }
.segment-width-45 { width: 45%; }
.segment-width-46 { width: 46%; }
.segment-width-47 { width: 47%; }
.segment-width-48 { width: 48%; }
.segment-width-49 { width: 49%; }
.segment-width-50 { width: 50%; }
.segment-width-51 { width: 51%; }
.segment-width-52 { width: 52%; }
.segment-width-53 { width: 53%; }
.segment-width-54 { width: 54%; }
.segment-width-55 { width: 55%; }
.segment-width-56 { width: 56%; }
.segment-width-57 { width: 57%; }
.segment-width-58 { width: 58%; }
.segment-width-59 { width: 59%; }
.segment-width-60 { width: 60%; }
.segment-width-61 { width: 61%; }
.segment-width-62 { width: 62%; }
.segment-width-63 { width: 63%; }
.segment-width-64 { width: 64%; }
.segment-width-65 { width: 65%; }
.segment-width-66 { width: 66%; }
.segment-width-67 { width: 67%; }
.segment-width-68 { width: 68%; }
.segment-width-69 { width: 69%; }
.segment-width-70 { width: 70%; }
.segment-width-71 { width: 71%; }
.segment-width-72 { width: 72%; }
.segment-width-73 { width: 73%; }
.segment-width-74 { width: 74%; }
.segment-width-75 { width: 75%; }
.segment-width-76 { width: 76%; }
.segment-width-77 { width: 77%; }
.segment-width-78 { width: 78%; }
.segment-width-79 { width: 79%; }
.segment-width-80 { width: 80%; }
.segment-width-81 { width: 81%; }
.segment-width-82 { width: 82%; }
.segment-width-83 { width: 83%; }
.segment-width-84 { width: 84%; }
.segment-width-85 { width: 85%; }
.segment-width-86 { width: 86%; }
.segment-width-87 { width: 87%; }
.segment-width-88 { width: 88%; }
.segment-width-89 { width: 89%; }
.segment-width-90 { width: 90%; }
.segment-width-91 { width: 91%; }
.segment-width-92 { width: 92%; }
.segment-width-93 { width: 93%; }
.segment-width-94 { width: 94%; }
.segment-width-95 { width: 95%; }
.segment-width-96 { width: 96%; }
.segment-width-97 { width: 97%; }
.segment-width-98 { width: 98%; }
.segment-width-99 { width: 99%; }
.segment-width-100 { width: 100%; }
.cat-seg + .cat-seg { box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.85); }

.cat-meta { grid-area: meta; font-size: 0.8rem; color: #5a6675; }
.cat-row.is-empty .cat-name,
.cat-row.is-empty .cat-score { color: #5a6675; }

.cat-detail { padding: 0 4px 14px; }
.cat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.cat-chip {
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--lvl);
    color: var(--lvl-text);
    font-size: 0.85rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

/* Tablette et ordinateur : nom à gauche, barre au centre, score à droite. */
@media (min-width: 640px) {
    .cat-chart { padding: 20px 24px; }
    .cat-row > summary {
        grid-template-columns: minmax(150px, 30%) minmax(0, 1fr) 4.5em;
        grid-template-areas:
            "name bar  score"
            ".    meta .";
        gap: 4px 16px;
    }
    .cat-score { text-align: right; }
    .cat-bar { height: 26px; }
}
@media (min-width: 900px) {
    .cat-row > summary { grid-template-columns: minmax(200px, 28%) minmax(0, 1fr) 4.5em; }
}

@media print {
    .cat-row > summary::after, .cat-name::before { display: none; }
    .cat-seg, .cat-swatch, .cat-chip { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.admin-definition { color: #5a6675; }
/* Le libellé de la question reste à l'intérieur de la carte (et non sur sa bordure). */
.practice-card > legend.practice-label { float: left; }
.practice-card > .practice-definition,
.practice-card > .practice-fields { clear: both; }

/* =====================================================================
   v4 – Questionnaire plus rapide : progression, filtre, remplissage
   ===================================================================== */
/* Un élément masqué le reste, quel que soit son style d'affichage. */
[hidden] { display: none !important; }

.btn-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 6px 2px;
    border: 0;
    background: none;
    color: var(--primary);
    font: inherit;
    font-size: 0.95rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.btn-link:hover { color: #8e0f45; }
.btn-link:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.btn-link-danger { color: #a3122f; }

.q-toolbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 18px;
    margin: 0 -4px 12px;
    padding: 10px 14px;
    background: rgba(245, 247, 250, 0.96);
    border-bottom: 1px solid var(--border);
}
.q-progress { flex: 1 1 240px; min-width: 0; }
.q-progress-text { font-size: 0.9rem; color: #3a4552; margin-bottom: 4px; }
.q-progress-bar {
    height: 8px;
    border-radius: 999px;
    background: #d9dce1;
    overflow: hidden;
}
.q-progress-bar > span {
    display: block;
    height: 100%;
    background: #c2417a;
    border-radius: 999px;
    transition: width 0.25s ease;
}
.q-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    font-size: 0.95rem;
    cursor: pointer;
}
.q-filter input, .note-shared input, .share-option input { width: 20px; height: 20px; margin: 0; flex: 0 0 auto; }
.q-filter-empty {
    padding: 14px 16px;
    background: #d4edda;
    color: #155724;
    border-radius: 12px;
}
.q-category { scroll-margin-top: 90px; }
.q-category[hidden], .practice-card[hidden] { display: none; }
.q-category-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0 16px;
    margin: -4px 0 6px;
}

/* Précision personnelle sous chaque pratique */
.practice-note { margin-top: 6px; }
.practice-note .note-toggle { font-size: 0.9rem; min-height: 40px; }
.note-toggle[data-has-note="1"] { font-weight: 700; }
.note-box { margin-top: 4px; }
.note-box textarea { min-height: 64px; resize: vertical; }
.note-shared {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    font-size: 0.9rem;
    color: #3a4552;
    cursor: pointer;
}

/* =====================================================================
   v4 – Fiche synthèse « En bref »
   ===================================================================== */
.results-summary {
    margin-bottom: 22px;
    padding: 16px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
}
.results-summary h2 { margin-bottom: 12px; }
.results-summary h3 { margin: 0 0 2px; font-size: 1.05rem; }

.health-box {
    margin-bottom: 14px;
    padding: 12px 14px;
    background: #fdf2f7;
    border: 1px solid #d7b3cb;
    border-left: 4px solid #8e0f45;
    border-radius: 8px;
}
.health-box h3 { color: #8e0f45; margin-bottom: 6px; }
.health-box p { margin: 0 0 6px; overflow-wrap: anywhere; }
.health-box p:last-child { margin-bottom: 0; }

.summary-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}
.summary-col {
    min-width: 0;
    padding: 12px 14px;
    border-radius: 10px;
    background: #f7f8fa;
    border-top: 4px solid #b9bec6;
}
.summary-must { border-top-color: #8e0f45; }
.summary-explore { border-top-color: #d97fa8; }
.summary-limits { border-top-color: #294c77; }
.summary-count {
    display: inline-block;
    min-width: 1.8em;
    padding: 0 7px;
    border-radius: 999px;
    background: #e6e9ee;
    color: #3a4552;
    font-size: 0.8rem;
    text-align: center;
    vertical-align: 2px;
}
.summary-hint { margin: 0 0 8px; font-size: 0.82rem; color: #5a6675; }
.summary-empty { margin: 0; color: #5a6675; font-size: 0.92rem; }
.summary-list { margin: 0; padding: 0; list-style: none; }
.summary-list li {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid #e6e9ee;
    overflow-wrap: anywhere;
}
.summary-list li:last-child { border-bottom: 0; }
.summary-dot {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--lvl);
    transform: translateY(-1px);
}
.summary-label { flex: 1 1 auto; min-width: 0; }
.summary-tag {
    flex: 0 0 auto;
    padding: 0 7px;
    border-radius: 999px;
    background: #e8edf4;
    color: #294c77;
    font-size: 0.78rem;
    white-space: nowrap;
}
.summary-more { margin-top: 4px; }
.summary-more > summary,
.summary-none > summary {
    min-height: 40px;
    padding: 8px 0;
    color: var(--primary);
    cursor: pointer;
    font-size: 0.92rem;
}
.summary-none { margin-top: 12px; border-top: 1px solid var(--border); }
.summary-none p { margin: 0 0 4px; color: #5a6675; font-size: 0.92rem; }

@media (min-width: 640px) {
    .results-summary { padding: 20px 24px; }
    .summary-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .summary-limits { grid-column: 1 / -1; }
}
@media (min-width: 900px) {
    .summary-columns { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .summary-limits { grid-column: auto; }
}

/* Précision dans les cartes de résultats */
.answer-note {
    margin-top: 6px;
    padding: 8px 10px;
    background: #f7f0f4;
    border-left: 3px solid #d97fa8;
    border-radius: 6px;
    overflow-wrap: anywhere;
}
.note-badge {
    padding: 0 7px;
    border-radius: 999px;
    background: #e6e9ee;
    color: #3a4552;
    font-size: 0.75rem;
    font-weight: 600;
}
.note-badge.is-shared { background: #d7b3cb; color: #4a0a26; }

/* =====================================================================
   v4 – Partage maîtrisé (Mon compte)
   ===================================================================== */
.share-none { color: #5a6675; }
.share-list { margin: 0 0 14px; padding: 0; list-style: none; }
.share-item {
    margin-bottom: 12px;
    padding: 14px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
}
.share-item.is-expired { background: #f7f8fa; }
.share-item-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin-bottom: 6px;
    overflow-wrap: anywhere;
}
.share-badge {
    padding: 1px 9px;
    border-radius: 999px;
    background: #e8edf4;
    color: #294c77;
    font-size: 0.8rem;
}
.share-badge.is-expired { background: #f8d7da; color: #721c24; }
.share-meta {
    margin: 0 0 10px;
    padding: 0;
    list-style: none;
    color: #3a4552;
    font-size: 0.9rem;
}
.share-meta li { padding: 2px 0; overflow-wrap: anywhere; }
.share-item .share-link-block { margin-bottom: 4px; }
.share-item .share-form { margin: 0; }
.share-create {
    margin-top: 10px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
}
.share-create > summary {
    min-height: 52px;
    padding: 14px 16px;
    font-weight: 700;
    cursor: pointer;
    color: var(--primary);
}
.share-create-form { padding: 0 16px 16px; }
.share-fieldset { margin: 0 0 16px; padding: 0; border: 0; min-width: 0; }
.share-fieldset legend { padding: 0; margin-bottom: 6px; font-weight: 600; }
.share-options {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0 16px;
}
.share-option {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    font-weight: 400 !important;
    cursor: pointer;
}
.share-select-all { margin: -6px 0 2px; color: #5a6675; }
@media (min-width: 640px) {
    .share-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
    .share-categories { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media print {
    .q-toolbar, .sort-section, .summary-more > summary { display: none; }
}
.form-group .share-option { display: flex; margin-bottom: 0; }
textarea.form-control { font-family: inherit; line-height: 1.4; }
.q-note-hint { margin: 0 0 12px; font-size: 0.88rem; color: #5a6675; }

/* =====================================================================
   v5 – Deux rôles par pratique (côté dominant / côté soumis)
   ===================================================================== */
.practice-card > .role-picker,
.practice-card > .role-empty,
.practice-card > .role-blocks { clear: both; }

.role-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 2px 0 10px;
}
.role-chip {
    position: relative;
    flex: 1 1 140px;
    min-width: 0;
    cursor: pointer;
}
.role-chip input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}
.role-chip span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 6px 12px;
    border: 1.5px solid #b9bec6;
    border-radius: 999px;
    background: white;
    color: #3a4552;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    overflow-wrap: anywhere;
}
.role-chip span::before {
    content: "";
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    border: 1.5px solid currentColor;
    border-radius: 4px;
}
.role-chip input:checked + span { color: white; }
.role-chip input:checked + span::before {
    content: "\2713";
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-color: white;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
}
.role-chip-dom input:checked + span::before { color: #8e0f45; }
.role-chip-sub input:checked + span::before { color: var(--primary); }
.role-chip-dom input:checked + span { background: #8e0f45; border-color: #8e0f45; }
.role-chip-sub input:checked + span { background: var(--primary); border-color: var(--primary); }
.role-chip input:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 2px; }

.role-empty {
    margin: 0 0 4px;
    color: #5a6675;
    font-size: 0.9rem;
}

.role-blocks { display: grid; gap: 12px; }
.role-block-dom,
.role-block-sub {
    padding: 10px 0 2px 12px;
    border-left: 3px solid #d97fa8;
}
.role-block-sub { border-left-color: #b9bec6; }
.role-block-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0 12px;
    margin-bottom: 6px;
}
.role-tag {
    font-weight: 700;
    font-size: 0.92rem;
    color: #8e0f45;
}
.role-block-sub .role-tag { color: var(--primary); }
.role-copy { font-size: 0.85rem; min-height: 36px; }
.role-blocks:not(.has-two) .role-copy { display: none; }

/* Ordinateur : les deux rôles côte à côte. */
@media (min-width: 880px) {
    .role-blocks.has-two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .role-blocks.has-two .practice-fields { display: block; }
    .role-blocks.has-two .practice-fields .question-row { margin-bottom: 10px; }
}

/* Choix de la position en tête du questionnaire */
.dynamic-picker {
    margin-bottom: 16px;
    padding: 14px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
}
.dynamic-picker h2 { margin-bottom: 4px; font-size: 1.15rem; }
.dynamic-hint { margin: 0 0 10px; color: #5a6675; font-size: 0.92rem; }
.dynamic-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.dynamic-option {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.dynamic-choice { position: relative; flex: 1 1 auto; min-width: 0; cursor: pointer; }
.dynamic-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dynamic-choice span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 6px 8px;
    border: 1.5px solid #b9bec6;
    border-radius: 999px;
    background: white;
    font-weight: 700;
    font-size: 0.95rem;
    text-align: center;
}
.dynamic-choice input:checked + span { background: var(--primary); border-color: var(--primary); color: white; }
.dynamic-choice input:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 2px; }
.dynamic-picker .practice-definition { margin: 10px 0 0; }

@media (max-width: 480px) {
    .dynamic-options { grid-template-columns: minmax(0, 1fr); }
}

/* Résultats : rôle de chaque réponse */
.answer-role + .answer-role {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eef1f5;
}
.answer-role-title {
    margin-bottom: 4px;
    font-weight: 700;
    font-size: 0.92rem;
    color: #8e0f45;
}
.answer-role-sub .answer-role-title { color: var(--primary); }
.summary-role { color: #5a6675; font-size: 0.85em; font-weight: 400; }
.summary-dynamic { margin: -6px 0 12px; color: #3a4552; }
.admin-roles { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.admin-roles legend { font-weight: 700; padding: 0 4px; }
.admin-roles label[for] { display: block; margin: 8px 0 4px; font-weight: 600; }
.admin-roles-summary { color: #5a6675; }
.admin-roles-edit summary { cursor: pointer; color: var(--primary); font-size: 0.85rem; margin-top: 4px; }
.admin-roles-edit form { display: grid; gap: 6px; margin-top: 6px; min-width: 220px; }
