/* Improve-what's-there pass (Nov 2026): flow, wording and placement fixes. Loaded last. */

/* Home: due scheduled entries sit above the list, only when something is due. */
.home-due-strip{display:grid;grid-template-columns:36px 1fr 20px;align-items:center;gap:12px;width:100%;min-height:56px;margin:0 0 16px;padding:10px 14px;border:1px solid var(--border);border-radius:var(--radius-md,16px);background:var(--surface);color:var(--text);text-align:left;cursor:pointer}
.home-due-icon{display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:var(--warning-soft);color:var(--warning)}
.home-due-icon svg,.home-due-go svg{width:18px;height:18px}
.home-due-text{display:grid;gap:2px;min-width:0}
.home-due-text strong{font-size:var(--text-sm);font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.home-due-text small{font-size:var(--text-xs);color:var(--muted)}
.home-due-go{color:var(--muted)}
@media (max-width:850px){#app .home-due-strip{width:calc(100% - 32px);margin:0 16px 16px}}
.due-preview{list-style:none;margin:8px 0 12px;padding:0;border-top:1px solid var(--divider)}
.due-preview li{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:10px 0;border-bottom:1px solid var(--divider)}
.due-preview li span{display:grid;gap:2px;min-width:0}
.due-preview small{color:var(--muted);font-size:var(--text-xs)}
.due-preview strong{font-variant-numeric:tabular-nums}

/* Add sheet: account + person on one line; the pre-picked tile says it is only the last choice. */
.entry-quickline{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0 0 12px}
.entry-account-chip{display:inline-flex;align-items:center;gap:6px;min-height:40px;max-width:52%;padding:0 10px 0 12px;border:1px solid var(--border);border-radius:var(--radius-pill);background:var(--subtle);color:var(--text);font:inherit;font-size:var(--text-sm);cursor:pointer}
.entry-account-chip span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.entry-account-chip svg{width:16px;height:16px;flex:none;color:var(--muted)}
.entry-person-chips{display:inline-flex;align-items:center;gap:4px;margin-left:auto;padding:3px;border:1px solid var(--border);border-radius:var(--radius-pill);background:var(--subtle)}
.entry-person-chips>span{padding:0 6px 0 8px;color:var(--muted);font-size:var(--text-xs)}
.entry-person-chips button{min-height:34px;min-width:44px;padding:0 12px;border:0;border-radius:var(--radius-pill);background:transparent;color:var(--muted);font:inherit;font-size:var(--text-sm);cursor:pointer;transition:background-color var(--motion-enter,.2s) var(--motion-ease,var(--motion-ease)),color var(--motion-enter,.2s) var(--motion-ease,var(--motion-ease))}
.entry-person-chips button[aria-checked=true]{background:var(--surface);color:var(--text);font-weight:600;box-shadow:0 1px 2px color-mix(in srgb,var(--text) 14%,transparent)}
.quick-last-used{display:block;font-style:normal;font-size:var(--text-2xs);color:var(--muted);line-height:1.2}
#transaction-form .merchant-suggestions{margin-top:-4px}
#transaction-form .recent-merchants{display:flex;flex-wrap:nowrap;gap:8px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;padding-bottom:2px}
#transaction-form .recent-merchants::-webkit-scrollbar{display:none}
#transaction-form .recent-merchants .merchant-chip{flex:none}

/* Sync stays quiet while it works: the cloud buttons and the detail-sheet line show only when sync needs attention. */
html:not([data-sync-attention=true]) :is(.local-status,.mobile-status){display:none}
/* The phone Home header names a column for the cloud button; without it, that column goes too so search and filter sit flush. */
@media(max-width:639px){html:not([data-sync-attention=true]) #app[data-route=home] .mobile-home-header{grid-template-columns:44px max-content 44px minmax(0,1fr) 44px 44px;grid-template-areas:"previous month next spacer search filter"}}
@media(max-width:359px){html:not([data-sync-attention=true]) #app[data-route=home] .mobile-home-header{grid-template-columns:44px minmax(80px,1fr) repeat(3,44px);grid-template-areas:"previous month next search filter"}}
.transaction-sync:empty{display:none}

/* Transaction details: More options, then Edit. */
.detail-footer{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.detail-footer .receipt-more{margin-right:auto}
.inline-detail-inner .detail-footer>.button{flex:1 1 0;min-width:0}

/* Stats: one Budget card. */
.stats-budget-card .section-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.stats-budget-card .section-heading .text-button{min-height:44px}
.stats-budget-card .budget-battery{margin:4px 0 0}
.stats-budget-card .battery-scope:empty{display:none}
.stats-budget-card .stats-hero-tiles{margin-top:16px;padding-top:16px;border-top:1px solid var(--divider)}
.stats-budget-outlook{margin-top:12px}
.stats-budget-outlook>*{margin-block:4px}
.stats-studio:not([data-stats-view=overview])>.stats-budget-card{display:none}
/* Desktop Stats is a 12-column grid: a card without its own placement spans the full width instead of falling into one 1/12 column. */
:where(.stats-studio>*){grid-column:1/-1}
.stats-watch-footer{display:flex;justify-content:flex-end;margin-top:4px}
.stats-watch-footer .text-button{display:inline-flex;align-items:center;gap:4px;min-height:44px;font-size:var(--text-sm)}
.stats-watch-footer svg{width:16px;height:16px}
.week-future-summary{margin:0;padding:14px 0 2px;border-top:1px solid var(--divider);color:var(--muted);font-size:var(--text-sm)}
.report-none{color:var(--muted)}

/* Budgets sheet: category limits under the monthly figure. */
.budget-sheet-categories{margin-top:8px;padding-top:16px;border-top:1px solid var(--divider)}
.budget-sheet-categories h3{margin:0 0 4px;font-size:var(--text-md,1rem)}
.budget-sheet-categories ul{list-style:none;margin:8px 0 0;padding:0}
.budget-sheet-categories li{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:52px;padding:6px 0;border-bottom:1px solid var(--divider)}
.budget-sheet-categories li span{display:grid;gap:2px;min-width:0}
.budget-sheet-categories li small{color:var(--muted);font-size:var(--text-xs)}
.budget-sheet-categories .small-button{min-height:36px;padding:0 12px;font-size:var(--text-sm);flex:none}

/* Account sheet: balance, this month, latest entries, then the chart; explanations wait behind a disclosure. */
.account-sheet .account-sheet-kind{display:block;color:var(--muted);font-size:var(--text-sm)}
.account-sort{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin:0 0 10px;color:var(--muted);font-size:var(--text-sm)}
.account-sort select{width:auto;max-width:100%;min-height:44px}
.account-sheet-shortcut{margin-block:4px 12px}
.account-sheet-shortcut .button{min-height:44px}
.account-sheet-month{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:12px 0 4px}
.account-sheet-month div{padding:10px 12px;border:1px solid var(--divider);border-radius:var(--radius-sm)}
.account-sheet-month dt{color:var(--muted);font-size:var(--text-xs)}
.account-sheet-month dd{margin:2px 0 0;font-weight:600;font-variant-numeric:tabular-nums}
.account-sheet-month dd.income,.account-sheet-recent b.income{color:var(--income)}
.account-sheet-recent h3{margin:16px 0 4px;font-size:var(--text-sm);color:var(--muted);font-weight:600}
.account-sheet-recent ul{list-style:none;margin:0;padding:0}
.account-sheet-recent button{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:52px;padding:6px 0;border:0;border-bottom:1px solid var(--divider);background:none;color:var(--text);font:inherit;text-align:left;cursor:pointer}
.account-sheet-recent button span{display:grid;gap:2px;min-width:0}
.account-sheet-recent strong{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.account-sheet-recent small{color:var(--muted);font-size:var(--text-xs)}
.account-sheet-recent b{font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap}
.account-sheet-about{margin-top:12px}
.account-sheet-about summary{min-height:44px;display:flex;align-items:center;cursor:pointer;color:var(--link);font-size:var(--text-sm)}

/* Goals: a quick Add beside each unfinished goal. */
.home-goal-row{display:grid;grid-template-columns:1fr auto;align-items:center;gap:12px;border-top:1px solid var(--divider)}
.home-goal-row>.home-goal{border-top:0}
.goal-add-money{min-height:36px;padding:0 12px;font-size:var(--text-sm);white-space:nowrap}
.goal-add-money svg{width:16px;height:16px}

/* Search: examples as chips; the hint is one short line. */
.search-examples{margin-bottom:4px}
.search-page-hint{margin:12px 4px 24px}

/* Stats tables scroll sideways only; the page keeps the vertical scroll (fixes the "stuck" category comparison). */
#app[data-route=stats] .table-scroll,#app[data-route=stats] .report-matrix-scroll{overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;overscroll-behavior-y:auto;max-height:none;touch-action:pan-x pan-y}
.stats-budget-line{display:grid;gap:4px;margin-top:4px}
.stats-budget-line strong{font-size:var(--text-xl,1.5rem);font-weight:700;font-variant-numeric:tabular-nums;letter-spacing:-.01em}
.stats-budget-line span{color:var(--muted);font-size:var(--text-sm)}
.stats-budget-line progress{width:100%;height:6px;margin-top:6px}
.stats-budget-line.is-over strong{color:var(--expense)}

/* Density: chart controls share one line; the compare picker drops its stacked label. */
#app[data-route=stats] .report-cumulative .report-comparison-label{display:flex;align-items:center;justify-content:space-between;gap:12px;max-width:none;white-space:nowrap;color:var(--muted)}
#app[data-route=stats] .report-cumulative .report-comparison-label select{width:auto;min-width:0;flex:0 1 auto}
#app .report-history.report-compare-months .report-phone-month{display:none}
