/* Final scoped order-page rules; keep configured folder colors. */
@media (min-width: 1101px) {
  body .orders-layout { grid-template-columns: 320px minmax(0, 1fr); }
  body .status-panel { width: 100%; min-width: 0; }
}
body .status-panel .status-list { padding: 10px 12px; }
body .status-panel .status-item,
body .status-panel .status-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  padding: 6px 8px;
}
body .status-panel .status-item.status-child { padding-left: 18px; }
body .status-panel .status-name {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.4;
  color: var(--heading);
  font-size: 14px;
  font-weight: 500;
}
body .status-panel .status-count {
  width: 64px;
  min-width: 64px;
  height: 26px;
  padding: 4px;
  font-variant-numeric: tabular-nums;
  line-height: 18px;
}
body .status-panel .status-item.chosen {
  background: var(--info-soft);
  box-shadow: inset 3px 0 var(--primary);
  border-radius: 4px;
}
body #order-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px 20px;
  align-items: end;
}
body #order-filters.hidden { display: none; }
body #order-filters > .filter-grid { display: contents; }
body #order-filters .placed-date-range,
body #order-filters .placed-time-range { grid-column: span 2; margin: 0; padding: 0; border: 0; min-width: 0; }
body #order-filters fieldset > legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
body #order-filters .date-range-controls,
body #order-filters .time-range-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
body #order-filters .date-range-controls label::before { content: none; }
body #order-filters .field label,
body #order-filters .date-range-controls label { font-size: 13px; line-height: 20px; min-height: 20px; margin: 0 0 6px; font-weight: 600; white-space: normal; }
body #order-filters .date-calendar { display: flex; align-items: center; height: 44px; }
body #order-filters .date-calendar input { height: 42px; min-height: 42px; }
body #order-filters .order-filter-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
body #order-filters .order-filter-actions .btn { width: 140px; margin: 0; }
.shipment-diagnostics { margin-top: 8px; text-align: left; white-space: normal; }
.shipment-diagnostics summary { cursor: pointer; font-weight: 600; color: var(--error-text); }
.shipment-diagnostics article { padding: 10px; margin-top: 8px; border: 1px solid var(--error-border); border-radius: 6px; background: var(--error-soft); }
.shipment-diagnostics pre { margin: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
.shipment-diagnostics small { display: block; }
.control-last-seen { white-space: normal; min-width: 140px; }
@container order-filter-panel (max-width: 820px) {
  body #order-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container order-filter-panel (max-width: 540px) {
  body #order-filters { grid-template-columns: minmax(0, 1fr); }
  body #order-filters .placed-date-range,
  body #order-filters .placed-time-range { grid-column: auto; }
  body #order-filters .date-range-controls,
  body #order-filters .time-range-controls { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  body #order-filters .order-filter-actions .btn { width: 100%; max-width: none; }
}

body #order-filters input, body #order-filters select { height: 44px; min-height: 44px; }

/* Adapt to the space left by navigation and browser zoom, including laptops. */
body .workspace{min-width:0;container-type:inline-size;container-name:workspace}
body .main{min-width:0;width:100%;padding-inline:clamp(12px,1.5vw,25px)}
body .main :is(.order-main,.card,.page-top>div,.card-head>div,.form-grid>*,.editor-line-grid>*){min-width:0}
body .page-top,body .card-head,body .form-footer{flex-wrap:wrap}
body .page-top>.actions{flex:1 1 320px;justify-content:flex-end}
body .main .table-wrap{max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain}
body .main :is(.actions,.bulk-buttons,.row-actions,.metric-strip){flex-wrap:wrap}
body .metric-strip{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,100px),1fr));gap:12px;max-width:650px}
body .metric-strip>div{min-width:0;padding:12px 14px}
body .metric-strip span{white-space:normal;line-height:1.4;min-height:30px;font-size:11px}
body .main .actions .btn{max-width:100%;white-space:normal;text-align:center}
body .main .form-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr))}
body .main .form-grid>.full{grid-column:1/-1}
body .header{height:auto;min-height:65px;padding-block:10px;flex-wrap:wrap;gap:10px 18px}
body .header :is(h1,.breadcrumbs){min-width:0;white-space:normal;overflow-wrap:anywhere}
body .header-right{flex-wrap:wrap;min-width:0}
body .status-panel{min-height:0;height:min(760px,calc(100dvh - 110px));max-height:calc(100dvh - 110px)}
body .orders-layout+.footer{padding-left:0}
body .order-main{container-type:inline-size;container-name:order-main}
body .orders-table .line-item .product-photo{width:72px;height:98px;flex:0 0 72px}
body .orders-table .product-photo img{object-fit:contain}
body .orders-table .missing-photo small{font-size:10px}
body .order-row-actions{display:flex;flex-direction:column;align-items:flex-end;gap:8px;width:124px;max-width:100%}
body .order-row-label{min-height:40px;white-space:normal;line-height:1.35;text-align:center;font-size:12px}
body .order-row-actions .custom-action-feedback{white-space:normal;font-size:12px;text-align:right}
body dialog{max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow-y:auto;overscroll-behavior:contain}
body dialog :is(.field input,.field select,.field textarea){max-width:100%;min-width:0}
body dialog .form-footer{gap:10px}
body #order-product-form .order-product-search-row{display:flex;flex-wrap:wrap;gap:10px;align-items:stretch}
body #order-product-form #order-product-search{flex:1 1 250px;width:auto}
body #order-product-mode{white-space:normal;flex:0 1 auto}
body dialog:has(#order-product-form){top:clamp(12px,8dvh,72px);bottom:auto;margin:0 auto;max-height:calc(100dvh - 90px)}
body #order-product-results{max-height:42dvh;overflow-y:auto;overscroll-behavior:contain}
@container workspace (max-width:1250px){
 body .orders-layout{grid-template-columns:250px minmax(0,1fr)}
 body .status-panel{width:auto}
 body .header .breadcrumbs{display:none}
 body .page-top{align-items:flex-start}
 body .order-filter-card .card-head .actions{margin-left:0}
}
@container workspace (max-width:1100px){
 body .page-top{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
 body .page-top>.actions{justify-content:flex-start}
 body .orders-layout{grid-template-columns:minmax(0,1fr)}
 body .status-panel{height:auto;max-height:none;position:static}
 body .status-panel .card-head{min-height:54px;padding:8px 14px}
 body .mobile-status-toggle{display:inline-flex;margin-left:auto}
 body .status-panel .status-list{display:none}
 body .status-panel.statuses-open .status-list{display:block;max-height:min(440px,55dvh);overflow-y:auto}
 body .order-info-grid,body .order-address-grid{grid-template-columns:minmax(0,1fr)}
}
@container order-main (max-width:1200px){
 body .order-table-wrap{padding:0 12px 12px;overflow:visible}
 body .orders-table,body .orders-table thead,body .orders-table tbody{display:block;width:100%;min-width:0;table-layout:auto}
 body .orders-table thead tr{display:block}
 body .orders-table thead th{display:none}
 body .orders-table thead th:first-child{display:block;padding:10px 0;border:0}
 body .orders-table thead th:first-child::after{content:'Zaznacz stronę';margin-left:10px;font-size:13px}
 body .orders-table tbody tr{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.4fr);grid-template-areas:'order products' 'date products' 'statusdate products' 'buyer delivery' 'amount actions';align-items:start;gap:12px 22px;position:relative;padding:16px;margin-bottom:14px;border:1px solid var(--border);border-radius:6px;background:var(--surface)}
 body .orders-table tbody td{display:block;min-width:0;width:auto!important;max-width:none;padding:0;border:0;white-space:normal;overflow-wrap:anywhere}
 body .orders-table tbody td:first-child{position:absolute;top:16px;left:14px;width:26px!important}
 body .orders-table tbody .col-order{grid-area:order;min-width:0;padding-left:36px;padding-right:0}
 body .orders-table tbody .col-date{grid-area:date;font-size:13px;color:var(--muted)}
 body .orders-table tbody .col-products{grid-area:products}
 body .orders-table tbody .col-buyer{grid-area:buyer}
 body .orders-table tbody .col-delivery{grid-area:delivery}
 body .orders-table tbody .col-amount{grid-area:amount;font-size:17px}
 body .orders-table tbody td.col-actions{grid-area:actions;position:static;justify-self:end;width:auto!important}
 body .orders-table td[data-label]::before{content:attr(data-label);display:block;font-size:12px;color:var(--muted);font-weight:600;margin-bottom:5px}
 body .orders-table .line-item{margin:0 0 12px;gap:12px}
 body .order-row-actions{width:124px;flex-direction:column;align-items:flex-end;justify-content:flex-start}
 body .order-row-label{min-height:44px;padding:8px 12px}
 body .orders-table .col-products .muted{font-size:12px}
}
@container order-main (max-width:520px){
 body .orders-table tbody tr{grid-template-columns:minmax(0,1fr);grid-template-areas:'order' 'date' 'statusdate' 'products' 'buyer' 'delivery' 'amount' 'actions';gap:14px;padding:14px}
 body .orders-table tbody .col-order{padding-left:34px}
 body .orders-table .line-item .product-photo{width:70px;height:94px;flex-basis:70px}
 body .order-row-actions{justify-content:flex-start}
 body .order-row-actions .custom-action-feedback{flex-basis:100%;text-align:left}
 body .order-filter-card .card-head .actions{width:100%;display:flex;flex-wrap:wrap}
 body .order-filter-card .card-head .actions .btn{flex:1 1 160px}
}
@media(max-width:700px){body .header{min-height:58px}body .header-right .search{display:none}body .page-top>.actions{justify-content:flex-start}body dialog .form-footer .btn{white-space:normal}}

/* Screen density follows available space; print documents keep their own units. */
@media screen {
  body { font-size: 13px; line-height: 1.4; }
  body .main { padding: 12px 14px; }
  body .header { min-height: 50px; padding: 7px 14px; gap: 8px 14px; }
  body .header h1 { font-size: 18px; line-height: 1.3; }
  body .header-right { gap: 10px; }
  body .header .search input { height: 32px; font-size: 12px; }
  body .card { margin-bottom: 12px; }
  body .card-head { min-height: 44px; padding: 8px 12px; gap: 8px; }
  body .card-head h2 { font-size: 14px; line-height: 1.4; }
  body .card-body { padding: 12px; }
  body .page-top { gap: 10px; margin-bottom: 12px; }
  body .page-top h2 { font-size: 18px; }
  body .main .form-grid { gap: 12px 14px; }
  body .main :is(.actions, .row-actions) { gap: 6px; }
  body .main .btn { min-height: 32px; padding: 6px 10px; font-size: 12px; line-height: 18px; }
  body .main .btn.small { min-height: 28px; padding: 4px 8px; font-size: 11.5px; }
  body .main .btn.square { width: 30px; height: 30px; min-width: 30px; min-height: 30px; padding: 6px; }
  body .main .field :is(input:not([type=checkbox]):not([type=radio]), select) { min-height: 34px; padding: 6px 8px; font-size: 13px; }
  body .main .field label { margin-bottom: 4px; font-size: 12px; line-height: 16px; }
  body .main .tabs { padding-inline: 12px; }
  body .main .tab { min-height: 34px; padding: 8px 10px; font-size: 12px; }
  body .main .form-footer { padding: 10px 12px; gap: 8px; }
  body .main :is(th, td) { font-size: 12.5px; line-height: 1.4; padding-block: 8px; }
  body .main .metric-strip { gap: 8px; max-width: 560px; }
  body .main .metric-strip > div { padding: 9px 12px; }
  body .main .metric-strip span { min-height: 0; font-size: 10.5px; }
  body .main .footer { margin-top: 12px; font-size: 11px; }

  body .orders-layout { grid-template-columns: 228px minmax(0, 1fr); gap: 12px; }
  body .status-panel { top: 62px; height: min(760px, calc(100dvh - 80px)); max-height: calc(100dvh - 80px); }
  body .status-panel .card-head { min-height: 42px; flex-basis: 42px; padding: 7px 10px; }
  body .status-panel .status-list { padding: 6px 7px; }
  body .status-panel :is(.status-item, .status-group) { grid-template-columns: minmax(0, 1fr) 48px; min-height: 29px; padding: 4px 5px; gap: 7px; }
  body .status-panel .status-name { font-size: 12px; line-height: 1.35; }
  body .status-panel .status-count { width: 48px; min-width: 48px; height: 21px; padding: 2px 3px; line-height: 17px; font-size: 10.5px; }
  body .order-filter-card .card-head { padding: 8px 12px; }
  body .order-filter-card .card-head .actions { gap: 6px; }
  body .order-filter-card .card-head .btn { min-height: 32px; padding: 6px 9px; font-size: 12px; }
  body #order-filters { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px 10px; padding: 10px 12px 12px; background: var(--surface); align-items: end; }
  body #order-filters.hidden { display: none; }
  body #order-filters > .filter-grid { display: contents; }
  body #order-filters .field { min-width: 0; margin: 0; }
  body #order-filters :is(.field label, .date-range-controls label, .time-range-controls label) { display: block; min-height: 16px; margin: 0 0 4px; font-size: 11.5px; font-weight: 600; line-height: 16px; }
  body #order-filters .field :is(input, select) { height: 32px; min-height: 32px; padding: 5px 7px; border-radius: 4px; font-size: 12px; line-height: 20px; }
  body #order-filters :is(.placed-date-range, .placed-time-range) { grid-column: span 2; align-self: end; }
  body #order-filters :is(.date-range-controls, .time-range-controls) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  body #order-filters .date-calendar { height: 32px; border-radius: 4px; }
  body #order-filters .date-calendar input { height: 30px; min-height: 30px; padding: 4px 5px; font-size: 12px; border-radius: 0; }
  body #order-filters .date-calendar-open { width: 27px; min-width: 27px; height: 30px; min-height: 30px; padding: 5px; }
  body #order-filters .date-calendar-open svg { width: 16px; height: 16px; }
  body #order-filters .range-input { gap: 4px; }
  body #order-filters .range-input input { padding-inline: 6px; }
  body #order-filters .order-filter-actions { grid-column: auto; justify-self: stretch; align-self: end; }
  body #order-filters .order-filter-actions .btn { width: 100%; min-width: 0; max-width: none; min-height: 32px; height: 32px; margin: 0; padding: 5px 10px; white-space: nowrap; }

  body .order-tools { padding: 10px 12px 8px; }
  body .order-records { margin-bottom: 8px; gap: 9px; font-size: 12px; }
  body .bulk-buttons { gap: 5px; }
  body .bulk-buttons .btn { min-height: 28px; padding: 4px 8px; }
  body .selection-tools { margin: 0 12px 8px; padding: 6px 8px; gap: 5px; }
  body .selection-tools button { min-height: 27px; padding: 4px 7px; font-size: 11px; }
  body .orders-table { min-width: 900px; width: 100%; }
  body .orders-table th:first-child { width: 28px; }
  body .orders-table th:last-child { width: 144px; }
  body .orders-table .col-order { width: 126px; }
  body .orders-table .col-date { width: 80px; }
  body .orders-table .col-products { width: auto; }
  body .orders-table .col-delivery { width: 126px; }
  body .orders-table .col-buyer { width: 140px; }
  body .orders-table .col-amount { width: 88px; white-space: nowrap; }
  body .orders-table :is(th, td) { padding: 8px 7px; font-size: 12.5px; line-height: 1.4; }
  body .orders-table .line-item { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
  body .orders-table .line-item:last-child { margin-bottom: 0; }
  body .orders-table .line-item > div { min-width: 0; }
  body .orders-table .line-item .product-photo { width: 56px; height: 76px; flex: 0 0 56px; }
  body .orders-table :is(.table-sub, .muted) { font-size: 11px; line-height: 1.4; }
  body .orders-table .order-status-pill { margin-top: 3px; padding: 2px 8px; font-size: 11px; line-height: 16px; }
  body .orders-table .order-indicator { width: 22px; height: 22px; min-height: 22px; }
  body .orders-table .order-indicator b { font-size: 12px; }
  body .orders-table .order-indicators { margin-top: 3px; gap: 4px; }
  body .order-row-actions { width: 130px; max-width: 100%; gap: 6px; align-items: flex-end; }
  body .main .order-row-label { display: inline-flex; flex-direction: row; align-items: center; justify-content: center; width: 130px; min-width: 130px; min-height: 30px; height: 30px; padding: 5px 8px; font-size: 11.5px; line-height: 18px; white-space: nowrap; word-break: normal; overflow-wrap: normal; }
  body .order-row-actions .custom-action-feedback { font-size: 11px; }
  body .order-pagination { padding: 10px 12px; gap: 8px; font-size: 12px; }
}

@container workspace (max-width: 1180px) {
  body .orders-layout { grid-template-columns: minmax(0, 1fr); }
  body .status-panel { position: static; height: auto; max-height: none; }
  body .status-panel .card-head { min-height: 38px; flex-basis: auto; }
  body .mobile-status-toggle { display: inline-flex; margin-left: auto; }
  body .status-panel .status-list { display: none; }
  body .status-panel.statuses-open .status-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); max-height: min(320px, 42dvh); overflow-y: auto; }
}
@container order-filter-panel (max-width: 899px) {
  body #order-filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@container order-filter-panel (max-width: 619px) {
  body #order-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 10px; }
  body .order-filter-card .card-head .actions { width: auto; }
  body .order-filter-card .card-head .actions .btn { flex: 0 1 auto; }
  body #order-filters .order-filter-actions { grid-column: 1 / -1; justify-self: end; width: min(100%, 150px); }
}
@container order-filter-panel (max-width: 329px) {
  body #order-filters :is(.date-range-controls, .time-range-controls) { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}

@container order-main (max-width: 1200px) {
  body .orders-table { min-width: 0; }
  body .orders-table tbody tr { width: 100%; }
}

@media screen and (max-width: 760px) {
  body .main { padding: 10px 8px; }
  body .header { min-height: 46px; padding: 6px 10px; }
  body .header h1 { font-size: 16px; }
  body .order-filter-card .card-head { gap: 8px; }
  body .order-filter-card .card-head .actions { display: flex; width: 100%; gap: 5px; }
  body .order-filter-card .card-head .actions .btn { flex: 1 1 auto; min-width: 0; padding: 6px; font-size: 11px; }
  body .order-filter-card #collect-status { width: auto; min-height: 36px; font-size: 12px; }
  body #order-filters { padding: 10px; }
  body #order-filters .field :is(input, select) { height: 40px; min-height: 40px; font-size: 16px; }
  body #order-filters .date-calendar { height: 40px; }
  body #order-filters .date-calendar input { height: 38px; min-height: 38px; font-size: 13px; }
  body #order-filters .date-calendar-open { height: 38px; min-height: 38px; width: 30px; min-width: 30px; }
  body .orders-table { min-width: 0; }
  body .orders-table tbody tr { gap: 8px 14px; padding: 10px; margin-bottom: 8px; }
  body .orders-table tbody td { padding: 0; }
  body .orders-table tbody td:first-child { top: 12px; left: 10px; }
  body .orders-table tbody td:last-child { position: static; width: auto; }
  body .orders-table .col-order { padding-left: 42px; }
  body .orders-table .col-date { margin: 0; padding-bottom: 4px; }
  body .orders-table .col-amount { font-size: 15px; }
  body .orders-table .line-item { margin-bottom: 8px; }
  body .orders-table .line-item .product-photo { width: 56px; height: 76px; flex-basis: 56px; }
  body .order-row-actions { flex-direction: row; flex-wrap: wrap; width: auto; max-width: 100%; align-items: center; justify-content: flex-start; }
  body .main .order-row-label { width: 140px; min-width: 140px; height: 36px; min-height: 36px; }
  body .orders-table td[data-label]::before { margin-bottom: 3px; font-size: 11px; }
}
@media screen and (pointer: coarse) {
  /* Real touch devices keep usable targets, independently of screen width. */
  body .main .btn, body .main .btn.small { min-height: 44px; }
  body .main .btn.square { width: 44px; height: 44px; min-width: 44px; }
  body #order-filters .field :is(input, select) { height: 44px; min-height: 44px; font-size: 16px; }
  body #order-filters .date-calendar { height: 44px; }
  body #order-filters .date-calendar input { height: 42px; min-height: 42px; }
  body #order-filters .date-calendar-open { min-width: 40px; width: 40px; min-height: 42px; height: 42px; }
  body #order-filters .order-filter-actions .btn { min-height: 44px; height: 44px; }
  body .main .order-row-label { min-height: 44px; height: 44px; }
}

/* Mobile: retain order content and individual folders without the desktop action panel. */
@media screen and (max-width:760px){
  body .order-card-layout .order-card-heading > .actions,
  body .status-panel .status-all,
  body .status-panel .status-group-remaining{display:none}
}

/* A selected order remains clear across alternating rows and mobile cards. */
body .orders-table tbody tr.order-selected,
body .orders-table tbody tr.order-selected > td{background:#e3e6ff!important;color:var(--heading)}
body .orders-table tbody tr.order-selected{outline:2px solid #6554c0;outline-offset:-2px;box-shadow:inset 5px 0 #6554c0}
body .orders-table tbody tr.order-selected > td:first-child{box-shadow:inset 5px 0 #6554c0}
body .orders-table tbody tr{cursor:default}
body .orders-table tbody tr :is(a,button,input,select,textarea){cursor:revert}
body .order-supplier-references{display:grid;gap:5px;margin-top:9px;max-width:100%}
body .orders-table .supplier-order-reference{display:block;padding:5px 8px;border:1px solid #24735f;border-left:4px solid #24735f;border-radius:4px;background:#e1f4eb;color:#134b3c;font-size:18px;line-height:1.35;font-weight:800;overflow-wrap:anywhere;white-space:normal}
@media screen and (max-width:760px){body .orders-table .supplier-order-reference{font-size:18px}}

body .supplier-auto-label{padding:7px 9px;margin-top:7px;border:1px solid var(--border);border-left:4px solid var(--primary);border-radius:4px;background:var(--info-soft);font-size:12px;line-height:1.45;overflow-wrap:anywhere}
body .supplier-auto-label.error{border-color:var(--error-text);color:var(--error-text);background:var(--error-soft)}
body .order-auto-label-status:not(:empty){padding:0 14px 12px}

/* Batch 172: readable notices and compact, whole-word order labels. */
body #toast, body.touch-ui #toast {
  box-sizing: border-box; width: max-content; max-width: min(820px, calc(100% - 32px));
  padding: 20px 28px; font-size: 18px; line-height: 1.5; font-weight: 600;
  bottom: max(28px, env(safe-area-inset-bottom)); border-radius: 8px;
  white-space: normal; overflow-wrap: break-word; text-align: center;
}
body .orders-table .order-status-pill {
  display: inline-block; box-sizing: border-box; max-width: 100%;
  border-radius: 4px; padding: 4px 7px; font-size: 11px; line-height: 1.3;
  white-space: normal; overflow-wrap: normal; word-break: normal; hyphens: none;
  text-align: left; vertical-align: top;
}
body .orders-table .line-item .product-photo {
  width: 68px; height: auto; min-height: 0; max-height: 88px;
  flex: 0 0 68px; padding: 0; background: #fff; border-radius: 3px;
}
body .orders-table .line-item .product-photo img {
  display: block; width: 100%; height: auto; max-height: 86px;
  object-fit: contain; aspect-ratio: auto;
}
body .orders-table .line-item .missing-photo { min-height: 48px; }
@media screen and (min-width: 761px) {
  body .orders-table .col-order { width: 152px; }
}
@media screen and (max-width: 760px) {
  body #toast, body.touch-ui #toast { max-width: calc(100% - 24px); padding: 16px 18px; font-size: 17px; }
}

/* Batch 177: comments remain readable and selection stays by the checkbox. */
body .orders-table .order-list-note{
  margin-top:9px;padding:7px 8px;border:1px solid #d5cef0;border-left:4px solid var(--primary,#6554c0);
  border-radius:5px;background:#f0edfa;overflow-wrap:anywhere;
}
body .orders-table .order-list-note>strong{display:block;color:#51418f;font-size:11px;line-height:1.35;font-weight:700;margin-bottom:3px}
body .orders-table .order-list-note>div{color:#29213f;font-size:14px;line-height:1.45;font-weight:750;white-space:pre-wrap}
body .orders-table .touch-choice,
.touch-ui body .orders-table .touch-choice{
  display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;
  width:1cm;height:1cm;min-width:1cm;min-height:1cm;max-width:1cm;max-height:1cm;
  padding:0;margin:0;border-radius:50%;clip-path:circle(50%);vertical-align:middle;cursor:pointer;touch-action:manipulation;
}
body .orders-table .touch-choice input,
.touch-ui body .orders-table .touch-choice input{margin:0;width:18px;height:18px;min-width:0;min-height:0;flex:none;cursor:pointer}
body .orders-table .touch-choice:hover{background:#e3def5}
body .orders-table .touch-choice:focus-within{box-shadow:inset 0 0 0 2px var(--primary,#6554c0)}

/* Live states update only this small part of the row. */
body .supplier-auto-label.waiting{background:#fff5d9;border-color:#c68b12;color:#725007}
body .supplier-auto-label.working{background:#eeebfc;border-color:#6554c0;color:#443285}
body .supplier-auto-label.ready{background:#e1f4eb;border-color:#24735f;color:#134b3c}
body .supplier-auto-label.muted-state{background:#f2f2f5;border-color:#aaa7b3;color:#55515f}
body .supplier-auto-label strong{display:block;font-size:13px;line-height:1.45}
body .auto-label-live-notice{margin:8px 12px;padding:9px 12px;background:#fff5d9;color:#725007;border-left:3px solid #c68b12;font-size:13px}

/* Status totals: only authorized responses contain amounts. */
.order-status-value-summary{display:flex;align-items:center;justify-content:space-between;gap:24px;margin:8px 12px 12px;padding:20px 24px;border:1px solid #d9dcf5;border-left:4px solid #5458d6;border-radius:8px;background:#f3f4fc;color:#272b3d}
.order-status-value-summary h3{margin:0 0 6px;font-size:16px;font-weight:700}
.order-status-value-summary p{margin:0;font-size:12px;color:#656a80;line-height:1.6}
.order-status-value-totals{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:10px 24px}
.order-status-value-amount{font-size:22px;font-weight:800;white-space:nowrap;font-variant-numeric:tabular-nums}
.order-status-value-amount span{font-size:14px;font-weight:700}
.order-status-value-error{font-size:13px;color:#a12546}
@media(max-width:760px){.order-status-value-summary{align-items:flex-start;flex-direction:column;padding:16px;gap:14px}.order-status-value-totals{justify-content:flex-start}.order-status-value-amount{font-size:20px}}

/* Release 20261026: readable status-entry date and keyboard-accessible comment IDs. */
body .orders-table .col-date,body .orders-table .col-status-date{min-width:104px;width:104px;overflow-wrap:normal}
body .comment-copy-id{font:inherit;font-weight:700;color:inherit;background:none;border:0;border-radius:3px;padding:2px 3px;margin:-2px -3px;cursor:copy;text-align:inherit}
body .comment-copy-id:hover{background:rgba(85,87,214,.12);text-decoration:underline}
body .comment-copy-id:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
body .comment-copy-buffer{position:fixed;left:-9999px;top:0}
body .picking-remove-line{color:var(--danger,#b42341);margin:4px 12px 0 0}
@container order-main (max-width:1200px){body .orders-table tbody .col-status-date{grid-area:statusdate;font-size:13px;color:var(--muted);min-width:0;width:auto}}

body .orders-table .col-status-date{min-width:120px;width:120px}

/* The product column must retain room for both its photo and readable text. */
body .orders-table .order-product-copy{flex:1 1 0;min-width:0;overflow-wrap:break-word;word-break:normal}
body .orders-table .order-product-identifiers{overflow-wrap:anywhere;word-break:normal}
@container order-main (max-width:1200px){
 body .orders-table thead tr{display:flex;align-items:center;flex-wrap:wrap;gap:8px 18px}
 body .orders-table thead th:first-child{display:flex;align-items:center;flex:0 0 auto;width:auto;gap:8px;white-space:nowrap}
 body .orders-table thead th:first-child::after{margin-left:0}
 body .orders-table thead th.col-date:not(.hidden),
 body .orders-table thead th.col-status-date:not(.hidden){display:block;width:auto;min-width:0;padding:8px 0;border:0}
 body .orders-table thead .th-sort{min-height:32px;white-space:normal}
}
@container order-main (min-width:1201px){
 body .orders-table{min-width:1320px}
 body .orders-table .col-products{width:318px;min-width:318px}
}
