/* MOPMMF Dashboard — finance, cool slate/navy/teal */
:root {
  /* Surfaces — cool navy */
  --bg: #0a1626;
  --bg-elev: #0f1f33;
  --surface: #122a44;
  --surface-2: #163255;
  --border: #1f3a5c;
  --border-soft: #1a2e48;

  /* Text */
  --text: #e6ecf4;
  --text-muted: #9fb2c9;
  --text-faint: #6b7e96;

  /* Accents */
  --teal: #67e8d7; /* primary accent */
  --teal-dim: #2bb8a6;
  --teal-deep: #0f766e;
  --slate: #5b7ca4;
  --gold: #e0b341;
  --rose: #e07a8b;
  --err: #f08089;

  /* Series — cool family */
  --c1: #67e8d7;
  --c2: #4fb6d9;
  --c3: #3c7fb8;
  --c4: #2e5187;
  --c5: #6f90bd;
  --c6: #b7d6e8;
  --c7: #e0b341;
  --c8: #c26a75;

  --radius: 10px;
  --radius-sm: 6px;
  --pad: clamp(16px, 2vw, 24px);
  --maxw: 1680px;

  --font-sans: "Satoshi", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Recurring tints promoted to tokens */
  --ice: #dff9fb;
  --mist: #f4f7fb;
}

.fund-simulation-page .scenario-control-grid {
  grid-template-columns:
    minmax(110px, 1.25fr) minmax(70px, 0.75fr) minmax(105px, 1fr) minmax(105px, 1fr)
    minmax(105px, 1fr) minmax(80px, 0.75fr) !important;
  gap: 7px !important;
}

.fund-simulation-page .scenario-control-grid label:first-child {
  grid-column: 1 / -1 !important;
}

.fund-simulation-page .scenario-actions {
  grid-column: 1 / -1 !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 7px !important;
}

.added-scenario-deals {
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  background: #151820 !important;
  overflow: hidden !important;
}

.added-scenario-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-bottom: 1px solid #252a34;
}

.added-scenario-head span {
  color: #8b94a3;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.added-scenario-head small,
.empty-added-deals {
  color: #8f99a8;
  font-size: 10px;
}

.added-scenario-table-wrap {
  overflow-x: auto;
}

.added-scenario-table {
  min-width: 640px;
}

.added-scenario-table th,
.added-scenario-table td {
  padding: 7px 8px !important;
  font-size: 10px !important;
}

.added-scenario-table td:nth-child(2) {
  color: #f8fafc;
  font-weight: 800;
}

.added-scenario-table td:nth-child(6) {
  color: var(--gold);
  font-weight: 900;
}

.empty-added-deals {
  text-align: center !important;
  padding: 12px !important;
}

@media (max-width: 1400px) {
  .fund-simulation-page .scenario-control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Final readability lift: applied after all compact dashboard overrides */
body,
body.fund-simulation-page,
body.calendar-page,
body.portfolio-page,
body.rate-sheet-page {
  font-size: 14px !important;
  line-height: 1.5 !important;
}

.card-head h1,
.portfolio-only-card h1,
.editable-rate-panel h1,
.calendar-only-card h1 {
  font-size: 24px !important;
}

.card-sub,
.workbook-drop-zone small,
.workbook-upload-status {
  font-size: 12px !important;
}

.eyebrow,
.upload-kicker,
.portfolio-inline-kpis span,
.scenario-control-grid label span,
.limit-summary-table th,
.weekly-maturity-table th,
.data-table th,
.deposit-register-table th,
.added-scenario-head span {
  font-size: 10px !important;
}

.portfolio-inline-kpis article {
  min-height: 76px !important;
  padding: 15px 16px !important;
}

.portfolio-inline-kpis strong,
.scenario-result-grid strong {
  font-size: 19px !important;
}

.portfolio-inline-kpis small,
.scenario-result-grid small,
.added-scenario-head small,
.empty-added-deals {
  font-size: 11px !important;
}

.scenario-result-grid article {
  padding: 14px 15px !important;
}

.scenario-control-grid select,
.scenario-control-grid input,
.subscription-input-row select,
.editable-rate-table input,
.portfolio-mini-input,
.sim-input {
  min-height: 35px !important;
  font-size: 12px !important;
  padding: 7px 9px !important;
}

.scenario-actions button,
.week-view-button,
.calendar-link-button,
.rate-sheet-actions button {
  min-height: 34px !important;
  font-size: 12px !important;
  padding: 7px 10px !important;
}

.fund-simulation-page #applyScenarioBatch {
  justify-self: start !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  border: 1px solid rgba(86, 185, 193, 0.46) !important;
  border-radius: 999px !important;
  background: rgba(86, 185, 193, 0.12) !important;
  color: var(--ice) !important;
  font-size: 10px !important;
  font-weight: 950 !important;
  letter-spacing: 0.06em !important;
  line-height: 1.15 !important;
  text-transform: uppercase !important;
  padding: 7px 12px !important;
  box-shadow: none !important;
}

.fund-simulation-page #applyScenarioBatch:hover {
  transform: translateY(-1px) !important;
  border-color: rgba(117, 232, 239, 0.82) !important;
  background: rgba(86, 185, 193, 0.2) !important;
  color: var(--ice) !important;
}

.data-table,
.deposit-register-table,
.weekly-maturity-table,
.limit-summary-table,
.editable-rate-table {
  font-size: 12px !important;
}

.data-table th,
.deposit-register-table th,
.weekly-maturity-table th,
.limit-summary-table th,
.editable-rate-table th {
  height: 36px !important;
}

.data-table td,
.deposit-register-table td,
.weekly-maturity-table td,
.limit-summary-table td,
.editable-rate-table td {
  padding: 10px 11px !important;
}

.fund-simulation-page .weekly-maturity-table tr.weekly-month-row td {
  padding: 12px 14px !important;
  border-top: 1px solid rgba(86, 185, 193, 0.3) !important;
  border-bottom: 1px solid rgba(86, 185, 193, 0.16) !important;
  background: linear-gradient(
    90deg,
    rgba(86, 185, 193, 0.13),
    rgba(86, 185, 193, 0.035)
  ) !important;
  color: #7fd8df !important;
  font-size: 16px !important;
  font-weight: 900 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
}

.fund-simulation-page .weekly-maturity-table tr.weekly-month-row td {
  padding: 15px 14px !important;
  border-top: 1px solid rgba(253, 171, 67, 0.45) !important;
  border-bottom: 1px solid rgba(253, 171, 67, 0.28) !important;
  background: linear-gradient(90deg, rgba(253, 171, 67, 0.22), rgba(86, 185, 193, 0.1)) !important;
  color: #ffd27a !important;
  font-size: 18px !important;
  font-weight: 950 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
}

.week-date-range {
  font-size: 11px !important;
}

.week-signal-low {
  font-size: 9px !important;
  padding: 3px 7px !important;
}

.added-scenario-head {
  padding: 11px 12px !important;
}

.added-scenario-table th,
.added-scenario-table td {
  padding: 8px 9px !important;
  font-size: 11px !important;
}

@media (min-width: 1020px) {
  .calendar-page .brand-name,
  .fund-simulation-page .brand-name,
  .portfolio-page .brand-name,
  .rate-sheet-page .brand-name {
    font-size: 14px !important;
  }

  .calendar-page .site-nav a,
  .fund-simulation-page .site-nav a,
  .portfolio-page .site-nav a,
  .rate-sheet-page .site-nav a {
    font-size: 12px !important;
  }
}

/* Simulation KPI layout with scenario idle-cash detail */
.fund-simulation-page .scenario-result-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

.fund-simulation-page .scenario-cash-card small {
  line-height: 1.35 !important;
}

.fund-simulation-page .scenario-cash-card em,
.fund-simulation-page .scenario-cash-card b {
  font-style: normal !important;
  font-weight: 900 !important;
}

.fund-simulation-page .scenario-cash-card b {
  color: #e9f3f7 !important;
}

.fund-simulation-page .scenario-cash-card .scenario-cash-capacity-line {
  margin-top: 4px !important;
  padding-top: 5px !important;
  border-top: 1px solid rgba(148, 163, 184, 0.18) !important;
  color: #9ca3af !important;
}

.fund-simulation-page .scenario-cash-card #scenarioCashCapacity {
  font-size: 12px !important;
  letter-spacing: 0.01em !important;
}

.fund-simulation-page .scenario-cash-flow-row {
  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(112px, 0.45fr) auto !important;
  align-items: end !important;
}

.top-holdings-main {
  max-width: min(1580px, calc(100vw - 32px));
}

.top-holdings-panel {
  overflow: hidden;
}

.top-holding-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.top-holding-kpis article {
  border: 1px solid rgba(103, 232, 215, 0.18);
  background: linear-gradient(145deg, rgba(18, 35, 52, 0.94), rgba(9, 18, 30, 0.96));
  border-radius: 18px;
  padding: 15px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.top-holding-kpis span,
.top-holding-kpis small {
  display: block;
  color: rgba(223, 237, 245, 0.68);
  font-size: 0.78rem;
}

.top-holding-kpis strong {
  display: block;
  margin: 5px 0 4px;
  color: #f7fbff;
  font-size: clamp(1rem, 1.6vw, 1.35rem);
}

.top-holding-status-row {
  display: flex;
  justify-content: flex-end;
  margin: -4px 0 10px;
  min-height: 20px;
  color: rgba(223, 237, 245, 0.66);
  font-size: 0.82rem;
}

.top-holding-status-row .is-success,
#topHoldingSaveStatus.is-success {
  color: #72e2ad;
}

.top-holding-status-row .is-error,
#topHoldingSaveStatus.is-error {
  color: #ff9b9b;
}

.top-holding-table-wrap {
  overflow-x: auto;
}

.top-holding-table th,
.top-holding-table td {
  vertical-align: middle;
}

.top-holding-input,
.top-holding-select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
  color: #f7fbff;
  padding: 9px 10px;
  font: inherit;
  outline: none;
}

.top-holding-select,
.top-holding-select option {
  background-color: #07111f;
  color: #f7fbff;
}

.top-holding-input.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.top-holding-input:focus,
.top-holding-select:focus {
  border-color: rgba(103, 232, 215, 0.7);
  box-shadow: 0 0 0 3px rgba(103, 232, 215, 0.12);
}

.top-holding-delete {
  padding: 7px 11px !important;
  font-size: 0.76rem !important;
}

.top-holding-readonly-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  border: 1px solid rgba(103, 232, 215, 0.2);
  border-radius: 999px;
  background: rgba(103, 232, 215, 0.08);
  color: #dff7f4;
  padding: 7px 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.top-holding-modal[hidden] {
  display: none !important;
}

.top-holding-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 10, 18, 0.72);
  backdrop-filter: blur(14px);
}

.top-holding-dialog {
  width: min(560px, 100%);
  border: 1px solid rgba(103, 232, 215, 0.2);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(14, 27, 43, 0.98), rgba(7, 14, 25, 0.98));
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  padding: 22px;
}

.top-holding-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.top-holding-dialog-head h2 {
  margin: 2px 0 0;
  color: #f7fbff;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.top-holding-modal-close {
  padding: 7px 12px !important;
  font-size: 0.76rem !important;
}

.top-holding-form {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 14px;
}

.top-holding-form label {
  display: grid;
  gap: 7px;
  color: rgba(223, 237, 245, 0.72);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}

.top-holding-form-notes,
.top-holding-form-preview,
.top-holding-dialog-actions {
  grid-column: 1 / -1;
}

.top-holding-form-preview {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  color: rgba(223, 237, 245, 0.76);
  padding: 10px 12px;
  font-size: 0.86rem;
}

.top-holding-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 2px;
}

.top-holding-dialog-actions .primary-action {
  background: linear-gradient(
    135deg,
    rgba(103, 232, 215, 0.92),
    rgba(69, 183, 201, 0.95)
  ) !important;
  color: #05131d !important;
  border-color: rgba(103, 232, 215, 0.45) !important;
}

body.top-holding-modal-open {
  overflow: hidden;
}

@media (max-width: 980px) {
  .top-holding-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .top-holding-kpis {
    grid-template-columns: 1fr;
  }

  .top-holding-form {
    grid-template-columns: 1fr;
  }
}

.fund-simulation-page .net-cash-flow-equivalent {
  align-self: center !important;
  margin-left: -2px !important;
  color: #8aa0aa !important;
  font-size: 9px !important;
  font-weight: 800 !important;
  white-space: nowrap !important;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

.fund-simulation-page .net-cash-flow-equivalent b {
  color: var(--ice) !important;
  font-size: 10px !important;
  font-weight: 950 !important;
}

@media (max-width: 1180px) {
  .fund-simulation-page .scenario-cash-flow-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 760px) {
  .fund-simulation-page .scenario-cash-flow-row {
    grid-template-columns: 1fr !important;
  }
}

/* NAV page: history plot should stretch to the available viewport width */
.nav-page .subscription-redemption-main {
  width: 100% !important;
  max-width: none !important;
}

.nav-page .subscription-redemption-card {
  width: 100% !important;
  max-width: none !important;
}

.nav-page .sub-red-chart-grid-single,
.nav-page .nav-history-card,
.nav-page .nav-history-chart {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
}

.nav-page .nav-history-card {
  display: block !important;
}

.nav-page .nav-history-chart svg {
  width: 100% !important;
  max-width: none !important;
}

/* Keep daily save + workbook controls compact at the bottom of the side bar */
@media (min-width: 1020px) {
  .calendar-page .sidebar-utility-stack,
  .fund-simulation-page .sidebar-utility-stack,
  .portfolio-page .sidebar-utility-stack,
  .rate-sheet-page .sidebar-utility-stack,
  .subscription-redemption-page .sidebar-utility-stack,
  .nav-page .sidebar-utility-stack {
    margin-top: auto !important;
    padding: 8px 8px 0 !important;
    border-top: 1px solid #252b38 !important;
    display: grid !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .calendar-page .header-meta,
  .fund-simulation-page .header-meta,
  .portfolio-page .header-meta,
  .rate-sheet-page .header-meta,
  .subscription-redemption-page .header-meta,
  .nav-page .header-meta {
    margin-top: 0 !important;
  }

  .sidebar-utility-stack .sidebar-workbook-upload {
    padding: 0 !important;
    border-top: 0 !important;
    width: 100% !important;
  }

  .sidebar-utility-stack .sidebar-workbook-upload .workbook-upload-card,
  .sidebar-utility-stack .sidebar-snapshot-control {
    min-width: 0 !important;
    max-width: none !important;
    width: 100% !important;
    border-radius: 9px !important;
    padding: 8px !important;
    background: rgba(11, 15, 24, 0.92) !important;
    border: 1px solid rgba(85, 199, 207, 0.15) !important;
    box-shadow: none !important;
  }

  .sidebar-utility-stack .workbook-upload-card {
    gap: 7px !important;
  }

  .sidebar-utility-stack .workbook-drop-zone {
    padding: 8px 7px !important;
    border-radius: 7px !important;
  }

  .sidebar-utility-stack .workbook-drop-zone strong {
    font-size: 10px !important;
  }

  .sidebar-utility-stack .workbook-upload-status {
    max-height: 36px !important;
  }

  .sidebar-utility-stack .snapshot-control-title {
    font-size: 8px !important;
  }

  .sidebar-utility-stack .snapshot-control-row {
    grid-template-columns: 1fr !important;
    gap: 5px !important;
  }

  .sidebar-utility-stack .snapshot-pill,
  .sidebar-utility-stack .snapshot-select {
    width: 100% !important;
    min-height: 28px !important;
    padding: 6px 8px !important;
    font-size: 9px !important;
  }

  .sidebar-utility-stack .snapshot-status {
    font-size: 9px !important;
    min-height: 10px !important;
  }
}

/* Final layout guard: keep the current KPI strip above the weekly table. */
.fund-simulation-page #currentPortfolioDateTitle {
  order: 0 !important;
  grid-column: 1 / -1 !important;
  grid-row: 1 !important;
}

.fund-simulation-page .portfolio-inline-kpis {
  order: 1 !important;
  grid-column: 1 / -1 !important;
  grid-row: 2 !important;
}

.fund-simulation-page .fund-sim-left-pane .register-table-wrap {
  order: 2 !important;
  grid-column: 1 !important;
  grid-row: 3 !important;
}

.fund-simulation-page .fund-sim-right-pane {
  order: 3 !important;
  grid-column: 2 !important;
  grid-row: 3 !important;
}

/* Final layout guard: keep the current KPI strip above the weekly table. */
.fund-simulation-page #currentPortfolioDateTitle {
  order: 0 !important;
  grid-column: 1 / -1 !important;
  grid-row: 1 !important;
}

.fund-simulation-page .portfolio-inline-kpis {
  order: 1 !important;
  grid-column: 1 / -1 !important;
  grid-row: 2 !important;
}

.fund-simulation-page .fund-sim-left-pane .register-table-wrap {
  order: 2 !important;
  grid-column: 1 !important;
  grid-row: 3 !important;
}

.fund-simulation-page .fund-sim-right-pane {
  order: 3 !important;
  grid-column: 2 !important;
  grid-row: 3 !important;
}

/* Keep the fund simulation KPI strip in its original top position. */
.fund-simulation-page #currentPortfolioDateTitle {
  order: 0 !important;
  grid-column: 1 / -1 !important;
  grid-row: 1 !important;
}

.fund-simulation-page .portfolio-inline-kpis {
  order: 1 !important;
  grid-column: 1 / -1 !important;
  grid-row: 2 !important;
}

.fund-simulation-page .fund-sim-left-pane .register-table-wrap {
  order: 2 !important;
  grid-column: 1 !important;
  grid-row: 3 !important;
}

.fund-simulation-page .fund-sim-right-pane {
  order: 3 !important;
  grid-column: 2 !important;
  grid-row: 3 !important;
}

.simulation-section-date-title {
  margin: 0 0 8px !important;
  color: var(--ice) !important;
  font-size: 12px !important;
  font-weight: 950 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
}

/* Final button normalization: keep all action controls on the same pill system */
.fund-simulation-page .cash-flow-lock-button,
.fund-simulation-page #applyScenarioBatch,
.fund-simulation-page #resetScenarioPortfolio,
.fund-simulation-page .calendar-link-button,
.fund-simulation-page .week-view-button,
.fund-simulation-page .renew-maturity-button,
.fund-simulation-page .scenario-actions button,
.fund-simulation-page .scenario-slot-actions button,
.fund-simulation-page .rule-block-foot button,
.fund-simulation-page .renewal-foot button,
.fund-simulation-page .saved-scenario-form button,
.fund-simulation-page .scenario-analysis-head button,
.fund-simulation-page .saved-scenario-delete,
.fund-simulation-page .table-sort-button,
.portfolio-page .portfolio-clear-button,
.rate-sheet-page .rate-sheet-actions button,
.rate-sheet-page #resetRateSheet,
.button-row button,
.ghost-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  justify-self: start !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  border: 1px solid rgba(86, 185, 193, 0.46) !important;
  border-radius: 999px !important;
  background: rgba(86, 185, 193, 0.12) !important;
  color: var(--ice) !important;
  box-shadow: none !important;
  cursor: pointer !important;
  font-size: 10px !important;
  font-weight: 950 !important;
  letter-spacing: 0.06em !important;
  line-height: 1.15 !important;
  padding: 7px 12px !important;
  text-align: center !important;
  text-transform: uppercase !important;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease,
    color 120ms ease !important;
}

.fund-simulation-page .cash-flow-lock-button:hover,
.fund-simulation-page #applyScenarioBatch:hover,
.fund-simulation-page #resetScenarioPortfolio:hover,
.fund-simulation-page .calendar-link-button:hover,
.fund-simulation-page .week-view-button:hover,
.fund-simulation-page .renew-maturity-button:hover,
.fund-simulation-page .scenario-actions button:hover,
.fund-simulation-page .scenario-slot-actions button:hover,
.fund-simulation-page .rule-block-foot button:hover,
.fund-simulation-page .renewal-foot button:hover,
.fund-simulation-page .saved-scenario-form button:hover,
.fund-simulation-page .scenario-analysis-head button:hover,
.fund-simulation-page .saved-scenario-delete:hover,
.fund-simulation-page .table-sort-button:hover,
.portfolio-page .portfolio-clear-button:hover,
.rate-sheet-page .rate-sheet-actions button:hover,
.rate-sheet-page #resetRateSheet:hover,
.button-row button:hover,
.ghost-button:hover {
  transform: translateY(-1px) !important;
  border-color: rgba(117, 232, 239, 0.82) !important;
  background: rgba(86, 185, 193, 0.2) !important;
  color: var(--ice) !important;
}

.fund-simulation-page .week-view-button,
.fund-simulation-page .renew-maturity-button,
.fund-simulation-page .scenario-slot-actions button:first-child,
.fund-simulation-page .table-sort-button {
  border-color: rgba(117, 232, 239, 0.28) !important;
  background: rgba(86, 185, 193, 0.08) !important;
  color: #bdeef2 !important;
}

.fund-simulation-page #resetScenarioPortfolio,
.rate-sheet-page #resetRateSheet,
.portfolio-page #clearPortfolioData,
.fund-simulation-page .scenario-slot-actions button:last-child,
.fund-simulation-page .saved-scenario-delete,
.fund-simulation-page .scenario-table [data-delete] {
  border-color: rgba(255, 128, 136, 0.42) !important;
  background: rgba(255, 128, 136, 0.1) !important;
  color: #ffc2c7 !important;
}

.fund-simulation-page #resetScenarioPortfolio:hover,
.rate-sheet-page #resetRateSheet:hover,
.portfolio-page #clearPortfolioData:hover,
.fund-simulation-page .scenario-slot-actions button:last-child:hover,
.fund-simulation-page .saved-scenario-delete:hover,
.fund-simulation-page .scenario-table [data-delete]:hover {
  border-color: rgba(255, 151, 158, 0.78) !important;
  background: rgba(255, 128, 136, 0.18) !important;
  color: #ffe0e2 !important;
}

.fund-simulation-page .scenario-slot-actions {
  display: flex !important;
  gap: 8px !important;
  justify-content: flex-start !important;
  padding: 8px 10px 10px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Final button normalization: keep all action controls on the same pill system */
.fund-simulation-page .cash-flow-lock-button,
.fund-simulation-page #applyScenarioBatch,
.fund-simulation-page #resetScenarioPortfolio,
.fund-simulation-page .calendar-link-button,
.fund-simulation-page .week-view-button,
.fund-simulation-page .renew-maturity-button,
.fund-simulation-page .scenario-actions button,
.fund-simulation-page .scenario-slot-actions button,
.fund-simulation-page .rule-block-foot button,
.fund-simulation-page .renewal-foot button,
.fund-simulation-page .saved-scenario-form button,
.fund-simulation-page .scenario-analysis-head button,
.fund-simulation-page .saved-scenario-delete,
.fund-simulation-page .table-sort-button,
.portfolio-page .portfolio-clear-button,
.rate-sheet-page .rate-sheet-actions button,
.rate-sheet-page #resetRateSheet,
.button-row button,
.ghost-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  justify-self: start !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  border: 1px solid rgba(86, 185, 193, 0.46) !important;
  border-radius: 999px !important;
  background: rgba(86, 185, 193, 0.12) !important;
  color: var(--ice) !important;
  box-shadow: none !important;
  cursor: pointer !important;
  font-size: 10px !important;
  font-weight: 950 !important;
  letter-spacing: 0.06em !important;
  line-height: 1.15 !important;
  padding: 7px 12px !important;
  text-align: center !important;
  text-transform: uppercase !important;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease,
    color 120ms ease !important;
}

.fund-simulation-page .cash-flow-lock-button:hover,
.fund-simulation-page #applyScenarioBatch:hover,
.fund-simulation-page #resetScenarioPortfolio:hover,
.fund-simulation-page .calendar-link-button:hover,
.fund-simulation-page .week-view-button:hover,
.fund-simulation-page .renew-maturity-button:hover,
.fund-simulation-page .scenario-actions button:hover,
.fund-simulation-page .scenario-slot-actions button:hover,
.fund-simulation-page .rule-block-foot button:hover,
.fund-simulation-page .renewal-foot button:hover,
.fund-simulation-page .saved-scenario-form button:hover,
.fund-simulation-page .scenario-analysis-head button:hover,
.fund-simulation-page .saved-scenario-delete:hover,
.fund-simulation-page .table-sort-button:hover,
.portfolio-page .portfolio-clear-button:hover,
.rate-sheet-page .rate-sheet-actions button:hover,
.rate-sheet-page #resetRateSheet:hover,
.button-row button:hover,
.ghost-button:hover {
  transform: translateY(-1px) !important;
  border-color: rgba(117, 232, 239, 0.82) !important;
  background: rgba(86, 185, 193, 0.2) !important;
  color: var(--ice) !important;
}

.fund-simulation-page .week-view-button,
.fund-simulation-page .renew-maturity-button,
.fund-simulation-page .scenario-slot-actions button:first-child,
.fund-simulation-page .table-sort-button {
  border-color: rgba(117, 232, 239, 0.28) !important;
  background: rgba(86, 185, 193, 0.08) !important;
  color: #bdeef2 !important;
}

.fund-simulation-page #resetScenarioPortfolio,
.rate-sheet-page #resetRateSheet,
.portfolio-page #clearPortfolioData,
.fund-simulation-page .scenario-slot-actions button:last-child,
.fund-simulation-page .saved-scenario-delete,
.fund-simulation-page .scenario-table [data-delete] {
  border-color: rgba(255, 128, 136, 0.42) !important;
  background: rgba(255, 128, 136, 0.1) !important;
  color: #ffc2c7 !important;
}

.fund-simulation-page #resetScenarioPortfolio:hover,
.rate-sheet-page #resetRateSheet:hover,
.portfolio-page #clearPortfolioData:hover,
.fund-simulation-page .scenario-slot-actions button:last-child:hover,
.fund-simulation-page .saved-scenario-delete:hover,
.fund-simulation-page .scenario-table [data-delete]:hover {
  border-color: rgba(255, 151, 158, 0.78) !important;
  background: rgba(255, 128, 136, 0.18) !important;
  color: #ffe0e2 !important;
}

.fund-simulation-page .scenario-slot-actions {
  display: flex !important;
  gap: 8px !important;
  justify-content: flex-start !important;
  padding: 8px 10px 10px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Final button normalization: keep all action controls on the same pill system */
.fund-simulation-page .cash-flow-lock-button,
.fund-simulation-page #applyScenarioBatch,
.fund-simulation-page #resetScenarioPortfolio,
.fund-simulation-page .calendar-link-button,
.fund-simulation-page .week-view-button,
.fund-simulation-page .renew-maturity-button,
.fund-simulation-page .scenario-actions button,
.fund-simulation-page .scenario-slot-actions button,
.fund-simulation-page .rule-block-foot button,
.fund-simulation-page .renewal-foot button,
.fund-simulation-page .saved-scenario-form button,
.fund-simulation-page .scenario-analysis-head button,
.fund-simulation-page .saved-scenario-delete,
.fund-simulation-page .table-sort-button,
.portfolio-page .portfolio-clear-button,
.rate-sheet-page .rate-sheet-actions button,
.rate-sheet-page #resetRateSheet,
.button-row button,
.ghost-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  justify-self: start !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  border: 1px solid rgba(86, 185, 193, 0.46) !important;
  border-radius: 999px !important;
  background: rgba(86, 185, 193, 0.12) !important;
  color: var(--ice) !important;
  box-shadow: none !important;
  cursor: pointer !important;
  font-size: 10px !important;
  font-weight: 950 !important;
  letter-spacing: 0.06em !important;
  line-height: 1.15 !important;
  padding: 7px 12px !important;
  text-align: center !important;
  text-transform: uppercase !important;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease,
    color 120ms ease !important;
}

.fund-simulation-page .cash-flow-lock-button:hover,
.fund-simulation-page #applyScenarioBatch:hover,
.fund-simulation-page #resetScenarioPortfolio:hover,
.fund-simulation-page .calendar-link-button:hover,
.fund-simulation-page .week-view-button:hover,
.fund-simulation-page .renew-maturity-button:hover,
.fund-simulation-page .scenario-actions button:hover,
.fund-simulation-page .scenario-slot-actions button:hover,
.fund-simulation-page .rule-block-foot button:hover,
.fund-simulation-page .renewal-foot button:hover,
.fund-simulation-page .saved-scenario-form button:hover,
.fund-simulation-page .scenario-analysis-head button:hover,
.fund-simulation-page .saved-scenario-delete:hover,
.fund-simulation-page .table-sort-button:hover,
.portfolio-page .portfolio-clear-button:hover,
.rate-sheet-page .rate-sheet-actions button:hover,
.rate-sheet-page #resetRateSheet:hover,
.button-row button:hover,
.ghost-button:hover {
  transform: translateY(-1px) !important;
  border-color: rgba(117, 232, 239, 0.82) !important;
  background: rgba(86, 185, 193, 0.2) !important;
  color: var(--ice) !important;
}

.fund-simulation-page .week-view-button,
.fund-simulation-page .renew-maturity-button,
.fund-simulation-page .scenario-slot-actions button:first-child,
.fund-simulation-page .table-sort-button {
  border-color: rgba(117, 232, 239, 0.28) !important;
  background: rgba(86, 185, 193, 0.08) !important;
  color: #bdeef2 !important;
}

.fund-simulation-page #resetScenarioPortfolio,
.rate-sheet-page #resetRateSheet,
.portfolio-page #clearPortfolioData,
.fund-simulation-page .scenario-slot-actions button:last-child,
.fund-simulation-page .saved-scenario-delete,
.fund-simulation-page .scenario-table [data-delete] {
  border-color: rgba(255, 128, 136, 0.42) !important;
  background: rgba(255, 128, 136, 0.1) !important;
  color: #ffc2c7 !important;
}

.fund-simulation-page #resetScenarioPortfolio:hover,
.rate-sheet-page #resetRateSheet:hover,
.portfolio-page #clearPortfolioData:hover,
.fund-simulation-page .scenario-slot-actions button:last-child:hover,
.fund-simulation-page .saved-scenario-delete:hover,
.fund-simulation-page .scenario-table [data-delete]:hover {
  border-color: rgba(255, 151, 158, 0.78) !important;
  background: rgba(255, 128, 136, 0.18) !important;
  color: #ffe0e2 !important;
}

.fund-simulation-page .scenario-slot-actions {
  display: flex !important;
  gap: 8px !important;
  justify-content: flex-start !important;
  padding: 8px 10px 10px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Unified dashboard pill button system */
.cash-flow-lock-button,
.fund-simulation-page #applyScenarioBatch,
.calendar-link-button,
.week-view-button,
.renew-maturity-button,
.rate-sheet-actions button,
.scenario-actions button,
.scenario-slot-actions button,
.rule-block-foot button,
.renewal-foot button,
.saved-scenario-form button,
.scenario-analysis-head button,
.saved-scenario-delete,
.table-sort-button,
.portfolio-clear-button,
.button-row button,
.ghost-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  border: 1px solid rgba(86, 185, 193, 0.46) !important;
  border-radius: 999px !important;
  background: rgba(86, 185, 193, 0.12) !important;
  color: var(--ice) !important;
  box-shadow: none !important;
  cursor: pointer !important;
  font-size: 10px !important;
  font-weight: 950 !important;
  letter-spacing: 0.06em !important;
  line-height: 1.15 !important;
  padding: 7px 12px !important;
  text-align: center !important;
  text-transform: uppercase !important;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease,
    color 120ms ease !important;
}

.cash-flow-lock-button:hover,
.fund-simulation-page #applyScenarioBatch:hover,
.calendar-link-button:hover,
.week-view-button:hover,
.renew-maturity-button:hover,
.rate-sheet-actions button:hover,
.scenario-actions button:hover,
.scenario-slot-actions button:hover,
.rule-block-foot button:hover,
.renewal-foot button:hover,
.saved-scenario-form button:hover,
.scenario-analysis-head button:hover,
.saved-scenario-delete:hover,
.table-sort-button:hover,
.portfolio-clear-button:hover,
.button-row button:hover,
.ghost-button:hover {
  transform: translateY(-1px) !important;
  border-color: rgba(117, 232, 239, 0.82) !important;
  background: rgba(86, 185, 193, 0.2) !important;
  color: var(--ice) !important;
}

.week-view-button,
.renew-maturity-button,
.scenario-slot-actions button:first-child,
.table-sort-button {
  border-color: rgba(117, 232, 239, 0.28) !important;
  background: rgba(86, 185, 193, 0.08) !important;
  color: #bdeef2 !important;
}

#resetScenarioPortfolio,
#resetRateSheet,
#clearPortfolioData,
.scenario-slot-actions button:last-child,
.saved-scenario-delete,
.scenario-table [data-delete],
.portfolio-clear-button {
  border-color: rgba(255, 128, 136, 0.42) !important;
  background: rgba(255, 128, 136, 0.1) !important;
  color: #ffc2c7 !important;
}

#resetScenarioPortfolio:hover,
#resetRateSheet:hover,
#clearPortfolioData:hover,
.scenario-slot-actions button:last-child:hover,
.saved-scenario-delete:hover,
.scenario-table [data-delete]:hover,
.portfolio-clear-button:hover {
  border-color: rgba(255, 151, 158, 0.78) !important;
  background: rgba(255, 128, 136, 0.18) !important;
  color: #ffe0e2 !important;
}

.scenario-actions {
  align-items: center !important;
}

.scenario-actions button {
  justify-self: start !important;
}

.scenario-slot-actions {
  display: flex !important;
  gap: 8px !important;
  justify-content: flex-start !important;
  padding: 8px 10px 10px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.scenario-slot-actions button {
  border-right: 1px solid rgba(86, 185, 193, 0.46) !important;
}

.scenario-slot-actions button:last-child {
  border-right: 1px solid rgba(255, 128, 136, 0.42) !important;
}

.renew-maturity-button {
  border: 1px solid rgba(86, 185, 193, 0.55) !important;
  border-radius: 999px !important;
  background: linear-gradient(135deg, rgba(86, 185, 193, 0.22), rgba(37, 99, 235, 0.18)) !important;
  color: var(--ice) !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  letter-spacing: 0.04em !important;
  padding: 5px 10px !important;
  cursor: pointer !important;
  box-shadow:
    0 0 0 1px rgba(86, 185, 193, 0.08),
    0 8px 18px rgba(0, 0, 0, 0.16) !important;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease !important;
  white-space: nowrap !important;
}

.renew-maturity-button:hover {
  transform: translateY(-1px) !important;
  border-color: rgba(117, 232, 239, 0.84) !important;
  background: linear-gradient(135deg, rgba(86, 185, 193, 0.34), rgba(37, 99, 235, 0.24)) !important;
}

.renewed-pill,
.deal-flow-action-muted {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 999px !important;
  padding: 4px 8px !important;
  font-size: 9px !important;
  font-weight: 900 !important;
  letter-spacing: 0.05em !important;
  white-space: nowrap !important;
}

.renewed-pill {
  border: 1px solid rgba(57, 216, 149, 0.45) !important;
  background: rgba(57, 216, 149, 0.12) !important;
  color: #5ef0ad !important;
}

.deal-flow-action-muted {
  color: #697386 !important;
}

.scenario-flow-date-input,
.scenario-flow-rate-input {
  width: 100% !important;
  min-width: 92px !important;
  border: 1px solid rgba(86, 185, 193, 0.34) !important;
  border-radius: 8px !important;
  background: rgba(5, 11, 20, 0.42) !important;
  color: #e8fbff !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  padding: 5px 7px !important;
  outline: none !important;
}

.scenario-flow-rate-input {
  min-width: 68px !important;
  text-align: right !important;
}

.scenario-flow-date-input:focus,
.scenario-flow-rate-input:focus {
  border-color: rgba(117, 232, 239, 0.85) !important;
  box-shadow: 0 0 0 2px rgba(86, 185, 193, 0.18) !important;
}

.scenario-flow-static {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100% !important;
  min-height: 26px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.035) !important;
  color: #eaf7f8 !important;
  font-size: 11px !important;
  font-weight: 850 !important;
  padding: 5px 7px !important;
}

td.num .scenario-flow-static {
  justify-content: flex-end !important;
}

.cash-flow-lock-button {
  grid-column: 1 / -1 !important;
  justify-self: start !important;
  border: 1px solid rgba(86, 185, 193, 0.46) !important;
  border-radius: 999px !important;
  background: rgba(86, 185, 193, 0.12) !important;
  color: var(--ice) !important;
  font-size: 10px !important;
  font-weight: 950 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  padding: 7px 12px !important;
  cursor: pointer !important;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease !important;
}

.cash-flow-lock-button:hover {
  transform: translateY(-1px) !important;
  border-color: rgba(117, 232, 239, 0.82) !important;
  background: rgba(86, 185, 193, 0.2) !important;
}

.cash-flow-lock-button.locked {
  border-color: rgba(255, 196, 87, 0.7) !important;
  background: rgba(255, 196, 87, 0.16) !important;
  color: #ffd36d !important;
}

.scenario-cash-flow-row input.cash-flow-locked,
.scenario-cash-flow-row input:disabled.cash-flow-locked {
  border-color: rgba(255, 196, 87, 0.42) !important;
  background: rgba(255, 196, 87, 0.07) !important;
  color: #ffe2a1 !important;
  opacity: 1 !important;
  cursor: not-allowed !important;
}

/* Latest override: keep simulation cash inputs separate from deal inputs */
.fund-simulation-page .scenario-control-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 10px !important;
}

.fund-simulation-page .scenario-control-grid label:first-child,
.fund-simulation-page .scenario-control-grid label {
  grid-column: auto !important;
}

.fund-simulation-page .scenario-cash-flow-row,
.fund-simulation-page .scenario-deal-input-row {
  display: grid !important;
  width: 100% !important;
  gap: 8px !important;
}

.fund-simulation-page .scenario-cash-flow-row {
  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(112px, 0.45fr) minmax(96px, 0.38fr) !important;
  padding: 9px !important;
  border: 1px solid rgba(86, 185, 193, 0.18) !important;
  border-radius: 10px !important;
  background: rgba(86, 185, 193, 0.055) !important;
}

.fund-simulation-page .net-cash-flow-equivalent {
  align-self: center !important;
  color: #8aa0aa !important;
  font-size: 9px !important;
  font-weight: 800 !important;
  letter-spacing: 0.02em !important;
  white-space: nowrap !important;
}

.fund-simulation-page .net-cash-flow-equivalent b {
  color: var(--ice) !important;
  font-size: 10px !important;
  font-weight: 950 !important;
}

.fund-simulation-page .scenario-deal-row-title {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  color: var(--ice) !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  letter-spacing: 0.09em !important;
  text-transform: uppercase !important;
}

.fund-simulation-page .scenario-deal-row-title::after {
  content: "" !important;
  flex: 1 !important;
  height: 1px !important;
  background: linear-gradient(90deg, rgba(86, 185, 193, 0.45), rgba(86, 185, 193, 0.05)) !important;
}

.fund-simulation-page .scenario-deal-input-row {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  padding: 9px !important;
  border: 1px solid rgba(255, 196, 87, 0.18) !important;
  border-radius: 10px !important;
  background: rgba(255, 196, 87, 0.045) !important;
}

.fund-simulation-page .scenario-cash-flow-row label,
.fund-simulation-page .scenario-deal-input-row label {
  min-width: 0 !important;
}

.fund-simulation-page .scenario-actions {
  grid-column: auto !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
}

@media (max-width: 1200px) {
  .fund-simulation-page .scenario-cash-flow-row,
  .fund-simulation-page .scenario-deal-input-row {
    grid-template-columns: 1fr !important;
  }
}

/* Latest override: keep simulation cash inputs separate from deal inputs */
.fund-simulation-page .scenario-control-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 10px !important;
}

.fund-simulation-page .scenario-control-grid label:first-child,
.fund-simulation-page .scenario-control-grid label {
  grid-column: auto !important;
}

.fund-simulation-page .scenario-cash-flow-row,
.fund-simulation-page .scenario-deal-input-row {
  display: grid !important;
  width: 100% !important;
  gap: 8px !important;
}

.fund-simulation-page .scenario-cash-flow-row {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  padding: 9px !important;
  border: 1px solid rgba(86, 185, 193, 0.18) !important;
  border-radius: 10px !important;
  background: rgba(86, 185, 193, 0.055) !important;
}

.fund-simulation-page .scenario-deal-row-title {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  color: var(--ice) !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  letter-spacing: 0.09em !important;
  text-transform: uppercase !important;
}

.fund-simulation-page .scenario-deal-row-title::after {
  content: "" !important;
  flex: 1 !important;
  height: 1px !important;
  background: linear-gradient(90deg, rgba(86, 185, 193, 0.45), rgba(86, 185, 193, 0.05)) !important;
}

.fund-simulation-page .scenario-deal-input-row {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  padding: 9px !important;
  border: 1px solid rgba(255, 196, 87, 0.18) !important;
  border-radius: 10px !important;
  background: rgba(255, 196, 87, 0.045) !important;
}

.fund-simulation-page .scenario-cash-flow-row label,
.fund-simulation-page .scenario-deal-input-row label {
  min-width: 0 !important;
}

.fund-simulation-page .scenario-actions {
  grid-column: auto !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
}

@media (max-width: 1200px) {
  .fund-simulation-page .scenario-cash-flow-row,
  .fund-simulation-page .scenario-deal-input-row {
    grid-template-columns: 1fr !important;
  }
}

/* Final simulation input separation: net cash flow above, deal input below */
.fund-simulation-page .scenario-control-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 10px !important;
}

.fund-simulation-page .scenario-control-grid label:first-child,
.fund-simulation-page .scenario-control-grid label {
  grid-column: auto !important;
}

.fund-simulation-page .scenario-cash-flow-row,
.fund-simulation-page .scenario-deal-input-row {
  display: grid !important;
  width: 100% !important;
  gap: 8px !important;
}

.fund-simulation-page .scenario-cash-flow-row {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  padding: 9px !important;
  border: 1px solid rgba(86, 185, 193, 0.18) !important;
  border-radius: 10px !important;
  background: rgba(86, 185, 193, 0.055) !important;
}

.fund-simulation-page .scenario-deal-row-title {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  color: var(--ice) !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  letter-spacing: 0.09em !important;
  text-transform: uppercase !important;
}

.fund-simulation-page .scenario-deal-row-title::after {
  content: "" !important;
  flex: 1 !important;
  height: 1px !important;
  background: linear-gradient(90deg, rgba(86, 185, 193, 0.45), rgba(86, 185, 193, 0.05)) !important;
}

.fund-simulation-page .scenario-deal-input-row {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  padding: 9px !important;
  border: 1px solid rgba(255, 196, 87, 0.18) !important;
  border-radius: 10px !important;
  background: rgba(255, 196, 87, 0.045) !important;
}

.fund-simulation-page .scenario-cash-flow-row label,
.fund-simulation-page .scenario-deal-input-row label {
  min-width: 0 !important;
}

.fund-simulation-page .scenario-actions {
  grid-column: auto !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
}

@media (max-width: 1200px) {
  .fund-simulation-page .scenario-cash-flow-row,
  .fund-simulation-page .scenario-deal-input-row {
    grid-template-columns: 1fr !important;
  }
}

.scenario-deal-flow {
  order: 0 !important;
}

.fund-simulation-page .portfolio-scenario-box .scenario-result-grid {
  order: 1 !important;
}

.deal-type-badge {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  border-radius: 999px !important;
  padding: 3px 8px !important;
  font-size: 9px !important;
  font-weight: 900 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  white-space: nowrap !important;
}

.deal-type-badge::before {
  content: "" !important;
  width: 6px !important;
  height: 6px !important;
  border-radius: 999px !important;
  background: currentColor !important;
}

.deal-type-badge.new {
  border: 1px solid rgba(57, 216, 149, 0.52) !important;
  background: rgba(57, 216, 149, 0.14) !important;
  color: #39d895 !important;
}

.deal-type-badge.maturity {
  border: 1px solid rgba(241, 138, 150, 0.58) !important;
  background: rgba(241, 138, 150, 0.15) !important;
  color: #ff8f9d !important;
}

.deal-type-badge.renewal {
  border: 1px solid rgba(255, 196, 87, 0.62) !important;
  background: rgba(255, 196, 87, 0.16) !important;
  color: #ffc457 !important;
}

.deal-flow-new {
  background: rgba(57, 216, 149, 0.055) !important;
}

.deal-flow-renewal {
  background: rgba(255, 196, 87, 0.065) !important;
}

.deal-flow-maturity {
  background: rgba(241, 138, 150, 0.055) !important;
}

.added-scenario-table tr.deal-flow-maturity td,
.added-scenario-table tr.deal-flow-new td,
.added-scenario-table tr.deal-flow-renewal td {
  font-weight: 850 !important;
}

.added-scenario-table tr.deal-flow-maturity td {
  background: rgba(241, 138, 150, 0.06) !important;
}

.added-scenario-table tr.deal-flow-new td {
  background: rgba(57, 216, 149, 0.06) !important;
}

.added-scenario-table tr.deal-flow-renewal td {
  background: rgba(255, 196, 87, 0.07) !important;
}

/* Fund Simulation: keep the top scenario panel summary-only, with inputs below capacity */
.fund-simulation-page .portfolio-inline-kpis {
  border: 2px solid rgba(86, 185, 193, 0.48) !important;
  border-radius: 10px !important;
  padding: 5px !important;
  background:
    linear-gradient(
      90deg,
      rgba(86, 185, 193, 0.09),
      rgba(241, 199, 181, 0.06),
      rgba(86, 185, 193, 0.06)
    ),
    rgba(10, 14, 22, 0.78) !important;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.045) inset,
    0 18px 42px rgba(0, 0, 0, 0.22) !important;
}

.fund-simulation-page .portfolio-scenario-box {
  display: grid !important;
  gap: 10px !important;
  border: 2px solid rgba(86, 185, 193, 0.55) !important;
  background:
    radial-gradient(760px 300px at 18% 0%, rgba(86, 185, 193, 0.18), transparent 62%),
    radial-gradient(620px 260px at 100% 20%, rgba(90, 120, 190, 0.12), transparent 58%),
    linear-gradient(180deg, rgba(18, 39, 54, 0.82), rgba(12, 18, 30, 0.98)) !important;
  box-shadow:
    0 0 0 1px rgba(150, 244, 238, 0.075) inset,
    0 18px 48px rgba(0, 0, 0, 0.3),
    0 0 28px rgba(86, 185, 193, 0.08) !important;
}

.fund-simulation-page .portfolio-scenario-box .scenario-result-grid article,
.fund-simulation-page .portfolio-scenario-box .added-scenario-deals {
  background: rgba(9, 16, 28, 0.68) !important;
  border-color: rgba(86, 185, 193, 0.2) !important;
}

.fund-simulation-page .portfolio-rules-box {
  display: grid !important;
  gap: 12px !important;
}

.scenario-working-box {
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  background:
    linear-gradient(180deg, rgba(86, 185, 193, 0.055), rgba(15, 18, 25, 0.96)), #121722 !important;
  padding: 12px !important;
}

.shared-scenario-status {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: max-content !important;
  border: 1px solid rgba(86, 185, 193, 0.32) !important;
  border-radius: 999px !important;
  background: rgba(86, 185, 193, 0.1) !important;
  color: #94f1f7 !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  letter-spacing: 0.04em !important;
  padding: 3px 8px !important;
  text-transform: uppercase !important;
}

.shared-scenario-status.saving {
  border-color: rgba(253, 171, 67, 0.45) !important;
  background: rgba(253, 171, 67, 0.12) !important;
  color: #ffd27a !important;
}

.shared-scenario-status.offline {
  border-color: rgba(221, 105, 116, 0.45) !important;
  background: rgba(221, 105, 116, 0.12) !important;
  color: #ff9aa2 !important;
}

.scenario-slot-panel {
  grid-column: 1 / -1 !important;
  border: 1px solid rgba(86, 185, 193, 0.18) !important;
  border-radius: 10px !important;
  background: rgba(8, 13, 22, 0.58) !important;
  padding: 10px !important;
}

.scenario-slot-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  margin-bottom: 8px !important;
}

.scenario-slot-head span {
  color: #e8fbff !important;
  font-size: 10px !important;
  font-weight: 950 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
}

.scenario-slot-head small {
  color: #8794a6 !important;
  font-size: 10px !important;
  font-weight: 750 !important;
}

.scenario-slot-buttons {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

.scenario-slot-card {
  min-width: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 9px !important;
  background: rgba(255, 255, 255, 0.025) !important;
  overflow: hidden !important;
}

.scenario-slot-card.saved {
  border-color: rgba(86, 185, 193, 0.24) !important;
  background: rgba(86, 185, 193, 0.055) !important;
}

.scenario-slot-title-row {
  padding: 8px 10px 0 !important;
}

.scenario-slot-name-input {
  width: 100% !important;
  min-height: 28px !important;
  border: 1px solid rgba(86, 185, 193, 0.18) !important;
  border-radius: 7px !important;
  background: rgba(0, 0, 0, 0.15) !important;
  color: #ffffff !important;
  font-size: 12px !important;
  font-weight: 950 !important;
  outline: none !important;
  padding: 5px 7px !important;
}

.scenario-slot-name-input:focus {
  border-color: rgba(117, 232, 239, 0.82) !important;
  box-shadow: 0 0 0 2px rgba(86, 185, 193, 0.16) !important;
}

.scenario-slot-main {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 6px !important;
  width: 100% !important;
  min-height: 66px !important;
  border: 0 !important;
  background: transparent !important;
  color: #eaf7f8 !important;
  cursor: pointer !important;
  padding: 9px 10px !important;
  text-align: left !important;
}

.scenario-slot-main strong {
  color: #ffffff !important;
  font-size: 12px !important;
  font-weight: 950 !important;
}

.scenario-slot-main span,
.scenario-slot-main small {
  color: #94a2b4 !important;
  font-size: 10px !important;
  font-weight: 800 !important;
}

.scenario-slot-deals {
  color: #8794a6 !important;
}

.scenario-slot-metrics {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 5px !important;
  width: 100% !important;
}

.scenario-slot-metrics em {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  min-width: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  border-radius: 7px !important;
  background: rgba(0, 0, 0, 0.16) !important;
  padding: 5px 6px !important;
  font-style: normal !important;
}

.scenario-slot-metrics em b {
  color: #738196 !important;
  font-size: 8px !important;
  font-weight: 950 !important;
  letter-spacing: 0.08em !important;
  line-height: 1 !important;
  text-transform: uppercase !important;
}

.scenario-slot-metrics em strong {
  color: var(--ice) !important;
  font-size: 11px !important;
  font-weight: 950 !important;
  line-height: 1.1 !important;
}

.scenario-slot-metrics em:first-child strong {
  color: #5ef0ad !important;
}

.scenario-slot-metrics em:last-child strong {
  color: #ffd27a !important;
}

.scenario-slot-main:hover {
  background: rgba(86, 185, 193, 0.08) !important;
}

.scenario-slot-actions {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.scenario-slot-actions button {
  min-height: 27px !important;
  border: 0 !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(255, 255, 255, 0.025) !important;
  color: #9fe8ee !important;
  cursor: pointer !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
}

.scenario-slot-actions button:last-child {
  border-right: 0 !important;
  color: #ff9aa2 !important;
}

/* Strong month separators for weekly maturity planning */
.fund-simulation-page .weekly-maturity-table tr.weekly-month-row td,
.weekly-maturity-table tr.weekly-month-row td {
  padding: 15px 14px !important;
  border-top: 1px solid rgba(253, 171, 67, 0.45) !important;
  border-bottom: 1px solid rgba(253, 171, 67, 0.28) !important;
  background: linear-gradient(90deg, rgba(253, 171, 67, 0.22), rgba(86, 185, 193, 0.1)) !important;
  color: #ffd27a !important;
  font-size: 18px !important;
  font-weight: 950 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
}

/* Strong month separators for weekly maturity planning */
.fund-simulation-page .weekly-maturity-table tr.weekly-month-row td,
.weekly-maturity-table tr.weekly-month-row td {
  padding: 15px 14px !important;
  border-top: 1px solid rgba(253, 171, 67, 0.45) !important;
  border-bottom: 1px solid rgba(253, 171, 67, 0.28) !important;
  background: linear-gradient(90deg, rgba(253, 171, 67, 0.22), rgba(86, 185, 193, 0.1)) !important;
  color: #ffd27a !important;
  font-size: 18px !important;
  font-weight: 950 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
}

/* Strong month separators for weekly maturity planning */
.fund-simulation-page .weekly-maturity-table tr.weekly-month-row td,
.weekly-maturity-table tr.weekly-month-row td {
  padding: 15px 14px !important;
  border-top: 1px solid rgba(253, 171, 67, 0.45) !important;
  border-bottom: 1px solid rgba(253, 171, 67, 0.28) !important;
  background: linear-gradient(90deg, rgba(253, 171, 67, 0.22), rgba(86, 185, 193, 0.1)) !important;
  color: #ffd27a !important;
  font-size: 18px !important;
  font-weight: 950 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
}

/* Final readability lift: slightly larger UI scale for fund-operation use */
body,
body.fund-simulation-page,
body.calendar-page,
body.portfolio-page,
body.rate-sheet-page {
  font-size: 14px !important;
  line-height: 1.5 !important;
}

.card-head h1,
.portfolio-only-card h1,
.editable-rate-panel h1,
.calendar-only-card h1 {
  font-size: 24px !important;
}

.card-sub,
.workbook-drop-zone small,
.workbook-upload-status {
  font-size: 12px !important;
}

.eyebrow,
.upload-kicker,
.portfolio-inline-kpis span,
.scenario-control-grid label span,
.limit-summary-table th,
.weekly-maturity-table th,
.data-table th,
.deposit-register-table th,
.added-scenario-head span {
  font-size: 10px !important;
}

.portfolio-inline-kpis article {
  min-height: 76px !important;
  padding: 15px 16px !important;
}

.portfolio-inline-kpis strong,
.scenario-result-grid strong {
  font-size: 19px !important;
}

.portfolio-inline-kpis small,
.scenario-result-grid small,
.added-scenario-head small,
.empty-added-deals {
  font-size: 11px !important;
}

.scenario-result-grid article {
  padding: 14px 15px !important;
}

.scenario-control-grid select,
.scenario-control-grid input,
.subscription-input-row select,
.editable-rate-table input,
.portfolio-mini-input,
.sim-input {
  min-height: 35px !important;
  font-size: 12px !important;
  padding: 7px 9px !important;
}

.scenario-actions button,
.week-view-button,
.calendar-link-button,
.rate-sheet-actions button {
  min-height: 34px !important;
  font-size: 12px !important;
  padding: 7px 10px !important;
}

.data-table,
.deposit-register-table,
.weekly-maturity-table,
.limit-summary-table,
.editable-rate-table {
  font-size: 12px !important;
}

.data-table th,
.deposit-register-table th,
.weekly-maturity-table th,
.limit-summary-table th,
.editable-rate-table th {
  height: 36px !important;
}

.data-table td,
.deposit-register-table td,
.weekly-maturity-table td,
.limit-summary-table td,
.editable-rate-table td {
  padding: 10px 11px !important;
}

.fund-simulation-page .weekly-maturity-table tr.weekly-month-row td {
  font-size: 15px !important;
}

.week-date-range {
  font-size: 11px !important;
}

.week-signal-low {
  font-size: 9px !important;
  padding: 3px 7px !important;
}

.added-scenario-head {
  padding: 11px 12px !important;
}

.added-scenario-table th,
.added-scenario-table td {
  padding: 8px 9px !important;
  font-size: 11px !important;
}

@media (min-width: 1020px) {
  .calendar-page .brand-name,
  .fund-simulation-page .brand-name,
  .portfolio-page .brand-name,
  .rate-sheet-page .brand-name {
    font-size: 14px !important;
  }

  .calendar-page .site-nav a,
  .fund-simulation-page .site-nav a,
  .portfolio-page .site-nav a,
  .rate-sheet-page .site-nav a {
    font-size: 12px !important;
  }
}

/* Readability lift: slightly larger UI scale for fund-operation use */
body {
  font-size: 14px !important;
  line-height: 1.5 !important;
}

.card-head h1,
.portfolio-only-card h1,
.editable-rate-panel h1,
.calendar-only-card h1 {
  font-size: 24px !important;
}

.card-sub,
.workbook-drop-zone small,
.workbook-upload-status {
  font-size: 12px !important;
}

.eyebrow,
.upload-kicker,
.portfolio-inline-kpis span,
.scenario-control-grid label span,
.limit-summary-table th,
.weekly-maturity-table th,
.data-table th,
.deposit-register-table th,
.added-scenario-head span {
  font-size: 10px !important;
}

.portfolio-inline-kpis article {
  min-height: 76px !important;
  padding: 15px 16px !important;
}

.portfolio-inline-kpis strong,
.scenario-result-grid strong {
  font-size: 19px !important;
}

.portfolio-inline-kpis small,
.scenario-result-grid small,
.added-scenario-head small,
.empty-added-deals {
  font-size: 11px !important;
}

.scenario-result-grid article {
  padding: 14px 15px !important;
}

.scenario-control-grid select,
.scenario-control-grid input,
.subscription-input-row select,
.editable-rate-table input,
.portfolio-mini-input,
.sim-input {
  min-height: 35px !important;
  font-size: 12px !important;
  padding: 7px 9px !important;
}

.scenario-actions button,
.week-view-button,
.calendar-link-button,
.rate-sheet-actions button {
  min-height: 34px !important;
  font-size: 12px !important;
  padding: 7px 10px !important;
}

.data-table,
.deposit-register-table,
.weekly-maturity-table,
.limit-summary-table,
.editable-rate-table {
  font-size: 12px !important;
}

.data-table th,
.deposit-register-table th,
.weekly-maturity-table th,
.limit-summary-table th,
.editable-rate-table th {
  height: 36px !important;
}

.data-table td,
.deposit-register-table td,
.weekly-maturity-table td,
.limit-summary-table td,
.editable-rate-table td {
  padding: 10px 11px !important;
}

.fund-simulation-page .weekly-maturity-table tr.weekly-month-row td {
  font-size: 15px !important;
}

.week-date-range {
  font-size: 11px !important;
}

.week-signal-low {
  font-size: 9px !important;
  padding: 3px 7px !important;
}

.added-scenario-head {
  padding: 11px 12px !important;
}

.added-scenario-table th,
.added-scenario-table td {
  padding: 8px 9px !important;
  font-size: 11px !important;
}

@media (min-width: 1020px) {
  .calendar-page .brand-name,
  .fund-simulation-page .brand-name,
  .portfolio-page .brand-name,
  .rate-sheet-page .brand-name {
    font-size: 14px !important;
  }

  .calendar-page .site-nav a,
  .fund-simulation-page .site-nav a,
  .portfolio-page .site-nav a,
  .rate-sheet-page .site-nav a {
    font-size: 12px !important;
  }
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: var(--font-sans);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(103, 232, 215, 0.06), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(75, 134, 200, 0.08), transparent 60%), var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.005em;
}
.num {
  text-align: right;
  font-variant-numeric: tabular-nums lining-nums;
  font-family: var(--font-mono);
}
.visually-hidden {
  position: absolute;
  clip: rect(0 0 0 0);
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 32px);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(10, 22, 38, 0.82);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.header-inner {
  display: grid;
  grid-template-columns: minmax(156px, auto) minmax(360px, 1fr) minmax(270px, auto);
  align-items: center;
  gap: 14px;
  padding: 14px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
.brand-mark {
  color: var(--teal);
  display: inline-flex;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-name {
  font-weight: 900;
  letter-spacing: 0.035em;
  font-size: 15px;
  white-space: nowrap;
}
.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  min-width: 0;
}
.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 9px;
  white-space: nowrap;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--teal);
  background: rgba(103, 232, 215, 0.08);
  border-color: rgba(103, 232, 215, 0.22);
}

.header-meta {
  display: grid;
  grid-auto-flow: column;
  justify-content: end;
  gap: 18px;
  font-size: 12px;
  color: var(--text-muted);
  min-width: 0;
}
.meta-row {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.meta-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}
.meta-value {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
}

@media (max-width: 1120px) {
  .header-inner {
    grid-template-columns: minmax(150px, auto) 1fr;
  }
  .site-nav {
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .header-meta {
    grid-column: 1 / -1;
    grid-auto-flow: column;
    justify-content: start;
  }
}

@media (max-width: 760px) {
  .header-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 0;
  }
  .site-nav {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .header-meta {
    grid-auto-flow: row;
    gap: 4px;
  }
  .header-meta .meta-row {
    flex-direction: row;
    gap: 8px;
    align-items: baseline;
  }
}

/* Workbook upload */
.workbook-upload-panel {
  padding-top: 14px;
}
.workbook-upload-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.42fr);
  gap: 14px;
  align-items: stretch;
  border: 1px solid rgba(103, 232, 215, 0.22);
  border-radius: 16px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(103, 232, 215, 0.08), rgba(224, 179, 65, 0.035)),
    rgba(12, 25, 42, 0.86);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}
.workbook-drop-zone {
  display: grid;
  gap: 4px;
  min-height: 96px;
  align-content: center;
  padding: 16px;
  border: 1px dashed rgba(103, 232, 215, 0.44);
  border-radius: 12px;
  background: rgba(103, 232, 215, 0.045);
  color: var(--text);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}
.workbook-drop-zone.drag-active,
.workbook-drop-zone:hover {
  border-color: var(--teal);
  background: rgba(103, 232, 215, 0.1);
  transform: translateY(-1px);
}
.workbook-drop-zone input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}
.upload-kicker {
  color: var(--teal);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 900;
}
.workbook-drop-zone strong {
  font-size: 16px;
  letter-spacing: -0.01em;
}
.workbook-drop-zone small,
.workbook-upload-status {
  color: var(--text-muted);
  font-size: 12px;
}
.workbook-upload-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}
.workbook-upload-status {
  margin: 0;
  line-height: 1.45;
}
.workbook-upload-status[data-tone="success"] {
  color: var(--teal);
}
.workbook-upload-status[data-tone="error"] {
  color: var(--err);
}
@media (max-width: 760px) {
  .workbook-upload-card {
    grid-template-columns: 1fr;
  }
}

.sidebar-workbook-upload {
  padding: 10px 8px 12px;
  margin: 0;
  border-top: 1px solid rgba(103, 232, 215, 0.12);
}

.sidebar-workbook-upload .workbook-upload-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(11, 20, 33, 0.72);
  border-color: rgba(103, 232, 215, 0.16);
  box-shadow: none;
}

.sidebar-workbook-upload .workbook-drop-zone {
  min-height: 0;
  padding: 10px 8px;
  border-radius: 8px;
  gap: 3px;
  background: rgba(103, 232, 215, 0.045);
}

.sidebar-workbook-upload .upload-kicker {
  font-size: 8px;
  letter-spacing: 0.12em;
}

.sidebar-workbook-upload .workbook-drop-zone strong {
  font-size: 11px;
  line-height: 1.2;
}

.sidebar-workbook-upload .workbook-drop-zone small {
  display: none;
}

.sidebar-workbook-upload .workbook-upload-actions {
  gap: 6px;
}

.sidebar-workbook-upload #workbookReset {
  width: 100%;
  min-height: 30px;
  padding: 6px 8px;
  font-size: 10px;
}

.sidebar-workbook-upload .workbook-upload-status {
  font-size: 9px;
  line-height: 1.3;
  max-height: 58px;
  overflow: hidden;
}

@media (min-width: 1020px) {
  .calendar-page .sidebar-workbook-upload,
  .fund-simulation-page .sidebar-workbook-upload,
  .portfolio-page .sidebar-workbook-upload {
    width: 100%;
    flex: 0 0 auto;
  }
}

@media (max-width: 1019px) {
  .sidebar-workbook-upload {
    width: 100%;
    padding: 8px 0 0;
    border-top: 0;
  }

  .sidebar-workbook-upload .workbook-upload-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

/* Main layout */
.main {
  padding: 28px 0 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero {
  max-width: 880px;
}
.eyebrow {
  color: var(--teal);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 4px 0 10px;
  font-weight: 700;
}
.hero h1 {
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.2;
  margin: 0 0 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.lede {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
  max-width: 72ch;
}

/* KPI grid */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 980px) {
  .kpis {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 520px) {
  .kpis {
    grid-template-columns: 1fr;
  }
}

.kpi {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-elev) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}
.kpi::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--teal), var(--teal-deep));
  opacity: 0.85;
}
.kpi-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.kpi-value {
  font-family: var(--font-mono);
  font-size: clamp(24px, 2.4vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.kpi-value .unit {
  font-size: 0.55em;
  color: var(--text-muted);
  margin-right: 6px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.kpi-value .suffix {
  font-size: 0.65em;
  color: var(--text-muted);
  margin-left: 2px;
}
.kpi-foot {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(103, 232, 215, 0.08);
  color: var(--teal);
  font-family: var(--font-mono);
  font-size: 11px;
  border: 1px solid rgba(103, 232, 215, 0.25);
}
.chip-accent {
  background: rgba(103, 232, 215, 0.16);
}

/* Card grid */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 1080px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 14px;
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.card-head h2 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.005em;
}
.card-sub {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  max-width: 60ch;
}

.chart-wrap {
  position: relative;
  width: 100%;
  height: 280px;
}
.chart-wrap.chart-tall {
  height: 340px;
}
.chart-wrap.chart-short {
  height: 140px;
}
@media (max-width: 520px) {
  .chart-wrap {
    height: 240px;
  }
  .chart-wrap.chart-tall {
    height: 300px;
  }
  .chart-wrap.chart-short {
    height: 130px;
  }
}

/* Tables */
.data-table {
  width: 100%;
  margin-top: 14px;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th,
.data-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
}
.data-table thead th {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
  padding-top: 0;
  border-bottom: 1px solid var(--border);
}
.data-table tbody tr:last-child td {
  border-bottom: 1px solid var(--border);
}
.data-table tfoot th,
.data-table tfoot td {
  font-weight: 700;
  color: var(--text);
  border-bottom: none;
  padding-top: 8px;
}
.data-table .num {
  text-align: right;
}

.mini-kpis {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}
.mini-kpi {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.025);
  padding: 12px;
  min-width: 0;
}
.mini-kpi-label {
  color: var(--text-faint);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 5px;
}
.mini-kpi-value {
  color: var(--text);
  font-size: clamp(15px, 1.4vw, 19px);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-kpi-note {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 4px;
}

.formula-box {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(103, 232, 215, 0.22);
  background: rgba(103, 232, 215, 0.055);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
  color: var(--text);
}
.formula-label {
  color: var(--teal);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  flex: 0 0 auto;
}
@media (max-width: 640px) {
  .formula-box {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}

@media (max-width: 1100px) {
  .mini-kpis {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 640px) {
  .mini-kpis {
    grid-template-columns: 1fr;
  }
}

.table-scroll {
  overflow: auto;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: rgba(4, 12, 24, 0.25);
  max-height: 620px;
}
.wide-table {
  min-width: 1680px;
  margin-top: 0;
}
.wide-table th,
.wide-table td {
  white-space: nowrap;
  font-size: 12px;
}
.wide-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg-elev);
}
.wide-table tbody tr:hover td {
  background: rgba(103, 232, 215, 0.045);
}
.deposit-register .status-pill {
  color: var(--teal);
  background: rgba(103, 232, 215, 0.08);
  border-color: rgba(103, 232, 215, 0.28);
}

/* Forward simulation workspace */
.simulation-page,
.fund-simulation-page {
  --bg: #081421;
  --bg-elev: #0e1d2f;
  --surface: #13263b;
  --surface-2: #172e46;
  --border: #25415f;
  --border-soft: #1c314a;
  --text: #eef6ff;
  --text-muted: #aabbd0;
  --text-faint: #70849d;
  --teal: #5de8d8;
  --gold: #f4c76b;
}
.simulation-main {
  gap: 22px;
}
.fund-sim-main {
  gap: 24px;
}
.sim-section {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  display: grid;
  gap: 16px;
}
.existing-zone {
  border-color: rgba(93, 232, 216, 0.24);
  background:
    linear-gradient(180deg, rgba(93, 232, 216, 0.055), rgba(14, 29, 47, 0.45)),
    rgba(14, 29, 47, 0.48);
}
.forecast-zone {
  border-color: rgba(244, 199, 107, 0.28);
  background:
    linear-gradient(180deg, rgba(244, 199, 107, 0.065), rgba(14, 29, 47, 0.4)),
    rgba(14, 29, 47, 0.48);
}
.fund-sim-hero {
  border-color: rgba(93, 232, 216, 0.24);
  background:
    linear-gradient(180deg, rgba(93, 232, 216, 0.055), rgba(14, 29, 47, 0.45)),
    rgba(14, 29, 47, 0.48);
}
.sim-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 20px;
  align-items: start;
}
.existing-zone .sim-section-head {
  grid-template-columns: 1fr;
}
.sim-section-head h1 {
  margin: 0 0 10px;
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.12;
  letter-spacing: -0.02em;
}
.scenario-date {
  background: linear-gradient(180deg, var(--surface), var(--bg-elev));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}
.scenario-date label {
  display: block;
  color: var(--teal);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
  margin-bottom: 7px;
}
.scenario-date input,
.sim-input {
  width: 100%;
  color: var(--text);
  background: #0a1725;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 9px;
  font: inherit;
  font-family: var(--font-mono);
}
.scenario-date p {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 12px;
}
.sim-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.existing-kpis {
  grid-template-columns: repeat(5, minmax(160px, 1fr));
}
.forecast-kpis {
  grid-template-columns: repeat(4, 1fr);
}
.sim-kpi {
  background: linear-gradient(180deg, var(--surface), var(--bg-elev));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}
.existing-zone .sim-kpi,
.existing-zone .sim-panel {
  border-color: rgba(93, 232, 216, 0.22);
}
.forecast-zone .sim-kpi,
.forecast-zone .sim-panel {
  border-color: rgba(244, 199, 107, 0.22);
}
.sim-kpi span {
  display: block;
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 800;
}
.sim-kpi strong {
  display: block;
  color: var(--text);
  font-size: clamp(18px, 1.6vw, 24px);
  margin-top: 4px;
}
.sim-kpi strong.wam-safe,
.data-table td.wam-safe {
  color: var(--teal);
}
.sim-kpi strong.wam-watch,
.data-table td.wam-watch {
  color: var(--gold);
}
.sim-kpi strong.wam-danger,
.data-table td.wam-danger {
  color: var(--err);
}
.sim-kpi.wam-safe-card {
  border-color: rgba(93, 232, 216, 0.36);
  box-shadow: inset 0 3px 0 rgba(93, 232, 216, 0.4);
}
.sim-kpi.wam-watch-card {
  border-color: rgba(244, 199, 107, 0.58);
  box-shadow:
    inset 0 3px 0 rgba(244, 199, 107, 0.74),
    0 0 0 1px rgba(244, 199, 107, 0.1);
}
.sim-kpi.wam-danger-card {
  border-color: rgba(240, 128, 137, 0.72);
  box-shadow:
    inset 0 3px 0 rgba(240, 128, 137, 0.9),
    0 0 0 1px rgba(240, 128, 137, 0.14),
    0 14px 34px rgba(240, 128, 137, 0.12);
}
.data-table td.wam-safe,
.data-table td.wam-watch,
.data-table td.wam-danger {
  font-weight: 900;
}
.sim-kpi small {
  display: block;
  color: var(--text-faint);
  font-size: 11px;
  margin-top: 4px;
}
.sim-kpi .warn,
#cashStatus.warn {
  color: var(--err);
}
.sim-panel {
  border-radius: 16px;
  min-width: 0;
  overflow-x: auto;
}
.button-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.button-row button,
.ghost-button {
  border: 1px solid rgba(93, 232, 216, 0.28);
  background: rgba(93, 232, 216, 0.08);
  color: var(--teal);
  border-radius: 999px;
  padding: 7px 11px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.ghost-button {
  color: var(--text-muted);
  background: transparent;
  border-color: var(--border);
}
.rollover-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.rollover-card {
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.025);
}
.rollover-card span {
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-weight: 800;
}
.rollover-card strong {
  display: block;
  color: var(--gold);
  font-size: 16px;
  margin-top: 3px;
}
.rollover-card small {
  display: block;
  color: var(--text-faint);
  margin-top: 3px;
}
.snapshot-cards {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 0;
}
.distribution-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.distribution-table {
  width: 100%;
  min-width: 0;
}
.distribution-table th,
.distribution-table td {
  white-space: nowrap;
}
.data-quality-panel {
  border-color: rgba(244, 199, 107, 0.28);
  background: rgba(244, 199, 107, 0.045);
}
.dq-body {
  display: grid;
  gap: 10px;
}
.dq-note {
  border: 1px solid rgba(244, 199, 107, 0.28);
  border-radius: 12px;
  padding: 12px;
  background: rgba(8, 20, 33, 0.34);
}
.dq-note strong {
  display: block;
  color: var(--gold);
  font-size: 13px;
  margin-bottom: 4px;
}
.dq-note p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}
.dq-note.success {
  border-color: rgba(93, 232, 216, 0.3);
  background: rgba(93, 232, 216, 0.055);
}
.dq-note.success strong {
  color: var(--teal);
}
.dq-note.warn {
  border-color: rgba(240, 128, 137, 0.36);
  background: rgba(240, 128, 137, 0.055);
}
.dq-note.warn strong {
  color: var(--err);
}
.forecast-table-wrap {
  overflow-x: auto;
  width: 100%;
  max-width: 100%;
}
.register-panel {
  border-color: rgba(93, 232, 216, 0.18);
}
.register-table-wrap {
  max-height: 560px;
  overflow: auto;
}
.deposit-register-table {
  min-width: 1040px;
}
.fund-excel-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}
.fund-excel-register .compact-stat {
  min-width: 140px;
  padding: 10px 12px;
}
.fund-excel-register .compact-stat strong {
  display: block;
  margin-top: 4px;
  color: var(--gold);
  font-size: 20px;
}
.portfolio-only-main {
  gap: 18px;
}
.portfolio-only-card {
  margin-top: 0;
}
.fund-simulation-page {
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}
.fund-simulation-page .container {
  max-width: none;
  padding-left: clamp(10px, 1.2vw, 18px);
  padding-right: clamp(10px, 1.2vw, 18px);
}
.fund-simulation-page .workbook-upload-panel {
  padding-top: 8px;
}
.fund-simulation-page .workbook-upload-card {
  padding: 9px;
  gap: 10px;
}
.fund-simulation-page .workbook-drop-zone {
  min-height: 66px;
  padding: 10px 14px;
}
.fund-simulation-page .main {
  padding-top: 12px;
  padding-bottom: 0;
}
.portfolio-only-card {
  height: calc(100vh - 208px);
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.portfolio-only-card .card-head {
  flex: 0 0 auto;
  align-items: flex-start;
  gap: 12px;
}
.portfolio-only-card .card-sub {
  max-width: 720px;
  margin-bottom: 0;
}
.editable-rate-panel {
  margin-top: 16px;
  margin-bottom: 22px;
  border-color: rgba(224, 179, 65, 0.22);
  background:
    linear-gradient(180deg, rgba(14, 36, 57, 0.94), rgba(9, 24, 40, 0.98)), var(--surface);
}
.compact-card-head {
  align-items: center;
  gap: 14px;
}
.editable-rate-panel h2 {
  margin: 4px 0 8px;
  font-size: clamp(20px, 2vw, 27px);
  letter-spacing: -0.035em;
}
.editable-rate-panel h1 {
  margin: 4px 0 8px;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.04em;
}
.rate-sheet-main {
  padding-top: 20px;
  padding-bottom: 28px;
}
.standalone-rate-panel {
  min-height: calc(100vh - 126px);
}
.rate-sheet-page .editable-rate-grid {
  margin-top: 8px;
}
.rate-sheet-actions {
  margin-left: auto;
}
.editable-rate-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 14px;
}
.editable-rate-block {
  min-width: 0;
  border: 1px solid rgba(103, 232, 215, 0.16);
  border-radius: 16px;
  background: rgba(5, 18, 31, 0.72);
  overflow: hidden;
}
.editable-rate-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 8px;
}
.editable-rate-title span {
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.editable-rate-title small {
  color: var(--text-muted);
  font-size: 11px;
  text-align: right;
}
.rate-table-wrap {
  overflow-x: auto;
}
.editable-rate-table {
  table-layout: fixed;
  min-width: 720px;
}
.editable-rate-table th,
.editable-rate-table td {
  padding: 4px;
  border-color: rgba(103, 232, 215, 0.1);
}
.editable-rate-table th {
  color: var(--text);
}
.editable-rate-table input {
  width: 100%;
  min-height: 30px;
  border: 1px solid rgba(103, 232, 215, 0.12);
  border-radius: 8px;
  padding: 5px 7px;
  background: rgba(7, 20, 34, 0.88);
  color: var(--text);
  font-family: var(--mono);
  font-size: 11px;
  text-align: right;
}
.editable-rate-table th:first-child input,
.editable-rate-table td:first-child input {
  text-align: left;
  font-family: var(--font);
  font-weight: 800;
}
.editable-rate-table input[readonly] {
  color: var(--teal);
  background: rgba(103, 232, 215, 0.09);
  border-color: rgba(103, 232, 215, 0.18);
  font-weight: 900;
  text-align: center;
  cursor: default;
}
.editable-rate-table input:focus {
  outline: none;
  border-color: rgba(224, 179, 65, 0.72);
  box-shadow: 0 0 0 3px rgba(224, 179, 65, 0.12);
}
.editable-rate-table td.rate-column-best input {
  color: #fff7c8;
  background:
    linear-gradient(180deg, rgba(255, 199, 74, 0.26), rgba(106, 74, 14, 0.34)),
    rgba(18, 31, 43, 0.94);
  border-color: rgba(255, 214, 92, 0.72);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 14px rgba(255, 199, 74, 0.13);
  font-weight: 900;
}
.fund-sim-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.92fr) minmax(340px, 0.68fr);
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
}
.fund-sim-left-pane,
.fund-sim-right-pane {
  min-height: 0;
}
.fund-sim-left-pane {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fund-sim-right-pane {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
}
.portfolio-only-card .register-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
}
.portfolio-inline-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  flex: 0 0 auto;
}
.portfolio-inline-kpis article {
  min-height: 96px;
  border: 1px solid rgba(103, 232, 215, 0.13);
  border-radius: 6px;
  padding: 12px 14px;
  background:
    linear-gradient(180deg, rgba(19, 28, 44, 0.96), rgba(14, 22, 36, 0.98)), rgba(15, 23, 38, 0.96);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}
.portfolio-inline-kpis span {
  display: block;
  margin-bottom: 7px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.portfolio-inline-kpis strong {
  display: block;
  color: var(--text);
  font-size: clamp(15px, 1.35vw, 20px);
  line-height: 1.1;
  letter-spacing: -0.035em;
  white-space: nowrap;
}
.portfolio-inline-kpis article:nth-child(3) strong {
  color: #58d68d;
}
.portfolio-inline-kpis small {
  display: block;
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 9.4px;
  line-height: 1.25;
}
.portfolio-inline-kpis small em {
  color: var(--text);
  font-style: normal;
  font-weight: 900;
}
.portfolio-inline-kpis small b {
  color: var(--gold);
  font-size: inherit;
  font-weight: 800;
}
.portfolio-cash-card {
  padding-top: 12px;
  padding-bottom: 12px;
}
.cash-breakdown {
  display: grid;
  gap: 4px;
}
.cash-breakdown div {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 6px;
}
.cash-breakdown small {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cash-breakdown strong {
  font-size: 12px;
  color: var(--gold);
  white-space: nowrap;
}
.cash-breakdown em {
  color: var(--teal);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}
.portfolio-scenario-box {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0;
  padding: 10px;
  border: 1px solid rgba(255, 78, 122, 0.55);
  border-radius: 14px;
  background:
    linear-gradient(
      135deg,
      rgba(255, 78, 122, 0.18),
      rgba(255, 185, 54, 0.1) 46%,
      rgba(0, 225, 198, 0.08)
    ),
    rgba(12, 14, 34, 0.88);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.035),
    0 0 24px rgba(255, 78, 122, 0.12);
  flex: 0 0 auto;
}
.scenario-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}
.scenario-control-grid label:first-child,
.scenario-actions {
  grid-column: 1 / -1;
}
.scenario-control-grid label {
  display: grid;
  gap: 4px;
}
.scenario-control-grid label span {
  color: #ffb03d;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.scenario-control-grid select,
.scenario-control-grid input,
.portfolio-mini-input {
  width: 100%;
  border: 1px solid rgba(0, 225, 198, 0.3);
  border-radius: 10px;
  background: rgba(5, 14, 29, 0.92);
  color: var(--text);
  font: inherit;
  font-variant-numeric: tabular-nums;
  outline: none;
}
.scenario-control-grid select,
.scenario-control-grid input {
  min-height: 34px;
  padding: 7px 9px;
}
.portfolio-mini-input {
  min-height: 24px;
  padding: 3px 5px;
  text-align: right;
  font-size: 10px;
}
.portfolio-mini-input.bank-input {
  text-align: left;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.portfolio-mini-input:focus,
.scenario-control-grid select:focus,
.scenario-control-grid input:focus {
  border-color: #00f0d2;
  box-shadow:
    0 0 0 2px rgba(0, 240, 210, 0.18),
    0 0 16px rgba(0, 240, 210, 0.16);
}
.table-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 900;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}
.table-sort-button span {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: rgba(103, 255, 232, 0.14);
  color: #67ffe8;
  font-size: 11px;
  line-height: 1;
}
.table-sort-button:hover span {
  background: rgba(103, 255, 232, 0.28);
}
.scenario-actions {
  display: flex;
  gap: 7px;
  align-items: center;
}
.scenario-actions button {
  flex: 1 1 0;
}
.scenario-actions button {
  white-space: nowrap;
  min-height: 34px;
  padding: 7px 10px;
}
.scenario-actions button:first-child,
.saved-scenario-form button {
  border-color: rgba(255, 214, 116, 0.72);
  background: linear-gradient(135deg, #ffe1cf, #ffd1d9);
  color: #301224;
  font-weight: 900;
  box-shadow: 0 0 18px rgba(255, 78, 122, 0.18);
}
.scenario-actions button:first-child:hover,
.saved-scenario-form button:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}
.scenario-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.scenario-result-grid article {
  border: 1px solid rgba(255, 185, 54, 0.32);
  border-radius: 12px;
  padding: 8px 10px;
  background:
    linear-gradient(135deg, rgba(255, 185, 54, 0.12), rgba(0, 225, 198, 0.08)),
    rgba(12, 22, 44, 0.88);
}
.scenario-result-grid span,
.scenario-result-grid small {
  display: block;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.scenario-result-grid strong {
  display: block;
  margin: 4px 0 2px;
  color: #ffc945;
  font-size: 15px;
}
#scenarioWam {
  color: #44d089;
}
#scenarioYield {
  color: var(--mist);
}
.scenario-result-grid small {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 700;
}
.scenario-analysis-panel {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(255, 201, 69, 0.42);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 201, 69, 0.12), rgba(103, 255, 232, 0.08)),
    rgba(6, 15, 31, 0.78);
}
.scenario-analysis-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.scenario-analysis-head span {
  display: block;
  color: #ffd66d;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.scenario-analysis-head small {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.35;
}
.scenario-analysis-head button {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(103, 255, 232, 0.62);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(103, 255, 232, 0.24), rgba(255, 201, 69, 0.2));
  color: var(--text);
  font: inherit;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}
.scenario-analysis-head button:hover {
  border-color: rgba(103, 255, 232, 0.92);
  transform: translateY(-1px);
}
.scenario-analysis-output {
  color: var(--text-muted);
  font-size: 10.5px;
  line-height: 1.45;
}
.scenario-analysis-output p {
  margin: 0;
}
.scenario-analysis-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 9px;
}
.scenario-analysis-summary span {
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #f9d981;
  font-size: 9.5px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.scenario-analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}
.scenario-analysis-grid > div {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  padding: 9px 10px;
  background: rgba(3, 10, 22, 0.48);
}
.scenario-analysis-grid h3 {
  margin: 0 0 6px;
  color: #67ffe8;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.scenario-analysis-grid div + div h3 {
  color: #ff9fb4;
}
.scenario-analysis-grid ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 15px;
}
.scenario-analysis-grid li {
  color: var(--text);
  font-size: 10.5px;
}
.saved-scenario-panel {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(0, 225, 198, 0.42);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(0, 225, 198, 0.1), rgba(255, 78, 122, 0.1)), rgba(4, 13, 26, 0.72);
}
.saved-scenario-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.saved-scenario-head span {
  display: block;
  color: #67ffe8;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.saved-scenario-head small {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.35;
}
.saved-scenario-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}
.saved-scenario-form input {
  min-height: 34px;
  border: 1px solid rgba(0, 225, 198, 0.34);
  border-radius: 10px;
  background: rgba(5, 14, 29, 0.92);
  color: var(--text);
  padding: 7px 9px;
  font: inherit;
  outline: none;
}
.saved-scenario-form input:focus {
  border-color: #00f0d2;
  box-shadow:
    0 0 0 2px rgba(0, 240, 210, 0.18),
    0 0 16px rgba(0, 240, 210, 0.16);
}
.saved-scenario-form button {
  min-height: 34px;
  padding: 7px 10px;
  white-space: nowrap;
}
.saved-scenario-list {
  display: grid;
  gap: 6px;
}
.saved-scenario-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 10.5px;
}
.saved-scenario-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: stretch;
}
.saved-scenario-open,
.saved-scenario-delete {
  border-radius: 10px;
  font: inherit;
  cursor: pointer;
}
.saved-scenario-open {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(0, 225, 198, 0.42);
  background: linear-gradient(135deg, rgba(0, 225, 198, 0.18), rgba(255, 185, 54, 0.1));
  color: var(--text);
  text-align: left;
}
.saved-scenario-open strong,
.saved-scenario-open span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.saved-scenario-open strong {
  font-size: 11px;
  font-weight: 900;
}
.saved-scenario-open span {
  color: var(--text-muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.saved-scenario-open:hover {
  border-color: rgba(0, 240, 210, 0.82);
  background: linear-gradient(135deg, rgba(0, 225, 198, 0.26), rgba(255, 185, 54, 0.16));
}
.saved-scenario-delete {
  padding: 0 9px;
  border: 1px solid rgba(255, 78, 122, 0.42);
  background: rgba(255, 78, 122, 0.16);
  color: #ff8fa9;
  font-size: 10px;
  font-weight: 900;
}
.portfolio-rules-box {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0;
  flex: 0 0 auto;
}
.limit-summary-wrap {
  overflow: hidden;
  border: 1px solid rgba(103, 232, 215, 0.14);
  border-radius: 12px;
  background: rgba(10, 23, 39, 0.56);
}
.limit-summary-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}
.limit-summary-table th,
.limit-summary-table td {
  padding: 4px 6px;
  font-size: 10px;
  line-height: 1.15;
  white-space: nowrap;
}
.limit-summary-table th:nth-child(1) {
  width: 24%;
}
.limit-summary-table th:nth-child(2) {
  width: 18%;
}
.limit-summary-table th:nth-child(3) {
  width: 38%;
}
.limit-summary-table th:nth-child(4) {
  width: 20%;
}
.limit-status {
  display: inline-flex;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.limit-status.ok {
  color: var(--teal);
  background: rgba(103, 232, 215, 0.1);
}
.limit-status.low {
  color: var(--gold);
  background: rgba(224, 179, 65, 0.16);
}
.limit-status.over {
  color: var(--err);
  background: rgba(240, 128, 137, 0.12);
}
.limit-low td {
  color: var(--gold);
}
.limit-over td {
  color: var(--err);
}
.portfolio-only-card h1 {
  margin: 4px 0 8px;
  font-size: clamp(24px, 3.2vw, 34px);
  letter-spacing: -0.04em;
}
.fund-simulation-page .fund-excel-table th,
.fund-simulation-page .fund-excel-table td {
  padding: 5px 6px;
  font-size: 10.5px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fund-simulation-page .fund-excel-table th:nth-child(1) {
  width: 12%;
}
.fund-simulation-page .fund-excel-table th:nth-child(2) {
  width: 6%;
}
.fund-simulation-page .fund-excel-table th:nth-child(3),
.fund-simulation-page .fund-excel-table th:nth-child(4) {
  width: 9%;
}
.fund-simulation-page .fund-excel-table th:nth-child(5),
.fund-simulation-page .fund-excel-table th:nth-child(6) {
  width: 7%;
}
.fund-simulation-page .fund-excel-table th:nth-child(7),
.fund-simulation-page .fund-excel-table th:nth-child(8) {
  width: 13%;
}
.fund-simulation-page .fund-excel-table th:nth-child(9) {
  width: 8%;
}
.fund-simulation-page .fund-excel-table th:nth-child(10),
.fund-simulation-page .fund-excel-table th:nth-child(11) {
  width: 8%;
}
.fund-simulation-page .weekly-maturity-table {
  width: min(720px, 100%);
  min-width: 0;
  table-layout: fixed;
}
.fund-simulation-page .weekly-maturity-table th,
.fund-simulation-page .weekly-maturity-table td {
  padding: 10px 12px;
  font-size: 13px;
}
.fund-simulation-page .weekly-maturity-table th:nth-child(1) {
  width: 38%;
}
.fund-simulation-page .weekly-maturity-table th:nth-child(2) {
  width: 38%;
}
.fund-simulation-page .weekly-maturity-table th:nth-child(3) {
  width: 24%;
}
.fund-simulation-page .weekly-maturity-table tr.weekly-month-row td {
  padding: 12px 14px 8px;
  color: var(--teal);
  background: linear-gradient(90deg, rgba(103, 232, 215, 0.12), rgba(103, 232, 215, 0.025));
  border-top: 1px solid rgba(103, 232, 215, 0.28);
  border-bottom: 1px solid rgba(103, 232, 215, 0.16);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.week-date-range {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
}
@media (min-height: 840px) {
  .fund-simulation-page .fund-excel-table th,
  .fund-simulation-page .fund-excel-table td {
    padding-top: 6px;
    padding-bottom: 6px;
    font-size: 11px;
  }
}
@media (max-width: 900px) {
  .fund-simulation-page {
    height: auto;
    overflow: auto;
  }
  .portfolio-only-card {
    height: auto;
  }
  .portfolio-inline-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fund-sim-workspace {
    grid-template-columns: 1fr;
  }
  .portfolio-scenario-box,
  .scenario-control-grid,
  .scenario-result-grid,
  .portfolio-rules-box,
  .editable-rate-grid,
  .saved-scenario-form {
    grid-template-columns: 1fr;
  }
  .scenario-actions {
    flex-wrap: wrap;
  }
  .portfolio-only-card .register-table-wrap {
    overflow-x: auto;
  }
  .fund-excel-table {
    min-width: 980px;
  }
}
.deposit-register-table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.018);
}
.deposit-register-table tbody tr:hover {
  background: rgba(93, 232, 216, 0.055);
}
.deposit-register-table tbody tr.scenario-row-changed {
  background: linear-gradient(
    90deg,
    rgba(255, 78, 122, 0.28),
    rgba(255, 185, 54, 0.18) 48%,
    rgba(0, 225, 198, 0.12)
  );
  box-shadow:
    inset 4px 0 0 #ff4e7a,
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05);
}
.deposit-register-table tbody tr.scenario-row-changed:hover {
  background: linear-gradient(
    90deg,
    rgba(255, 78, 122, 0.34),
    rgba(255, 185, 54, 0.23) 48%,
    rgba(0, 225, 198, 0.16)
  );
}
.deposit-register-table tbody tr.scenario-row-changed .portfolio-mini-input {
  border-color: rgba(255, 201, 69, 0.48);
  background: rgba(26, 18, 31, 0.92);
}
.forecast-table {
  min-width: 1060px;
}
.forecast-table th:nth-child(1) {
  width: 20%;
}
.forecast-table th:nth-child(2) {
  width: 9%;
}
.forecast-table th:nth-child(3) {
  width: 16%;
}
.forecast-table th:nth-child(4) {
  width: 10%;
}
.forecast-table th:nth-child(5) {
  width: 14%;
}
.forecast-table th:nth-child(6) {
  width: 14%;
}
.forecast-table th:nth-child(7) {
  width: 10%;
}
.num-input {
  text-align: right;
}
.date-input {
  min-width: 140px;
}
.cash-split-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.cash-split-card strong {
  color: var(--teal);
}
.action-cell {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}
.mini-action {
  border: 1px solid rgba(93, 232, 216, 0.24);
  color: var(--text-muted);
  background: rgba(93, 232, 216, 0.055);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}
.mini-action:hover,
.mini-action.active {
  color: var(--teal);
  border-color: rgba(93, 232, 216, 0.56);
  background: rgba(93, 232, 216, 0.13);
}
.mini-action[data-mature].active {
  color: var(--gold);
  border-color: rgba(244, 199, 107, 0.54);
  background: rgba(244, 199, 107, 0.12);
}
.fund-base-kpis {
  grid-template-columns: repeat(4, 1fr);
}
.scenario-workbench,
.scenario-results-card {
  border-color: rgba(93, 232, 216, 0.2);
}
.scenario-input-table,
.scenario-output-table {
  min-width: 1040px;
}
.scenario-input-table th:nth-child(1) {
  width: 18%;
}
.scenario-input-table th:nth-child(2) {
  width: 14%;
}
.scenario-input-table th:nth-child(3) {
  width: 12%;
}
.scenario-input-table th:nth-child(4) {
  width: 14%;
}
.scenario-input-table th:nth-child(5) {
  width: 10%;
}
.scenario-input-table th:nth-child(6) {
  width: 12%;
}
.scenario-input-table th:nth-child(7) {
  width: 12%;
}
.scenario-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 4px 0 14px;
}
.scenario-summary-card strong {
  color: var(--teal);
}
.status-warn td:last-child {
  color: var(--gold);
  font-weight: 800;
}

/* Fund simulation: institutional compact dashboard style */
.fund-simulation-page {
  --bg: #080a10;
  --bg-elev: #11141e;
  --surface: #141824;
  --surface-2: #181d2b;
  --border: #242a3a;
  --border-soft: #1c2230;
  --text: #eef2f8;
  --text-muted: #8f98aa;
  --text-faint: #5f687a;
  --teal: #49a8b1;
  --gold: #e6a93d;
  background:
    radial-gradient(circle at top left, rgba(73, 168, 177, 0.05), transparent 34%), #080a10;
}
.fund-simulation-page .site-header {
  background: rgba(8, 10, 16, 0.96);
  border-bottom-color: #202637;
  box-shadow: none;
}
.fund-simulation-page .brand-mark,
.fund-simulation-page .site-nav a[aria-current="page"] {
  color: #58c1c7;
}
.fund-simulation-page .brand {
  gap: 14px;
}
.fund-simulation-page .brand-name {
  letter-spacing: 0.04em;
}
.fund-simulation-page .workbook-upload-card,
.fund-simulation-page .portfolio-only-card {
  border-color: #242a3a;
  background: #0f121b;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}
.fund-simulation-page .portfolio-only-card {
  height: auto;
  min-height: calc(100vh - 208px);
}
.fund-simulation-page .workbook-drop-zone {
  border-color: #283142;
  background: #121722;
}
.fund-simulation-page .card-head {
  align-items: flex-start;
  margin-bottom: 14px;
}
.fund-simulation-page .card-head h1 {
  margin: 0 0 6px;
  font-size: clamp(22px, 2vw, 30px);
  letter-spacing: -0.04em;
}
.fund-simulation-page .eyebrow {
  color: #8fd9dc;
  font-size: 10px;
  letter-spacing: 0.16em;
}
.fund-simulation-page .card-sub {
  max-width: 760px;
  color: #9ca7ba;
}
.fund-simulation-page .scenario-date.compact-stat {
  border-color: #242a3a;
  border-radius: 8px;
  background: #121722;
}
.fund-simulation-page .portfolio-inline-kpis {
  gap: 8px;
}
.fund-simulation-page .portfolio-inline-kpis article {
  min-height: 78px;
  border-color: #252b3b;
  border-radius: 7px;
  padding: 11px 13px;
  background: #131722;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}
.fund-simulation-page .portfolio-inline-kpis span {
  margin-bottom: 7px;
  color: #7f8898;
  font-size: 8px;
  letter-spacing: 0.11em;
}
.fund-simulation-page .portfolio-inline-kpis strong {
  color: var(--mist);
  font-size: clamp(15px, 1.25vw, 18px);
  letter-spacing: -0.02em;
}
.fund-simulation-page .portfolio-inline-kpis article:nth-child(3) strong {
  color: #44d089;
}
.fund-simulation-page .portfolio-inline-kpis small {
  margin-top: 5px;
  color: #98a2b3;
  font-size: 9px;
}
.fund-simulation-page .portfolio-inline-kpis small b {
  color: #e8b24f;
}
.weekly-calendar-wrap {
  overflow: visible;
}
.weekly-calendar-list {
  display: grid;
  gap: 18px;
}
.weekly-calendar-month {
  margin: 8px 0 -4px;
  color: #72dad8;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.weekly-calendar-card {
  border: 1px solid #263044;
  border-radius: 10px;
  background: linear-gradient(180deg, #151c2a, #111723);
  overflow: hidden;
}
.weekly-calendar-title {
  display: grid;
  gap: 4px;
  padding: 11px 12px 10px;
  border-bottom: 2px solid rgba(105, 216, 214, 0.65);
  background: linear-gradient(90deg, rgba(230, 169, 61, 0.1), rgba(105, 216, 214, 0.04));
}
.weekly-calendar-title strong {
  color: #f0c24f;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.weekly-calendar-title span {
  color: #f2f5fa;
  font-size: 12px;
  font-weight: 800;
}
.weekly-calendar-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(112px, 1fr)) minmax(150px, 0.72fr);
  min-height: 145px;
}
.weekly-day-cell,
.weekly-total-cell {
  min-width: 0;
  border-right: 1px solid #222a3a;
  padding: 9px 10px 10px;
  background: #111723;
}
.weekly-day-cell:nth-child(even) {
  background: #141b28;
}
.weekly-day-cell:last-of-type {
  border-right: 0;
}
.weekly-day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(105, 216, 214, 0.18);
}
.weekly-day-head strong {
  color: #69d8d6;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
}
.weekly-day-head span {
  color: #d9e0ea;
  font-size: 10px;
  font-weight: 800;
}
.weekly-holiday-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(240, 128, 137, 0.35);
  border-radius: 999px;
  padding: 3px 7px;
  color: #ffd0d4;
  background: rgba(240, 128, 137, 0.13);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.weekly-day-deals {
  display: grid;
  gap: 7px;
}
.weekly-deal-card {
  border: 1px solid rgba(105, 216, 214, 0.22);
  border-radius: 7px;
  padding: 8px 8px 7px;
  background: #223247;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}
.weekly-deal-card strong {
  display: block;
  color: #f5f7fb;
  font-size: clamp(11px, 0.82vw, 14px);
  line-height: 1.2;
  white-space: nowrap;
}
.weekly-deal-card span {
  display: block;
  margin-top: 4px;
  color: #f0c24f;
  font-size: 11px;
  font-weight: 900;
}
.weekly-deal-card small {
  display: block;
  margin-top: 3px;
  color: #a8b2c3;
  font-size: 9px;
}
.weekly-empty {
  color: #8f98aa;
  font-size: 11px;
  padding-top: 8px;
}
.weekly-total-cell {
  display: grid;
  align-content: center;
  gap: 8px;
  border-right: 0;
  border-left: 1px solid #293244;
  background: linear-gradient(180deg, rgba(230, 169, 61, 0.08), #151923);
}
.weekly-total-cell span {
  color: #69d8d6;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.weekly-total-cell strong {
  color: #f5f7fb;
  font-size: 17px;
}
.weekly-total-cell small {
  color: #f0c24f;
  font-size: 11px;
  font-weight: 900;
}
.weekly-total-cell em {
  color: #d9e0ea;
  font-size: 10px;
  font-style: normal;
}
.weekly-total-cell .week-view-button {
  justify-self: start;
  margin-top: 2px;
}
.fund-simulation-page .weekly-maturity-table {
  width: min(860px, 100%);
  color: #d7deea;
}
/* F-7: unclamped-overflow is a desktop affordance — at ≤900 it defeated the
   mobile overflow-x guard, so the weekly Table view could never pan. */
@media (min-width: 901px) {
  .fund-simulation-page .fund-sim-left-pane .register-table-wrap {
    flex: 0 0 auto;
    max-height: none;
    overflow: visible;
  }
}
.fund-simulation-page .weekly-maturity-table th:nth-child(1) {
  width: 34%;
}
.fund-simulation-page .weekly-maturity-table th:nth-child(2) {
  width: 34%;
}
.fund-simulation-page .weekly-maturity-table th:nth-child(3) {
  width: 18%;
}
.fund-simulation-page .weekly-maturity-table th:nth-child(4) {
  width: 14%;
}
.fund-simulation-page .weekly-maturity-table thead th {
  color: #7f8898;
  background: #10141e;
  border-bottom-color: #252b3b;
  font-size: 10px;
  letter-spacing: 0.15em;
}
.fund-simulation-page .weekly-maturity-table th,
.fund-simulation-page .weekly-maturity-table td {
  padding: 9px 12px;
  border-color: #222838;
}
.fund-simulation-page .weekly-maturity-table tr.weekly-month-row td {
  color: #69d8d6;
  background: #17212c;
  border-color: #253241;
}
.fund-simulation-page .deposit-register-table tbody tr:nth-child(odd) {
  background: #10141e;
}
.fund-simulation-page .deposit-register-table tbody tr:hover {
  background: #161c29;
}
.fund-simulation-page .portfolio-scenario-box,
.fund-simulation-page .portfolio-rules-box,
.fund-simulation-page .scenario-analysis-panel,
.fund-simulation-page .saved-scenario-panel,
.fund-simulation-page .scenario-result-grid article {
  border-color: #252b3b;
  border-radius: 8px;
  background: #131722;
  box-shadow: none;
}
.fund-simulation-page .portfolio-scenario-box {
  padding: 10px;
}
.fund-simulation-page .scenario-control-grid label span,
.fund-simulation-page .scenario-analysis-head span,
.fund-simulation-page .saved-scenario-head span {
  color: #d9a64b;
}
.fund-simulation-page .scenario-control-grid select,
.fund-simulation-page .scenario-control-grid input,
.fund-simulation-page .saved-scenario-form input {
  border-color: #273247;
  border-radius: 6px;
  background: #0b1019;
}
.fund-simulation-page .scenario-actions button:first-child,
.fund-simulation-page .saved-scenario-form button,
.fund-simulation-page .scenario-analysis-head button {
  border-radius: 6px;
  background: #e8e1d4;
  color: #151515;
  box-shadow: none;
}
.fund-simulation-page .scenario-actions button,
.fund-simulation-page .ghost-button {
  border-radius: 6px;
  background: #151924;
  border-color: #2a3245;
}
.fund-simulation-page .fund-sim-right-pane {
  overflow: visible;
}
@media (min-width: 901px) {
  .fund-simulation-page .portfolio-only-card .register-table-wrap {
    max-height: none;
    overflow: visible;
  }
}
.fund-simulation-page .fund-sim-workspace {
  grid-template-columns: minmax(520px, 0.92fr) minmax(520px, 1fr);
  align-items: start;
}
.fund-simulation-page .fund-sim-left-pane {
  display: contents;
}
.fund-simulation-page .portfolio-inline-kpis {
  order: 1;
  grid-column: 1 / -1;
  width: min(1040px, 100%);
}
.fund-simulation-page .fund-sim-right-pane {
  order: 2;
  grid-column: 1;
  width: 100%;
  justify-self: start;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.62fr);
  align-items: start;
}
.fund-simulation-page .fund-sim-left-pane .register-table-wrap {
  order: 3;
  grid-column: 2;
  width: 100%;
}

/* Fund Simulation UI polish */
.fund-simulation-page .portfolio-only-card {
  padding: 16px;
  background:
    radial-gradient(circle at 0% 0%, rgba(88, 193, 199, 0.1), transparent 34%),
    linear-gradient(180deg, #0f141f 0%, #0b0f17 100%);
}
.fund-simulation-page .card-head {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(105, 216, 214, 0.1);
}
.fund-simulation-page .card-head h1 {
  color: #f6f8fb;
  font-size: clamp(21px, 1.7vw, 26px);
}
.fund-simulation-page .card-sub {
  color: #a7b2c5;
  font-size: 12px;
}
.fund-simulation-page .fund-sim-workspace {
  grid-template-columns: minmax(650px, 0.98fr) minmax(500px, 1.02fr);
  gap: 14px;
}
.fund-simulation-page .portfolio-inline-kpis {
  width: 100%;
  gap: 9px;
}
.fund-simulation-page .portfolio-inline-kpis article {
  min-height: 72px;
  border: 1px solid rgba(105, 216, 214, 0.13);
  border-radius: 10px;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(27, 36, 54, 0.96), rgba(15, 21, 33, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.fund-simulation-page .portfolio-inline-kpis span {
  color: #8ea0b8;
  font-size: 8px;
}
.fund-simulation-page .portfolio-inline-kpis strong {
  font-size: clamp(14px, 1.1vw, 17px);
}
.fund-simulation-page .portfolio-inline-kpis article:nth-child(1) strong,
.fund-simulation-page .portfolio-inline-kpis article:nth-child(2) strong {
  color: #f6f1df;
}
.fund-simulation-page .portfolio-inline-kpis article:nth-child(3) strong {
  color: #36e59b;
}
.fund-simulation-page .portfolio-inline-kpis article:nth-child(4) strong {
  color: #f7c84b;
}
.fund-simulation-page .fund-sim-right-pane {
  gap: 10px;
  grid-template-columns: minmax(300px, 0.96fr) minmax(300px, 1.04fr);
}
.fund-simulation-page .portfolio-scenario-box,
.fund-simulation-page .portfolio-rules-box {
  border: 1px solid rgba(255, 180, 66, 0.22);
  border-radius: 12px;
  background: linear-gradient(
    135deg,
    rgba(128, 40, 55, 0.26),
    rgba(31, 27, 42, 0.92) 45%,
    rgba(13, 27, 43, 0.96)
  );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 18px 36px rgba(0, 0, 0, 0.2);
}
.fund-simulation-page .portfolio-scenario-box {
  padding: 11px;
}
.fund-simulation-page .portfolio-rules-box {
  padding: 10px;
  background: linear-gradient(135deg, rgba(24, 38, 53, 0.98), rgba(17, 22, 34, 0.98));
}
.fund-simulation-page .scenario-control-grid {
  gap: 7px;
}
.fund-simulation-page .scenario-control-grid label span,
.fund-simulation-page .scenario-analysis-head span,
.fund-simulation-page .saved-scenario-head span {
  color: #ffca5a;
  font-size: 8px;
}
.fund-simulation-page .scenario-control-grid select,
.fund-simulation-page .scenario-control-grid input,
.fund-simulation-page .saved-scenario-form input {
  min-height: 31px;
  border-color: rgba(255, 202, 90, 0.2);
  border-radius: 8px;
  background: rgba(10, 13, 21, 0.82);
  color: var(--mist);
  font-size: 11px;
}
.fund-simulation-page .scenario-actions button {
  min-height: 31px;
  padding: 6px 10px;
  font-size: 11px;
}
.fund-simulation-page .scenario-actions button:first-child,
.fund-simulation-page .saved-scenario-form button,
.fund-simulation-page .scenario-analysis-head button {
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffe6c8, #ffc7b0);
  color: #31151b;
  box-shadow: 0 8px 18px rgba(255, 137, 88, 0.18);
}
.fund-simulation-page .ghost-button {
  color: #b9c5d8;
}
.fund-simulation-page .scenario-result-grid {
  gap: 7px;
}
.fund-simulation-page .scenario-result-grid article {
  border-radius: 9px;
  padding: 7px 9px;
  background: rgba(9, 14, 24, 0.54);
}
.fund-simulation-page .scenario-result-grid strong {
  font-size: 14px;
}
.fund-simulation-page .scenario-analysis-panel,
.fund-simulation-page .saved-scenario-panel {
  border-radius: 10px;
  padding: 9px;
  background: rgba(9, 14, 24, 0.44);
}
.fund-simulation-page .scenario-analysis-head {
  gap: 8px;
}
.fund-simulation-page .scenario-analysis-head small,
.fund-simulation-page .saved-scenario-head small {
  color: #9daabd;
  font-size: 9px;
}
.fund-simulation-page .scenario-analysis-head {
  grid-template-columns: minmax(0, 1fr) auto;
}
.fund-simulation-page .scenario-analysis-head button {
  min-width: 128px;
}
.fund-simulation-page .saved-scenario-form {
  gap: 6px;
}
.fund-simulation-page .limit-summary-wrap {
  border-color: rgba(105, 216, 214, 0.16);
  border-radius: 10px;
}
.fund-simulation-page .limit-summary-table th {
  color: #7adfdf;
  background: rgba(14, 25, 38, 0.86);
}
.fund-simulation-page .limit-summary-table td {
  color: #d7deea;
}
.fund-simulation-page .weekly-maturity-table {
  width: 100%;
  border: 1px solid rgba(105, 216, 214, 0.12);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(9, 13, 22, 0.62);
}
.fund-simulation-page .weekly-maturity-table thead th {
  padding: 8px 10px;
  color: #8bdfe0;
  background: #101a27;
  font-size: 8px;
}
.fund-simulation-page .weekly-maturity-table th,
.fund-simulation-page .weekly-maturity-table td {
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.25;
}
.fund-simulation-page .weekly-maturity-table tr.weekly-month-row td {
  padding: 8px 10px;
  color: #7cf2e8;
  background: linear-gradient(90deg, rgba(34, 73, 91, 0.82), rgba(17, 31, 45, 0.96));
}
.fund-simulation-page .weekly-maturity-table tbody tr:not(.weekly-month-row):hover {
  background: rgba(105, 216, 214, 0.08);
}
.fund-simulation-page .week-date-range {
  margin-top: 2px;
  color: #9eabbf;
  font-size: 9px;
}
.fund-simulation-page .week-view-button {
  min-width: 48px;
  padding: 4px 9px;
  border-color: rgba(116, 216, 217, 0.36);
  color: #8ff4ed;
  background: rgba(23, 39, 54, 0.92);
}
.fund-simulation-page .week-view-button:hover {
  color: #071015;
  background: #8ff4ed;
}
.week-view-button {
  min-width: 52px;
  border: 1px solid #2b3a4c;
  border-radius: 999px;
  padding: 5px 10px;
  background: #151b27;
  color: #74d8d9;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.week-view-button:hover {
  border-color: rgba(116, 216, 217, 0.62);
  background: #182433;
}
.week-maturity-popup[hidden] {
  display: none;
}
.week-maturity-popup {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
}
.week-maturity-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 9, 0.72);
  backdrop-filter: blur(4px);
}
.week-maturity-panel {
  position: relative;
  width: min(1240px, calc(100vw - 40px));
  max-height: min(720px, calc(100vh - 48px));
  max-height: min(720px, calc(100dvh - 48px));
  display: flex;
  flex-direction: column;
  border: 1px solid #2a3245;
  border-radius: 12px;
  background: #0f121b;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.46);
  overflow: hidden;
}
.week-maturity-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid #232a3a;
  background: #121722;
}
.week-maturity-head h2 {
  margin: 5px 0 3px;
  font-size: 21px;
  letter-spacing: -0.035em;
}
.week-maturity-head p {
  margin: 0;
  color: #99a4b7;
  font-size: 12px;
}
.week-popup-close {
  width: 30px;
  height: 30px;
  border: 1px solid #2a3245;
  border-radius: 8px;
  background: #151a25;
  color: #e9eef7;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.week-maturity-body {
  display: grid;
  gap: 8px;
  padding: 14px 18px 18px;
  overflow: auto;
}
.week-maturity-body .popup-week-calendar-card {
  min-width: 1040px;
}
.week-maturity-body .weekly-calendar-title {
  padding: 10px 12px 9px;
}
.week-maturity-body .weekly-calendar-grid {
  grid-template-columns: repeat(5, minmax(132px, 1fr)) minmax(150px, 0.66fr);
  min-height: 126px;
}
.week-maturity-body .weekly-day-cell,
.week-maturity-body .weekly-total-cell {
  padding: 8px 9px 9px;
}
.week-maturity-body .weekly-deal-card strong {
  font-size: 13px;
}
.week-maturity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 0.32fr);
  gap: 14px;
  align-items: center;
  border: 1px solid #222938;
  border-radius: 10px;
  padding: 12px 14px;
  background: #131722;
}
.week-maturity-row strong {
  display: block;
  color: #f1f4f9;
  font-size: 16px;
  line-height: 1.2;
}
.week-maturity-row span {
  display: block;
  margin-top: 4px;
  color: #d2d9e5;
  font-size: 12px;
}
.week-maturity-row small {
  display: block;
  margin-top: 3px;
  color: #8f98aa;
  font-size: 11px;
}
.week-maturity-meta {
  text-align: right;
}
.week-maturity-meta span {
  margin: 0 0 5px;
  color: #7f8898;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.week-maturity-meta strong {
  color: #74d8d9;
  font-size: 13px;
}
.week-maturity-foot {
  display: flex;
  justify-content: flex-end;
  padding: 12px 18px 16px;
  border-top: 1px solid #232a3a;
  background: #10141e;
}
.calendar-link-button {
  border: 1px solid #2b3a4c;
  border-radius: 8px;
  padding: 8px 12px;
  color: #0e1219;
  background: #e8e1d4;
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
}
body.week-popup-open {
  overflow: hidden;
}

.rule-block-popup[hidden] {
  display: none !important;
}

.rule-block-popup {
  position: fixed !important;
  inset: 0 !important;
  z-index: 10000 !important;
  display: grid !important;
  place-items: center !important;
  padding: 24px !important;
}

.rule-block-backdrop {
  position: absolute !important;
  inset: 0 !important;
  background: rgba(3, 7, 14, 0.74) !important;
  backdrop-filter: blur(5px) !important;
}

.rule-block-panel {
  position: relative !important;
  width: min(560px, 94vw) !important;
  overflow: hidden !important;
  border: 2px solid rgba(241, 138, 150, 0.72) !important;
  border-radius: 14px !important;
  background:
    radial-gradient(520px 210px at 0% 0%, rgba(241, 138, 150, 0.18), transparent 62%),
    linear-gradient(180deg, #172033, #0f141f) !important;
  color: #eff6ff !important;
  box-shadow:
    0 26px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.055) inset !important;
}

.rule-block-head {
  display: flex !important;
  justify-content: space-between !important;
  gap: 16px !important;
  padding: 18px 20px 14px !important;
  border-bottom: 1px solid rgba(241, 138, 150, 0.22) !important;
}

.rule-block-head h2 {
  margin: 3px 0 5px !important;
  color: #ffffff !important;
  font-size: 21px !important;
  letter-spacing: -0.03em !important;
}

.rule-block-head p {
  margin: 0 !important;
  color: #f7b7bf !important;
  font-size: 13px !important;
  font-weight: 800 !important;
}

.rule-block-body {
  padding: 16px 20px 18px !important;
}

.rule-block-body ul {
  display: grid !important;
  gap: 9px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.rule-block-body li {
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  border-left: 3px solid rgba(241, 138, 150, 0.82) !important;
  border-radius: 8px !important;
  padding: 9px 11px !important;
  background: rgba(6, 10, 18, 0.52) !important;
  color: #dfe7f2 !important;
  font-size: 13px !important;
}

.rule-block-foot {
  display: flex !important;
  justify-content: flex-end !important;
  padding: 13px 20px 18px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.rule-block-foot button {
  min-width: 92px !important;
}

body.rule-block-open {
  overflow: hidden;
}

.renewal-popup[hidden] {
  display: none !important;
}

.renewal-popup {
  position: fixed !important;
  inset: 0 !important;
  z-index: 10001 !important;
  display: grid !important;
  place-items: center !important;
  padding: 24px !important;
}

.renewal-backdrop {
  position: absolute !important;
  inset: 0 !important;
  background: rgba(3, 7, 14, 0.76) !important;
  backdrop-filter: blur(6px) !important;
}

.renewal-panel {
  position: relative !important;
  width: min(560px, 94vw) !important;
  overflow: hidden !important;
  border: 2px solid rgba(86, 185, 193, 0.72) !important;
  border-radius: 14px !important;
  background:
    radial-gradient(520px 210px at 0% 0%, rgba(86, 185, 193, 0.18), transparent 62%),
    linear-gradient(180deg, #172033, #0f141f) !important;
  color: #eff6ff !important;
  box-shadow:
    0 26px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.055) inset !important;
}

.renewal-head {
  display: flex !important;
  justify-content: space-between !important;
  gap: 16px !important;
  padding: 18px 20px 14px !important;
  border-bottom: 1px solid rgba(86, 185, 193, 0.22) !important;
}

.renewal-head h2 {
  margin: 3px 0 5px !important;
  color: #ffffff !important;
  font-size: 21px !important;
  letter-spacing: -0.03em !important;
}

.renewal-head p {
  margin: 0 !important;
  color: #bceff3 !important;
  font-size: 13px !important;
  font-weight: 800 !important;
}

.renewal-body {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 12px !important;
  padding: 16px 20px 18px !important;
}

.renewal-deal-info {
  grid-column: 1 / -1 !important;
  display: grid !important;
  gap: 4px !important;
  border: 1px solid rgba(86, 185, 193, 0.24) !important;
  border-left: 4px solid rgba(86, 185, 193, 0.88) !important;
  border-radius: 10px !important;
  padding: 11px 12px !important;
  background: rgba(5, 12, 22, 0.58) !important;
}

.renewal-deal-info strong {
  color: #ffffff !important;
  font-size: 15px !important;
  font-weight: 950 !important;
}

.renewal-deal-info span {
  color: #72f0e8 !important;
  font-size: 14px !important;
  font-weight: 950 !important;
}

.renewal-deal-info small {
  color: #9fb2c6 !important;
  font-size: 11px !important;
  font-weight: 800 !important;
}

.renewal-body label {
  display: grid !important;
  gap: 6px !important;
  color: #a8bad0 !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
}

.renewal-body input {
  border: 1px solid rgba(86, 185, 193, 0.38) !important;
  border-radius: 9px !important;
  background: rgba(5, 11, 20, 0.58) !important;
  color: #e8fbff !important;
  font-size: 15px !important;
  font-weight: 900 !important;
  padding: 10px 11px !important;
  outline: none !important;
}

.renewal-body input:focus {
  border-color: rgba(117, 232, 239, 0.9) !important;
  box-shadow: 0 0 0 3px rgba(86, 185, 193, 0.18) !important;
}

.renewal-foot {
  display: flex !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  padding: 13px 20px 18px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
}

.renewal-foot button {
  min-width: 112px !important;
}

body.renewal-popup-open {
  overflow: hidden;
}

@media (max-width: 620px) {
  .renewal-body {
    grid-template-columns: 1fr !important;
  }
}
.sim-table td,
.sim-table th {
  vertical-align: middle;
}
.sim-notes {
  background: rgba(14, 29, 47, 0.72);
}

@media (max-width: 1120px) {
  .sim-kpis,
  .forecast-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
  .existing-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
  .fund-base-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
  .scenario-card-grid {
    grid-template-columns: 1fr;
  }
  .cash-split-grid {
    grid-template-columns: 1fr;
  }
  .snapshot-cards,
  .distribution-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 760px) {
  .sim-section-head {
    grid-template-columns: 1fr;
  }
  .sim-kpis,
  .forecast-kpis,
  .existing-kpis,
  .fund-base-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
  .rollover-list {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 520px) {
  .sim-kpis {
    grid-template-columns: 1fr;
  }
}

/* Maturity calendar */
.calendar-page {
  --bg: #101827;
  --bg-elev: #162236;
  --surface: #1c2b42;
  --surface-2: #223651;
  --border: #2c435f;
  --border-soft: #23364e;
  --text: #ffffff;
  --text-muted: #d8e2f0;
  --text-faint: #a9b8ce;
  --teal: #56ffe7;
  --teal-dim: #35b9aa;
  --teal-deep: #118074;
  --slate: #7ea0c5;
  --gold: #ffd166;
  --rose: #ff8fab;
  --err: #f18a96;
}
.calendar-page body,
body.calendar-page {
  background:
    radial-gradient(900px 420px at 88% -8%, rgba(114, 228, 212, 0.13), transparent 58%),
    radial-gradient(760px 460px at -8% 8%, rgba(243, 195, 107, 0.1), transparent 62%), var(--bg);
}
.calendar-page .site-header {
  background: rgba(16, 24, 39, 0.88);
  border-bottom-color: var(--border-soft);
}
.calendar-page .brand-sub,
.calendar-page .meta-label,
.calendar-page .meta-value,
.calendar-page .card-sub {
  color: var(--text-muted);
}
.calendar-main {
  gap: 18px;
}
.calendar-only-card {
  padding: 20px;
}
.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}
@media (max-width: 1180px) {
  .calendar-layout {
    grid-template-columns: 1fr;
  }
}

.control-row {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
}
.control-row label {
  display: grid;
  gap: 5px;
  min-width: 190px;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.control-row select,
.control-row button {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
}
.control-row button {
  cursor: pointer;
  color: var(--teal);
  border-color: rgba(103, 232, 215, 0.28);
}
.control-row button:hover {
  background: rgba(103, 232, 215, 0.08);
}

.calendar-weeks {
  display: grid;
  gap: 22px;
}
.month-section {
  display: grid;
  gap: 16px;
  border: 1px solid rgba(114, 228, 212, 0.22);
  border-radius: 20px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(114, 228, 212, 0.055), rgba(10, 18, 30, 0.2)),
    rgba(10, 18, 30, 0.38);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.month-section + .month-section {
  margin-top: 18px;
}
.month-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(114, 228, 212, 0.26);
  border-radius: 14px;
  padding: 16px 18px;
  background: linear-gradient(90deg, rgba(114, 228, 212, 0.18), rgba(243, 195, 107, 0.09));
}
.month-section-head h3 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--teal);
  text-transform: uppercase;
}
.month-section-head p {
  margin: 2px 0 0;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
}
.month-section-total {
  color: var(--teal);
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
}
.month-weeks {
  display: grid;
  gap: 12px;
}
.week-card {
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(22, 34, 54, 0.78);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.2);
}
.month-weeks .week-card:nth-child(odd) {
  background: rgba(21, 36, 58, 0.92);
  border-color: rgba(114, 228, 212, 0.18);
}
.month-weeks .week-card:nth-child(even) {
  background: rgba(34, 45, 67, 0.92);
  border-color: rgba(243, 195, 107, 0.18);
}
.week-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.035);
}
.month-weeks .week-card:nth-child(odd) .week-summary {
  background: linear-gradient(90deg, rgba(114, 228, 212, 0.13), rgba(114, 228, 212, 0.04));
}
.month-weeks .week-card:nth-child(even) .week-summary {
  background: linear-gradient(90deg, rgba(243, 195, 107, 0.12), rgba(243, 195, 107, 0.035));
}
.week-title {
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.week-range {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}
.week-total {
  color: var(--teal);
  text-align: right;
}
.week-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(138px, 0.82fr);
}
.calendar-day {
  min-height: 154px;
  border-right: 1px solid var(--border-soft);
  padding: 10px;
  background: rgba(28, 43, 66, 0.86);
}
.month-weeks .week-card:nth-child(odd) .calendar-day {
  background: rgba(25, 42, 66, 0.86);
}
.month-weeks .week-card:nth-child(even) .calendar-day {
  background: rgba(38, 49, 70, 0.86);
}
.calendar-day.weekend {
  background: linear-gradient(135deg, rgba(243, 195, 107, 0.15), rgba(243, 195, 107, 0.055));
}
.calendar-day.holiday {
  background:
    linear-gradient(135deg, rgba(224, 122, 139, 0.16), rgba(224, 179, 65, 0.08)),
    rgba(36, 42, 62, 0.9);
  box-shadow: inset 0 4px 0 rgba(224, 122, 139, 0.72);
}
.calendar-day.has-maturity {
  box-shadow: inset 0 4px 0 rgba(114, 228, 212, 0.72);
}
.calendar-day.holiday.has-maturity {
  box-shadow:
    inset 0 4px 0 rgba(224, 122, 139, 0.72),
    inset 0 8px 0 rgba(114, 228, 212, 0.58);
}
.day-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 6px;
}
.weekday {
  color: var(--teal);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.date {
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}
.weekend-label,
.holiday-label,
.valuation-label {
  display: inline-block;
  margin-bottom: 6px;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.weekend-label {
  color: var(--gold);
  background: rgba(224, 179, 65, 0.1);
  border: 1px solid rgba(224, 179, 65, 0.25);
}
.holiday-label {
  color: #ffd4dc;
  background: rgba(224, 122, 139, 0.13);
  border: 1px solid rgba(224, 122, 139, 0.34);
  font-weight: 900;
}
.valuation-label {
  color: var(--teal);
  background: rgba(103, 232, 215, 0.08);
  border: 1px solid rgba(103, 232, 215, 0.24);
  font-weight: 900;
}
.day-total {
  color: var(--teal);
  font-size: 11px;
  margin: 6px 0;
}
.day-deposits {
  display: grid;
  gap: 6px;
}
.deposit-pill {
  border: 1px solid rgba(114, 228, 212, 0.22);
  background: rgba(114, 228, 212, 0.08);
  border-radius: 7px;
  padding: 7px;
}
.deposit-amount {
  display: block;
  color: #ffffff;
  font-weight: 900;
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  text-shadow: 0 0 14px rgba(86, 255, 231, 0.12);
}
.deposit-bank {
  display: block;
  font-weight: 900;
  color: var(--gold);
  font-size: 13px;
  line-height: 1.25;
  margin-top: 3px;
}
.deposit-maturity-date {
  display: block;
  color: #9fe7e9;
  font-size: 10px;
  line-height: 1.25;
  margin-top: 4px;
  font-weight: 900;
  letter-spacing: 0.01em;
}
.deposit-meta {
  display: block;
  color: var(--text-faint);
  font-size: 9px;
  line-height: 1.25;
  margin-top: 4px;
  font-weight: 600;
}

.portfolio-clear-button {
  margin-top: 8px;
  width: 100%;
  justify-content: center;
  font-size: 11px !important;
  min-height: 30px !important;
  color: #f2c4c4 !important;
  border-color: rgba(221, 105, 116, 0.35) !important;
  background: rgba(221, 105, 116, 0.08) !important;
}

.portfolio-clear-button:hover {
  border-color: rgba(221, 105, 116, 0.62) !important;
  background: rgba(221, 105, 116, 0.14) !important;
}
.portfolio-lock-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 26px;
  margin-bottom: 8px;
  border: 1px solid rgba(85, 199, 207, 0.34);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(85, 199, 207, 0.16), rgba(241, 199, 181, 0.1));
  color: #9fe7e9;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035);
}
.empty-day {
  color: var(--text-faint);
  font-size: 12px;
  margin-top: 14px;
}

.calendar-summary-cell {
  min-height: 154px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  border-left: 1px solid var(--border-soft);
}
.week-total-cell {
  background: linear-gradient(180deg, rgba(114, 228, 212, 0.16), rgba(114, 228, 212, 0.06));
}
.month-weeks .week-card:nth-child(even) .week-total-cell {
  background: linear-gradient(180deg, rgba(243, 195, 107, 0.16), rgba(243, 195, 107, 0.055));
}
.month-total-cell {
  background: linear-gradient(180deg, rgba(243, 195, 107, 0.17), rgba(243, 195, 107, 0.06));
}
.month-end-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid rgba(243, 195, 107, 0.26);
  border-radius: 14px;
  padding: 16px 18px;
  background: linear-gradient(90deg, rgba(243, 195, 107, 0.18), rgba(114, 228, 212, 0.07));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.month-end-value {
  text-align: right;
}
.summary-title {
  color: var(--teal);
  font-size: 10px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  font-weight: 700;
}
.summary-amount {
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
}
.summary-note {
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
}
.summary-sub {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.maturity-list {
  display: grid;
  gap: 12px;
  max-height: 900px;
  overflow: auto;
  padding-right: 3px;
}
.maturity-group {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.maturity-group-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  font-weight: 700;
}
.maturity-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-top: 1px solid var(--border-soft);
}
.maturity-meta {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 2px;
}
.maturity-item .num span {
  color: var(--text-muted);
  font-size: 11px;
}

.deposit-aum-pct,
.weekly-deal-card .deal-aum-pct {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border: 1px solid rgba(97, 219, 219, 0.34);
  border-radius: 999px;
  padding: 2px 7px;
  color: #9ff4f0;
  background: rgba(97, 219, 219, 0.1);
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.01em;
}

@media (max-width: 900px) {
  .month-section-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .month-end-total {
    flex-direction: column;
    align-items: flex-start;
  }
  .month-end-value {
    text-align: left;
  }
  .week-grid {
    grid-template-columns: 1fr;
  }
  .calendar-day {
    min-height: 0;
    border-right: none;
    border-bottom: 1px solid var(--border-soft);
  }
  .calendar-day:last-child {
    border-bottom: none;
  }
  .calendar-summary-cell {
    min-height: 0;
    border-left: none;
    border-bottom: 1px solid var(--border-soft);
  }
  .week-summary {
    flex-direction: column;
  }
  .week-total {
    text-align: left;
  }
}

/* Notes */
.notes-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 22px;
}
@media (max-width: 880px) {
  .notes-list {
    grid-template-columns: 1fr;
  }
}
.notes-list li {
  padding: 8px 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  border-bottom: 1px dashed var(--border-soft);
}
.notes-list li strong {
  color: var(--text);
  font-weight: 600;
}
.notes-list li em {
  color: var(--text);
  font-style: normal;
  background: rgba(255, 255, 255, 0.04);
  padding: 1px 4px;
  border-radius: 3px;
}

/* Data quality */
.data-quality .dq-body {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
  max-width: 92ch;
}
.mono.err {
  color: var(--err);
  background: rgba(240, 128, 137, 0.08);
  padding: 1px 5px;
  border-radius: 3px;
}
.status-pill {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(224, 179, 65, 0.1);
  border: 1px solid rgba(224, 179, 65, 0.35);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}

/* Footer */
.site-footer {
  color: var(--text-faint);
  font-size: 12px;
  padding: 8px 0 4px;
  border-top: 1px solid var(--border-soft);
}

/* Focus */
:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* Site-wide institutional dashboard style — aligned to the reference UI */
:root {
  --bg: #0b0d13;
  --bg-elev: #11151f;
  --surface: #151a25;
  --surface-2: #171d2a;
  --border: #252b38;
  --border-soft: #1c2230;
  --text: #eef3fb;
  --text-muted: #9ca7b8;
  --text-faint: #697486;
  --teal: #55c7cf;
  --teal-dim: #3f9fa7;
  --gold: #f2ad32;
  --rose: #ef6a78;
  --err: #ff6b7b;
}
body {
  background:
    radial-gradient(circle at 18% 0%, rgba(85, 199, 207, 0.08), transparent 28%),
    linear-gradient(180deg, #0d1017 0%, #090b10 100%);
  color: var(--text);
}
.card,
.workbook-upload-card,
.sim-panel,
.calendar-only-card,
.editable-rate-panel,
.standalone-rate-panel,
.portfolio-only-card,
.calendar-month-section,
.week-card,
.month-total-box,
.kpi,
.mini-kpi,
.sim-kpi,
.compact-stat {
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  background: linear-gradient(180deg, #151923 0%, #11151f 100%) !important;
  box-shadow: none !important;
}
.card-head,
.compact-card-head {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.eyebrow,
.upload-kicker,
.calendar-month-title,
.weekly-calendar-month,
.editable-rate-title span,
.compact-stat span,
.kpi-label,
.mini-kpi-label,
.sim-kpi span {
  color: #8da0b7 !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
}
.card h1,
.card h2,
.calendar-month-title,
.editable-rate-panel h1,
.editable-rate-panel h2 {
  color: #f5f7fb !important;
}
.card-sub,
.workbook-upload-status,
.workbook-drop-zone small,
.mini-kpi-note,
.sim-kpi small,
.notes-list li {
  color: var(--text-muted) !important;
}
.workbook-upload-card {
  padding: 10px !important;
}
.workbook-drop-zone {
  min-height: 64px !important;
  border: 1px solid var(--border) !important;
  border-radius: 7px !important;
  background: #131722 !important;
}
.workbook-drop-zone:hover,
.workbook-drop-zone.drag-active {
  border-color: rgba(85, 199, 207, 0.55) !important;
  background: #171d2a !important;
  transform: none !important;
}
button,
.ghost-button,
.calendar-link-button,
.week-view-button,
.rate-sheet-actions button,
.scenario-actions button,
.saved-scenario-form button {
  border-radius: 7px !important;
  border: 1px solid #2a3344 !important;
  background: #171d2a !important;
  color: #c7d2e1 !important;
  box-shadow: none !important;
}
button:hover,
.ghost-button:hover,
.calendar-link-button:hover,
.week-view-button:hover,
.rate-sheet-actions button:hover,
.scenario-actions button:hover,
.saved-scenario-form button:hover {
  border-color: rgba(85, 199, 207, 0.55) !important;
  background: #1c2432 !important;
  color: #ffffff !important;
}
.scenario-actions button:first-child,
.saved-scenario-form button,
.scenario-analysis-head button {
  background: #f1c7b5 !important;
  color: #241318 !important;
  border-color: transparent !important;
}
.data-table,
.deposit-register-table,
.editable-rate-table,
.limit-summary-table {
  border-collapse: separate !important;
  border-spacing: 0 !important;
  color: #d9e1ec !important;
}
.data-table th,
.deposit-register-table th,
.editable-rate-table th,
.limit-summary-table th {
  color: #8390a3 !important;
  background: #11151f !important;
  border-bottom: 1px solid #252b38 !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
}
.data-table td,
.deposit-register-table td,
.editable-rate-table td,
.limit-summary-table td {
  border-bottom: 1px solid #202635 !important;
  background: transparent !important;
}
.data-table tbody tr:nth-child(odd),
.deposit-register-table tbody tr:nth-child(odd),
.editable-rate-table tbody tr:nth-child(odd) {
  background: rgba(255, 255, 255, 0.012) !important;
}
.data-table tbody tr:hover,
.deposit-register-table tbody tr:hover,
.editable-rate-table tbody tr:hover {
  background: rgba(85, 199, 207, 0.055) !important;
}
.kpi::before {
  background: var(--teal) !important;
}
.kpi-value,
.mini-kpi-value,
.sim-kpi strong,
.compact-stat strong {
  color: var(--mist) !important;
}
.wam-safe,
#scenarioWam,
.fund-simulation-page .portfolio-inline-kpis article:nth-child(3) strong {
  color: #39d895 !important;
}
.wam-watch,
.week-total strong,
.month-total-box strong,
.fund-simulation-page .portfolio-inline-kpis article:nth-child(4) strong {
  color: var(--gold) !important;
}
.wam-danger,
.limit-status.low {
  color: var(--err) !important;
}
.status-pill,
.chip,
.limit-status {
  border-radius: 999px !important;
  border-color: rgba(85, 199, 207, 0.28) !important;
  background: rgba(85, 199, 207, 0.08) !important;
  color: var(--teal) !important;
}
.portfolio-scenario-box,
.portfolio-rules-box,
.scenario-analysis-panel,
.saved-scenario-panel,
.scenario-result-grid article,
.limit-summary-wrap {
  border-color: var(--border) !important;
  border-radius: 8px !important;
  background: #151923 !important;
}

.fund-simulation-page .fund-sim-right-pane {
  display: flex !important;
  flex-direction: column !important;
  grid-template-columns: none !important;
  align-items: stretch !important;
  grid-column: 2 !important;
  grid-row: 2 !important;
}

.fund-simulation-page .fund-sim-left-pane .register-table-wrap {
  grid-column: 1 !important;
  grid-row: 2 !important;
}

.fund-simulation-page .portfolio-rules-box {
  width: 100% !important;
  margin-top: 0 !important;
}

.fund-simulation-page .portfolio-rules-box .limit-summary-wrap {
  width: 100% !important;
}

.subscription-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 7px;
}

.scenario-control-grid select,
.scenario-control-grid input,
.saved-scenario-form input,
.editable-rate-table input,
.portfolio-mini-input,
.scenario-date input,
.sim-input {
  border: 1px solid #252d3d !important;
  border-radius: 6px !important;
  background: #0d1119 !important;
  color: #eef3fb !important;
}
.calendar-month-section {
  padding: 12px !important;
}
.calendar-month-title {
  border-bottom: 1px solid #252b38 !important;
  padding-bottom: 8px !important;
}
.week-card {
  overflow: hidden !important;
}
.week-header,
.weekly-calendar-title {
  background: #151923 !important;
  border-bottom: 1px solid #2c3444 !important;
}
.calendar-day,
.weekly-day-cell,
.calendar-summary-cell,
.weekly-total-cell {
  background: #121722 !important;
  border-color: #232a39 !important;
}
.calendar-day:nth-child(even),
.weekly-day-cell:nth-child(even) {
  background: #151b27 !important;
}
.deposit-card,
.weekly-deal-card {
  border-color: rgba(85, 199, 207, 0.24) !important;
  border-radius: 6px !important;
  background: #203047 !important;
}
.deposit-card strong,
.weekly-deal-card strong {
  color: #ffffff !important;
}
.deposit-card span,
.weekly-deal-card span {
  color: var(--gold) !important;
}

.portfolio-page .portfolio-only-card {
  border-color: rgba(85, 199, 207, 0.22) !important;
  background:
    linear-gradient(180deg, rgba(19, 26, 38, 0.98), rgba(12, 17, 27, 0.99)), #101620 !important;
}

.portfolio-page .portfolio-only-card .card-head {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(37, 43, 56, 0.9);
}

.portfolio-page .portfolio-only-card .card-sub::after {
  content: " Read only: upload a new Excel workbook to refresh; cells in this page are locked.";
  color: #9fe7e9;
  font-weight: 800;
}

.portfolio-page .forecast-table-wrap {
  border: 1px solid #252b38;
  border-radius: 10px;
  background: #101620;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
  overflow-x: auto !important;
  overflow-y: auto !important;
}

.portfolio-page .fund-excel-table {
  border-radius: 10px;
  overflow: hidden;
  min-width: 1280px !important;
  table-layout: auto !important;
}

.portfolio-page .fund-sim-workspace {
  grid-template-columns: minmax(0, 2.45fr) minmax(330px, 0.55fr) !important;
  gap: 14px !important;
}

.portfolio-page .fund-excel-table th,
.portfolio-page .fund-excel-table td {
  padding: 8px 10px !important;
  font-size: 11.5px !important;
  line-height: 1.25 !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

.portfolio-page .fund-excel-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: linear-gradient(180deg, #171e2b, #11151f) !important;
  color: #a7b5c9 !important;
  box-shadow: inset 0 -1px 0 #303849;
}

.portfolio-page .fund-excel-table th:nth-child(1) {
  min-width: 150px !important;
}
.portfolio-page .fund-excel-table th:nth-child(2) {
  min-width: 78px !important;
}
.portfolio-page .fund-excel-table th:nth-child(3),
.portfolio-page .fund-excel-table th:nth-child(4) {
  min-width: 126px !important;
}
.portfolio-page .fund-excel-table th:nth-child(5),
.portfolio-page .fund-excel-table th:nth-child(6) {
  min-width: 94px !important;
}
.portfolio-page .fund-excel-table th:nth-child(7),
.portfolio-page .fund-excel-table th:nth-child(8) {
  min-width: 168px !important;
}
.portfolio-page .fund-excel-table th:nth-child(9) {
  min-width: 98px !important;
}
.portfolio-page .fund-excel-table th:nth-child(10) {
  min-width: 112px !important;
}

.portfolio-page .fund-excel-table tbody tr:nth-child(4n + 1) {
  background: rgba(85, 199, 207, 0.028) !important;
}

.portfolio-page .fund-excel-table tbody tr:nth-child(4n + 2) {
  background: rgba(241, 199, 181, 0.03) !important;
}

.portfolio-page .fund-excel-table tbody tr:nth-child(4n + 3) {
  background: rgba(224, 179, 65, 0.026) !important;
}

.portfolio-page .fund-excel-table tbody tr:nth-child(4n) {
  background: rgba(255, 255, 255, 0.014) !important;
}

.portfolio-page .fund-excel-table tbody tr:hover {
  background: rgba(85, 199, 207, 0.095) !important;
  box-shadow: inset 3px 0 0 #55c7cf;
}

.portfolio-page .portfolio-chart-panel,
.dashboard-page .portfolio-chart-panel {
  display: grid;
  grid-template-columns: minmax(430px, 1.12fr) minmax(340px, 0.86fr) minmax(250px, 0.58fr);
  gap: 14px;
  margin: 2px 0 14px;
}

.portfolio-page .portfolio-chart-card,
.dashboard-page .portfolio-chart-card {
  border: 1px solid rgba(85, 199, 207, 0.18);
  border-radius: 14px;
  background:
    radial-gradient(600px 220px at 12% -20%, rgba(85, 199, 207, 0.13), transparent 62%),
    linear-gradient(180deg, rgba(18, 25, 37, 0.98), rgba(13, 18, 28, 0.99));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 14px 30px rgba(0, 0, 0, 0.22);
  padding: 14px;
  min-height: 236px;
}

.portfolio-page .portfolio-chart-head,
.dashboard-page .portfolio-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.portfolio-page .portfolio-chart-head,
.dashboard-page .portfolio-chart-head h2 {
  margin: 2px 0 0;
  color: #f5f8fc;
  font-size: 17px;
  line-height: 1.12;
}

.portfolio-page .chart-note {
  border: 1px solid rgba(85, 199, 207, 0.22);
  border-radius: 999px;
  padding: 5px 9px;
  color: #8fdde3;
  background: rgba(85, 199, 207, 0.065);
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.portfolio-page .portfolio-bank-chart {
  min-height: 172px;
}

.portfolio-page .portfolio-pie-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.portfolio-page .portfolio-pie-wrap {
  position: relative;
  width: 184px;
  height: 184px;
  margin: 0 auto;
}

.portfolio-page .portfolio-pie,
.dashboard-page .portfolio-pie {
  width: 100%;
  height: 100%;
  border: 1px solid rgba(85, 199, 207, 0.22);
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.045),
    0 18px 34px rgba(0, 0, 0, 0.22);
}

.portfolio-page .portfolio-pie-center,
.dashboard-page .portfolio-pie-center {
  position: absolute;
  inset: 42px;
  display: grid;
  place-items: center;
  align-content: center;
  border: 1px solid rgba(85, 199, 207, 0.16);
  border-radius: 50%;
  background: #0f1520;
  text-align: center;
}

.portfolio-page .portfolio-pie-center,
.dashboard-page .portfolio-pie-center span,
.portfolio-page .portfolio-pie-center,
.dashboard-page .portfolio-pie-center small {
  color: #8b97aa;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portfolio-page .portfolio-pie-center,
.dashboard-page .portfolio-pie-center strong {
  color: #ffffff;
  font-size: 18px;
  font-weight: 950;
}

.portfolio-page .portfolio-pie-legend,
.dashboard-page .portfolio-pie-legend {
  display: grid;
  gap: 6px;
}

.portfolio-page .portfolio-pie-legend,
.dashboard-page .portfolio-pie-legend-row {
  display: grid;
  grid-template-columns: 10px minmax(70px, 1fr) 66px 78px;
  align-items: center;
  gap: 8px;
  min-height: 24px;
}

.portfolio-page .portfolio-pie-legend,
.dashboard-page .portfolio-pie-legend-row i {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--legend-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--legend-color), transparent 72%);
}

.portfolio-page .portfolio-pie-legend,
.dashboard-page .portfolio-pie-legend-row span {
  overflow: hidden;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portfolio-page .portfolio-pie-legend,
.dashboard-page .portfolio-pie-legend-row strong,
.portfolio-page .portfolio-tenor-top span {
  color: #9fe7e9;
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

.portfolio-page .portfolio-pie-legend,
.dashboard-page .portfolio-pie-legend-row em {
  color: #8b97aa;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  text-align: right;
}

.portfolio-page .portfolio-bar-track {
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(85, 199, 207, 0.14);
  border-radius: 999px;
  background: rgba(7, 11, 18, 0.62);
}

.portfolio-page .portfolio-bar-track i {
  display: block;
  width: var(--bar-pct);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #56c8d0, #e0b341);
  box-shadow: 0 0 18px rgba(85, 199, 207, 0.18);
}

.portfolio-page .portfolio-tenor-chart,
.dashboard-page .portfolio-tenor-chart {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  height: calc(100% - 42px);
  align-items: stretch;
}

.portfolio-page .portfolio-tenor-item,
.dashboard-page .portfolio-tenor-item {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-height: 150px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  background: rgba(9, 14, 22, 0.52);
  padding: 11px;
}

.portfolio-page .portfolio-tenor-top {
  display: grid;
  gap: 6px;
}

.portfolio-page .portfolio-tenor-top strong {
  color: #ffffff;
  font-size: 18px;
  font-weight: 950;
}

.portfolio-page .portfolio-tenor-item,
.dashboard-page .portfolio-tenor-item .portfolio-bar-track {
  height: 90px;
  display: flex;
  align-items: flex-end;
  border-radius: 10px;
}

.portfolio-page .portfolio-tenor-item,
.dashboard-page .portfolio-tenor-item .portfolio-bar-track i {
  width: 100%;
  height: var(--bar-pct);
  min-height: 2px;
  background: linear-gradient(180deg, #e0b341, #56c8d0);
}

.portfolio-page .portfolio-tenor-item,
.dashboard-page .portfolio-tenor-item small {
  color: #8b97aa;
  font-size: 10px;
  font-weight: 850;
}

.portfolio-page .portfolio-chart-empty {
  border: 1px dashed rgba(85, 199, 207, 0.22);
  border-radius: 12px;
  padding: 18px;
  color: #8b97aa;
  text-align: center;
}

.portfolio-page .portfolio-currency-chart {
  min-height: 172px;
}

.portfolio-page .portfolio-currency-pie-layout {
  display: grid;
  gap: 14px;
  justify-items: center;
}

.portfolio-page .portfolio-currency-pie-wrap {
  width: 156px;
  height: 156px;
}

.portfolio-page .portfolio-currency-pie-wrap .portfolio-pie-center,
.dashboard-page .portfolio-currency-pie-wrap .portfolio-pie-center {
  inset: 35px;
}

.portfolio-page .portfolio-currency-pie-wrap .portfolio-pie-center,
.dashboard-page .portfolio-currency-pie-wrap .portfolio-pie-center strong {
  font-size: 12px;
}

.portfolio-page .portfolio-currency-legend,
.dashboard-page .portfolio-currency-legend {
  display: grid;
  gap: 8px;
  width: 100%;
}

.portfolio-page .portfolio-currency-legend,
.dashboard-page .portfolio-currency-legend-row {
  display: grid;
  grid-template-columns: 10px 44px 64px minmax(72px, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 26px;
}

.portfolio-page .portfolio-currency-legend,
.dashboard-page .portfolio-currency-legend-row i {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--legend-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--legend-color), transparent 72%);
}

.portfolio-page .portfolio-currency-legend,
.dashboard-page .portfolio-currency-legend-row span {
  color: #ffffff;
  font-size: 12px;
  font-weight: 950;
}

.portfolio-page .portfolio-currency-legend,
.dashboard-page .portfolio-currency-legend-row strong {
  color: #9fe7e9;
  font-size: 12px;
  font-weight: 950;
  text-align: right;
}

.portfolio-page .portfolio-currency-legend,
.dashboard-page .portfolio-currency-legend-row em {
  color: #8b97aa;
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
  text-align: right;
}

@media (max-width: 1180px) {
  .portfolio-page .portfolio-chart-panel,
  .dashboard-page .portfolio-chart-panel {
    grid-template-columns: 1fr;
  }

  .portfolio-page .portfolio-tenor-chart,
  .dashboard-page .portfolio-tenor-chart {
    height: auto;
  }
}

/* Reference-style four-panel allocation dashboard */
.portfolio-page .portfolio-chart-panel,
.dashboard-page .portfolio-chart-panel {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 10px !important;
  margin: 4px 0 12px !important;
}

.portfolio-page .portfolio-chart-card,
.dashboard-page .portfolio-chart-card {
  min-height: 238px !important;
  padding: 13px 14px !important;
  border: 1px solid rgba(96, 108, 132, 0.28) !important;
  border-radius: 10px !important;
  background: linear-gradient(180deg, rgba(20, 24, 35, 0.98), rgba(17, 20, 30, 0.99)) !important;
  box-shadow:
    inset 1px 0 0 rgba(255, 255, 255, 0.025),
    inset -1px 0 0 rgba(255, 255, 255, 0.018),
    0 12px 26px rgba(0, 0, 0, 0.2) !important;
}

.dashboard-page .dashboard-nav-return-card {
  margin: 0;
  padding: 13px 14px;
  border: 1px solid rgba(96, 108, 132, 0.28);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(20, 24, 35, 0.98), rgba(17, 20, 30, 0.99));
  box-shadow:
    inset 1px 0 0 rgba(255, 255, 255, 0.025),
    inset -1px 0 0 rgba(255, 255, 255, 0.018),
    0 12px 26px rgba(0, 0, 0, 0.2);
  min-width: 0;
}

.dashboard-page .dashboard-nav-return-card .portfolio-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px !important;
}

.dashboard-page .dashboard-nav-return-card .portfolio-chart-head h2 {
  display: block !important;
  margin: 2px 0 0;
  color: var(--mist);
  font-size: 15px;
  font-weight: 950;
  letter-spacing: -0.01em;
}

.dashboard-page #dashboardNavReturnAsOf {
  color: #a1a8b8;
  font-size: 11px;
  font-weight: 850;
}

.dashboard-page .dashboard-nav-return-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.dashboard-page .dashboard-nav-return-table th,
.dashboard-page .dashboard-nav-return-table td {
  padding: 8px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  color: #e8edf5;
  text-align: left;
}

.dashboard-page .dashboard-nav-return-table th {
  color: #8f98aa;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-page .dashboard-nav-return-table .num {
  text-align: right;
}

.dashboard-page .nav-return-delta-mini span,
.dashboard-page .nav-return-delta-mini small {
  display: block;
  font-size: 11px;
  font-weight: 950;
  line-height: 1.25;
}

.portfolio-page .portfolio-chart-head,
.dashboard-page .portfolio-chart-head {
  margin-bottom: 10px !important;
}

.portfolio-page .portfolio-chart-head,
.dashboard-page .portfolio-chart-head .eyebrow {
  color: #a1a8b8 !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  letter-spacing: 0.08em !important;
}

.portfolio-page .portfolio-chart-head,
.dashboard-page .portfolio-chart-head h2,
.portfolio-page .chart-note {
  display: none !important;
}

.portfolio-page .portfolio-pie-layout,
.portfolio-page .portfolio-currency-pie-layout,
.dashboard-page .portfolio-pie-layout,
.dashboard-page .portfolio-currency-pie-layout {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 10px !important;
  justify-items: center !important;
}

.portfolio-page .portfolio-bank-pie-layout,
.dashboard-page .portfolio-bank-pie-layout {
  grid-template-columns: 150px minmax(0, 1fr) !important;
  gap: 12px !important;
}

.portfolio-page .portfolio-pie-wrap,
.portfolio-page .portfolio-currency-pie-wrap,
.dashboard-page .portfolio-pie-wrap,
.dashboard-page .portfolio-currency-pie-wrap {
  width: 168px !important;
  height: 168px !important;
}

.portfolio-page .portfolio-bank-pie-layout,
.dashboard-page .portfolio-bank-pie-layout .portfolio-pie-wrap {
  width: 126px !important;
  height: 126px !important;
  align-self: center;
}

.portfolio-page .portfolio-pie,
.dashboard-page .portfolio-pie {
  border: 0 !important;
  box-shadow: none !important;
}

.portfolio-page .portfolio-pie-center,
.dashboard-page .portfolio-pie-center {
  inset: 48px !important;
  border: 0 !important;
  background: #151923 !important;
}

.portfolio-page .portfolio-bank-pie-layout,
.dashboard-page .portfolio-bank-pie-layout .portfolio-pie-center {
  inset: 38px !important;
}

.portfolio-page .portfolio-pie-center,
.dashboard-page .portfolio-pie-center strong {
  color: #ffffff !important;
  font-size: 12px !important;
  line-height: 1.1 !important;
}

.portfolio-page .portfolio-currency-pie-wrap .portfolio-pie-center,
.dashboard-page .portfolio-currency-pie-wrap .portfolio-pie-center {
  inset: 55px !important;
}

.portfolio-page .portfolio-currency-legend,
.dashboard-page .portfolio-currency-legend {
  grid-template-columns: repeat(2, minmax(0, auto)) !important;
  justify-content: center !important;
  gap: 12px !important;
}

.portfolio-page .portfolio-currency-legend,
.dashboard-page .portfolio-currency-legend-row {
  display: grid !important;
  grid-template-columns: 12px auto auto !important;
  gap: 6px !important;
  min-height: 18px !important;
}

.portfolio-page .portfolio-currency-legend,
.dashboard-page .portfolio-currency-legend-row em {
  display: none !important;
}

.portfolio-page .portfolio-pie-legend,
.dashboard-page .portfolio-pie-legend {
  gap: 7px !important;
  align-content: center !important;
}

.portfolio-page .portfolio-pie-legend,
.dashboard-page .portfolio-pie-legend-row {
  grid-template-columns: 12px minmax(72px, 1fr) 56px !important;
  gap: 6px !important;
  min-height: 18px !important;
}

.portfolio-page .portfolio-pie-legend,
.dashboard-page .portfolio-pie-legend-row em {
  display: none !important;
}

.portfolio-page .portfolio-pie-legend,
.dashboard-page .portfolio-pie-legend-row span,
.portfolio-page .portfolio-currency-legend,
.dashboard-page .portfolio-currency-legend-row span {
  color: #c6ccd8 !important;
  font-size: 11px !important;
  font-weight: 750 !important;
}

.portfolio-page .portfolio-pie-legend,
.dashboard-page .portfolio-pie-legend-row strong,
.portfolio-page .portfolio-currency-legend,
.dashboard-page .portfolio-currency-legend-row strong {
  color: #b9c0cc !important;
  font-size: 10px !important;
  font-weight: 800 !important;
}

.portfolio-page .portfolio-tenor-chart,
.dashboard-page .portfolio-tenor-chart {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 13px !important;
  height: auto !important;
  padding: 10px 6px 0 !important;
}

.portfolio-page .portfolio-tenor-item,
.dashboard-page .portfolio-tenor-item {
  display: grid !important;
  grid-template-columns: 78px minmax(0, 1fr) 72px 34px !important;
  align-items: center !important;
  gap: 10px !important;
  min-height: 24px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

.portfolio-page .portfolio-tenor-item,
.dashboard-page .portfolio-tenor-item span {
  color: #9fa7b8 !important;
  font-size: 10px !important;
  font-weight: 750 !important;
  text-align: right !important;
}

.portfolio-page .portfolio-tenor-item,
.dashboard-page .portfolio-tenor-item strong {
  color: #cbd3e1 !important;
  font-size: 10px !important;
  font-weight: 850 !important;
  text-align: right !important;
}

.portfolio-page .portfolio-tenor-item,
.dashboard-page .portfolio-tenor-item .portfolio-bar-track {
  display: block !important;
  height: 24px !important;
  border: 0 !important;
  border-radius: 4px !important;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px), rgba(255, 255, 255, 0.02) !important;
  background-size: 33.333% 100% !important;
}

.portfolio-page .portfolio-tenor-item,
.dashboard-page .portfolio-tenor-item .portfolio-bar-track i {
  width: var(--bar-pct) !important;
  height: 100% !important;
  min-height: 0 !important;
  border-radius: 4px !important;
  background: linear-gradient(90deg, #4f9fd5, #f3b53e) !important;
  box-shadow: none !important;
}

.portfolio-page .portfolio-maturity-ladder-chart,
.dashboard-page .portfolio-maturity-ladder-chart {
  height: 182px;
  padding: 2px 6px 0;
}

.portfolio-page .portfolio-ladder-grid,
.dashboard-page .portfolio-ladder-grid {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 178px;
  padding: 0 0 24px;
  border-bottom: 1px solid rgba(140, 150, 172, 0.2);
  background: linear-gradient(rgba(140, 150, 172, 0.14) 1px, transparent 1px);
  background-size: 100% 36px;
  overflow: hidden;
}

.portfolio-page .portfolio-ladder-bar,
.dashboard-page .portfolio-ladder-bar {
  flex: 1 1 0;
  min-width: 10px;
  height: 100%;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.portfolio-page .portfolio-ladder-bar,
.dashboard-page .portfolio-ladder-bar i {
  display: block;
  width: 75%;
  height: var(--bar-height);
  min-height: 4px;
  border-radius: 3px 3px 0 0;
  background: #4ea6bd;
  opacity: 0.9;
}

.portfolio-page .portfolio-ladder-bar,
.dashboard-page .portfolio-ladder-bar span {
  display: none;
}

.portfolio-page .portfolio-ladder-bar,
.dashboard-page .portfolio-ladder-bar em {
  position: absolute;
  left: 50%;
  bottom: -23px;
  transform: translateX(-50%) rotate(-50deg);
  transform-origin: center;
  color: #8f97a8;
  font-size: 9px;
  font-style: normal;
  font-weight: 750;
  white-space: nowrap;
}

@media (max-width: 1320px) {
  .portfolio-page .portfolio-chart-panel,
  .dashboard-page .portfolio-chart-panel,
  .dashboard-page .portfolio-chart-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

.portfolio-page .fund-excel-table td {
  cursor: default;
  user-select: text;
}

.portfolio-readonly-cell {
  display: block;
  min-height: 28px;
  padding: 6px 8px;
  border: 1px solid rgba(85, 199, 207, 0.1);
  border-radius: 6px;
  background: rgba(9, 14, 22, 0.46);
  color: #eef3fb;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portfolio-readonly-cell.bank-cell {
  color: #ffffff;
  font-weight: 900;
  letter-spacing: 0.01em;
}

/* Dashboard chart overrides: clean four-card panel moved from Portfolio */
.dashboard-page .dashboard-kpi-shell {
  margin-bottom: 12px !important;
}

.dashboard-page .portfolio-chart-panel {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 10px !important;
  margin: 0 !important;
}

.dashboard-page .portfolio-chart-card {
  min-height: 238px !important;
  padding: 13px 14px !important;
  overflow: hidden !important;
}

.dashboard-page .portfolio-chart-head {
  display: block !important;
  margin-bottom: 10px !important;
}

.dashboard-page .portfolio-chart-head .eyebrow {
  display: block !important;
  color: #a1a8b8 !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  letter-spacing: 0.08em !important;
}

.dashboard-page .portfolio-pie-layout,
.dashboard-page .portfolio-currency-pie-layout {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 10px !important;
  justify-items: center !important;
  align-items: center !important;
}

.dashboard-page .portfolio-bank-pie-layout {
  grid-template-columns: 126px minmax(0, 1fr) !important;
  gap: 12px !important;
}

.dashboard-page .portfolio-pie-wrap,
.dashboard-page .portfolio-currency-pie-wrap {
  position: relative !important;
  width: 168px !important;
  height: 168px !important;
  margin: 0 auto !important;
}

.dashboard-page .portfolio-bank-pie-layout .portfolio-pie-wrap {
  width: 126px !important;
  height: 126px !important;
}

.dashboard-page .portfolio-pie {
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  border-radius: 50% !important;
  box-shadow: none !important;
}

.dashboard-page .portfolio-pie-center {
  position: absolute !important;
  inset: 55px !important;
  display: grid !important;
  place-items: center !important;
  align-content: center !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: #151923 !important;
  text-align: center !important;
}

.dashboard-page .portfolio-bank-pie-layout .portfolio-pie-center {
  inset: 38px !important;
}

.dashboard-page .portfolio-pie-center strong {
  color: #ffffff !important;
  font-size: 12px !important;
  line-height: 1.1 !important;
}

.dashboard-page .portfolio-currency-legend {
  display: grid !important;
  grid-template-columns: repeat(2, max-content) !important;
  justify-content: center !important;
  gap: 12px !important;
  width: 100% !important;
}

.dashboard-page .portfolio-currency-legend-row,
.dashboard-page .portfolio-pie-legend-row {
  display: grid !important;
  align-items: center !important;
  min-height: 18px !important;
}

.dashboard-page .portfolio-currency-legend-row {
  grid-template-columns: 12px auto auto !important;
  gap: 6px !important;
}

.dashboard-page .portfolio-pie-legend {
  display: grid !important;
  gap: 7px !important;
  align-content: center !important;
}

.dashboard-page .portfolio-pie-legend-row {
  grid-template-columns: 12px minmax(72px, 1fr) 56px !important;
  gap: 6px !important;
}

.dashboard-page .portfolio-currency-legend-row i,
.dashboard-page .portfolio-pie-legend-row i {
  display: block !important;
  width: 9px !important;
  height: 9px !important;
  border-radius: 999px !important;
  background: var(--legend-color) !important;
}

.dashboard-page .portfolio-currency-legend-row em,
.dashboard-page .portfolio-pie-legend-row em {
  display: none !important;
}

.dashboard-page .portfolio-currency-legend-row span,
.dashboard-page .portfolio-pie-legend-row span {
  overflow: hidden !important;
  color: #c6ccd8 !important;
  font-size: 11px !important;
  font-weight: 750 !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.dashboard-page .portfolio-currency-legend-row strong,
.dashboard-page .portfolio-pie-legend-row strong {
  color: #b9c0cc !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  text-align: right !important;
}

.dashboard-page .portfolio-tenor-chart {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 13px !important;
  height: auto !important;
  padding: 10px 6px 0 !important;
}

.dashboard-page .portfolio-tenor-item {
  display: grid !important;
  grid-template-columns: 78px minmax(0, 1fr) 72px 34px !important;
  align-items: center !important;
  gap: 10px !important;
  min-height: 24px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.dashboard-page .portfolio-tenor-item span,
.dashboard-page .portfolio-tenor-item strong {
  font-size: 10px !important;
  font-weight: 800 !important;
  text-align: right !important;
}

.dashboard-page .portfolio-tenor-item em {
  font-size: 10px !important;
  font-weight: 750 !important;
  font-style: normal !important;
  text-align: right !important;
  color: #9fa7b8 !important;
  white-space: nowrap !important;
}

.dashboard-page .portfolio-tenor-item .portfolio-bar-track {
  display: block !important;
  height: 24px !important;
  border: 0 !important;
  border-radius: 4px !important;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px), rgba(255, 255, 255, 0.02) !important;
  background-size: 33.333% 100% !important;
}

.dashboard-page .portfolio-tenor-item .portfolio-bar-track i {
  display: block !important;
  width: var(--bar-pct) !important;
  height: 100% !important;
  border-radius: 4px !important;
  background: linear-gradient(90deg, #4f9fd5, #f3b53e) !important;
}

.dashboard-page .portfolio-ladder-grid {
  display: flex !important;
  align-items: flex-end !important;
  gap: 6px !important;
  height: 178px !important;
}

.dashboard-page .portfolio-ladder-bar {
  flex: 1 1 0 !important;
  min-width: 10px !important;
  height: 100% !important;
  position: relative !important;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: center !important;
}

.dashboard-page .portfolio-ladder-bar i {
  display: block !important;
  width: 75% !important;
  height: var(--bar-height) !important;
  min-height: 4px !important;
  border-radius: 3px 3px 0 0 !important;
  background: #4ea6bd !important;
}

.dashboard-page .portfolio-ladder-bar span {
  display: none !important;
}

.dashboard-page .portfolio-ladder-bar em {
  position: absolute !important;
  left: 50% !important;
  bottom: -23px !important;
  transform: translateX(-50%) rotate(-50deg) !important;
  color: #8f97a8 !important;
  font-size: 9px !important;
  font-style: normal !important;
  font-weight: 750 !important;
  white-space: nowrap !important;
}

@media (max-width: 1320px) {
  .dashboard-page .portfolio-chart-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

.portfolio-readonly-cell.num-cell {
  color: #9fe7e9;
  font-weight: 900;
}

.portfolio-readonly-cell.rate-cell {
  border-color: rgba(224, 179, 65, 0.22);
  background: rgba(224, 179, 65, 0.075);
  color: #f3cb72;
  font-weight: 900;
}

.portfolio-page .portfolio-inline-kpis article {
  border-color: rgba(85, 199, 207, 0.2) !important;
  background: linear-gradient(180deg, rgba(24, 31, 45, 0.98), rgba(17, 22, 33, 0.99)) !important;
}

.portfolio-page .portfolio-inline-kpis article:hover {
  border-color: rgba(85, 199, 207, 0.36) !important;
  box-shadow:
    0 0 0 1px rgba(85, 199, 207, 0.06),
    0 12px 24px rgba(0, 0, 0, 0.18);
}

@media (min-width: 1020px) {
  body.calendar-page,
  body.fund-simulation-page,
  body.portfolio-page,
  body.rate-sheet-page {
    padding-left: 176px;
  }
  .calendar-page .site-header,
  .fund-simulation-page .site-header,
  .portfolio-page .site-header,
  .rate-sheet-page .site-header {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    width: 176px !important;
    height: 100vh !important;
    height: 100dvh !important;
    border-right: 1px solid #252b38 !important;
    border-bottom: 0 !important;
    background: #11151f !important;
    box-shadow: none !important;
    /* Short-viewport fix: the fixed rail is detached from the page scroll, so
       it must scroll its own overflow or the bottom content is unreachable.
       Sideways it must NEVER scroll — anything wider than the rail is a bug,
       and overflow-y:auto alone would turn it into a horizontal scrollbar. */
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
  }
  .calendar-page .site-header .container,
  .fund-simulation-page .site-header .container,
  .portfolio-page .site-header .container,
  .rate-sheet-page .site-header .container {
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    padding: 0 !important;
  }
  .calendar-page .header-inner,
  .fund-simulation-page .header-inner,
  .portfolio-page .header-inner,
  .rate-sheet-page .header-inner {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
    padding: 14px 0 !important;
  }
  .calendar-page .brand,
  .fund-simulation-page .brand,
  .portfolio-page .brand,
  .rate-sheet-page .brand {
    padding: 0 14px 18px !important;
    border-bottom: 1px solid #252b38 !important;
  }
  .calendar-page .brand-mark svg,
  .fund-simulation-page .brand-mark svg,
  .portfolio-page .brand-mark svg,
  .rate-sheet-page .brand-mark svg {
    width: 28px !important;
    height: 20px !important;
  }
  .calendar-page .brand-name,
  .fund-simulation-page .brand-name,
  .portfolio-page .brand-name,
  .rate-sheet-page .brand-name {
    font-size: 13px !important;
    color: #f7f9fc !important;
  }
  .calendar-page .brand-sub,
  .fund-simulation-page .brand-sub,
  .portfolio-page .brand-sub,
  .rate-sheet-page .brand-sub {
    max-width: 120px !important;
    color: #8491a4 !important;
    font-size: 9px !important;
    white-space: normal !important;
  }
  .calendar-page .site-nav,
  .fund-simulation-page .site-nav,
  .portfolio-page .site-nav,
  .rate-sheet-page .site-nav {
    display: grid !important;
    /* minmax(0, …): the track must be allowed to shrink below the widest
       nowrap label or the whole rail gains a horizontal scrollbar. */
    grid-template-columns: minmax(0, 1fr) !important;
    justify-content: stretch !important;
    gap: 5px !important;
    padding: 16px 8px !important;
  }
  /* In the rail the equal halves are too tight for MANUAL — let it size to
     its label and give AD (short since 2026-07) whatever is left. */
  .calendar-page .dataset-toggle-row,
  .fund-simulation-page .dataset-toggle-row,
  .portfolio-page .dataset-toggle-row,
  .rate-sheet-page .dataset-toggle-row {
    grid-template-columns: fit-content(100%) minmax(0, 1fr);
  }
  .calendar-page .site-nav a,
  .fund-simulation-page .site-nav a,
  .portfolio-page .site-nav a,
  .rate-sheet-page .site-nav a {
    display: block !important;
    border-radius: 6px !important;
    padding: 8px 10px !important;
    color: #a3adbd !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    font-size: 11px !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
    line-height: 1.35 !important;
  }
  .calendar-page .site-nav a:hover,
  .fund-simulation-page .site-nav a:hover,
  .portfolio-page .site-nav a:hover,
  .rate-sheet-page .site-nav a:hover,
  .calendar-page .site-nav a[aria-current="page"],
  .fund-simulation-page .site-nav a[aria-current="page"],
  .portfolio-page .site-nav a[aria-current="page"],
  .rate-sheet-page .site-nav a[aria-current="page"] {
    color: var(--ice) !important;
    background: rgba(85, 199, 207, 0.13) !important;
    border-color: rgba(85, 199, 207, 0.1) !important;
  }
  .calendar-page .header-meta,
  .fund-simulation-page .header-meta,
  .portfolio-page .header-meta,
  .rate-sheet-page .header-meta {
    margin-top: auto !important;
    padding: 12px 12px 0 !important;
    display: grid !important;
    grid-auto-flow: row !important;
    gap: 10px !important;
    justify-content: stretch !important;
    border-top: 1px solid #252b38 !important;
  }
  .calendar-page .meta-label,
  .fund-simulation-page .meta-label,
  .portfolio-page .meta-label,
  .rate-sheet-page .meta-label {
    font-size: 8px !important;
  }
  .calendar-page .meta-value,
  .fund-simulation-page .meta-value,
  .portfolio-page .meta-value,
  .rate-sheet-page .meta-value {
    font-size: 11px !important;
    white-space: normal !important;
  }
  .calendar-page .container,
  .fund-simulation-page .container,
  .portfolio-page .container,
  .rate-sheet-page .container {
    max-width: none !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
  .calendar-page .main,
  .fund-simulation-page .main,
  .portfolio-page .main,
  .rate-sheet-page .main {
    padding-top: 18px !important;
  }
}

@media (max-width: 1019px) {
  .site-header {
    background: rgba(17, 21, 31, 0.96) !important;
  }
}

/* Reference-style MMF dashboard theme: compact dark cards, teal/green finance palette */
:root {
  --bg: #0d0f15;
  --bg-elev: #10131a;
  --surface: #151820;
  --surface-2: #181c25;
  --border: #2a2f3a;
  --border-soft: #202632;
  --text: #f1f5f9;
  --text-muted: #9aa4b2;
  --text-faint: #687384;
  --teal: #56b9c1;
  --teal-dim: #3f9fa8;
  --green: #37d78a;
  --gold: #e5ad3d;
  --purple: #a772e8;
  --rose: #ec6b7a;
  --err: #f06476;
  --radius: 8px;
  --font-sans: "Satoshi", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, monospace;
}

body {
  background: #0d0f15 !important;
  color: var(--text) !important;
  font-family: var(--font-sans) !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
  letter-spacing: -0.01em;
}

.card,
.workbook-upload-card,
.portfolio-only-card,
.calendar-only-card,
.editable-rate-panel,
.standalone-rate-panel,
.portfolio-scenario-box,
.portfolio-rules-box,
.scenario-result-grid article,
.limit-summary-wrap,
.register-table-wrap,
.calendar-month-section,
.week-card,
.month-total-box {
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  background: #151820 !important;
  box-shadow: none !important;
}

.fund-simulation-page .portfolio-only-card {
  background: #11141b !important;
}

.card-head h1,
.portfolio-only-card h1,
.editable-rate-panel h1,
.calendar-only-card h1 {
  color: #f8fafc !important;
  font-size: 22px !important;
  font-weight: 800 !important;
  letter-spacing: -0.035em !important;
}

.card-sub,
.workbook-drop-zone small,
.workbook-upload-status {
  color: #8f99a8 !important;
  font-size: 11px !important;
}

.eyebrow,
.upload-kicker,
.portfolio-inline-kpis span,
.scenario-control-grid label span,
.limit-summary-table th,
.weekly-maturity-table th,
.data-table th,
.deposit-register-table th {
  color: #8b94a3 !important;
  font-size: 9px !important;
  font-weight: 800 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
}

.portfolio-inline-kpis {
  gap: 12px !important;
}

.portfolio-inline-kpis article {
  min-height: 70px !important;
  padding: 13px 14px !important;
  border-color: var(--border) !important;
  border-radius: 8px !important;
  background: #151820 !important;
}

.portfolio-inline-kpis strong,
.scenario-result-grid strong {
  color: #f8fafc !important;
  font-size: 17px !important;
  font-weight: 900 !important;
  letter-spacing: -0.035em !important;
}

.portfolio-inline-kpis article:nth-child(3) strong,
#scenarioWam,
.wam-safe {
  color: var(--green) !important;
}

.portfolio-inline-kpis article:nth-child(4) strong,
#scenarioYield,
.wam-watch {
  color: var(--gold) !important;
}

.portfolio-inline-kpis small,
.scenario-result-grid small {
  color: #8f99a8 !important;
  font-size: 10px !important;
}

.scenario-control-grid select,
.scenario-control-grid input,
.subscription-input-row select,
.editable-rate-table input,
.portfolio-mini-input,
.sim-input {
  min-height: 31px !important;
  border: 1px solid #252b36 !important;
  border-radius: 5px !important;
  background: #0f1219 !important;
  color: #edf2f7 !important;
  font-size: 11px !important;
}

.scenario-control-grid select:focus,
.scenario-control-grid input:focus,
.subscription-input-row select:focus {
  border-color: rgba(86, 185, 193, 0.8) !important;
  box-shadow: 0 0 0 2px rgba(86, 185, 193, 0.12) !important;
}

.scenario-actions button,
.week-view-button,
.calendar-link-button,
.rate-sheet-actions button {
  min-height: 30px !important;
  border: 1px solid #2a3140 !important;
  border-radius: 6px !important;
  background: #1a1f2a !important;
  color: #cbd5e1 !important;
  font-size: 11px !important;
  font-weight: 800 !important;
}

.scenario-actions button:first-child {
  background: var(--teal) !important;
  color: #071014 !important;
  border-color: var(--teal) !important;
}

.scenario-actions button:hover,
.week-view-button:hover,
.calendar-link-button:hover,
.rate-sheet-actions button:hover {
  background: #202734 !important;
  border-color: rgba(86, 185, 193, 0.7) !important;
  color: #ffffff !important;
}

.data-table,
.deposit-register-table,
.weekly-maturity-table,
.limit-summary-table,
.editable-rate-table {
  color: #dce4ee !important;
  font-size: 11px !important;
  background: #151820 !important;
}

.data-table th,
.deposit-register-table th,
.weekly-maturity-table th,
.limit-summary-table th,
.editable-rate-table th {
  height: 32px !important;
  background: #151820 !important;
  border-bottom: 1px solid #2a2f3a !important;
}

.data-table td,
.deposit-register-table td,
.weekly-maturity-table td,
.limit-summary-table td,
.editable-rate-table td {
  padding: 9px 10px !important;
  border-bottom: 1px solid #252a34 !important;
  background: transparent !important;
}

.deposit-register-table tbody tr:nth-child(odd),
.weekly-maturity-table tbody tr:nth-child(odd),
.data-table tbody tr:nth-child(odd) {
  background: #121620 !important;
}

.deposit-register-table tbody tr:hover,
.weekly-maturity-table tbody tr:hover,
.data-table tbody tr:hover {
  background: rgba(86, 185, 193, 0.08) !important;
}

.fund-simulation-page .weekly-maturity-table tr.weekly-month-row td {
  color: #5ed2d2 !important;
  background: #151820 !important;
  font-size: 14px !important;
  font-weight: 900 !important;
  letter-spacing: 0.1em !important;
}

.week-date-range {
  color: #8f99a8 !important;
  font-size: 10px !important;
}

.fund-simulation-page .weekly-maturity-table tbody tr.weekly-low-wla-row {
  background: rgba(240, 100, 118, 0.055) !important;
}

.fund-simulation-page .weekly-maturity-table tbody tr.weekly-low-wla-row:hover {
  background: rgba(240, 100, 118, 0.1) !important;
}

.week-signal-low {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 6px;
  border: 1px solid rgba(240, 100, 118, 0.35);
  border-radius: 999px;
  background: rgba(240, 100, 118, 0.1);
  color: var(--err);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
}

.wla-low {
  color: var(--err) !important;
  font-weight: 900 !important;
}

.limit-status.ok,
.status-pill.ok {
  color: var(--green) !important;
  background: rgba(55, 215, 138, 0.08) !important;
  border-color: rgba(55, 215, 138, 0.22) !important;
}

.limit-status.low,
.limit-status.over,
.wam-danger {
  color: var(--err) !important;
}

@media (min-width: 1020px) {
  body.calendar-page,
  body.fund-simulation-page,
  body.portfolio-page,
  body.rate-sheet-page {
    padding-left: 168px !important;
  }

  .calendar-page .site-header,
  .fund-simulation-page .site-header,
  .portfolio-page .site-header,
  .rate-sheet-page .site-header {
    width: 168px !important;
    background: #10131a !important;
    border-right: 1px solid #222834 !important;
  }

  .calendar-page .brand,
  .fund-simulation-page .brand,
  .portfolio-page .brand,
  .rate-sheet-page .brand {
    padding: 12px 12px 20px !important;
  }

  .calendar-page .brand-mark,
  .fund-simulation-page .brand-mark,
  .portfolio-page .brand-mark,
  .rate-sheet-page .brand-mark {
    color: var(--teal) !important;
  }

  .calendar-page .brand-name,
  .fund-simulation-page .brand-name,
  .portfolio-page .brand-name,
  .rate-sheet-page .brand-name {
    color: var(--teal) !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    letter-spacing: -0.01em !important;
  }

  .calendar-page .site-nav a,
  .fund-simulation-page .site-nav a,
  .portfolio-page .site-nav a,
  .rate-sheet-page .site-nav a {
    border-radius: 6px !important;
    color: #9aa4b2 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
  }

  .calendar-page .site-nav a[aria-current="page"],
  .fund-simulation-page .site-nav a[aria-current="page"],
  .portfolio-page .site-nav a[aria-current="page"],
  .rate-sheet-page .site-nav a[aria-current="page"] {
    color: var(--ice) !important;
    background: rgba(86, 185, 193, 0.16) !important;
    border-color: transparent !important;
  }
}

/* Scenario row-by-row deal input and added-deal ledger */
.fund-simulation-page .scenario-control-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 10px !important;
}

.fund-simulation-page .scenario-control-grid label:first-child,
.fund-simulation-page .scenario-control-grid label {
  grid-column: auto !important;
}

.fund-simulation-page .scenario-cash-flow-row,
.fund-simulation-page .scenario-deal-input-row {
  display: grid !important;
  width: 100% !important;
  gap: 8px !important;
}

.fund-simulation-page .scenario-cash-flow-row {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  padding: 9px !important;
  border: 1px solid rgba(86, 185, 193, 0.18) !important;
  border-radius: 10px !important;
  background: rgba(86, 185, 193, 0.055) !important;
}

.fund-simulation-page .scenario-deal-row-title {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  color: var(--ice) !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  letter-spacing: 0.09em !important;
  text-transform: uppercase !important;
}

.fund-simulation-page .scenario-deal-row-title::after {
  content: "" !important;
  flex: 1 !important;
  height: 1px !important;
  background: linear-gradient(90deg, rgba(86, 185, 193, 0.45), rgba(86, 185, 193, 0.05)) !important;
}

.fund-simulation-page .scenario-deal-input-row {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  padding: 9px !important;
  border: 1px solid rgba(255, 196, 87, 0.18) !important;
  border-radius: 10px !important;
  background: rgba(255, 196, 87, 0.045) !important;
}

.fund-simulation-page .scenario-cash-flow-row label,
.fund-simulation-page .scenario-deal-input-row label {
  min-width: 0 !important;
}

.fund-simulation-page .scenario-actions {
  grid-column: auto !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
}

.added-scenario-deals {
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  background: #151820 !important;
  overflow: hidden !important;
}

.added-scenario-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-bottom: 1px solid #252a34;
}

.added-scenario-head span {
  color: #8b94a3;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.added-scenario-head small,
.empty-added-deals {
  color: #8f99a8;
  font-size: 10px;
}

.added-scenario-table-wrap {
  overflow-x: auto;
}

.added-scenario-table {
  min-width: 640px;
}

.added-scenario-table th,
.added-scenario-table td {
  padding: 7px 8px !important;
  font-size: 10px !important;
}

.added-scenario-table td:nth-child(2) {
  color: #f8fafc;
  font-weight: 800;
}

.added-scenario-table td:nth-child(6) {
  color: var(--gold);
  font-weight: 900;
}

.empty-added-deals {
  text-align: center !important;
  padding: 12px !important;
}

@media (max-width: 1400px) {
  .fund-simulation-page .scenario-cash-flow-row,
  .fund-simulation-page .scenario-deal-input-row {
    grid-template-columns: 1fr !important;
  }
}

/* Final readability lift: applied after all compact dashboard overrides */
body,
body.fund-simulation-page,
body.calendar-page,
body.portfolio-page,
body.rate-sheet-page {
  font-size: 14px !important;
  line-height: 1.5 !important;
}

.dashboard-page .dashboard-main {
  max-width: 1480px;
}

.dashboard-page .dashboard-summary-card {
  min-height: 0;
}

.dashboard-page .dashboard-page-heading {
  margin: 0 0 14px;
  padding: 2px 2px 0;
}

.dashboard-page .dashboard-page-heading h2 {
  margin: 0;
  color: var(--mist);
  font-size: 24px;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.dashboard-page .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.dashboard-page .dashboard-kpi-shell {
  border: 2px solid rgba(255, 82, 82, 0.75);
  border-radius: 12px;
  background: rgba(122, 31, 39, 0.28);
  padding: 10px;
}

.dashboard-page .dashboard-kpi-shell .simulation-section-date-title {
  margin: 0 0 8px;
}

.dashboard-page .portfolio-inline-kpis {
  margin: 0;
}

.dashboard-page .dashboard-upcoming-card {
  margin-top: 0;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  background: rgba(17, 20, 31, 0.82);
  overflow: hidden;
  min-width: 0;
}

.dashboard-page .dashboard-lower-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.9fr);
  gap: 12px;
  margin-top: 12px;
  align-items: stretch;
}

@media (max-width: 1120px) {
  .dashboard-page .dashboard-lower-summary {
    grid-template-columns: 1fr;
  }
}

.dashboard-page .dashboard-upcoming-card h3 {
  margin: 0;
  padding: 13px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(236, 241, 248, 0.7);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dashboard-page .dashboard-upcoming-table {
  width: 100%;
  border-collapse: collapse;
  color: #e8edf5;
  font-size: 14px;
}

.dashboard-page .dashboard-upcoming-table th,
.dashboard-page .dashboard-upcoming-table td {
  padding: 12px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  text-align: left;
  white-space: nowrap;
}

.dashboard-page .dashboard-upcoming-table th {
  color: rgba(232, 237, 245, 0.62);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dashboard-page .dashboard-upcoming-table .num {
  text-align: right;
}

.dashboard-page .dashboard-upcoming-table tbody tr:last-child td {
  border-bottom: 0;
}

.dashboard-page .dashboard-upcoming-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.025);
}

.dashboard-page .dashboard-upcoming-empty td {
  color: rgba(232, 237, 245, 0.58);
  text-align: center;
}

.snapshot-control-panel {
  display: grid;
  gap: 5px;
  min-width: 300px;
  max-width: 360px;
  border: 1px solid rgba(103, 232, 215, 0.14);
  border-radius: 14px;
  padding: 9px 10px;
  background: rgba(12, 18, 30, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 10px 22px rgba(0, 0, 0, 0.18);
}

.snapshot-control-title {
  color: rgba(232, 237, 245, 0.58);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.snapshot-control-row {
  display: grid;
  grid-template-columns: auto minmax(116px, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.snapshot-pill,
.snapshot-select {
  min-height: 30px;
  border: 1px solid rgba(86, 185, 193, 0.42);
  border-radius: 999px;
  background: rgba(86, 185, 193, 0.1);
  color: var(--ice);
  font: inherit;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  outline: none;
}

.snapshot-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  cursor: pointer;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease,
    opacity 120ms ease;
}

.snapshot-pill:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(117, 232, 239, 0.78);
  background: rgba(86, 185, 193, 0.18);
}

.snapshot-pill:disabled {
  cursor: wait;
  opacity: 0.58;
}

.snapshot-select {
  width: 100%;
  padding: 7px 28px 7px 10px;
  color: rgba(244, 247, 251, 0.88);
  background-color: rgba(8, 12, 20, 0.72);
}

.snapshot-restore {
  border-color: rgba(224, 179, 65, 0.42);
  background: rgba(224, 179, 65, 0.1);
  color: #ffe8a6;
}

.snapshot-restore:hover:not(:disabled) {
  border-color: rgba(224, 179, 65, 0.78);
  background: rgba(224, 179, 65, 0.16);
}

.snapshot-status {
  min-height: 12px;
  margin: 0;
  color: rgba(232, 237, 245, 0.54);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
}

.snapshot-status.is-success {
  color: #67e8d7;
}

.snapshot-status.is-error {
  color: #ff8a98;
}

@media (max-width: 1180px) {
  .snapshot-control-panel {
    order: 4;
    width: 100%;
    max-width: none;
  }
}

/* Sidebar utility controls: workbook default + daily snapshots */
.sidebar-utility-stack {
  display: grid;
  gap: 8px;
  width: 100%;
}

.sidebar-snapshot-control {
  min-width: 0;
  max-width: none;
  width: 100%;
}

.subscription-redemption-page .subscription-redemption-main {
  max-width: 1480px;
}

.subscription-redemption-page .subscription-redemption-card {
  min-height: 320px;
}

.subscription-redemption-page .sub-red-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.subscription-redemption-page .sub-red-overview article {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(103, 232, 215, 0.16);
  border-radius: 14px;
  padding: 16px;
  background: rgba(16, 21, 33, 0.86);
}

.subscription-redemption-page .sub-red-overview span,
.subscription-redemption-page .sub-red-product-card span {
  color: rgba(232, 237, 245, 0.58);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.subscription-redemption-page .sub-red-overview strong,
.subscription-redemption-page .sub-red-flow-toggle {
  display: block;
  width: 100%;
  border: 0 !important;
  padding: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--mist);
  font-size: 22px;
  font-weight: 950;
  text-align: left;
  cursor: pointer;
}

.subscription-redemption-page .sub-red-flow-card-subscription .sub-red-flow-toggle {
  color: #67e8d7 !important;
}

.subscription-redemption-page .sub-red-flow-card-redemption .sub-red-flow-toggle {
  color: #ff8a98 !important;
}

.subscription-redemption-page .sub-red-flow-card-net .sub-red-flow-toggle {
  color: #e0b341 !important;
}

.subscription-redemption-page .sub-red-flow-toggle:hover {
  filter: brightness(1.12);
}

.subscription-redemption-page .sub-red-flow-details {
  display: none;
  gap: 2px;
  margin-top: 7px;
  color: rgba(232, 237, 245, 0.72);
  font-size: 11px;
  line-height: 1.25;
}

.subscription-redemption-page .sub-red-flow-toggle.is-expanded .sub-red-flow-details {
  display: grid;
}

.subscription-redemption-page .sub-red-overview strong small {
  display: grid;
  gap: 2px;
  margin-top: 7px;
  color: rgba(232, 237, 245, 0.72);
  font-size: 11px;
  line-height: 1.25;
}

.subscription-redemption-page .sub-red-overview strong small b {
  display: block;
  color: #e0b341;
  font-size: 11px;
  font-weight: 900;
}

.subscription-redemption-page .sub-red-overview small {
  color: rgba(232, 237, 245, 0.68);
  font-size: 11px;
}

.subscription-redemption-page .sub-red-product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.subscription-redemption-page .sub-red-product-card {
  display: grid;
  gap: 5px;
  align-content: center;
  min-height: 96px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 18px 20px;
  background: rgba(19, 23, 34, 0.92);
}

.subscription-redemption-page .sub-red-product-card strong {
  display: block;
  margin-top: 0;
  color: #60c78a;
  font-size: 22px;
  font-weight: 950;
  letter-spacing: -0.02em;
}

.subscription-redemption-page .sub-red-product-card dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.subscription-redemption-page .sub-red-product-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.subscription-redemption-page .sub-red-product-card dt {
  color: rgba(232, 237, 245, 0.58);
  font-size: 12px;
}

.subscription-redemption-page .sub-red-product-card dd {
  margin: 0;
  color: var(--mist);
  font-size: 12px;
  font-weight: 900;
}

.subscription-redemption-page .sub-red-positive {
  color: #67e8d7 !important;
}

.subscription-redemption-page .sub-red-negative {
  color: #ff8a8a !important;
}

.subscription-redemption-page .sub-red-product-card small {
  color: rgba(244, 247, 251, 0.88);
  font-size: 12px;
  font-weight: 850;
}

.subscription-redemption-page .manual-record-card {
  margin-top: 12px;
  border: 1px solid rgba(103, 232, 215, 0.16);
  border-radius: 16px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(103, 232, 215, 0.08), rgba(224, 179, 65, 0.04)),
    rgba(16, 21, 33, 0.9);
}

.subscription-redemption-page .manual-record-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
}

.subscription-redemption-page .manual-record-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.subscription-redemption-page .manual-record-head h2 {
  margin: 0;
  color: var(--mist);
  font-size: 15px;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.subscription-redemption-page .manual-record-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 280px;
}

.subscription-redemption-page .manual-record-status {
  color: rgba(232, 237, 245, 0.62);
  font-size: 11px;
  font-weight: 850;
  text-align: right;
}

.subscription-redemption-page .manual-record-status.is-success {
  color: #67e8d7;
}

.subscription-redemption-page .manual-record-status.is-error {
  color: #ff8a98;
}

.subscription-redemption-page .manual-record-form {
  display: grid;
  grid-template-columns:
    minmax(160px, 0.85fr) minmax(220px, 1.15fr) minmax(160px, 0.8fr) minmax(180px, 1fr)
    auto;
  gap: 10px;
  align-items: end;
}

.subscription-redemption-page .nav-manual-form {
  grid-template-columns: minmax(180px, 0.9fr) minmax(200px, 1fr) minmax(200px, 1fr) auto;
}

.subscription-redemption-page .manual-record-dialog .manual-record-form,
.subscription-redemption-page .manual-record-dialog .nav-manual-form {
  grid-template-columns: 1fr;
}

.subscription-redemption-page .manual-record-form label {
  display: grid;
  gap: 6px;
}

.subscription-redemption-page .manual-record-form label span {
  color: rgba(232, 237, 245, 0.58);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.subscription-redemption-page .manual-record-form input,
.subscription-redemption-page .manual-record-form select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(8, 12, 20, 0.68);
  color: var(--mist);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  outline: none;
}

.subscription-redemption-page .manual-record-form input:focus,
.subscription-redemption-page .manual-record-form select:focus {
  border-color: rgba(103, 232, 215, 0.58);
  box-shadow: 0 0 0 3px rgba(103, 232, 215, 0.1);
}

.subscription-redemption-page .manual-nav-strip,
.subscription-redemption-page .manual-calc-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid rgba(103, 232, 215, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(103, 232, 215, 0.055);
}

.subscription-redemption-page .manual-nav-strip div,
.subscription-redemption-page .manual-calc-preview {
  min-width: 0;
}

.subscription-redemption-page .manual-nav-strip span,
.subscription-redemption-page .manual-calc-preview span {
  display: block;
  color: rgba(232, 237, 245, 0.56);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.subscription-redemption-page .manual-nav-strip strong,
.subscription-redemption-page .manual-calc-preview strong {
  display: block;
  margin-top: 4px;
  color: #67e8d7;
  font-size: 13px;
  font-weight: 950;
}

.subscription-redemption-page .manual-calc-preview {
  grid-template-columns: 1fr;
  background: rgba(224, 179, 65, 0.075);
}

.subscription-redemption-page .manual-calc-preview strong {
  color: #e0b341;
}

.subscription-redemption-page .manual-record-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(86, 185, 193, 0.46);
  border-radius: 999px;
  padding: 10px 15px;
  background: rgba(86, 185, 193, 0.12);
  color: var(--ice);
  cursor: pointer;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease,
    color 120ms ease;
}

.subscription-redemption-page .manual-record-submit:hover {
  transform: translateY(-1px);
  border-color: rgba(117, 232, 239, 0.82);
  background: rgba(86, 185, 193, 0.2);
}

.subscription-redemption-page .manual-record-input-button {
  padding: 7px 13px;
  font-size: 10px;
}

.subscription-redemption-page .nav-col-action {
  width: 150px;
}

.subscription-redemption-page .nav-row-actions {
  white-space: nowrap;
}

.subscription-redemption-page .nav-row-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  margin-left: 6px;
  border: 1px solid rgba(86, 185, 193, 0.42);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(86, 185, 193, 0.1);
  color: var(--ice);
  cursor: pointer;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease,
    color 120ms ease;
}

.subscription-redemption-page .nav-row-action-button:hover {
  transform: translateY(-1px);
  border-color: rgba(117, 232, 239, 0.78);
  background: rgba(86, 185, 193, 0.18);
}

.subscription-redemption-page .nav-row-delete-button {
  border-color: rgba(255, 138, 152, 0.38);
  background: rgba(255, 138, 152, 0.1);
  color: #ffd6dc;
}

.subscription-redemption-page .nav-row-delete-button:hover {
  border-color: rgba(255, 138, 152, 0.76);
  background: rgba(255, 138, 152, 0.17);
}

.subscription-redemption-page .sub-red-table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.subscription-redemption-page .sub-red-table-actions .manual-record-status {
  max-width: 360px;
}

.subscription-redemption-page .manual-record-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.subscription-redemption-page .manual-record-modal.is-open {
  display: flex;
}

.subscription-redemption-page .manual-record-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 14, 0.72);
  backdrop-filter: blur(8px);
}

.subscription-redemption-page .manual-record-dialog {
  position: relative;
  width: min(520px, 100%);
  border: 1px solid rgba(103, 232, 215, 0.18);
  border-radius: 18px;
  padding: 18px;
  background:
    radial-gradient(700px 260px at 20% -10%, rgba(103, 232, 215, 0.12), transparent 58%), #111723;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
}

.subscription-redemption-page .manual-record-dialog-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.subscription-redemption-page .manual-record-dialog-head h2 {
  margin: 0;
  color: var(--mist);
  font-size: 17px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.subscription-redemption-page .manual-record-close {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(244, 247, 251, 0.82);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.subscription-redemption-page .manual-record-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.subscription-redemption-page .manual-record-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 10px 15px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(244, 247, 251, 0.78);
  cursor: pointer;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (max-width: 1060px) {
  .subscription-redemption-page .manual-record-form,
  .subscription-redemption-page .nav-manual-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .subscription-redemption-page .manual-record-head,
  .subscription-redemption-page .manual-record-strip,
  .subscription-redemption-page .manual-record-actions,
  .subscription-redemption-page .manual-record-form,
  .subscription-redemption-page .nav-manual-form {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .subscription-redemption-page .manual-record-status {
    text-align: left;
  }
}

.subscription-redemption-page .sub-red-chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 12px;
}

.subscription-redemption-page .sub-red-chart-grid-pair {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: stretch;
  gap: 0;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(17, 20, 31, 0.82);
  overflow: hidden;
}

.subscription-redemption-page .sub-red-chart-grid-single {
  grid-template-columns: minmax(0, 1fr);
}

.subscription-redemption-page .sub-red-unified-chart-card {
  padding: 16px 18px 18px;
}

.subscription-redemption-page .sub-red-chart-card {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 14px;
  background: rgba(17, 20, 31, 0.82);
}

.subscription-redemption-page .sub-red-chart-grid-pair .sub-red-chart-card {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.subscription-redemption-page .sub-red-chart-grid-pair .sub-red-chart-card + .sub-red-chart-card {
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.subscription-redemption-page .sub-red-chart-card-large {
  padding: 16px;
  position: relative;
}

.subscription-redemption-page .sub-red-chart-grid-pair .sub-red-chart-card-large:first-child {
  margin-left: 0;
}

.subscription-redemption-page .sub-red-chart-grid-pair .sub-red-chart-card-large:last-child {
  margin-right: 0;
}

.subscription-redemption-page .sub-red-chart-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.subscription-redemption-page .sub-red-chart-head-large {
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.subscription-redemption-page .sub-red-chart-head-large > div:first-child {
  display: grid;
  gap: 4px;
}

.subscription-redemption-page .sub-red-chart-head span {
  color: rgba(232, 237, 245, 0.58);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.subscription-redemption-page .sub-red-chart-head strong {
  color: var(--mist);
  font-size: 13px;
  font-weight: 950;
  text-align: right;
}

.subscription-redemption-page .sub-red-chart-head-large strong {
  font-size: 18px;
  text-align: left;
}

.subscription-redemption-page .sub-red-chart-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.subscription-redemption-page .sub-red-chart-toggle button {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: transparent;
  color: rgba(232, 237, 245, 0.66);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition:
    background 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.subscription-redemption-page .sub-red-chart-toggle button:hover {
  color: var(--mist);
  background: rgba(255, 255, 255, 0.07);
}

.subscription-redemption-page .sub-red-chart-toggle button.is-active {
  color: #9ff4f0;
  background: rgba(103, 232, 215, 0.14);
  box-shadow: inset 0 0 0 1px rgba(103, 232, 215, 0.24);
}

.subscription-redemption-page .sub-red-range-toggle button.is-active {
  color: #ffd98a;
  background: rgba(224, 179, 65, 0.14);
  box-shadow: inset 0 0 0 1px rgba(224, 179, 65, 0.26);
}

.subscription-redemption-page .sub-red-aggregate-toggle button.is-active {
  color: #b9c7ff;
  background: rgba(127, 146, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(127, 146, 255, 0.26);
}

.subscription-redemption-page .sub-red-chart-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: -2px 0 8px;
  color: rgba(232, 237, 245, 0.62);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.subscription-redemption-page .sub-red-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.subscription-redemption-page .sub-red-chart-legend i {
  display: inline-block;
  width: 14px;
  height: 7px;
  border-radius: 999px;
}

.subscription-redemption-page .sub-red-chart-legend .legend-subscription {
  background: #67e8d7;
}

.subscription-redemption-page .sub-red-chart-legend .legend-redemption {
  background: #ff8a98;
}

.subscription-redemption-page .sub-red-chart-legend .legend-net {
  height: 2px;
  background: #e0b341;
}

.subscription-redemption-page .sub-red-chart-legend .legend-alert {
  width: 9px;
  height: 9px;
  background: #ff5b6b;
  transform: rotate(45deg);
}

.subscription-redemption-page .sub-red-line-chart {
  color: #67e8d7;
}

.subscription-redemption-page .sub-red-chart-redemption {
  color: #ff8a98;
}

.subscription-redemption-page .sub-red-chart-net {
  color: #e0b341;
}

.subscription-redemption-page .sub-red-line-chart svg {
  display: block;
  width: 100%;
  height: 132px;
}

.subscription-redemption-page .sub-red-chart-large svg {
  height: 236px;
}

.subscription-redemption-page .sub-red-unified-chart-card .sub-red-chart-large svg {
  height: 306px;
}

.subscription-redemption-page .sub-red-chart-axis {
  stroke: rgba(255, 255, 255, 0.13);
  stroke-width: 1;
}

.subscription-redemption-page .sub-red-chart-gridline {
  stroke: rgba(255, 255, 255, 0.09);
  stroke-width: 1;
}

.subscription-redemption-page .sub-red-chart-y-label,
.subscription-redemption-page .sub-red-chart-x-label {
  fill: rgba(232, 237, 245, 0.74);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.subscription-redemption-page .sub-red-chart-x-label-dense {
  font-size: 9px;
  fill: rgba(244, 247, 251, 0.82);
  font-weight: 850;
}

.subscription-redemption-page .sub-red-unified-chart-card .sub-red-chart-y-label {
  font-size: 8.5px;
}

.subscription-redemption-page .sub-red-chart-y-label {
  text-anchor: end;
}

.subscription-redemption-page .sub-red-chart-fill {
  stroke: none;
}

.subscription-redemption-page .sub-red-chart-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.subscription-redemption-page .sub-red-chart-line-subscription,
.subscription-redemption-page .sub-red-chart-dot-subscription {
  stroke: #67e8d7;
  color: #67e8d7;
}

.subscription-redemption-page .sub-red-chart-line-redemption,
.subscription-redemption-page .sub-red-chart-dot-redemption {
  stroke: #ff8a98;
  color: #ff8a98;
}

.subscription-redemption-page .sub-red-chart-line-net,
.subscription-redemption-page .sub-red-chart-dot-net {
  stroke: #e0b341;
  color: #e0b341;
}

.subscription-redemption-page .sub-red-aggregate-net-line {
  stroke-width: 2.8;
}

.subscription-redemption-page .sub-red-bar {
  rx: 1.8;
  shape-rendering: crispEdges;
}

.subscription-redemption-page .sub-red-bar-subscription {
  fill: rgba(103, 232, 215, 0.74);
}

.subscription-redemption-page .sub-red-bar-redemption {
  fill: rgba(255, 138, 152, 0.74);
}

.subscription-redemption-page .sub-red-chart-dot {
  fill: currentColor;
  stroke: #11151f;
  stroke-width: 2;
}

.subscription-redemption-page .sub-red-chart-dot-subscription {
  fill: #67e8d7;
}

.subscription-redemption-page .sub-red-chart-dot-redemption {
  fill: #ff8a98;
}

.subscription-redemption-page .sub-red-chart-dot-net {
  fill: #e0b341;
}

.subscription-redemption-page .sub-red-chart-hit {
  fill: transparent;
  stroke: transparent;
  cursor: crosshair;
}

.subscription-redemption-page .sub-red-chart-hit:focus {
  outline: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.subscription-redemption-page .sub-red-alert-marker path {
  fill: #ff5b6b;
  stroke: rgba(255, 255, 255, 0.74);
  stroke-width: 1;
}

.subscription-redemption-page .sub-red-alert-marker:focus {
  outline: none;
}

.subscription-redemption-page .sub-red-chart-tooltip {
  position: absolute;
  z-index: 8;
  display: grid;
  gap: 2px;
  min-width: 132px;
  padding: 8px 10px;
  border: 1px solid rgba(103, 232, 215, 0.28);
  border-radius: 10px;
  background: rgba(10, 14, 23, 0.94);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
  color: var(--mist);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -6px);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.subscription-redemption-page .sub-red-chart-tooltip.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.subscription-redemption-page .sub-red-chart-tooltip span {
  color: rgba(232, 237, 245, 0.62);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.subscription-redemption-page .sub-red-chart-tooltip strong {
  color: #9ff4f0;
  font-size: 13px;
  font-weight: 950;
}

.subscription-redemption-page .sub-red-chart-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  color: rgba(232, 237, 245, 0.54);
  font-size: 10px;
}

.subscription-redemption-page .sub-red-chart-card-large .sub-red-chart-meta {
  margin-top: 10px;
  font-size: 12px;
}

.subscription-redemption-page .sub-red-chart-empty {
  display: grid;
  min-height: 132px;
  place-items: center;
  color: rgba(232, 237, 245, 0.54);
  font-size: 12px;
}

.subscription-redemption-page .sub-red-table-card {
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 14px;
  background: rgba(17, 20, 31, 0.82);
  overflow: hidden;
}

.subscription-redemption-page .sub-red-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.subscription-redemption-page .sub-red-table-head h2 {
  margin: 0;
  color: var(--mist);
  font-size: 15px;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.subscription-redemption-page .sub-red-table-head span {
  color: #9fe7e9;
  font-size: 12px;
  font-weight: 850;
}

.subscription-redemption-page .sub-red-table-wrap {
  max-height: 560px;
  overflow: auto;
}

.subscription-redemption-page .sub-red-table {
  width: 100%;
  border-collapse: collapse;
  color: #e8edf5;
  font-size: 12px;
  table-layout: fixed;
}

.subscription-redemption-page .sub-red-table th,
.subscription-redemption-page .sub-red-table td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
}

.subscription-redemption-page .sub-red-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #121722;
  color: rgba(232, 237, 245, 0.68);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.subscription-redemption-page .sub-red-table thead tr:first-child th {
  top: 0;
  color: rgba(232, 237, 245, 0.58);
  background: #141b27;
}

.subscription-redemption-page .sub-red-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.025);
}

.subscription-redemption-page .sub-red-table .num {
  text-align: right;
}

.subscription-redemption-page .sub-red-table th:nth-child(1),
.subscription-redemption-page .sub-red-table td:nth-child(1) {
  width: 9%;
}

.subscription-redemption-page .sub-red-table th:nth-child(2),
.subscription-redemption-page .sub-red-table td:nth-child(2) {
  width: 13%;
}

.subscription-redemption-page .sub-red-table th:nth-child(3),
.subscription-redemption-page .sub-red-table td:nth-child(3) {
  width: 6%;
}

.subscription-redemption-page .sub-red-table th:nth-child(4),
.subscription-redemption-page .sub-red-table td:nth-child(4) {
  width: 10%;
}

.subscription-redemption-page .sub-red-table th:nth-child(5),
.subscription-redemption-page .sub-red-table td:nth-child(5) {
  width: 15%;
}

.subscription-redemption-page .sub-red-table th:nth-child(6),
.subscription-redemption-page .sub-red-table td:nth-child(6) {
  width: 10%;
}

.subscription-redemption-page .sub-red-table th:nth-child(7),
.subscription-redemption-page .sub-red-table td:nth-child(7) {
  width: 8%;
}

.subscription-redemption-page .sub-red-table th:nth-child(8),
.subscription-redemption-page .sub-red-table td:nth-child(8) {
  width: 20%;
}

.subscription-redemption-page .sub-red-table th:nth-child(9),
.subscription-redemption-page .sub-red-table td:nth-child(9) {
  width: 9%;
  text-align: center;
}

.subscription-redemption-page .sub-red-direction,
.subscription-redemption-page .sub-red-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.04em;
}

.subscription-redemption-page .sub-red-subscription {
  color: #65e2c1;
  background: rgba(58, 201, 153, 0.1);
}

.subscription-redemption-page .sub-red-redemption {
  color: #ff8a98;
  background: rgba(255, 83, 112, 0.1);
}

.subscription-redemption-page .sub-red-status {
  color: #66dfab;
  background: rgba(58, 201, 153, 0.1);
}

.subscription-redemption-page .sub-red-table td em {
  margin-left: 6px;
  color: rgba(232, 237, 245, 0.44);
  font-style: normal;
}

.subscription-redemption-page .sub-red-actions {
  white-space: nowrap;
}

.subscription-redemption-page .sub-red-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  border: 1px solid rgba(86, 185, 193, 0.42);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--ice);
  background: rgba(86, 185, 193, 0.1);
  cursor: pointer;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition:
    transform 120ms ease,
    border-color 120ms ease,
    background 120ms ease,
    color 120ms ease;
}

.subscription-redemption-page .sub-red-actions button:hover {
  transform: translateY(-1px);
  border-color: rgba(117, 232, 239, 0.78);
  background: rgba(86, 185, 193, 0.18);
}

.subscription-redemption-page .sub-red-actions button + button {
  margin-left: 6px;
}

.subscription-redemption-page .sub-red-actions .sub-red-row-delete-button {
  border-color: rgba(255, 138, 152, 0.38);
  background: rgba(255, 138, 152, 0.1);
  color: #ffd6dc;
}

.subscription-redemption-page .sub-red-actions .sub-red-row-delete-button:hover {
  border-color: rgba(255, 138, 152, 0.76);
  background: rgba(255, 138, 152, 0.17);
}

.nav-page .nav-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.nav-page .nav-summary-card {
  display: grid;
  gap: 6px;
  min-height: 108px;
  align-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 18px 20px;
  background: rgba(19, 23, 34, 0.92);
}

.nav-page .nav-summary-card span {
  color: rgba(232, 237, 245, 0.58);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav-page .nav-summary-card strong {
  font-size: 24px;
  font-weight: 950;
  letter-spacing: -0.02em;
}

.nav-page .nav-summary-card.nav-teal strong {
  color: #67e8d7;
}

.nav-page .nav-summary-card.nav-pink strong {
  color: #ff8a98;
}

.nav-page .nav-summary-card.nav-gold strong {
  color: #e0b341;
}

.nav-page .nav-summary-card small {
  color: rgba(244, 247, 251, 0.78);
  font-size: 12px;
  font-weight: 850;
}

.nav-page .nav-history-card {
  margin-top: 12px;
}

.nav-page .nav-history-chart svg {
  display: block;
  width: 100%;
  height: 306px;
}

.nav-page .nav-chart-line {
  fill: none;
  stroke-width: 3.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-page .nav-chart-area {
  stroke: none;
  opacity: 0.86;
}

.nav-page .nav-chart-area-a1 {
  fill: url("#navA1Fill");
}

.nav-page .nav-chart-area-a2 {
  fill: url("#navA2Fill");
}

.nav-page .nav-chart-line-a1 {
  stroke: #67e8d7;
}

.nav-page .nav-chart-line-a2 {
  stroke: #e0b341;
}

.nav-page .nav-chart-month-label {
  font-size: 9px;
  letter-spacing: 0.01em;
}

.nav-page .nav-table-wrap {
  overflow-x: hidden;
}

.nav-page .nav-table-return-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(360px, 0.82fr);
  gap: 12px;
  align-items: start;
  margin-top: 12px;
}

.nav-page .nav-table-return-grid .sub-red-table-card {
  margin-top: 0;
}

.nav-page .nav-table {
  min-width: 0;
}

.nav-page .nav-table .nav-col-date {
  width: 30%;
}

.nav-page .nav-table .nav-col-a1,
.nav-page .nav-table .nav-col-a2 {
  width: 35%;
}

.nav-page .nav-table th:nth-child(2),
.nav-page .nav-table td:nth-child(2),
.nav-page .nav-table th:nth-child(3),
.nav-page .nav-table td:nth-child(3) {
  padding-right: 16px;
  text-align: right;
}

.nav-page #navSourceLabel {
  max-width: 240px;
  text-align: right;
  line-height: 1.2;
}

.nav-page .nav-return-card {
  min-height: 320px;
}

.nav-page .nav-return-wrap {
  max-height: none;
  overflow: visible;
}

.nav-page .nav-return-table {
  table-layout: fixed;
}

.nav-page .nav-return-table th:nth-child(1),
.nav-page .nav-return-table td:nth-child(1) {
  width: 18%;
}

.nav-page .nav-return-table th:nth-child(2),
.nav-page .nav-return-table td:nth-child(2) {
  width: 34%;
}

.nav-page .nav-return-table th:nth-child(3),
.nav-page .nav-return-table td:nth-child(3),
.nav-page .nav-return-table th:nth-child(4),
.nav-page .nav-return-table td:nth-child(4),
.nav-page .nav-return-table th:nth-child(5),
.nav-page .nav-return-table td:nth-child(5) {
  width: 16%;
  text-align: right;
}

.nav-page .nav-return-table td {
  vertical-align: middle;
}

.nav-page .nav-return-table td strong {
  display: block;
  color: var(--mist);
  font-size: 11px;
  font-weight: 900;
}

.nav-page .nav-return-table td small {
  display: block;
  margin-top: 2px;
  color: rgba(232, 237, 245, 0.48);
  font-size: 10px;
  font-weight: 750;
}

.nav-page .nav-return-delta-cell span,
.nav-page .nav-return-delta-cell small {
  display: block;
  font-size: 11px;
  font-weight: 950;
  line-height: 1.25;
}

.nav-page .nav-return-delta-cell .delta-up,
.dashboard-page .nav-return-delta-mini .delta-up {
  color: #72e6a8 !important;
}

.nav-page .nav-return-delta-cell .delta-down,
.dashboard-page .nav-return-delta-mini .delta-down {
  color: #ff7f93 !important;
}

.nav-page .nav-custom-return-inputs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 6px;
  align-items: center;
}

.nav-page .nav-custom-return-inputs span {
  color: rgba(232, 237, 245, 0.56);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.nav-page .nav-custom-return-inputs input {
  min-width: 0;
  width: 100%;
  border: 1px solid rgba(103, 232, 215, 0.2);
  border-radius: 8px;
  padding: 6px 7px;
  color: var(--mist);
  background: rgba(255, 255, 255, 0.05);
  font-size: 10px;
  font-weight: 850;
  color-scheme: dark;
}

@media (max-width: 1100px) {
  .subscription-redemption-page .sub-red-overview,
  .subscription-redemption-page .sub-red-product-grid,
  .subscription-redemption-page .sub-red-chart-grid,
  .nav-page .nav-table-return-grid {
    grid-template-columns: 1fr;
  }
}

.card-head h1,
.portfolio-only-card h1,
.editable-rate-panel h1,
.calendar-only-card h1 {
  font-size: 24px !important;
}

.card-sub,
.workbook-drop-zone small,
.workbook-upload-status {
  font-size: 12px !important;
}

.eyebrow,
.upload-kicker,
.portfolio-inline-kpis span,
.scenario-control-grid label span,
.limit-summary-table th,
.weekly-maturity-table th,
.data-table th,
.deposit-register-table th,
.added-scenario-head span {
  font-size: 10px !important;
}

.portfolio-inline-kpis article {
  min-height: 76px !important;
  padding: 15px 16px !important;
}

.portfolio-inline-kpis strong,
.scenario-result-grid strong {
  font-size: 19px !important;
}

.portfolio-inline-kpis small,
.scenario-result-grid small,
.added-scenario-head small,
.empty-added-deals {
  font-size: 11px !important;
}

.scenario-result-grid article {
  padding: 14px 15px !important;
}

.scenario-control-grid select,
.scenario-control-grid input,
.subscription-input-row select,
.editable-rate-table input,
.portfolio-mini-input,
.sim-input {
  min-height: 35px !important;
  font-size: 12px !important;
  padding: 7px 9px !important;
}

.scenario-actions button,
.week-view-button,
.calendar-link-button,
.rate-sheet-actions button {
  min-height: 34px !important;
  font-size: 12px !important;
  padding: 7px 10px !important;
}

.data-table,
.deposit-register-table,
.weekly-maturity-table,
.limit-summary-table,
.editable-rate-table {
  font-size: 12px !important;
}

.data-table th,
.deposit-register-table th,
.weekly-maturity-table th,
.limit-summary-table th,
.editable-rate-table th {
  height: 36px !important;
}

.data-table td,
.deposit-register-table td,
.weekly-maturity-table td,
.limit-summary-table td,
.editable-rate-table td {
  padding: 10px 11px !important;
}

.fund-simulation-page .weekly-maturity-table tr.weekly-month-row td {
  font-size: 15px !important;
}

.week-date-range {
  font-size: 11px !important;
}

.week-signal-low {
  font-size: 9px !important;
  padding: 3px 7px !important;
}

.added-scenario-head {
  padding: 11px 12px !important;
}

.added-scenario-table th,
.added-scenario-table td {
  padding: 8px 9px !important;
  font-size: 11px !important;
}

@media (min-width: 1020px) {
  .calendar-page .brand-name,
  .fund-simulation-page .brand-name,
  .portfolio-page .brand-name,
  .rate-sheet-page .brand-name {
    font-size: 14px !important;
  }

  .calendar-page .site-nav a,
  .fund-simulation-page .site-nav a,
  .portfolio-page .site-nav a,
  .rate-sheet-page .site-nav a {
    font-size: 12px !important;
  }
}

/* Simulation KPI layout with scenario idle-cash detail */
.fund-simulation-page .scenario-result-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

.fund-simulation-page .scenario-cash-card small {
  line-height: 1.35 !important;
}

.fund-simulation-page .scenario-cash-card em,
.fund-simulation-page .scenario-cash-card b {
  font-style: normal !important;
  font-weight: 900 !important;
}

.fund-simulation-page .scenario-cash-card b {
  color: #e9f3f7 !important;
}
/* ───────────────────────────────────────────────────────────────────────────
   Sidebar utility cluster — unify the bottom-left controls.
   The business-date selector (date-context.js), presence bar (presence.js) and
   Time Machine button (time-machine.js) each inject their own minimal styles,
   so they rendered as mismatched native controls — including a white <select> —
   that clashed with the dark rail. These rules give them one design language
   that matches the sidebar nav pills and the MODE/FX meta labels. Control
   appearance is themed in any header context; full-width stacking on the gutter
   is applied only in the >=1020px left rail.
   ─────────────────────────────────────────────────────────────────────────── */

/* Field labels ("Business date") read like the MODE/FX/VALUATION labels. */
.site-header .mmf-date-label {
  opacity: 1;
  color: var(--text-faint);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* The date trigger and Time Machine share one pill: dark surface, hairline
   border, 6px radius — same family as the nav links. */
.site-header .mmf-date-trigger,
.site-header .mmf-tm-btn {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
  /* !important to beat the global `button {…!important}` reset (≈ line 6018). */
  color: var(--text) !important;
  background: rgba(255, 255, 255, 0.025) !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  padding: 7px 10px;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}

/* The trigger reads as a field: calendar glyph, the date, then a caret. */
.site-header .mmf-date-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  font-variant-numeric: tabular-nums;
}
.site-header .mmf-date-trigger .mmf-cal-ico {
  color: var(--teal);
  flex: 0 0 auto;
}
.site-header .mmf-date-trigger-text {
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-header .mmf-date-trigger .mmf-cal-caret {
  color: var(--text-faint);
  flex: 0 0 auto;
}

.site-header .mmf-date-trigger:hover,
.site-header .mmf-tm-btn:hover,
.site-header .mmf-date-trigger[aria-expanded="true"] {
  border-color: rgba(85, 199, 207, 0.4) !important;
  background: rgba(85, 199, 207, 0.1) !important;
  color: var(--ice) !important;
}
.site-header .mmf-date-trigger:hover .mmf-cal-caret,
.site-header .mmf-date-trigger[aria-expanded="true"] .mmf-cal-caret {
  color: var(--ice);
}
.site-header .mmf-date-trigger:focus-visible,
.site-header .mmf-tm-btn:focus-visible {
  outline: 2px solid rgba(85, 199, 207, 0.6);
  outline-offset: 1px;
  border-color: rgba(85, 199, 207, 0.5) !important;
}

/* Time Machine: the cluster's other utility action. */
.site-header .mmf-tm-btn {
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Inline status (date-create / lock notes) — calm gold, hidden when empty. */
.site-header .mmf-date-msg {
  color: var(--gold);
  font-size: 11px;
}
.site-header .mmf-date-msg:empty {
  display: none;
}

/* Presence: "N online" reads as a label; avatars use the rail's teal family. */
.site-header .mmf-presence-bar {
  color: var(--text-faint);
  font-size: 11px;
  gap: 6px;
  flex-wrap: wrap;
}
.site-header .mmf-presence-count {
  opacity: 1;
  color: var(--text-faint);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.site-header .mmf-avatar {
  width: 21px;
  height: 21px;
  background: #2c6e74;
  color: var(--ice);
  border: 1px solid rgba(85, 199, 207, 0.35);
  font-size: 9px;
  font-weight: 700;
}
.site-header .mmf-lock-note {
  color: var(--gold);
}

/* ── Left rail (>=1020px): stack the cluster full-width on the 12px gutter that
      the MODE/FX meta and the upload card already use, as one tidy group. ── */
@media (min-width: 1020px) {
  .calendar-page .mmf-date-panel,
  .fund-simulation-page .mmf-date-panel,
  .portfolio-page .mmf-date-panel,
  .rate-sheet-page .mmf-date-panel {
    display: grid !important;
    gap: 6px !important;
    width: 100% !important;
    padding: 10px 12px 0 !important;
    margin: 0 !important;
  }
  .calendar-page .mmf-date-trigger,
  .fund-simulation-page .mmf-date-trigger,
  .portfolio-page .mmf-date-trigger,
  .rate-sheet-page .mmf-date-trigger {
    width: 100% !important;
  }
  .calendar-page .mmf-presence-bar,
  .fund-simulation-page .mmf-presence-bar,
  .portfolio-page .mmf-presence-bar,
  .rate-sheet-page .mmf-presence-bar {
    width: 100% !important;
    padding: 9px 12px 0 !important;
  }
  .calendar-page .mmf-tm-btn,
  .fund-simulation-page .mmf-tm-btn,
  .portfolio-page .mmf-tm-btn,
  .rate-sheet-page .mmf-tm-btn {
    width: calc(100% - 24px) !important;
    margin: 10px 12px 2px !important;
  }
}

/* ───────────────────────────────────────────────────────────────────────────
   Business-date calendar picker (date-context.js). A popover anchored to the
   rail trigger: future days disabled, weekends muted, holidays rose + named,
   existing dates dotted, the active date filled. Appended to <body> so the rail
   never clips it; palette matches the maturity calendar (rose holiday / teal data).
   The day/nav/confirm cells are <button>s, so the global `button {…!important}`
   reset (≈ line 6018) forces a dark box on them — these rules use !important to
   reclaim the flat-cell / teal-selected / rose-holiday look.
   ─────────────────────────────────────────────────────────────────────────── */
.mmf-cal-pop {
  position: fixed;
  z-index: 9999;
  width: 286px;
  box-sizing: border-box;
  padding: 12px;
  background: #11151f;
  border: 1px solid var(--border, #2a2f3a);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  color: var(--text, #f1f5f9);
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 12px;
  user-select: none;
}
.mmf-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.mmf-cal-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.mmf-cal-nav {
  appearance: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  color: var(--text-muted, #9aa4b2) !important;
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid var(--border, #2a2f3a) !important;
  border-radius: 7px !important;
  cursor: pointer;
  transition:
    color 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}
.mmf-cal-nav:hover {
  color: var(--ice, #dff9fb) !important;
  border-color: rgba(85, 199, 207, 0.4) !important;
  background: rgba(85, 199, 207, 0.1) !important;
}
.mmf-cal-nav:focus-visible {
  outline: 2px solid rgba(85, 199, 207, 0.6);
  outline-offset: 1px;
}
.mmf-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.mmf-cal-dow span {
  text-align: center;
  padding: 2px 0 6px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint, #687384);
}
.mmf-cal-day {
  appearance: none;
  position: relative;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font: inherit;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text, #f1f5f9) !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  cursor: pointer;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease;
}
.mmf-cal-day:hover {
  background: rgba(85, 199, 207, 0.12) !important;
  border-color: rgba(85, 199, 207, 0.3) !important;
}
.mmf-cal-day:focus-visible {
  outline: 2px solid rgba(85, 199, 207, 0.65);
  outline-offset: -1px;
}
/* a data dot under the number marks existing business dates */
.mmf-cal-day.has-data::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--teal, #56b9c1);
}
.mmf-cal-day.is-today {
  border-color: rgba(85, 199, 207, 0.5) !important;
}
.mmf-cal-day.is-weekend {
  color: var(--text-faint, #687384) !important;
}
.mmf-cal-day.is-future {
  color: var(--text-faint, #687384) !important;
  opacity: 0.45;
}
/* the next banking day — the one future day open for manual carry-forward input */
.mmf-cal-day.is-next {
  color: var(--text, #f1f5f9) !important;
  border-color: rgba(85, 199, 207, 0.4) !important;
  border-style: dashed !important;
}
.mmf-cal-day.is-outside {
  color: var(--text-faint, #687384) !important;
  opacity: 0.28;
}
.mmf-cal-day.is-holiday {
  color: #ffd4dc !important;
  background: rgba(224, 122, 139, 0.13) !important;
  border-color: rgba(224, 122, 139, 0.32) !important;
}
/* non-selectable days (weekend / holiday / future / outside) don't react to hover */
.mmf-cal-day[aria-disabled="true"],
.mmf-cal-day.is-outside {
  cursor: default;
}
.mmf-cal-day[aria-disabled="true"]:hover,
.mmf-cal-day.is-outside:hover {
  background: transparent !important;
  border-color: transparent !important;
}
.mmf-cal-day.is-holiday[aria-disabled="true"]:hover {
  background: rgba(224, 122, 139, 0.13) !important;
  border-color: rgba(224, 122, 139, 0.32) !important;
}
.mmf-cal-day.is-selected,
.mmf-cal-day.is-selected:hover {
  background: var(--teal, #56b9c1) !important;
  border-color: var(--teal, #56b9c1) !important;
  color: #06121a !important;
  font-weight: 800;
}
.mmf-cal-day.is-selected.has-data::after {
  background: #06121a;
}
.mmf-cal-day.is-pending {
  border-color: var(--teal, #56b9c1) !important;
  border-style: dashed !important;
}

.mmf-cal-foot {
  margin-top: 10px;
}
.mmf-cal-confirm {
  display: grid;
  gap: 8px;
  padding: 9px 10px;
  margin-bottom: 9px;
  border: 1px solid rgba(85, 199, 207, 0.25);
  background: rgba(85, 199, 207, 0.07);
  border-radius: 9px;
}
.mmf-cal-confirm-txt {
  display: grid;
  gap: 2px;
}
.mmf-cal-confirm-txt strong {
  font-size: 12px;
  font-weight: 800;
}
.mmf-cal-confirm-txt span {
  font-size: 10.5px;
  color: var(--text-muted, #9aa4b2);
}
.mmf-cal-err {
  font-style: normal;
  font-size: 10.5px;
  color: var(--rose, #ec6b7a);
}
.mmf-cal-confirm-act {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
.mmf-cal-cancel,
.mmf-cal-create {
  appearance: none;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 7px !important;
  cursor: pointer;
  border: 1px solid transparent !important;
  box-shadow: none !important;
  transition:
    color 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease,
    filter 0.15s ease;
}
.mmf-cal-cancel {
  color: var(--text-muted, #9aa4b2) !important;
  background: transparent !important;
  border-color: var(--border, #2a2f3a) !important;
}
.mmf-cal-cancel:hover {
  color: var(--text, #f1f5f9) !important;
  border-color: var(--text-faint, #687384) !important;
}
.mmf-cal-create {
  color: #06121a !important;
  background: var(--teal, #56b9c1) !important;
  border-color: var(--teal, #56b9c1) !important;
}
.mmf-cal-create:hover {
  filter: brightness(1.08);
}
.mmf-cal-create:disabled {
  opacity: 0.6;
  cursor: default;
}
.mmf-cal-cancel:focus-visible,
.mmf-cal-create:focus-visible {
  outline: 2px solid rgba(85, 199, 207, 0.6);
  outline-offset: 1px;
}
.mmf-cal-note {
  margin-bottom: 9px;
  font-size: 10px;
  line-height: 1.35;
  color: var(--gold, #e5ad3d);
}
.mmf-cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding-top: 9px;
  border-top: 1px solid var(--border-soft, #202632);
  font-size: 10px;
  color: var(--text-muted, #9aa4b2);
}
.mmf-cal-legend span {
  display: inline-flex;
  align-items: center;
}
.mmf-cal-legend i {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  margin-right: 5px;
}
.mmf-cal-legend .lg-data {
  background: var(--teal, #56b9c1);
}
.mmf-cal-legend .lg-create {
  background: transparent;
  border: 1px solid var(--text-faint, #687384);
}
.mmf-cal-legend .lg-holiday {
  background: rgba(224, 122, 139, 0.5);
  border: 1px solid rgba(224, 122, 139, 0.7);
}
.mmf-cal-legend .lg-off {
  background: var(--text-faint, #687384);
  opacity: 0.5;
}
@media (prefers-reduced-motion: reduce) {
  .mmf-cal-day,
  .mmf-cal-nav,
  .mmf-cal-cancel,
  .mmf-cal-create {
    transition: none;
  }
}

/* Portfolio: AVG RATE stat + tenor / to-maturity table filters */
.portfolio-head-stats {
  display: flex;
  align-items: stretch;
  gap: 10px;
}
.portfolio-avg-rate-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 116px;
}
.fund-excel-register .portfolio-avg-rate-stat strong {
  margin-top: 0;
  color: #67e8d7 !important;
}
.portfolio-filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  flex: 0 0 auto;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: linear-gradient(180deg, #151923 0%, #11151f 100%);
}
.portfolio-filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.portfolio-filter-label {
  color: #8da0b7;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.portfolio-filter-toggle {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}
.portfolio-filter-chip {
  border: 0 !important;
  border-radius: 999px !important;
  padding: 6px 11px !important;
  background: transparent !important;
  color: rgba(232, 237, 245, 0.66) !important;
  font-size: 11px !important;
  font-weight: 900 !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
  min-height: 0 !important;
  box-shadow: none !important;
  transition:
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}
.portfolio-filter-chip:hover {
  color: var(--mist) !important;
  background: rgba(255, 255, 255, 0.07) !important;
}
.portfolio-filter-chip.is-active {
  color: #9ff4f0 !important;
  background: rgba(103, 232, 215, 0.14) !important;
  box-shadow: inset 0 0 0 1px rgba(103, 232, 215, 0.24) !important;
}
.portfolio-filter-clear {
  margin-left: auto;
  min-height: 28px !important;
  padding: 5px 12px !important;
  font-size: 11px !important;
}
.portfolio-filter-clear[hidden] {
  display: none !important;
}
.portfolio-empty-row td {
  padding: 20px 14px !important;
  color: var(--text-muted) !important;
  font-size: 13px;
  text-align: center;
}

/* ---------------------------------------------------------------------------
   Dataset toggle (injected by data-store.js) — Manual vs AlphaDesk (NAS-pushed
   base book with manual planning inputs). Sits directly under the brand in the sidebar
   rail. Visual props carry !important to beat the global button reset. The AD
   option uses the gold accent so the verification view is unmistakable.
--------------------------------------------------------------------------- */
.dataset-toggle {
  margin: 8px 12px 0;
  padding: 8px;
  border: 1px solid rgba(85, 199, 207, 0.15);
  border-radius: 9px;
  background: rgba(11, 15, 24, 0.92);
  /* Below 1020px .header-inner is a 3-column grid; take a full row of our own
     instead of displacing the nav column. In the >=1020px rail .header-inner
     becomes a flex column and grid-column is ignored. */
  grid-column: 1 / -1;
  max-width: 300px;
}
.dataset-toggle-row {
  display: grid;
  /* minmax(0, …) so a pill's min-content can never widen the row past its
     container (the old ALPHADESK label used to force a horizontal scrollbar
     in the rail). The >=1020px rail narrows this to content-sized MANUAL. */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
button.dataset-toggle-option {
  min-height: 28px;
  padding: 4px 6px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(86, 185, 193, 0.28) !important;
  background: rgba(23, 29, 42, 0.9) !important;
  color: #8491a4 !important;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
button.dataset-toggle-option:hover {
  color: var(--ice) !important;
}
button.dataset-toggle-option.is-active {
  border-color: rgba(117, 232, 239, 0.78) !important;
  background: rgba(86, 185, 193, 0.18) !important;
  color: var(--ice) !important;
}
button.dataset-toggle-option-ad.is-active {
  border-color: rgba(229, 173, 61, 0.85) !important;
  background: rgba(229, 173, 61, 0.16) !important;
  color: #f8e3b0 !important;
}
button.dataset-toggle-option:focus-visible {
  outline: 2px solid var(--ice) !important;
  outline-offset: 2px;
}
.dataset-toggle-caption {
  margin: 6px 2px 0;
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #687384;
}
html.dataset-ad .dataset-toggle-caption {
  color: #e0b341;
}

/* AD source rows remain read-only. Hide only controls that replace or mutate the
   NAS-sourced workbook/sub-red/NAV state; scenario, rate, and top-holding inputs
   remain available through the exact same resources used by Manual mode. */
html.dataset-ad #workbookUploadPanel,
html.dataset-ad .manual-record-input-button,
html.dataset-ad .manual-record-modal,
html.dataset-ad .sub-red-actions,
html.dataset-ad [data-nav-edit-date],
html.dataset-ad [data-nav-delete-date],
html.dataset-ad #mmfTmBtn,
html.dataset-ad #mmfTmRestore,
html.dataset-ad #clearPortfolioData {
  display: none !important;
}

/* Final responsive guard for Fund Simulation. Several earlier desktop layout
   guards use !important, so this must remain after them to keep the newly
   available scenario inputs reachable on tablet and mobile. */
@media (max-width: 900px) {
  .fund-simulation-page .fund-sim-workspace {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
  }
  .fund-simulation-page .fund-sim-left-pane,
  .fund-simulation-page .fund-sim-right-pane {
    width: 100% !important;
    min-width: 0 !important;
    grid-column: 1 !important;
  }
  .fund-simulation-page .fund-sim-left-pane {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px;
    grid-row: 1 !important;
  }
  .fund-simulation-page .fund-sim-right-pane {
    grid-row: 2 !important;
  }
}

@media (max-width: 520px) {
  .fund-simulation-page .scenario-result-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* ── Counterparty List page ─────────────────────────────────────────────────
   Reuses the top-holding table/modal/input components; only the State owned
   checkbox and its label row are new (no native-checkbox styling existed). */
.counterparty-checkbox {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--teal);
}
.counterparty-state-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text);
}
.counterparty-state-toggle span {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.top-holding-form label.counterparty-form-state {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  grid-column: 1 / -1;
}
.top-holding-form label.counterparty-form-state span {
  font-size: 0.85rem;
}
.counterparty-table .top-holding-input {
  width: 100%;
  min-width: 140px;
}
/* State owned is fixed at creation — the column is static text, not a toggle. */
.counterparty-state-static {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.counterparty-state-static.is-state-owned {
  color: var(--text);
}
/* Staged-edit Save/Revert bar: only rendered while unsaved changes exist,
   sticky so the actions stay in view above a long registry table. */
.counterparty-save-bar {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 2px;
  border-top: 1px solid var(--border-soft);
  background: var(--surface);
}
.counterparty-save-bar[hidden] {
  display: none;
}
.counterparty-save-bar .counterparty-save-hint {
  margin-right: auto;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── WLA horizon month grid (fund simulation left pane) ─────────────────── */
.fund-simulation-page .wla-view-toggle {
  display: inline-flex;
  gap: 6px;
  margin: 10px 12px 2px;
}

.fund-simulation-page .wla-view-toggle button {
  min-height: 28px !important;
  padding: 0 14px !important;
  border: 1px solid #2a3140 !important;
  border-radius: 6px !important;
  background: #1a1f2a !important;
  color: #cbd5e1 !important;
  font-size: 10.5px !important;
  font-weight: 800 !important;
  cursor: pointer !important;
}

.fund-simulation-page .wla-view-toggle button:hover {
  background: #202734 !important;
  border-color: rgba(86, 185, 193, 0.7) !important;
  color: #ffffff !important;
}

.fund-simulation-page .wla-view-toggle button.is-active {
  background: var(--teal) !important;
  border-color: var(--teal) !important;
  color: #071014 !important;
}

.fund-simulation-page .wla-month-grid-mount {
  padding: 10px 12px 14px;
}

.wla-grid-empty {
  color: var(--text-muted) !important;
  font-size: 11px !important;
  padding: 14px 4px !important;
}

.fund-simulation-page .wla-grid-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 4px 0 2px;
}

.fund-simulation-page .wla-grid-head h3 {
  margin: 0 !important;
  color: var(--text) !important;
  font-size: 13px !important;
  font-weight: 900 !important;
  letter-spacing: 0.02em !important;
}

.fund-simulation-page .wla-grid-head h3 small {
  margin-left: 7px;
  color: var(--text-faint) !important;
  font-size: 10.5px !important;
  font-weight: 700 !important;
}

.wla-shortfall-summary {
  padding: 3px 10px;
  border: 1px solid rgba(240, 100, 118, 0.3);
  border-radius: 999px;
  background: rgba(240, 100, 118, 0.08);
  color: var(--err) !important;
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
}

.wla-all-funded {
  padding: 3px 10px;
  border: 1px solid rgba(55, 215, 138, 0.28);
  border-radius: 999px;
  background: rgba(55, 215, 138, 0.08);
  color: var(--green) !important;
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
}

.fund-simulation-page .wla-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 8px 0 12px;
  color: var(--text-muted) !important;
  font-size: 10px;
  font-weight: 700;
}

.fund-simulation-page .wla-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.fund-simulation-page .wla-legend i {
  font-style: normal;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: inline-grid;
  place-items: center;
  font-size: 8.5px;
  font-weight: 900;
}

.fund-simulation-page .wla-legend .wla-legend-ok i {
  background: rgba(55, 215, 138, 0.14);
  border: 1px solid rgba(55, 215, 138, 0.4);
  color: var(--green);
}

.fund-simulation-page .wla-legend .wla-legend-watch i {
  background: rgba(229, 173, 61, 0.14);
  border: 1px solid rgba(229, 173, 61, 0.4);
  color: var(--gold);
}

.fund-simulation-page .wla-legend .wla-legend-low i {
  background: rgba(240, 100, 118, 0.14);
  border: 1px solid rgba(240, 100, 118, 0.4);
  color: var(--err);
}

.fund-simulation-page .wla-month-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
  align-items: start;
}

.wla-month {
  background: var(--bg-elev) !important;
  border: 1px solid var(--border-soft) !important;
  border-radius: 7px !important;
  overflow: hidden;
}

.wla-month-title {
  margin: 0 !important;
  padding: 7px 10px 6px !important;
  border-bottom: 1px solid var(--border-soft) !important;
  color: #5ed2d2 !important;
  font-size: 10.5px !important;
  font-weight: 900 !important;
  letter-spacing: 0.1em !important;
  text-transform: uppercase !important;
}

.wla-weeks {
  display: grid;
  gap: 4px;
  padding: 6px;
}

.fund-simulation-page button.wla-week {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  width: 100% !important;
  min-height: 26px !important;
  padding: 4px 8px !important;
  border-radius: 5px !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: var(--text) !important;
  font-size: 10px !important;
  text-align: left !important;
  cursor: pointer !important;
}

.fund-simulation-page button.wla-week:hover {
  filter: brightness(1.25) !important;
}

.fund-simulation-page button.wla-week:focus-visible {
  outline: 2px solid var(--teal) !important;
  outline-offset: 1px !important;
}

.wla-week .wla-week-range {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.wla-week .wla-week-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.wla-week .wla-week-pct {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
}

.wla-week .wla-week-mark {
  font-size: 9px;
  font-weight: 900;
}

.fund-simulation-page button.wla-week.is-ok {
  background: rgba(55, 215, 138, 0.09) !important;
  border-color: rgba(55, 215, 138, 0.22) !important;
}

.wla-week.is-ok .wla-week-pct,
.wla-week.is-ok .wla-week-mark {
  color: var(--green);
}

.fund-simulation-page button.wla-week.is-watch {
  background: rgba(229, 173, 61, 0.09) !important;
  border-color: rgba(229, 173, 61, 0.24) !important;
}

.wla-week.is-watch .wla-week-pct,
.wla-week.is-watch .wla-week-mark {
  color: var(--gold);
}

.fund-simulation-page button.wla-week.is-low {
  background: rgba(240, 100, 118, 0.1) !important;
  border-color: rgba(240, 100, 118, 0.3) !important;
}

.wla-week.is-low .wla-week-pct,
.wla-week.is-low .wla-week-mark {
  color: var(--err);
}

.fund-simulation-page button.wla-week.is-current {
  box-shadow: inset 0 0 0 1px rgba(86, 185, 193, 0.55) !important;
}

.wla-week .wla-week-need {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(240, 100, 118, 0.14);
  color: var(--err);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 800;
  white-space: nowrap;
}

.wla-week.is-watch .wla-week-need {
  background: rgba(229, 173, 61, 0.14);
  color: var(--gold);
}

.wla-grid-foot {
  margin: 10px 0 0 !important;
  color: var(--text-faint) !important;
  font-size: 9.5px !important;
}

/* Business-day rollover banner (data-store.js date-watch, plan §3.1). Gold
   accent = --c7 (NOT --gold, which is overridden — see project conventions).
   Button visual props need !important against the global button reset. */
.mmf-rollover-banner {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: min(92vw, 640px);
  padding: 12px 18px;
  border-radius: 10px;
  background: #1c2437;
  border: 1px solid var(--c7, #e8c468);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  color: #f2f5fb;
  font-size: 0.92rem;
}
button.mmf-rollover-reload {
  background: var(--c7, #e8c468) !important;
  color: #1a2030 !important;
  border: none !important;
  border-radius: 8px !important;
  padding: 8px 14px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  cursor: pointer !important;
}

/* Stale-analysis badge (fund-simulation.js markScenarioAnalysisStale, plan
   §4.3): the generated narrative visibly flags that its inputs moved. */
.analysis-stale-note {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--c7, #e0b341);
  background: rgba(224, 179, 65, 0.12);
  color: var(--c7, #e0b341);
  font-size: 0.85rem;
}

/* Counterparty capacity table provenance rows (fund-simulation.js, plan §5):
   the loading placeholder and the loud built-in-limits fallback badge. */
.registry-note-row td {
  padding: 10px 12px;
  font-size: 0.85rem;
  color: rgba(242, 245, 251, 0.75);
  font-style: italic;
}
.registry-note-row.registry-fallback td {
  border-left: 3px solid var(--c7, #e0b341);
  /* !important: the global .limit-summary-table td background is transparent
     !important, which would silently kill this badge fill (review catch). */
  background: rgba(224, 179, 65, 0.12) !important;
  color: var(--c7, #e0b341);
  font-style: normal;
}
/* ————— Fund simulation pane overhaul (2026-07-24): collapsible counterparty
   limits, per-leg idle-cash alerts, MOP↔HKD exchange input + FX flow. ————— */

/* 1) Counterparty limits disclosure (collapsed by default). The global
   button reset (~6018) forces card chrome on every <button>, so the
   transparent header needs !important on each visual prop. */
.limit-summary-toggle {
  display: flex !important;
  width: 100% !important;
  align-items: center !important;
  gap: 9px !important;
  padding: 10px 11px !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: inherit !important;
  text-align: left !important;
  cursor: pointer;
}
.limit-summary-toggle:hover {
  background: rgba(86, 185, 193, 0.05) !important;
}
.limit-summary-chevron {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  color: var(--text-faint);
}
.limit-summary-chevron svg {
  display: block;
  width: 100%;
  height: 100%;
}
@media (prefers-reduced-motion: no-preference) {
  .limit-summary-chevron svg {
    transition: transform 160ms ease;
  }
}
.limit-summary-toggle[aria-expanded="true"] .limit-summary-chevron svg {
  transform: rotate(90deg);
}
.limit-summary-title {
  flex: 0 0 auto;
  /* Collapsed-by-default sections hide everything but this line, so it keeps
     the full section-header treatment (same as the old Simulation input head)
     instead of the faint 10px label it launched with. */
  color: #eff6ff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.limit-summary-digest {
  flex: 1 1 auto;
  color: #8f99a8;
  font-size: 10px;
  font-weight: 500;
  text-align: right;
}
.limit-summary-digest b {
  color: var(--ice);
  font-weight: 800;
}

/* Simulation input as a disclosure (2026-07-30): the working box reuses the
   limit-summary toggle chrome; its 12px body padding moves onto the collapsible
   body so the collapsed header sits flush like the counterparty one. */
.fund-simulation-page .scenario-working-box {
  padding: 0 !important;
}
.fund-simulation-page .scenario-working-toggle {
  padding: 12px 12px 11px !important;
}
.fund-simulation-page #scenarioWorkingBody {
  padding: 0 12px 12px;
}
.fund-simulation-page #scenarioWorkingBody .scenario-control-grid {
  border-top: 1px solid #252a34;
  padding-top: 10px;
}
.scenario-working-digest {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.scenario-working-digest em {
  color: inherit;
  font-style: normal;
  font-size: 11px;
}

/* Merged Used / Limit cell: the used figure carries the row's status color
   (via .limit-low/.limit-over td), the "/ limit" tail stays faint. */
.limit-summary-table .used-limit-cell b {
  font-weight: 700;
}
.limit-summary-table .used-limit-cell .of {
  color: var(--text-faint);
  font-weight: 400;
}

/* 2) Per-leg idle-cash alerts on the scenario cash card. Must outrank the
   card's own `.scenario-cash-card b { color:#e9f3f7!important }`. */
.fund-simulation-page .scenario-cash-card b.cash-low {
  color: var(--gold) !important;
}
.fund-simulation-page .scenario-cash-card b.cash-neg {
  color: var(--err) !important;
}

/* 3) Exchange input group — blue-slate tint distinguishes it from the teal
   cash-flow group and the gold deal group. */
.fund-simulation-page .scenario-exchange-row-title::after {
  background: linear-gradient(
    90deg,
    rgba(111, 144, 189, 0.6),
    rgba(111, 144, 189, 0.06)
  ) !important;
}
.fund-simulation-page .scenario-exchange-input-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 9px;
  border: 1px solid rgba(111, 144, 189, 0.28);
  border-radius: 10px;
  background: rgba(111, 144, 189, 0.06);
}
.fund-simulation-page .scenario-exchange-input-row label {
  min-width: 0;
}
@media (max-width: 1200px) {
  .fund-simulation-page .scenario-exchange-input-row {
    grid-template-columns: 1fr;
  }
}
.scenario-fx-delta {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.scenario-fx-delta span {
  color: #8b94a3 !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
}
.scenario-fx-delta output {
  display: inline-flex;
  align-items: center;
  width: 100%;
  min-height: 35px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
  color: #eaf7f8;
  font-size: 12px;
  font-weight: 500;
}
.scenario-fx-hint {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--text-faint);
  font-size: 10px;
}
.scenario-fx-hint b {
  color: #9fb4d6;
}

/* Add exchange mirrors the Add deal teal pill (id-pinned because the global
   button reset + .scenario-actions primary rules would repaint it). */
.fund-simulation-page #applyScenarioExchange {
  justify-self: start !important;
  border: 1px solid rgba(86, 185, 193, 0.46) !important;
  border-radius: 999px !important;
  background: rgba(86, 185, 193, 0.12) !important;
  color: var(--ice) !important;
  font-size: 10px !important;
  font-weight: 950 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  padding: 7px 12px !important;
}
.fund-simulation-page #applyScenarioExchange:hover {
  transform: translateY(-1px) !important;
  border-color: rgba(117, 232, 239, 0.82) !important;
  background: rgba(86, 185, 193, 0.2) !important;
}

/* FX conversion flow — a second, self-hiding table under the deal flow. */
.fx-conversion-flow {
  border-top: 1px solid #252a34;
}
.fx-flow-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 11px 7px;
  border-bottom: 1px solid #252a34;
  background: rgba(111, 144, 189, 0.05);
}
.fx-flow-head span {
  color: #9fb4d6;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.fx-flow-head small {
  color: #8f99a8;
  font-size: 10px;
}
.deal-type-badge.exchange {
  border: 1px solid rgba(86, 185, 193, 0.52) !important;
  background: rgba(86, 185, 193, 0.13) !important;
  color: #5de8d8 !important;
}

/* Match the deal-flow table's compact metrics (the shared institutional
   td/th sizes are !important, so these must be too). */
.fund-simulation-page .fx-conversion-table th,
.fund-simulation-page .fx-conversion-table td {
  padding: 5px 5px !important;
  font-size: 9px !important;
  line-height: 1.15 !important;
}
.fund-simulation-page .fx-conversion-table tr.deal-flow-exchange td {
  background: rgba(111, 144, 189, 0.07) !important;
  font-weight: 850 !important;
}
.fund-simulation-page .fx-conversion-table .deal-amount {
  white-space: pre !important;
  overflow-wrap: normal !important;
}
.fund-simulation-page .fx-conversion-table tfoot .fx-net-row td {
  border-top: 1px solid #252b38 !important;
  border-bottom: none !important;
  color: var(--text-muted) !important;
  font-size: 8px !important;
  font-weight: 800 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
}
.fund-simulation-page .fx-conversion-table tfoot .fx-net-row td.num {
  font-size: 9.5px !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}
/* Net-impact gain/loss color must outrank the tfoot td color above. */
.fund-simulation-page .fx-conversion-table tfoot td.wam-safe {
  color: #39d895 !important;
}
.fund-simulation-page .fx-conversion-table tfoot td.wam-danger {
  color: var(--err) !important;
}

/* ---- Inline rule gates (fund simulation) ------------------------------------
   Replaces the old ruleBlockPopup modal: blocking rules (MO-pool holidays,
   tenor, min trade, cash 5%, counterparty capacity) paint this box red and
   grey the add button; an HK-only holiday paints it amber and demands the
   two-click orange confirm. Red/amber accents follow --err / --c7 (NOT --gold,
   which is overridden — see project conventions). */
.rule-inline-box {
  margin: 10px 0 2px;
  padding: 10px 12px;
  border: 1px solid rgba(240, 128, 137, 0.45);
  border-left: 3px solid var(--err, #f08089);
  border-radius: 7px;
  background: rgba(240, 128, 137, 0.1);
  font-size: 13px;
  line-height: 1.45;
  color: #e9f3f7;
}
.rule-inline-box strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--err, #f08089);
}
.rule-inline-box ul {
  margin: 0;
  padding-left: 18px;
}
.rule-inline-box li + li {
  margin-top: 3px;
}
.rule-inline-box.is-confirm {
  border-color: rgba(224, 179, 65, 0.45);
  border-left-color: var(--c7, #e0b341);
  background: rgba(224, 179, 65, 0.1);
}
.rule-inline-box.is-confirm strong {
  color: var(--c7, #e0b341);
}

/* Greyed-out add/save buttons while a blocking rule is live. The global
   `button { … !important }` reset (and the peach `.scenario-actions
   button:first-child` skin) must lose here — hence !important and this
   block's trailing position. :hover is repeated because disabled buttons
   still match it. */
.scenario-actions button:disabled,
.scenario-actions button:disabled:hover,
.renewal-foot button:disabled,
.renewal-foot button:disabled:hover {
  background: #1a1f2b !important;
  border-color: #2a3344 !important;
  color: #5b6678 !important;
  cursor: not-allowed !important;
}

/* Armed two-click confirm: the button itself turns orange ("Confirm add …")
   until the second click or any input change disarms it. */
.scenario-actions button.confirm-armed,
.scenario-actions button.confirm-armed:hover,
.renewal-foot button.confirm-armed,
.renewal-foot button.confirm-armed:hover {
  background: var(--c7, #e0b341) !important;
  border-color: var(--c7, #e0b341) !important;
  color: #141821 !important;
  font-weight: 800 !important;
}

/* Inside the renewal/edit dialogs the box sits between the padded body and
   the foot — align it with the body's 20px gutters. */
.renewal-panel .rule-inline-box {
  margin: 0 20px 4px;
}

/* The two main-form CTAs are id-pinned teal pills (`.fund-simulation-page
   #applyScenarioBatch` here + `#applyScenarioBatch` in button-system.css), so
   their disabled/armed skins must be id-pinned too — the class-level rules
   above only reach the renewal/edit dialog buttons. :disabled(:hover) at
   (1,2,0)/(1,3,0) outranks every competing pill selector; transform:none
   kills the hover lift that would otherwise survive on an inert button. */
.fund-simulation-page #applyScenarioBatch:disabled,
.fund-simulation-page #applyScenarioBatch:disabled:hover,
.fund-simulation-page #applyScenarioExchange:disabled,
.fund-simulation-page #applyScenarioExchange:disabled:hover {
  background: #1a1f2b !important;
  border-color: #2a3344 !important;
  color: #5b6678 !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}
.fund-simulation-page #applyScenarioBatch.confirm-armed,
.fund-simulation-page #applyScenarioBatch.confirm-armed:hover,
.fund-simulation-page #applyScenarioExchange.confirm-armed,
.fund-simulation-page #applyScenarioExchange.confirm-armed:hover {
  background: var(--c7, #e0b341) !important;
  border-color: var(--c7, #e0b341) !important;
  color: #141821 !important;
  transform: none !important;
}
/* And keep the dialog buttons from hover-lifting while disabled/armed. */
.scenario-actions button:disabled:hover,
.renewal-foot button:disabled:hover,
.scenario-actions button.confirm-armed:hover,
.renewal-foot button.confirm-armed:hover {
  transform: none !important;
}

/* ── Universal muted scrollbars ──────────────────────────────────────────────
   One slim, muted scrollbar design for every scroll container — the page
   itself, the fixed left rail, table/chart overflow wraps — instead of the
   chunky system default. Thumb alpha is calibrated to keep >=3:1 (WCAG
   1.4.11) against the darkest AND lightest app surfaces (#0d0f15 page …
   #202632 border-soft) — author-styled scrollbars lose the user-agent
   exemption, and the horizontal bar is the only cue a wide register table
   has more columns off-screen. scrollbar-color is inherited from the root;
   the * selector carries scrollbar-width, which is not. Engines that support
   these standard properties (Chrome/Edge >=121, Firefox, Safari >=18.2)
   ignore the entire ::-webkit-scrollbar cascade once they are set — the
   ::-webkit-* rules below only serve older WebKit/Blink. */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(182, 192, 207, 0.55) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(182, 192, 207, 0.55);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(198, 208, 222, 0.8);
}

::-webkit-scrollbar-corner {
  background: transparent;
}

/* ————— Team chat panel (2026-07-30): colleague message stream under the
   Simulation input disclosure. Flat buttons need !important per prop because
   the global button reset (~5985) forces card chrome on every <button>. All
   [hidden] overlays get explicit display:none — their classes set flex. ————— */
.fund-simulation-page .chat-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  background: #151923 !important;
}
.chat-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 12px 12px 9px;
  border-bottom: 1px solid #252a34;
}
.chat-panel-status {
  color: #8f99a8;
  font-size: 10px;
  text-align: right;
}
.chat-panel-status.chat-status-error {
  color: var(--err, #e5697a);
}
.chat-scroll:focus-visible {
  outline-offset: -2px;
}
.chat-scroll {
  max-height: 340px;
  min-height: 150px;
  overflow-y: auto;
  padding: 10px 12px;
  scrollbar-width: thin;
}
.chat-messages {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-day-sep {
  align-self: center;
  padding: 2px 9px;
  border: 1px solid #252a34;
  border-radius: 999px;
  background: rgba(17, 21, 31, 0.85);
  /* #8f99a8, not --text-faint: the token sits ~3.1:1 on this panel, below the
     project's 4.5:1 floor for the chat's smallest text. */
  color: #8f99a8;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.chat-msg {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  align-self: flex-start;
  max-width: 84%;
}
.chat-msg.is-mine {
  align-self: flex-end;
  align-items: flex-end;
}
.chat-msg-meta {
  margin-bottom: 3px;
  color: #8f99a8;
  font-size: 9.5px;
}
.chat-bubble {
  border: 1px solid #252a34;
  border-radius: 10px;
  border-bottom-left-radius: 3px;
  background: #1a2130;
  padding: 7px 10px;
}
.chat-msg.is-mine .chat-bubble {
  border-radius: 10px;
  border-bottom-right-radius: 3px;
  border-color: rgba(86, 185, 193, 0.3);
  background: rgba(86, 185, 193, 0.12);
}
.chat-msg.is-image .chat-bubble {
  padding: 4px;
}
.chat-body {
  margin: 0;
  color: #dfe7f2;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.chat-image-thumb {
  display: block;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 7px !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: zoom-in;
  min-width: 90px;
  min-height: 60px;
}
.chat-image-thumb img {
  display: block;
  max-width: 220px;
  max-height: 170px;
  border-radius: 6px;
}
.chat-image-thumb.is-broken {
  cursor: default;
}
.chat-image-thumb.is-broken span {
  display: block;
  padding: 12px;
  color: #8f99a8;
  font-size: 10px;
}
.chat-empty {
  margin: 6px 2px;
  color: #8f99a8;
  font-size: 11px;
}
.chat-drop-veil {
  position: absolute;
  inset: 6px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed rgba(103, 232, 215, 0.55);
  border-radius: 8px;
  background: rgba(10, 23, 39, 0.85);
  color: #94f1f7;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  pointer-events: none;
}
.chat-drop-veil[hidden] {
  display: none !important;
}
.chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  padding: 9px 10px 10px;
  border-top: 1px solid #252a34;
}
.chat-composer textarea {
  flex: 1 1 auto;
  min-height: 34px;
  max-height: 96px;
  resize: none;
  padding: 8px 10px;
  border: 1px solid #252d3d;
  border-radius: 6px;
  background: #0d1119;
  color: #eef3fb;
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
  overflow-y: auto;
}
.chat-attach {
  flex: 0 0 auto;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0 !important;
  border: 1px solid #252d3d !important;
  border-radius: 6px !important;
  background: #0d1119 !important;
  color: #8f99a8 !important;
  box-shadow: none !important;
  cursor: pointer;
}
.chat-attach:hover {
  border-color: rgba(85, 199, 207, 0.55) !important;
  background: #131a26 !important;
  color: #94f1f7 !important;
}
.chat-attach svg {
  width: 15px;
  height: 15px;
}
#chatSend {
  flex: 0 0 auto;
  padding: 8px 13px !important;
  border: 1px solid rgba(86, 185, 193, 0.4) !important;
  border-radius: 6px !important;
  background: rgba(86, 185, 193, 0.14) !important;
  color: #94f1f7 !important;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: none !important;
  cursor: pointer;
}
#chatSend:hover:not(:disabled) {
  background: rgba(86, 185, 193, 0.24) !important;
  color: #d6fbfd !important;
}
#chatSend:disabled {
  opacity: 0.55;
  cursor: default;
}
/* Read-only day (viewing a past/future business date): the composer stays
   visible but inert — the placeholder explains why. */
.chat-composer.is-readonly textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.chat-attach:disabled {
  opacity: 0.45 !important;
  border-color: #252d3d !important;
  background: #0d1119 !important;
  color: #8f99a8 !important;
  cursor: default !important;
}
.chat-edit-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: min(240px, 60vw);
}
.chat-edit-area {
  resize: vertical;
  padding: 7px 9px;
  border: 1px solid #252d3d;
  border-radius: 6px;
  background: #0d1119;
  color: #eef3fb;
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
}
.chat-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
.chat-edit-actions button {
  padding: 4px 10px !important;
  border-radius: 6px !important;
  font-size: 10.5px;
  box-shadow: none !important;
}
.chat-lightbox {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 13, 0.88);
  cursor: zoom-out;
}
.chat-lightbox[hidden] {
  display: none !important;
}
.chat-lightbox img {
  max-width: min(92vw, 1400px);
  max-height: 92vh;
  border: 1px solid rgba(103, 232, 215, 0.25);
  border-radius: 8px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
}
.chat-context-menu {
  position: fixed;
  z-index: 420;
  display: flex;
  flex-direction: column;
  min-width: 172px;
  padding: 4px;
  border: 1px solid #2a3140;
  border-radius: 8px;
  background: #161b26;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
}
.chat-context-menu[hidden] {
  display: none !important;
}
.chat-context-menu button {
  padding: 7px 10px !important;
  border: 0 !important;
  border-radius: 6px !important;
  background: transparent !important;
  color: #dfe7f2 !important;
  box-shadow: none !important;
  font-size: 11.5px;
  text-align: left !important;
  cursor: pointer;
}
.chat-context-menu button:hover:not(:disabled) {
  background: rgba(86, 185, 193, 0.1) !important;
}
.chat-context-menu button:disabled {
  opacity: 0.45;
  cursor: default;
}
.chat-context-menu button[hidden] {
  display: none !important;
}
.chat-context-menu .chat-menu-danger {
  color: #ff8f9d !important;
}
.chat-context-menu .chat-menu-danger:hover {
  background: rgba(229, 105, 122, 0.12) !important;
}

/* ————— Numeric inputs (2026-07-30): input[type=number] becomes a grouped
   text input (numeric-input.js) — live thousand separators, lockdown to
   digits/./-, copy strips separators. The native white spinner is replaced
   by this floating stepper, shown while a numeric field is focused; it can
   appear inside modals, so it sits above every layer (max page z is 10001).
   Buttons need !important per prop (global button reset ~5985). ————— */
.numeric-input {
  font-variant-numeric: tabular-nums;
  /* Reserved stepper gutter, like the native spinner reserved its space —
     toggling this on focus made the text jump ~18px per focus/blur. */
  padding-right: 24px !important;
}
.numeric-stepper {
  position: fixed;
  z-index: 10500;
  display: flex;
  flex-direction: column;
  width: 17px;
  height: 26px;
  overflow: hidden;
  border: 1px solid #2a3344;
  border-radius: 5px;
  background: #171d2a;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.numeric-stepper[hidden] {
  display: none !important;
}
.numeric-stepper button {
  flex: 1 1 50%;
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #8f99a8 !important;
  box-shadow: none !important;
  cursor: pointer;
}
.numeric-stepper button + button {
  border-top: 1px solid #2a3344 !important;
}
.numeric-stepper button:hover {
  background: rgba(86, 185, 193, 0.16) !important;
  color: #94f1f7 !important;
}
.numeric-stepper button svg {
  display: block;
  width: 9px;
  height: 6px;
}
/* ————— Quick rate sheet (2026-07-31): fund-sim bottom-right FAB opens a
   simplified best-quote-per-tenor reference over a dimmed, blurred backdrop.
   FAB visual props carry !important against the global button reset (~5985). ————— */

.fund-simulation-page .quick-rate-fab {
  position: fixed !important;
  right: 22px;
  bottom: 22px;
  /* Below the week-maturity popup (z 80): that dialog has no focus trap, so
     the FAB must sit under its backdrop rather than stay clickable over it. */
  z-index: 60;
  width: 54px;
  height: 54px;
  display: grid !important;
  place-items: center !important;
  padding: 0 !important;
  border-radius: 999px !important;
  border: 1px solid rgba(103, 232, 215, 0.45) !important;
  background: linear-gradient(145deg, rgba(16, 30, 46, 0.98), rgba(8, 15, 26, 0.98)) !important;
  color: var(--c1, #67e8d7) !important;
  font-size: 21px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
  cursor: pointer;
}

.fund-simulation-page .quick-rate-fab:hover {
  border-color: rgba(103, 232, 215, 0.85) !important;
  background: linear-gradient(145deg, rgba(20, 38, 57, 0.98), rgba(10, 19, 32, 0.98)) !important;
  color: var(--c1, #67e8d7) !important;
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.55),
    0 0 18px rgba(103, 232, 215, 0.22) !important;
}

.fund-simulation-page .quick-rate-fab:focus-visible {
  outline: 2px solid var(--c1, #67e8d7);
  outline-offset: 3px;
  border-radius: 999px;
}

body.quick-rate-open {
  overflow: hidden;
}

.fund-simulation-page .quick-rate-popup[hidden] {
  display: none !important;
}

.fund-simulation-page .quick-rate-popup {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: grid;
  place-items: center;
  padding: 24px;
}

.fund-simulation-page .quick-rate-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 14, 0.76);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.fund-simulation-page .quick-rate-panel {
  position: relative;
  width: min(920px, 96vw);
  max-height: min(88vh, 900px);
  overflow: auto;
  padding: 20px 22px 18px;
  border: 1px solid rgba(103, 232, 215, 0.24);
  border-radius: 16px;
  background:
    radial-gradient(560px 220px at 0% 0%, rgba(86, 185, 193, 0.14), transparent 62%),
    linear-gradient(180deg, #172033, #0f141f);
  color: #eff6ff;
  box-shadow:
    0 26px 80px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(255, 255, 255, 0.055);
}

.fund-simulation-page .quick-rate-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.fund-simulation-page .quick-rate-head h2 {
  margin: 2px 0 4px;
  font-size: 19px;
}

.fund-simulation-page .quick-rate-head p {
  margin: 0;
  font-size: 12px;
  color: #93a4b8;
}

.fund-simulation-page .quick-rate-tables {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

/* Narrow viewport: HKD above MOP instead of side by side. */
@media (max-width: 900px) {
  .fund-simulation-page .quick-rate-tables {
    grid-template-columns: 1fr;
  }
}

.fund-simulation-page .quick-rate-block {
  padding: 12px 14px;
  border: 1px solid var(--border, #2a2f3a);
  border-radius: 12px;
  background: rgba(10, 15, 24, 0.55);
}

.fund-simulation-page .quick-rate-block h3 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c1, #67e8d7);
}

.fund-simulation-page .quick-rate-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.fund-simulation-page .quick-rate-table th,
.fund-simulation-page .quick-rate-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid rgba(42, 47, 58, 0.7);
}

.fund-simulation-page .quick-rate-table tr:last-child th,
.fund-simulation-page .quick-rate-table tr:last-child td {
  border-bottom: 0;
}

.fund-simulation-page .quick-rate-table thead th {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #93a4b8;
}

.fund-simulation-page .quick-rate-table tbody th {
  font-weight: 700;
  color: #cfd9e6;
  white-space: nowrap;
}

.fund-simulation-page .quick-rate-table td.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.fund-simulation-page .quick-rate-rate {
  font-weight: 800;
  color: #eef6fb;
}

/* Week-reference fallback row: the muted cousin of the rate-sheet page's grey
   outline — no quote typed today, showing the bank's latest quote this week.
   The .quick-rate-table hop keeps these ahead of the tbody th color above. */
.fund-simulation-page .quick-rate-table .quick-rate-week th,
.fund-simulation-page .quick-rate-table .quick-rate-week td,
.fund-simulation-page .quick-rate-table .quick-rate-week .quick-rate-rate {
  color: #93a4b8;
  font-weight: 500;
}

.fund-simulation-page .quick-rate-table .quick-rate-empty th,
.fund-simulation-page .quick-rate-table .quick-rate-empty td {
  color: #8794a8;
}

.fund-simulation-page .quick-rate-table td.quick-rate-over {
  color: var(--err, #f06476);
  font-weight: 700;
}

.fund-simulation-page .quick-rate-table td.quick-rate-low {
  color: var(--c7, #e0b341);
  font-weight: 700;
}

.fund-simulation-page .quick-rate-note {
  margin: 6px 0 10px;
  font-size: 13px;
  color: #93a4b8;
}

.fund-simulation-page .quick-rate-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}
/* ═══════════════════════════════════════════════════════════════════════════
   Mobile chrome (mobile-readiness-plan Phase 1) — ≤1019px only.
   Closed: .site-header stays a compact sticky bar (brand + date chip +
   hamburger); every injected rail control is hidden. Open
   (body.mmf-drawer-open): the header becomes a full-screen scrim at z-index
   9500 whose .header-inner is an opaque, scrollable drawer column carrying the
   nav and all rail controls at touch sizes; clicks on the scrim itself close
   it (mobile-chrome.js). ≥1020px: only the two new controls are hidden —
   nothing else changes.
   ══════════════════════════════════════════════════════════════════════════ */

@media (min-width: 1020px) {
  #mmfNavToggle,
  #mmfDrawerClose {
    display: none !important;
  }
}

@media (max-width: 1019px) {
  /* — compact bar (drawer closed) — */
  body:not(.mmf-drawer-open) .site-header .header-inner {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    grid-template-columns: none !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    padding: 8px 0 !important;
  }
  body:not(.mmf-drawer-open) .site-header .site-nav,
  body:not(.mmf-drawer-open) .site-header .dataset-toggle,
  body:not(.mmf-drawer-open) .site-header .sidebar-utility-stack,
  body:not(.mmf-drawer-open) .site-header .sidebar-workbook-upload,
  body:not(.mmf-drawer-open) .site-header .header-meta,
  body:not(.mmf-drawer-open) .site-header .mmf-presence-bar,
  body:not(.mmf-drawer-open) .site-header .mmf-tm-btn {
    display: none !important;
  }
  /* Compact current-date chip: keep the trigger in the bar, drop its label and
     status line (both return inside the drawer). */
  body:not(.mmf-drawer-open) .site-header .mmf-date-panel {
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
    min-width: 0;
  }
  body:not(.mmf-drawer-open) .site-header .mmf-date-label,
  body:not(.mmf-drawer-open) .site-header .mmf-date-msg {
    display: none !important;
  }
  .site-header .mmf-date-trigger {
    min-height: 40px !important;
  }

  /* — hamburger + drawer close (44×44; the global button reset forces its own
       visuals on any <button>, so every visual prop is pinned) — */
  #mmfNavToggle,
  #mmfDrawerClose {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 0 !important;
    flex: 0 0 auto !important;
    border-radius: 10px !important;
    border: 1px solid #2a3344 !important;
    background: rgba(255, 255, 255, 0.04) !important;
    color: var(--text) !important;
    cursor: pointer;
  }
  #mmfDrawerClose {
    display: none !important;
  }
  body.mmf-drawer-open #mmfNavToggle {
    display: none !important;
  }
  body.mmf-drawer-open #mmfDrawerClose {
    display: inline-flex !important;
    position: absolute !important;
    top: 10px;
    right: 10px;
    z-index: 2;
  }

  /* — scroll lock while the drawer is up — */
  html.mmf-drawer-open,
  html.mmf-drawer-open body {
    overflow: hidden !important;
  }

  /* — drawer open — */
  body.mmf-drawer-open .site-header {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9500 !important;
    height: 100vh !important;
    height: 100dvh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    background: rgba(4, 9, 18, 0.62) !important;
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
    border-bottom: 0 !important;
  }
  body.mmf-drawer-open .header-inner {
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 16px !important;
    width: min(400px, 88vw) !important;
    max-width: none !important;
    min-height: 100% !important;
    margin: 0 !important;
    padding: 12px 16px calc(24px + env(safe-area-inset-bottom)) !important;
    background: #11151f !important;
    border-right: 1px solid #252b38 !important;
  }
  body.mmf-drawer-open .brand {
    padding-right: 56px;
  }
  body.mmf-drawer-open .site-nav {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 4px !important;
  }
  body.mmf-drawer-open .site-nav a {
    display: flex !important;
    align-items: center !important;
    min-height: 44px !important;
    padding: 10px 12px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    white-space: normal !important;
  }
  body.mmf-drawer-open .dataset-toggle {
    display: block !important;
  }
  body.mmf-drawer-open .dataset-toggle-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }
  body.mmf-drawer-open .dataset-toggle-option {
    min-height: 44px !important;
  }
  body.mmf-drawer-open .sidebar-utility-stack {
    display: grid !important;
    gap: 12px !important;
  }
  body.mmf-drawer-open .header-meta {
    display: grid !important;
    grid-auto-flow: row !important;
    justify-content: start !important;
    gap: 10px !important;
  }
  body.mmf-drawer-open .mmf-date-panel {
    display: grid !important;
    gap: 6px !important;
  }
  body.mmf-drawer-open .mmf-date-trigger {
    width: 100% !important;
    min-height: 44px !important;
  }
  body.mmf-drawer-open .mmf-presence-bar {
    display: flex !important;
    flex-wrap: wrap;
  }
  body.mmf-drawer-open .mmf-tm-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 44px !important;
    margin: 0 !important;
  }
  body.mmf-drawer-open .sidebar-utility-stack .snapshot-pill,
  body.mmf-drawer-open .sidebar-utility-stack .snapshot-select {
    min-height: 40px !important;
  }

  /* — upload card inside the drawer (§1.3): single column so the status text
       can never starve the drop zone into a sliver that overpaints the
       "Use default data" button — */
  body.mmf-drawer-open .sidebar-workbook-upload {
    display: block !important;
  }
  body.mmf-drawer-open .sidebar-workbook-upload .workbook-upload-card {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  body.mmf-drawer-open .workbook-upload-actions {
    min-width: 0 !important;
    display: grid !important;
    gap: 8px !important;
  }
  body.mmf-drawer-open .workbook-upload-status {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    max-height: none !important;
  }
  body.mmf-drawer-open .workbook-drop-zone {
    min-height: 44px !important;
  }
  body.mmf-drawer-open #workbookReset {
    width: 100% !important;
    min-height: 44px !important;
  }

  /* — Time Machine popover clamp (§1.3): the injected .mmf-tm-pop style sheet
       hard-codes width:380px / right:12px, which lands at x = −13 at 390px.
       The id selector outranks the injected class rule. — */
  #mmfTmPop {
    width: min(380px, calc(100vw - 16px)) !important;
    right: 8px !important;
    left: auto !important;
    max-height: 72vh;
    max-height: 72dvh;
  }
  #mmfTmPop .mmf-tm-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
  }
}
/* ═══════════════════════════════════════════════════════════════════════════
   Mobile cross-cutting fixes (mobile-readiness-plan Phase 2, G-1…G-10).
   Appended: at equal specificity these win on source order; !important only
   where an existing !important (the 12px control blanket at ~9582, the global
   button reset at ~5985, the renewal-popup pinning) must be beaten.
   ══════════════════════════════════════════════════════════════════════════ */

/* — G-1 · 16px control floor at ≤1019px: an input under 16px makes iOS zoom
     the whole page on focus. Beats the 12px !important blanket by order. — */
@media (max-width: 1019px) {
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* — G-2 · KPI value overpaint (dashboard, portfolio, fund-sim): 19px nowrap
     digits painted up to 87px past their tile. Wrap + clamp instead. — */
@media (max-width: 900px) {
  .portfolio-inline-kpis strong {
    font-size: clamp(13px, 4.4vw, 19px) !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    line-height: 1.15 !important;
  }
  .portfolio-inline-kpis article {
    min-height: 0 !important;
    overflow: hidden;
  }
  .portfolio-inline-kpis .cash-breakdown div {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 8px;
  }
  .portfolio-inline-kpis .cash-breakdown div > small {
    grid-column: 1 / -1;
  }
}
@media (max-width: 430px) {
  .portfolio-inline-kpis {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* — G-3 · Limits table (fund-sim): fixed layout + nowrap inside
     overflow:hidden overpaints "Used / Limit" onto Capacity. Scroll it. — */
@media (max-width: 900px) {
  .limit-summary-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  .limit-summary-table {
    table-layout: auto;
    min-width: 430px;
  }
  .limit-summary-table th,
  .limit-summary-table td {
    padding: 6px 8px;
    font-size: 11px;
  }
}

/* — G-4 · Release the shared 1040px register min-width for the two pages
     whose tables don't need it (their own layout items take over). Mobile
     band only: at ≥1020 the release visibly recompresses the desktop
     columns, and desktop must stay unchanged. — */
@media (max-width: 1019px) {
  .top-holdings-page .top-holding-table {
    min-width: 720px;
  }
  .counterparty-list-page .counterparty-table {
    min-width: 0;
  }
}

/* — G-5 · Modal scroll pattern: none of these overlays scrolled, so anything
     past the viewport edge (landscape phones, soft keyboard) was unreachable.
     The overlay scrolls; the dialog centres only when there's room. Backdrop
     children go fixed so scrolling can't reveal unmasked page. — */
.subscription-redemption-page .manual-record-modal {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  align-items: flex-start;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
}
.subscription-redemption-page .manual-record-dialog {
  margin: auto 0;
  max-height: none;
}
.subscription-redemption-page .manual-record-backdrop {
  position: fixed;
}
.top-holding-modal {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  place-items: start center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
}
.top-holding-dialog {
  margin: auto 0;
}
.renewal-popup {
  place-items: start center !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain !important;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)) !important;
}
.renewal-backdrop {
  position: fixed !important;
}
.renewal-panel {
  margin: auto 0 !important;
  overflow: visible !important;
  overflow-y: auto !important;
  max-height: calc(100vh - 32px) !important;
  max-height: calc(100dvh - 32px) !important;
}

/* — G-6 · Quick-rate FAB clearance: the fixed FAB covered the chat Send
     button at end-of-scroll on every width below 1020 — and, once F-1 stacks
     the workspace, up to 1279 as well (chat ends the page there too). — */
@media (max-width: 1279px) {
  .fund-simulation-page .chat-panel {
    margin-bottom: 84px;
  }
}
.fund-simulation-page .quick-rate-fab {
  bottom: calc(22px + env(safe-area-inset-bottom));
}

/* — G-7 · Rollover banner: fixed, undismissable, grew to 41% of a phone
     screen. Cap it, let rows wrap, add the session dismiss (data-store.js). — */
.mmf-rollover-banner {
  /* left:50% + translate makes shrink-to-fit resolve against the RIGHT half
     of the viewport (≈180px on a phone) once the label is allowed to wrap —
     anchor both edges and centre with auto margins instead. */
  left: 12px;
  right: 12px;
  transform: none;
  width: fit-content;
  margin-inline: auto;
  max-width: min(480px, calc(100vw - 24px));
  flex-wrap: wrap;
  row-gap: 8px;
  bottom: calc(18px + env(safe-area-inset-bottom));
}
@media (max-width: 520px) {
  .mmf-rollover-banner {
    font-size: 0.8rem;
    padding: 10px 12px;
    gap: 8px;
  }
}
button.mmf-rollover-dismiss {
  width: 40px !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 8px !important;
  font-size: 20px !important;
  line-height: 1 !important;
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: #f2f5fb !important;
  cursor: pointer !important;
}

/* — G-8 · Numeric input on touch: the stepper never mounts on a coarse
     pointer (numeric-input.js); this is the belt-and-braces for a stray
     mount. The +/− sign toggle only exists on coarse pointers. — */
@media (pointer: coarse) {
  .numeric-stepper {
    display: none !important;
  }
}
button.numeric-sign-toggle {
  min-width: 44px !important;
  min-height: 40px !important;
  padding: 6px 10px !important;
  margin-top: 6px;
  align-self: flex-start;
  border-radius: 8px !important;
  font-size: 15px !important;
  line-height: 1 !important;
}

/* — G-10 · Two-tap destructive confirm (armed state): --c7 amber family,
     !important against the global button reset. — */
button.two-tap-armed {
  background: rgba(232, 196, 104, 0.16) !important;
  border-color: var(--c7, #e8c468) !important;
  color: var(--c7, #e8c468) !important;
}
/* ═══════════════════════════════════════════════════════════════════════════
   Fund-simulation page items (mobile-readiness-plan Phase 3, F-1…F-10).
   ══════════════════════════════════════════════════════════════════════════ */

/* — F-1 · Workspace collapse: with 984px of minimum track the two panes only
     fit once ~1250px of viewport remains beside the desktop rail; below that
     the right pane was clipped (345px unreachable at 1024). Scoped away from
     portfolio (same workspace markup, its own phase handles it): appended
     last so it outranks the earlier desktop !important pane guards. — */
@media (max-width: 1279px) {
  body.fund-simulation-page:not(.portfolio-page) .fund-sim-workspace {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto !important;
  }
  body.fund-simulation-page:not(.portfolio-page) .fund-sim-left-pane {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px;
    grid-column: 1 !important;
    grid-row: 1 !important;
    min-width: 0 !important;
    width: 100% !important;
  }
  body.fund-simulation-page:not(.portfolio-page) .fund-sim-right-pane {
    grid-column: 1 !important;
    grid-row: 2 !important;
    min-width: 0 !important;
    width: 100% !important;
  }
}

/* — F-2 · Quick-rate blocks scroll sideways so the Limit column stays
     reachable down to 320px (markup wrap added in renderQuickRateSheet). — */
.quick-rate-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
}
.quick-rate-scroll .quick-rate-table {
  min-width: 300px;
}

/* — F-4 · CTA pills: the shared pill rule pins min-height:0/font-size:10px
     with !important, leaving every primary action 27.5px tall. Geometry only
     — the id-pinned state colors are untouched (ground rule 5). — */
@media (pointer: coarse) {
  /* body-qualified: the page-scoped pill pins (e.g.
     .fund-simulation-page .renewal-foot button at ~1039, the
     .portfolio-scenario-box row-action pin in fund-simulation-layout.css)
     carry higher specificity than the bare class list — every selector here
     must outrank its !important counterpart, not just come later. */
  body .cash-flow-lock-button,
  body.fund-simulation-page #applyScenarioBatch,
  body .calendar-link-button,
  body .week-view-button,
  body .renew-maturity-button,
  body.fund-simulation-page .portfolio-scenario-box .renew-maturity-button,
  body.rate-sheet-page .rate-sheet-actions button,
  body.rate-sheet-page #resetRateSheet,
  body .rate-sheet-actions button,
  body .scenario-actions button,
  body .scenario-slot-actions button,
  body .rule-block-foot button,
  body.fund-simulation-page .renewal-foot button,
  body.fund-simulation-page .saved-scenario-form button,
  body.fund-simulation-page .scenario-analysis-head button,
  body.fund-simulation-page .saved-scenario-delete,
  body.fund-simulation-page .table-sort-button,
  body.portfolio-page .portfolio-clear-button,
  body .renewal-foot button,
  body .saved-scenario-form button,
  body .scenario-analysis-head button,
  body .saved-scenario-delete,
  body .table-sort-button,
  body .portfolio-clear-button,
  body .button-row button,
  body .ghost-button {
    min-height: 44px !important;
    font-size: 11px !important;
    padding: 10px 14px !important;
  }
}

/* — F-5 · Saved-scenario slots: the pinned 3-col grid crushed Save/Clear to
     26px wide at 390 — full-width cards on phones. — */
@media (max-width: 520px) {
  .scenario-slot-buttons {
    grid-template-columns: 1fr !important;
  }
}

/* — F-6 · Edit-deal selects were unstyled 19px UA controls — match the
     .renewal-body input treatment. — */
.renewal-body select {
  appearance: none !important;
  -webkit-appearance: none !important;
  border: 1px solid rgba(86, 185, 193, 0.38) !important;
  border-radius: 9px !important;
  background: rgba(5, 11, 20, 0.58) !important;
  color: #e8fbff !important;
  /* 16px, not the inputs' 15px: this higher-specificity rule would otherwise
     outrank the G-1 ≤1019 floor and re-shrink the control on phones. */
  font-size: 16px !important;
  font-weight: 900 !important;
  padding: 10px 11px !important;
  outline: none !important;
}
.renewal-body select:focus {
  border-color: rgba(117, 232, 239, 0.9) !important;
  box-shadow: 0 0 0 3px rgba(86, 185, 193, 0.18) !important;
}

/* — F-8 · WLA week rows: 26px targets 4px apart. — */
@media (pointer: coarse) {
  .fund-simulation-page button.wla-week {
    min-height: 40px !important;
  }
  .wla-weeks {
    gap: 6px;
  }
}

/* — F-9 · Chat mobile pack: per-message kebab (hover-revealed on fine
     pointers, always on for touch), 44px attach/Send, legible timestamps,
     dvh-capped lightbox. — */
button.chat-kebab {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 28px !important;
  min-height: 24px !important;
  padding: 0 6px !important;
  margin-left: 6px;
  border: 1px solid transparent !important;
  border-radius: 6px !important;
  background: transparent !important;
  color: var(--text-muted) !important;
  font-size: 15px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  opacity: 0;
  transition: opacity 120ms ease;
}
.chat-msg:hover .chat-kebab,
.chat-msg:focus-within .chat-kebab,
button.chat-kebab:focus-visible {
  opacity: 1;
}
button.chat-kebab:hover {
  border-color: rgba(103, 232, 215, 0.35) !important;
  color: var(--ice) !important;
}
@media (pointer: coarse) {
  button.chat-kebab {
    opacity: 1;
    min-width: 40px !important;
    min-height: 40px !important;
  }
  .chat-attach {
    width: 44px !important;
    height: 44px !important;
  }
  #chatSend {
    min-width: 44px !important;
    min-height: 44px !important;
  }
  .chat-msg-meta {
    font-size: 11px !important;
  }
  .chat-day-pill {
    font-size: 11px !important;
  }
}
.chat-lightbox img {
  max-height: 92vh;
  max-height: 92dvh;
}

/* — F-10 · The shared-scenario status pill overlapped its own caption at
     390: let the collapsed-header digest wrap onto its own rows. — */
@media (max-width: 520px) {
  .scenario-working-toggle {
    flex-wrap: wrap !important;
  }
  .scenario-working-digest {
    flex: 1 1 100% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
    min-width: 0 !important;
  }
  .scenario-working-digest em,
  .scenario-working-digest b {
    white-space: normal !important;
    overflow-wrap: anywhere;
  }
}

/* F-2 addendum: the ≤900 stack used a bare 1fr track, whose automatic minimum
   is the table's max-content (≈330px) — the whole block escaped the panel at
   320 and .quick-rate-scroll never engaged. minmax(0,1fr) lets the block
   shrink so the table overflows INSIDE its scroller. */
@media (max-width: 900px) {
  .fund-simulation-page .quick-rate-tables {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* F-1 band: between the stacked layout (≤1279) and the untouched ≥1400
   desktop, the original 650+500+14px minimums exceeded the space beside the
   rail — 540+430+14 = 984px keeps both panes fully on-screen there. */
@media (min-width: 1280px) and (max-width: 1399px) {
  body.fund-simulation-page:not(.portfolio-page) .fund-sim-workspace {
    grid-template-columns: minmax(540px, 0.98fr) minmax(430px, 1.02fr) !important;
  }
}

/* Phase 3 addenda for the F-1 stacked band and two uncovered toggles. */
@media (pointer: coarse) {
  body.fund-simulation-page .wla-view-toggle button {
    min-height: 40px !important;
    padding: 8px 14px !important;
  }
  body.fund-simulation-page #limitSummaryToggle,
  body.fund-simulation-page .scenario-working-toggle {
    min-height: 44px !important;
  }
}

/* In the 901–1279 stacked band the KPI strip spreads over 5-6 narrow tracks
   and the 19px nowrap digits ink past their tiles again — same treatment the
   ≤900 G-2 block applies. */
@media (min-width: 901px) and (max-width: 1279px) {
  body.fund-simulation-page:not(.portfolio-page) .portfolio-inline-kpis strong {
    font-size: clamp(13px, 1.6vw, 19px) !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    line-height: 1.15 !important;
  }
  body.fund-simulation-page:not(.portfolio-page) .portfolio-inline-kpis article {
    min-height: 0 !important;
    overflow: hidden;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Phase 4 · dashboard.html (D-1…D-7). body-qualified: the chart chrome pins
   everything with page-scoped !important rules.
   ══════════════════════════════════════════════════════════════════════════ */

/* — D-1 · Upcoming-maturities table had no scroller inside an
     overflow:hidden card — Principal/MOP Eq. were simply unreachable. — */
@media (max-width: 900px) {
  body.dashboard-page .dashboard-upcoming-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  body.dashboard-page .dashboard-upcoming-table-wrap table {
    min-width: 460px;
  }
  body.dashboard-page .dashboard-upcoming-table-wrap th,
  body.dashboard-page .dashboard-upcoming-table-wrap td {
    padding: 10px !important;
    font-size: 12px !important;
  }
}

@media (max-width: 760px) {
  /* — D-2 · charts single-column; cards stop clipping their content — */
  body.dashboard-page .portfolio-chart-panel {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
  }
  body.dashboard-page .portfolio-chart-card {
    min-height: 0 !important;
  }
  /* — D-3 · liquidity rows: 78+72+34px of fixed tracks left the 1fr bar
       track resolving to 0px on every row — */
  body.dashboard-page .portfolio-tenor-item {
    grid-template-columns: 62px minmax(40px, 1fr) 68px 30px !important;
    gap: 6px !important;
  }
  body.dashboard-page .portfolio-tenor-item .portfolio-bar-track {
    min-width: 40px !important;
  }
  /* — D-4 · bank-pie legend stacked under the donut instead of over it;
       the MOP amount cedes its track to keep name + share legible — */
  body.dashboard-page .portfolio-bank-pie-layout {
    grid-template-columns: minmax(0, 1fr) !important;
    justify-items: center !important;
  }
  body.dashboard-page .portfolio-bank-pie-layout .portfolio-pie-wrap {
    margin: 0 auto !important;
  }
  body.dashboard-page .portfolio-pie-legend {
    width: 100% !important;
  }
  body.dashboard-page .portfolio-pie-legend-row {
    grid-template-columns: 12px minmax(0, 1fr) 46px !important;
  }
  body.dashboard-page .portfolio-pie-legend-row em {
    display: none !important;
  }
  /* — D-5 · maturity ladder scrolls sideways instead of dropping 7/16 bars — */
  body.dashboard-page .portfolio-maturity-ladder-chart {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  body.dashboard-page .portfolio-ladder-grid {
    overflow: visible !important;
    padding-bottom: 26px !important;
  }
  body.dashboard-page .portfolio-ladder-bar {
    flex: 0 0 22px !important;
    min-width: 22px !important;
  }
  /* — D-6 · donuts scale to the card instead of clipping at 168px — */
  body.dashboard-page .portfolio-pie-wrap,
  body.dashboard-page .portfolio-currency-pie-wrap {
    width: min(168px, 100%) !important;
    aspect-ratio: 1 / 1 !important;
    height: auto !important;
  }
  body.dashboard-page .portfolio-pie-center {
    inset: 33% !important;
  }
  /* — D-7 · 9-10px chart typography lifts to 12px — */
  body.dashboard-page .portfolio-tenor-item span,
  body.dashboard-page .portfolio-tenor-item strong,
  body.dashboard-page .portfolio-tenor-item em,
  body.dashboard-page .portfolio-pie-legend-row span,
  body.dashboard-page .portfolio-pie-legend-row strong,
  body.dashboard-page .portfolio-ladder-bar em {
    font-size: 12px !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Phase 4 · portfolio.html (P-1…P-5). body-qualified against the page's
   !important pins; top-holdings/counterparty share the portfolio-page class
   but none of these structures.
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  /* — P-1 · stacked order put 3,604px of register above the summary and
       capacity panes — summary first. Portfolio only: fund-sim keeps its
       left pane on top. — */
  body.portfolio-page .fund-sim-right-pane {
    grid-row: 1 !important;
  }
  body.portfolio-page .fund-sim-left-pane {
    grid-row: 2 !important;
  }
  /* — P-2 · 1280px register at phone widths: denser cells, saner minimum,
       and a sticky bank column so panned rows stay identifiable. — */
  body.portfolio-page .fund-excel-table {
    min-width: 820px !important;
  }
  body.portfolio-page .fund-excel-table th,
  body.portfolio-page .fund-excel-table td {
    padding: 6px 7px !important;
    font-size: 11px !important;
  }
  body.portfolio-page .fund-excel-table th:first-child,
  body.portfolio-page .fund-excel-table td:first-child {
    position: sticky !important;
    left: 0;
    z-index: 2;
    background: #0f1522 !important;
  }
  body.portfolio-page .fund-excel-table thead th:first-child {
    z-index: 3;
  }
  /* — P-3 · 78 rows deserve sticky headers: give the wrap a scrollport. — */
  body.portfolio-page .register-table-wrap {
    max-height: 62vh !important;
    max-height: 62dvh !important;
    overflow: auto !important;
  }
  body.portfolio-page .fund-excel-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
  }
  /* — P-5 · 24px filter chips / 32px sort buttons. — */
  body.portfolio-page .portfolio-filter-chip {
    min-height: 40px !important;
    padding: 10px 14px !important;
  }
}
@media (max-width: 760px) {
  /* — P-4 · the card head pushed "Clear data" off-screen. — */
  body.portfolio-page .card-head,
  body.portfolio-page .portfolio-head-stats {
    flex-wrap: wrap !important;
  }
  body.portfolio-page .portfolio-head-stats > * {
    flex: 1 1 150px !important;
    min-width: 0 !important;
  }
  body.portfolio-page .portfolio-only-card {
    overflow-x: clip;
  }
}
/* Portfolio KPI strip at tablet/desktop-window widths (901–1439): same
   overpaint treatment the ≤900 G-2 block applies — 19px nowrap digits ink
   past their tiles beside the rail. 1440+ untouched. */
@media (min-width: 901px) and (max-width: 1439px) {
  body.portfolio-page .portfolio-inline-kpis strong {
    font-size: clamp(13px, 1.4vw, 19px) !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    line-height: 1.15 !important;
  }
  body.portfolio-page .portfolio-inline-kpis article {
    min-height: 0 !important;
    overflow: hidden;
  }
  /* The cash rows park the value in an auto (max-content) track, so the wrap
     treatment above never engages — same restructure as the ≤900 G-2 block. */
  body.portfolio-page .portfolio-inline-kpis .cash-breakdown div {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 8px;
  }
  body.portfolio-page .portfolio-inline-kpis .cash-breakdown div > small {
    grid-column: 1 / -1;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Phase 4 · subscription-redemption.html (S-1…S-8). nav.html shares the
   sub-red table chrome, so structural table changes are scoped off .nav-page
   (N-1/N-2 bring nav its own table treatment).
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  /* — S-1 · table-layout:fixed + width:100% crushed 9 columns into the
       viewport and left the wrap's scroller with nothing to do. — */
  body.subscription-redemption-page:not(.nav-page) .sub-red-table {
    table-layout: auto !important;
    width: auto !important;
    min-width: 780px !important;
  }
  body.subscription-redemption-page:not(.nav-page) .sub-red-table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  /* — S-2 · the action column gets real width and ≥40px pills. — */
  body.subscription-redemption-page:not(.nav-page) .sub-red-table th:last-child {
    width: 132px;
  }
  body.subscription-redemption-page .sub-red-row-action-button {
    min-height: 40px !important;
    padding: 8px 12px !important;
  }
}
@media (max-width: 760px) {
  /* — S-6 · the table head clipped the Input CTA and the source label. — */
  body.subscription-redemption-page .sub-red-table-head {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  body.subscription-redemption-page .sub-red-table-head .manual-record-status {
    flex: 1 1 100% !important;
    max-width: none !important;
  }
  body.subscription-redemption-page .manual-record-open-button,
  body.subscription-redemption-page #openSubRedManualModal,
  body.nav-page #openNavManualModal {
    min-height: 44px !important;
    padding: 10px 16px !important;
  }
  /* — S-7 · flow-summary totals are toggle buttons that read as text. — */
  body.subscription-redemption-page .sub-red-flow-toggle {
    min-height: 44px !important;
    position: relative;
  }
  body.subscription-redemption-page .sub-red-flow-toggle::after {
    content: "▾";
    margin-left: 6px;
    color: var(--c1, #67e8d7);
    font-size: 12px;
  }
}
@media (max-width: 700px) {
  /* — S-4 · let the chart follow its (narrow) viewBox instead of squeezing
       a 1180-unit drawing into a hard 306px box. — */
  body.subscription-redemption-page .sub-red-chart-large svg,
  body.subscription-redemption-page .sub-red-unified-chart-card .sub-red-chart-large svg {
    height: auto !important;
  }
  /* — S-8 · the series toggle row spilled 36px past the card at 360. — */
  body.subscription-redemption-page .sub-red-chart-toggle {
    flex-wrap: wrap !important;
    max-width: 100% !important;
  }
  .sub-red-chart-hit-band {
    fill: transparent;
    stroke: none;
  }
}

/* S-2/S-7/S-8 sizing belongs to the pointer, not the width: 768 tablets sit
   outside the ≤760 blocks above. */
@media (pointer: coarse) {
  body.subscription-redemption-page .sub-red-flow-toggle {
    min-height: 44px !important;
  }
  body.subscription-redemption-page #openSubRedManualModal,
  body.nav-page #openNavManualModal {
    min-height: 44px !important;
    padding: 10px 16px !important;
  }
  body.subscription-redemption-page .sub-red-chart-toggle button,
  body.subscription-redemption-page [data-sub-red-chart],
  body.subscription-redemption-page [data-sub-red-range] {
    min-height: 40px !important;
  }
}

/* S-1 at tablet-landscape/desktop-window widths (901–1439): the fixed-layout
   table crushed 9 columns and left row actions unreachable at 1024 too.
   1440+ keeps the designed evenly-divided table. */
@media (min-width: 901px) and (max-width: 1439px) {
  body.subscription-redemption-page:not(.nav-page) .sub-red-table {
    table-layout: auto !important;
    width: auto !important;
    min-width: 780px !important;
  }
  body.subscription-redemption-page:not(.nav-page) .sub-red-table-wrap {
    overflow-x: auto !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Phase 4 · nav.html (N-1…N-6; N-7 rides the shared S-6 head fix).
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 720px) {
  /* — N-1 · records table was ellipsized under a page-local
       overflow-x:hidden. — */
  body.nav-page .nav-table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  body.nav-page .nav-table-wrap .sub-red-table {
    table-layout: auto !important;
    width: auto !important;
    min-width: 430px !important;
  }
  body.nav-page .nav-table-wrap .sub-red-table th:first-child {
    width: 108px;
  }
  body.nav-page .nav-table-wrap .sub-red-table th:nth-child(2),
  body.nav-page .nav-table-wrap .sub-red-table th:nth-child(3) {
    width: 92px;
  }
  /* — N-2 · annualized-return table: same dead-scroller pattern. — */
  body.nav-page .nav-return-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  body.nav-page .nav-return-table {
    table-layout: auto !important;
    width: auto !important;
    min-width: 520px !important;
  }
  /* — N-4 · three summary cards collided; 2-up measured insufficient. — */
  body.nav-page .nav-overview {
    grid-template-columns: 1fr !important;
  }
  body.nav-page .nav-overview > * {
    min-width: 0 !important;
  }
  /* — N-5 · custom return-period inputs stack full-width. — */
  body.nav-page .nav-custom-return-inputs {
    grid-template-columns: 1fr !important;
  }
  body.nav-page .nav-custom-return-inputs input {
    min-height: 40px !important;
  }
}
/* — N-6 · 25-33px row actions, Edit 13px from destructive Del. — */
@media (pointer: coarse) {
  body.nav-page .nav-row-action-button {
    min-height: 40px !important;
    padding: 8px 12px !important;
    margin-left: 8px !important;
  }
  body.nav-page .nav-custom-return-inputs input {
    min-height: 40px !important;
  }
  .manual-record-submit,
  .manual-record-cancel,
  .manual-record-close {
    min-height: 44px !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Phase 4 · top-holdings.html (T-1, T-4, T-5) + counterparty-list.html
   (C-1, C-2, C-3, C-5, C-6). T-2/T-3/C-4 ride G-5/G-10 and the coarse pill
   sizing from earlier phases.
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  /* — T-1 · stacked cards: the 6-column table kept Notes/Delete off-screen
       even after the G-4 min-width release. td::before renders the column
       name from data-label (emitted by the row renderer). — */
  body.top-holdings-page .top-holding-table {
    display: block !important;
    min-width: 0 !important;
    width: 100% !important;
  }
  body.top-holdings-page .top-holding-table thead {
    display: none !important;
  }
  body.top-holdings-page .top-holding-table tbody {
    display: block !important;
  }
  body.top-holdings-page .top-holding-table tbody tr {
    display: block !important;
    margin: 0 0 10px !important;
    padding: 10px 12px !important;
    border: 1px solid rgba(103, 232, 215, 0.18) !important;
    border-radius: 12px !important;
    background: rgba(15, 21, 34, 0.82) !important;
  }
  body.top-holdings-page .top-holding-table td[data-label] {
    display: grid !important;
    grid-template-columns: 96px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 5px 0 !important;
    border-bottom: 0 !important;
    text-align: left !important;
  }
  body.top-holdings-page .top-holding-table td[data-label]::before {
    content: attr(data-label);
    color: rgba(232, 237, 245, 0.55);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  body.top-holdings-page .top-holding-table td[data-label="Notes"] .top-holding-input {
    width: 100% !important;
  }
  body.top-holdings-page .top-holding-table td[data-label="Action"] {
    display: block !important;
  }
  body.top-holdings-page .top-holding-table td[data-label="Action"]::before {
    content: none;
  }
  body.top-holdings-page .top-holding-table td[data-label="Action"] .top-holding-delete {
    width: 100% !important;
  }
  body.top-holdings-page .top-holding-table td:not([data-label]) {
    display: block !important;
  }
  /* — T-4 · dialog actions: full-width, primary on top. — */
  .top-holding-dialog-actions {
    display: flex !important;
    flex-direction: column-reverse !important;
    gap: 10px !important;
  }
  .top-holding-dialog-actions button {
    width: 100% !important;
    min-height: 44px !important;
  }
  /* — C-6 · KPI strip: three digits burned 331px of viewport. — */
  .top-holding-kpis {
    gap: 8px !important;
  }
  .top-holding-kpis article {
    padding: 10px 8px !important;
  }
}
@media (max-width: 700px) {
  /* — T-5 / C-5 · card heads clipped their CTAs. — */
  .compact-card-head {
    flex-wrap: wrap !important;
    gap: 10px !important;
  }
  body.top-holdings-page #addHoldingRow,
  body.counterparty-list-page [data-testid="button-add-counterparty"] {
    width: 100% !important;
    min-height: 44px !important;
  }
}
@media (max-width: 760px) {
  /* — C-1 · panning the registry keeps rows identifiable: sticky name col. — */
  body.counterparty-list-page .counterparty-table th:first-child,
  body.counterparty-list-page .counterparty-table td:first-child {
    position: sticky !important;
    left: 0;
    z-index: 2;
    background: #0f1522 !important;
  }
  /* The G-4 min-width release alone crushes the name inputs to ~22px — the
     table keeps a usable minimum and pans behind the sticky name column. */
  body.counterparty-list-page .counterparty-table {
    min-width: 640px !important;
  }
  body.counterparty-list-page .top-holding-table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  body.counterparty-list-page .counterparty-table .top-holding-input {
    min-width: 120px !important;
  }
}
@media (max-width: 900px) {
  /* — C-2 · the Save/Revert bar sat ~925px below the fold after an edit. — */
  body.counterparty-list-page .counterparty-save-bar {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 40 !important;
    margin: 0 !important;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom)) !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
    background: #0e1420 !important;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.4);
  }
  body.counterparty-list-page main {
    padding-bottom: 132px !important;
  }
  /* — C-3 · Save 38×27px, 10px from destructive Revert. — */
  body.counterparty-list-page #saveCounterparties,
  body.counterparty-list-page #revertCounterparties {
    min-height: 44px !important;
    flex: 1 1 140px !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Phase 4 · maturity-calendar.html (M-1…M-6).
   ══════════════════════════════════════════════════════════════════════════ */
/* — M-1 · months are <details>; the head is the summary (chevron flips),
     and a scrollable chip bar jumps between anchored months. — */
body.calendar-page summary.month-section-head {
  cursor: pointer;
  list-style: none;
}
body.calendar-page summary.month-section-head::-webkit-details-marker {
  display: none;
}
body.calendar-page .month-section-caret {
  color: var(--c1, #67e8d7);
  font-size: 14px;
  transition: transform 150ms ease;
}
body.calendar-page .month-section[open] > summary .month-section-caret {
  transform: rotate(180deg);
}
@media (prefers-reduced-motion: reduce) {
  body.calendar-page .month-section-caret {
    transition: none;
  }
}
body.calendar-page .month-jump-bar {
  /* Static below 1020: a sticky bar would spend the ≤72px pinned-chrome
     budget (audit check B). The desktop rail viewport can afford sticky. */
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  padding: 8px 2px;
  margin-bottom: 4px;
  background: rgba(10, 16, 27, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 10px;
}
body.calendar-page .month-jump-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid rgba(103, 232, 215, 0.28);
  border-radius: 999px;
  color: var(--ice, #dff9fb);
  background: rgba(103, 232, 215, 0.08);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  scroll-snap-align: start;
  white-space: nowrap;
}
body.calendar-page .month-section {
  scroll-margin-top: 130px;
}
body.calendar-page .calendar-empty-days {
  padding: 10px 12px;
  color: rgba(232, 237, 245, 0.55);
  font-size: 12px;
}
@media (min-width: 1020px) {
  body.calendar-page .month-jump-bar {
    position: sticky;
    top: 8px;
    z-index: 5;
  }
}
/* — M-2 · 768 tablets scrolled 2.3× more than a 901px window: tiered
     columns between the phone stack and the 6-col desktop. — */
@media (min-width: 560px) and (max-width: 900px) {
  body.calendar-page .week-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  body.calendar-page .calendar-empty-days {
    grid-column: 1 / -1;
  }
}
@media (min-width: 720px) and (max-width: 900px) {
  body.calendar-page .week-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
/* — M-3 · the holiday NAME was hover-only (title attr) — visible ≤900. — */
body.calendar-page .holiday-label-name {
  display: none;
}
@media (max-width: 900px) {
  body.calendar-page .holiday-label-name {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0.01em;
  }
  /* — M-4 · 9-10px pill typography lifts. — */
  body.calendar-page .deposit-meta,
  body.calendar-page .deposit-aum-pct,
  body.calendar-page .deposit-bank {
    font-size: 11px !important;
  }
  body.calendar-page .deposit-maturity-date,
  body.calendar-page .deposit-amount {
    font-size: 12px !important;
  }
}
/* — M-6 · four nested padding layers ate 26% of a 390px viewport. — */
@media (max-width: 620px) {
  body.calendar-page .month-section {
    padding: 10px;
  }
  body.calendar-page .month-section-head {
    padding: 12px;
  }
  body.calendar-page .week-card {
    padding: 8px;
  }
  body.calendar-page .calendar-day {
    padding: 8px;
  }
  body.calendar-page .week-grid {
    gap: 8px;
  }
}

/* ————— Chat alert toast + unread pill (chat-alerts plan §5.1/§5.2) —————
   alerts.js renders ONE coalesced toast, top-right, never auto-dismissed
   (rollover-banner precedent, top-right variant). Button visual props need
   per-prop !important against the global button reset. */
.mmf-alert-toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(92vw, 420px);
  padding: 12px 16px;
  border-radius: 10px;
  background: #1c2437;
  border: 1px solid rgba(86, 185, 193, 0.55);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  color: #f2f5fb;
  font-size: 0.92rem;
}
.mmf-alert-toast-text {
  min-width: 0;
}
button.mmf-alert-toast-open {
  background: rgba(86, 185, 193, 0.14) !important;
  color: #94f1f7 !important;
  border: 1px solid rgba(86, 185, 193, 0.4) !important;
  border-radius: 8px !important;
  padding: 7px 12px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  cursor: pointer !important;
}
button.mmf-alert-toast-open:hover {
  background: rgba(86, 185, 193, 0.24) !important;
  color: #d6fbfd !important;
}
button.mmf-alert-toast-dismiss {
  background: transparent !important;
  border: none !important;
  color: #8f99a8 !important;
  font-size: 16px !important;
  line-height: 1 !important;
  padding: 4px 6px !important;
  cursor: pointer !important;
}
button.mmf-alert-toast-dismiss:hover {
  color: #ffffff !important;
  background: transparent !important;
}
.chat-unread-pill {
  display: inline-block;
  min-width: 18px;
  padding: 1px 6px;
  margin-left: 6px;
  border-radius: 999px;
  background: rgba(86, 185, 193, 0.18);
  border: 1px solid rgba(86, 185, 193, 0.4);
  color: #94f1f7;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  vertical-align: middle;
}

/* ————— Chat bell dropdown (chat-alerts plan §5.2.4) —————
   Right end of the chat panel head: status + bell live in .chat-head-tools
   so the head's space-between geometry stays stable. The dropdown anchors to
   the tools wrapper. Button props need per-prop !important (global reset). */
.chat-panel-head {
  position: relative;
}
.chat-head-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
button.chat-bell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0 !important;
  border: 1px solid #252d3d !important;
  border-radius: 6px !important;
  background: #0d1119 !important;
  color: #8f99a8 !important;
  cursor: pointer !important;
  flex: 0 0 auto;
}
button.chat-bell svg {
  width: 14px;
  height: 14px;
}
button.chat-bell:hover,
button.chat-bell[aria-expanded="true"] {
  border-color: rgba(86, 185, 193, 0.55) !important;
  color: #94f1f7 !important;
  background: #131926 !important;
}
.chat-bell-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 8px;
  z-index: 420;
  min-width: 220px;
  padding: 8px;
  border: 1px solid #2a3140;
  border-radius: 8px;
  background: #161b26;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
}
.chat-bell-menu[hidden] {
  display: none !important;
}
.chat-bell-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 8px;
  border-radius: 6px;
  color: #dfe7f2;
  font-size: 11.5px;
  cursor: pointer;
}
.chat-bell-row:hover {
  background: rgba(86, 185, 193, 0.08);
}
.chat-bell-row:has(input:disabled) {
  opacity: 0.45;
  cursor: default;
}
.chat-bell-row input[type="checkbox"] {
  accent-color: #56b9c1;
  width: 14px;
  height: 14px;
  margin: 0;
  flex: 0 0 auto;
}
.chat-bell-hint {
  margin: 2px 0 4px;
  padding: 0 8px;
  color: #8f99a8;
  font-size: 10.5px;
}

/* ————— Chat alert follow-ups (UI review of the chat-alerts commits) —————
   1. The pill sets display, which beats the UA [hidden] rule — without this
      an explicit `0` badge ships permanently next to "Team chat".
   2. Placement at ≤1019px: the toast is fixed top-right, but the compact
      mobile header (sticky, ~61px, hamburger at its right edge) lives
      exactly there — the never-auto-dismissed toast would sit on top of the
      hamburger, the date chip and, with the drawer up, its close button.
      Below the bar, full width, and BELOW the drawer's 9500 so the drawer
      always wins.
   3. Touch sizes on coarse pointers, matching the mobile pass's chat pack
      (kebab 40 / attach 44 / send 44): the 24px bell reopened a check-F
      failure on the one page that pack had certified. */
.chat-unread-pill[hidden] {
  display: none !important;
}
.mmf-alert-toast {
  z-index: 9000;
}
@media (max-width: 1019px) {
  .mmf-alert-toast {
    top: 73px;
    right: 12px;
    left: 12px;
    max-width: none;
  }
}
@media (pointer: coarse) {
  button.chat-bell {
    width: 40px !important;
    height: 40px !important;
  }
  button.mmf-alert-toast-dismiss {
    min-width: 40px !important;
    min-height: 40px !important;
  }
  .chat-bell-row {
    min-height: 40px;
  }
}

/* NAV table: weekend rows are real published NAVs (2026-08-06 restate) —
   styling derives from the date, since the wire no longer flags frozen rows. */
.nav-weekend-row td {
  color: var(--text-muted);
}
.nav-weekend-tag {
  margin-left: 8px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
