/* Zone ingredients commune aux parcours SSR de creation et de modification. */
.cm-ingredient-section.cm-ingredient-section {
    min-width: 0;
    padding: clamp(1.25rem, 3vw, 1.7rem);
    border: 1px solid rgba(255, 214, 100, .12);
    border-radius: 26px 10px 26px 10px;
    background: linear-gradient(145deg, rgba(39, 38, 31, .98), rgba(27, 26, 21, .98));
    box-shadow: 0 22px 60px rgba(0, 0, 0, .18);
}
.cm-ingredient-section .cm-ingredient-title-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}
.cm-ingredient-section .cm-ingredient-title { min-width: 0; }
.cm-ingredient-section .cm-ingredient-title > span {
    color: #f4b72b;
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .15em;
    text-transform: uppercase;
}
.cm-ingredient-section .cm-ingredient-title h2 {
    margin: .45rem 0 .45rem;
    color: #fff7e5;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.55rem;
    letter-spacing: -.04em;
}
.cm-ingredient-section .cm-ingredient-title p,
.cm-ingredient-section .cm-ingredient-title .ingredient-help {
    margin: 0;
    color: #aaa396;
    font-size: .9rem;
    line-height: 1.6;
}
.cm-ingredient-section .heading-actions {
    display: flex;
    align-items: center;
    gap: .65rem;
    flex-wrap: wrap;
}
.cm-ingredient-section .add-group-button {
    min-height: 40px;
    flex: 0 0 auto;
    padding: 0 .85rem;
    border: 1px solid rgba(244, 183, 43, .24);
    border-radius: 10px;
    background: rgba(244, 183, 43, .08);
    color: #ffd86d;
    font: inherit;
    font-size: .78rem;
    font-weight: 850;
    cursor: pointer;
}
.cm-ingredient-section .add-group-button:disabled { opacity: .35; cursor: default; }
.cm-ingredient-section .editor-preview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: stretch;
    gap: 1rem;
}
.cm-ingredient-section .editor-pane,
.cm-ingredient-section .preview-pane {
    min-width: 0;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 16px;
    background: rgba(0, 0, 0, .11);
}
.cm-ingredient-section .preview-pane {
    background: linear-gradient(145deg, rgba(27, 26, 21, .96), rgba(22, 21, 18, .96));
}
.cm-ingredient-section .pane-heading {
    display: flex;
    justify-content: space-between;
    gap: .8rem;
    margin-bottom: .75rem;
}
.cm-ingredient-section .pane-heading strong { color: #f2eadc; font-size: .84rem; }
.cm-ingredient-section .pane-heading span { color: #7f786d; font-size: .72rem; text-align: right; }
.cm-ingredient-section .preview-empty { margin: 0; padding: 2rem 1rem; color: #777166; text-align: center; }
.cm-ingredient-section .ingredient-input-column {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: .8rem;
}
.cm-ingredient-section .ingredient-input-column > .add-group-button {
    box-sizing: border-box;
    width: 100%;
    align-self: stretch;
    min-height: 44px;
}
.cm-ingredient-section .ingredient-groups { display: grid; gap: .8rem; align-content: start; }
.cm-ingredient-section .ingredient-group {
    padding: .8rem;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 13px;
    background: rgba(255, 255, 255, .018);
}
.cm-ingredient-section .group-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .7rem;
    align-items: end;
    margin-bottom: .65rem;
}
.cm-ingredient-section .group-heading label {
    display: grid;
    gap: .4rem;
    min-width: 0;
    color: #ddd5c7;
    font-size: .82rem;
    font-weight: 800;
}
.cm-ingredient-section .group-name-input,
.cm-ingredient-section .ingredient-editor {
    box-sizing: border-box;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 12px;
    background: #23221d;
    color: #f6efe2;
    font: inherit;
    outline: 0;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.cm-ingredient-section .group-name-input { min-height: 48px; padding: 0 .9rem; }
.cm-ingredient-section .ingredient-editor { min-height: 210px; padding: .8rem; line-height: 1.55; resize: vertical; }
.cm-ingredient-section .group-name-input:focus,
.cm-ingredient-section .ingredient-editor:focus {
    border-color: rgba(244, 183, 43, .66);
    box-shadow: 0 0 0 3px rgba(244, 183, 43, .08);
}
.cm-ingredient-section .ingredient-editor:disabled { opacity: .45; }
.cm-ingredient-section .ingredient-editor[aria-invalid="true"] { border-color: rgba(255, 130, 112, .8); }
.cm-ingredient-section .group-actions { display: flex; gap: .3rem; padding-bottom: .05rem; }
.cm-ingredient-section .group-actions button {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 9px;
    background: rgba(255, 255, 255, .04);
    color: #d8d0c2;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}
.cm-ingredient-section .group-actions button:disabled { opacity: .25; cursor: default; }
.cm-ingredient-section .group-actions .danger { color: #ff9f91; }
.cm-ingredient-section .group-name-required { margin: -.1rem 0 .55rem; color: #ffb0a5; font-size: .76rem; }
.cm-ingredient-section .ingredient-line-errors:not([hidden]) {
    margin-top: .5rem;
    padding: .65rem .8rem;
    border: 1px solid rgba(255, 130, 112, .3);
    border-radius: 9px;
    background: rgba(173, 57, 48, .12);
    color: #ffb4a8;
    font-size: .8rem;
    line-height: 1.5;
}
.cm-ingredient-section .ingredient-line-errors p { margin: 0; }
@media (max-width: 900px) {
    .cm-ingredient-section .editor-preview-grid { grid-template-columns: 1fr; }
    .cm-ingredient-section .cm-ingredient-title-row { align-items: stretch; flex-direction: column; }
}
@media (max-width: 650px) {
    .cm-ingredient-section .group-heading { grid-template-columns: 1fr; }
    .cm-ingredient-section .group-actions { justify-content: flex-end; }
    .cm-ingredient-section .pane-heading { align-items: flex-start; flex-direction: column; }
    .cm-ingredient-section .pane-heading span { text-align: left; }
}

/* Presentateur commun : fiche SSR (Razor) et apercus SSR (DOM JavaScript). */
.cm-ingredient-display { min-width: 0; width: 100%; }
.cm-ingredient-display-group + .cm-ingredient-display-group { margin-top: 1.65rem; }
.cm-ingredient-group-title {
    display: flex;
    align-items: center;
    gap: .8rem;
    margin: 0 0 .55rem;
    color: #f4b72b;
    font-family: inherit;
    font-size: .82rem;
    font-weight: 900;
    line-height: 1.3;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.cm-ingredient-group-title::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: rgba(244, 183, 43, .2);
}
.cm-ingredient-list {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}
.cm-ingredient-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 1rem;
    min-height: 42px;
    padding: .65rem .1rem;
    font-size: 15px;
}
.cm-ingredient-item + .cm-ingredient-item {
    border-top: 1px solid rgba(255, 255, 255, .07);
}
.cm-ingredient-name {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #e3d9c7;
    font-weight: 600;
    line-height: 1.35;
}
.cm-ingredient-quantity {
    justify-self: end;
    color: #fff7e5;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.35;
    text-align: right;
    white-space: nowrap;
}
.cm-ingredient-item.invalid .cm-ingredient-name { color: #ffc0b7; }
.cm-ingredient-warning {
    color: #f4b72b;
    font-size: .75rem;
    font-weight: 700;
    white-space: nowrap;
}
@media (max-width: 520px) {
    .cm-ingredient-item { gap: .75rem; padding-inline: .05rem; }
    .cm-ingredient-quantity { max-width: 42vw; white-space: normal; }
}

/* Modes de lecture partages par la fiche publique et les apercus SSR. */
.cm-ingredient-view-switch {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: .38rem;
    margin: 0;
}
.cm-ingredient-view-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid rgba(255, 213, 101, .22);
    border-radius: 8px;
    background: rgba(255, 255, 255, .035);
    color: #e1d6bd;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.cm-ingredient-view-button:hover { border-color: rgba(244, 183, 43, .65); }
.cm-ingredient-view-button[aria-pressed="true"] {
    border-color: #f4b72b;
    background: #f4b72b;
    color: #191813;
}
.cm-ingredient-view-button:focus-visible {
    outline: 2px solid #ffdc75;
    outline-offset: 3px;
}


/* La fiche publique reserve la ligne superieure aux boutons, a hauteur du surtitre
   « Ingredients », sans reduire la largeur du grand titre en dessous. */
.cm-ingredient-public-heading {
    position: relative;
    display: block;
    padding-bottom: .4rem;
}
.cm-ingredient-public-heading .cm-ingredient-heading-labels { min-width: 0; }
.cm-ingredient-public-heading .cm-ingredient-view-switch {
    position: absolute;
    top: 0;
    right: 0;
    margin: 0;
}
.cm-ingredient-section .pane-heading.cm-ingredient-preview-heading {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .6rem 1rem;
}
.cm-ingredient-preview-heading .cm-ingredient-heading-labels {
    display: grid;
    min-width: 0;
    gap: .15rem;
}
.cm-ingredient-section .cm-ingredient-preview-heading .cm-ingredient-heading-labels span {
    text-align: left;
}
.cm-ingredient-preview-heading .cm-ingredient-view-switch { margin-left: auto; }
@media (max-width: 520px) {
    .cm-ingredient-section .pane-heading.cm-ingredient-preview-heading {
        align-items: flex-start;
    }
}

/* Vue compacte : rythme plus serre, mais une ligne reste lisible et confortable. */
:root[data-ingredient-view-mode="compact"] .cm-ingredient-display-group + .cm-ingredient-display-group { margin-top: 1rem; }
:root[data-ingredient-view-mode="compact"] .cm-ingredient-item {
    min-height: 36px;
    gap: .65rem;
    padding: .45rem .1rem;
    font-size: 15px;
}
:root[data-ingredient-view-mode="compact"] .cm-ingredient-item + .cm-ingredient-item {
    border-top-color: rgba(255, 255, 255, .035);
}
:root[data-ingredient-view-mode="compact"] .cm-ingredient-group-title { margin-bottom: .2rem; }

/* Troisieme vue : quantite a gauche, designation a droite, sans case a cocher. */
:root[data-ingredient-view-mode="quantity-left"] .cm-ingredient-display-group + .cm-ingredient-display-group {
    margin-top: 1.2rem;
}
:root[data-ingredient-view-mode="quantity-left"] .cm-ingredient-list {
    gap: .42rem;
}
:root[data-ingredient-view-mode="quantity-left"] .cm-ingredient-item {
    grid-template-columns: minmax(5.8rem, 32%) minmax(0, 1fr);
    align-items: center;
    gap: .7rem;
    min-height: 42px;
    padding: .65rem .7rem;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 9px;
    background: rgba(255, 255, 255, .035);
}
:root[data-ingredient-view-mode="quantity-left"] .cm-ingredient-item + .cm-ingredient-item {
    border-top: 1px solid rgba(255, 255, 255, .07);
}
:root[data-ingredient-view-mode="quantity-left"] .cm-ingredient-quantity {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    color: #f4b72b;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
}
:root[data-ingredient-view-mode="quantity-left"] .cm-ingredient-name {
    grid-column: 2;
    grid-row: 1;
}
@media (max-width: 520px) {
    :root[data-ingredient-view-mode="quantity-left"] .cm-ingredient-item {
        grid-template-columns: minmax(4.6rem, 35%) minmax(0, 1fr);
        gap: .5rem;
        padding: .5rem;
    }
    :root[data-ingredient-view-mode="quantity-left"] .cm-ingredient-quantity {
        max-width: none;
    }
    .cm-ingredient-view-button { width: 36px; height: 36px; }
}
@media (prefers-reduced-motion: reduce) {
    .cm-ingredient-view-button { transition: none; }
}

.photo-import-page{width:min(1120px,calc(100% - 2rem));margin:2rem auto 5rem;color:#f5ead7}.photo-import-heading{margin-bottom:1.6rem}.photo-import-back{display:inline-block;margin-bottom:1.6rem;color:#f3bc35;text-decoration:none}.photo-import-card,.photo-import-result{background:#24221d;border:1px solid #494029;border-radius:22px;padding:clamp(1.1rem,3vw,2rem);box-shadow:0 14px 38px #0003}.photo-import-toolbar{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-bottom:1rem}.photo-import-toolbar strong{font-size:1.15rem}.photo-import-toolbar p{margin:.45rem 0 0;color:#c5b9a1}.photo-import-credit{padding:.8rem 1rem;border:1px solid #725c29;border-radius:12px;color:#f8cb66;font-weight:700;white-space:nowrap}.photo-import-drop{border:2px dashed #77602f;border-radius:16px;min-height:175px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.7rem;padding:1.3rem;text-align:center;cursor:pointer;background:#2b2922;transition:border-color .2s,background .2s}.photo-import-drop:hover,.photo-import-drop.dragging{border-color:#efb92d;background:#352f1f}.photo-import-drop span{color:#b8ac96}.photo-import-camera{font-size:2rem}.photo-import-drop input{position:absolute;width:1px;height:1px;opacity:0}.photo-import-thumbnails{display:flex;gap:1rem;flex-wrap:wrap;margin-top:1rem}.photo-import-thumb{display:flex;align-items:center;gap:.75rem;background:#36332b;border-radius:12px;padding:.4rem .8rem;color:#e9d5ab}.photo-import-thumb img{width:70px;height:68px;object-fit:cover;border-radius:8px}.photo-import-actions,.photo-import-result-actions{display:flex;align-items:center;flex-wrap:wrap;gap:1rem;margin-top:1.5rem}.photo-import-actions>span{color:#c8bda6;font-size:.85rem}.photo-import-primary,.photo-import-secondary{font:inherit;font-weight:700;border-radius:12px;cursor:pointer;padding:.85rem 1.2rem}.photo-import-primary{background:#f1b82b;color:#251d10;border:1px solid #f1b82b}.photo-import-primary:disabled{opacity:.5;cursor:not-allowed}.photo-import-secondary{background:transparent;color:#ffcf6e;border:1px solid #8c6e35}.photo-import-error{padding:1rem;background:#5b2927;color:#fff0df;border-radius:10px;margin:1rem 0 0}.photo-import-result{margin-top:1.8rem;scroll-margin-top:8rem}.photo-import-result-heading{display:flex;align-items:center;justify-content:space-between;color:#ffc849;font-size:.75rem;font-weight:800;letter-spacing:.08em}.photo-import-result-heading strong{color:#dfd1b2;font-size:.72rem}.photo-import-result h2{font-family:Georgia,serif;font-size:clamp(1.65rem,3vw,2.6rem);line-height:1.15;margin:1.2rem 0 .5rem}.photo-import-result>p{color:#cabeab}.photo-import-facts{display:flex;gap:.6rem;flex-wrap:wrap;margin:1.25rem 0}.photo-import-facts span{border:1px solid #4d422f;background:#302c23;padding:.5rem .8rem;border-radius:30px;font-size:.84rem}.photo-import-recipe-columns{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin:1.6rem 0}.photo-import-recipe-section{min-width:0;border:1px solid #4c422e;border-radius:18px;padding:1.25rem;background:#201f1b}.photo-import-recipe-section .cm-ingredient-display{margin-top:1.5rem}.photo-import-step{display:flex;gap:.85rem;margin:1rem 0;align-items:flex-start;line-height:1.55}.photo-import-step p{margin:0}.photo-import-step-number{width:30px;height:30px;flex:0 0 30px;display:grid;place-items:center;border:1px solid #8c712e;background:#383020;border-radius:50%;color:#f5c949;font-weight:700}.photo-import-warning{padding:.8rem 1rem;background:#393020;border-radius:12px;border:1px solid #685128;color:#f2d5a3!important}.photo-import-saving-note{font-size:.84rem}.photo-import-result[hidden],.photo-import-error[hidden]{display:none!important}
@media(max-width:700px){.photo-import-page{width:min(100% - 1.25rem,1120px)}.photo-import-toolbar{align-items:flex-start;flex-direction:column}.photo-import-credit{white-space:normal}.photo-import-recipe-columns{grid-template-columns:1fr}.photo-import-result-actions>*{width:100%}}

.photo-import-drop{cursor:default}.photo-import-choices{display:flex;justify-content:center;flex-wrap:wrap;gap:.7rem;margin:.3rem 0}.photo-import-choices label{cursor:pointer;display:inline-flex;align-items:center}.photo-import-hidden-file{position:absolute;opacity:0;width:1px;height:1px;pointer-events:none}.photo-import-drop small{color:#c1b29b}.photo-import-remove{background:#524025;color:#f5d48b;border:1px solid #997032;border-radius:8px;cursor:pointer;font-size:1.2rem;min-width:32px;min-height:32px}.photo-import-choices .photo-import-secondary:hover{border-color:#f0bb3d;background:#42331e}

.photo-import-privacy{font-size:.79rem;color:#c7b99e;margin:.8rem 0 .2rem}

/* Option facultative et photographie choisie par l'IA. */
.photo-import-enhance{margin-top:1.15rem;padding:1rem 1.15rem;border:1px solid #685637;background:#302c23;border-radius:14px;display:flex;justify-content:space-between;gap:1rem;align-items:center}
.photo-import-enhance[hidden],.photo-import-illustration[hidden]{display:none!important}
.photo-import-enhance label{display:flex;gap:.75rem;align-items:flex-start;cursor:pointer}
.photo-import-enhance input{accent-color:#eebd39;width:19px;height:19px;margin-top:.18rem}
.photo-import-enhance label span{display:flex;flex-direction:column;gap:.3rem}
.photo-import-enhance small{font-size:.84rem;color:#c3b69d}
#photo-import-enhance-price{font-weight:800;color:#f7c44b;white-space:nowrap}
.photo-import-regional{margin:.65rem 0 0 1.3rem;padding:.8rem 1rem;border-left:3px solid #c89b36;background:#28251f;border-radius:0 12px 12px 0}
.photo-import-regional[hidden],#photo-import-confirm-regional-row[hidden]{display:none!important}
.photo-import-regional label{display:flex;align-items:flex-start;gap:.75rem;cursor:pointer}
.photo-import-regional input{accent-color:#eebd39;width:18px;height:18px;margin-top:.2rem;flex-shrink:0}
.photo-import-regional label span{display:flex;flex-direction:column;gap:.35rem}
.photo-import-regional strong{color:#f6edd9;font-size:.92rem}
.photo-import-regional strong em{font-style:normal;color:#f4c34f;font-size:.8rem}
.photo-import-regional small{color:#c3b69d;font-size:.83rem;line-height:1.5}
.photo-import-price-summary{color:#e4cf9e;font-weight:700;margin:1rem .2rem .3rem}
.photo-import-illustration{margin:1.35rem 0 1rem}
.photo-import-illustration img{display:block;width:100%;aspect-ratio:16/9;object-fit:cover;border-radius:14px;border:1px solid #655331}
.photo-import-illustration figcaption{color:#bfb198;font-size:.8rem;margin-top:.35rem}
@media(max-width:600px){.photo-import-enhance{align-items:flex-start;flex-direction:column}}

.photo-import-card[aria-busy="true"] .photo-import-drop{opacity:.65}

/* Vitrine publique de l'import photo : aucun formulaire ni appel IA hors administration. */
.photo-import-teaser{width:min(1140px,calc(100% - 2rem));margin:2.1rem auto 5rem;padding:clamp(1.1rem,3.3vw,2.7rem);border-radius:24px;border:1px solid #524329;background:radial-gradient(ellipse at 84% 9%,#3a3020 0%,#24221d 54%,#1d1c19 100%);color:#f7e9d2;box-shadow:0 24px 60px #0004}
.photo-import-teaser-intro{width:100%;min-width:0}
.photo-import-teaser-kicker{display:inline-flex;gap:.5rem;align-items:center;color:#f5c34f;letter-spacing:.11em;font-weight:800;font-size:.76rem}
.photo-import-teaser-kicker>span{font-size:1.3rem}
.photo-import-teaser h1{font-family:Georgia,serif;font-size:clamp(2rem,4.7vw,3.7rem);line-height:1.12;letter-spacing:-.035em;margin:.8rem 0 1rem}
.photo-import-teaser h1 em{font-style:normal;color:#f4c352}
.photo-import-teaser-lead{font-size:clamp(.99rem,1.4vw,1.12rem);line-height:1.7;color:#d8c9ae;max-width:none}
.photo-import-teaser-status{display:flex;gap:.8rem;align-items:flex-start;padding:1rem 1.2rem;margin:1.6rem 0;border-radius:14px;border:1px solid #95712e;background:#3c311d;color:#f5dc9e;width:100%;max-width:none;box-sizing:border-box}
.photo-import-teaser-status>span{font-size:1.6rem;line-height:1;color:#ffca56}
.photo-import-teaser-status strong,.photo-import-teaser-status div span{display:block}
.photo-import-teaser-status strong{font-size:1rem;margin-bottom:.26rem}
.photo-import-teaser-status div span{font-size:.88rem;line-height:1.6;color:#ead6a5}
.photo-import-teaser-demo{display:grid;grid-template-columns:minmax(0,1fr) 54px minmax(0,1fr);align-items:center;gap:1.15rem;margin:2.2rem 0 .6rem}
.photo-import-teaser-example{min-width:0;margin:0;position:relative;border-radius:18px;border:1px solid #5c4a2d;background:#1b1a18;padding:.6rem;box-shadow:0 12px 32px #0005}
.photo-import-teaser-example img{display:block;width:100%;height:auto;aspect-ratio:706/589;object-fit:contain;border-radius:10px}
.photo-import-teaser-source img{background:linear-gradient(120deg,#201d18,#4c3b25)}
.photo-import-teaser-example figcaption{display:flex;align-items:center;gap:.6rem;color:#f3dcab;font-size:.87rem;font-weight:700;padding:.8rem .3rem .25rem}
.photo-import-teaser-example figcaption span{color:#fbc84e;font-weight:900}
.photo-import-teaser-arrow{display:grid;place-items:center;width:48px;height:48px;border-radius:50%;background:#eeb72f;color:#2b200d;font-size:1.75rem;font-weight:900}
.photo-import-teaser-disclaimer{color:#a99f8c;font-size:.78rem;text-align:right;margin:.35rem 0 1.9rem}
.photo-import-teaser-benefits{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem}
.photo-import-teaser-benefits>div{border:1px solid #4d422c;background:#28261f;border-radius:16px;padding:1.3rem}
.photo-import-teaser-benefits>div>span{font-size:1.6rem;display:block;margin-bottom:.6rem}
.photo-import-teaser-benefits strong{display:block;color:#fff2d6;font-size:1rem}
.photo-import-teaser-benefits p{color:#c7b8a1;line-height:1.55;font-size:.9rem;margin:.5rem 0 0}
.photo-import-teaser-footer{display:flex;justify-content:space-between;align-items:center;gap:1rem;flex-wrap:wrap;margin-top:1.7rem;border-top:1px solid #4e432e;padding-top:1.4rem;color:#d4c4a4}
.photo-import-teaser-footer a{display:inline-flex;border-radius:10px;padding:.75rem 1.2rem;border:1px solid #8f6d2d;color:#f7ca61;text-decoration:none;font-weight:700}
.photo-import-teaser-footer a:hover{background:#3e3421;border-color:#edba3f}
@media(max-width:800px){.photo-import-teaser-demo{grid-template-columns:minmax(0,1fr) 40px minmax(0,1fr);gap:.65rem}.photo-import-teaser-arrow{width:38px;height:38px;font-size:1.35rem}.photo-import-teaser-benefits{gap:.65rem}.photo-import-teaser-benefits>div{padding:1rem}}
@media(max-width:630px){.photo-import-teaser{width:calc(100% - 1.25rem)}.photo-import-teaser-demo{display:flex;flex-direction:column;gap:.9rem}.photo-import-teaser-example{width:100%}.photo-import-teaser-arrow{transform:rotate(90deg)}.photo-import-teaser-benefits{grid-template-columns:1fr}.photo-import-teaser-disclaimer{text-align:left}.photo-import-teaser-footer{align-items:flex-start;flex-direction:column}}


/* Contenu propre à l’analyse ; le cadre et les boutons sont dans CMDialog. */
.photo-import-confirm-breakdown{background:#302c24;border:1px solid #53432a;padding:1rem 1.1rem;border-radius:14px}
.photo-import-confirm-line,.photo-import-confirm-total,.photo-import-confirm-balance{display:flex;align-items:baseline;justify-content:space-between;gap:1rem}
.photo-import-confirm-line{padding:.35rem 0;color:#e0d4c0;font-size:.91rem}
.photo-import-confirm-line strong{color:#fff3d9;white-space:nowrap}
.photo-import-confirm-total{border-top:1px solid #695532;margin-top:.7rem;padding-top:.9rem;font-weight:800}
.photo-import-confirm-total strong{font-size:1.35rem;color:#f6c34a;white-space:nowrap}
.photo-import-confirm-balance{margin:1rem .1rem;color:#d8c8aa;font-size:.9rem}
.photo-import-confirm-balance strong{color:#fff3d9;white-space:nowrap}
.photo-import-confirm-note{color:#c9b895;font-size:.82rem;line-height:1.6;margin:1rem 0 1.2rem}
.photo-import-confirm-enhance[hidden],#photo-import-confirm-enhance-row[hidden]{display:none!important}
@media(max-width:480px){.photo-import-confirm-total strong{font-size:1.1rem}}

/* Les photos sélectionnées restent dans la zone de dépôt et précèdent les boutons d'ajout. */
.photo-import-selection-row{display:flex;align-items:center;justify-content:center;gap:1.2rem;flex-wrap:wrap;width:100%}
.photo-import-thumbnails{display:flex;align-items:center;justify-content:center;gap:.75rem;flex-wrap:wrap;margin:0}
.photo-import-thumb{position:relative;display:flex;flex-direction:column;gap:.25rem;padding:.4rem;background:#36332b;cursor:grab;user-select:none;touch-action:pan-y;min-width:102px}
.photo-import-thumb:active{cursor:grabbing}.photo-import-thumb.sorting{opacity:.45}
.photo-import-thumb img{width:94px;height:84px;object-fit:cover}
.photo-import-thumb-number{position:absolute;left:.55rem;top:.55rem;display:grid;place-items:center;background:#efb92d;color:#201b12!important;font-weight:800;border-radius:50%;height:23px;width:23px;font-size:.8rem}
.photo-import-thumb-size{font-size:.75rem;color:#e9d5ab!important;white-space:nowrap}
.photo-import-thumb .photo-import-remove{position:absolute;right:.45rem;top:.45rem;min-width:27px;min-height:27px;line-height:1;padding:0}
.photo-import-choices[hidden]{display:none!important}
.photo-import-drop.has-photos{min-height:195px}
@media(max-width:580px){.photo-import-selection-row{gap:.7rem}.photo-import-thumb img{width:82px;height:76px}.photo-import-thumb{min-width:90px}.photo-import-drop{padding:.9rem}}

/* Zone de photos compacte : galerie au-dessus, barre d'ajout stable en dessous. */
.photo-import-drop{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;text-align:left;min-height:0!important;padding:1rem 1.2rem;gap:.65rem}
.photo-import-drop.has-photos{min-height:0!important}
.photo-import-thumbnails{display:flex;justify-content:flex-start;align-items:flex-start;flex-wrap:wrap;gap:.85rem;width:100%;margin:0}
.photo-import-thumbnails:empty{display:none}
.photo-import-thumbnails:not(:empty){padding:.2rem 0 .85rem;border-bottom:1px solid #635a47}
.photo-import-add-bar{display:flex;align-items:center;justify-content:flex-start;gap:1rem;flex-wrap:wrap;min-width:0}
.photo-import-drop .photo-import-camera{font-size:1.3rem;line-height:1;flex:none}
.photo-import-file-info{font-size:.85rem;color:#c5b9a1;white-space:normal}
.photo-import-add-bar .photo-import-choices{margin:0;gap:.5rem;justify-content:flex-start}
.photo-import-add-bar .photo-import-secondary{padding:.65rem .8rem;font-size:.86rem}
.photo-import-limit{color:#f1c766;font-size:.9rem;font-weight:700}
.photo-import-drop #photo-import-drop-help{display:block;text-align:center;font-size:.8rem}
.photo-import-drop .photo-import-photo-tip{display:block;text-align:center;font-size:.76rem;opacity:.85}
.photo-import-thumb{min-width:0;padding:.5rem;gap:.45rem;position:relative}
.photo-import-thumb img{width:130px;height:112px;cursor:zoom-in;object-fit:cover}
.photo-import-thumb-grip{position:absolute;bottom:.45rem;right:.5rem;color:#e9d5ab!important;cursor:grab;font-size:1.1rem}
.photo-import-thumb-size{font-size:.75rem;padding-right:1.15rem}
.photo-import-lightbox{border:1px solid #8c6e35;border-radius:16px;background:#24221d;padding:2.5rem 1rem 1rem;max-width:min(94vw,1000px);max-height:90vh;color:#fff}
.photo-import-lightbox::backdrop{background:rgba(0,0,0,.84)}
.photo-import-lightbox img{display:block;max-width:100%;max-height:calc(90vh - 5rem);object-fit:contain;margin:auto}
.photo-import-lightbox-close{position:absolute;right:.55rem;top:.3rem;background:transparent;border:0;color:#f5cf81;font-size:2rem;cursor:pointer}
@media(max-width:620px){.photo-import-drop{padding:.85rem}.photo-import-thumbnails{gap:.55rem}.photo-import-thumb img{width:clamp(88px,30vw,125px);height:100px}.photo-import-add-bar{gap:.6rem}.photo-import-add-bar .photo-import-choices{width:100%}.photo-import-add-bar .photo-import-secondary{flex:1;justify-content:center;text-align:center}.photo-import-file-info{font-size:.78rem}}
@media(max-width:360px){.photo-import-add-bar .photo-import-choices{flex-direction:column}.photo-import-add-bar .photo-import-secondary{width:100%}}

/* Choix de portée AVANT l'analyse IA payante : pas de crédits dépensés sur un privé déjà saturé. */
.photo-import-visibility{margin:1rem 0 0;padding:1rem 1.15rem;border:1px solid #625032;border-radius:14px;background:#2c2922;min-width:0}
.photo-import-visibility legend{font-weight:800;color:#f8d68c;padding:0 .35rem}
.photo-import-visibility-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.7rem}
.photo-import-visibility-options label{display:flex;gap:.7rem;align-items:flex-start;padding:.8rem;border-radius:10px;border:1px solid #51442e;cursor:pointer}
.photo-import-visibility-options input{accent-color:#f0bd3c;flex-shrink:0;margin-top:.2rem}
.photo-import-visibility-options label:has(input:checked){background:#443821;border-color:#b68c36}
.photo-import-visibility-options label:has(input:disabled){opacity:.48;cursor:not-allowed}
.photo-import-visibility-options span{display:flex;flex-direction:column;gap:.25rem}
.photo-import-visibility-options strong{color:#f5e5c6;font-size:.9rem}
.photo-import-visibility-options small{color:#c2b59c;font-size:.8rem;line-height:1.4}
.photo-import-quota-hint{font-size:.83rem;color:#ebc576;margin:.7rem 0 .2rem}
.photo-import-rights{padding:.8rem;border-radius:10px;background:#332e24;border:1px solid #766035;margin:.75rem 0 0}
.photo-import-rights[hidden]{display:none!important}
.photo-import-rights label{display:flex;align-items:flex-start;gap:.6rem;cursor:pointer;color:#eddfc5;font-size:.84rem;line-height:1.5}
.photo-import-rights input{accent-color:#f0bd3c;flex-shrink:0;margin-top:.18rem}
@media(max-width:600px){.photo-import-visibility-options{grid-template-columns:1fr}}

/* Après une analyse réussie, seul le résultat reste visible. Le formulaire masqué
   conserve ses valeurs nécessaires à la création sécurisée de la recette. */
.photo-import-heading[hidden],.photo-import-card[hidden]{display:none!important}
.photo-import-result-status{display:flex;align-items:center;gap:.7rem;flex-wrap:wrap}
.photo-import-result-heading{gap:1rem;flex-wrap:wrap}
.photo-import-result-heading>.photo-import-secondary{font-size:.82rem;padding:.65rem .85rem;letter-spacing:normal;white-space:nowrap}
@media(max-width:580px){.photo-import-result-heading>.photo-import-secondary{width:100%}}

/* Le diagnostic photo est une aide avant l'analyse IA, jamais un blocage. */
.photo-import-drop .photo-import-thumb-quality{display:block;max-width:150px;font-size:.72rem;line-height:1.3;font-weight:700;color:#e0c89c;overflow-wrap:anywhere}
.photo-import-drop .photo-import-thumb-quality--checking{color:#b9b1a1}
.photo-import-drop .photo-import-thumb-quality--ok{color:#88d6a3}
.photo-import-drop .photo-import-thumb-quality--warn{color:#f2c36b}
.photo-import-drop .photo-import-thumb-quality--poor{color:#ff9d91}
.photo-import-drop .photo-import-thumb-quality--unknown{color:#e0c89c}
.photo-import-thumb .photo-import-change{align-self:flex-start;border:1px solid #756344;background:#29261f;color:#f7d38c;border-radius:7px;padding:.2rem .45rem;font:inherit;font-size:.7rem;font-weight:700;cursor:pointer}
.photo-import-thumb .photo-import-change:hover{background:#4a3a22;border-color:#c2953b}
.photo-import-thumb .photo-import-change:disabled{opacity:.5;cursor:not-allowed}
.photo-import-thumb .photo-import-thumb-grip{bottom:.5rem;right:.5rem}
.photo-import-quality-warning{width:100%;box-sizing:border-box;background:#42331f;border:1px solid #987335;border-radius:12px;padding:.8rem 1rem;color:#f2ddb6;font-size:.85rem;line-height:1.5}
.photo-import-quality-warning[hidden]{display:none!important}
.photo-import-quality-warning strong{color:#ffd578}
.photo-import-quality-warning ul{padding-left:1.2rem;margin:.4rem 0}
.photo-import-quality-warning p{margin:.35rem 0 0;font-size:.8rem;color:#e2ccb1}

.photo-import-mode-tag { display: inline-flex; padding: .4rem .75rem; border-radius: 10px; border: 1px solid rgba(244,183,43,.3); background: rgba(244,183,43,.09); color: #ffe29b; font-weight: 800; }
.photo-import-tips { margin-top: 1rem; }
.photo-import-tips #photo-import-tips-text { margin-top: .75rem; }

.photo-import-mode-tag[hidden], .photo-import-tips[hidden] { display: none !important; }

/* Dialogue réutilisable Carnet Miam : une seule identité visuelle en SSR comme en Blazor. */
.cm-dialog {box-sizing:border-box;width:min(510px,calc(100vw - 2rem));max-width:none;max-height:min(92dvh,760px);overflow-y:auto;margin:auto;padding:0;border:1px solid #947239;border-radius:22px;background:#25231e;color:#f5ebd9;box-shadow:0 24px 90px #000b}
.cm-dialog:not([open]) {display:none!important}
.cm-dialog::backdrop {background:rgba(11,10,8,.78);backdrop-filter:blur(3px)}
.cm-dialog-inner {padding:clamp(1.2rem,3vw,2rem)}
.cm-dialog-icon {display:grid;place-items:center;width:48px;height:48px;border-radius:14px;color:#2e220d;background:#f2bf3e;font-size:1.6rem;margin-bottom:1rem}
.cm-dialog-kicker {margin:0 0 .6rem;color:#f6c34a;letter-spacing:.1em;font-size:.72rem;font-weight:800}
.cm-dialog h2 {font-family:Georgia,serif;color:#fff1d8;line-height:1.2;font-size:clamp(1.55rem,4vw,2rem);margin:0 0 .65rem}
.cm-dialog-description {margin:0 0 1.3rem;line-height:1.55;color:#d4c5ae}
.cm-dialog-actions {display:flex;justify-content:flex-end;gap:.7rem;flex-wrap:wrap;margin-top:1.15rem}
.cm-dialog-button[hidden] {display:none!important}
.cm-dialog-button {display:inline-flex;align-items:center;justify-content:center;min-height:43px;padding:.7rem 1.05rem;border-radius:11px;font:inherit;font-size:.88rem;font-weight:800;cursor:pointer}
.cm-dialog-button-secondary {border:1px solid #655b4a;background:transparent;color:#f2e6d1}
.cm-dialog-button-primary {border:1px solid #f2bf3e;background:#f2bf3e;color:#211a0e}
.cm-dialog-button-danger {border:1px solid #c65b5c;background:#a43b40;color:#fff7ef}
.cm-dialog-button-neutral {border:1px solid #655b4a;background:#39352e;color:#f2e6d1}
.cm-dialog-button:disabled {opacity:.55;cursor:wait}
.cm-dialog button:focus-visible {outline:3px solid #f5cc64;outline-offset:3px}
.cm-dialog-alerte {border-color:#ac5a56}
.cm-dialog-alerte .cm-dialog-icon {background:#d87371;color:#2e1312}
.cm-dialog-alerte .cm-dialog-kicker {color:#efa39a}
.cm-dialog-attention .cm-dialog-icon {background:#f2bf3e}
.cm-dialog-message .cm-dialog-icon {background:#c2b69a}
.cm-dialog-danger-details {padding:.95rem 1.05rem;border:1px solid #6d4540;border-radius:12px;background:#342825;color:#e4c8bf;line-height:1.55;font-size:.88rem}
@media(max-width:480px){.cm-dialog-actions{flex-direction:column-reverse}.cm-dialog-actions button{width:100%}}
@media(prefers-reduced-motion:reduce){.cm-dialog::backdrop{backdrop-filter:none}}

.cm-report-recipe { font-weight:700; margin-bottom:12px; }
.cm-report-label { display:block; margin:12px 0 5px; font-weight:700; }
#cm-recipe-report-dialog select,#cm-recipe-report-dialog textarea { width:100%; box-sizing:border-box; border:1px solid #c5b9a4; border-radius:6px; padding:9px; font:inherit; background:#fff; color:#302c24; }
.cm-report-notice { font-size:.85rem; line-height:1.5; margin-top:12px; }
.cm-report-validation { color:#ad3022; font-weight:700; }

/* La top layer d'un <dialog> est indispensable pour couvrir les confirmations déjà ouvertes. */
.cm-ai-processing-overlay {
    box-sizing: border-box;
    width: min(440px, calc(100vw - 2rem));
    max-width: none;
    max-height: calc(100dvh - 2rem);
    margin: auto;
    padding: 0;
    overflow: visible;
    border: 1px solid #c8993a;
    border-radius: 23px;
    background: linear-gradient(145deg, #332a1e 0%, #24221d 68%, #201e1a 100%);
    color: #fff1d5;
    box-shadow: 0 26px 85px #000b, 0 0 40px #efb63724, inset 0 1px #f6d37b44;
    text-align: center;
    animation: cm-ai-arrive .28s ease-out both;
}
.cm-ai-processing-overlay:not([open]) {display: none!important}
.cm-ai-processing-overlay::backdrop {
    background: rgba(9, 8, 6, .75);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    animation: cm-ai-backdrop-in .28s ease-out both;
}
.cm-ai-processing-overlay.is-closing {animation: cm-ai-depart .26s ease-in both}
.cm-ai-processing-overlay.is-closing::backdrop {animation: cm-ai-backdrop-out .26s ease-in both}
.cm-ai-processing-card {padding: clamp(1.35rem, 4vw, 2rem);}
.cm-ai-processing-icon {
    display: grid;
    place-items: center;
    width: 66px;
    height: 66px;
    margin: 0 auto 1rem;
    padding: 9px;
    border: 1px solid #ae8139;
    border-radius: 19px;
    background: linear-gradient(140deg,#5b4425,#29251d);
    box-shadow: 0 0 28px #f4b72b28;
    animation: cm-ai-breathe 2.6s ease-in-out infinite;
}
.cm-ai-processing-icon img {width: 100%;height: 100%;display: block}
.cm-ai-processing-kicker {margin: 0 0 .55rem;color: #f6c34a;font-size: .7rem;font-weight: 800;letter-spacing: .16em}
.cm-ai-processing-card h2 {font-family: Georgia,serif;font-weight: 700;font-size: clamp(1.4rem, 4.5vw, 1.9rem);line-height: 1.2;margin: 0 0 .8rem;color: #fff1d7}
.cm-ai-processing-detail {color:#e0cdb0;font-size:.93rem;line-height:1.5;margin:0 auto 1.5rem;max-width:350px}
.cm-ai-processing-track {position:relative;height:5px;margin:0 auto .75rem;max-width:350px;border-radius:50px;overflow:hidden;background:#54452f}
.cm-ai-processing-track span {position:absolute;top:0;bottom:0;left:-42%;width:42%;border-radius:50px;background:linear-gradient(90deg,#a97b28,#ffe089,#f4b72b);animation:cm-ai-track 1.9s ease-in-out infinite}
.cm-ai-processing-elapsed {font-size:.78rem;color:#c3af8a;margin:0;font-variant-numeric:tabular-nums}
@keyframes cm-ai-track {0%{left:-42%}100%{left:100%}}
@keyframes cm-ai-breathe {50%{box-shadow:0 0 36px #f4b72b60;transform:translateY(-2px)}}
@keyframes cm-ai-arrive {from{opacity:0;transform:translateY(12px) scale(.985)}to{opacity:1;transform:none}}
@keyframes cm-ai-depart {to{opacity:0;transform:translateY(8px) scale(.985)}}
@keyframes cm-ai-backdrop-in {from{background:rgba(9,8,6,0);-webkit-backdrop-filter:blur(0);backdrop-filter:blur(0)}}
@keyframes cm-ai-backdrop-out {to{background:rgba(9,8,6,0);-webkit-backdrop-filter:blur(0);backdrop-filter:blur(0)}}
@media(max-width:480px){.cm-ai-processing-card{padding:1.4rem 1.1rem}.cm-ai-processing-icon{width:58px;height:58px}}
@media(prefers-reduced-motion:reduce){
    .cm-ai-processing-overlay,.cm-ai-processing-overlay::backdrop,.cm-ai-processing-icon,.cm-ai-processing-track span {animation:none!important}
    .cm-ai-processing-overlay::backdrop {-webkit-backdrop-filter:none;backdrop-filter:none}
    .cm-ai-processing-track span {left:0;width:100%}
}

/* En-tête du choix principal : pictogramme officiel du site et titre or souligné. */
#cm-add-recipe-dialog .cm-add-dialog-heading {
    display:inline-flex;align-items:center;gap:.7rem;max-width:100%;vertical-align:middle;
}
#cm-add-recipe-dialog .cm-add-dialog-brand {
    width:52px;height:52px;flex:none;border-radius:14px;
    box-shadow:0 3px 12px #09070580;
}
#cm-add-recipe-dialog .cm-add-dialog-heading-copy {display:inline-block;white-space:normal;}
#cm-add-recipe-dialog .cm-add-dialog-heading-accent {
    position:relative;display:inline-block;color:#f5bc35;
}
#cm-add-recipe-dialog .cm-add-dialog-heading-accent::after {
    content:"";position:absolute;left:1%;right:0;bottom:-.17em;height:.12em;
    background:#f5bd35;border-radius:100%;transform:rotate(-3deg);
}
@media(max-width:480px){
    #cm-add-recipe-dialog .cm-add-dialog-heading{gap:.45rem;}
    #cm-add-recipe-dialog .cm-add-dialog-brand{width:38px;height:38px;border-radius:10px;}
    #cm-add-recipe-dialog .cm-dialog-inner>h2{font-size:1.48rem;line-height:1.12;}
}

/* Entrée principale de création : même CMDialog partagé, présentation vitrine compacte. */
#cm-add-recipe-dialog.cm-dialog {
    width: min(835px, calc(100vw - 2rem));
    max-height: min(92dvh, 780px);
    border-color: #c99a3e;
    background: radial-gradient(ellipse at 88% -15%, #61451f 0, transparent 48%),
                linear-gradient(145deg,#2c261d,#1e1b17 74%);
    box-shadow: 0 25px 95px #000c, 0 0 0 1px #f5c86325, inset 0 1px #f8cf7955;
}
#cm-add-recipe-dialog .cm-dialog-inner { padding: clamp(1rem, 2.3vw, 1.4rem); }
#cm-add-recipe-dialog .cm-dialog-icon { display:none; }
#cm-add-recipe-dialog .cm-dialog-kicker { display:none; }
#cm-add-recipe-dialog .cm-dialog-inner > h2 {
    color:#fff5de;font-size:clamp(1.5rem,2.45vw,2rem);
    letter-spacing:-.035em;margin:0 0 .2rem;
}
#cm-add-recipe-dialog .cm-dialog-description {
    margin-bottom:.9rem;color:#d9cbb2;font-size:.88rem;
}
#cm-add-recipe-dialog [hidden] { display:none !important; }
#cm-add-recipe-dialog .cm-dialog-actions {
    margin-top:.8rem;padding-top:.55rem;border-top:1px solid #e6b45b35;
}
#cm-add-recipe-dialog .cm-dialog-actions .cm-dialog-button-secondary {
    border-color:#8d795a;color:#ffe8c3;background:#2d281f;
}
#cm-add-recipe-dialog .cm-dialog-actions .cm-dialog-button-secondary:hover {background:#423522;border-color:#e8be65;}
.cm-add-entry { display:grid;gap:.72rem; }
.cm-add-choices { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.75rem; }
.cm-add-choice {
    position:relative;isolation:isolate;box-sizing:border-box;display:flex;min-width:0;min-height:188px;
    padding:.87rem .9rem;border:2px solid #fff5df;border-radius:18px;overflow:hidden;
    background:linear-gradient(115deg,#fffaf0 0%,#fff5e7 57%,#efdec5 100%);
    color:#1f222b;text-decoration:none;text-align:left;font:inherit;cursor:pointer;
    box-shadow:0 8px 19px #100b0780,inset 0 1px #fff;
    transition:transform .22s ease,box-shadow .22s ease,border-color .22s ease;
}
/* Le texte garde un fond lisible, même sur les photos très contrastées. */
.cm-add-choice::before {
    content:"";position:absolute;inset:0;z-index:1;pointer-events:none;
    background:linear-gradient(90deg,#fffaf0 0%,#fffaf0f7 39%,#fffaf0d9 53%,#fffaf000 79%);
}
.cm-add-choice:hover, .cm-add-choice:focus-visible {
    transform:translateY(-4px);border-color:#ffcd5c;
    box-shadow:0 14px 29px #060403a3,0 0 0 2px #ffbc3b52,inset 0 1px #fff;
}
.cm-add-choice:focus-visible { outline:3px solid #ffc94e;outline-offset:3px; }
.cm-add-choice-image {
    position:absolute;inset:0 0 0 auto;z-index:0;width:59%;height:100%;display:block;
    object-fit:cover;object-position:54% center;
    -webkit-mask-image:linear-gradient(to right,transparent 0%,#000 38%);
    mask-image:linear-gradient(to right,transparent 0%,#000 38%);
    transition:transform .45s ease;
}
.cm-add-choice:hover .cm-add-choice-image { transform:scale(1.055); }
.cm-add-choice--manual .cm-add-choice-image {object-position:57% center;}
.cm-add-choice--photo .cm-add-choice-image {object-position:56% center;}
.cm-add-choice--url .cm-add-choice-image {object-position:60% center;}
.cm-add-choice-copy {position:relative;z-index:1;display:flex;flex-direction:column;align-items:flex-start;min-height:155px;width:68%;}
.cm-add-choice-icon {display:grid;place-items:center;flex:0 0 35px;width:35px;height:35px;margin-bottom:.36rem;
    border-radius:11px;background:#ffe2a2;color:#8a5714;box-shadow:inset 0 1px #fff9;}
.cm-add-choice-icon svg {width:20px;height:20px;}
.cm-add-choice-icon--photo {color:#614b9a;background:#e9dcff;}
.cm-add-choice-icon--text {color:#266c78;background:#d7eef2;}
.cm-add-choice-icon--url {color:#457a43;background:#e1f1d6;}
.cm-add-choice strong {display:block;color:#191d2a;font-size:clamp(.96rem,1.34vw,1.08rem);
    font-weight:850;line-height:1.17;letter-spacing:-.028em;}
.cm-add-ai-tag {display:inline-block;vertical-align:2px;padding:.16rem .28rem;border-radius:5px;background:#e1d1b5;
    color:#684619;font-family:inherit;font-size:.63rem;line-height:1;font-weight:900;letter-spacing:.035em;}
.cm-add-choice small {display:block;max-width:250px;margin:.32rem 0 .5rem;color:#4a4850;
    font-size:.75rem;line-height:1.35;font-weight:500;}
.cm-add-choice-action {display:inline-flex;gap:.55rem;align-items:center;margin-top:auto;
    padding:.43rem .7rem;border-radius:30px;background:linear-gradient(115deg,#ffe49b,#f5bc43);
    color:#271c0d;font-size:.73rem;font-weight:850;white-space:nowrap;
    box-shadow:0 2px 10px #b1781738;transition:background .2s ease,transform .2s ease;}
.cm-add-choice-action>span {font-size:1.25rem;line-height:.7;}
.cm-add-choice:hover .cm-add-choice-action {background:linear-gradient(115deg,#ffeebc,#ffcb57);transform:translateX(2px);}
.cm-add-choice-admin {display:inline-block;margin:-.27rem 0 .4rem;padding:.19rem .38rem;border-radius:7px;
    background:#ffe8b5;color:#7b5118;font-size:.59rem;font-weight:850;white-space:nowrap;}
.cm-add-choice--url .cm-add-choice-copy {width:70%;}
.cm-add-footnote {display:flex;align-items:flex-start;gap:.6rem;grid-column:1/-1;
    color:#dfd2be;font-size:.75rem;line-height:1.4;margin:.1rem .15rem 0;}
.cm-add-footnote>span {font-size:1.12rem;color:#f6c761;line-height:1;}
/* Pour les membres, la troisième carte utilise toute la largeur plutôt que laisser un trou. */
.cm-add-choices:not(:has(.cm-add-choice--url)) .cm-add-choice--text {grid-column:1/-1;}
.cm-add-choices:not(:has(.cm-add-choice--url)) .cm-add-choice--text .cm-add-choice-copy {width:58%;}
.cm-add-choices:not(:has(.cm-add-choice--url)) .cm-add-choice--text .cm-add-choice-image {width:48%;}

/* Les vues texte/URL conservent leurs champs et leur fonctionnement dans la même modale. */
.cm-add-form { display:grid;gap:.7rem;max-width:720px;margin-inline:auto;width:100%;}
.cm-add-form h3 { margin:.2rem 0 .1rem;font-size:1.2rem;color:#f4dca8;font-family:Georgia,serif; }
.cm-add-form label { color:#f2e2c0;font-weight:750;font-size:.88rem; }
.cm-add-form textarea,.cm-add-form input[type="url"],.cm-add-form input[type="text"],.cm-add-form select {
    box-sizing:border-box;width:100%;min-height:43px;padding:.68rem .8rem;border-radius:11px;
    border:1px solid rgba(242,193,84,.34);background:#1d1d19;color:#fff0db;font:inherit; }
.cm-add-form textarea { resize:vertical;min-height:175px;line-height:1.55; }
.cm-add-form small { color:#bfb5a4;font-size:.78rem;line-height:1.5; }
.cm-add-back { justify-self:start;background:transparent;color:#f2c261;border:0;padding:.1rem 0;cursor:pointer;font:inherit;font-size:.81rem;font-weight:750; }
.cm-add-back:hover { text-decoration:underline; }
.cm-add-url-options { display:grid;gap:.7rem;border:1px solid rgba(242,193,84,.3);border-radius:12px;padding:.8rem;margin:0; }
.cm-add-url-options legend { color:#ffd16c;padding:0 .35rem;font-size:.85rem;font-weight:800; }
.cm-add-url-options label { display:flex;align-items:center;gap:.6rem;font-weight:550;cursor:pointer; }
.cm-add-url-options input,.cm-add-replace input { accent-color:#eeb63c; }
.cm-add-url-options select { width:calc(100% - 1.5rem);margin-left:1.5rem; }
.cm-add-price { color:#f7cf77;margin:.15rem 0;font-weight:750;font-size:.85rem; }
.cm-add-error { color:#ffb2a7;font-size:.85rem;line-height:1.55;margin:0; }
.cm-add-form-actions { display:flex;gap:.8rem;flex-wrap:wrap;align-items:center; }
.cm-add-form-actions span { color:#f7d088;font-size:.82rem; }
.cm-add-submit { cursor:pointer;border:1px solid #e7ad36;border-radius:11px;padding:.75rem 1.15rem;
    background:linear-gradient(125deg,#ffe07b,#edb22e);color:#291e0b;font:inherit;font-weight:850; }
.cm-add-submit:disabled { opacity:.48;cursor:not-allowed; }
.cm-add-replace { border:1px solid rgba(245,185,74,.4);padding:.85rem;border-radius:12px;background:rgba(145,95,15,.14); }
.cm-add-replace label { display:flex;align-items:flex-start;gap:.6rem;font-size:.83rem;line-height:1.5;color:#ffdc9c; }
@media(max-width:780px){
    #cm-add-recipe-dialog.cm-dialog {width:min(590px,calc(100vw - 1.25rem));}
    .cm-add-choices{grid-template-columns:1fr;gap:.72rem;}
    .cm-add-choice {min-height:164px;padding:.85rem 1rem;}
    .cm-add-choice-copy {width:65%;min-height:130px;}
    .cm-add-choices:not(:has(.cm-add-choice--url)) .cm-add-choice--text {grid-column:auto;}
    .cm-add-choices:not(:has(.cm-add-choice--url)) .cm-add-choice--text .cm-add-choice-copy {width:65%;}
    .cm-add-choices:not(:has(.cm-add-choice--url)) .cm-add-choice--text .cm-add-choice-image {width:61%;}
}
@media(max-width:480px){
    #cm-add-recipe-dialog.cm-dialog {width:calc(100vw - 1rem);}
    #cm-add-recipe-dialog .cm-dialog-inner {padding:1rem .9rem;}
    #cm-add-recipe-dialog .cm-dialog-description {font-size:.85rem;margin-bottom:.95rem;}
    .cm-add-choice {min-height:152px;padding:.75rem;border-radius:16px;}
    .cm-add-choice-copy {min-height:127px;}
    .cm-add-choice-icon {width:34px;height:34px;flex-basis:34px;border-radius:10px;margin-bottom:.35rem;}
    .cm-add-choice-icon svg {width:19px;height:19px;}
    .cm-add-choice strong {font-size:1rem;}
    .cm-add-choice small {font-size:.73rem;line-height:1.33;margin:.3rem 0 .55rem;}
    .cm-add-choice-action {font-size:.72rem;padding:.4rem .65rem;}
    .cm-add-choice-admin {font-size:.56rem;margin:-.12rem 0 .25rem;}
    .cm-add-footnote {font-size:.73rem;}
}
@media(prefers-reduced-motion:reduce){
    .cm-add-choice,.cm-add-choice-image,.cm-add-choice-action {transition:none!important;}
    .cm-add-choice:hover,.cm-add-choice:hover .cm-add-choice-image,.cm-add-choice:hover .cm-add-choice-action {transform:none!important;}
}

/* Composant commun : classique, mini et image/titre. Applicable au SSR et aux cartes d'historique HTTP. */
.cm-recipe-card { position:relative; display:flex; flex-direction:column; min-width:0; height:100%; overflow:hidden; border:1px solid rgba(255,214,100,.12); border-radius:21px; background:#24231e; color:#fff7e5; box-shadow:0 13px 30px rgba(0,0,0,.13); transition:transform .16s ease,border-color .16s ease; }
.cm-recipe-card:hover { transform:translateY(-2px); border-color:rgba(244,183,43,.4); }
.cm-recipe-card:focus-within { border-color:rgba(244,183,43,.55); }

/* Le proprietaire distingue ses propres recettes masquees, sans changer leur place ni leurs actions. */
.cm-recipe-card.cm-recipe-card--admin-withdrawn {
    border:2px solid rgba(198,73,75,.78);
    background:linear-gradient(160deg,rgba(127,38,43,.10),rgba(127,38,43,.035)),#24231e;
    box-shadow:0 0 0 1px rgba(198,73,75,.12),0 13px 30px rgba(0,0,0,.16);
}
.cm-recipe-card.cm-recipe-card--admin-pending {
    border:2px solid rgba(205,149,57,.78);
    background:linear-gradient(160deg,rgba(139,96,28,.09),rgba(139,96,28,.025)),#24231e;
    box-shadow:0 0 0 1px rgba(205,149,57,.11),0 13px 30px rgba(0,0,0,.16);
}
.cm-recipe-card--admin-withdrawn .cm-recipe-card-image { opacity:.87; filter:saturate(.82); }
.cm-recipe-card--admin-pending .cm-recipe-card-image { opacity:.91; filter:saturate(.91); }
.cm-recipe-card.cm-recipe-card--admin-withdrawn:hover,
.cm-recipe-card.cm-recipe-card--admin-withdrawn:focus-within { border-color:#e77577; }
.cm-recipe-card.cm-recipe-card--admin-pending:hover,
.cm-recipe-card.cm-recipe-card--admin-pending:focus-within { border-color:#edb95f; }

.cm-recipe-card-photo { position:relative; flex:0 0 auto; height:205px; display:grid; place-items:center; background-color:#302e27; background-position:center; background-size:cover; background-repeat:no-repeat; }
.cm-recipe-card-image { position:absolute; inset:0; width:100%; height:100%; display:block; object-fit:cover; }
.cm-recipe-card-photo-link { position:absolute; inset:0; z-index:1; }
/* Sur les grandes cartes, la photo est libre : provenance et appareil occupent une ligne dediee.
   Une ligne de hauteur constante reste presente meme lorsqu'aucun badge n'est renseigne. */
.cm-recipe-card-photo-link:focus-visible,.cm-recipe-card-body h3 a:focus-visible { outline:2px solid #f4b72b; outline-offset:-3px; }
.cm-recipe-card-placeholder { font-size:2.6rem; color:#a58c57; }
.cm-recipe-card-badge { position:absolute; z-index:2; top:.75rem; left:.75rem; max-width:calc(100% - 3.9rem); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; padding:.35rem .65rem; border-radius:999px; background:rgba(22,21,18,.89); color:#ffe08a; font-size:.72rem; font-weight:800; }
.cm-recipe-card-badge.private { color:#b8d1ff; }
.cm-recipe-card-badge.archived,.cm-recipe-card-badge.draft { color:#ddd2c2; }
.cm-recipe-card-overlay { position:absolute; z-index:4; top:.7rem; right:.7rem; }

.cm-recipe-card-body { display:flex; flex:1; flex-direction:column; min-width:0; gap:.55rem; padding:1rem; }
.cm-recipe-card-body h3 { margin:0; color:#fff7e5; font:700 1.39rem/1.09 Georgia,'Times New Roman',serif; letter-spacing:-.035em; overflow-wrap:anywhere; }
.cm-recipe-card-body h3 a { color:inherit; text-decoration:none; }
.cm-recipe-card-body h3 a:hover { color:#ffcf66; }
.cm-recipe-card-topline { display:flex; justify-content:space-between; align-items:baseline; flex-wrap:wrap; gap:.3rem .6rem; color:#9f998b; font-size:.75rem; }
.cm-recipe-card-date { margin-left:auto; text-align:right; }
.cm-recipe-card-category-button { display:inline-block; min-width:0; max-width:100%; padding:0; margin:0; border:0; border-radius:3px; background:transparent; color:inherit; font:inherit; text-align:left; cursor:pointer; }
.cm-recipe-card-category-button:hover { color:#f4b72b; text-decoration:underline; text-underline-offset:3px; }
.cm-recipe-card-category-button:focus-visible { outline:2px solid #f4b72b; outline-offset:3px; }
.cm-recipe-category-choices { display:grid; grid-template-columns:repeat(auto-fit,minmax(145px,1fr)); gap:.55rem; max-height:min(50vh,420px); overflow-y:auto; margin:.35rem 0 .55rem; }
.cm-recipe-category-choice { padding:.75rem .8rem; border:1px solid rgba(244,183,43,.32); border-radius:10px; background:#28251f; color:#f6e5c4; text-align:left; font:600 .9rem system-ui,sans-serif; cursor:pointer; }
.cm-recipe-category-choice:hover,.cm-recipe-category-choice:focus-visible { background:#40331c; border-color:#f4b72b; outline:none; }
.cm-recipe-card-author { display:flex; align-items:center; gap:.45rem; color:#b1aa9e; font-size:.8rem; }
.cm-recipe-card-author img { width:27px; height:27px; object-fit:cover; border:1px solid rgba(244,183,43,.22); border-radius:8px; }
.cm-recipe-card-author strong { color:#e8dfd0; }
.cm-recipe-card-body p { margin:0; color:#b4ad9f; line-height:1.55; font-size:.91rem; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; }
/* Toutes les étiquettes des cartes classiques ont exactement la même géométrie. */
.cm-recipe-card--classique .cm-recipe-card-meta { display:flex; align-items:flex-start; align-content:flex-start; flex-wrap:wrap; gap:6px; margin-top:auto; padding-top:.35rem; min-width:0; }
.cm-recipe-card--classique .cm-recipe-card-tag {
    display:inline-flex; align-items:center; justify-content:center; gap:4px; box-sizing:border-box;
    max-width:100%; min-width:0; min-height:24px; height:24px; padding:0 8px;
    border:1px solid rgba(255,255,255,.12); border-radius:6px;
    background:rgba(255,255,255,.055); color:#d3c9b9;
    font:650 11px/1 system-ui,sans-serif; letter-spacing:0; white-space:nowrap;
    text-decoration:none; vertical-align:middle;
}
.cm-recipe-card--classique .cm-recipe-card-tag [data-cm-badge-label] { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cm-recipe-card--classique .cm-recipe-card-tag-glyph { flex:0 0 auto; font-size:12px; line-height:1; }
.cm-recipe-card--classique .cm-recipe-card-tag[hidden] { display:none!important; }
.cm-recipe-card--classique .cm-recipe-card-tag--pending {
    border-color:rgba(241,179,67,.63);
    background:rgba(125,88,22,.30);
    color:#ffe3aa;
}
.cm-recipe-card--classique .cm-recipe-card-tag--withdrawn {
    border-color:rgba(236,105,113,.73);
    background:rgba(143,39,51,.36);
    color:#ffdadd;
}
.cm-recipe-card--classique a.cm-recipe-card-tag--withdrawn:hover,
.cm-recipe-card--classique a.cm-recipe-card-tag--withdrawn:focus-visible {
    border-color:#f08d95;
    background:rgba(162,47,60,.52);
    outline-offset:2px;
}
.cm-recipe-card--classique .cm-recipe-card-tag--mode { border-color:rgba(255,214,100,.24); background:rgba(255,214,100,.07); color:#e4cf9f; }
.cm-recipe-card--classique .cm-recipe-card-tag--calories { border-color:var(--cm-ai-border,#b98ad1); background:var(--cm-ai-soft,rgba(98,52,124,.35)); color:var(--cm-ai-ink,#faf1ff); }
.cm-recipe-card--classique button.cm-recipe-card-tag--editable { cursor:pointer; }
.cm-recipe-card--classique button.cm-recipe-card-tag--editable:hover,
.cm-recipe-card--classique button.cm-recipe-card-tag--editable:focus-visible {
    filter:brightness(1.23); outline:2px solid #f4b72b; outline-offset:2px;
}
.cm-recipe-card--classique button.cm-recipe-card-tag--editable[aria-busy="true"] { opacity:.65; cursor:wait; }
.cm-card-mode-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; border:0; margin:0; padding:0; }
.cm-card-mode-legend { width:100%; margin-bottom:10px; font-size:.8rem; color:#dfc98d; }
.cm-card-mode-choice { display:flex; align-items:center; gap:10px; min-height:48px; padding:9px 12px; border:1px solid #514a3e; border-radius:9px; cursor:pointer; }
.cm-card-mode-choice:has(input:checked) { border-color:#edba44; background:rgba(224,175,67,.11); }
.cm-card-mode-choice input { accent-color:#edba44; }
@media(max-width:520px) { .cm-card-mode-options { grid-template-columns:1fr; } }
.cm-recipe-card--mini { flex-direction:row; min-height:106px; }
.cm-recipe-card--mini .cm-recipe-card-photo { width:120px; height:auto; min-height:105px; }
.cm-recipe-card--mini .cm-recipe-card-body { justify-content:center; padding:.75rem; }
.cm-recipe-card--mini .cm-recipe-card-body h3 { font:700 1rem/1.22 system-ui, sans-serif; letter-spacing:0; }
.cm-recipe-card-mini-author { color:#a9a294; font-size:.79rem; }
.cm-recipe-card--imagetitre { border-radius:15px; box-shadow:none; }
.cm-recipe-card--imagetitre .cm-recipe-card-photo { height:112px; }
.cm-recipe-card--imagetitre .cm-recipe-card-body { justify-content:center; padding:.65rem .75rem .8rem; min-height:54px; }
.cm-recipe-card--imagetitre .cm-recipe-card-body h3 { font:700 .94rem/1.25 system-ui,sans-serif; letter-spacing:0; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.cm-recent-strip { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(155px,calc((100% - 5rem)/6)); gap:.8rem; overflow-x:auto; padding:.1rem .1rem .85rem; scroll-snap-type:x proximity; scrollbar-color:#77613b transparent; scrollbar-width:thin; }
.cm-recent-strip > * { scroll-snap-align:start; min-width:0; }
.cm-recent-strip .cm-recipe-card { height:100%; }
@media(max-width:1050px){.cm-recent-strip { grid-auto-columns:minmax(155px,calc((100% - 2.4rem)/4)); }}
@media(max-width:700px){.cm-recent-strip { grid-auto-columns:minmax(160px,48%); gap:.65rem; }.cm-recipe-card--imagetitre .cm-recipe-card-photo{height:105px}.cm-recipe-card--mini .cm-recipe-card-photo{width:96px}.cm-recipe-card-photo{height:190px} }
@media(max-width:420px){.cm-recent-strip { grid-auto-columns:minmax(145px,75%); }}

.cm-recipe-card--notebook .cm-recipe-card-photo { border-radius:20px 20px 0 0; }
.cm-recipe-card--mini .cm-recipe-card-body { padding-right:3.2rem; }
.cm-recipe-card-mini-time { color:#938b7d; font-size:.74rem; }
.cm-recipe-card--mini .cm-recipe-card-overlay { top:.55rem; right:.55rem; }
.cm-recipe-card--mini .cm-recipe-card-overlay .recipe-album-button.compact { width:36px; height:36px; }

.cm-recipe-card-private-label { position:absolute; z-index:2; top:.5rem; left:.5rem; padding:.25rem .5rem; border-radius:20px; background:rgba(20,19,18,.88); color:#d3e1ff; font-size:.68rem; font-weight:750; }

/* Le badge de visibilité est identique dans toutes les variantes ; seul le propriétaire peut agir. */
.cm-recipe-visibility { position:absolute; z-index:3; left:.65rem; top:.65rem; display:inline-flex; align-items:center; gap:.28rem; max-width:calc(100% - 1.3rem); padding:.32rem .55rem; border:1px solid rgba(245,190,64,.24); border-radius:999px; background:rgba(18,17,15,.91); color:#f9d57f; font:750 .73rem/1.1 system-ui,sans-serif; white-space:nowrap; }
.cm-recipe-visibility--private { color:#d4e1ff; border-color:rgba(165,194,244,.25); }
button.cm-recipe-visibility--editable { cursor:pointer; border-color:#ac8433; }
button.cm-recipe-visibility--editable:hover,button.cm-recipe-visibility--editable:focus-visible { color:white; border-color:#ffcf67; background:#42351e; outline:2px solid transparent; }
.cm-recipe-visibility-chevron { margin-left:.12rem; color:#f5bf4c; }
.cm-recipe-card-badge { top:2.72rem; }
.cm-recipe-card--imagetitre .cm-recipe-visibility,.cm-recipe-card--mini .cm-recipe-visibility { font-size:.65rem; padding:.24rem .4rem; }
.cm-recipe-card--mini .cm-recipe-card-photo .cm-recipe-visibility { left:.4rem; top:.4rem; }
.cm-visibility-rights[hidden] { display:none!important; }
.cm-visibility-rights { padding:1rem; border:1px solid #76552a; border-radius:12px; background:#352c1e; color:#f5e1c4; font-size:.88rem; line-height:1.5; }
.cm-visibility-rights label { display:flex; align-items:start; gap:.6rem; cursor:pointer; }
.cm-visibility-rights input { flex:0 0 auto; margin-top:.3rem; accent-color:#f4b72b; }

/* Sur la fiche complète le badge fait partie de la barre d’actions, pas de la photographie. */
.detail-toolbar-actions .cm-recipe-visibility { position:static; max-width:none; min-height:48px; align-self:center; padding:.4rem .65rem; }

/* Variantes de cartes : les petites cartes ne laissent apparaître que le pictogramme. */
.cm-recipe-visibility--compact { gap:0; min-width:30px; min-height:30px; justify-content:center; padding:.3rem; }
.cm-recipe-visibility--compact .cm-recipe-visibility-text,
.cm-recipe-visibility--compact .cm-recipe-visibility-chevron { display:none; }
.cm-recipe-card--mini .cm-recipe-visibility--compact,
.cm-recipe-card--imagetitre .cm-recipe-visibility--compact { left:.5rem; top:.5rem; font-size:.8rem; }


/* Carte classique : image dégagée, puis actions lisibles sous la photographie. */
.cm-recipe-card-tools { display:flex; align-items:stretch; min-width:0; min-height:48px; border-bottom:1px solid rgba(255,214,100,.13); }
.cm-recipe-card-tools > * { display:flex; align-items:center; justify-content:center; min-width:0; padding:.35rem .5rem; }
.cm-recipe-card-tools > * + * { border-left:1px solid rgba(255,214,100,.13); }
.cm-recipe-card-tools-author { flex:0 0 40px; padding:.25rem .3rem; }
.cm-recipe-card-tools-visibility { flex:0 0 40px; padding:.25rem .2rem; }
.cm-recipe-card-tools-album { flex:0 0 40px; padding:.25rem .2rem; }
.cm-recipe-card-tools-edit { flex:0 0 40px; padding:.25rem .2rem; }
.cm-recipe-card-tools-delete { flex:0 0 42px; padding:.25rem .2rem; margin-left:auto; border-left:1px solid rgba(255,214,100,.13); }
.cm-recipe-card-tools-delete form { display:flex; margin:0; }
.cm-recipe-card--classique .cm-recipe-card-tools .cm-recipe-visibility { position:static; max-width:100%; min-height:32px; padding:.28rem .55rem; font-size:.72rem; }
/* La visibilité utilise une tuile de même taille que les autres actions, sans libellé. */
.cm-recipe-card--classique .cm-recipe-card-tools .cm-recipe-visibility--toolbar-icon { display:grid; place-items:center; width:36px; min-width:36px; height:36px; min-height:36px; padding:0; border-radius:9px; color:#f4b72b; }
.cm-recipe-card--classique .cm-recipe-card-tools .cm-recipe-visibility--toolbar-icon.cm-recipe-visibility--private { color:#d4e1ff; }
.cm-recipe-visibility--toolbar-icon .cm-recipe-visibility-toolbar-glyph { display:grid; place-items:center; width:19px; height:19px; }
.cm-recipe-visibility--toolbar-icon svg { display:block; width:19px; height:19px; }
.cm-recipe-visibility--toolbar-icon .cm-recipe-visibility-icon--private,
.cm-recipe-visibility--toolbar-icon.cm-recipe-visibility--private .cm-recipe-visibility-icon--public { display:none; }
.cm-recipe-visibility--toolbar-icon.cm-recipe-visibility--private .cm-recipe-visibility-icon--private { display:block; }
.cm-recipe-card-tools .cm-recipe-card-author { display:flex; align-items:center; justify-content:center; width:30px; height:34px; color:#e8dfd0; text-decoration:none; }
.cm-recipe-card-tools .cm-recipe-card-author img { display:block; width:26px; height:26px; object-fit:cover; border-radius:8px; }
.cm-recipe-card-author-placeholder { line-height:1; font-size:1.15rem; }
.cm-recipe-card-tools-edit .cm-recipe-card-edit-action { color:#f4b72b; }
.cm-recipe-card-tools-delete .cm-recipe-card-delete-action { color:#e6a29a; }
.cm-recipe-card-tools-delete .cm-recipe-card-delete-action:hover { color:#ffb1a7; }
.cm-recipe-card-tools-edit .cm-recipe-card-edit-action svg,
.cm-recipe-card-tools-delete .cm-recipe-card-delete-action svg { display:block; width:19px; height:19px; }
.cm-recipe-card-tools a.cm-recipe-card-author:hover { color:#ffcf66; }
.cm-recipe-card-status { align-self:flex-start; border-radius:99px; padding:.24rem .55rem; background:rgba(255,255,255,.06); color:#d3c9b9; font-size:.71rem; font-weight:750; }
.cm-recipe-card-status.archived,.cm-recipe-card-status.draft { color:#ddd2c2; }
.cm-recipe-card--classique .cm-recipe-card-body { padding:1rem; }
@media(max-width:420px) {
  .cm-recipe-card-tools > * { padding:.25rem .3rem; }
  .cm-recipe-card-tools-author { flex-basis:38px; }
  .cm-recipe-card-tools-album,.cm-recipe-card-tools-edit { flex-basis:38px; }
  .cm-recipe-card-tools-delete { flex-basis:40px; }
}

/* Validation asynchrone de la visibilité : empêcher un second clic sur le badge pendant le POST. */
button.cm-recipe-visibility[aria-busy="true"] { opacity:.65; cursor:progress; }

/* Signalement discret : uniquement dans la barre des cartes classiques. */
.cm-recipe-card-tools-report { flex:0 0 38px; padding:.25rem .1rem; }
.cm-recipe-card-report-action { color:#ec916e; }
.cm-recipe-card-report-action:hover,.cm-recipe-card-report-action:focus-visible { color:#ffb28f; }
.cm-recipe-card-report-action svg { width:20px; height:20px; }

.recipe-album-button {
    display:inline-flex;align-items:center;justify-content:center;gap:.5rem;cursor:pointer;
    font:inherit;font-weight:750;text-decoration:none;color:#f4b72b;
    border:1px solid rgba(244,183,43,.42);background:#252117;border-radius:12px;
    transition:background 150ms ease,border-color 150ms ease,transform 150ms ease;
}
.recipe-album-button:hover { background:#44351d;color:#ffd873;transform:translateY(-1px); }
.recipe-album-button.full { min-height:42px;padding:0 .85rem; }
.recipe-album-button.compact { position:absolute;z-index:4;top:.75rem;right:.75rem;
    width:44px;height:44px;border-radius:50%;padding:0;backdrop-filter:blur(6px); }
.recipe-album-button.compact.dense {top:.55rem;right:.55rem;width:38px;height:38px;}
.recipe-album-button .album-glyph {width:23px;height:23px;flex:none;}
.recipe-album-button.is-in-album {background:#f4b72b;color:#242017;border-color:#f4b72b;}
.recipe-album-button.is-in-album .album-glyph {fill:rgba(244,183,43,.30);}
.recipe-album-button.is-in-album:hover {background:#ffcd5c;color:#231c10;}
.recipe-album-button.action-tile { width:82px;min-height:82px;flex-direction:column;border-radius:14px;
    padding:.5rem .25rem;font-size:.77rem;text-align:center;line-height:1.2; }
.recipe-album-button.action-tile .album-glyph {width:27px;height:27px;}
.cm-recipe-card--classique .cm-recipe-card-tools .recipe-album-button.compact {
    position:static;inset:auto;box-shadow:none;backdrop-filter:none;
}
.cm-recipe-card--classique .cm-recipe-card-tools .recipe-album-button.compact.is-in-album {color:#f5c65c;}
.cm-recipe-card-overlay .recipe-album-button.compact {position:relative;inset:auto;}
#cm-album-choices-dialog {width:min(600px,calc(100vw - 1.25rem));}
.cm-album-dialog-list {display:grid;gap:.9rem;max-height:min(43dvh,440px);overflow-y:auto;
    overscroll-behavior:contain;scrollbar-gutter:stable;margin:.75rem 0;padding-right:.3rem;}
.cm-album-dialog-shelf {display:grid;gap:.45rem;min-width:0;}
.cm-album-dialog-shelf-heading {display:flex;align-items:center;
    gap:.5rem;padding:.55rem .75rem;border-left:3px solid #f4b72b;
    border-bottom:1px solid #765a2f;border-radius:6px 6px 0 0;background:rgba(244,183,43,.07);color:#ffda82;}
.cm-album-dialog-shelf-heading strong {font:750 1.16rem Georgia,serif;overflow-wrap:anywhere;}
.cm-album-dialog-choice {display:flex;align-items:center;gap:.75rem;min-height:64px;padding:.4rem .7rem;
    border:1px solid #4a4439;border-radius:12px;text-align:left;cursor:pointer;min-width:0;}
.cm-album-dialog-choice:hover {background:#302b22;border-color:#897043;}
.cm-album-dialog-choice:has(input:checked) {border-color:#e5ae42;background:#343021;}
.cm-album-dialog-choice input {width:19px;height:19px;flex:0 0 19px;margin:0;accent-color:#dfa733;}
.cm-album-dialog-cover {display:grid;place-items:center;flex:0 0 46px;width:46px;height:54px;
    border:1px solid #796247;border-radius:6px;background:#403328;color:#bda172;overflow:hidden;font-size:1.35rem;}
.cm-album-dialog-cover img {width:100%;height:100%;object-fit:contain;display:block;}
.cm-album-dialog-choice-title {flex:1;min-width:0;overflow-wrap:anywhere;font-size:.9rem;line-height:1.3;}
@media(max-width:480px) {
    #cm-album-choices-dialog .cm-dialog-inner {padding:1rem;}
    .cm-album-dialog-list {max-height:39dvh;}
    .cm-album-dialog-cover {flex-basis:42px;width:42px;height:50px;}
    .cm-album-dialog-choice {gap:.55rem;padding:.35rem .5rem;}
}
.cm-album-dialog-empty,.cm-album-dialog-error {color:#dfd2b8;font-size:.95rem;}
.cm-album-dialog-error {color:#ff9c82;}

.albums-index,.album-page{width:min(100%,1180px);margin:0 auto;padding:1.7rem 0 4rem;color:#f5ecda}
.albums-header,.album-recipes-heading{display:flex;align-items:center;justify-content:space-between;gap:1.5rem;flex-wrap:wrap;margin-bottom:2rem}
.album-primary-action,.album-add-link,.album-edit-actions button {display:inline-flex;justify-content:center;align-items:center;gap:.45rem;border:0;border-radius:12px;background:#f4b72b;color:#292015;font-weight:800;text-decoration:none;padding:.8rem 1.2rem;cursor:pointer}
.album-primary-action:hover,.album-add-link:hover,.album-edit-actions button:hover{background:#ffd06a;color:#292015}
.album-library{display:grid;grid-template-columns:repeat(auto-fill,minmax(188px,1fr));gap:2.3rem 1.8rem;padding:1rem 0 2.6rem;background:repeating-linear-gradient(to bottom,transparent 0,transparent 344px,rgba(121,72,34,.3) 345px,rgba(67,43,26,.55) 350px,transparent 353px)}
.album-book{display:block;text-decoration:none;color:inherit;min-width:0;transition:transform .2s ease}
.album-book:hover,.album-book:focus-visible{transform:translateY(-5px)}
.album-book-cover{position:relative;isolation:isolate;aspect-ratio:2/3;overflow:hidden;margin:0 8px;border:1px solid rgba(255,221,149,.3);border-left:13px solid #59402b;border-radius:4px 8px 8px 4px;background:linear-gradient(145deg,#4d382d,#221f20 60%,#4c351f);box-shadow:8px 12px 14px rgba(0,0,0,.4),inset 3px 0 7px rgba(255,240,177,.16)}
.album-book-cover:after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,rgba(0,0,0,.25),transparent 12%,transparent 92%,rgba(0,0,0,.12));z-index:1;pointer-events:none}
.album-book-cover img{width:100%;height:100%;object-fit:cover}
.album-book-placeholder{position:absolute;inset:0;display:grid;place-items:center;color:#d9b778;font-family:Georgia,serif;font-size:5rem;opacity:.45}
.album-book-caption{padding:.8rem .4rem;display:grid;gap:.25rem;min-width:0}
.album-book-caption strong{font:700 1.05rem Georgia,serif;overflow-wrap:anywhere}
.album-book-caption small{color:#bdb3a2}
.album-empty-shelf,.album-empty-recipes{padding:3rem 1.5rem;border:1px dashed #6a583d;border-radius:20px;background:rgba(41,36,28,.63);text-align:center}
.album-empty-illustration{font-size:4rem;color:#d8ae5b}
.album-empty-shelf h2{font:700 1.55rem Georgia,serif}
.album-empty-shelf p,.album-empty-recipes{color:#bcb2a4}
.album-empty-shelf .album-primary-action{margin-top:1rem}
.album-back-link{display:inline-block;margin-bottom:1.2rem;color:#f6c65d;text-decoration:none}
.album-detail-hero{display:flex;align-items:flex-start;gap:2.5rem;padding:1.4rem;border-radius:22px;background:linear-gradient(135deg,#393025,#21201b);border:1px solid #554638;margin-bottom:2.5rem}
.album-detail-cover{width:175px;aspect-ratio:2/3;flex:none;overflow:hidden;display:grid;place-items:center;background:#483625;border-left:10px solid #7d5631;box-shadow:8px 9px 18px #1118;border-radius:6px}
.album-detail-cover img{width:100%;height:100%;object-fit:cover}
.album-detail-cover span{font-size:5rem;color:#dcbe85;opacity:.5}
.album-detail-copy{flex:1;min-width:0}
.album-kicker{font-size:.76rem;font-weight:800;color:#e7b552;letter-spacing:.14em}
.album-detail-copy h1,.album-edit-form h1{margin:.45rem 0 1rem;font:700 clamp(1.8rem,4vw,2.7rem) Georgia,'Times New Roman',serif;overflow-wrap:anywhere}
.album-detail-copy p{color:#dbd0bf;line-height:1.6;white-space:pre-wrap}
.album-detail-copy small{color:#cabd9f}
.album-detail-actions{display:flex;flex-wrap:wrap;gap:.65rem;margin-top:1.45rem}
.album-detail-actions button{padding:.65rem .85rem;border:1px solid #6d604b;border-radius:10px;background:#312b22;color:#f8e9d0;cursor:pointer;font:inherit}
.album-detail-actions button:hover{border-color:#e7b552;background:#463826}
.album-detail-actions .album-danger-action{color:#ffb4a3}
.album-edit-form{margin:0 0 2rem;padding:1.8rem;border:1px solid #63513c;border-radius:18px;background:#2e2922;display:grid;gap:.8rem}
.album-edit-form[hidden]{display:none}
.album-edit-form label{font-weight:700;color:#ead4a8}
.album-edit-form input:not([type=hidden]),.album-edit-form select,.album-edit-form textarea{width:100%;font:inherit;color:#f9efe0;background:#1e1d1a;border:1px solid #635844;border-radius:10px;padding:.7rem .8rem}
.album-edit-form input[type=file]{cursor:pointer}
.album-shelf-picker{display:flex;align-items:stretch;gap:.65rem;min-width:0}
.album-edit-form .album-shelf-picker select{flex:1 1 auto;min-width:0;width:auto}
.album-shelf-new-action{flex:none;white-space:nowrap;border:1px solid #97733a;border-radius:10px;padding:.65rem .9rem;background:#31281d;color:#f6d18c;font:inherit;font-weight:750;cursor:pointer}
.album-shelf-new-action:hover{border-color:#f4b72b;background:#493721}
.album-shelf-new-action:disabled{opacity:.6;cursor:wait}
.album-shelf-dialog-field{display:grid;gap:.5rem}
.album-shelf-dialog-field label{font-weight:700;color:#ead4a8}
.album-shelf-dialog-field input{width:100%;min-width:0;box-sizing:border-box;font:inherit;color:#f9efe0;background:#1e1d1a;border:1px solid #806c4f;border-radius:10px;padding:.75rem .85rem}
.album-shelf-dialog-field input:focus-visible{outline:2px solid #f4b72b;outline-offset:2px}
.album-shelf-dialog-field [role=alert]{margin:.1rem 0 0;color:#ffb4a3;font-size:.86rem}
.album-shelf-dialog-field [hidden]{display:none}
@media(max-width:600px){.album-shelf-picker{flex-wrap:wrap}.album-shelf-picker select{min-width:170px!important}.album-shelf-new-action{flex:1 1 auto}}

.album-help{font-size:.86rem;color:#b6aca0;margin:0}
.album-edit-actions{display:flex;align-items:center;justify-content:flex-end;gap:1rem;margin-top:.7rem}
.album-edit-actions a{color:#f3d499}
.album-recipes-heading{margin:0 0 1.25rem}
.album-recipes-heading h2{font:700 1.8rem Georgia,serif;margin:.3rem 0}
.album-recipe-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(245px,100%),1fr));gap:1.2rem;align-items:start}
.album-recipe-tile{position:relative;min-width:0}
.album-recipe-reorder-tools{display:flex;position:absolute;top:.45rem;left:.45rem;right:.45rem;z-index:6;align-items:center;justify-content:space-between;pointer-events:none}
.album-recipe-reorder-tools button{pointer-events:auto;border:1px solid #ae925b;border-radius:8px;background:#28231e;color:#ffd46e;min-width:36px;min-height:36px;cursor:pointer;font-size:1.45rem}
.album-recipe-tile.album-moving{opacity:.6;outline:2px dashed #edb74c;border-radius:12px}
.album-recipe-handle{touch-action:none;user-select:none}
.album-order-feedback{min-height:1.4rem;color:#f2cf83;font-size:.85rem}
.album-visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
@media(max-width:650px){.album-library{grid-template-columns:repeat(2,minmax(0,1fr));gap:1.5rem .9rem}.album-detail-hero{gap:1rem}.album-detail-cover{width:105px}.album-detail-copy h1{font-size:1.55rem}.album-detail-actions{gap:.4rem}.album-detail-actions button{font-size:.85rem}.albums-index,.album-page{padding-top:1rem}}

.album-detail-hero[hidden], .album-edit-form[hidden], .album-cover-preview[hidden] {display:none}
.album-cover-preview{width:140px;aspect-ratio:2/3;object-fit:cover;border:1px solid #66533d;border-radius:8px}
.album-form-error{color:#ffb7a5;font-weight:650}
.album-form-error[hidden]{display:none}

/* Carte photo des albums : même langage visuel que l'éditeur de recettes, couverture verticale 2:3. */
.album-cover-editor{display:grid;gap:.8rem;margin-top:.35rem}
.album-cover-editor>label{font-weight:750;color:#ead4a8}
.album-cover-dropzone,.album-cover-photo-card{width:min(100%,370px)}
.album-cover-dropzone{aspect-ratio:2/3;border:2px dashed rgba(244,183,43,.38);border-radius:17px;background:#1d1d19}
.album-cover-dropzone[hidden],.album-cover-photo-card[hidden]{display:none}
.album-cover-dropzone-button{width:100%;height:100%;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:.65rem;border:0;background:none;color:#f5ecdf;font:inherit;cursor:pointer;padding:1.6rem;text-align:center}
.album-cover-dropzone-button>span:not(.album-cover-plus){color:#bcb3a5}
.album-cover-dropzone-button small{color:#8e877b}
.album-cover-plus{display:grid;place-items:center;width:52px;height:52px;border-radius:50%;background:rgba(244,183,43,.12);color:#f4b72b;font-size:2rem;margin-bottom:.2rem}
.album-cover-dropzone:hover{border-color:#f4b72b;background:#25221b}
.album-cover-photo-card{min-width:0;overflow:hidden;border:1px solid rgba(244,183,43,.38);border-radius:14px;background:rgba(0,0,0,.13)}
.album-cover-photo-preview{position:relative;aspect-ratio:2/3;overflow:hidden;background:#181713}
.album-cover-change-image{width:100%;height:100%;padding:0;border:0;background:none;cursor:pointer;display:block;position:relative}
.album-cover-change-image img{width:100%;height:100%;object-fit:cover;display:block}
.album-cover-change-image span{position:absolute;bottom:0;left:0;right:0;background:linear-gradient(transparent,#000b);padding:2rem .7rem .7rem;color:#fff2d6;font-weight:750;opacity:0;transition:opacity .2s}
.album-cover-change-image:hover span,.album-cover-change-image:focus-visible span{opacity:1}
.album-cover-photo-preview .main-photo-badge{position:absolute;top:.55rem;left:.55rem;padding:.28rem .5rem;border-radius:7px;background:rgba(244,183,43,.95);color:#211f19;font-size:.72rem;font-weight:850;pointer-events:none}
.album-cover-photo-body{display:grid;gap:.75rem;padding:.8rem}
.album-cover-photo-meta{display:grid;gap:.2rem;min-width:0}
.album-cover-photo-meta strong{font-size:.86rem;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}
.album-cover-photo-meta span{font-size:.76rem;color:#aaa08f}
.album-cover-photo-actions{display:flex;flex-wrap:wrap;gap:.45rem}
.album-cover-photo-actions button{display:inline-flex;align-items:center;justify-content:center;min-height:39px;padding:.48rem .65rem;border-radius:9px;font-weight:800;font-size:.8rem;cursor:pointer}
.album-cover-crop-action{flex:1;border:1px solid rgba(244,183,43,.3);background:rgba(244,183,43,.12);color:#ffe29d}
.album-cover-ai-action{flex:1.25;border:1px solid #5c4e32;background:#3b2f1e;color:#ffe2a5}
.album-cover-delete-action{flex:0 0 44px;border:1px solid rgba(193,79,63,.25);background:rgba(142,47,36,.35);color:#ffb0a5;font-size:1.1rem!important}
.album-cover-photo-actions button:hover{filter:brightness(1.18)}
.album-cover-photo-actions button:disabled{opacity:.45;cursor:wait}
.album-cover-editor [hidden]{display:none!important}
.album-ai-preview{display:flex;justify-content:center;margin:1rem 0}
.album-ai-preview img{width:min(170px,100%);aspect-ratio:2/3;object-fit:contain;background:#181713;border-radius:10px;border:1px solid rgba(244,183,43,.3)}
.album-ai-cost{color:#f7d793}
.album-ai-comparison{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem}
.album-ai-comparison figure{margin:0;text-align:center;color:#f7d793;font-size:.87rem}
.album-ai-comparison img{width:100%;max-height:330px;aspect-ratio:2/3;object-fit:contain;background:#181713;border-radius:10px;border:1px solid #6c5940}
@media(max-width:520px){.album-cover-dropzone,.album-cover-photo-card{width:min(100%,330px)}.album-ai-comparison{gap:.55rem}}

.album-photo-feedback{padding:.7rem .9rem;border-radius:10px;background:rgba(229,178,81,.12);color:#f4d894;border:1px solid rgba(229,178,81,.28);font-size:.88rem}
.album-photo-feedback[hidden]{display:none}

/* Edition des albums : meme shell et meme barre d'actions que la fiche recette. */
.album-page[data-editor-active="true"] { padding-top:0; }
.album-page[data-editor-active="true"] > .album-back-link { display:none; }
.album-save-bar { margin:-1.8rem -1.8rem .9rem; padding:0 1.8rem; }
.album-cover-ai-hint{margin:-.2rem .2rem .5rem;max-width:360px;text-align:center;color:#dfccaa;font-size:.79rem;line-height:1.45}
.album-cover-ai-hint button{border:0;background:none;color:#f7c95b;font:inherit;font-weight:800;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.album-cover-ai-hint button:hover{color:#ffdf8a}
@media(max-width:620px){.album-save-bar{padding:0 1rem}}

.album-cover-dropzone{display:flex;flex-direction:column}
.album-cover-dropzone-button{flex:1 1 auto;height:auto;min-height:0}
.album-cover-ai-hint{width:100%;max-width:none;margin:0;padding:.55rem .85rem .85rem;border-top:1px solid rgba(244,183,43,.14)}

/* Bibliotheque en rayons, et classement toujours disponible via les poignees. */
.album-library-header-actions{display:flex;align-items:center;gap:.65rem;flex-wrap:wrap}
.album-secondary-action{display:inline-flex;align-items:center;justify-content:center;gap:.4rem;padding:.78rem 1rem;border:1px solid #816746;border-radius:12px;background:#312a22;color:#f6dba8;font:inherit;font-weight:750;cursor:pointer}
.album-secondary-action:hover{background:#463725;border-color:#e8ba62}
.album-shelf-create{display:flex;gap:.6rem;align-items:center;flex-wrap:wrap;border:1px solid #766145;background:#29231d;border-radius:14px;padding:1rem;margin-bottom:1.2rem}
.album-shelf-create[hidden],.album-shelf-rename[hidden]{display:none}
.album-shelf-create label{color:#f5d58c;font-weight:750}
.album-shelf-create input,.album-shelf-rename input{min-width:200px;flex:1;background:#181714;color:#f8eedc;border:1px solid #786747;border-radius:9px;padding:.72rem .8rem;font:inherit}
.album-library-feedback{min-height:1.3rem;font-size:.83rem;color:#e8c981;margin:.35rem 0}
.album-library-feedback.is-error{color:#ffb4a3}
.album-shelves{display:grid;gap:1.8rem}
.album-shelf{border:1px solid #4d4132;border-radius:18px;padding:1rem 1.25rem 1.4rem;background:linear-gradient(150deg,rgba(54,42,29,.48),rgba(20,20,18,.36))}
.album-shelf.is-dragging{opacity:.65;outline:2px dashed #f4b72b}
.album-shelf-heading{display:flex;align-items:center;gap:.45rem;border-bottom:1px solid #584731;padding-bottom:.7rem;margin-bottom:.7rem}
.album-shelf-toggle{flex:1;min-width:0;display:flex;align-items:baseline;gap:.65rem;border:0;background:none;color:#f8e8c9;cursor:pointer;text-align:left;padding:.35rem;font:inherit}
.album-shelf-toggle strong{font:700 clamp(1.15rem,2.5vw,1.55rem) Georgia,serif;overflow-wrap:anywhere}
.album-shelf-toggle small{color:#b9a88b;font:.8rem sans-serif;white-space:nowrap}
.album-shelf-toggle span{font-size:1.3rem;display:inline-block;transition:transform .16s}
.album-shelf.is-folded .album-shelf-toggle span{transform:rotate(-90deg)}
.album-shelf-handle,.album-book-handle{display:grid;place-items:center;width:36px;height:36px;flex:none;border-radius:9px;border:1px solid #97733a;background:#29231d;color:#f2c566;font-size:1.55rem;cursor:grab;touch-action:none;user-select:none;z-index:3}
.album-shelf-handle:active,.album-book-handle:active{cursor:grabbing}
.album-shelf-actions{display:flex;gap:.35rem;flex-wrap:wrap}
.album-shelf-actions button,.album-shelf-rename button{padding:.43rem .6rem;border:1px solid #6e593c;border-radius:8px;background:#322a21;color:#f5ddb3;cursor:pointer;font:inherit;font-size:.82rem}
.album-shelf-actions button:last-child{color:#ffb4a3}
.album-shelf-rename{display:flex;align-items:center;gap:.5rem;padding:.7rem 0;flex-wrap:wrap}
.album-shelf-rename label{display:flex;align-items:center;gap:.5rem;flex:1}
.album-shelf-content[hidden]{display:none}
.album-shelf .album-library{padding:.7rem 0 1.15rem;gap:1.4rem 1.1rem;background:repeating-linear-gradient(to bottom,transparent 0,transparent 326px,rgba(121,72,34,.36) 327px,rgba(67,43,26,.64) 334px,transparent 337px)}
.album-book-item{position:relative;min-width:0}
.album-book-item.is-dragging{opacity:.55;outline:2px dashed #e7b552;border-radius:10px}
.album-book-handle{position:absolute;top:.5rem;left:.75rem;box-shadow:0 2px 7px #0009}
.album-shelf-empty{text-align:center;color:#b7a993;border:1px dashed #67543c;padding:1rem;border-radius:10px;margin:.5rem 0}
.album-shelf-empty[hidden]{display:none}
.album-book-mobile-move{display:none}
.album-recipe-tile .album-recipe-handle{box-shadow:0 2px 7px #0008}
.album-recipe-handle:focus-visible,.album-book-handle:focus-visible,.album-shelf-handle:focus-visible{outline:2px solid #ffe493;outline-offset:2px}
@media(max-width:700px){
 .album-shelf{padding:.7rem .8rem 1rem}
 .album-shelf-heading{flex-wrap:wrap}
 .album-shelf-toggle{flex-basis:60%}
 .album-shelf-actions{margin-left:auto}
 .album-shelf-actions button{font-size:.74rem;padding:.35rem}
 .album-book-mobile-move{display:grid;font-size:.73rem;color:#d4c49e;gap:.2rem;margin:0 .2rem .4rem}
 .album-book-mobile-move select{width:100%;max-width:100%;padding:.4rem;border:1px solid #665537;border-radius:7px;background:#24211d;color:#f6e7c9}
 .album-shelf-create input{min-width:min(100%,220px)}
}
@media(prefers-reduced-motion:reduce){.album-book,.album-shelf-toggle span{transition:none}}

.album-book-cover img{-webkit-user-drag:none;user-select:none}

/* Le layout libere la largeur pour cette page uniquement ; le hero s'etend sans
   100vw (qui inclut la barre de defilement et cause un debordement horizontal). */
.image-library-page{width:100%;margin:0;padding:0 0 4rem;color:#f5ecda}
.image-library-body{box-sizing:border-box;width:min(1180px,calc(100% - 2.5rem));margin:0 auto}
.image-library-hero{position:relative;isolation:isolate;width:100%;margin:0 0 1.6rem;overflow:hidden;background:#251b14 url('/images/bibliotheque/fusion-hero-fond.webp') center center/cover no-repeat}
.image-library-hero::before{content:"";position:absolute;inset:0;z-index:-1;background:linear-gradient(180deg,rgba(16,12,8,.30),rgba(16,12,8,.08) 52%,rgba(16,12,8,.30));pointer-events:none}
.image-library-hero-inner{box-sizing:border-box;width:min(100%,1460px);padding:10px clamp(16px,2.8vw,42px) 13px;margin:0 auto}
.image-library-hero-heading{position:relative;min-height:108px;display:flex;align-items:center;justify-content:center;margin-bottom:0}
.image-library-hero-logo{position:absolute;left:0;top:0;width:clamp(148px,13.4vw,215px);height:auto;filter:drop-shadow(0 4px 12px #000b)}
.image-library-hero-intro{box-sizing:border-box;width:100%;margin:0 auto;text-align:center;min-width:0;padding:0 clamp(185px,16vw,240px)}
.image-library-hero h1{white-space:nowrap;font-family:Georgia,'Times New Roman',serif;font-size:clamp(2rem,3.06vw,3.3rem);color:#fff7e8;line-height:1.09;letter-spacing:-.025em;font-weight:750;margin:0;text-shadow:0 3px 14px #000a}
.image-library-hero h1::after{content:"";display:block;margin:8px auto 8px;width:clamp(128px,14vw,240px);height:4px;border-radius:12px;background:#f6b927}
.image-library-hero-intro p{font-size:clamp(.88rem,1.16vw,1.08rem);color:#fff1dd;line-height:1.39;margin:0;text-shadow:0 2px 9px #000}
.image-library-hero-composition{display:block;width:min(100%,1030px);height:auto;margin:0 auto;filter:drop-shadow(0 12px 16px rgba(0,0,0,.27))}
@media(max-width:1160px){.image-library-hero-heading{min-height:105px}.image-library-hero-intro{padding-inline:140px}.image-library-hero-logo{width:155px}.image-library-hero h1{font-size:clamp(1.8rem,3.1vw,2.65rem)}.image-library-hero-inner{padding-bottom:13px}}
@media(max-width:950px) and (min-width:721px){.image-library-hero-heading{flex-direction:column;gap:2px;min-height:0;margin-bottom:12px}.image-library-hero-logo{position:static;width:135px}.image-library-hero-intro{padding:0}.image-library-hero h1{white-space:normal;font-size:clamp(1.8rem,3.5vw,2.5rem)}}
@media(max-width:720px){.image-library-hero{margin-bottom:1.3rem;background-position:45% center}.image-library-hero-inner{padding:10px 10px 14px}.image-library-hero-heading{display:flex;flex-direction:column;gap:2px;min-height:0;margin-bottom:12px}.image-library-hero-logo{position:static;width:135px;margin:0 auto}.image-library-hero-intro{padding:0;max-width:520px}.image-library-hero h1{font-size:clamp(1.4rem,5.3vw,2rem);white-space:normal}.image-library-hero h1::after{height:3px;margin:6px auto}.image-library-hero-intro p{font-size:.8rem;line-height:1.35}.image-library-desktop-break{display:none}.image-library-hero-composition{width:100%;max-width:none;filter:drop-shadow(0 5px 9px #0007)}}
.image-library-header{display:flex;align-items:flex-start;justify-content:space-between;gap:1.5rem;flex-wrap:wrap;margin-bottom:2rem}
.image-library-header>div:first-child{flex:1;min-width:min(100%,340px)}
.image-library-quota{margin:.7rem 0 0;color:#c9b9a0;font-size:.95rem}
.image-library-quota strong{color:#f8c353}
.image-library-add{display:flex;flex-direction:column;gap:.55rem;align-items:flex-end}
.image-library-add small{color:#a99b84;text-align:right;font-size:.79rem;max-width:290px}
.image-library-primary{display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:12px;padding:.85rem 1.2rem;background:#f4b72b;color:#2a2015;font-size:.96rem;font-weight:800;font-family:inherit;cursor:pointer;min-height:45px}
.image-library-primary:hover:not(:disabled){background:#ffd06a}
.image-library-primary:disabled,.image-library-primary[aria-disabled="true"]{opacity:.48;cursor:not-allowed;pointer-events:none}
.image-library-primary:focus-visible{outline:3px solid #fff0c1;outline-offset:3px}
.image-library-file-input{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;opacity:0}
.image-library-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(235px,100%),1fr));gap:1.25rem;align-items:start}
.image-library-card{overflow:hidden;background:#29251e;border:1px solid #544734;border-radius:15px;box-shadow:0 10px 24px #0003;min-width:0}
.image-library-preview{display:block;width:100%;padding:0;aspect-ratio:4/3;border:0;background:#171612;position:relative;overflow:hidden;cursor:zoom-in}
.image-library-preview img{width:100%;height:100%;object-fit:cover;display:block;transition:transform .2s ease}
.image-library-preview:hover img,.image-library-preview:focus-visible img{transform:scale(1.035)}
.image-library-preview span{position:absolute;right:.6rem;bottom:.6rem;padding:.3rem .48rem;border-radius:7px;background:#181511c9;color:#fff0d9;font-size:.78rem;opacity:0}
.image-library-preview:hover span,.image-library-preview:focus-visible span{opacity:1}
.image-library-card-body{padding:.9rem;display:grid;gap:.35rem}
.image-library-card-body label{font-size:.8rem;font-weight:700;color:#d5bf90}
.image-library-card-body input{box-sizing:border-box;width:100%;border:1px solid #675942;background:#1d1b18;border-radius:9px;color:#fff5e4;padding:.7rem .75rem;font:inherit;min-width:0}
.image-library-card-body input:focus-visible{outline:2px solid #f4b72b;outline-offset:1px}
.image-library-card-footer{display:flex;align-items:center;justify-content:space-between;gap:.4rem;margin-top:.28rem}
.image-library-card-footer span{color:#a6ba9d;font-size:.78rem;line-height:1.3;min-height:1em}
.image-library-card-footer span[data-error="true"]{color:#ffac9f}
.image-library-delete{border:1px solid #68423a;background:#39231e;border-radius:9px;min-width:39px;min-height:39px;color:#f6a69a;font-size:1.15rem;cursor:pointer}
.image-library-delete:hover{background:#65352d;border-color:#cb7770}
.image-library-delete:disabled{opacity:.55;cursor:wait}
.image-library-feedback{padding:.8rem 1rem;border:1px solid #b79044;border-radius:10px;background:#403322;color:#f8deaa;margin:0 0 1.2rem;line-height:1.5}
.image-library-feedback[hidden]{display:none}
.image-library-feedback[data-error="true"]{border-color:#b46b5d;background:#3b2923;color:#ffc9b9}
.image-library-empty{border:1px dashed #6b5839;border-radius:20px;background:#2b261e;text-align:center;padding:3rem 1.2rem}
.image-library-empty>span{font-size:3.6rem;color:#f5bc46}
.image-library-empty h2{font:700 1.65rem Georgia,serif;margin:1rem 0 .5rem}
.image-library-empty p{color:#cab9a0;margin:0 auto 1.3rem;max-width:520px;line-height:1.5}
.image-library-large-preview{display:flex;align-items:center;justify-content:center;max-height:min(66vh,650px);min-width:0}
.image-library-large-preview img{display:block;max-width:100%;max-height:min(66vh,650px);width:auto;height:auto;object-fit:contain;border-radius:8px}
.image-library-large-preview img:not([src]){display:none}
@media(max-width:720px){.image-library-header{gap:1rem}.image-library-add{align-items:stretch;width:100%}.image-library-add small{text-align:left;max-width:none}.image-library-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:.7rem}.image-library-card-body{padding:.6rem}.image-library-card-body input{font-size:.88rem;padding:.55rem}.image-library-preview span{opacity:1}}
@media(max-width:360px){.image-library-grid{grid-template-columns:1fr}}

/* Styles partages de la fiche recette : page SSR et apercu de controle Blazor. */
.recipe-content { display: grid; gap: 1.2rem; min-width: 0; }

.recipe-detail-page {
    display: grid;
    gap: 1.2rem;
}

.detail-loading,
.detail-hero,
.detail-card {
    padding: clamp(1.45rem, 4vw, 2rem);
    border: 1px solid rgba(255, 214, 100, 0.12);
    border-radius: 28px 10px 28px 10px;
    background: linear-gradient(145deg, rgba(40, 39, 31, 0.98), rgba(25, 24, 19, 0.98));
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

.detail-loading span,
.detail-card-heading span,
.detail-category {
    color: #f4b72b;
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.detail-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.detail-toolbar-actions {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 0.7rem;
    flex-wrap: wrap;
}

/* Séparer les actions de consultation des actions réservées au propriétaire. */
.detail-general-actions,
.detail-owner-actions {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.detail-toolbar-separator {
    flex: 0 0 1px;
    width: 1px;
    height: 56px;
    background: rgba(255, 214, 100, 0.27);
}

/* Le mode cuisine est la premiere action, accessible aussi aux visiteurs. */
.detail-cook-button.action-tile {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .34rem;
    width: 82px;
    min-height: 74px;
    padding: .62rem .4rem .5rem;
    border: 1px solid rgba(244, 183, 43, .53);
    border-radius: 16px 7px 16px 7px;
    background: rgba(244, 183, 43, .16);
    color: #ffe49a;
    line-height: 1.05;
    font-weight: 900;
    text-decoration: none;
    text-align: center;
}
.detail-cook-button .detail-cook-icon { font-size: 1.65rem; line-height: 1; }
.detail-cook-button .detail-cook-icon svg { display:block; width:25px; height:25px; }
.detail-cook-button > span:last-child { font-size: .7rem; }
.detail-cook-button:hover, .detail-cook-button:focus-visible {
    color: #211f18;
    background: #f4b72b;
    outline-offset: 3px;
}

.detail-share-action[hidden] { display: none !important; }

/* La portée est une action propriétaire, au même format que Modifier/Supprimer. */
.detail-owner-visibility .cm-recipe-visibility--action-tile {
    position: static;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: .34rem;
    width: 82px;
    min-height: 74px;
    max-width: none;
    padding: .62rem .4rem .5rem;
    border: 1px solid rgba(255, 214, 100, .22);
    border-radius: 16px 7px 16px 7px;
    background: rgba(244, 183, 43, .1);
    color: #fff4d6;
    text-align: center;
}

.detail-owner-visibility .cm-recipe-visibility--action-tile > span[aria-hidden] {
    font-size: 1.5rem;
    line-height: 1;
}

.detail-owner-visibility .cm-recipe-visibility--action-tile .cm-recipe-visibility-text {
    font-size: .7rem;
    color: inherit;
}

.detail-backlink {
    color: #ffe085;
    font-weight: 800;
    text-decoration: none;
}

.detail-edit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 1rem;
    border: 1px solid rgba(255, 214, 100, 0.22);
    border-radius: 13px;
    background: rgba(244, 183, 43, 0.1);
    color: #fff4d6;
    font-weight: 900;
    text-decoration: none;
}

.detail-edit-button.action-tile {
    width: 82px;
    min-height: 74px;
    flex-direction: column;
    gap: .34rem;
    padding: .62rem .4rem .5rem;
    border-radius: 16px 7px 16px 7px;
    line-height: 1.05;
    text-align: center;
}

.detail-edit-icon {
    font-size: 1.75rem;
    line-height: 1;
}

.detail-edit-button.action-tile > span:last-child {
    font-size: .7rem;
}

.detail-edit-button:hover {
    background: #f4b72b;
    color: #201d16;
}

.detail-loading h1,
.detail-copy h1,
.detail-card h2 {
    margin: 0.8rem 0 0.55rem;
    color: #fff7e5;
    font-family: Georgia, "Times New Roman", serif;
    letter-spacing: -0.04em;
}

.detail-copy h1 {
    font-size: clamp(1.89rem, 4.14vw, 3.45rem);
    line-height: 1.02;
    overflow-wrap: anywhere;
}

/* Le macaron demarre au niveau du titre ; les lignes longues retrouvent
   toute la largeur sous le macaron, sans empiéter sur la photo. */
.detail-honor-title-row {
    display: flow-root;
    margin: .8rem 0 .6rem;
    min-width: 0;
}
.detail-honor-title-row h1 { margin: 0; min-width: 0; }
.detail-honor-award {
    float: left;
    width: 92px;
    margin: 0 .8rem .4rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
    min-width: 0;
    color: #dbc892;
    text-align: center;
}
.detail-honor-award img { display: block; width: 86px; height: auto; max-width: 100%; }
.detail-honor-award span { font-size: .63rem; line-height: 1.25; }
.detail-honor-award strong { display: block; color: #ffe09b; font-size: .67rem; font-weight: 800; }
@media (max-width: 620px) {
    .detail-honor-award { width: 72px; margin-right: .65rem; }
    .detail-honor-award img { width: 68px; }
    .detail-honor-title-row h1 { font-size: clamp(1.61rem, 5.7vw, 2.53rem); }
}

.detail-loading p,
.detail-copy p,
.detail-empty,
.preparation-text,
.ingredient-source {
    margin: 0;
    color: #b4ad9f;
    line-height: 1.75;
}

.detail-loading a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin-top: 1rem;
    padding: 0 1rem;
    border-radius: 14px;
    background: #f4b72b;
    color: #201d16;
    font-weight: 900;
    text-decoration: none;
}

.detail-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(330px, 0.9fr);
    gap: 1.2rem;
    align-items: start;
    background:
        radial-gradient(circle at top right, rgba(244, 183, 43, 0.15), transparent 34%),
        linear-gradient(145deg, rgba(40, 39, 31, 0.98), rgba(25, 24, 19, 0.98));
}

.detail-copy {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Même signature que le badge des cartes standard, sans surcharge des recettes classiques. */
.detail-preparation-mode {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: .33rem;
    max-width: 100%;
    margin-bottom: .55rem;
    padding: .35rem .57rem;
    border: 1px solid rgba(255, 214, 100, .35);
    border-radius: 999px;
    background: rgba(20, 19, 17, .87);
    color: #ffe1a0;
    font: 700 .72rem/1.1 system-ui, sans-serif;
}
.detail-preparation-mode svg { flex: 0 0 15px; width: 15px; height: 15px; }
.detail-preparation-mode span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.detail-quickfacts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1.2rem;
}

.detail-quickfacts span {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #d6cfbf;
    font-size: 0.8rem;
}

.detail-visual {
    display: grid;
    gap: 0.8rem;
    align-content: start;
}

.hero-photo,
.detail-thumb {
    background-color: #2a2923;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

img.hero-photo, img.detail-thumb {
    display: block;
    width: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-photo {
    min-height: 350px;
    max-height: 520px;
    border-radius: 22px;
}

/* Le cadre 16/9 reste entièrement couvert, même si l'original est vertical. */
img.hero-photo {
    aspect-ratio: 16 / 9;
    height: auto;
    min-height: 0;
    max-height: none;
}

.detail-thumbs {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: .6rem;
    padding: .18rem .15rem;
}

/* 3 vignettes au maximum par ligne, avec la dernière rangée sans vide. */
.detail-thumbs > .cm-detail-thumb-wrap { grid-column: span 2; }
.detail-thumbs:not([data-gallery-count="4"]) > .cm-detail-thumb-wrap:last-child:nth-child(3n + 1) { grid-column: span 6; }
.detail-thumbs > .cm-detail-thumb-wrap:nth-last-child(2):nth-child(3n + 1),
.detail-thumbs > .cm-detail-thumb-wrap:last-child:nth-child(3n + 2) { grid-column: span 3; }
/* Quatre photos forment deux rangées équilibrées plutôt qu'une grande photo isolée. */
.detail-thumbs[data-gallery-count="4"] > .cm-detail-thumb-wrap { grid-column: span 3; }

.detail-thumb {
    min-height: 95px;
    height: 110px;
    border-radius: 16px;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(290px, 0.8fr);
    gap: 1rem;
}

.detail-main,
.detail-side {
    display: grid;
    gap: 1rem;
}

.detail-card h2 {
    font-size: clamp(1.8rem, 3vw, 2.3rem);
    line-height: 1.04;
}

.detail-main .detail-card-heading {
    margin-bottom: 2rem;
}

/* Le surtitre et les commandes occupent leur propre ligne : le titre de la fiche
   ingredients reste toujours independant des boutons, meme sur petit ecran. */
.detail-side .cm-ingredient-public-heading {
    padding-bottom: 0;
    margin-bottom: 2rem;
}

.detail-side .cm-ingredient-public-heading .cm-ingredient-heading-labels .cm-editorial-kicker {
    min-height: 34px;
    padding-right: 8.5rem;
}

.detail-side .cm-ingredient-public-heading .cm-ingredient-heading-labels .cm-editorial-title {
    margin-top: .8rem;
    font-size: clamp(1.8rem, 2.3vw, 2rem);
    line-height: 1.15;
}

.preparation-text,
.ingredient-source {
    white-space: pre-line;
}

.detail-engagement {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(255, 214, 100, 0.12);
    border-radius: 18px 7px 18px 7px;
    background: linear-gradient(135deg, rgba(244, 183, 43, 0.07), rgba(255, 255, 255, 0.025));
}

.detail-engagement-label {
    display: grid;
    gap: 0.2rem;
}

.detail-engagement-label span {
    color: #f4b72b;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.detail-engagement-label strong {
    color: #d9d1c1;
    font-size: 0.86rem;
    line-height: 1.35;
}

.detail-engagement-actions {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 0.65rem;
    flex-wrap: wrap;
}

@media (max-width: 920px) {
    .detail-hero,
    .detail-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .detail-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .detail-toolbar-actions {
        justify-content: flex-start;
    }

    .detail-general-actions,
    .detail-owner-actions {
        justify-content: flex-start;
    }

    /* Les deux groupes se succèdent sur mobile, sans séparateur vertical isolé. */
    .detail-toolbar-separator {
        flex-basis: 100%;
        width: 100%;
        height: 1px;
    }

    .hero-photo {
        min-height: 250px;
    }
}

@media (max-width: 520px) {
    .detail-loading,
    .detail-hero,
    .detail-card {
        border-radius: 22px 8px 22px 8px;
    }


}

/* Commentaires : une section ouverte, sans cartes imbriquées. */
.comments-section {
    padding: clamp(1.1rem, 3vw, 1.8rem) clamp(0rem, 2vw, 1rem) 0.6rem;
    border-top: 1px solid rgba(255, 214, 100, 0.18);
    min-width: 0;
}

.comments-section-top {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-bottom: 1.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.comments-section-top .cm-editorial-title { margin-bottom: 0; }

.comment-login-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.65rem 1rem;
    border: 1px solid #f4b72b;
    border-radius: 13px;
    background: #f4b72b;
    color: #201d16;
    font: inherit;
    font-weight: 850;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease;
}
.comment-login-link:hover,
.comment-login-link:focus-visible { background: #ffe08a; border-color: #ffe08a; }

.comment-form {
    display: grid;
    gap: 0.7rem;
    margin: 1.15rem 0 0.25rem;
}
.comments-section[hidden], .comment-form[hidden], .comment-login-link[hidden],
.comments-list[hidden], .comments-empty[hidden], .comment-message[hidden], .comment-pending-notice[hidden] { display: none !important; }
.comment-form label { color: #f5eddf; font-weight: 750; }
.comment-form textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 126px;
    resize: vertical;
    padding: 0.95rem;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 14px;
    outline: 0;
    background: #201f1a;
    color: #fff8e7;
    font: inherit;
    line-height: 1.5;
}
.comment-form textarea:focus {
    border-color: rgba(244,183,43,.7);
    box-shadow: 0 0 0 3px rgba(244,183,43,.08);
}
.comment-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}
.comment-form-footer span, .comment-moderation-note { color: #aaa396; font-size: 0.85rem; }
.comment-form-footer button {
    min-height: 42px;
    padding: 0.55rem 1rem;
    border: 0;
    border-radius: 13px;
    background: #f4b72b;
    color: #201d16;
    font: inherit;
    font-weight: 850;
    cursor: pointer;
}
.comment-form-footer button:hover { background: #ffe08a; }
.comment-form-footer button:disabled { opacity: 0.6; cursor: wait; }
.comment-moderation-note { margin: 0; }
.comment-message { margin: 0.15rem 0 0; color: #b9dfa7; font-weight: 700; }
.comment-message.is-error { color: #ffbb91; }
.comment-pending-notice { margin: 1.2rem 0 0; color: #f4b72b; font-size: 0.9rem; line-height: 1.5; }
.comments-empty {
    margin: 0;
    padding: 1.75rem 0 0.7rem;
    color: #aaa396;
    text-align: center;
    line-height: 1.65;
}
.comments-list { margin-top: 0.45rem; }
.comment-item {
    padding: 1.2rem 0;
    border-bottom: 1px solid rgba(255,255,255,.1);
}
.comment-item:last-child { border-bottom: 0; }
.comment-item.pending { border-left: 2px solid rgba(244,183,43,.65); padding-left: 0.8rem; }
.comment-item header { display: flex; align-items: baseline; gap: 0.65rem; flex-wrap: wrap; }
.comment-item header strong { color: #fff7e5; }
.comment-item header span { color: #989083; font-size: 0.82rem; }
.comment-item header em { margin-left: auto; color: #f4b72b; font-size: 0.78rem; font-style: normal; font-weight: 800; }
.comment-cancel { border: 0; padding: 0.2rem 0.25rem; background: transparent; color: #f4b72b; font: inherit; font-size: 0.82rem; text-decoration: underline; cursor: pointer; }
.comment-cancel:hover, .comment-cancel:focus-visible { color: #ffe08a; }
.comment-cancel:disabled { opacity: 0.55; cursor: wait; }
.comment-item p { margin: 0.55rem 0 0; color: #c9c1b2; line-height: 1.65; white-space: pre-line; overflow-wrap: anywhere; }

@media (max-width: 620px) {
    .comments-section-top { align-items: flex-start; }
    .comment-login-link { width: 100%; }
    .comment-form-footer { align-items: stretch; flex-direction: column; }
    .comment-form-footer button { width: 100%; }
    .comment-item header em { margin-left: 0; }
}

.detail-author { display:flex; align-items:center; gap:.65rem; flex-wrap:wrap; margin:.15rem 0 .75rem; color:#c9c1b3; font-size:.9rem; }
.detail-author img { width:38px; height:38px; object-fit:cover; border-radius:12px; border:1px solid rgba(244,183,43,.3); background:#2a2923; }
.detail-author strong { color:#ffe08a; }
.detail-author-link,.detail-author-static { display:inline-flex; align-items:center; gap:.6rem; color:inherit; text-decoration:none; }
.detail-author-link em { color:#f4b72b; font-size:.78rem; font-style:normal; font-weight:850; opacity:.9; transition:opacity 150ms ease; }
.detail-author-link:hover em { opacity:1; text-decoration:underline; text-underline-offset:3px; }
@media(max-width:540px){.detail-author{align-items:flex-start}.detail-author-link{align-items:flex-start;flex-wrap:wrap}.detail-author-link em{width:100%;margin-left:44px;margin-top:-.35rem}}

.related-recipes {
    display: grid;
    gap: 1rem;
    padding-top: 0.35rem;
}

.related-heading span {
    color: #f4b72b;
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.related-heading h2 {
    margin: 0.6rem 0 0.35rem;
    color: #fff7e5;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.9rem, 3vw, 2.6rem);
    letter-spacing: -0.04em;
}

.related-heading p {
    margin: 0;
    color: #aaa396;
    line-height: 1.65;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.related-card-host {
    position: relative;
    min-width: 0;
}

.related-card {
    display: grid;
    height: 100%;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(40, 39, 31, 0.98), rgba(25, 24, 19, 0.98));
    text-decoration: none;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.2);
    transition: transform 150ms ease, border-color 150ms ease;
}

.related-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 214, 100, 0.3);
}

.related-photo {
    min-height: 205px;
    position: relative;
    background-color: #2a2923;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.related-category {
    position: absolute;
    left: 0.9rem;
    top: 0.9rem;
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 0.8rem;
    border-radius: 999px;
    background: #f4b72b;
    color: #201d16;
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.related-body {
    padding: 1.05rem 1.05rem 1.2rem;
}

.related-body h3 {
    margin: 0;
    color: #fff7e5;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.5rem;
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.related-body p {
    margin: 0.65rem 0 0;
    color: #b1ab9c;
    line-height: 1.65;
}

.related-author {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin: 0.55rem 0 0;
    color: #aaa396;
    font-size: 0.8rem;
}

.related-author img {
    width: 30px;
    height: 30px;
    object-fit: cover;
    border-radius: 9px;
    border: 1px solid rgba(244, 183, 43, 0.25);
    background: #2b2a23;
}

.related-author strong {
    color: #e7dfd0;
}

.related-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.95rem;
}

.related-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #d5cfbf;
    font-size: 0.79rem;
}

@media (max-width: 980px) {
    .related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 650px) {
    .related-grid {
        grid-template-columns: 1fr;
    }

    .related-photo {
        min-height: 190px;
    }
}

/* L'action destructive est distincte des actions sociales et visible seulement au propriétaire. */
.detail-delete-form {margin:0;display:inline-flex}
.detail-delete-button.action-tile {display:inline-flex;align-items:center;justify-content:center;width:82px;min-height:74px;flex-direction:column;gap:.34rem;padding:.62rem .4rem .5rem;border:1px solid #a65b58;border-radius:16px 7px 16px 7px;background:#522b29;color:#ffe9e4;font:inherit;font-weight:900;cursor:pointer}
.detail-delete-button .detail-edit-icon svg { display:block; width:20px; height:20px; }
.detail-delete-button.action-tile > span:last-child {font-size:.7rem}
.detail-delete-button:hover {background:#8d3d3b;color:#fff}

/* Fiche recette : mêmes rangées icône/libellé pour toutes les tuiles, y compris les
   composants enfants (favoris, partage, "faite", visibilité). Une légende sur deux
   lignes ne doit pas décaler les autres boutons. */
.detail-toolbar-actions .action-tile,
.detail-owner-visibility .cm-recipe-visibility--action-tile {
    box-sizing: border-box;
    display: grid;
    grid-template-rows: 30px 32px;
    align-content: center;
    align-items: center;
    justify-items: center;
    flex: 0 0 82px;
    width: 82px;
    min-width: 82px;
    max-width: 82px;
    height: 82px;
    min-height: 82px;
    padding: 5px;
    gap: 4px;
    line-height: 1.12;
    text-align: center;
}

.detail-toolbar-actions .action-tile > span:first-child,
.detail-owner-visibility .cm-recipe-visibility--action-tile > span:first-child {
    box-sizing: border-box;
    display: grid;
    place-items: center;
    width: 32px;
    height: 30px;
    font-size: 1.65rem;
    line-height: 1;
}

.detail-toolbar-actions .action-tile > span:last-child,
.detail-owner-visibility .cm-recipe-visibility--action-tile .cm-recipe-visibility-text {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 32px;
    margin: 0;
    font-size: .7rem;
    font-weight: 850;
    line-height: 1.15;
    white-space: normal;
    text-align: center;
}

/* Une seule géométrie pour les actions de la fiche, quel que soit le composant. */
.recipe-detail-page .detail-toolbar-actions :is(.action-tile, .cm-recipe-visibility--action-tile) {
    border-radius: 16px 7px 16px 7px;
}

/* Le panier et les albums partagent le même état visuel persistant. */
.recipe-detail-page .detail-toolbar-actions .cm-basket-toggle.action-tile {
    background: #252117;
    color: #f4b72b;
    border-color: rgba(244, 183, 43, .42);
    cursor: pointer;
}
.recipe-detail-page .detail-toolbar-actions .cm-basket-toggle.action-tile > svg {
    width: 27px;
    height: 27px;
}
.recipe-detail-page .detail-toolbar-actions .cm-basket-toggle.action-tile:not(:disabled):is(:hover, :focus-visible) {
    background: #44351d;
    color: #ffd873;
}
.recipe-detail-page .detail-toolbar-actions .cm-basket-toggle.action-tile[aria-pressed="true"] {
    background: #f4b72b;
    color: #242017;
    border-color: #f4b72b;
}
.recipe-detail-page .detail-toolbar-actions .cm-basket-toggle.action-tile[aria-pressed="true"]:not(:disabled):is(:hover, :focus-visible) {
    background: #ffcd5c;
    color: #231c10;
}
.recipe-detail-page .detail-toolbar-actions .cm-basket-toggle.action-tile:disabled {
    cursor: wait;
}

/* Ce composant peut afficher des statistiques sous le bouton : elles ne doivent
   jamais modifier l'alignement de la rangée principale. */
.detail-general-actions .recipe-made-it-wrap.action-tile-wrap {
    min-width: 82px;
    justify-items: start;
}

.detail-toolbar-separator {
    height: 58px;
    align-self: flex-start;
    margin-top: 12px;
}

@media (max-width: 620px) {
    .detail-toolbar-separator {
        height: 1px;
        margin-top: 0;
    }
}

/* Gestion Pinterest : fonctionnalité éditoriale exclusivement Super Administrateur. */
.detail-pinterest-button { cursor:pointer; font:inherit; }
.detail-pinterest-button .cm-pin-icon { position:relative; color:#e7354c; font-weight:1000; font-family:Georgia,serif; }
.cm-pin-state { position:absolute; top:-4px; right:-15px; display:grid; place-items:center;
    width:18px; height:18px; border-radius:50%; color:#fff; font:900 12px/1 sans-serif; border:2px solid #26231b; }
.cm-pin-state-ready { background:#159451; }
.cm-pin-state-stale { background:#c28c20; }
.cm-pinterest-manager { display:grid; justify-items:center; gap:.8rem; min-width: min(340px, 75vw); }
.cm-pinterest-manager form { display:none; }
.cm-pin-message { margin:.2rem 0; text-align:center; line-height:1.45; }
.cm-pin-error { color:#e97474; }
.cm-pin-preview { display:block; width:min(245px, 60vw); height:auto; max-height:49vh; object-fit:contain; border-radius:10px;
    box-shadow:0 6px 25px rgba(0,0,0,.28); }
.cm-pin-preview[hidden], .cm-pin-buttons [hidden] { display:none!important; }
.cm-pin-note { max-width:390px; font-size:.86rem; text-align:center; opacity:.87; margin:0; }
.cm-pin-buttons { display:flex; justify-content:center; flex-wrap:wrap; gap:.5rem; }
.cm-pin-buttons button, .cm-pin-buttons a { display:inline-flex; align-items:center; justify-content:center;
    border:1px solid #bd9531; color:#241a07; background:#ffd66e; font-family:inherit; font-size:.85rem; font-weight:750; line-height:1.25;
    border-radius:10px; padding:.64rem .85rem; cursor:pointer; text-decoration:none; }
.cm-pin-buttons button:disabled { opacity:.55; cursor:not-allowed; }
.cm-pin-buttons a { background:transparent; color:#f8dc87; }
.cm-pinterest-manager > small { line-height:1.4; text-align:center; max-width:410px; opacity:.8; }

.cm-pin-compare { display:flex; justify-content:center; align-items:flex-start; flex-wrap:wrap; gap:1rem; max-width:min(600px, 90vw); }
.cm-pin-compare figure { margin:0; display:grid; justify-items:center; gap:.4rem; }
.cm-pin-compare figure[hidden] { display:none!important; }
.cm-pin-compare figcaption { font-size:.76rem; font-weight:800; text-align:center; }
.cm-pin-compare figure .cm-pin-preview { width:min(224px, 33vw); max-height:42vh; }
@media (max-width:600px) { .cm-pin-compare figure .cm-pin-preview { width:min(175px, 36vw); max-height:38vh; } }

/* Les conseils occupent toute la largeur, entre la grille étapes/ingrédients et la nutrition. */
.detail-recipe-tips { min-width: 0; }
.detail-recipe-tips .detail-card-heading { margin-bottom: 1rem; }
.detail-recipe-tips-text { margin: 0; color: #e2d8c6; }
.cm-editorial-markdown { overflow-wrap: anywhere; line-height: 1.75; white-space: pre-line; }
.cm-editorial-markdown > * { margin: 0 0 1.25em; }
.cm-editorial-markdown > :last-child { margin-bottom: 0; }
.cm-editorial-markdown :is(h3, h4, h5, h6) { font-size: 1.08em; line-height: 1.4; color: #fff4dd; font-weight: 700; }
.cm-editorial-markdown :is(ul, ol) { padding-inline-start: 1.5em; }
.cm-editorial-markdown ul { list-style: disc; }
.cm-editorial-markdown ol { list-style: decimal; }
.cm-editorial-markdown li + li { margin-top: .35em; }
.cm-editorial-markdown li::marker { color: #f4b72b; }
.cm-editorial-markdown strong { color: #fff4dd; }
.cm-editorial-markdown a { color: #f4c450; text-decoration: underline; }

/* Une seule présentation pour les recettes persistées et leurs versions de travail IA. */
.cm-assistant-work-page {min-width:0;}
.cm-working-status,.cm-working-note {
    display:inline-flex;align-items:center;max-width:100%;padding:.55rem .8rem;
    border:1px solid rgba(210,150,232,.48);border-radius:12px;
    background:rgba(104,55,129,.18);color:#edd0f5;font-size:.79rem;font-weight:800;
}
.cm-working-note {margin:.15rem 0 .65rem;}
.cm-working-help {
    margin:0;padding:.7rem .95rem;border-left:3px solid #a368c4;
    background:rgba(122,73,146,.12);color:#e3d1e8;line-height:1.5;font-size:.88rem;
}
.cm-working-feedback {color:#e0b9ec;font-size:.88rem;line-height:1.5;}
.cm-working-feedback[data-error="true"] {color:#ffd0cc;}
.cm-work-save-button.action-tile {width:108px;max-width:none;background:#f4b72b;color:#1d1b17;cursor:pointer;}
.cm-work-save-button.action-tile > span:last-child {font-size:.68rem;}
.cm-work-save-button:disabled {opacity:.55;cursor:wait;}
.cm-illustration-badge {
    justify-self:start;display:inline-block;padding:.42rem .7rem;border-radius:10px;
    background:rgba(107,57,129,.9);border:1px solid rgba(231,177,249,.5);
    color:#fff1ff;font-weight:800;font-size:.76rem;letter-spacing:.01em;
}
.cm-illustration-generator {
    display:grid;gap:.75rem;justify-items:center;padding:1.15rem;border:1px dashed rgba(215,170,228,.48);
    background:rgba(76,49,90,.17);border-radius:16px;text-align:center;
}
.cm-illustration-generator-label {color:#d6c7dc;font-weight:700;font-size:.84rem;}
.cm-illustration-generator [data-cm-illustration-generate] {max-width:100%;white-space:normal;cursor:pointer;}
.cm-illustration-generator [hidden],img.hero-photo[hidden],.cm-working-feedback[hidden] {display:none!important;}
.cm-illustration-proposal {position:relative;display:grid;gap:.7rem;width:100%;justify-items:center;}
.cm-illustration-proposal img {display:block;width:100%;aspect-ratio:16/9;object-fit:cover;border-radius:14px;}
.cm-illustration-proposal button {cursor:pointer;}
.cm-illustration-feedback {color:#e2c3ed;font-size:.81rem;line-height:1.5;margin:0;}
.cm-illustration-feedback[data-error="true"],.cm-illustration-warning {color:#ffcbc9;}
@media(max-width:700px){
    .cm-assistant-work-page .detail-toolbar {align-items:flex-start;flex-wrap:wrap;}
    .cm-assistant-work-page .detail-toolbar-actions {width:100%;justify-content:space-between;align-items:center;}
    .cm-work-save-button.action-tile {width:106px;}
}

/* Galerie de fiche : une image vedette et toutes les autres visibles dans une grille. */
.cm-gallery-main-media { position: relative; min-width: 0; }
.cm-gallery-main-media .hero-photo { width: 100%; }
.cm-gallery-hero-open {
    display: block; width: 100%; padding: 0; border: 0; border-radius: 22px;
    background: transparent; color: inherit; cursor: zoom-in;
}
.cm-gallery-hero-open:focus-visible { outline: 3px solid #f5bd43; outline-offset: 2px; }
.cm-gallery-main-badge {
    position: absolute; bottom: .8rem; left: .8rem; z-index: 1;
    box-sizing: border-box; display: flex; align-items: center; min-width: 0; min-height: 0;
    max-width: calc(100% - 1.6rem); overflow-wrap: anywhere; pointer-events: auto;
    padding: .42rem .7rem; font-size: .72rem; line-height: 1.2; border-radius: 10px;
    box-shadow: 0 2px 9px rgba(0,0,0,.36);
}
.cm-gallery-main-badge[hidden] { display: none !important; }
.cm-detail-gallery { min-width: 0; }
.cm-detail-thumb-wrap {
    position: relative; display: block; min-width: 0; width: 100%; padding: 0;
    border: 2px solid transparent; border-radius: 16px; background: transparent;
    color: inherit; overflow: hidden;
}
.cm-detail-thumb-open {
    position: relative; display: block; width: 100%; padding: 0; border: 0;
    background: transparent; color: inherit; cursor: zoom-in; text-align: left;
}
.cm-detail-thumb-wrap .detail-thumb { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; min-height: 0; pointer-events: none; }
.cm-detail-thumb-wrap:has(:focus-visible) { border-color: #f5bd43; outline: 2px solid #f5bd43; outline-offset: 1px; }
.cm-detail-thumb-status {
    position: absolute; bottom: .32rem; left: .32rem; max-width: calc(100% - .64rem);
    padding: .22rem .42rem; border-radius: 7px;
    background: rgba(73,39,93,.92); color: #fff; font-size: .62rem;
    line-height: 1.2; font-weight: 750; pointer-events: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 700px) {
    .cm-gallery-main-badge { bottom: .55rem; left: .55rem; max-width: calc(100% - 1.1rem); }
}

/* Le verrou administratif est lisible sur la fiche et dans l'éditeur du propriétaire. */
.cm-admin-withdrawal { margin: 0 0 1.2rem; }
.cm-admin-withdrawal-panel { display: flex; flex-direction: column; gap: .65rem; padding: 1rem 1.2rem; border: 1px solid; border-radius: 12px; line-height: 1.48; }
.cm-admin-withdrawal-panel[hidden] { display: none !important; }
.cm-admin-withdrawal-panel--removed { border-color: #bb6c5a; background: #502d29; color: #fff4ee; }
.cm-admin-withdrawal-panel--pending { border-color: #bb9441; background: #433a25; color: #fff4d7; }
.cm-admin-withdrawal-panel h2 { font-size: 1.14rem; line-height: 1.3; margin: 0; font-weight: 800; color: inherit; }
.cm-admin-withdrawal-panel h2 span { margin-right: .3rem; }
.cm-admin-withdrawal-panel p { margin: 0; font-size: .91rem; }
.cm-admin-withdrawal-reason { display: grid; gap: .28rem; padding: .65rem .75rem; background: rgba(0,0,0,.13); border-radius: 8px; font-size: .9rem; }
.cm-admin-withdrawal-comment p { margin-top: .18rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.cm-admin-withdrawal-muted { opacity: .85; }
.cm-admin-withdrawal-steps { border-top: 1px solid rgba(255,255,255,.22); padding-top: .7rem; }
.cm-admin-withdrawal-steps > strong { display: block; margin-bottom: .35rem; }
.cm-admin-withdrawal-steps ol { margin: 0 0 .5rem; padding-left: 1.35rem; }
.cm-admin-withdrawal-steps li { margin: .2rem 0; font-size: .91rem; }
.cm-admin-withdrawal-action { display: inline-flex; align-self: flex-start; align-items: center; justify-content: center; border: 0; border-radius: 8px; padding: .55rem .9rem; background: #f0b72b; color: #231b0b; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; }
.cm-admin-withdrawal-action:hover, .cm-admin-withdrawal-action:focus-visible { background: #ffd568; color: #231b0b; text-decoration: none; }
.cm-admin-withdrawal-action:disabled { cursor: not-allowed; opacity: .55; background: #b79d6b; }
.cm-admin-withdrawal-history { border-top: 1px solid rgba(255,255,255,.18); padding-top: .5rem; font-size: .86rem; }
.cm-admin-withdrawal-history summary { cursor: pointer; font-weight: 650; }
.cm-admin-withdrawal-history p { margin: .3rem 0; overflow-wrap: anywhere; font-size: .86rem; white-space: pre-wrap; }
#cm-recipe-publication { scroll-margin-top: 110px; }
@media (max-width: 620px) { .cm-admin-withdrawal-panel { padding: .9rem; } }

html.cm-image-viewer-open, html.cm-image-viewer-open body { overflow: hidden; overscroll-behavior: none; }
.cm-image-viewer {
    position: fixed; inset: 0; margin: 0; padding: 0; border: 0;
    width: 100%; max-width: none; height: 100%; height: 100dvh; max-height: none;
    box-sizing: border-box; background: #10100f; color: #fff; overflow: hidden;
    font-family: inherit;
}
.cm-image-viewer[open] { display: flex; flex-direction: column; }
.cm-image-viewer::backdrop { background: #10100f; }
.cm-image-viewer [hidden] { display: none !important; }
.cm-image-viewer button {
    display: grid; place-items: center; flex: none; min-width: 40px; min-height: 40px;
    padding: .3rem .65rem; border: 1px solid #625746; border-radius: 9px;
    background: #292621; color: #fff; font: inherit; font-weight: 700; cursor: pointer;
}
.cm-image-viewer button:hover:not(:disabled) { background: #f4b72b; color: #211b13; }
.cm-image-viewer button:disabled { opacity: .35; cursor: default; }
.cm-image-viewer button:focus-visible, .cm-iv-stage:focus-visible { outline: 2px solid #f4b72b; outline-offset: -2px; }
.cm-iv-header { display: flex; align-items: center; gap: .6rem; padding: .5rem .85rem; flex: none; }
.cm-iv-counter { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; }
.cm-iv-badge { min-width: 0; padding: .3rem .5rem; border-radius: 7px; font-size: .75rem; background: #65417a; overflow-wrap: anywhere; }
.cm-image-viewer .cm-iv-close { margin-left: auto; font-size: 1.2rem; }
.cm-iv-body { position: relative; flex: 1; min-height: 0; min-width: 0; padding: 0 3.2rem; display: flex; }
.cm-iv-body:has(.cm-iv-prev[hidden]) { padding-inline: .5rem; }
.cm-iv-stage { flex: 1; position: relative; min-width: 0; min-height: 0; overflow: hidden; touch-action: none; }
.cm-iv-stage:not(.is-zoomed) .cm-iv-canvas img { cursor: zoom-out; }
.cm-iv-stage.is-zoomed { cursor: grab; }
.cm-iv-stage.is-dragging { cursor: grabbing; }
.cm-iv-canvas { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.cm-iv-canvas img { display: block; max-width: none; max-height: none; flex: none; object-fit: contain; user-select: none; }
.cm-iv-canvas img:not([style*="width"]) { max-width: 100%; max-height: 100%; }
.cm-iv-error { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; pointer-events: none; }
.cm-image-viewer .cm-iv-prev, .cm-image-viewer .cm-iv-next { position: absolute; top: 50%; transform: translateY(-50%); font-size: 1.9rem; line-height: 1; }
.cm-image-viewer .cm-iv-prev { left: .35rem; }
.cm-image-viewer .cm-iv-next { right: .35rem; }
.cm-iv-footer { flex: none; display: flex; flex-direction: column; align-items: center; gap: .45rem; padding: .5rem .5rem max(.5rem, env(safe-area-inset-bottom)); }
.cm-iv-controls { display: flex; align-items: center; gap: .45rem; }
.cm-iv-level { min-width: 4.1em; text-align: center; font-variant-numeric: tabular-nums; }
.cm-iv-thumbs { position: relative; display: flex; gap: .4rem; max-width: 100%; overflow-x: auto; padding: 2px; }
.cm-image-viewer .cm-iv-thumbs button { width: 76px; min-height: 0; aspect-ratio: 16 / 9; padding: 0; overflow: hidden; border: 2px solid transparent; }
.cm-iv-thumbs img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cm-image-viewer .cm-iv-thumbs button[aria-current="true"] { border-color: #f4b72b; }
@media (max-width: 600px) {
    .cm-iv-body { padding-inline: 0; }
    .cm-image-viewer .cm-iv-prev, .cm-image-viewer .cm-iv-next { background: rgba(30,27,22,.75); }
    .cm-image-viewer .cm-iv-thumbs button { width: 60px; }
}
@media (max-height: 450px) { .cm-iv-thumbs { display: none; } .cm-iv-footer, .cm-iv-header { padding-block: .2rem; } }

/* Articles associes a la recette : discret pour ne pas concurrencer la fiche principale. */
.cm-recipe-articles { min-width:0; padding:clamp(1.15rem,3vw,1.65rem); border:1px solid rgba(255,214,100,.15); border-radius:22px 9px 22px 9px; background:linear-gradient(135deg,#26251e,#1d1d19); }
.cm-recipe-articles-heading { display:flex; justify-content:space-between; align-items:center; gap:1rem; margin-bottom:1.1rem; }
.cm-recipe-articles-kicker { color:#f4b72b; font-size:.71rem; font-weight:850; text-transform:uppercase; letter-spacing:.12em; }
.cm-recipe-articles-heading h2 { margin:.35rem 0 .35rem; color:#fff1d3; font:700 clamp(1.2rem,2vw,1.5rem)/1.2 Georgia,serif; }
.cm-recipe-articles-heading p { margin:0; color:#c2b6a3; font-size:.89rem; }
.cm-recipe-articles-add { flex:none; border:1px solid #ebbb50; border-radius:11px; background:#f3bf50; padding:.62rem 1rem; color:#211d14; font-weight:850; cursor:pointer; }
.cm-recipe-articles-add:hover { background:#ffe29a; }
.cm-recipe-articles-add span { font-size:1.25rem; vertical-align:-.05em; }
.cm-recipe-articles-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,330px),1fr)); gap:.75rem; }
.cm-recipe-articles-card { position:relative; min-width:0; border:1px solid rgba(245,195,92,.18); background:rgba(12,12,11,.37); border-radius:14px; overflow:hidden; }
.cm-recipe-articles-card-content { display:flex; min-height:113px; color:inherit; text-decoration:none; outline-offset:-3px; }
.cm-recipe-articles-card-content:hover { background:rgba(245,195,92,.075); }
.cm-recipe-articles-image { display:grid; flex:0 0 125px; width:125px; place-items:center; overflow:hidden; color:#f3bd4d; font-size:1.8rem; background:#3b362a; }
.cm-recipe-articles-image img { width:100%; height:100%; object-fit:cover; }
.cm-recipe-articles-description { min-width:0; display:flex; flex-direction:column; align-items:flex-start; gap:.24rem; justify-content:center; padding:.8rem 2.1rem .8rem .85rem; }
.cm-recipe-articles-category { color:#eebf5a; font-size:.69rem; font-weight:850; text-transform:uppercase; }
.cm-recipe-articles-description strong { color:#fff0d1; line-height:1.25; font-size:1rem; overflow-wrap:anywhere; }
.cm-recipe-articles-excerpt { font-size:.79rem; color:#c6bdaf; line-height:1.36; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.cm-recipe-articles-state { margin-top:.2rem; border:1px solid #8a7847; color:#f4d996; font-weight:800; border-radius:6px; padding:.1rem .4rem; font-size:.69rem; }
.cm-recipe-articles-remove { position:absolute; top:.35rem; right:.35rem; display:grid; place-items:center; width:27px; height:27px; border:1px solid #c55b5b; border-radius:8px; color:#ffbbbb; background:#562326; cursor:pointer; font-size:1.23rem; line-height:1; z-index:1; }
.cm-recipe-articles-remove:hover { color:white; background:#ac343b; }
.cm-recipe-articles-empty { margin:0; color:#c7bcab; font-style:italic; }
.cm-recipe-articles-status:not(:empty) { margin:.7rem 0 0; color:#d8e7c4; font-size:.86rem; }
.cm-recipe-articles-status[data-error="true"] { color:#ffb3b3; }
.cm-recipe-articles [data-cm-recipe-articles-token] { display:none; }
.cm-recipe-articles-dialog { width:min(680px,calc(100vw - 1.4rem)); max-height:min(90vh,860px); max-height:min(90dvh,860px); padding:0; border:1px solid #79663b; border-radius:18px; background:#24231e; color:#f5efe1; box-shadow:0 24px 85px rgba(0,0,0,.7); }
.cm-recipe-articles-dialog::backdrop { background:rgba(0,0,0,.75); }
.cm-recipe-articles-dialog-inner { padding:clamp(1rem,3vw,1.55rem); }
.cm-recipe-articles-dialog-header { display:flex; justify-content:space-between; gap:1rem; align-items:flex-start; }
.cm-recipe-articles-dialog-header h2 { margin:.2rem 0 .35rem; color:#ffedc8; font:700 1.48rem Georgia,serif; }
.cm-recipe-articles-dialog-header p { margin:0 0 1rem; color:#c7bead; font-size:.89rem; }
.cm-recipe-articles-dialog-close { flex:none; width:34px; height:34px; border:1px solid #746a59; border-radius:8px; background:#3b372d; color:#fff1d1; font-size:1.4rem; cursor:pointer; }
.cm-recipe-articles-search-label { display:block; margin:.35rem 0; font-size:.82rem; font-weight:750; color:#edcd89; }
.cm-recipe-articles-search { display:block; width:100%; padding:.78rem .9rem; border:1px solid #81704e; border-radius:9px; color:#fff; background:#151511; font:inherit; }
.cm-recipe-articles-search:focus-visible { outline:2px solid #ffc757; outline-offset:2px; }
.cm-recipe-articles-search-status { min-height:1.3em; color:#c9beaa; font-size:.82rem; margin:.7rem 0 .4rem; }
.cm-recipe-articles-search-status[data-error="true"] { color:#ffadad; }
.cm-recipe-articles-results { display:grid; gap:.52rem; max-height:min(48vh,470px); overflow-y:auto; padding:.15rem .1rem .2rem; }
.cm-recipe-articles-result { display:flex; align-items:center; gap:.75rem; width:100%; text-align:left; background:#343128; border:1px solid #534a38; color:#f4e8d3; border-radius:11px; padding:.48rem; cursor:pointer; }
.cm-recipe-articles-result:hover:not(:disabled),.cm-recipe-articles-result:focus-visible { background:#4b402e; border-color:#e7b34a; }
.cm-recipe-articles-result:disabled { opacity:.5; cursor:wait; }
.cm-recipe-articles-result-image { flex:none; width:72px; height:56px; display:grid; place-items:center; overflow:hidden; background:#22201b; color:#eab94f; font-size:1.4rem; border-radius:7px; }
.cm-recipe-articles-result-image img { display:block; width:100%; height:100%; object-fit:cover; }
.cm-recipe-articles-result-text { display:flex; flex:1; min-width:0; flex-direction:column; gap:.18rem; }
.cm-recipe-articles-result-text strong { font-size:.9rem; overflow-wrap:anywhere; }
.cm-recipe-articles-result-meta { color:#ead09a; font-size:.74rem; }
.cm-recipe-articles-result-excerpt { color:#beb5a5; font-size:.78rem; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.cm-recipe-articles-dialog-footer { display:flex; justify-content:flex-end; margin-top:1rem; }
.cm-recipe-articles-dialog-footer button { border:1px solid #777061; background:#3a3831; border-radius:8px; color:#f9efd6; padding:.57rem 1.1rem; cursor:pointer; }
@media (max-width:480px) { .cm-recipe-articles-image { flex-basis:94px; width:94px; } .cm-recipe-articles-description { padding:.68rem 1.9rem .68rem .65rem; } .cm-recipe-articles-heading { align-items:flex-start; } }

/* Barre d'actions partagee des fiches en edition : sous le bandeau de marque, hors navigation. */
.cm-editor-bar { position:sticky; top:var(--editor-header-height,108px); z-index:30; min-width:0; isolation:isolate; }
.cm-editor-bar::before { content:""; position:absolute; inset-block:0; left:50%; width:100vw; z-index:-1; transform:translateX(-50%); background:rgba(29,28,24,.985); border-top:1px solid rgba(255,214,100,.14); border-bottom:1px solid rgba(255,214,100,.14); box-shadow:0 14px 35px rgba(0,0,0,.28); backdrop-filter:blur(12px); }
.cm-editor-bar-content { display:flex; width:100%; min-height:72px; justify-content:space-between; align-items:center; gap:1rem; margin:0; padding:.8rem 0; }
.cm-editor-bar-left { display:flex; align-items:center; gap:.85rem; flex-wrap:wrap; }
.cm-editor-bar-left > span { font-size:.82rem; color:#a99d8a; }
.cm-editor-bar-return { display:inline-flex; align-items:center; min-height:36px; padding:0 .8rem; border:1px solid rgba(255,214,100,.18); border-radius:9px; background:rgba(244,183,43,.07); color:#ffe39b; text-decoration:none; font-size:.82rem; font-weight:850; }
.cm-editor-bar-return:hover { background:rgba(244,183,43,.13); }
.cm-editor-bar button[type=submit] { display:inline-flex; align-items:center; justify-content:center; min-height:42px; padding:.65rem 1.1rem; border:0; border-radius:10px; background:#f4b72b; color:#211f19; font:inherit; font-weight:850; cursor:pointer; white-space:nowrap; }
.cm-editor-bar button[type=submit]:disabled { opacity:.52; cursor:default; }
.cm-editor-bar button[type=submit][data-cm-saving=true] { cursor:progress; }
@media(max-width:760px){ .cm-editor-bar { top:0; } }
@media(max-width:620px){ .cm-editor-bar-content { align-items:stretch; flex-direction:column; min-height:68px; } .cm-editor-bar-left { justify-content:space-between; } .cm-editor-bar button[type=submit]{width:100%;} }

/* Variante partagée pour une barre courte sur smartphone (profil et futurs formulaires). */
@media(max-width:620px) {
    .cm-editor-bar--inline-mobile .cm-editor-bar-content { flex-direction:row; align-items:center; }
    .cm-editor-bar--inline-mobile .cm-editor-bar-left { min-width:0; flex-wrap:nowrap; gap:.5rem; }
    .cm-editor-bar--inline-mobile .cm-editor-bar-left > span { display:none; }
    .cm-editor-bar--inline-mobile button[type=submit] { width:auto; min-height:40px; padding:.5rem .7rem; font-size:.83rem; }
}

/* Le mode Dirty doit rester clairement identifiable, meme apres la courte animation. */
.cm-dirty-save-attention:not(:disabled) {
    outline: 3px solid #ffe17b;
    outline-offset: 3px;
    box-shadow: 0 0 0 6px rgba(255, 191, 39, .30),
                0 0 26px 10px rgba(255, 174, 0, .48);
    filter: brightness(1.14);
    transform-origin: center;
    animation: cm-dirty-save-beacon 1.25s ease-in-out 4;
}

@keyframes cm-dirty-save-beacon {
    0%, 100% {
        transform: scale(1);
        outline-color: #ffe17b;
        box-shadow: 0 0 0 6px rgba(255, 191, 39, .30),
                    0 0 26px 10px rgba(255, 174, 0, .48);
    }
    48% {
        transform: scale(1.07);
        outline-color: #fff3b6;
        box-shadow: 0 0 0 11px rgba(255, 201, 61, .46),
                    0 0 38px 17px rgba(255, 183, 0, .76);
    }
}

@media (prefers-reduced-motion: reduce) {
    .cm-dirty-save-attention:not(:disabled) {
        animation: none;
        transform: none;
    }
}

/* Case dorée réutilisable : <label class="cm-gold-checkbox"><input class="cm-gold-checkbox-input" type="checkbox">... */
.cm-gold-checkbox { display:flex; align-items:flex-start; gap:.85rem; color:#e8dfcd; cursor:pointer; }
.cm-gold-checkbox:hover .cm-gold-checkbox-copy strong { color:#ffda7f; }
.cm-gold-checkbox-input { appearance:none; -webkit-appearance:none; position:relative; flex:0 0 28px; width:28px; height:28px; margin:0; border:2px solid #c69c43; border-radius:8px; background:#1a1915; cursor:pointer; transition:background .16s ease,border-color .16s ease,box-shadow .16s ease; }
.cm-gold-checkbox-input:checked { background:#f4b72b; border-color:#f4b72b; }
.cm-gold-checkbox-input:checked::after { content:""; position:absolute; top:3px; left:8px; width:7px; height:12px; transform:rotate(42deg); border:solid #221c10; border-width:0 3px 3px 0; }
.cm-gold-checkbox-input:focus-visible { outline:3px solid #fff0ad; outline-offset:3px; }
.cm-gold-checkbox-input:disabled { cursor:wait; opacity:.65; }
.cm-gold-checkbox-copy { display:grid; gap:.22rem; line-height:1.4; }
.cm-gold-checkbox-copy strong { color:#fff1c9; font-size:.94rem; }
.cm-gold-checkbox-copy > span { color:#beb3a2; font-size:.82rem; }
@media (prefers-reduced-motion: reduce) { .cm-gold-checkbox-input { transition:none; } }

/* Felicitations aux cuistots : fond assombri, or CarnetMiam et halo du bouton Enregistrer. */
.cm-defi-victory-dialog {
    box-sizing: border-box;
    position: fixed;
    margin: auto;
    inset: 0;
    width: min(980px, calc(100vw - 36px));
    max-width: unset;
    max-height: min(880px, calc(100dvh - 28px));
    overflow-y: auto;
    padding: 0;
    border: 2px solid #ffcc4f;
    border-radius: 32px;
    color: #fff2cf;
    background: radial-gradient(ellipse at 18% 35%, #50310d 0, #291e18 42%, #1b1917 83%);
    box-shadow: 0 24px 90px rgba(0,0,0,.82), 0 0 30px rgba(255,186,46,.52);
    animation: cm-defi-victory-beacon 1.25s ease-in-out 4;
    overscroll-behavior: contain;
}
.cm-defi-victory-dialog::backdrop {
    background: rgba(6, 5, 4, .78);
    backdrop-filter: blur(3px);
}
@keyframes cm-defi-victory-beacon {
    0%, 100% {
        border-color: #ffcc4f;
        box-shadow: 0 24px 90px rgba(0,0,0,.82), 0 0 0 4px rgba(255,191,39,.25), 0 0 26px 10px rgba(255,174,0,.38);
    }
    48% {
        border-color: #fff5b2;
        box-shadow: 0 24px 90px rgba(0,0,0,.82), 0 0 0 10px rgba(255,201,61,.43), 0 0 40px 19px rgba(255,183,0,.75);
    }
}
.cm-defi-victory-dialog * { box-sizing: border-box; }
.cm-defi-victory-inner { padding: 26px 34px 30px; position: relative; }
.cm-defi-victory-head { text-align: center; padding: 1px 26px 0; }
.cm-defi-victory-kicker {
    display: inline-flex; gap: 8px; align-items: center; justify-content: center;
    border: 1px solid rgba(255,199,50,.9); padding: 8px 18px;
    border-radius: 100px; background: linear-gradient(#4c3725,#30261d);
    font-weight: 800; font-size: 1.02rem; color: #ffca42;
}
.cm-defi-victory-head h2 {
    margin: 10px 0 2px; color: #fff5e1; font-size: clamp(2.05rem, 4.6vw, 3.5rem);
    font-weight: 900; line-height: 1.13; text-shadow: 0 3px 15px rgba(228,149,27,.38);
}
.cm-defi-victory-subtitle { margin: 6px 0 0; font-size: 1.04rem; color: #f3d9a8; }
.cm-defi-victory-close {
    position: absolute; top: 19px; right: 20px; z-index: 2;
    display: grid; place-items: center; width: 40px; height: 40px;
    border: 1px solid rgba(255,255,255,.24); border-radius: 50%;
    background: #413631; color: #fff8ef; font-size: 1.65rem; cursor: pointer;
}
.cm-defi-victory-close:hover, .cm-defi-victory-close:focus-visible { background: #62452c; outline-color: #ffe17b; }
.cm-defi-victory-content {
    display: grid; grid-template-columns: 41% minmax(0,1fr); align-items: center;
    gap: 4px; margin-top: 4px;
}
.cm-defi-victory-mascot { position: relative; min-width: 0; filter: drop-shadow(0 12px 14px rgba(0,0,0,.42)); }
.cm-defi-victory-mascot-image { display: block; width: 100%; aspect-ratio: 1; background-position: center; background-repeat: no-repeat; background-size: contain; }
.cm-defi-victory-dialog[open] .cm-defi-victory-mascot-image { background-image: url("/images/defis/carnet-victoire.webp?v=2"); }
.cm-defi-victory-sparkle { position: absolute; color: #ffd44e; text-shadow: 0 0 15px #ffc338; font-size: 2rem; }
.cm-defi-victory-sparkle-a { top: 11%; left: 15%; }
.cm-defi-victory-sparkle-b { right: 1%; top: 28%; }
.cm-defi-victory-sparkle-c { bottom: 11%; right: 20%; }
.cm-defi-victory-right { min-width: 0; text-align: center; padding: 0 6px 3px 0; }
.cm-defi-victory-ribbon {
    display: flex; justify-content: center; gap: 14px; align-items: center;
    background: linear-gradient(110deg,#ffe29a,#ffc64e,#ffe7a2);
    color: #432808; padding: 16px 18px; margin-bottom: 19px;
    border-radius: 13px; box-shadow: 0 4px 17px rgba(255,185,35,.32);
    font-size: clamp(1.2rem,2.5vw,1.6rem); font-weight: 800;
}
.cm-defi-victory-ribbon span { display: grid; place-items: center; background: #47b923; color: white; width: 29px; height: 29px; border-radius: 50%; }
/* La consigne de definition explique le gain sans renvoyer vers une autre page. */
.cm-defi-victory-reason {
    margin: -7px auto 15px; max-width: 480px; padding: 10px 14px;
    border-left: 3px solid #ffce53; border-radius: 8px;
    background: rgba(255, 205, 95, .09); color: #ffebc7;
    font-size: .97rem; line-height: 1.48; text-align: left;
}
.cm-defi-victory-credit-badge {
    display: inline-flex; align-items: center; justify-content: center; gap: 11px;
    padding: 12px 28px; border-radius: 80px; border: 2px solid #ffcf38;
    background: linear-gradient(180deg, #694111, #3f2d1d);
    box-shadow: 0 0 17px rgba(255,195,42,.6), inset 0 0 15px rgba(255,172,32,.08);
    color: #ffe29b; font-size: clamp(1.45rem, 3vw, 2.05rem); font-weight: 900;
}
.cm-defi-victory-message { max-width: 480px; margin: 19px auto; color: #f4e7d3; line-height: 1.45; font-size: 1.03rem; }
.cm-defi-victory-progress {
    display: flex; align-items: center; gap: 13px; text-align: left;
    padding: 14px 16px; margin: 0 auto; border: 1px solid rgba(255,221,178,.33);
    background: rgba(255,255,255,.04); border-radius: 17px; max-width: 500px;
}
.cm-defi-victory-progress > span { font-size: 1.25rem; }
.cm-defi-victory-progress-copy { flex: 1; min-width: 0; font-size: .94rem; font-weight: 700; }
.cm-defi-victory-track { height: 9px; border-radius: 99px; background: #655f5a; margin-top: 8px; overflow: hidden; }
.cm-defi-victory-track > span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg,#f3aa05,#ffdf4c); transition: width .35s ease; }
.cm-defi-victory-rewards { display: flex; flex-direction: column; gap: 9px; max-height: 265px; overflow: auto; margin-bottom: 16px; text-align: left; }
.cm-defi-victory-reward {
    display: grid; grid-template-columns: 24px minmax(0,1fr) auto; align-items: center; gap: 10px;
    padding: 12px; border: 1px solid rgba(251,197,99,.36); border-radius: 13px;
    background: rgba(255,211,105,.07);
}
.cm-defi-victory-reward-check { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; background: #55c92d; color: #173405; font-weight: 900; }
.cm-defi-victory-reward-copy { min-width: 0; }
.cm-defi-victory-reward-reason { margin: 5px 0 0; color: #eedbc0; font-size: .82rem; line-height: 1.4; }
.cm-defi-victory-reward-title { font-size: .93rem; font-weight: 700; line-height: 1.25; }
.cm-defi-victory-reward-credits { color: #ffe087; white-space: nowrap; font-size: .88rem; font-weight: 800; }
.cm-defi-victory-actions { display: flex; gap: 15px; justify-content: center; margin-top: 6px; }
.cm-defi-victory-actions button { min-height: 53px; border-radius: 15px; font-size: 1.03rem; font-weight: 900; padding: 12px 25px; cursor: pointer; }
.cm-defi-victory-primary { color: #362009; background: linear-gradient(#ffdb66,#ffb900); border: 1px solid #ffe9a2; box-shadow: inset 0 1px #fff3b2, 0 5px 18px rgba(255,174,17,.23); }
.cm-defi-victory-secondary { color: #fff0df; border: 1px solid #ba9e83; background: #372d28; }
.cm-defi-victory-actions button:hover { filter: brightness(1.09); }
.cm-defi-victory-actions button:focus-visible { outline: 3px solid #ffe27e; outline-offset: 2px; }
.cm-defi-victory-actions button:disabled { cursor: wait; opacity: .6; }
.cm-defi-victory-error { text-align: center; color: #ffd48c; margin: 8px 0; }
.cm-defi-victory-dialog [hidden] { display: none !important; }
@media(max-width: 780px) {
    .cm-defi-victory-dialog { width: min(550px,calc(100vw - 18px)); border-radius: 20px; max-height: calc(100dvh - 14px); }
    .cm-defi-victory-inner { padding: 19px 17px 22px; }
    .cm-defi-victory-head { padding: 5px 28px 0; }
    .cm-defi-victory-content { grid-template-columns: 1fr; justify-items: center; }
    .cm-defi-victory-mascot { width: 100%; max-width: min(235px,49vw); margin: -9px auto -6px; }
    .cm-defi-victory-right { width: 100%; padding: 0; }
    .cm-defi-victory-message { margin: 12px auto; }
    .cm-defi-victory-actions { gap: 9px; }
    .cm-defi-victory-actions button { flex: 1; font-size: .9rem; padding: 12px 5px; }
    .cm-defi-victory-close { top: 8px; right: 8px; }
    .cm-defi-victory-rewards { max-height: 180px; }
    .cm-defi-victory-reward { grid-template-columns: 20px minmax(0,1fr); gap: 8px; }
    .cm-defi-victory-reward-credits { grid-column: 2; justify-self: start; }
}
@media(max-width: 370px) { .cm-defi-victory-head h2 { font-size: 1.75rem; } .cm-defi-victory-mascot { max-width: 140px; } }
@media(prefers-reduced-motion:reduce) {
    .cm-defi-victory-dialog { animation: none; }
    .cm-defi-victory-track > span { transition: none; }
}

/* La proposition est large sur desktop pour supprimer le défilement intérieur habituel. */
.cm-journal-dialog {
    width: min(94vw, 850px);
    max-height: calc(100dvh - 24px);
    padding: 0;
    border: 1px solid rgba(255, 205, 91, .28);
    border-radius: 20px;
    background: #25231f;
    color: #f7f1e6;
    box-shadow: 0 30px 95px rgba(0, 0, 0, .65);
    overflow-y: auto; /* Secours uniquement sur les petits écrans/polices agrandies. */
}
.cm-journal-dialog::backdrop { background: rgba(0, 0, 0, .75); backdrop-filter: blur(3px); }
.cm-journal-content { position: relative; padding: clamp(24px, 3vw, 36px); }
.cm-journal-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: clamp(22px, 3vw, 38px); align-items: center; }
.cm-journal-intro, .cm-journal-details { min-width: 0; }
.cm-journal-intro { text-align: center; }
.cm-journal-icon {
    display: grid; place-items: center; width: 60px; height: 60px; margin: 0 auto 17px;
    border-radius: 50%; background: #423a26; color: #ffcb56; font-size: 2rem;
}
.cm-journal-kicker { color: #e8c376; font-size: .72rem; letter-spacing: .08em; font-weight: 750; margin: 0 0 10px; }
.cm-journal-dialog h2 { margin: 0 0 15px; color: #fff4dc; font-size: clamp(1.45rem, 2.65vw, 1.92rem); line-height: 1.18; }
.cm-journal-dialog #cm-journal-description { margin: 0; color: #ded6cb; line-height: 1.55; }
.cm-journal-benefits {
    list-style: none; padding: 14px 18px; margin: 0 0 14px; border-radius: 12px;
    background: #34312b; text-align: left;
}
.cm-journal-benefits li { position: relative; padding: 7px 0 7px 25px; line-height: 1.38; font-size: .94rem; }
.cm-journal-benefits li::before { content: '✓'; position: absolute; top: 6px; left: 0; color: #ffd16a; font-weight: bold; }
.cm-journal-fineprint { color: #bdb5aa; font-size: .82rem; line-height: 1.5; margin: 0 0 14px; text-align: center; }
.cm-journal-actions { display: grid; gap: 10px; }
.cm-journal-actions button { min-height: 44px; padding: 10px 12px; border-radius: 10px; font-weight: 700; cursor: pointer; }
.cm-journal-accept { background: #f7ba29; color: #201a10; border: 1px solid #f7ba29; }
.cm-journal-accept:hover { background: #ffd16b; }
.cm-journal-decline { background: transparent; border: 1px solid #756d60; color: #f2e9db; }
.cm-journal-decline:hover { background: #3a3731; }
.cm-journal-actions button:disabled { opacity: .65; cursor: wait; }
.cm-journal-error { color: #ffb9aa; font-size: .9rem; margin: 12px 0 0; }
.cm-journal-error[hidden] { display: none; }
.cm-journal-dialog :focus-visible { outline: 2px solid #ffdc80; outline-offset: 2px; }
@media (max-width: 700px) {
    .cm-journal-dialog { width: min(94vw, 465px); }
    .cm-journal-content { padding: 21px 22px; }
    .cm-journal-layout { grid-template-columns: 1fr; gap: 14px; }
    .cm-journal-icon { width: 47px; height: 47px; font-size: 1.65rem; margin-bottom: 8px; }
    .cm-journal-kicker { font-size: .66rem; line-height: 1.3; margin-bottom: 6px; padding: 0 15px; }
    .cm-journal-dialog h2 { font-size: clamp(1.4rem, 5vw, 1.7rem); margin-bottom: 9px; }
    .cm-journal-dialog #cm-journal-description { font-size: .89rem; line-height: 1.4; }
    .cm-journal-benefits { padding: 10px 14px; margin-bottom: 10px; }
    .cm-journal-benefits li { padding: 4px 0 4px 24px; font-size: .86rem; }
    .cm-journal-benefits li::before { top: 4px; }
    .cm-journal-fineprint { margin-bottom: 11px; font-size: .77rem; line-height: 1.35; }
    .cm-journal-actions { gap: 8px; }
    .cm-journal-actions button { min-height: 42px; padding: 8px 10px; }
}
@media (max-height: 680px) and (max-width: 700px) {
    .cm-journal-content { padding: 15px 18px; }
    .cm-journal-layout { gap: 9px; }
    .cm-journal-icon { width: 38px; height: 38px; font-size: 1.35rem; margin-bottom: 5px; }
    .cm-journal-dialog h2 { margin-bottom: 5px; }
    .cm-journal-benefits { padding: 7px 12px; margin-bottom: 7px; }
    .cm-journal-benefits li { padding-top: 3px; padding-bottom: 3px; }
    .cm-journal-fineprint { margin-bottom: 7px; }
    .cm-journal-actions button { min-height: 39px; }
}
@media (prefers-reduced-motion: reduce) { .cm-journal-dialog::backdrop { backdrop-filter: none; } }

/* Feedback commun aux formulaires : flottant, accessible et sans déplacement de page. */
.cm-toast {
    position: fixed;
    z-index: 1250;
    top: clamp(100px, 14vh, 152px);
    right: max(16px, env(safe-area-inset-right));
    width: min(400px, calc(100vw - 32px));
    max-height: min(60vh, 440px);
    overflow-y: auto;
    display: flex;
    align-items: flex-start;
    gap: .8rem;
    padding: 1rem;
    box-sizing: border-box;
    border: 1px solid rgba(144, 200, 115, .42);
    border-left: 4px solid #a8d38a;
    border-radius: 14px;
    background: #25271f;
    color: #f4f1e8;
    box-shadow: 0 16px 45px rgba(0, 0, 0, .48);
    font-size: .88rem;
    line-height: 1.45;
}
.cm-toast[hidden], .cm-toast-action[hidden] { display: none !important; }
.cm-toast-symbol {
    display: grid;
    place-items: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(144, 200, 115, .14);
    color: #c6e6a5;
    font-size: 1.15rem;
    font-weight: 900;
}
.cm-toast-copy { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.cm-toast-title { display: block; margin: .08rem 0 .25rem; font-weight: 850; }
.cm-toast-message { margin: 0; color: #d0cfc6; white-space: pre-wrap; }
.cm-toast-close {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, .07);
    color: #ded8c9;
    font: inherit;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}
.cm-toast-close:hover, .cm-toast-close:focus-visible { background: rgba(255, 255, 255, .16); }
.cm-toast-action {
    margin-top: .65rem;
    padding: .3rem .6rem;
    border: 1px solid rgba(255, 210, 130, .4);
    border-radius: 8px;
    background: rgba(255, 210, 130, .08);
    color: #ffe09d;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
}
.cm-toast-action:hover, .cm-toast-action:focus-visible { background: rgba(255, 210, 130, .16); }
.cm-toast-error {
    border-color: rgba(255, 127, 111, .5);
    border-left-color: #ff9382;
    background: #302321;
}
.cm-toast-error .cm-toast-symbol { background: rgba(255, 127, 111, .14); color: #ffb6a9; }
@media (max-width: 620px) {
    .cm-toast { top: max(12px, env(safe-area-inset-top)); right: 12px; width: calc(100vw - 24px); padding: .8rem; }
}

/* Le feuillet annoté se distingue du livre ouvert utilisé pour les albums. */
.cm-personal-note-icon { display:block; width:20px; height:20px; }
#cm-personal-note-dialog .cm-dialog-actions [hidden] { display:none !important; }
#cm-personal-note-dialog .cm-dialog-icon .cm-personal-note-icon { width:27px; height:27px; }
.cm-recipe-card-tools-note { flex:0 0 38px; padding:.25rem .15rem; }
.cm-recipe-card-note-action { color:#b7ab90; }
.cm-recipe-card-note-action:hover,.cm-recipe-card-note-action:focus-visible { color:#ffcb53; }
.cm-recipe-card-note-action[data-cm-note-state="filled"] { color:#f8b923; }
.cm-recipe-card-note-action[data-cm-note-state="filled"] .cm-personal-note-icon { fill:rgba(248,185,35,.16); }
.cm-personal-note-block { margin:clamp(1rem,2.4vw,1.6rem) 0; padding:clamp(1.1rem,3vw,1.7rem); color:#eee7d8; border:1px solid rgba(255,214,100,.17); border-radius:22px 9px 22px 9px; background:#24231e; }
.cm-personal-note-heading { display:flex; gap:.85rem; align-items:center; }
.cm-personal-note-heading-icon { color:#ffc43a; display:grid; place-items:center; width:39px; height:39px; border-radius:11px; background:#3b301b; flex-shrink:0; }
.cm-personal-note-heading-icon .cm-personal-note-icon { width:24px; height:24px; }
.cm-personal-note-kicker { color:#ffbe29; font-size:.69rem; font-weight:800; letter-spacing:.09em; }
.cm-personal-note-heading h2 { font-size:clamp(1.1rem,2.5vw,1.5rem); line-height:1.25; margin:.12rem 0 0; }
.cm-personal-note-private { margin-left:auto; color:#c3b497; font-size:.78rem; border:1px solid rgba(255,214,100,.22); border-radius:20px; padding:.25rem .65rem; }
.cm-personal-note-block > p { color:#cbc0aa; margin:.8rem 0 1rem; }
.cm-personal-note-block textarea,.cm-personal-note-dialog textarea { display:block; box-sizing:border-box; width:100%; min-height:100px; padding:.8rem .9rem; color:#fff1d6; background:#181813; border:1px solid #645333; border-radius:10px; font:inherit; line-height:1.5; resize:vertical; }
.cm-personal-note-block textarea:focus,.cm-personal-note-dialog textarea:focus { border-color:#ffc543; outline:2px solid rgba(255,192,43,.25); }
.cm-personal-note-block textarea:disabled { opacity:.7; }
/* La note longue grandit à l'ouverture et lors de la saisie, sans étirer toute la fiche. */
.cm-personal-note-block textarea[data-cm-note-text] { max-height:360px; overflow-y:auto; }
.cm-personal-note-bottom { display:flex; align-items:center; justify-content:space-between; gap:.8rem; margin-top:.8rem; flex-wrap:wrap; }
.cm-personal-note-status,.cm-personal-note-dialog-status { font-size:.82rem; color:#cfc3a9; }
.cm-personal-note-status[data-error="true"],.cm-personal-note-dialog-status[data-error="true"] { color:#ffc0b2; }
.cm-personal-note-buttons { display:flex; gap:.6rem; margin-left:auto; }
.cm-personal-note-buttons button,.cm-personal-note-signin { display:inline-flex; align-items:center; justify-content:center; border-radius:9px; padding:.56rem .95rem; font:inherit; font-weight:650; cursor:pointer; text-decoration:none; }
.cm-personal-note-buttons button[data-cm-note-save],.cm-personal-note-signin { border:1px solid #eab42d; background:#f0b82e; color:#211910; }
.cm-personal-note-buttons button[data-cm-note-clear],.cm-personal-note-buttons button[data-cm-note-cancel] { border:1px solid #76613d; background:transparent; color:#e4cba2; }
.cm-personal-note-buttons [hidden] { display:none !important; }
.cm-personal-note-buttons button:disabled { cursor:default; opacity:.5; }
.cm-personal-note-recipe-title { color:#f7c963; font-weight:700; margin:0 0 .9rem; }
.cm-personal-note-dialog label { display:block; margin-bottom:.5rem; }
.cm-personal-note-dialog-status { min-height:1.3em; margin:.65rem 0 0; }
@media (max-width:480px) {
    .cm-recipe-card-tools-note { flex-basis:34px; }
    .cm-personal-note-heading { gap:.6rem; }
    .cm-personal-note-private { font-size:.7rem; padding:.2rem .5rem; }
}

@media (max-width: 540px) {
    .cm-recipe-card-tools > * { padding:.2rem .1rem; }
    .cm-recipe-card-tools-author { flex-basis:32px; }
    .cm-recipe-card-tools-album,.cm-recipe-card-tools-edit { flex-basis:32px; }
    .cm-recipe-card-tools-delete { flex-basis:34px; }
    .cm-recipe-card-tools-report { flex-basis:32px; }
    .cm-recipe-card-tools-visibility { max-width:35%; }
}

/* Sur la carte, une seule étoile représente la moyenne arrondie des appréciations. */
.cm-recipe-card-tools-rating { flex:0 0 38px; padding:.25rem .1rem !important; }
:is(.cm-recipe-card-rating-action, .cm-rating-personal) {
    --cm-rating-star-color:#978a6a;
    --cm-rating-star-fill:0%;
    color:var(--cm-rating-star-color);
}
:is(.cm-recipe-card-rating-action, .cm-rating-personal)[data-cm-rating-level="1"] { --cm-rating-star-color:#e67869;--cm-rating-star-fill:25%; }
:is(.cm-recipe-card-rating-action, .cm-rating-personal)[data-cm-rating-level="2"] { --cm-rating-star-color:#efa457;--cm-rating-star-fill:50%; }
:is(.cm-recipe-card-rating-action, .cm-rating-personal)[data-cm-rating-level="3"] { --cm-rating-star-color:#f3ca58;--cm-rating-star-fill:75%; }
:is(.cm-recipe-card-rating-action, .cm-rating-personal)[data-cm-rating-level="4"] { --cm-rating-star-color:#ffda76;--cm-rating-star-fill:100%; }
.cm-rating-star {position:relative;display:block;width:21px;height:21px;flex:none;}
.cm-rating-star-outline {position:absolute;inset:0;display:block;width:100%;height:100%;overflow:visible;}
.cm-rating-star-outline path {stroke:currentColor;stroke-width:2.1;stroke-linejoin:round;}
.cm-rating-star-shape {
    position:absolute;inset:0;
    -webkit-mask:url('/images/avis/etoile-pleine.svg') center/100% 100% no-repeat;
    mask:url('/images/avis/etoile-pleine.svg') center/100% 100% no-repeat;
}
.cm-rating-star-progress {
    position:absolute;inset:0 auto 0 0;width:var(--cm-rating-star-fill);
    background:var(--cm-rating-star-color);
}
:is(.cm-recipe-card-rating-action, .cm-rating-personal)[data-cm-rating-level="4"] .cm-rating-star {
    filter:drop-shadow(0 0 2px rgba(255,213,97,.78)) drop-shadow(0 0 3.5px rgba(255,176,42,.35));
}
/* Zéro avis : une étoile vide et discrète, mais toujours cliquable. */
.cm-recipe-card-rating-action.cm-rating-no-votes .cm-rating-star {opacity:.42;}
.cm-recipe-card-rating-action.cm-rating-no-votes:is(:hover,:focus-visible) .cm-rating-star {opacity:.9;}
.cm-detail-rating-action { cursor:pointer; }
.cm-detail-rating-icon img { display:block; width:32px; height:32px; object-fit:contain; }
.cm-detail-rating-action.cm-rating-no-votes .cm-detail-rating-icon img { opacity:.36; filter:saturate(.65); }
.cm-detail-rating-action.cm-rating-no-votes:is(:hover,:focus-visible) .cm-detail-rating-icon img { opacity:.9; filter:none; }
.cm-detail-rating-action:hover .cm-detail-rating-icon img { filter:drop-shadow(0 1px 2px rgba(0,0,0,.2)); }
.cm-rating-dialog-icon {display:block;width:31px;height:31px;}
.cm-rating-dialog { min-width:0; }
.cm-rating-dialog-recipe {margin:0 0 1rem;color:#f7c963;font-weight:750;text-align:center;line-height:1.3;}
.cm-rating-scale { display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px;padding:4px;border:1px solid rgba(244,183,43,.25);border-radius:18px 8px 18px 8px;background:#171711; }
.cm-rating-choice { min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.6rem;min-height:112px;padding:.68rem .2rem;border:1px solid transparent;border-radius:12px 6px 12px 6px;background:rgba(255,218,132,.06);color:#eadfc9;font:inherit;font-size:.78rem;font-weight:750;line-height:1.25;cursor:pointer;transition:background-color .14s ease,border-color .14s ease,transform .14s ease; }
.cm-rating-choice img {display:block;width:clamp(35px,7vw,51px);height:clamp(35px,7vw,51px);object-fit:contain;}
.cm-rating-choice span {display:block;text-align:center;}
.cm-rating-choice--none {background:rgba(190,181,159,.045);color:#bbb4a5;border-right:1px solid rgba(244,183,43,.2);}
.cm-rating-choice--none img { opacity:.48; filter:saturate(.65); }
.cm-rating-choice--none:is(:hover,:focus-visible,.is-selected) img { opacity:1; filter:none; }
.cm-rating-choice:hover:not(:disabled),.cm-rating-choice:focus-visible:not(:disabled) { background:#43361e;border-color:#d8aa4a;outline:2px solid #f2bd53;outline-offset:1px;transform:translateY(-1px); }
.cm-rating-choice.is-selected {background:linear-gradient(150deg,#55401d,#342a1d);border-color:#f2b936;color:#ffe4a6;box-shadow:inset 0 0 0 1px rgba(255,210,109,.22);}
.cm-rating-choice.is-selected::after {content:'✓';font-size:.85rem;font-weight:900;color:#ffcf5b;height:0;position:relative;top:-1px;align-self:flex-end;margin-right:10%;}
.cm-rating-choice:disabled {opacity:.58;cursor:progress;}
.cm-rating-dialog-hint {margin:.8rem 0 .2rem;text-align:center;color:#bbae93;font-size:.76rem;}
.cm-rating-dialog-status {margin:.35rem 0 0;min-height:1.2em;text-align:center;font-size:.78rem;color:#f5d27b;}
.cm-rating-dialog-status[data-error="true"] {color:#ffbca9;}
@media (max-width:540px) { .cm-recipe-card-tools-rating {flex-basis:32px;padding:.18rem .02rem !important;} .cm-rating-star {width:19px;height:19px;} .cm-rating-scale{gap:2px;padding:3px;} .cm-rating-choice{gap:.4rem;min-height:96px;padding:.6rem .1rem;font-size:.68rem;} .cm-rating-choice img{width:35px;height:35px;} }
@media (prefers-reduced-motion:reduce){.cm-rating-choice{transition:none;}.cm-rating-choice:hover{transform:none;}}

/* Informations nutritionnelles sous les deux colonnes Preparation / Ingredients. */
.cm-nutrition {
    min-width: 0;
    padding: clamp(1rem, 2.2vw, 1.55rem);
    border: 1px solid rgba(252, 215, 122, .19);
    border-radius: 24px 8px 24px 8px;
    color: #f8f5ee;
    background: linear-gradient(135deg, #28261f 0%, #1c1b18 77%);
    box-shadow: 0 22px 56px rgba(0,0,0,.27);
}
.cm-nutrition-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .8rem;
    flex-wrap: wrap;
    margin: 0 0 .85rem;
}
.cm-nutrition-header h2 {
    display: flex;
    align-items: center;
    gap: .7rem;
    margin: 0;
    font-family: Georgia, serif;
    font-size: clamp(1.4rem, 2.4vw, 2.15rem);
    line-height: 1.16;
    color: #fffaf1;
    letter-spacing: -.025em;
}
.cm-nutrition-heart { flex:0 0 40px; width:40px; height:40px; color:#ffc900; }
.cm-nutrition-info {
    display: inline-block;
    max-width: 100%;
    padding: .52rem .8rem;
    border: 1px solid rgba(255,255,255,.11);
    border-radius: 20px;
    background: rgba(255,255,255,.09);
    font-size: .78rem;
    color: #e9e6e0;
}
.cm-nutrition-overview {
    display: grid;
    grid-template-columns: minmax(155px, .9fr) minmax(150px, .9fr) minmax(0, 2.15fr);
    align-items: center;
    gap: clamp(.7rem, 2vw, 1.6rem);
    padding: clamp(1rem, 2vw, 1.5rem);
    border: 1px solid rgba(238,226,200,.25);
    border-radius: 22px;
    background: rgba(10,10,9,.15);
}
.cm-nutrition-donut {
    position: relative;
    width: min(100%, 230px);
    aspect-ratio: 1;
    margin: 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(#3b99ff 0 var(--cm-nutrition-protein), #ff922c var(--cm-nutrition-protein) var(--cm-nutrition-carbs), #6ccc20 var(--cm-nutrition-carbs) 100%);
}
.cm-nutrition-donut::before {
    content: '';
    position: absolute;
    inset: 25%;
    background: #151614;
    border-radius: 50%;
}
.cm-nutrition-donut-center {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.05;
    text-align: center;
}
.cm-nutrition-donut-center strong { font-size: clamp(1.35rem, 2.3vw, 2.2rem); font-weight: 900; }
.cm-nutrition-donut-center span { font-size: 1rem; font-weight: 800; }
.cm-nutrition-donut-center small { font-size: .79rem; font-weight: 400; }
.cm-nutrition-legend { display: grid; gap: .9rem; }
.cm-nutrition-legend > div { display: flex; align-items: flex-start; gap: .6rem; }
.cm-nutrition-dot { display: block; flex: 0 0 18px; width:18px; height:18px; border-radius: 50%; margin-top:.15rem; }
.cm-nutrition-dot.protein { background:#3b99ff; }
.cm-nutrition-dot.carbs { background:#ff922c; }
.cm-nutrition-dot.fats { background:#6ccc20; }
.cm-nutrition-legend span { display:grid; gap:.12rem; }
.cm-nutrition-legend strong { font-size: .93rem; line-height: 1.2; }
.cm-nutrition-legend small { font-size: .83rem; color:#d8d3c9; }
.cm-nutrition-overview-right {min-width:0;border-left:1px solid #625e56;padding-left:clamp(.6rem,2vw,1.6rem);display:grid;gap:.7rem;}
.cm-nutrition-highlights { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .55rem; }
.cm-nutrition-score {display:grid;gap:.55rem;border:1px solid rgba(244,222,174,.24);border-radius:14px;background:rgba(255,255,255,.035);padding:.65rem .75rem;}
.cm-nutrition-score-heading {display:flex;align-items:baseline;justify-content:space-between;flex-wrap:wrap;gap:.3rem .8rem;}
.cm-nutrition-score-heading strong {font-size:.9rem;color:#fff6e5;}
.cm-nutrition-score-heading small,.cm-nutrition-score-notice {font-size:.71rem;color:#dbd4c7;line-height:1.35;}
.cm-nutrition-score-scale {display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:.3rem;max-width:510px;}
.cm-nutrition-score-grade {display:grid;place-items:center;min-height:32px;font-size:1.05rem;font-weight:900;border-radius:5px;opacity:.6;color:#171714;}
.cm-nutrition-score-grade-a {background:#15934d;color:#fff;}
.cm-nutrition-score-grade-b {background:#77bb36;}
.cm-nutrition-score-grade-c {background:#efc935;}
.cm-nutrition-score-grade-d {background:#eb902d;}
.cm-nutrition-score-grade-e {background:#d95146;color:#fff;}
.cm-nutrition-score-active {opacity:1;outline:2px solid #fff4d0;outline-offset:2px;transform:translateY(-1px);}
.cm-nutrition-score-unavailable {margin:0;font-size:.83rem;color:#e5dac7;}
.cm-nutrition-disclaimer.cm-nutrition-disclaimer-top {margin:0 0 1rem;border-color:rgba(244,206,105,.36);background:linear-gradient(125deg,rgba(142,100,23,.2),rgba(255,255,255,.07));padding:.85rem 1rem;font-size:.83rem;line-height:1.5;color:#f1e8d7;align-items:center;}
.cm-nutrition-disclaimer-top strong {color:#ffdf88;}
.cm-nutrition-disclaimer-top time {font-size:.78rem;color:#dfd7c9;}
.cm-nutrition-tile {
    display:flex; flex-direction:column; align-items:center; justify-content:center;
    gap:.45rem; min-width:0; min-height:142px; padding:.75rem .35rem;
    text-align:center; border:1px solid rgba(235,230,219,.28); border-radius:16px;
    background:linear-gradient(145deg,rgba(105,100,91,.3),rgba(57,54,51,.65));
}
.cm-nutrition-tile span { font-size:1.7rem; line-height:1.1; color:#ffe4b0; }
.cm-nutrition-tile strong { font-size:clamp(1rem,1.7vw,1.32rem); line-height:1.18; }
.cm-nutrition-tile small { color:#e9e5de; font-size:.78rem; line-height:1.3; }
.cm-nutrition-tile-selected { border: 2px solid #ffd315; background:linear-gradient(140deg,rgba(189,132,23,.42),rgba(84,69,28,.45)); }
.cm-nutrition-tile-selected span { color:#ffcd08; }
.cm-nutrition-details { display:grid; grid-template-columns:minmax(0,2.3fr) minmax(220px,1fr); align-items:start; gap:1rem; margin-top:1.25rem; }
.cm-nutrition-table-card { min-width:0; overflow:hidden; border:1px solid rgba(238,226,200,.33); border-radius:15px; }
.cm-nutrition-table-toggle > summary {display:none;}
.cm-nutrition-table-card table { border-collapse:collapse; width:100%; table-layout:fixed; }
.cm-nutrition-table-card th,.cm-nutrition-table-card td { padding:.67rem .55rem; border-bottom:1px solid rgba(238,226,200,.24); border-right:1px solid rgba(238,226,200,.2); }
.cm-nutrition-table-card tr:last-child th,.cm-nutrition-table-card tr:last-child td {border-bottom:0;}
.cm-nutrition-table-card th:last-child,.cm-nutrition-table-card td:last-child {border-right:0;}
.cm-nutrition-table-card thead {background:rgba(104,98,89,.34);}
.cm-nutrition-table-card thead th {font-weight:800; font-size:.85rem; text-align:center;}
.cm-nutrition-table-card thead th:first-child {width:39%;text-align:left;font-size:.93rem;}
.cm-nutrition-table-card tbody th {text-align:left;font-size:.9rem;font-weight:800;}
.cm-nutrition-table-card td {text-align:center;font-size:.9rem;font-weight:750;}
.cm-nutrition-table-card small {display:block;font-size:.75rem;font-weight:450;color:#d4d0c8;margin-top:.15rem;}
.cm-nutrition-table-card tbody th small {padding-left:1.4rem;font-style:italic;}
.cm-nutrition-table-card .cm-nutrition-energy {background:rgba(150,103,0,.42);}
.cm-nutrition-comment {padding:.8rem;border:1px solid rgba(151,163,102,.35);border-radius:18px;background:linear-gradient(135deg,#363c2b,#27291f);}
.cm-nutrition-comment > details > summary {margin:0 0 .7rem;font-size:1.06rem;line-height:1.25;color:#fff;font-weight:800;list-style:none;cursor:pointer;}
.cm-nutrition-comment > details > summary::-webkit-details-marker{display:none;}
.cm-nutrition-comment h3 {margin:0 0 .7rem;font-size:1.06rem;line-height:1.25;color:#fff;}
.cm-nutrition-comment-body {border:1px solid rgba(175,198,120,.44);border-radius:12px;padding:.9rem;background:rgba(17,22,15,.27);}
.cm-nutrition-comment-body p {font-size:.88rem;line-height:1.58;margin:0 0 .7rem;}
.cm-nutrition-comment-body p:last-child {margin-bottom:0;}
.cm-nutrition-disclaimer {display:flex;justify-content:space-between;gap:.55rem 1rem;flex-wrap:wrap;padding:.75rem .9rem;border:1px solid rgba(255,255,255,.15);border-radius:14px;background:rgba(255,255,255,.07);margin-top:0;font-size:.75rem;color:#ddd8ce;}
.cm-nutrition-disclaimer time {white-space:nowrap;}
.cm-nutrition-supplement {margin-top:1rem;border:1px solid rgba(255,255,255,.18);border-radius:12px;overflow:hidden;}
.cm-nutrition-supplement summary,.cm-nutrition-extra summary {cursor:pointer;padding:.75rem 1rem;color:#f7d67d;font-size:.88rem;font-weight:750;}
.cm-nutrition-supplement-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1.3rem;padding:.3rem 1rem 1rem;}
.cm-nutrition-supplement h3 {font-size:1rem;margin:.7rem 0;}
.cm-nutrition-supplement p,.cm-nutrition-supplement li,.cm-nutrition-supplement small {font-size:.84rem;line-height:1.5;}
.cm-nutrition-supplement ul {padding-left:1.2rem;}
.cm-nutrition-supplement dl {margin:0;}
.cm-nutrition-supplement dl div {display:flex;justify-content:space-between;gap:.5rem;margin:.45rem 0;border-bottom:1px solid rgba(255,255,255,.09);padding-bottom:.35rem;font-size:.84rem;}
.cm-nutrition-supplement dd {margin:0;font-weight:700;white-space:nowrap;}
.cm-nutrition-extra {border-top:1px solid rgba(255,255,255,.2);}
.cm-nutrition-per100 {padding:0 1rem 1rem;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.65rem;}
.cm-nutrition-per100 span {display:flex;justify-content:space-between;gap:.5rem;font-size:.8rem;}
.cm-nutrition-extra > small {padding:0 1rem .85rem;}
.cm-nutrition-empty {text-align:center;padding:1.5rem .6rem;display:grid;justify-items:center;gap:1rem;}
.cm-nutrition-empty p {max-width:670px;margin:0;color:#e4dfd4;line-height:1.55;}
.cm-nutrition-empty .cm-ai-action {min-height:46px;}
.cm-nutrition-action-error {color:#ffbab5!important;}
.cm-nutrition-dialog-row {display:flex;justify-content:space-between;gap:1rem;margin:.55rem 0;font-size:1rem;}
.cm-nutrition-dialog-note {font-size:.86rem;line-height:1.5;}
.cm-nutrition-csrf[hidden],.cm-nutrition-action-error[hidden],[data-cm-nutrition-warning][hidden] {display:none!important;}
@media(max-width:1090px){
    .cm-nutrition-overview {grid-template-columns:minmax(160px,1fr) minmax(150px,1fr);}
    .cm-nutrition-overview-right {grid-column:1/-1;border-left:0;border-top:1px solid rgba(255,255,255,.18);padding:1rem 0 0;}
    .cm-nutrition-tile{min-height:110px;}
}
@media(max-width:760px){
    .cm-nutrition-table-toggle > summary {display:block;padding:.8rem;font-weight:800;cursor:pointer;background:rgba(104,98,89,.34);}
    .cm-nutrition-table-toggle > summary::after {content:'⌄';float:right;color:#ffcc21;}
    .cm-nutrition-comment > details > summary::after {content:'⌄';float:right;color:#ffcc21;}
    .cm-nutrition-details {grid-template-columns:1fr;}
    .cm-nutrition-overview {grid-template-columns:minmax(130px,1fr) minmax(130px,1fr);padding:.7rem;}
    .cm-nutrition-header h2 {font-size:1.55rem;}
    .cm-nutrition-disclaimer-top {font-size:.8rem;}
    .cm-nutrition-comment-body p {font-size:.9rem;}
}
@media(max-width:440px){
    .cm-nutrition{padding:.7rem;border-radius:18px;}
    .cm-nutrition-overview{gap:.6rem;}
    .cm-nutrition-donut-center strong{font-size:1.45rem;}
    .cm-nutrition-legend{gap:.55rem;}
    .cm-nutrition-legend strong{font-size:.75rem;}
    .cm-nutrition-legend small{font-size:.72rem;}
    .cm-nutrition-dot{flex-basis:12px;width:12px;height:12px;}
    .cm-nutrition-tile{padding:.5rem .2rem;min-height:100px;}
    .cm-nutrition-tile strong{font-size:.85rem;}
    .cm-nutrition-tile small{font-size:.7rem;}
    .cm-nutrition-table-card th,.cm-nutrition-table-card td{padding:.6rem .22rem;}
    .cm-nutrition-table-card thead th,.cm-nutrition-table-card tbody th,.cm-nutrition-table-card td{font-size:.76rem;}
    .cm-nutrition-table-card small{font-size:.67rem;}
    .cm-nutrition-supplement-grid{grid-template-columns:1fr;}
}

/* Informations complémentaires volontairement compactes : pas de second tableau de bord. */
.cm-nutrition-badges {display:flex;flex-wrap:wrap;gap:.4rem;align-items:center;}
.cm-nutrition-badge {display:inline-flex;align-items:center;border-radius:999px;padding:.35rem .65rem;font-size:.76rem;font-weight:750;white-space:nowrap;border:1px solid rgba(255,255,255,.25);background:rgba(255,255,255,.07);color:#f1ebdd;}
.cm-nutrition-badge-positive {background:rgba(88,132,57,.19);border-color:rgba(154,207,99,.46);color:#d7f2ba;}
.cm-nutrition-badge-warning {background:rgba(184,123,44,.18);border-color:rgba(237,183,93,.5);color:#ffdda0;}
.cm-nutrition-disclaimer-top small {display:block;margin-top:.2rem;color:#dbd3c3;font-size:.76rem;}
.cm-nutrition-daily {border:1px solid rgba(238,226,200,.2);border-radius:14px;padding:.75rem .9rem;margin-top:1rem;background:rgba(255,255,255,.035);}
.cm-nutrition-mini-heading {display:flex;justify-content:space-between;align-items:baseline;gap:.35rem 1rem;flex-wrap:wrap;margin-bottom:.65rem;}
.cm-nutrition-mini-heading strong {font-size:.95rem;color:#fff5dc;}
.cm-nutrition-mini-heading small {font-size:.74rem;color:#cdc5b5;}
.cm-nutrition-daily-list {display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:.8rem;}
.cm-nutrition-daily-item {min-width:0;}
.cm-nutrition-daily-text,.cm-nutrition-contributor-label {display:flex;justify-content:space-between;gap:.35rem;align-items:baseline;font-size:.8rem;}
.cm-nutrition-daily-text strong,.cm-nutrition-contributor-label strong {color:#ffe29a;white-space:nowrap;}
.cm-nutrition-daily-bar,.cm-nutrition-contributor-bar {height:7px;margin-top:.34rem;background:rgba(255,255,255,.15);border-radius:999px;overflow:hidden;}
.cm-nutrition-daily-bar > span {display:block;height:100%;border-radius:999px;background:#ddae56;}
.cm-nutrition-daily-note {display:block;margin-top:.6rem;font-size:.69rem;color:#c5beaf;line-height:1.35;}
.cm-nutrition-contributors {margin-top:1rem;padding:1rem;border:1px solid rgba(238,226,200,.21);border-radius:15px;background:rgba(12,12,10,.16);}
.cm-nutrition-contributors-list {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.7rem 1.3rem;}
.cm-nutrition-contributor-label {font-size:.84rem;}
.cm-nutrition-contributor-label span {min-width:0;overflow-wrap:anywhere;}
.cm-nutrition-contributor-bar {height:8px;}
.cm-nutrition-contributor-bar > span {display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,#d69a40,#f1d18c);}
.cm-nutrition-contributor:last-child .cm-nutrition-contributor-bar > span {background:#837a69;}
.cm-nutrition-contributors > small {display:block;font-size:.71rem;color:#cbc3b5;margin-top:.7rem;line-height:1.4;}
@media(max-width:1090px){.cm-nutrition-daily-list {grid-template-columns:repeat(3,minmax(0,1fr));}}
@media(max-width:640px){.cm-nutrition-daily-list,.cm-nutrition-contributors-list {grid-template-columns:repeat(2,minmax(0,1fr));}.cm-nutrition-badges {width:100%;}.cm-nutrition-badge {font-size:.72rem;}}
@media(max-width:390px){.cm-nutrition-daily-list,.cm-nutrition-contributors-list {grid-template-columns:1fr 1fr;gap:.6rem;}.cm-nutrition-daily,.cm-nutrition-contributors{padding:.7rem;}}

/* Recalcul volontaire lorsqu'une analyse utilise une ancienne version du générateur. */
.cm-nutrition-update {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.75rem 1.1rem;margin-top:1rem;padding:.9rem 1rem;border:1px solid rgba(159,99,184,.55);border-radius:14px;background:rgba(91,45,110,.16);}
.cm-nutrition-update > div {flex:1 1 320px;}
.cm-nutrition-update strong {color:#f1d8fc;font-size:.92rem;}
.cm-nutrition-update p {margin:.3rem 0 0;font-size:.82rem;line-height:1.45;color:#e4d9eb;}
.cm-nutrition-update .cm-ai-action {min-height:40px;}
.cm-nutrition-update .cm-nutrition-action-error {flex-basis:100%;margin:0;}

/* Diagnostic technique réservé aux administrateurs ; n'empiète pas sur les informations du public. */
.cm-nutrition-admin-recalc { min-height: 35px; font-size: .76rem; padding: .35rem .65rem; }
.cm-nutrition .cm-nutrition-admin-debug button.cm-nutrition-admin-recalc:disabled {
    border-color: rgba(170,170,170,.24);
    background: #3a383d;
    color: #aaa5ad;
    opacity: 1;
    box-shadow: none;
    cursor: not-allowed;
}
.cm-nutrition-admin-debug {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .55rem;
    margin-top: .85rem;
    padding-top: .6rem;
    border-top: 1px dashed rgba(186, 145, 204, .24);
}
.cm-nutrition-debug-button {
    appearance: none;
    border: 1px solid rgba(188, 117, 208, .55);
    border-radius: 8px;
    padding: .35rem .6rem;
    background: rgba(98, 52, 124, .28);
    color: #eed7f7;
    font: inherit;
    font-size: .76rem;
    cursor: pointer;
}
.cm-nutrition-debug-button:hover, .cm-nutrition-debug-button:focus-visible {
    background: rgba(140, 80, 166, .45);
    outline-offset: 2px;
}
.cm-nutrition-debug-button:disabled { opacity: .65; cursor: wait; }
.cm-nutrition-debug-feedback { font-size: .76rem; color: #dab9e6; }

.cm-nutrition-debug-button[hidden] { display: none; }

/* Statut persistant de la file de nutrition, commun aux fiches propriétaires. */
.cm-nutrition-queued {margin:.8rem 0 1rem;padding:.9rem 1rem;border:1px solid rgba(173,112,205,.65);border-radius:14px;background:rgba(91,45,110,.20);}
.cm-nutrition-queued strong {display:block;color:#f3defc;font-size:.94rem;}
.cm-nutrition-queued p {margin:.4rem 0;color:#eee2f2;font-size:.87rem;line-height:1.5;}
.cm-nutrition-queued small {color:#d6bcdf;font-size:.76rem;line-height:1.4;}

.cm-legal-page {
    width: min(970px, calc(100% - 2.5rem));
    margin: 2.8rem auto 5rem;
    color: #e9e4d7;
}
.cm-legal-header {
    background: linear-gradient(135deg, rgba(58, 51, 35, .75), rgba(25, 25, 20, .96));
    border: 1px solid rgba(251, 208, 108, .2);
    border-radius: 22px;
    padding: clamp(1.5rem, 4.5vw, 3rem);
    margin-bottom: 1.4rem;
}
.cm-legal-kicker { text-transform: uppercase; color: #f1be58; letter-spacing: .16em; font-size: .76rem; font-weight: 800; }
.cm-legal-header h1 { color: #fff8eb; font-family: Georgia, 'Times New Roman', serif; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.15; margin: .75rem 0; }
.cm-legal-header p { color: #ccc4b1; max-width: 70ch; font-size: 1.05rem; line-height: 1.65; margin: .7rem 0 1.25rem; }
.cm-legal-date { color: #a59b85; font-size: .84rem; }
.cm-legal-body { background: #1a1a16; border: 1px solid rgba(255, 232, 178, .11); border-radius: 18px; padding: clamp(1.35rem, 4vw, 2.7rem); }
.cm-legal-body section + section { margin-top: 1.9rem; border-top: 1px solid rgba(255, 255, 255, .085); padding-top: 1.8rem; }
.cm-legal-body h2 { font-size: 1.25rem; line-height: 1.35; margin: 0 0 1rem; color: #ffd073; }
.cm-legal-body h3 { color: #f2e4c0; font-size: 1.04rem; margin: 1.1rem 0 .55rem; }
.cm-legal-body p, .cm-legal-body li, .cm-legal-body address { font-size: .97rem; color: #d0cabc; line-height: 1.75; }
.cm-legal-body p { margin: .7rem 0; }
.cm-legal-body ul { margin: .7rem 0; padding-left: 1.35rem; }
.cm-legal-body li + li { margin-top: .5rem; }
.cm-legal-body strong { color: #f4efe2; }
.cm-legal-body a { color: #ffcf72; text-decoration-thickness: 1px; text-underline-offset: .22em; overflow-wrap: anywhere; }
.cm-legal-body a:hover { color: #ffe1a5; }
.cm-legal-body address { font-style: normal; padding: 1rem 1.15rem; border-left: 3px solid #edb449; background: rgba(255, 255, 255, .04); border-radius: 0 12px 12px 0; }
.cm-legal-attention { border: 1px solid rgba(241, 190, 88, .4); border-radius: 12px; padding: 1rem; background: rgba(241, 190, 88, .07); }
@media (max-width: 600px) {
    .cm-legal-page { width: calc(100% - 1.2rem); margin: 1.2rem auto 3rem; }
    .cm-legal-header, .cm-legal-body { border-radius: 13px; }
}

/* Opposition locale à la mesure de fréquentation, sans appel à un service tiers. */
.cm-traffic-optout { display: flex; flex-wrap: wrap; align-items: center; gap: .85rem; margin: 1rem 0; }
.cm-traffic-optout button { border: 1px solid #e1ad3e; border-radius: 10px; background: #2b281e; color: #ffd664; padding: .72rem 1.1rem; cursor: pointer; font-weight: 800; }
.cm-traffic-optout button:focus-visible { outline: 2px solid #ffd664; outline-offset: 3px; }
.cm-traffic-optout span { color: #bcb4a5; font-size: .87rem; }

/* Popup de cadrage réutilisable : l'image complète reste intacte, seul le rectangle normalisé est sauvegardé. */
.cm-photo-crop-dialog { box-sizing:border-box; width:min(780px,calc(100vw - 32px)); max-width:none; max-height:calc(100dvh - 32px); overflow-y:auto; padding:clamp(1rem,3vw,1.6rem); border:1px solid rgba(244,183,43,.3); border-radius:18px; color:#eee6d7; background:#23221d; box-shadow:0 28px 90px rgba(0,0,0,.72); }
.cm-photo-crop-dialog::backdrop { background:rgba(0,0,0,.78); backdrop-filter:blur(3px); }
.cm-photo-crop-header { display:flex; align-items:start; justify-content:space-between; gap:1rem; }
.cm-photo-crop-kicker { display:block; margin-bottom:.35rem; font:900 .7rem system-ui,sans-serif; text-transform:uppercase; letter-spacing:.12em; color:#f4b72b; }
.cm-photo-crop-header h2 { margin:0; font:700 clamp(1.4rem,4vw,2.1rem)/1.15 Georgia,serif; color:#fff4d9; }
.cm-photo-crop-close { background:transparent; color:#ddd0b9; border:0; cursor:pointer; font:400 1.8rem system-ui,sans-serif; line-height:1; padding:0 .35rem; }
.cm-photo-crop-intro { color:#bcb3a3; font-size:.9rem; line-height:1.5; margin:1rem 0; }
.cm-photo-crop-workspace { display:grid; grid-template-columns:minmax(0,1fr) 190px; gap:1rem; align-items:center; }
.cm-photo-crop-card-preview { min-width:0; align-self:center; display:grid; gap:.55rem; padding:.8rem; border:1px solid rgba(244,183,43,.22); border-radius:12px; background:rgba(0,0,0,.14); }
.cm-photo-crop-card-label { font:800 .76rem system-ui,sans-serif; color:#f1c766; }
.cm-photo-crop-card-frame { position:relative; overflow:hidden; width:100%; aspect-ratio:16 / 9; border:1px solid rgba(244,183,43,.26); border-radius:8px; background:#11100e; box-sizing:border-box; }
.cm-photo-crop-card-frame img { display:block; position:absolute; max-width:none; max-height:none; pointer-events:none; user-select:none; }
.cm-photo-crop-card-preview p { margin:0; color:#bcb3a3; font:.76rem/1.45 system-ui,sans-serif; }
@media(max-width:600px) { .cm-photo-crop-workspace { grid-template-columns:minmax(0,1fr); } .cm-photo-crop-card-preview { display:grid; grid-template-columns:minmax(0,1fr) 138px; gap:.35rem .75rem; align-items:center; } .cm-photo-crop-card-preview .cm-photo-crop-card-frame { grid-row:1 / 3; grid-column:2; } .cm-photo-crop-card-preview p { grid-column:1; font-size:.72rem; } }
.cm-photo-crop-viewport { position:relative; overflow:hidden; width:100%; aspect-ratio:16 / 9; background:#10100e; border:0; outline:1px solid rgba(244,183,43,.34); border-radius:12px; box-sizing:border-box; cursor:grab; touch-action:none; user-select:none; }
.cm-photo-crop-viewport:active { cursor:grabbing; }
.cm-photo-crop-viewport img { display:block; position:absolute; max-width:none; max-height:none; pointer-events:none; user-select:none; }
.cm-photo-crop-guide { position:absolute; inset:0; pointer-events:none; box-shadow:inset 0 0 0 1px rgba(255,255,255,.16); background:linear-gradient(to right,transparent 33.2%,rgba(255,255,255,.18) 33.3%,rgba(255,255,255,.18) 33.4%,transparent 33.5%,transparent 66.5%,rgba(255,255,255,.18) 66.6%,rgba(255,255,255,.18) 66.7%,transparent 66.8%),linear-gradient(to bottom,transparent 33.2%,rgba(255,255,255,.18) 33.3%,rgba(255,255,255,.18) 33.4%,transparent 33.5%,transparent 66.5%,rgba(255,255,255,.18) 66.6%,rgba(255,255,255,.18) 66.7%,transparent 66.8%); }
.cm-photo-crop-zoom-label { display:flex; justify-content:space-between; margin:1.15rem 0 .45rem; font:750 .88rem system-ui,sans-serif; color:#dfd6c6; }
.cm-photo-crop-dialog input[type=range] { display:block; width:100%; margin:0; accent-color:#f4b72b; }
.cm-photo-crop-actions,.cm-photo-crop-actions-right { display:flex; align-items:center; flex-wrap:wrap; gap:.6rem; }
.cm-photo-crop-actions { justify-content:space-between; margin-top:1.2rem; }
.cm-photo-crop-actions-right { margin-left:auto; }
.cm-photo-crop-actions button { min-height:40px; padding:.55rem .85rem; border-radius:9px; cursor:pointer; font:800 .82rem system-ui,sans-serif; }
.cm-photo-crop-secondary { color:#e6ddce; background:rgba(255,255,255,.07); border:1px solid rgba(244,183,43,.2); }
.cm-photo-crop-primary { color:#221e16; background:#f4b72b; border:1px solid #f4b72b; }
.cm-photo-crop-actions button:focus-visible,.cm-photo-crop-close:focus-visible { outline:2px solid #f4b72b; outline-offset:3px; }
@media(max-width:550px) { .cm-photo-crop-actions-right { width:100%; } .cm-photo-crop-actions-right button { flex:1; } }

/* Même dialogue de cadrage, dans un livre vertical 2:3 pour les albums. */
.cm-photo-crop-dialog.cm-photo-crop-portrait .cm-photo-crop-viewport { aspect-ratio: 2 / 3; width:min(100%, 340px); margin-inline:auto; max-height:min(58dvh,510px); }

.cm-photo-crop-dialog.cm-photo-crop-portrait .cm-photo-crop-workspace { display:block; }
.cm-photo-crop-dialog.cm-photo-crop-portrait .cm-photo-crop-card-preview { display:none; }

/* Le cadrage de l'avatar reprend le même dialogue, dans un carré de 384 x 384 px en sortie. */
.cm-photo-crop-dialog.cm-photo-crop-square .cm-photo-crop-viewport { aspect-ratio:1 / 1; width:min(100%,390px); margin-inline:auto; max-height:min(58dvh,390px); }
.cm-photo-crop-dialog.cm-photo-crop-square .cm-photo-crop-workspace { display:block; }
.cm-photo-crop-dialog.cm-photo-crop-square .cm-photo-crop-card-preview { display:none; }

/* Éditeur photo commun aux pages SSR création et modification. */
.cm-recipe-photo-editor .section-heading { display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-bottom:.75rem; }
.cm-recipe-photo-editor .photo-heading-actions { display:flex; align-items:center; flex-wrap:wrap; gap:.6rem; }
.cm-recipe-photo-editor .photo-upload-button { position:relative; min-height:38px; display:inline-flex; align-items:center; justify-content:center; padding:0 .9rem; overflow:hidden; border-radius:9px; background:#f4b72b; color:#211f19; font-size:.82rem; font-weight:850; cursor:pointer; }
.cm-recipe-photo-editor .photo-upload-button input { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.cm-recipe-photo-editor .photo-clipboard-button { min-height:38px; padding:0 .9rem; border:1px solid #f4b72b; border-radius:9px; background:#f4b72b; color:#211f19; font:inherit; font-size:.82rem; font-weight:850; cursor:pointer; }
.cm-recipe-photo-editor .photo-clipboard-button:hover:not(:disabled) { background:#ffc846; }
/* La prise de photo est tactile, mais le collage et les creations IA restent disponibles partout. */
.cm-recipe-photo-editor .photo-camera-button { display:none; }
@media (hover:none) and (pointer:coarse) {
    .cm-recipe-photo-editor .photo-camera-button { display:inline-flex; }
}
.cm-recipe-photo-editor .photo-paste-fallback { margin:0 0 1rem; padding:.7rem .85rem; border:1px solid rgba(244,183,43,.3); border-radius:10px; background:rgba(244,183,43,.07); }
.cm-recipe-photo-editor .photo-paste-fallback p { margin:0 0 .65rem; color:#efdfbd; font-size:.81rem; line-height:1.5; }
.cm-recipe-photo-editor .photo-paste-target { box-sizing:border-box; min-height:48px; width:100%; padding:.8rem; border:1px dashed rgba(244,183,43,.7); border-radius:8px; background:#211e19; color:#fff5db; font-size:.85rem; outline-offset:3px; -webkit-user-select:text; user-select:text; }
.cm-recipe-photo-editor .photo-paste-target:empty::before { content:"Appui long ici, puis Coller"; color:#b9a98b; pointer-events:none; }
.cm-recipe-photo-editor .photo-paste-target:focus-visible { outline:2px solid #f4b72b; }
.cm-recipe-photo-editor .photo-upload-button:has(input:disabled),
.cm-recipe-photo-editor .photo-clipboard-button:disabled { opacity:.48; cursor:default; }
.cm-recipe-photo-editor .photo-upload-button input:disabled { cursor:default; }
.cm-recipe-photo-editor .photo-help { margin:0 0 .8rem; color:#928b7f; font-size:.82rem; line-height:1.5; }
.cm-recipe-photo-editor .photo-message { margin:.6rem 0; padding:.7rem .9rem; border:1px solid rgba(132,190,105,.24); border-radius:10px; background:rgba(80,135,60,.12); color:#cce6b9; font-size:.84rem; }
.cm-recipe-photo-editor .photo-error { margin:.6rem 0; padding:.7rem .9rem; border:1px solid rgba(255,122,105,.32); border-radius:10px; background:rgba(142,47,36,.2); color:#ffb0a5; font-size:.84rem; }
.cm-recipe-photo-editor .empty-state { padding:1.1rem; border:1px dashed rgba(255,214,100,.16); border-radius:12px; color:#999286; text-align:center; }
.cm-recipe-photo-editor [hidden] { display:none !important; }
.cm-recipe-photo-editor .photo-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,280px),1fr)); gap:.9rem; }
.cm-recipe-photo-editor .photo-card { min-width:0; overflow:hidden; border:1px solid rgba(255,255,255,.08); border-radius:14px; background:rgba(0,0,0,.13); }
.cm-recipe-photo-editor .photo-grid .photo-card.main-photo { border-color:#f4b72b; outline:2px solid rgba(244,183,43,.82); outline-offset:0; box-shadow:0 0 0 1px rgba(244,183,43,.3), 0 0 18px rgba(244,183,43,.2); }
.cm-recipe-photo-editor .photo-preview { position:relative; aspect-ratio:16/9; overflow:hidden; background:#181713; }
.cm-recipe-photo-editor .photo-preview img { position:absolute; top:0; left:0; width:100%; height:100%; max-width:none; max-height:none; display:block; object-fit:cover; }
.cm-recipe-photo-editor .main-photo-badge { position:absolute; top:.55rem; left:.55rem; padding:.28rem .48rem; border-radius:7px; background:rgba(244,183,43,.94); color:#211f19; font-size:.7rem; font-weight:900; text-transform:uppercase; }
.cm-recipe-photo-editor .photo-card-body { display:grid; gap:.75rem; padding:.75rem; }
.cm-recipe-photo-editor .photo-actions { display:flex; gap:.45rem; align-items:center; flex-wrap:wrap; }
.cm-recipe-photo-editor .photo-actions button { min-height:36px; border-radius:9px; font:inherit; font-size:.78rem; font-weight:850; cursor:pointer; }
.cm-recipe-photo-editor .photo-actions .photo-primary-action { flex:0 0 auto; padding:.35rem .5rem; border:1px solid rgba(244,183,43,.28); background:rgba(244,183,43,.1); color:#ffe29d; }
.cm-recipe-photo-editor .photo-actions .photo-enhance-action { flex:1 1 auto; padding:.4rem .7rem; border:1px solid rgba(244,183,43,.3); background:rgba(244,183,43,.12); color:#f6c55f; }
.cm-recipe-photo-editor .photo-actions button.photo-delete-icon {
    flex:0 0 36px; box-sizing:border-box; width:36px; height:36px; min-height:36px;
    margin-left:auto; padding:0; display:inline-flex; align-items:center; justify-content:center;
    border:1px solid rgba(239,106,102,.78); border-radius:9px;
    background:rgba(142,47,36,.28); color:#ffb4ab;
}
.cm-recipe-photo-editor .photo-actions button.photo-delete-icon:hover {
    border-color:#ff9690; background:rgba(175,46,46,.43); color:#ffe1dd;
}
.cm-recipe-photo-editor .photo-actions button.photo-delete-icon:focus-visible {
    outline:2px solid #ff8888; outline-offset:2px;
}
/* Le compteur est integre au libelle du bouton IA ; aucun acces historique sur la carte. */
.cm-recipe-photo-editor .photo-actions button:disabled { opacity:.5; cursor:wait; }
.photo-enhance-confirm-photo { display:flex; justify-content:center; margin:0 0 1rem; }
.photo-enhance-confirm-photo img { max-width:100%; height:auto; max-height:155px; object-fit:contain; border:1px solid #5e4b30; border-radius:10px; }
.photo-enhance-cost { display:flex; justify-content:space-between; gap:1rem; padding:.75rem .2rem; border-bottom:1px solid #4c4030; font-size:.9rem; }
.photo-enhance-cost strong { color:#f4b72b; white-space:nowrap; }
.photo-enhance-remark { color:#c6bba8; font-size:.83rem; line-height:1.55; margin:.85rem 0 0; }
.cm-dialog:has(.photo-enhance-comparison) { width:min(920px,calc(100vw - 1.5rem)); }
.photo-enhance-comparison { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; }
.photo-enhance-comparison figure { min-width:0; margin:0; display:grid; gap:.45rem; }
.photo-enhance-comparison img { display:block; width:100%; max-height:48vh; aspect-ratio:16/9; object-fit:contain; border:1px solid #554530; border-radius:12px; background:#171612; }
.photo-enhance-comparison figcaption { font-size:.9rem; color:#f2c05b; text-align:center; font-weight:800; }
@media(max-width:900px) { .cm-recipe-photo-editor .section-heading { align-items:stretch; flex-direction:column; } .cm-recipe-photo-editor .photo-heading-actions > * { flex:1 1 170px; } }
@media(max-width:600px) {
    .cm-recipe-photo-editor .photo-heading-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); width:100%; gap:.5rem; }
    .cm-recipe-photo-editor .photo-heading-actions > * { box-sizing:border-box; min-width:0; width:100%; padding:.55rem .35rem; line-height:1.25; text-align:center; white-space:normal; }
    .photo-enhance-comparison { grid-template-columns:1fr; }
    .photo-enhance-comparison img { max-height:25vh; }
}
@media(max-width:330px) { .cm-recipe-photo-editor .photo-heading-actions { grid-template-columns:1fr; } }

.cm-recipe-photo-editor[data-create="true"] .cm-photo-position {position:absolute;top:.55rem;right:.55rem;z-index:2;padding:.3rem .55rem;border:1px solid rgba(246,197,95,.5);border-radius:8px;background:rgba(20,19,18,.83);color:#ffe1a0;font-weight:850;font-size:.72rem;pointer-events:none}

.cm-recipe-photo-editor[data-create="true"] .photo-preview:has(.cm-photo-position) .main-photo-badge {top:2.6rem}


/* Le statut garde le format du bouton existant et reprend la couleur des badges publics. */
.cm-recipe-photo-editor .photo-status-button { display:block; width:100%; max-width:none; box-sizing:border-box; min-height:38px;
    padding:.5rem .75rem; border:1px solid rgba(244,183,43,.38); border-radius:9px;
    background:rgba(244,183,43,.12); color:#ffe29d; font:inherit; font-size:.78rem; font-weight:850;
    text-align:center; cursor:pointer; transition:filter .15s ease; }
.cm-recipe-photo-editor .photo-status-button:hover { filter:brightness(1.17); }
.cm-recipe-photo-editor .photo-status-button:focus-visible { outline:2px solid currentColor; outline-offset:2px; }
.cm-recipe-photo-editor .photo-status-button:disabled { opacity:.5; cursor:wait; }
/* Le dialogue de statut utilise une grille 2x2 sur grand écran, sans scroll systématique. */
#cm-recipe-photo-status-dialog { width:min(820px,calc(100vw - 2rem)); max-height:min(94dvh,840px); }
#cm-recipe-photo-status-dialog .cm-dialog-inner { padding:clamp(1rem,2.2vw,1.65rem); }
#cm-recipe-photo-status-dialog .cm-dialog-icon { width:38px; height:38px; margin-bottom:.6rem; }
#cm-recipe-photo-status-dialog .cm-dialog-kicker { margin-bottom:.28rem; }
#cm-recipe-photo-status-dialog .cm-dialog-description { margin-bottom:.9rem; }
.cm-photo-status-options { padding:0; margin:0; border:0; min-width:0; }
.cm-photo-status-options legend { margin:0 0 .55rem; color:#f2c763; font-size:.83rem; font-weight:850; }
.cm-photo-status-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.7rem; }
.cm-photo-status-grid label { display:flex; align-items:flex-start; min-width:0; gap:.65rem; padding:.82rem .88rem;
    border:1px solid #4b4539; border-radius:12px; cursor:pointer; transition:background .15s,border-color .15s; }
.cm-photo-status-grid label:has(input:checked) { border-color:#d9aa45; background:rgba(224,175,67,.11); }
.cm-photo-status-grid label:hover { border-color:#ac8e55; }
.cm-photo-status-grid input, .cm-photo-status-provisional input { flex:0 0 auto; width:18px; height:18px; margin:.12rem 0 0; accent-color:#edba44; }
.cm-photo-status-card-content { display:flex; flex-direction:column; align-items:flex-start; flex:1; min-width:0; gap:.4rem; }
.cm-photo-status-grid strong,.cm-photo-status-provisional strong { font-size:.91rem; color:#f6ead7; }
.cm-photo-status-grid small,.cm-photo-status-provisional small { font-size:.78rem; font-weight:400; line-height:1.35; color:#c8bba8; }
.cm-photo-status-preview-none { margin-top:auto; color:#a9a092; font-size:.72rem; font-style:italic; }
.cm-photo-status-preview-badge { display:inline-flex; align-items:center; max-width:100%; margin-top:auto; padding:.28rem .52rem; border:1px solid transparent;
    border-radius:7px; font-size:.72rem; font-weight:750; line-height:1.2; white-space:normal; }
.cm-photo-status-provisional { display:flex; align-items:flex-start; gap:.7rem; padding:.72rem .85rem; margin-top:.85rem;
    border:1px solid #6f6041; border-radius:11px; cursor:pointer; }
.cm-photo-status-provisional span { display:flex; flex-direction:column; gap:.14rem; }
.cm-photo-status-provisional:has(input:checked) { background:rgba(224,175,67,.09); }
@media(max-width:650px) { .cm-photo-status-grid { grid-template-columns:1fr; gap:.45rem; }
    #cm-recipe-photo-status-dialog .cm-dialog-inner { padding:1.05rem; }
    .cm-photo-status-grid label { padding:.65rem .72rem; }
}

/* Une hiérarchie sobre : les vraies photos sont valorisées ; l'IA reste identifiable. */
[data-photo-badge-provenance="originale"] {
    background:rgba(26,69,43,.91)!important; border-color:rgba(139,213,157,.72)!important; color:#e3ffdc!important;
}
[data-photo-badge-provenance="decor-ia"] {
    background:rgba(40,52,59,.93)!important; border-color:rgba(176,194,202,.62)!important; color:#e8f4f6!important;
}
[data-photo-badge-provenance="illustration-ia"] {
    background:rgba(79,38,105,.83)!important; border-color:rgba(223,185,241,.45)!important; color:#f9edff!important;
}
[data-photo-badge-provenance="a-preciser"] {
    background:rgba(54,48,39,.94)!important; border-color:rgba(204,179,122,.55)!important; color:#f2e4c7!important;
}
/* Les explications restent accessibles au survol des badges des recettes. */
.cm-recipe-card-ai-label[data-photo-badge-provenance],
.cm-gallery-main-badge[data-photo-badge-provenance],
.cm-detail-thumb-status[data-photo-badge-provenance] { pointer-events:auto; cursor:help; }
[data-photo-badge-provenance="originale"]::before,
[data-photo-badge-provenance="decor-ia"]::before { content:"📷"; margin-right:.28rem; font-size:.95em; }
[data-photo-badge-provenance="originale"]::after { content:"✓✓"; margin-left:.32rem; font-size:.92em; letter-spacing:-.16em; }
[data-photo-badge-provenance="illustration-ia"]::before { content:"✦"; margin-right:.3rem; }

/* Poignee identique aux albums ; seul le grip intercepte les gestes de classement. */
.cm-recipe-photo-editor .photo-sort-handle { position:absolute;top:.45rem;right:.45rem;z-index:5;display:grid;place-items:center;
    min-width:36px;min-height:36px;padding:0;border:1px solid #ae925b;border-radius:8px;
    background:#28231e;color:#ffd46e;font:inherit;font-size:1.45rem;line-height:1;cursor:grab;
    touch-action:none;user-select:none;-webkit-user-select:none; }
.cm-recipe-photo-editor .photo-sort-handle:active { cursor:grabbing; }
.cm-recipe-photo-editor .photo-sort-handle:focus-visible { outline:2px solid #f4b72b;outline-offset:2px; }
/* Pendant le tri, l'original reserve une place stable dans la grille. */
.cm-recipe-photo-editor .photo-grid { position:relative; }
.cm-recipe-photo-editor .photo-grid .photo-card.photo-drag-slot {
    position:relative; overflow:visible; border:2px dashed #f4b72b; outline:none;
    box-shadow:inset 0 0 0 1px rgba(244,183,43,.27);background:rgba(244,183,43,.11);
}
.cm-recipe-photo-editor .photo-grid .photo-card.photo-drag-slot > * { visibility:hidden; }
.cm-recipe-photo-editor .photo-grid .photo-card.photo-drag-slot::after {
    content:"Déposer ici";position:absolute;inset:12px;display:grid;place-items:center;
    border-radius:10px;background:rgba(244,183,43,.1);color:#ffe29d;
    font-size:.95rem;font-weight:850;letter-spacing:.02em;pointer-events:none;
}
.cm-photo-sort-layer { position:fixed;inset:0;z-index:11000;pointer-events:none;overflow:visible;
    margin:0!important;padding:0!important;min-height:0!important;max-width:none!important;max-height:none!important;width:auto!important;height:auto!important; }
.cm-recipe-photo-editor .photo-card.photo-sort-ghost {
    position:absolute;box-sizing:border-box;z-index:1;margin:0;opacity:.86;pointer-events:none;
    background:#25231d;box-shadow:0 20px 48px rgba(0,0,0,.7),0 0 0 2px #f4b72b;
    will-change:transform;
}
.cm-recipe-photo-editor .photo-card.photo-sort-ghost .photo-sort-handle { cursor:grabbing; }
.cm-recipe-photo-editor .photo-preview .main-photo-badge { z-index:2;pointer-events:none; }
.cm-recipe-photo-editor[data-create="true"] .cm-photo-position { top:2.7rem; }
.cm-recipe-photo-editor .photo-visually-hidden { position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap; }
@media(prefers-reduced-motion:reduce){.cm-recipe-photo-editor .photo-card.photo-moving{transition:none}}

.cm-recipe-photo-editor .photo-grid > .photo-card:only-child .photo-sort-handle { display:none; }

/* Aperçu grand format : aucune action sur la photographie enregistrée. */
.cm-recipe-photo-editor .photo-preview img { cursor:zoom-in; }
.cm-recipe-photo-editor .photo-preview img:focus-visible { outline:3px solid #f3bd4b;outline-offset:-4px; }
.cm-photo-generate-button { white-space:nowrap; }

/* Menu flottant natif des cartes recette : hors des containers susceptibles de le couper. */
.cm-photo-ai-menu {position:fixed;z-index:900;min-width:238px;max-width:min(300px,calc(100vw - 20px));
    padding:5px;background:#27251f;border:1px solid rgba(244,183,43,.35);border-radius:12px;
    box-shadow:0 14px 40px rgba(0,0,0,.6);display:grid;gap:2px}
.cm-photo-ai-menu[hidden] {display:none}
.cm-photo-ai-menu button {border:0;background:none;color:#f5e9ce;text-align:left;cursor:pointer;
    border-radius:8px;padding:10px 12px;font:inherit;font-size:.86rem;line-height:1.4}
.cm-photo-ai-menu button:hover,.cm-photo-ai-menu button:focus-visible {background:rgba(244,183,43,.15);outline:2px solid transparent}
.cm-photo-ai-menu button small {display:block;color:#aba18d;font-size:.75rem;margin-top:2px}
.cm-photo-ai-menu button + button {border-top:1px solid rgba(255,255,255,.07)}
/* Studio : entree principale du menu IA, reservee aux recettes en modification. */
.cm-photo-ai-menu .cm-photo-ai-menu-studio {
    padding:13px 12px; border:1px solid rgba(207,146,242,.53);
    background:linear-gradient(110deg,rgba(119,58,153,.48),rgba(75,37,104,.38));
    color:#f8deff; font-size:.93rem; font-weight:850;
}
.cm-photo-ai-menu .cm-photo-ai-menu-studio small {color:#dac2e8;font-weight:500;}
.cm-photo-ai-menu .cm-photo-ai-menu-studio:hover,
.cm-photo-ai-menu .cm-photo-ai-menu-studio:focus-visible {background:rgba(141,73,180,.52);}
.cm-photo-ai-menu .cm-photo-ai-menu-group {
    display:flex;align-items:center;gap:10px;padding:8px 10px 4px;
    color:#c8afcf;font-size:.68rem;font-weight:850;letter-spacing:.12em;text-transform:uppercase;
}
.cm-photo-ai-menu .cm-photo-ai-menu-group::after {content:"";flex:1;border-top:1px solid rgba(204,165,224,.26);}
/* Sur iOS, un panneau fixe en bas evite les deplacements du viewport Safari. */
.cm-photo-ai-menu-touch {left:12px;right:12px;top:auto;bottom:max(12px,env(safe-area-inset-bottom));
    box-sizing:border-box;width:auto;min-width:0;max-width:none;max-height:70dvh;overflow-y:auto;
    -webkit-overflow-scrolling:touch;z-index:2000;box-shadow:0 10px 50px rgba(0,0,0,.8)}
.cm-photo-ai-menu-touch button {min-height:54px;padding:12px 15px;touch-action:manipulation;
    -webkit-tap-highlight-color:transparent;font-size:.96rem}
.cm-dialog:has(.photo-scene-grid) {width:min(760px,calc(100vw - 1.5rem))}
.photo-scene-grid {display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:.75rem;max-height:36vh;overflow-y:auto;padding:3px}
.photo-scene-card {display:grid;gap:.35rem;min-width:0;border:2px solid rgba(255,255,255,.10);border-radius:12px;
    padding:5px;background:rgba(255,255,255,.04);color:#f5ead3;cursor:pointer;text-align:left;font:inherit}
.photo-scene-card img {width:100%;aspect-ratio:4/3;object-fit:cover;border-radius:8px}
.photo-scene-card span {font-size:.78rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:2px}
.photo-scene-card[aria-pressed="true"] {border-color:#f4b72b;background:rgba(244,183,43,.15)}
.photo-scene-add {display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.6rem;margin-top:.9rem}
.photo-scene-upload-label {display:inline-flex;min-height:38px;align-items:center;border:1px solid rgba(244,183,43,.4);
    border-radius:8px;padding:.5rem .8rem;color:#ffe2a2;cursor:pointer;font-size:.83rem;font-weight:800}
.photo-scene-add input[type=file] {position:absolute;inline-size:1px;block-size:1px;opacity:0}
.photo-scene-add span {color:#ada391;font-size:.8rem}
.photo-scene-message {font-size:.82rem;min-height:1.2em;color:#ffc9b6;margin:.6rem 0 0}
.photo-scene-empty {grid-column:1/-1;padding:1rem;color:#d6cab4;text-align:center;border:1px dashed rgba(244,183,43,.3);border-radius:12px}
.photo-scene-options {display:grid;gap:.65rem;margin:.85rem 0 0;padding:.85rem;border:1px solid rgba(244,183,43,.23);border-radius:12px;min-width:0}
.photo-scene-options legend {padding:0 .4rem;color:#f4c56e;font-size:.88rem;font-weight:850}
.photo-scene-framing {margin:0 0 .15rem;color:#d9cba9;font-size:.8rem;line-height:1.5}
.photo-scene-option {display:flex;align-items:flex-start;gap:.75rem;padding:.6rem .35rem;cursor:pointer;border-radius:8px}
.photo-scene-option:hover {background:rgba(244,183,43,.06)}
.photo-scene-option input {width:18px;height:18px;flex:0 0 18px;margin:.12rem 0 0;accent-color:#f4b72b;cursor:pointer}
.photo-scene-option span {display:grid;gap:.16rem}
.photo-scene-option strong {font-size:.88rem;color:#f2e9d9}
.photo-scene-option small {font-size:.77rem;color:#b7ab96;line-height:1.45}
.photo-ai-history-chip {position:absolute;bottom:.5rem;right:.5rem;border:1px solid rgba(255,225,160,.65);border-radius:7px;
    background:rgba(20,20,18,.8);color:#ffe0a0;cursor:pointer;padding:.26rem .5rem;font:inherit;font-size:.72rem;font-weight:850}
.photo-ai-history-list {max-height:45vh;overflow:auto;display:grid;gap:.65rem}
.photo-ai-history-entry {border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.03);border-radius:10px;padding:.75rem;display:grid;gap:.3rem}
.photo-ai-history-entry strong {color:#ffe0a0}.photo-ai-history-entry small {color:#bbb2a1}
@media(max-width:550px){.photo-scene-grid{grid-template-columns:repeat(2,minmax(0,1fr));max-height:38vh}}

/* Catalogue des traitements photo rapides, distinct de la bibliothèque des décors. */
.cm-dialog:has(.photo-transformation-grid) { width:min(810px,calc(100vw - 1.5rem)) }
.photo-transformation-grid { display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:.75rem;max-height:55vh;overflow-y:auto;padding:3px }
.photo-transformation-card { border:1px solid rgba(237,200,255,.25);border-radius:12px;background:rgba(255,255,255,.055);color:#f3e7f5;cursor:pointer;text-align:left;display:grid;align-content:start;gap:.45rem;padding:.5rem;font:inherit }
.photo-transformation-card:hover,.photo-transformation-card:focus-visible { border-color:#e0b9ff;background:rgba(190,137,228,.2);outline:none }
.photo-transformation-card img,.photo-transformation-card .photo-transformation-placeholder {width:100%;aspect-ratio:16/9;object-fit:cover;border-radius:8px}
.photo-transformation-placeholder {display:grid;place-items:center;background:#493054;color:#e9c5fa;font-size:2.2rem}
.photo-transformation-card strong {font-size:.92rem;margin:0 .2rem}
.photo-transformation-card small {font-size:.76rem;color:#cdb8d1;line-height:1.45;margin:0 .2rem .25rem}
.photo-transformation-empty {grid-column:1/-1;text-align:center;padding:1rem;color:#e4d2ea}
.photo-transformation-confirm-illustration {display:block;width:min(310px,100%);aspect-ratio:16/9;object-fit:cover;margin:0 auto .85rem;border-radius:9px}
.photo-transformation-confirm-illustration[hidden] {display:none}
@media(max-width:500px){.photo-transformation-grid {grid-template-columns:repeat(2,minmax(0,1fr))}}

.cm-photo-studio { width:min(1480px,calc(100vw - 28px));max-width:none;max-height:calc(100dvh - 24px);height:min(900px,calc(100dvh - 24px));margin:auto;border:1px solid #654b79;border-radius:18px;padding:0;color:#f3eaf5;background:#1b1620;box-shadow:0 30px 100px #000b;overflow:hidden }
.cm-photo-studio::backdrop { background:rgba(9,7,12,.84);backdrop-filter:blur(5px) }
.cm-photo-studio *, .cm-photo-studio *::before, .cm-photo-studio *::after { box-sizing:border-box }
.cm-photo-studio-shell { height:100%;min-height:0;display:flex;flex-direction:column }
.cm-photo-studio-header { display:flex;justify-content:space-between;gap:20px;align-items:start;border-bottom:1px solid #44334d;padding:18px 24px }
.cm-photo-studio-kicker { font-size:.68rem;letter-spacing:.14em;color:#d6a6f5;font-weight:850 }
.cm-photo-studio-header h2 { color:#f8eafa;margin:4px 0;font-size:1.35rem }
.cm-photo-studio-header-actions { display:flex;gap:12px;align-items:center;white-space:nowrap }
.cm-photo-studio-format { padding:7px 11px;border-radius:20px;border:1px solid #765288;color:#dec5ef;font-size:.75rem }
.cm-photo-studio-close { font-size:1.8rem;line-height:1;width:38px;height:38px;border:0;border-radius:9px;background:#3b2a44;color:#eee;cursor:pointer }
.cm-photo-studio-content { flex:1;display:grid;grid-template-columns:minmax(0,1.25fr) minmax(320px,.95fr);gap:0;min-height:0 }
.cm-photo-studio-visual { min-height:0;min-width:0;display:flex;flex-direction:column;padding:20px 20px 12px;gap:12px }
.cm-photo-studio-stage { display:flex;align-items:center;justify-content:center;flex:1;min-height:100px;background:#110f12;border:1px solid #47374b;border-radius:12px;overflow:hidden }
.cm-photo-studio-stage img { display:block;width:100%;max-height:100%;height:auto;object-fit:contain;aspect-ratio:16/9 }
.cm-photo-studio-selected { text-align:center;color:#e3c6f6;font-size:.88rem;font-weight:700 }
.cm-photo-studio-strip-row { display:flex;gap:6px;min-height:86px }
.cm-photo-studio-strip-row>button { flex:0 0 24px;border:1px solid #644e6c;border-radius:7px;color:#efdbf7;background:#2b2130;font-size:1.5rem;cursor:pointer }
.cm-photo-studio-strip { display:flex;gap:8px;overflow-x:auto;scrollbar-width:thin;min-width:0;flex:1;padding-bottom:5px }
.cm-photo-studio-thumb { flex:0 0 122px;min-width:0;border:2px solid #59485c;background:#261c2b;color:#eee;border-radius:9px;padding:3px;cursor:pointer;text-align:left }
.cm-photo-studio-thumb[aria-pressed="true"] { border-color:#e5aeff;box-shadow:0 0 0 1px #e5aeff }
.cm-photo-studio-thumb img { display:block;width:100%;aspect-ratio:16/9;object-fit:cover;border-radius:4px }
.cm-photo-studio-thumb span { display:block;font-size:.68rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:3px 2px }
.cm-photo-studio-chat { min-width:0;min-height:0;display:flex;flex-direction:column;border-left:1px solid #44334d;background:#241a2b }
.cm-photo-studio-chat-head { display:flex;gap:10px;align-items:center;padding:16px;border-bottom:1px solid #48354f }
.cm-photo-studio-chat-head>span { font-size:1.6rem }
.cm-photo-studio-chat-title { min-width:0;flex:1 }
.cm-photo-studio-quick-wrap { position:relative;flex:0 0 auto;margin-left:auto }
.cm-photo-studio-quick-trigger { padding:8px 11px;border:1px solid #976eaf;border-radius:9px;background:#473053;color:#f7e7ff;font-size:.76rem;font-weight:750;white-space:nowrap }
.cm-photo-studio-quick-trigger[aria-expanded="true"] { border-color:#dba7f6;background:#614073 }
.cm-photo-studio-quick-panel { position:absolute;z-index:100;top:calc(100% + 7px);right:0;width:min(290px,calc(100vw - 28px));padding:6px;border:1px solid #8d64a3;border-radius:11px;background:#2a1e32;box-shadow:0 12px 32px #0009 }
.cm-photo-studio-quick-panel[hidden] { display:none!important }
.cm-photo-studio-quick-panel button { display:block;text-align:left;width:100%;padding:10px 12px;background:transparent;color:#f9eafb;border:0;border-radius:8px }
.cm-photo-studio-quick-panel button:hover,.cm-photo-studio-quick-panel button:focus-visible { background:#523361;outline:1px solid #b58bc9 }
.cm-photo-studio-quick-panel strong,.cm-photo-studio-quick-panel small { display:block }
.cm-photo-studio-quick-panel small { font-size:.7rem;color:#d2bedb;margin-top:4px }

.cm-photo-studio-chat-head strong,.cm-photo-studio-chat-head small { display:block }
.cm-photo-studio-chat-head small { color:#c7b4ce;font-size:.73rem;margin-top:3px }
.cm-photo-studio-messages { flex:1;min-height:110px;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:13px }
.cm-photo-studio-message { max-width:93%;padding:11px 13px;border:1px solid #594263;border-radius:12px;background:#34273d;font-size:.88rem;line-height:1.52;white-space:pre-wrap;overflow-wrap:anywhere }
.cm-photo-studio-message.user { margin-left:auto;background:#503366;border-color:#76528a }
.cm-photo-studio-message.assistant { margin-right:auto }
.cm-photo-studio-message small { display:block;font-size:.73rem;color:#cab8d0;margin-top:7px }
.cm-photo-studio-propose { display:block;margin-top:11px;padding:9px 12px;border:1px solid #b888d9;border-radius:9px;color:#25162c;background:#e5b3f5;font-size:.79rem;font-weight:850;cursor:pointer }
.cm-photo-studio-propose:disabled { opacity:.6;cursor:not-allowed }
.cm-photo-studio-message small.cm-photo-studio-proposal-feedback { margin-top:8px;color:#e4caec;line-height:1.4 }
.cm-photo-studio-message small.cm-photo-studio-proposal-feedback.is-error { color:#ffb9bc;font-weight:700 }
.cm-photo-studio .cm-photo-studio-working { display:inline-flex;align-items:center;justify-content:center;gap:8px; }
.cm-photo-studio .cm-photo-studio-working::before { content:"";flex:0 0 15px;width:15px;height:15px;border:2px solid currentColor;border-right-color:transparent;border-bottom-color:transparent;border-radius:50%;animation:cm-photo-studio-spin .85s linear infinite; }
.cm-photo-studio .cm-photo-studio-working:disabled { opacity:1;cursor:progress; }
@keyframes cm-photo-studio-spin { to { transform:rotate(360deg); } }
@media(prefers-reduced-motion:reduce) { .cm-photo-studio .cm-photo-studio-working::before { animation:none; } }
.cm-photo-studio-suggestions { display:flex;flex-wrap:wrap;gap:5px;padding:0 14px 8px }
.cm-photo-studio-suggestions button { background:#34253b;border:1px solid #62466e;color:#e7cfef;border-radius:17px;padding:6px 9px;font-size:.72rem;cursor:pointer }
.cm-photo-studio-compose { margin:0 14px 14px;display:flex;flex-direction:column;gap:6px }
.cm-photo-studio-compose label { font-size:.77rem;color:#dbc4e5;font-weight:700 }
.cm-photo-studio-compose textarea { resize:vertical;min-height:72px;max-height:170px;border:1px solid #85629a;border-radius:10px;padding:10px;background:#160f1b;color:#fff;font:inherit;font-size:.9rem }
.cm-photo-studio-compose-foot { display:flex;align-items:center;justify-content:space-between;gap:12px }
.cm-photo-studio-compose-foot small { font-size:.73rem;color:#cbb5d2 }
.cm-photo-studio-main { background:#d4a0ef!important;border:1px solid #e9c0fb!important;color:#291536!important;font-weight:850!important }
.cm-photo-studio button { cursor:pointer }
.cm-photo-studio button:disabled { opacity:.5;cursor:not-allowed }
.cm-photo-studio-compose-foot button,.cm-photo-studio-footer-actions button { padding:10px 14px;border-radius:9px;border:1px solid #674a76;background:#392943;color:#f1e4f4;font-size:.82rem }
.cm-photo-studio-footer { display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 20px;border-top:1px solid #48354f }
.cm-photo-studio-footer>span { color:#d8bfe4;font-size:.79rem;line-height:1.35;max-width:55% }
.cm-photo-studio-footer-actions { display:flex;gap:8px;justify-content:flex-end }
@media(max-width:850px) {
 .cm-photo-studio { width:100vw;max-height:100dvh;height:100dvh;border-radius:0;border:0 }
 .cm-photo-studio-header { padding:12px 14px }
 .cm-photo-studio-header h2 { font-size:1.1rem }
 .cm-photo-studio-content { grid-template-columns:1fr;grid-template-rows:minmax(0,45%) minmax(0,55%) }
 .cm-photo-studio-visual { padding:10px 12px;gap:6px }
 .cm-photo-studio-stage { min-height:80px }
 .cm-photo-studio-strip-row { min-height:62px }
 .cm-photo-studio-thumb { flex-basis:95px }
 .cm-photo-studio-chat { border-left:0;border-top:1px solid #44334d }
 .cm-photo-studio-chat-head { padding:8px 12px }
 .cm-photo-studio-messages { min-height:60px }
 .cm-photo-studio-suggestions { padding:0 10px 5px }
 .cm-photo-studio-compose { margin:0 10px 8px }
 .cm-photo-studio-compose textarea { min-height:55px }
 .cm-photo-studio-footer { padding:8px 12px;flex-wrap:wrap }
 .cm-photo-studio-footer>span { max-width:100%;flex-basis:100% }
 .cm-photo-studio-footer-actions { margin-left:auto }
}
@media(max-width:440px) { .cm-photo-studio-format { display:none } .cm-photo-studio-header { padding:9px 12px } .cm-photo-studio-thumb { flex-basis:78px } .cm-photo-studio-strip-row { min-height:55px } .cm-photo-studio-footer-actions button { font-size:.75rem;padding:8px } }

@media(max-width:440px) { .cm-photo-studio-chat-head { gap:5px } .cm-photo-studio-chat-head>span { font-size:1.1rem } .cm-photo-studio-quick-trigger { font-size:.68rem;padding:7px 8px } .cm-photo-studio-chat-head small { font-size:.64rem } }

/* Éditeur commun : les outils gratuits conservent leurs réglages par version. */
.cm-photo-studio [hidden] { display:none!important; }
.cm-photo-studio-tabs { display:flex;gap:7px;padding:12px 14px 10px;border-bottom:1px solid #48354f; }
.cm-photo-studio-tabs button { flex:1;min-width:0;padding:9px 7px;background:#34263d;border:1px solid #685272;border-radius:9px;color:#e9d5f0;font-size:.78rem;font-weight:750; }
.cm-photo-studio-tabs button[aria-pressed="true"] {background:#684078;border-color:#d9aaf2;color:#fff;}
.cm-photo-studio-tabs small {font-size:.68rem;color:#b8f5b8;margin-left:4px;}
.cm-photo-studio-classic {display:flex;flex-direction:column;gap:16px;flex:1;min-height:0;overflow-y:auto;padding:18px;}
.cm-photo-studio-classic-head {display:grid;gap:4px;}
.cm-photo-studio-classic-head strong,.cm-photo-studio-crop-head strong {color:#f5d8fb;font-size:.96rem;}
.cm-photo-studio-crop-head small {color:#c9b8d0;font-size:.75rem;line-height:1.45;}
.cm-photo-studio-classic-buttons {display:flex;gap:7px;flex-wrap:wrap;}
.cm-photo-studio-classic-buttons button {flex:1 1 115px;border:1px solid #755582;background:#392745;color:#f3e1fa;border-radius:8px;padding:10px 8px;font-size:.76rem;font-weight:700;}
.cm-photo-studio-classic-buttons button:hover {background:#513360;border-color:#b989d2;}
.cm-photo-studio-adjust-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:22px;row-gap:16px;}
.cm-photo-studio-adjust {display:grid;gap:8px;color:#eee;font-size:.82rem;}
.cm-photo-studio-adjust span {display:flex;align-items:center;justify-content:space-between;gap:8px;}
.cm-photo-studio-adjust output {font-weight:800;color:#e2b5f7;font-variant-numeric:tabular-nums;}
.cm-photo-studio-adjust input {width:100%;accent-color:#d8a4f3;cursor:ew-resize;}
.cm-photo-studio-crop-head {display:grid;gap:4px;padding-top:13px;border-top:1px solid #47344f;}
.cm-photo-studio-classic-foot {padding-top:10px;border-top:1px solid #47344f;}
.cm-photo-studio-ai-area {display:flex;flex-direction:column;flex:1;min-height:0;}
.cm-photo-studio-stage {touch-action:none;}
.cm-photo-studio-stage:has(+ .cm-photo-studio-selected) {cursor:grab;}
.cm-photo-studio-stage:active {cursor:grabbing;}
@media(max-width:850px) {
 .cm-photo-studio-tabs {padding:5px 9px;}
 .cm-photo-studio-tabs button {padding:7px;font-size:.73rem;}
 .cm-photo-studio-classic {padding:10px 12px;gap:10px;}
 .cm-photo-studio-classic-buttons button {padding:7px;font-size:.69rem;}
}

@media(max-width:600px) { .cm-photo-studio-adjust-grid {grid-template-columns:minmax(0,1fr);row-gap:12px;} }

.cm-photo-studio-footer-actions [data-studio-debug] { flex:0 0 auto;min-width:36px;padding:8px 10px;font-size:1rem; }

/* Sélecteurs communs à la création administrative et à la modification SSR. */
.cm-recipe-readonly-field {
    display: grid;
    gap: .4rem;
    min-width: 0;
    color: #c6bfb2;
    font-size: .82rem;
    font-weight: 750;
}
.cm-recipe-readonly-value {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: .72rem .9rem;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 10px;
    background: rgba(255,255,255,.025);
    color: #ede5d7;
    font-size: .9rem;
    font-weight: 650;
    overflow-wrap: anywhere;
}
.cm-recipe-readonly-field > small {
    color: #8e877b;
    font-weight: 500;
}
.cm-recipe-publication-intro {
    margin: -.15rem 0 1rem;
    color: #aca496;
    font-size: .88rem;
    line-height: 1.45;
}
.cm-recipe-publication-groups { display: grid; gap: 1.2rem; }
.cm-recipe-choice-group {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}
.cm-recipe-choice-group legend {
    display: block;
    margin-bottom: .65rem;
    padding: 0;
    color: #e8ddcd;
    font-size: .87rem;
    font-weight: 850;
}
.cm-recipe-choice-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .7rem;
}
.cm-recipe-choice-group:last-child .cm-recipe-choice-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.cm-recipe-choice {
    position: relative;
    display: block;
    min-width: 0;
    cursor: pointer;
}
.cm-recipe-choice > input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.cm-recipe-choice-copy {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .4rem;
    min-height: 94px;
    height: 100%;
    padding: .85rem .9rem .85rem 2.1rem;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 12px;
    background: rgba(255,255,255,.025);
    transition: border-color .15s ease, background-color .15s ease;
}
.cm-recipe-choice-copy::before {
    content: "";
    position: absolute;
    top: .95rem;
    left: .85rem;
    width: 13px;
    height: 13px;
    border: 1.5px solid #857a67;
    border-radius: 50%;
    background: #24231e;
}
.cm-recipe-choice-copy strong {
    color: #f4eee2;
    font-size: .86rem;
    line-height: 1.25;
}
.cm-recipe-choice-copy small {
    color: #aaa294;
    font-size: .77rem;
    font-weight: 500;
    line-height: 1.4;
}
.cm-recipe-choice > input[type="radio"]:checked + .cm-recipe-choice-copy {
    border-color: #e4b638;
    background: rgba(244,183,43,.095);
}
.cm-recipe-choice > input[type="radio"]:checked + .cm-recipe-choice-copy::before {
    border-color: #f4b72b;
    background: #f4b72b;
    box-shadow: inset 0 0 0 3px #33301f;
}
.cm-recipe-choice > input[type="radio"]:focus-visible + .cm-recipe-choice-copy {
    outline: 2px solid #ffe5a0;
    outline-offset: 3px;
}
.cm-recipe-choice:hover > input[type="radio"]:not(:disabled) + .cm-recipe-choice-copy {
    border-color: rgba(244,183,43,.6);
}
.cm-recipe-choice > input[type="radio"]:disabled + .cm-recipe-choice-copy {
    opacity: .47;
    cursor: not-allowed;
}
.cm-recipe-private-notice {
    margin: .6rem 0 0;
    color: #f7cf84;
    font-size: .8rem;
    line-height: 1.5;
}
@media (max-width: 760px) {
    .cm-recipe-choice-options,
    .cm-recipe-choice-group:last-child .cm-recipe-choice-options {
        grid-template-columns: 1fr;
    }
    .cm-recipe-choice-copy { min-height: 72px; }
}
@media (prefers-reduced-motion: reduce) {
    .cm-recipe-choice-copy { transition: none; }
}

/* Saisie et aperçu partagés des préparations (création / modification / administration). */
.cm-preparation-editor { min-width:0; }
.cm-preparation-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; align-items:stretch; }
.cm-preparation-pane { min-width:0; padding:1rem; border:1px solid rgba(255,255,255,.07); border-radius:16px; background:rgba(0,0,0,.11); }
.cm-preparation-preview-pane { background:linear-gradient(145deg,rgba(27,26,21,.96),rgba(22,21,18,.96)); }
.cm-preparation-pane-heading { display:flex; align-items:center; justify-content:space-between; gap:.75rem; min-height:30px; margin-bottom:.8rem; }
.cm-preparation-insert-actions { display:flex; align-items:center; justify-content:flex-end; gap:.45rem; flex-wrap:wrap; }
.cm-preparation-pane-heading strong { color:#f2eadc; font-size:.84rem; }
.cm-preparation-pane-heading span { color:#91897e; font-size:.73rem; text-align:right; }
.cm-preparation-add-title { min-height:32px; padding:.35rem .75rem; background:rgba(244,183,43,.1); color:#ffdb80; border:1px solid rgba(244,183,43,.34); border-radius:9px; cursor:pointer; font:inherit; font-size:.78rem; font-weight:800; }
.cm-preparation-add-title:hover, .cm-preparation-add-title:focus-visible { background:rgba(244,183,43,.2); }
.cm-preparation-input { display:block; width:100%; box-sizing:border-box; min-height:330px; padding:.9rem; border:1px solid rgba(255,255,255,.1); border-radius:12px; background:#23221d; color:#f6efe2; font:inherit; font-size:.88rem; line-height:1.6; resize:vertical; outline:0; }
.cm-preparation-input:focus { border-color:rgba(244,183,43,.66); box-shadow:0 0 0 3px rgba(244,183,43,.08); }
.cm-preparation-preview { min-height:280px; }
.cm-preparation-empty { margin:0; padding:2rem 1rem; color:#858075; text-align:center; }
.cm-preparation-preview .recipe-preparation-display { display:grid; gap:.9rem; color:#c2baad; line-height:1.72; }
.cm-preparation-preview .recipe-preparation-step { display:grid; grid-template-columns:2.25rem minmax(0,1fr); gap:.8rem; align-items:start; }
.cm-preparation-preview .recipe-preparation-step-number { width:2.25rem; height:2.25rem; display:grid; place-items:center; border:1px solid rgba(244,183,43,.28); border-radius:50%; background:rgba(244,183,43,.1); color:#ffd664; font-size:.82rem; font-weight:900; }
.cm-preparation-preview .recipe-preparation-step p, .cm-preparation-preview .recipe-preparation-paragraph { margin:0; }
.cm-preparation-preview .recipe-preparation-title { margin:.65rem 0 .05rem; color:#ffdc85; font-size:1.08rem; font-weight:850; line-height:1.35; overflow-wrap:anywhere; }
.cm-preparation-preview .recipe-preparation-title:first-child { margin-top:0; }
.cm-preparation-help { margin:.85rem 0 0; font-size:.8rem; color:#a79e90; line-height:1.6; }
.cm-preparation-help code { padding:.12rem .3rem; color:#f5c665; background:rgba(244,183,43,.09); border-radius:4px; }
@media (max-width:900px) { .cm-preparation-grid { grid-template-columns:minmax(0,1fr); } .cm-preparation-input { min-height:235px; } .cm-preparation-preview { min-height:100px; } }

/* Identite IA CarnetMiam : modifier ici la palette, sans toucher au theme dore du site.
   - cm-ai-action          : commande IA compacte (prune doux)
   - cm-ai-action--solid   : action IA principale (degrade prune)
   - cm-ai-action--sparkle : ajoute le symbole IA uniquement si le libelle n'en a pas
   - cm-ai-badge           : indicateur IA, sans impact sur les badges habituels
   - cm-ai-entry           : parcours IA du dialogue d'ajout de recette
   Ce fichier est charge apres les CSS existants afin de surcharger leurs couleurs. */
:root {
    --cm-ai-plum: #62347c;
    --cm-ai-plum-light: #8c50a6;
    --cm-ai-plum-hover: #a264b9;
    --cm-ai-ink: #faf1ff;
    --cm-ai-muted: #dfb9f1;
    --cm-ai-outline: #c895de;
    --cm-ai-soft: rgba(98, 52, 124, .27);
    --cm-ai-soft-hover: rgba(140, 80, 166, .36);
    --cm-ai-border: rgba(185, 138, 209, .66);
    --cm-ai-gradient: linear-gradient(115deg, var(--cm-ai-plum), var(--cm-ai-plum-light));
    --cm-ai-gradient-hover: linear-gradient(115deg, #74418f, var(--cm-ai-plum-hover));
}

/* Boutons IA : ne changer que la signature, pas la geometrie des composants. */
button.cm-ai-action, a.cm-ai-action {
    border-color: var(--cm-ai-border);
    background: var(--cm-ai-soft);
    color: var(--cm-ai-ink);
    text-decoration: none;
    transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
button.cm-ai-action:hover:not(:disabled), a.cm-ai-action:hover {
    border-color: var(--cm-ai-outline);
    background: var(--cm-ai-soft-hover);
    color: #fff;
}
button.cm-ai-action--solid, a.cm-ai-action--solid,
.cm-add-form button.cm-ai-action--solid,
.photo-import-actions button.cm-ai-action--solid,
.cm-pin-buttons button.cm-ai-action--solid,
.discover-feature-link.cm-ai-action--solid {
    border-color: var(--cm-ai-plum-light);
    background: var(--cm-ai-gradient);
    color: #fff;
    box-shadow: 0 3px 12px rgba(52, 21, 66, .24);
}
button.cm-ai-action--solid:hover:not(:disabled), a.cm-ai-action--solid:hover,
.cm-add-form button.cm-ai-action--solid:hover:not(:disabled),
.cm-pin-buttons button.cm-ai-action--solid:hover:not(:disabled),
.discover-feature-link.cm-ai-action--solid:hover {
    border-color: var(--cm-ai-outline);
    background: var(--cm-ai-gradient-hover);
    color: #fff;
}
.cm-ai-action--sparkle::before {content: '✦'; display:inline-block; margin-right:.45em; font-weight:800;}
button.cm-ai-action:focus-visible, a.cm-ai-action:focus-visible,
.cm-photo-ai-menu button:focus-visible, button.cm-ai-badge:focus-visible {
    outline: 2px solid var(--cm-ai-outline);
    outline-offset: 3px;
}
button.cm-ai-action:disabled {opacity:.48; cursor:not-allowed; box-shadow:none;}

/* Editeur de photos, y compris les cartes reconstruites par JavaScript. */
.cm-recipe-photo-editor .photo-actions button.photo-enhance-action.cm-ai-action,
.admin-page .cm-recipe-photo-editor .photo-actions button.photo-enhance-action.cm-ai-action {
    background: var(--cm-ai-soft);
    border-color: var(--cm-ai-border);
    color: var(--cm-ai-ink);
}
.cm-recipe-photo-editor .photo-actions button.photo-enhance-action.cm-ai-action:hover:not(:disabled),
.admin-page .cm-recipe-photo-editor .photo-actions button.photo-enhance-action.cm-ai-action:hover:not(:disabled) {
    background: var(--cm-ai-soft-hover);
    border-color: var(--cm-ai-outline);
}
.album-cover-photo-actions button.album-cover-ai-action.cm-ai-action {
    border-color: var(--cm-ai-border);
    background: var(--cm-ai-soft);
    color: var(--cm-ai-ink);
}
.album-cover-photo-actions button.album-cover-ai-action.cm-ai-action:hover:not(:disabled) {
    background: var(--cm-ai-soft-hover);
    border-color: var(--cm-ai-outline);
}

/* Les marques IA sont violettes ; les pastilles Principale restent dorees. */
.cm-ai-badge, .photo-preview button.photo-ai-history-chip.cm-ai-badge,
.photo-preview .photo-ai-history-chip.cm-ai-badge {
    border-color: var(--cm-ai-border);
    background: rgba(49, 27, 63, .92);
    color: var(--cm-ai-ink);
}
.photo-ai-history-chip.cm-ai-badge:hover {background:var(--cm-ai-plum);}
.cm-add-choice .cm-add-ai-tag.cm-ai-badge {
    border:1px solid rgba(98, 52, 124, .22);
    background:#eadbf1;
    color:var(--cm-ai-plum);
}
.cm-add-ai-tag.cm-ai-badge::before {content:'✦ ';}

/* Cartes de parcours IA sur fond creme : conserver leur visuel culinaire. */
.cm-add-choice.cm-ai-entry:hover, .cm-add-choice.cm-ai-entry:focus-visible {
    border-color:var(--cm-ai-plum-light);
    box-shadow:0 14px 29px #060403a3, 0 0 0 2px rgba(140, 80, 166, .22), inset 0 1px #fff;
}
.cm-add-choice.cm-ai-entry:focus-visible {outline-color:var(--cm-ai-outline);}
.cm-add-choice.cm-ai-entry .cm-add-choice-action {
    background:var(--cm-ai-gradient);
    color:var(--cm-ai-ink);
    box-shadow:0 2px 10px rgba(98, 52, 124, .20);
}
.cm-add-choice.cm-ai-entry .cm-add-choice-action::before {content:'✦';}
.cm-add-choice.cm-ai-entry:hover .cm-add-choice-action {background:var(--cm-ai-gradient-hover);}
/* Un pictogramme commun remplace les trois anciennes couleurs de pictogrammes IA. */
.cm-add-choice.cm-ai-entry .cm-add-choice-icon {background:#eadbf1; color:var(--cm-ai-plum);}
#cm-add-recipe-dialog .cm-add-form .cm-add-submit.cm-ai-action--solid {
    background:var(--cm-ai-gradient); border-color:var(--cm-ai-plum-light); color:#fff;
}
#cm-add-recipe-dialog .cm-add-form .cm-add-submit.cm-ai-action--solid:hover:not(:disabled) {
    background:var(--cm-ai-gradient-hover);
}
#cm-add-recipe-dialog .cm-add-price {color:var(--cm-ai-muted);}

/* Menu IA flottant (desktop et tactile) et historique de transformation. */
.cm-photo-ai-menu {
    border-color:var(--cm-ai-border);
    background:#29212f;
    box-shadow:0 14px 40px rgba(0, 0, 0, .6), 0 0 0 1px rgba(140, 80, 166, .08);
}
.cm-photo-ai-menu button {color:var(--cm-ai-ink);}
.cm-photo-ai-menu button:hover, .cm-photo-ai-menu button:focus-visible {
    background:var(--cm-ai-soft-hover);
    outline:2px solid transparent;
}
.cm-photo-ai-menu button:focus-visible {outline:2px solid var(--cm-ai-outline); outline-offset:-2px;}
.cm-photo-ai-menu button small {color:#cdb6d6;}
.photo-ai-history-entry {border-color:rgba(185, 138, 209, .25);}
.photo-ai-history-entry strong {color:var(--cm-ai-muted);}

/* Dialogues de traitement : boutons d'execution IA seulement.
   Annuler, Fermer, garder/ajouter une photo et enregistrer restent dans le theme ordinaire. */
:is(#member-photo-enhance-confirm,#member-photo-enhance-compare,#member-photo-scene-choose,
    #member-photo-ai-history,#album-cover-ai-confirm,#album-cover-ai-compare,
    #photo-import-confirm,#cm-pinterest-poster-dialog,#cm-pinterest-poster-confirm).cm-dialog {
    border-color:var(--cm-ai-border);
}
:is(#member-photo-enhance-confirm,#member-photo-enhance-compare,#member-photo-scene-choose,
    #member-photo-ai-history,#album-cover-ai-confirm,#album-cover-ai-compare,
    #photo-import-confirm,#cm-pinterest-poster-dialog,#cm-pinterest-poster-confirm) .cm-dialog-icon {
    background:var(--cm-ai-gradient);
    color:var(--cm-ai-ink);
}
:is(#member-photo-enhance-confirm,#member-photo-enhance-compare,#member-photo-scene-choose,
    #member-photo-ai-history,#album-cover-ai-confirm,#album-cover-ai-compare,
    #photo-import-confirm,#cm-pinterest-poster-dialog,#cm-pinterest-poster-confirm) .cm-dialog-kicker {
    color:var(--cm-ai-muted);
}
:is(#member-photo-enhance-confirm,#album-cover-ai-confirm,#photo-import-confirm,#cm-pinterest-poster-confirm)
    .cm-dialog-button[data-cm-dialog-code="confirm"],
#member-photo-scene-choose .cm-dialog-button[data-cm-dialog-code="generate"] {
    border-color:var(--cm-ai-plum-light);
    background:var(--cm-ai-gradient);
    color:var(--cm-ai-ink);
}
:is(#member-photo-enhance-confirm,#album-cover-ai-confirm,#photo-import-confirm,#cm-pinterest-poster-confirm)
    .cm-dialog-button[data-cm-dialog-code="confirm"]::before,
#member-photo-scene-choose .cm-dialog-button[data-cm-dialog-code="generate"]::before {
    content:'✦';margin-right:.45em;
}
:is(#member-photo-enhance-confirm,#album-cover-ai-confirm,#photo-import-confirm,#cm-pinterest-poster-confirm)
    .cm-dialog-button[data-cm-dialog-code="confirm"]:hover:not(:disabled),
#member-photo-scene-choose .cm-dialog-button[data-cm-dialog-code="generate"]:hover:not(:disabled) {
    background:var(--cm-ai-gradient-hover);
}
:is(#member-photo-enhance-confirm,#member-photo-enhance-compare,#member-photo-scene-choose,
    #member-photo-ai-history,#album-cover-ai-confirm,#album-cover-ai-compare,
    #photo-import-confirm,#cm-pinterest-poster-dialog,#cm-pinterest-poster-confirm) button:focus-visible {
    outline-color:var(--cm-ai-outline);
}
.photo-enhance-cost strong, #album-cover-ai-confirm .album-ai-cost strong,
#photo-import-confirm .photo-import-confirm-total strong {color:var(--cm-ai-muted);}
#member-photo-scene-choose .photo-scene-card[aria-pressed="true"] {
    border-color:var(--cm-ai-plum-light);
    background:var(--cm-ai-soft);
}
#member-photo-scene-choose .photo-scene-option input {accent-color:var(--cm-ai-plum-light);}
#member-photo-scene-choose .photo-scene-options legend {color:var(--cm-ai-muted);}

/* Choix facultatifs propres aux operations IA, sans toucher a la portee des recettes. */
.photo-import-enhance {
    border-color:rgba(185, 138, 209, .38);
    background:rgba(98, 52, 124, .12);
}
.photo-import-enhance input, .photo-import-regional input {accent-color:var(--cm-ai-plum-light);}
#photo-import-enhance-price {color:var(--cm-ai-muted);}
.photo-import-regional {border-left-color:var(--cm-ai-plum-light);}
#photo-import-confirm .photo-import-confirm-breakdown {border-color:rgba(185, 138, 209, .32);}
#photo-import-confirm .photo-import-confirm-total {border-top-color:rgba(185, 138, 209, .38);}
#member-photo-scene-choose .photo-scene-options {border-color:rgba(185, 138, 209, .35);}
#member-photo-scene-choose .photo-scene-option:hover {background:rgba(140, 80, 166, .12);}
#member-photo-scene-choose .photo-scene-upload-label {
    border-color:var(--cm-ai-border); color:var(--cm-ai-ink);
    background:var(--cm-ai-soft);
}
#member-photo-scene-choose .photo-scene-upload-label:hover {background:var(--cm-ai-soft-hover);}
#member-photo-enhance-compare .photo-enhance-comparison figcaption,
#album-cover-ai-compare .album-ai-comparison figure,
#album-cover-ai-confirm .album-ai-cost {color:var(--cm-ai-muted);}
#album-cover-ai-confirm .album-ai-preview img,
#album-cover-ai-compare .album-ai-comparison img {border-color:rgba(185, 138, 209, .48);}

/* Identite visuelle de l'attente IA, sans changer le mecanisme de l'overlay. */
.cm-ai-processing-overlay {
    border-color:var(--cm-ai-border);
    background:linear-gradient(145deg,#33253b 0%,#26212a 64%,#211e23 100%);
    box-shadow:0 26px 85px #000b,0 0 40px rgba(140,80,166,.18),inset 0 1px rgba(185,138,209,.25);
}
.cm-ai-processing-icon {
    border-color:var(--cm-ai-border);
    background:linear-gradient(140deg,#513161,#29222f);
    box-shadow:0 0 28px rgba(140,80,166,.3);
    animation-name:cm-ai-plum-breathe;
}
.cm-ai-processing-kicker {color:var(--cm-ai-muted);}
.cm-ai-processing-track {background:#48344e;}
.cm-ai-processing-track span {background:linear-gradient(90deg,var(--cm-ai-plum),var(--cm-ai-muted),var(--cm-ai-plum-light));}
.cm-ai-processing-elapsed {color:#cfb6d9;}
@keyframes cm-ai-plum-breathe {50%{box-shadow:0 0 36px rgba(185,138,209,.53);transform:translateY(-2px)}}
@media(prefers-reduced-motion:reduce) {
    button.cm-ai-action,a.cm-ai-action {transition:none;}
    .cm-ai-processing-icon {animation:none!important;}
}

/* Accroches de cartes : la description seule reçoit le traitement IA. */
.cm-recipe-description-heading {display:flex;align-items:center;justify-content:space-between;gap:1rem;flex-wrap:wrap;}
.cm-recipe-description-heading label {font-weight:700;}
.cm-recipe-description-ai-button {font-size:.83rem;font-weight:800;padding:.6rem .95rem;border-radius:10px;min-height:38px;cursor:pointer;white-space:nowrap;}
.cm-recipe-description-ai-button:disabled {opacity:.48;cursor:not-allowed;}
.cm-recipe-description-editor {min-width:0;display:flex;flex-direction:column;gap:.45rem;}
.cm-recipe-description-editor textarea {width:100%;box-sizing:border-box;}
.cm-recipe-description-ai-message {font-size:.84rem;color:var(--cm-ai-muted);margin:.4rem 0;line-height:1.4;}
.cm-recipe-description-ai-message[hidden] {display:none;}
#cm-recipe-description-ai-confirm.cm-dialog,#cm-recipe-description-ai-choose.cm-dialog {border-color:var(--cm-ai-border);}
:is(#cm-recipe-description-ai-confirm,#cm-recipe-description-ai-choose) .cm-dialog-icon {background:var(--cm-ai-gradient);color:var(--cm-ai-ink);}
:is(#cm-recipe-description-ai-confirm,#cm-recipe-description-ai-choose) .cm-dialog-kicker {color:var(--cm-ai-muted);}
#cm-recipe-description-ai-confirm .cm-dialog-button[data-cm-dialog-code="confirm"] {background:var(--cm-ai-gradient);border-color:var(--cm-ai-plum-light);color:var(--cm-ai-ink);}
#cm-recipe-description-ai-confirm .cm-dialog-button[data-cm-dialog-code="confirm"]:hover:not(:disabled) {background:var(--cm-ai-gradient-hover);}
:is(#cm-recipe-description-ai-confirm,#cm-recipe-description-ai-choose) button:focus-visible {outline-color:var(--cm-ai-outline);}
.cm-recipe-description-ai-cost {display:flex;justify-content:space-between;align-items:center;gap:1rem;padding:.6rem 0;border-bottom:1px solid rgba(185,138,209,.3);font-size:.9rem;}
.cm-recipe-description-ai-cost strong {color:var(--cm-ai-muted);}
.cm-recipe-description-ai-note {margin:1rem 0 0;color:#cebecf;font-size:.83rem;line-height:1.6;}
.cm-recipe-description-ai-warning {color:#ffcf80;font-weight:700;font-size:.85rem;}
#cm-recipe-description-ai-choose.cm-dialog {width:min(620px,calc(100vw - 2rem));max-height:90dvh;}
.cm-recipe-description-ai-options {display:grid;gap:.65rem;}
.cm-recipe-description-ai-option {display:flex;align-items:flex-start;gap:.8rem;padding:.85rem;border:1px solid rgba(185,138,209,.35);border-radius:12px;background:#29242c;cursor:pointer;line-height:1.4;}
.cm-recipe-description-ai-option:hover,.cm-recipe-description-ai-option:focus-within {border-color:var(--cm-ai-outline);background:var(--cm-ai-soft);}
.cm-recipe-description-ai-option:has(input:checked) {border-color:var(--cm-ai-plum-light);background:rgba(98,52,124,.34);}
.cm-recipe-description-ai-option input {flex-shrink:0;accent-color:var(--cm-ai-plum-light);margin-top:.35rem;}
.cm-recipe-description-ai-option>span {display:grid;gap:.3rem;min-width:0;font-size:.88rem;color:#f5ebf8;}
.cm-recipe-description-ai-option strong {color:var(--cm-ai-muted);font-size:.76rem;letter-spacing:.02em;}
@media(max-width:480px) {.cm-recipe-description-heading {align-items:flex-start;} .cm-recipe-description-ai-button {white-space:normal;}}

/* Signature de toutes les popups IA. Les autres CMDialog restent dans le thème classique.
   Theme="Ai" côté Razor émet cm-dialog-ai ; l'import Texte/URL l'active seulement
   pendant sa phase IA dans la popup d'ajout de recette partagée. */
.cm-dialog.cm-dialog-ai {
    border-color:var(--cm-ai-border);
    background:radial-gradient(ellipse at 80% -20%,rgba(123,69,146,.38),transparent 56%),
               linear-gradient(145deg,#302438 0%,#26212d 64%,#201d25 100%);
    color:var(--cm-ai-ink);
    box-shadow:0 24px 90px #000c,0 0 0 1px rgba(185,138,209,.18),inset 0 1px rgba(208,166,226,.2);
}
.cm-dialog.cm-dialog-ai::backdrop {background:rgba(13,8,18,.82);backdrop-filter:blur(3px);}
.cm-dialog.cm-dialog-ai .cm-dialog-icon {
    background:var(--cm-ai-gradient);color:var(--cm-ai-ink);
    box-shadow:0 4px 18px rgba(98,52,124,.25);
}
.cm-dialog.cm-dialog-ai .cm-dialog-kicker {color:var(--cm-ai-muted);}
.cm-dialog.cm-dialog-ai h2 {color:#fff4ff;}
.cm-dialog.cm-dialog-ai .cm-dialog-description {color:#d8c9dd;}
.cm-dialog.cm-dialog-ai .cm-dialog-actions {border-top-color:rgba(185,138,209,.3);}
.cm-dialog.cm-dialog-ai .cm-dialog-button-primary {
    border-color:var(--cm-ai-plum-light);
    background:var(--cm-ai-gradient);
    color:#fff;
}
.cm-dialog.cm-dialog-ai .cm-dialog-button-primary:hover:not(:disabled) {
    border-color:var(--cm-ai-outline);
    background:var(--cm-ai-gradient-hover);
}
.cm-dialog.cm-dialog-ai .cm-dialog-button-secondary,
.cm-dialog.cm-dialog-ai .cm-dialog-button-neutral {
    border-color:rgba(185,138,209,.42);background:#332b3b;color:#f3e6f5;
}
.cm-dialog.cm-dialog-ai .cm-dialog-button-secondary:hover:not(:disabled),
.cm-dialog.cm-dialog-ai .cm-dialog-button-neutral:hover:not(:disabled) {
    background:#42334c;border-color:var(--cm-ai-outline);
}
.cm-dialog.cm-dialog-ai button:focus-visible,
.cm-dialog.cm-dialog-ai a:focus-visible,
.cm-dialog.cm-dialog-ai input:focus-visible,
.cm-dialog.cm-dialog-ai textarea:focus-visible,
.cm-dialog.cm-dialog-ai select:focus-visible {
    outline:2px solid var(--cm-ai-outline);outline-offset:3px;
}
/* Formulaires d'importation depuis texte ou URL : la fenêtre n'est prune
   que lorsque l'utilisateur a choisi une opération IA. */
#cm-add-recipe-dialog.cm-dialog.cm-dialog-ai {
    border-color:var(--cm-ai-border);
    background:radial-gradient(ellipse at 86% -14%,rgba(123,69,146,.38),transparent 56%),
               linear-gradient(145deg,#302438,#211d26 74%);
    box-shadow:0 25px 95px #000c,0 0 0 1px rgba(185,138,209,.18),inset 0 1px rgba(208,166,226,.2);
}
#cm-add-recipe-dialog.cm-dialog-ai .cm-add-dialog-heading-accent {color:var(--cm-ai-muted);}
#cm-add-recipe-dialog.cm-dialog-ai .cm-add-dialog-heading-accent::after {background:var(--cm-ai-plum-light);}
#cm-add-recipe-dialog.cm-dialog-ai .cm-dialog-inner>h2 {color:#fff4ff;}
#cm-add-recipe-dialog.cm-dialog-ai .cm-dialog-description {color:#d8c9dd;}
#cm-add-recipe-dialog.cm-dialog-ai .cm-dialog-actions {border-top-color:rgba(185,138,209,.3);}
#cm-add-recipe-dialog.cm-dialog-ai .cm-dialog-actions .cm-dialog-button-secondary {
    border-color:var(--cm-ai-border);background:#332b3b;color:var(--cm-ai-ink);
}
#cm-add-recipe-dialog.cm-dialog-ai .cm-dialog-actions .cm-dialog-button-secondary:hover {
    border-color:var(--cm-ai-outline);background:#42334c;
}
#cm-add-recipe-dialog.cm-dialog-ai .cm-add-form h3,
#cm-add-recipe-dialog.cm-dialog-ai .cm-add-url-options legend {color:var(--cm-ai-muted);}
#cm-add-recipe-dialog.cm-dialog-ai .cm-add-form label {color:#f0dff4;}
#cm-add-recipe-dialog.cm-dialog-ai .cm-add-form textarea,
#cm-add-recipe-dialog.cm-dialog-ai .cm-add-form input[type="url"],
#cm-add-recipe-dialog.cm-dialog-ai .cm-add-form input[type="text"],
#cm-add-recipe-dialog.cm-dialog-ai .cm-add-form select {
    border-color:rgba(185,138,209,.4);background:#231d29;color:var(--cm-ai-ink);
}
#cm-add-recipe-dialog.cm-dialog-ai .cm-add-url-options,
#cm-add-recipe-dialog.cm-dialog-ai .cm-add-replace {border-color:rgba(185,138,209,.4);}
#cm-add-recipe-dialog.cm-dialog-ai .cm-add-replace {background:var(--cm-ai-soft);}
#cm-add-recipe-dialog.cm-dialog-ai .cm-add-replace label {color:#eed2fa;}
#cm-add-recipe-dialog.cm-dialog-ai .cm-add-url-options input,
#cm-add-recipe-dialog.cm-dialog-ai .cm-add-replace input {accent-color:var(--cm-ai-plum-light);}
#cm-add-recipe-dialog.cm-dialog-ai .cm-add-back,
#cm-add-recipe-dialog.cm-dialog-ai .cm-add-price,
#cm-add-recipe-dialog.cm-dialog-ai .cm-add-form-actions span {color:var(--cm-ai-muted);}
/* Les encarts de confirmation IA reprennent eux aussi la palette prune. */
#photo-import-confirm.cm-dialog-ai .photo-import-confirm-breakdown {
    background:#2a2230;border-color:rgba(185,138,209,.4);
}
#photo-import-confirm.cm-dialog-ai .photo-import-confirm-line,
#photo-import-confirm.cm-dialog-ai .photo-import-confirm-balance,
#photo-import-confirm.cm-dialog-ai .photo-import-confirm-note {color:#ddcde2;}
#photo-import-confirm.cm-dialog-ai .photo-import-confirm-total {border-top-color:var(--cm-ai-border);}
#photo-import-confirm.cm-dialog-ai .photo-import-confirm-total strong,
#photo-import-confirm.cm-dialog-ai .photo-import-confirm-balance strong {color:var(--cm-ai-muted);}
#member-photo-scene-choose.cm-dialog-ai .photo-scene-empty {border-color:var(--cm-ai-border);color:#d8c9dd;}
#cm-pinterest-poster-dialog.cm-dialog-ai .cm-pin-note {color:#d8c9dd;}
@media(prefers-reduced-motion:reduce) {
    .cm-dialog.cm-dialog-ai::backdrop {backdrop-filter:none;}
}

/* Administration du contenu editorial, isolee par prefixe pour ne pas toucher au site public. */
.editorial-admin { display:grid; gap:1.15rem; color:#f8f2e5; }
.editorial-admin .editorial-head { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:1.2rem; }
.editorial-admin .editorial-head span, .editorial-admin .editorial-kicker { display:block; color:#edb935; font-size:.7rem; font-weight:850; letter-spacing:.15em; }
.editorial-admin .editorial-head h1 { font:700 clamp(1.7rem,3vw,2.5rem) Georgia,serif; margin:.2rem 0 .45rem; color:#fff7e8; }
.editorial-admin .editorial-head p { margin:0; color:#aaa395; line-height:1.5; }
.editorial-admin .editorial-head-actions, .editorial-admin .editorial-actions { display:flex; align-items:center; flex-wrap:wrap; gap:.65rem; }
.editorial-admin button, .editorial-admin input, .editorial-admin select, .editorial-admin textarea { font:inherit; }
.editorial-admin button { cursor:pointer; }
.editorial-admin button:disabled { cursor:default; opacity:.55; }
.editorial-admin .editorial-primary, .editorial-admin .editorial-outline { display:inline-flex; align-items:center; justify-content:center; gap:.35rem; padding:.73rem 1rem; border-radius:9px; font-size:.88rem; font-weight:800; text-decoration:none; }
.editorial-admin .editorial-primary { color:#211c13; background:#f2b932; border:1px solid #f2b932; }
.editorial-admin .editorial-outline { border:1px solid #5c5135; background:transparent; color:#f0d59a; }
.editorial-admin .editorial-primary:hover { background:#ffd464; }
.editorial-admin .editorial-outline:hover { border-color:#e9b73d; }
.editorial-admin .editorial-panel { background:#24221d; border:1px solid #484032; border-radius:14px; padding:1.15rem; min-width:0; }
.editorial-admin .editorial-alert { background:#3a2c1e; border:1px solid #9f7337; border-radius:9px; padding:.8rem 1rem; color:#ffdfaa; }
.editorial-admin .editorial-split { display:grid; grid-template-columns:minmax(0,1.6fr) minmax(305px,.85fr); gap:1rem; align-items:start; }
.editorial-admin .editorial-editor h2, .editorial-admin .editorial-preview h2 { font:700 1.4rem Georgia,serif; color:#fff5de; margin:0 0 1.2rem; }
.editorial-admin .editorial-fields { display:grid; gap:.5rem; }
.editorial-admin .editorial-fields label, .editorial-admin .editorial-filters label { color:#ded1bd; font-size:.84rem; font-weight:700; display:block; margin-top:.45rem; margin-bottom:.3rem; }
.editorial-admin .editorial-fields em { color:#f4b72b; font-style:normal; }
.editorial-admin .editorial-control, .editorial-admin .editorial-filters input, .editorial-admin .editorial-filters select, .editorial-admin .editorial-toolbar input { min-width:0; width:100%; border:1px solid #5b4c31; border-radius:8px; background:#171814; color:#fff7e9; padding:.73rem .8rem; outline-offset:2px; }
.editorial-admin .editorial-control:focus, .editorial-admin .editorial-filters input:focus, .editorial-admin .editorial-filters select:focus { outline:2px solid #edb935; }
.editorial-admin .editorial-fields-two { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.8rem; }
.editorial-admin .editorial-date-field { display:flex; align-items:center; gap:.5rem; min-width:0; }
.editorial-admin .editorial-date-field .editorial-date-picker { flex:1; }
.editorial-admin .editorial-date-clear { flex-shrink:0; font-size:.78rem; padding:.72rem .65rem; }
.editorial-admin .editorial-date-picker { display:flex; justify-content:space-between; align-items:center; gap:.75rem; text-align:left; cursor:pointer; }
.editorial-admin .editorial-date-picker:hover:not(:disabled) { border-color:#edb935; }
.editorial-admin .editorial-date-picker span:last-child { color:#f2c966; font-size:1.25rem; line-height:1; }
.editorial-admin .editorial-check { display:flex!important; align-items:center; gap:.6rem; font-weight:700; cursor:pointer; }
.editorial-admin .editorial-check input { accent-color:#edb935; width:18px; height:18px; }
.editorial-admin .editorial-check span { color:#f2cc73; }
.editorial-admin .editorial-editor .editorial-primary { margin-top:.5rem; }
.editorial-admin .editorial-help { color:#a9a293; font-size:.76rem; line-height:1.45; }
.editorial-admin .editorial-table-wrap { padding:0; overflow:hidden; }
.editorial-admin .editorial-table { width:100%; border-collapse:collapse; font-size:.84rem; }
.editorial-admin .editorial-table thead { background:#322d24; }
.editorial-admin .editorial-table th { text-align:left; font-weight:800; font-size:.75rem; color:#cab99a; padding:.9rem .75rem; white-space:nowrap; }
.editorial-admin .editorial-table td { padding:.9rem .75rem; border-top:1px solid rgba(255,255,255,.08); vertical-align:middle; }
.editorial-admin .editorial-table td strong { display:block; font-weight:800; color:#fff7e6; }
.editorial-admin .editorial-table td small { display:block; color:#9d9585; font-size:.72rem; margin-top:.25rem; line-height:1.3; }
.editorial-admin .editorial-row-selected { background:rgba(238,183,52,.08); }
.editorial-admin .editorial-link, .editorial-admin .editorial-danger-link { color:#f2c966; background:none; padding:0; border:0; text-decoration:underline; font-size:.85rem; }
.editorial-admin .editorial-danger-link { color:#ffb7a3; }
.editorial-admin .editorial-delete { margin-top:1.3rem; padding-top:1rem; border-top:1px solid #4a4030; }
.editorial-admin .editorial-delete p, .editorial-admin .editorial-delete small { color:#cab7a0; }
.editorial-admin .editorial-danger { margin-right:.6rem; border:1px solid #a64d43; border-radius:8px; padding:.6rem .85rem; background:#69332c; color:#fff1eb; }
.editorial-admin .editorial-state { display:inline-block; padding:.29rem .55rem; border-radius:6px; white-space:nowrap; font-size:.72rem; font-weight:800; }
.editorial-admin .editorial-state-good { color:#d1f0c6; background:#29432f; }
.editorial-admin .editorial-state-muted { color:#c4bcab; background:#39362e; }
.editorial-admin .editorial-state-danger { color:#ffb8a4; background:#593128; }
.editorial-admin .editorial-state-soon { color:#ffdf91; background:#58441f; }
.editorial-admin .editorial-toolbar { display:flex; align-items:center; gap:.65rem; padding:1rem; }
.editorial-admin .editorial-toolbar span { white-space:nowrap; color:#bcb3a4; font-size:.78rem; }
.editorial-admin .editorial-filters { display:grid; gap:.6rem; }
.editorial-admin .editorial-filter-end { display:flex; flex-wrap:wrap; align-items:end; gap:.65rem; }
.editorial-admin .editorial-filter-end > div { width:min(200px,100%); }
.editorial-admin .editorial-filter-end select { width:100%; }
.editorial-admin .editorial-switch-panel { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:1rem 1.2rem; border:1px solid #61512c; border-radius:12px; background:#2d281d; }
.editorial-admin .editorial-switch-panel strong { color:#ffe3a0; }
.editorial-admin .editorial-switch-panel p { margin:.25rem 0 0; color:#afa392; font-size:.8rem; }
.editorial-admin .editorial-list-layout { display:grid; grid-template-columns:minmax(0,1.85fr) minmax(275px,.85fr); align-items:start; gap:1rem; }
.editorial-admin .editorial-list-count { font-size:.8rem; color:#cfc1ab; padding:.85rem 1rem; }
.editorial-admin .editorial-title-button { display:flex; align-items:center; text-align:left; gap:.6rem; color:inherit; background:none; border:0; padding:0; }
.editorial-admin .editorial-title-button img { width:60px; height:45px; object-fit:cover; border-radius:5px; }
.editorial-admin .editorial-title-button:hover strong { color:#edb935; }
.editorial-admin .editorial-pagination { display:flex; align-items:center; justify-content:space-between; gap:.65rem; padding:1rem; color:#c7b9a1; border-top:1px solid #433b2e; }
.editorial-admin .editorial-pagination button { color:#f0d197; background:#302a21; border:1px solid #61512c; border-radius:7px; padding:.55rem .75rem; }
.editorial-admin .editorial-preview { display:flex; flex-direction:column; gap:.65rem; }
.editorial-admin .editorial-preview h2 { margin:.2rem 0; line-height:1.2; }
.editorial-admin .editorial-preview p { line-height:1.6; color:#c7bcaa; white-space:pre-line; overflow-wrap:anywhere; }
.editorial-admin .editorial-hero-preview { width:100%; aspect-ratio:16/9; object-fit:cover; border-radius:8px; }
.editorial-admin .editorial-preview-meta { display:flex; flex-wrap:wrap; gap:.35rem; font-size:.78rem; color:#f6c861; }
.editorial-admin .editorial-preview-note { border-top:1px solid #544633; padding:.75rem 0; color:#a9a093; font-size:.78rem; }
.editorial-admin .editorial-empty-preview { text-align:center; padding:2rem .7rem; }
.editorial-admin .editorial-empty-preview span { font-size:3rem; }
.editorial-admin .editorial-edit-layout { display:grid; grid-template-columns:minmax(0,1.5fr) minmax(290px,.85fr); align-items:start; gap:1rem; }
.editorial-admin .editorial-edit-sidebar { display:grid; gap:1rem; }
.editorial-admin .editorial-image-main { width:100%; max-height:280px; object-fit:contain; border-radius:9px; background:#161713; }
.editorial-admin .editorial-image-empty { padding:3rem 1rem; border:2px dashed #52472f; text-align:center; color:#a99e8c; border-radius:9px; }
.editorial-admin .editorial-upload { display:grid; gap:.5rem; color:#e8cf92; font-size:.82rem; padding-top:1rem; }
.editorial-admin .editorial-upload input { max-width:100%; font-size:.78rem; }
.editorial-admin .editorial-blocks-placeholder { display:flex; justify-content:space-between; align-items:center; gap:1rem; }
.editorial-admin .editorial-blocks-placeholder h2 { margin:.4rem 0; font:700 1.3rem Georgia,serif; }
.editorial-admin .editorial-blocks-placeholder p { margin:0; color:#a9a093; }
.editorial-admin .editorial-actions { padding:.6rem 0; }
.editorial-admin .editorial-actions > a { color:#ccb78c; font-size:.83rem; }
@media (max-width:1250px) { .editorial-admin .editorial-list-layout { grid-template-columns:1fr; } .editorial-admin .editorial-preview { max-width:750px; } }
@media (max-width:980px) { .editorial-admin .editorial-split, .editorial-admin .editorial-edit-layout { grid-template-columns:1fr; } }
@media (max-width:680px) { .editorial-admin .editorial-fields-two { grid-template-columns:1fr; } .editorial-admin .editorial-table-wrap { overflow-x:auto; } .editorial-admin .editorial-table { min-width:600px; } .editorial-admin .editorial-head { align-items:stretch; } .editorial-admin .editorial-switch-panel { flex-direction:column; align-items:flex-start; } }

.editorial-admin .editorial-validation { color:#ffb5a5; padding:.75rem 1rem; border-radius:8px; background:#3f2722; }
.editorial-admin .editorial-validation:empty { display:none; }

/* Edition et lecture des blocs editoriaux (admin seulement en V1). */
.editorial-admin .editorial-blocks-editor { display:grid; gap:1rem; }
.editorial-admin .editorial-blocks-head { display:flex; justify-content:space-between; align-items:start; gap:1rem; flex-wrap:wrap; }
.editorial-admin .editorial-blocks-head h2 { font:700 1.45rem Georgia,serif; margin:.25rem 0; }
.editorial-admin .editorial-blocks-head p { color:#b4a895; margin:.25rem 0; font-size:.86rem; }
.editorial-admin .editorial-block-list { display:grid; gap:.5rem; }
.editorial-admin .editorial-empty-blocs { padding:1.2rem; text-align:center; color:#b3a796; border:1px dashed #645034; border-radius:10px; }
.editorial-admin .editorial-block-line { display:flex; justify-content:space-between; align-items:center; gap:.9rem; padding:.8rem; border:1px solid #4e4330; border-radius:9px; background:#1c1c18; }
.editorial-admin .editorial-block-line.is-selected { border-color:#eab733; }
.editorial-admin .editorial-block-summary { display:grid; gap:.3rem; min-width:0; }
.editorial-admin .editorial-block-summary small { max-width:560px; color:#b9ac9a; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.editorial-admin .editorial-block-controls, .editorial-admin .editorial-add-blocks, .editorial-admin .editorial-block-form-actions { display:flex; align-items:center; flex-wrap:wrap; gap:.5rem; }
.editorial-admin .editorial-block-controls .editorial-outline { padding:.4rem .6rem; font-size:.77rem; }
.editorial-admin .editorial-block-form { display:grid; gap:.75rem; border:1px solid #685331; border-radius:10px; padding:1.1rem; background:#2b281f; }
.editorial-admin .editorial-block-form-head { display:flex; justify-content:space-between; align-items:center; gap:.7rem; flex-wrap:wrap; }
.editorial-admin .editorial-block-form h3 { margin:0; font:700 1.25rem Georgia,serif; }
.editorial-admin .editorial-block-form h4 { margin:.6rem 0 .1rem; }
.editorial-admin .editorial-block-form label { font-weight:700; font-size:.84rem; color:#e5d1a6; }
.editorial-admin .editorial-block-image-preview { max-width:100%; max-height:350px; object-fit:contain; justify-self:start; border-radius:8px; }
.editorial-admin .editorial-rich-editor { display:grid; gap:.55rem; }
.editorial-admin .editorial-rich-tools { display:flex; flex-wrap:wrap; gap:.4rem; }
.editorial-admin .editorial-rich-tools button { border:1px solid #78623a; background:#1b1b17; color:#ffe6ae; border-radius:6px; padding:.45rem .65rem; }
.editorial-admin .editorial-rich-surface { min-height:180px; padding:1rem; border:1px solid #796339; border-radius:8px; background:#191915; color:#fcf3e0; outline-offset:2px; overflow-wrap:anywhere; line-height:1.7; }
.editorial-admin .editorial-rich-surface:focus { outline:2px solid #edb935; }
.editorial-admin .editorial-rich-surface a { color:#f2c556; }
.editorial-admin .editorial-recipe-search { display:flex; gap:.5rem; align-items:center; }
.editorial-admin .editorial-recipe-results { display:grid; gap:.35rem; max-height:240px; overflow:auto; border:1px solid #4d4230; border-radius:8px; padding:.55rem; }
.editorial-admin .editorial-recipe-result { display:flex; align-items:center; flex-wrap:wrap; gap:.4rem; padding:.5rem .2rem; border-bottom:1px solid #524734; }
.editorial-admin .editorial-recipe-result span { flex:1; min-width:170px; }
.editorial-admin .editorial-recipe-result .editorial-outline { padding:.35rem .55rem; }
.editorial-admin .editorial-article-reading { width:min(100%,990px); margin:0 auto; border:1px solid #51452f; border-radius:14px; padding:clamp(1rem,4vw,2.5rem); background:#24221d; color:#eee2cf; }
.editorial-admin .editorial-article-header { margin-bottom:2rem; }
.editorial-admin .editorial-article-header h1 { color:#fff4dc; font:700 clamp(1.9rem,4vw,3rem) Georgia,serif; line-height:1.15; margin:.55rem 0; }
.editorial-admin .editorial-article-lead { color:#d3c1a1; font-size:1.12rem; line-height:1.7; }
.editorial-admin .editorial-article-cover { width:100%; max-height:470px; object-fit:cover; border-radius:10px; margin-top:1rem; }
.editorial-admin .editorial-content-text { margin:1.3rem 0; line-height:1.72; font-size:1rem; overflow-wrap:anywhere; }
.editorial-admin .editorial-content-text h2, .editorial-admin .editorial-content-text h3, .editorial-admin .editorial-content-text h4 { font-family:Georgia,serif; color:#ffebbb; margin:1.6rem 0 .75rem; }
.editorial-admin .editorial-content-text h2 { font-size:1.75rem; }
.editorial-admin .editorial-content-text h3 { font-size:1.35rem; }
.editorial-admin .editorial-content-text h4 { font-size:1.1rem; }
.editorial-admin .editorial-content-html p { margin:0 0 .8rem; }
.editorial-admin .editorial-content-html ul, .editorial-admin .editorial-content-html ol { margin:.4rem 0 .9rem; padding-left:1.5rem; }
.editorial-admin .editorial-content-html a { color:#f5c65d; }
.editorial-admin .editorial-content-astuce, .editorial-admin .editorial-content-attention, .editorial-admin .editorial-content-mise-en-avant, .editorial-admin .editorial-content-citation { border-radius:9px; padding:1rem 1.2rem; }
.editorial-admin .editorial-content-astuce { background:#283426; border-left:4px solid #9bbb67; }
.editorial-admin .editorial-content-attention { background:#3b2924; border-left:4px solid #e69372; }
.editorial-admin .editorial-content-mise-en-avant { background:#363022; border-left:4px solid #ecc052; font-weight:600; }
.editorial-admin .editorial-content-citation { background:#302c28; border-left:4px solid #b5a49a; font-style:italic; }
.editorial-admin .editorial-callout-label { font-weight:800; margin-bottom:.5rem; }
.editorial-admin .editorial-content-image { margin:2rem auto; }
.editorial-admin .editorial-content-image img { display:block; width:100%; height:auto; border-radius:9px; }
.editorial-admin .editorial-image-moyenne { max-width:700px; }
.editorial-admin .editorial-image-centree { max-width:450px; }
.editorial-admin .editorial-content-image figcaption { margin-top:.5rem; color:#cbbca4; font-size:.83rem; text-align:center; }
.editorial-admin .editorial-content-recipes { margin:2rem 0; }
.editorial-admin .editorial-content-recipes h2 { font:700 1.5rem Georgia,serif; margin-bottom:1rem; }
.editorial-admin .editorial-recipes-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr)); gap:1rem; }
.editorial-admin .editorial-article-empty { color:#b5a996; font-style:italic; }
@media (max-width:700px) { .editorial-admin .editorial-block-line { align-items:stretch; flex-direction:column; } .editorial-admin .editorial-block-summary small { max-width:75vw; } .editorial-admin .editorial-recipe-search { flex-wrap:wrap; } }

/* Administration éditoriale PC : liste compacte, aperçu majoritaire. */
.editorial-admin.editorial-index-page .editorial-list-layout {
    grid-template-columns:minmax(320px,35fr) minmax(0,65fr);
    align-items:start;
}
.editorial-admin .editorial-cards-panel { padding:0; overflow:hidden; }
.editorial-admin .editorial-article-cards { display:grid; gap:.48rem; padding:.55rem; }
.editorial-admin .editorial-article-card { display:flex; align-items:start; gap:.8rem; border:1px solid #504432; border-radius:10px; background:#1b1b18; padding:.7rem; cursor:pointer; min-width:0; }
.editorial-admin .editorial-article-card:hover, .editorial-admin .editorial-article-card:focus-visible { border-color:#dfaf43; }
.editorial-admin .editorial-article-card.is-selected { border-color:#edb935; background:#39301e; }
.editorial-admin .editorial-article-card > img { width:90px; height:76px; border-radius:7px; object-fit:cover; flex:none; }
.editorial-admin .editorial-card-body { display:grid; gap:.48rem; min-width:0; flex:1; }
.editorial-admin .editorial-card-body a { color:#fff3d7; text-decoration:none; font-size:.94rem; font-weight:800; line-height:1.3; overflow-wrap:anywhere; }
.editorial-admin .editorial-card-body a:hover { color:#ffd166; text-decoration:underline; }
.editorial-admin .editorial-card-meta { display:flex; gap:.45rem; align-items:center; flex-wrap:wrap; color:#ccbca0; font-size:.75rem; }
.editorial-admin .editorial-card-body > small { font-size:.71rem; color:#a69b85; }
/* Même bouton de suppression discret que sur les cartes de la bibliothèque d'images. */
.editorial-admin .editorial-article-delete {
    align-self:flex-end; flex:none; min-width:36px; min-height:36px; padding:0;
    border:1px solid #68423a; background:#39231e; border-radius:9px;
    color:#f6a69a; font-size:1.15rem; line-height:1; cursor:pointer;
}
.editorial-admin .editorial-article-delete:hover:not(:disabled) { background:#65352d; border-color:#cb7770; }
.editorial-admin .editorial-article-delete:focus-visible { outline:2px solid #f4b72b; outline-offset:2px; }
.editorial-admin .editorial-cards-empty { padding:1rem; color:#c4b59b; }
.editorial-admin .editorial-list-reading { min-height:470px; }
.editorial-admin .editorial-list-reading .editorial-article-reading { width:100%; border:0; padding:.4rem; background:transparent; }
/* Filtres compacts en une ligne : libellés et contrôles restent côte à côte sur PC. */
.editorial-admin.editorial-index-page .editorial-filters-compact {
    display:grid; grid-template-columns:minmax(230px,1.5fr) minmax(240px,1.25fr) minmax(175px,.9fr) auto;
    gap:.8rem; align-items:center; padding:.8rem 1rem;
}
.editorial-admin.editorial-index-page .editorial-filter-field { display:flex; align-items:center; gap:.55rem; min-width:0; }
.editorial-admin.editorial-index-page .editorial-filter-field label { display:inline; flex:none; margin:0; white-space:nowrap; }
.editorial-admin.editorial-index-page .editorial-filter-field input,
.editorial-admin.editorial-index-page .editorial-filter-field select { flex:1; min-width:0; padding:.55rem .65rem; height:42px; }
.editorial-admin.editorial-index-page .editorial-filters-compact > button { white-space:nowrap; padding:.55rem .75rem; min-height:42px; }
@media (max-width:1150px) {
    .editorial-admin.editorial-index-page .editorial-filters-compact { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .editorial-admin.editorial-index-page .editorial-filters-compact > button { justify-self:start; }
}
@media (max-width:650px) {
    .editorial-admin.editorial-index-page .editorial-filters-compact { grid-template-columns:1fr; }
}
.editorial-admin.editorial-index-page .editorial-switch-panel .editorial-check { margin-left:auto; }

/* Barre sticky de l'éditeur ; la barre d'administration classique défile normalement. */
.editorial-admin .editorial-article-form { display:grid; gap:1.15rem; min-width:0; }
.editorial-admin .editorial-editor-sticky {
    position:sticky; top:0; z-index:120;
    display:flex; flex-direction:column; align-items:stretch; gap:.65rem;
    padding:.85rem 1.05rem; margin:-.2rem 0 .1rem;
    border:1px solid #7b6231; border-radius:12px;
    background:rgba(30,28,23,.98); box-shadow:0 8px 24px rgba(0,0,0,.36);
}
/* Les messages s'affichent sous les actions et restent visibles pendant le defilement. */
.editorial-admin .editorial-sticky-main { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:1rem; min-width:0; }
.editorial-admin .editorial-sticky-notice {
    display:flex; align-items:flex-start; justify-content:space-between; gap:.8rem;
    padding:.7rem .85rem; border:1px solid #9f7337; border-radius:9px;
    background:#3a2c1e; color:#ffdfaa; min-width:0;
}
.editorial-admin .editorial-sticky-notice-text { flex:1; min-width:0; white-space:pre-line; overflow-wrap:anywhere; line-height:1.5; }
.editorial-admin .editorial-sticky-notice-close {
    flex:none; display:inline-flex; justify-content:center; align-items:center;
    width:1.8rem; height:1.8rem; margin:-.2rem -.3rem 0 0;
    padding:0; border:0; border-radius:6px; color:#ffdfaa; background:transparent;
    font-size:1.4rem; line-height:1;
}
.editorial-admin .editorial-sticky-notice-close:hover,
.editorial-admin .editorial-sticky-notice-close:focus-visible { color:#fff; background:#5a4225; }
.editorial-admin .editorial-sticky-heading { display:grid; gap:.2rem; }
.editorial-admin .editorial-sticky-heading span { color:#edb935; font-size:.69rem; font-weight:850; letter-spacing:.13em; }
.editorial-admin .editorial-sticky-heading strong { font:700 1.25rem Georgia,serif; }
.editorial-admin .editorial-sticky-actions { display:flex; flex-wrap:wrap; align-items:center; gap:.55rem; }
.editorial-admin .editorial-sticky-actions .editorial-primary { min-width:115px; }
.editorial-admin .editorial-block-add-menu { position:relative; }
.editorial-admin .editorial-block-add-options { position:absolute; top:calc(100% + .4rem); right:0; width:220px; padding:.4rem; display:grid; gap:.15rem; z-index:125; background:#2b271f; border:1px solid #86652c; border-radius:10px; box-shadow:0 10px 30px rgba(0,0,0,.5); }
.editorial-admin .editorial-block-add-options button { text-align:left; padding:.7rem .85rem; background:transparent; border:0; border-radius:6px; color:#f6dfb0; }
.editorial-admin .editorial-block-add-options button:hover { background:#4b3a1b; }

/* Blocs toujours éditables : paramètres à gauche, rendu fidèle à droite. */
.editorial-admin .editorial-blocks-editor { margin-bottom:1.5rem; }
.editorial-admin .editorial-block-card { border:1px solid #625037; border-radius:11px; overflow:hidden; background:#24211c; }
.editorial-admin .editorial-block-card-head { display:flex; justify-content:space-between; align-items:center; gap:1rem; background:#312c22; padding:.68rem .95rem; }
.editorial-admin .editorial-block-number { color:#e7b545; font-weight:800; font-size:.8rem; margin-right:.5rem; }
.editorial-admin .editorial-block-columns { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:0; }
.editorial-admin .editorial-block-parameters, .editorial-admin .editorial-block-live { padding:1rem; display:grid; align-content:start; gap:.75rem; min-width:0; }
.editorial-admin .editorial-block-parameters { border-right:1px solid #625037; }
.editorial-admin .editorial-block-live { background:#1b1c19; }
.editorial-admin .editorial-block-columns h3 { color:#efcd86; font:700 1.02rem Georgia,serif; margin:0 0 .25rem; }
.editorial-admin .editorial-block-parameters label { font-weight:700; font-size:.82rem; color:#dfcda9; }
.editorial-admin .editorial-block-parameters h4 { margin:.6rem 0 0; font-size:.87rem; }
.editorial-admin .editorial-block-live-content { min-height:110px; padding:.2rem .45rem; overflow-wrap:anywhere; }
.editorial-admin .editorial-block-live-content .editorial-content-text { margin:0; }
.editorial-admin .editorial-block-live-content .editorial-content-text h2,
.editorial-admin .editorial-block-live-content .editorial-content-text h3,
.editorial-admin .editorial-block-live-content .editorial-content-text h4 { margin:.2rem 0 .65rem; }
.editorial-admin .editorial-block-live-content .editorial-content-image { margin:.5rem 0; }
.editorial-admin .editorial-block-live-content .editorial-recipes-grid { grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); }
.editorial-admin .editorial-preview-hint { color:#a99a83; font-style:italic; font-size:.87rem; }
.editorial-admin .editorial-block-controls .editorial-danger { margin-right:0; }
.editorial-admin .editorial-rich-surface { min-height:220px; }

/* Prévisualisation plein écran et accessible au clavier. */
.editorial-admin .editorial-preview-modal { position:fixed; inset:0; z-index:3000; background:#161713; display:flex; flex-direction:column; }
.editorial-admin .editorial-preview-modal-topbar { display:flex; align-items:center; justify-content:space-between; padding:.8rem 1.6rem; gap:1rem; border-bottom:1px solid #6b5530; background:#26221b; flex:none; }
.editorial-admin .editorial-preview-modal-topbar > div { display:grid; gap:.18rem; }
.editorial-admin .editorial-preview-modal-topbar strong { font:700 1.2rem Georgia,serif; }
.editorial-admin .editorial-preview-modal-topbar small { font-size:.78rem; color:#c5b798; }
.editorial-admin .editorial-preview-modal-scroll { flex:1; min-height:0; overflow-y:auto; padding:2rem; }
.editorial-admin .editorial-preview-modal-scroll .editorial-article-reading { max-width:1040px; }
@media (max-width:920px) {
    .editorial-admin.editorial-index-page .editorial-list-layout { grid-template-columns:1fr; }
    .editorial-admin .editorial-block-columns { grid-template-columns:1fr; }
    .editorial-admin .editorial-block-parameters { border-right:0; border-bottom:1px solid #625037; }
}

.editorial-admin .editorial-block-card { scroll-margin-top:100px; }

/* Echange JSON IA : commandes regroupees et controle avant application. */
.editorial-admin .editorial-ai-clipboard-actions { display:inline-flex; align-items:center; gap:.35rem; padding:.2rem; border:1px solid #65512e; border-radius:10px; }
.editorial-admin .editorial-ai-clipboard-actions .editorial-outline { padding:.52rem .72rem; }
.editorial-admin .editorial-ai-modal-backdrop { position:fixed; inset:0; z-index:3500; display:grid; place-items:center; background:rgba(0,0,0,.78); padding:1rem; }
.editorial-admin .editorial-ai-modal { width:min(94vw,760px); max-height:90vh; overflow:auto; display:grid; gap:.85rem; background:#25231e; color:#f8f2e5; border:1px solid #b58c3c; border-radius:13px; padding:1.35rem; box-shadow:0 14px 40px #0009; }
.editorial-admin .editorial-ai-modal h2 { margin:0; font:700 1.4rem Georgia,serif; }
.editorial-admin .editorial-ai-modal p { margin:0; line-height:1.55; }
.editorial-admin .editorial-ai-modal ul { margin:.1rem 0; padding-left:1.5rem; line-height:1.8; }
.editorial-admin .editorial-ai-modal textarea, .editorial-admin .editorial-ai-manual textarea { width:100%; font-family:ui-monospace,Consolas,monospace; font-size:.8rem; line-height:1.45; resize:vertical; }
.editorial-admin .editorial-ai-modal-actions { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:.65rem; }
.editorial-admin .editorial-ai-manual { display:grid; gap:.8rem; }
.editorial-admin .editorial-ai-manual p { margin:0; }
.editorial-admin .editorial-ai-manual button { justify-self:end; }

/* Tableaux éditoriaux : contenu texte sûr et défilement horizontal sur petits écrans. */
.editorial-content-table { margin:1.5rem 0; min-width:0; max-width:100%; }
.editorial-content-table > h2 { font:700 1.35rem Georgia,serif; color:#ffebbb; margin:0 0 .75rem; }
.editorial-table-scroll { overflow-x:auto; max-width:100%; border:1px solid #675437; border-radius:9px; }
.editorial-content-table table { border-collapse:collapse; width:100%; min-width:440px; font-size:.92rem; text-align:left; }
.editorial-content-table th, .editorial-content-table td { padding:.75rem .85rem; border-bottom:1px solid #504638; vertical-align:top; overflow-wrap:break-word; }
.editorial-content-table thead th { color:#ffe5a8; background:#393222; font-weight:750; }
.editorial-content-table tbody tr:nth-child(even) { background:rgba(255,255,255,.04); }
.editorial-content-table tbody tr:last-child td { border-bottom:0; }
.editorial-admin .editorial-table-actions { display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; }
.editorial-admin .editorial-table-edit-scroll { width:100%; max-width:100%; overflow-x:auto; }
.editorial-admin .editorial-table-edit { border-collapse:separate; border-spacing:.3rem; width:100%; min-width:440px; }
.editorial-admin .editorial-table-edit td, .editorial-admin .editorial-table-edit th { min-width:140px; vertical-align:middle; }
.editorial-admin .editorial-table-edit .editorial-control { padding:.45rem; font-size:.86rem; }
.editorial-admin .editorial-table-row-actions { min-width:110px; white-space:nowrap; }
.editorial-admin .editorial-table-row-actions button { padding:.3rem .35rem; }

/* Assistant IA optionnel. Le panneau reste hors de la top-layer et ne bloque jamais le site. */
.header-ai-assistant {
    display:inline-flex;align-items:center;justify-content:center;gap:.42rem;
    min-height:46px;padding:0 .9rem;border:1px solid var(--cm-ai-border);
    border-radius:13px;font-family:inherit;font-size:.84rem;font-weight:850;
    white-space:nowrap;cursor:pointer;
}
.header-ai-assistant > span:first-child {font-size:1.3rem;line-height:1;}
.header-ai-assistant-text {white-space:nowrap;}
/* La mascotte ne remplace l'icone neutre que sur l'accueil ; aucune autre action IA n'est modifiee. */
.header-ai-assistant-mascot {
    width:44px;height:46px;object-fit:contain;flex:0 0 auto;
    margin:-5px -3px -5px -7px;filter:drop-shadow(0 2px 3px rgba(14,4,18,.28));
}

.cm-assistant-host {position:fixed;right:max(16px,env(safe-area-inset-right));bottom:max(18px,env(safe-area-inset-bottom));z-index:950;pointer-events:none;}
.cm-assistant-host button,.cm-assistant-panel {pointer-events:auto;}
.cm-assistant-launcher {
    display:flex;align-items:center;gap:.65rem;min-height:54px;padding:.6rem 1rem;
    margin-left:auto;border:1px solid rgba(244,192,255,.45);border-radius:999px;
    box-shadow:0 12px 38px rgba(30,7,40,.45);color:#fff;font:inherit;font-weight:800;cursor:pointer;
}
.cm-assistant-launcher-star {font-size:1.35rem;line-height:1;}
.cm-assistant-host[data-cm-open="true"] .cm-assistant-launcher {display:none;}
.cm-assistant-panel {
    width:min(405px,calc(100vw - 26px));height:min(660px,calc(100dvh - 34px));
    display:flex;flex-direction:column;overflow:hidden;border:1px solid rgba(212,153,235,.48);
    border-radius:19px;background:#211726;color:#fff5ff;
    box-shadow:0 18px 65px rgba(6,3,10,.55);font-family:inherit;
}
.cm-assistant-panel[hidden],.cm-assistant-error[hidden],.cm-assistant-welcome[hidden] {display:none!important;}
.cm-assistant-panel-header {
    flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:.6rem;
    padding:.85rem 1rem;background:linear-gradient(120deg,#5a2a78,#392044);
    border-bottom:1px solid rgba(232,190,247,.25);
}
.cm-assistant-panel-identity {display:flex;align-items:center;gap:.7rem;min-width:0;}
.cm-assistant-panel-identity strong {display:block;font-size:.94rem;line-height:1.25;color:#fff;}
.cm-assistant-panel-identity small {display:block;color:#e2c1ea;font-size:.71rem;margin-top:.12rem;}
.cm-assistant-panel-avatar {
    flex:0 0 38px;display:grid;place-items:center;width:38px;height:38px;
    border-radius:11px;background:rgba(243,198,255,.18);font-size:1.45rem;
}
.cm-assistant-panel-mascot {
    width:88px;height:73px;flex:0 0 88px;
    background-position:center;background-repeat:no-repeat;background-size:contain;
    margin:-9px -4px -9px -7px;filter:drop-shadow(0 3px 4px rgba(11,3,16,.42));
}
/* La mascotte decorative ne doit pas etre demandee tant que le panneau est ferme. */
.cm-assistant-panel:not([hidden]) .cm-assistant-panel-mascot {background-image:url("/images/assistant/robot-chef-v2.webp");}
.cm-assistant-panel-identity:has(.cm-assistant-panel-mascot) {gap:.35rem;}
.cm-assistant-panel-identity:has(.cm-assistant-panel-mascot) > div {min-width:0;}
.cm-assistant-panel-header:has(.cm-assistant-panel-mascot) {min-height:76px;padding:.55rem .85rem;box-sizing:border-box;}
.cm-assistant-panel-tools {display:flex;align-items:center;gap:.15rem;}
.cm-assistant-icon-button {
    border:0;border-radius:10px;background:transparent;color:#f6e7fc;
    width:38px;height:38px;font:inherit;font-size:1.35rem;cursor:pointer;
}
.cm-assistant-icon-button:hover,.cm-assistant-icon-button:focus-visible {background:rgba(255,255,255,.15);}
.cm-assistant-conversation {
    flex:1 1 auto;min-height:0;padding:1rem .85rem;overflow-y:auto;
    overscroll-behavior:contain;scrollbar-color:#735080 transparent;
}
.cm-assistant-welcome {
    display:grid;gap:.5rem;justify-items:center;margin:1rem .35rem;
    padding:1.25rem .85rem;background:rgba(154,93,180,.12);
    border:1px solid rgba(213,162,232,.2);border-radius:14px;text-align:center;
}
.cm-assistant-welcome > span {font-size:1.55rem;color:#edbafa;}
.cm-assistant-welcome strong {font-size:1.07rem;color:#fff;}
.cm-assistant-welcome p {margin:0;color:#dcc6e4;font-size:.84rem;line-height:1.5;}
.cm-assistant-welcome-examples {font-style:italic;}
.cm-assistant-messages {display:flex;flex-direction:column;gap:.85rem;}
.cm-assistant-message {max-width:93%;display:grid;gap:.3rem;min-width:0;}
.cm-assistant-message--user {align-self:flex-end;}
.cm-assistant-message--assistant {align-self:flex-start;}
.cm-assistant-bubble {
    padding:.75rem .85rem;border-radius:14px;overflow-wrap:anywhere;
    font-size:.87rem;line-height:1.52;white-space:pre-line;
}
.cm-assistant-bubble--structured {white-space:normal;}
.cm-assistant-bubble-text {white-space:pre-line;}
.cm-assistant-bubble-list {
    margin:.65rem 0;padding-left:1.55rem;display:grid;gap:.5rem;
    line-height:1.45;
}
.cm-assistant-bubble-list li {padding-left:.12rem;overflow-wrap:anywhere;}
.cm-assistant-bubble-list li::marker {color:#f2c266;font-weight:800;}
.cm-assistant-bubble-paragraph {margin:0;white-space:pre-line;}
.cm-assistant-bubble-paragraph + .cm-assistant-bubble-paragraph {margin-top:.6rem;}
.cm-assistant-bubble-heading {font-size:.92rem;font-weight:750;line-height:1.4;color:#f8e1ff;margin:.6rem 0 .25rem;}
.cm-assistant-bubble--structured > :first-child {margin-top:0;}
.cm-assistant-bubble--structured > :last-child {margin-bottom:0;}
.cm-assistant-bubble strong {font-weight:750;color:#fff4ff;}
.cm-assistant-bubble em {font-style:italic;}
.cm-assistant-bubble code {font-family:ui-monospace,Consolas,monospace;font-size:.92em;padding:.08rem .2rem;border-radius:4px;background:rgba(0,0,0,.23);overflow-wrap:anywhere;}
.cm-assistant-bubble-codeblock {margin:.55rem 0;padding:.55rem .65rem;border:1px solid rgba(207,166,228,.18);border-radius:8px;white-space:pre-wrap;overflow-wrap:anywhere;background:rgba(0,0,0,.2);}
.cm-assistant-bubble-codeblock code {padding:0;background:transparent;}
.cm-assistant-bubble-quote {margin:.55rem 0;padding:.25rem .65rem;border-left:3px solid #b982d4;white-space:pre-line;color:#e9c7f1;}
.cm-assistant-bubble-divider {border:0;border-top:1px solid rgba(207,166,228,.22);margin:.65rem 0;}
.cm-assistant-message--user .cm-assistant-bubble {
    background:#613675;color:#fff;border-bottom-right-radius:5px;
}
.cm-assistant-message--assistant .cm-assistant-bubble {
    background:#312337;border:1px solid rgba(218,170,238,.17);color:#f8edfa;border-bottom-left-radius:5px;
}
.cm-assistant-message-meta {font-size:.7rem;color:#bda4c7;padding:0 .25rem;}
.cm-assistant-message--user .cm-assistant-message-meta {text-align:right;}
.cm-assistant-result-links {display:grid;gap:.45rem;margin-top:.4rem;}
.cm-assistant-result-links a {
    display:block;padding:.56rem .7rem;border:1px solid rgba(209,164,236,.3);
    border-radius:9px;background:rgba(147,78,172,.18);color:#f7d9ff;
    text-decoration:none;font-size:.8rem;line-height:1.35;
}
.cm-assistant-result-links a:hover,.cm-assistant-result-links a:focus-visible {background:rgba(147,78,172,.34);}
.cm-assistant-result-links a strong {display:block;font-weight:750;}
.cm-assistant-result-links a small {color:#d7bcdf;}
.cm-assistant-result-info {font-size:.75rem;color:#dfbded;margin:.25rem .05rem 0;line-height:1.45;}
.cm-assistant-resource-group {margin-top:.35rem;display:grid;gap:.25rem;min-width:0;}
.cm-assistant-resource-heading {font-size:.73rem;font-weight:750;color:#efc9ff;padding:0 .2rem;}
.cm-assistant-resource-list {list-style:none;margin:0;padding:0;display:grid;gap:.23rem;}
.cm-assistant-resource-list li {min-width:0;}
.cm-assistant-resource-list a {display:flex;align-items:flex-start;justify-content:space-between;gap:.4rem;
    padding:.43rem .6rem;border-radius:8px;background:rgba(153,87,190,.12);
    border:1px solid rgba(201,149,225,.24);color:#f8deff;text-decoration:underline;
    text-underline-offset:2px;font-size:.79rem;line-height:1.35;overflow-wrap:anywhere;}
.cm-assistant-resource-list a::before {content:"↗";flex:0 0 auto;color:#f2c266;text-decoration:none;}
.cm-assistant-resource-title {min-width:0;flex:1;}
.cm-assistant-resource-list small {flex:0 0 auto;max-width:38%;font-size:.7rem;color:#d5b6e4;text-align:right;}
.cm-assistant-resource-list a:hover,.cm-assistant-resource-list a:focus-visible {background:rgba(153,87,190,.3);}
.cm-assistant-followups {display:grid;gap:.25rem;margin-top:.3rem;}
.cm-assistant-followup {text-align:left;border:0;background:transparent;color:#d9b4ec;padding:.27rem .38rem;
    border-radius:6px;font:inherit;font-size:.76rem;text-decoration:underline;cursor:pointer;}
.cm-assistant-followup::before {content:"↪ ";color:#f2c266;}
.cm-assistant-followup:hover:not(:disabled),.cm-assistant-followup:focus-visible:not(:disabled) {background:rgba(153,87,190,.2);}
.cm-assistant-followup:disabled {opacity:.55;cursor:not-allowed;}
@media (max-width:420px) {.cm-assistant-resource-list a {flex-wrap:wrap;}.cm-assistant-resource-list small {max-width:100%;margin-left:1.2rem;}}
.cm-assistant-panel-compose {
    flex:0 0 auto;padding:.7rem .9rem .8rem;border-top:1px solid rgba(205,148,225,.23);
    background:#2a1c30;display:grid;gap:.45rem;
}
.cm-assistant-context {
    margin:0;max-width:100%;color:#e1c3eb;font-size:.74rem;
    white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.cm-assistant-compose-label {font-size:.74rem;color:#f0e4f6;font-weight:750;}
.cm-assistant-panel textarea {
    width:100%;max-height:130px;min-height:64px;resize:vertical;box-sizing:border-box;
    padding:.6rem .7rem;border:1px solid rgba(207,158,225,.43);border-radius:11px;
    background:#1b1420;color:#fff;font:inherit;font-size: .9rem;line-height:1.45;
}
.cm-assistant-panel textarea:focus {outline:2px solid rgba(229,174,246,.48);outline-offset:1px;}
.cm-assistant-panel textarea::placeholder {color:#b5a1bf;}
.cm-assistant-panel textarea:disabled {opacity:.65;}
.cm-assistant-compose-actions {display:flex;align-items:center;gap:.65rem;justify-content:space-between;}
.cm-assistant-cost {flex:1;margin:0;color:#d6bee0;font-size:.73rem;line-height:1.35;}
.cm-assistant-submit {
    display:grid;place-items:center;flex:0 0 44px;height:43px;border:0;border-radius:11px;
    color:#fff;font:inherit;font-size:1.15rem;cursor:pointer;
}
.cm-assistant-submit:disabled {cursor:not-allowed;opacity:.52;}
.cm-assistant-send-icon {display:block;width:23px;height:23px;}
.cm-assistant-send-spinner {display:none;width:21px;height:21px;box-sizing:border-box;
    border:3px solid rgba(255,255,255,.28);border-top-color:#fff;border-radius:50%;}
.cm-assistant-submit--busy .cm-assistant-send-icon {display:none;}
.cm-assistant-submit--busy .cm-assistant-send-spinner {display:block;animation:cm-assistant-send-spin .85s linear infinite;}
.cm-assistant-submit--busy:disabled {opacity:1;cursor:progress;}
@keyframes cm-assistant-send-spin {to {transform:rotate(360deg);}}
@media (prefers-reduced-motion:reduce) {
    .cm-assistant-submit--busy .cm-assistant-send-spinner {animation:none;border-top-color:#fff;border-right-color:#fff;}
}
.cm-assistant-error {margin:0;color:#ffc9cc;font-size:.79rem;line-height:1.42;}
.cm-assistant-message--pending .cm-assistant-bubble {opacity:.62;}
.cm-assistant-message--error .cm-assistant-bubble {border-color:rgba(255,149,156,.38);}

/* Pages SSR de travail : les cartes et les ingredients restent lisibles derriere l'assistant. */
.cm-assistant-main-page {display:grid;gap:1.35rem;margin:0 auto;max-width:1200px;padding:clamp(1rem,3vw,2rem) 0 4rem;}
.cm-assistant-main-heading,.cm-assistant-main-section,.cm-assistant-main-search,.cm-assistant-main-empty {
    padding:clamp(1.25rem,3vw,2rem);border:1px solid rgba(255,214,100,.13);
    border-radius:22px;background:linear-gradient(145deg,#292820,#1b1a17);color:#f8f4e8;
}
.cm-assistant-main-kicker {color:#e8b5f2;text-transform:uppercase;letter-spacing:.13em;font-size:.75rem;font-weight:850;}
.cm-assistant-main-heading h1 {margin:.65rem 0;font-family:Georgia,serif;font-size:clamp(1.8rem,4vw,3rem);line-height:1.15;color:#fff4df;}
.cm-assistant-main-heading p,.cm-assistant-main-empty p {color:#d2cbbb;line-height:1.65;}
.cm-assistant-main-heading .cm-assistant-main-hint {border-left:3px solid #9561a8;padding:.45rem .9rem;color:#e5c7ed;background:rgba(120,68,140,.13);}
.cm-assistant-main-search {display:grid;gap:.6rem;}
.cm-assistant-main-search label {font-weight:700;}
.cm-assistant-main-search > div {display:flex;gap:.6rem;}
.cm-assistant-main-search input {flex:1;min-width:0;padding:.85rem 1rem;border:1px solid #534d43;border-radius:11px;background:#161612;color:#fff;}
.cm-assistant-main-search button {padding:.7rem 1.15rem;border:0;border-radius:11px;background:#f1bc50;font-weight:800;cursor:pointer;}
.cm-assistant-main-count {margin:0;color:#d6cbbb;}
.cm-assistant-main-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem;}
.cm-assistant-main-card {overflow:hidden;display:flex;flex-direction:column;min-width:0;border:1px solid rgba(255,255,255,.12);border-radius:17px;background:#27241f;text-decoration:none;color:#fff;transition:transform .12s ease;}
.cm-assistant-main-card:hover {transform:translateY(-3px);border-color:rgba(231,181,244,.5);}
/* Les photos doivent rester dans leur cadre, sans recouvrir le titre ni le texte de la carte. */
.cm-assistant-main-image {height:175px;flex:0 0 175px;position:relative;overflow:hidden;display:flex;align-items:center;justify-content:center;background:linear-gradient(145deg,#534257,#35293a);color:#e7b4ed;font-size:2.5rem;}
.cm-assistant-main-image img {position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;}
.cm-assistant-main-rank {position:absolute;z-index:1;top:.75rem;left:.75rem;display:grid;place-items:center;min-width:32px;height:32px;padding:0 .4rem;border-radius:50%;background:rgba(35,20,42,.85);color:#fff;font-size:.85rem;font-weight:850;}
.cm-assistant-main-card-body {padding:1rem;display:flex;flex:1;flex-direction:column;gap:.45rem;min-width:0;}
.cm-assistant-main-card h2 {display:block;min-height:2.5em;overflow-wrap:anywhere;font-size:1.15rem;line-height:1.25;margin:0;color:#fff5e6;}
.cm-assistant-main-card p {margin:0;color:#bcb3a8;font-size:.85rem;}
.cm-assistant-main-card-body > span {margin-top:auto;font-size:.83rem;color:#e7b4ed;}
.cm-assistant-main-empty {line-height:1.6;}
.cm-assistant-main-empty a {color:#f1cc78;}
.cm-assistant-main-meta {display:flex;flex-wrap:wrap;gap:.5rem;margin:.85rem 0;}
.cm-assistant-main-meta span {padding:.4rem .7rem;border-radius:999px;background:#44354b;color:#f7e8fa;font-size:.8rem;}
.cm-assistant-main-columns {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.6fr);gap:1rem;align-items:start;}
.cm-assistant-main-section h2 {margin:0 0 1rem;font-family:Georgia,serif;color:#fff2d9;}
.cm-assistant-main-section h3 {color:#f2d8fa;margin-top:1.2rem;}
.cm-assistant-main-ingredients {list-style:none;margin:0;padding:0;display:grid;gap:.75rem;}
.cm-assistant-main-ingredients li {padding-bottom:.65rem;border-bottom:1px solid rgba(255,255,255,.08);line-height:1.45;}
.cm-assistant-main-ingredients small {display:block;color:#d0a6dc;}
.cm-assistant-main-preparation {line-height:1.75;white-space:pre-line;overflow-wrap:anywhere;}
@media(max-width:880px){.cm-assistant-main-grid {grid-template-columns:repeat(2,minmax(0,1fr));}.cm-assistant-main-columns {grid-template-columns:1fr;}}
@media(max-width:760px){
    .header-ai-assistant {min-height:40px;padding:0 .65rem;}
    .header-ai-assistant-text {display:none;}
    .header-ai-assistant-mascot {width:39px;height:40px;margin:-4px -3px;}
    .cm-assistant-panel-mascot {width:75px;height:65px;flex-basis:75px;margin:-6px -6px -6px -7px;}
}
@media(max-width:580px){
    .cm-assistant-host {right:8px;bottom:max(8px,env(safe-area-inset-bottom));}
    .cm-assistant-panel {width:calc(100vw - 16px);height:min(85dvh,820px);border-radius:17px;}
    .cm-assistant-launcher {min-height:47px;padding:.6rem .8rem;font-size:.85rem;}
    .cm-assistant-conversation {padding:.75rem;}
    .cm-assistant-panel textarea {font-size:16px;}
    .cm-assistant-main-grid {grid-template-columns:1fr;}
    .cm-assistant-main-image {height:190px;flex-basis:190px;}
    .cm-assistant-main-search > div {flex-direction:column;}
}
@media(max-width:380px){.header-ai-assistant {padding:0 .42rem;}.brand-band .header-width {width:calc(100% - 1rem);}}

/* Outils admin : diagnostic JSON et suspension du dialogue (sans masquer l'assistant). */
.cm-assistant-diagnostic {display:grid;place-items:center;flex:0 0 32px;height:34px;
    border:1px solid rgba(226,179,243,.4);border-radius:9px;background:rgba(165,104,191,.16);
    color:#f2d9fc;font:inherit;font-size:1.25rem;cursor:pointer;}
.cm-assistant-diagnostic:hover,.cm-assistant-diagnostic:focus-visible {background:rgba(165,104,191,.35);outline-offset:2px;}
.cm-assistant-copy-feedback {margin:0;color:#cbeec8;font-size:.76rem;line-height:1.35;}
.cm-assistant-copy-feedback[data-error="true"] {color:#ffb8b8;}
.cm-assistant-copy-feedback[hidden],.cm-assistant-disabled[hidden] {display:none!important;}
.cm-assistant-disabled {margin:0;padding:.7rem .8rem;border-radius:10px;
    border:1px solid rgba(240,190,128,.4);background:rgba(141,82,48,.22);
    color:#ffe2b5;font-size:.82rem;line-height:1.45;}

/* Fenêtre commune de génération, pilotée depuis le dialogue et les fiches. */
.cm-illustration-instructions-label {display:block;margin:.65rem 0 .3rem;font-weight:750;font-size:.86rem;}
[data-cm-illustration-instructions] {display:block;width:100%;box-sizing:border-box;min-height:70px;padding:.6rem .75rem;
    resize:vertical;border:1px solid rgba(150,109,178,.4);border-radius:9px;background:rgba(255,255,255,.06);
    color:inherit;font:inherit;font-size:.9rem;line-height:1.4;}

/* Propositions actionnables : choix explicite, sans reformuler "oui" ni deuxième débit. */
.cm-assistant-suggestions {display:grid;gap:.42rem;margin-top:.4rem;}
.cm-assistant-suggestion {
    width:100%;text-align:left;padding:.65rem .8rem;border-radius:10px;
    border:1px solid rgba(220,180,239,.58);background:#693785;
    color:#fff;font:inherit;font-size:.81rem;font-weight:750;line-height:1.35;
    cursor:pointer;overflow-wrap:anywhere;
}
.cm-assistant-suggestion:hover:not(:disabled),.cm-assistant-suggestion:focus-visible:not(:disabled) {
    background:#80469d;outline:2px solid rgba(232,197,250,.65);outline-offset:1px;
}
.cm-assistant-suggestion:disabled {opacity:.58;cursor:not-allowed;}

/* Ideas are data-backed actions; show their culinary description without crowding mobile panels. */
.cm-assistant-idea-choice {display:grid;gap:.18rem;min-width:0;}
.cm-assistant-idea-description {
    color:#e1d2e8;font-size:.74rem;line-height:1.35;padding:0 .45rem .28rem;
    display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;
}

/* Liste des recettes de travail du copilote, sans navigation bloquante. */
.cm-assistant-work-list {max-height:45%;overflow:auto;padding:.75rem .85rem;background:#2d2033;border-bottom:1px solid rgba(219,178,233,.25);}
.cm-assistant-work-list[hidden] {display:none!important;}
.cm-assistant-work-list-heading {display:flex;align-items:center;justify-content:space-between;gap:.4rem;margin-bottom:.45rem;}
.cm-assistant-work-list-heading strong {font-size:.84rem;color:#fff;}
.cm-assistant-work-list-heading button {border:0;background:transparent;color:#fff;font:inherit;font-size:1.25rem;cursor:pointer;}
.cm-assistant-work-list [data-cm-assistant-work-items] {display:grid;gap:.4rem;}
.cm-assistant-work-list [data-cm-assistant-work-items] p {font-size:.78rem;color:#e2c9e9;margin:.4rem 0;}
.cm-assistant-work-entry,.cm-assistant-publication-link {display:grid;gap:.2rem;padding:.55rem .65rem;color:#fff3ff!important;background:rgba(149,82,177,.23);border:1px solid rgba(208,150,228,.35);border-radius:9px;text-decoration:none;font-size:.8rem;}
.cm-assistant-work-entry:hover,.cm-assistant-publication-link:hover {background:rgba(149,82,177,.4);}
.cm-assistant-work-entry small {color:#dec2e9;}
@media(max-width:580px){
    .cm-assistant-panel-header .cm-assistant-panel-mascot {width:60px;height:55px;flex-basis:60px;}
    .cm-assistant-panel-header .cm-assistant-panel-tools {gap:0;}
    .cm-assistant-panel-header .cm-assistant-icon-button {width:31px;height:33px;font-size:1.15rem;}
    .cm-assistant-panel-header .cm-assistant-panel-identity strong {font-size:.82rem;}
    .cm-assistant-panel-header .cm-assistant-panel-identity small {font-size:.65rem;}
}

/* Annulation locale des modifications du formulaire préparées par le compagnon. */
.cm-assistant-undo-patch {
    justify-self:start;max-width:100%;padding:.5rem .72rem;
    color:#f8e7ff;background:rgba(154,92,188,.22);
    border:1px solid rgba(220,173,240,.54);border-radius:9px;
    font:inherit;font-size:.79rem;font-weight:700;cursor:pointer;
}
.cm-assistant-undo-patch:hover,.cm-assistant-undo-patch:focus-visible {
    background:rgba(154,92,188,.42);
}

/* Barre d'actions des cartes classiques : geometrie et retours visuels communs.
   Les fonds permanents signalent un choix personnel, pas une moyenne publique. */
.cm-recipe-card--classique .cm-recipe-card-tools :is(a, button) {
    box-sizing:border-box;
    display:grid;
    place-items:center;
    width:36px;
    height:36px;
    min-width:0;
    min-height:0;
    margin:0;
    padding:0;
    border:1px solid transparent;
    border-radius:9px;
    background:transparent;
    text-decoration:none;
    cursor:pointer;
    outline:none;
    transform:none;
    transition:background-color .15s ease,border-color .15s ease,color .15s ease;
}

/* Les trois fonds persistants reposent sur des etats deja mis a jour en JS.
   Un bouton desactive ne doit jamais conserver de fond actif. */
.cm-recipe-card--classique .cm-recipe-card-tools .recipe-album-button.is-in-album:not(:disabled):not([aria-disabled="true"]) {
    background:rgba(244,183,43,.18);
}
.cm-recipe-card--classique .cm-recipe-card-tools .cm-recipe-card-note-action[data-cm-note-state="filled"]:not(:disabled):not([aria-disabled="true"]) {
    background:#4a3817;
}
.cm-recipe-card--classique .cm-recipe-card-tools .cm-recipe-card-rating-action[data-cm-rating-voted="true"]:not(:disabled):not([aria-disabled="true"]) {
    background:rgba(244,183,43,.18);
}

/* Tous les liens et boutons interactifs, meme la suppression, ont fond et cadre au survol. */
.cm-recipe-card--classique .cm-recipe-card-tools :is(a, button):not(:disabled):not([aria-disabled="true"]):is(:hover, :focus-visible) {
    background:#40351d;
    border-color:#bf9343;
    transform:none;
}
.cm-recipe-card--classique .cm-recipe-card-tools :is(a, button):not(:disabled):not([aria-disabled="true"]):focus-visible {
    outline:2px solid #f4b72b;
    outline-offset:1px;
}
.cm-recipe-card--classique .cm-recipe-card-tools :is(
    .recipe-album-button.is-in-album,
    .cm-recipe-card-note-action[data-cm-note-state="filled"],
    .cm-recipe-card-rating-action[data-cm-rating-voted="true"]
):not(:disabled):not([aria-disabled="true"]):is(:hover, :focus-visible) {
    background:#57411e;
}

/* Visibilite en lecture seule (span) et commandes desactivees :
   icone seule, aucun fond ni bordure, y compris au survol. */
.cm-recipe-card--classique .cm-recipe-card-tools :is(
    span.cm-recipe-visibility--toolbar-icon,
    button:disabled,
    a[aria-disabled="true"],
    button[aria-disabled="true"]
) {
    background:transparent;
    border-color:transparent;
    box-shadow:none;
    outline:none;
    cursor:default;
    transform:none;
}

@media(max-width:540px) {
    .cm-recipe-card--classique .cm-recipe-card-tools :is(a, button) { width:31px; height:33px; }
    .cm-recipe-card--classique .cm-recipe-card-tools .cm-recipe-visibility--toolbar-icon {
        width:31px; min-width:31px; height:33px; min-height:33px;
    }
}
@media(prefers-reduced-motion:reduce) {
    .cm-recipe-card--classique .cm-recipe-card-tools :is(a, button) { transition:none; }
}

.cm-basket-toggle svg{width:20px;height:20px;flex:none}
.cm-recipe-card-tools-basket{display:flex;align-items:center;justify-content:center;flex:0 1 36px;padding:.2rem!important}
.cm-recipe-card-tools:has(.cm-recipe-card-tools-basket){flex-wrap:wrap}
.cm-recipe-card-tools:has(.cm-recipe-card-tools-basket)>*{padding:.15rem!important;flex-basis:auto;flex-shrink:1}
.cm-recipe-card--classique .cm-recipe-card-tools:has(.cm-recipe-card-tools-basket) :is(a,button){width:30px;height:34px}
.cm-basket-toggle:not(.action-tile)[aria-pressed=true]{color:#e9ac22!important;background:#e9ac2225!important;border-radius:5px}
.cm-basket-toggle:disabled{opacity:.55}
.cm-shopping-page{max-width:1040px;margin:1.5rem auto 3rem;padding:0 1rem}
.cm-shopping-heading,.cm-shopping-actions{display:flex;align-items:center;justify-content:space-between;gap:.75rem;flex-wrap:wrap}
.cm-shopping-heading h1{margin:.25rem 0}.cm-shopping-actions{justify-content:flex-start;margin:1.25rem 0}
.cm-shopping-page button{cursor:pointer;background:transparent;color:inherit;border:1px solid #a58b4c80;border-radius:7px;padding:.55rem .8rem;font:inherit}.cm-shopping-page button:disabled{opacity:.5;cursor:default}.cm-shopping-page .cm-shopping-primary{background:#f7bd32;color:#21190a;font-weight:700;border-color:#f7bd32}
.cm-basket-row{display:flex;align-items:center;gap:1rem;border:1px solid #a58b4c55;border-radius:12px;margin:.65rem 0;padding:.7rem;background:#a58b4c0c}.cm-basket-row img{width:116px;aspect-ratio:4/3;object-fit:cover;border-radius:7px;display:block}.cm-basket-copy{min-width:0;flex:1;display:grid;gap:.4rem}.cm-basket-title{font-weight:700;color:inherit;text-decoration:none}.cm-basket-title:hover,.cm-basket-title:focus-visible{text-decoration:underline}.cm-basket-row-actions{display:flex;align-items:center;gap:.55rem;flex-wrap:wrap}.cm-shopping-page input:not([type=checkbox]),.cm-shopping-page select{border:1px solid #a58b4c80;background:transparent;color:inherit;border-radius:5px;padding:.35rem}.cm-shopping-page select option{color:#211b10;background:#fff}
.cm-shopping-memo,.cm-shopping-warnings,.cm-shopping-group{border:1px solid #a58b4c55;border-radius:10px;padding:.9rem;margin:.7rem 0}.cm-shopping-memo h2,.cm-shopping-warnings h2,.cm-shopping-group h2{font-size:1.1rem;margin:0 0 .5rem}.cm-shopping-memo ul{margin:.3rem 0;padding-left:1.2rem}.cm-shopping-warnings p{margin:.3rem 0}.cm-shopping-groups{display:block}.cm-shopping-group{margin:0}.cm-shopping-item{display:flex;align-items:center;justify-content:space-between;gap:.5rem;border-bottom:1px solid #a58b4c30;padding:.45rem 0}.cm-shopping-item:last-child{border:0}.cm-shopping-item label{display:flex;align-items:flex-start;gap:.4rem;min-width:0;overflow-wrap:anywhere}.cm-shopping-item input{flex:none;accent-color:#eab32d;margin-top:.3em}.cm-shopping-item[data-checked=true] label span{text-decoration:line-through;opacity:.65}.cm-shopping-item-actions{display:flex;gap:.15rem;flex:none;align-items:center}.cm-shopping-edit-form{display:grid;gap:.7rem}.cm-shopping-edit-form label{display:grid;gap:.25rem}.cm-shopping-edit-form label:last-child{display:flex;align-items:center}
@media(max-width:760px){.cm-basket-row{flex-wrap:wrap;gap:.65rem}.cm-basket-row img{width:85px}.cm-basket-row-actions{width:100%;justify-content:flex-end}}

/* Les rayons se suivent dans chaque colonne sans attendre la hauteur du rayon voisin. */
@media screen {
    .cm-shopping-page[data-cm-shopping-page]{max-width:1280px}
    .cm-shopping-groups{columns:2;column-gap:.8rem}
    .cm-shopping-groups .cm-shopping-group{break-inside:avoid;margin:0 0 .8rem;box-sizing:border-box}
    .cm-shopping-group h2{font-size:1.08rem;font-weight:600;line-height:1.3;padding:.5rem .65rem;margin:0 0 .3rem;border-left:2px solid #a58849;border-radius:4px;background:#eab32d12;color:#c4a46a;color:light-dark(#806023,#c4a46a)}
    .cm-shopping-item label{flex:1;cursor:pointer;align-items:center;min-height:32px}
    .cm-shopping-item label span{font-weight:600;text-decoration-thickness:1px;transition:opacity 150ms ease}
    .cm-shopping-item[data-checked=true] label span{opacity:.35;font-weight:400;text-decoration-color:color-mix(in srgb,currentColor 65%,transparent);text-decoration-thickness:1px}
    .cm-shopping-item label input,.cm-shopping-item-actions .cm-shopping-item-action{transition:opacity 150ms ease}
    .cm-shopping-item[data-checked=true] label input{opacity:.42}
    .cm-shopping-item[data-checked=true] .cm-shopping-item-action:not(:hover):not(:focus-visible){opacity:.30}
    .cm-shopping-item-actions .cm-shopping-item-action{display:grid;place-items:center;flex:none;width:36px;height:36px;min-width:0;min-height:0;padding:0;border:1px solid transparent;border-radius:9px;background:transparent;box-sizing:border-box}
    .cm-shopping-item-actions .cm-recipe-card-edit-action{color:#f4b72b}
    .cm-shopping-item-actions .cm-recipe-card-delete-action{color:#e6a29a}
    .cm-shopping-item-actions .cm-shopping-item-action svg{display:block;width:19px;height:19px}
    .cm-shopping-item-actions .cm-shopping-item-action:not(:disabled):is(:hover,:focus-visible){background:#40351d;border-color:#bf9343}
    .cm-shopping-item-actions .cm-shopping-item-action:focus-visible{outline:2px solid #f4b72b;outline-offset:1px}
}
@media screen and (max-width:760px){
    .cm-shopping-groups{columns:1}
    .cm-shopping-item label{min-height:44px}
    .cm-shopping-item-actions .cm-shopping-item-action{width:44px;height:44px}
}
@media screen and (prefers-reduced-motion:reduce){
    .cm-shopping-item label span,.cm-shopping-item label input,.cm-shopping-item-actions .cm-shopping-item-action{transition:none}
}
@media print{
 @page{size:A4;margin:12mm}
 body:has([data-cm-shopping-page]),html:has([data-cm-shopping-page]){background:white!important;color:black!important;overflow:visible!important;height:auto!important}
 body:has([data-cm-shopping-page]) :is(header,footer,nav,aside,dialog,.site-header-space,.cm-shopping-no-print,.cm-toast,.cm-assistant-host,[data-cm-assistant-open]){display:none!important}
 body:has([data-cm-shopping-page]) :is(main,.site-shell,.site-main,.site-content,.main-content,.page,.content,.cm-shopping-page){margin:0!important;padding:0!important;width:auto!important;max-width:none!important;background:white!important;color:black!important;overflow:visible!important}
 body:has([data-cm-shopping-page]) .cm-shopping-heading{display:block!important}
 body:has([data-cm-shopping-page]) .site-shell{display:block!important;min-height:0!important}
 .cm-shopping-page *{color:black!important;background:transparent!important;box-shadow:none!important;text-shadow:none!important}
 .cm-shopping-page h1{font-size:19pt}.cm-shopping-page h2{font-size:12pt}.cm-shopping-page{font-size:10pt}.cm-shopping-page .cm-shopping-groups{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;align-items:start;gap:4mm 8mm;column-count:auto!important;-webkit-column-count:auto!important;width:100%}.cm-shopping-group{break-inside:avoid;page-break-inside:avoid;margin:0;min-width:0;padding:2mm;border:1px solid #aaa}.cm-shopping-item{break-inside:avoid;padding:1mm 0;display:block}.cm-shopping-item label{display:flex}
 /* Le rendu papier ne dépend pas du color-scheme ni des cases natives du navigateur. */
 .cm-shopping-page .cm-shopping-item input[type=checkbox]{display:none!important}
 .cm-shopping-page .cm-shopping-item label::before{content:"";display:grid;place-items:center;flex:0 0 4mm;width:4mm;height:4mm;box-sizing:border-box;margin-top:.1em;border:1px solid #000;border-radius:0;background:#fff!important;color:#000!important;font:normal 10pt/1 Arial,sans-serif}
 .cm-shopping-page .cm-shopping-item label:has(input[type=checkbox]:checked)::before{content:"\2713"}
 .cm-shopping-memo,.cm-shopping-warnings{break-inside:avoid;border-color:#aaa}.cm-print-remaining [data-checked=true],.cm-print-remaining .cm-print-empty{display:none!important}
}

/* Les contrôles tactiles du panier gardent un disque jaune et une zone active de 44 px. */
.cm-basket-stepper{display:grid;justify-items:center;gap:.15rem}
.cm-basket-portions-label{font-size:.78rem;opacity:.8}
.cm-basket-steps{display:flex;align-items:center;gap:.2rem}
.cm-basket-steps .cm-basket-step{position:relative;isolation:isolate;display:grid;place-items:center;width:44px;height:44px;padding:0;border:0;background:transparent;color:#21190a;font-weight:800;font-size:1.25rem;line-height:1;border-radius:50%}
.cm-basket-step::before{content:"";position:absolute;inset:6px;border-radius:50%;background:#f7bd32;z-index:-1}
.cm-basket-step:not(:disabled):hover::before{background:#ffd365}
.cm-basket-parts{min-width:2ch;text-align:center;font-size:1.1rem;font-variant-numeric:tabular-nums}
.cm-basket-row-actions .cm-basket-remove{display:grid;place-items:center;width:44px;height:44px;padding:0;border:0;background:transparent;color:#e6a29a;border-radius:7px}
.cm-basket-remove svg{display:block;width:19px;height:19px}
.cm-basket-row-actions .cm-basket-remove:hover{color:#ffb1a7;background:#e6a29a16}
.cm-basket-row-actions button:focus-visible{outline:2px solid #f7bd32;outline-offset:2px}
#cm-shopping-edit .cm-dialog-button-primary{background:#f7bd32;color:#21190a;border-color:#f7bd32;font-weight:800}
#cm-shopping-edit :is(input:not([type=checkbox]),select){width:100%;box-sizing:border-box;min-height:44px;font:inherit;padding:.5rem .65rem}
#cm-shopping-edit select{color:#f5ebd9;background:#25231e;color-scheme:dark}
#cm-shopping-edit select option{color:#211b10;background:#fff;color-scheme:light}
#cm-shopping-edit [aria-invalid=true]{border-color:#ff8174;outline:2px solid #ff8174;outline-offset:1px}
#cm-shopping-edit [data-shopping-edit-feedback] .cm-toast{position:static;width:100%;max-height:none;margin-top:.75rem;box-shadow:none}
@media(max-width:760px){.cm-basket-row-actions{gap:.5rem}.cm-basket-row-actions .cm-basket-remove{margin-left:.3rem}.cm-basket-copy{overflow-wrap:anywhere}}

.cm-basket-recipe-warning{color:#ffb66c;font-weight:700;width:fit-content;max-width:100%;background:#39291c;border-radius:4px;padding:.1rem .35rem}
.cm-basket-exclusions{margin:.75rem 0;padding:.75rem;border:1px solid #ac783d;border-radius:9px;background:#ad6e2217;color:#ffd29c;overflow-wrap:anywhere}
.cm-basket-exclusions[hidden]{display:none!important}
.cm-basket-exclusions ul{padding-left:1.2rem;margin:.5rem 0;max-height:12rem;overflow:auto}
.cm-basket-exclusions p{margin:.4rem 0 0;font-size:.85rem}

@media screen {
    .cm-shopping-page [data-shopping-actions] button{min-height:44px}
}

