/* Three-carrier monthly reconciliation workspace — presentation only. */
.monthlyDutyPanel { min-width: 0; max-width: 100%; padding: 20px 0; }
.monthlyDutyPanel[hidden] { display: none !important; }
.monthlyDutyHead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.monthlyDutyHead h2 { margin: 0; font-size: 24px; }
.monthlyDutyHead p { margin: 5px 0 0; color: #64748b; font-size: 13px; }
.monthlyDutyFilters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; background: #fff; border: 1px solid #dbe4f0; border-radius: 12px; padding: 16px; }
.monthlyDutyFilters .field { min-width: 0; }
.monthlyDutyFilters label { display: block; font-size: 12px; margin-bottom: 5px; color: #64748b; }
.monthlyDutyFilters input, .monthlyDutyFilters select { box-sizing: border-box; min-width: 0; width: 100%; height: 36px; border: 1px solid #c8d7ea; border-radius: 6px; padding: 0 8px; background: #fff; }
.monthlyDutySourceField { grid-column: span 2; }
.monthlyDutyActions { display: flex; gap: 8px; align-items: end; }
#monthlyDutyMessage { margin: 12px 0; overflow-wrap: anywhere; }
.monthlyDutyKpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.monthlyDutyKpis > div { min-width: 0; border: 1px solid #dbe4f0; border-radius: 10px; padding: 14px; background: #fff; }
.monthlyDutyKpis span { display: block; color: #64748b; font-size: 12px; }
.monthlyDutyKpis b { display: block; margin-top: 8px; font-size: 23px; overflow-wrap: anywhere; color: #10244a; }
#monthlyDutyGroups { display: grid; min-width: 0; gap: 16px; }
.monthlyDutySourceGroup { min-width: 0; max-width: 100%; border: 1px solid #dbe4f0; border-radius: 10px; background: #fff; overflow: hidden; }
.monthlyDutySourceHead { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 13px 16px; }
.monthlyDutySourceHead h3 { min-width: 0; margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.monthlyDutySourceHead span { font-size: 12px; color: #64748b; }
.monthlyDutyTableWrap { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.monthlyDutyTableWrap table { border-collapse: collapse; width: 100%; min-width: 1450px; }
.monthlyDutyTableWrap th, .monthlyDutyTableWrap td { padding: 10px 12px; white-space: nowrap; border-top: 1px solid #e7edf5; font-size: 12px; text-align: left; }
.monthlyDutyTableWrap th { background: #f6f8fc; color: #64748b; }
.monthlyDutyTableWrap .num { text-align: right; font-variant-numeric: tabular-nums; }
.monthlyDutyPager { display: flex; justify-content: end; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.monthlyDutyPager[hidden] { display: none; }
@media (max-width: 980px) { .monthlyDutyFilters { grid-template-columns: repeat(2, minmax(0, 1fr)); } .monthlyDutyKpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .monthlyDutyPanel { padding: 12px 0; } .monthlyDutyFilters { padding: 12px; grid-template-columns: minmax(0, 1fr); } .monthlyDutySourceField { grid-column: auto; } .monthlyDutyKpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .monthlyDutyKpis b { font-size: 20px; } .monthlyDutyHead { flex-wrap: wrap; } }

body.monthly-reconcile-active {
  --freight-sidebar-width: 210px;
  --mr-ink: #10244a;
  --mr-muted: #64748b;
  --mr-line: #dbe4f0;
  --mr-soft: #f6f8fc;
  --mr-blue: #0758d5;
  --mr-blue-dark: #083c92;
  --mr-green: #17a85b;
  --mr-orange: #e77613;
  --mr-red: #dc3b3b;
  background: #f2f5fa;
  color: var(--mr-ink);
}

body.monthly-reconcile-active .app {
  grid-template-columns: 210px minmax(0, 1fr);
}

body.monthly-reconcile-active .sidebar {
  background: linear-gradient(180deg, #061a3a 0%, #062759 100%);
  box-shadow: 2px 0 14px rgba(15, 23, 42, .12);
}

body.monthly-reconcile-active .main {
  min-width: 0;
  overflow-x: hidden;
  padding: 0 14px 28px;
  background: #f2f5fa;
}

body.monthly-reconcile-active #workspaceTabsShell {
  display: none !important;
}

.monthlyLegacyWorkspace[hidden],
.monthlyWorkspace[hidden],
.monthlyWorkspaceModal[hidden] {
  display: none !important;
}

body.monthly-reconcile-active #navUpsBill[hidden] { display: none !important; }

.monthlyWorkspace {
  width: min(100%, 1540px);
  min-width: 0;
  margin: 0 auto;
  color: var(--mr-ink, #10244a);
  font-size: 13px;
}

.monthlyWorkspace *,
.monthlyWorkspaceModal * {
  box-sizing: border-box;
}

.monthlyWorkspaceTopbar {
  min-height: 62px;
  margin: 0 -14px 14px;
  padding: 0 18px;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 24px;
  background: #fff;
  border-bottom: 1px solid var(--mr-line);
}

.monthlyCarrierTabs {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.monthlyWorkspaceTabCluster { display: flex; min-width: 0; align-items: stretch; }
.monthlyMobileNavToggle { display: none; }

.monthlyCarrierTab {
  position: relative;
  min-width: 116px;
  padding: 0 20px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #172033;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.monthlyCarrierTab::after {
  content: "";
  position: absolute;
  right: 20px;
  bottom: 0;
  left: 20px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: transparent;
}

.monthlyCarrierTab:hover,
.monthlyCarrierTab:focus-visible,
.monthlyCarrierTab.active {
  color: var(--mr-blue);
  background: #f8fbff;
}

.monthlyCarrierTab.active::after {
  background: var(--mr-blue);
}

.monthlyWorkspaceContext {
  display: flex;
  align-items: center;
  gap: 18px;
  white-space: nowrap;
  color: #516079;
  font-size: 12px;
}

.monthlyWorkspaceContext span:first-child {
  padding: 8px 12px;
  border: 1px solid var(--mr-line);
  border-radius: 5px;
  background: #f7f9fc;
}

.monthlyWorkspaceContext b {
  color: #273750;
}

.monthlyWorkspaceFilter,
.monthlyWorkspacePanel,
.monthlyWorkspaceKpi,
.monthlyWorkspaceMore {
  border: 1px solid var(--mr-line);
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 45, 90, .035);
}

.monthlyWorkspaceFilter {
  position: relative;
  margin-bottom: 12px;
  padding: 13px 14px 10px;
  border-radius: 8px;
}

.monthlyWorkspaceFilterGrid {
  display: grid;
  grid-template-columns: minmax(145px, .85fr) minmax(220px, 1.45fr) minmax(145px, .9fr) minmax(145px, .9fr) minmax(230px, 1.4fr) 92px;
  align-items: end;
  gap: 10px;
}

.monthlyWorkspaceField {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.monthlyWorkspaceField > span {
  color: #52627c;
  font-size: 12px;
  font-weight: 700;
}

.monthlyWorkspaceField input,
.monthlyWorkspaceField select,
.monthlyWorkspacePager select,
.monthlyWorkspacePager input,
.monthlyWorkspace button,
.monthlyWorkspaceModal button {
  font: inherit;
}

.monthlyWorkspaceField input,
.monthlyWorkspaceField select {
  width: 100%;
  height: 38px;
  min-width: 0;
  padding: 0 11px;
  border: 1px solid #d6dfeb;
  border-radius: 5px;
  outline: 0;
  background: #fff;
  color: #23334f;
}

.monthlyWorkspaceField input:focus,
.monthlyWorkspaceField select:focus,
.monthlyWorkspacePager input:focus,
.monthlyWorkspacePager select:focus {
  border-color: #78a5f3;
  box-shadow: 0 0 0 3px rgba(7, 88, 213, .1);
}

.monthlyWorkspacePrimary,
.monthlyWorkspaceActions button,
.monthlyWorkspacePager button,
.monthlyWorkspaceView {
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid #8fb3ef;
  border-radius: 5px;
  background: #fff;
  color: var(--mr-blue);
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
}

.monthlyWorkspaceFilterGrid > .monthlyWorkspacePrimary,
.monthlyWorkspaceActions .monthlyWorkspacePrimary {
  border-color: var(--mr-blue);
  background: linear-gradient(180deg, #0961e4, #064fc7);
  color: #fff;
  box-shadow: 0 3px 8px rgba(7, 88, 213, .16);
}

.monthlyWorkspace button:hover:not(:disabled),
.monthlyWorkspaceModal button:hover:not(:disabled) {
  border-color: var(--mr-blue);
  background-color: #edf5ff;
}

.monthlyWorkspaceFilterGrid > .monthlyWorkspacePrimary:hover,
.monthlyWorkspaceActions .monthlyWorkspacePrimary:hover {
  background: var(--mr-blue-dark);
  color: #fff;
}

.monthlyWorkspace button:focus-visible,
.monthlyWorkspaceModal button:focus-visible,
.monthlyWorkspace summary:focus-visible {
  outline: 3px solid rgba(7, 88, 213, .22);
  outline-offset: 2px;
}

.monthlyWorkspaceActions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.monthlyWorkspaceMessage {
  position: absolute;
  left: 14px;
  bottom: 14px;
  max-width: 410px;
  min-height: 0;
  margin: 0;
  color: var(--mr-muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.monthlyWorkspace.loading .monthlyWorkspaceFilter::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--mr-blue) 40%, transparent 75%);
  background-size: 200% 100%;
  animation: monthlyWorkspaceLoading 1s linear infinite;
}

@keyframes monthlyWorkspaceLoading {
  to { background-position: -200% 0; }
}

.monthlyWorkspaceKpis {
  display: grid;
  grid-template-columns: 1.25fr repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.monthlyWorkspaceKpi {
  min-width: 0;
  min-height: 146px;
  padding: 14px 15px 12px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.monthlyWorkspaceCompletionCard {
  justify-content: flex-start;
}

.monthlyWorkspaceKpiLabel {
  margin-bottom: 12px;
  color: #233b66;
  font-weight: 800;
  font-size: 14px;
}

.monthlyWorkspaceCompletionCard .monthlyWorkspaceKpiLabel {
  margin-bottom: 12px;
}

.monthlyWorkspaceKpiCaption {
  color: #5b6a83;
  font-size: 12px;
}

.monthlyWorkspaceKpi > strong {
  max-width: 100%;
  color: #0737a5;
  font-size: clamp(22px, 1.7vw, 28px);
  line-height: 1.15;
  letter-spacing: -.035em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.monthlyWorkspaceCompletionCard > strong {
  margin-top: 2px;
  color: #0b285c;
  font-size: clamp(34px, 3vw, 43px);
}

.monthlyWorkspaceKpi > strong span {
  padding-left: 2px;
  font-size: .53em;
  letter-spacing: 0;
}

.monthlyWorkspaceKpi p {
  min-height: 18px;
  margin: 9px 0 0;
  color: var(--mr-muted);
  font-size: 12px;
  line-height: 1.45;
}

.monthlyWorkspaceWarningKpi > strong { color: var(--mr-orange); }
.monthlyWorkspacePendingKpi > strong { color: #15264a; text-align: center; }
.monthlyWorkspacePendingKpi .monthlyWorkspaceKpiLabel,
.monthlyWorkspacePendingKpi p { text-align: left; }

.monthlyWorkspaceProgress {
  width: 100%;
  height: 8px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: #edf1f6;
}

.monthlyWorkspaceProgress > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--mr-green);
  transition: width .25s ease;
}

.monthlyWorkspaceInsights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.monthlyWorkspacePanel {
  min-width: 0;
  border-radius: 8px;
}

.monthlyWorkspacePanelHead {
  min-height: 44px;
  padding: 10px 14px 7px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.monthlyWorkspacePanelHead h3 {
  margin: 0;
  color: #142951;
  font-size: 15px;
  line-height: 1.2;
}

.monthlyWorkspacePanelHead p {
  margin: 3px 0 0;
  color: var(--mr-muted);
  font-size: 11px;
  line-height: 1.2;
}

.monthlyWorkspaceBillCards {
  min-height: 92px;
  padding: 0 10px 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.monthlyWorkspaceBillCard {
  min-width: 0;
  padding: 6px 14px;
  display: grid;
  justify-items: center;
  gap: 4px;
  border: 0;
  border-right: 1px solid #e4eaf2;
  border-radius: 0;
  background: transparent;
  color: #52627c;
  cursor: pointer;
}

.monthlyWorkspaceBillCard:last-child { border-right: 0; }
.monthlyWorkspaceBillCard.selected { background: #f7faff; }
.monthlyWorkspaceBillCard:not(.selected) { opacity: .65; }
.monthlyWorkspaceBillCard .monthlyWorkspaceBillAccount { width: 100%; font-weight: 800; color: #253750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.monthlyWorkspaceBillCard strong { max-width: 100%; color: #102d65; font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.monthlyWorkspaceBillCard span { font-size: 11px; }
.monthlyWorkspaceBillCard small { width: 100%; color: #758197; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.monthlyWorkspaceIssues {
  min-height: 92px;
  padding: 6px 10px 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.monthlyWorkspaceIssues > div,
.monthlyWorkspaceIssues > button {
  min-width: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 11px;
  border-right: 1px solid #e4eaf2;
}

.monthlyWorkspaceIssues > div:last-child,
.monthlyWorkspaceIssues > button:last-child { border-right: 0; }
.monthlyWorkspaceIssue {
  appearance: none;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease;
}
.monthlyWorkspaceIssue:hover,
.monthlyWorkspaceIssue:focus-visible { background: #f4f8fd; outline: none; }
.monthlyWorkspaceIssue.active { background: #edf4ff; box-shadow: inset 0 -3px 0 #2f6fde; }
.monthlyWorkspaceIssues span { color: #4c5d78; font-size: 12px; }
.monthlyWorkspaceIssues strong { color: var(--mr-red); font-size: 26px; font-variant-numeric: tabular-nums; }
.monthlyWorkspaceIssues em { margin-left: 3px; font-size: 12px; font-style: normal; }

.monthlyWorkspaceTablePanel { overflow: hidden; }
.monthlyWorkspaceTableHead { border-bottom: 1px solid var(--mr-line); }
.monthlyWorkspaceTableHead > span { color: #576781; font-weight: 700; }
.monthlyWorkspaceTableScroll { width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.monthlyWorkspaceTable { width: 100%; min-width: 1320px; border-collapse: collapse; table-layout: fixed; color: #34435c; font-size: 11px; }
.monthlyWorkspaceTable th,
.monthlyWorkspaceTable td { height: 29px; padding: 3px 9px; border-right: 1px solid #e5ebf3; border-bottom: 1px solid #e5ebf3; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.monthlyWorkspaceTable th { height: 32px; background: #f5f8fc; color: #43536e; font-weight: 800; }
.monthlyWorkspaceTable th:nth-child(1) { width: 145px; }
.monthlyWorkspaceTable th:nth-child(2),
.monthlyWorkspaceTable th:nth-child(3) { width: 126px; }
.monthlyWorkspaceTable th:nth-child(4) { width: 130px; }
.monthlyWorkspaceTable th:nth-child(5),
.monthlyWorkspaceTable th:nth-child(6) { width: 105px; }
.monthlyWorkspaceTable th:nth-child(n+7):nth-child(-n+11) { width: 112px; }
.monthlyWorkspaceTable th:nth-child(12) { width: 100px; }
.monthlyWorkspaceTable th:last-child,
.monthlyWorkspaceTable td:last-child { width: 74px; position: sticky; right: 0; border-right: 0; background: #fff; box-shadow: -7px 0 10px rgba(32, 61, 102, .05); }
.monthlyWorkspaceTable th:last-child { background: #f5f8fc; }
.monthlyWorkspaceTable tbody tr:hover td { background-color: #f8fbff; }
.monthlyWorkspaceTable .tracking { color: #153d89; font-weight: 700; }
.monthlyWorkspaceTable .num { text-align: right; font-variant-numeric: tabular-nums; }
.monthlyWorkspaceTable .danger { color: var(--mr-red); font-weight: 800; }

.monthlyWorkspaceStatus { display: inline-flex; min-height: 20px; padding: 2px 8px; align-items: center; border-radius: 99px; font-weight: 700; }
.monthlyWorkspaceStatus.ok { background: #e7f7ee; color: #14723e; }
.monthlyWorkspaceStatus.pending { background: #fff5da; color: #8a5b00; }
.monthlyWorkspaceStatus.bad { background: #ffeded; color: #b52c2c; }
.monthlyWorkspaceView { min-height: 22px; padding: 0 8px; font-size: 11px; }

.monthlyWorkspaceEmpty { grid-column: 1 / -1; padding: 28px 16px; text-align: center; color: var(--mr-muted); }

.monthlyWorkspacePager {
  min-height: 50px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #52617b;
  font-size: 12px;
}

.monthlyWorkspacePagerActions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.monthlyWorkspacePagerActions label { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.monthlyWorkspacePager select,
.monthlyWorkspacePager input { height: 32px; border: 1px solid #d7e0ec; border-radius: 5px; background: #fff; color: #31405a; }
.monthlyWorkspacePager select { padding: 0 8px; }
.monthlyWorkspacePager input { width: 55px; padding: 0 7px; text-align: center; }
.monthlyWorkspacePager button { min-width: 34px; min-height: 32px; padding: 0 10px; border-color: #d7e0ec; color: #4a5b76; }
.monthlyWorkspacePager button.active { border-color: var(--mr-blue); background: var(--mr-blue); color: #fff; }
.monthlyWorkspacePager button:disabled { opacity: .4; cursor: not-allowed; }

.monthlyWorkspaceMore { margin-top: 12px; border-radius: 8px; }
.monthlyWorkspaceMore > summary { padding: 13px 15px; color: #344661; font-weight: 800; cursor: pointer; }
#monthlyWorkspaceMoreHost { padding: 0 12px 12px; }

.monthlyWorkspaceModal {
  position: fixed;
  z-index: 1200;
  inset: 0;
  padding: 24px;
  display: grid;
  place-items: center;
  background: rgba(8, 24, 49, .46);
  backdrop-filter: blur(2px);
}

.monthlyWorkspaceModalBox {
  width: min(560px, 100%);
  max-height: min(720px, 90vh);
  overflow: auto;
  border: 1px solid #d9e2ee;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 26px 60px rgba(9, 32, 72, .25);
}

.monthlyWorkspaceModalHead { padding: 18px 20px 14px; display: flex; justify-content: space-between; gap: 16px; border-bottom: 1px solid #e4eaf2; }
.monthlyWorkspaceModalHead h3 { margin: 0; color: #142951; font-size: 18px; }
.monthlyWorkspaceModalHead p { margin: 5px 0 0; color: #6a778c; font-size: 12px; }
.monthlyWorkspaceModalHead button { min-width: 58px; height: 34px; border: 1px solid #d7e0ec; border-radius: 5px; background: #fff; color: #43536e; cursor: pointer; }
.monthlyWorkspaceImportFields { padding: 18px 20px 6px; display: grid; gap: 14px; }
.monthlyWorkspaceImportFields .field { display: grid !important; gap: 7px; }
.monthlyWorkspaceImportFields label { color: #52627c; font-size: 12px; font-weight: 700; }
.monthlyWorkspaceImportFields .filePicker { width: 100%; min-height: 48px; }
.monthlyWorkspaceImportStatus { min-height: 20px; margin: 8px 20px 0; color: #516079; font-size: 12px; line-height: 1.55; }
.monthlyWorkspaceImportAction { padding: 14px 20px 20px; display: flex; justify-content: flex-end; }
.monthlyWorkspaceImportAction button { min-width: 118px; height: 38px; border: 1px solid var(--mr-blue, #0758d5); border-radius: 5px; background: var(--mr-blue, #0758d5); color: #fff; font-weight: 800; cursor: pointer; }
.monthlyWorkspaceImportAction button:disabled { cursor: wait; opacity: .62; }
body.monthly-modal-open { overflow: hidden; }

@media (max-width: 1180px) {
  .monthlyWorkspaceFilterGrid { grid-template-columns: minmax(140px, 1fr) minmax(210px, 1.4fr) minmax(140px, 1fr) minmax(140px, 1fr) minmax(210px, 1.35fr) 86px; overflow-x: auto; padding-bottom: 4px; }
  .monthlyWorkspaceFilterGrid > * { min-width: 140px; }
  .monthlyWorkspaceFilterGrid > .monthlyWorkspaceAccountField { min-width: 220px; }
  .monthlyWorkspaceFilterGrid > .monthlyWorkspaceKeywordField { min-width: 220px; }
  .monthlyWorkspaceFilterGrid > button { min-width: 86px; }
}

@media (max-width: 1024px) {
  body.monthly-reconcile-active .app { grid-template-columns: var(--freight-sidebar-width) minmax(0, 1fr) !important; }
  .monthlyWorkspaceKpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .monthlyWorkspaceCompletionCard { grid-column: 1 / -1; }
  .monthlyWorkspaceInsights { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  body.monthly-reconcile-active .app { grid-template-columns: 1fr !important; }
  body.monthly-reconcile-active .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 950;
    width: min(300px, 84vw);
    min-width: 0;
    height: 100vh;
    overflow-y: auto;
    transform: translateX(-102%);
    transition: transform .2s ease;
  }
  body.monthly-reconcile-active.monthly-mobile-nav-open .sidebar { transform: translateX(0); }
  body.monthly-reconcile-active .main { width: 100%; }
  .monthlyMobileNavToggle {
    min-width: 58px;
    margin: 9px 8px 9px 0;
    padding: 0 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #9db8e4;
    border-radius: 5px;
    background: #fff;
    color: var(--mr-blue);
    font-weight: 800;
  }
}

@media (max-width: 820px) {
  .monthlyWorkspaceTopbar { min-height: 0; padding: 8px 12px; flex-direction: column; gap: 7px; }
  .monthlyWorkspaceTabCluster { width: 100%; }
  .monthlyCarrierTabs { min-height: 44px; overflow-x: auto; }
  .monthlyCarrierTab { min-width: 108px; padding: 0 12px; }
  .monthlyWorkspaceContext { width: 100%; justify-content: space-between; overflow-x: auto; }
  .monthlyWorkspaceFilterGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
  .monthlyWorkspaceFilterGrid > * { min-width: 0; }
  .monthlyWorkspaceAccountField,
  .monthlyWorkspaceKeywordField { grid-column: span 2; }
  .monthlyWorkspaceFilterGrid > .monthlyWorkspacePrimary { grid-column: span 2; }
  .monthlyWorkspaceMessage { position: static; max-width: none; margin-top: 7px; white-space: normal; }
  .monthlyWorkspaceActions { overflow-x: auto; justify-content: flex-start; padding-bottom: 4px; }
  .monthlyWorkspaceActions button { flex: 0 0 auto; }
  .monthlyWorkspacePager { align-items: flex-start; flex-direction: column; }
  .monthlyWorkspacePagerActions { width: 100%; justify-content: flex-start; overflow-x: auto; padding-bottom: 4px; }
}

@media (max-width: 620px) {
  body.monthly-reconcile-active .main { padding-right: 8px; padding-left: 8px; }
  .monthlyWorkspaceTopbar { margin-right: -8px; margin-left: -8px; }
  .monthlyWorkspaceContext span:last-child { display: none; }
  .monthlyWorkspaceFilterGrid,
  .monthlyWorkspaceKpis { grid-template-columns: 1fr; }
  .monthlyWorkspaceAccountField,
  .monthlyWorkspaceKeywordField,
  .monthlyWorkspaceFilterGrid > .monthlyWorkspacePrimary,
  .monthlyWorkspaceCompletionCard { grid-column: auto; }
  .monthlyWorkspaceKpi { min-height: 132px; }
  .monthlyWorkspaceActions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    padding-bottom: 0;
  }
  .monthlyWorkspaceActions button { width: 100%; min-width: 0; }
  .monthlyWorkspaceBillCards { grid-template-columns: 1fr; }
  .monthlyWorkspaceBillCard { border-right: 0; border-bottom: 1px solid #e4eaf2; }
  .monthlyWorkspaceIssues { grid-template-columns: 1fr; }
  .monthlyWorkspaceIssues > div,
  .monthlyWorkspaceIssues > button { min-height: 84px; border-right: 0; border-bottom: 1px solid #e4eaf2; }
  .monthlyWorkspaceIssues > div:last-child,
  .monthlyWorkspaceIssues > button:last-child { border-bottom: 0; }
  .monthlyWorkspaceModal { padding: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .monthlyWorkspace *,
  .monthlyWorkspace *::before,
  .monthlyWorkspace *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; }
}


/* Duty import shares the established billing modal layout. */
#monthlyDutyImportModal[hidden] { display: none !important; }
#monthlyDutyImportModal input, #monthlyDutyImportModal select { min-width: 0; width: 100%; box-sizing: border-box; padding: 9px; border: 1px solid #c8d7ea; border-radius: 6px; background: #fff; }
#monthlyDutyImportModal .monthlyWorkspaceModalHead button:disabled { opacity: .5; cursor: wait; }
#monthlyDutyImportBtn { white-space: nowrap; }

.monthlyDutyTableWrap td:nth-child(8) { max-width: 300px; min-width: 100px; white-space: normal; }

/* Country-scoped factory duty comparison. */
.monthlyFactoryDutyActions { display:flex; align-items:center; flex-wrap:wrap; gap:12px; margin:16px 0; }
.monthlyFactoryDutyActions [hidden],#monthlyFactoryDutyPanel[hidden],#monthlyDutyCountryField[hidden],#monthlyDutyPayerField[hidden],#monthlyFactoryDutyModal[hidden] { display:none!important; }
.monthlyFactoryDutyPanel { padding:18px; margin:16px 0; border:1px solid #dbe5f3; border-radius:12px; background:#fff; }
.monthlyFactoryDutySummary { padding:12px 0; line-height:1.8; color:#465b78; }
#monthlyFactoryDutyModal input { width:100%; min-width:0; box-sizing:border-box; padding:9px; border:1px solid #c8d7ea; border-radius:6px; }
#monthlyFactoryDutyModal button:disabled { opacity:.5; cursor:wait; }

/* The import field grid must not override carrier-specific hidden fields. */
#monthlyDutyImportAccountField[hidden] { display: none !important; }

.monthlyOtherReviewActions{display:inline-flex;flex-wrap:wrap;gap:8px;margin-left:12px;min-width:180px;vertical-align:middle}.monthlyOtherReviewActions [role="status"]{flex-basis:100%;font-size:12px;white-space:normal}.monthlyOtherReviewActions button:disabled{opacity:.5;cursor:default}

/* Keep both duty import actions visible at the page entry. */
.monthlyDutyHeaderActions { display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
.monthlyDutyHeaderActions [hidden],#monthlyFactoryDutyTemplate[hidden] { display:none!important; }
