/* Polish review 2: one pass of measured fixes, numbered as in the review. Loaded last. */

/* 1. Savings goals: a whole card on phones too (it had a top border only, so its outline faded down the sides). */
@media (max-width:639px){
 #app .home-goals-card{padding:16px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-card);box-shadow:none}
}

/* 4. One corner scale: top-level cards 20px, boxes inside a card 12px, the compare card 16px inside its 20px card. */
#app[data-route=stats] :is(.stats-studio>.card,.report-deeper>.card:not(.ledger),.stats-weeks),
#app :is(.account-grid,.home-goals-card,.settings-profile,.search-answer,.mobile-budget-summary),
#app .home-panel .card.ledger{border-radius:var(--radius-card)}
#app .account-grid>.account-card:only-child,#app[data-route=accounts] .account-card{border-radius:var(--radius-card)}
@media (max-width:639px){#app[data-route=accounts] .account-grid>.account-card{border-radius:0}}
#app .report-history .cc-card{border-radius:var(--radius-section)}

/* 5. 44px hit areas. */
#app .entry-person-chips>button,dialog .entry-person-chips>button,dialog .entry-account-chip,#app .search-token,#app .goal-add-money,#app button.cc-grid-row,#app .cc-grid-total{min-height:44px}
#app .search-page-clear{width:44px;height:44px;margin-block:-6px;margin-inline-end:-6px}
#app .stats-budget-card .section-heading .text-button,#app .week-explorer-nav .text-button{min-width:44px;min-height:44px}
@media (min-width:640px){#app .topbar .overview-tools .topbar-search{min-height:44px}}

/* 6, 7. Desktop Stats Overview: the hero, trend and analyzer are boxed like the Budget card; card content starts 20px in. */
@media (min-width:640px){
 #app[data-route=stats] .stats-studio>:is(.stats-hero,.stats-trend,.stats-analyzer){padding:20px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-card);box-shadow:none}
 #app[data-route=stats] :is(.stats-studio>.card,.report-deeper>.card:not(.ledger)){padding:20px}
}

/* 8. One gap between cards: 16px on phones, 24px on desktop. */
#app[data-route=stats] .report-deeper>.card{margin:0}
@media (max-width:639px){#app[data-route=stats] .stats-studio{row-gap:16px}#app[data-route=stats] .report-deeper{gap:16px}#app .account-grid+.home-goals-card{margin-top:16px}}
@media (min-width:640px){#app[data-route=stats] .stats-studio{row-gap:24px}#app[data-route=stats] .report-deeper{gap:24px}}

/* 9, 10. Weeks: the day-to-day / bills line gets the full row width; tabular figures on amounts only, never on a sentence. */
#app .stats-weeks .week summary>span{grid-column:1/-1;grid-row:1}
#app .stats-weeks .week summary>strong{grid-column:2;grid-row:1;align-self:start}
#app .stats-weeks .week summary>:last-child:not(span):not(strong){grid-column:3;grid-row:1;align-self:start}
#app .stats-weeks .week summary>span>:first-child{padding-inline-end:120px}
#app .stats-weeks .week summary small,#app .week-selection-readout{font-variant-numeric:normal}
#app :is(.report-amount,.metric-value,.account-trend span,.home-goal-amounts,.cc-pill,.cc-usual,.cc-amount,.mobile-budget-summary :is(strong,b),.transaction-amount,.ledger-day-heading span:last-child,.week-selection-readout strong,.search-answer strong){font-variant-numeric:tabular-nums}

/* 11. Titles: card titles 18/600, small section labels 13/600, page titles 28px. */
#app .calendar-controls h2{font-size:var(--text-xl);font-weight:600}
#app :is(.search-section-title,.search-month){font-size:var(--text-sm);font-weight:600}
#app .page-heading h1{font-size:var(--text-4xl)}

/* 13. Detail sheet: Edit fits its label next to ⋯ instead of stretching across the row. */
html[data-theme] :is(#app,dialog) .detail-footer>.button.primary,#app[data-route=home][data-home-view=daily] .home-ledger-layout .inline-detail-inner .dialog-footer>.button.primary{flex:0 0 auto;min-width:120px;margin-inline-start:auto}

/* 14. Search: the summary chip row fades at the right edge so a cut chip reads as "scroll for more". */
#app .search-pills{padding-inline-end:16px;-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 24px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 24px),transparent)}

/* 15. Three icon sizes: 24 navigation, 20 toolbar and buttons, 16 inline. */
#app .navigation .nav-item .icon,.navigation .nav-item .icon{width:24px;height:24px}
#app .search-page-field>svg,#app .search-page-field>.icon{width:20px;height:20px}
#app .search-page-clear svg{width:16px;height:16px}

/* 12. Phone Details: the grid comes straight after the subtitle and its progress bar; "How this is counted" follows the grid. */
@media (max-width:639px){
 #app .report-history{display:flex;flex-direction:column}
 #app .report-history>.cc{order:1}
 #app .report-history>.report-note{order:2;margin-top:12px}
 #app .report-history .cc-short{margin:0 0 8px}
 #app .report-history .cc-progress{margin-top:0}
}

/* Specificity follow-ups found when re-measuring (4, 8, 11). */
html[data-theme] #app[data-route=stats] .stats-studio>:is(.card,.stats-hero,.stats-trend,.stats-analyzer){border-radius:var(--radius-card);margin-block:0}
@media (max-width:639px){html[data-theme] #app[data-route=stats] .stats-studio{row-gap:16px}#app .calendar-controls h2{font-size:var(--text-xl)!important}}
@media (min-width:640px){html[data-theme] #app[data-route=stats] .stats-studio{row-gap:24px}#app[data-route=stats] .page-heading h1{font-size:var(--text-4xl)}}
