:root {
  color-scheme: light;
  --canvas: #fff;
  --ink: #273238;
  --deep: #171c1b;
  --muted: #555d63;
  --forest: #4f6c52;
  --positive: #2e6b35;
  --negative: #b72436;
  --voice-accent: #155e59;
  --selected: #f1f2f3;
  --sage: #b2ccae;
  --blue: #c9e1ee;
  --sand: #f8dfbc;
  --mauve: #decbe3;
  --green: #d4e3c8;
  --teal: #b6ded9;
  --periwinkle: #ced4f1;
  --slate: #c5d0dd;
  --rose: #f1ccd5;
  --stone: #dfd9d0;
  --text-secondary: .875rem;
  --ease: cubic-bezier(.2, .72, .24, 1);
  --ease-settle: cubic-bezier(.22, .9, .26, 1);
  --ease-exit: cubic-bezier(.42, 0, .72, .5);
  --motion-quick: 170ms;
  --motion-select: 260ms;
  --motion-present: 330ms;
  --motion-dismiss: 215ms;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
  background: var(--canvas);
  color: var(--deep);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body, h1, h2, h3, p, ul, fieldset { margin: 0; }
ul { padding: 0; list-style: none; }
button, input, select { font: inherit; color: inherit; }
button { touch-action: manipulation; cursor: pointer; border: 0; background: none; padding: 0; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--forest); outline-offset: 3px; }
.svg-library { position: absolute; width: 0; height: 0; }
.icon { display: inline-block; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.positive, .direction-in { color: var(--positive); }
.negative, .direction-out { color: var(--negative); }

.app {
  --side: 16px;
  --dock-gap: 10px;
  --dock-action-size: 56px;
  --dock-inset: calc(10px + env(safe-area-inset-bottom, 0px));
  --top-inset: env(safe-area-inset-top, 0px);
  --bottom-inset: env(safe-area-inset-bottom, 0px);
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--canvas);
  container-type: inline-size;
}
.screen-viewport {
  --top-fade: 16px;
  --bottom-fade: calc(var(--dock-inset) + 68px);
  position: absolute;
  inset: var(--top-inset) 0 0;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 var(--top-fade), #000 calc(100% - var(--bottom-fade)), transparent calc(100% - var(--dock-inset) - 17px));
  mask-image: linear-gradient(to bottom, transparent, #000 var(--top-fade), #000 calc(100% - var(--bottom-fade)), transparent calc(100% - var(--dock-inset) - 17px));
}
.screen {
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  padding: var(--top-fade) var(--side) calc(var(--dock-inset) + 79px);
  scroll-padding-block: var(--top-fade) var(--bottom-fade);
}
.screen::-webkit-scrollbar { display: none; }
.system-top, .system-bottom, .review { display: none; }

.app-header { display: flex; justify-content: space-between; align-items: flex-start; min-height: 56px; padding: 0 5px; }
.app-header h1 { font-size: 1.875rem; line-height: 1.06; font-weight: 750; letter-spacing: -.042em; }
.home-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  gap: clamp(4px, 1.35cqw, 6px);
  align-items: center;
  min-height: 56px;
  padding-inline: 3px;
}
.home-avatar, .home-assistant { display: grid; place-items: center; border-radius: 50%; }
.home-avatar { width: 51px; height: 51px; overflow: hidden; background: #e5ede7; }
.home-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; transform: translateY(2px) scale(1.25); }
.home-greeting { min-width: 0; }
.home-greeting p { color: #414b50; font-size: .8125rem; line-height: 1.25; }
.home-greeting h1 {
  margin-top: 2px;
  overflow-wrap: break-word;
  font-size: 1.125rem;
  font-weight: 750;
  line-height: 1.16;
  letter-spacing: -.025em;
}
.home-account {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 9px;
  border-radius: 99px;
  color: var(--muted);
  font-size: .8125rem;
  white-space: nowrap;
}
.home-assistant { width: 36px; height: 36px; color: var(--muted); opacity: .65; }
.home-assistant .icon { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.theme-toggle { display: grid; place-items: center; width: 44px; min-height: 44px; border-radius: 50%; color: var(--muted); }
.theme-toggle .icon { width: 16px; height: 16px; stroke-width: 1.6; }
.theme-toggle:active { background: var(--selected); }
@media (hover: hover) {
  .theme-toggle:hover { background: var(--selected); color: var(--deep); }
}

.balances { position: relative; margin-top: 23px; text-align: center; }
.balance-primary { display: grid; justify-items: center; align-content: center; min-height: 100px; }
.balance-label { color: var(--muted); font-size: 1rem; font-weight: 550; line-height: 1.24; }
.balance-amount, .balance-secondary strong {
  font-weight: 600;
  letter-spacing: -.045em;
}
.balance-amount { display: block; margin-top: 8px; font-size: clamp(1.75rem, 9.5cqw, 2.375rem); line-height: 1.04; white-space: nowrap; }
.currency { margin-top: 4px; color: var(--muted); font-size: .875rem; line-height: 1.23; }
.icon-button { width: 44px; height: 44px; display: inline-grid; place-items: center; }
.balance-label { max-inline-size: calc(100% - 176px); }
.balance-actions { position: absolute; top: -1px; inset-inline-end: 0; display: flex; color: var(--muted); }
.balance-actions .icon-button { border-radius: 50%; }
.balance-actions .icon-button:active { background: var(--selected); }
.balance-actions .icon { width: 20px; height: 20px; }
.balance-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; min-height: 50px; gap: 8px; margin-top: 6px; }
.balance-row { position: relative; }
.period-holder { min-width: 0; }
.period-button { display: inline-flex; max-width: 100%; min-height: 44px; align-items: center; gap: 4px; color: var(--deep); text-align: left; padding-inline: 10px; border-radius: 99px; }
.period-button, .chart-actions button { font-size: .9rem; font-weight: 650; }
.period-button .icon { width: 15px; height: 15px; }
.period-list {
  position: absolute;
  z-index: 3;
  inset-block-start: calc(100% + 2px);
  inset-inline-start: 50%;
  transform: translateX(-50%);
  width: min(248px, 100%);
  padding: 1px 12px 9px;
  border: 1px solid #d8ddda99;
  border-radius: 24px;
  background: #fcfcfc;
  box-shadow: 0 3px 8px #161e1910, 0 16px 36px #161e191c, inset 0 1px 0 #fff;
}
@supports (backdrop-filter: blur(16px)) or (-webkit-backdrop-filter: blur(16px)) {
  .period-list { background: #fcfcfcfa; -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); }
}
.month-picker-header { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; min-height: 45px; }
.month-picker-header > span { grid-column: 2; text-align: center; color: var(--muted); font-size: .8125rem; font-weight: 600; }
.month-picker-header button { grid-column: 3; justify-self: end; min-height: 44px; padding-inline: 6px; border-radius: 10px; color: var(--positive); font-size: .875rem; font-weight: 650; }
.month-picker-header button:active { opacity: .6; }
.month-wheel { --month-row: max(42px, 2.5rem); --wheel-height: calc(var(--month-row) * 4); position: relative; }
.month-wheel::before { content: ""; position: absolute; inset: 50% 3px auto; height: var(--month-row); transform: translateY(-50%); border-radius: 9px; background: #71717c16; pointer-events: none; }
.month-options { position: relative; height: var(--wheel-height); padding-block: calc((var(--wheel-height) - var(--month-row)) / 2); border-radius: 9px; overflow-y: auto; overscroll-behavior: contain; scroll-snap-type: y mandatory; scrollbar-width: none; mask-image: linear-gradient(transparent, #000 35%, #000 65%, transparent); }
.month-options::-webkit-scrollbar { display: none; }
.month-wheel:has(.month-options:focus-visible) { outline: 2px solid var(--forest); outline-offset: 2px; border-radius: 10px; }
.month-option { display: grid; place-items: center; height: var(--month-row); padding-inline: 5px; color: var(--muted); font-size: 1.0625rem; line-height: 1.15; letter-spacing: -.02em; cursor: pointer; scroll-snap-align: center; }
.month-option[data-selected] { color: var(--deep); font-weight: 650; }
@media (prefers-reduced-motion: no-preference) {
  .month-option > span { transition: transform var(--motion-quick) var(--ease-settle); }
  .month-option[data-wheel-neighbor="before"] > span { transform: perspective(170px) rotateX(22deg) scale(.94); }
  .month-option[data-wheel-neighbor="after"] > span { transform: perspective(170px) rotateX(-22deg) scale(.94); }
}
.balance-secondary {
  padding: 6px 11px;
  border-radius: 99px;
  font-size: .9375rem;
  line-height: 1.2;
  white-space: nowrap;
}
.balance-secondary.glass { border-color: #e3eae5; box-shadow: 0 2px 6px #17202212, inset 0 1px 3px #fff; }
.balance-secondary strong { display: inline-block; font-size: inherit; }
.swap { position: relative; flex: none; isolation: isolate; }
.swap::before { content: ""; position: absolute; z-index: -1; inset: 6px; border-radius: 50%; background: var(--selected); }
.swap .icon { width: 20px; height: 20px; stroke-width: 2; }

.chart { margin-top: 24px; --curve: 16px; }
.chart-tabs { position: relative; isolation: isolate; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow-x: clip; }
.chart-tabs button { position: relative; display: grid; align-content: center; gap: 5px; min-height: 74px; padding: 8px 14px; border-radius: var(--curve) var(--curve) 0 0; text-align: left; }
.chart-tabs button:focus-visible { outline-offset: -3px; }
.chart-tabs button > span { display: flex; align-items: center; gap: 6px; font-size: .9375rem; line-height: 1.2; }
.chart-tabs .icon { width: 20px; height: 20px; stroke-width: 2.15; }
.chart-tabs strong { font-size: clamp(1rem, 5.25cqw, 1.3rem); font-weight: 750; letter-spacing: -.035em; }
.chart-tabs button[aria-pressed="true"] > span { font-weight: 700; }
.chart-selection {
  position: absolute;
  z-index: -1;
  inset: 0 auto 0 0;
  width: 50%;
  border-radius: var(--curve) var(--curve) 0 0;
  background: var(--chart-surface, var(--selected));
  pointer-events: none;
  transition: transform var(--motion-select) var(--ease-settle);
}
.chart[data-selected="expenses"] .chart-selection { transform: translateX(100%); }
.chart-selection::before, .chart-selection::after {
  position: absolute;
  inset-block-end: 0;
  width: var(--curve);
  height: var(--curve);
  content: "";
  opacity: 0;
  transition: opacity var(--motion-quick) ease-out;
}
.chart-selection::before {
  right: 100%;
  background: radial-gradient(circle at 0 0, transparent calc(var(--curve) - .55px), var(--chart-surface, var(--selected)) var(--curve));
}
.chart-selection::after {
  left: 100%;
  background: radial-gradient(circle at 100% 0, transparent calc(var(--curve) - .55px), var(--chart-surface, var(--selected)) var(--curve));
}
.chart[data-selected="expenses"] .chart-selection::before, .chart[data-selected="income"] .chart-selection::after { opacity: 1; }
.chart-content { padding: 9px 8px 12px; border-radius: var(--curve) 0 var(--curve) var(--curve); background: var(--chart-surface, var(--selected)); transition: border-radius var(--motion-select) var(--ease-settle); }
.chart[data-selected="income"] .chart-content { border-top-left-radius: 0; border-top-right-radius: var(--curve); }
.chart-content h2 { margin-inline: 7px; font-size: 1.3rem; line-height: 1.14; font-weight: 750; letter-spacing: -.027em; }
.chart-heading { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; min-height: 30px; }
.chart-help-button { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; }
.chart-help-button span { display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid currentColor; border-radius: 50%; color: var(--muted); font-size: .75rem; font-weight: 700; line-height: 1; }
.chart-help-button[aria-expanded="true"] span { background: #fff; }
.chart-legend { position: absolute; inset-inline-end: 6px; top: calc(100% - 5px); width: min(11.5rem, calc(100% - 12px)); padding: 8px 10px; border: 1px solid #d9dfdc; border-radius: 10px; background: #fff; box-shadow: 0 4px 12px #18252219; font-size: .8125rem; line-height: 1.35; }
.chart-legend p { display: flex; align-items: center; gap: 7px; }
.chart-legend :is(p + p, div + p) { margin-top: 4px; }
.chart-legend i { flex: 0 0 13px; height: 10px; border-radius: 3px; }
.chart-replay {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
  border-top: 1px solid color-mix(in srgb, currentColor 14%, transparent);
  color: inherit;
  font-weight: 700;
  text-align: start;
}
.legend-outline { border: 1px solid color-mix(in srgb, var(--sage) 76%, currentColor); }
.legend-fill { background: var(--sage); }
.legend-available { background: #f1f2f3; }
.chart[data-selected="expenses"] .tiles { margin-top: 5px; }
.chart[data-selected="income"] .tiles { margin-top: 6px; }
.chart-content > .empty { margin: 8px 7px 4px; }

.tiles {
  --tile-gap: 5px;
  --tile-side-space: max(144px, 9rem);
  display: grid;
  grid-template-columns: min(57%, max(50%, calc(100% - var(--tile-side-space)))) minmax(0, 1fr);
  grid-template-rows: minmax(0, 82fr) minmax(0, 68fr) minmax(0, 58fr);
  gap: var(--tile-gap);
  block-size: max(218px, 13.625rem);
}
.tiles[data-count="3"] {
  grid-template-rows: minmax(0, 80fr) minmax(0, 62fr);
  block-size: max(147px, 9.1875rem);
}
.tiles[data-count="2"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  block-size: max(112px, 7rem);
}
.tiles[data-count="1"] {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  block-size: max(108px, 6.75rem);
}
.tile { position: relative; z-index: 0; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 3px; padding: 4px clamp(5px, 2.2cqw, 12px); overflow: hidden; border: 1px solid var(--fill-color); border-radius: 9px; background: var(--fill-color); }
.tile::before { content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none; }
.tile-link { position: absolute; inset: 0; width: 100%; border-radius: inherit; }
.tile-link:focus-visible { outline-offset: -3px; }
.tile-link:active { background: #ffffff24; }
@media (hover: hover) {
  .tile-link:hover { background: #ffffff16; }
}
.tiles.expenses .tile {
  border-color: var(--fill-color);
  border-color: color-mix(in srgb, var(--fill-color) 76%, currentColor);
  background: #fcfdfd;
}
.tiles.expenses:not([data-count="2"]) .tile:not(:first-child) { padding-inline: clamp(4px, 1.5cqw, 6px); }
.tiles.expenses .tile::before { top: auto; height: var(--fill, 0%); background: var(--fill-color); }
.tiles.expenses .tile[data-budget]::before {
  box-shadow: inset 0 1px color-mix(in srgb, var(--fill-color) 73%, #192b2d);
}
@keyframes budget-fill {
  from { height: var(--fill-start, 0%); }
}
@media (prefers-reduced-motion: no-preference) {
  .tiles.expenses[data-intro-pending] .tile::before { height: 0; }
  .tiles.expenses .tile[data-fill-update]::before {
    --fill-start: var(--previous-fill);
    animation: budget-fill 430ms var(--ease) var(--motion-dismiss) backwards;
  }
  .tiles.expenses.introducing .tile[data-budget]::before {
    --fill-start: 0%;
    animation: budget-fill 540ms var(--ease);
  }
}
.tiles .tile:first-child { grid-row: 1 / -1; }
.tile-figure { display: contents; }
.tile-label { display: flex; align-items: center; gap: 5px; font-size: .78125rem; line-height: 1.2; font-weight: 550; }
.tile-label > span { overflow-wrap: normal; word-break: normal; }
.tile:not(:first-child) .tile-label { font-size: .75rem; }
.tile-label .icon { flex-shrink: 0; }
.tile-label .icon { width: 16px; height: 16px; }
.tile-amount { font-size: clamp(.96rem, 5.4cqw, 1.3rem); line-height: 1; font-weight: 750; letter-spacing: -.036em; white-space: nowrap; }
.tiles:is([data-count="3"], [data-count="4"]) .tile:first-child { gap: 6px; padding: 10px; }
.tiles:is([data-count="3"], [data-count="4"]) .tile:first-child .tile-label { font-size: .875rem; font-weight: 650; }
.tiles:is([data-count="3"], [data-count="4"]) .tile:first-child .icon { width: 27px; height: 27px; }
.tiles:is([data-count="3"], [data-count="4"]) .tile:first-child .tile-amount { font-size: clamp(1.55rem, 8.5cqw, 2.05rem); }
.tiles.expenses:is([data-count="3"], [data-count="4"]) .tile:first-child { justify-content: flex-end; padding-block-end: clamp(16px, 5.4cqw, 23px); }
.tiles.expenses[data-count="1"] .tile { min-height: 68px; justify-content: flex-end; padding: 7px 13px 10px; }
.tiles.income:is([data-count="3"], [data-count="4"]) .tile:first-child .tile-label { flex-direction: column; align-items: flex-start; gap: 9px; }
.tiles.income[data-count="1"] .tile { align-items: flex-start; padding-inline: 10px; }
.tiles.income[data-count="1"] .tile-label, .tiles.income[data-count="2"] .tile-label { font-size: .9375rem; }
.tiles.income[data-count="1"] .tile-label .icon { width: 23px; height: 23px; }
.tiles.income[data-count="1"] .tile-amount { font-size: 1.5rem; }
.tiles[data-count="2"] .tile { padding-inline: 8px; }
.tiles[data-count="2"] .tile .tile-label { gap: 4px; font-size: min(.8125rem, 4cqw); }
.tiles[data-count="2"] .tile .tile-label .icon { width: 14px; height: 14px; }
.tiles[data-count="2"] .tile .tile-amount { font-size: clamp(1rem, 5.4cqw, 1.35rem); }
@container (width < 22rem) {
  .tiles[data-count="2"] .tile-label { flex-wrap: wrap; }
}

:is(.tile, .quick-category, .transaction-icon)[data-tone="sage"] { --fill-color: var(--sage); }
:is(.tile, .quick-category, .transaction-icon)[data-tone="blue"] { --fill-color: var(--blue); }
:is(.tile, .quick-category, .transaction-icon)[data-tone="sand"] { --fill-color: var(--sand); }
:is(.tile, .quick-category, .transaction-icon)[data-tone="mauve"] { --fill-color: var(--mauve); }
:is(.tile, .quick-category, .transaction-icon)[data-tone="green"] { --fill-color: var(--green); }
[data-tone="teal"] { --fill-color: var(--teal); --product-tone: var(--teal); }
[data-tone="periwinkle"] { --fill-color: var(--periwinkle); --product-tone: var(--periwinkle); }
[data-tone="slate"] { --fill-color: var(--slate); --product-tone: var(--slate); }
[data-tone="rose"] { --fill-color: var(--rose); --product-tone: var(--rose); }
[data-tone="stone"] { --fill-color: var(--stone); --product-tone: var(--stone); }

.empty { margin: 15px 6px; color: var(--muted); line-height: 1.45; }
.secondary-view { padding-top: 7px; }

.transactions {
  --history-chip: #f1f3f2;
  --history-line: #27323818;
  --history-edge: #2732381f;
  --history-filter-active: #e5efe4;
  --history-filter-border: #64866b80;
  --history-filter-ink: #2e5a3b;
  --history-segment-track: #4d665314;
  --history-segment-selection: #fbfdfb;
  --history-segment-shadow: 0 1px 4px #2c473621, inset 0 1px #fff;
}
.transactions-header { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 8px; }
.transactions-header h1 { font-size: 1.25rem; font-weight: 700; text-align: center; letter-spacing: -.025em; overflow-wrap: anywhere; }
.history-icon-button { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; }
.history-icon-button .icon { width: 21px; height: 21px; }
.history-controls {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 3px;
  margin-top: 7px;
  padding: 4px 6px 6px;
  border-radius: 22px;
}
.history-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; column-gap: 8px; }
.history-period { position: relative; min-width: 0; max-width: 100%; }
.history-toolbar .period-list { inset-inline-start: 0; transform: none; width: min(248px, calc(100cqw - 32px)); }
.history-filter-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  margin-inline-start: auto;
  padding-inline: 8px;
  border-radius: 16px;
  color: var(--history-filter-ink);
  font-size: .875rem;
  font-weight: 650;
}
.history-filter-toggle[aria-expanded="true"] { background: var(--history-filter-active); }
.history-filter-count {
  min-width: 1.35em;
  padding: .1em .22em;
  border-radius: 99px;
  background: var(--history-filter-active);
  font-size: .78em;
  text-align: center;
}
.history-month-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-top: 5px;
}
.history-month-steps button {
  min-height: 44px;
  padding: 4px;
  border-radius: 9px;
  background: var(--selected);
  font-size: .8125rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.history-month-steps button:disabled { opacity: .45; cursor: default; }
.history-month-button { display: flex; justify-content: center; align-items: center; gap: 4px; min-height: 40px; border-radius: 12px; font-size: 1rem; font-weight: 660; }
.history-month-button .icon { width: 15px; height: 15px; }
.history-filters { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
.history-filter { display: grid; grid-template-columns: minmax(0, 1fr) auto; flex: 1 0 auto; width: max-content; max-width: 100%; min-width: 0; min-height: 44px; border-radius: 24px; box-shadow: inset 0 0 0 1px var(--history-edge); background: var(--history-chip); }
.history-filter.is-active { box-shadow: inset 0 0 0 1px var(--history-filter-border); background: var(--history-filter-active); color: var(--history-filter-ink); }
.history-filter-picker { position: relative; display: flex; flex: 1 1 auto; min-width: 0; justify-content: center; align-items: center; gap: 4px; padding: 6px 5px; text-align: center; font-size: .875rem; line-height: 1.3; }
.history-filter-picker:focus-within { outline: 2px solid var(--positive); outline-offset: 2px; border-radius: inherit; }
.history-filter-picker span { min-width: 0; overflow-wrap: break-word; }
.history-filter-picker .icon { width: 17px; height: 17px; }
.history-filter-picker .history-filter-chevron { width: 14px; height: 14px; }
.history-filter.is-active .history-filter-picker { justify-content: flex-start; padding-inline: 10px 2px; }
.history-filter.is-active .history-filter-chevron { display: none; }
.history-filter select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.history-filter-remove { width: 44px; align-self: stretch; border-radius: 24px; }
.history-filter-remove .icon { width: 17px; height: 17px; }
.history-clear { min-height: 44px; padding-inline: 4px; color: var(--history-filter-ink); text-decoration: underline; text-underline-offset: 3px; font-size: .9rem; }
.history-results { margin-top: 20px; }
.history-summary { padding-inline: 4px; margin-bottom: 21px; }
.history-summary-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 10px; }
.history-summary-heading h2 { flex: 1 1 auto; max-width: 100%; font-size: 1.0625rem; line-height: 1.25; font-weight: 680; overflow-wrap: break-word; }
.history-summary-heading p { color: var(--muted); font-size: .8125rem; }
.history-summary > strong { display: block; margin-top: 4px; font-size: 2.05rem; font-weight: 700; line-height: 1.13; letter-spacing: -.035em; overflow-wrap: anywhere; }
.history-summary > strong span { padding-inline-end: .04em; }
.history-breakdown { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 7px; }
.history-breakdown button { display: flex; align-items: center; gap: 8px; min-height: 44px; min-width: 0; padding-inline: 4px; text-align: left; color: var(--muted); font-size: .8rem; }
.history-breakdown button + button { padding-inline-start: 12px; border-inline-start: 1px solid var(--history-line); }
.history-breakdown button strong { display: block; margin-top: 2px; color: var(--deep); font-size: 1rem; overflow-wrap: anywhere; }
.history-direction { display: grid; flex: none; width: 26px; height: 26px; place-items: center; }
.history-direction .icon { width: 21px; height: 21px; }
.history-day { margin-inline: 4px; }
.history-day + .history-day { margin-top: 20px; }
.history-day h3 { margin-bottom: 3px; color: var(--muted); font-weight: 570; font-size: .94rem; }
.transaction-open { display: flex; width: 100%; text-align: start; border-radius: 8px; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 3px 8px; min-height: 52px; padding-block: 6px; }
.transaction-row + .transaction-row { border-top: 1px solid color-mix(in srgb, var(--history-line) 60%, transparent); }
.transaction-open:active { background: var(--selected); }
@media (hover: hover) {
  .transaction-open:hover { background: color-mix(in srgb, var(--selected) 60%, transparent); }
}
.transaction-main { display: flex; flex: 1 1 8rem; min-width: 0; align-items: center; gap: 10px; }
.transaction-icon { display: grid; place-items: center; width: 36px; flex: 0 0 36px; aspect-ratio: 1; border-radius: 10px; background: color-mix(in srgb, var(--fill-color, var(--history-chip)) 76%, var(--canvas)); color: var(--deep); }
.transaction-icon .icon { width: 20px; height: 20px; }
.transaction-copy { display: grid; min-width: 0; gap: 2px; line-height: 1.3; overflow-wrap: break-word; }
.transaction-copy strong { font-size: 1rem; font-weight: 630; }
.transaction-copy small { color: var(--muted); font-size: var(--text-secondary); }
.transaction-copy small span { white-space: nowrap; }
.transaction-value { margin-inline-start: auto; max-width: 100%; font-size: 1rem; font-weight: 650; text-align: end; overflow-wrap: anywhere; }
.history-group-context {
  margin: -7px 4px 20px;
  padding: 9px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--selected) 66%, transparent);
  color: var(--muted);
  font-size: var(--text-secondary);
  line-height: 1.35;
}
.history-group-warning {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 6px 8px;
  margin-bottom: 7px;
  border-radius: 8px;
  background: var(--product-over-bg);
  color: var(--negative);
}
.history-group-warning .icon { flex: none; width: 16px; height: 16px; }
.history-group-warning strong, #history-group-exceeded { display: block; }
#history-group-names { color: var(--ink); font-weight: 570; }
.history-group-context p + p { margin-top: 3px; }
.history-empty { padding: 12px 4px 16px; color: var(--muted); line-height: 1.45; }
.history-empty .history-clear { padding-inline: 0; }
.app[data-view="transactions"] .screen { padding-bottom: calc(var(--dock-inset) + max(79px, 4.5rem)); }
.app[data-view="transactions"] :is(.dock .glass, .history-icon-button) { box-shadow: none; }
.app[data-view="transactions"] .dock-tabs button { overflow-wrap: anywhere; }


.dock { position: absolute; z-index: 2; inset: auto var(--side) var(--dock-inset); display: grid; grid-template-columns: var(--dock-action-size) minmax(0, 1fr) var(--dock-action-size); align-items: center; gap: var(--dock-gap); }
.glass { border: 1px solid #e7e9ea; background: #fafbfb; box-shadow: 0 7px 19px #17202212, inset 0 1px 2px #ffffffed; }
.dock-action { display: grid; place-items: center; width: var(--dock-action-size); height: var(--dock-action-size); border-radius: 50%; transition: transform 140ms var(--ease); }
.dock-action:active { transform: scale(.94); transition-duration: 85ms; }
.add .icon { width: 29px; height: 29px; stroke-width: 2.4; }
.dock-action.mic { background: linear-gradient(145deg, #237d73, var(--voice-accent)); color: #fff; border-color: #39867d; box-shadow: 0 6px 18px #14342d33, inset 0 1px 1px #ffffff50; }
.mic .icon { width: 25px; height: 25px; }
.dock-tabs { position: relative; isolation: isolate; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; min-height: 60px; padding: 3px 5px; border-radius: 36px; }
.dock-tabs::before { content: ""; position: absolute; z-index: -1; inset-block: 4px; inset-inline-start: 5px; width: calc((100% - 10px) / 3); border-radius: 24px; background: var(--control-selection, #27323813); transform: translateX(calc(var(--tab-index, 0) * 100%)); transition: transform var(--motion-select) var(--ease-settle); }
.dock-tabs button { display: grid; justify-items: center; align-content: center; gap: 4px; min-width: 0; min-height: 50px; border-radius: 22px; font-size: clamp(12px, 3.45cqw, .875rem); line-height: 1.2; }
.dock-tabs .icon { width: 23px; height: 23px; }
.dock-tabs button[data-view="home"][aria-current="page"] .icon { fill: currentColor; }
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: rgb(243 244 245 / 78%); -webkit-backdrop-filter: blur(24px) saturate(132%); backdrop-filter: blur(24px) saturate(132%); }
}
@media (prefers-reduced-transparency: reduce) {
  .glass { background: #fafbfb; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

.app:has(.sheet[open]) .dock { visibility: hidden; }
.sheet {
  position: fixed;
  inset: var(--sheet-y, 0) auto auto var(--sheet-x, 0);
  width: var(--sheet-width, 100%);
  height: var(--sheet-height, 100%);
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--deep);
  overflow: hidden;
}
.sheet[open] { display: flex; align-items: flex-end; }
.sheet::before {
  position: absolute;
  inset: 0;
  background: rgb(15 17 18 / 49%);
  content: "";
  pointer-events: none;
  opacity: var(--sheet-dim, 1);
  animation: dim-in var(--motion-select) ease-out;
  transition: opacity var(--motion-quick) ease-out;
}
.sheet::backdrop { background: transparent; }
.sheet-body {
  position: relative;
  width: 100%;
  max-height: calc(100% - var(--top-inset) - 11px);
  padding: 11px var(--side) calc(var(--sheet-safe, var(--bottom-inset)) + 27px);
  border-radius: 25px 25px 0 0;
  background: #fff;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  transform: translateY(var(--sheet-drag, 0px));
  animation: sheet-in var(--motion-present) var(--ease-settle);
  transition: transform var(--motion-select) var(--ease-settle);
}
.sheet[data-interacted]:not(.closing) .sheet-body,
.sheet[data-interacted]:not(.closing)::before { animation: none; }
.sheet[data-dragging] .sheet-body, .sheet[data-dragging]::before,
.sheet.closing .sheet-body, .sheet.closing::before { transition: none; }
.sheet.closing .sheet-body { animation: sheet-out var(--motion-dismiss) var(--ease-exit) both; }
.sheet.closing::before { animation: dim-out var(--motion-dismiss) ease-in both; }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes sheet-out { from { transform: var(--sheet-exit-transform, none); } to { transform: translateY(100%); } }
@keyframes dim-in { from { opacity: 0; } }
@keyframes dim-out { from { opacity: var(--sheet-exit-opacity, 1); } to { opacity: 0; } }
@keyframes chart-slide-in { from { opacity: .62; transform: translateX(var(--chart-offset)); } to { opacity: 1; transform: translateX(0); } }
.chart { --chart-offset: 9px; }
.chart[data-selected="income"] { --chart-offset: -9px; }
.chart-content.updating > :not([hidden]) { animation: chart-slide-in var(--motion-select) var(--ease-settle); }
@keyframes balance-swap-in { from { opacity: .48; transform: translateY(var(--swap-offset)) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.balance-amount.updating { --swap-offset: 10px; }
.balance-secondary strong.updating { --swap-offset: -7px; }
.balance-amount.updating, .balance-secondary strong.updating { animation: balance-swap-in 300ms var(--ease-settle); }
/* Keep punctuation and steady digits on the baseline while a digit rolls. */
.balance-digit {
  position: relative;
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}
.balance-digit > span { display: block; }
[data-roll="up"] { --digit-from: 100%; --digit-to: -100%; }
[data-roll="down"] { --digit-from: -100%; --digit-to: 100%; }
@media (prefers-reduced-motion: no-preference) {
  .app:not([data-review-motion]) [data-roll] .balance-digit > span {
    animation: balance-digit-arrive 420ms var(--ease-settle) both;
  }
  .app:not([data-review-motion]) [data-roll] .balance-digit[data-outgoing]::before {
    content: attr(data-outgoing);
    position: absolute;
    inset: 0;
    animation: balance-digit-leave 420ms var(--ease-settle) both;
  }
  .app:has(.sheet[open]) [data-roll] .balance-digit > span,
  .app:has(.sheet[open]) [data-roll] .balance-digit::before { animation-play-state: paused; }
}
@keyframes balance-digit-arrive { from { opacity: .12; transform: translateY(var(--digit-from)); } }
@keyframes balance-digit-leave { to { opacity: 0; transform: translateY(var(--digit-to)); } }

.grabber { position: relative; touch-action: none; width: 46px; height: 5px; margin: 1px auto 5px; border-radius: 8px; background: #aaadaf; }
.grabber::after { position: absolute; inset: -11px -12px -12px; content: ""; touch-action: none; }
.sheet h2 { font-weight: 750; letter-spacing: -.035em; line-height: 1.13; overflow-wrap: break-word; }
.sheet-cancel { min-height: 44px; padding: 0 4px; color: var(--ink); font-size: 1rem; }
.manual h2 { margin: 3px 3px 30px; font-size: min(1.77rem, 14cqw); }
.quick .sheet-body { padding-bottom: calc(var(--sheet-safe, var(--bottom-inset)) + 9px); }
.quick-header { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, max-content) minmax(0, 1fr); align-items: center; gap: 6px; }
.quick-header .sheet-cancel { justify-self: start; color: var(--positive); font-size: .9rem; font-weight: 600; }
.quick-header h2 { font-size: 1.0625rem; text-align: center; overflow-wrap: break-word; }
#quick-form { padding-top: 11px; }
.quick-intro h3 { font-size: clamp(1.5rem, 7.5cqw, 1.9rem); line-height: 1.05; letter-spacing: -.04em; }
.quick-intro p { margin: 7px 0 15px; color: var(--muted); }
.quick-entry { display: flex; align-items: center; min-height: 47px; border-radius: 16px; background: #eaf2e8; }
.quick-entry:focus-within { box-shadow: 0 0 0 1px #c3d6c1; }
.quick-entry input { flex: 1; min-width: 0; min-height: 46px; padding: 0 2px 0 13px; border: 0; background: transparent; font-size: 1rem; outline: none; }
.quick-entry button { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 13px; color: var(--positive); }
.quick-entry button .icon { width: 20px; height: 20px; }
.quick-example, .quick-feedback { margin: 8px 2px 0; color: var(--muted); font-size: .875rem; line-height: 1.4; }
#quick-review { margin-top: 14px; }
.quick-name { display: flex; justify-content: center; align-items: center; gap: 4px; width: min(235px, 90%); margin: 12px auto 0; }
.quick-name input { min-height: 36px; max-width: calc(100% - 20px); min-width: 0; padding: 3px; border: 0; border-radius: 8px; background: transparent; text-align: center; font-size: 1rem; }
.quick-name .icon { width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.transaction-amount.quick-amount { padding: 0 0 21px; }
.transaction-amount.quick-amount input { min-height: 44px; border-radius: 9px; font-size: clamp(1.85rem, 9.4cqw, 2.5rem); }
.quick-optional { margin: 0 0 5px; color: var(--muted); font-size: .8125rem; }
.quick-details { display: flex; flex-wrap: wrap; gap: 5px; }
.quick-chip { position: relative; display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; min-height: 44px; padding-inline: 8px; border-radius: 99px; background: var(--selected); font-size: .8125rem; line-height: 1.25; font-weight: 600; cursor: pointer; }
.quick-chip > span:not(.quick-category-icon) { min-width: 0; overflow-wrap: break-word; }
.quick-chip:focus-within { outline: 2px solid var(--forest); outline-offset: 1px; }
.quick-chip .icon { width: 14px; height: 14px; }
.quick-chip .chip-chevron { width: 11px; height: 11px; }
.quick-chip select { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.quick-category { gap: 6px; max-width: 100%; padding-inline: 4px 8px; }
.quick-category[data-tone] { background: color-mix(in srgb, var(--fill-color) 34%, white); }
.quick-category-icon { display: grid; flex: none; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--fill-color, #e1e6e2); }
.quick-tags-field input { width: 100%; min-height: 44px; margin-top: 7px; padding: 0 10px; border: 1px solid #dce0e1; border-radius: 10px; background: #fff; font-size: 1rem; }
.quick-actions { display: grid; gap: 2px; margin-top: 14px; }
.quick-actions .save-button { margin-top: 0; min-height: 44px; background: #32613b; }
.quick-actions .save-button:disabled { background: #e3e6e4; color: #59625d; box-shadow: none; cursor: default; }
.use-form { min-height: 44px; border-radius: 10px; color: var(--positive); font-size: .9rem; font-weight: 600; }
.transaction-type { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; min-width: 0; border: 1px solid #dce0e1; border-radius: 17px; }
.transaction-type label { position: relative; cursor: pointer; }
.transaction-type input { position: absolute; opacity: 0; inset: 0; width: 100%; margin: 0; cursor: pointer; }
.transaction-type span { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 39px; border-radius: 13px; font-size: .975rem; }
.transaction-type input:checked + span { font-weight: 690; }
.transaction-type input:focus-visible + span { outline: 2px solid var(--forest); }
.transaction-type .icon { width: 20px; height: 20px; }
.transaction-amount { display: block; padding: 17px 0 22px; }
.transaction-amount input { display: block; width: 100%; min-width: 0; border: 0; background: none; font-size: clamp(1.8rem, 11cqw, 2.9rem); line-height: 1; font-weight: 750; letter-spacing: -.045em; text-align: center; }
.field-group { padding: 0 10px; background: var(--selected); border-radius: 15px; }
.form-row { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1fr); align-items: center; gap: 6px; min-height: 48px; padding: 0 4px; text-align: left; font-size: 1rem; }
.form-row + .form-row { border-top: 1px solid #d8dcde; }
.form-row > span:first-child { color: var(--muted); }
.form-row input, .form-row select { min-width: 0; width: 100%; min-height: 44px; padding: 0; border: 0; background: transparent; font-size: 1rem; font-weight: 520; text-align: left; }
.date-control { position: relative; min-height: 44px; justify-content: space-between; }
.date-control input[type="date"] { position: absolute; inset: 0; height: 100%; opacity: 0; }
.date-control:focus-within { outline: 2px solid var(--forest); outline-offset: 2px; }
.date-control input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; }
.form-row input::placeholder { color: var(--muted); font-weight: 400; }
.form-row select { appearance: none; -webkit-appearance: none; text-overflow: ellipsis; }
.form-category { position: relative; }
.form-category select { position: absolute; inset: 0; height: 100%; opacity: 0; cursor: pointer; }
.form-category:focus-within { outline: 2px solid var(--forest); outline-offset: 2px; }
.form-category .field-arrow { margin-inline-start: auto; }
#category-display { min-width: 0; overflow-wrap: break-word; padding-block: 7px; }

.row-control { display: flex; align-items: center; min-width: 0; gap: 6px; }
.row-control .icon { width: 17px; height: 17px; }
.row-control .field-arrow { pointer-events: none; color: var(--muted); }
.save-button { color: white; background: var(--forest); border-radius: 15px; min-height: 51px; margin-top: 28px; width: 100%; font-weight: 720; font-size: 1.125rem; }
.toast { position: absolute; z-index: 4; inset: auto var(--side) calc(var(--dock-inset) + 70px); display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 12px; border-radius: 12px; background: var(--ink); color: #fff; font-size: .9rem; }
.toast button { min-height: 44px; color: #dce6d8; font-weight: 700; }

#voice .sheet-body {
  color: #f5fffc;
  background: radial-gradient(ellipse at 50% 24%, #17423d, transparent 59%), #101e23;
  padding-bottom: calc(var(--sheet-safe, var(--bottom-inset)) + 21px);
}
.voice-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.voice-header h2 { font-size: .94rem; font-weight: 650; color: #cde4df; }
.voice-header button { border-radius: 50%; background: #e8fff51a; }
.voice-header .icon { width: 18px; height: 18px; }
.voice-content { display: grid; justify-items: center; text-align: center; gap: 16px; padding: 14px 0 1px; }
.voice-orb {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  width: clamp(96px, 37cqw, 144px);
  aspect-ratio: 1;
  border-radius: 42% 58% 47% 53%;
  background: conic-gradient(from 35deg, #a1f2d4, #56bcbc, #334e79, #b9a7df, #7ed1a7, #a1f2d4);
  box-shadow: 0 0 39px #59e5c444, inset 0 0 15px #e5fff3b3;
}
.voice-orb-light {
  position: absolute;
  inset: 6px;
  border-radius: inherit;
  background: radial-gradient(ellipse at 63% 76%, #7be2c376, transparent 60%), radial-gradient(ellipse at 16% 25%, #a99ad67a, transparent 62%), #0c2c32;
}
.voice-orb-symbol { position: relative; display: grid; place-items: center; width: 38%; aspect-ratio: 1; color: #e5fff3; }
.voice-orb-symbol .icon { width: 100%; height: 100%; }
.voice-bubbo { display: none; }
#voice[data-voice-design="bubbo"] .voice-bubbo {
  display: block;
  position: absolute;
  inset: 11%;
  width: 78%;
  height: 78%;
  object-fit: contain;
}
#voice[data-voice-design="bubbo"] .voice-orb-symbol {
  position: absolute;
  inset-inline-end: 1%;
  inset-block-end: 0;
  width: 29%;
  border: 1px solid #a9e2d0;
  border-radius: 50%;
  background: #183c3c;
  box-shadow: 0 2px 8px #0a2528aa;
}
#voice[data-voice-design="bubbo"] .voice-orb-symbol .icon { width: 55%; height: 55%; }
#voice[data-voice-design="bubbo"] [data-listening="true"] .voice-orb-symbol { background: #a3e5ce; color: #102f2e; }
.voice-message h3 { font-size: clamp(1.28rem, 6.5cqw, 1.8rem); line-height: 1.12; letter-spacing: -.035em; }
.voice-instruction { margin: 5px auto 0; color: #c3dcd6; font-size: .875rem; max-width: 28ch; }
.voice-action { width: min(100%, 300px); min-height: 48px; padding: 9px 13px; border-radius: 15px; color: #0b302e; background: #a3e5ce; font-size: .95rem; font-weight: 730; }
.voice-content[data-listening="true"] .voice-orb { box-shadow: 0 0 44px #6ff6d67a, inset 0 0 15px #e5fff3b3; }
.voice-orb::before {
  content: "";
  position: absolute;
  inset: -9px;
  z-index: -1;
  border: 1px solid #a1f2d44d;
  border-inline-color: #b9a7df2e;
  border-radius: 50% 46% 53% 47%;
}
@media (prefers-reduced-motion: no-preference) {
  #voice[open]:not(.closing) .voice-orb { animation: voice-arrive 440ms var(--ease-settle); }
  #voice[open]:not(.closing) [data-listening="true"] .voice-orb::before { animation: voice-listen 1.15s ease-in-out 3; }
  #voice[open]:not(.closing) [data-listening="true"] .voice-orb-light { animation: voice-light 1.15s ease-in-out 3; }
  #voice[data-voice-design="bubbo"][open]:not(.closing) .voice-bubbo { animation: voice-bubbo-arrive 490ms var(--ease-settle); }
  .voice-orb-symbol { transition: background-color var(--motion-quick), color var(--motion-quick); }
}
@keyframes voice-arrive { from { opacity: .45; scale: .94; } }
@keyframes voice-bubbo-arrive { from { opacity: .2; translate: 0 5px; } }
@keyframes voice-listen {
  50% { opacity: .48; scale: 1.05; }
}
@keyframes voice-light { 50% { opacity: .77; } }

@container (max-width: 365px) {
  .balance-row { gap: 5px; }
  .balance-secondary, .period-button, .chart-actions button { font-size: .875rem; }
  .balance-secondary { padding-inline: 8px; }
  .chart-tabs button { padding-inline: 9px; }
  .tiles.expenses .tile-label { gap: 3px; }
  .tiles.expenses .tile-label .icon { width: 13px; height: 13px; }
  .tiles.expenses[data-count]:not([data-count="1"]) .tile:first-child .icon { width: 24px; height: 24px; }
}

@container (max-width: 340px) {
  .home-header { gap: 5px; }
  .home-avatar { width: 44px; height: 44px; }
  .home-account { padding-inline: 8px; }
  .home-assistant { width: 36px; height: 36px; }
  .dock { --side: 12px; --dock-gap: 7px; --dock-action-size: 46px; }
  .tile-label { font-size: .7rem; }
  .tiles:is([data-count="3"], [data-count="4"]) .tile:first-child { padding-inline: 8px; }
  .tiles:is([data-count="3"], [data-count="4"]) .tile:first-child .tile-label { font-size: .84rem; }
  .dock-tabs { min-height: 56px; padding-inline: 2px; }
  .dock-tabs::before { inset-inline-start: 2px; width: calc((100% - 4px) / 3); }
  .dock-tabs .icon { width: 21px; height: 21px; }
}

@container (width < 19rem) {
  .home-header { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .home-account { grid-row: 2; grid-column: 2 / -1; justify-self: start; }
  .balance-primary { padding-inline: 22px; }
  .balance-amount { font-size: min(2.375rem, 10.5cqw); }
  .chart-tabs strong { font-size: min(1.65rem, 6.9cqw); }
  .balance-label { max-inline-size: max(80px, calc(100% - 132px)); }
  .balance-actions { top: -13px; }
  .balance-row { gap: 5px; }
  .chart-tabs button { overflow-wrap: break-word; }
  .chart-tabs button > span { flex-wrap: wrap; }
  .tiles:is([data-count="3"], [data-count="4"]) {
    block-size: auto;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
  }
  .tiles:is([data-count="3"], [data-count="4"]):is(.income, .expenses) .tile:first-child { grid-row: auto; padding-block: 10px; }
  .tiles:is([data-count="3"], [data-count="4"]) .tile { block-size: max(112px, 7rem); }
  .tiles:is([data-count="3"], [data-count="4"]) .tile:first-child { block-size: max(132px, 8.25rem); }
  .tiles:is([data-count="3"], [data-count="4"]) .tile:nth-child(3) { block-size: max(96px, 6rem); }
  .tiles:is([data-count="3"], [data-count="4"]) .tile:nth-child(4) { block-size: max(84px, 5.25rem); }
  .quick-header { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .quick-header h2 { justify-self: start; text-align: start; }
  .transaction-type span { flex-wrap: wrap; gap: 4px; padding: 4px; }
  .form-row { grid-template-columns: minmax(0, 1fr); gap: 0; padding-block-start: 7px; }
}

@media (min-width: 700px) {
  html { background: #eef0f0; }
  .workspace { display: flex; align-items: flex-start; justify-content: center; gap: clamp(21px, 4vw, 45px); padding: 20px 16px; }
  .app { --top-inset: 56px; --bottom-inset: 28px; --dock-inset: 41px; flex: none; width: var(--review-width, 393px); height: var(--review-height, 852px); border-radius: 42px; outline: 2px solid #202529; box-shadow: 0 17px 44px #20252924; }
  .system-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; position: absolute; z-index: 1; inset: 0 0 auto; padding: 0 29px; height: 56px; pointer-events: none; font-size: .875rem; font-weight: 700; }
  .island { display: block; width: 116px; height: 29px; border-radius: 22px; background: #050505; }
  .system-glyphs { display: flex; align-items: center; justify-self: end; gap: 4px; color: #050505; }
  .system-glyphs .icon { width: 12px; height: 12px; stroke-width: 2.2; }
  .service { width: 13px; height: 10px; background: currentColor; clip-path: polygon(0 65%, 17% 65%, 17% 100%, 28% 100%, 28% 47%, 44% 47%, 44% 100%, 56% 100%, 56% 26%, 72% 26%, 72% 100%, 84% 100%, 84% 0, 100% 0, 100% 100%, 0 100%); }
  .battery { display: block; width: 22px; height: 10px; border: 1px solid #555; border-radius: 3px; box-shadow: inset 0 0 0 1px #fff; background: #0a0a0a; }
  .system-bottom { display: block; position: absolute; z-index: 3; inset: auto 50% 13px auto; width: 36%; height: 5px; border-radius: 7px; translate: 50% 0; pointer-events: none; background: #050505; }
  .sheet { border-radius: 42px; }
  .sheet::after {
    position: absolute;
    inset: auto 32% 13px;
    height: 5px;
    border-radius: 7px;
    background: #050505;
    pointer-events: none;
    content: "";
  }
  .review {
    position: sticky;
    top: 16px;
    display: grid;
    flex: 0 1 284px;
    align-content: start;
    min-width: 0;
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
    padding: 2px 4px 5px;
    gap: 8px;
    color: var(--ink);
  }
  .review h2 { margin-bottom: 5px; font-size: 19px; letter-spacing: -.02em; }
  .review label { display: block; font-size: 13px; font-weight: 640; }
  .review select, .review button { width: 100%; min-width: 0; min-height: 44px; padding: 0 8px; border: 1px solid #c9d0d0; border-radius: 9px; background: #fff; font-size: 13px; }
  .review p { font-size: 13px; line-height: 1.4; color: var(--muted); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #000;
  --ink: #e2e7ee;
  --deep: #f5f7fa;
  --muted: #b9c5d2;
  --selected: #2c3643;
  --positive: #78e1a7;
  --negative: #ff9bad;
  --sage: #25543f;
  --blue: #214e69;
  --sand: #705134;
  --mauve: #644b72;
  --green: #405335;
  --teal: #2c625f;
  --periwinkle: #4b567e;
  --slate: #4a5b74;
  --rose: #744859;
  --stone: #5c534a;
  --raised: #181d22;
  --edge: #48576a;
  --soft: #313c4a;
  --glass-dark: #293341;
  --dark-progress: #86ccf0;
  --dark-progress-coral: #ff96a8;
  --dark-progress-track: #344659;
}

[data-theme="dark"] :focus-visible,
[data-theme="dark"] .transaction-type input:focus-visible + span,
[data-theme="dark"] .month-wheel:has(.month-options:focus-visible),
[data-theme="dark"] .quick-chip:focus-within,
[data-theme="dark"] .date-control:focus-within { outline-color: var(--positive); }

[data-theme="dark"] .home-avatar { background: #a7bfae; }
[data-theme="dark"] .home-greeting p { color: var(--muted); }
[data-theme="dark"] :is(.period-list, .chart-legend) {
  border-color: var(--edge);
  background: var(--raised);
  box-shadow: 0 10px 28px #0a101570;
}
[data-theme="dark"] .month-wheel::before { background: var(--soft); }
[data-theme="dark"] .chart {
  --chart-idle: #0c1014;
  --chart-surface: #29343e;
  --chart-active-edge: #7b90a469;
}
[data-theme="dark"] .chart-tabs,
:root:not([data-theme="dark"]) .chart[data-layout="list"] .chart-tabs {
  background: var(--chart-idle);
  border-radius: var(--curve) var(--curve) 0 0;
}
[data-theme="dark"] .chart-help-button[aria-expanded="true"] span { background: var(--soft); }
[data-theme="dark"] :is(.tiles.expenses .tile, .legend-available) { background: var(--canvas); }
[data-theme="dark"] .legend-outline { border-color: #a0c1a9; }
[data-theme="dark"] .transactions {
  --history-chip: #2e3846;
  --history-line: #b6c9df32;
  --history-edge: #aabed23d;
  --history-filter-active: #283e38;
  --history-filter-border: #9dcfb58c;
  --history-filter-ink: #d3f1df;
  --history-segment-track: #242c37;
  --history-segment-selection: #3c534a;
  --history-segment-shadow: 0 1px 4px #0a101545, inset 0 1px #dcefe527;
}
[data-theme="dark"] .glass { border-color: var(--edge); background: var(--glass-dark); box-shadow: 0 6px 18px #0a101560, inset 0 1px 0 #d8e2e916; }
[data-theme="dark"] .balance-secondary.glass { border-color: var(--edge); box-shadow: 0 2px 6px #0a101550; }
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  [data-theme="dark"] .glass { background: color-mix(in srgb, var(--glass-dark) 86%, transparent); }
}
@media (prefers-reduced-transparency: reduce) {
  [data-theme="dark"] .glass { background: var(--glass-dark); }
}
[data-theme="dark"] .dock-action.mic { background: linear-gradient(145deg, #a5e8d5, #66b5a9); color: #0b302e; border-color: #a5ddcf; box-shadow: 0 5px 18px #152d2b66, inset 0 1px 1px #ffffff55; }
[data-theme="dark"] { --control-selection: #dfe7ed1c; }
[data-theme="dark"] .sheet::before { background: rgb(9 14 18 / 66%); }
[data-theme="dark"] .sheet-body { background: var(--raised); }
[data-theme="dark"] .grabber { background: #87939a; }
[data-theme="dark"] .quick-entry { background: var(--soft); }
[data-theme="dark"] .quick-entry:focus-within { box-shadow: 0 0 0 1px #64866b; }
[data-theme="dark"] .quick-category[data-tone] { background: color-mix(in srgb, var(--fill-color) 42%, var(--raised)); }
[data-theme="dark"] .quick-category-icon { background: var(--fill-color, var(--soft)); }
[data-theme="dark"] .quick-tags-field input { border-color: var(--edge); background: var(--canvas); }
[data-theme="dark"] .quick-actions .save-button:disabled { background: var(--soft); color: var(--muted); }
[data-theme="dark"] :is(.transaction-type, .form-row + .form-row) { border-color: var(--edge); }
[data-theme="dark"] .toast { background: var(--soft); color: var(--deep); }

@media (min-width: 700px) {
  :root[data-theme="dark"] { background: #000; }
  [data-theme="dark"] .app { outline-color: var(--edge); box-shadow: 0 17px 44px #0006; }
  [data-theme="dark"] .system-glyphs { color: var(--ink); }
  [data-theme="dark"] .battery { border-color: var(--muted); box-shadow: inset 0 0 0 1px var(--canvas); background: var(--ink); }
  [data-theme="dark"] .system-bottom,
  [data-theme="dark"] .sheet::after { background: var(--ink); }
  [data-theme="dark"] .review :is(select, button) { border-color: var(--edge); background: var(--raised); }
}

/* Payments, goals and monthly budgets share controls and figures. */
.app {
  --product-rule: #dce3df;
  --product-surface: #f3f6f4;
  --product-track: #e2ebe4;
  --product-active: #dfe8e2;
  --product-progress: #64896a;
  --product-over-bg: #fce8e6;
  --product-button: #42634a;
  --product-link: #325b3c;
  --product-today: #fbefdb;
}
[data-theme="dark"] .app {
  --product-rule: #414e60;
  --product-surface: #232c37;
  --product-track: #3a4857;
  --product-active: #344d46;
  --product-progress: #a1cdae;
  --product-over-bg: #482e3a;
  --product-button: #3d614f;
  --product-link: #bde8ce;
  --product-today: #40352c;
}
:is(.product-icon, .product-meter, .goal-card)[data-tone="sage"] { --product-tone: var(--sage); }
:is(.product-icon, .product-meter, .goal-card)[data-tone="blue"] { --product-tone: var(--blue); }
:is(.product-icon, .product-meter, .goal-card)[data-tone="sand"] { --product-tone: var(--sand); }
:is(.product-icon, .product-meter, .goal-card)[data-tone="mauve"] { --product-tone: var(--mauve); }
:is(.product-icon, .product-meter, .goal-card)[data-tone="green"] { --product-tone: var(--green); }
.product-view { padding: 1px 4px 0; line-height: 1.35; }
.product-heading { margin: 4px 2px 13px; }
.product-heading h1 { font-size: 1.78rem; line-height: 1.12; letter-spacing: -.035em; font-weight: 730; overflow-wrap: anywhere; }
.product-heading p { margin-top: 3px; color: var(--muted); font-size: .88rem; }
.product-heading-back {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
}
.product-heading-back h1 { font-size: clamp(1.12rem, 5.7cqw, 1.45rem); overflow-wrap: normal; }
.budget-month { background: var(--selected); }
.budget-month .product-month-display { font-size: .79rem; padding-inline: 9px 23px; white-space: nowrap; }
.budget-month::after { inset-inline-end: 9px; width: 6px; height: 6px; }
@container (width < 19rem) {
  .product-heading-back { grid-template-columns: 44px minmax(0, 1fr); }
  .budget-month { grid-column: 2; justify-self: start; }
}
.product-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; }
.product-toolbar-end { justify-content: flex-end; }
.product-primary, .product-link { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 44px; font-size: .94rem; font-weight: 660; line-height: 1.2; }
.product-primary { padding: 7px 16px; border-radius: 22px; background: var(--product-button); color: #fff; text-align: center; }
.product-primary:active { filter: brightness(1.15); }
.product-link { color: var(--product-link); padding-inline: 4px; }
.product-link:active { text-decoration: underline; }
.product-link .icon { width: 16px; height: 16px; }
.product-month { position: relative; display: inline-flex; align-items: center; min-width: 0; min-height: 44px; max-width: 100%; color: var(--deep); border-radius: 24px; }
.product-month-display { min-width: 0; padding: 5px 30px 5px 14px; font-size: .9rem; font-weight: 600; overflow-wrap: anywhere; }
.product-month select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.product-month:focus-within { outline: 2px solid var(--positive); outline-offset: 2px; }
.product-month::after { position: absolute; top: 50%; right: 13px; width: 8px; height: 8px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-70%) rotate(45deg); content: ""; pointer-events: none; }
.product-summary { display: grid; justify-items: center; gap: 4px; margin: 10px 2px 19px; padding-inline: 8px; text-align: center; }
.product-summary > strong { font-size: min(2.125rem, 12.5cqw); font-weight: 740; line-height: 1.12; letter-spacing: -.035em; overflow-wrap: anywhere; }
.product-summary p { color: var(--muted); font-size: .93rem; }
.product-summary .product-meter { margin-top: 9px; width: min(100%, 20rem); }
.product-meter { height: 7px; border-radius: 8px; background: var(--product-track); overflow: hidden; }
.product-meter i { display: block; width: var(--progress); height: 100%; border-radius: inherit; background: var(--product-progress); }
.product-meter[data-meter-change] i { animation: product-progress 380ms var(--ease-settle); }
@keyframes product-progress { from { width: var(--previous-progress); } }
.product-meter[data-tone] i { background: color-mix(in srgb, var(--product-tone) 51%, var(--product-progress)); }
.product-meter[data-over] i { background: var(--product-over-fill, #ba263e); }
[data-theme="dark"] .app { --product-over-fill: #ff8293; }
.product-feed { display: grid; align-content: start; gap: 10px; margin-top: 11px; }
.product-group { margin: 5px 3px 0; color: var(--muted); font-size: .88rem; font-weight: 690; }
.product-group.negative { color: var(--negative); }
.payment-row, .budget-row { min-width: 0; padding: 2px 2px 8px; border-bottom: 1px solid var(--product-rule); }
.payment-row[data-today] { padding: 6px 10px 1px; border: 0; border-radius: 17px; background: var(--product-today); }
.product-row-main { display: flex; width: 100%; min-height: 57px; align-items: center; gap: 9px; padding-block: 4px; text-align: start; }
.product-row-main > .icon { width: 15px; height: 15px; color: var(--muted); }
.product-row-copy { display: grid; grid-template-columns: minmax(0, 1fr); flex: 1 1 auto; min-width: 0; gap: 2px; overflow-wrap: break-word; }
.product-row-copy strong { font-size: 1rem; font-weight: 690; }
.product-row-copy small, .goal-figures span { color: var(--muted); font-size: var(--text-secondary); }
.product-row-copy .negative { color: var(--negative); }
.product-row-amount { font-size: .98rem; white-space: nowrap; }
.product-icon { display: grid; flex: 0 0 42px; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--product-tone, var(--product-active)); color: var(--deep); }
.product-icon .icon { width: 23px; height: 23px; }
.product-row-action { display: flex; justify-content: end; }
.payment-row .product-row-action { margin-top: 3px; border-top: 1px solid var(--product-rule); }
.goals-heading, .goals-summary, .goal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 10px;
}
.goals-heading .product-quiet-action { background: var(--selected); }
.goals-heading .product-quiet-action .icon { width: 16px; height: 16px; }
.goals-summary {
  margin-bottom: 12px;
  padding: 9px 11px;
  border-radius: 12px;
  background: var(--product-surface);
  color: var(--muted);
  font-size: .8125rem;
  overflow-wrap: anywhere;
}
.goals-summary strong { color: var(--deep); }
.goal-card {
  min-width: 0;
  padding: 9px 12px 8px;
  border: 1px solid var(--product-rule);
  border-radius: 17px;
  background: color-mix(in srgb, var(--product-tone, var(--product-active)) 25%, var(--canvas));
}
.goal-card-header { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: start; }
.goal-card .product-row-main { min-height: 48px; }
.product-menu { position: relative; }
.product-menu[open] { z-index: 2; }
.product-menu summary {
  display: grid;
  place-items: center;
  min-height: 44px;
  border-radius: 12px;
  list-style: none;
  color: var(--muted);
  cursor: pointer;
}
.product-menu summary::-webkit-details-marker { display: none; }
.product-menu summary .icon { width: 20px; height: 20px; rotate: 90deg; }
.product-menu[open] summary { background: var(--selected); }
.product-menu-actions {
  position: absolute;
  inset: calc(100% + 3px) 0 auto auto;
  display: grid;
  width: min(165px, 55cqw);
  padding: 3px;
  border-radius: 14px;
}
.product-menu-actions .product-link { justify-content: start; padding-inline: 9px; border-radius: 10px; color: var(--deep); overflow-wrap: anywhere; }
.product-menu-actions .product-link:active { background: var(--selected); }
.goal-figures { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 6px; margin: 8px 0 6px; }
.goal-figures strong { font-size: 1.15rem; overflow-wrap: anywhere; }
.goal-footer { margin-top: 6px; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.goal-percent { color: var(--product-link); font-weight: 700; }
.goal-card[data-celebration] { position: relative; margin-top: 106px; }
.goal-completed-mark {
  display: inline-grid;
  place-items: center;
  width: 1.32em;
  height: 1.32em;
  border-radius: 50%;
  background: var(--product-active);
  color: var(--positive);
  font-weight: 750;
}
.goal-celebration-art {
  position: absolute;
  bottom: 100%;
  inset-inline: 0;
  height: 108px;
  display: grid;
  justify-items: center;
  align-items: end;
  overflow: hidden;
  pointer-events: none;
}
.goal-celebration-art img { position: relative; width: min(166px, 60%); height: auto; }
.goal-celebration-art i { display: none; }
.goal-celebration-caption {
  margin: 1px 5px 7px;
  display: grid;
  justify-items: center;
  gap: 2px;
  text-align: center;
  overflow-wrap: anywhere;
}
.goal-celebration-caption strong { font-size: 1.43rem; letter-spacing: -.025em; }
.goal-celebration-caption span { color: var(--muted); font-size: .9rem; }
@media (prefers-reduced-motion: no-preference) {
  .app:not([data-review-motion]) .goal-card[data-celebration-enter] img {
    animation: goal-bubbo-rise 1.5s var(--ease) both;
  }
  .app:not([data-review-motion]) .goal-card[data-celebration-enter] .goal-completed-mark {
    animation: goal-check 310ms var(--ease-settle) both;
  }
  .app:not([data-review-motion]) .goal-card[data-celebration-enter] .goal-celebration-art i {
    position: absolute;
    display: block;
    inset-block-start: 10px;
    inset-inline-start: calc(50% + var(--confetti-offset));
    width: 5px;
    height: 12px;
    border-radius: 2px;
    background: var(--confetti-color, #a1b99c);
    animation: goal-confetti 780ms var(--ease) var(--confetti-delay, 420ms) both;
  }
  .goal-celebration-art i:nth-child(1) { --confetti-offset: -89px; --confetti-turn: -46deg; }
  .goal-celebration-art i:nth-child(2) { --confetti-offset: -64px; --confetti-turn: 90deg; --confetti-delay: 550ms; --confetti-color: #cbb781; }
  .goal-celebration-art i:nth-child(3) { --confetti-offset: 64px; --confetti-turn: 52deg; }
  .goal-celebration-art i:nth-child(4) { --confetti-offset: 86px; --confetti-turn: -52deg; --confetti-color: #cbb781; }
  .goal-celebration-art i:nth-child(5) { --confetti-offset: 72px; --confetti-turn: 77deg; --confetti-delay: 650ms; }
  .app:has(.product-sheet[open]) .goal-card[data-celebration-enter] :is(img, i, .goal-completed-mark) { animation-play-state: paused; }
}
@keyframes goal-bubbo-rise {
  0% { transform: translateY(104%); }
  39% { transform: translateY(0); }
  57% { transform: translateY(-6px) rotate(-2deg); }
  78%, 100% { transform: translateY(0); }
}
@keyframes goal-check { from { opacity: 0; transform: scale(.75); } }
@keyframes goal-confetti {
  from { opacity: 0; transform: translateY(-4px) rotate(0deg); }
  24% { opacity: .88; }
  to { opacity: 0; transform: translateY(65px) rotate(var(--confetti-turn)); }
}
.budget-warning { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 5px 8px; border-radius: 12px; background: var(--product-over-bg); color: var(--negative); font-size: .88rem; font-weight: 640; }
.budget-warning .icon { width: 18px; height: 18px; }
.budget-row .product-row-main { min-height: 49px; }
.budget-row .product-meter { margin: 4px 0 3px 51px; }
.budget-value { display: grid; gap: 2px; text-align: end; }
.budget-value small { font-size: .83rem; color: var(--product-link); font-weight: 640; }
.product-empty { margin-block: 23px; padding: 16px 13px; text-align: center; }
.product-empty h2 { font-size: 1.16rem; }
.product-empty p { margin: 5px 0 13px; color: var(--muted); font-size: .92rem; }
.product-sheet-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.product-sheet-header h2 { min-width: 0; font-size: 1.3rem; }
.product-sheet-header .sheet-cancel { color: var(--product-link); font-size: .94rem; }
.product-sheet .sheet-body { padding-bottom: calc(var(--sheet-safe, var(--bottom-inset)) + 12px); }
.product-form, .product-options > div { display: grid; gap: 11px; }
.product-field { display: grid; gap: 4px; min-width: 0; color: var(--muted); font-size: .875rem; font-weight: 610; }
.product-field input, .product-field select { width: 100%; min-width: 0; min-height: 46px; padding: 8px 11px; border: 1px solid var(--product-rule); border-radius: 11px; background: var(--product-surface); color: var(--deep); font-size: 1rem; }
.product-field input[name="amount"] { font-size: 1.23rem; font-weight: 680; }
.product-options { padding: 0 9px; border: 1px solid var(--product-rule); border-radius: 11px; }
.product-options summary { min-height: 44px; padding-block: 12px; cursor: pointer; color: var(--product-link); font-size: .93rem; font-weight: 620; }
.product-options > div { padding-bottom: 10px; }
.product-options p, .product-context { color: var(--muted); font-size: .875rem; }
.product-check { display: flex; min-height: 44px; align-items: center; gap: 8px; font-size: .94rem; }
.product-check input { flex: none; width: 19px; height: 19px; accent-color: var(--product-button); }
.product-form-footer { position: sticky; z-index: 1; bottom: 0; margin-top: 2px; padding-block: 5px; background: var(--canvas); }
[data-theme="dark"] .product-form-footer { background: var(--raised); }
.product-form-footer .product-primary { width: 100%; border-radius: 12px; }
.product-error { color: var(--negative); font-size: .875rem; }
.product-detail-heading { display: flex; align-items: center; gap: 10px; }
.product-detail-heading > :not(.product-icon) { min-width: 0; }
.product-detail-heading h3 { font-size: 1.22rem; overflow-wrap: anywhere; }
.product-detail-heading p { color: var(--muted); font-size: .9rem; }
.product-detail-amount { margin-top: 10px; font-size: min(1.95rem, 11cqw); font-weight: 730; letter-spacing: -.025em; }
.product-detail-amount small { font-size: .55em; font-weight: 520; color: var(--muted); }
.product-detail-list { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 12px; padding-top: 11px; border-top: 1px solid var(--product-rule); font-size: .93rem; }
.product-detail-list dt { color: var(--muted); }
.product-detail-list dd { margin: 0; text-align: end; overflow-wrap: anywhere; }
.product-sheet-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 7px; }
#product-notice { z-index: 5; }

.tile-budget-coverage { color: var(--muted); font-size: .67rem; line-height: 1.05; }
.tile-budget-status { display: flex; align-items: center; gap: 3px; align-self: flex-start; flex-wrap: wrap; color: var(--deep); font-size: .75rem; line-height: 1.15; }
.tile-budget-status .icon, .tiles.expenses .tile:first-child .tile-budget-status .icon { width: 13px; height: 13px; }
.tile[data-over] .tile-budget-status { color: var(--negative); background: var(--product-over-bg); border-radius: 9px; padding: 2px 4px; }
:where(.chart:not([data-layout="bars"])) .tiles.expenses:not([data-count="2"]) .tile:first-child[data-over] .tile-budget-status { position: absolute; inset: 7px 7px auto auto; max-width: calc(100% - 14px); }
.tiles.expenses[data-count="1"] .tile { padding-top: 24px; }

@container (width < 19rem) {
  .product-row-main { flex-wrap: wrap; }
  .product-row-copy { flex-basis: 55%; overflow-wrap: anywhere; }
  .product-row-amount, .budget-value { margin-inline-start: auto; }
  .product-sheet-header { flex-wrap: wrap; gap: 4px; }
  .product-sheet-header h2 { flex-basis: 100%; }
  .product-detail-list { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  .product-detail-list dd { text-align: start; margin-bottom: 7px; }
  .tiles.expenses .tile-figure { display: flex; align-items: center; gap: 4px; }
  .tiles.expenses .tile:first-child[data-over] .tile-budget-status { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  .product-meter[data-meter-change] i { animation: none; }
  .product-segment button { transition: none; }
}

/* Thresholds are conveyed with wording, icon and edge, while fill remains category color. */
:root { font-size: var(--review-text, 100%); }
.product-create-icon {
  display: grid;
  flex: none;
  place-items: center;
  background: var(--control-selection, #27323813);
}
.product-create-icon .icon { width: 17px; height: 17px; }
@media (hover: hover) {
  .product-row-main:hover { background: color-mix(in srgb, var(--product-active) 40%, transparent); }
}
.legend-over { width: 14px; height: 9px; border-radius: 9px; background: var(--product-over-bg); }
.budget-warning { justify-content: flex-start; gap: 10px; padding: 10px 12px; }
.budget-warning > div { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.budget-warning small { color: var(--ink); }
.budgets-overview { margin-bottom: 10px; }
.budget-normal { padding: 3px; color: var(--muted); font-size: .88rem; text-align: center; }
.budget-row[data-over] .product-row-copy strong { text-decoration: none; }
.product-row-main { border-radius: 10px; transition: background-color 170ms var(--ease); }
.product-segment button, .history-segment button,
.history-month-button,
.chart-help-button { min-height: 44px; }
.tiles.expenses .tile:not(:first-child) .tile-label { gap: 3px; }
.tiles.expenses .tile:not(:first-child) .tile-label .icon { width: 13px; height: 13px; }
.tiles.expenses:not([data-count="2"]) .tile:not(:first-child) .tile-amount { font-size: clamp(.94rem, 4.75cqw, 1.13rem); }
.tile-budget-status { font-size: .73rem; overflow-wrap: anywhere; }
.tile[data-over] .tile-budget-status { font-weight: 630; }
.tile[data-over]:not(:first-child) .tile-budget-status { flex-wrap: nowrap; }
.tiles.expenses .tile:has(.tile-budget-coverage) { gap: 2px; }
.balance-amount[data-wide-amount] { font-size: min(2.1rem, 7.65cqw); }
.chart-tabs strong[data-wide-amount] { font-size: min(1.25rem, 4.45cqw); }
.balance-secondary[data-wide-amount], .balance-secondary:has([data-wide-amount]) { font-size: min(.94rem, 3.8cqw); }

@keyframes view-enter { from { opacity: .6; transform: translate(var(--enter-x, 0px), var(--enter-y, 8px)); } }
:is(#home, .transactions, .product-view):not([hidden]) { animation: view-enter 280ms var(--ease-settle); }
:is(#transactions, #budgets) { --enter-x: 14px; --enter-y: 0px; }

@keyframes surface-enter { from { opacity: 0; translate: 0 var(--surface-offset, 5px); } }
:is(.period-list, .history-filters, #history-search-box, .chart-legend, #quick-review, #quick-tags-field, .quick-feedback,
  .onboarding-home-tip, .onboarding-empty, .first-steps):not([hidden]),
.product-menu[open] .product-menu-actions { animation: surface-enter var(--motion-quick) var(--ease-settle); }
.toast:not([hidden]) { --surface-offset: 9px; animation: surface-enter var(--motion-select) var(--ease-settle); }
:is(.history-results, .product-feed, #product-sheet-content).updating {
  animation: view-enter var(--motion-select) var(--ease-settle);
}

:is(.dock-tabs button, .segmented > button, .swap, .history-icon-button,
  .history-filter-toggle, .product-menu summary, .product-create, .product-quiet-action) .icon {
  transition: transform var(--motion-quick) var(--ease-settle);
}
:is(.dock-tabs button, .swap, .history-icon-button, .product-menu summary, .product-create, .product-quiet-action):active .icon {
  transform: scale(.88);
}
:is(.segmented > button, .history-filter-toggle, .voice-action) { transition: opacity var(--motion-quick) ease-out; }
:is(.segmented > button, .history-filter-toggle, .voice-action):active { opacity: .72; }
.tile :is(.tile-label, .tile-amount) { transition: transform var(--motion-quick) var(--ease-settle); }
.tile:has(.tile-link:active) :is(.tile-label, .tile-amount) { transform: translateY(1px); }

/* Frequent touches get a small response without moving the surrounding layout. */
.app :is(.chart-action, .chart-help-button, .ranking-row, .transaction-open, .product-row-main, .dock-action,
  .product-primary, .save-button, .theme-toggle, .stats-chart-toggle, .voice-action,
  .onboarding-secondary, .onboarding-edit-movement, .onboarding-option,
  .history-icon-button, .quick-chip, .product-link, .period-button):not(:disabled):active { opacity: .72; }

@media (prefers-reduced-motion: no-preference) {
  .app:not([data-review-motion]) :is(.chart-action, .chart-help-button, .ranking-row, .transaction-open,
    .product-row-main, .product-primary, .save-button, .theme-toggle, .stats-chart-toggle, .voice-action,
    .onboarding-secondary, .onboarding-edit-movement, .onboarding-option,
    .history-icon-button, .quick-chip, .product-link, .period-button) {
    transition: opacity var(--motion-quick) ease, background-color var(--motion-quick) ease, scale 130ms var(--ease-settle);
  }
  .app:not([data-review-motion]) :is(.product-primary, .save-button, .theme-toggle, .stats-chart-toggle,
    .voice-action, .chart-help-button, .onboarding-secondary):not(:disabled):active { scale: .97; }
  .app:not([data-review-motion]) :is(.chart-tabs > button, .segmented > button, .stats-ranges button,
    .product-segment button, .transaction-type label span, .history-filter, .chart-display-toggle) {
    transition: color var(--motion-quick) ease, background-color var(--motion-quick) ease, opacity var(--motion-quick) ease;
  }
}
.stats-bar { transform-origin: center bottom; }

.app[data-review-motion] *, .app[data-review-motion] *::before, .app[data-review-motion] *::after {
  animation: none !important;
  transition: none !important;
}
.app[data-review-motion] .tiles.expenses[data-intro-pending] .tile::before { height: var(--fill, 0%); }
.app[data-review-motion] .dock-action:active,
.app[data-review-motion] .tile:has(.tile-link:active) :is(.tile-label, .tile-amount),
.app[data-review-motion] :is(.dock-tabs button, .swap, .history-icon-button, .product-menu summary, .product-create, .product-quiet-action):active .icon { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .app .dock-action:active,
  .app .tile:has(.tile-link:active) :is(.tile-label, .tile-amount),
  .app :is(.dock-tabs button, .swap, .history-icon-button, .product-menu summary, .product-create, .product-quiet-action):active .icon { transform: none; }
}
.app[data-review-glass] .glass, .app[data-review-glass] .period-list {
  background: var(--canvas);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.app[data-review-glass] .chart :is(.chart-content, .chart-selection) { background: var(--selected); -webkit-backdrop-filter: none; backdrop-filter: none; }

@media (min-width: 700px) {
  .review > header { padding: 5px 3px; }
  .review-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; }
  .review-grid label { margin-bottom: 4px; }
  .review .review-toggle { display: flex; align-items: center; gap: 6px; min-height: 30px; font-weight: 520; }
  .review-toggle input { accent-color: var(--forest); }
  .review-details { font-size: 13px; }
  .review-details summary { padding-block: 7px; cursor: pointer; }
  .review-details select { margin-block: 3px 6px; }
  #review-check { font-weight: 680; color: var(--positive); }
  #review-check-list { display: grid; gap: 4px; font-size: 12px; line-height: 1.3; }
  #review-check-list li[data-passed="true"] { color: var(--positive); }
  #review-check-list li[data-passed="false"] { color: var(--negative); }
}

@container (width < 19rem) {
  .tiles.expenses:not([data-count="2"]) .tile:not(:first-child) .tile-amount { font-size: 1.28rem; }
}
@media (prefers-reduced-motion: reduce) {
  .product-view:not([hidden]) { animation: none; }
}

.tiles.expenses:not([data-count="2"]) .tile:first-child .tile-amount[data-compact] { font-size: clamp(1.2rem, 7.35cqw, 1.74rem); }
.tiles.expenses .tile-amount { white-space: normal; overflow-wrap: anywhere; }


/* Floating controls share a quiet surface and the dock’s moving selection. */
.segmented {
  --segment-columns: 2;
  --segment-index: 0;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(var(--segment-columns), minmax(0, 1fr));
  align-items: stretch;
  gap: 0;
  margin-inline: 0;
  padding: 3px;
  border-radius: 25px;
}
:is(.budget-segment, .history-segment) { --segment-columns: 3; }
.segmented:has(> button:nth-child(2)[aria-pressed="true"]),
.segmented:has(> label:nth-last-child(1) input:checked) { --segment-index: 1; }
.segmented:has(> button:nth-child(3)[aria-pressed="true"]) { --segment-index: 2; }
.segmented::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 3px auto 3px 3px;
  width: calc((100% - 6px) / var(--segment-columns));
  border-radius: 20px;
  background: var(--control-selection, #27323813);
  transform: translateX(calc(var(--segment-index) * 100%));
  transition: transform var(--motion-select) var(--ease-settle);
}
.segmented > button {
  min-height: 44px;
  min-width: 0;
  padding: 5px 4px;
  border-radius: 20px;
  color: var(--ink);
  font-size: .9rem;
  line-height: 1.2;
  overflow-wrap: break-word;
}
.segmented > button[aria-pressed="true"] { color: var(--deep); font-weight: 690; }
.history-segment { background: var(--history-segment-track); }
.history-segment::before {
  background: var(--history-segment-selection);
  box-shadow: var(--history-segment-shadow);
}
.history-segment > button { color: var(--muted); }
.history-segment > button[aria-pressed="true"] { color: var(--history-filter-ink); }
.history-controls .history-filters { padding-block: 4px 1px; }
.history-controls .history-filter { border-radius: 14px; box-shadow: none; }
.segmented > label { min-width: 0; }
.transaction-type.segmented label > span { min-height: 44px; border-radius: 20px; }
:is(.product-month, .history-month-button, .period-button) { box-shadow: none; }
.history-month-button { max-width: 100%; padding-inline: 6px; border-radius: 16px; text-align: start; font-size: .9375rem; }
.history-month-button span { min-width: 0; overflow-wrap: anywhere; }
.history-month-button .icon { flex: none; }
.product-create, .product-quiet-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 5px 12px 5px 6px;
  border-radius: 24px;
  color: var(--deep);
  font-size: .9rem;
  line-height: 1.2;
  font-weight: 650;
}
.product-create-icon { width: 30px; height: 30px; border-radius: 50%; }
.product-quiet-action { padding-inline: 14px; background: var(--control-selection, #27323813); }
:is(.product-create, .product-quiet-action):active { filter: brightness(.94); }

.first-steps {
  display: grid;
  justify-items: start;
  gap: 10px;
  margin-top: 17px;
  padding: clamp(14px, 4cqw, 18px);
  border-radius: 20px;
  border: 1px solid var(--product-rule);
  background: color-mix(in srgb, var(--product-active) 57%, var(--canvas));
}
.first-steps h2 {
  color: var(--deep);
  font-weight: 720;
  font-size: clamp(1.2rem, 5.8cqw, 1.55rem);
  line-height: 1.12;
  letter-spacing: -.027em;
  overflow-wrap: anywhere;
}
.first-steps p {
  color: var(--ink);
  font-size: .92rem;
  line-height: 1.4;
}
.first-steps .first-steps-example {
  max-width: 31ch;
  color: var(--muted);
  font-size: .8rem;
}
.first-steps .product-primary {
  padding-inline: 15px;
  text-align: start;
}
#history-first-record { padding: 0; text-align: start; }


.home[data-first-empty] .balances { margin-top: 24px; }

/* Alternate Home chart, enabled from the prototype review panel. */
.tile-progress { display: none; }

.chart[data-layout="bars"] {
  --chart-frost: #f7f9fa;
  --chart-line: #283c4c1a;
  --chart-sheen: linear-gradient(145deg, #ffffffbb, #e3ebef75);
  --chart-rim: #ffffffb0;
  --budget-bar: #a9c3b2;
  --budget-over-bar: #ff9098;
  --curve: 19px;
  border: 1px solid var(--chart-line);
  border-radius: var(--curve);
  background: var(--chart-frost);
}
[data-theme="dark"] .chart[data-layout="bars"] {
  --chart-frost: var(--chart-idle);
  --chart-line: #b7cce048;
  --chart-sheen: var(--chart-idle);
  --chart-rim: #d6edf819;
  --budget-bar: var(--dark-progress);
  --budget-over-bar: var(--dark-progress-coral);
}
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .app:not([data-review-glass]) .chart[data-layout="bars"] {
    background: var(--chart-sheen);
    box-shadow: inset 0 1px var(--chart-rim);
    -webkit-backdrop-filter: blur(18px) saturate(115%);
    backdrop-filter: blur(18px) saturate(115%);
  }
}
@media (prefers-reduced-transparency: reduce) {
  .app:not([data-review-glass]) .chart[data-layout="bars"] {
    background: var(--chart-frost);
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
.chart[data-layout="bars"] .chart-content { padding: 8px 7px 8px; }
.chart[data-layout="bars"] :is(.chart-selection, .chart-content) {
  background-image: none;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.chart[data-layout="bars"] .chart-heading { min-height: 42px; }

.chart[data-layout="bars"] .tiles .tile {
  justify-content: center;
  gap: 4px;
  padding: 6px clamp(6px, 2.1cqw, 11px);
  border: 0;
  border-radius: 12px;
  background: var(--fill-color);
}
.chart[data-layout="bars"] .tiles:where(:not([data-count="2"])) .tile:first-child {
  padding: 9px clamp(8px, 2.5cqw, 12px);
  color: #f7fbff;
  --muted: #c3d5e0;
  background: linear-gradient(145deg, #213d51, #142b3e);
}
.chart[data-layout="bars"] .tiles:is([data-count="3"], [data-count="4"]) .tile:first-child { padding-block-start: 25px; }
.chart[data-layout="bars"] .tiles:where(:not([data-count="2"])) .tile:first-child :is(.tile-label, .tile-amount) { color: inherit; }
.chart[data-layout="bars"] .tiles.expenses .tile::before { content: none; }
.chart[data-layout="bars"] .tiles .tile-amount { white-space: nowrap; }
.chart[data-layout="bars"] .tiles:where(:not([data-count="2"])) .tile:first-child .tile-label .icon { width: 21px; height: 21px; }
.chart[data-layout="bars"] .tiles.income:is([data-count="3"], [data-count="4"]) .tile:first-child .tile-label { align-items: flex-start; }
.chart[data-layout="bars"] .tiles.income:is([data-count="3"], [data-count="4"]) .tile:first-child .tile-label .icon { width: 26px; height: 26px; }
.chart[data-layout="bars"] .tiles:is([data-count="3"], [data-count="4"]) .tile:first-child .tile-amount:not([data-compact]) { font-size: clamp(1.75rem, 9.25cqw, 2.4rem); }
.chart[data-layout="bars"] .tiles.expenses:where(:not([data-count="2"])) .tile:first-child .tile-label { font-size: .8125rem; }
.chart[data-layout="bars"] .tiles.expenses:where(:not([data-count="2"])) .tile:first-child:not([data-over]) .tile-budget-status { color: #c3d5e0; }
.chart[data-layout="bars"] .tile-figure {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.chart[data-layout="bars"] .tile-figure .tile-amount { flex-shrink: 0; max-width: 100%; }
.chart[data-layout="bars"] .tile-figure .tile-budget-status {
  position: static;
  align-self: center;
  flex-wrap: nowrap;
  min-width: 0;
  max-width: none;
  padding: 0 3px;
  overflow: hidden;
  color: #921e32;
  background: #ffdcdf;
}
@container (width >= 19rem) {
  .chart[data-layout="bars"] .tiles:is([data-count="3"], [data-count="4"]) .tile:first-child .tile-figure .tile-budget-status {
    position: absolute;
    inset: 7px 7px auto auto;
    max-width: calc(100% - 14px);
    padding-block: 1px;
  }
}
.chart[data-layout="bars"] .tile-budget-status .icon { flex: none; }
.chart[data-layout="bars"] .tile-budget-excess { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart[data-layout="bars"] .tile:not(:first-child) .tile-budget-excess,
.chart[data-layout="bars"] .tiles[data-count="2"] .tile-budget-excess { display: none; }

.chart[data-layout="bars"] .tile-progress { display: grid; gap: 4px; width: 100%; }
.chart[data-layout="bars"] .tile-progress-caption { font-size: .75rem; line-height: 1.15; }
.chart[data-layout="bars"] .tile:not(:first-child) .tile-progress-caption,
.chart[data-layout="bars"] .tiles[data-count="2"] .tile-progress-caption { display: none; }
.chart[data-layout="bars"] .tile-progress-track {
  display: block;
  height: 6px;
  overflow: hidden;
  border-radius: 9px;
  background: #455f72;
}
.chart[data-layout="bars"] :where(.tiles:not([data-count="2"])) .tile:first-child .tile-progress { margin-top: 6px; }
.chart[data-layout="bars"] .tiles:is([data-count="3"], [data-count="4"]) .tile:first-child .tile-progress { margin-top: clamp(6px, 2.2cqw, 10px); }
.chart[data-layout="bars"] :where(.tiles:not([data-count="2"])) .tile:first-child .tile-progress-track { height: 9px; background: #3b5668; }
.chart[data-layout="bars"] .tile-progress-fill {
  display: block;
  width: var(--fill);
  height: 100%;
  border-radius: inherit;
  background: var(--budget-bar);
}
.chart[data-layout="bars"] .tile[data-budget-exceeded] .tile-progress-fill { background: var(--budget-over-bar); }

.chart-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr));
  gap: 0 9px;
  margin: 8px 3px 0;
  border-top: 1px solid var(--product-rule);
}
.chart-action {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 5px 4px;
  text-align: start;
  border-radius: 8px;
  color: var(--deep);
  line-height: 1.2;
}
.chart-action[data-list-overflow] { grid-column: 1 / -1; }
.chart-action:active { background: var(--selected); }
.chart-action-icon { width: 17px; height: 17px; color: var(--positive); }
.chart-action-arrow { width: 13px; height: 13px; color: var(--muted); }
.chart-action span { overflow-wrap: break-word; }
@media (hover: hover) {
  .chart-action:hover { background: var(--selected); }
}

@keyframes budget-bar-fill { from { width: var(--fill-start, 0%); } }
@media (prefers-reduced-motion: no-preference) {
  .chart[data-layout="bars"] .tiles[data-intro-pending] .tile-progress-fill { width: 0; }
  .chart[data-layout="bars"] .tile[data-fill-update] .tile-progress-fill {
    --fill-start: var(--previous-fill);
    animation: budget-bar-fill 470ms var(--ease) var(--motion-dismiss) backwards;
  }
  .chart[data-layout="bars"] .tiles.introducing .tile-progress-fill {
    --fill-start: 0%;
    animation: budget-bar-fill 600ms var(--ease);
  }
  .app[data-review-motion] .chart[data-layout="bars"] .tiles[data-intro-pending] .tile-progress-fill { width: var(--fill); }
}
@container (width < 19rem) {
  .chart[data-layout="bars"] .tiles:is([data-count="3"], [data-count="4"]) .tile:first-child { padding-block-start: 12px; }
}
.goal-last-amount { display: block; margin-top: 3px; color: var(--muted); font-size: var(--text-secondary); }
.goal-plan-note { margin-top: 13px; color: var(--muted); font-size: var(--text-secondary); line-height: 1.45; }

@container (19rem <= width <= 22rem) {
  .tiles.expenses:is([data-count="3"], [data-count="4"]) .tile:first-child .tile-label { gap: 4px; font-size: .78125rem; }
  .tiles.expenses:is([data-count="3"], [data-count="4"]) .tile:first-child .tile-label .icon { width: 16px; height: 16px; }
}

@keyframes tile-rank-arrive {
  from { opacity: .25; transform: translateY(var(--rank-offset, 7px)); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: no-preference) {
  .tile[data-rank-change="down"] { --rank-offset: -7px; }
  .tile[data-rank-change] :is(.tile-label, .tile-amount, .tile-progress) {
    animation: tile-rank-arrive 390ms var(--ease-settle) 55ms both;
  }
}

[data-theme="dark"] .quick-actions .save-button:not(:disabled) { background: var(--product-button); }
[data-theme="dark"] .save-button { background: var(--product-button); }
[data-theme="dark"] .app .chart[data-layout="bars"] {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
[data-theme="dark"] .chart[data-layout="bars"] .tiles:where(:not([data-count="2"])) .tile:first-child { background: #1e374b; }
[data-theme="dark"] .chart[data-layout="bars"] .tile .tile-progress-track { background: var(--dark-progress-track); }

.chart-display-tools { display: flex; align-items: center; flex: none; }
.chart-display-toggle {
  display: grid;
  place-items: center;
  width: 72px;
  min-height: 44px;
  border-radius: 22px;
  color: var(--muted);
}
.chart-toggle-track {
  --toggle-surface: #f8fbfcaf;
  --toggle-edge: #536c7b2b;
  --toggle-rim: #ffffffc9;
  --toggle-thumb: linear-gradient(165deg, #fffffff2, #e5eef0d9);
  --toggle-solid: #eff4f5;
  --toggle-solid-thumb: #fff;
  display: grid;
  grid-template-columns: 1fr 1fr;
  place-items: center;
  isolation: isolate;
  position: relative;
  width: 66px;
  height: 32px;
  padding: 3px;
  border-radius: 18px;
  background: var(--toggle-surface);
  box-shadow: inset 0 0 0 1px var(--toggle-edge), inset 0 1px var(--toggle-rim);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
}
.chart-toggle-track::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 3px auto 3px 3px;
  width: calc(50% - 3px);
  border-radius: 15px;
  background: var(--toggle-thumb);
  box-shadow: inset 0 0 0 1px var(--toggle-edge), inset 0 1px var(--toggle-rim), 0 1px 3px #1723301f;
  transition: transform 315ms var(--ease-settle);
}
.chart-display-toggle[aria-pressed="true"] .chart-toggle-track::before { transform: translateX(100%); }
.chart-display-toggle .icon { width: 14px; height: 14px; transition: color 160ms ease; }
.chart-display-toggle[aria-pressed="false"] [data-display="mosaic"],
.chart-display-toggle[aria-pressed="true"] [data-display="vertical"] { color: var(--deep); }
[data-theme="dark"] .chart-toggle-track {
  --toggle-surface: #141c258f;
  --toggle-edge: #9eb6cc46;
  --toggle-rim: #d0e9ff2a;
  --toggle-thumb: linear-gradient(165deg, #55667cdb, #344355e6);
  --toggle-solid: #222e3a;
  --toggle-solid-thumb: #4a5d72;
}
.app[data-review-glass] .chart-toggle-track {
  background: var(--toggle-solid);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.app[data-review-glass] .chart-toggle-track::before { background: var(--toggle-solid-thumb); }
@media (prefers-reduced-transparency: reduce) {
  .chart-toggle-track { background: var(--toggle-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .chart-toggle-track::before { background: var(--toggle-solid-thumb); }
}
.chart-display-tools .chart-help-button { width: 44px; }
@container (width < 19rem) {
  .chart-heading { flex-wrap: wrap; }
}

.chart[data-layout="list"] {
  --chart-line: #293d4c29;
  --rank-track: #dce5e9;
  --rank-fill: #51768b;
  --rank-income: #4b795f;
  --rank-excess: #bb4559;
  background: var(--chart-surface);
  border: 1px solid var(--chart-line);
  border-radius: var(--curve);
}
:root:not([data-theme="dark"]) .chart[data-layout="list"] {
  --chart-surface: #f6f8fa;
  --chart-idle: #dfe6ed;
  --chart-active-edge: #8fa2b17a;
  --ranking-surface: #fff;
  --ranking-interactive: #edf2f7;
}
[data-theme="dark"] .chart[data-layout="list"] {
  --chart-surface: #283541;
  --chart-line: #b7cce038;
  --ranking-surface: #334352;
  --ranking-interactive: #3c4e60;
  --rank-track: var(--dark-progress-track);
  --rank-fill: var(--dark-progress);
  --rank-income: var(--positive);
  --rank-excess: var(--dark-progress-coral);
}
.chart[data-layout="list"] :is(.chart-selection, .chart-content) { box-shadow: none; background-image: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.chart[data-layout="list"] .chart-content { padding: 8px; }
.category-ranking { display: grid; gap: 5px; list-style: none; padding: 0; margin: 3px 0 0; }
.category-ranking .ranking-group-heading { padding: 8px 8px 0; }
.ranking-group-heading h3 { color: var(--muted); font-size: .8rem; font-weight: 680; line-height: 1.3; }
.ranking-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  width: 100%;
  min-height: 44px;
  text-align: start;
  gap: 6px 8px;
  padding: 9px 8px;
  border-radius: 10px;
  background: var(--ranking-surface);
  box-shadow: inset 0 0 0 1px var(--chart-line);
}
.ranking-row:is(:focus-visible, :active) { background: var(--ranking-interactive); }
@media (hover: hover) {
  .ranking-row:hover { background: var(--ranking-interactive); }
}
.ranking-icon { width: 30px; border-radius: 9px; }
.ranking-icon .icon { width: 17px; height: 17px; }
.ranking-name { font-size: .93rem; font-weight: 680; overflow-wrap: normal; }
.ranking-value { font-size: .94rem; font-weight: 690; letter-spacing: -.02em; white-space: nowrap; }
.ranking-arrow.icon { width: 13px; height: 13px; color: var(--muted); }
.ranking-track, .ranking-note { grid-column: 2 / -2; }
.ranking-track { display: block; height: 7px; border-radius: 99px; background: var(--rank-track); }
.ranking-fill { display: block; height: 100%; border-radius: inherit; background: var(--rank-fill); }
[data-selected="income"] .ranking-fill { background: var(--rank-income); }
.ranking-fill[data-over] { background: var(--rank-excess); }
.ranking-note { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 3px 8px; color: var(--muted); font-size: .78rem; line-height: 1.3; }
.ranking-budget-state { color: var(--ink); font-weight: 620; }
.ranking-over-label { color: var(--negative); font-weight: 660; }
@container (width < 21rem) {
  .ranking-row { grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 8px; }
  .ranking-arrow.icon { grid-area: 1 / 3; }
  .ranking-value { grid-column: 2; grid-row: 2; white-space: normal; overflow-wrap: break-word; }
  .ranking-track, .ranking-note { grid-column: 2 / -1; }
}

[data-theme="dark"] .chart .chart-selection,
:root:not([data-theme="dark"]) .chart[data-layout="list"] .chart-selection {
  box-shadow: inset 1px 0 var(--chart-active-edge), inset -1px 0 var(--chart-active-edge), inset 0 1px var(--chart-active-edge);
}
[data-theme="dark"] .chart .chart-content,
:root:not([data-theme="dark"]) .chart[data-layout="list"] .chart-content {
  box-shadow: inset 1px 0 var(--chart-active-edge), inset -1px 0 var(--chart-active-edge), inset 0 -1px var(--chart-active-edge);
}
[data-theme="dark"] .chart-tabs button:not([aria-pressed="true"]),
:root:not([data-theme="dark"]) .chart[data-layout="list"] .chart-tabs button:not([aria-pressed="true"]) { color: var(--muted); }
:root:not([data-theme="dark"]) .chart-toggle-track {
  --toggle-thumb: linear-gradient(165deg, #edf2f6, #d3dfe8);
  --toggle-solid-thumb: #dbe5ed;
}
:root:not([data-theme="dark"]) .chart-display-toggle[aria-pressed="false"] [data-display="mosaic"],
:root:not([data-theme="dark"]) .chart-display-toggle[aria-pressed="true"] [data-display="vertical"] { color: #344b5e; }
[data-theme="dark"] .chart-tabs button[aria-pressed="true"] { color: var(--deep); }

@media (min-width: 700px) {
  .review-designs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    margin-bottom: 5px;
  }
  .review .review-designs button {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 5px;
    min-height: 65px;
    padding: 5px 2px;
    line-height: 1.2;
    font-size: 12px;
    font-weight: 580;
  }
  .review .review-designs button[aria-pressed="true"] {
    border-color: var(--positive);
    background: color-mix(in srgb, var(--positive) 11%, var(--canvas));
    font-weight: 720;
  }
  .review-design-preview {
    display: grid;
    gap: 2px;
    width: 39px;
    max-width: 100%;
    height: 24px;
  }
  .mosaic-preview { grid-template-columns: 1.45fr 1fr; grid-template-rows: 1fr 1fr; }
  .mosaic-preview i { position: relative; border-radius: 3px; background: var(--blue); }
  .mosaic-preview i:first-child { grid-row: span 2; background: var(--sage); }
  .mosaic-preview i:last-child { background: var(--sand); }
  .fill-preview i { border: 1px solid currentColor; background: linear-gradient(to top, var(--blue) 55%, transparent 55%); }
  .fill-preview i:first-child { background: linear-gradient(to top, var(--sage) 70%, transparent 70%); }
  .fill-preview i:last-child { background: linear-gradient(to top, var(--sand) 40%, transparent 40%); }
  .bars-preview i::after {
    position: absolute;
    inset: auto 2px 2px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    content: "";
  }
  .list-preview { align-content: center; gap: 4px; }
  .list-preview i {
    width: 100%;
    height: 4px;
    border-radius: 3px;
    background: linear-gradient(to right, var(--positive) var(--sample), var(--blue) var(--sample));
  }
  .list-preview i:nth-child(1) { --sample: 72%; }
  .list-preview i:nth-child(2) { --sample: 54%; }
  .list-preview i:nth-child(3) { --sample: 36%; }
}

[data-theme="dark"] .app { --product-button: var(--soft); }
[data-theme="dark"] .product-create .product-create-icon,
[data-theme="dark"] .goals-heading .product-quiet-action .icon,
[data-theme="dark"] .chart-display-toggle[aria-pressed="false"] [data-display="mosaic"],
[data-theme="dark"] .chart-display-toggle[aria-pressed="true"] [data-display="vertical"] { color: #b2ccae; }
[data-theme="dark"] .product-create .product-create-icon { background: var(--selected); }

[data-theme="dark"] .goal-card {
  background: color-mix(in srgb, var(--product-tone, var(--product-active)) 58%, #161a1d);
}
[data-theme="dark"] :is(.product-icon, .transaction-icon, .quick-category-icon) {
  background: color-mix(in srgb, var(--product-tone, var(--fill-color, var(--soft))) 28%, #f7f5ef);
  color: #121619;
}
[data-theme="dark"] .tile-label .icon { color: #fff; stroke-width: 2.2; }
[data-theme="dark"] .payment-row[data-today] { background: #33271a; }
[data-theme="dark"] .tile[data-group-key="entertainment"] { --fill-color: #3c6090; }
[data-theme="dark"] .chart[data-layout="bars"] .tiles:where(:not([data-count="2"])) .tile:first-child { background: #173b53; }
[data-theme="dark"] .chart[data-layout="bars"] .tiles .tile[data-group-key="entertainment"] { background: var(--fill-color); }


@media (min-width: 700px) {
  .review-disclosure {
    min-width: 0;
    border: 1px solid #c9d0d0;
    border-radius: 12px;
    background: var(--canvas);
  }
  [data-theme="dark"] .review-disclosure { border-color: var(--edge); }
  .review-disclosure > summary {
    display: list-item;
    min-height: 44px;
    padding: 12px 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
  }
  .review-disclosure-body { display: grid; gap: 6px; padding: 0 10px 10px; }
  .review-disclosure:not([open]) > .review-disclosure-body { display: none; }
}

/* Keep budget details inside the shortest slot in either layout. */
.tiles:is([data-count="3"], [data-count="4"]) .tile:last-child,
.chart[data-layout="bars"] .tiles:is([data-count="3"], [data-count="4"]) .tile:last-child {
  padding-block: 2px;
  row-gap: 1px;
}

#quick-direction { margin: 0 0 7px; font-weight: 650; }
.transaction-type:not(:has(input:checked))::before { opacity: 0; }
.quick-details { margin-block: 10px 3px; }
.quick-date input { position: absolute; inset: 0; width: 100%; height: 100%; min-width: 0; opacity: 0; cursor: pointer; }
.quick-date input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; }
#history-search-box { margin: 8px 0; }
#history-search { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--history-edge); border-radius: 15px; background: var(--history-chip); font-size: 1rem; }
#history-category-filter.is-active .history-filter-chevron { display: none; }
#onboarding-unknown-balance { min-height: 44px; font-weight: 650; }
.budget-category-choices { display: grid; }
.budget-category-choices button { display: flex; align-items: center; gap: 10px; min-height: 48px; text-align: start; }
.budget-category-choices .product-icon { width: 32px; height: 32px; flex-basis: 32px; }
.budget-remove { min-height: 44px; color: var(--negative); }

.stats { --stats-line: var(--history-edge, #d9dfdb); }
.stats > header { margin-bottom: 14px; }
.stats-panel, .stats-metric, .stats-insight { border: 1px solid var(--stats-line); border-radius: 16px; }
.stats-panel { padding: 13px 10px 11px; background: var(--canvas); }
.stats-chart-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-inline: 3px; }
.stats-chart-heading h2 { font-size: 1.15rem; letter-spacing: -.025em; }
.stats-chart-toggle { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 11px; border: 1px solid var(--stats-line); background: var(--selected); color: var(--muted); }
.stats-chart-toggle .icon { width: 19px; height: 19px; }
.stats-chart-toggle[aria-pressed="true"] { color: var(--positive); }
.stats-chart-toggle:disabled { opacity: .45; }
.stats-ranges {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
  padding: 3px;
  margin-top: 9px;
  background: var(--selected);
  border-radius: 13px;
}
.stats-ranges button { min-height: 44px; padding-inline: 2px; border-radius: 10px; color: var(--muted); font-size: .81rem; line-height: 1.15; }
.stats-ranges button[aria-pressed="true"] { color: var(--deep); background: var(--canvas); box-shadow: 0 0 0 1px var(--stats-line); font-weight: 720; }
.stats-caption { margin: 11px 3px 2px; color: var(--muted); font-size: .76rem; }
.stats-plot { position: relative; margin-top: 12px; }
.stats-overlay { position: absolute; z-index: 1; inset: 0; width: 100%; height: 116px; pointer-events: none; }
.stats-overlay path { fill: none; vector-effect: non-scaling-stroke; }
.stats-trend { stroke: var(--positive); stroke-width: 2px; stroke-linejoin: round; }
.stats-budget-line { stroke: var(--negative); stroke-width: 1.5px; stroke-dasharray: 4 4; }
.stats-chart {
  display: grid;
  grid-template-columns: repeat(var(--stats-columns), minmax(0, 1fr));
  background-image: repeating-linear-gradient(to top, var(--stats-line) 0 1px, transparent 1px 33.33%);
  background-repeat: no-repeat;
  background-size: 100% 116px;
}
.stats-month { display: grid; grid-template-rows: 116px minmax(22px, auto); min-width: 0; border-radius: 5px; }
.stats-track { position: relative; display: flex; align-items: end; justify-content: center; padding-inline: 2px; }
.stats-bar { width: min(73%, 31px); height: max(2px, var(--stats-height)); background: var(--sage); border-radius: 4px 4px 2px 2px; }
.stats-month[aria-pressed="true"] .stats-bar { background: var(--positive); }
.stats-month[data-no-records] .stats-bar { background: transparent; border-bottom: 2px dotted var(--muted); }
.stats-month[data-over-reference][aria-pressed="true"] .stats-bar { background: var(--negative); }
.stats-chart[data-style="line"] .stats-month:not([data-no-records]) .stats-bar {
  position: absolute;
  z-index: 2;
  inset-block-end: var(--stats-height);
  width: 7px;
  height: 7px;
  translate: 0 50%;
  border-radius: 50%;
  background: var(--positive);
}
.stats-chart[data-style="line"] .stats-month[aria-pressed="true"] .stats-bar { width: 10px; height: 10px; outline: 2px solid var(--canvas); }
.stats-chart[data-style="line"] .stats-month[data-over-reference][aria-pressed="true"] .stats-bar { background: var(--negative); }
.stats-tick { font-size: clamp(.58rem, 2.75cqw, .73rem); padding-top: 5px; color: var(--muted); }
.stats-selected { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 3px 9px; margin-top: 4px; padding: 8px 3px 0; border-top: 1px solid var(--stats-line); font-size: .846rem; }
.stats-selected:empty { display: none; }
.stats-selected > span, .stats-selected > div { display: grid; gap: 2px; }
.stats-selected > div { text-align: end; }
.stats-selected :is(small, div > span) { color: var(--muted); font-size: .75rem; }
.stats-chart-hint { margin-top: 3px; }
.stats-summary { margin-top: 15px; }
.stats-summary > h2 { margin: 0 2px 5px; font-size: .96rem; }
.stats-summary .stats-metrics { margin-top: 0; }
.stats-metric[data-metric="budget"] { grid-column: 1 / -1; }
.stats-budget-reference > div { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 3px 8px; }
.stats-budget-reference { position: relative; display: grid; gap: 2px; margin: 6px 3px 1px; color: var(--muted); font-size: .75rem; }
.stats-budget-reference[data-reference-line] { padding-inline-start: 24px; }
.stats-budget-reference[data-reference-line]::before { content: ""; position: absolute; inset-inline-start: 0; top: .62em; width: 17px; border-top: 2px dashed var(--negative); }
.stats-budget-reference strong { color: var(--deep); }
.stats-budget-reference small { font-size: inherit; }
.stats-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 9px; }
.stats-metric { display: grid; align-content: start; gap: 4px; padding: 10px 9px; background: var(--selected); }
.stats-metric[data-metric="savings"] { --stats-accent: var(--sage); }
.stats-metric[data-metric="average"] { --stats-accent: var(--sand); }
.stats-metric[data-metric="income"] { --stats-accent: var(--blue); }
.stats-metric[data-metric="budget"] { --stats-accent: var(--mauve); }
.stats-metric { background: color-mix(in srgb, var(--stats-accent) 26%, var(--canvas)); }
:root[data-theme="dark"] .stats-metric { background: color-mix(in srgb, var(--stats-accent) 15%, var(--canvas)); }
.stats-metric h2, .stats-insight h2 { font-size: .86rem; font-weight: 690; }
.stats-metric strong { font-size: clamp(.98rem, 5cqw, 1.33rem); letter-spacing: -.025em; overflow-wrap: anywhere; }
.stats-metric p, .stats-insight li { font-size: .75rem; color: var(--muted); }
.stats-insight { display: flex; align-items: flex-start; gap: 8px; margin-top: 9px; padding: 11px 10px; }
.stats-insight .icon { flex: none; width: 18px; color: var(--positive); }
.stats-insight ul { margin-top: 5px; padding-inline-start: 1em; }
.stats-insight li + li { margin-top: 5px; }
@container (width < 18rem) { .stats-metrics { grid-template-columns: minmax(0, 1fr); } }

.balance-secondary-month, .balance-card-mark, .balance-list-mark, .balance-switch-label, .balance-switch-track { display: none; }
.balances[data-columns] {
  --balance-panel: #eff5f3;
  --balance-edge: #dbe6e0;
  --balance-control: #ffffffbd;
  --balance-card-top: #262f43;
  --balance-card-base: #1c2635;
  --balance-card-edge: #43536c;
  --balance-card-glow: #748fbe1a;
  --balance-card-trace: #b2c8f014;
  --balance-mark-ink: #d3e2ff;
  --balance-mark-surface: #a5bee51c;
  --balance-card-shadow: #0005;
  --balance-card-ink: #f6f8fc;
  --balance-card-label: #c4d0e3;
  --balance-card-up: #a4efbb;
  --balance-card-down: #ffbcc8;
  display: grid;
  grid-template-columns: minmax(0, 1.23fr) minmax(0, 1fr);
  grid-template-areas: "actions actions" "primary controls";
  gap: 5px 8px;
  margin-top: 7px;
  text-align: start;
}
:root[data-theme="dark"] .balances[data-columns] {
  --balance-panel: #172428;
  --balance-edge: #32474a;
  --balance-control: #213338;
  --balance-card-top: #f3f5fa;
  --balance-card-base: #e4ecf7;
  --balance-card-edge: #cfd9e7;
  --balance-card-glow: #ffffff9e;
  --balance-card-trace: #607ba51c;
  --balance-mark-ink: #3e5578;
  --balance-mark-surface: #ffffff82;
  --balance-card-shadow: #1b2d461a;
  --balance-card-ink: #182334;
  --balance-card-label: #485264;
  --balance-card-up: #276137;
  --balance-card-down: #a2263d;
}
.balances[data-columns] .balance-primary {
  position: relative;
  isolation: isolate;
  grid-area: primary;
  grid-template-rows: 1fr auto auto auto;
  justify-items: start;
  min-width: 0;
  min-height: 147px;
  padding: 12px clamp(10px, 3.1cqw, 15px);
  border: 1px solid var(--balance-card-edge);
  border-radius: 20px;
  background: radial-gradient(ellipse at 100% 0%, var(--balance-card-glow), transparent 72%),
    linear-gradient(148deg, var(--balance-card-top), var(--balance-card-base) 75%);
  box-shadow: 0 8px 16px var(--balance-card-shadow);
  color: var(--balance-card-ink);
}
.balances[data-columns] .balance-primary::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  background: repeating-radial-gradient(ellipse 93px 83px at 108% -13%,
    var(--balance-card-trace) 0 1px, transparent 2px 11px);
  mask-image: linear-gradient(150deg, transparent 20%, #000 52%, transparent 83%);
  pointer-events: none;
}
.balances[data-columns] .balance-card-mark {
  display: grid;
  align-self: start;
  place-items: center;
  width: 31px;
  height: 31px;
  margin-bottom: 9px;
  border: 1px solid var(--balance-card-edge);
  border-radius: 10px;
  background: var(--balance-mark-surface);
  color: var(--balance-mark-ink);
}
.balance-card-mark .icon { width: 17px; height: 17px; }
.balances[data-columns] .balance-label {
  max-inline-size: 100%;
  color: var(--balance-card-label);
  font-size: .8rem;
  font-weight: 620;
  overflow-wrap: anywhere;
}
.balances[data-columns] .balance-amount {
  max-inline-size: 100%;
  margin-top: 4px;
  font-size: clamp(1.23rem, 7.8cqw, 2.15rem);
  font-weight: 720;
  letter-spacing: -.053em;
  white-space: normal;
  overflow-wrap: anywhere;
}
.balances[data-columns] .balance-amount[data-wide-amount] { font-size: clamp(1.03rem, calc(10.7cqw - 14px), 1.93rem); }
.balances[data-columns] .balance-amount.positive { color: var(--balance-card-up); }
.balances[data-columns] .balance-amount.negative { color: var(--balance-card-down); }
.balances[data-columns] .currency { color: var(--balance-card-label); font-size: .67rem; font-weight: 620; }
.balances[data-columns] .balance-actions {
  position: relative;
  inset: auto;
  z-index: 1;
  grid-area: actions;
  justify-self: end;
  gap: 8px;
}
.balances[data-columns] .balance-actions::before {
  content: "";
  position: absolute;
  inset-block: 14px;
  inset-inline-start: 50%;
  border-inline-start: 1px solid var(--balance-edge);
  pointer-events: none;
}
.balances[data-columns] .balance-actions button { border-radius: 10px; }
.balances[data-columns] .balance-actions .icon { width: 20px; height: 20px; }
.balances[data-columns] .balance-row {
  grid-area: controls;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 1fr auto auto;
  gap: 8px;
  min-width: 0;
  margin-top: 0;
  padding: 12px 10px 7px;
  border: 1px solid var(--balance-edge);
  border-radius: 20px;
  background: var(--balance-panel);
}
.balances[data-columns] .balance-secondary {
  grid-row: 1;
  min-width: 0;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
  font-size: clamp(.91rem, 4.9cqw, 1.22rem);
  white-space: normal;
  overflow-wrap: anywhere;
}
.balances[data-columns] .balance-secondary strong { letter-spacing: -.045em; font-weight: 720; }
.balances[data-columns] .balance-secondary:has(#balance-secondary-total[hidden]) .balance-secondary-month,
.balances[data-columns] #balance-secondary-total:not([hidden]) {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 560;
}
.balances[data-columns] .period-holder { position: relative; grid-row: 2; }
.balances[data-columns] .period-button {
  width: 100%;
  min-height: 44px;
  height: auto;
  gap: 6px;
  padding-inline: 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
  font-size: .8rem;
}
.balances[data-columns] .period-button:active { background: var(--selected); }
.balances[data-columns] #period-label { flex: 1; overflow-wrap: anywhere; }
.balances[data-columns] .period-button .icon { width: 15px; color: var(--muted); }
.balances[data-columns] .period-list {
  inset-inline: auto 0;
  width: min(248px, calc(100cqw - 32px));
  transform: none;
}
.balances[data-columns] .swap {
  grid-row: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
  width: 100%;
  min-height: 44px;
  height: auto;
  padding: 3px 2px;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 700;
  text-align: start;
}
.balances[data-columns] .swap::before,
.balances[data-columns] .swap > .icon { display: none; }
.balances[data-columns] .swap::after {
  content: "";
  position: absolute;
  inset: -4px 2px auto;
  border-top: 1px solid var(--balance-edge);
  pointer-events: none;
}
.balances[data-columns] .balance-switch-label { display: inline; }
.balances[data-columns] .balance-switch-track {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  place-items: center;
  flex: 0 0 62px;
  height: 30px;
  border: 1px solid var(--balance-edge);
  border-radius: 99px;
  background: color-mix(in srgb, var(--balance-panel), var(--muted) 13%);
  color: var(--muted);
}
.balance-switch-track .icon {
  width: 15px;
  height: 15px;
  stroke-width: 1.65;
}
.balance-switch-track::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 2px auto 2px 2px;
  width: calc(50% - 4px);
  border-radius: 99px;
  background: linear-gradient(156deg, var(--balance-card-top), var(--balance-card-base));
  box-shadow: 0 1px 3px #18233440, inset 0 1px 0 #fff4;
  transition: transform var(--motion-quick) var(--ease-settle);
}
.swap[aria-checked="true"] .balance-switch-track::before { transform: translateX(calc(100% + 4px)); }
.swap[aria-checked="false"] .balance-switch-total,
.swap[aria-checked="true"] .balance-switch-month { color: var(--balance-card-ink); }
.balances[data-columns] .swap:active { background: var(--selected); }
.balances[data-columns] #onboarding-unknown-balance { grid-row: 1; font-size: .75rem; overflow-wrap: anywhere; }
@media (hover: hover) {
  .balances[data-columns] :is(.balance-actions button, .period-button, .swap):hover:not(:active) { background: var(--balance-control); }
}

.balances[data-rows] {
  --balance-list-edge: #dce5e2;
  --balance-list-base: #f7f9f8;
  --balance-list-primary: #f0f5f3;
  --balance-list-icon: #e4efeb;
  --balance-list-icon-ink: #365c55;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px 88px;
  grid-template-areas: "period swap actions" "primary primary primary" "secondary secondary secondary";
  margin-top: 15px;
  border: 1px solid var(--balance-list-edge);
  border-radius: 17px;
  background: var(--balance-list-base);
  text-align: start;
}
:root[data-theme="dark"] .balances[data-rows] {
  --balance-list-edge: #334244;
  --balance-list-base: #151d21;
  --balance-list-primary: #1c292c;
  --balance-list-icon: #28413f;
  --balance-list-icon-ink: #aedaca;
}
.balances[data-rows] .balance-row { display: contents; }
.balances[data-rows] .balance-actions { position: static; grid-area: actions; }
.balances[data-rows] .balance-actions .icon { width: 17px; height: 17px; }
.balances[data-rows] .period-holder { position: relative; grid-area: period; padding: 0 8px; }
.balances[data-rows] .period-button {
  min-height: 44px;
  padding-inline: 4px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
  font-size: .82rem;
}
.balances[data-rows] #period-label { overflow-wrap: anywhere; }
.balances[data-rows] .period-list {
  inset-inline: -1px auto;
  width: min(248px, calc(100cqw - 36px));
  transform: none;
}
.balances[data-rows] .swap { grid-area: swap; border-radius: 9px; }
.balances[data-rows] .swap::before { display: none; }
.balances[data-rows] .swap .icon { width: 17px; height: 17px; color: var(--muted); }
.balances[data-rows] :is(.period-button, .swap, .balance-actions button):active { background: var(--selected); }

.balances[data-rows] :is(.balance-primary, .balance-secondary) {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) minmax(0, 48%);
  align-items: center;
  justify-items: stretch;
  column-gap: 8px;
  min-height: 54px;
  padding: 8px 10px;
  border: 0;
  border-top: 1px solid var(--balance-list-edge);
  text-align: start;
}
.balances[data-rows] .balance-primary {
  grid-area: primary;
  grid-template-areas: "mark name amount" "mark currency amount";
  row-gap: 2px;
  background: var(--balance-list-primary);
}
.balances[data-rows] .balance-secondary {
  grid-area: secondary;
  grid-template-areas: "mark name amount";
  border-radius: 0 0 16px 16px;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
  white-space: normal;
}
.balances[data-rows] :is(.balance-card-mark, .balance-list-mark) {
  grid-area: mark;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--balance-list-icon);
  color: var(--balance-list-icon-ink);
}
.balances[data-rows] :is(.balance-card-mark, .balance-list-mark) .icon { width: 16px; height: 16px; }
.balances[data-rows] :where(.balance-label, #balance-secondary-total, .balance-secondary-month) {
  grid-area: name;
  max-inline-size: 100%;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.balances[data-rows] .balance-secondary:has(#balance-secondary-total[hidden]) .balance-secondary-month { display: block; }
.balances[data-rows] .currency { grid-area: currency; margin: 0; font-size: .66rem; }
.balances[data-rows] :is(.balance-amount, .balance-secondary strong) {
  grid-area: amount;
  min-width: 0;
  margin: 0;
  text-align: end;
  font-size: clamp(1rem, 5.5cqw, 1.42rem);
  font-weight: 710;
  line-height: 1.12;
  white-space: normal;
  overflow-wrap: anywhere;
}
.balances[data-rows] #onboarding-unknown-balance { grid-area: secondary; border-top: 1px solid var(--balance-list-edge); }

.review-balance-layout { display: grid; gap: 4px; margin-bottom: 6px; }
.review-balance-layout > span { color: var(--muted); font-size: .82rem; font-weight: 650; }
.review-balance-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.review-balance-options button { min-height: 40px; font-size: .82rem; }
.review-balance-options button[aria-pressed="true"] { background: var(--selected); color: var(--deep); font-weight: 700; }
#review-home-design .review-balance-layout + .review-balance-layout {
  padding-top: 9px;
  border-top: 1px solid var(--edge, #dce5de);
}

