#modal[open]:has(.recipe-editor) { width: min(1060px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); padding: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 5px; }
#modal:has(.recipe-editor) > .modal-head { padding: 16px 23px; }
#modal:has(.recipe-editor) > .modal-head h2 { font: 500 27px/1.15 "Barlow Condensed", "Arial Narrow", sans-serif; }
#modal:has(.recipe-editor) > .modal-body { padding: 0; overflow: hidden; }
.recipe-editor { display: flex; flex-direction: column; min-height: 0; height: min(660px, calc(100dvh - 112px)); margin: 0; color: var(--text); font: 400 12px/1.45 "IBM Plex Sans", "Segoe UI", sans-serif; }
.recipe-editor * { box-sizing: border-box; }
.reditor-scroll { display: grid; grid-template-columns: minmax(230px, 290px) minmax(0, 1fr); align-content: start; gap: 17px 24px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 17px 23px 24px; }
.reditor-enabled { grid-column: 1/-1; display: flex; align-items: center; gap: 9px; margin: 0; }
.reditor-fixed { min-width: 0; }
.reditor-fixed h3 { margin: 0 0 12px; text-align: left; font: 500 15px/1.3 "IBM Plex Sans", "Segoe UI", sans-serif; }
.reditor-groups { min-width: 0; }
.reditor-scroll > [data-recipe-add-group] { grid-column: 2; justify-self: start; }
.recipe-editor input:not([type="checkbox"]), .recipe-editor select { width: 100%; min-width: 0; height: 34px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 3px; background: var(--surface-input); color: var(--text); font: inherit; box-shadow: none; }
.recipe-editor select[multiple] { height: 86px; }
.recipe-editor input[type="checkbox"] { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.recipe-editor button { min-height: 33px; padding: 6px 11px; border: 1px solid var(--border); border-radius: 3px; background: transparent; color: var(--text); font: inherit; box-shadow: none; }
.recipe-editor button:hover:not(:disabled) { background: var(--surface-hover); }
.recipe-editor button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #fff); }
.recipe-editor :is(button,input,select,summary):focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }
.recipe-editor :disabled { opacity: .45; cursor: default; }
.reditor-ingredients { display: grid; gap: 7px; }
.reditor-ingredient { display: grid; grid-template-columns: minmax(0, 1fr) 53px 54px 28px; gap: 5px; align-items: center; }
.reditor-ingredient > button { padding: 3px; font-size: 17px; }
.recipe-editor .reditor-text-action { justify-self: start; border: 0; padding: 4px 0; color: var(--accent-bright); background: transparent; }
.reditor-group { padding: 0 0 18px; }
.reditor-group + .reditor-group { padding-top: 18px; border-top: 1px solid var(--border); }
.reditor-group > header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-bottom: 12px; }
.reditor-group > header > div { display: flex; gap: 4px; }
.reditor-group > header button { width: 29px; padding: 3px; font-size: 16px; }
.reditor-group-rules { display: grid; grid-template-columns: 75px 95px minmax(0, 1fr); align-items: end; gap: 9px; margin-bottom: 13px; }
.recipe-editor label > :is(input,select) { margin-top: 4px; }
.reditor-baseline { margin-bottom: 15px; }
.reditor-baseline > label { display: block; margin-bottom: 5px; color: var(--muted); }
.reditor-reference { display: grid; grid-template-columns: minmax(0, 1fr) 54px; gap: 6px; align-items: end; }
.reditor-option { border-top: 1px solid var(--border); }
.reditor-option summary { padding: 10px 0; cursor: pointer; }
.reditor-option-body { padding: 0 0 12px 12px; border-left: 2px solid var(--border); }
.reditor-option-head { display: grid; grid-template-columns: minmax(0, 1fr) auto 28px; gap: 10px; align-items: center; margin-bottom: 9px; }
.reditor-option-head label { display: flex; align-items: center; gap: 6px; margin: 0; }
.reditor-option-head input[type="checkbox"] { margin: 0; }
.reditor-option-head > button { padding: 3px; font-size: 17px; }
.reditor-option-price { display: grid; grid-template-columns: minmax(150px, .9fr) minmax(0, 1fr); align-items: end; gap: 10px; margin-top: 9px; }
.reditor-restrictions { color: var(--muted); margin-top: 7px; }
.reditor-restrictions summary { padding-block: 4px; font-size: 11px; }
.reditor-restrictions > div { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.reditor-footer { flex: 0 0 auto; padding: 12px 23px 17px; border-top: 1px solid var(--border); background: var(--surface); }
.reditor-footer > p { margin: 0 0 8px; color: var(--red, #ee7b81); }
.reditor-footer > p:empty { display: none; }
.reditor-actions { display: flex; justify-content: flex-end; gap: 9px; }
.reditor-footer [hidden] { display: none !important; }
.reditor-footer [data-reditor-conflict] { display: flex; gap: 8px; margin-bottom: 9px; }
@media(max-width:760px) { .reditor-scroll { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-inline: 16px; } .reditor-scroll > [data-recipe-add-group] { grid-column: 1; } .reditor-fixed { padding-bottom: 16px; border-bottom: 1px solid var(--border); } .reditor-footer { padding-inline: 16px; } }
@media(max-width:430px) { .reditor-option-price { grid-template-columns: 1fr; } .reditor-group-rules { grid-template-columns: 70px 85px minmax(0, 1fr); } }
