/* DisputePilot v2 · Settings and reports layout pass (Nov 28 2026, Carl pt458u + 8:04 PM steering).
   Loaded last. Only widths, grid spans and wrapping: no content, colours or components change.
   Measured with audit/audit.py at 1440 / 1280 / 1024 / 390 (clipped controls, 3+ line wraps, offscreen inputs).
   Roll back: remove this file and its <link> in index.html. */

/* 1 · Setup steps: same 880 px settings column as Order Screening › No-reply rules (v2-os-noreply.css) */
@media (min-width: 1367px) {
  body.dp-v2 .v2-stepper { grid-template-columns: 240px minmax(0, 880px); }
}
/* Steps without the composite wrapper (PreAlert › Resolve receipts, Order Insight, First-Party Trust) still opened the old
   two-column settings tree inside the step, so the form shrank to a 240 px column. Same single column as Alert setup. */
body.dp-v2 .v2-stepper-form .omp-resolve-ops__settings { grid-template-columns: minmax(0, 1fr) !important; display: block; }
/* Step footer buttons (Back / Continue / Save and finish later) had no side padding on <button> */
body.dp-v2 .v2-stepper-foot { flex-wrap: wrap; gap: 8px; }
body.dp-v2 .v2-stepper-foot > button.btn-outline,
body.dp-v2 .v2-stepper-foot > button.btn-primary { padding: 0 16px; white-space: nowrap; }
/* Long URL fields in step rows (digital receipt links) use the room the wider column gives */
body.dp-v2 .omp-resolve-ops__srow .omp-resolve-ops__input--wide { width: min(100%, 440px); }
/* Panel titles that are long (e.g. "Order Insight (Compelling Evidence 3.0)") keep to two lines */
body.dp-v2 .omp-resolve-ops__panel-head h2:not(.v2-dup-title) { text-wrap: balance; }

/* 2 · Setup overview step cards: description and button use the full card width, not just the title column,
   so "Hold and capture", "Data sources", "Rebill protection" stop wrapping to 3–4 lines at 1024 px */
body.dp-v2 .v2-step p,
body.dp-v2 .v2-step .v2-step-btn { grid-column: 2 / -1; }
body.dp-v2 .v2-step h3 { min-width: 0; }

/* 3 · Descriptors & network IDs / CE 3.0 tables: selects sized to their longest option */
body.dp-v2 .ms-edit select.ms-in { min-width: 140px; }
body.dp-v2 .ms-edit select.ms-in.is-sm { width: auto; max-width: none; padding-right: 26px; }
/* Below 1180 px the 7-column tables do not fit, so they stack as cards (same pattern v2-merchant.css uses on phones) */
@media (max-width: 1180px) and (min-width: 701px) {
  body.dp-v2 .ms-table.ms-edit thead { display: none; }
  body.dp-v2 .ms-table.ms-edit, body.dp-v2 .ms-table.ms-edit tbody, body.dp-v2 .ms-table.ms-edit tr, body.dp-v2 .ms-table.ms-edit td { display: block; width: 100%; box-sizing: border-box; }
  body.dp-v2 .ms-table.ms-edit tbody tr { height: auto; }
  body.dp-v2 .ms-table.ms-edit tr { border: 1px solid rgba(22,53,73,.10); border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; background: #fff; }
  body.dp-v2 .ms-table.ms-edit td { border: 0; padding: 5px 0; display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 10px; align-items: center; }
  body.dp-v2 .ms-table.ms-edit td::before { content: attr(data-label); font-size: 12px; color: #6B7F8C; }
  body.dp-v2 .ms-table.ms-edit td.ms-x { display: block; text-align: left; }
  body.dp-v2 .ms-table.ms-edit td.ms-x::before { content: none; }
  body.dp-v2 .ms-table.ms-edit td .ms-in { min-width: 0; max-width: 420px; justify-self: start; }
  body.dp-v2 .ms-table.ms-edit td select.ms-in.is-sm { width: auto; max-width: 100%; }
  body.dp-v2 .gp-table-wrap:has(> .ms-table.ms-edit) { overflow: visible; }
}
@media (max-width: 700px) {
  body.dp-v2 .ms-table.ms-edit td select.ms-in.is-sm { width: 100%; max-width: 100%; }
}
@media (max-width: 480px) {
  body.dp-v2 .ms-table.ms-edit td { grid-template-columns: minmax(0, 1fr); gap: 4px; }
}

/* 4 · Merchant Profile: Category and Description get the room their values need */
@media (min-width: 1367px) {
  body.dp-v2 .ms-grid.is-5:has(#ms-profile-category) { grid-template-columns: minmax(0, .9fr) minmax(0, 1.4fr) minmax(0, 2fr) minmax(0, 1fr) minmax(0, .6fr); }
}
@media (max-width: 1366px) and (min-width: 701px) {
  body.dp-v2 .ms-grid.is-5:has(#ms-profile-category) { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: row dense; }
  body.dp-v2 .ms-field:has(> #ms-profile-description) { grid-column: span 2; }
}
@media (max-width: 1100px) and (min-width: 701px) {
  body.dp-v2 .ms-grid.is-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.dp-v2 .ms-grid.is-5:has(#ms-profile-category) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 5 · Order Screening › Hold and capture: two wide columns so "Keep the authorization and send to review" fits */
body.dp-v2 .dp-os-rule__fields:has([data-os-hc-field]) { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }

/* 6 · Report tables (Executive summary, Support-to-dispute backtest): first column and headers keep a readable width;
   the table scrolls inside its card instead of squeezing headers to 3–17 lines */
body.dp-v2 .gp-table.in-table th { min-width: 96px; text-wrap: balance; }
body.dp-v2 .gp-table.in-table th:first-child,
body.dp-v2 .gp-table.in-table td:first-child { min-width: 180px; }
body.dp-v2 .gp-table.in-table th:has(+ th) { vertical-align: bottom; }
@media (max-width: 1279px) {
  body.dp-v2 .gp-table.in-table th { min-width: 120px; }
}
@media (max-width: 700px) {
  body.dp-v2 .gp-table.in-table th:first-child, body.dp-v2 .gp-table.in-table td:first-child { min-width: 150px; }
}
body.dp-v2 .gp-table.in-buckets th:nth-child(3) { min-width: 250px; }
body.dp-v2 .gp-table.in-buckets th:nth-child(4) { min-width: 180px; }
/* Alerts › Reason codes header "Evidence auto-pulled from Solvpath 360" */
body.dp-v2 table.omp-resolve-ops__table thead th { text-wrap: balance; }

/* 7 · Autopilot presets: cards keep at least 300 px (2 per row at 1024 px instead of 3 narrow ones) */
body.dp-v2 .gp-preset-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }

/* 8 · Phones: long select options in step rows and Notifications use a slightly smaller face, full width */
@media (max-width: 480px) {
  body.dp-v2 .omp-resolve-ops__srow select.omp-resolve-ops__select,
  body.dp-v2 #view-rz .omp-resolve-ops__step > label > select { width: 100%; max-width: 100%; font-size: 13px; padding-left: 8px; padding-right: 24px; text-overflow: ellipsis; }
}
/* Step cards go one per row below 1100 px so descriptions stay at one or two lines */
@media (max-width: 1100px) { body.dp-v2 .v2-steps { grid-template-columns: minmax(0, 1fr); } }
/* Header: the Sign in banner overlapped the avatar (its box was narrower than its contents) */
@media (min-width: 701px) {
  body.dp-v2 .dp-top > #dp-banner { width: auto; min-width: max-content; flex-wrap: nowrap; padding-left: 10px; padding-right: 0; gap: 8px; }
}
@media (max-width: 1366px) and (min-width: 701px) {
  body.dp-v2 .dp-top { padding-right: 16px; }
  body.dp-v2 .dp-top-right { gap: 8px; }
}
/* Feature pass layout fixes (Nov 28 2026, Carl 10:03 PM). AAC-14 Audit & credits report: short header cells
   ("Network", "Filed with") squeezed to ~27px and wrapped letter by letter at 390px; keep headers on one line (the table already scrolls). */
body.dp-v2 #view-cr .pc-table th { white-space: nowrap; }
/* AAC-13 Action center filters: "First orders and rebills" was clipped in a half-width select at 390px; stack the selects full width on phones. */
@media (max-width: 480px) { body.dp-v2 .dx-filters select.ms-in { flex: 1 1 100%; width: 100%; } }
/* Header, signed in: the user label pushed Sign out past the right edge (horizontal scroll). The avatar already shows who is signed in. */
@media (min-width: 701px) {
  body.dp-v2 .dp-top > #dp-banner .dp-user { min-width: 0; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (min-width: 701px) and (max-width: 1680px) {
  body.dp-v2 .dp-top > #dp-banner .dp-user { display: none; }
}
