/* Existing OS tokens, medium density: summary first, optional work on demand. */
.ui-case-nav { display:flex;flex-wrap:wrap;gap:8px;margin:16px 0;padding:12px 0;border-block:1px solid var(--line); }
.ui-case-nav button { margin:0!important;background:var(--ui-soft,#f3f6f2);color:var(--nav,#254938);font-weight:650; }
.ui-detail-fold { margin:12px 0;border:1px solid var(--line);border-radius:10px;background:#fff;min-width:0; }
.ui-detail-fold > summary { padding:12px 16px!important;min-height:44px;cursor:pointer;font-size:.9rem; }
.ui-detail-fold[open] > summary { border-bottom:1px solid var(--line);margin-bottom:0!important; }
.ui-detail-fold > :not(summary) { margin:0!important;padding:16px;min-width:0; }
.ui-detail-fold > form { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px; }
.ui-detail-fold > form > :where(h5,h6,p,button,div,[role=status]) { grid-column:1/-1; }
.ui-detail-fold > form label:has(textarea) { grid-column:1/-1; }
#service-case-detail { font-size:.9rem;line-height:1.65; }
#service-case-detail > h4 { font-size:1rem; }
#service-case-detail h6 { font-size:.9rem;line-height:1.5;margin-block:12px; }
#service-case-detail > .service-case-detail-title { font-size:1.1rem;margin-block:8px; }
#service-case-detail .service-case-detail-meta { font-size:.82rem; }
#service-case-detail .policy-followup-panel { padding:16px;border:1px solid var(--line);border-radius:10px;background:#f3f6f2; }
#service-case-detail .service-case-form-actions { display:flex;flex-wrap:wrap;gap:8px; }
#service-case-detail .service-case-form-actions button { margin:0; }
#service-case-detail .service-case-assignment-form > button[type="submit"]:not(:disabled) { background:var(--nav);color:#fff;border-color:var(--nav);font-weight:700; }
#service-case-detail .aftercare-track { border-top:1px solid var(--line);padding-top:20px; }
#service-case-detail :where(pre, .aftercare-preview-body) { white-space:pre-wrap;overflow-wrap:anywhere; }
.ui-detail-fold :where(form,section,article,div) { max-width:100%; }
/* Generated case headings are siblings, not a pre-grouped title block. */
#service-case-workbench > .service-case-heading { display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 12px; }
#service-case-workbench > .service-case-heading > :not(button) { grid-column:1;min-width:0; }
#service-case-workbench > .service-case-heading > button { grid-column:2;grid-row:1/3;align-self:start;min-height:44px; }
#service-case-workbench > .service-case-heading > p:not(.eyebrow) { grid-column:1/-1; }
#service-case-workbench > .service-case-heading > .eyebrow { margin:0; }
@media(max-width:680px){
  .ui-detail-fold > form { grid-template-columns:minmax(0,1fr); }
  .ui-case-nav { gap:6px; }
  .ui-case-nav button { flex:1 1 40%; }
  .ui-detail-fold > :not(summary) { padding:12px; }
}
/* Classic scrollbars also consume room inside a 320px viewport. */
@media(max-width:360px){
  body { min-width:0; }
  #service-case-workbench { padding:10px; }
  #service-case-detail { padding:8px; }
  #service-case-detail .ui-detail-fold > :not(summary) { padding:10px; }
}
#ops-metrics .ops-metrics-grid > article:nth-child(5):last-child strong {
  font-size: 1rem;
  line-height: 1.5;
}
#ops-metrics .ops-metrics-grid small { font-size: .75rem; line-height: 1.55; }
@media (max-width: 960px) {
  #ops-metrics .ops-metrics-grid > article:nth-child(5):last-child { grid-column: 1 / -1; }
}
#customer-transaction-shadow .shadow-order-line-supplier-panel:empty,
#customer-transaction-shadow .shadow-shipment-allocation-panel:empty { display: none; }
#customer-transaction-shadow .shadow-order-lines > li > .shadow-order-line-review {
  display: inline-block;
  margin-right: .35rem;
  max-width: 100%;
  white-space: normal;
  vertical-align: top;
}
#customer-transaction-shadow .shadow-order-lines > li > .shadow-order-line-review:first-of-type { display: block; }
#app-view .content h5,
#app-view .content h6 { font-size: .9rem; line-height: 1.5; }
#app-view .content form > h5,
#app-view .content form > h6 { grid-column: 1 / -1; margin: 0 0 4px; }
/* The compact return label is still a primary navigation touch target. */
@media (max-width: 960px) {
  #operations-return { min-height: 44px; }
}
/* Existing summary cards had responsive column rules but no base grid styling. */
#service-case-workbench .service-case-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}
#service-case-workbench .service-case-summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f6f8f4;
}
#service-case-workbench .service-case-summary-card > span { color: var(--muted); font-size: .85rem; line-height: 1.5; word-break: keep-all; }
#service-case-workbench .service-case-summary-card > strong { flex-shrink: 0; font-size: 1.05rem; }
@media (max-width: 1100px) {
  #service-case-workbench .service-case-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  #service-case-workbench .service-case-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #service-case-workbench .service-case-summary-card { padding: 8px; gap: 4px; }
}

/* Original role and decision title share one line only when space permits. */
@media(min-width:761px){
  .owner-decision-card .ui-owner-decision-heading{display:flex;align-items:flex-start;gap:8px;margin-bottom:4px}
  .owner-decision-card .ui-owner-decision-heading>.work-who-owner{flex-shrink:0;margin-bottom:0}
  .owner-decision-card .ui-owner-decision-heading>strong{flex:1;min-width:0;margin-bottom:0}
}

/* Candidate metadata needs a complete row before narrow-screen statuses/actions. */
@media(max-width:760px){
  .product-review-list>.content-channel-candidate-row{flex-wrap:wrap;align-items:flex-start}
  .content-channel-candidate-row>div:first-child{flex:1 1 100%;min-width:0}
  .content-channel-candidate-row>button{flex-shrink:0}
}

.po-trial-panel{margin-top:20px;padding:20px;border:1px solid #dce3dc;border-radius:12px;background:#fff}.po-trial-controls{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.po-trial-panel input,.po-trial-panel select{max-width:100%;min-width:0}.po-trial-panel>select{display:block;margin:8px 0}.po-trial-panel pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:.8rem}.po-trial-current{font-weight:700}.po-trial-panel button{min-height:44px}.po-trial-panel button:disabled{opacity:.55}

.po-trial-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0}.po-trial-choices label{display:block;margin-bottom:6px;font-weight:600}.po-trial-choices select{width:100%;min-height:44px}.po-trial-panel .po-trial-controls>label{flex-basis:100%;margin-bottom:0}.po-trial-panel .po-trial-controls>input{flex:1 1 260px}.po-trial-panel .po-trial-controls>button{flex:0 0 auto}@media(max-width:760px){.po-trial-choices{grid-template-columns:1fr}.po-trial-panel{padding:14px}.po-trial-panel .po-trial-controls>input{flex-basis:100%}}

.ui-return-focus-target{scroll-margin-top:110px}.ui-detail-focus-target{scroll-margin-top:120px}

/* Keep native date controls readable inside nested procurement cards at 320px. */
@media(max-width:360px){
  #procurement{padding:10px}
  #procurement .procurement-case-card{padding:8px;min-width:0}
  #procurement .ui-detail-fold>form{padding:6px!important}
  #procurement .procurement-event-form label{min-width:0;max-width:100%}
  #procurement .procurement-event-form input[type="datetime-local"]{width:100%;min-width:0;padding-inline:4px;font-size:.82rem}
}
