.calculator-page .result-notices,
.podsort-page .result-notices {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 8px 14px;
  border: 1px solid #d4deec;
  border-radius: 10px;
  background: #f8fbff;
  color: #25344f;
  font-size: 13px;
  line-height: 1.35;
}
.result-notices__count { font-weight: 700; font-variant-numeric: tabular-nums; }
.result-notices__partial { padding: 2px 7px; border-radius: 6px; background: #fff1d8; color: #8a4b10; font-size: 11px; font-weight: 700; }
.result-notices__stale,
.result-notices__inbound { padding: 2px 7px; border-radius: 6px; background: #fff1d8; color: #8a4b10; font-size: 11px; font-weight: 700; }
.result-notices__dates { color: #725122; font-size: 12px; }
.podsort-stale-option {
  padding: 8px 14px;
  border: 1px solid #e7d19b;
  border-radius: 10px;
  background: #fffaf0;
  color: #62461d;
}
.podsort-stale-option label { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 9px; cursor: pointer; font-size: 13px; font-weight: 650; }
.podsort-stale-option input { margin: 0; width: 16px; height: 16px; accent-color: #a96813; }
.podsort-stale-option small { color: #806c4f; font-size: 11px; font-weight: 400; }
.podsort-storage-disclosure { border: 1px solid #d4deec; border-radius: 10px; background: #fff; }
.podsort-storage-disclosure > summary { display: list-item; margin-left: 28px; padding: 9px 12px 9px 0; cursor: pointer; color: #2457ad; font-size: 13px; font-weight: 650; }
.podsort-storage-disclosure > summary:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.podsort-storage-disclosure > .storage-status-panel { margin: 0; border: 0; border-top: 1px solid #d4deec; box-shadow: none; }
.podsort-error-notice { font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.podsort-error-notice summary { margin-top: 5px; cursor: pointer; font-weight: 650; }
.podsort-error-notice__body { max-height: 45vh; margin-top: 8px; overflow: auto; white-space: pre-wrap; font-weight: 400; }
.podsort-inbound-recovery { display: block; margin-top: 8px; }
.result-notices__detail { position: relative; }
.result-notices__detail summary {
  display: list-item;
  cursor: pointer;
  color: #2457ad;
  font-weight: 600;
  white-space: nowrap;
}
.result-notices__detail summary:hover { text-decoration: underline; }
.result-notices__detail summary:focus-visible { outline: 2px solid #2563eb; outline-offset: 3px; border-radius: 3px; }
.result-notices__body {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 30;
  box-sizing: border-box;
  width: min(570px, calc(100vw - 48px));
  max-height: min(52vh, 480px);
  overflow: auto;
  padding: 12px 16px;
  border: 1px solid #c7d6ee;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 40px #1d376026;
  color: #26344d;
  font-weight: 400;
  white-space: normal;
}
.result-notices__body ul { margin: 0; padding-left: 18px; }
.result-notices__body li + li { margin-top: 6px; }
.result-notices__body small { display: block; margin-top: 8px; color: #64748b; }
.calculator-page .calc-selection.panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 7px 14px;
}
.calculator-page .calc-selection .ops-section-head { display: flex; align-items: center; gap: 16px; min-height: 0; margin: 0; padding: 0; border: 0; }
.calculator-page .calc-selection h2 { margin: 0; font-size: 14px; white-space: nowrap; }
.calculator-page .calc-selection small { margin: 0; color: #64748b; font-size: 12px; }
.calculator-page .calc-selection .segmented-control button { min-height: 32px; }

/* Results workspaces keep their filters in the document flow on desktop. */
@media (min-width: 901px) {
  .app-shell .calculator-page,
  .app-shell .podsort-page,
  .app-shell .ops-page:has(> .ops-filter-panel .rnp-filters) {
    box-sizing: border-box;
    padding-right: 0 !important;
  }

  .app-shell.app-shell .calculator-page > .calc-scope,
  .app-shell.app-shell .podsort-page > .ops-filter-panel,
  .app-shell.app-shell .ops-page:has(> .ops-filter-panel .rnp-filters) > .ops-filter-panel {
    position: static !important;
    z-index: auto !important;
    inset: auto !important;
    box-sizing: border-box;
    width: 100% !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    overflow: visible !important;
    scrollbar-gutter: auto !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    transform: none !important;
    clip-path: none !important;
    transition: none !important;
    will-change: auto !important;
    pointer-events: auto !important;
  }

  .app-shell .calculator-page > .calc-scope::after,
  .app-shell .podsort-page > .ops-filter-panel::after,
  .app-shell .ops-page:has(> .ops-filter-panel .rnp-filters) > .ops-filter-panel::after {
    content: none !important;
    display: none !important;
  }

  .app-shell .calculator-page > .calc-scope .calc-main-fields > .ops-field:first-child,
  .app-shell .podsort-page > .ops-filter-panel .podsort-filters > .ops-field:nth-child(2),
  .app-shell .ops-page:has(> .ops-filter-panel .rnp-filters) > .ops-filter-panel .rnp-filters > .ops-field:first-child {
    grid-column: auto !important;
  }
  .app-shell .calculator-page > .calc-scope .advanced-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .app-shell .calculator-page > .calc-scope .file-inputs { flex-direction: row; }
  .app-shell .calculator-page > .calc-scope .file-inputs label { width: 240px; }

  .app-shell:has(.calculator-page) .filter-dock-toggle,
  .app-shell:has(.podsort-page) .filter-dock-toggle,
  .app-shell:has(.ops-page > .ops-filter-panel .rnp-filters) .filter-dock-toggle {
    display: none;
  }

  body.sphere-table-fullscreen .app-shell:has(.calculator-page) .table-viewport.is-fullscreen,
  body.sphere-table-fullscreen .app-shell:has(.podsort-page) .table-viewport.is-fullscreen,
  body.sphere-table-fullscreen .app-shell:has(.ops-page > .ops-filter-panel .rnp-filters) .table-viewport.is-fullscreen {
    right: 0;
  }
}
@media (min-width: 1700px) {
  .calculator-page, .podsort-page { gap: 10px; }
  .calculator-page .page-header, .podsort-page .page-header { margin-bottom: 2px; }
  .calculator-page .page-header p, .podsort-page .page-header p { margin-bottom: 0; }
  .calculator-page .calc-scope, .podsort-page > .ops-filter-panel { padding-top: 12px; padding-bottom: 0; }
  .calculator-page .calc-main-fields, .podsort-page .podsort-filters { gap: 8px 12px; }
  .calculator-page .calc-scope-footer, .podsort-page .ops-filter-footer { min-height: 44px; }
  .calculator-page .calc-selection.panel { min-height: 42px; }
  .podsort-stale-option { padding-top: 6px; padding-bottom: 6px; }
  .calculator-page .calc-workspace, .podsort-page .podsort-workspace { margin-top: 0; }
}
@media (max-width: 700px) {
  .calculator-page .result-notices, .podsort-page .result-notices { gap: 7px 14px; }
  .result-notices__body { position: static; width: min(100%, calc(100vw - 48px)); max-height: 52vh; margin-top: 8px; }
  .result-notices__detail[open] { flex-basis: 100%; }
  .calculator-page .calc-selection.panel, .calculator-page .calc-selection .ops-section-head { align-items: flex-start; }
  .calculator-page .calc-selection .ops-section-head { flex-wrap: wrap; gap: 7px 12px; }
}

/* Dense report controls; all rules stay inside RNP. */
.app-shell .rnp-page { gap: 12px; }
.rnp-page > .page-header { display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: 12px 24px; margin: 0 0 10px; padding: 0; min-height: 0; }
.rnp-page > .page-header > div:first-child { display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 16px; row-gap: 2px; }
.rnp-page > .page-header .eyebrow { grid-column: 2; grid-row: 1; margin: 0; font-size: 11px; }
.rnp-page > .page-header h1 { grid-column: 1; grid-row: 1 / 3; margin: 0; font-size: 28px; line-height: 1.1; }
.rnp-page > .page-header p:not(.eyebrow) { grid-column: 2; margin: 0; max-width: 510px; font-size: 12px; line-height: 1.35; }
.rnp-page > .page-header .page-actions { margin: 0; }
.rnp-page .rnp-report-switch .button { min-height: 36px; padding: 8px 12px; }
.app-shell .rnp-page > .rnp-visible-filters { padding: 12px 16px; overflow: visible; }
.rnp-page .rnp-filters { display: flex !important; flex-wrap: wrap !important; align-items: end; gap: 10px 12px; }
.rnp-page .rnp-filters > .ops-field { flex: 1 1 210px; min-width: 0; }
.rnp-page .rnp-filters > .ops-field:nth-child(-n+2) { flex: 0 1 154px; }
.rnp-page .rnp-filters input[type=date] { min-width: 0; width: 100%; }
.rnp-page .rnp-filter-tools { display: flex; flex: 1 1 360px; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 10px 12px; min-width: 0; }
.rnp-page .rnp-filter-tools .economics-quick-ranges { margin: 0; flex: 0 0 auto; }
.rnp-page .rnp-filter-tools .filter-data-status { margin: 0 0 0 auto; white-space: normal; font-size: 11px; }
.rnp-page .rnp-filter-tools .metric-picker-wrap { flex: 0 0 auto; }
.rnp-page .rnp-filter-tools .metric-picker { right: 0 !important; left: auto !important; }
.rnp-page .rnp-filter-tools .sphere-rnp-status {
  display: inline-flex; flex: 0 0 144px; box-sizing: border-box; width: 144px;
  min-height: 36px; margin: 0; padding: 5px 8px; gap: 6px;
  border: 1px solid #d5e8e2; border-radius: 6px; background: #f5faf8;
  white-space: normal; font-size: 10px; line-height: 1.3;
}
.rnp-page .sphere-rnp-status > svg { flex: 0 0 12px; width: 12px; height: 12px; }
.rnp-page .rnp-status-copy { display: grid; gap: 1px; min-width: 0; }
.rnp-page .rnp-status-label { font-weight: 600; }
.rnp-page .rnp-status-detail { white-space: nowrap; }
@media (min-width: 1200px) {
  .app-shell .rnp-page > .rnp-visible-filters { padding: 12px; }
  .rnp-page .rnp-filters { flex-wrap: nowrap !important; gap: 8px; padding: 0; }
  .rnp-page .rnp-filters > .ops-field { flex: 1 1 140px; }
  .rnp-page .rnp-filters > .ops-field:nth-child(-n+2) { flex: 0 0 128px; }
  .rnp-page .rnp-filters > .ops-field:nth-child(4) { flex-basis: 170px; }
  .rnp-page .rnp-filter-tools { display: contents; }
  .rnp-page .rnp-filter-tools .economics-quick-ranges { display: flex; flex-wrap: nowrap; gap: 4px; }
  .rnp-page .rnp-filter-tools .metric-picker-wrap { margin: 0; }
  .rnp-page .rnp-filter-tools .button { min-height: 34px; padding: 7px 10px; white-space: nowrap; }
  .rnp-page .rnp-filter-tools .filter-data-status { margin: 0; font-size: 10px; }
}
@media (max-width: 900px) {
  .rnp-page .rnp-filter-tools .metric-picker { left: 16px !important; right: 16px !important; width: auto; }
}
.rnp-page .rnp-visible-filters .internal-api-error { margin-top: 8px; }
.rnp-page .metric-chip-row { margin: 0; gap: 5px; }
.rnp-page .ops-chart-panel > .ops-section-head { padding: 12px 16px; gap: 12px; flex-wrap: wrap; }
.rnp-page .rnp-chart-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.rnp-page .rnp-chart-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 10px; font-size: 12px; }
.rnp-page .rnp-chart-toggle svg { width: 16px; height: 16px; }
.rnp-page #rnp-chart-body[hidden] { display: none; }
.rnp-page .ops-table-panel > .ops-section-head { padding: 12px 16px; }
.rnp-page .rnp-table-viewport > .table-column-toolbar:has(.rnp-matrix-heading) {
  min-height: 52px; padding: 10px 16px; background: #fff;
}
.rnp-page .rnp-matrix-heading { min-width: 0; margin-right: auto; }
.rnp-page .rnp-matrix-heading h2 { margin: 0; font-size: 12px; line-height: 1.3; }
.rnp-page .rnp-matrix-heading p { margin: 3px 0 0; font-size: 9px; line-height: 1.3; color: #748198; }
.rnp-page .rnp-matrix-heading ~ .table-fullscreen-trigger { flex-shrink: 0; }
.rnp-page .rnp-matrix-table td:not(.rnp-sticky-photo):not(.rnp-sticky-product):not(.rnp-metric-cell):not(.rnp-spark-cell),
.rnp-page .rnp-daily-table td,
.rnp-page .rnp-daily-table tfoot th { font-size: 14px; line-height: 1.4; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rnp-page .rnp-matrix-table td:not([class]),
.rnp-page .rnp-matrix-table td.heat-soft,
.rnp-page .rnp-matrix-table td.negative { min-width: 92px; padding: 8px 10px; }
.rnp-page .rnp-matrix-table th, .rnp-page .rnp-daily-table thead th { font-size: 12px; }
.rnp-page .rnp-matrix-table .table-sort-trigger { font-size: inherit; }
.rnp-page .rnp-current-stock b { font-size: 14px; }
.rnp-page .rnp-current-stock small, .rnp-page .rnp-sticky-product .mono { font-size: 12px; }
.rnp-page .rnp-metric-cell { font-size: 12px; white-space: normal; }
@media (max-width: 700px) {
  .rnp-page > .page-header { gap: 10px; }
  .rnp-page > .page-header > div:first-child { column-gap: 12px; }
  .rnp-page > .page-header p:not(.eyebrow) { max-width: 280px; }
  .rnp-page .rnp-filters > .ops-field:nth-child(-n+2) { flex: 1 1 130px; }
  .rnp-page .rnp-filter-tools { flex-basis: 100%; }
  .rnp-page .rnp-filter-tools .filter-data-status { flex-basis: 100%; margin-left: 0; }
}

/* Product identity uses the row group's available height instead of ellipsis. */
.rnp-page .rnp-matrix-table .rnp-sticky-product > b,
.rnp-page .rnp-matrix-table .rnp-sticky-product > small {
  display: block; max-width: 100% !important; white-space: normal;
  overflow: visible; text-overflow: clip; overflow-wrap: anywhere;
}
.rnp-page .rnp-matrix-table .rnp-sticky-product > b {
  margin-bottom: 6px; font-size: 13px; line-height: 1.4; color: #475569;
}
.rnp-page .rnp-matrix-table .rnp-sticky-product > small:not(.mono) {
  font-size: 14px; line-height: 1.45; color: #1e293b; text-wrap: pretty;
}
.rnp-page .rnp-matrix-table .rnp-sticky-product > small.mono {
  margin-top: 8px; font-size: 13px; line-height: 1.4; color: #64748b;
}
@media (min-width: 1200px) {
  .rnp-page .rnp-filters > .ops-field:nth-child(3) { max-width: 320px; }
  .rnp-page .rnp-filters > .ops-field:nth-child(4) { max-width: 300px; }
}


/* Fit the matrix to its viewport. Rowspan cells must be styled by class,
   not their DOM index, because later metric rows omit the identity cells. */
.rnp-page .rnp-table-viewport > .ops-table-scroll {
  overflow: auto; scrollbar-gutter: stable;
}
.rnp-page .rnp-matrix-table {
  table-layout: fixed; width: 100%; min-width: 900px;
}
.rnp-page .rnp-matrix-table th,
.rnp-page .rnp-matrix-table td {
  box-sizing: border-box; min-width: 0 !important; max-width: none !important;
  width: auto; padding: 7px 4px; white-space: normal !important;
  overflow-wrap: anywhere;
}
.rnp-page .rnp-matrix-table th:first-child,
.rnp-page .rnp-matrix-table td.rnp-sticky-photo {
  width: 36px !important; padding-left: 3px !important; padding-right: 3px !important;
}
.rnp-page .rnp-matrix-table th:nth-child(2),
.rnp-page .rnp-matrix-table td.rnp-sticky-product {
  width: 140px !important; left: 36px !important;
  padding-left: 6px !important; padding-right: 6px !important;
}
.rnp-page .rnp-matrix-table .rnp-metric-head,
.rnp-page .rnp-matrix-table .rnp-metric-cell {
  width: 82px !important; left: 176px !important; padding: 7px 4px;
}
.rnp-page .rnp-matrix-table .rnp-spark-head,
.rnp-page .rnp-matrix-table .rnp-spark-cell { width: 72px !important; }
.rnp-page .rnp-matrix-table .metric-spark { width: 100%; max-width: 64px; gap: 1px; }
.rnp-page .rnp-matrix-table thead th:nth-last-child(3) { width: 88px; }
.rnp-page .rnp-matrix-table thead th:nth-last-child(2) { width: 72px; }
.rnp-page .rnp-matrix-table thead th:last-child { width: 64px; }
.rnp-page .rnp-matrix-table td:not(.rnp-sticky-photo):not(.rnp-sticky-product):not(.rnp-metric-cell):not(.rnp-spark-cell) {
  min-width: 0; padding: 7px 4px; white-space: normal;
}
.rnp-page .rnp-matrix-table .table-sort-trigger {
  padding: 5px 2px; gap: 2px; flex-wrap: wrap;
}
.rnp-page .rnp-matrix-table .table-sort-trigger > span { min-width: 0; }
.rnp-page .rnp-matrix-table thead th { font-size: 10px; overflow-wrap: normal; }
.rnp-page .rnp-matrix-table .table-sort-trigger > span { white-space: normal; overflow-wrap: anywhere; flex: 0 0 auto; max-width: 100%; }
.rnp-page .rnp-matrix-table thead th:nth-child(n+5):nth-last-child(n+4) .table-sort-trigger > span { white-space: nowrap; }
.rnp-page .rnp-matrix-table .rnp-current-stock small {
  max-width: 100%; white-space: normal; overflow-wrap: anywhere;
}

.rnp-page .rnp-matrix-table .rnp-number {
  display: inline-block; white-space: nowrap; font-size: 12px;
  font-variant-numeric: tabular-nums; line-height: 1.4;
}
.rnp-page .rnp-matrix-table td:not(.rnp-sticky-photo):not(.rnp-sticky-product):not(.rnp-metric-cell):not(.rnp-spark-cell) {
  padding-left: 1px; padding-right: 1px; text-align: right;
}
.rnp-page .rnp-matrix-table tbody td,
.rnp-page .rnp-matrix-table tbody td:not(.rnp-sticky-photo):not(.rnp-sticky-product):not(.rnp-metric-cell):not(.rnp-spark-cell),
.rnp-page .rnp-matrix-table .rnp-sticky-product > b,
.rnp-page .rnp-matrix-table .rnp-sticky-product > small,
.rnp-page .rnp-matrix-table .rnp-sticky-product > small:not(.mono),
.rnp-page .rnp-matrix-table .rnp-sticky-product > small.mono,
.rnp-page .rnp-matrix-table .rnp-current-stock small,
.rnp-page .rnp-daily-table td,
.rnp-page .rnp-daily-table tfoot th { font-size: 12px; }
