/* MEMORA solutions, info@memora.ca */
.cp-v2 .ct-pill{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:0.5rem 1rem;border:2px solid var(--c-border);border-radius:9999px;background:var(--c-paper);color:#374151;font-size:0.875rem;font-weight:500;cursor:pointer;transition:all .15s ease;position:relative;}
.cp-v2 .ct-pill:hover{border-color:var(--c-primary);color:var(--c-primary);}
.cp-v2 .ct-pill--on{background:var(--c-primary);border-color:var(--c-primary);color:var(--c-on-primary);}
.cp-v2 .ct-pill--on:hover{color:var(--c-on-primary);}
.cp-v2 .ct-pill__input{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}
.cp-v2 .ct-pill:focus-within{outline:2px solid var(--c-primary);outline-offset:2px;z-index:1;}
.cp-v2 .ct-task-card{display:flex;flex-direction:column;gap:2px;text-align:left;width:100%;min-height:76px;padding:0.85rem 1rem;border:2px solid var(--c-border);border-radius:12px;background:var(--c-paper);color:var(--c-dark);cursor:pointer;transition:all .15s ease;}
.cp-v2 .ct-task-card:hover{border-color:var(--c-primary);}
.cp-v2 .ct-task-card:focus-visible{outline:2px solid var(--c-primary);outline-offset:2px;}
.cp-v2 .ct-task-card--on{background:var(--c-primary);border-color:var(--c-primary);color:var(--c-on-primary);}
.cp-v2 .ct-task-card--on .ct-task-card__desc{color:var(--c-on-primary);}
.cp-v2 .ct-task-card__title{font-weight:700;font-size:0.95rem;}
.cp-v2 .ct-task-card__desc{font-size:0.78rem;color:var(--c-text-muted);}
.cp-v2 .ct-advanced-toggle{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;padding:0.75rem 1rem;border:1px dashed rgba(11,114,133,0.35);border-radius:10px;background:var(--c-primary-light);color:var(--c-primary);font-weight:600;font-size:0.9rem;cursor:pointer;min-height:44px;}
.cp-v2 .ct-advanced-toggle .ct-chevron{transition:transform .2s ease;}
.cp-v2 .ct-advanced-toggle[aria-expanded="true"] .ct-chevron{transform:rotate(180deg);}
.cp-v2 .ct-task-card--custom{cursor:default;position:relative;}
.cp-v2 .ct-task-card--custom.ct-task-card--hidden-card{opacity:0.5;}
.cp-v2 .ct-custom-card__head{display:flex;align-items:flex-start;justify-content:space-between;gap:4px;width:100%;flex-wrap:wrap;}
.cp-v2 .ct-custom-card__icon-btn{flex-shrink:0;width:44px;height:44px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--c-border);border-radius:8px;background:var(--c-paper);cursor:pointer;padding:0;}
.cp-v2 .ct-task-card--on .ct-custom-card__icon-btn{background:rgba(255,255,255,0.15);border-color:rgba(255,255,255,0.5);}
.cp-v2 .ct-custom-card__actions{display:flex;flex-wrap:wrap;gap:2px;justify-content:flex-end;}
.cp-v2 .ct-custom-card__icon-action{width:44px;height:44px;min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center;border:none;background:transparent;border-radius:6px;cursor:pointer;color:inherit;opacity:0.75;font-size:0.85rem;padding:0;}
.cp-v2 .ct-custom-card__icon-action:hover{opacity:1;background:rgba(0,0,0,0.06);}
.cp-v2 .ct-task-card--on .ct-custom-card__icon-action:hover{background:rgba(255,255,255,0.15);}
.cp-v2 .ct-custom-card__icon-action:focus-visible{outline:2px solid var(--c-primary);outline-offset:1px;}
.cp-v2 .ct-custom-card__title-btn{background:none;border:none;padding:0;margin:0;text-align:left;font-weight:700;font-size:0.95rem;color:inherit;cursor:text;min-height:44px;display:flex;align-items:center;}
.cp-v2 .ct-custom-card__title-btn:focus-visible{outline:2px solid var(--c-primary);outline-offset:2px;}
.cp-v2 .ct-custom-card__title-input{width:100%;font-weight:700;font-size:0.9rem;padding:2px 4px;border-radius:6px;border:1px solid var(--c-primary);}
.cp-v2 .ct-custom-card__select{display:flex;align-items:center;width:100%;text-align:left;background:none;border:none;padding:0;margin-top:2px;font-size:0.78rem;color:var(--c-text-muted);cursor:pointer;min-height:44px;}
.cp-v2 .ct-task-card--on .ct-custom-card__select{color:var(--c-on-primary);}
.cp-v2 .ct-icon-picker{position:absolute;z-index:5;top:40px;left:50%;transform:translateX(-50%);display:flex;flex-direction:column;gap:6px;width:280px;max-width:calc(100vw - 24px);max-height:340px;overflow-y:auto;background:var(--c-paper);border:1px solid var(--c-border);border-radius:10px;padding:8px;box-shadow:0 6px 18px rgba(0,0,0,0.15);}
.cp-v2 .ct-icon-picker__search{width:100%;box-sizing:border-box;padding:0.4rem 0.6rem;border:1px solid var(--c-border);border-radius:8px;font-size:0.85rem;min-height:44px;}
.cp-v2 .ct-icon-picker__search:focus-visible{outline:2px solid var(--c-primary);outline-offset:1px;}
.cp-v2 .ct-icon-picker__category{font-size:0.7rem;font-weight:700;text-transform:uppercase;letter-spacing:0.03em;color:var(--c-text-muted);margin:6px 2px 2px;}
.cp-v2 .ct-icon-picker__empty{font-size:0.8rem;color:var(--c-text-muted);padding:8px 4px;margin:0;}
.cp-v2 .ct-emoji-grid{display:grid;grid-template-columns:repeat(5,44px);gap:4px;}
.cp-v2 .ct-emoji-grid button{width:44px;height:44px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:8px;background:var(--c-paper);font-size:1.2rem;cursor:pointer;}
@media (max-width: 575.98px){ .cp-v2 .ct-icon-picker{width:252px;}
.cp-v2 .ct-emoji-grid{grid-template-columns:repeat(4,44px);}
}
.cp-v2 .ct-emoji-grid button:hover, .cp-v2 .ct-emoji-grid button:focus-visible{border-color:var(--c-primary);outline:2px solid var(--c-primary);outline-offset:1px;}
.cp-v2 .ct-custom-card__panel{border:1px solid var(--c-border);border-radius:10px;padding:0.6rem;margin-top:0.5rem;background:var(--c-surface);color:var(--c-dark);}
.cp-v2 .ct-add-card-btn{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;width:100%;min-height:76px;padding:0.85rem 1rem;border:2px dashed var(--c-text-muted, #52586A);border-radius:12px;background:transparent;color:var(--c-text-muted);cursor:pointer;font-weight:600;}
.cp-v2 .ct-add-card-btn:hover:not(:disabled){border-color:var(--c-primary);color:var(--c-primary);}
.cp-v2 .ct-add-card-btn:disabled{opacity:0.5;cursor:not-allowed;}
.cp-v2 .ct-add-card-btn:focus-visible{outline:2px solid var(--c-primary);outline-offset:2px;}
.cp-v2 .ct-seg-user{background:var(--c-warning-surface);color:var(--c-warning);border-radius:4px;padding:0 2px;font-weight:600;}
.cp-v2 .ct-seg-tool{background:var(--c-primary-light);color:var(--c-dark);border-radius:4px;}
.cp-v2 .ct-block{margin-bottom:1rem;padding:0.85rem 1rem;border:1px solid var(--c-border);border-radius:12px;background:var(--c-paper);}
.cp-v2 .ct-block__head{display:flex;align-items:baseline;justify-content:space-between;gap:8px;flex-wrap:wrap;margin-bottom:0.25rem;}
.cp-v2 .ct-block__title{font-family:var(--f-heading);font-weight:700;color:var(--c-dark);font-size:1rem;margin:0;}
.cp-v2 .ct-block__optional{font-size:0.72rem;font-weight:600;color:var(--c-text-muted);background:var(--c-surface);border-radius:999px;padding:2px 8px;white-space:nowrap;}
.cp-v2 .ct-block__example{font-size:0.78rem;color:var(--c-text-muted);margin:0 0 0.5rem;font-style:italic;}
.cp-v2 .ct-block__added{font-size:0.8rem;color:var(--c-dark);background:var(--c-primary-light);border-left:3px solid var(--c-primary);border-radius:6px;padding:0.45rem 0.65rem;margin:0.75rem 0 0;font-weight:600;}
.cp-v2 .ct-block__field{margin-bottom:0.75rem;}
.cp-v2 .ct-block__field:last-child{margin-bottom:0;}
.cp-v2 .ct-chip-row{display:flex;flex-wrap:wrap;gap:0.4rem;margin-top:0.5rem;}
.cp-v2 .ct-chip{display:inline-flex;align-items:center;gap:4px;border:2px solid var(--c-primary);border-radius:9999px;background:var(--c-primary);color:var(--c-on-primary);padding:0.25rem 0.5rem 0.25rem 0.75rem;font-size:0.8rem;font-weight:500;}
.cp-v2 .ct-chip__x{position:relative;display:inline-flex;align-items:center;justify-content:center;background:transparent;border:0;color:inherit;font-size:1.05rem;line-height:1;cursor:pointer;width:24px;height:24px;padding:0;border-radius:6px;opacity:0.85;transition:background-color .12s ease,opacity .12s ease;}
.cp-v2 .ct-chip__x::after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:44px;height:44px;}
.cp-v2 .ct-chip__x:hover{background:transparent;text-decoration:underline;}
.cp-v2 .ct-chip__x:focus-visible{outline:2px solid #fff;outline-offset:1px;border-radius:50%;}
.cp-v2 .ct-check-grid{display:flex;flex-direction:column;gap:0.5rem;}
@media (min-width: 768px){ .cp-v2 .ct-check-grid{display:block;columns:2;column-gap:1.25rem;}.cp-v2 .ct-check-grid>label{break-inside:avoid;width:100%;margin-bottom:0.15rem;}}
@media (min-width: 768px){ .cp-v2 #cpSectionFormat .cp-peaufiner__body{display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));gap:0 1.25rem;align-items:start;}
.cp-v2 #cpSectionFormat .cp-peaufiner__body > .ct-block__example{grid-column:1 / -1;}
}
.cp-v2 .ct-chip--pending{background:var(--c-surface);border-color:var(--c-border);color:var(--c-dark);}
.cp-v2 .ct-chip--missing{background:var(--c-warning-surface);border-color:var(--c-warning);color:var(--c-warning);}
.cp-v2 .ct-chip--missing .ct-chip__x:focus-visible, .cp-v2 .ct-chip--missing .ct-chip__label:focus-visible{outline-color:var(--c-warning);}
.cp-v2 .ct-chip__label{display:inline-flex;align-items:center;background:transparent;border:0;color:inherit;font:inherit;font-weight:500;cursor:pointer;padding:0;min-height:44px;}
.cp-v2 #cpWizard select.form-control, .cp-v2 #cpWizard select.form-control-sm, .cp-v2 #cpWizard input.form-control-sm[type="text"]{min-height:44px;}
.cp-v2 .ct-chip__label:focus-visible{outline:2px solid #fff;outline-offset:1px;border-radius:4px;}
.cp-v2 .ct-chip__input{background:var(--c-paper);border:1px solid var(--c-primary);border-radius:6px;color:var(--c-dark);font-size:0.8rem;padding:2px 6px;min-width:90px;max-width:180px;min-height:24px;}
.cp-v2 .ct-chip__badge{font-size:0.7rem;opacity:0.9;white-space:nowrap;}
.cp-v2 .ct-space-pending-hint::before{content:'↑ ';}
.cp-v2 .ct-seg-space-empty{background:var(--c-warning-surface);color:var(--c-warning);border-radius:4px;padding:0 2px;font-weight:600;border-bottom:2px dashed var(--c-warning);}
.cp-v2 .ct-seg-space-filled{background:var(--c-warning-surface);color:var(--c-warning);border-radius:4px;padding:0 2px;font-weight:600;border-bottom:2px solid var(--c-warning);}
.cp-v2 .ct-seg-space-active{outline:2px solid var(--c-primary);outline-offset:1px;}
.cp-v2 .ct-conditional-block{margin-top:0.5rem;padding:0.5rem 0.65rem;background:var(--c-primary-light);border-left:3px solid var(--c-primary);border-radius:8px;}
.cp-v2 .ct-disclosure{border:1px solid var(--c-border);border-radius:10px;background:var(--c-paper);margin-bottom:0.75rem;overflow:hidden;}
.cp-v2 .ct-disclosure__toggle{display:flex;align-items:center;gap:8px;width:100%;min-height:44px;padding:0.65rem 0.9rem;border:0;background:transparent;color:var(--c-dark);font-family:var(--f-heading);font-weight:700;font-size:0.9rem;text-align:left;cursor:pointer;}
.cp-v2 .ct-disclosure__toggle:focus-visible{outline:2px solid var(--c-primary);outline-offset:-2px;}
.cp-v2 .ct-disclosure__chevron{display:inline-block;transition:transform .2s ease;flex-shrink:0;}
.cp-v2 .ct-disclosure__chevron--open{transform:rotate(90deg);}
@media (prefers-reduced-motion:reduce){ .cp-v2 .ct-disclosure__chevron{transition:none;}
}
.cp-v2 .ct-disclosure__panel{padding:0 0.9rem 0.9rem;}
.cp-v2 .ct-actions-panel{border-radius:12px;padding:0.85rem;margin-bottom:1rem;transition:box-shadow .2s ease;border:1px solid var(--c-border);background:var(--c-surface,#F8FAFB);}
.cp-v2 .ct-actions-panel--active{border-color:var(--c-primary);background:var(--c-paper);box-shadow:0 2px 10px rgba(6,78,90,0.08);}
@media (prefers-reduced-motion:reduce){ .cp-v2 .ct-actions-panel{transition:none;}
}
.cp-v2 .cp-tech-tabs.nav-tabs{border-bottom:2px solid var(--c-primary-light);flex-wrap:wrap;margin-bottom:1rem;}
.cp-v2 .cp-tech-tabs.nav-tabs .nav-link{min-height:44px;display:flex;align-items:center;font-weight:600;color:var(--c-dark);background:transparent;border:0;border-bottom:3px solid transparent;border-radius:0;padding:0.6rem 0.9rem;}
.cp-v2 .cp-tech-tabs.nav-tabs .nav-link:hover{color:var(--c-primary);border-bottom-color:rgba(6,78,90,0.35);}
.cp-v2 .cp-tech-tabs.nav-tabs .nav-link.active{color:var(--c-primary);background:var(--c-primary-light);border-bottom-color:var(--c-primary);}
.cp-v2 .cp-tech-tabs.nav-tabs .nav-link:focus-visible{outline:2px solid var(--c-primary);outline-offset:2px;}
.cp-v2 .cp-tech-card{border:1px solid var(--c-border);border-radius:12px;padding:0.85rem 1rem;margin-bottom:0.85rem;background:var(--c-paper);}
.cp-v2 .cp-tech-card:last-child{margin-bottom:0;}
.cp-v2 .cp-tech-card__quand{font-size:0.85rem;color:var(--c-dark);margin:0.4rem 0 0;}
.cp-v2 .cp-tech-card__details{margin-top:0.5rem;}
.cp-v2 .cp-tech-card__details summary{cursor:pointer;font-weight:600;font-size:0.82rem;color:var(--c-primary);min-height:44px;display:flex;align-items:center;}
.cp-v2 .cp-tech-card__details summary:focus-visible{outline:2px solid var(--c-primary);outline-offset:2px;}
.cp-v2 .cp-tech-card__explication{font-size:0.85rem;color:var(--c-text-muted);margin:0.4rem 0 0;}
.cp-v2 .cp-tech-card__phrase{font-size:0.8rem;font-style:italic;color:var(--c-primary);background:var(--c-primary-light);border-radius:6px;padding:0.4rem 0.6rem;margin:0.6rem 0 0;}
.cp-v2 .cp-tech-card__foot{display:flex;justify-content:flex-end;margin-top:0.65rem;}
.cp-v2 .cp-tech-current-badge{display:none;margin-left:6px;padding:2px 8px;border-radius:999px;background:var(--c-primary);color:var(--c-on-primary);font-size:0.72rem;font-weight:600;white-space:nowrap;}
.cp-v2 {
--c-primary:#064e5a; --c-primary-hover:#032e36; --c-primary-light:#e6f2f3; --c-primary-badge:#e6f4f6;
--c-help-glyph:#075057;
--c-dark:#15262a; --c-text-muted:#3c4d51; --c-text-secondary:#3c4d51;
--c-paper:#ffffff; --c-surface:#f7fafb; --c-on-primary:#ffffff; --c-border:#a5b6ba;
--c-danger:#751717; --c-danger-surface:#fceeee; --c-success:#155438; --c-success-surface:#e3f5e9;
--c-warning:#49360e; --c-warning-surface:#fef3c7; --r-base:12px; --f-heading:inherit;
color:var(--c-dark); font-size:1rem; line-height:1.6;
max-width:860px; margin:auto; padding:16px; overflow-wrap:anywhere;
}
.cp-v2 .container {padding:0; max-width:100%}
.cp-v2 .card {border:0; background:var(--c-surface)}
.cp-v2 #cpWizard {padding:24px!important; min-width:0; color:var(--c-dark)}
.cp-v2 h1 {font-size:1.75rem}
.cp-v2 #cpWizard p:not([class]), .cp-v2 #cpCommonTaskHelp {color:inherit}

.cp-v2 h2 {font-size:1.45rem; margin:24px 0 16px}
.cp-v2 .ct-btn {display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:44px; padding:8px 16px; border:1px solid var(--c-primary); border-radius:8px; background:transparent; color:var(--c-primary); font-weight:600; white-space:normal; text-decoration:none}
.cp-v2 .ct-btn-primary,.cp-v2 .ct-btn-accent {background:var(--c-primary); color:var(--c-on-primary)}
.cp-v2 .ct-btn-danger {background:#991b1b; color:#fff; border-color:#991b1b}
/* Bouton-icône standardisé : carré parfait 44x44, jamais ovale. Consomme le contrat
   de .ct-btn-icon de la charte; annule le padding horizontal hérité de .cp-v2 .ct-btn
   (sinon largeur > hauteur = ovale). Le cercle vient du modificateur --circle, jamais
   d'un style en ligne répété. MEMORA solutions. */
.cp-v2 .ct-btn-icon {width:44px; height:44px; min-width:44px; min-height:44px; padding:0; flex:0 0 auto}
.cp-v2 .ct-btn-icon--circle {border-radius:50%}
.cp-v2-help {display:inline-flex; align-items:center; justify-content:center; border:0; background:transparent; color:var(--c-primary); border-radius:50%; font-weight:700}
.cp-v2 :is(input,select,textarea) {min-height:44px; max-width:100%; border-radius:8px; border:1px solid var(--c-border); background:var(--c-paper); color:var(--c-dark)}
.cp-v2 :is(button,input,select,textarea,summary,a):focus {box-shadow:none!important}
.cp-v2 :is(input,select,textarea):focus {outline:3px solid var(--c-primary)!important; outline-offset:0; border-color:transparent!important}
.cp-v2 :is(button,summary,a):focus-visible {outline:3px solid var(--c-primary)!important; outline-offset:2px; box-shadow:none!important}
.cp-v2 .ct-pill:focus-within {outline:none}
.cp-v2 .ct-pill:has(input:focus-visible) {outline:3px solid var(--c-primary); outline-offset:2px}
.cp-v2 .ct-pill input:focus {outline:none!important}
.cp-v2 .ct-block {padding:16px; margin-bottom:16px; border:1px solid var(--c-border); border-radius:12px; background:var(--c-paper)}
.cp-v2 .ct-block__head {display:flex; justify-content:space-between; gap:8px}
.cp-v2 .ct-block__title {font-size:1.1rem}
.cp-v2 .ct-block__optional,.cp-v2 .ct-block__example {color:var(--c-text-muted); font-size:.875rem}
.cp-v2 .ct-block__field {margin:16px 0}
.cp-v2 .ct-block__added {padding:8px; background:var(--c-primary-light); border-radius:8px}
.cp-v2 .ct-check-grid {display:grid; gap:8px}
.cp-v2 .ct-disclosure__panel {padding:16px; max-height:35vh; overflow:auto}
.cp-v2 .cp-v2-output {white-space:pre-wrap; overflow-wrap:anywhere; max-height:420px; overflow:auto; background:var(--c-primary-light); padding:16px; border-radius:8px}
.cp-v2 summary {min-height:44px; cursor:pointer}
.cp-v2 [x-cloak] {display:none!important}
.cp-v2 button:disabled {opacity:1; color:var(--c-text-muted); background:var(--c-surface); border-color:var(--c-border); cursor:not-allowed}
.cp-v2-status:not(:empty) {position:fixed; bottom:20px; right:16px; z-index:100000; max-width:calc(100vw - 32px); padding:16px; color:var(--c-on-primary); background:var(--c-primary); border-radius:8px}
.cp-v2.modal {max-width:none; padding:0}
.cp-v2.modal .modal-content {background:var(--c-paper); color:var(--c-dark)}
@media (max-width:600px) {
.cp-v2 {padding:16px 0}
.cp-v2 #cpWizard {padding:16px!important}
.cp-v2 .d-flex:has(>input[x-model="saveName"]) {flex-wrap:wrap}
}
@media (prefers-reduced-motion:reduce) {.cp-v2 * {transition:none!important; scroll-behavior:auto!important}}
html[data-theme="dark"] .cp-v2,
[data-bs-theme="dark"] .cp-v2 {
    color-scheme: dark;
    --c-primary:#9be4ed;
    --c-primary-hover:#c0f1f6;
    --c-primary-light:#16383e;
    --c-primary-badge:#16383e;
    --c-help-glyph:var(--c-primary);
    --c-dark:#eef6f7;
    --c-text-muted:#c2d6da;
    --c-text-secondary:var(--c-text-muted);
    --c-paper:#151f22;
    --c-surface:#202d31;
    --c-on-primary:#10272b;
    --c-border:#718c92;
    --c-workspace-bg:var(--c-surface);
    --c-danger:#ffc5c1;
    --c-danger-surface:#411f21;
    --c-success:#c0f1d3;
    --c-success-surface:#19382a;
    --c-warning:#ffebad;
    --c-warning-surface:#3a2c15;
}
.ct-confirm-overlay:has(#confirm-cp-rename-merge-title) {--sys-focus-ring-width:3px; --sys-focus-ring-offset:2px}
.ct-confirm-overlay:has(#confirm-cp-rename-merge-title) button {min-height:44px; min-width:44px}
:is(html[data-theme="dark"], [data-bs-theme="dark"]) .ct-confirm-overlay:has(#confirm-cp-rename-merge-title) {
    --cmp-overlay-bg:#151f22; --sys-text-default:#eef6f7; --sys-text-secondary:#c2d6da; --sys-focus-ring:#9be4ed;
}
:is(html[data-theme="dark"], [data-bs-theme="dark"]) .ct-confirm-overlay:has(#confirm-cp-rename-merge-title) .ct-confirm-btn-cancel {background:var(--cmp-overlay-bg)}
.cp-v2 input:is([type="checkbox"],[type="radio"]) {min-height:18px}
.cp-v2 .modal-header {background:#064e5a!important}
.cp-v2 .cp-v2-label-row {display:flex; align-items:center; justify-content:flex-start; gap:4px; width:fit-content; max-width:100%; margin-bottom:8px; break-inside:avoid}
.cp-v2 .cp-v2-label-row label {margin-bottom:0!important; min-width:0}
.cp-v2 .cp-v2-help {display:inline-flex; vertical-align:middle; flex:0 0 44px; width:44px; min-width:44px; min-height:44px; padding:0; color:var(--c-help-glyph); background:var(--c-primary-light); border:1px solid var(--c-help-glyph); font-size:.875rem; line-height:1}
.cp-v2 .cp-v2-toolbar {position:relative; display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-block:8px 12px}
.cp-v2 .cp-v2-tools {flex-wrap:wrap; align-items:center; justify-content:flex-end; margin-inline-start:auto; max-width:100%}
.cp-v2 .cp-v2-models {max-width:100%}
.cp-v2 .cp-v2-models__links {
    position:absolute; inset-block-start:100%; inset-inline-start:0; z-index:12;
    width:min(20rem, calc(100vw - 5.5rem)); max-height:50vh; overflow:auto;
    margin:4px 0 0; padding:4px; border:1px solid var(--c-primary); border-radius:8px;
    background:var(--c-paper); box-shadow:0 6px 18px #15262a26;
}
.cp-v2 .cp-v2-models__links a {
    display:flex; flex-direction:column; justify-content:center; min-height:44px;
    padding:6px 10px; color:var(--c-primary); background:var(--c-paper); font-weight:600; text-decoration:none;
}
.cp-v2 .cp-v2-models__links a:hover {background:var(--c-primary-light); text-decoration:underline}
.cp-v2 .cp-v2-models__hint {color:var(--c-text-muted); font-size:.8rem; font-weight:400}
.cp-v2 :is(.cp-v2-toolbar, #promptHelpModal, #resetConfirmModal) .ct-btn {color:var(--c-primary); background:var(--c-paper); border-color:var(--c-primary)}
.cp-v2 :is(.cp-v2-toolbar, #promptHelpModal, #resetConfirmModal) .ct-btn:hover {color:var(--c-primary); background:var(--c-primary-light)}
.cp-v2 #promptHelpModal .ct-btn-primary {color:var(--c-on-primary); background:var(--c-primary)}
.cp-v2 #resetConfirmModal .ct-btn-danger {color:#fff; background:#991b1b; border-color:#991b1b}
.cp-v2 #promptHelpModal .ct-btn-primary:hover {color:var(--c-on-primary); background:var(--c-primary-hover)}
.cp-v2 #resetConfirmModal .ct-btn-danger:hover {color:#fff; background:#7f1d1d}
.cp-v2 .modal-header button:focus-visible {outline-color:#fff!important}
.cp-v2.is-fullscreen > .modal {background:#15262a80}
.cp-v2 :is(#cpPreviewPanel,#cpV2ResultHeading) {scroll-margin-top:160px}
.cp-v2 #cpWizard :is(.d-flex,.ct-block__field) {min-width:0}
.cp-v2 #promptHelpModalLabel {color:#fff}
.cp-v2 #promptHelpModal .modal-body {font-size:1rem; line-height:1.7; color:var(--c-dark); background:var(--c-paper); white-space:pre-line}


/* Finitions des libellés et du focus programmatique. */
.cp-v2 .cp-v2-label-row:has(label input[type="radio"]) {flex:none; white-space:nowrap}
.cp-v2 .d-flex:has(>.cp-v2-label-row label input[type="radio"]) {flex-wrap:wrap}
.cp-v2 .d-flex:has(>input[x-model="saveName"]) {flex-wrap:wrap}
.cp-v2 .d-flex:has(>input[x-model="saveName"])>.cp-v2-label-row {flex-basis:100%; white-space:nowrap}
.cp-v2 .cp-v2-tools>* {flex-shrink:0}

/* MEMORA solutions : présentation du résultat et modèles de l’aperçu admin. */
.cp-v2 .cp-v2-var { background: var(--c-primary-light); color: var(--c-dark); border-bottom: 2px solid var(--c-primary); padding: 0; }
.cp-v2 .cp-v2-var--empty { background: var(--c-surface); color: var(--c-dark); border-bottom-style: dashed; }

/* ====== Patron "etape a forte saisie" (train B, standard valide 2026-11-07) ====== */
/* Note de confidentialite COMPACTE (une ligne) sous un champ. */
.cp-v2 .cp-pii-inline{display:flex;gap:6px;align-items:flex-start;font-size:0.78rem;color:var(--c-text-secondary, #4a4f5c);margin:4px 0 2px;line-height:1.4;}
.cp-v2 .cp-pii-inline a{color:var(--c-primary);font-weight:700;text-decoration:underline;}
/* Divulgation progressive "Peaufiner la demande" : caret COLLE au libelle (jamais au bord droit). */
.cp-v2 .cp-peaufiner{border:1px dashed rgba(11,114,133,0.35);border-radius:12px;background:var(--c-primary-light);margin:0.25rem 0 1rem;overflow:hidden;}
.cp-v2 .cp-peaufiner>summary{list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:flex-start;gap:8px;padding:14px 16px;font-weight:600;font-size:0.92rem;color:var(--c-primary);min-height:44px;}
.cp-v2 .cp-peaufiner>summary::-webkit-details-marker{display:none;}
.cp-v2 .cp-peaufiner__chev{transition:transform .2s ease;font-size:0.8rem;line-height:1;}
.cp-v2 .cp-peaufiner[open]>summary .cp-peaufiner__chev{transform:rotate(180deg);}
.cp-v2 .cp-peaufiner>summary:focus-visible{outline:2px solid var(--c-primary);outline-offset:2px;}
.cp-v2 .cp-peaufiner__body{padding:12px 16px 14px;border-top:1px solid rgba(11,114,133,0.2);}
.cp-v2 .cp-v2-helppanel{margin:0 0 12px;padding:10px 12px;max-width:65ch;border-left:3px solid var(--c-primary);background:var(--c-primary-light);border-radius:0 8px 8px 0;color:var(--c-dark);font-size:.875rem;line-height:1.5}
.cp-v2 .ct-block__head>.cp-v2-helppanel{flex:0 0 100%}
.cp-v2 .cp-v2-help[aria-expanded="true"]{background:var(--c-primary);color:var(--c-on-primary)}

.cp-v2.tool-fullscreen-target {max-width:1180px; background:var(--c-workspace-bg, transparent)}
.cp-v2.tool-fullscreen-target.is-fullscreen {
    background:var(--c-paper); --cp-bottom-offset:0px; --cp-admin-bar:0px;
}
.cp-v2 .cp-v2-workspace {display:grid; grid-template-columns:minmax(0, 1.35fr) minmax(17rem, 1fr); align-items:start; gap:20px}
.cp-v2 .cp-v2-form {min-width:0}
.cp-v2 .cp-v2-result {
    position:sticky; top:calc(16px + var(--cp-admin-header, 0px)); min-width:0; color:var(--c-dark); background:var(--c-paper);
    border:1px solid var(--c-border); border-radius:12px;
    display:flex; flex-direction:column; max-height:calc(100dvh - 32px - var(--cp-admin-header, 0px) - var(--cp-admin-bar, 0px));
}
.cp-v2 .cp-v2-result-header {display:flex; align-items:center; justify-content:space-between; gap:8px; padding:10px 16px; border-bottom:1px solid var(--c-border)}
.cp-v2 .cp-v2-result-header h2 {margin:0; font-size:1.2rem; color:var(--c-dark)}
.cp-v2 .cp-v2-result-content {padding:16px; overflow:auto; min-height:0; scrollbar-gutter:stable; overscroll-behavior:contain}
.cp-v2 .cp-v2-result .cp-v2-output {color:var(--c-dark); max-height:32dvh; margin-bottom:8px}
.cp-v2 .cp-v2-result-metrics {display:flex; flex-wrap:wrap; gap:4px 14px; color:var(--c-text-muted); font-size:.8rem}
.cp-v2 .cp-v2-result-actions {display:grid; gap:8px; margin-block:12px}
.cp-v2 .cp-v2-result :is(button, summary, a) {min-height:44px; min-width:44px}
.cp-v2 .cp-v2-result a {display:inline-flex; align-items:center}
.cp-v2 .cp-v2-result .ct-btn-outline-danger {color:var(--c-danger); border-color:var(--c-danger)}
.cp-v2 .cp-v2-result .ct-btn {transition:none}
.cp-v2 .cp-v2-result .ct-btn-outline:not(:disabled):is(:hover, :focus, :active) {color:var(--c-primary); background:var(--c-primary-light); border-color:var(--c-primary)}
.cp-v2 .cp-v2-result .ct-btn-outline-danger:not(:disabled):is(:hover, :focus, :active) {color:var(--c-danger); background:var(--c-danger-surface); border-color:var(--c-danger)}
.cp-v2 .cp-v2-result :is(.ct-btn-primary, .ct-btn-accent):not(:disabled):is(:hover, :focus, :active) {color:var(--c-on-primary); background:var(--c-primary-hover); border-color:var(--c-primary-hover)}
.cp-v2 .cp-v2-result .cp-v2-result-toggle {display:none}

@media (min-width:721px) {
    .cp-v2.tool-fullscreen-target:not(.wpo-blog-single-section, .is-fullscreen) {--cp-admin-header:60px}
}

@media (max-width:991.98px) {
    body:has(#bottomBar):has(.cp-v2-workspace) {--cp-admin-bar:56px}
}

@media (max-width:720px) {
    body:has(.cp-v2-workspace) {
        --cp-result-bar:5.5rem;
        --cp-bottom-offset:max(var(--cp-admin-bar, 0px), var(--lv-free-notice-h, 0px));
        padding-bottom:calc(var(--cp-result-bar) + var(--cp-bottom-offset) + env(safe-area-inset-bottom));
    }
    body:has(.cp-v2-workspace):has(#cc-fab:not(.cc-hidden)) {
        --cp-bottom-offset:calc(var(--lv-free-notice-h, 0px) + 3rem + env(safe-area-inset-bottom));
    }
    .cp-v2 #cpWizard {padding-bottom:calc(var(--cp-result-bar) + var(--cp-bottom-offset) + env(safe-area-inset-bottom))!important}
    .cp-v2 .cp-v2-workspace {display:block}
    .cp-v2 .cp-v2-form {
        --cp-form-scroll-bottom:calc(var(--cp-result-bar) + var(--cp-bottom-offset) + env(safe-area-inset-bottom));
    }
    .cp-v2 .cp-v2-result {
        position:fixed; inset:auto 0 max(var(--cp-bottom-offset), var(--cp-keyboard-inset, 0px)); z-index:1000; border-radius:12px 12px 0 0;
        max-height:calc(var(--cp-visual-height, 100dvh) - var(--cp-bottom-offset) - 12px); padding-bottom:env(safe-area-inset-bottom);
        box-shadow:0 -4px 20px #15262a26;
    }
    .cp-v2-keyboard-open .cp-v2-workspace:has(.cp-v2-form :is(textarea, input:not([type="checkbox"], [type="radio"], [type="hidden"], [type="button"], [readonly])):focus) .cp-v2-result {
        display:none;
    }
    .cp-v2 .cp-v2-result:not(.cp-v2-result--open) .cp-v2-result-header {border-bottom:0}
    .cp-v2 .cp-v2-result:not(.cp-v2-result--open) .cp-v2-result-content {display:none}
    .cp-v2 .cp-v2-result .cp-v2-result-toggle {display:inline-flex}
    .cp-v2 .cp-v2-status:not(:empty) {top:12px; bottom:auto}
}

.cp-v2 [tabindex]:focus-visible {outline:3px solid var(--c-primary); outline-offset:-3px}

.cp-v2 :is(.cp-v2-essential, .cp-v2-refinements) {
    background: var(--c-paper);
    border: 1px solid var(--c-border);
    border-radius: 14px;
    margin-bottom: 1rem;
    padding: clamp(12px, 3vw, 20px);
}
.cp-v2 .cp-v2-essential { border-inline-start: 4px solid var(--c-primary); }
.cp-v2 .cp-v2-essential-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.cp-v2 :is(.cp-v2-essential, .cp-v2-refinements) h2 { color: var(--c-dark); font-size: 1.2rem; font-weight: 700; margin: 0; }
.cp-v2 .cp-v2-refinements h2 { margin-bottom: .75rem; }
.cp-v2 .cp-v2-optional-heading { font-size: .85rem; font-weight: 400; color: var(--c-text-muted); }
.cp-v2 :is(.cp-v2-required, .cp-v2-row-summary) {
    background: var(--c-primary-badge);
    color: var(--c-primary);
    border-radius: 8px;
    padding: .15rem .5rem;
    font-size: .8rem;
    font-weight: 700;
}
.cp-v2 :is(.cp-v2-required--filled, .cp-v2-ready) { color: var(--c-success); background: var(--c-success-surface); }
.cp-v2 .cp-v2-ready { border-radius: 8px; padding: .6rem .75rem; margin: .5rem 0 0; }
.cp-v2 .cp-v2-required-message { color: var(--c-danger); margin: .5rem 0 0; }
.cp-v2 .cp-v2-refinement-title { display: grid; justify-items: start; gap: .25rem; min-width: 0; }
.cp-v2 .cp-v2-row-summary { max-width: 100%; overflow-wrap: anywhere; }
.cp-v2 .cp-v2-form :is(.form-control, .cp-v2-help, .ct-btn),
.cp-v2 .cp-v2-result #cpValidityHint button { min-height: 44px; }
.cp-v2 .cp-v2-form .cp-v2-help { min-width: 44px; }
.cp-v2 .cp-v2-form :is(input, select, textarea, button, summary, [tabindex]) {
    scroll-margin-block:1rem var(--cp-form-scroll-bottom, 1rem);
}

.cp-v2 .text-muted {color:var(--c-text-muted)!important}
.cp-v2 .alert {color:var(--c-dark); background:var(--c-primary-light); border-color:var(--c-border)}
.cp-v2 .alert-warning {color:var(--c-warning); background:var(--c-warning-surface)}
.cp-v2 .alert-danger {color:var(--c-danger); background:var(--c-danger-surface)}
.cp-v2 .form-control:is(:focus, :disabled), .cp-v2 .form-control {color:var(--c-dark); background:var(--c-paper)}
.cp-v2 input::placeholder, .cp-v2 textarea::placeholder {color:var(--c-text-muted); opacity:1}
.cp-v2 :is(.ct-chip__x, .ct-chip__badge) {opacity:1}
.cp-v2 .ct-chip:has(>.ct-chip__label) {column-gap:10px}
.cp-v2 .ct-chip :is(.ct-chip__x, .ct-chip__label):focus-visible {outline-color:currentColor!important; outline-offset:-2px}
.cp-v2 label:has(>input:is([type="checkbox"], [type="radio"]):not(.ct-pill__input)) {
    display:inline-flex; align-items:center; min-width:44px; min-height:44px; cursor:pointer;
}
.cp-v2 label:has(>input:is([type="checkbox"], [type="radio"]):not(.ct-pill__input):focus-visible) {
    outline:3px solid var(--c-primary); outline-offset:2px; border-radius:6px;
}
.cp-v2 label>input:is([type="checkbox"], [type="radio"]):focus-visible {outline:none!important}
.cp-v2 :is(.ct-disclosure__toggle, .cp-peaufiner>summary):focus-visible {outline-offset:-3px}
.cp-v2 .cp-v2-result #cpValidityHint button {color:inherit; border-color:currentColor}
