@layer foundation,pages,components;
@layer components {
.brew-dialog{width:min(940px,calc(100vw - 48px));max-width:none;max-height:calc(100dvh - 48px);padding:0;border:1px solid var(--border);border-radius:10px;color:var(--text);background:#fff;box-shadow:0 16px 65px #252a2833;font:inherit;overflow:hidden}
.brew-dialog[open]{display:flex;flex-direction:column}.brew-dialog::backdrop{background:#252a2866}.dialog-header,.dialog-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 18px;flex:none;background:#f8f8f4}.dialog-header{border-bottom:1px solid var(--border)}.dialog-header h2{font-size:var(--font-section);margin:0;overflow-wrap:anywhere}.dialog-header-actions{display:flex;gap:8px;align-items:center}.dialog-footer{justify-content:flex-end;border-top:1px solid var(--border)}.dialog-body{padding:16px 18px;overflow:auto;min-height:0}.brew-dialog button{font:inherit;font-weight:700;border:1px solid #bfcdbf;border-radius:5px;background:#dfeadd;color:#354937;padding:7px 11px;min-height:36px;cursor:pointer;margin:0}.brew-dialog button.secondary{border-color:var(--border);background:#f7f7f2;color:var(--text)}.brew-dialog button.danger{background:#f6dfdb;border-color:#e8bab2;color:#813c35}.brew-dialog button:disabled{opacity:.5;cursor:default}.brew-dialog .dialog-close{background:transparent;border:0;width:36px;min-width:36px;font-size:22px;padding:0}.dialog-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 12px}.dialog-grid.catalog-fields{grid-template-columns:minmax(0,1.5fr) minmax(0,1fr) 90px}.dialog-grid.receipt-fields{grid-template-columns:repeat(3,minmax(0,1fr))}.brew-dialog label{display:block;font-size:var(--font-label);margin:0;color:#615b52}.brew-dialog input,.brew-dialog select,.brew-dialog textarea{display:block;font:inherit;font-size:var(--font-body);color:var(--text);background:#fff;border:1px solid var(--border);border-radius:5px;width:100%;height:36px;min-height:36px;padding:6px 8px;margin:4px 0 0;min-width:0}.brew-dialog input[type=checkbox]{width:16px;height:16px;min-height:0;margin:0}.brew-dialog .inline-check{display:flex;align-items:center;gap:6px;white-space:nowrap}.dialog-disclosure{border-top:1px solid var(--border);padding-top:12px;margin:14px 0}.dialog-disclosure summary{font-size:var(--font-action);font-weight:700;cursor:pointer;margin-bottom:10px}.dialog-disclosure:not([open]) summary{margin-bottom:0}.brew-dialog .brew-meta{font-size:var(--font-label);margin:8px 0 12px;line-height:1.45}.brew-dialog .brew-actions{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0 0}.dialog-error{color:#8f322b;background:#fff0ed;border:1px solid #e7bcb6;border-radius:5px;padding:10px;font-size:var(--font-body);margin:10px 0}.brew-dialog input[aria-invalid=true],.brew-dialog select[aria-invalid=true]{border:2px solid #b94439;background:#fff1ef}.inline-field{display:flex;align-items:center;gap:6px}.inline-field button{margin-top:4px;white-space:nowrap}.receipt-status-controls{border-top:1px solid var(--border);padding-top:10px;margin-top:12px}.library-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.library-heading h2,.library-heading h3{font-size:var(--font-section);margin:0}.brew-card .library-heading button{margin:0}.library-toolbar{display:flex;align-items:center;gap:12px;margin:8px 0}.brew-card .library-toolbar input{width:230px;max-width:65%;height:36px;min-height:36px;padding:6px 8px}.library-toolbar span{font-size:var(--font-label);color:#716a61}.ingredient-library>p{margin:10px 0}.compact-sheet th,.compact-sheet td{padding:7px 9px;vertical-align:middle}.ingredient-library-sheet th{white-space:nowrap}.ingredient-library-sheet th:nth-child(3){width:70px}.ingredient-library-sheet th:last-child{width:74px}.brew-page .sheet-open{padding:0;margin:0;background:transparent;color:#45674c;border:0;text-align:left;cursor:pointer;font-weight:700}.receipt-sheet{min-width:650px}.receipt-sheet .sheet-open{font-size:var(--font-label)}.receipt-sheet td:last-child{width:150px}.receipt-sheet td{font-size:var(--font-body)}.receipt-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.receipt-blocked{background:#fff0ed}.receipt-archived{color:#817a70}.part-warning{display:inline-block;font-size:var(--font-label);color:#8a3a32;line-height:1.3}.allocation-sheet{table-layout:fixed;min-width:430px}.allocation-sheet th:nth-child(2){width:110px}.allocation-sheet th:nth-child(3){width:65px}.allocation-sheet th:last-child{width:45px}.allocation-sheet input,.allocation-sheet select{margin:0}.allocation-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:10px}.allocation-actions p{margin:0;font-size:var(--font-label)}.part-quantity{margin:0 0 8px;font-weight:700}.allocation-incomplete{color:#8e632b}.allocation-over{color:#97362e}.allocation-complete{color:#42684a}.text-dialog{width:min(760px,calc(100vw - 48px))}.text-dialog .dialog-body{display:flex;flex-direction:column;gap:8px;flex:1}.text-dialog #dialog-text{height:300px;min-height:200px;resize:vertical;padding:12px;line-height:1.6}.text-dialog.is-fullscreen{width:calc(100vw - 32px);height:calc(100dvh - 32px);max-height:none}.text-dialog.is-fullscreen #dialog-text{height:auto;flex:1;resize:none}.text-dialog .text-draft-hint{margin:0}.brew-page .text-preview{display:block;width:100%;min-width:0;height:36px;min-height:36px;max-width:100%;padding:6px 8px;margin:0;text-align:left;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:var(--font-body);font-weight:400;background:#f8faf6;color:#4a453e;border:1px solid var(--border);border-radius:5px;cursor:pointer;line-height:1.45}.brew-page .text-preview:hover{border-color:#99ae98;background:#eaf0e7}.brew-page .text-preview:disabled{opacity:.7;cursor:default}.brew-page .part-picker.part-missing{background:#fbf4e4;border-color:#e2d6b5}.brew-page .part-picker.part-complete{background:#eaf0e7}.brew-page .part-picker.part-blocked{background:#fbe7e3;border-color:#e3b3aa;color:#85382f}.recipe-steps-sheet{table-layout:fixed;min-width:830px}.brew-card .recipe-steps-sheet td,.brew-card .recipe-ingredients-sheet td,.brew-page .raw-material-sheet td{padding:7px 8px;vertical-align:middle}.brew-card :is(.recipe-steps-sheet,.recipe-ingredients-sheet) :is(input,select){height:36px;min-height:36px;padding:6px 8px;line-height:1.45}.brew-card .recipe-steps-sheet textarea[hidden],.brew-page .raw-material-sheet textarea[hidden]{display:none}.brew-card .step-row-actions button{height:36px;min-height:36px;margin:0}.recipe-steps-sheet td:nth-child(2){width:22%}.recipe-steps-sheet td:nth-child(3){width:185px}.recipe-steps-sheet td:nth-child(4){width:88px}.recipe-ingredients-sheet col.recipe-ingredient-name{width:32%}.recipe-ingredients-sheet col.recipe-ingredient-category{width:25%}.recipe-ingredients-sheet col.recipe-ingredient-quantity{width:110px}.recipe-ingredients-sheet col.recipe-ingredient-unit{width:76px}.recipe-ingredients-sheet col.recipe-ingredient-volume{width:auto}.recipe-ingredients-sheet .recipe-volume-cell small{display:none}.recipe-ingredients-sheet .recipe-volume-cell{min-width:0}.raw-material-sheet{min-width:1120px}.raw-material-sheet col.raw-name{width:20%}.raw-material-sheet col.raw-date{width:96px}.raw-material-sheet col.raw-use{width:84px}.raw-material-sheet col.raw-quantity{width:85px}.raw-material-sheet col.raw-unit{width:70px}.raw-material-sheet col.raw-price{width:100px}.raw-material-sheet col.raw-part{width:145px}.raw-material-sheet col.raw-cost{width:106px}.raw-material-sheet col.raw-action{width:42px}.raw-material-sheet :is(input,select){height:36px;min-height:36px;padding:6px 8px}.raw-block-warning{margin:8px 0;padding:10px 12px;background:#fbe7e3;border:1px solid #e8bfb5;border-radius:6px;font-size:var(--font-body)}.raw-block-warning a{color:#813c35;font-weight:700}.brew-page button:focus-visible,.brew-dialog button:focus-visible{outline:3px solid #7194ab;outline-offset:2px}
@media(max-width:700px){.brew-dialog,.text-dialog{width:100vw;max-height:none;height:100dvh;max-width:none;border-radius:0;border:0;margin:0}.dialog-header,.dialog-footer{padding:12px}.dialog-body{padding:12px}.dialog-grid.catalog-fields{grid-template-columns:minmax(0,1fr) 85px}.catalog-fields label:first-child{grid-column:1/-1}.dialog-grid.receipt-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.dialog-grid{gap:10px}.text-dialog #dialog-text{flex:1;min-height:200px;height:auto;resize:none}.text-dialog.is-fullscreen{width:100vw;height:100dvh}.dialog-header-actions [data-text-fullscreen]{display:none}.library-heading{flex-wrap:wrap}.ingredient-library-sheet{min-width:560px}.brew-dialog .dialog-close{width:44px;height:44px}.brew-dialog .dialog-footer button{min-height:44px}.brew-dialog button{min-height:40px}}

/* These dimensions also override the legacy styles on the custom pages. */
.brew-dialog :is(input,select){height:36px;min-height:36px;font-size:14px;font-weight:400}.brew-dialog label{font-size:12px;font-weight:400}.brew-dialog h2,.brew-dialog h3{font-size:16px;font-weight:700}.brew-dialog .sheet-open{background:none;border:0;padding:0;min-height:28px;color:#45674c}.receipt-actions{flex-wrap:nowrap;white-space:nowrap}.receipt-actions a{color:#45674c;font-weight:700;font-size:12px}.receipt-sheet td:last-child{min-width:135px}.receipt-sheet td{padding:7px 9px}#ingredient-purchases{margin-top:14px;padding-top:14px;border-top:1px solid var(--border)}.brew-dialog input[type=checkbox]{height:16px;min-height:16px}.brew-card :is(.recipe-steps-sheet,.recipe-ingredients-sheet) :is(input,select),.brew-page .raw-material-sheet :is(input,select){height:36px;min-height:36px}.brew-page .text-preview{font-weight:400}.recipe-steps-sheet col.step-arrows{width:84px}.recipe-steps-sheet col.step-name{width:24%}.recipe-steps-sheet col.step-kind{width:190px}.recipe-steps-sheet col.step-day{width:88px}.recipe-steps-sheet col.step-text{width:auto}.recipe-steps-sheet col.step-delete{width:46px}
html:has(dialog[open]),body:has(dialog[open]){overflow:hidden}.brew-dialog .dialog-body{min-width:0;flex:1}.brew-dialog .dialog-header,.brew-dialog .dialog-footer{min-width:0}.brew-dialog .library-heading>*{min-width:0}
@media(max-width:700px){.brew-dialog,.text-dialog,.text-dialog.is-fullscreen{position:fixed;inset:0;width:100%;height:100%;max-width:100%;max-height:100%;margin:0}.allocation-sheet{min-width:0;width:100%}.allocation-sheet thead{display:none}.allocation-sheet,.allocation-sheet tbody{display:block}.allocation-sheet tbody tr{display:grid;grid-template-columns:minmax(0,1fr) 32px 44px;gap:4px 8px;padding:8px 0;border-bottom:1px solid var(--border)}.allocation-sheet td{display:block;width:auto;border:0;padding:0}.allocation-sheet td:first-child{grid-column:1/-1}.allocation-sheet td:nth-child(2) input{width:100%;max-width:125px}.allocation-sheet td:nth-child(3){align-self:center}.allocation-sheet td:last-child{justify-self:end}.allocation-sheet select{min-width:0;width:100%}.allocation-actions{align-items:flex-start}.allocation-actions p{white-space:normal}.brew-dialog .inline-check{white-space:normal}}
.purchase-editor h3{margin:0 0 10px}.dialog-grid.receipt-fields{grid-template-columns:1fr 1fr .85fr 150px 1.2fr}.receipt-sheet{min-width:610px}.raw-usage-fields{grid-template-columns:90px 70px 115px 150px minmax(0,1fr)}.raw-library-actions button{margin:0}.recipe-header-grid{grid-template-columns:minmax(0,1fr) 140px}.recipe-intro-columns{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.3fr);gap:24px;align-items:stretch;margin:16px 0}.recipe-notes-column label{display:flex;flex-direction:column;gap:8px;height:100%;margin:0;font-size:var(--font-section);font-weight:700}.brew-card .recipe-notes-column .recipe-short-notes{flex:1;height:auto;min-height:90px;margin:0}.recipe-ingredient-column>p:last-child{margin-bottom:0}.recipe-ingredient-column .recipe-ingredient-heading{margin:0;align-items:flex-start;flex-wrap:wrap}.recipe-ingredient-column .recipe-volume-summary{font-size:var(--font-label);gap:4px 12px}.recipe-ingredient-column p{font-size:var(--font-body);margin:8px 0}.raw-material-sheet{min-width:1040px}.raw-material-sheet col.raw-name{width:23%}.library-toolbar{flex-wrap:wrap}.library-toolbar .inline-check{display:flex;gap:6px;align-items:center;margin:0}.library-toolbar .inline-check input{height:16px;min-height:16px;width:16px;max-width:none}.packaging-item-fields{grid-template-columns:minmax(0,2fr) 150px 120px minmax(0,1.2fr)}.packaging-purchase-meta{grid-template-columns:140px 90px minmax(0,1fr) 145px 145px}.packaging-purchase-cost{grid-template-columns:150px 110px 100px 120px minmax(0,1fr);margin:10px 0}.purchase-total{padding:5px 8px;background:#edf3e8;border-radius:5px;font-size:var(--font-label)}.purchase-total strong,.purchase-total small{display:block}.purchase-total strong{font-size:var(--font-section)}.packaging-purchase-sheet{min-width:780px}.dialog-record-actions{margin-right:auto;display:flex;gap:8px}.packaging-part-button{margin:5px 0;padding:5px 8px;font-size:var(--font-label);min-height:30px;background:#edf3e8;color:#425a43}.brew-dialog #raw-catalog-picker{margin:0 0 12px}.brew-dialog h3{margin-bottom:10px}
@media(max-width:700px){.dialog-grid.receipt-fields,.raw-usage-fields,.packaging-item-fields,.packaging-purchase-meta,.packaging-purchase-cost{grid-template-columns:repeat(2,minmax(0,1fr))}.dialog-grid.receipt-fields label:last-child,.packaging-item-fields label:first-child{grid-column:1/-1}.recipe-intro-columns{grid-template-columns:1fr;gap:16px}.brew-card .recipe-notes-column .recipe-short-notes{height:80px;min-height:80px}.packaging-purchase-cost .purchase-total{grid-column:1/-1}.dialog-footer{flex-wrap:wrap}.dialog-record-actions{flex-wrap:wrap;gap:6px}.packaging-purchase-sheet{font-size:var(--font-label)}.recipe-ingredient-column .recipe-volume-summary{gap:4px}.raw-library-actions{flex-wrap:wrap}}

.brew-page .brew-card .recipe-notes-column label{font-size:var(--font-section);font-weight:700}

.brew-dialog [hidden]{display:none}
.receipt-cost-fields{grid-template-columns:1.2fr .6fr 1.5fr 1.1fr 1fr;align-items:end}.receipt-cost-fields input[readonly]{background:#f1f2ed}.receipt-cost-fields .purchase-total{font-size:var(--font-body);padding:8px;background:#eef3e9;border-radius:5px}.receipt-cost-fields .purchase-total strong{display:block;font-size:var(--font-body)}
@media(max-width:700px){.receipt-cost-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.receipt-cost-fields .purchase-total{grid-column:1/-1}}

}
