/* 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-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; }
    .cm-ingredient-section .add-group-button { align-self: flex-start; }
}
@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; }
}
