/* Screen-only responsive controls; print forms retain their original geometry. */
.mobile-menu-toggle{display:none}.mobile-sort-tools{display:none}.mobile-field-label{display:none}
@media screen{
.auto-filled,.common-locked input,.common-locked textarea,.common-locked select,input[readonly],textarea[readonly],select:disabled,.auto-linked-input[readonly],.lot-code-display[readonly]{background:#edf5ff!important;border-color:#9bbce0!important;color:#214f7a!important;opacity:1!important}
.auto-lot-badge,.auto-yield-summary,.auto-label-spec{background:#edf5ff!important;border-color:#9bbce0!important;color:#214f7a!important}
.mobile-table-scroll{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}
.mobile-table-scroll>table{min-width:720px}
}
@media screen and (max-width:1024px){
body{overflow-wrap:break-word}.container{padding:18px 14px 90px;max-width:100%;min-width:0}
.container>*{min-width:0}.topbar{padding:9px 14px;min-height:62px;gap:10px;flex-wrap:wrap}
.topbar .brand{flex:1;gap:12px;min-width:0}.topbar .company-home{width:140px}.topbar .system-name{width:78px}.topbar .version-chip{display:inline}
.mobile-menu-toggle{display:block;min-width:44px;min-height:44px;background:white;border:1px solid #cdd7d2;border-radius:8px;font-size:22px;color:#176b4d}
.main-nav{display:none!important;width:100%;align-items:stretch;gap:6px}.main-nav.mobile-open{display:flex!important;flex-wrap:wrap}
.main-nav>a,.main-nav>.nav-menu{flex:1 1 100px}.main-nav>a,.nav-menu>summary{display:block!important;padding:12px;font-size:14px}
.nav-dropdown{max-height:65vh;overflow:auto}
.page-head,.work-head,.section-head{flex-wrap:wrap;gap:12px}.page-head h1{font-size:23px;word-break:keep-all;overflow-wrap:break-word}
.actions{flex-wrap:wrap;max-width:100%}.btn{min-height:44px}.btn.small,.btn.tiny{min-height:40px}.card,.work-card,.paper-like-card{padding:16px!important;min-width:0;max-width:100%}
.form-grid,.search-grid,.result-grid,.record-grid.three-col,.record-grid.four-col,.inventory-summary,.batch-meta{grid-template-columns:repeat(2,minmax(0,1fr))!important}
.record-grid>*{min-width:0}.work-grid,.two-col{grid-template-columns:repeat(2,minmax(0,1fr))}
input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea{font-size:16px!important;min-height:44px;max-width:100%;min-width:0!important}
.record-field,.manufacturing-signature-field{min-width:0}.record-field input,.record-field select{font-size:16px!important}
.date-split{display:grid!important;min-width:0!important;width:100%;grid-template-columns:minmax(70px,1.4fr) auto minmax(44px,1fr) auto minmax(44px,1fr) auto!important}.date-split input{padding:6px 2px!important;font-size:16px!important;text-align:center}
.sheet-tabs{max-width:100%;overflow-x:auto;flex-wrap:nowrap!important;align-items:stretch}.sheet-tab{flex:none;white-space:nowrap;min-height:44px}
#sheetTabs.concentrate-tab-layout .sheet-tabs-row{grid-template-columns:repeat(11,135px)}
.sheet-titlebar{position:sticky;top:62px;background:white;z-index:8;gap:8px;padding:10px;border-bottom:1px solid #dfe6e2}.sheet-titlebar h2{font-size:18px}
.record-savebar,.form-submit{position:sticky;bottom:0;z-index:9;background:#fff;padding:12px;flex-wrap:wrap;border-top:1px solid #dfe6e2}
.record-savebar .btn,.form-submit .btn{flex:1;min-width:100px}.record-savebar span{flex-basis:100%}
.time-range-row{grid-template-columns:1fr!important}.clock-selects{grid-template-columns:minmax(85px,1.3fr) minmax(58px,1fr) minmax(58px,1fr)!important}
.work-check-row,.ccp-meta-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
.process-section-title{flex-wrap:wrap;gap:8px}.process-section-title strong{min-width:0!important;word-break:keep-all}.process-section-title span{white-space:normal!important}
.process-body,.process-section,.ccp-card{padding:12px!important;min-width:0;max-width:100%}.process-card>summary{padding:12px!important;word-break:keep-all}
.usage-table-wrap,.ccp-table-wrap,.table-scroll,.cert-scroll,.work-table{max-width:100%;overflow:auto}
/* Reuse actual controls, never duplicate values or form identifiers. */
table.responsive-cards{display:block!important;width:100%!important;min-width:0!important;table-layout:auto!important;border:0!important}
table.responsive-cards>colgroup,table.responsive-cards>thead{display:none!important}
table.responsive-cards>tbody{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;width:100%}
table.responsive-cards tr{display:block!important;padding:14px;background:#fff;border:1px solid #dfe6e2;border-radius:10px;min-width:0}
table.responsive-cards td{display:block!important;width:100%!important;min-width:0!important;border:0!important;padding:8px 0!important;text-align:left!important;white-space:normal!important;word-break:normal!important;overflow-wrap:break-word!important}
.mobile-field-label{display:block;font-weight:700;font-size:13px;color:#53605a;margin:0 0 5px;word-break:keep-all}
table.responsive-cards input,table.responsive-cards select,table.responsive-cards textarea{width:100%!important;min-width:0!important;padding:10px!important}
table.responsive-info{display:block!important;width:100%!important;min-width:0!important;table-layout:auto!important}
table.responsive-info>tbody{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
table.responsive-info tr{display:contents!important}
table.responsive-info td{display:block!important;width:auto!important;min-width:0;max-width:100%;border:1px solid #dfe6e2!important;border-radius:8px;padding:12px!important;word-break:normal!important;overflow-wrap:break-word!important;white-space:normal!important}
table.responsive-info th{display:none!important}.mobile-sort-tools{display:flex;gap:6px;flex-wrap:wrap;padding:10px 0}.mobile-sort-tools button{min-height:40px;border:1px solid #cdd7d2;background:white;border-radius:8px;color:#214f7a;padding:7px 10px}
.info-table .field-sync-note,.form-hint{word-break:keep-all;white-space:normal!important;font-size:13px;line-height:1.5}
.cert-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.signature-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
.journal-sheet,.quality-sheet,.print-sheet,.cert-paper,.certificate-preview{max-width:100%;overflow-x:auto}.journal-sheet>table,.quality-sheet>table{min-width:700px}
.preview-modal,.crop-dialog,.manufacturing-sign-modal{max-width:calc(100vw - 20px)!important}
}
@media screen and (max-width:600px){
.topbar .system-name{display:none}.topbar .company-home{width:150px}.topbar .brand{gap:12px}
.container{padding:14px 10px 86px}.page-head h1{font-size:21px}.card,.work-card,.paper-like-card{padding:12px!important}
.form-grid,.search-grid,.result-grid,.record-grid.two-col,.record-grid.three-col,.record-grid.four-col,.record-grid,.inventory-summary,.batch-meta,.work-grid,.two-col,.work-check-row,.ccp-meta-grid,.cert-grid,.approval-grid,.ledger-entry-grid{grid-template-columns:1fr!important}
.span2{grid-column:auto!important}.sign-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.sheet-titlebar{top:62px}.sheet-titlebar .actions{width:100%}.sheet-titlebar .actions .btn{flex:1}
table.responsive-cards>tbody,table.responsive-info>tbody{grid-template-columns:1fr}
.table-card{padding:10px!important}.inline-form,.inventory-search,.inventory-search-wide,.work-search{display:flex;flex-wrap:wrap;max-width:100%}.inline-form>*{flex:1 1 100%}
.photo-grid,.template-grid{grid-template-columns:1fr!important}.upload-zone{padding:12px}.photo-slot{min-width:0}.photo-slot img{max-width:100%}
.time-pair-field,.time-range-field{min-width:0}.form-submit{gap:8px}.form-submit .btn{font-size:14px}
}
@media print{.mobile-menu-toggle,.mobile-field-label,.mobile-sort-tools{display:none!important}.mobile-table-scroll{overflow:visible!important}.mobile-table-scroll>table{min-width:0!important}}
.mobile-save-dock{display:none}
@media screen and (max-width:1024px){
.sheet-titlebar{position:static!important}.mobile-save-dock{display:flex;position:fixed;bottom:0;left:0;right:0;z-index:15;padding:10px 14px calc(10px + env(safe-area-inset-bottom));gap:10px;background:#fff;border-top:1px solid #cdd7d2;box-shadow:0 -4px 16px #173b2310}.mobile-save-dock .btn{flex:1}.mobile-save-dock span{font-size:12px;color:#607080;align-self:center}.responsive-cards td:has(.manufacturing-signature-field)>.mobile-field-label{display:none}
}
@media print{.mobile-save-dock{display:none!important}}

@media screen and (max-width:1024px){.sheet-titlebar{scroll-margin-top:72px}.qf-wrap,.qf-paper{min-width:0;max-width:100%;padding:12px}.qf-top{flex-wrap:wrap}.gin-final-box{min-width:0!important;width:100%}.qf-meta{table-layout:auto}.qf-scroll{max-width:100%;overflow:auto}}

/* Automatic manufacturing values stay visibly blue on PC, tablet and phone. */
@media screen{
body .sheet-form .common-locked input,body .sheet-form .common-locked select,body .sheet-form .common-locked textarea,
body .sheet-form input[readonly]:not(.ccp-unlocked),body .sheet-form textarea[readonly],body .sheet-form select:disabled,
body .sheet-form .auto-filled,body .sheet-form .auto-linked-input[readonly],body .sheet-form .ccp-linked-readonly:not(.ccp-unlocked),
body .sheet-form .auto-sync-field input,body .sheet-form .auto-sync-field select,body .sheet-form .ccp-duration-value,
body .sheet-form .auto-linked-display,body .sheet-form .auto-yield-summary{background:#edf5ff!important;border-color:#9bbce0!important;color:#214f7a!important;opacity:1!important}
.auto-linked-display{display:inline-block;padding:5px 8px;border:1px solid #9bbce0;border-radius:6px;line-height:1.5}
.auto-field-legend{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin:10px 0;font-size:13px;line-height:1.6;color:#52616f}
}

@media screen{:root{--auto-field-background:#edf5ff;--auto-field-border:#9bbce0;--auto-field-color:#214f7a}}

/* v115: short records, with sorting only above the list. */
@media screen and (max-width:1024px){
 table.responsive-cards tr{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 12px;padding:10px!important}
 table.responsive-cards td{padding:4px 0!important;line-height:1.35;font-size:13px!important}
 table.responsive-cards .mobile-field-label{font-size:11px;margin:0 0 2px;color:#65726d}
 table.responsive-cards td.mobile-row-actions{grid-column:1/-1;display:flex!important;align-items:center;gap:5px;flex-wrap:wrap}
 table.responsive-cards td.mobile-row-actions>.mobile-field-label{display:none!important}
 table.responsive-cards .btn.small,table.responsive-cards .btn.tiny{padding:5px 8px!important;min-height:34px;font-size:12px}
 table.responsive-cards input[type=checkbox]{width:20px!important;min-height:20px!important;height:20px;padding:0!important}
 .mobile-sort-tools{gap:4px;padding:6px 0}.mobile-sort-tools button{font-size:12px;min-height:34px;padding:5px 7px}
}

.mobile-detail-toggle{display:none}
@media screen and (max-width:1024px){
 table.responsive-cards tr:not(.mobile-expanded) td.mobile-extra-cell{display:none!important}
 .mobile-detail-toggle{display:inline-block;border:1px solid #ccd8d1;border-radius:6px;background:#f6faf8;color:#176b4d;font-size:12px;padding:6px 8px;margin-left:6px;min-height:32px}
}
@media print{.mobile-detail-toggle{display:none!important}}

@media screen and (max-width:600px){
 .inventory-summary{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
 .inventory-summary>div{padding:10px!important}.inventory-summary strong{font-size:22px!important}
}
