/* Contas da casa. Fundo branco, azul-tinta e linhas finas. Sempre claro (escuro só com data-theme=dark). */
@font-face { font-family: "Bricolage"; src: url(../fonts/bricolage.woff2) format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Bricolage"; src: url(../fonts/bricolage-ext.woff2) format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: "Plex"; src: url(../fonts/plex-400.woff2) format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+2212; }
@font-face { font-family: "Plex"; src: url(../fonts/plex-500.woff2) format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+2212; }
@font-face { font-family: "Plex"; src: url(../fonts/plex-600.woff2) format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+2212; }
@font-face { font-family: "Plex"; src: url(../fonts/plex-ext-400.woff2) format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0100-024F; }
@font-face { font-family: "Plex"; src: url(../fonts/plex-ext-500.woff2) format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0100-024F; }
@font-face { font-family: "Plex"; src: url(../fonts/plex-ext-600.woff2) format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0100-024F; }

:root {
  color-scheme: light;
  --paper: #f7f8fb;
  --surface: #ffffff;
  --sunken: #f3f4f7;
  --ink: #1a2030;
  --ink-2: #565f72;
  --ink-3: #626c7e;
  --rule: #e9ebf0;
  --pine: #3b4f9a;          /* destaque: azul-tinta (nome antigo mantido por compatibilidade) */
  --pine-ink: #ffffff;
  --moss: #eef1fa;          /* destaque suave */
  --pos: #2d6a8e;
  --neg: #b9483a;
  --neg-soft: #fbefec;
  --warn: #8a5a14;
  --warn-soft: #faf3e3;
  --sky: #5a8bb8;
  --sky-soft: #edf3f9;
  --lilac: #7d6bb5;
  --lilac-soft: #f1eefa;
  --series: #3b4f9a;
  --series-base: #a5adbb;
  --focus: #3b4f9a;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --shadow: none;
  --accent: var(--pine);
  --sh-1: 0 1px 2px rgba(21, 27, 43, .05), 0 1px 1px rgba(21, 27, 43, .03);
  --sh-2: 0 8px 28px rgba(21, 27, 43, .08), 0 2px 6px rgba(21, 27, 43, .04);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --display: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --body: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #12151b; --surface: #1a1e26; --sunken: #232832; --ink: #e8ebf1; --ink-2: #aab3c2;
  --ink-3: #818b9b; --rule: #2c323d; --pine: #9db4f5; --pine-ink: #12151b; --moss: #232b45;
  --pos: #8fb0f5; --neg: #ff8a80; --neg-soft: #3a1d1b; --warn: #f2c35b; --warn-soft: #362b12;
  --series: #9db4f5; --series-base: #6c7686;
  --sky-soft: #1c2a3a; --lilac-soft: #26223f; --sky: #7db4ea; --lilac: #b0a4f2; --shadow: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 15px/1.5 var(--body); font-variant-numeric: tabular-nums;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--body); font-weight: 650; letter-spacing: -0.01em; margin: 0; }
h1, .hero-a, .qname, .qamt, .fact dd, .when b, .monthnav strong, .amount-input, .login h1 { font-family: var(--display); }
h1 { font-size: 28px; line-height: 1.15; }
h2 { font-size: 19px; line-height: 1.25; }
h3 { font-size: 15px; font-family: var(--body); font-weight: 600; letter-spacing: 0; }
p { margin: 0; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 13px; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- shell */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; padding: 24px 16px; display: flex; flex-direction: column; gap: 4px;
}
.wordmark { font-family: var(--display); font-weight: 750; font-size: 22px; padding: 0 10px 18px; letter-spacing: -0.02em; text-decoration: none; display: flex; align-items: center; gap: 10px; }
.wordmark::before { content: ""; width: 34px; height: 34px; border-radius: 11px; flex: none; background: var(--pine) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11.5 12 4l9 7.5'/%3E%3Cpath d='M5.5 10v9.5h13V10'/%3E%3C/svg%3E") center/20px no-repeat; }
.wordmark span { display: block; }
.wordmark small { display: block; font: 400 12px/1.3 var(--body); color: var(--ink-3); letter-spacing: 0; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--r-md);
  text-decoration: none; color: var(--ink-2); font-weight: 500;
}
.nav a:hover { background: var(--sunken); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--moss); color: var(--pine); font-weight: 600; }
.nav a[aria-current="page"] svg { color: var(--pine); }
.nav svg { width: 18px; height: 18px; flex: none; }
.side .btn-primary { margin: 14px 0 0; justify-content: center; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding: 0 10px; font-size: 13px; color: var(--ink-3); }
.side-foot form { margin: 0; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--ink-2); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

.main { padding: 32px 40px 80px; max-width: 1180px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head p { margin-top: 4px; }

.tabs { display: none; }
.fab { display: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .main { padding: 20px 16px 120px; }
  h1 { font-size: 24px; }
  .tabs {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0 0; z-index: 20;
    background: var(--surface); border-top: 1px solid var(--rule); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--ink-3); text-decoration: none; padding: 4px 0; }
  .tabs a[aria-current="page"] { color: var(--ink); font-weight: 600; }
  .tabs svg { width: 22px; height: 22px; }
  .fab {
    display: inline-flex; position: fixed; right: 16px; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 21;
    align-items: center; gap: 8px; padding: 14px 20px; border-radius: 999px; border: 0;
    background: var(--pine); color: var(--pine-ink); font: 600 15px var(--body);
    box-shadow: 0 6px 16px rgba(59, 79, 154, .32);
  }
  .fab svg { width: 18px; height: 18px; }
}

/* ---------- buttons & controls */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink);
  font: 500 14px/1.2 var(--body); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-3); }
.btn-primary { background: var(--pine); border-color: var(--pine); color: var(--pine-ink); }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--pine); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--ink-2); padding: 6px 8px; }
.btn-quiet:hover { background: var(--sunken); color: var(--ink); border-color: transparent; }
.btn-danger { color: var(--neg); }
.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: 999px; }
.btn svg { width: 16px; height: 16px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.seg { display: inline-flex; background: var(--sunken); border-radius: 999px; padding: 3px; gap: 2px; }
.seg a, .seg button, .seg label {
  border: 0; background: none; padding: 6px 14px; border-radius: 999px; font: 500 13px var(--body);
  color: var(--ink-2); cursor: pointer; text-decoration: none; white-space: nowrap;
}
.seg [aria-pressed="true"], .seg [aria-current="true"], .seg input:checked + span {
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
}
.seg label { padding: 0; }
.seg label span { display: block; padding: 7px 14px; border-radius: 999px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:focus-visible) span { outline: 2px solid var(--focus); }

/* ---------- dashboard hero */
.hero { padding: 24px 26px; margin-bottom: 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--rule); box-shadow: var(--shadow); }
.hero-q { color: var(--ink-2); font-size: 15px; margin-bottom: 6px; }
.hero-a { font-family: var(--display); font-size: clamp(26px, 4.2vw, 40px); line-height: 1.12; font-weight: 650; letter-spacing: -0.02em; letter-spacing: -0.02em; max-width: 26ch; }
.hero-a .val { font-weight: 750; }
.hero-a .val.neg { color: var(--neg); }
.hero-alert {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; padding: 12px 14px;
  border-radius: var(--r-md); background: var(--neg-soft); color: var(--ink); max-width: 640px;
}
.hero-alert svg { width: 20px; height: 20px; color: var(--neg); flex: none; margin-top: 1px; }
.hero-alert.warn { background: var(--warn-soft); }
.hero-alert.warn svg { color: var(--warn); }

.facts { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px 0 0; border-top: 0; margin: 0; }
.fact { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-md); padding: 10px 16px; min-width: 150px; }
.fact dt { font-size: 13px; color: var(--ink-2); }
.fact dd { margin: 2px 0 0; font-family: var(--display); font-size: 22px; font-weight: 650; letter-spacing: -0.01em; }
.fact dd small { display: block; font: 400 13px/1.4 var(--body); color: var(--ink-3); letter-spacing: 0; }

.forecast { background: var(--surface); border: 1px solid var(--rule); box-shadow: var(--shadow); border-radius: var(--r-lg); padding: 20px 20px 16px; }
.forecast-bar { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.chart-box { position: relative; height: 300px; }
@media (max-width: 600px) { .chart-box { height: 240px; } }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); margin-top: 10px; }
.legend i { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--series); vertical-align: middle; margin-right: 6px; }
.legend i.base { border-top: 2px dashed var(--series-base); }
.legend i.zero { border-top: 2px solid var(--neg); }

.scenarios { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--rule); }
.scenarios h3 { margin-bottom: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 9px; border-radius: 999px;
  border: 1px solid var(--rule); background: var(--paper); color: var(--ink-2); font: 500 13px var(--body); cursor: pointer;
}
.chip:hover { border-color: var(--pine); }
.chip .box { width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid var(--ink-3); display: grid; place-items: center; }
.chip .box svg { width: 12px; height: 12px; opacity: 0; }
.chip[aria-pressed="true"] { background: var(--moss); border-color: transparent; color: var(--ink); }
.chip[aria-pressed="true"] .box { background: var(--pine); border-color: var(--pine); color: var(--pine-ink); }
.chip[aria-pressed="true"] .box svg { opacity: 1; }
.chip .impact { color: var(--ink-3); font-weight: 400; }
.htmx-request .chart-box { opacity: .55; transition: opacity .2s; }

/* ---------- panels and lists */
.grid-2 { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; margin-top: 16px; }
.grid-2 > section, .card { background: var(--surface); border-radius: var(--r-lg); padding: 20px; border: 1px solid var(--rule); box-shadow: none; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; gap: 28px; } }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.section-head a { font-size: 13px; color: var(--ink-2); }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.list > li:last-child { border-bottom: 0; }
.when { width: 46px; flex: none; text-align: center; line-height: 1.1; }
.when b { display: block; font-family: var(--display); font-size: 19px; font-weight: 650; }
.when span { font-size: 12px; color: var(--ink-3); }
.when.late b, .when.late span { color: var(--neg); }
.grow { flex: 1; min-width: 0; }
.grow .title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grow .sub { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.amount { font-weight: 600; text-align: right; white-space: nowrap; }
.tag { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 999px; background: var(--sunken); color: var(--ink-2); vertical-align: 1px; }
.tag.late { background: var(--neg-soft); color: var(--neg); }
.tag.plan { background: var(--moss); color: var(--ink); }

.empty { padding: 22px; border: 1px dashed var(--rule); border-radius: var(--r-md); color: var(--ink-2); text-align: center; }
.empty .btn { margin-top: 10px; }

/* budget bars */
.bars { list-style: none; margin: 0; padding: 0; }
.bars li { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.bars li:last-child { border-bottom: 0; }
.bar { position: relative; height: 10px; border-radius: 99px; background: var(--sunken); margin-top: 7px; overflow: visible; }
.bar .fill { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--pine); max-width: 100%; }
.bar .fill.proj { background: var(--pine); opacity: .28; }
.bar.over .fill { background: var(--neg); }
.bar.ahead .fill:not(.proj) { background: var(--warn); }
.bar .pace { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); opacity: .55; border-radius: 1px; }

/* ---------- tables (transactions) */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.toolbar form { display: contents; }
.monthnav { display: inline-flex; align-items: center; gap: 4px; }
.monthnav strong { font-family: var(--display); font-size: 18px; min-width: 150px; text-align: center; font-weight: 650; }
.day { margin-top: 18px; }
.day-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-3); padding: 0 0 4px; border-bottom: 1px solid var(--rule); }
.tx { display: grid; grid-template-columns: 1fr 190px 130px 34px; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.tx .who { font-size: 12px; color: var(--ink-3); }
.tx select { width: 100%; }
.tx select.uncat { border-color: var(--warn); background-color: var(--warn-soft); }
@media (max-width: 700px) {
  .tx { grid-template-columns: 1fr auto; row-gap: 6px; }
  .tx .cat { grid-column: 1; grid-row: 2; }
  .tx .amount { grid-column: 2; grid-row: 1; }
  .tx .act { grid-column: 2; grid-row: 2; justify-self: end; }
}
.totals { display: flex; flex-wrap: wrap; gap: 6px 28px; font-size: 14px; color: var(--ink-2); margin-bottom: 4px; }

/* ---------- forms */
input, select, textarea {
  font: 400 15px var(--body); color: var(--ink); background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--r-sm); padding: 9px 10px; min-height: 40px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
.toolbar select, .toolbar input { width: auto; min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
.form { display: grid; gap: 14px; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .form .two { grid-template-columns: 1fr; } }
.field label { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); margin-bottom: 4px; }
.field .hint { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.field .err { font-size: 13px; color: var(--neg); margin-top: 3px; }
.field.has-err input, .field.has-err select { border-color: var(--neg); }
.amount-input { font-family: var(--display); font-size: 28px; font-weight: 650; padding: 8px 12px; min-height: 56px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { width: 18px; height: 18px; min-height: 0; margin-top: 2px; accent-color: var(--pine); }
.form-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.inline-form { display: flex; gap: 6px; align-items: center; }
.inline-form input { width: 130px; min-height: 34px; padding: 5px 8px; font-size: 14px; }

/* ---------- dialog */
dialog {
  width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 0; border: 0;
  border-radius: var(--r-lg); background: var(--surface); color: var(--ink);
  box-shadow: 0 24px 60px rgba(31, 42, 55, .25);
}
dialog::backdrop { background: rgba(12, 20, 16, .45); }
dialog[open] { animation: rise .18s ease-out; }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 600px) {
  dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: 92vh; }
}
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 0; }
.dlg-body { padding: 14px 20px 20px; overflow: auto; }

/* ---------- toast */
.toast-region { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 50; display: grid; gap: 8px; pointer-events: none; }
@media (max-width: 900px) { .toast-region { bottom: calc(140px + env(safe-area-inset-bottom)); } }
.toast { background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--r-md); font-weight: 500; box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: rise .2s ease-out; }
.toast.error { background: var(--neg); color: #fff; }

/* ---------- planning */
.plan-sec { margin-top: 30px; }
.plan-sec:first-of-type { margin-top: 0; }
.plan-row .actions { display: flex; gap: 4px; }
.summary-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 16px; }

/* ---------- accounts */
.acc-group { margin-top: 28px; }
.acc-group:first-of-type { margin-top: 0; }
.acc-row details summary { cursor: pointer; list-style: none; color: var(--ink-2); font-size: 13px; }
.acc-row details summary::-webkit-details-marker { display: none; }
.acc-row details[open] summary { margin-bottom: 6px; }

/* ---------- login & onboarding */
.center { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login { width: min(380px, 100%); }
.login h1 { font-size: 34px; margin-bottom: 6px; }
.login .form { margin-top: 24px; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; max-width: 620px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; padding: 16px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md); }
.steps li::before { content: counter(s); font-family: var(--display); font-weight: 700; font-size: 20px; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--moss); }
.steps p { margin-top: 2px; }
.steps .btn { margin-top: 10px; }

.cat-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cat-table th { text-align: left; font-weight: 500; color: var(--ink-3); font-size: 13px; padding: 6px 8px; border-bottom: 1px solid var(--rule); }
.cat-table td { padding: 6px 8px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.cat-table input, .cat-table select { min-height: 34px; padding: 5px 8px; font-size: 14px; }
.cat-table input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--pine); }
.scroll-x { overflow-x: auto; }

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

/* ---------- CSV import */
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.import-form { max-width: 560px; margin-bottom: 22px; }
.import-rec { border: 1px solid var(--rule); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 18px; }
.import-rec h2 { margin: 0 0 6px; font-size: 16px; }
.import-rec p { margin: 4px 0; }
.import-rec.ok { border-color: var(--pine); }
.import-rec.warn { border-color: var(--neg); }
.rec-ok { color: var(--pine); font-weight: 600; }
.rec-warn { color: var(--neg); }
.import-save .check { display: flex; gap: 8px; align-items: center; margin: 4px 0 14px; }
.table-scroll { overflow-x: auto; }
.import-table td:first-child { max-width: 260px; overflow-wrap: anywhere; }
.import-actions { position: sticky; bottom: 0; padding: 12px 0; background: var(--paper); }

/* ---------- painel "Hoje" (maquete docs/mockups/home.html) */
.hello { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.hello h1 { font-size: 26px; }
.level { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md); padding: 10px 14px; min-width: 230px; }
.level-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.level p { margin-top: 4px; }
.meter { height: 8px; background: var(--sunken); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; border-radius: 99px; background: var(--pine); }

.hero2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 24px; align-items: center; }
.hero2 .hero-a { max-width: 22ch; }
.hero-chart .chart-box { height: 220px; }
.hero-chart .forecast-bar { margin-bottom: 8px; }
.scenarios.card { margin-bottom: 16px; margin-top: 0; padding-top: 18px; border-top: 0; }
.scenarios.card h2 { font-size: 16px; }
@media (max-width: 900px) { .hero2 { grid-template-columns: 1fr; } .hero { padding: 20px; } }

.card h2 { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 16px; }
.card h2 a { font: 500 13px var(--body); color: var(--pine); text-decoration: none; }
.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.dash-grid > .span-5 { grid-column: span 5; } .dash-grid > .span-7 { grid-column: span 7; } .dash-grid > .span-12 { grid-column: span 12; }
@media (max-width: 900px) { .dash-grid > .span-5, .dash-grid > .span-7 { grid-column: span 12; } }
.facts.strip { border-top: 0; padding: 0; }
.facts.strip .fact { background: var(--surface); border: 1px solid var(--rule); flex: 1; min-width: 200px; }

.tag.streak { background: var(--moss); color: var(--pine); font-weight: 600; }
.week { display: flex; gap: 8px; margin: 2px 0 14px; }
.wday { flex: 1; text-align: center; font-size: 12px; color: var(--ink-3); }
.wday i { display: grid; place-items: center; height: 38px; border-radius: 12px; margin-bottom: 4px; background: var(--sunken); font-style: normal; font-size: 16px; }
.wday.done i { background: var(--moss); color: var(--pine); }
.wday.today i { outline: 2px solid var(--pine); background: var(--surface); color: var(--pine); }
.wsteps { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.wsteps li { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: var(--r-sm); border: 1px solid var(--rule); }
.wsteps li > span:nth-child(2) { flex: 1; }
.wsteps .ck { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--rule); display: grid; place-items: center; font-size: 12px; color: #fff; flex: none; }
.wsteps .done .ck { background: var(--pine); border-color: var(--pine); }
.wsteps .done > span:nth-child(2) { color: var(--ink-3); text-decoration: line-through; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

#quickcat .qtx { text-align: center; padding: 6px 0 16px; }
.qname { font-family: var(--display); font-size: 22px; font-weight: 650; overflow-wrap: anywhere; }
.qamt { font-family: var(--display); font-size: 30px; font-weight: 650; margin: 2px 0; }
.qform { display: grid; gap: 12px; justify-items: center; }
.qchips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.qchip { padding: 9px 16px; font-size: 14px; font-weight: 600; background: var(--surface); color: var(--ink); }
.qchip:hover, .qchip:focus-visible { background: var(--moss); border-color: var(--pine); color: var(--pine); }
.qform select { max-width: 260px; }
.qfoot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.qdone { text-align: center; padding: 22px 8px; }

.rings { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px; text-align: center; }
.ring { position: relative; width: 92px; height: 92px; margin: 0 auto 8px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4; }
.ring .trk { stroke: var(--sunken); }
.ring .arc { stroke: var(--pine); stroke-linecap: round; }
.ring.sky .arc { stroke: var(--sky); } .ring.lilac .arc { stroke: var(--lilac); } .ring.sun .arc { stroke: var(--warn); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 17px; }
.goal strong { display: block; font-size: 14px; } .goal > span { font-size: 12.5px; color: var(--ink-2); }
.goal-add { margin-top: 6px; font-size: 13px; }
.goal-add summary { cursor: pointer; color: var(--pine); list-style: none; font-weight: 500; }
.goal-add summary::-webkit-details-marker { display: none; }
.goal-add .inline-form { justify-content: center; margin: 6px 0 4px; }
.goal-add .inline-form input { width: 90px; }

.cats { display: grid; gap: 16px; }
.cat .row { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; margin-bottom: 6px; }
.cat .row span:last-child { font-weight: 500; color: var(--ink-2); }
.track { position: relative; height: 10px; background: var(--sunken); border-radius: 99px; }
.track i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--pine); }
.track.ahead i { background: #c9953a; } .track.over i { background: var(--neg); }
.track u { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink-3); opacity: .6; }
.note { font-size: 12.5px; margin-top: 4px; color: var(--ink-2); }

.badges { display: flex; gap: 12px; flex-wrap: wrap; }
.badge { width: 92px; text-align: center; font-size: 12px; color: var(--ink-2); }
.badge i { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; margin: 0 auto 6px; font-size: 26px; font-style: normal; }
.badge i.green { background: var(--moss); } .badge i.sun { background: var(--warn-soft); }
.badge i.sky { background: var(--sky-soft); } .badge i.lilac { background: var(--lilac-soft); }
.badge.off i { background: var(--sunken); filter: grayscale(1); opacity: .55; }


/* ---------- visual compartilhado por todas as páginas */
h1 { font-size: 26px; }
.summary-strip > * { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md); padding: 12px 16px; }
.summary-strip dt, .facts .fact dt { font-size: 13px; color: var(--ink-2); }
.summary-strip dd, .facts .fact dd { margin: 2px 0 0; font: 650 22px var(--display); letter-spacing: -0.01em; }
.summary-strip dd small, .facts .fact dd small { display: block; font: 400 13px/1.4 var(--body); color: var(--ink-3); letter-spacing: 0; }

.plan-sec, .acc-group, .day { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 18px 20px; margin: 0 0 16px; }
.plan-sec:first-of-type, .acc-group:first-of-type { margin-top: 0; }
.plan-sec h2, .acc-group h2 { font-size: 16px; }
.plan-sec .section-head, .acc-group .section-head { margin-bottom: 10px; }
.plan-sec .empty { padding: 16px; }
.day { padding: 8px 20px 4px; margin-top: 0; }
.day-head { padding: 8px 0 6px; text-transform: capitalize; font-weight: 500; }
.tx:last-child { border-bottom: 0; }
.totals { margin: 0 0 14px; }
.toolbar { margin-bottom: 14px; }

.import-rec { background: var(--surface); }
.login { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 30px 28px; box-shadow: 0 10px 36px rgba(26, 32, 48, .06); }
.login h1 { font-size: 28px; }
.steps li { border-radius: var(--r-lg); }

.dlg-head { padding: 18px 22px 0; }
.dlg-head h2 { font-size: 18px; }
.dlg-body { padding: 14px 22px 22px; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
.btn-primary:active { filter: brightness(.95); }
.list > li { padding: 12px 0; }

.main { min-width: 0; }
.hero-chart, .hero-main { min-width: 0; }
@media (max-width: 900px) {
  .facts { gap: 8px; }
  .fact { flex: 1 1 140px; }
  .hello { align-items: stretch; }
  .level { min-width: 0; width: 100%; }
}

/* ---------- conselheiro */
.advisor { margin-bottom: 16px; }
.adv-sum { font-size: 17px; line-height: 1.5; margin-bottom: 12px; max-width: 70ch; }
.adv-h { margin: 16px 0 8px; font-size: 14px; color: var(--ink-2); font-weight: 600; }
.adv-list, .adv-q { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-width: 78ch; }
.adv-list li { padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--r-md); display: grid; gap: 2px; }
.adv-list strong { font-weight: 650; }
.adv-list span { color: var(--ink-2); }
.adv-list em { font-style: normal; font-size: 13px; color: var(--pine); }
.adv-q li { padding-left: 16px; position: relative; color: var(--ink-2); }
.adv-q li::before { content: "?"; position: absolute; left: 0; color: var(--pine); font-weight: 700; }
.adv-msg { margin: 10px 0; padding: 10px 14px; border-radius: var(--r-md); background: var(--warn-soft); color: var(--warn); }
.adv-wait { margin-left: 8px; }
.tag.sit-tranquila { background: var(--moss); color: var(--pine); }
.tag.sit-atencao { background: var(--warn-soft); color: var(--warn); }
.tag.sit-urgente { background: var(--neg-soft); color: var(--neg); }
.adv-json { margin: 10px 0 0; padding: 14px; background: var(--sunken); border-radius: var(--r-md); overflow: auto; max-height: 420px; font: 12.5px/1.5 ui-monospace, Consolas, monospace; white-space: pre; }
.advisor .btn[disabled] { opacity: .6; }
.adv-foot { margin-top: 14px; }
.advisor > .small { margin-top: 8px; }

.rangelabel strong { font-size: 18px; font-weight: 650; }
.toolbar input[type=date] { width: auto; }
.filter-sum { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: baseline; padding: 12px 16px; margin-bottom: 14px; border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--surface); }
.filter-sum strong { font-size: 18px; font-weight: 650; }

/* ---------- dois caixas (Canadá e Brasil) */
.caixas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
@media (max-width: 900px) { .caixas { grid-template-columns: minmax(0, 1fr); } }
.caixa h2 { margin-bottom: 4px; }
.caixa .big { font: 650 28px var(--display); letter-spacing: -0.02em; margin: 2px 0 12px; }
.caixa dl { margin: 0; display: grid; gap: 8px; }
.caixa dl > div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.caixa dl > div:last-child { border-bottom: 0; padding-bottom: 0; }
.caixa dt { color: var(--ink-2); font-size: 14px; }
.caixa dd { margin: 0; font-weight: 600; text-align: right; }
.caixa .note { margin-top: 12px; padding: 10px 12px; border-radius: var(--r-md); background: var(--sunken); font-size: 13.5px; color: var(--ink-2); }
.caixa .note.warn { background: var(--warn-soft); color: var(--warn); }
.caixa .note.bad { background: var(--neg-soft); color: var(--neg); }

/* ---------- tela inicial: três cartões, dois lados, calendário */
:root { --in: #1f7a4d; --in-soft: #e6f4ec; --out: #b9483a; --out-soft: #fbeceb; }
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.top h1 { font-size: 26px; }
.btn-out { background: var(--out-soft); border-color: transparent; color: var(--out); }
.btn-in { background: var(--in-soft); border-color: transparent; color: var(--in); }
.btn-out:hover, .btn-in:hover { filter: brightness(.97); border-color: transparent; }

.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.tcard { display: flex; flex-direction: column; gap: 12px; padding: 18px 18px 16px; position: relative; overflow: hidden; }
.tcard::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--pine); }
.tcard.bad::before { background: var(--out); } .tcard.good::before { background: var(--in); } .tcard.warn::before { background: #c9953a; }
.thead { display: flex; align-items: center; gap: 10px; }
.ticon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-size: 16px; background: var(--moss); color: var(--pine); flex: none; }
.bad .ticon { background: var(--out-soft); color: var(--out); } .good .ticon { background: var(--in-soft); color: var(--in); } .warn .ticon { background: var(--warn-soft); color: var(--warn); }
.thead h2 { font-size: 13px; font-weight: 700; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; margin: 0; }
.tmain { font-size: 19px; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; }
.tsub { color: var(--ink-2); font-size: 14px; }
.tfoot { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.nx { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nx li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.nx li:last-child { border-bottom: 0; }
.dchip { text-align: center; line-height: 1.1; } .dchip b { display: block; font-size: 16px; } .dchip span { font-size: 11px; color: var(--ink-3); text-transform: uppercase; }
.dchip.late b, .dchip.late span { color: var(--out); }
.nm { min-width: 0; line-height: 1.25; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tagp { font-size: 10.5px; font-weight: 700; color: var(--ink-3); border: 1px solid var(--rule); border-radius: 6px; padding: 0 4px; margin-left: 6px; vertical-align: 1px; }
.vv.in, .sv.in { color: var(--in); font-weight: 650; } .vv.out, .sv.out { color: var(--out); font-weight: 650; }
.endrow { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--r-md); }
.endrow .l { font-size: 13px; color: var(--ink-2); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.endrow .big { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.endrow .s { font-size: 12.5px; color: var(--ink-3); }
.fxline { font-size: 12.5px; color: var(--ink-3); }
@media (max-width: 1100px) { .trio { grid-template-columns: minmax(0, 1fr); } }

.sides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.sides.one { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 900px) { .sides { grid-template-columns: minmax(0, 1fr); } }
.scard h2 { font-size: 15px; margin-bottom: 2px; justify-content: flex-start; gap: 6px; }
.bal { font-size: 32px; font-weight: 700; letter-spacing: -.02em; }
.slow { font-size: 13px; color: var(--ink-2); margin-bottom: 12px; } .slow b { color: var(--ink); } .slow b.neg { color: var(--out); }
.sactions { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.slist { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; border-top: 1px solid var(--rule); }
.slist li { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 2px; border-bottom: 1px solid var(--rule); }
.sd { font-size: 12px; color: var(--ink-3); }
.sn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .sn small { display: block; color: var(--ink-3); font-size: 12px; }
.more { display: block; text-align: center; padding-top: 10px; font-size: 13px; color: var(--pine); text-decoration: none; }

.cal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-head h2 { font-size: 18px; margin: 0; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-btn { border: 1px solid var(--rule); background: var(--surface); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 17px; color: var(--ink); }
.cal-btn:hover { border-color: var(--pine); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cdow { font-size: 12px; color: var(--ink-3); text-align: center; padding: 4px 0; font-weight: 600; }
.cday { min-height: 92px; border: 1px solid var(--rule); border-radius: var(--r-md); padding: 6px 7px; background: var(--surface); text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 3px; font: inherit; color: inherit; }
button.cday:hover { border-color: var(--pine); }
.cday.other { background: var(--sunken); opacity: .5; cursor: default; }
.cday.today { outline: 2px solid var(--pine); }
.cdn { font-size: 12px; color: var(--ink-3); font-weight: 600; } .today .cdn { color: var(--pine); }
.cin, .cout { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; border-radius: 6px; padding: 1px 5px; width: fit-content; max-width: 100%; }
.cin { color: var(--in); background: var(--in-soft); } .cout { color: var(--out); background: var(--out-soft); }
.cplan { background: transparent; border: 1px dashed currentColor; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); margin-top: 12px; }
.legend i { display: inline-block; width: 14px; height: 10px; border-radius: 3px; vertical-align: middle; margin-right: 6px; }
.lg-in { background: var(--in-soft); border: 1px solid var(--in); } .lg-out { background: var(--out-soft); border: 1px solid var(--out); } .lg-plan { border: 1px dashed var(--ink-2); }
.dpanel { margin-top: 14px; border: 1px solid var(--pine); border-radius: var(--r-lg); padding: 16px 18px; }
.dpanel h3 { font-size: 16px; margin-bottom: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ditems { list-style: none; margin: 0 0 12px; padding: 0; display: grid; }
.ditems li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.ditems .dn small { display: block; color: var(--ink-3); font-size: 12px; }
.ditems b.in { color: var(--in); } .ditems b.out { color: var(--out); }
.ditems li.planned { opacity: .9; }
.dhint { margin-bottom: 8px; } .dactions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 900px) {
  .cday { min-height: 66px; padding: 4px; } .cin, .cout { font-size: 10.5px; padding: 0 3px; }
}

.more-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.more-list a { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border: 1px solid var(--rule); border-radius: var(--r-lg); text-decoration: none; }
.more-list svg { width: 22px; height: 22px; color: var(--pine); flex: none; }
.more-list b { display: block; } .more-list small { color: var(--ink-3); }

/* centavos em todos os valores: o calendário precisa de um pouco mais de espaço */
.cin, .cout { letter-spacing: -.01em; white-space: nowrap; }
.as { display: none; }
@media (max-width: 900px) { .cin, .cout { font-size: 10.5px; padding: 0 3px; } .cday { padding: 3px; } }
@media (min-width: 901px) and (max-width: 1250px) { .cin, .cout { font-size: 11.5px; } }

/* saldo real da conta, com cada conta e as faturas à parte */
.slabel { font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }
.accs { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; gap: 2px; font-size: 13.5px; }
.accs li { display: flex; justify-content: space-between; gap: 10px; color: var(--ink-2); }
.accs small { color: var(--ink-3); font-size: 11.5px; }
.accs b { color: var(--ink); font-weight: 600; } .accs b.neg { color: var(--out); }
.scards { font-size: 13px; color: var(--ink-2); margin: 0 0 6px; } .scards b { color: var(--ink); } .scards b.neg { color: var(--out); }

/* celular: ~40 px por dia não comportam centavos. A célula mostra o valor inteiro; o painel do dia, o exato. */
@media (max-width: 600px) {
  #calendario { padding: 14px 8px; }
  .cal-grid { gap: 3px; }
  .cday { min-height: 62px; padding: 3px 2px; border-radius: 10px; }
  .cdn { padding-left: 2px; }
  .af { display: none; } .as { display: inline; }
  .cin, .cout { font-size: 9.5px; padding: 0 2px; letter-spacing: -.03em; border-radius: 5px; }
  .cplan { border-width: 1px; }
  .cal-head h2 { font-size: 16px; }
}

/* conselheiro: pergunta e resposta */
.adv-form { display: grid; gap: 8px; max-width: 78ch; margin-top: 12px; }
.adv-form textarea { min-height: 64px; resize: vertical; font: inherit; line-height: 1.4; }
.adv-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.adv-chips .chip { font-size: 12.5px; padding: 5px 11px; text-align: left; }
.adv-send { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.adv-asked { display: grid; gap: 2px; margin-bottom: 10px; padding: 10px 14px; border-radius: var(--r-md); background: var(--sunken); max-width: 78ch; }
.adv-answer { margin-bottom: 14px; padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--pine); background: var(--moss); max-width: 78ch; }
.adv-answer b { display: block; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--pine); margin-bottom: 4px; }
.adv-answer p { font-size: 16.5px; line-height: 1.5; }

/* conselheiro: memória, registro e zona de perigo */
.mem-form textarea { font: inherit; line-height: 1.45; min-height: 96px; }
.mem-form { max-width: 78ch; }
.adv-sent { margin-top: 12px; max-width: 100%; }
.adv-sent summary { cursor: pointer; color: var(--pine); font-size: 13.5px; }
.danger-zone { border-color: var(--neg-soft); }
.danger-zone .btn { margin-top: 10px; }

/* "Por que isso?": a previsão explica a própria conta */
.why summary { cursor: pointer; color: var(--pine); font-size: 13.5px; font-weight: 500; }
.why[open] summary { margin-bottom: 8px; }
.why-list { margin: 8px 0; display: grid; gap: 4px; font-size: 13.5px; }
.why-list > div { display: flex; justify-content: space-between; gap: 12px; }
.why-list dt { color: var(--ink-2); } .why-list dd { margin: 0; font-weight: 600; white-space: nowrap; }
.why-list dd.neg { color: var(--out); } .why-list dd.pos { color: var(--in); }
.why-total { border-top: 1px solid var(--rule); padding-top: 6px; margin-top: 2px; }
.why-total dt { color: var(--ink); font-weight: 650; }
.tagp { white-space: nowrap; display: inline-block; }


/* ================================================================== UI v3 (maquete docs/mockups/home-v3.html) */
/* fundo levemente cinza com cartões brancos e sombra suave; movimento curto e discreto */
.card, .grid-2 > section, .plan-sec, .acc-group, .day, .forecast, .hero, .filter-sum, .summary-strip > *, .endrow { box-shadow: var(--sh-1); }
.btn { transition: transform .12s var(--ease), box-shadow .15s, background .15s, border-color .15s; }
.btn:hover { box-shadow: var(--sh-1); }
.btn:active { transform: scale(.97); }
.nav a { transition: background .15s var(--ease), color .15s; }
.list > li, .slist li, .nx li, .tx { transition: background .15s, opacity .3s var(--ease), transform .3s var(--ease); }
.slist li:hover, .nx li:hover { background: var(--paper); }
button.cday { transition: background .15s, border-color .15s, transform .12s var(--ease); }
button.cday:hover { background: var(--moss); transform: translateY(-1px); }
.leaving { opacity: 0; transform: translateX(24px); }
.fab { box-shadow: var(--sh-2); }
.tabs { background: rgba(255, 255, 255, .92); backdrop-filter: blur(14px); }
dialog { box-shadow: var(--sh-2); }
dialog[open] { animation: rise .28s var(--ease); }
dialog::backdrop { background: rgba(21, 27, 43, .38); }
@media (max-width: 600px) {
  dialog[open] { animation: sheet-up .32s var(--ease); }
  dialog::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 9px; background: var(--rule); margin: 10px auto 0; }
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
.toast { animation: toast-in .35s var(--ease); box-shadow: var(--sh-2); }
@keyframes toast-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

/* carregando: esqueleto no lugar do "pisca" */
.sk { background: linear-gradient(90deg, var(--sunken) 25%, var(--paper) 50%, var(--sunken) 75%); background-size: 200% 100%; animation: sk 1.2s linear infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }
.htmx-request.card, .htmx-request .cal-grid { opacity: .6; transition: opacity .2s; }

/* barra lateral agrupada */
.nav .grp { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 14px 10px 5px; }
.nav .grp:first-child { padding-top: 0; }
.side-search { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 8px 12px; border: 1px solid var(--rule); background: var(--surface); border-radius: 999px; color: var(--ink-3); font: 400 13.5px var(--body); cursor: pointer; width: 100%; }
.side-search:hover { border-color: var(--ink-3); }
.side-search svg { width: 16px; height: 16px; }
.kbd { margin-left: auto; font: 500 11px var(--body); border: 1px solid var(--rule); border-radius: 6px; padding: 1px 6px; background: var(--paper); }
.side .btn-primary { box-shadow: var(--sh-1); }

/* colchão em barra */
.runway { height: 6px; border-radius: 99px; background: var(--sunken); overflow: hidden; margin: 2px 0 6px; }
.runway i { display: block; height: 100%; border-radius: 99px; background: var(--pine); }
.runway.low i { background: var(--neg); }

@media (prefers-reduced-motion: reduce) { .sk { animation: none; } dialog[open], .toast { animation: none !important; } }

/* formulário de lançamento: valor grande e categorias em chips */
.amount-input { font-size: 40px; font-weight: 750; letter-spacing: -.03em; min-height: 72px; text-align: center; }
.catchips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.catchips .chip { padding: 7px 14px; font-size: 13.5px; }
.catchips .chip[hidden] { display: none; }
.catchips + select { font-size: 13.5px; color: var(--ink-2); }

/* paleta de comandos */
#palette { width: min(520px, calc(100vw - 24px)); margin-top: 14vh; padding: 0; }
#palette::backdrop { background: rgba(21, 27, 43, .38); }
#palette input { border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; min-height: 52px; font-size: 16px; padding: 0 18px; }
#palette input:focus { outline: none; }
.pal-list { list-style: none; margin: 0; padding: 6px; max-height: 340px; overflow-y: auto; }
.pal-list li { padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.pal-list li:hover, .pal-list li[aria-selected="true"] { background: var(--moss); color: var(--pine); }

/* navegação entre páginas com fusão suave (navegadores que suportam) */
@view-transition { navigation: auto; }
.side { view-transition-name: side; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }


/* faturas do cartão */
.fat-top { margin-bottom: 14px; }
.fat-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
@media (max-width: 800px) { .fat-cols { grid-template-columns: minmax(0, 1fr); gap: 16px; } }
.fat-best { padding: 12px 16px; border-radius: var(--r-md); background: var(--moss); }
.fat { margin-bottom: 12px; padding: 0; }
.fat > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; flex-wrap: wrap; }
.fat > summary::-webkit-details-marker { display: none; }
.fat-title { font-weight: 600; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.fat-total { font-size: 18px; font-weight: 700; }
.fat > :not(summary) { margin-left: 18px; margin-right: 18px; }
.fat-sum { margin: 0 18px 10px; display: grid; gap: 4px; font-size: 14px; max-width: 520px; }
.fat-sum > div { display: flex; justify-content: space-between; gap: 12px; }
.fat-sum dt { color: var(--ink-2); } .fat-sum dd { margin: 0; font-weight: 600; text-align: right; }
.fat-lines { list-style: none; padding: 0; margin: 6px 18px 0; border-top: 1px solid var(--rule); }
.fat-lines li { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.fat-lines li.planned { opacity: .7; }
.fat-foot { padding: 12px 0 16px; }
.tag.fat-aberta { background: var(--moss); color: var(--pine); }
.tag.fat-fechada, .tag.fat-parcial { background: var(--warn-soft); color: var(--warn); }
.tag.fat-paga { background: var(--in-soft); color: var(--in); }
.tag.fat-vencida { background: var(--neg-soft); color: var(--neg); }
.fat-parts { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; gap: 2px; font-size: 14px; }
.fat-parts li { display: flex; justify-content: space-between; gap: 12px; color: var(--ink-2); }
.fat-parts b { color: var(--ink); font-weight: 600; } .fat-parts b.neg { color: var(--out); }
