/* Shared control sizes follow the customer order screen. */
html,body{max-width:100%}
body .app,body .main,body .content,body .page{min-width:0}
body .content{padding:12px 16px!important}
body #pages>.page{padding:12px 16px}
body .page:not(#orders) h1{font-size:21px;margin:0 0 5px}
body .page:not(#orders) :is(h2,h3){font-size:14px;margin-top:0}
body .page:not(#orders) :is(.sub,.hint,.help,.note,.raw-muted){font-size:11px;line-height:1.55}
body .page:not(#orders) :is(.sub,.hint){margin-bottom:10px}
body .page:not(#orders) :is(.box,.card,.raw-section){border-radius:6px;padding:10px 12px;margin-top:8px;margin-bottom:8px}
body .page:not(#orders) :is(.form,.grid,.raw-grid){display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,190px))!important;gap:8px 10px;align-items:end}
body .page:not(#orders) :is(.form,.grid,.raw-grid)>div{min-width:0}
body .page:not(#orders) :is(.form,.grid,.raw-grid)>:is(.wide,.full,.plan-order-field){grid-column:1 / -1;max-width:660px}
body .page:not(#orders) label{font-size:11px;margin-bottom:3px}
body :is(.page:not(#orders),dialog) :is(input:not([type=checkbox]):not([type=radio]),select,button,.btn){font-size:12px;line-height:1.3;border-radius:5px;min-height:32px;padding:6px 10px}
body :is(.page:not(#orders),dialog) :is(input:not([type=checkbox]):not([type=radio]):not([type=file]),select){height:32px;max-width:100%}
body :is(.page:not(#orders),dialog) :is(input[type=checkbox],input[type=radio]){width:15px;height:15px;min-height:0;margin:0;vertical-align:middle;flex:none}
body .page:not(#orders) textarea{font-size:12px;min-height:60px;border-radius:5px;padding:7px 9px}
body .page:not(#orders) :is(.head,.section-title){gap:8px;margin-bottom:8px;flex-wrap:wrap}
body .page:not(#orders) .head>h3{flex:1 1 auto;min-width:0}
body .page:not(#orders) .head>:is(input,select){width:180px!important;flex:0 1 180px}
body .page:not(#orders) :is(.toolbar,.tools,.raw-actions){gap:6px;align-items:center}
body .page:not(#orders) :is(.toolbar,.tools,.raw-actions)>:is(input:not([type=file]):not([type=checkbox]),select){width:170px!important;min-width:0;flex:0 1 170px}
body .page:not(#orders) :is(.toolbar,.tools,.raw-actions)>input[type=file]{width:260px!important;max-width:100%;min-width:0;flex:0 1 260px}
body .page:not(#orders) input[type=file]::file-selector-button{font:inherit;border:0;border-radius:3px;background:#eaf2fc;color:#1257a0;padding:3px 7px;margin-right:7px}
body .page:not(#orders) table{font-size:12px}
body .page:not(#orders) :is(th,td){padding:6px 8px;line-height:1.4;vertical-align:middle}
body .page:not(#orders) td :is(button,.btn){min-height:27px;padding:4px 7px;font-size:11px}
body .page:not(#orders) :is(.raw-results,.material-scroll,.scroll){max-width:100%;overflow:auto}
body .page:not(#orders) :is(.raw-status,.warn){font-size:11px;padding:7px 9px;line-height:1.5}
body .page:not(#orders) details>summary{font-size:13px;line-height:1.4}
body .page:not(#orders) details:not([open])>summary{margin-bottom:0;padding:2px 0}
body .page:not(#orders) .material-entry button{margin-top:0}
body .page:not(#orders) .material-entry[open]>summary{margin-bottom:9px;padding-bottom:8px}
body .page:not(#orders) :is(#rawInspectionHistory,#rhTable) table{min-width:1000px}
body .page:not(#orders) :is(#rawInspectionHistory,#rhTable) td{white-space:nowrap}
body .page:not(#orders) :is(#rawInspectionHistory,#rhTable){max-height:52vh;overflow:auto}
body .page:not(#orders) :is(#rawInspectionHistory,#rhTable) thead th{position:sticky;top:0;z-index:1;background:#f1f5fa}
.compact-row-actions :is(button,.btn){height:27px;min-height:27px!important;margin:0!important;padding:4px 7px!important}
.compact-row-actions{display:flex;align-items:center;gap:4px;white-space:nowrap}
.pvc-product-label{display:inline-block;border:1px solid #bedfd4;background:#edf9f4;color:#227552;border-radius:4px;padding:2px 6px;font-size:10px;white-space:nowrap}
body .sectionTabs{padding:7px 12px;gap:5px}
body .sectionTabs button{padding:6px 10px;font-size:12px;min-height:32px}
body .top{height:48px;padding:0 16px}
body :is(dialog,[role=dialog]) :is(input,select,textarea){font-size:12px}
@media(max-width:700px){body .content{padding:10px!important}body .page:not(#orders) :is(.form,.grid,.raw-grid){grid-template-columns:repeat(2,minmax(0,1fr))!important}body .page:not(#orders) :is(.form,.grid,.raw-grid)>:is(.wide,.full,.plan-order-field){max-width:100%}}
@media(max-width:420px){body .page:not(#orders) :is(.form,.grid,.raw-grid){grid-template-columns:1fr!important}}

body #plans .plan-product-field{grid-column:1 / -1;width:100%;max-width:660px;display:grid;grid-template-columns:190px minmax(0,1fr);gap:8px 10px}
body #plans .plan-product-field>div{min-width:0}
@media(max-width:700px){body #plans .plan-product-field{grid-template-columns:1fr}}
@media(max-width:700px){.plan-order-select{flex-wrap:wrap}.plan-order-select input{flex:1 0 100%}}

/* Both millsheets workflows share one result area below the title actions. */
body #raw .raw-page-head{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:5px}
body #raw .raw-page-head h1{margin:0 auto 0 0}
body #raw .raw-millsheet-actions{display:flex;gap:6px;flex-wrap:wrap}
body #raw #rawMillsheetWork[hidden],body #raw [data-raw-millsheet-mode][hidden]{display:none!important}
body #raw #rawMillsheetWork>.head{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:6px}
body #raw #rawMillsheetWorkTitle{margin:0}
body #raw #rawMillsheetWork>.head>.btn{margin-left:auto}
body #raw #rawMillsheetWorkFile{min-width:0;overflow-wrap:anywhere}
body #raw #rawMillsheetWork .raw-muted{font-size:11px;line-height:1.5}
body #raw #rawMillsheetWork .raw-status{padding:5px 8px;line-height:1.5}
body #raw #rawMillsheetWork .raw-results{max-width:100%;max-height:42vh;overflow:auto}
body #raw :is(#rawBatchResult,#rawNasList,#rawDetect):empty{display:none}

/* Receipt entry stays aligned; later millsheet evidence lives in the shared work area. */
body #raw .raw-receipt-grid{grid-template-columns:repeat(6,minmax(140px,190px))!important;align-items:start}
body #raw .raw-receipt-grid>div>label{min-height:16px;line-height:16px;margin-bottom:4px}
body #raw #rawMillsheetDetails[hidden]{display:none!important}
body #raw #rawMillsheetDetails>.raw-section{border:0;border-top:1px solid #dbe5ef;border-radius:0;margin:10px 0 0;padding:10px 0 0}
body #raw #rawMillsheetDetails input[readonly]{background:#f4f7fb;color:#233f5c}
.raw-receipt-detail-body{padding:12px 16px}
.raw-receipt-detail-body>h3{font-size:14px;margin:16px 0 8px}
.raw-receipt-detail-body>h3:first-child{margin-top:0}
.raw-receipt-detail-body .raw-results{max-width:100%;overflow:auto}
@media(max-width:1100px){body #raw .raw-receipt-grid{grid-template-columns:repeat(4,minmax(0,190px))!important}}
@media(max-width:700px){body #raw .raw-receipt-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:420px){body #raw .raw-receipt-grid{grid-template-columns:1fr!important}}

#oiItems input[readonly]{background:#f3f6fa;color:#4d6278;border-color:#e0e6ed;cursor:default;}

/* Receipt measurements and millsheet evidence share the same read-only presentation. */
:is(#rawInspectionHistory,#rhTable) .raw-measured-summary{display:block;min-width:125px;color:#526f89;font-size:10px;margin-top:4px;line-height:1.5;white-space:normal}
:is(#rawInspectionHistory,#rhTable) .raw-property-summary{display:flex;flex-wrap:wrap;gap:3px 5px;max-width:230px;min-width:145px}
:is(#rawInspectionHistory,#rhTable) .raw-property-summary>span{display:inline-flex;align-items:baseline;gap:3px;font-size:11px;white-space:nowrap}
:is(#rawInspectionHistory,#rhTable) .raw-property-summary small{font-size:9px;color:#65809a}
:is(#rawInspectionHistory,#rhTable) .raw-values-toggle{margin-top:5px;padding:4px 7px;font-size:10px;white-space:nowrap}
:is(#rawInspectionHistory,#rhTable) .raw-receipt-values-row[hidden]{display:none!important}
body .page:not(#orders) :is(#rawInspectionHistory,#rhTable) .raw-receipt-values-row>td{padding:10px!important;background:#f4f8fd;white-space:normal}
.raw-value-panel{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,.85fr) minmax(0,1.2fr);gap:10px;min-width:0}
.raw-value-card{min-width:0;border:1px solid #d8e5f1;border-radius:5px;background:#fff;padding:10px}
.raw-value-card h4{margin:0 0 8px;font-size:12px;color:#245986}
.raw-value-card dl{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:8px;margin:0}
.raw-value-card dl>div{min-width:0}
.raw-value-card dl>.raw-value-wide{grid-column:1 / -1}
.raw-value-card dt{color:#657c91;font-size:10px;margin-bottom:3px;white-space:normal;overflow-wrap:anywhere}
.raw-value-card dd{margin:0;font-size:12px;font-weight:700;color:#173e60;white-space:normal;overflow-wrap:anywhere;line-height:1.5}
.raw-value-source{display:flex;gap:6px;align-items:center;flex-wrap:wrap;margin-top:8px;font-size:11px;color:#5b7389}
@media(max-width:850px){.raw-value-panel{grid-template-columns:1fr}.raw-value-card dl{grid-template-columns:repeat(auto-fit,minmax(110px,1fr))}}
.raw-thickness-criteria{margin-top:8px;padding:8px 10px;background:#f4f8fd;border:1px solid #d8e5f1;border-radius:5px;font-size:12px;color:#365873}
.raw-thickness-limits{display:flex;flex-wrap:wrap;gap:7px 24px;align-items:center}
.raw-thickness-limits b{margin-left:5px}
.raw-thickness-criteria>small{display:block;margin-top:5px;line-height:1.5;color:#60798f;font-size:10px}
.raw-thickness-criteria>span{margin-left:6px}
.raw-thickness-pending{color:#99600d;font-weight:700}
