:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #f5f6f3;
  --panel: #fff;
  --raised: #f1f4ef;
  --hover: #e9eee8;
  --line: #dce3dc;
  --ink: #1a2922;
  --muted: #53645b;
  --accent: #245e43;
  --accent-soft: #edf5ed;
  --action: #224f3a;
  --action-hover: #193d2d;
  --action-ink: #fff;
  --focus: #347750;
  --logo: #1c4432;
  --logo-ink: #dcf1d9;
  --chart: #4d8463;
  --paid-bg: #e6f3e9;
  --paid-ink: #236144;
  --due-bg: #faf0dc;
  --due-ink: #79501c;
  --credit-bg: #f0edf7;
  --credit-ink: #584787;
  --debit-bg: #e7f2f5;
  --debit-ink: #24576a;
  --danger: #a12d39;
  --bank-neutral: #3f5e50;
  --bank-picpay: #08624a;
  --bank-nubank: #65269d;
  --bank-c6bank: #684b20;
  --backdrop: #102a2070;
}

:root:is([data-theme=dark], [data-theme=black]) {
  color-scheme: dark;
  --bg: #101a16;
  --panel: #18261f;
  --raised: #21332a;
  --hover: #293f33;
  --line: #354b40;
  --ink: #e8f0ea;
  --muted: #b2c3b8;
  --accent: #b0e2ac;
  --accent-soft: #1e3428;
  --action: #b5e6aa;
  --action-hover: #c7f0be;
  --action-ink: #172e20;
  --focus: #ace9a0;
  --logo: #28483a;
  --logo-ink: #c7e9be;
  --chart: #86bd8d;
  --paid-bg: #234537;
  --paid-ink: #b0ebce;
  --due-bg: #463520;
  --due-ink: #f8d49a;
  --credit-bg: #393148;
  --credit-ink: #ddcff2;
  --debit-bg: #253e47;
  --debit-ink: #b2e1ef;
  --danger: #ffb1b7;
  --bank-neutral: #c2d9ca;
  --bank-picpay: var(--paid-ink);
  --bank-nubank: var(--credit-ink);
  --bank-c6bank: var(--due-ink);
  --backdrop: #050b08b8;
}

:root[data-theme=black] {
  --bg: #000;
  --panel: #111;
  --raised: #1b1b1b;
  --hover: #252525;
  --line: #353535;
  --ink: #f2f2f2;
  --muted: #b8b8b8;
  --accent: #ededed;
  --accent-soft: #1c1c1c;
  --action: #eee;
  --action-hover: #fff;
  --action-ink: #171717;
  --focus: #eee;
  --logo: #292929;
  --logo-ink: #f0f0f0;
  --chart: #bdbdbd;
  --bank-neutral: #d6d6d6;
  --backdrop: #000b;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.45; }
:where(h1, h2, h3, h4, p, dl, dd) { margin: 0; }
button, input, select { font: inherit; }
button, summary { cursor: pointer; }
button:disabled { opacity: .54; cursor: default; }
:where(button, input, select, a, summary, [role=tabpanel]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
svg {
  width: 22px; height: 22px; fill: none; stroke: currentColor;
  stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round;
}
.top-inner, main { width: min(100%, 1320px); margin-inline: auto; padding-inline: clamp(16px, 3.3vw, 42px); }

/* Header and shared controls */
.top {
  position: relative; z-index: 4;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.top-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.dashboard-top { display: grid; grid-template-columns: 1fr auto 1fr; }
.brand {
  display: inline-flex; align-items: center; gap: 10px; width: fit-content;
  color: var(--ink); text-decoration: none; font-size: 21px; font-weight: 760;
  letter-spacing: -.065em; line-height: 1.05; white-space: nowrap;
}
.brand-icon {
  display: grid; place-items: center; width: 37px; height: 37px;
  background: var(--logo); color: var(--logo-ink); border-radius: 8px; flex: none;
}
.brand-icon svg { width: 20px; height: 20px; }
.brand-accent { color: var(--accent); }
.brand small {
  display: block; margin-top: 4px; color: var(--muted);
  font-size: 8px; font-weight: 750; letter-spacing: .11em;
}
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.private, .theme-trigger {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--ink); font-size: 12px; font-weight: 650;
  white-space: nowrap; text-decoration: none;
}
.private:hover, .theme-trigger:hover { background: var(--raised); }
.private svg, .theme-trigger svg { width: 15px; height: 15px; flex: none; }
.workspace-tabs { align-self: stretch; display: flex; align-items: stretch; gap: 14px; }
.workspace-tabs button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 4px 7px 2px; border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: var(--muted); font-weight: 650; font-size: 13px;
}
.workspace-tabs button:hover, .workspace-tabs button[aria-selected=true] { color: var(--accent); }
.workspace-tabs button[aria-selected=true] { border-bottom-color: var(--accent); }
.workspace-tabs svg { width: 17px; height: 17px; flex: none; }
.primary, .secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 8px 13px; border-radius: 8px; border: 1px solid transparent;
  font-size: 13px; font-weight: 680; line-height: 1.3; text-align: center; text-decoration: none;
}
.primary { background: var(--action); color: var(--action-ink); }
.primary:hover:not(:disabled) { background: var(--action-hover); }
.secondary { background: var(--panel); color: var(--ink); border-color: var(--line); }
.secondary:hover:not(:disabled) { background: var(--hover); }
.primary svg, .secondary svg { width: 17px; height: 17px; flex: none; }
.plus { font-size: 20px; line-height: 14px; font-weight: 500; }
.icon-button {
  display: grid; place-items: center; width: 36px; height: 36px; border: 0;
  background: transparent; color: var(--muted); border-radius: 7px; flex: none;
}
.icon-button:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
select {
  max-width: 100%; min-height: 36px; padding: 6px 8px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--raised); color: var(--ink); font-size: 12px;
  cursor: pointer;
}
@supports (appearance: base-select) and selector(::picker(select)) {
  select, ::picker(select) { appearance: base-select; }
  select { align-items: center; gap: 8px; }
  select::picker-icon {
    content: ""; width: 6px; height: 6px; margin-inline-end: 2px;
    border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
    transform: rotate(45deg);
  }
  select:open::picker-icon { rotate: 180deg; }
  ::picker(select) {
    margin-block: 5px; padding: 4px; max-block-size: min(270px, 45dvh); overflow: auto;
    border: 1px solid var(--line); border-radius: 11px;
    background: var(--panel); color: var(--ink); box-shadow: 0 10px 30px #0004;
    scrollbar-width: thin;
  }
  option {
    align-items: center; justify-content: space-between; gap: 9px;
    min-height: 36px; padding: 7px 9px; border-radius: 7px; font-weight: 500;
  }
  option:checked { background: var(--accent-soft); color: var(--accent); font-weight: 670; }
  option:hover:not(:disabled), option:focus-visible { background: var(--hover); }
  option:disabled { color: var(--muted); cursor: default; }
  option::checkmark { order: 1; color: var(--accent); }
}

/* Theme menu */
.theme-picker { position: relative; flex: none; }
.theme-trigger { list-style: none; }
.theme-trigger::-webkit-details-marker { display: none; }
.theme-trigger .theme-chevron { width: 12px; height: 12px; color: var(--muted); }
.theme-picker[open] .theme-chevron { transform: rotate(180deg); }
.theme-picker[open] .theme-trigger { border-color: var(--focus); }
.theme-panel {
  position: absolute; z-index: 5; inset-inline-end: 0; top: calc(100% + 8px);
  width: 204px; padding: 6px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--panel); box-shadow: 0 12px 28px #0003;
}
.theme-heading {
  display: block; padding: 7px 9px 5px; color: var(--muted);
  font-size: 11px; font-weight: 720;
}
.theme-option {
  display: grid; grid-template-columns: 24px 1fr 12px; align-items: center; gap: 8px;
  width: 100%; min-height: 40px; padding: 5px 8px; border: 1px solid transparent;
  border-radius: 7px; background: transparent; color: var(--ink);
  text-align: start; font-size: 13px; font-weight: 630;
}
.theme-option:hover, .theme-option[aria-pressed=true] { background: var(--raised); }
.theme-option[aria-pressed=true] { border-color: var(--line); }
.theme-option[aria-pressed=true]::after {
  content: ""; width: 5px; height: 9px; justify-self: center;
  border: solid var(--focus); border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg);
}
.theme-swatch { width: 24px; height: 18px; border: 1px solid #777; border-radius: 4px; }
.theme-swatch-light { background: linear-gradient(145deg, #fff 52%, #dce9e0 53%); }
.theme-swatch-green { background: linear-gradient(145deg, #172f26 52%, #4e785b 53%); }
.theme-swatch-black { background: linear-gradient(145deg, #060606 52%, #404040 53%); }

/* Overview and monthly totals */
main { padding-top: clamp(23px, 3vw, 40px); }
.page-intro, .section-head, .ledger-head, .filters, .finance-head, footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.page-intro { align-items: flex-end; margin-bottom: 28px; }
.page-intro h1 { font-size: clamp(29px, 4vw, 43px); font-weight: 720; letter-spacing: -.055em; line-height: 1.05; }
.page-intro p { margin-top: 9px; color: var(--muted); font-size: 14px; }
.page-actions, .ledger-tools, .ledger-selects, .bank-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.page-actions, .ledger-tools, .ledger-selects { justify-content: flex-end; }
.expense-fab {
  position: fixed; z-index: 3;
  inset-inline-end: max(18px, env(safe-area-inset-right));
  inset-block-end: calc(16px + env(safe-area-inset-bottom));
  min-height: 52px; padding-inline: 16px; border-radius: 14px;
  box-shadow: 0 6px 20px #0003;
}
.expense-fab svg { width: 22px; height: 22px; stroke-width: 2; }
.section-head { margin-bottom: 10px; }
.section-head h2, .ledger-head h2, .finance-head h2 {
  font-size: 20px; line-height: 1.2; font-weight: 700; letter-spacing: -.035em;
}
.month {
  display: flex; align-items: center; min-height: 36px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel);
}
.month button {
  display: grid; place-items: center; width: 33px; height: 34px;
  border: 0; border-radius: 7px; background: transparent; color: var(--muted);
}
.month button:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.month button svg { width: 16px; height: 16px; }
.month-field {
  position: relative; min-width: 130px; padding: 6px 7px; text-align: center;
  color: var(--ink); font-size: 12px; font-weight: 700;
}
.month-field::first-letter, #month-label::first-letter { text-transform: uppercase; }
#month-label { display: inline-block; }
.month-field input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.month-field input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; cursor: pointer; }
.month-field:focus-within { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: 5px; }

.stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
}
.stat {
  display: grid; grid-template-columns: 25px minmax(0, 1fr); align-items: center; gap: 7px 7px;
  padding: 15px clamp(11px, 1.8vw, 22px) 16px; min-width: 0; border-inline-start: 1px solid var(--line);
}
.stat:first-child { border-inline-start: 0; }
.stat-total { background: var(--accent-soft); }
.stat-icon {
  display: grid; place-items: center; width: 25px; height: 25px; border-radius: 6px;
  background: var(--raised); color: var(--muted);
}
.stat-icon svg { width: 15px; height: 15px; }
.stat-icon.green { color: var(--accent); }
.stat-icon.mint { color: var(--paid-ink); }
.stat-icon.amber { color: var(--due-ink); background: var(--due-bg); }
.stat > span:nth-child(2) { color: var(--muted); font-weight: 680; font-size: 12px; }
.stat strong {
  grid-column: 1 / -1; font-size: clamp(19px, 2.45vw, 31px); font-weight: 700;
  letter-spacing: -.055em; line-height: 1.12; overflow-wrap: anywhere;
}
.stat small { grid-column: 1 / -1; color: var(--muted); font-size: 11px; }
.stat-due strong { color: var(--due-ink); }
.stat strong, .amount, .finance-metrics dd, .payment-summary dd, .chart-caption strong, .chart-percent, .saving-balance {
  font-variant-numeric: tabular-nums;
}
.invoice-note { padding-inline: 2px; }

/* Transactions and the month analysis */
.expense-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 34%);
  align-items: start; gap: 18px; margin-top: 18px;
}
.expense-sidebar, .breakdown { display: grid; align-content: start; gap: 14px; }
.ledger, .breakdown-panel, .finance-panel {
  min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
}
.ledger { overflow: hidden; }
.ledger-head { align-items: flex-start; padding: 16px 17px 12px; }
.ledger-head p, .finance-head p, .breakdown-panel > p {
  margin-top: 4px; color: var(--muted); font-size: 12px;
}
.ledger-tools .secondary { min-height: 36px; font-size: 12px; }
.search {
  display: flex; align-items: center; gap: 7px; width: 153px; min-height: 36px;
  padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted);
}
.search svg { width: 16px; height: 16px; flex: none; }
.search input { min-width: 0; width: 100%; padding: 7px 0; border: 0; background: transparent; color: var(--ink); font-size: 12px; }
.search:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.search input:focus-visible { outline: none; }
.filters { flex-wrap: wrap; padding: 0 17px 12px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 2px; padding: 3px; border-radius: 7px; background: var(--raised); }
.tabs button {
  min-height: 30px; padding: 4px 9px; border: 1px solid transparent; border-radius: 5px;
  background: transparent; color: var(--muted); font-size: 12px; font-weight: 660;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-pressed=true] { background: var(--panel); border-color: var(--line); color: var(--accent); }
.ledger-columns, .row {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(84px, 115px) minmax(62px, 79px) 75px 31px;
  align-items: center; gap: 10px; padding-inline: 17px;
}
.ledger-columns {
  padding-block: 9px; background: var(--raised); color: var(--muted);
  font-size: 11px; font-weight: 650; border-bottom: 1px solid var(--line);
}
.ledger-columns span:nth-child(2) { text-align: end; }
.ledger-columns span:nth-child(3), .ledger-columns span:nth-child(4) { text-align: center; }
.row { padding-block: 11px; border-bottom: 1px solid var(--line); font-size: 13px; }
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--accent-soft); }
.entry-description { min-width: 0; }
.entry-title, .entry-description small { display: block; overflow-wrap: anywhere; }
.entry-title { font-weight: 720; }
.entry-description small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.entry-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 5px; }
.row .amount { text-align: end; font-weight: 700; letter-spacing: -.02em; overflow-wrap: anywhere; }
.row .date { text-align: center; color: var(--muted); font-size: 11px; }
.row .icon-button { width: 31px; font-size: 19px; }
.badge {
  min-height: 30px; padding: 5px 6px; border: 0; border-radius: 6px;
  color: var(--due-ink); background: var(--due-bg); font-size: 11px; font-weight: 680;
}
.badge.is-paid { background: var(--paid-bg); color: var(--paid-ink); }
.badge:hover:not(:disabled), .danger:hover:not(:disabled) { text-decoration: underline; }
.method-tag, .bank-badge {
  display: inline-block; max-width: 100%; padding: 2px 6px; border-radius: 4px;
  background: var(--raised); color: var(--muted); font-size: 10px; font-weight: 650; overflow-wrap: anywhere;
}
.method-credit { background: var(--credit-bg); color: var(--credit-ink); }
.method-debit { background: var(--debit-bg); color: var(--debit-ink); }
.method-pix { background: var(--paid-bg); color: var(--paid-ink); }
.method-boleto { background: var(--due-bg); color: var(--due-ink); }
.bank-notice {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 17px; background: var(--raised); border-bottom: 1px solid var(--line);
  color: var(--muted); font-size: 12px;
}
.bank-notice .secondary { min-height: 30px; padding: 4px 7px; font-size: 11px; }
.empty { display: grid; justify-items: center; padding: 32px 16px; text-align: center; }
.empty-icon {
  display: grid; place-items: center; width: 37px; height: 37px; margin-bottom: 10px;
  border-radius: 8px; background: var(--accent-soft); color: var(--accent);
}
.empty-icon svg { width: 18px; height: 18px; }
.empty h3 { font-size: 15px; }
.empty p { margin-top: 4px; color: var(--muted); font-size: 13px; }
.empty .secondary { min-height: 34px; margin-top: 13px; font-size: 12px; }
.breakdown-panel, .finance-panel { padding: 16px; }
.breakdown-panel h3, .finance-head h3 { font-size: 16px; font-weight: 700; letter-spacing: -.025em; }
.breakdown-panel .chart-empty { margin-top: 12px; }
.category-chart { display: grid; gap: 11px; padding: 0; margin: 13px 0 0; list-style: none; }
.chart-caption {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(34px, auto); align-items: baseline;
  gap: 7px; font-size: 11px;
}
.chart-category { font-weight: 670; overflow-wrap: anywhere; }
.chart-percent { color: var(--muted); text-align: end; }
.chart-track { height: 5px; margin-top: 4px; overflow: hidden; border-radius: 6px; background: var(--raised); }
.chart-bar { height: 100%; border-radius: 6px; background: var(--chart); }
.payment-summary { margin-top: 9px; }
.payment-summary div {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid var(--line);
}
.payment-summary div:last-child { border-bottom: 0; padding-bottom: 0; }
.payment-summary .method-tag { font-size: 11px; }
.payment-summary dd { text-align: end; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.breakdown-panel .breakdown-note { margin-top: 11px; }

/* Salary and investment panels */
.finance-head { flex-wrap: wrap; }
.finance-head .secondary { min-height: 34px; padding: 6px 9px; font-size: 12px; }
.finance-note { margin-top: 10px; color: var(--muted); font-size: 12px; }
.finance-note:empty, .hint:empty { display: none; }
.finance-metrics {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px; margin-top: 13px;
}
.finance-metrics > div { min-width: 0; padding: 9px; border-radius: 7px; background: var(--raised); }
.finance-metrics dt, .finance-metrics small { color: var(--muted); font-size: 11px; }
.finance-metrics dd { margin-top: 2px; font-size: 17px; font-weight: 730; letter-spacing: -.035em; overflow-wrap: anywhere; }
.finance-metrics small { display: block; margin-top: 2px; }
.finance-metrics .negative, .saving-card .negative { color: var(--danger); }
.salary-deductions-summary {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px;
}
.salary-deductions-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 3px 8px; color: var(--ink); }
.salary-deductions-head h4 { font-size: 12px; }
.salary-deductions-summary p { margin-top: 3px; }
.salary-deductions-summary dl:empty { display: none; }
.salary-deductions-summary dl { display: grid; gap: 4px; margin-top: 7px; }
.salary-deductions-summary dl div { display: flex; justify-content: space-between; gap: 10px; }
.salary-deductions-summary dd { text-align: end; font-weight: 700; }
.investments-panel, .connected-portfolio { padding: 18px; }
.connected-portfolio { margin-top: 16px; }
.contribution-callout {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: 12px; margin-bottom: 16px; padding: 14px 16px; background: var(--accent-soft);
}
.contribution-callout h2 { font-size: 16px; letter-spacing: -.02em; }
.contribution-callout p { color: var(--muted); font-size: 12px; }
.saving-contribution { align-self: flex-start; margin-top: 12px; min-height: 34px; font-size: 12px; }
.investment-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.investment-metrics > div { padding: 12px; }
.investment-metrics dd { font-size: clamp(18px, 2.3vw, 25px); }
.investment-list {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 255px), 1fr));
  gap: 11px; margin-top: 13px;
}
.investment-list:empty { display: none; }
.bank-neutral { --bank-accent: var(--bank-neutral); --bank-soft: var(--raised); }
.bank-picpay { --bank-accent: var(--bank-picpay); --bank-soft: var(--paid-bg); }
.bank-nubank { --bank-accent: var(--bank-nubank); --bank-soft: var(--credit-bg); }
.bank-c6bank { --bank-accent: var(--bank-c6bank); --bank-soft: var(--due-bg); }
.bank-badge { color: var(--bank-accent); background: var(--bank-soft); }
.saving-card {
  display: flex; flex-direction: column; min-width: 0; padding: 13px;
  border: 1px solid var(--line); border-inline-start: 3px solid var(--bank-accent);
  border-radius: 8px; background: var(--panel);
}
.saving-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; margin-bottom: 9px; }
.saving-edit {
  min-height: 27px; padding: 3px 7px; border: 1px solid var(--line); border-radius: 5px;
  background: var(--panel); color: var(--ink); font-size: 11px; font-weight: 650;
}
.saving-edit:hover { background: var(--hover); }
.saving-card h3 { font-size: 15px; font-weight: 710; overflow-wrap: anywhere; }
.saving-card small, .saving-detail { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.saving-detail { margin-top: 2px; }
.saving-balance-label { margin-top: auto; padding-top: 12px; }
.saving-balance { margin: 1px 0 9px; font-size: 22px; letter-spacing: -.04em; overflow-wrap: anywhere; }
.saving-card-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.saving-card-metrics small, .saving-card-metrics strong { display: block; overflow-wrap: anywhere; }
.saving-card-metrics strong { font-size: 13px; }
footer { margin-top: 23px; padding: 12px 0 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
#panel-despesas:not([hidden]) ~ footer { padding-block-end: calc(76px + env(safe-area-inset-bottom)); }

/* Dialogs and form fields */
dialog {
  --dialog-padding: clamp(15px, 4vw, 23px);
  width: min(540px, calc(100% - 24px)); max-height: calc(100% - 24px);
  max-height: calc(100dvh - 24px); margin: auto; padding: 0;
  border: 1px solid var(--line); border-radius: 16px; background: var(--panel);
  color: var(--ink); box-shadow: 0 24px 72px #0006;
  overscroll-behavior: contain; scrollbar-width: thin;
}
dialog::backdrop { background: var(--backdrop); backdrop-filter: blur(2px); }
form { --field-height: 44px; display: grid; gap: 12px; padding: var(--dialog-padding, 20px); }
.modal-head, .modal-actions { display: flex; justify-content: space-between; gap: 10px; }
.modal-head { align-items: flex-start; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.modal-heading { display: flex; align-items: center; gap: 11px; min-width: 0; }
.modal-icon {
  display: grid; place-items: center; flex: none; width: 39px; height: 39px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--accent-soft); color: var(--accent);
}
.modal-icon svg { width: 20px; height: 20px; }
.modal-head h2 { font-size: clamp(19px, 4.4vw, 24px); line-height: 1.15; font-weight: 740; letter-spacing: -.035em; }
.modal-head p, .hint { margin-top: 3px; color: var(--muted); font-size: 12px; }
.modal-head p::first-letter { text-transform: uppercase; }
.modal-head .icon-button {
  width: 36px; height: 36px; border: 1px solid var(--line);
  background: var(--raised); border-radius: 9px; font-size: 22px; line-height: 1;
}
.modal-tag { margin-bottom: 3px; color: var(--accent); font-size: 10px; letter-spacing: .09em; font-weight: 750; }
.modal-actions {
  flex-wrap: wrap; align-items: center; justify-content: flex-end;
  margin-top: 2px; padding-top: 13px; border-top: 1px solid var(--line);
}
.modal-actions :is(.primary, .secondary) { min-height: 42px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@supports (grid-template-rows: subgrid) {
  .fields > label { grid-row: span 2; grid-template-rows: subgrid; }
}
form label, .bank-field { display: grid; gap: 5px; min-width: 0; font-size: 13px; font-weight: 650; }
form input:not([type=checkbox]), form select {
  width: 100%; min-width: 0; min-height: var(--field-height); padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--raised); color: var(--ink); font-size: 14px; font-weight: 500;
}
form input::placeholder { color: var(--muted); opacity: 1; }
form :is(input:not([type=checkbox]), select):focus-visible { outline-offset: 1px; }
form input[type=date] { font-variant-numeric: tabular-nums; }
form input[type=date]:not([readonly])::-webkit-calendar-picker-indicator { cursor: pointer; }
.check {
  display: flex; align-items: flex-start; gap: 9px; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--raised); cursor: pointer;
}
.check:has(input:checked) { background: var(--accent-soft); border-color: var(--focus); }
.check input { width: 16px; height: 16px; margin: 1px 0 0; flex: none; accent-color: var(--focus); }
.check small { display: block; margin-top: 2px; color: var(--muted); font-weight: 500; }
.edit-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.danger {
  padding: 5px 0; border: 0; background: transparent;
  color: var(--danger); font-size: 12px; font-weight: 700;
}
.error { color: var(--danger); font-size: 13px; }
.toast {
  position: fixed; z-index: 6; inset-inline-start: 50%; bottom: 16px; transform: translateX(-50%);
  max-width: calc(100% - 28px); padding: 10px 14px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--logo); color: var(--logo-ink); box-shadow: 0 6px 20px #0003;
}
.bank-dialog { width: min(600px, calc(100% - 24px)); }
.bank-content { padding: var(--dialog-padding); }
.bank-guide { margin: 11px 0; color: var(--muted); font-size: 13px; }
.bank-content #bank-status { margin-top: 10px; }
.bank-form { margin-top: 10px; padding: 10px 0 0; border-top: 1px solid var(--line); }
.bank-form a { color: var(--accent); font-weight: 680; }
.bank-form .primary { justify-self: start; }
.salary-gross-fields, #salary-extra-deductions { display: grid; gap: 9px; }
.salary-gross-fields .secondary { justify-self: start; }
.salary-extra-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 7px; align-items: end; }
.salary-extra-row .icon-button { width: 31px; font-size: 20px; }

/* Bank suggestions */
.bank-picker { position: relative; min-width: 0; }
form .bank-picker input { padding-inline-end: 44px; }
.bank-picker-toggle {
  position: absolute; inset-block-start: 1px; inset-inline-end: 1px;
  display: grid; place-items: center; width: 40px; height: calc(var(--field-height) - 2px);
  border: 0; border-inline-start: 1px solid var(--line); border-radius: 0 8px 8px 0;
  background: transparent; color: var(--muted);
}
.bank-picker-toggle:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.bank-picker-toggle svg { width: 16px; height: 16px; }
.bank-picker input[aria-expanded=true] + .bank-picker-toggle svg { rotate: 180deg; }
.bank-picker-menu {
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: 264px; overflow: hidden; margin: 6px 0 0; padding: 4px;
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--panel); color: var(--ink); box-shadow: 0 10px 30px #0005;
}
.bank-picker-menu:popover-open { position: fixed; inset: auto; margin: 0; }
.bank-picker-caption { padding: 7px 9px 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.bank-picker-list {
  overflow: auto; overscroll-behavior: contain; scrollbar-width: thin;
  list-style: none; margin: 0; padding: 0;
}
.bank-picker-option {
  display: flex; align-items: center; min-height: 36px; padding: 7px 9px;
  border-radius: 7px; font-size: 14px; font-weight: 560; cursor: pointer;
}
.bank-picker-option:hover { background: var(--hover); }
.bank-picker-option[aria-selected=true] { background: var(--accent-soft); color: var(--accent); }
.bank-picker-note {
  margin: 4px 0 0; padding: 6px 9px 4px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 11px; font-weight: 500;
}

/* Sign-in */
.login-page {
  width: min(100%, 1040px); min-height: calc(100svh - 69px);
  display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1fr); align-content: center;
  padding-block: clamp(22px, 5vw, 54px);
}
.login-intro, .login-card { padding: clamp(22px, 4vw, 43px); border: 1px solid var(--line); }
.login-intro {
  display: flex; flex-direction: column; justify-content: space-between; gap: 28px;
  border-radius: 14px 0 0 14px; border-inline-end: 0; background: #1c372b; color: #eff7ee;
}
[data-theme=black] .login-intro { background: #191919; color: #f2f2f2; }
.login-kicker { color: #bcdbc3; font-size: 12px; font-weight: 680; }
[data-theme=black] .login-kicker { color: #bcbcbc; }
.login-statement {
  margin-top: 16px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(35px, 4.5vw, 60px);
  line-height: .98; letter-spacing: -.055em;
}
.login-description { margin-top: 9px; color: var(--muted); font-size: 14px; }
.login-intro .login-description { margin-top: 17px; color: #d1dfd2; }
[data-theme=black] .login-intro .login-description { color: #cfcfcf; }
.login-features { padding: 0; margin: 0; list-style: none; }
.login-features li {
  display: flex; gap: 10px; align-items: baseline; padding: 9px 0;
  border-top: 1px solid #e4efe839; font-size: 12px; font-weight: 630;
}
.login-features span { color: #b8d5bd; font-size: 10px; font-variant-numeric: tabular-nums; }
[data-theme=black] .login-features span { color: #c4c4c4; }
.login-card { min-width: 0; border-radius: 0 14px 14px 0; background: var(--panel); }
.login-card h1 { font-size: clamp(25px, 3.3vw, 33px); letter-spacing: -.05em; line-height: 1.1; }
.login-card form { margin-top: 18px; padding: 0; }
.login-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.login-actions .secondary { min-height: 34px; font-size: 12px; }
.login-submit { margin-top: 2px; }
.login-submit > * { flex: 1 1 auto; }
.login-submit .primary, .login-submit .secondary { min-height: 40px; font-size: 13px; }
.login-alternatives { margin-top: 12px; }
.login-divider { margin-top: 15px; padding-top: 11px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.login-card .login-note { margin-top: 12px; color: var(--muted); font-size: 12px; }
.login-card .error:not(:empty) { margin-top: 9px; }
.login-card .login-active { margin-top: 16px; color: var(--muted); font-size: 13px; }
.login-note a { color: var(--accent); font-weight: 720; text-underline-offset: 3px; }
.signup-page .login-card > .profile-eyebrow { margin-bottom: 7px; }
.signup-page .login-submit .primary { min-height: 44px; }
form input[aria-invalid=true] { border-color: var(--danger); }

/* Account, rewards and personalization */
.account-link { max-width: min(192px, 37vw); min-width: 0; }
#account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-avatar {
  display: inline-grid; place-items: center; flex: none; width: 64px; aspect-ratio: 1;
  overflow: hidden; border-radius: 16px; background: var(--logo); color: var(--logo-ink);
  font-size: 22px; font-weight: 750; letter-spacing: -.03em;
}
.profile-avatar img, .profile-avatar svg { display: block; width: 100%; height: 100%; object-fit: cover; }
.profile-avatar svg { stroke: none; }
.account-avatar { width: 23px; border-radius: 7px; font-size: 10px; }
.profile-page { max-width: 1170px; padding-block-end: 40px; }
[data-cover=bosque] { --cover-base: #16372c; --cover-glow: #356e53; }
[data-cover=grafite] { --cover-base: #232731; --cover-glow: #535b6e; }
[data-cover=horizonte] { --cover-base: #4b2b36; --cover-glow: #956240; }
[data-cover=aurora] { --cover-base: #202e49; --cover-glow: #337c70; }
.profile-cover, .profile-swatch {
  background-color: var(--cover-base, #16372c);
  background-image: radial-gradient(ellipse at 92% 0%, var(--cover-glow, #356e53), transparent 72%),
    repeating-linear-gradient(120deg, #ffffff0c 0 1px, transparent 1px 34px);
}
.profile-cover {
  padding: clamp(16px, 3.6vw, 34px); border: 1px solid #ffffff24; border-radius: 17px;
  color: #f3f8f3; box-shadow: 0 13px 36px #10221a20;
}
.profile-back {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 9px 5px 5px;
  color: #edf6ed; background: #0003; border: 1px solid #ffffff25;
  border-radius: 6px; font-size: 12px; font-weight: 650; text-decoration: none;
}
.profile-back:hover { background: #0005; }
.profile-back svg { width: 15px; height: 15px; }
.profile-cover-body { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-top: 23px; }
.profile-identity { display: flex; min-width: 0; align-items: center; gap: 15px; }
.profile-identity .profile-avatar { border: 2px solid #f2f8f399; }
.profile-kicker, .profile-eyebrow { font-size: 11px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.profile-kicker { color: #d2ebda; }
.profile-eyebrow { color: var(--accent); margin-bottom: 4px; }
.profile-identity h1 { font-size: clamp(23px, 4.5vw, 42px); line-height: 1.12; letter-spacing: -.045em; overflow-wrap: anywhere; }
.profile-coins {
  display: flex; align-items: center; flex: none; gap: 10px; padding: 9px 13px;
  background: #0003; border: 1px solid #ffffff32; border-radius: 10px;
}
.profile-coins svg { flex: none; color: #ffdc97; }
.profile-coins strong { display: block; font-size: 24px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.profile-coins span { font-size: 11px; color: #e5f0e6; }
.profile-status { margin-top: 15px; color: var(--muted); }
.profile-layout { display: grid; grid-template-columns: minmax(245px, .9fr) minmax(0, 1.85fr); gap: 14px; margin-top: 16px; }
.profile-column { display: grid; align-content: start; gap: 14px; min-width: 0; }
.profile-panel { min-width: 0; padding: clamp(14px, 2.6vw, 20px); background: var(--panel); border: 1px solid var(--line); border-radius: 13px; }
.profile-panel h2 { font-size: clamp(17px, 2.4vw, 22px); line-height: 1.2; letter-spacing: -.035em; }
.profile-subtitle { margin-top: 5px; color: var(--muted); font-size: 13px; }
.profile-form, .profile-credentials form { margin-top: 12px; padding: 0; gap: 9px; }
.profile-form > button, .profile-logout { justify-self: start; }
#profile-email { margin-top: 9px; overflow-wrap: anywhere; }
.profile-form .profile-file input[type=file] { font-size: 12px; overflow: hidden; }
.profile-file input::file-selector-button {
  margin-inline-end: 8px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 5px;
  background: var(--panel); color: var(--ink); font: inherit; font-weight: 650; cursor: pointer;
}
.profile-actions, .profile-panel-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.profile-panel-head { justify-content: space-between; }
.profile-logout, .profile-credentials { margin-top: 10px; }
.profile-credentials summary { color: var(--accent); font-size: 13px; font-weight: 650; }
.profile-panel #cloud-login-message:not(:empty) { margin-top: 8px; }
.profile-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 14px; }
.profile-metrics div { min-width: 0; padding: 10px; background: var(--raised); border: 1px solid var(--line); border-radius: 8px; }
.profile-metrics dt, .profile-rule { color: var(--muted); font-size: 12px; }
.profile-metrics dd { margin-top: 4px; font-size: clamp(16px, 2.2vw, 24px); font-weight: 740; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.profile-metrics small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.profile-rule { margin-top: 9px; }
.profile-history { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.profile-history summary { color: var(--accent); font-size: 13px; font-weight: 670; }
.profile-history ul { list-style: none; padding: 0; margin: 8px 0 0; }
.profile-history li { display: flex; gap: 8px; align-items: baseline; padding: 5px 0; font-size: 12px; }
.profile-history time { color: var(--muted); flex: none; }
.profile-history li span { min-width: 0; overflow-wrap: anywhere; }
.profile-history li strong { margin-inline-start: auto; white-space: nowrap; }
.profile-history .profile-withdrawal strong { color: var(--danger); }
.profile-gallery-title { margin: 15px 0 7px; font-size: 14px; font-weight: 740; }
.profile-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 104px), 1fr)); gap: 7px; }
.profile-choice {
  display: grid; justify-items: center; align-content: start; gap: 4px; padding: 8px;
  border: 1px solid var(--line); border-radius: 9px; min-width: 0; color: var(--ink); background: var(--panel);
}
.profile-choice:hover:not(:disabled) { border-color: var(--accent); background: var(--hover); }
.profile-choice:disabled { opacity: .75; }
.profile-choice[data-selected=true] { border-color: var(--accent); background: var(--accent-soft); opacity: 1; }
.profile-choice strong { font-size: 12px; overflow-wrap: anywhere; }
.profile-choice small { font-size: 11px; color: var(--muted); }
.profile-preview { width: 42px; border-radius: 10px; font-size: 15px; }
.profile-swatch { display: block; width: 100%; height: 42px; border-radius: 6px; }
.profile-error-toast { background: var(--panel); color: var(--danger); border-color: var(--danger); }

@media (max-width: 800px) { .profile-layout { grid-template-columns: 1fr; } }
@media (max-width: 460px) {
  .profile-cover-body { align-items: flex-start; flex-direction: column; gap: 12px; }
  .profile-identity { gap: 10px; }
  .profile-identity .profile-avatar { width: 48px; border-radius: 12px; font-size: 17px; }
  .profile-metrics { grid-template-columns: 1fr; }
  .contribution-callout { grid-template-columns: auto minmax(0, 1fr); }
  .contribution-callout > a { grid-column: 2; justify-self: start; }
}

/* Compact widths */
@media (max-width: 1040px) {
  .expense-layout { grid-template-columns: 1fr; }
  .expense-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (max-width: 790px) {
  .dashboard-top { grid-template-columns: 1fr auto; min-height: auto; padding-top: 10px; row-gap: 4px; }
  .dashboard-top .top-actions { grid-row: 1; grid-column: 2; }
  .dashboard-top .workspace-tabs { grid-column: 1 / -1; min-height: 40px; gap: 16px; }
  .page-intro { flex-wrap: wrap; margin-bottom: 20px; }
  .page-actions { justify-content: flex-start; }
}
@media (max-width: 680px) {
  .login-page { grid-template-columns: minmax(0, 460px); justify-content: center; }
  .login-intro { display: none; }
  .login-card { border-radius: 12px; }
  .expense-sidebar { grid-template-columns: 1fr; }
  .ledger-head { flex-wrap: wrap; }
  .ledger-tools { justify-content: flex-start; }
}
@media (max-width: 550px) {
  form input:not([type=checkbox]) { font-size: 16px; }
  .expense-fab { width: 54px; height: 54px; padding: 0; }
  .expense-fab span { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding-block: 10px 12px; }
  .stat:nth-child(odd) { border-inline-start: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .ledger-columns { display: none; }
  .row {
    grid-template-columns: minmax(0, 1fr) minmax(66px, max-content) 29px;
    gap: 4px 7px; align-items: center; padding: 10px 12px;
  }
  .row .entry-description { grid-column: 1; grid-row: 1 / span 2; }
  .row .amount { grid-column: 2; grid-row: 1; font-size: 12px; }
  .row .date { display: none; }
  .row .row-status { grid-column: 2; grid-row: 2; justify-self: end; }
  .row .icon-button { grid-column: 3; grid-row: 1 / span 2; width: 29px; }
  .row .badge { min-height: 24px; padding: 3px 6px; }
  .ledger-head, .filters { padding-inline: 12px; }
  .filters, .ledger-selects { justify-content: flex-start; }
  .ledger-tools { width: 100%; }
  .search { flex: 1 1 114px; }
  .investment-metrics { grid-template-columns: 1fr; }
  .investment-metrics > div { padding: 9px; }
}
@media (max-width: 480px) {
  .dashboard-top .workspace-tabs { gap: 9px; }
  .workspace-tabs button { padding-inline: 4px; font-size: 12px; }
  .dashboard-top .theme-current { display: none; }
  .top-actions .theme-panel { inset-inline-end: -60px; }
}
@media (max-width: 390px) {
  .expense-date-fields { grid-template-columns: 1fr; }
  .brand small { display: none; }
  .brand { font-size: 18px; gap: 6px; }
  .brand-icon { width: 31px; height: 31px; }
  .brand-icon svg { width: 16px; height: 16px; }
  .top-inner { gap: 7px; }
  .top-actions { gap: 4px; }
  .private, .theme-trigger { gap: 4px; padding-inline: 6px; font-size: 11px; }
  .page-actions { display: grid; grid-template-columns: auto minmax(0, 1fr); width: 100%; gap: 6px; }
  .page-actions :is(.primary, .secondary) { padding-inline: 8px; font-size: 12px; }
  .month-field { min-width: 99px; font-size: 11px; }
  .month button { width: 26px; }
  .section-head h2 { font-size: 16px; }
}

/* Investment detail and movement history */
.saving-card-clickable { cursor: pointer; transition: transform .25s cubic-bezier(.2,.75,.25,1), box-shadow .25s, background-color .25s; }
@media (hover: hover) {
  .saving-card-clickable:hover { transform: translateY(-5px); background-color: var(--raised); box-shadow: 0 16px 32px #0003, 0 4px 10px #0001; }
  .saving-card-clickable:hover .saving-details-link::after { opacity: 1; transform: translate(3px, -3px); }
}
.saving-card-clickable:focus-within { box-shadow: 0 10px 24px #0002; }
.saving-card-clickable:active { transform: translateY(-1px) scale(.995); }
.saving-details-link { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.saving-details-link::after { content: ' ↗'; display: inline-block; opacity: .55; font-size: .85em; transition: transform .25s, opacity .25s; }
.saving-details-link:focus-visible { outline: 2px solid currentColor; outline-offset: 5px; border-radius: 3px; }
.investment-history-dialog { width: min(760px, calc(100vw - 24px)); max-width: 760px; padding: 0; }
.investment-history-content { padding: clamp(16px, 4vw, 30px); }
.investment-history-content h2 { overflow-wrap: anywhere; }
.investment-history-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 20px 0 26px; }
.investment-history-totals > div { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.investment-history-totals small, .investment-history-list small { opacity: .7; font-size: .78rem; }
.investment-history-totals strong { font-size: clamp(.95rem, 2.8vw, 1.3rem); overflow-wrap: anywhere; }
.investment-chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.investment-chart-head h3, .investment-history-heading h3 { font-size: 1rem; margin: 0; }
.investment-chart-head p { font-size: .82rem; margin: 4px 0; opacity: .8; }
.investment-chart { margin: 12px 0; border: 1px solid var(--line); border-radius: 14px; padding: 12px 4px; }
.investment-chart > p { padding: 16px; }
.investment-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: currentColor; opacity: .12; stroke-dasharray: 3 5; }
.chart-label { fill: currentColor; opacity: .65; font: 11px system-ui, sans-serif; }
.chart-line { stroke: var(--accent, #83bd4e); fill: none; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.chart-point { fill: var(--accent, #83bd4e); stroke: currentColor; stroke-width: 1; cursor: pointer; }
.chart-point.selected, .chart-point:focus { r: 7; stroke-width: 3; outline: none; }
.investment-history-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.investment-history-list { list-style: none; padding: 0; margin: 10px 0 0; }
.investment-history-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.investment-history-list li > div { display: grid; gap: 5px; }
.movement-positive { color: var(--accent, #83bd4e); }
@media (max-width: 450px) {
  .investment-history-totals { grid-template-columns: 1fr; gap: 8px; }
  .investment-history-totals > div { display: flex; justify-content: space-between; align-items: center; padding: 12px; }
  .investment-history-totals strong { font-size: 1.05rem; }
}

.investment-chart text { font-weight: 400; }

.investment-chart { position: relative; }
.chart-area { fill: var(--accent); opacity: .09; pointer-events: none; }
.chart-guide { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 4; pointer-events: none; }
.chart-point { transition: r .18s, stroke-width .18s; }
.chart-tooltip { position: absolute; z-index: 2; transform: translateX(-50%); display: grid; gap: 4px; min-width: 132px; padding: 10px 14px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 8px 24px #0004; color: var(--ink); pointer-events: none; animation: chart-tooltip-in .14s ease-out; }
.chart-tooltip[hidden] { display: none; }
.chart-tooltip strong { font-size: .93rem; }
.chart-tooltip span { font-size: .75rem; color: var(--muted); }
@keyframes chart-tooltip-in { from { opacity: 0; margin-top: 4px; } to { opacity: 1; margin-top: 0; } }
@media (prefers-reduced-motion: reduce) {
  .saving-card-clickable, .saving-details-link::after, .chart-point { transition: none; }
  .saving-card-clickable:hover, .saving-card-clickable:active { transform: none; }
  .chart-tooltip { animation: none; }
}
@media (max-width: 450px) {
  .investment-history-totals > div { flex-wrap: wrap; column-gap: 8px; }
  .investment-history-totals > div > strong { white-space: nowrap; overflow-wrap: normal; }
  .investment-history-totals > div > small:last-child { flex-basis: 100%; }
}
.salary-hourly-fields { display: grid; gap: 6px; }
.salary-calculation { border: 1px solid var(--line); border-radius: 10px; background: var(--raised); color: var(--ink); padding: 12px 14px; font-size: .87rem; font-weight: 600; line-height: 1.5; }
#salary-payment-summary { padding: 10px 0; line-height: 1.6; }

.cash-panel { margin: 0 0 24px; padding: clamp(18px, 3vw, 28px); }
.cash-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.cash-panel-head h2 { margin: 0; font-size: 1.3rem; }
.cash-total { display: grid; gap: 5px; margin: 20px 0; }
.cash-total > span { color: var(--muted); font-size: .8rem; }
.cash-total > strong { font-size: clamp(1.7rem, 4vw, 2.3rem); font-weight: 750; letter-spacing: -.04em; }
.cash-accounts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 12px; margin-bottom: 16px; }
.cash-account { display: grid; gap: 10px; padding: 18px; border: 1px solid var(--line); border-left: 3px solid var(--bank-accent, var(--line)); border-radius: 12px; background: var(--panel); }
.cash-account-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cash-account > small { color: var(--muted); font-size: .78rem; }
.cash-account > strong { font-size: 1.5rem; letter-spacing: -.025em; }
@media (max-width: 450px) { .salary-hourly-fields .fields { grid-template-columns: 1fr; } }
.salary-panel > .finance-head { flex-wrap: wrap; }
.salary-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.extra-income-history { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 15px; }
.extra-income-history h3 { font-size: .95rem; margin: 0 0 6px; }
#extra-income-list { list-style: none; padding: 0; margin: 10px 0 0; }
#extra-income-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
#extra-income-list li > div:first-child { display: grid; gap: 5px; min-width: 0; font-size: .85rem; }
#extra-income-list strong { overflow-wrap: anywhere; }
.extra-income-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.human-verification { display: grid; gap: 7px; width: 100%; min-width: 0; margin: 4px 0; }
#human-verification { width: 100%; min-height: 65px; }
.human-verification .hint { margin: 0; }
#human-verification-retry { justify-self: start; }

/* Segurança da conta */
.security-page { width:min(540px,calc(100% - 32px));margin:60px auto;padding:28px; }
.security-page form,.security-page #security-new-password { display:grid;gap:16px; }
.security-page [hidden] { display:none!important; }
.security-sessions { display:grid;gap:12px;padding:0;list-style:none; }
.security-sessions li { display:grid;gap:8px;padding:14px;border:1px solid var(--border,#363636);border-radius:12px;min-width:0; }
.security-sessions small { overflow-wrap:anywhere;opacity:.75; }
.security-sessions button { justify-self:start; }
#account-security { margin:20px 0;padding-top:16px;border-top:1px solid var(--border,#363636); }
#account-security h3 { margin:20px 0 10px; }

/* Perfil: uma área por vez */
.profile-page .profile-cover { position:relative;padding:22px 28px;border-radius:18px; }
.profile-page .profile-cover-body { margin-top:20px;gap:24px; }
.profile-page .profile-identity h1 { max-width:730px;font-size:clamp(23px,3.1vw,34px);line-height:1.2; }
.profile-cover-caption { margin-top:5px;color:#e0ebe3;font-size:13px; }
.profile-page .profile-kicker { font-size:10px; }
.profile-page .profile-coins { background:#0002;border:0;padding:10px 14px; }
.profile-page .profile-coins strong { font-size:26px; }
.profile-customize { position:absolute;top:22px;right:28px;display:flex;align-items:center;gap:6px;margin:0;padding:6px 0;background:transparent;color:#f3f8f3;border:0;font-size:12px; }
.profile-customize:hover { background:transparent;text-decoration:underline; }
.profile-customize svg { width:14px;height:14px; }
.profile-settings { margin-top:24px; }
.profile-nav { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;padding:5px;background:var(--panel);border:1px solid var(--line);border-radius:13px; }
.profile-nav button { display:flex;align-items:center;justify-content:center;gap:8px;min-width:0;padding:13px 8px;border:1px solid transparent;border-radius:9px;color:var(--muted);background:transparent;font-size:13px;font-weight:650;transition:background .18s,color .18s; }
.profile-nav button svg { width:18px;height:18px;flex-shrink:0; }
.profile-nav button:hover { color:var(--ink);background:var(--hover); }
.profile-nav button[aria-selected=true] { color:var(--ink);background:var(--raised);border-color:var(--line);box-shadow:0 2px 4px #00000008; }
.profile-tab-content { margin-top:26px;outline-offset:6px;animation:profile-pane-in .2s ease-out; }
@keyframes profile-pane-in { from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)} }
.profile-section-heading { margin:0 0 18px; }
.profile-section-heading h2 { font-size:24px;font-weight:730;letter-spacing:-.035em;line-height:1.25; }
.profile-section-heading > p:last-child { color:var(--muted);font-size:13px;margin-top:6px; }
.profile-section-heading .profile-eyebrow { display:none; }
.profile-settings .profile-panel { padding:24px;border-radius:14px; }
.profile-settings .profile-panel h2 { font-size:18px; }
.profile-data-grid { max-width:730px; }
.profile-settings .profile-form { margin-top:20px;gap:16px; }
.profile-settings .profile-form label { font-size:13px; }
.profile-settings #profile-name-form { max-width:560px; }
.profile-settings #profile-email { border-top:1px solid var(--line);margin-top:24px;padding-top:18px;color:var(--muted);font-size:12px; }
.profile-appearance-grid { display:grid;grid-template-columns:minmax(230px,.8fr) minmax(0,1.6fr);gap:20px;align-items:start; }
.profile-settings .profile-gallery { grid-template-columns:repeat(auto-fit,minmax(min(100%,110px),1fr));gap:10px; }
.profile-settings .profile-gallery-title { margin:24px 0 12px; }
.profile-settings .profile-choice { padding:15px 9px;gap:7px;border-radius:12px;transition:background .18s,border-color .18s,transform .18s; }
.profile-settings .profile-choice:hover:not(:disabled) { transform:translateY(-2px); }
.profile-settings .profile-preview { width:46px;height:46px; }
.profile-settings .profile-swatch { height:48px; }
.profile-settings .profile-metrics { gap:14px;margin-top:22px; }
.profile-settings .profile-metrics div { padding:18px;border-radius:10px;background:transparent; }
.profile-settings .profile-metrics dd { margin-top:12px;font-size:27px; }
.profile-settings .profile-metrics small { margin-top:7px;line-height:1.5; }
.profile-settings .profile-rule { margin-top:18px;line-height:1.65; }
.profile-settings .profile-history { margin-top:24px;padding-top:18px; }
.profile-settings .profile-history summary { padding-block:3px;font-size:13px; }
.profile-settings .profile-history li { padding:13px 0;border-bottom:1px solid var(--line); }
#profile-pane-seguranca > .profile-panel { max-width:850px; }
.profile-security-method { margin-top:0;padding-block:0 20px;border-bottom:1px solid var(--line); }
.profile-settings h3 { font-size:14px;font-weight:680; }
.profile-security-method > .hint { margin-top:7px; }
.profile-settings #account-security { margin:0;padding:0;border:0; }
.profile-settings #account-security h3 { margin:0; }
.profile-security-email { display:flex;justify-content:space-between;align-items:center;gap:18px;padding-block:22px;border-bottom:1px solid var(--line); }
.profile-security-email p { margin-top:7px;color:var(--muted);font-size:13px;line-height:1.6;max-width:510px; }
.profile-session-head { display:flex;justify-content:space-between;align-items:center;gap:16px;margin:22px 0 12px; }
.profile-session-head .hint { margin-top:5px; }
.profile-active-badge { flex:none;border-radius:20px;background:var(--accent-soft);color:var(--accent);font-size:11px;padding:5px 10px;font-weight:650; }
.profile-settings .security-sessions { display:block;margin:0; }
.profile-settings .security-sessions li { display:flex;align-items:center;justify-content:space-between;gap:14px;padding:16px 0;border:0;border-bottom:1px solid var(--line);border-radius:0; }
.profile-settings .security-sessions li > div { display:grid;gap:5px;min-width:0; }
.profile-settings .security-sessions strong { font-size:13px;font-weight:620; }
.profile-settings .security-sessions small { font-size:12px;color:var(--muted);opacity:1; }
.profile-settings .security-sessions button { flex:none;font-size:12px;padding:8px 12px; }
.profile-settings #security-current-session li { border:0;border-radius:10px;background:var(--raised);padding:16px; }
.profile-other-sessions { margin-top:14px;border:1px solid var(--line);border-radius:10px; }
.profile-other-sessions > summary { display:flex;align-items:center;gap:10px;list-style:none;padding:15px 16px;font-size:13px;font-weight:650;cursor:pointer; }
.profile-other-sessions > summary::-webkit-details-marker { display:none; }
.profile-other-sessions > summary svg { width:16px;height:16px;margin-left:auto;transition:transform .18s; }
.profile-other-sessions[open] > summary svg { transform:rotate(180deg); }
.profile-session-count { display:grid;place-items:center;min-width:22px;height:22px;padding:0 5px;border-radius:6px;background:var(--raised);color:var(--muted);font-size:11px; }
.profile-other-sessions > .hint { padding:0 16px 10px; }
.profile-settings .profile-other-sessions .security-sessions { max-height:350px;overflow-y:auto;padding:0 16px; }
.profile-settings .security-sessions .security-session-empty { color:var(--muted);font-size:13px; }
.profile-signout-all { display:flex;justify-content:space-between;align-items:center;gap:18px;border-top:1px solid var(--line);margin-top:24px;padding-top:22px; }
.profile-signout-all .hint { max-width:460px;margin-top:6px;line-height:1.6; }
.profile-signout-all button { color:var(--danger);flex:none; }
.profile-signout { margin-top:22px;padding-top:18px;border-top:1px solid var(--line); }
.profile-signout .profile-logout { margin:0; }
.profile-settings #security-message:not(:empty) { margin-top:16px;font-size:13px;color:var(--accent); }
@media (max-width:800px) {
  .profile-appearance-grid { grid-template-columns:1fr; }
  .profile-appearance-grid > .profile-panel:first-child .profile-form { max-width:500px; }
  .profile-page .profile-cover { padding:20px; }
}
@media (max-width:540px) {
  .profile-page .profile-cover-body { align-items:flex-start;flex-direction:column;gap:18px; }
  .profile-page .profile-coins { padding:0;background:none; }
  .profile-page .profile-coins strong { font-size:22px; }
  .profile-page .profile-coins svg { width:20px;height:20px; }
  .profile-customize { display:none; }
  .profile-settings { margin-top:18px; }
  .profile-nav { grid-template-columns:repeat(2,minmax(0,1fr));gap:4px; }
  .profile-nav button { justify-content:flex-start;padding:11px 12px;font-size:12px; }
  .profile-tab-content { margin-top:22px; }
  .profile-section-heading h2 { font-size:22px; }
  .profile-settings .profile-panel { padding:18px; }
  .profile-settings .profile-metrics { grid-template-columns:1fr;gap:10px; }
  .profile-settings .profile-metrics div { padding:16px; }
  .profile-settings .profile-metrics dd { font-size:25px;margin-top:6px; }
  .profile-security-email,.profile-signout-all { align-items:flex-start;flex-direction:column;gap:12px; }
  .profile-settings .profile-history li { flex-wrap:wrap; }
}
@media (prefers-reduced-motion:reduce) {
  .profile-tab-content { animation:none; }
  .profile-settings .profile-choice,.profile-nav button,.profile-other-sessions > summary svg { transition:none; }
}

.profile-mfa { border-bottom:1px solid var(--line);padding:22px 0; }
.profile-mfa > .hint,.profile-mfa .profile-panel-head .hint { margin-top:6px; }
.profile-mfa > button,.profile-mfa > details { margin-top:14px; }
.profile-mfa summary { cursor:pointer;font-size:13px;color:var(--accent); }
.profile-mfa [hidden] { display:none!important; }
.profile-mfa form { max-width:470px; }
#mfa-setup,#mfa-recovery { margin-top:20px;padding:18px;background:var(--raised);border:1px solid var(--line);border-radius:12px;font-size:13px;line-height:1.65; }
#mfa-qr { width:min(100%,220px);margin:16px 0;background:white;padding:8px;border-radius:10px; }
#mfa-qr svg { display:block;width:100%;height:auto;fill:black;stroke:none; }
#mfa-secret { display:block;overflow-wrap:anywhere;user-select:all;margin:12px 0; }
#mfa-recovery-codes { list-style:none;padding:0;display:grid;gap:6px;margin:14px 0; }
#mfa-recovery-codes code { font-size:clamp(9px,2.6vw,12px);user-select:all;overflow-wrap:anywhere; }
#mfa-message:not(:empty) { margin-top:14px;color:var(--accent);font-size:13px; }

.profile-weekly { padding:22px 0;border-bottom:1px solid var(--line); }
.profile-weekly > .hint { margin-top:8px;line-height:1.65;max-width:610px; }
.profile-weekly .weekly-check { display:flex;align-items:center;gap:10px;font-size:13px;cursor:pointer; }
.profile-weekly .weekly-check input { width:18px;height:18px;min-height:18px;flex:none;accent-color:var(--accent); }
.profile-weekly form { max-width:480px; }

.profile-weekly > summary { display:flex;align-items:center;gap:12px;list-style:none;cursor:pointer;font-size:14px;font-weight:680; }
.profile-weekly > summary::-webkit-details-marker { display:none; }
.profile-weekly > summary svg { width:16px;height:16px;flex:none;margin-left:auto; }
.profile-weekly[open] > summary svg { transform:rotate(180deg); }
.profile-weekly #weekly-badge[data-enabled=false] { color:var(--muted);background:var(--raised); }
.profile-weekly[open] > .hint:first-of-type { margin-top:16px; }
