/* Detailed Dashboard presentation. Layout follows available width, not devices.
   Existing controls, state classes and data handlers are preserved. */
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card {
  --dashboard-line: color-mix(in srgb, var(--text) 11%, transparent);
  --dashboard-muted: color-mix(in srgb, var(--text) 65%, var(--bg));
  --dashboard-hit: 34px;
  --dashboard-row-height: 42px;
  container: dashboard / inline-size;
  display: block; min-width: 0; padding: 10px 8px 8px;
  background: var(--bg); gap: 0;
}
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .summary-top { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 6px 16px; min-height: 0; height: auto; padding: 8px 0 10px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .summary-title-stack { align-self: flex-start; align-items: flex-start; justify-self: start; min-width: 0; width: auto; text-align: left; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .period-label-main { width: auto; margin: 0; font-size: clamp(26px, 3vw, 34px); line-height: 1.1; letter-spacing: -.035em; text-align: left; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .summary-actions { display: flex; flex: 0 1 auto; flex-wrap: wrap; align-items: center; align-self: center; gap: 2px; margin-left: auto; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .summary-actions > :is(.summary-json-btn, .summary-pdf-btn, .summary-section-toggle) { height: var(--dashboard-hit); min-height: var(--dashboard-hit); min-width: 34px; width: auto; padding: 0 8px; border: 0; border-radius: var(--ui-radius-control); background: transparent; box-shadow: none; color: var(--dashboard-muted); font-size: 10px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .summary-actions .period-controls { display: inline-flex; align-items: center; width: 174px; height: var(--dashboard-hit); min-height: var(--dashboard-hit); gap: 0; padding: 0; border: 0; border-radius: var(--ui-radius-control); background: color-mix(in srgb, var(--text) 3%, transparent); }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .period-controls button { width: 32px; min-width: 32px; height: var(--dashboard-hit); min-height: var(--dashboard-hit); background: transparent; border: 0; font-size: 20px; color: var(--dashboard-muted); }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #refPeriodInput { width: 110px; min-width: 0; height: var(--dashboard-hit); min-height: var(--dashboard-hit); padding: 0 4px; border: 0; border-radius: 0; background: transparent; font-size: 12px; line-height: 1.2; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .summary-grid, :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .summary-grid:has(#allDebtSummaryBlock.is-open) { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 0; transition: none; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .summary-main-column { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; width: 100%; min-width: 0; padding: 0; border: 0; border-radius: 0; background: transparent; overflow: visible; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .summary-main-column::before,
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .summary-main-column::after { content: none; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .summary-side { display: block; width: 100%; min-width: 0; margin: 0; padding: 0; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card :is(#monthlySummaryBlock, #projectionSummaryBlock, #allDebtSummaryBlock) { min-width: 0; width: 100%; padding: 0; margin: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; overflow: visible; }
/* The heading owns the separator. A collapsed shell never adds a second line. */
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card :is(#monthlySummaryBlock, #projectionSummaryBlock):not(.is-open) { border: 0; background: transparent; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock:not(.is-open) > .summary-converted-inline { padding-bottom: 8px; border-bottom: 1px solid var(--dashboard-line); }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card:not(.is-open) :is(.summary-grid, .due-tracker-box, .simulation-banner, .summary-utility-row) { display: none; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card [hidden],
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card :is(#monthlySummaryBlock, #projectionSummaryBlock, #allDebtSummaryBlock) [hidden] { display: none; }

/* A heading and its disclosure share one hit area, without a second button box. */
/* This unified panel already gets the shared ::before chevron in both modes. */
#mainApp .summary-card #simulationCoveredToggle .live-covered-collapse-arrow::after { content: none; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card :is(#monthlySummaryBlock, #projectionSummaryBlock, #allDebtSummaryBlock, #dueTrackerBox, .summary-actions) .summary-collapse-mark { display: inline-grid; place-items: center; width: 12px; min-width: 12px; height: 12px; min-height: 12px; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--dashboard-muted); font-size: 0; line-height: 0; transform: none; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .summary-collapse-mark::before { content: ""; display: block; width: 6px; height: 6px; border: 0; border-right: 1.4px solid currentColor; border-bottom: 1.4px solid currentColor; border-radius: 0; background: none; transform: rotate(-45deg); }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card [aria-expanded="true"] > .summary-collapse-mark::before { transform: rotate(45deg); }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card :is(.monthly-summary-toggle, .projection-detail-toggle) { display: inline-flex; justify-content: center; align-items: center; width: var(--dashboard-hit); min-width: var(--dashboard-hit); height: var(--dashboard-hit); min-height: var(--dashboard-hit); margin: 0; padding: 0; border: 0; border-radius: var(--ui-radius-control); background: transparent; box-shadow: none; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card :is(button, select):focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card :is(.summary-actions > button, .period-controls button, .monthly-summary-toggle, .projection-detail-toggle, .quick-assumption-toggle):hover { color: var(--text); background: color-mix(in srgb, var(--text) 5%, transparent); }

/* Compact due overview. Status colours still identify urgency. */
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .due-tracker-box { margin: 0 0 10px; padding: 0 0 10px; border: 0; border-bottom: 1px solid var(--dashboard-line); background: transparent; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .due-tracker-head { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0 8px; min-height: var(--dashboard-hit); padding: 0; border: 0; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .due-tracker-toggle { flex: 1 1 145px; width: auto; min-height: var(--dashboard-hit); gap: 8px; justify-content: flex-start; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .due-tracker-title-stack { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .due-tracker-title-stack h3 { font-size: 11px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .due-tracker-title-stack > span { font-size: 10px; color: var(--dashboard-muted); }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .due-tracker-switch { width: auto; min-height: var(--dashboard-hit); margin: 0; gap: 6px; font-size: 10px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .due-tracker-body { padding: 0; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .due-tracker-chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin: 0; padding: 0; border: 0; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .due-tracker-chip { min-height: 48px; padding: 7px 9px; gap: 4px 8px; border: 0; border-left: 2px solid var(--dashboard-line); border-radius: 0; background: transparent; box-shadow: none; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .due-tracker-chip-overdue { border-left-color: var(--red); background: color-mix(in srgb, var(--red) 4%, transparent); }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .due-tracker-chip-today { border-left-color: var(--warning); background: color-mix(in srgb, var(--warning) 4%, transparent); }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .due-tracker-chip:is(:hover, :focus-visible, .is-open) { background: color-mix(in srgb, var(--text) 5%, transparent); }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .due-tracker-chip > span { font-size: 10px; letter-spacing: .01em; white-space: normal; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .due-tracker-chip > strong { font-size: 18px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .due-tracker-chip > em { font-size: 10px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .due-tracker-popup { width: min(390px, calc(100cqw - 8px)); max-height: min(320px, 50svh); }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .due-tracker-popup-main b { white-space: normal; overflow-wrap: anywhere; }

/* Fixed control slots keep active weight and the hidden month filter from
   moving neighbouring choices. Narrow screens keep the existing toolbar. */
.dashboard-items-head { display: none; }
.dashboard-items-context { display: contents; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock > .summary-converted-inline { display: block; margin: 0; padding: 0; border: 0; background: transparent; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock .monthly-total-toggle { display: grid; grid-template-columns: minmax(0, 1fr) auto var(--dashboard-hit); gap: 4px 8px; align-items: center; min-height: var(--dashboard-hit); height: auto; padding: 0; }
/* Anchor the title and chevron to the first control row, just like Projection.
   The collapsed total can then appear below without re-centring the title. */
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock .monthly-total-toggle > div { align-self: start; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock .monthly-summary-toggle { grid-column: 3; justify-self: end; align-self: start; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock .monthly-total-toggle h3 { display: flex; align-items: center; min-height: var(--dashboard-hit); font-size: 12px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock.is-open .monthly-summary-compact-total { display: none; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock .quick-assumption-toggle { min-height: var(--dashboard-hit); max-width: 100%; padding: 0 10px; gap: 6px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius-control); background: transparent; color: var(--text); }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .quick-assumption-title { font-size: 11px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .quick-assumption-state { font-size: 11px; max-width: 120px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock .summary-window-anchor-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 12px; min-height: var(--dashboard-hit); margin: 0; padding: 0 0 6px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock :is(#summaryWindowToggle, #monthlyFilter) { display: inline-grid; align-items: center; gap: 0; padding: 0; margin: 0; border: 0; border-radius: 0; background: transparent; overflow: visible; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock #summaryWindowToggle { grid-template-columns: repeat(2, 48px); }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock #monthlyFilter { grid-template-columns: 44px 44px 64px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock #monthlyFilter [data-monthly-filter="all"] { grid-column: 2; grid-row: 1; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock #monthlyFilter [data-monthly-filter="month"] { grid-column: 1; grid-row: 1; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock #monthlyFilter [data-monthly-filter="overdue"] { grid-column: 3; grid-row: 1; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock :is(#summaryWindowToggle, #monthlyFilter) button { width: 100%; min-width: 0; justify-content: center; white-space: nowrap; min-height: var(--dashboard-hit); height: auto; padding: 0 4px; border: 0; border-bottom: 1px solid transparent; border-radius: 0; background: transparent; box-shadow: none; color: var(--dashboard-muted); font-size: 11px; font-weight: 500; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock :is(#summaryWindowToggle, #monthlyFilter) button.is-active { border-bottom-color: var(--text); background: transparent; color: var(--text); font-weight: 700; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock :is(#summaryWindowToggle, #monthlyFilter) button:hover { color: var(--text); background: color-mix(in srgb, var(--text) 4%, transparent); }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock .summary-converted-controls { min-height: 0; margin: 0; padding: 0 0 10px; gap: 4px; border: 0; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock .combined-total-stack { gap: 4px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock .combined-value { font-size: clamp(28px, 3vw, 36px); line-height: 1.1; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock .combined-alternates { font-size: 11px; color: var(--dashboard-muted); }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyDetailArea { padding: 0; margin: 0; border: 0; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyDetailArea > .summary-monthly-static-head:not(:has(*)) { display: none; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyDetailBody { padding: 0; margin: 0; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyTotals { display: grid; gap: 8px; width: 100%; margin: 0; padding: 0; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyTotals :is(.total-group, .total-group-hazal-monthly, .total-group-hazal-currency) { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; width: 100%; min-width: 0; padding: 0; margin: 0; border: 0; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card :is(#monthlyTotals, .dashboard-currency-head) .totals-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; width: 100%; padding: 6px 0; margin: 0; border: 0; border-bottom: 1px solid var(--dashboard-line); }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card :is(#monthlyTotals, .dashboard-currency-head) .totals-row .cur { min-width: 0; margin: 0; font-size: 10px; color: var(--dashboard-muted); }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card :is(#monthlyTotals, .dashboard-currency-head) .totals-row > span:last-child { font-size: 14px; line-height: 1.2; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyTotals .total-items { grid-column: 1; width: 100%; min-width: 0; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyTotals .total-item { grid-template-columns: 18px minmax(0, 1fr) auto 18px; gap: 8px; width: 100%; min-width: 0; min-height: var(--dashboard-row-height); padding: 5px 6px; border: 0; border-bottom: 1px solid var(--dashboard-line); border-radius: 0; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyTotals .monthly-item-copy { min-width: 0; gap: 2px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyTotals .monthly-item-main { display: block; min-width: 0; overflow: visible; white-space: normal; overflow-wrap: anywhere; text-overflow: clip; font-size: 13px; line-height: 1.3; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyTotals .monthly-item-main > em { margin-right: 5px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyTotals .monthly-item-due { font-size: 10px; line-height: 1.2; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyTotals .total-item > strong { min-width: 0; justify-self: end; font-size: 13px; line-height: 1.3; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyTotals .monthly-card-plan-stack { display: grid; grid-template-columns: max-content max-content; justify-content: end; align-items: center; gap: 4px 8px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyTotals .monthly-card-plan-control { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyTotals .monthly-card-plan-select { min-width: 0; width: 80px; height: var(--dashboard-hit); min-height: var(--dashboard-hit); padding: 0 18px 0 4px; border: 0; border-bottom: 1px solid var(--dashboard-line); border-radius: 0; background-color: transparent; font-size: 11px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyTotals :is(.monthly-card-plan-amount, .monthly-paid-amount) { width: 88px; max-width: 100%; min-height: var(--dashboard-hit); border: 0; border-bottom: 1px solid var(--dashboard-line); border-radius: 0; background: transparent; font-size: 13px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyTotals .monthly-card-plan-result { min-width: 0; font-size: 13px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyTotals :is(.monthly-select-toggle, .monthly-paid-toggle) { width: 18px; min-width: 18px; height: 18px; min-height: 18px; margin: 0; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyTotals .monthly-pending-amount-btn { max-width: 105px; min-height: var(--dashboard-hit); white-space: normal; }

/* Projection remains fully readable at every width. No nested scroll for six months. */
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #projectionSummaryBlock .projection-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto; align-items: start; gap: 4px 8px; min-height: var(--dashboard-hit); height: auto; padding: 0 0 6px; border: 0; border-bottom: 1px solid var(--dashboard-line); }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #projectionSummaryBlock .projection-toggle { display: contents; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #projectionSummaryBlock .projection-title-copy { display: contents; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #projectionSummaryBlock .projection-title-copy h3 { grid-column: 1; grid-row: 1; display: flex; align-items: center; min-height: var(--dashboard-hit); margin: 0; font-size: 12px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #projectionSummaryBlock .projection-title-copy > span { grid-column: 1 / -1; grid-row: 2; font-size: 10px; line-height: 1.35; white-space: normal; overflow: visible; color: var(--dashboard-muted); }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #projectionSummaryBlock .projection-head-tools { grid-column: 2; grid-row: 1; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; align-self: start; gap: 4px; min-height: var(--dashboard-hit); height: auto; margin: 0; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #projectionSummaryBlock .projection-range-control { gap: 4px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #projectionSummaryBlock .projection-range-control > span { display: none; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #projectionSummaryBlock .projection-range-control select { height: var(--dashboard-hit); min-height: var(--dashboard-hit); padding: 0 22px 0 6px; border: 0; border-bottom: 1px solid var(--dashboard-line); border-radius: 0; background-color: transparent; font-size: 11px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #projectionSummaryBlock .projection-collapsible-body { padding: 6px 0 0; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #projectionSummaryBlock:not(.is-open) :is(.projection-title-copy > span, .projection-range-control, .projection-simulation-badge) { display: none; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #projectionChart { padding: 0; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #projectionChart .projection-bars { gap: 0; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #projectionChart .projection-row { display: grid; grid-template-columns: 18px 46px minmax(24px, 1fr) auto; grid-template-areas: "select month track amount" ". . original original"; align-items: center; gap: 3px 8px; min-height: var(--dashboard-row-height); padding: 4px 0; border: 0; border-bottom: 1px solid var(--dashboard-line); border-radius: 0; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #projectionChart .projection-row::after { content: none; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #projectionChart .projection-month-select { position: static; grid-area: select; width: 18px; min-width: 18px; height: 18px; min-height: 18px; margin: 0; transform: none; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #projectionChart .projection-month { grid-area: month; font-size: 11px; line-height: 1.2; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #projectionChart .projection-track { grid-area: track; width: 100%; min-width: 0; height: 4px; margin: 0; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #projectionChart .projection-amount { grid-area: amount; justify-self: end; margin: 0; font-size: 13px; line-height: 1.2; white-space: normal; text-align: right; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #projectionChart .projection-original { grid-area: original; justify-self: end; margin: 0; font-size: 10px; line-height: 1.2; overflow-wrap: anywhere; text-align: right; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #projectionChart .projection-row.has-duplicate-original { grid-template-areas: "select month track amount"; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #projectionChart .has-duplicate-original .projection-original { display: none; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #projectionChart :is(.projection-amount, .projection-original) .projection-sim-markers { flex-wrap: wrap; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #projectionChart:is([data-months="12"], [data-months="24"]) { max-height: clamp(220px, 50svh, 540px); overflow-y: auto; overscroll-behavior: contain; }

/* Debt disclosure uses a complete horizontal heading, open or closed. */
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #allDebtSummaryBlock > .summary-block-toggle { display: grid; grid-template-columns: minmax(0, 1fr) 24px; gap: 8px; min-height: var(--dashboard-hit); width: 100%; padding: 0 0 6px; border: 0; border-bottom: 1px solid var(--dashboard-line); border-radius: 0; background: transparent; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #allDebtSummaryBlock > .summary-block-toggle h3 { display: block; font-size: 12px; line-height: 1.3; text-align: left; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #allDebtSummaryBlock .debt-title-word { display: inline; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #allDebtSummaryBlock > .summary-block-toggle > div { display: grid; gap: 2px; min-width: 0; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #allDebtSummaryBlock > .summary-block-toggle > div > span { font-size: 10px; line-height: 1.35; white-space: normal; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #allDebtSummaryBlock:not(.is-open) > .summary-block-toggle > div > span { display: none; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #allDebtSummaryBlock .summary-debt-converted { padding: 8px 0; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #allDebtSummaryBlock .combined-value { font-size: clamp(26px, 2.5vw, 32px); line-height: 1.1; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #allDebtTotals { padding: 0; gap: 8px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #allDebtTotals .total-item { min-width: 0; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #allDebtTotals .total-item > span { overflow-wrap: anywhere; }

/* Context panels retain their original state and controls. */
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .quick-assumption-row { grid-template-columns: minmax(100px, 1fr) auto auto var(--dashboard-hit); gap: 6px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .quick-assumption-row :is(select, input, button) { min-height: var(--dashboard-hit); }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .quick-assumption-method-options { display: flex; flex-wrap: wrap; gap: 4px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .quick-assumption-method-options button { min-height: var(--dashboard-hit); padding: 0 7px; border: 0; border-bottom: 1px solid transparent; border-radius: 0; background: transparent; font-size: 11px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .quick-assumption-method-options button.is-active { border-bottom-color: var(--text); }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthBridgePanel { width: 100%; margin-top: 8px; padding-top: 8px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthBridgePanel .month-bridge-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthBridgePanel .month-bridge-amount-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthBridgePanel #monthBridgeItems { width: 100%; margin-top: 6px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .simulation-banner { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 8px; margin: 0 0 8px; padding: 6px 8px; min-height: 0; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #simulationBanner[hidden] { display: none; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .simulation-banner-copy,
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .simulation-banner-copy > div { display: contents; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .simulation-banner-dot { display: none; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .simulation-banner-copy strong { grid-column: 1; grid-row: 1; font-size: 10px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #simulationBannerText { grid-column: 1 / -1; grid-row: 2; font-size: 11px; line-height: 1.35; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .simulation-banner-actions { grid-column: 2; grid-row: 1; margin: 0; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #simulationClearAll { min-height: var(--dashboard-hit); padding: 0 4px; border: 0; border-radius: 0; background: transparent; font-size: 11px; white-space: nowrap; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .simulation-impact-card { border: 0; border-radius: 0; background: transparent; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .simulation-impact-head { display: flex; flex-wrap: wrap; gap: 3px 10px; padding: 5px 0; border: 0; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .simulation-impact-head span { text-align: left; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .simulation-impact-flow { grid-template-columns: minmax(0, 1fr) 12px minmax(0, 1fr); padding: 6px 0; gap: 6px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .simulation-impact-flow > i { width: auto; transform: none; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .simulation-impact-value > strong { font-size: 14px; white-space: normal; overflow: visible; overflow-wrap: anywhere; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .simulation-impact-delta { padding: 6px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySelectedPanel { padding: 8px 0; margin: 0 0 8px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card :is(.monthly-selected-head, .selection-panel-head) { display: flex; flex-wrap: wrap; flex-direction: row; align-items: center; gap: 6px 12px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card :is(.monthly-selected-actions, .selection-panel-actions) { margin-left: auto; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .monthly-selected-item { min-width: 0; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .monthly-selected-item > span { white-space: normal; overflow-wrap: anywhere; }

/* Wide composition: shared summary band, aligned detail/projection, then debt.
   Keep the original DOM, disclosure targets and phone presentation intact.
   680px accommodates a 380px payment list and a 280px projection. */
@container dashboard (min-width: 680px) {
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #summaryGrid { --dashboard-align-rows: 1; }
  /* A decorative rule sits in the existing gutter, without narrowing either column. */
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #summaryGrid:has(#monthlySummaryBlock.is-open):has(#projectionSummaryBlock.is-open)::after { content: ""; grid-column: 2; grid-row: 2 / 5; justify-self: start; align-self: stretch; width: 1px; transform: translateX(-10.5px); background: color-mix(in srgb, var(--text) 7%, transparent); pointer-events: none; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card .summary-grid, :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card .summary-grid:has(#allDebtSummaryBlock.is-open) { grid-template-columns: minmax(0, 1fr) minmax(280px, 38%); grid-template-rows: auto auto auto auto auto; align-items: stretch; gap: 0 20px; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card .summary-main-column, :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock { display: contents; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock > .summary-converted-inline { grid-column: 1 / -1; grid-row: 1; display: grid; grid-template-rows: auto; grid-auto-rows: auto; grid-template-columns: minmax(0, 1fr) 96px max-content var(--dashboard-hit); align-items: center; gap: 4px 12px; margin-bottom: 8px; padding: 0 0 8px; border-bottom: 1px solid var(--dashboard-line); }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock .monthly-total-toggle { display: contents; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock .monthly-total-toggle > div { grid-column: 1; grid-row: 1; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock .quick-assumption-toggle { grid-column: 3; grid-row: 1; justify-self: end; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock .monthly-summary-toggle { grid-column: 4; grid-row: 1; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock .summary-window-anchor-row { grid-column: 2; grid-row: 1; justify-content: flex-start; align-self: center; gap: 0; padding: 0; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock #monthlySummaryTotals:not([hidden]), :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryTotals > .combined-row, :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryTotals > .combined-row > .combined-total-stack { display: contents; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryTotals #combinedTotal { grid-column: 1; grid-row: 2; justify-self: start; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryTotals #combinedAlternates { grid-column: 1; grid-row: 3; justify-self: start; }
  /* The quick-assumption wrapper is display: contents. Its visible body, not
     that boxless wrapper, must own the full-width grid placement. */
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryTotals .combined-total-stack > :not(#combinedTotal, #combinedAlternates), :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryTotals #quickAssumptionBody { grid-column: 1 / -1; min-width: 0; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryTotals #monthlySelectionClear { justify-self: start; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock:not(.is-open) > .summary-converted-inline { padding-bottom: 8px; }
  /* Share the header track. Projection content flows directly below it,
     independently of the ledger's optional selection area. */
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyDetailArea:not([hidden]), :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #projectionSummaryBlock { display: grid; grid-row: 2 / 5; grid-template-rows: subgrid; row-gap: 0; align-self: stretch; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyDetailArea { grid-column: 1; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #projectionSummaryBlock { grid-column: 2; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card .dashboard-items-head { display: grid; grid-row: 1; grid-template-rows: auto 1fr; gap: 4px; padding: 0 0 6px; border-bottom: 1px solid var(--dashboard-line); }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card .dashboard-items-toolbar { display: flex; align-self: start; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--dashboard-hit); }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card .dashboard-items-toolbar h3 { margin: 0; font-size: 12px; line-height: 1.3; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card .dashboard-currency-head { align-self: end; min-width: 0; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock .dashboard-currency-head .totals-row { padding: 0; border: 0; min-height: 17px; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyDetailBody:not([hidden]) { display: contents; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #projectionSummaryBlock .projection-collapsible-body:not([hidden]) { display: block; grid-row: 2 / 4; align-self: start; padding: 0; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card .dashboard-items-context { display: block; grid-row: 2; min-width: 0; }
  /* Size-query containment belongs on the list, not on a subgrid host:
     an independent formatting context disables the shared header tracks. */
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyTotals { grid-row: 3; align-self: start; container: monthly-list / inline-size; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #projectionSummaryBlock .projection-head { grid-row: 1; grid-template-rows: auto 1fr; margin: 0; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #projectionSummaryBlock .projection-title-copy > span { align-self: end; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #projectionSummaryBlock #projectionSelectionSummary { margin: 0; }
  /* Long horizons flow down the dedicated column; compact layouts keep the lock. */
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #projectionChart:is([data-months="12"], [data-months="24"]) { --projection-expanded: 1; height: auto; min-height: 0; max-height: none; overflow: visible; overscroll-behavior: auto; scrollbar-gutter: auto; -webkit-mask-image: none; mask-image: none; }
  /* Inline payment controls fit the shared row height without reducing their hit area.
     Balanced outer tracks keep projection controls and totals at the row centre;
     the currency breakdown can still wrap and increase the row's natural height. */
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyTotals .total-item { padding-block: 3px; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #projectionChart .projection-row { grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-areas: "select month . ." "select month track amount" "select month original original"; row-gap: 0; padding-block: 0; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #projectionChart .projection-original { align-self: start; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #projectionChart .projection-row.has-duplicate-original { grid-template-rows: auto; grid-template-areas: "select month track amount"; }
  /* The preceding list/heading already ends in a rule; the debt heading owns its own. */
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card .summary-side { grid-column: 1 / -1; grid-row: 5; margin-top: 8px; padding-top: 0; border: 0; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card .summary-grid:has(#monthlySummaryBlock:not(.is-open)) { grid-template-columns: minmax(0, 1fr); }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card .summary-grid:has(#monthlySummaryBlock:not(.is-open)) #projectionSummaryBlock { grid-column: 1; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #allDebtSummaryBlock.is-open { display: grid; grid-template-columns: minmax(200px, .38fr) minmax(0, 1fr); align-items: start; gap: 8px 24px; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #allDebtSummaryBlock > .summary-block-toggle { grid-column: 1 / -1; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #allDebtSummaryBlock .summary-debt-converted { grid-column: 1; padding: 6px 0; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #allDebtSummaryBlock #allDebtTotals { grid-column: 2; min-width: 0; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #allDebtSummaryBlock #allDebtClosedImpact { grid-column: 1 / -1; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #allDebtSummaryBlock #allDebtClosedImpact:empty { display: none; }
}
/* Payment rows respond to their own column, including portrait tablets. */
@container monthly-list (max-width: 430px) {
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyTotals .monthly-card-plan-stack { grid-template-columns: minmax(0, 1fr); gap: 0; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyTotals .monthly-card-plan-control { max-width: 178px; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyTotals .total-item:has(.forecast-amount-inline) { grid-template-columns: 18px minmax(0, 1fr) 18px; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyTotals .total-item:has(.forecast-amount-inline) .monthly-item-copy { grid-column: 2; grid-row: 1; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyTotals .total-item:has(.forecast-amount-inline) > strong { grid-column: 2; grid-row: 2; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyTotals .total-item:has(.forecast-amount-inline) > .monthly-select-toggle { grid-column: 3; grid-row: 1; }
  :where(html:not([data-expense-mode="simple"]):not([data-app-device="phone"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyTotals .total-item:has(.forecast-amount-inline) > .monthly-paid-toggle { grid-column: 1; grid-row: 1; }
}
@container dashboard (max-width: 650px) {
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .summary-top { gap: 6px; }
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .summary-actions { flex: 1 0 100%; margin-left: 0; }
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .summary-actions .period-controls { margin-right: auto; }
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .due-tracker-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock .quick-assumption-state { max-width: 90px; }
}
@container dashboard (max-width: 380px) {
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .due-tracker-switch { margin-left: auto; }
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock .monthly-total-toggle { column-gap: 4px; }
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock .quick-assumption-toggle { grid-template-columns: none; grid-auto-flow: column; padding-inline: 8px; white-space: nowrap; }
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock .quick-assumption-state:not(:empty) { grid-column: 1 / -1; justify-self: start; max-width: 100%; }
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock #summaryWindowToggle { grid-template-columns: repeat(2, 44px); }
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock #monthlyFilter { grid-template-columns: 40px 40px 60px; }
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock :is(#summaryWindowToggle, #monthlyFilter) button { padding-inline: 6px; font-size: 10px; }
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyTotals .total-item { gap: 6px; padding-inline: 4px; }
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #simulationCovered { padding-right: 4px; }
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyTotals .monthly-card-plan-stack { grid-template-columns: minmax(0, 1fr); gap: 0; }
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyTotals .monthly-card-plan-control { justify-content: flex-end; }
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyTotals .monthly-card-plan-select { width: 78px; min-height: 30px; height: 30px; }
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .quick-assumption-row { grid-template-columns: minmax(0, 1fr) auto var(--dashboard-hit); }
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #quickAssumptionMode { grid-column: 1 / 3; grid-row: 2; max-width: none; width: 100%; }
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #quickAssumptionClear { grid-column: 3; grid-row: 1; }
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .quick-ratio-group label { grid-template-columns: minmax(0, 1fr) auto; height: auto; min-height: 0; padding: 3px 6px; border: 0; border-bottom: 1px solid var(--dashboard-line); border-radius: 0; background: transparent; }
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .quick-ratio-group label > span { grid-column: 1 / -1; font-size: 9px; white-space: normal; overflow: visible; }
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .quick-ratio-group input { width: 100%; min-width: 0; min-height: 28px; }
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyTotals .total-item:has(.forecast-amount-inline) { grid-template-columns: 18px minmax(0, 1fr) 18px; }
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyTotals .total-item:has(.forecast-amount-inline) .monthly-item-copy { grid-column: 2; grid-row: 1; }
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyTotals .total-item:has(.forecast-amount-inline) > strong { grid-column: 2; grid-row: 2; }
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyTotals .total-item:has(.forecast-amount-inline) > .monthly-select-toggle { grid-column: 3; grid-row: 1; }
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlyTotals .total-item:has(.forecast-amount-inline) > .monthly-paid-toggle { grid-column: 1; grid-row: 1; }
}
@media (pointer: coarse) {
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card { --dashboard-hit: 36px; --dashboard-row-height: 44px; }
}
@container dashboard (max-width: 300px) {
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .summary-actions .period-controls { width: 144px; }
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .period-controls button { width: 28px; min-width: 28px; }
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #refPeriodInput { width: 88px; font-size: 11px; }
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .summary-actions > :is(.summary-json-btn, .summary-pdf-btn, .summary-section-toggle) { min-width: 30px; padding-inline: 4px; }
}
@media (max-height: 500px) {
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .summary-top { padding-bottom: 6px; }
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .due-tracker-box { margin-bottom: 6px; padding-bottom: 6px; }
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .due-tracker-popup { max-height: 42svh; }
}
/* Match the established Plan page-title inset, without changing its shell.
   Dashboard content layout remains container-width based. */
@media (max-width: 760px) and (orientation: portrait) {
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card { padding-top: 7px; }
}


/* The action has its own button treatment; chevrons only disclose sections. */
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock .quick-assumption-state { order: 2; }
@media (max-width: 430px) { :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock .quick-assumption-toggle[aria-expanded="true"] .quick-assumption-state:not(:empty) ~ .quick-assumption-title { display: none; } }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock .quick-assumption-toggle[aria-expanded="true"] { border-color: var(--sim-mode); background: color-mix(in srgb, var(--sim-mode) 16%, transparent); color: var(--text); }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock .quick-assumption-toggle[aria-expanded="true"] .quick-assumption-state { color: var(--sim-ink); font-weight: 700; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .summary-actions > .summary-section-toggle { width: var(--dashboard-hit); padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--text); }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .summary-actions > .summary-section-toggle .summary-collapse-mark::before { width: 9px; height: 9px; border-width: 0 2px 2px 0; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card :is(.monthly-summary-toggle, .projection-detail-toggle, #allDebtSummaryBlock > .summary-block-toggle) .summary-collapse-mark { justify-self: center; color: var(--text); }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #allDebtSummaryBlock > .summary-block-toggle { grid-template-columns: minmax(0, 1fr) var(--dashboard-hit); gap: 8px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card :is(#summaryWindowTitle, #projectionTitle, #allDebtSummaryBlock > .summary-block-toggle h3) { font-weight: 700; }

/* Category bands remain the same height while reading as distinct headings. */
#mainApp :is(.main-owner-section, .hazal-section) .list-card-head { background: transparent; border-bottom-color: var(--text); }

/* Rolling view has two adjacent filter slots, with no empty month track. */
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock[data-summary-window="30d"] #monthlyFilter { grid-template-columns: 44px 64px; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock[data-summary-window="30d"] #monthlyFilter [data-monthly-filter="all"] { grid-column: 1; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock[data-summary-window="30d"] #monthlyFilter [data-monthly-filter="overdue"] { grid-column: 2; }
@container dashboard (max-width: 380px) {
  :where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card #monthlySummaryBlock[data-summary-window="30d"] #monthlyFilter { grid-template-columns: 40px 60px; }
}

/* Compact category bands: neither control sets a tall heading row. */
#mainApp :is(.main-owner-section, .hazal-section) .list-card-head { grid-template-columns: minmax(0, 1fr) 22px 22px; gap: 4px; min-height: 0; height: auto; padding: 3px 6px; }
#mainApp :is(.main-owner-section, .hazal-section) .list-card-head :is(.column-toggle, .list-card-collapse-btn, .list-card-toggle) { display: inline-grid; place-items: center; width: 22px; min-width: 22px; height: 18px; min-height: 18px; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--muted); }
#mainApp :is(.main-owner-section, .hazal-section) .list-card-head .column-toggle { font-size: 14px; font-weight: 500; line-height: 1; }
#mainApp :is(.main-owner-section, .hazal-section) .list-card-head :is(.column-toggle, .list-card-collapse-btn, .list-card-toggle):hover { color: var(--text); background: transparent; }
#mainApp :is(.main-owner-section, .hazal-section) .list-card-head .summary-collapse-mark { width: 12px; min-width: 12px; height: 12px; min-height: 12px; }

#mainApp :is(.main-owner-section, .hazal-section) .list-card-head { border-radius: 0; }
:where(html:not([data-expense-mode="simple"]) body:not(.is-plan-view)) #mainApp .summary-card .summary-actions > .summary-section-toggle:hover { background: transparent; }

#mainApp :is(.main-owner-section, .hazal-section) .list-card-head .column-toggle svg { display: block; width: 14px; height: 14px; fill: currentColor; }

/* Category selection belongs to the summary heading, not another toolbar row. */
#mainApp .summary-card :is(#monthlySummaryBlock, #allDebtSummaryBlock) .monthly-summary-title-group { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; min-height: var(--dashboard-hit); }
#mainApp .summary-card :is(#monthlySummaryBlock, #allDebtSummaryBlock) .monthly-summary-title-group h3 { margin: 0; flex: 0 0 auto; }
#mainApp .summary-card :is(#monthlySummaryBlock, #allDebtSummaryBlock) :is(.monthly-category-filter-toggle, .monthly-category-filter-clear) { display: inline-flex; align-items: center; justify-content: center; gap: 3px; min-height: 24px; height: 24px; padding: 0 3px; border: 0; border-radius: var(--ui-radius-control); background: transparent; color: var(--dashboard-muted); box-shadow: none; font: 500 10px/1 var(--font-ui); white-space: nowrap; cursor: pointer; }
#mainApp .summary-card :is(#monthlySummaryBlock, #allDebtSummaryBlock) .monthly-category-filter-toggle { flex: 0 0 24px; width: 24px; }
#mainApp .summary-card :is(#monthlySummaryBlock, #allDebtSummaryBlock) .monthly-category-filter-toggle svg { display: block; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
#mainApp .summary-card :is(#monthlySummaryBlock, #allDebtSummaryBlock) .monthly-category-filter-toggle.is-active { color: var(--text); background: color-mix(in srgb, var(--text) 7%, var(--bg)); }
#mainApp .summary-card :is(#monthlySummaryBlock, #allDebtSummaryBlock) .monthly-category-filter-clear { color: var(--text); }
#mainApp .summary-card :is(#monthlySummaryBlock, #allDebtSummaryBlock) .monthly-category-filter-panel { position: absolute; top: 100%; left: 0; z-index: 50; display: block; width: 260px; max-width: calc(100vw - 48px); max-height: min(420px, 65svh); overflow: auto; padding: 10px 12px; border: 1px solid var(--dashboard-line); border-radius: var(--ui-radius-card); background: var(--bg); color: var(--text); box-shadow: 0 8px 24px color-mix(in srgb, var(--text) 12%, transparent); }
#mainApp .summary-card :is(#monthlySummaryBlock, #allDebtSummaryBlock) .monthly-category-filter-panel fieldset { min-width: 0; margin: 8px 0 0; padding: 0; border: 0; }
#mainApp .summary-card :is(#monthlySummaryBlock, #allDebtSummaryBlock) .monthly-category-filter-panel legend { padding: 0; font: 700 10px/1.5 var(--font-ui); }
#mainApp .summary-card :is(#monthlySummaryBlock, #allDebtSummaryBlock) .monthly-category-filter-panel legend small { display: block; color: var(--dashboard-muted); font-weight: 400; }
#mainApp .summary-card :is(#monthlySummaryBlock, #allDebtSummaryBlock) .monthly-category-filter-panel label { display: flex; align-items: center; gap: 8px; min-height: 28px; font: 400 12px/1.3 var(--font-ui); cursor: pointer; }
#mainApp .summary-card :is(#monthlySummaryBlock, #allDebtSummaryBlock) .monthly-category-filter-panel label:has(input:disabled) { opacity: .5; cursor: default; }
#mainApp .summary-card :is(#monthlySummaryBlock, #allDebtSummaryBlock) .monthly-category-filter-panel input { flex: 0 0 14px; width: 14px; height: 14px; min-height: 14px; margin: 0; }
#mainApp .summary-card :is(#monthlySummaryBlock, #allDebtSummaryBlock) .monthly-category-filter-actions { display: flex; justify-content: space-between; gap: 8px; padding-bottom: 5px; border-bottom: 1px solid var(--dashboard-line); }
#mainApp .summary-card :is(#monthlySummaryBlock, #allDebtSummaryBlock) .monthly-category-filter-actions button { min-height: 26px; padding: 0 3px; border: 0; border-radius: var(--ui-radius-control); background: transparent; color: var(--text); font: 500 11px/1.3 var(--font-ui); cursor: pointer; }
#mainApp .summary-card :is(#monthlySummaryBlock, #allDebtSummaryBlock) :is(.monthly-category-filter-panel, .monthly-category-filter-clear)[hidden], #mainApp .summary-card :is(#monthlySummaryBlock, #allDebtSummaryBlock) .monthly-category-filter-panel [hidden] { display: none; }
html[data-expense-mode="simple"] #mainApp :is(#monthlyCategoryFilterToggle, #monthlyCategoryFilterClear, #monthlyCategoryFilterPanel, #debtCategoryFilterToggle, #debtCategoryFilterClear, #debtCategoryFilterPanel) { display: none; }

#mainApp .summary-card #allDebtSummaryBlock { position: relative; }
#mainApp .summary-card #allDebtSummaryBlock .debt-category-heading-controls { position: absolute; top: 0; left: 84px; z-index: 2; min-height: var(--dashboard-hit); }
#mainApp .summary-card #allDebtSummaryBlock > .summary-block-head h3 { padding-right: 110px; }
