/* Account menus expand from the field; the original select still owns its form value. */
.account-picker{display:inline-flex;position:relative;min-width:0;max-width:100%;vertical-align:middle}
.account-picker-native{position:absolute!important;width:1px!important;height:1px!important;min-width:0!important;min-height:0!important;clip-path:inset(50%);overflow:hidden;pointer-events:none;opacity:0!important}
html[data-theme] .account-picker-trigger,html[data-theme] .account-picker-current,html[data-theme] .account-picker-option{display:flex;align-items:center;gap:10px;min-height:44px;margin:0;border:0;background:none;color:var(--text);font:inherit;font-size:var(--text-sm);line-height:1.4;text-align:left;cursor:pointer}
html[data-theme] .account-picker-trigger{width:100%;padding:10px 12px;border:1px solid var(--control-border,var(--border));border-radius:var(--radius-pill);background:var(--surface)}
.account-picker-trigger>.icon:last-child,.account-picker-current>.icon:last-child{margin-left:auto}
.account-picker-value{min-width:0;overflow-wrap:break-word;word-break:normal}
.account-picker .icon{width:18px;height:18px;flex:none}
.entry-account-chip.has-select:has(.account-picker){padding:0;border:0;background:none;gap:0}
.entry-account-chip.has-select:has(.account-picker)>.icon,.entry-account-chip.has-select:has(.account-picker)>span:not(.account-picker){display:none}
html[data-theme] .account-picker-panel{position:fixed;inset:auto;margin:0;left:var(--ap-left,12px);top:var(--ap-top,12px);width:var(--ap-width,260px);max-height:var(--ap-height,340px);padding:6px;border:1px solid var(--border);border-radius:20px;background:var(--surface-raised,var(--surface));color:var(--text);box-shadow:0 12px 36px #0003;overflow:hidden;isolation:isolate}
.account-picker-panel:popover-open{display:flex;flex-direction:column}
.account-picker-panel[data-up=true]{flex-direction:column-reverse}
.account-picker-panel::backdrop{background:transparent}
html[data-theme] .account-picker-current{flex:none;width:100%;padding:10px 12px;font-weight:600}
.account-picker-current>.icon:last-child{transform:rotate(180deg)}
.account-picker-panel[data-up=true] .account-picker-current>.icon:last-child{transform:none}
.account-picker-options{display:grid;gap:3px;min-height:0;overflow:auto;overscroll-behavior:contain;padding:4px 0;scroll-padding:4px}
html[data-theme] .account-picker-option{width:100%;padding:10px 12px;border-radius:13px;flex:none}
.account-picker-option .icon{width:18px;height:18px;flex:none}
.account-picker-check{margin-left:auto;visibility:hidden;display:flex;flex:none}
.account-picker-option[aria-selected=true] .account-picker-check{visibility:visible}
.account-picker-option[aria-selected=true]{font-weight:600}
html[data-theme] .account-picker-option:focus-visible{background:var(--subtle);outline:2px solid transparent;outline-offset:-2px}
.account-picker-trigger:focus-visible,.account-picker-current:focus-visible{outline:2px solid var(--link);outline-offset:2px}
.account-picker-option:disabled{opacity:.5;cursor:default}
.field-picker{display:flex;width:100%}
html[data-theme] .field-picker .account-picker-trigger{border-radius:var(--radius-control,12px);min-width:0}
html[data-theme] .field-picker .account-picker-current{color:var(--muted)}
html[data-theme] .field-picker .account-picker-option[aria-selected=true]{background:color-mix(in srgb,var(--reference-blue,var(--brand)) 13%,var(--surface))}
.field-picker [hidden]{display:none!important}
.field-picker .account-picker-search{flex:none;width:calc(100% - 12px);margin:0 6px 6px;min-height:44px;font-size:16px}
.account-picker-empty{margin:4px 12px 12px;color:var(--muted);font-size:var(--text-sm)}
html[data-theme] .field-picker .account-picker-panel[data-sheet=true]{inset:auto 0 var(--ap-keyboard,0px);width:100%;max-height:var(--ap-sheet-height,min(68dvh,560px));border-radius:24px 24px 0 0;padding:8px 12px max(12px,env(safe-area-inset-bottom))}
.field-picker .account-picker-panel[data-sheet=true]::backdrop{background:#101a3152}
.account-sort .field-picker{width:auto;max-width:78%}
.sort-control .field-picker{height:100%}
#transaction-form label>.account-picker,#receipt-workspace-form label>.account-picker{display:flex;width:100%}

/* Categories use the existing expandable rows as the labelled legend. */
.stats-category-card-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px;flex-wrap:wrap}
.stats-category-period-label{font-size:var(--text-sm);color:var(--muted)}
.stats-category-period{display:flex;gap:3px;padding:3px;border:1px solid var(--border);border-radius:var(--radius-pill);background:var(--subtle)}
.stats-category-period button{min-height:38px;padding:7px 14px;border:0;border-radius:var(--radius-pill);background:none;color:var(--muted);font:inherit;font-size:var(--text-sm);white-space:nowrap;cursor:pointer}
.stats-category-period button[aria-pressed=true]{background:var(--surface);color:var(--text);box-shadow:0 1px 3px #0001}
html[data-theme] .stats-allocation-summary.category-ring-summary{padding:12px 0 6px;border:0;background:none;display:grid;justify-items:center;gap:6px}
.category-ring{position:relative;width:min(100%,244px);aspect-ratio:1;display:grid;place-items:center;margin:0 auto}
.category-ring svg{display:block;width:100%;height:100%;overflow:visible}
.category-ring-track{fill:none;stroke:var(--subtle);stroke-width:24}
.category-ring-arc{cursor:pointer;transition:opacity var(--motion-fast)}
.category-ring-center{position:absolute;inset:26%;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;pointer-events:none;gap:4px}
.category-ring-center>[data-story-center-label]{font-size:var(--text-xs);color:var(--muted);line-height:1.3;max-width:100%;overflow-wrap:break-word}
.category-ring-center>[data-story-center-amount]{font-size:clamp(16px,5vw,23px);font-weight:650;line-height:1.3;letter-spacing:-.5px;max-width:100%}
.category-ring-center .report-amount{white-space:nowrap}
.category-ring-summary>.small{margin:0;color:var(--muted);font-size:var(--text-xs)}
html[data-theme] .report-allocation:has(.category-ring-summary){display:grid;grid-template-columns:minmax(0,1fr);gap:8px}
.report-allocation:has(.category-ring-summary) .share-rows{margin-top:0}
.report-allocation:has(.category-ring-summary) .share-row-toggle{padding-block:12px}
.report-allocation:has(.category-ring-summary) .sr-bar{display:none}
.report-allocation:has(.category-ring-summary) .sr-line{gap:12px}
.report-allocation:has(.category-ring-summary) .sr-meta{margin-top:4px}
.category-ring-summary:has([data-wide-center=true]) .category-ring-center>[data-story-center-amount]{font-size:16px;letter-spacing:-.6px}
@media(prefers-reduced-motion:reduce){.category-ring-arc{transition:none}}

@media(hover:hover) and (pointer:fine){html[data-theme] .account-picker-option:hover{background:var(--subtle)}}
html[data-theme] #app .report-allocation:has(.category-ring-summary) .sr-bar{display:none}
#app[data-route=stats] .stats-allocation-summary.category-ring-summary{margin:0;padding:8px 0 4px;gap:0}
#app[data-route=stats] .category-ring{width:min(100%,210px)}
#app[data-route=stats] .category-ring-arc{stroke-linecap:butt}
#app[data-route=stats] .report-allocation.has-active-slice .category-ring-arc:not(.is-active-slice){opacity:.3}
html[data-theme] #app .report-allocation:has(.category-ring-summary) .share-row-toggle{grid-template-columns:minmax(0,1fr) auto auto;gap:4px 10px;padding-block:12px}
html[data-theme] #app .report-allocation:has(.category-ring-summary) .share-row .sr-line{display:contents}
html[data-theme] #app .report-allocation:has(.category-ring-summary) .sr-name{grid-column:1;grid-row:1;white-space:normal;overflow-wrap:break-word;text-overflow:clip}
html[data-theme] #app .report-allocation:has(.category-ring-summary) .sr-amount{grid-column:2;grid-row:1;white-space:nowrap}
html[data-theme] #app .report-allocation:has(.category-ring-summary) .sr-meta>span:last-child{grid-column:3;grid-row:1;text-align:right;min-width:40px;white-space:nowrap}
html[data-theme] #app .report-allocation:has(.category-ring-summary) .sr-meta>span:first-child{grid-column:1/-1;grid-row:2}

/* Rounded sector corners preserve each category's angle without overlapping small slices. */
#app[data-route=stats] .category-ring-arc{stroke:none;fill-rule:evenodd}
#app[data-route=stats] .category-ring-arc:focus-visible{outline:none;stroke:var(--text);stroke-width:2;stroke-linejoin:round;vector-effect:non-scaling-stroke}

@keyframes category-ring-enter{from{opacity:.6;transform:rotate(-5deg)}to{opacity:1;transform:rotate(0deg)}}
#app[data-route=stats] .category-ring svg{animation:category-ring-enter var(--motion-move) var(--motion-ease) both}
@media(prefers-reduced-motion:reduce){#app[data-route=stats] .category-ring svg{animation:none}}

.stats-category-period-label{display:inline-flex;align-items:center;gap:6px;min-height:44px;padding:0;border:0;background:none;text-align:left}
.stats-category-period-label .icon{width:16px;height:16px}

/* Keep very large rupee amounts whole without squeezing the category into a sliver. */
.category-ring-center{inset:19%}
#app[data-route=stats] .category-ring-center[data-wide-center=true]>[data-story-center-amount]{font-size:12px;letter-spacing:-.4px}
html[data-theme] #app .report-allocation:has(.category-ring-summary) .share-row-toggle[data-wide-amount=true] .sr-name{grid-column:1/-1;grid-row:1}
html[data-theme] #app .report-allocation:has(.category-ring-summary) .share-row-toggle[data-wide-amount=true] .sr-amount{grid-column:1/3;grid-row:2}
html[data-theme] #app .report-allocation:has(.category-ring-summary) .share-row-toggle[data-wide-amount=true] .sr-meta>span:last-child{grid-row:2}
html[data-theme] #app .report-allocation:has(.category-ring-summary) .share-row-toggle[data-wide-amount=true] .sr-meta>span:first-child{grid-row:3}

.stats-analyzer-filters{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;margin-bottom:8px}
.stats-analyzer-filters .text-button{display:inline-flex;align-items:center;gap:6px;min-height:44px}
.stats-analyzer-filters .icon{width:16px;height:16px}

.stats-analyzer-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:4px 12px;margin-bottom:8px}
.stats-analyzer-toolbar :is(.stats-category-card-head,.stats-analyzer-filters){flex:1 1 auto;margin-bottom:0}
.stats-analyzer-toolbar .stats-analyzer-filters{gap:4px 12px;justify-content:flex-end}
.stats-analyzer-toolbar .stats-analyzer-filters:has([data-action=story-reset]){justify-content:space-between}

/* SVG paths keep their contour on focus, including browsers that draw tap outlines. */
#app[data-route=stats] :is(.category-ring-arc,.group-chart-shape,.story-arc){
 outline:none!important;box-shadow:none!important;-webkit-tap-highlight-color:transparent
}
#app[data-route=stats] :is(.category-ring-arc,.group-chart-shape,.story-arc):focus-visible{animation:none}
#app[data-route=stats] .story-arc:focus-visible{stroke:var(--text);stroke-width:2;vector-effect:non-scaling-stroke}
@media(forced-colors:active){
 #app[data-route=stats] :is(.category-ring-arc,.group-chart-shape,.story-arc):focus-visible{stroke:Highlight}
}

#app[data-route=stats] .category-ring-summary .group-chart-switch{justify-self:center;margin-bottom:8px}
#app[data-route=stats] .category-ring-summary [hidden]{display:none}
.category-chart-bars{display:grid;width:min(100%,420px);gap:4px;margin:0 auto 10px}
.category-chart-bars button{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px 8px;text-align:left;min-height:44px;padding:6px 8px;border-radius:var(--radius-xs);font-size:var(--text-sm);overflow-wrap:anywhere}
.category-chart-bars button.is-active-slice{background:var(--subtle)}
.category-chart-bars svg{grid-column:1/-1;width:100%;height:7px}

#app[data-route=stats] .sov-period{display:flex;justify-content:space-between;align-items:center;gap:8px;color:var(--muted);font-size:var(--text-sm)}
#app[data-route=stats] .sov-period .stats-category-period{border-radius:12px}
#app[data-route=stats] .sov-period .stats-category-period button{border-radius:9px;min-height:36px}
#app[data-route=stats] .sov-period button[aria-pressed=true]{background:var(--sw-thumb);color:var(--sw-active-text)}
#app[data-route=stats] .stats-studio .stats-analyzer.sov-analyzer{--sov-home:#4f74a8;--sov-food:#568a75;--sov-shop:#bb8154;--sov-transport:#8572aa;--sov-other:#8c939a;display:flex;flex-direction:column;position:relative;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none;overflow:visible}
#app[data-route=stats] .sov-analyzer .section-heading{display:grid;gap:8px;margin:0 0 8px}
#app[data-route=stats] .sov-analyzer .section-heading h2{display:flex;align-items:center;min-height:44px;font-size:var(--text-lg)}
#app[data-route=stats] .sov-analyzer:has([data-group-stacked]) .section-heading h2{padding-inline-end:112px}
#app[data-route=stats] .sov-analyzer .stats-analyzer-toolbar:empty{display:none}
#app[data-route=stats] .sov-analyzer .report-breakdown{display:contents}
#app[data-route=stats] .sov-analyzer .sov-scope-options{order:3;margin-top:4px;color:var(--muted);font-size:var(--text-xs)}
#app[data-route=stats] .sov-scope-options summary{padding:8px 0;min-height:36px;cursor:pointer}
#app[data-route=stats] .sov-analyzer :is(.report-breakdown-layout,.story-breakdown-layout){display:grid;grid-template-columns:minmax(0,1fr);gap:8px}
#app[data-route=stats] .sov-analyzer [data-group-stacked]{padding:0;border:0;border-radius:0;background:none}
#app[data-route=stats] .sov-analyzer [data-group-stacked] .group-chart-head{position:absolute;inset:0 0 auto auto}
#app[data-route=stats] .sov-analyzer [data-group-stacked] .group-chart-switch button{min-height:36px;min-width:44px;padding-inline:8px}
#app[data-route=stats] [data-group-stacked] .group-chart-visual{position:relative;width:100%;margin:0}
#app[data-route=stats] [data-group-stacked] .group-chart-plot{display:block;width:100%;height:auto;margin:0}
#app[data-route=stats] [data-group-stacked][data-group-mode=bar] .group-chart-plot{border-radius:7px;overflow:hidden}
#app[data-route=stats] [data-group-stacked][data-group-mode=bar] .group-chart-reading,#app[data-route=stats] [data-group-stacked] .group-chart-note{display:none}
#app[data-route=stats] [data-group-stacked][data-group-mode=pie] .group-chart-reading{position:absolute;inset:25%;display:flex;justify-content:center;align-items:center;text-align:center;pointer-events:none}
#app[data-route=stats] [data-group-stacked] .group-chart-shape:not(.is-active-slice){transition:opacity var(--motion-fast)}
#app[data-route=stats] .sov-analyzer .has-active-slice .group-chart-shape:not(.is-active-slice){opacity:.3}
#app[data-route=stats] .sov-analyzer :is(.share-rows,.story-groups){margin:0;padding:0;border:0;background:none}
html[data-theme] #app .sov-analyzer .share-row-toggle,#app[data-route=stats] .sov-analyzer .story-group{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 10px;padding:8px 2px;min-height:50px;border:0;background:none}
html[data-theme] #app .sov-analyzer .share-row .sr-line{display:contents}
#app[data-route=stats] .sov-analyzer .sr-name{grid-column:1;grid-row:1/3;white-space:normal;overflow-wrap:anywhere;display:flex;align-items:center;gap:8px}
#app[data-route=stats] .sov-analyzer .sr-amount{grid-column:2;grid-row:1;text-align:right;white-space:nowrap}
#app[data-route=stats] .sov-analyzer .sr-meta>span{grid-column:2;grid-row:2;text-align:right;color:var(--muted)}
#app[data-route=stats] .sov-analyzer :is(.sr-bar,.story-person-bar,.story-group-name small){display:none}
#app[data-route=stats] .sov-analyzer .story-group{grid-template-columns:32px minmax(0,1fr) auto;text-align:left}
#app[data-route=stats] .sov-analyzer .story-group-value{text-align:right}
#app[data-route=stats] .sov-analyzer :is(.share-row,.story-groups>li){border-bottom:1px solid var(--divider)}
.sov-kind-icon{display:grid;place-items:center;position:relative;width:32px;height:32px;flex:none;border-radius:8px;overflow:hidden}
.sov-kind-icon .sov-kind-tint{position:absolute;inset:0;width:100%;height:100%;opacity:.2}
.sov-kind-icon .icon{position:relative;width:16px;height:16px}
.sov-transactions{order:2;display:flex;justify-content:space-between;align-items:center;gap:8px;width:100%;min-height:48px;padding:7px 10px;margin-top:8px;text-align:left;border:1px solid var(--divider);border-radius:11px;background:var(--surface)}
.sov-transactions span{display:grid}
.sov-transactions small{font-size:var(--text-xs);color:var(--muted)}

html:is([data-theme=dark],[data-theme=grey-glass]) #app[data-route=stats] .stats-studio .stats-analyzer.sov-analyzer{--sov-home:#82a6d8;--sov-food:#83b6a0;--sov-shop:#d7a47b;--sov-transport:#ac99ca;--sov-other:#a5aeb6}

html[data-theme] #app[data-route=stats] .stats-studio[data-stats-view=overview]>.stats-hero{padding:0 0 14px;border:0;border-bottom:1px solid var(--divider);border-radius:0;background:none}
/* Category glyph tiles: the category's icon on a soft tile tinted by its top group (Home rows use the same hues).
   Rounded rectangle like every other control. A short tilt confirms the press. */
.glyph-tile[data-hue="0"]{--glyph-hue:var(--chart-2)}.glyph-tile[data-hue="1"]{--glyph-hue:var(--chart-3)}.glyph-tile[data-hue="2"]{--glyph-hue:var(--chart-4)}.glyph-tile[data-hue="3"]{--glyph-hue:var(--chart-5)}
.glyph-tile[data-hue="4"]{--glyph-hue:var(--chart-6)}.glyph-tile[data-hue="5"]{--glyph-hue:var(--chart-7)}.glyph-tile[data-hue="6"]{--glyph-hue:var(--chart-8)}.glyph-tile[data-hue="7"]{--glyph-hue:var(--chart-9)}
html[data-theme] #app .glyph-tile,html[data-theme] dialog .glyph-tile{--glyph-tint:18%;--glyph-ink:72%;display:grid;place-items:center;flex:none;border-radius:var(--radius-sm,12px);background:color-mix(in srgb,var(--glyph-hue,var(--muted)) var(--glyph-tint),var(--surface));color:color-mix(in srgb,var(--glyph-hue,var(--muted)) var(--glyph-ink),var(--text))}
html[data-theme=dark] :is(#app,dialog) .glyph-tile{--glyph-tint:24%;--glyph-ink:100%}
html[data-theme=grey-glass] :is(#app,dialog) .glyph-tile{--glyph-tint:28%;--glyph-ink:100%}
html[data-theme] :is(#app,dialog) .quick-category .glyph-tile{width:36px;height:36px;border-radius:11px}
html[data-theme] :is(#app,dialog) .quick-category .glyph-tile .icon{width:18px;height:18px}
html[data-theme] :is(#app,dialog) .quick-category-more>span{border-radius:9px}
html[data-theme] #transaction-form:not(.te-ready) #quick-categories-slot .quick-category .glyph-tile{width:30px;height:30px;border-radius:9px}
html[data-theme] #transaction-form:not(.te-ready) #quick-categories-slot .quick-category .glyph-tile .icon{width:16px;height:16px}
html[data-theme] :is(#app,dialog) .chooser-tile .glyph-tile{width:44px;height:44px;border-radius:13px}
html[data-theme] :is(#app,dialog) .chooser-tile .glyph-tile .icon{width:22px;height:22px}
html[data-theme] :is(#app,dialog) .chooser-tile{background:var(--surface)}
html[data-theme] :is(#app,dialog) .chooser-chip .glyph-tile{width:24px;height:24px;border-radius:7px}
html[data-theme] :is(#app,dialog) .chooser-chip .glyph-tile .icon{width:14px;height:14px}
html[data-theme] :is(#app,dialog) .chooser-chip{border-radius:var(--radius-control,12px)}
html[data-theme] :is(#app,dialog) .chooser-row-icon.glyph-tile{width:32px;height:32px}
html[data-theme] :is(#app,dialog) .category-trigger-icon.glyph-tile{width:28px;height:28px;border-radius:9px}
html[data-theme] :is(#app,dialog) .category-trigger-icon.glyph-tile .icon{width:16px;height:16px}
@media (prefers-reduced-motion:no-preference){
 html[data-theme] :is(#app,dialog) .glyph-tile{transition:transform var(--motion-press) var(--motion-ease)}
 html[data-theme] :is(#app,dialog) :is(.quick-category,.chooser-tile,.chooser-chip,.chooser-select):active .glyph-tile{transform:rotate(-6deg) scale(1.06)}
}
