/* Pandinha v4 — leitura sem ruído; edição apenas por botão; preparação detalhada no Inventário. */
#workbench #editor-screen:not(.is-editing)>.editor,
#workbench #editor-screen:not(.is-editing)>.preview{display:none!important}
#workbench #editor-screen.is-editing>#creator-idle{display:none!important}
#workbench #editor-screen:not(.is-editing)>#creator-idle{display:grid;grid-column:1/-1;justify-items:center;gap:11px;max-width:620px;margin:0 auto;width:100%;padding:clamp(22px,5vw,45px);text-align:center}
#workbench .creator-idle-art{width:62px;height:62px;display:grid;place-items:center;border:1px solid #87a976;border-radius:16px;color:var(--lime);font-size:2.2rem;background:#223323}
#workbench .creator-idle h3{font-size:clamp(1.5rem,3vw,2.1rem);margin:0}
#workbench .creator-idle p{margin:0;color:var(--muted);max-width:400px}
#workbench .creator-idle .creator-start-button{min-height:60px;min-width:225px;margin:8px 0;border-radius:13px;font-size:1.03rem}
#workbench .creator-idle .creator-idle-tip{font-size:.74rem;max-width:360px}
#workbench[data-view=editor] .workbench-top .toolbar{display:none!important}
#workbench[data-view=inventory] .workbench-top .toolbar{display:none!important}
#workbench #editor-screen.is-editing .stage-quick-actions{margin-top:16px}
#workbench #editor-screen.is-editing .editor>.section-head:first-child{margin-bottom:7px}
#workbench #editor-screen.is-editing .editor>.section-head.section-space .tag{display:none}
#workbench #editor-screen.is-editing .basics{display:block}
#workbench #editor-screen.is-editing .basics label{font-size:.81rem}
#workbench #editor-screen.is-editing .basics input{min-height:47px;font-size:1rem}
#workbench #editor-screen.is-editing .editor>.guide{display:none}
#workbench #editor-screen.is-editing #add-step{display:none}
#workbench #editor-screen.is-editing .quick-stage-card .stage-options,
#workbench #editor-screen.is-editing .quick-stage-card .capacity-inline{display:none!important}
#workbench #editor-screen.is-editing .preview .box-legend{display:none}
#workbench #editor-screen.is-editing .save-bottom #delete-recipe{display:none}
#workbench #editor-screen.is-editing .save-bottom{gap:10px}
#workbench .recipe-operations{margin-top:14px;border-top:1px solid #394737;padding-top:10px}
#workbench .recipe-operations summary{width:max-content;max-width:100%;cursor:pointer;border:1px solid #587453;border-radius:10px;min-height:44px;padding:10px 14px;background:#243124;font-size:.82rem;font-weight:800;color:#d2edc9}
#workbench .recipe-operations:not([open]) .library-reader-actions{display:none!important}
#workbench .recipe-operations .library-reader-actions{margin-top:8px;border:none;padding:8px 0 0}
#workbench .reader-ingredient-details{margin:6px 0 2px;border:1px solid #476044;background:#1b281e;border-radius:12px;overflow:hidden}
#workbench .reader-ingredient-details>summary{cursor:pointer;display:flex;align-items:center;min-height:54px;padding:12px 14px;font-size:.84rem;font-weight:850;color:#c8eabd}
#workbench .reader-ingredient-details .writer-ingredients-overview{border:none;background:none;padding:10px 13px 14px;margin:0;border-top:1px solid #455b42}
#workbench .reader-ingredient-details .writer-ingredients-overview>.preview-subtitle{display:none}
#workbench .reader-ingredient-details .p-ing{padding:7px 0}
#workbench .library-reader .box-legend{display:none}
#workbench .library-reader .writer-sequence{margin:0}
#workbench .library-reader .writer-box{margin:0}
#workbench .library-reader .writer-box .writer-item{font-size:.75rem}
#workbench .library-reader .writer-box-head{min-height:40px}
#workbench .library-layout{grid-template-columns:minmax(210px,285px) minmax(0,1fr)}
#workbench #inventory-screen .recipe-inventory{display:grid;align-content:start;gap:11px}
#workbench #inventory-screen .inventory-advanced-group{border:1px solid #3e5340;border-radius:10px;padding:10px 12px;background:#1b261c}
#workbench #inventory-screen .inventory-advanced-group>summary{cursor:pointer;font-weight:850;color:var(--lime);font-size:.84rem;min-height:30px}
#workbench #inventory-screen .inventory-advanced-group>div{padding:10px 0 2px}
#workbench #inventory-screen .inventory-advanced-group .section-head.section-space:first-child{margin-top:4px}
#workbench #inventory-screen .inventory-create-details{border:1px solid #537d4b;border-radius:11px;background:#213023;padding:10px;margin:12px 0}
#workbench #inventory-screen .inventory-create-details>summary{font-weight:900;cursor:pointer;min-height:35px;display:flex;align-items:center;color:#c8f3b9}
#workbench #inventory-screen .inventory-create-details>.inventory-form{margin-top:9px}
#workbench #inventory-screen .inventory-stage-config{border:1px solid #536151;background:#202a21;border-radius:10px;padding:10px;margin:9px 0}
#workbench #inventory-screen .inventory-stage-config>strong{font-size:.83rem;display:block;margin-bottom:7px}
#workbench #inventory-screen .inventory-stage-config .stage-options{padding-top:6px;border-top:1px solid #475849}
#workbench #inventory-screen .inventory-stage-config .stage-options summary{display:block;color:var(--lime);font-size:.78rem;font-weight:750;cursor:pointer;min-height:34px}
#workbench #inventory-screen .inventory-stage-config .step-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-top:9px}
#workbench #inventory-screen .inventory-stage-config .step-fields .kind-field,
#workbench #inventory-screen .inventory-stage-config .step-fields .detail-field,
#workbench #inventory-screen .inventory-stage-config .step-fields .title-field{grid-column:1/-1}
#workbench #inventory-screen .inventory-stage-config .capacity-inline{margin-top:11px}
#workbench #inventory-screen #ingredients-editor{display:grid;gap:9px}
#workbench #inventory-screen #ingredient-presets{display:none}
#workbench #inventory-screen .recipe-inventory>.guide{display:none}
#workbench #inventory-screen .inventory-advanced-group .optional-field{min-height:40px}
#workbench .quick-stage-card .stage-visual-head{padding-top:2px}
#workbench .quick-stage-card .box-inner-ingredients{margin-top:5px}
.quick-dialog .picker-progress{margin:4px 0 10px;font-size:.75rem;font-weight:950;letter-spacing:.08em;color:#c8f3ba;text-transform:uppercase}
.quick-dialog .picker-back{padding:7px 11px;font-size:.79rem;border:1px solid #657c5e;border-radius:9px;background:#2b3b2e;color:#e4f1df;flex:none}
.quick-dialog .picker-breadcrumb{min-width:0;flex:1;font-size:.74rem;line-height:1.3;color:#d0dfc7;overflow-wrap:anywhere}
.quick-dialog .category-options{display:flex;align-items:center;min-height:29px;gap:8px;margin-bottom:7px;overflow:visible}
.quick-dialog .picker-search-label[hidden]{display:none!important}
.quick-dialog .wizard-choice{min-height:76px}
.quick-dialog .wizard-choice small{align-self:start}
@media(min-width:1150px){
 #workbench .library-layout{grid-template-columns:minmax(0,240px) minmax(0,730px);justify-content:center}
 #workbench #editor-screen .editor{max-width:750px}
}
@media(max-width:730px){
 .app{padding:6px 8px 50px}
 body:has(#workbench:not([hidden])) .hero{display:none}
 body:has(#workbench:not([hidden])) .app{padding-top:4px}
 body:has(#workbench:not([hidden])) .topbar{min-height:48px;padding:6px 10px}
 #workbench .workbench-top{margin:0 0 3px}
 #workbench .workbench-top .eyebrow{display:none}
 #workbench .workbench-top h2{font-size:.92rem;line-height:1.2}
 #workbench .mode-tabs{margin:0 0 10px;top:0}
 #workbench .library-layout{display:flex;flex-direction:column;gap:0}
 #workbench .library-layout>.library-reader{width:100%;margin:0 0 80px;padding:11px;order:0;border-radius:12px}
 #workbench .library-reader .section-head{margin-bottom:8px}
 #workbench .library-reader .preview-body{display:flex;flex-direction:column;width:100%;gap:10px}
 #workbench .library-reader .writer-sequence{width:100%}
 #workbench .library-reader .writer-box{width:100%;border-radius:10px}
 #workbench .library-layout>.library-page{left:8px;right:8px;bottom:calc(8px + env(safe-area-inset-bottom,0px));padding:7px;border-radius:12px;order:1}
 #workbench .library-page:not(.is-open)>.section-head,
 #workbench .library-page:not(.is-open)>.library-search-label,
 #workbench .library-page:not(.is-open)>.recipe-list,
 #workbench .library-page:not(.is-open)>.hint{display:none!important}
 #workbench .library-page.is-open{max-height:70dvh}
 #workbench .recipe-operations summary{font-size:.78rem}
 #workbench .recipe-operations .library-reader-actions{display:flex;flex-direction:column;gap:7px}
 #workbench .reader-ingredient-details{margin-top:4px}
 #workbench #editor-screen:not(.is-editing)>#creator-idle{padding:27px 17px;max-width:100%}
 #workbench .quick-stage-card .edit-controls{gap:4px}
 #workbench .quick-stage-card .stage-visual-head>svg{width:34px;height:34px}
 #workbench #inventory-screen .inventory-layout{display:flex;flex-direction:column;gap:10px}
 #workbench #inventory-screen .inventory-layout>.panel{width:100%}
 #workbench #inventory-screen .inventory-catalog{order:0}
 #workbench #inventory-screen .recipe-inventory{order:1}
}
@media(max-width:370px){
 #workbench .mode-tab{font-size:.61rem;padding:6px 3px}
 #workbench .library-reader .writer-item{font-size:.65rem}
}
body[data-theme=light] #workbench .creator-idle-art{background:#e5f5e0;color:#3b7a2d;border-color:#a9c9a1}
body[data-theme=light] #workbench .reader-ingredient-details{background:#f2f8ee;border-color:#bdcfb5}
body[data-theme=light] #workbench .reader-ingredient-details>summary{color:#37662c}
body[data-theme=light] #workbench .recipe-operations summary{background:#eef6e9;border-color:#c2d4ba;color:#2c5729}
body[data-theme=light] #workbench #inventory-screen .inventory-advanced-group,
body[data-theme=light] #workbench #inventory-screen .inventory-create-details,
body[data-theme=light] #workbench #inventory-screen .inventory-stage-config{background:#f3f8ef;border-color:#c3d8bd}
body[data-theme=light] #workbench #inventory-screen .inventory-create-details>summary{color:#356e27}
body[data-theme=light] .quick-dialog .picker-progress{color:#356e27}
body[data-theme=light] .quick-dialog .picker-back{background:#e5f0e1;color:#31562c}
body[data-theme=light] .quick-dialog .picker-breadcrumb{color:#49684a}

/* Sem acionar Editar, Inventário mostra apenas o catálogo global. */
#workbench[data-authoring="no"] #inventory-screen .recipe-inventory{display:none!important}
#workbench[data-authoring="no"] #inventory-screen .inventory-layout{grid-template-columns:minmax(0,680px);justify-content:center}
#workbench[data-authoring="no"] #inventory-screen .inventory-catalog{width:100%}

/* Pandinha 2.5 — catálogo carregado de receitas + base de insumos. */
#workbench .inventory-browse-controls{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(155px,.8fr);gap:10px;margin:12px 0 8px}
#workbench .inventory-browse-controls label{display:grid;gap:6px;min-width:0;font-size:.74rem;font-weight:850}
#workbench .inventory-browse-controls input,#workbench .inventory-browse-controls select{min-height:47px;padding:10px;border-radius:9px}
#workbench .inventory-browse-note{font-size:.73rem;color:var(--muted);line-height:1.45;margin:4px 0 14px}
#workbench .inventory-list{max-height:68dvh;overflow-y:auto;overscroll-behavior:contain;padding:2px;scrollbar-width:thin}
#workbench .inventory-item-text strong{font-size:.87rem}
#workbench .inventory-item-text small{line-height:1.35}
#workbench .inventory-item .small-action{min-height:36px}
#workbench .inventory-catalog>.section-head.section-space{margin-top:17px}
#workbench[data-authoring=no] .inventory-catalog{max-width:800px}
@media(max-width:730px){
 #workbench .inventory-browse-controls{grid-template-columns:1fr;gap:8px}
 #workbench .inventory-list{max-height:none;overflow:visible}
 #workbench .inventory-item{padding:10px 8px}
 #workbench .inventory-item .small-action{min-height:40px}
}
body[data-theme=light] #workbench .inventory-browse-note{color:#536e56}

/* Catálogo colorido somente quando o item tem cor cadastrada. */
#workbench .inventory-item .ingredient-color-swatch{
 display:inline-block;flex:none;width:19px;height:19px;border:1px solid #91a090;
 border-radius:100%;box-shadow:0 0 0 2px #242b25;vertical-align:middle;
}
.quick-dialog .wizard-choice:has(.ingredient-color-swatch){position:relative;padding-right:37px}
.quick-dialog .wizard-choice .ingredient-color-swatch{
 position:absolute;top:11px;right:9px;display:block;width:23px;height:23px;
 border-radius:7px;border:1px solid #c3c5c3;box-shadow:0 1px 3px #0005;
}
body[data-theme=light] #workbench .inventory-item .ingredient-color-swatch{box-shadow:0 0 0 2px #e9efe6}
