/* Selected design: bring editable oils into the first viewport. */
body.studio[data-style] .header{height:76px}
body.studio[data-style] .tool-nav{margin:0 0 10px;padding:6px 0;gap:8px}
body.studio[data-style] .tool-nav a{padding:7px 12px}
body.studio[data-style] .heading{margin:8px 0 10px}
body.studio[data-style] .heading img,body.studio[data-style] .heading .eyebrow{display:none}
body.studio[data-style] .heading h1{font-size:30px;margin:0}
body.studio[data-style] #page-intro{margin:4px 0;font-size:14px}
body.studio[data-style] .notice{padding:8px 12px;font-size:13px}
body.studio[data-style] .notice p{font-size:12px;line-height:1.4;margin:3px 0 0}
body.studio[data-style] #message:empty{margin:0}
body.studio[data-style] #message{font-size:13px;line-height:1.4;margin:6px 0}
body.studio[data-style] .filebar{margin:12px 0;gap:8px;align-items:center}
body.studio[data-style] #recipe-status{font-size:13px}
body.studio[data-style] #save-status{font-size:12px;line-height:1.4;margin:3px 0}
body.studio[data-style] .filebar button{padding:8px 12px}
body.studio[data-style] .studio-grid{margin:12px 0}
body.studio[data-style] .editor{padding:18px}
body.studio[data-style] .editor>.eyebrow{display:none}
body.studio[data-style] #inputs-title{font-size:22px;margin:0 0 10px}
body.studio[data-style] .editor>.pair label{margin-top:0}
body.studio[data-style] .oil-row{margin:12px 0;padding:10px}
body.studio[data-style] .file-tools{margin:18px 0}
body.studio[data-style] .metric strong{font-size:30px}
body.studio[data-style="h"] .results{background:#fffffc;border-color:#dfe4d8}
body.studio[data-style="h"] .result-basis{background:#f1f4ec}
body.studio[data-style="h"] .metric,body.studio[data-style="h"] th,body.studio[data-style="h"] td{border-color:#dfe4d8}
body.studio[data-style] #errors a{display:block;min-height:44px;padding:8px;border:1px solid #d4a5a5;border-radius:8px;background:#fff7f5}
@media(max-width:700px), screen and (max-width:950px) and (max-height:500px) and (pointer:coarse){
 body.studio[data-style] .header{height:auto;min-height:0;padding:10px 22px;gap:8px}
 body.studio[data-style] .header .brand{font-size:23px!important}
 body.studio[data-style] .header .brand img{width:34px!important;height:34px}
 body.studio[data-style] .tool-nav{margin:0 0 8px;gap:8px}
 body.studio[data-style] .tool-nav .jump-results{display:none}
 body.studio[data-style] .heading h1{font-size:27px!important}
 body.studio[data-style] .heading{margin:0 0 4px}
 body.studio[data-style] #page-intro{display:none}
 body.studio[data-style] .notice{padding:7px 10px}
 body.studio[data-style] .filebar{flex-direction:column;align-items:stretch;margin:4px 0}
 body.studio[data-style] .filebar .actions{gap:8px}
 body.studio[data-style] .filebar button{min-height:38px;font-size:13px}
 body.studio[data-style] .editor{padding:14px}
 body.studio[data-style] .studio-grid{margin:6px 0}
 body.studio[data-style] #inputs-title{font-size:21px!important;margin-bottom:6px}
 body.studio[data-style] .editor>.pair label{font-size:13px}
 body.studio[data-style] .editor>.pair select{padding:8px;font-size:16px}
 body.studio[data-style] .oil-row{margin:10px 0;padding:8px;gap:6px}
 body.studio[data-style] .oil-row select,body.studio[data-style] .oil-row input{padding:9px}
 body.studio[data-style] .metric strong{font-size:30px;white-space:nowrap}
 body.studio[data-style] #unit,body.studio[data-style] #mode,body.studio[data-style] .oil-row select,body.studio[data-style] .oil-row input,body.studio[data-style] .oil-row button{min-height:44px}
 body.studio[data-style] .tool-nav a{min-height:44px;display:inline-flex;align-items:center}
 body.studio[data-style] .save-actions button{min-height:44px}
 body.studio[data-style] .mobile-dock{padding:8px 14px}
 body.studio[data-style] #mobile-weigh{min-height:44px}
 body.studio[data-style] #mobile-results{min-height:44px;display:inline-flex;align-items:center}
 body.studio[data-style] footer{padding:20px 22px 110px}
 body.studio[data-style] input,body.studio[data-style] select,body.studio[data-style] button,body.studio[data-style] #errors a{scroll-margin-top:90px;scroll-margin-bottom:100px}
}
@media print{body.studio[data-style] .file-tools{display:none!important}body.studio[data-style] .heading h1{font-size:20pt!important}}

body.studio[data-style] .dataset-print{display:none}
@media print{body.studio[data-style] .dataset-print{display:inline}}
body.studio[data-style] #sap-table table{table-layout:fixed;width:100%;min-width:0}
body.studio[data-style] #sap-table th,body.studio[data-style] #sap-table td{white-space:normal;overflow-wrap:anywhere;vertical-align:top}
body.studio[data-style] #sap-table th:first-child{width:52%}
@media(max-width:700px), screen and (max-width:950px) and (max-height:500px) and (pointer:coarse){
 body.studio[data-style] #sap-table table,body.studio[data-style] #sap-table tbody{display:block}
 body.studio[data-style] #sap-table thead{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 body.studio[data-style] #sap-table tr{display:block;margin:12px 0;border:1px solid #dfe4d8;border-radius:8px;padding:10px}
 body.studio[data-style] #sap-table td{display:block;border:0;padding:5px 0;width:auto;font-size:13px}
 body.studio[data-style] #sap-table td:first-child{font-weight:600}
 body.studio[data-style] #sap-table td:first-child small{font-weight:400}
 body.studio[data-style] #sap-table td:nth-child(2)::before{content:'KOH specification / selected: ';font-weight:600}
 body.studio[data-style] #sap-table td:nth-child(3)::before{content:'NaOH SAP (g/g): ';font-weight:600}
}


/* Phone audit: compact editing without shrinking touch targets. */
@media screen and (max-width:700px), screen and (max-width:950px) and (max-height:500px) and (pointer:coarse){
 html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
 body.studio[data-style] .header{padding:8px 16px;gap:0;align-items:center}
 body.studio[data-style] .header .brand{font-size:20px!important}
 body.studio[data-style] .header .brand img{width:28px!important;height:28px}
 body.studio[data-style] .header nav{gap:16px;font-size:12px;line-height:1.2}
 body.studio[data-style] .header nav a{display:inline-flex;align-items:center;min-height:44px}
 body.studio[data-style] main.wrap{width:calc(100% - 24px);padding-left:0;padding-right:0}
 body.studio[data-style] .tool-nav{position:static;padding:0;margin:0 0 8px;gap:8px}
 body.studio[data-style] .tool-nav a{font-size:14px;padding:6px 12px;min-height:44px}
 body.studio[data-style] .heading{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 body.studio[data-style] details.notice{margin:0 0 8px;padding:0 10px}
 body.studio[data-style] .notice summary{font-size:12px;min-height:44px;display:flex;align-items:center;gap:6px}
 body.studio[data-style] .notice summary::after{content:' +';margin-left:auto}
 body.studio[data-style] .notice[open] summary::after{content:' −'}
 body.studio[data-style] .notice p{font-size:12px;line-height:1.4;margin:0 0 8px}
 body.studio[data-style] .filebar{margin:4px 0 8px;gap:4px}
 body.studio[data-style] #recipe-status{font-size:12px;line-height:1.4;font-weight:500}
 body.studio[data-style] #save-status{font-size:11px;line-height:1.4;margin:2px 0}
 body.studio[data-style] .editor,body.studio[data-style] .results{padding:12px}
 body.studio[data-style] #inputs-title{font-size:19px!important;margin:0 0 8px}
 body.studio[data-style] .editor>.pair{gap:8px}
 body.studio[data-style] .editor>.pair label{font-size:12px;line-height:1.3;margin-bottom:4px}
 body.studio[data-style] .oil-row{grid-template-columns:minmax(0,1fr) 78px 44px;gap:4px;margin:8px 0;padding:6px;align-items:end}
 body.studio[data-style] .oil-row .oil-choice{grid-column:1}
 body.studio[data-style] .oil-row .oil-value{grid-column:2}
 body.studio[data-style] .oil-row label{font-size:12px;line-height:1.3;margin:0 0 4px}
 body.studio[data-style] .oil-row select,body.studio[data-style] .oil-row input{font-size:16px;padding:6px;min-height:44px}
 body.studio[data-style] .oil-row button{min-width:44px;min-height:44px;padding:6px}
 body.studio[data-style] .card p.sap-note{font-size:11px;line-height:1.3;margin:2px 0 0}
 body.studio[data-style] #sum{font-size:12px;line-height:1.4;margin:6px 0}
 body.studio[data-style] .save-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px}
 body.studio[data-style] .save-actions button{font-size:13px;min-height:44px;padding:6px 8px}
 body.studio[data-style] .mobile-dock{padding:6px 12px;gap:8px;box-shadow:none}
 body.studio[data-style] #mobile-summary{font-size:12px;line-height:1.3}
 body.studio[data-style] #mobile-results{font-size:12px;min-height:44px}
 body.studio[data-style] #mobile-weigh{font-size:13px;min-width:52px;padding:6px}
 body.studio.sdb-input-focused[data-style] .mobile-dock{display:none}
 body.studio[data-style] .results h2{font-size:20px;margin:0 0 8px}
 body.studio[data-style] .metric{padding:10px 0;gap:8px}
 body.studio[data-style] .metric strong{font-size:24px}
 body.studio[data-style] .metric small{font-size:12px}
 body.studio[data-style] .recipe-card{padding:12px;margin:12px 0}
 body.studio[data-style] .recipe-card h3{font-size:18px;line-height:1.3;margin:4px 0 6px}
 body.studio[data-style] .recipe-card p{font-size:13px;line-height:1.4;margin:4px 0}
 body.studio[data-style] .recipe-card p.help{font-size:12px;line-height:1.4}
 body.studio[data-style] .recipe-card .actions{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:10px}
 body.studio[data-style] .recipe-card button{font-size:12px;min-height:44px;padding:6px}
 body.studio[data-style] dialog{padding:16px;max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px);overflow:auto}
 body.studio[data-style] #save-title{font-size:22px;margin:0 0 8px}
 body.studio[data-style] #save-explanation{font-size:13px;line-height:1.4;margin:0 0 8px}
 body.studio[data-style] #save-dialog label{font-size:13px;margin:8px 0 4px}
 body.studio[data-style] #save-dialog details{margin:10px 0}
 body.studio[data-style] #save-dialog summary{font-size:13px;min-height:44px;display:flex;align-items:center}
 body.studio[data-style] #save-dialog .actions{position:sticky;bottom:0;background:#fffffc;padding-top:8px;display:grid;grid-template-columns:1fr 1fr}
 body.studio[data-style] #save-dialog button{font-size:13px;min-height:44px;padding:8px}
 body.studio[data-style] #weigh-dialog .check-row label{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:4px 12px;flex:1;min-width:0}
 body.studio[data-style] #weigh-dialog .check-row label span{font-size:13px}
 body.studio[data-style] #weigh-dialog .check-row label strong{font-size:24px}
 body.studio[data-style] #weigh-dialog .check-row{min-height:52px}
 body.studio[data-style] #close-weigh{min-width:44px;min-height:44px}
 body.studio[data-style] #library-view h2{font-size:21px}
 body.studio[data-style] #library-view .library-toolbar .actions{display:grid;grid-template-columns:1fr 1fr;width:100%;gap:6px}
 body.studio[data-style] #library-view .library-toolbar button{font-size:13px;padding:8px;min-height:44px}
}

body.studio[data-style] .site-menu{display:contents}
body.studio[data-style] .site-menu>summary{display:none}
@media screen and (max-width:700px), screen and (max-width:950px) and (max-height:500px) and (pointer:coarse){
 body.studio[data-style] .header{justify-content:space-between;flex-wrap:nowrap}
 body.studio[data-style] .header .brand{font-size:18px!important;gap:8px}
 body.studio[data-style] .site-menu{display:block;position:relative;margin:0}
 body.studio[data-style] .site-menu>summary{display:flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;font-size:13px}
 body.studio[data-style] .site-menu nav{position:absolute;top:100%;right:0;width:160px;display:flex;flex-direction:column;gap:0;z-index:10;background:#fffffc;border:1px solid #dfe4d8;border-radius:8px;padding:8px}
 body.studio[data-style] .site-menu nav a{width:100%;font-size:14px;padding:4px 8px;min-height:44px}
 body.studio[data-style] .editor .filebar{margin:8px 0}
}
@media screen and (max-width:700px), screen and (max-width:950px) and (max-height:500px) and (pointer:coarse){
 body.studio[data-style][data-view="recipes"] .notice{display:none}
 body.studio[data-style] .library-toolbar{margin:8px 0;gap:8px}
 body.studio[data-style] .library-toolbar .help{font-size:12px;line-height:1.4;margin:4px 0}
 body.studio[data-style] #library-summary{font-size:12px;line-height:1.4;margin:8px 0}
 body.studio[data-style] #library-view>label{font-size:13px;line-height:1.3;margin:8px 0 4px}
 body.studio[data-style] .recipe-card{gap:6px}
 body.studio[data-style] #history-dialog .section-top{flex-direction:row;align-items:center;gap:8px}
 body.studio[data-style] #history-title{font-size:22px;margin:0}
 body.studio[data-style] #history-close{min-width:44px;min-height:44px;padding:6px;flex-shrink:0}
 body.studio[data-style] #history-content h3{font-size:18px;margin:12px 0 6px}
 body.studio[data-style] #history-dialog p{font-size:13px;line-height:1.4;margin:8px 0}
 body.studio[data-style] #history-dialog .actions{display:grid;grid-template-columns:1fr 1fr;gap:6px}
 body.studio[data-style] #history-dialog button{font-size:13px;padding:8px;min-height:44px}
}
@media screen and (max-width:700px), screen and (max-width:950px) and (max-height:500px) and (pointer:coarse){
 body.studio[data-style] #history-dialog[open]{display:flex;flex-direction:column;height:calc(100vh - 32px);height:calc(100dvh - 32px);overflow:hidden}
 body.studio[data-style] #history-dialog>.section-top,body.studio[data-style] #history-dialog>label,body.studio[data-style] #history-select,body.studio[data-style] #history-dialog>.actions,body.studio[data-style] #history-dialog>.help{flex-shrink:0}
 body.studio[data-style] #history-dialog>label{font-size:13px;margin:8px 0 4px}
 body.studio[data-style] #history-select{font-size:14px;padding:8px;min-height:44px}
 body.studio[data-style] #history-content{overflow-y:auto;min-height:0;flex:1}
 body.studio[data-style] #history-content th,body.studio[data-style] #history-content td{font-size:14px;padding:8px 4px}
 body.studio[data-style] #history-dialog>.actions{margin:8px 0 0;padding-top:8px;border-top:1px solid #dfe4d8}
}
@media screen and (max-width:700px), screen and (max-width:950px) and (max-height:500px) and (pointer:coarse){
 body.studio[data-style] #save-dialog[open]{display:flex;flex-direction:column;overflow:hidden;max-height:calc(var(--sdb-viewport-height,100vh) - 24px)}
 body.studio[data-style] #save-title,body.studio[data-style] #save-explanation{flex-shrink:0}
 body.studio[data-style] #save-explanation{font-size:12px;line-height:1.3}
 body.studio[data-style] #save-form{display:flex;flex-direction:column;min-height:0}
 body.studio[data-style] #save-fields{overflow-y:auto;min-height:0}
 body.studio[data-style] #save-form>.actions{position:static;flex-shrink:0;margin-top:8px}
 body.studio[data-style] #history-dialog[open]{height:calc(var(--sdb-viewport-height,100vh) - 32px);max-height:calc(var(--sdb-viewport-height,100vh) - 32px)}
}
@media screen and (max-width:700px), screen and (max-width:950px) and (max-height:500px) and (pointer:coarse){
 body.studio[data-style] #save-dialog[open]{box-sizing:border-box;position:fixed;top:12px;bottom:auto;left:0;right:0;margin:0 auto;max-height:calc(var(--sdb-viewport-height,100vh) - 24px)}
}
