/* Card colors are independent of semantic amounts and the app appearance. */
:root[data-palette="petrol"] {
  --v2-tile-ink: #f9fcff;
  --v2-hero-start: #1d384a;
  --v2-hero-end: #142c3e;
  --v2-tone-1: #263f51;
  --v2-tone-2: #34566b;
  --v2-tone-3: #3f6174;
  --v2-outline: #9dbcc9;
}
:root[data-palette="mono"] {
  --v2-tile-ink: #fff;
  --v2-hero-start: #282828;
  --v2-hero-end: #151515;
  --v2-tone-1: #303030;
  --v2-tone-2: #424242;
  --v2-tone-3: #535353;
  --v2-outline: #a2a2a2;
}
:root[data-palette="sage"] {
  --v2-tile-ink: #f7fcf8;
  --v2-hero-start: #344c3d;
  --v2-hero-end: #233a2c;
  --v2-tone-1: #365441;
  --v2-tone-2: #42614c;
  --v2-tone-3: #4f6b56;
  --v2-outline: #a6c1a7;
}
:root[data-palette="categories"] {
  --v2-tile-ink: #fafcff;
  --v2-hero-start: #24475a;
  --v2-hero-end: #132731;
  --v2-tone-1: #354d5d;
  --v2-tone-2: #43677d;
  --v2-tone-3: #52758a;
  --v2-outline: #a6bac4;
  --sand: #cbbce6;
  --stone: #abc5ca;
}
:root[data-palette="categories"][data-theme="dark"] {
  --sand: #55466f;
  --stone: #3f5d60;
}
:root[data-palette] { --v2-hero: linear-gradient(145deg, var(--v2-hero-start), var(--v2-hero-end)); }

.home-header { grid-template-columns: auto minmax(0, 1fr) repeat(3, auto); }
.home-header .home-account { grid-area: auto; justify-self: end; min-height: 44px; padding-inline: 9px; }
.home-header .presentation-toggle .icon { width: 17px; height: 17px; stroke-width: 1.8; }
.presentation-toggle[aria-pressed="true"] { color: var(--deep); background: var(--selected); }
@container (width < 22rem) {
  .home-header { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .home-header .home-account { grid-area: 2 / 2 / 3 / -1; justify-self: start; }
}
:root[data-presentation] { background: var(--canvas); }
:root[data-presentation] .review { display: none; }
@media (min-width: 700px) {
  :root[data-presentation] .workspace { padding: 0; }
  :root[data-presentation] .app {
    --top-inset: env(safe-area-inset-top, 0px);
    --bottom-inset: env(safe-area-inset-bottom, 0px);
    --dock-inset: calc(10px + var(--bottom-inset));
    width: min(100%, max(430px, var(--review-width, 393px)));
    height: 100dvh;
    border-radius: 0;
    outline: 0;
    box-shadow: none;
  }
  :root[data-presentation] :is(.system-top, .system-bottom),
  :root[data-presentation] .sheet::after { display: none; }
  :root[data-presentation] .sheet { border-radius: 0; }
}
.options-trigger { font-weight: 650; }
.design-settings { display: grid; gap: 15px; padding-block: 8px 4px; }
.design-settings fieldset { min-width: 0; padding: 0; border: 0; }
.design-settings legend { padding: 0; margin-bottom: 7px; font-size: .95rem; font-weight: 700; }
.design-choices { display: grid; gap: 7px; }
.design-chart-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.v2-review-palettes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.design-options .desktop-design-setting { display: none; }
.load-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  margin-block: 9px 2px;
}
.load-presets button {
  min-height: 44px;
  padding: 4px 5px;
  border: 1px solid var(--product-rule);
  border-radius: 11px;
  background: var(--product-surface);
  color: var(--deep);
  font-size: .77rem;
  line-height: 1.15;
  font-weight: 670;
}
.load-presets button[aria-pressed="true"] {
  border-color: var(--forest);
  background: color-mix(in srgb, var(--forest) 13%, var(--canvas));
}
.design-choices button {
  display: grid;
  grid-auto-flow: row;
  place-content: center;
  justify-items: center;
  gap: 5px;
  min-height: 66px;
  padding: 7px 4px;
  border: 1px solid var(--product-rule);
  border-radius: 13px;
  background: var(--product-surface);
  color: var(--deep);
  font-size: .82rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.design-choices button[aria-pressed="true"] {
  border-color: var(--forest);
  background: color-mix(in srgb, var(--forest) 14%, var(--canvas));
  font-weight: 700;
}
.design-choices .icon { width: 20px; height: 20px; }
.v2-review-palettes i { display: block; width: 35px; height: 13px; border-radius: 9px; background: var(--swatch); }
.v2-review-palettes [data-v2-palette="mono"] { --swatch: linear-gradient(90deg,#242424 35%,#717171 35% 69%,#d4d4d4 69%); }
.v2-review-palettes [data-v2-palette="petrol"] { --swatch: linear-gradient(90deg,#1d384a 35%,#496779 35% 69%,#adc0cc 69%); }
.v2-review-palettes [data-v2-palette="sage"] { --swatch: linear-gradient(90deg,#263d30 35%,#56725d 35% 69%,#adc1b0 69%); }
.v2-review-palettes [data-v2-palette="categories"] { --swatch: linear-gradient(90deg,#81a48f 25%,#7da4c0 25% 50%,#9b9bcc 50% 75%,#bda1c7 75%); }
.design-settings-list {
  display: grid;
  padding-inline: 10px;
  border: 1px solid var(--product-rule);
  border-radius: 13px;
  background: var(--product-surface);
}
.design-settings-list label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-size: .875rem;
}
.design-settings-list label + label { border-top: 1px solid var(--product-rule); }
.design-settings-list select { min-width: 0; max-width: 37cqw; min-height: 44px; background: transparent; border: 0; }
.design-settings-list input { justify-self: end; accent-color: var(--forest); width: 19px; height: 19px; }

.chart {
  --chart-depth-offset: 4px;
  --chart-shadow-near: #24343f29;
  --chart-shadow-far: #24343f1a;
  --chart-depth-rim: #ffffffad;
  isolation: isolate;
}
.chart[data-selected="income"] { --chart-depth-offset: -4px; }
:root[data-theme="dark"] .chart {
  --chart-shadow-near: #0008;
  --chart-shadow-far: #0006;
  --chart-depth-rim: #e2efff24;
}
.chart .chart-tabs { z-index: 1; overflow: visible; }
.chart .chart-selection,
:root[data-theme="dark"] .chart .chart-selection {
  clip-path: inset(-24px -24px 0);
  box-shadow: 0 -3px 10px -2px var(--chart-shadow-near), 0 -8px 18px -5px var(--chart-shadow-far),
    inset 0 1px var(--chart-depth-rim);
}
.chart .chart-content,
:root[data-theme="dark"] .chart .chart-content {
  position: relative;
  box-shadow: var(--chart-depth-offset) 7px 14px -5px var(--chart-shadow-near),
    var(--chart-depth-offset) 15px 24px -10px var(--chart-shadow-far), inset 0 -1px var(--chart-depth-rim);
  transition: border-radius var(--motion-select) var(--ease-settle), box-shadow var(--motion-present) var(--ease-settle);
}

.chart .legend-outline { border-color: var(--v2-outline); }
.chart .legend-fill { background: var(--v2-tone-1); }
.chart .legend-available { background: var(--v2-tone-3); }
.chart .legend-over { background: var(--negative); }
/* The two chart views share category tones and budget states. */
/* Tones vary across categories while keeping the same palette family. */
.app :is(.tile, .product-card, .product-icon, .product-meter, .transaction-icon, .quick-category) {
  --card-tone: var(--v2-tone-1);
}
.app :is(.tile, .product-card, .product-icon, .product-meter, .transaction-icon, .quick-category):is([data-tone="mauve"], [data-tone="sand"], [data-tone="stone"], [data-tone="periwinkle"]) {
  --card-tone: var(--v2-hero-end);
}
.app :is(.tile, .product-card, .product-icon, .product-meter, .transaction-icon, .quick-category):is([data-tone="teal"], [data-tone="green"], [data-tone="rose"]) {
  --card-tone: var(--v2-tone-2);
}
.app .chart .tiles .tile {
  --tile-available: var(--v2-tone-3);
  --tile-edge: var(--v2-outline);
  --tile-color: linear-gradient(152deg, color-mix(in srgb, var(--card-tone), var(--v2-outline) 9%), var(--card-tone) 83%);
  color: var(--v2-tile-ink);
}
.app .chart .tiles .tile :is(.tile-label, .tile-amount) { color: inherit; }
.app .chart .tiles.income .tile { background: var(--tile-color); border-color: var(--card-tone); }
.app .chart .tiles.income .tile[data-group-key="salary"] { --tile-color: var(--v2-hero); }
.app .chart .tiles.expenses .tile { background: var(--tile-available); border-color: var(--tile-edge); }
.app .chart .tiles.expenses .tile::before { background: var(--tile-color); box-shadow: none; }
.app .chart .tiles.expenses .tile:not([data-budget]) { background: var(--tile-color); border-color: var(--card-tone); }
.app .chart .tiles.expenses .tile:not([data-budget])::before { content: none; }
.tile-alert {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: inherit;
}
.tile-alert-mark {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #b91e34;
  color: #fff;
  box-shadow: 0 2px 5px #2e07164d;
  font-size: .83rem;
  font-weight: 800;
  line-height: 1;
}
.tile-alert:focus-visible { outline-offset: -3px; }
.tile-alert:active .tile-alert-mark { background: #96182b; }
/* A warning has its own grid cell, including the full touch target. */
.chart:not([data-vertical]) .tiles.expenses:has(.tile-alert) {
  block-size: auto;
  min-block-size: max(218px, 13.625rem);
  grid-template-rows: minmax(min-content, 82fr) minmax(min-content, 68fr) minmax(min-content, 58fr);
}
.chart:not([data-vertical]) .tiles.expenses[data-count="3"]:has(.tile-alert) {
  min-block-size: max(147px, 9.1875rem);
  grid-template-rows: minmax(min-content, 80fr) minmax(min-content, 62fr);
}
.chart:not([data-vertical]) .tiles.expenses:is([data-count="1"], [data-count="2"]):has(.tile-alert) {
  min-block-size: max(112px, 7rem);
  grid-template-rows: minmax(min-content, 1fr);
}
.chart:not([data-vertical]) .tile:has(.tile-alert) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  grid-template-rows: auto auto;
  align-content: center;
  align-items: center;
  justify-content: stretch;
  gap: 9px 6px;
}
.tile[data-rank-change]:has(.tile-alert) { --rank-offset: 0px; }
.chart:not([data-vertical]) .tile:has(.tile-alert) .tile-label { grid-area: 1 / 1 / 2 / -1; }
.chart:not([data-vertical]) .tile:has(.tile-alert) .tile-label > span { min-width: 0; overflow-wrap: anywhere; }
.chart:not([data-vertical]) .tile:has(.tile-alert) .tile-amount {
  grid-area: 2 / 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chart:not([data-vertical]) .tile-alert { grid-area: 2 / 2; }
@container (width < 19rem) {
  .chart:not([data-vertical]) .tiles.expenses:is([data-count="3"], [data-count="4"]):has(.tile-alert) {
    grid-template-rows: none;
  }
  .chart:not([data-vertical]) .tiles.expenses:is([data-count="3"], [data-count="4"]) .tile:has(.tile-alert) {
    block-size: auto;
    min-block-size: max(86px, 5.375rem);
  }
  .chart:not([data-vertical]) .tiles.expenses:is([data-count="3"], [data-count="4"]) .tile:first-child:has(.tile-alert) {
    min-block-size: max(132px, 8.25rem);
  }
}
.budget-alert-detail { padding-block: 8px 12px; }
.budget-alert-detail + .budget-alert-detail { border-top: 1px solid var(--product-rule); }
.budget-alert-detail h3 { margin-bottom: 6px; font-size: 1.05rem; }
.budget-alert-detail .product-detail-list { margin-block: 0; }
.budget-alert-detail dd.negative { color: var(--negative); }
.chart[data-vertical] .tiles {
  display: grid; grid-template-columns: repeat(var(--column-count, 4), minmax(0, 1fr));
  grid-template-rows: auto; gap: clamp(3px, 1.4cqw, 7px); block-size: auto; min-block-size: 0;
}
.chart[data-vertical] .tiles[data-count="1"] { --column-count: 1; }
.chart[data-vertical] .tiles[data-count="2"] { --column-count: 2; }
.chart[data-vertical] .tiles[data-count="3"] { --column-count: 3; }
.app .chart[data-vertical] .tiles:is(.income, .expenses) .tile {
  align-items: stretch; justify-content: flex-start; grid-area: auto; padding: 3px 2px 6px; gap: 4px;
  border: 0; color: var(--deep); background: transparent; overflow: visible; text-align: center;
}
.chart[data-vertical] .tiles .tile .tile-label {
  display: block;
  min-width: 0;
  min-height: 1.2em;
  padding-inline: 0;
  font-size: clamp(.58rem, 2.6cqw, .72rem);
  font-weight: 650;
}
.chart[data-vertical] .tiles .tile .tile-label[data-long-label] {
  font-size: clamp(.5rem, 2.3cqw, .64rem);
  letter-spacing: -.025em;
}
.chart[data-vertical] .tile-label > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chart[data-vertical] .tiles[data-count="1"] .tile { max-inline-size: 9rem; justify-self: start; width: 100%; }
.chart[data-vertical] .tiles[data-count="1"] .tile[data-group-key="group:other"] { justify-self: end; }
.chart[data-vertical] .tiles[data-count="2"] .tile { max-inline-size: 10rem; width: 100%; justify-self: center; }
.chart[data-vertical] .tiles .tile::before { content: none; }
.tile-column {
  --column-min-height: max(5rem, clamp(89px, 23.4cqw, 104px));
  --column-height-range: clamp(68px, 22cqw, 96px);
  --column-color: linear-gradient(155deg, var(--card-tone), color-mix(in srgb, var(--card-tone), var(--v2-hero-end) 29%));
  position: relative;
  display: block;
  overflow: hidden;
  block-size: calc(var(--column-min-height) + var(--column-height-range) * var(--column-scale, 0));
  border: 1px solid var(--card-tone); border-radius: 14px; background: var(--column-color); color: var(--v2-tile-ink);
}
.chart[data-vertical] .tiles.income .tile[data-group-key="salary"] .tile-column { --column-color: var(--v2-hero); }
.chart[data-vertical] .tiles.expenses .tile[data-budget] .tile-column {
  border-color: var(--tile-edge);
  background: color-mix(in srgb, var(--v2-outline) 26%, var(--canvas));
}
:root[data-theme="dark"] .chart[data-vertical] .tiles.expenses .tile[data-budget] .tile-column {
  background: color-mix(in srgb, var(--v2-outline) 72%, var(--canvas));
}
.chart[data-vertical] .tiles.expenses .tile[data-budget] .tile-column::before {
  content: ""; position: absolute; inset: 0 0 auto; height: var(--fill, 0%);
  border-radius: 0 0 10px 10px;
  background: var(--column-color);
  box-shadow: inset 0 -1px #ffffff38;
}
.app .chart[data-vertical] .tiles .tile-column .icon {
  position: relative; display: block; margin: 8px auto 0; width: 19px; height: 19px;
  box-sizing: content-box; padding: 4px; border-radius: 10px;
  color: var(--v2-hero-end); background: var(--v2-tile-ink);
  box-shadow: 0 2px 5px #1322293b;
}
.chart[data-vertical] .tile:has(.tile-alert) .tile-column .icon { margin-inline-start: 5px; }
.chart[data-vertical] .tile-alert {
  position: absolute;
  inset-block-start: 3px;
  inset-inline-end: 2px;
  place-items: start end;
  padding: 5px 5px 0 0;
  border-radius: 14px;
}
@container (width <= 23rem) {
  .chart[data-vertical] .tiles[data-count="4"] .tile-column {
    --column-min-height: max(7rem, 112px);
  }
  .chart[data-vertical] .tiles[data-count="4"] .tile:has(.tile-alert) .tile-column .icon { margin: 45px auto 0; }
}
.app .chart[data-vertical] .tiles .tile .tile-column .tile-amount {
  position: absolute;
  inset: auto 2px 6px;
  display: block;
  margin: 0 auto;
  width: max-content;
  max-width: calc(100% - 4px);
  padding: 4px 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 7px;
  background: color-mix(in srgb, var(--card-tone), var(--v2-hero-end) 45%);
  color: var(--v2-tile-ink);
  font-size: clamp(.87rem, 3.75cqw, 1rem);
  line-height: 1.05;
  font-weight: 760;
}
.chart[data-vertical] .tile-link { z-index: 1; border-radius: 14px; }
@media (prefers-reduced-motion: no-preference) {
  .chart[data-vertical] .tiles.expenses[data-intro-pending] .tile[data-budget] .tile-column::before { height: 0; }
  .chart[data-vertical] .tiles.expenses.introducing .tile[data-budget] .tile-column::before { animation: budget-fill 540ms var(--ease); }
  .chart[data-vertical] .tiles.expenses .tile[data-fill-update] .tile-column::before {
    --fill-start: var(--previous-fill);
    animation: budget-fill 430ms var(--ease) var(--motion-dismiss) backwards;
  }
}
.app[data-review-motion] .tile-column::before { animation: none !important; }

#voice {
  --voice-surface: #101e23;
  --voice-control: #234641;
  --voice-outline: #9cc6bd;
  --voice-ink: #f5fffc;
}
#voice .sheet-body { background: radial-gradient(ellipse at 50% 9%, #17423d, transparent 64%), var(--voice-surface); }
#voice .voice-content { padding-block-start: 4px; gap: 10px; }
#voice .voice-orb { width: clamp(93px, 30cqw, 122px); }
#voice .voice-action {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  width: auto; min-height: 44px; padding: 8px 18px; border-radius: 24px;
  color: var(--voice-ink); background: var(--voice-control); box-shadow: inset 0 0 0 1px var(--voice-outline);
}
#voice .voice-action[aria-pressed="true"] { background: var(--voice-ink); color: var(--voice-surface); }
#voice .voice-action .icon { width: 17px; height: 17px; }
.voice-compose { display: grid; gap: 7px; width: 100%; padding-top: 6px; text-align: start; }
.voice-compose > label { font-size: .88rem; font-weight: 630; }
.voice-compose textarea {
  display: block; width: 100%; min-height: 59px; resize: vertical; padding: 9px 11px;
  border: 1px solid var(--voice-outline); border-radius: 12px; background: var(--voice-surface);
  color: var(--voice-ink); font: inherit; font-size: max(16px, 1rem);
}
.voice-compose textarea::placeholder { color: var(--voice-outline); opacity: 1; }
.voice-compose .voice-instruction { margin: 0; max-width: none; }
.voice-review {
  min-height: 44px; padding: 7px 15px; border-radius: 11px;
  color: var(--voice-surface); background: var(--voice-ink); font-weight: 720;
}
.voice-review:disabled { opacity: .55; cursor: default; }
#voice :focus-visible { outline-color: var(--voice-ink); }
#voice:focus-within .sheet-body { overflow: auto; }

/* Pagos and Metas share the header, overview, card, and options menu. */
.product-heading-with-action {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  min-height: 53px; gap: 8px; margin-block-end: 12px;
}
.product-heading-with-action .product-create { min-inline-size: 124px; }
.product-overview {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto); align-items: start;
  gap: 4px; min-height: 132px; padding: 11px 12px; margin: 0 2px 13px;
  border-radius: 16px;
}
.product-overview .product-summary { margin: 0; padding: 0; justify-items: start; gap: 4px; text-align: start; }
.product-overview .product-summary > strong { font-size: clamp(1.45rem, 7.5cqw, 2rem); }
.product-overview .product-summary p { color: var(--summary-muted); font-size: clamp(.76rem, 3.55cqw, .9rem); }
.product-overview .product-month, .product-overview-context { max-width: 31cqw; min-height: 44px; border-radius: 15px; }
.product-overview .product-month-display { padding-inline: 7px 20px; font-size: .75rem; }
.product-overview .product-month::after { right: 8px; width: 6px; height: 6px; }
.product-overview-context { display: grid; place-items: center; padding: 4px 8px; font-size: .76rem; font-weight: 600; }
.app .product-overview .product-month, .product-overview-context {
  border: 1px solid var(--summary-edge);
  background: color-mix(in srgb, var(--v2-hero-start) 88%, #fff);
  color: inherit;
  box-shadow: none;
}
.product-overview .product-month { color-scheme: dark; }
.product-overview .product-month:focus-within { outline-color: #fff; }
.app .product-feed .product-card {
  border: 1px solid color-mix(in srgb, var(--card-tone) 27%, var(--product-rule));
  border-radius: 16px;
  background: linear-gradient(145deg,
    color-mix(in srgb, var(--v2-outline) 28%, var(--product-surface)),
    color-mix(in srgb, var(--card-tone) 7%, var(--product-surface)));
  padding: 8px 10px;
}
.app :is(.product-icon, .transaction-icon, .quick-category[data-tone] .quick-category-icon) {
  background: color-mix(in srgb, var(--card-tone) 21%, var(--canvas));
  color: var(--deep);
}
.app .quick-category[data-tone] { background: color-mix(in srgb, var(--card-tone) 13%, var(--canvas)); }
.app .product-meter:not([data-over]) i { background: var(--card-tone); }
:root[data-theme="dark"] .app .product-meter:not([data-over]) i {
  background: color-mix(in srgb, var(--card-tone), var(--v2-outline) 58%);
}
.app .product-feed .payment-row[data-today] { box-shadow: inset 3px 0 0 var(--v2-outline); }
.product-card-header { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: center; gap: 2px; }
.product-card .product-row-main { min-height: 52px; }
.product-card .product-row-amount { font-size: clamp(.75rem, 3.9cqw, .98rem); }
.product-card .product-row-copy { overflow-wrap: anywhere; }
.product-card .product-row-main:focus-visible { outline-offset: -1px; border-radius: 8px; }
@container (max-width: 350px) {
  .product-card .product-row-main { gap: 6px; }
  .product-card .product-icon { flex-basis: 34px; inline-size: 34px; block-size: 34px; }
  .product-card .product-icon .icon { width: 18px; height: 18px; }
}

/* Read-only overlays for an excess or the categories grouped under Otros. */
.sheet[data-centered][open] { align-items: center; justify-content: center; }
.sheet[data-centered]::before {
  background: rgb(13 24 33 / 43%);
  -webkit-backdrop-filter: blur(10px) saturate(.8);
  backdrop-filter: blur(10px) saturate(.8);
}
.sheet[data-centered] .sheet-body {
  width: min(calc(100% - 32px), 340px);
  max-height: calc(100% - 40px);
  padding: 13px 16px 14px;
  border: 1px solid rgb(255 255 255 / 53%);
  border-radius: 25px;
  color: var(--deep);
  background: color-mix(in srgb, var(--canvas) 84%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  backdrop-filter: blur(22px) saturate(1.35);
  box-shadow: 0 17px 46px #0a182c3b, inset 0 1px #ffffff70;
  animation: glass-in var(--motion-present) var(--ease-settle) both;
}
.sheet[data-centered] .grabber { display: none; }
.sheet[data-centered] .product-sheet-header {
  border-bottom: 1px solid color-mix(in srgb, var(--deep) 14%, transparent);
  margin-bottom: 5px;
}
.sheet[data-centered] .product-sheet-header h2 { font-size: 1.11rem; }
.sheet[data-centered] .sheet-cancel {
  min-width: 55px;
  min-height: 44px;
  color: var(--deep);
  font-size: .82rem;
  font-weight: 650;
}
.sheet[data-centered].closing .sheet-body { animation: glass-out var(--motion-dismiss) var(--ease-exit) both; }
@keyframes glass-in { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }
@keyframes glass-out { to { opacity: 0; transform: scale(.97); } }
@media (prefers-reduced-motion: reduce) {
  .sheet[data-centered] .sheet-body { animation: none; }
}
.app[data-review-motion] .sheet[data-centered] .sheet-body { animation: none; }
.budget-alert-detail:last-child { padding-bottom: 2px; }
.budget-alert-detail h3 { font-size: .95rem; }

/* Summary cards share the dark accent of the selected palette. */
:is(.product-overview, .budget-hero, .history-summary, .overdue-stack-summary) {
  --summary-muted: color-mix(in srgb, #fff 86%, var(--v2-hero-start));
  --summary-edge: #ffffff36;
  --summary-positive: #55df75;
  --summary-negative: #ff9a94;
  border: 1px solid var(--summary-edge);
  background: var(--v2-hero);
  color: #fff;
}
:is(.product-overview, .history-summary, .overdue-stack-summary):focus-visible,
:is(.product-overview, .history-summary) :focus-visible { outline-color: #fff; }
.app .product-overview .product-meter { background: #ffffff33; }
.app .product-overview .product-summary .product-meter:not([data-over]) i {
  background: color-mix(in srgb, var(--v2-outline) 55%, #fff);
}

.stats-panel {
  border: 1px solid color-mix(in srgb, var(--v2-outline), var(--product-rule) 58%);
  border-radius: 18px;
  background: linear-gradient(148deg, color-mix(in srgb, var(--v2-outline) 23%, var(--canvas)), var(--canvas) 83%);
}
.stats { --stats-line: color-mix(in srgb, var(--v2-outline) 58%, var(--product-rule)); }
.stats-panel { padding: 14px 11px 12px; }
.stats-ranges { background: color-mix(in srgb, var(--v2-tone-1) 10%, var(--canvas)); }
.stats-ranges button { font-weight: 620; }
.stats-ranges button[aria-pressed="true"] { background: var(--v2-hero); color: var(--v2-tile-ink); }
.stats-bar { background: var(--v2-outline); border-radius: 7px 7px 3px 3px; }
.stats-month[aria-pressed="true"]:not([data-over-reference]) .stats-bar { background: var(--v2-hero); }
.stats-chart[data-style="line"] .stats-month[aria-pressed="true"]:not([data-over-reference]) .stats-bar { background: var(--v2-tone-2); }
.stats-trend { stroke: var(--v2-tone-2); }
[data-theme="dark"] .stats-trend { stroke: var(--v2-outline); }
.stats-summary .stats-metric, :root[data-theme="dark"] .stats .stats-metric {
  --stats-accent: var(--v2-outline);
  background: color-mix(in srgb, var(--stats-accent) 18%, var(--canvas));
  border-color: var(--stats-line);
}
.stats-metric h3 { margin: 0; font-size: .83rem; font-weight: 690; }
.stats-insight { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.stats-insight p { margin-top: 2px; font-size: .83rem; color: var(--muted); }
.stats-insight > strong { font-size: .87rem; text-align: end; overflow-wrap: anywhere; }
.budget-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; padding: 13px 11px; border-radius: 18px; }
.budget-hero > div { min-width: 0; }
.budget-hero > div + div { border-inline-start: 1px solid var(--summary-edge); padding-inline-start: 9px; }
.budget-hero span, .other-category-list small { display: block; font-size: .76rem; }
.budget-hero span { color: var(--summary-muted); }
.budget-hero strong { display: block; margin-top: 4px; font-size: clamp(1rem, 5cqw, 1.5rem); overflow-wrap: anywhere; }
.budget-warning { justify-content: start; border-radius: 13px; padding: 7px 10px; }
.app .product-feed .budget-row.product-card { padding: 7px 10px; }
.budget-row .budget-value { text-align: end; }
.budget-row .product-meter { margin: 3px 0 4px; }
.history-summary { padding: 12px 11px 8px; margin-bottom: 11px; border-radius: 18px; }
.history-summary-heading h2 { font-size: .91rem; }
.history-summary-heading p, .history-summary .history-breakdown button { color: var(--summary-muted); }
.history-summary .history-breakdown button + button { border-color: var(--summary-edge); }
.history-summary :is(.positive, [data-history-kind="income"] strong) { color: var(--summary-positive); }
.history-summary :is(.negative, [data-history-kind="expenses"] strong) { color: var(--summary-negative); }
.history-day ul { border: 1px solid var(--product-rule); border-radius: 15px; background: var(--product-surface); }
.history-day .transaction-open { padding: 7px 9px; }
.history-day .transaction-value { font-size: .92rem; }
.history-group-context {
  display: grid;
  width: 100%;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  padding: 8px 10px;
  border: 1px solid var(--product-rule);
  border-radius: 14px;
  background: var(--product-surface);
  text-align: start;
}
.history-group-context strong { display: block; font-size: .84rem; }
.history-group-context small { display: block; margin-top: 2px; font-size: .75rem; color: var(--muted); }
.other-group-icon { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 9px; background: color-mix(in srgb, var(--v2-outline) 36%, var(--canvas)); }
.history-group-context .icon { width: 17px; height: 17px; }
.other-category-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-size: .9rem;
  overflow-wrap: anywhere;
}
.other-category-list li + li { border-top: 1px solid var(--product-rule); }
.other-category-list .product-icon { width: 32px; height: 32px; border-radius: 10px; }
.other-category-list .product-icon .icon { width: 17px; height: 17px; }
.other-category-list strong { text-align: end; font-size: .84rem; }

/* The two entry fields lead the sheet and the remaining controls reveal on input. */
#quick .sheet-body {
  --quick-field: color-mix(in srgb, var(--deep) 5%, var(--canvas));
  --quick-line: color-mix(in srgb, var(--deep) 12%, var(--canvas));
  --quick-accent: var(--positive);
  padding: 9px clamp(14px, 5.1cqw, 22px) calc(var(--sheet-safe, var(--bottom-inset)) + 12px);
}
#quick .grabber { width: 34px; height: 4px; margin-block-end: 4px; }
#quick .quick-header {
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.45fr) minmax(0, 1fr);
  gap: 6px;
}
#quick .quick-header h2 {
  justify-self: center;
  text-align: center;
  font-size: clamp(.94rem, 4.35cqw, 1.125rem);
  font-weight: 690;
  letter-spacing: -.025em;
}
#quick .sheet-cancel { padding-inline: 0 4px; color: var(--quick-accent); font-size: .85rem; }
.quick-confirm {
  display: grid;
  width: 44px;
  height: 44px;
  justify-self: end;
  place-items: center;
  border-radius: 50%;
}
.quick-confirm span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: #32613b;
  color: #fff;
}
.quick-confirm .icon { width: 17px; height: 17px; stroke-width: 2.4; }
.quick-confirm:disabled { cursor: default; }
.quick-confirm:disabled span { background: var(--quick-field); color: var(--muted); }
#quick-form { padding-top: 13px; }
.quick-fields { display: grid; gap: 10px; }
.quick-field {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: var(--quick-field);
  cursor: text;
}
.quick-field:focus-within { border-color: var(--quick-accent); }
.quick-field > span:first-child { color: var(--muted); font-size: .76rem; font-weight: 620; }
.quick-field input {
  width: 100%;
  min-width: 0;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  font-size: 1rem;
  font-weight: 630;
}
.quick-field input::placeholder { color: var(--muted); font-weight: 470; }
.quick-money {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 4px;
}
.quick-money > :is(span, input) {
  font-size: clamp(1.37rem, 6.5cqw, 1.75rem);
  line-height: 1.22;
  letter-spacing: -.04em;
}
.quick-money > span { color: var(--muted); font-weight: 510; }
.quick-money input { font-weight: 700; }
.quick-money small { color: var(--muted); font-size: .7rem; font-weight: 660; letter-spacing: .025em; }
.quick-extras {
  display: grid;
  gap: 12px;
  margin-top: 13px;
  animation: quick-reveal 190ms var(--ease-settle) both;
}
@keyframes quick-reveal { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
#quick .transaction-type {
  position: relative;
  isolation: isolate;
  width: min(100%, 17rem);
  margin: 0 auto;
  padding: 0 4px;
  gap: 4px;
  border: 0;
}
#quick .transaction-type::before {
  position: absolute;
  z-index: -1;
  inset: 4px 0;
  border-radius: 12px;
  background: var(--quick-field);
  opacity: 1;
  content: "";
}
#quick .transaction-type label span {
  position: relative;
  isolation: isolate;
  min-height: 44px;
  gap: 5px;
  padding: 0;
  font-size: .85rem;
  font-weight: 600;
  pointer-events: none;
}
#quick .transaction-type :checked + span::before {
  position: absolute;
  z-index: -1;
  inset: 7px 0;
  border-radius: 9px;
  background: var(--canvas);
  box-shadow: 0 1px 3px #0002;
  content: "";
}
#quick .transaction-type .icon { width: 15px; height: 15px; }
#quick .transaction-type [value="expenses"]:checked + span { color: var(--negative); }
#quick .transaction-type [value="income"]:checked + span { color: var(--positive); }
.quick-metadata {
  border: 1px solid var(--quick-line);
  border-radius: 13px;
  background: var(--canvas);
}
#quick :is(.quick-category, .wallet-picker) {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) minmax(0, auto) 12px;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 45px;
  border: 0;
  border-radius: 12px;
  padding: 6px 10px;
  background: transparent;
  color: var(--ink);
  text-align: start;
}
#quick .wallet-slot { position: relative; }
#quick .wallet-slot::before {
  position: absolute;
  inset: 0 10px auto 43px;
  height: 1px;
  background: var(--quick-line);
  content: "";
}
#quick .wallet-picker-copy { display: contents; }
#quick :is(.quick-category, .wallet-picker) small { color: var(--muted); font-size: .76rem; font-weight: 520; }
#quick :is(.quick-category, .wallet-picker) strong {
  max-width: 39cqw;
  font-size: .82rem;
  font-weight: 660;
  text-align: end;
  overflow-wrap: anywhere;
}
#quick :is(.quick-category-icon, .wallet-picker-icon) {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 7px;
}
#quick :is(.quick-category-icon, .wallet-picker-icon) .icon { width: 15px; height: 15px; }
#quick :is(.chip-chevron, .wallet-picker > .icon) { width: 12px; height: 12px; color: var(--muted); }
#quick .quick-category:has(select:disabled) { cursor: default; }
.quick-extras .quick-details { gap: 5px 9px; margin: 0; }
#quick .quick-details .quick-chip {
  isolation: isolate;
  min-width: 44px;
  min-height: 44px;
  gap: 5px;
  padding-inline: 10px;
  background: transparent;
  font-size: .78rem;
  font-weight: 590;
}
#quick .quick-details .quick-chip::before {
  position: absolute;
  z-index: -1;
  inset: 6px 0;
  border-radius: 99px;
  background: var(--quick-field);
  content: "";
}
#quick .quick-details .quick-chip > span { max-width: 40cqw; }
#quick .quick-tags-field input {
  margin: 0;
  border-color: var(--quick-line);
  background: var(--quick-field);
}
#quick .use-form { justify-self: center; padding-inline: 9px; color: var(--muted); font-size: .8rem; }
@media (prefers-reduced-motion: reduce) { .quick-extras { animation: none; } }
.app[data-review-motion] .quick-extras { animation: none; }

/* The waveform doubles as the assistant's visual identity and listening state. */
.voice-wave, .dock-voice-wave {
  display: flex;
  align-items: center;
  justify-content: center;
}
.voice-wave {
  position: relative;
  width: 64%;
  height: 52%;
  gap: 4px;
  filter: drop-shadow(0 1px 4px #072421a0);
}
.voice-wave i, .dock-voice-wave i {
  --height: 95%;
  width: 4px;
  height: var(--height);
  max-height: 35px;
  border-radius: 8px;
  background: #d2f5e7;
  transform-origin: center;
}
.voice-wave i:is(:first-child, :last-child) { --height: 19%; }
.voice-wave i:is(:nth-child(2), :nth-child(6)) { --height: 35%; }
.voice-wave i:is(:nth-child(3), :nth-child(5)) { --height: 49%; }
.dock-voice-wave { height: 24px; gap: 2.5px; }
.dock-voice-wave i { width: 2.5px; height: 8px; background: currentColor; }
.dock-voice-wave i:is(:nth-child(2), :nth-child(4)) { height: 14px; }
.dock-voice-wave i:nth-child(3) { height: 22px; }
@keyframes voice-bar { from { transform: scaleY(.55); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: no-preference) {
  .app:not([data-review-motion]) #voice[open] .voice-wave i { animation: voice-bar 560ms ease-in-out 4 alternate both; }
  .app:not([data-review-motion]) #voice[open] [data-listening="true"] .voice-wave i { animation-iteration-count: infinite; }
  .app:not([data-review-motion]) #voice[open] .voice-wave i:nth-child(even) { animation-delay: -190ms; }
  .app:not([data-review-motion]) #voice[open] .voice-wave i:nth-child(3n) { animation-delay: -310ms; }
  .app:not([data-review-motion]) .mic:is(:hover, :focus-visible) .dock-voice-wave i { animation: voice-bar 310ms ease-in-out 2 alternate; }
}

/* Shared category hues across charts, cards and movement rows. */
:root[data-palette="categories"] .app [data-tone] {
  --card-tone: color-mix(in srgb, var(--category-paint, var(--v2-outline)) 47%, #101b26);
}
:root[data-palette="categories"][data-theme="dark"] .app [data-tone] {
  --card-tone: color-mix(in srgb, var(--category-paint, var(--v2-outline)) 82%, #d2dce5);
}
:root[data-palette="categories"] [data-tone="sage"] { --category-paint: var(--sage); }
:root[data-palette="categories"] [data-tone="blue"] { --category-paint: var(--blue); }
:root[data-palette="categories"] [data-tone="sand"] { --category-paint: var(--sand); }
:root[data-palette="categories"] [data-tone="mauve"] { --category-paint: var(--mauve); }
:root[data-palette="categories"] [data-tone="green"] { --category-paint: var(--green); }
:root[data-palette="categories"] [data-tone="teal"] { --category-paint: var(--teal); }
:root[data-palette="categories"] [data-tone="periwinkle"] { --category-paint: var(--periwinkle); }
:root[data-palette="categories"] [data-tone="slate"] { --category-paint: var(--slate); }
:root[data-palette="categories"] [data-tone="rose"] { --category-paint: var(--rose); }
:root[data-palette="categories"] [data-tone="stone"] { --category-paint: var(--stone); }
:root[data-palette="categories"] .app .product-feed .product-card {
  border-color: color-mix(in srgb, var(--category-paint, var(--v2-outline)) 64%, var(--product-rule));
  background: linear-gradient(145deg,
    color-mix(in srgb, var(--category-paint, var(--v2-outline)) 40%, var(--product-surface)),
    color-mix(in srgb, var(--category-paint, var(--v2-outline)) 19%, var(--product-surface)));
}
:root[data-palette="categories"] .app :is(.product-icon, .transaction-icon, .quick-category .quick-category-icon) {
  background: color-mix(in srgb, var(--category-paint, var(--v2-outline)) 64%, var(--canvas));
}
:root[data-palette="categories"] .history-day .transaction-open {
  background-image: linear-gradient(105deg, color-mix(in srgb, var(--category-paint, var(--v2-outline)) 19%, transparent), transparent 75%);
}
:root[data-palette="categories"] .chart[data-vertical] .tiles.expenses .tile[data-budget] .tile-column {
  background: color-mix(in srgb, var(--category-paint, var(--v2-outline)) 25%, var(--canvas));
}
:root[data-palette="categories"][data-theme="dark"] .chart[data-vertical] .tiles.expenses .tile[data-budget] .tile-column {
  background: color-mix(in srgb, var(--category-paint, var(--v2-outline)) 27%, var(--canvas));
}

/* Let the list take up space gradually in either direction. */
.overdue-stack {
  --overdue-motion: 360ms var(--ease-settle);
  margin-block-end: 11px;
  transition: margin-block-end var(--overdue-motion);
}
.overdue-stack[data-expanded] { margin-block-end: 0; }
.overdue-stack-header { position: relative; }
.overdue-stack-header::before,
.overdue-stack-header::after {
  position: absolute;
  inset: auto 8px -6px;
  height: 22px;
  border: 1px solid color-mix(in srgb, var(--v2-hero-start) 70%, var(--v2-outline));
  border-radius: 13px;
  background: color-mix(in srgb, var(--v2-hero-start) 86%, var(--v2-outline));
  content: "";
  pointer-events: none;
  transition: opacity var(--overdue-motion), transform var(--overdue-motion);
}
.overdue-stack-header::before { inset-inline: 16px; bottom: -11px; }
.overdue-stack[data-expanded] .overdue-stack-header::before,
.overdue-stack[data-expanded] .overdue-stack-header::after { opacity: 0; transform: translateY(-11px); }
.overdue-stack-summary {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 66px;
  padding: 8px 10px;
  border-radius: 15px;
  cursor: pointer;
  text-align: start;
}
.overdue-stack-glyph {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  border-radius: 11px;
  color: var(--summary-negative);
  background: #ffffff16;
}
.overdue-stack-glyph .icon { width: 20px; height: 20px; }
.overdue-stack-count { display: grid; gap: 2px; min-width: 0; }
.overdue-stack-count strong { font-size: .91rem; }
.overdue-stack-count small { font-size: .79rem; color: var(--summary-muted); }
.overdue-stack-summary > .icon, .overdue-stack-fold .icon { width: 18px; height: 18px; }
.overdue-stack-summary > .icon { transition: transform var(--overdue-motion); }
.overdue-stack[data-expanded] .overdue-stack-summary > .icon, .overdue-stack-fold .icon { transform: rotate(180deg); }
.overdue-stack-reveal {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--overdue-motion);
}
.overdue-stack[data-expanded] .overdue-stack-reveal { grid-template-rows: 1fr; }
.overdue-stack-cards { display: grid; align-content: start; gap: 7px; min-height: 0; overflow: clip; }
.overdue-stack-cards > :first-child { margin-top: 7px; }
.overdue-stack[data-expanded] .overdue-stack-cards:has(.product-menu[open]) { overflow: visible; }
.overdue-stack-fold {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 12px;
  color: var(--deep);
  font-size: .82rem;
  font-weight: 680;
}
.overdue-stack-fold:is(:hover, :focus-visible) { background: var(--selected); }

.wallet-picker {
  position: relative;
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr) 15px;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 45px;
  padding: 5px 8px;
  border: 1px solid color-mix(in srgb, var(--v2-outline) 44%, var(--product-rule));
  border-radius: 12px;
  background: color-mix(in srgb, var(--v2-outline) 13%, var(--canvas));
  color: var(--deep);
  text-align: start;
}
.wallet-picker:focus-within { outline: 2px solid var(--forest); outline-offset: 2px; }
.wallet-picker-icon {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--v2-outline) 26%, var(--canvas));
}
.wallet-picker-icon .icon { width: 17px; height: 17px; }
.wallet-picker > .icon { width: 13px; height: 13px; color: var(--muted); }
.wallet-picker-copy { display: grid; gap: 1px; min-width: 0; overflow-wrap: anywhere; line-height: 1.17; }
.wallet-picker-copy small { font-size: .72rem; color: var(--muted); }
.wallet-picker-copy strong { font-size: .84rem; font-weight: 690; }
.wallet-picker .wallet-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.manual .wallet-slot { margin-block-end: 8px; }
