/* Keep the Home transaction filters in the list header, with room for the open fields. */
#app[data-route=home] .home-ledger-layout .home-ledger-heading{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px 12px}
#app[data-route=home] .home-ledger-heading>.toolbar{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px;margin:0;min-width:0}
#app[data-route=home] .home-ledger-heading>.toolbar:is(.filters-open,:has(.active-filters)){grid-column:1/-1}
#app[data-route=home] .home-ledger-heading>.toolbar :is(.filter-fields,.active-filters){flex-basis:100%}
html[data-theme] #app[data-route=home][data-home-view=daily] .home-ledger-layout .transaction-disclosure.is-expanded>.transaction,
html[data-theme] #app[data-route=home][data-home-view=daily] .home-ledger-layout .transaction:active{background:color-mix(in srgb,var(--reference-blue) 7%,transparent)}
@media(min-width:1101px){
 #app[data-route=home] .home-ledger-layout .ledger:not(.ledger-grouped) .mobile-date{display:inline}
}
@media(max-width:639px){
 #app[data-route=home] .home-ledger-layout .home-ledger-heading{grid-template-columns:minmax(0,1fr)}
 #app[data-route=home] .home-ledger-heading>.toolbar:not(.filters-open){display:none}
 #app[data-route=home] .home-ledger-layout .mobile-category-chips{padding-inline:16px}
 html[data-theme] #app .mobile-budget-summary.is-compact .mobile-summary-date{flex-wrap:wrap;white-space:normal}
 html[data-theme] #app .mobile-budget-summary.is-compact .mobile-spent-inline{margin-left:auto;text-align:right;overflow-wrap:anywhere}
 html[data-theme] #app .mobile-budget-summary.is-compact .mobile-remaining{display:grid;grid-template-columns:minmax(0,1fr);justify-items:start;gap:4px}
 html[data-theme] #app .mobile-budget-summary.is-compact .mobile-remaining strong{max-width:100%;white-space:normal;overflow:visible;overflow-wrap:anywhere}
 html[data-theme] #app .mobile-budget-summary.is-compact .mobile-budget-line>span:first-child{min-width:0;overflow-wrap:anywhere}
 html[data-theme] #app .mobile-budget-summary.is-compact .mobile-pace-foot{height:auto;min-height:20px;white-space:normal;align-items:center}
 html[data-theme] #app .mobile-budget-summary.is-compact .pace-left{min-width:0;overflow-wrap:anywhere}
}
@media(prefers-reduced-motion:reduce){
 #app[data-route=home] .home-ledger-layout .transaction{transition:none}
}

/* Home consistency (2026-11-06). Loaded last. Home follows the Stats rules: nothing under 12 px, 44 px switches,
   plain 20 px hairline cards, and motion on the shared tokens (home-review.css, ledger-rows.css). */
#app[data-route=home] .view-tabs button{min-height:44px}
#app .home-due-strip{border-radius:var(--radius-card)}
/* Phone calendar: weekday letters, dates and day totals at 12 px; totals tighten so the day still fits a tile. */
@media (max-width:639px){
 #app .calendar-studio .calendar-weekdays span{font-size:12px;letter-spacing:.02em}
 #app .calendar-studio .calendar-day .calendar-date-number,#app .calendar-studio .calendar-outside span{font-size:12px}
 #app .calendar-studio .calendar-day small{font-size:12px;letter-spacing:-.03em;min-height:14px;white-space:nowrap}
}
/* Roomier phone day cells (2026-11-07). The grid runs nearly to the card edge with 2-4 px column gaps, so every
   tile gains about 4 px of width and drops its side padding; "−₹1.3K" at 12 px is ~36 px and now fits a 320 px
   phone (tile ~38 px) instead of clipping. Rows keep a 4 px gap and tiles grow to 64 px for vertical air.
   The #app[data-route=home] selector beats ledger-rows.css, which had pulled Home totals back to 10-11 px. */
@media (max-width:639px){
 #app .calendar-studio .calendar-weekdays{padding-inline:6px;gap:4px}
 #app .calendar-studio .calendar-grid{padding-inline:6px;gap:5px 4px}
 #app .calendar-studio .calendar-day,#app .calendar-studio .calendar-outside{min-height:64px}
 #app .calendar-studio .calendar-day{padding:8px 0 7px}
 #app[data-route=home] .calendar-studio .calendar-day small{font-size:12px;line-height:1.2;letter-spacing:-.03em;min-height:14px;max-width:none;overflow:visible}
}
@media (max-width:389px){
 #app .calendar-studio .calendar-weekdays,#app .calendar-studio .calendar-grid{padding-inline:4px;column-gap:3px}
 /* Proportional digits and a touch more tracking keep a 2 px margin inside the narrower tiles. */
 #app[data-route=home] .calendar-studio .calendar-day small{letter-spacing:-.05em;font-variant-numeric:proportional-nums}
}
@media (max-width:359px){
 #app .calendar-studio .calendar-weekdays,#app .calendar-studio .calendar-grid{padding-inline:2px;column-gap:2px}
 #app .calendar-studio .calendar-weekdays span{letter-spacing:0}
}
/* Dark phone calendar (2026-11-07, user reference): tiles sit on their own raised surface with a hairline edge,
   weekday names are quiet pills, and days outside the month are hatched, so the grid reads apart from the card. Applies at every width (the user checks on a laptop too). */
@media all{
 html[data-theme=dark] #app .calendar-studio{--cal-tile:color-mix(in srgb,var(--text) 7%,var(--surface));--cal-edge:color-mix(in srgb,var(--text) 14%,transparent)}
 html[data-theme=dark] #app .calendar-studio .calendar-weekdays span{background:var(--cal-tile);border-radius:8px;padding:5px 0}
 html[data-theme=dark] #app .calendar-studio .calendar-day{background:var(--cal-tile);border-color:var(--cal-edge)!important}
 html[data-theme=dark] #app .calendar-studio .calendar-day[data-spend-level='1']:not(.selected,.today){background:color-mix(in srgb,var(--expense) 8%,var(--cal-tile))}
 html[data-theme=dark] #app .calendar-studio .calendar-day[data-spend-level='2']:not(.selected,.today){background:color-mix(in srgb,var(--expense) 14%,var(--cal-tile))}
 html[data-theme=dark] #app .calendar-studio .calendar-day[data-spend-level='3']:not(.selected,.today){background:color-mix(in srgb,var(--expense) 20%,var(--cal-tile))}
 html[data-theme=dark] #app .calendar-studio .calendar-day.selected{background:var(--selection-soft);border-color:var(--selection-edge)!important}
 html[data-theme=dark] #app .calendar-studio .calendar-day.selected .calendar-date-number{color:var(--reference-blue)}
 html[data-theme=dark] #app .calendar-studio .calendar-day.future:not(.selected){opacity:1}
 html[data-theme=dark] #app .calendar-studio .calendar-day.future:not(.has-scheduled) .calendar-date-number{color:var(--muted)}
 html[data-theme=dark] #app .calendar-studio .calendar-day.future.has-scheduled:not(.selected){background:var(--cal-tile);border-color:var(--cal-edge)!important}
 html[data-theme=dark] #app .calendar-studio .calendar-outside{opacity:1;background:repeating-linear-gradient(135deg,var(--cal-edge) 0 1px,transparent 1px 7px);border:1px solid color-mix(in srgb,var(--text) 8%,transparent)!important;color:color-mix(in srgb,var(--muted) 70%,transparent)}
}
