/* V30.25: readable summary, then notes and production details. */
.order-overview-heading,.oe-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;flex-wrap:wrap}
.order-overview-heading h2,.oe-heading h2{margin:0 0 8px;font-size:22px;line-height:1.6}.order-overview-heading p,.oe-heading p{margin:0;color:var(--muted)}
.order-primary-details{display:grid;grid-template-columns:1.3fr 1fr .7fr;gap:16px;margin:24px 0 16px}.order-primary-details>div{background:#edf4fa;border:1px solid #d5e2ef;border-radius:12px;padding:16px;min-width:0}.order-primary-details dt{font-size:13px;color:var(--muted);margin-bottom:8px}.order-primary-details dd{margin:0;font-size:19px;font-weight:700;overflow-wrap:anywhere}.order-primary-details .order-count-value{font-size:28px;line-height:1.2}.order-primary-details a{color:inherit;text-decoration:none}
.order-secondary-details{margin-bottom:24px}.order-secondary-details .detail{font-size:14px}.order-notes-block{margin:24px 0}.order-notes-block h3{font-size:17px;margin-bottom:12px}.order-notes-block .detail{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.8;padding:16px;background:#fff}
.order-meta-count{flex-basis:100%;color:var(--navy-800);font-weight:700}.order-card .view-btn.card-view-button{min-height:44px;padding:8px 12px;white-space:nowrap}.order-edit-dialog{width:min(760px,94vw)}.order-edit-dialog form{padding:24px}.oe-heading>[data-close]{min-width:44px;min-height:44px;background:#f1f4f8;font-size:24px}.oe-fields,.oe-routing{display:grid;grid-template-columns:1fr 1fr;gap:16px}.oe-fields{margin:24px 0}.order-edit-dialog label{display:grid;gap:8px;font-size:14px;font-weight:600}.order-edit-dialog input,.order-edit-dialog select,.order-edit-dialog textarea{width:100%;min-height:44px;margin:0;font:inherit;box-sizing:border-box}.order-edit-dialog fieldset{border:1px solid var(--line);border-radius:12px;padding:16px;margin:0 0 24px}.order-edit-dialog legend{font-weight:700;font-size:16px;padding:0 8px}.order-edit-dialog fieldset p{font-size:13px;line-height:1.7;margin-top:0}.oe-help{font-size:13px;line-height:1.7;color:var(--muted);margin:16px 0}.oe-actions{display:flex;gap:8px;flex-wrap:wrap}.oe-actions button{min-height:44px;width:auto;margin:0}.oe-error{color:#a12622;background:#fff0ef;border-radius:8px;padding:12px;line-height:1.7}.order-edit-dialog :focus-visible{outline:3px solid #477db7;outline-offset:3px}
@media(max-width:650px){.order-primary-details{grid-template-columns:1fr 1fr;gap:8px}.order-primary-details>div:first-child{grid-column:1/-1}.order-primary-details>div{padding:12px}.order-primary-details dd{font-size:17px}.oe-fields,.oe-routing{grid-template-columns:1fr}.order-edit-dialog form{padding:16px}.order-overview-heading{gap:12px}.card-actions:has(.card-view-button){grid-template-columns:1fr auto}.card-actions:has(.card-view-button)>.primary{grid-column:1/-1}.order-card .card-view-button{width:100%}}
.orders.is-table-mode .card-view-button{display:none}
.order-files{margin-block:24px;padding:16px;border:1px solid var(--line);border-radius:12px;background:#fff}.order-files-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}.order-files-heading h3{margin:0;font-size:17px}.order-files button{min-height:44px}.order-files>p{font-size:13px;line-height:1.7}.order-files ul{list-style:none;margin:16px 0;padding:0;display:grid;gap:8px}.order-files li{padding:12px;border:1px solid var(--line);border-radius:8px;display:flex;gap:12px;align-items:center;flex-wrap:wrap}.order-files li>div:first-child{flex:1;min-width:120px;overflow-wrap:anywhere}.order-files small{display:block;color:var(--muted);margin-top:4px;direction:ltr;text-align:start}.order-file-actions{display:flex;gap:8px}.order-files [role=status]{white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px}.order-files [hidden]{display:none!important}
/* V30.27: compact order layout; touch controls stay 44px. */
#orderDialogBody{padding:16px;line-height:1.6}
#orderDialogBody h3{font-size:16px;margin:0 0 8px}
#orderDialogBody .order-overview-heading{gap:8px;align-items:center;margin-bottom:12px}
#orderDialogBody .order-overview-heading h2{font-size:20px;margin:0}
#orderDialogBody .order-overview-heading p{font-size:12px}
#orderDialogBody .order-overview-heading button{min-height:44px;font-size:13px;padding:8px 12px}
#orderDialogBody .order-primary-details{gap:8px;margin:12px 0}
#orderDialogBody .order-primary-details>div{padding:8px 12px;border-radius:8px}
#orderDialogBody .order-primary-details dt{font-size:12px;margin-bottom:4px}
#orderDialogBody .order-primary-details dd{font-size:17px;line-height:1.5}
#orderDialogBody .order-primary-details .order-count-value{font-size:23px}
#orderDialogBody .order-secondary-details{grid-template-columns:repeat(3,minmax(0,1fr));gap:0 16px;margin:0 0 12px;padding:0 12px;border:1px solid var(--line);border-radius:8px}
#orderDialogBody .order-secondary-details .detail{padding:8px 0;border:0;border-radius:0;border-bottom:1px solid #edf0f4;background:transparent;font-size:13px;overflow-wrap:anywhere}
#orderDialogBody .order-secondary-details .detail b{display:block;font-size:12px;font-weight:500;color:var(--muted);margin-bottom:2px}
#orderDialogBody .order-secondary-details .detail br{display:none}
#orderDialogBody .order-notes-block{margin:12px 0}
#orderDialogBody .order-notes-block .detail{padding:10px 12px;font-size:14px;line-height:1.6;min-height:0}
#orderDialogBody .custom-order-tools{margin:12px 0;padding:12px;border-radius:8px;background:#fafbfd}
#orderDialogBody .tools-fields{gap:8px;margin:8px 0}
#orderDialogBody .tools-fields label{gap:4px;margin:0;font-size:12px}
#orderDialogBody .tools-fields input{min-height:40px;padding:8px}
#orderDialogBody .tools-actions:empty,#orderDialogBody .tools-message:empty{display:none}
#orderDialogBody .remaining{padding:10px;font-size:13px}
#orderDialogBody .photo-list{gap:8px;margin:8px 0;font-size:13px}
#orderDialogBody .photo-item{width:140px;padding:4px}
#orderDialogBody .photo-item img{height:100px}
.order-spec-editor{margin:8px 0;border-top:1px solid var(--line)}
.order-spec-editor>summary{display:flex;justify-content:space-between;align-items:center;gap:8px;cursor:pointer;min-height:44px;font-size:14px;font-weight:600;list-style:none}
.order-spec-editor>summary::after{content:'+';font-size:20px;color:var(--muted)}
.order-spec-editor[open]>summary::after{content:'−'}
.order-spec-editor>summary:focus-visible{outline:3px solid #477db7;outline-offset:2px}
.order-spec-editor>summary span{margin-inline-start:auto;font-size:12px;font-weight:400}
.order-files{margin:0 0 12px;padding:12px;border-radius:8px;background:#f9fbfd}
.order-files-heading{gap:8px}.order-files-heading h3{display:flex;align-items:center;gap:4px;margin:0!important}
.order-files-heading h3 small{display:inline;margin:0;font-size:12px;font-weight:400}
.order-files-heading-actions{display:flex;align-items:center;gap:4px}
.order-files-heading-actions button{margin:0;padding:8px 10px;font-size:13px}
.order-files ul{gap:4px;margin:8px 0}
.order-files li{display:grid;grid-template-columns:56px minmax(0,1fr) auto;gap:8px;padding:6px;border-radius:8px;align-items:center;background:#fff}
.order-files li>div:first-child{min-width:0}
.order-files .of-file-info{min-width:0}
.order-files .of-file-info strong{font-size:13px;font-weight:600;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.order-files .of-file-info small{font-size:11px;margin-top:2px}
.order-files .order-file-actions{gap:4px}.order-files .order-file-actions button{padding:7px 9px;min-width:44px;font-size:12px;margin:0}
.order-files li>[role=status]:empty,.order-files [data-file-message]:empty{display:none}
.order-files li>[role=status]{grid-column:1/-1}
.order-file-preview{position:relative;width:56px;height:56px;min-height:56px!important;padding:0;background:#edf3f9;border:1px solid #dce5ef;border-radius:6px;overflow:hidden;display:grid;place-items:center;color:#385773;flex:none}
.order-file-preview img,.order-file-preview canvas{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0}
.order-file-preview.is-ready img,.order-file-preview.is-ready canvas{opacity:1}
.order-file-preview .of-file-mark{font-weight:700;font-size:11px;display:grid;place-items:center}
.order-file-preview.is-ready .of-file-mark{display:none}
.order-files .of-empty{display:block;color:var(--muted);border:0;background:transparent;padding:4px 0;font-size:13px}
.order-files-footer{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.order-files-footer>small{font-size:11px;margin:0;margin-inline-end:auto;direction:rtl}
.order-files-footer>button{min-height:44px;padding:8px;font-size:12px;margin:0}
.orders:not(.is-table-mode){gap:8px}
.orders:not(.is-table-mode) .order-card{padding:12px;gap:12px;min-height:104px;grid-template-columns:64px minmax(0,1fr) auto}
.orders:not(.is-table-mode) .thumb-shell{width:64px;height:64px;border-radius:10px}
.orders:not(.is-table-mode) .order-title{font-size:16px}
.orders:not(.is-table-mode) .order-meta{margin:5px 0;gap:4px 12px}
.orders:not(.is-table-mode) .order-tags{gap:4px}
.order-edit-dialog .oe-fields{margin:12px 0;gap:8px 12px}
.order-edit-dialog label{gap:4px;margin:0}
.order-edit-dialog fieldset{padding:12px;margin-bottom:12px}
.order-edit-dialog .oe-routing{gap:8px}
.order-edit-dialog .oe-help{margin:8px 0}
.new-order-dialog .unified-form{gap:8px}.new-order-dialog .unified-section{padding:12px}
.new-order-dialog .unified-section-title{margin-bottom:12px}
.new-order-dialog .unified-customer-grid,.new-order-dialog .unified-item-main,.new-order-dialog .unified-extra-grid{gap:8px 12px}
.new-order-dialog .unified-product{padding:12px}.new-order-dialog .unified-products{gap:8px}
.new-order-dialog .unified-form label{margin:0;gap:4px}.new-order-dialog .unified-dimensions{margin:8px 0;gap:8px}
@media(max-width:650px){
 #orderDialogBody{padding:12px}
 #orderDialogBody .order-primary-details{grid-template-columns:minmax(0,1.3fr) minmax(0,.7fr)}
 #orderDialogBody .order-primary-details>div:first-child{grid-column:1/-1}
 #orderDialogBody .order-secondary-details{grid-template-columns:repeat(2,minmax(0,1fr));gap:0 12px;padding:0 8px}
 #orderDialogBody .order-secondary-details .detail{padding:6px 0}
 .order-files{padding:8px}.order-files li{gap:6px;grid-template-columns:48px minmax(0,1fr) auto;padding:4px}
 .order-file-preview{width:48px;height:48px;min-height:48px!important}
 .order-files .order-file-actions button{padding:7px}
 .orders:not(.is-table-mode) .order-card{grid-template-columns:56px minmax(0,1fr);padding:10px;gap:8px;min-height:0}
 .orders:not(.is-table-mode) .thumb-shell{width:56px;height:56px}
}
#orderDialog>.dialog-actions{position:sticky;bottom:0;margin:0;padding:8px 16px;background:#fff;border-top:1px solid var(--line);z-index:2}
#orderDialog>.dialog-actions button{min-height:44px;margin:0;padding:8px 20px}

.order-files li>[role=status] input{width:100%;min-height:44px;font-size:12px;padding:8px;box-sizing:border-box}
