/* UI-085 · Cardápio Studio · criação de PDF e ajuste pré-impressão.
   Página principal permanece responsiva, sem overlay de configuração.
   Biblioteca jsPDF carregada sob demanda; render do PDF em Blob local. */
#screen-pdf{--pdf-accent:#d5f79a;min-width:0}
#screen-pdf .pdf-heading{align-items:flex-start}
#screen-pdf .pdf-heading .small-badge{margin-top:9px}
#screen-pdf .pdf-workspace{display:grid;grid-template-columns:minmax(285px,390px) minmax(0,1fr);gap:14px;align-items:start}
#screen-pdf .pdf-controls{min-width:0;display:grid;gap:12px}
#screen-pdf .pdf-controls .studio-card{margin:0}
#screen-pdf .pdf-panel{min-width:0}
#screen-pdf .pdf-panel:has(>summary){padding:0}
#screen-pdf .pdf-panel>summary{padding:15px 18px;list-style:none;cursor:pointer;min-height:46px;font-size:.87rem;font-weight:900;color:#edfae3;display:flex;justify-content:space-between;gap:7px}
#screen-pdf .pdf-panel>summary::-webkit-details-marker{display:none}
#screen-pdf .pdf-panel>summary::after{content:"⌄";font-size:1.2rem;color:#c8e3b7}
#screen-pdf .pdf-panel[open]>summary{border-bottom:1px solid #3e5841}
#screen-pdf .pdf-panel[open]>summary::after{content:"⌃"}
#screen-pdf .pdf-advanced{padding:16px;display:grid;gap:12px;min-width:0}
#screen-pdf .pdf-controls .fields.two{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
#screen-pdf .pdf-controls .fields.two label{display:grid;align-items:stretch;gap:7px}
#screen-pdf .pdf-controls input[type=range]{width:100%;min-width:0}
#screen-pdf .pdf-range-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px;min-width:0}
#screen-pdf .pdf-range-grid label{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:7px}
#screen-pdf .pdf-range-grid label input{grid-column:1/-1}
#screen-pdf .pdf-range-grid output{font-size:.73rem;color:var(--pdf-accent);white-space:nowrap;font-variant-numeric:tabular-nums}
#screen-pdf .pdf-checks{gap:4px}
#screen-pdf .pdf-checks label{display:flex;align-items:center;gap:10px;min-height:40px;padding:9px 10px;border:1px solid #435e47;border-radius:10px;background:#203025;cursor:pointer;font-size:.79rem}
#screen-pdf .pdf-checks input[type=checkbox]{flex:none;margin:0;width:19px;height:19px}
#screen-pdf .pdf-checks .field-hint{padding:6px 0 0}
#screen-pdf .pdf-item-manager{display:grid;gap:13px;min-width:0;max-height:550px;overflow-y:auto;padding:1px 4px 3px 0;scrollbar-width:thin}
#screen-pdf .pdf-section-block{display:grid;gap:6px;padding:9px;border:1px solid #3e5943;background:#1b2a20;border-radius:12px;min-width:0}
#screen-pdf .pdf-section-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-bottom:7px;border-bottom:1px solid #425948}
#screen-pdf .pdf-section-head strong{font-size:.78rem;overflow-wrap:anywhere}
#screen-pdf .pdf-section-head .pdf-break-label{display:flex;align-items:center;gap:4px;flex:none;font-size:.66rem;font-weight:700;cursor:pointer}
#screen-pdf .pdf-break-label input{width:17px;height:17px;flex:none}
#screen-pdf .pdf-product-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px;align-items:center;padding:5px 4px;min-width:0;border-bottom:1px solid #34473a}
#screen-pdf .pdf-product-row:last-child{border-bottom:0}
#screen-pdf .pdf-product-choice{display:flex!important;align-items:center;gap:9px;min-width:0;cursor:pointer}
#screen-pdf .pdf-product-choice>input{flex:none;width:19px;height:19px}
#screen-pdf .pdf-item-caption{display:grid;gap:2px;min-width:0;font-size:.75rem;font-weight:800;overflow-wrap:anywhere}
#screen-pdf .pdf-item-caption small{font-size:.65rem;color:#a9c69f;font-weight:600}
#screen-pdf .pdf-move-controls{display:flex;gap:5px;flex:none}
#screen-pdf .pdf-move-btn{min-width:34px;min-height:36px;border:1px solid #637e60;border-radius:8px;background:#2f4934;color:#e5f6d6;font-size:1.1rem;font-weight:800}
#screen-pdf .pdf-move-btn:hover:not(:disabled){border-color:#ceff9b}
#screen-pdf .pdf-move-btn:disabled{opacity:.38}
#screen-pdf .pdf-export-actions{display:grid;gap:11px}
#screen-pdf .pdf-export-secondary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
#screen-pdf .pdf-export-secondary button{white-space:normal;font-size:.75rem}
#screen-pdf .pdf-stat{font-size:.8rem;color:#d6ebc7;line-height:1.5}
#screen-pdf .pdf-stat[data-state=error]{color:#ffc2b2}
#screen-pdf .pdf-stat[data-state=success]{color:#cffa9f}
#screen-pdf .pdf-preview-panel{min-width:0;position:sticky;top:12px;display:grid;gap:12px;padding:12px;margin-bottom:0}
#screen-pdf .pdf-preview-panel .card-heading{margin:0;padding-bottom:10px}
#screen-pdf .pdf-preview-tabs{display:flex;align-items:center;justify-content:center;gap:8px}
#screen-pdf .pdf-preview-tabs .studio-btn{min-width:40px;flex:none}
#screen-pdf .pdf-preview-tabs>span{font-size:.79rem;min-width:45px;text-align:center;font-variant-numeric:tabular-nums}
#screen-pdf .pdf-preview-surface{position:relative;width:100%;min-height:640px;background:#e6ebe1;border:1px solid #95a596;border-radius:11px;overflow:auto;overscroll-behavior:contain}
#screen-pdf .pdf-preview-surface iframe{display:block;width:100%;height:710px;min-height:0;border:0;background:#e8eee4}
#screen-pdf .pdf-preview-placeholder{position:absolute;inset:0;display:grid;place-items:center;text-align:center;padding:22px;background:#eff3e9;color:#334537;font-size:.84rem}
#screen-pdf .pdf-page-summary{display:flex;flex-wrap:wrap;gap:7px;font-size:.72rem;color:#d3e4c7;line-height:1.4}
#screen-pdf .pdf-preview-tip{color:#acc6a7}
#screen-pdf .pdf-integrations{border-style:dashed}
#screen-pdf .pdf-integrations p{font-size:.76rem;margin:0}
#screen-pdf .pdf-item-overrides{margin:0 2px 5px;border:1px solid #3f5b46;border-radius:9px;background:#233428}
#screen-pdf .pdf-item-overrides>summary{cursor:pointer;list-style:none;font-size:.7rem;font-weight:750;color:#c8dfa9;min-height:36px;display:flex;align-items:center;padding:8px 10px}
#screen-pdf .pdf-item-overrides>summary::-webkit-details-marker{display:none}
#screen-pdf .pdf-item-overrides>summary:before{content:"▸";margin-right:6px}
#screen-pdf .pdf-item-overrides[open]>summary:before{content:"▾"}
#screen-pdf .pdf-item-overrides[open]>summary{border-bottom:1px solid #45604b}
#screen-pdf .pdf-item-overrides-body{padding:10px;display:grid;gap:10px}
#screen-pdf .pdf-item-overrides-body label{font-size:.72rem;display:grid;gap:5px}
#screen-pdf .pdf-item-overrides-body :is(input,textarea){min-height:41px;width:100%}
#screen-pdf .pdf-item-overrides-body textarea{resize:vertical}
#screen-pdf .pdf-item-overrides-body button{white-space:normal}
@media(max-width:1510px){
 #screen-pdf .pdf-workspace{grid-template-columns:minmax(255px,360px) minmax(0,1fr)}
 #screen-pdf .pdf-preview-surface iframe{height:650px}
}
@media(max-width:1230px){
 #screen-pdf .pdf-workspace{grid-template-columns:1fr}
 #screen-pdf .pdf-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}
 #screen-pdf .pdf-controls .pdf-export-actions{grid-column:1/-1}
 #screen-pdf .pdf-preview-panel{position:static}
 #screen-pdf .pdf-preview-surface iframe{height:640px}
}
@media(max-width:930px){
 #screen-pdf .pdf-controls{grid-template-columns:1fr}
 #screen-pdf .pdf-workspace{gap:12px}
 #screen-pdf .pdf-preview-panel{order:2}
 #screen-pdf .pdf-preview-surface iframe{height:530px}
 #screen-pdf .pdf-heading .small-badge{margin-top:2px}
}
@media(max-width:430px){
 #screen-pdf .pdf-controls .fields.two{grid-template-columns:1fr}
 #screen-pdf .pdf-range-grid{grid-template-columns:1fr}
 #screen-pdf .pdf-advanced{padding:12px}
 #screen-pdf .pdf-panel>summary{padding:13px}
 #screen-pdf .pdf-preview-surface{min-height:390px}
 #screen-pdf .pdf-preview-surface iframe{height:460px}
 #screen-pdf .pdf-export-secondary{grid-template-columns:1fr}
 #screen-pdf .pdf-section-head{flex-wrap:wrap}
 #screen-pdf .pdf-product-row{grid-template-columns:minmax(0,1fr) 74px}
 #screen-pdf .pdf-move-btn{min-width:33px}
}
@media(prefers-reduced-motion:reduce){#screen-pdf *{scroll-behavior:auto}}
