/* One compact mobile language for every order-detail section. */
.history-mobile-date,.history-mobile-status{display:none}
@media(max-width:767px){
  #tab-orders #orderDetailView .order-detail-card{padding:14px;border-radius:13px}
  #tab-orders #orderDetailView .order-detail-card-head{gap:8px;margin-bottom:12px}
  #tab-orders #orderDetailView .order-detail-card h3{margin:0;font-size:17px;line-height:1.35}
  #tab-orders #orderDetailView .order-detail-card-head p{margin:5px 0 0;font-size:12.5px;line-height:1.45}
  #tab-orders #orderDetailView .order-detail-panel{min-width:0;gap:10px}
  /* Editable data and payment/document facts use the same two-column rows. */
  #tab-orders #orderDetailView .order-detail-form-grid{display:block;margin-top:0;border:1px solid #dcd5e1;border-bottom:0}
  #tab-orders #orderDetailView .order-detail-form-grid>.field,
  #tab-orders #orderDetailView .order-detail-company-toggle,
  #tab-orders #orderDetailView .order-detail-note{display:grid;grid-template-columns:minmax(0,40%) minmax(0,1fr);gap:0;margin:0;border-bottom:1px solid #dcd5e1;align-items:stretch}
  #tab-orders #orderDetailView .order-detail-form-grid>.field>span,
  #tab-orders #orderDetailView .order-detail-note>span{margin:0;padding:8px;background:#f4f0f6;border-right:1px solid #dcd5e1;font-size:12px;font-weight:700;line-height:1.4;overflow-wrap:anywhere}
  #tab-orders #orderDetailView .order-detail-form-grid :is(input:not([type=checkbox]),select),
  #tab-orders #orderDetailView .order-detail-note textarea{width:100%;min-width:0;min-height:44px;margin:0;padding:7px;border:0;border-radius:0;box-shadow:none;background:#fff;font-size:16px}
  #tab-orders #orderDetailView .order-detail-note{border:1px solid #dcd5e1;margin-top:10px}
  #tab-orders #orderDetailView .order-detail-note textarea{min-height:72px}
  #tab-orders #orderDetailView .order-detail-company-toggle{display:flex;align-items:center;gap:6px;min-height:44px;padding:7px 8px;border:0;border-bottom:1px solid #dcd5e1;border-radius:0;background:#fff;font-size:13px}
  #tab-orders #orderDetailView .order-detail-company-toggle input{width:18px;height:18px;min-height:0;margin:0;flex:none}
  #tab-orders #orderDetailView .order-detail-company-fields{margin-top:10px}
  #tab-orders #orderDetailView .order-detail-dl{display:grid;grid-template-columns:minmax(0,40%) minmax(0,1fr);gap:0;margin:12px 0 0;border:1px solid #dcd5e1;border-bottom:0}
  #tab-orders #orderDetailView .order-detail-dl :is(dt,dd){min-width:0;margin:0;padding:8px;border-bottom:1px solid #dcd5e1;font-size:13px;line-height:1.45;text-transform:none;letter-spacing:normal;overflow-wrap:anywhere}
  #tab-orders #orderDetailView .order-detail-dl dt{background:#f4f0f6;border-right:1px solid #dcd5e1;font-weight:700}
  #tab-orders #orderDetailView .order-detail-dl dd{font-weight:650}
  #tab-orders #orderDetailView .order-detail-dl dd.is-money{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
  /* History stays a continuous bordered list, with one date/content grid. */
  #tab-orders #orderDetailView .order-history-scroll{display:block;overflow:visible;max-width:100%}
  #tab-orders #orderDetailView .order-history-table{display:block;width:100%;min-width:0;border:1px solid #dcd5e1;border-bottom:0;border-radius:0;font-size:13px}
  #tab-orders #orderDetailView .order-history-table :is(thead,tbody){display:block;width:100%}
  #tab-orders #orderDetailView .order-history-table tr{display:grid;width:100%;min-width:0;margin:0;padding:0;gap:0;border:0;border-bottom:1px solid #dcd5e1;border-radius:0;background:#fff}
  #tab-orders #orderDetailView .order-history-table tbody tr:nth-child(even){background:#faf9fb}
  #tab-orders #orderDetailView .order-history-table :is(th,td){display:block;width:auto;min-width:0;max-width:100%;margin:0;padding:7px;border:0;border-radius:0;background:transparent;white-space:normal;text-align:left;overflow-wrap:anywhere;font-size:13px;line-height:1.4}
  #tab-orders #orderDetailView .order-history-table thead tr{background:#f4f0f6}
  #tab-orders #orderDetailView #orderHistoryTimeline tr{grid-template-columns:82px minmax(0,1fr)}
  #tab-orders #orderDetailView #orderHistoryTimeline .history-date{grid-column:1;grid-row:1 / span 3;border-right:1px solid #dcd5e1;font-size:13px;color:var(--muted)}
  #tab-orders #orderDetailView #orderHistoryTimeline .history-event{grid-column:2;width:auto;font-size:13.5px;font-weight:750}
  #tab-orders #orderDetailView #orderHistoryTimeline tbody td:nth-child(3){grid-column:2;padding-top:0;color:var(--muted)}
  #tab-orders #orderDetailView #orderHistoryTimeline tbody td:last-child{grid-column:2;padding-top:0}
  #tab-orders #orderDetailView #orderHistoryTimeline tbody td:last-child:not(:has(button)){display:none}
  #tab-orders #orderDetailView #orderHistoryTimeline thead th:nth-child(n+3){display:none}
  #tab-orders #orderDetailView .order-history-table .order-history-email-action{min-height:36px;margin:0;padding:6px 8px;font-size:12px}
  /* Purchase amount has a real, consistently right-aligned column. */
  #tab-orders #orderDetailView #customerPurchaseHistory tr{grid-template-columns:76px minmax(0,1fr) 68px}
  #tab-orders #orderDetailView #customerPurchaseHistory tr>:nth-child(2),
  #tab-orders #orderDetailView #customerPurchaseHistory tr>:nth-child(5){display:none}
  #tab-orders #orderDetailView #customerPurchaseHistory tr>:first-child{grid-column:1;border-right:1px solid #dcd5e1}
  #tab-orders #orderDetailView #customerPurchaseHistory tr>:nth-child(3){grid-column:2;border-right:1px solid #dcd5e1}
  #tab-orders #orderDetailView #customerPurchaseHistory tr>:nth-child(4){grid-column:3;text-align:right;font-weight:800;font-variant-numeric:tabular-nums;white-space:nowrap}
  #tab-orders #orderDetailView .history-mobile-date{display:block;margin-top:3px;font-size:11.5px;color:var(--muted);font-weight:400}
  #tab-orders #orderDetailView .history-mobile-status{display:block;margin-top:5px;font-size:12px;color:var(--muted)}
  #tab-orders #orderDetailView .history-mobile-status.is-paid{color:#16805e;font-weight:750}
  #tab-orders #orderDetailView .order-history-table .customer-order-link{min-height:32px;font-size:13px}
  /* The same compact label/value rows replace source and summary tiles. */
  #tab-orders #orderDetailView :is(.order-source-grid,.order-journey-summary,.customer-purchase-summary){display:block;grid-template-columns:none;gap:0;margin:0;border:1px solid #dcd5e1;border-bottom:0}
  #tab-orders #orderDetailView :is(.order-source-field,.customer-purchase-metric){display:grid;grid-template-columns:minmax(0,40%) minmax(0,1fr);gap:0;margin:0;padding:0;border:0;border-bottom:1px solid #dcd5e1;border-radius:0;background:#fff}
  #tab-orders #orderDetailView :is(.order-source-field-label,.customer-purchase-metric>span){display:block;min-width:0;margin:0;padding:7px;background:#f4f0f6;border-right:1px solid #dcd5e1;font-size:12px;font-weight:700;line-height:1.45;letter-spacing:normal;overflow-wrap:anywhere}
  #tab-orders #orderDetailView :is(.order-source-field-value,.customer-purchase-metric>strong){min-width:0;margin:0;padding:7px;font-size:13px;line-height:1.45;font-weight:650;overflow-wrap:anywhere}
  #tab-orders #orderDetailView .customer-purchase-metric>strong{text-align:right;font-variant-numeric:tabular-nums}
  #tab-orders #orderDetailView .customer-purchase-summary{margin-bottom:12px}
  #tab-orders #orderDetailView .order-insights-layout{margin-top:10px;gap:10px}
  #tab-orders #orderDetailView .order-journey-scope{margin:0 0 10px;font-size:12px;line-height:1.45}
  #tab-orders #orderDetailView .order-journey-list{border:1px solid #dcd5e1;border-bottom:0}
  #tab-orders #orderDetailView .order-journey-step{display:grid;grid-template-columns:82px minmax(0,1fr);min-height:0;border-bottom:1px solid #dcd5e1}
  #tab-orders #orderDetailView .order-journey-step:nth-child(even){background:#faf9fb}
  #tab-orders #orderDetailView .order-journey-node{display:none}
  #tab-orders #orderDetailView .order-journey-time{min-width:0;padding:7px;border-right:1px solid #dcd5e1;text-align:left;font-size:11.5px;line-height:1.4}
  #tab-orders #orderDetailView .order-journey-time strong{font-size:12px}
  #tab-orders #orderDetailView .order-journey-info{min-width:0;padding:7px}
  #tab-orders #orderDetailView .order-journey-action{font-size:13.5px;line-height:1.4}
  #tab-orders #orderDetailView .order-journey-product{display:block;margin:3px 0 0;padding:0;border:0;border-radius:0;background:none;font-size:12px}
  #tab-orders #orderDetailView .order-insights-count{align-self:flex-start;padding:3px 6px;font-size:11px}
  #tab-orders #orderDetailView .order-insights-empty{margin:0 0 10px;padding:8px;border:1px solid #dcd5e1;border-radius:0;font-size:12px}
}
