:root {
  --bg: #f4f1ea;
  --surface: #ffffff;
  --surface-2: #f0ece3;
  --ink: #132823;
  --muted: #69736d;
  --line: #e3ddd0;
  --brand: #16302a;
  --brand-2: #23493f;
  --accent: #c9a96e;
  --pos: #2f8f6b;
  --neg: #d0533f;
  --radius: 20px;
  --shadow: 0 1px 2px rgba(22, 48, 42, .06), 0 8px 24px rgba(22, 48, 42, .06);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1513;
    --surface: #171f1c;
    --surface-2: #1f2925;
    --ink: #eef1ee;
    --muted: #9aa59f;
    --line: #2a3531;
    --brand: #0c1a16;
    --brand-2: #1d3a32;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #0f1513;
    --surface: #171f1c;
    --surface-2: #1f2925;
    --ink: #eef1ee;
    --muted: #9aa59f;
    --line: #2a3531;
    --brand: #0c1a16;
    --brand-2: #1d3a32;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(120% 70% at 50% 0%, var(--brand-2), var(--brand) 60%); }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border-radius: 28px; padding: 32px 24px 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.login-card h1 { font-size: 26px; margin: 16px 0 4px; letter-spacing: -.02em; }
.login-card p { margin: 0 0 20px; }
.brand-mark { display: inline-flex; align-items: baseline; gap: 2px; font: 600 30px/1 Georgia, "Times New Roman", serif; color: var(--brand); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand-mark { color: var(--ink); } }
:root[data-theme="dark"] .brand-mark { color: var(--ink); }
.brand-mark i { color: var(--accent); font-style: italic; font-size: 24px; }
form label, .field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 14px; }
form label input, .field input, .field select {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink); font-weight: 500; font-size: 16px; outline: none;
}
form label input:focus, .field input:focus, .field select:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.form-error { color: var(--neg); font-size: 14px; margin: 0 0 12px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 14px; font-weight: 600; }
.btn-primary { background: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { background: var(--accent); color: #1b1408; } }
:root[data-theme="dark"] .btn-primary { background: var(--accent); color: #1b1408; }
.btn-primary:active { transform: scale(.98); }
.btn-primary[disabled] { opacity: .6; }
.btn-ghost { border: 1px solid var(--line); }
.btn-block { width: 100%; }
.link { color: var(--brand-2); font-weight: 600; font-size: 14px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .link { color: var(--accent); } }
:root[data-theme="dark"] .link { color: var(--accent); }

/* ---------- app shell ---------- */
.app { min-height: 100dvh; padding-bottom: calc(96px + var(--safe-b)); }
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 4px;
  padding: calc(10px + var(--safe-t)) 12px 10px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; }
.icon-btn:active { background: var(--surface-2); }
.icon-btn.danger { color: var(--neg); }
.month-label { flex: 1; text-align: center; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.sync-pill { position: absolute; right: 56px; top: calc(16px + var(--safe-t)); display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 999px; background: #fdecc8; color: #7a5410; }
.sync-pill svg { width: 14px; height: 14px; }
.view { padding: 4px 16px 16px; max-width: 640px; margin: 0 auto; }

.hero {
  border-radius: 24px; padding: 20px; color: #fff; margin-bottom: 14px;
  background: linear-gradient(140deg, var(--brand-2), var(--brand) 70%);
  box-shadow: 0 12px 30px rgba(22, 48, 42, .25);
  position: relative; overflow: hidden;
}
.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, rgba(201, 169, 110, .45), transparent 70%); }
.hero-label { margin: 0; opacity: .8; font-size: 14px; }
.hero-value { margin: 2px 0 16px; font-size: 34px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.hero-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hero-stat { display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, .09); border-radius: 16px; padding: 10px; }
.hero-stat small { display: block; opacity: .75; font-size: 12px; }
.hero-stat strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.dot { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; }
.dot svg { width: 18px; height: 18px; }
.dot-in { background: rgba(80, 200, 150, .25); color: #9ff0cc; }
.dot-out { background: rgba(240, 120, 100, .25); color: #ffb4a6; }

.card { background: var(--surface); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.card-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 16px; letter-spacing: -.01em; }
.card-head h2 svg { width: 18px; height: 18px; color: var(--accent); }

.settle-text { margin: 0 0 12px; font-size: 15px; }
.settle-text strong { font-variant-numeric: tabular-nums; }
.settle-bars { display: grid; gap: 8px; }
.settle-row { display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.settle-track { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.settle-fill { height: 100%; border-radius: 99px; }

.donut-wrap { position: relative; width: 190px; margin: 4px auto 14px; }
.donut { width: 190px; height: 190px; display: block; transform: rotate(-90deg); }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-center small { color: var(--muted); font-size: 12px; }
.donut-center strong { font-size: 20px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.legend li { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; font-size: 14px; }
.legend .pct { color: var(--muted); font-size: 12px; margin-left: 6px; }
.legend .val { font-weight: 600; font-variant-numeric: tabular-nums; }
.cat-ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; }
.cat-ico svg { width: 18px; height: 18px; }

.bars { width: 100%; height: auto; display: block; }
.bars .bar { fill: var(--accent); }
.bars .bar.today { fill: var(--brand-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bars .bar.today { fill: #6fd1a8; } }
:root[data-theme="dark"] .bars .bar.today { fill: #6fd1a8; }
.bars .axis { stroke: var(--line); stroke-width: 1; }
.bars text { fill: var(--muted); font-size: 9px; }

.empty { text-align: center; color: var(--muted); padding: 18px 8px; font-size: 14px; }

.tx-list { list-style: none; margin: 0; padding: 0; }
.tx { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.tx:last-child { border-bottom: 0; }
.tx .cat-ico { width: 40px; height: 40px; border-radius: 13px; }
.tx-main { min-width: 0; }
.tx-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-sub { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tx-amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.tx-amt.in { color: var(--pos); }
.badge { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.badge.shared { background: color-mix(in srgb, var(--accent) 22%, transparent); color: #8a6a2c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge.shared { color: var(--accent); } }
:root[data-theme="dark"] .badge.shared { color: var(--accent); }
.badge.pending { background: #fdecc8; color: #7a5410; }
.badge.auto { background: color-mix(in srgb, var(--pos) 18%, transparent); color: var(--pos); }
.receipt-auto-note { margin: 8px 0; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--pos) 14%, transparent); color: var(--pos); font-size: 13px; }
.receipt-read { border-color: var(--accent); color: var(--accent); }
.activity-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 10px; margin-bottom: 14px; }
.activity-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 14px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.activity-row:last-child { border-bottom: 0; }
.onboarding-sheet { max-height: 92dvh; overflow-y: auto; }
.onboarding-options { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 6px; margin: 12px 0; }
.onboarding-options legend { padding: 0 5px; font-size: 13px; font-weight: 700; }
.onboarding-options label { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 14px; }
.onboarding-options input[type=checkbox] { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.onboarding-options .tips-channel { margin-left: 26px; display: flex; justify-content: space-between; }
.person { display: inline-flex; align-items: center; gap: 4px; }
.person i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

.group-title { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--muted); margin: 14px 4px 6px; text-transform: capitalize; }
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 6px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 40px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 600; }
.chip.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip.is-on { background: var(--accent); border-color: var(--accent); color: #1b1408; } }
:root[data-theme="dark"] .chip.is-on { background: var(--accent); border-color: var(--accent); color: #1b1408; }

/* ---------- tabbar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: 1fr 1fr 72px 1fr 1fr; align-items: center;
  padding: 8px 10px calc(8px + var(--safe-b)); background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px); border-top: 1px solid var(--line);
}
.tab { display: grid; justify-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); padding: 6px 0; }
.tab.is-on { color: var(--ink); }
.tab.is-on svg { color: var(--accent); }
.fab { width: 58px; height: 58px; justify-self: center; margin-top: -26px; border-radius: 20px; display: grid; place-items: center; color: #fff; background: linear-gradient(140deg, var(--accent), #b08a48); box-shadow: 0 10px 24px rgba(176, 138, 72, .45); }
.fab svg { width: 28px; height: 28px; stroke-width: 2.2; }
.fab:active { transform: scale(.95); }

/* ---------- sheets ---------- */
dialog.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 94dvh;
  border-radius: 26px 26px 0 0; background: var(--surface); color: var(--ink); box-shadow: 0 -10px 40px rgba(0, 0, 0, .2);
}
dialog.sheet[open] { animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(30px); opacity: .4; } }
dialog.sheet::backdrop { background: rgba(10, 20, 17, .45); }
@media (min-width: 700px) { dialog.sheet { margin: auto; border-radius: 26px; } }
dialog.sheet form { padding: 8px 18px calc(18px + var(--safe-b)); overflow-y: auto; max-height: 94dvh; }
.sheet-head { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; margin-bottom: 8px; position: sticky; top: 0; background: var(--surface); z-index: 1; padding-top: 6px; }
.sheet-head h2 { text-align: center; font-size: 17px; margin: 0; }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 4px; border-radius: 14px; background: var(--surface-2); margin-bottom: 14px; }
.segmented.small { margin-bottom: 10px; }
.seg { min-height: 40px; border-radius: 11px; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg.is-on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }

.amount-field { display: flex; align-items: baseline; justify-content: center; gap: 6px; margin: 4px 0 16px; color: var(--ink); }
.amount-field .currency { font-size: 22px; font-weight: 600; color: var(--muted); }
.amount-field input {
  width: auto; max-width: 260px; border: 0; background: none; text-align: center; font-size: 44px; font-weight: 700;
  letter-spacing: -.03em; min-height: 0; padding: 0; color: var(--ink); font-variant-numeric: tabular-nums; outline: none;
}
.amount-field.is-expense input { color: var(--ink); }
.amount-field.is-income input { color: var(--pos); }

.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cat-opt { display: grid; justify-items: center; gap: 4px; padding: 8px 2px; border-radius: 14px; border: 1.5px solid transparent; font-size: 11.5px; font-weight: 600; color: var(--ink); text-align: center; line-height: 1.15; }
.cat-opt .cat-ico { width: 40px; height: 40px; border-radius: 13px; }
.cat-opt.is-on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* data em cima, quem lançou embaixo: no iPhone o campo de data não cabe em meia largura */
#tx-form .row-2 { grid-template-columns: 1fr; }
.row-2 > * { min-width: 0; }
input[type="date"] { width: 100%; min-width: 0; max-width: 100%; display: block; -webkit-appearance: none; appearance: none; }
.who { display: grid; grid-auto-flow: column; gap: 6px; }
.who-opt { min-height: 48px; border-radius: 14px; border: 1.5px solid var(--line); font-weight: 600; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--ink); }
.who-opt i { width: 10px; height: 10px; border-radius: 50%; }
.who-opt.is-on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.split-detail { display: grid; gap: 10px; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; }
.presets .chip { min-height: 40px; font-size: 13px; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.split-explain { margin: 0; font-size: 14px; font-weight: 500; color: var(--ink); }

.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 8px 0; width: 100%; text-align: left; border-bottom: 1px solid var(--line); }
.cat-row:last-child { border-bottom: 0; }
.cat-row.archived { opacity: .5; }
.cat-row small { color: var(--muted); }
.icon-pick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.icon-pick button { height: 44px; border-radius: 12px; display: grid; place-items: center; border: 1.5px solid var(--line); color: var(--ink); }
.icon-pick button.is-on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.color-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.color-pick button { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1.5px var(--line); }
.color-pick button.is-on { box-shadow: 0 0 0 2.5px var(--ink); }
.check { display: flex !important; align-items: center; gap: 10px; color: var(--ink) !important; font-weight: 500 !important; }
.check input { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); }

.toast { position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translateX(-50%); z-index: 20; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 14px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow); max-width: calc(100% - 32px); }

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

/* ---------- viagens ---------- */
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 6px 0 12px; }
.section-head h1 { font-size: 22px; margin: 0; letter-spacing: -.02em; }
.section-head p { margin: 2px 0 0; }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn-sm svg { width: 18px; height: 18px; }
.trip-card { display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center; width: 100%; text-align: left; background: var(--surface); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow); color: var(--ink); }
.trip-card.archived { opacity: .6; }
.trip-card .cat-ico { width: 48px; height: 48px; border-radius: 15px; }
.trip-card .cat-ico svg { width: 24px; height: 24px; }
.trip-card h3 { margin: 0; font-size: 16px; }
.trip-card .meta { font-size: 13px; color: var(--muted); }
.trip-card .amt { font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 4px; }
.trip-card .budget-track { margin-top: 8px; }
.trip-top { display: flex; justify-content: space-between; align-items: center; margin: 0 -6px 4px; }
.trip-hero { padding-top: 16px; }
.trip-name { margin: 2px 0 6px; font-size: 24px; letter-spacing: -.02em; }
.trip-hero .hero-value { margin-bottom: 6px; }
.budget { margin-top: 8px; }
.budget-track { height: 8px; border-radius: 99px; background: rgba(127, 127, 127, .2); overflow: hidden; }
.budget-fill { height: 100%; border-radius: 99px; background: var(--accent); }
.budget-fill.over { background: #ff8a73; }
.budget-text { margin: 6px 0 0; font-size: 13px; opacity: .85; }
.add-in-trip { margin-bottom: 14px; }
.trip-pick { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.trip-pick::-webkit-scrollbar { display: none; }
.trip-pick .chip { display: inline-flex; align-items: center; gap: 6px; }
.trip-pick .chip svg { width: 16px; height: 16px; }
.trip-pick .chip.is-on svg { color: inherit; }
.badge.trip { background: color-mix(in srgb, #4a7bd0 16%, transparent); color: #3a64ad; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge.trip { color: #9dbbf0; } }
:root[data-theme="dark"] .badge.trip { color: #9dbbf0; }
.tab span { font-size: 10.5px; }
.topbar.no-month #prev-month, .topbar.no-month #next-month, .topbar.no-month #month-label { visibility: hidden; }
.auth-switch { display: block; margin: 14px auto 0; }
.form-ok { color: var(--pos); font-size: 14px; margin: 0 0 12px; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
#login form p.muted { margin: 0 0 14px; }

/* ---------- contas a pagar ---------- */
.bill-list { list-style: none; margin: 0; padding: 0; }
.bill { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.bill:last-child { border-bottom: 0; }
.bill-date { width: 44px; height: 48px; border-radius: 12px; background: var(--surface-2); display: grid; place-content: center; text-align: center; line-height: 1; }
.bill-date b { font-size: 18px; font-variant-numeric: tabular-nums; }
.bill-date small { font-size: 10px; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-top: 2px; }
.bill-main { min-width: 0; text-align: left; }
.bill-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.bill-sub { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.bill-pay { min-height: 36px; padding: 0 14px; border-radius: 11px; background: var(--brand); color: #fff; font-weight: 700; font-size: 13px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bill-pay { background: var(--accent); color: #1b1408; } }
:root[data-theme="dark"] .bill-pay { background: var(--accent); color: #1b1408; }
.bill.paid .bill-name { text-decoration: line-through; text-decoration-color: var(--muted); }
.badge.late { background: #fde0da; color: #a5321f; }
.badge.today { background: #fdecc8; color: #7a5410; }
.badge.ok { background: color-mix(in srgb, var(--pos) 16%, transparent); color: var(--pos); }
.badge.cal { background: var(--surface-2); color: var(--muted); }
a.btn { text-decoration: none; }

.theme-btn { font-size: 18px; line-height: 1; }
[hidden] { display: none !important; }

.hero-top { display: flex; align-items: center; justify-content: space-between; }
.eye-btn { background: rgba(255,255,255,.14); border: 0; border-radius: 999px; width: 38px; height: 38px; font-size: 18px; cursor: pointer; color: inherit; }
.savings-value { margin: 4px 0 2px; font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hide-values .hero-value, .hide-values .hero-stat strong, .hide-values .savings-value { filter: blur(9px); user-select: none; }
.hide-values .sav-val, .hide-values #savings-month, .hide-values #savings-list, .hide-values #events-home .sav-val { filter: blur(9px); user-select: none; }
.sav-val { margin-left: auto; padding: 0 8px; }
.bill-list .bill-row { display: flex; align-items: center; gap: 6px; padding: 8px 0; border-top: 1px solid rgba(128,128,128,.18); font-size: 14px; list-style: none; }

.field select { width: 100%; }
.goal-card { margin-bottom: 12px; }
.goal-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.goal-head h3 { margin: 0; font-size: 16px; }
.goal-items { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.goal-item { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 6px 0; border-top: 1px solid rgba(128,128,128,.15); }
.goal-item.done { opacity: .6; text-decoration: line-through; }
.goal-item .sav-val { margin-left: auto; }
.mini-btn { border: 1px solid var(--line); background: transparent; color: inherit; border-radius: 99px; padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.mini-btn.on { background: var(--accent); color: #1c1507; border-color: transparent; }
.hide-values .goal-head strong, .hide-values .goal-item .sav-val, .hide-values .pu-sub { filter: blur(9px); user-select: none; }
.pu-sub { display: block; font-size: 13px; opacity: .75; }

/* barra de baixo deslizável + botão + flutuante */
.tabbar { display: flex; grid-template-columns: none; gap: 2px; overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-right: 84px; }
.tabbar::-webkit-scrollbar { display: none; }
.tab { flex: 1 0 74px; scroll-snap-align: start; }
.fab { position: fixed; z-index: 7; right: 16px; bottom: calc(14px + var(--safe-b)); margin: 0; width: 56px; height: 56px; }
/* desktop: usa a largura da tela */
@media (min-width: 900px) {
  .view { max-width: min(1280px, 94vw); }
  #view-home { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; align-items: start; }
  #view-home > .hero { grid-column: 1 / -1; }
  #view-home > .card, #home-cards > .card { margin: 0; } #view-home > .home-tools { grid-column: 1 / -1; margin: 0; }
  .tabbar { justify-content: center; padding-right: 100px; }
  .tab { flex: 0 0 110px; }
  .topbar { padding-left: max(12px, calc((100vw - min(1280px, 94vw)) / 2)); padding-right: max(12px, calc((100vw - min(1280px, 94vw)) / 2)); }
}

.go-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr 24px; gap: 6px; align-items: center; margin-bottom: 8px; }
.go-row input, .go-row select { width: 100%; min-width: 0; padding: 10px 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-size: 15px; }

/* ícone do olho */
.eye-btn { display: grid; place-items: center; }
.eye-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
/* + flutuante na lateral direita, como o botão Câmera do site */
.fab { position: fixed; right: 0; left: auto; top: 58%; bottom: auto; width: auto; height: auto; margin: 0; padding: 12px 12px 10px 14px; border-radius: 18px 0 0 18px; display: grid; justify-items: center; gap: 2px; z-index: 8; background: var(--brand, #16302a); color: #f3e6c8; box-shadow: -4px 6px 18px rgba(0,0,0,.28); border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); border-right: 0; touch-action: none; }
.fab svg { width: 24px; height: 24px; color: var(--accent); }
.fab span { font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.tabbar { padding-right: 10px; }
/* aba ativa acesa */
.tab { border-radius: 16px; margin: 0 2px; transition: background .2s, color .2s; }
.tab.is-on { background: color-mix(in srgb, var(--accent) 30%, var(--surface)); color: var(--ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent); }
.tab.is-on svg { color: #a07a2e; }
/* menu três pontinhos */
.menu-scrim { position: fixed; inset: 0; background: rgba(10,20,17,.4); z-index: 30; }
.menu-panel { position: fixed; top: calc(8px + var(--safe-t)); right: 8px; z-index: 31; width: min(300px, calc(100vw - 16px)); max-height: calc(100dvh - 24px); overflow-y: auto; background: var(--surface); border-radius: 20px; box-shadow: 0 20px 50px rgba(0,0,0,.3); padding: 8px; }
.menu-title { font-weight: 700; padding: 8px 12px 6px; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border-radius: 14px; font-size: 15px; font-weight: 600; text-align: left; color: var(--ink); }
.menu-item svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; color: #a07a2e; flex: 0 0 22px; }
.menu-item:hover, .menu-item:active { background: var(--surface-2); }
.menu-item.is-on { background: color-mix(in srgb, var(--accent) 30%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent); }
.menu-panel hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }

/* anexos */
.att-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.att-btn { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 8px; border-radius: 14px; border: 1px dashed color-mix(in srgb, var(--accent) 70%, transparent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); font-weight: 600; font-size: 14px; cursor: pointer; text-align: center; }
.att-btn svg { width: 20px; height: 20px; color: #a07a2e; }
.att-list, .att-all { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.att-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.att-item a { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.att-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-item img, .att-row img { width: 44px; height: 44px; object-fit: cover; border-radius: 10px; flex: none; }
.att-item.pending { opacity: .75; }
.att-pdf { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: #f3d9d4; color: #9b2c1c; font-size: 10px; font-weight: 700; flex: none; }
.att-pdf svg { width: 18px; height: 18px; }
.att-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.att-row:first-child { border-top: 0; }
.att-row-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.att-row-link span { display: grid; min-width: 0; }
.att-row-link b, .att-row-link small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* tarefas */
.task-scopes { margin-bottom: 10px; }
.task-list-filter { display: flex; align-items: end; gap: 8px; margin-bottom: 12px; }
.task-list-filter .field { flex: 1; margin-bottom: 0; }
.task-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.task-item { display: grid; grid-template-columns: 44px minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.task-item.is-done { opacity: .65; }
.task-item.is-done .task-title { text-decoration: line-through; }
.task-check { width: 40px; height: 40px; border: 1.5px solid var(--line); border-radius: 13px; display: grid; place-items: center; color: var(--pos); }
.task-check svg { width: 20px; height: 20px; }
.task-main { min-width: 0; }
.task-title { display: block; text-align: left; font-weight: 650; overflow-wrap: anywhere; }
.task-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; color: var(--muted); font-size: 12px; margin-top: 3px; }
.task-acts { display: flex; gap: 2px; }
.task-action { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); }
.task-action.is-important { color: #b07d21; }
.task-children { grid-column: 1 / -1; list-style: none; padding: 6px 0 0 26px; display: grid; gap: 6px; }
.task-child { box-shadow: none; border: 1px solid var(--line); }
.task-list-empty { padding: 26px 12px; text-align: center; color: var(--muted); }
.task-history-date { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.task-sheet-note { font-size: 12px; margin: 0 0 10px; }
.voice-btn { margin: 0 0 10px; }
.voice-icon { font-size: 21px; }
.voice-summary { padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 13%, transparent); margin: 0 0 12px; }
.voice-summary[hidden] { display: none; }
.voice-summary.is-listening { color: var(--brand-2); font-weight: 650; }

/* ===== v17: barra flutuante de vidro + gráficos de toque ===== */
.view { padding-bottom: calc(110px + var(--safe-b)); }
.tabbar {
  left: 12px; right: 12px; bottom: calc(10px + var(--safe-b)); padding: 6px; gap: 2px;
  border-radius: 26px; border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  backdrop-filter: saturate(1.6) blur(22px); -webkit-backdrop-filter: saturate(1.6) blur(22px);
  box-shadow: 0 14px 40px rgba(22, 48, 42, .22), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.tab { padding: 7px 0 6px; border-radius: 20px; }
.tab svg { transition: transform .2s; }
.tab.is-on svg { transform: translateY(-1px) scale(1.08); }
@media (min-width: 900px) { .tabbar { left: 50%; right: auto; transform: translateX(-50%); width: auto; justify-content: center; padding-right: 6px; } .tab { flex: 0 0 104px; } }

.hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 80% at 0% 100%, rgba(201, 169, 110, .18), transparent 60%); pointer-events: none; }
.hero-value { font-size: clamp(34px, 9vw, 44px); }

.chart-box { position: relative; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.chart-hint { margin: 6px 0 0; font-size: 12px; color: var(--muted); text-align: center; }
.chart-tip { position: absolute; z-index: 3; pointer-events: none; display: grid; gap: 2px; padding: 8px 12px; border-radius: 14px; background: var(--brand); color: #f6eedd; font-size: 13px; white-space: nowrap; box-shadow: 0 10px 24px rgba(0, 0, 0, .25); transition: left .08s linear, top .08s linear; }
.chart-tip b { font-size: 15px; font-variant-numeric: tabular-nums; }
.chart-tip small { opacity: .75; font-size: 11.5px; }
.chart-tip .t-g b { color: var(--accent); } .chart-tip .t-s b { color: #8fd3b4; }
.chart-tip span { display: flex; justify-content: space-between; gap: 12px; }
.bars, .trend { cursor: crosshair; }
.bars rect { transition: x .12s ease-out, width .12s ease-out, y .12s ease-out, height .12s ease-out; }
.bars .bar.zero { fill: var(--line); }
.bars .bar.hot { fill: var(--brand-2); filter: drop-shadow(0 3px 4px rgba(22, 48, 42, .35)); }
.bars .guide, .trend .guide { stroke: var(--accent); stroke-width: 1; stroke-dasharray: 3 3; transition: opacity .15s; }
.trend { width: 100%; height: auto; display: block; overflow: visible; }
.trend .line { fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.trend .line.gasto { stroke: var(--accent); } .trend .line.guard { stroke: var(--pos); }
.trend .dot { stroke: var(--surface); stroke-width: 2; transition: r .15s ease-out; }
.trend .dot.gasto { fill: var(--accent); } .trend .dot.guard { fill: var(--pos); }
.trend text { fill: var(--muted); font-size: 10px; } .trend text.cur { fill: var(--ink); font-weight: 700; }
.trend-key { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.trend-key i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 4px; }
.trend-key .k-gasto { background: var(--accent); } .trend-key .k-guard { background: var(--pos); }
.donut { touch-action: none; cursor: pointer; overflow: visible; }
.donut .arc { transition: stroke-width .18s ease-out, opacity .18s; }
.donut .arc.on { stroke-width: 22; }
.donut .arc.dim { opacity: .28; }
.donut-center { pointer-events: none; transition: transform .18s; }
.donut-center.picked { transform: scale(1.06); }
.donut-center small { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend li { cursor: pointer; border-radius: 12px; padding: 4px; margin: -4px; transition: background .15s; }
.legend li.on { background: color-mix(in srgb, var(--accent) 22%, transparent); }
@media (prefers-reduced-motion: reduce) { .bars rect, .donut .arc, .trend .dot, .chart-tip { transition: none; } }
@media (min-width: 900px) { #home-cards > .trend-card { grid-column: span 2; } }
.bars rect, .bars text, .trend text, .trend .area { stroke: none; }
.legend li.empty { display: block; cursor: default; padding: 8px 0; margin: 0; color: var(--muted); text-align: center; }
.donut .arc { stroke-linecap: butt; }

/* v18: o brilho dourado do hero cobria o botão do olho e engolia o toque */
.hero::after { pointer-events: none; }
.hero-top { position: relative; z-index: 2; }
.eye-btn { position: relative; z-index: 3; touch-action: manipulation; }
/* ocultar valores: cobre também gráficos, listas e totais */
.hide-values .trend-wrap, .hide-values #trend-card svg, .hide-values .donut-center, .hide-values .legend strong, .hide-values .bill-row strong, .hide-values .tx-amount, .hide-values .amount, .hide-values .chart-tip, .hide-values [id^="sum-"], .hide-values .bar-total { filter: blur(9px); user-select: none; }

/* v19: bolinha flutuante redonda */
.fab { position: fixed; right: 14px; left: auto; top: auto; bottom: calc(96px + var(--safe-b)); width: 64px; height: 64px; padding: 0; margin: 0; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--accent) 70%, transparent); display: grid; place-content: center; justify-items: center; gap: 0; z-index: 9; background: radial-gradient(circle at 30% 25%, #1f4a3f, var(--brand, #16302a)); color: #f3e6c8; box-shadow: 0 10px 26px rgba(0,0,0,.35), 0 0 0 5px rgba(201,169,110,.18); touch-action: none; cursor: grab; transition: transform .15s, box-shadow .15s; }
.fab svg { width: 24px; height: 24px; color: var(--accent); }
.fab span { font-size: 11px; font-weight: 700; line-height: 1; margin-top: 1px; }
.fab.drag { transform: scale(1.12); box-shadow: 0 16px 34px rgba(0,0,0,.45), 0 0 0 8px rgba(201,169,110,.28); cursor: grabbing; }
@media (min-width: 900px) { .fab { bottom: 32px; } }

/* v20: metas editáveis + histórico */
textarea { width: 100%; font: inherit; color: var(--text, inherit); background: var(--card, #fff); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; resize: vertical; }
.goal-item { cursor: pointer; flex-wrap: wrap; row-gap: 2px; }
.goal-item.done { text-decoration: none; opacity: .75; }
.goal-item .gi-main { display: grid; gap: 2px; min-width: 0; flex: 1; }
.goal-item .gi-who { font-weight: 600; color: var(--text, inherit); }
.goal-item .gi-dates { font-size: 12px; color: var(--muted); }
.goal-item .gi-dates .late { color: #c0612b; font-weight: 600; }
.goal-item .gi-dates .ok { color: #2f8f5b; font-weight: 600; }
.goal-item .gi-note { font-size: 12px; color: var(--muted); font-style: italic; flex-basis: 100%; }
.goal-item .gi-seqn { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 22%, transparent); font-size: 12px; font-weight: 700; }
.goal-item.done .gi-seqn { background: var(--accent); color: #1c1507; }
.goal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.goal-note { white-space: pre-wrap; font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.small-h { font-size: 14px; margin: 20px 0 8px; }
.log-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.log-list li { font-size: 13px; padding: 8px 10px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 8%, transparent); line-height: 1.35; }
.log-list li small { display: block; color: var(--muted); font-size: 11px; margin-bottom: 2px; }
.danger-txt { color: #c0392b !important; margin-top: 8px; }
.hide-values .log-list, .hide-values #gi-amt { filter: blur(6px); }
.trip-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0 0; padding: 10px 14px; border-radius: 16px; background: color-mix(in srgb, var(--accent) 16%, transparent); font-size: 14px; }
#trip-auto-hint { margin: 6px 2px 0; }

/* v21: início personalizável */
.home-tools { display: flex; justify-content: flex-end; gap: 8px; margin: 12px 2px 4px; }
.home-tools .mini-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; }
.home-tools svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
#home-cards { display: contents; }
.u-hide { display: none !important; }
.card-fold { margin-left: 6px; width: 34px; height: 34px; border: 0; border-radius: 99px; background: transparent; color: var(--muted); display: inline-grid; place-items: center; cursor: pointer; flex: none; }
.card-fold svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .2s; }
.is-collapsed .card-fold svg { transform: rotate(-90deg); }
.is-pinned .card-fold { opacity: .35; }
.is-collapsed > :not(.card-head) { display: none !important; }
.is-collapsed .card-head { margin-bottom: 0; }
#home-cards .card-head { cursor: pointer; }
button.hero-stat { border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%; transition: transform .15s, background .15s; }
button.hero-stat:active { transform: scale(.97); background: rgba(255,255,255,.16); }
.dot-net { background: rgba(201,169,110,.35); }
.hc-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.hc-row { display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 10px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 10%, transparent); touch-action: pan-y; }
.hc-row.off .hc-name { opacity: .45; text-decoration: line-through; }
.hc-row.drag { box-shadow: 0 10px 24px rgba(0,0,0,.25); background: var(--card, #fff); transform: scale(1.02); }
.hc-grip { cursor: grab; font-size: 20px; padding: 6px; color: var(--muted); touch-action: none; user-select: none; }
.hc-name { flex: 1; font-size: 14px; font-weight: 600; }
.hc-ic { width: 38px; height: 38px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.hc-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; }
.hc-ic.on { color: var(--brand-2, #16302a); background: color-mix(in srgb, var(--accent) 28%, transparent); }
.hc-ic.down svg { transform: rotate(180deg); }
.hc-ic:disabled { opacity: .25; }
.hero-stat strong { white-space: nowrap; font-size: clamp(13px, 3.9vw, 15px); }

/* v22: período do gráfico + detalhe do lançamento */
.seg-mini { display: inline-flex; gap: 4px; padding: 3px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 14%, transparent); margin-left: auto; }
.seg-mini button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 99px; cursor: pointer; min-height: 40px; }
.seg-mini button.is-on { background: var(--brand, #16302a); color: #f3e6c8; }
[data-card=daily] .card-head h2, #bars-title { flex: 0 1 auto; }
.txd { padding: 8px 18px calc(18px + var(--safe-b)); overflow-y: auto; max-height: 94dvh; }
.txd-hero { display: flex; align-items: center; gap: 14px; margin: 6px 0 14px; }
.txd-hero .cat-ico { width: 52px; height: 52px; flex: none; }
.txd-desc { font-size: 15px; color: var(--muted); font-weight: 600; }
.txd-amt { font-size: 30px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.txd-amt.in { color: #2f8f5b; }
.txd-list { margin: 0 0 14px; display: grid; gap: 0; border-radius: 16px; overflow: hidden; background: color-mix(in srgb, var(--accent) 8%, transparent); }
.txd-row { display: grid; grid-template-columns: 120px 1fr; gap: 10px; padding: 11px 14px; border-top: 1px solid rgba(128,128,128,.14); font-size: 14px; }
.txd-row:first-child { border-top: 0; }
.txd-row dt { color: var(--muted); font-weight: 600; } .txd-row dd { margin: 0; word-break: break-word; }
.txd-edit { color: var(--brand-2, inherit); }
#txd-edit2 svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; margin-right: 8px; vertical-align: -3px; }
.att-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; } .att-list a { color: var(--brand-2, inherit); font-weight: 600; }
.hide-values .txd-amt, .hide-values .txd-row dd { filter: blur(7px); }
.badge.pm { background: color-mix(in srgb, var(--accent) 24%, transparent); color: inherit; }
#tx-pm, #tx-pm-cards { flex-wrap: wrap; } #tx-pm-cards { margin-top: 8px; }

/* v24: forma de pagamento */
#tx-pm { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; overflow: visible; }
.pm-tile { display: grid; justify-items: center; gap: 6px; padding: 10px 4px 8px; border: 1px solid var(--line); border-radius: 16px; background: transparent; color: inherit; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; min-height: 70px; transition: transform .12s, background .15s, border-color .15s; }
.pm-tile:active { transform: scale(.95); }
.pm-tile.is-on { border-color: var(--pm); background: color-mix(in srgb, var(--pm) 14%, transparent); box-shadow: 0 0 0 1px var(--pm) inset; }
.pm-ico { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: color-mix(in srgb, var(--pm) 18%, transparent); color: var(--pm); flex: none; }
.pm-ico svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.badge.pm { display: inline-flex; align-items: center; gap: 5px; padding-left: 3px; }
.badge.pm .pm-ico { width: 18px; height: 18px; border-radius: 6px; }
.badge.pm .pm-ico svg { width: 12px; height: 12px; }
#tx-pm-cards { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.card-pick { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: 1px solid var(--line); border-radius: 14px; background: transparent; color: inherit; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; min-height: 44px; }
.card-pick.is-on { border-color: var(--brand-2, #16302a); background: color-mix(in srgb, var(--accent) 22%, transparent); box-shadow: 0 0 0 1px var(--brand-2, #16302a) inset; }
.card-badge { position: relative; display: inline-grid; place-items: center; width: 40px; height: 28px; border-radius: 7px; color: #fff; font-size: 13px; overflow: hidden; box-shadow: 0 2px 6px rgba(0,0,0,.25); flex: none; }
.card-badge .cb-chip { position: absolute; left: 5px; top: 5px; width: 8px; height: 6px; border-radius: 2px; background: rgba(255,255,255,.75); }
.card-badge b { transform: translate(5px, 3px); }
.card-badge.plus { background: transparent; color: var(--muted); box-shadow: none; border: 1px dashed var(--line); } .card-badge.plus svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }

/* v25: quadros fechados viram ícones, botão Lançar com tamanho, barra de baixo oculta */
.home-dock { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 12px; }
.home-dock[hidden] { display: none; }
#view-home > .home-dock { grid-column: 1 / -1; margin: 0; }
.home-dock > .card { margin: 0; width: 84px; padding: 10px 6px 8px; border-radius: 20px; cursor: pointer; display: grid; place-items: center; text-align: center; transition: transform .12s; }
.home-dock > .card:active { transform: scale(.94); }
.home-dock .card-head { margin: 0; display: block; }
.home-dock .card-head > :not(h2) { display: none !important; }
.home-dock .card-head h2 { display: grid; justify-items: center; gap: 5px; font-size: 11px; line-height: 1.15; font-weight: 650; margin: 0; max-width: 72px; }
.home-dock .card-head h2 svg { width: 26px; height: 26px; padding: 5px; box-sizing: content-box; border-radius: 14px; background: color-mix(in srgb, var(--accent) 22%, transparent); stroke: var(--accent); }
.is-collapsed .card-fold { display: none; }
.fab.fab-sm { width: 48px; height: 48px; } .fab.fab-sm span { display: none; } .fab.fab-sm svg { width: 22px; height: 22px; }
.fab.fab-md { width: 64px; height: 64px; }
.fab.fab-lg { width: 84px; height: 84px; } .fab.fab-lg svg { width: 32px; height: 32px; } .fab.fab-lg span { font-size: 13px; }
.no-tabbar .tabbar { display: none !important; }
.no-tabbar .app { padding-bottom: calc(24px + var(--safe-b)); } .no-tabbar .view { padding-bottom: calc(40px + var(--safe-b)); }
.no-tabbar .fab { bottom: calc(24px + var(--safe-b)); }
#menu-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* v45: layout de celular sem largura excedente nem sobra no fim da página */
html, body { width: 100%; max-width: 100%; overflow-x: clip; }
.app { width: 100%; min-width: 0; padding-bottom: 0; }
.view { width: 100%; min-width: 0; padding: 4px 12px calc(88px + var(--safe-b)); }
.no-tabbar .app { padding-bottom: 0; }
.card, .hero { width: 100%; min-width: 0; }
.card-head, .card-head h2 { min-width: 0; }
.card-head h2 { overflow-wrap: anywhere; }
.legend li { grid-template-columns: 34px minmax(0, 1fr) auto; min-width: 0; gap: 8px; }
.legend li > :nth-child(2) { min-width: 0; overflow-wrap: anywhere; }
.legend .val { white-space: nowrap; font-size: clamp(12px, 3.5vw, 14px); }
.tx { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 8px; min-width: 0; }
.tx-main { min-width: 0; overflow: hidden; }
.tx-title { overflow-wrap: anywhere; }
.tx-amt { white-space: nowrap; font-size: clamp(12px, 3.5vw, 15px); }
.fab { right: max(12px, env(safe-area-inset-right, 0px)); touch-action: manipulation; cursor: pointer; }
.fab.drag { transform: none; }
@media (max-width: 899px) {
  .tabbar { left: 12px; right: 104px; max-width: none; }
  .fab { right: 14px; bottom: calc(10px + var(--safe-b)); }
  .fab.fab-lg { width: 64px; height: 64px; }
}
@media (max-width: 360px) {
  .view { padding-left: 8px; padding-right: 8px; }
  .card { padding: 12px; }
  .tx { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 6px; }
  .tx .cat-ico { width: 34px; height: 34px; }
  .tx-amt { font-size: 12px; }
  .legend li { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 6px; }
  .legend .cat-ico { width: 30px; height: 30px; }
}

/* v28: hero só com os 3 quadros + filtro de período */
.hero { padding: 14px 14px 16px; }
.hero-top { margin-bottom: 8px; }
.hero-label { font-size: 13px; margin: 4px 2px 10px; }
.hero-3 { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hero-3 .hero-stat { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 8px; min-width: 0; }
.hero-3 .hero-stat strong { font-size: clamp(13px, 3.9vw, 16px); }
.hero-range { background: rgba(255,255,255,.14); }
.hero-range button { color: rgba(255,255,255,.8); }
.hero-range button.is-on { background: #f3e6c8; color: #16302a; }
.hero-dates { display: flex; align-items: center; gap: 8px; margin: 2px 0 6px; position: relative; z-index: 2; font-size: 13px; }
.hero-dates input { flex: 1; min-width: 0; background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 12px; padding: 8px 10px; font: inherit; color-scheme: dark; }
.hero-dates[hidden], .hero-dates input[hidden], .hero-dates span[hidden] { display: none; }
.hide-values .hero-stat strong { filter: blur(9px); }

/* v29: formas de pagamento */
.kind-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; }
.kind-grid button { border: 1px solid var(--line); background: transparent; color: inherit; font: inherit; font-size: 13px; font-weight: 600; padding: 9px 8px; border-radius: 12px; cursor: pointer; }
.kind-grid button.is-on { background: var(--brand, #16302a); color: #f3e6c8; border-color: transparent; }
#tx-pm { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; overflow: visible; }
#tx-pm .pm-tile span:last-child { font-size: 11px; text-align: center; line-height: 1.15; }
.pm-extra { display: grid; gap: 8px; margin-top: 10px; }
.pm-extra[hidden], .pm-n[hidden], .pm-modes[hidden] { display: none; }
.pm-modes { margin-left: 0; justify-self: start; }
.pm-n { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.pm-n input, #pm-ref { flex: 1; border: 1px solid var(--line); background: var(--card, transparent); color: inherit; border-radius: 12px; padding: 10px 12px; font: inherit; }

/* v29b: hero 2 quadros, dock em grade, nota comprida */
.hero-3 { grid-template-columns: 1fr 1fr; gap: 10px; }
.hero-3 .hero-stat { flex-direction: row; align-items: center; gap: 10px; padding: 12px; }
.hero-3 .hero-stat strong { font-size: clamp(15px, 4.4vw, 19px); }
.home-dock { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.home-dock > .card { width: auto; min-width: 0; aspect-ratio: 1 / 1; padding: 8px 4px; }
.home-dock .card-head h2 { max-width: 100%; font-size: 11px; }
.att-btns .att-long { grid-column: 1 / -1; font: inherit; color: inherit; cursor: pointer; }
.att-long svg { color: #a07a2e; }
.stitch-list { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 8px; }
.stitch-item { display: grid; grid-template-columns: 56px 1fr 40px 40px; align-items: center; gap: 8px; font-size: 14px; }
.stitch-item img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; }
.stitch-item .icon-btn[disabled] { opacity: .3; }
.home-dock { grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 6px; }
.home-dock > .card { aspect-ratio: auto; min-height: 92px; padding: 10px 3px 8px; }
.home-dock .card-head h2 { font-size: 10.5px; }

/* v32: assinatura RC Finanças */
.lic-banner { display: flex; align-items: center; gap: 8px; margin: 0 16px 8px; padding: 10px 12px; border-radius: 14px; font-size: 13px; font-weight: 600; background: #fdecc8; color: #7a5410; max-width: 608px; }
@media (min-width: 672px) { .lic-banner { margin: 0 auto 8px; } }
.lic-banner[hidden] { display: none; }
.lic-banner svg { width: 18px; height: 18px; flex: none; }
.lic-banner span { flex: 1; }
.lic-banner .link { color: inherit; text-decoration: underline; font-weight: 700; white-space: nowrap; }
.lic-banner.lic-readonly, .lic-banner.lic-blocked, .lic-banner.lic-suspended { background: #f8d7d3; color: #8a2216; }
.lic-block { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; background: color-mix(in srgb, var(--bg, #f4f1ea) 88%, transparent); backdrop-filter: blur(6px); }
.lic-block[hidden] { display: none; }
.lic-card { width: min(420px, 100%); background: var(--surface, #fffdf8); border-radius: 24px; padding: 24px; box-shadow: 0 20px 50px rgba(0,0,0,.18); display: grid; gap: 10px; text-align: center; }
.lic-card h1 { margin: 6px 0 0; font-size: 22px; }
.lic-card p { margin: 0; line-height: 1.5; }
.lic-card .brand-mark { justify-self: center; }
.lic-pix { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; text-align: left; padding: 12px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 14%, transparent); }
.lic-pix small { grid-column: 1; color: var(--muted); }
.lic-pix b { grid-column: 1; word-break: break-all; }
.lic-pix button { grid-column: 2; grid-row: 1 / span 2; }
.read-only .fab { opacity: .55; }

/* T39: primeira visita, lançamento compacto e navegação principal */
.intro { min-height: 100dvh; display: grid; place-items: center; padding: 18px; background: radial-gradient(100% 70% at 100% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 68%), var(--bg); color: var(--ink); }
.intro[hidden], .intro-page[hidden] { display: none !important; }
.intro-shell { width: min(100%, 500px); padding: clamp(18px, 5vw, 30px); border: 1px solid var(--line); border-radius: 28px; background: var(--surface); box-shadow: 0 20px 60px rgba(16, 38, 32, .13); }
.intro-brand { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.intro-brand-identity { display: flex; align-items: center; gap: 9px; min-width: 0; }
.intro-brand-wordmark { display: grid; gap: 1px; line-height: 1.15; }
.intro-brand-wordmark b { font-size: 14px; }
.intro-brand-wordmark small { color: var(--muted); font-size: 11px; }
.intro-brand .brand-mark { width: max-content; margin: 0; }
.intro-step, .intro-eyebrow { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.intro-eyebrow { margin: 0 0 8px; }
.intro-page h1 { margin: 0 0 8px; font-size: clamp(25px, 7vw, 34px); line-height: 1.12; letter-spacing: -.025em; }
.intro-page > .muted { line-height: 1.55; }
.intro-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 22px 0 18px; }
.intro-choice { display: grid; justify-items: start; gap: 7px; min-width: 0; min-height: 140px; padding: 16px; text-align: left; border: 1px solid var(--line); border-radius: 20px; background: var(--card, var(--surface)); color: var(--ink); }
.intro-choice.is-on { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 24%, transparent); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.intro-choice > span { font-size: 24px; }
.intro-choice b { font-size: 16px; }
.intro-choice small, .intro-toggle small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.intro-example { display: grid; gap: 5px; margin: 20px 0 12px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.intro-example span { color: var(--accent); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.intro-example b { font-size: 16px; }
.intro-example small, .intro-footnote { color: var(--muted); font-size: 12px; }
.intro-footnote { line-height: 1.5; margin: 12px 0 18px; }
.intro-back { display: block; margin: 10px auto 0; }
.intro-toggle { display: flex; align-items: flex-start; gap: 12px; margin: 12px 0; padding: 14px; border: 1px solid var(--line); border-radius: 16px; }
.intro-toggle input { flex: none; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); }
.intro-toggle span { display: grid; gap: 4px; }
.intro-demo .demo-balance { display: grid; gap: 5px; margin: 18px 0 10px; padding: 18px; border-radius: 20px; background: var(--brand, #16302a); color: #fff; }
.demo-balance small, .demo-balance span { opacity: .76; font-size: 12px; }
.demo-balance strong { font-size: 29px; }
.demo-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 13px 2px; border-bottom: 1px solid var(--line); font-size: 13px; }
.demo-line span { min-width: 0; }
.demo-line b { white-space: nowrap; }

.quick-pay-wrap { margin: 12px 0 8px; }
.quick-pay-wrap[hidden], .quick-inference[hidden] { display: none !important; }
.quick-pay-label { display: block; margin-bottom: 8px; font-size: 13px; font-weight: 750; }
.quick-pay-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.quick-pay-option { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 48px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); text-align: left; font-size: 13px; font-weight: 700; }
.quick-pay-option.is-on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 32%, transparent); }
.quick-pay-option .pm-ico { flex: none; }
.quick-pay-note { margin: 7px 1px 0; line-height: 1.4; }
.quick-inference { display: flex; align-items: center; gap: 8px; margin: 8px 0 4px; padding: 10px 12px; border-radius: 13px; background: color-mix(in srgb, var(--accent) 13%, transparent); font-size: 12px; line-height: 1.4; }
.quick-inference > span { flex: 1; }
.quick-inference .link { flex: none; }
.tx-details { margin: 12px 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.tx-details > summary { min-height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 10px 13px; cursor: pointer; font-weight: 700; list-style: none; }
.tx-details > summary::-webkit-details-marker { display: none; }
.tx-details > summary::after { content: '+'; font-size: 20px; color: var(--accent); }
.tx-details[open] > summary::after { content: '−'; }
.tx-details-body { padding: 0 12px 12px; border-top: 1px solid var(--line); }

.today-heading { align-items: center; }
.today-heading h1 { margin: 0; font-size: 28px; }
.today-heading .muted { margin: 4px 0 0; text-transform: capitalize; }
.today-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.today-stats .card { display: grid; gap: 7px; margin: 0; padding: 14px; min-width: 0; }
.today-stats small { color: var(--muted); font-size: 12px; }
.today-stats strong { overflow-wrap: anywhere; font-size: clamp(17px, 4.8vw, 22px); }
.today-task-list { margin-bottom: 0; }
.today-events { display: grid; gap: 8px; }
.today-event { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 9px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--ink); text-align: left; }
.today-event > span:last-child { display: grid; min-width: 0; gap: 3px; }
.today-event b { overflow-wrap: anywhere; }
.today-event small { color: var(--muted); }
.routine-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.routine-card { display: grid; justify-items: start; align-content: start; gap: 8px; min-width: 0; min-height: 142px; padding: 16px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--ink); text-align: left; }
.routine-card > span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); font-size: 21px; font-weight: 800; }
.routine-card b { font-size: 16px; }
.routine-card small, .routine-card i { color: var(--muted); font-size: 12px; font-style: normal; }
.launch-sheet { padding: 20px; }
.launch-mode-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.launch-mode-actions .btn { min-height: 52px; }

/* Keep five destinations and the central action visible on narrow phones. */
.tabbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 62px minmax(0, 1fr) minmax(0, 1fr); left: 50%; right: auto; width: min(520px, calc(100vw - 20px)); transform: translateX(-50%); overflow: visible; gap: 2px; padding: 6px 5px calc(6px + var(--safe-b)); }
.tabbar .tab { min-width: 0; flex: initial; padding: 7px 1px 6px; font-size: 10px; }
.tabbar .tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
#fab.fab { position: static; inset: auto; width: 58px; height: 54px; min-width: 0; margin: -14px 0 0; padding: 3px; border-radius: 18px; touch-action: manipulation; cursor: pointer; }
#fab.fab svg { width: 24px; height: 24px; }
#fab.fab span { display: block; margin: 0; font-size: 9px; }
#fab.fab:active { transform: scale(.96); }
#fab.fab.drag { transform: none; }
@media (max-width: 360px) {
  .intro { padding: 10px; }
  .intro-shell { padding: 17px; border-radius: 22px; }
  .intro-choice { min-height: 124px; padding: 12px; }
  .routine-grid { gap: 8px; }
  .routine-card { min-height: 132px; padding: 12px; }
  .tabbar { width: calc(100vw - 14px); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 58px minmax(0, 1fr) minmax(0, 1fr); }
  #fab.fab { width: 54px; }
}

.vip-pill { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; margin-right: 8px; padding: 6px 11px; border-radius: 99px; font-size: 12px; font-weight: 800; letter-spacing: .04em; color: #4a3204; background: linear-gradient(135deg, #f7e3a8, #d9b25c); box-shadow: 0 2px 10px rgba(217,178,92,.35); position: relative; z-index: 2; }
.vip-pill svg { width: 14px; height: 14px; stroke-width: 2.2; }
.vip-pill:not([hidden]) + .eye-btn { margin-left: 0; }

/* v34: áreas de toque das Metas (auditoria) */
.goal-card .mini-btn, .goal-actions .mini-btn { min-height: 40px; padding: 8px 14px; display: inline-flex; align-items: center; justify-content: center; }
.goal-item .mini-btn { min-width: 92px; }
.goal-edit-btn { min-height: 40px; padding: 8px 4px 8px 12px; }
.goal-actions { gap: 8px; }

/* The legacy hide-navigation preference still leaves the central launch action. */
.no-tabbar .tabbar { display: grid !important; left: auto; right: 14px; bottom: calc(12px + var(--safe-b)); width: 62px; transform: none; grid-template-columns: 1fr; padding: 0; border: 0; background: transparent; box-shadow: none; backdrop-filter: none; }
.no-tabbar .tabbar .tab { display: none; }
.no-tabbar #fab.fab { position: static; width: 58px; height: 54px; margin: 0; }
.no-tabbar .view { padding-bottom: calc(100px + var(--safe-b)); }

/* ==========================================================================
   SUPER-APP MERCADO PAGO STYLE HUB & ARGON CALM TECH TOKENS (fin-v47)
   ========================================================================== */
.calm-banner {
  background: linear-gradient(135deg, #16302a 0%, #234b40 100%);
  color: #f4f1ea;
  border-radius: 20px;
  padding: 16px 18px;
  border: 1px solid #c9a96e;
  box-shadow: 0 8px 24px rgba(22, 48, 42, 0.16);
  margin-bottom: 14px;
}
.calm-banner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #dfc48f;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.calm-banner h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
}
.calm-banner p {
  margin: 4px 0 0;
  font-size: 13px;
  color: #d6e4df;
  line-height: 1.4;
}
.badge-gold {
  background: #f9f0dc;
  color: #7c5c20;
  border: 1px solid #e3c893;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
}

/* Super-App Quick Features Hub (Mercado Pago style) */
.superapp-hub-card {
  margin-bottom: 14px;
  padding: 16px 14px;
}
.superapp-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 0 4px;
}
.superapp-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.superapp-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 8px;
}
@media (max-width: 350px) {
  .superapp-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 6px;
  }
}
@media (min-width: 600px) {
  .superapp-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px 10px;
  }
}
@media (min-width: 900px) {
  .superapp-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 16px 12px;
  }
}
.superapp-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 4px 2px;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  text-align: center;
  touch-action: manipulation;
}
.superapp-btn:active .superapp-icon {
  transform: scale(0.92);
}
.superapp-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--brand-2, #087cf0);
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.superapp-icon > svg { width: 22px; height: 22px; }
.superapp-btn .brand-icon {
  background: linear-gradient(135deg, #16302a 0%, #244d42 100%);
  color: #dfc48f;
  border-color: #c9a96e;
  font-size: 24px;
  font-weight: 800;
}
.superapp-btn .brand-icon > svg { width: 20px; height: 20px; stroke-width: 2.2; }
.superapp-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  word-break: break-word;
  max-width: 68px;
}
.badge-novo {
  position: absolute;
  top: -3px;
  right: calc(50% - 28px);
  background: #d0533f;
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(208, 83, 63, 0.4);
}

/* Shopping & Compras Quick Card */
.shopping-card {
  margin-bottom: 14px;
}
.shopping-quick-form {
  margin: 10px 0;
}
.shopping-input-row {
  display: flex;
  gap: 8px;
}
.shopping-input-row input {
  flex: 1;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 14px;
  outline: none;
}
.shopping-input-row input:focus {
  border-color: var(--brand-2);
}
.shopping-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}
.shopping-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.shopping-item label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}
.shopping-item label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shopping-item.is-done label span {
  text-decoration: line-through;
  opacity: 0.55;
}

/* T08-MINI-01: leitura de nota (foto múltipla / vídeo) e avisos */
.att-flag { font-size: 12px; margin-left: 2px; }
.pm-auto-note { color: #14a38b; font-weight: 600; margin: 2px 0 8px; }
.scan-prompt { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.scan-prompt .muted { margin-right: auto; }

/* T69: instalação PWA/APK */
.install-cta { margin-top: 16px; text-align: center; }
.install-cta small { display: block; margin-top: 6px; }
.install-option { margin-bottom: 16px; }
.install-option:last-child { margin-bottom: 0; }
.install-option h3 { margin-bottom: 4px; }
.install-option .btn { margin-top: 8px; }

/* ==========================================================================
   HX33 - Acessibilidade: alvos de toque >= 44px e contraste AA (WCAG 2.1)
   Correcoes pontuais sobre os controles criticos; comentarios em ASCII.
   ========================================================================== */

/* --- alvos de toque: minimo de 44x44px nos controles pequenos --- */
.icon-btn { min-width: 44px; min-height: 44px; }
.eye-btn { min-width: 44px; min-height: 44px; }
.hc-ic { min-width: 44px; min-height: 44px; }
.card-fold { min-width: 44px; min-height: 44px; }
.task-check { min-width: 44px; min-height: 44px; }
.task-action { min-width: 44px; min-height: 44px; }
.bill-pay { min-height: 44px; }
.chip { min-height: 44px; }
.seg { min-height: 44px; }
.seg-mini button { min-height: 44px; }
.mini-btn { min-height: 44px; }
.color-pick button { min-width: 44px; min-height: 44px; }

/* --- contraste AA no tema claro (texto sobre --bg / --surface) --- */
:root {
  --muted: #616d66; /* 4.79:1 sobre --bg; 5.31:1 sobre --surface */
  --neg: #bd4330;   /* 5.15:1 sobre --surface; 4.64:1 sobre --bg */
  --pos: #267457;   /* 5.56:1 sobre --surface; 5.01:1 sobre --bg */
}

/* --- contraste AA no tema escuro (texto sobre --surface / --bg) --- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --neg: #e06652; /* 4.96:1 sobre --surface escuro */
    --pos: #4cc08d; /* 7.39:1 sobre --surface escuro */
  }
}
:root[data-theme="dark"] {
  --neg: #e06652;
  --pos: #4cc08d;
}

/* ==========================================================================
   HX01 - Tokens visuais (mockup-ui.css -> variaveis CSS do app)
   Verdade: financas-colar/mockups/mockup-ui.css + 14 HTMLs de mockup.
   Tema claro/escuro preservados. Nao altera telas; apenas define tokens.
   ========================================================================== */

:root {
  /* --- tipografia --- */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --fs-10: 10px;
  --fs-11: 11px;
  --fs-12: 12px;
  --fs-13: 13px;
  --fs-14: 14px;
  --fs-15: 15px;
  --fs-16: 16px;
  --fs-18: 18px;
  --fs-21: 21px;
  --fs-22: 22px;
  --fs-28: 28px;
  --fw-600: 600;
  --fw-700: 700;
  --fw-800: 800;
  --fw-900: 900;
  --track-tight: -0.02em;

  /* --- paleta "calm tech" (verde profundo + dourado sereno + creme) --- */
  --cream: #f4f1ea;
  --ink: #132823;                 /* alinhado ao corpo do mockup */
  --green-deep: #16302a;          /* brand principal */
  --green-2: #234b40;             /* fim do gradiente do banner */
  --green-3: #244d42;             /* gradiente do botao central */
  --green-4: #234c41;             /* radial do hero escuro */
  --green-5: #0e201c;             /* base do radial do hero escuro */
  --gold: #c9a96e;                /* accent */
  --gold-light: #dfc48f;          /* texto dourado sobre fundo escuro */
  --gold-deep: #b18d4f;           /* fim do gradiente do botao dourado */
  --gold-start: #d8b97d;          /* inicio do gradiente do botao dourado */
  --white: #ffffff;

  /* --- superficies e bordas --- */
  --surface: #ffffff;             /* cartoes */
  --surface-cream: #faf8f3;       /* campo de entrada */
  --surface-wash: #f9f2e2;        /* cartao dourado suave */
  --surface-wash2: #fbf9f4;
  --green-wash: #eaf1ee;          /* item selecionado / icone de linha */
  --green-wash2: #e1f3ec;         /* fundo de selo verde */
  --green-line: #b5dfcc;          /* borda de selo verde */
  --green-strong: #175c40;        /* texto de selo verde / positivo */
  --gold-wash: #f9f0dc;           /* fundo de selo dourado */
  --gold-line: #e3c893;           /* borda de selo dourado */
  --gold-text: #7c5c20;           /* texto de selo dourado */
  --gold-text2: #946210;          /* valor "informar valor" */
  --line-soft: #e1dacb;           /* borda de cartao */
  --line-pill: #d8d0c0;           /* borda de pill de icone */
  --line-input: #d5cebe;          /* borda de campo de entrada */
  --line-nav: #ded7c7;            /* borda superior da navegacao */
  --line-dash: #e7e1d4;           /* divisor tracejado de linha */
  --seg-bg: #e6e0d2;              /* fundo do controle segmentado */
  --seg-track: #e7e1d3;           /* trilho de progresso */

  /* --- tons de texto neutro (hierarquia) --- */
  --muted-2: #536c65;
  --muted-3: #5a726b;
  --muted-4: #5b736c;
  --muted-5: #657c75;
  --muted-6: #617871;
  --muted-7: #48615a;
  --muted-8: #4a635c;
  --muted-9: #3f5851;
  --muted-10: #3d564f;
  --muted-11: #27423b;
  --muted-12: #2c443d;

  /* --- texto sobre fundo escuro --- */
  --dark-soft: #d6e4df;
  --dark-soft2: #c9d8d3;
  --dark-soft3: #b8ccc6;
  --dark-soft4: #d7e3df;

  /* --- raios --- */
  --radius-1: 10px;
  --radius-2: 12px;
  --radius-3: 14px;
  --radius-4: 16px;
  --radius-5: 18px;
  --radius-round: 999px;

  /* --- sombras --- */
  --shadow-card: 0 4px 12px rgba(22, 48, 42, 0.04);
  --shadow-banner: 0 8px 20px rgba(22, 48, 42, 0.14);
  --shadow-btn-gold: 0 8px 18px rgba(201, 169, 110, 0.28);
  --shadow-omni: 0 8px 18px rgba(22, 48, 42, 0.28);

  /* --- gradientes --- */
  --grad-btn-gold: linear-gradient(135deg, #d8b97d 0%, #c9a96e 60%, #b18d4f 100%);
  --grad-banner: linear-gradient(135deg, #16302a 0%, #234b40 100%);
  --grad-omni: linear-gradient(135deg, #16302a 0%, #244d42 100%);
  --grad-progress: linear-gradient(90deg, #16302a 0%, #c9a96e 100%);
  --grad-hero: radial-gradient(circle at 50% 15%, #234c41 0%, #16302a 60%, #0e201c 100%);

  /* --- espacamento --- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;

  /* --- metricas de componente --- */
  --h-input: 42px;
  --h-btn: 46px;
  --h-pill: 38px;
  --h-nav: 74px;
}

/* Tema escuro: mantem a paleta profunda do app, com os novos tokens ajustados */
:root[data-theme="dark"] {
  --cream: #0f1513;
  --ink: #eef1ee;
  --surface: #171f1c;
  --surface-cream: #1f2925;
  --surface-wash: #26271f;
  --surface-wash2: #1f2925;
  --green-wash: #1f2e29;
  --green-wash2: #1c332b;
  --green-line: #2a4a3e;
  --gold-wash: #2c261a;
  --gold-line: #4a3d22;
  --gold-text: #dfc48f;
  --gold-text2: #dfc48f;
  --line-soft: #2a3531;
  --line-pill: #2a3531;
  --line-input: #2a3531;
  --line-nav: #2a3531;
  --line-dash: #28332f;
  --seg-bg: #1f2925;
  --seg-track: #28332f;
  --muted-2: #9aa59f;
  --muted-3: #9aa59f;
  --muted-4: #9aa59f;
  --muted-5: #9aa59f;
  --muted-6: #9aa59f;
  --muted-7: #9aa59f;
  --muted-8: #9aa59f;
  --muted-9: #9aa59f;
  --muted-10: #9aa59f;
  --muted-11: #b8c6c0;
  --muted-12: #b8c6c0;
  --dark-soft: #d6e4df;
  --dark-soft2: #c9d8d3;
  --dark-soft3: #b8ccc6;
  --dark-soft4: #d7e3df;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-banner: 0 8px 20px rgba(0, 0, 0, .3);
  --shadow-btn-gold: 0 8px 18px rgba(0, 0, 0, .3);
  --shadow-omni: 0 8px 18px rgba(0, 0, 0, .3);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --cream: #0f1513;
    --ink: #eef1ee;
    --surface: #171f1c;
    --surface-cream: #1f2925;
    --surface-wash: #26271f;
    --surface-wash2: #1f2925;
    --green-wash: #1f2e29;
    --green-wash2: #1c332b;
    --green-line: #2a4a3e;
    --gold-wash: #2c261a;
    --gold-line: #4a3d22;
    --gold-text: #dfc48f;
    --gold-text2: #dfc48f;
    --line-soft: #2a3531;
    --line-pill: #2a3531;
    --line-input: #2a3531;
    --line-nav: #2a3531;
    --line-dash: #28332f;
    --seg-bg: #1f2925;
    --seg-track: #28332f;
    --muted-2: #9aa59f;
    --muted-3: #9aa59f;
    --muted-4: #9aa59f;
    --muted-5: #9aa59f;
    --muted-6: #9aa59f;
    --muted-7: #9aa59f;
    --muted-8: #9aa59f;
    --muted-9: #9aa59f;
    --muted-10: #9aa59f;
    --muted-11: #b8c6c0;
    --muted-12: #b8c6c0;
    --dark-soft: #d6e4df;
    --dark-soft2: #c9d8d3;
    --dark-soft3: #b8ccc6;
    --dark-soft4: #d7e3df;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-banner: 0 8px 20px rgba(0, 0, 0, .3);
    --shadow-btn-gold: 0 8px 18px rgba(0, 0, 0, .3);
    --shadow-omni: 0 8px 18px rgba(0, 0, 0, .3);
  }
}

/* ==========================================================================
   HX02 - Casca do app: cabecalho, navegacao inferior e componentes base
   Verdade: financas-colar/mockups/mockup-ui.css + 14 HTMLs.
   Responsivo (nao fixo em 390px), respeitando safe-area iPhone/Android.
   ========================================================================== */

/* ---------- casca ---------- */
#app.app-shell {
  min-height: 100dvh;
  background: var(--cream);
  color: var(--ink);
}
.app-shell.dark-hero {
  background: var(--grad-hero);
  color: var(--cream);
}

/* barra de status do app (sem falsificar hora/bateria do aparelho) */
.status-bar {
  height: calc(42px + var(--safe-t, 0px));
  padding: calc(10px + var(--safe-t, 0px)) 22px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-12);
  font-weight: 700;
  opacity: 0.9;
  letter-spacing: .02em;
}

/* cabecalho */
.top-header {
  padding: 8px 18px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.top-title-group { min-width: 0; }
.top-title-group span.eyebrow {
  display: block;
  font-size: 11.5px;
  color: var(--muted-2);
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.top-title-group h1 {
  font-size: var(--fs-18);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 2px 0 0;
}
.app-shell.dark-hero .top-title-group span.eyebrow { color: var(--gold-light); }
.app-shell.dark-hero .top-title-group h1 { color: #fff; }
.top-actions { display: flex; align-items: center; gap: 6px; flex: none; }

.icon-pill {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--radius-2);
  border: 1px solid var(--line-pill);
  background: var(--white);
  color: var(--green-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-12);
  font-weight: 700;
  gap: 4px;
  cursor: pointer;
}
.app-shell.dark-hero .icon-pill { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: var(--cream); }

/* area de conteudo rolavel */
.content-area {
  padding: 0 18px calc(96px + var(--safe-b, 0px));
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.content-area::-webkit-scrollbar { display: none; }

/* ---------- navegacao inferior (5 destinos + botao central) ---------- */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 6;
  height: calc(74px + var(--safe-b, 0px));
  padding: 6px 12px calc(12px + var(--safe-b, 0px));
  background: var(--white);
  border-top: 1px solid var(--line-nav);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted-6);
  background: none;
  border: 0;
  cursor: pointer;
  min-height: 48px;
  padding: 0 2px;
}
.nav-item .nav-emoji { font-size: 20px; line-height: 1; }
.nav-item.active { color: var(--green-deep); }
.nav-omni {
  width: 48px;
  height: 48px;
  margin: -14px auto 0;
  border-radius: 16px;
  background: var(--grad-omni);
  border: 2px solid var(--gold);
  color: var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: var(--shadow-omni);
  cursor: pointer;
}
.nav-item .nav-omni-label { font-size: 10px; font-weight: 700; color: var(--muted-6); }

/* ---------- componentes do design system (reusados pelas telas) ---------- */
.calm-banner {
  background: var(--grad-banner);
  color: var(--cream);
  border-radius: 18px;
  padding: 14px 15px;
  border: 1px solid var(--gold);
  box-shadow: var(--shadow-banner);
}
.calm-banner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--gold-light);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 5px;
  gap: 8px;
}
.calm-banner h2 {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.02em;
  margin: 0;
}
.calm-banner p { font-size: 12px; color: var(--dark-soft); margin: 3px 0 0; }

.seg-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  background: var(--seg-bg);
  padding: 4px;
  border-radius: var(--radius-2);
}
.seg-control.cols-2 { grid-template-columns: 1fr 1fr; }
.seg-item {
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted-9);
  background: none;
  border: 0;
  cursor: pointer;
}
.seg-item.active { background: var(--green-deep); color: var(--cream); }

.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: var(--shadow-card);
}
.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.card-title { font-size: 12.5px; font-weight: 800; color: var(--green-deep); }
.app-shell.dark-hero .card { color: var(--ink); }
.app-shell.dark-hero .card-title { color: var(--green-deep); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}
.badge-green { background: var(--green-wash2); color: var(--green-strong); border: 1px solid var(--green-line); }
.badge-gold { background: var(--gold-wash); color: var(--gold-text); border: 1px solid var(--gold-line); }
.badge-dark { background: var(--green-deep); color: var(--gold-light); }

.row-list { display: grid; gap: 8px; }
.row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 7px;
  border-bottom: 1px dashed var(--line-dash);
}
.row-item:last-child { border-bottom: none; padding-bottom: 0; }
.row-left { display: flex; align-items: center; gap: 9px; min-width: 0; }
.row-icon {
  width: 34px; height: 34px; flex: none;
  border-radius: 10px;
  background: var(--green-wash);
  color: var(--green-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.row-text { min-width: 0; }
.row-text strong { display: block; font-size: 12.5px; color: var(--ink); font-weight: 700; }
.row-text span { font-size: 11px; color: var(--muted-3); }
.row-right { text-align: right; flex: none; }
.row-right strong { display: block; font-size: 12.5px; color: var(--green-deep); font-weight: 800; }
.row-right span { font-size: 10.5px; color: var(--muted-5); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mini-stat {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 10px 12px;
}
.mini-stat span { font-size: 10.5px; color: var(--muted-4); font-weight: 700; display: block; }
.mini-stat strong { font-size: 15px; color: var(--green-deep); font-weight: 900; }

.progress-track {
  width: 100%; height: 8px;
  background: var(--seg-track);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}
.progress-fill { height: 100%; background: var(--grad-progress); border-radius: 999px; }

.btn-full {
  width: 100%; min-height: 46px;
  border-radius: 14px;
  background: var(--grad-btn-gold);
  color: #10241f;
  font-weight: 800;
  font-size: 13.5px;
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-btn-gold);
  padding: 10px 14px;
}
.btn-dark-full {
  width: 100%; min-height: 46px;
  border-radius: 14px;
  background: var(--green-deep);
  color: var(--cream);
  font-weight: 800;
  font-size: 13.5px;
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  border: 1px solid var(--gold);
  cursor: pointer;
  padding: 10px 14px;
}

.field-mock { display: grid; gap: 3px; }
.field-mock label { font-size: 11px; font-weight: 700; color: var(--muted-7); }
.field-mock .input-box {
  height: 42px; border-radius: 10px; border: 1px solid var(--line-input);
  background: var(--surface-cream); padding: 0 12px;
  display: flex; align-items: center; font-size: 12.5px; font-weight: 600; color: var(--ink);
}

/* reduz movimento */
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* HX02 - ajustes do cabecalho: eyebrow + titulo + navegacao de mes */
.top-header .title-with-nav { display: flex; align-items: center; gap: 2px; margin-top: 2px; }
.top-header .month-label { flex: 1; text-align: left; font-weight: 800; font-size: 18px; letter-spacing: -0.02em; line-height: 1.15; }
.top-header .icon-btn { width: 30px; height: 30px; border-radius: 9px; }
.top-header .icon-btn svg { width: 16px; height: 16px; }
.top-header.no-month #prev-month, .top-header.no-month #next-month { visibility: hidden; width: 0; overflow: hidden; }
.top-header.no-month #month-label { visibility: visible; }

/* o botao central Capturar reaproveita o #fab sem os estilos antigos de FAB */
.bottom-nav #fab.nav-item { min-height: 0; }

/* HX03 - tela 01 boas-vindas & login (dark-hero, fiel ao mockup) */
#login.app-shell { display: flex; flex-direction: column; min-height: 100dvh; padding: 0; background: var(--grad-hero); color: var(--cream); }
#login.app-shell .content-area { flex: 1; overflow-y: auto; padding-bottom: 12px; }
#login .field-mock { margin-bottom: 9px; }
.field-mock .input-box input {
  border: 0; background: none; width: 100%; height: 100%; min-height: 0; padding: 0;
  font: inherit; color: var(--ink); outline: none; font-weight: 600;
}
.field-mock .input-box input:focus-visible { box-shadow: inset 0 0 0 2px var(--gold); border-radius: 6px; }
#login-form, #forgot-form, #reset-form, #change-form { display: grid; gap: 2px; }
#login .card .muted { color: var(--muted-10); }
#login .auth-switch { display: block; margin: 10px auto 0; text-align: center; }

/* HX04 - tela 02 questionario de primeiro acesso (v40, fiel ao mockup) */
#intro.app-shell { display: flex; flex-direction: column; min-height: 100dvh; padding: 0; background: var(--cream); color: var(--ink); }
#intro.app-shell .content-area { flex: 1; overflow-y: auto; padding-bottom: 16px; }
.intro-choice-card { padding: 10px; border-radius: 12px; text-align: left; cursor: pointer; border: 1px solid #dcd5c5; background: transparent; display: grid; gap: 2px; width: 100%; }
.intro-choice-card.is-on { border: 2px solid var(--green-deep); background: var(--green-wash); }
.intro-choice-card strong { font-size: 12.5px; display: block; color: var(--ink); font-weight: 700; }
.intro-choice-card span { font-size: 10.5px; color: var(--muted-8); }
.intro-priority { width: 100%; text-align: left; background: none; border: 0; cursor: pointer; color: inherit; }
.intro-priority .row-text strong, .intro-priority .row-text span { color: inherit; }

/* HX05 - telas reconstruidas (view.screen) + tela 03 inicio · pulso de tranquilidade */
.view.screen { padding: 0; max-width: 640px; margin: 0 auto; }
.view.screen .content-area { padding: 0 18px calc(96px + var(--safe-b, 0px)); }
.view.screen .mini-stat strong { font-variant-numeric: tabular-nums; }
.hide-values #pulse-value, .hide-values #home-income, .hide-values #home-expense,
.hide-values #home-shared-total, .hide-values #home-balance, .hide-values .row-right strong { filter: blur(9px); user-select: none; }
@media (min-width: 900px) { .view.screen { max-width: min(640px, 94vw); } }


/* HX06 - tela 04 - modo voz inteligente (dark-hero, fiel ao mockup 04-modo-voz-inteligente.html) */
#app.app-shell.app-voice { background: var(--grad-hero); color: var(--cream); }
#app.app-shell.app-voice > .status-bar,
#app.app-shell.app-voice > .top-header { display: none; }

#view-voice {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
  background: var(--grad-hero);
  color: var(--cream);
  min-height: 100dvh;
}

#view-voice .voice-head {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(12px + var(--safe-t, 0px)) 18px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
#view-voice .voice-head .eyebrow { color: var(--gold-light); }
#view-voice .voice-head h1 { color: #fff; }

#view-voice .content-area { padding: 0 18px calc(96px + var(--safe-b, 0px)); }

#view-voice .voice-banner {
  background: rgba(0, 0, 0, 0.28);
  border-color: var(--gold);
  text-align: center;
  padding: 18px 14px;
}
#view-voice .voice-banner-label {
  font-size: 11px;
  color: var(--gold-light);
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
#view-voice .voice-banner p {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  line-height: 1.35;
  margin: 0;
}
#view-voice .voice-banner p.voice-empty { color: var(--dark-soft); font-size: 13px; }
#view-voice .voice-badges {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
#view-voice .voice-badges[hidden] { display: none; }

#view-voice .card { color: #132823; }
#view-voice .row-right strong { color: #132823; }
#view-voice .voice-actions { grid-template-columns: 1fr 1fr; }
#view-voice .voice-actions .btn-dark-full { height: 40px; font-size: 12px; }
#view-voice .voice-actions .btn-dark-full:only-child { grid-column: 1 / -1; }

#view-voice .voice-empty-card {
  color: var(--dark-soft);
  font-size: 13px;
  text-align: center;
  padding: 18px 14px;
  border: 1px dashed rgba(223, 196, 143, .35);
  border-radius: 16px;
}



/* HX07 - tela 05 - scanner de nota fiscal QR/OCR (claro, fiel ao mockup 05-scanner-nota-ocr-qr.html) */
#app.app-shell.app-scanner > .top-header { display: none; }

#view-scanner .scanner-head {
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 18px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
#view-scanner .scanner-head .eyebrow { color: var(--muted-2); }
#view-scanner .scanner-head h1 { color: var(--ink); }

/* as linhas "Alterar / 50/50 / Ver foto" sao botoes reais (mantem a cara da .row-item) */
#view-scanner .scanner-row {
  width: 100%;
  background: none;
  border: 0;
  border-bottom: 1px dashed var(--line-dash);
  padding: 0 0 7px;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
#view-scanner .scanner-row:last-child { border-bottom: none; padding-bottom: 0; }

/* card dourado do Cofre de Garantia */
#view-scanner .scanner-vault { background: #f9f2e2; border-color: #c9a96e; }
#view-scanner .scanner-vault .card-title { color: #16302a; }
#view-scanner .scanner-vault-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  color: #3d564f;
  cursor: pointer;
}
#view-scanner .scanner-vault-ctrl { display: flex; align-items: center; gap: 8px; flex: none; }
#view-scanner .scanner-vault-state { color: #16302a; font-weight: 800; white-space: nowrap; }

/* switch simples (checkbox local) */
#view-scanner .scanner-switch { position: relative; width: 40px; height: 22px; flex: none; display: inline-block; }
#view-scanner .scanner-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
#view-scanner .scanner-switch i {
  position: absolute; inset: 0; border-radius: 999px;
  background: #cfd8d4; transition: background .15s;
  pointer-events: none;
}
#view-scanner .scanner-switch i::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .15s;
}
#view-scanner .scanner-switch input:checked + i { background: var(--green-deep); }
#view-scanner .scanner-switch input:checked + i::after { transform: translateX(18px); }

@media (prefers-reduced-motion: reduce) {
  #view-scanner .scanner-switch i, #view-scanner .scanner-switch i::after { transition: none; }
}



/* HX17-HX21 - estados e fluxo (login, questionario, inicio, voz, scanner) */

/* foco de teclado visivel em todos os controles interativos */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* botao "Voltar" das sub-telas (voz, scanner) e do questionario */
.sub-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--surface);
  flex: none;
}
.sub-back:active { opacity: .75; }

/* mensagem de erro/aviso das views (carregamento, erro, offline) */
.view-error {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--neg);
  border: 1px solid color-mix(in srgb, var(--neg) 40%, transparent);
  background: color-mix(in srgb, var(--neg) 12%, transparent);
  border-radius: 12px;
  padding: 10px 12px;
}

/* HX20 - voz (dark-hero): botao voltar e erro claros sobre fundo escuro */
#view-voice .sub-back {
  color: var(--cream);
  border-color: rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .08);
}
#view-voice .view-error {
  color: #ffd9d1;
  border-color: rgba(243, 183, 173, .55);
  background: rgba(211, 84, 63, .22);
}

/* HX21 - scanner: botao voltar e erro sobre fundo claro */
#view-scanner .sub-back {
  color: var(--ink);
  border-color: var(--line-input);
  background: var(--surface-cream);
}

/* carregando neutro das views novas (nao confundir com erro) */
.view-loading {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted-2);
  padding: 10px 12px;
}

/* HX08 · tela 06 · novo lançamento & divisão do casal (fiel ao mockup 06-novo-lancamento-divisao.html) */
#app.app-shell.app-tx > .top-header { display: none; }

#view-tx .tx-head {
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 18px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
#view-tx .tx-head .eyebrow { color: var(--muted-2); }
#view-tx .tx-head h1 { color: var(--ink); }

/* card valor */
#view-tx .tx-val-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
#view-tx .tx-val-label { font-size: 11px; font-weight: 700; color: var(--muted-3); letter-spacing: .02em; }
#view-tx #tx-view-paid-by { font: inherit; cursor: pointer; }
#view-tx .tx-val-input-wrap { display: flex; align-items: baseline; gap: 6px; margin: 6px 0 4px; }
#view-tx .tx-currency { font-size: 20px; font-weight: 800; color: var(--green-deep); flex: none; }
#view-tx .tx-val-input-wrap input {
  font-size: 28px; font-weight: 900; color: var(--green-deep);
  letter-spacing: -.03em; font-variant-numeric: tabular-nums;
  border: 0; background: none; padding: 0; width: 100%; min-width: 0; outline: none;
}
#view-tx .tx-val-input-wrap input:focus-visible { box-shadow: inset 0 -2px 0 var(--gold); }
#view-tx .tx-val-desc { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted-8); }
#view-tx .tx-val-desc input {
  flex: 1; min-width: 0; border: 0; background: none; font: inherit;
  color: var(--ink); font-weight: 700; outline: none; padding: 0;
}

/* card divisão */
#view-tx .tx-split-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
#view-tx .tx-split-opt {
  padding: 8px 4px; border-radius: 10px; border: 1px solid var(--line-input);
  text-align: center; font-size: 11px; font-weight: 700; color: var(--ink);
  background: none; cursor: pointer; line-height: 1.2;
}
#view-tx .tx-split-opt.active { background: var(--green-deep); color: var(--cream); font-weight: 800; border-color: var(--gold); }
#view-tx .tx-split-explain { font-size: 11.5px; color: var(--muted-10); background: var(--cream); padding: 8px 10px; border-radius: 10px; }

/* card categoria & pagamento + evento */
#view-tx .tx-date {
  border: 1px solid var(--line-input); border-radius: 8px; padding: 4px 6px;
  font-size: 11px; color: var(--ink); background: var(--surface-cream); font-weight: 700;
}
#view-tx .tx-picker { display: grid; gap: 6px; padding-bottom: 7px; border-bottom: 1px dashed var(--line-dash); }
#view-tx .tx-picker-label { font-size: 11px; font-weight: 700; color: var(--muted-4); }
#view-tx .tx-picker-pm, #view-tx .tx-view-trips { display: flex; flex-wrap: wrap; gap: 6px; }
#view-tx .tx-picker-pm .chip, #view-tx .tx-view-trips .chip { display: inline-flex; align-items: center; gap: 6px; }
#view-tx .tx-picker-pm .chip .pm-ico svg, #view-tx .tx-view-trips .chip svg { width: 16px; height: 16px; }

#view-tx #tx-view-error { color: var(--neg); font-size: 12.5px; font-weight: 700; }
#view-tx #tx-view-error[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  #view-tx .tx-val-input-wrap input, #view-tx .tx-split-opt { transition: none; }
}


/* HX09 · tela 07 · extrato de lançamentos & filtros (fiel ao mockup 07-extrato-lancamentos-filtros.html) */

/* busca client-side (equivalente funcional do pill "🔎 Buscar") */
#view-list-new .list-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-2);
  border: 1px solid var(--line-pill);
  background: var(--surface);
}
#view-list-new .list-search > span { font-size: 14px; line-height: 1; }
#view-list-new .list-search input {
  flex: 1; min-width: 0; height: 100%;
  border: 0; background: none; padding: 0;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--ink);
  outline: none;
}
#view-list-new .list-search input::placeholder { color: var(--muted-5); }
#view-list-new .list-search button {
  width: 24px; height: 24px; flex: none;
  display: grid; place-items: center;
  border-radius: 6px; color: var(--muted-5); font-size: 18px; line-height: 1;
}
#view-list-new .list-search button[hidden] { display: none; }

/* filtros 4 colunas: Todos ativo escuro · Despesas/Receitas claras · Divididos dourado */
#view-list-new .list-filters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}
#view-list-new .list-filter {
  height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700;
  background: var(--surface);
  border: 1px solid var(--line-pill);
  color: var(--ink);
  cursor: pointer;
  padding: 0 4px;
}
#view-list-new .list-filter.is-on {
  background: var(--green-deep);
  border-color: var(--green-deep);
  color: var(--cream);
  font-weight: 800;
}
#view-list-new .list-filter.gold {
  background: var(--gold-wash);
  border-color: var(--gold);
  color: var(--gold-text);
  font-weight: 800;
}
#view-list-new .list-filter.gold.is-on {
  box-shadow: inset 0 0 0 1.5px var(--green-deep);
}

/* cartões de lançamentos agrupados por data */
#view-list-new #list-tx-cards { display: grid; gap: 10px; }
#view-list-new #list-tx-cards .card { margin-bottom: 0; }

/* linhas de lançamento: botões reais → detalhe (alterar/excluir) */
#view-list-new .list-tx-row {
  width: 100%;
  background: none;
  border: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
#view-list-new .list-tx-row:active { opacity: .7; }
#view-list-new .list-tx-row .row-icon { font-size: 18px; }

/* card verde-claro da síntese dos divididos */
#view-list-new .list-synthesis {
  background: var(--green-wash);
  border-color: var(--green-deep);
  margin-bottom: 0;
}
#view-list-new .list-synthesis-text {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted-11);
  line-height: 1.5;
}
#view-list-new .list-synthesis-text strong { font-weight: 800; }



/* HX10 · tela 08 · contas a pagar & fixas (radar de vencimentos, fiel ao mockup 08-contas-a-pagar-recorrentes.html) */

/* selo dourado "+ Nova Conta" no cabeçalho — visível só na view bills */
.top-header .bills-new-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 12px;
  flex: none;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  background: var(--gold-wash);
  color: var(--gold-text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}
.top-header .bills-new-add[hidden] { display: none; }
.top-header .bills-new-add:active { opacity: .75; }

/* banner: "previstos" em dourado claro */
#view-bills-new .bills-new-prev {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold-light);
}

/* linhas de conta: botões reais → abrem a conta (openBill) */
#view-bills-new .bills-new-row {
  width: 100%;
  background: none;
  border: 0;
  border-bottom: 1px dashed var(--line-dash);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  padding: 0 0 7px;
}
#view-bills-new .bills-new-row:last-child { border-bottom: none; padding-bottom: 0; }
#view-bills-new .bills-new-row:active { opacity: .7; }
#view-bills-new .bills-new-row .row-icon { font-size: 17px; }
#view-bills-new .bills-new-row .bills-new-cta {
  color: var(--gold-text2);
  font-weight: 700;
}

/* card dourado do radar de contas variáveis */
#view-bills-new .bills-new-radar {
  background: var(--surface-wash);
  border-color: var(--gold);
}
#view-bills-new .bills-new-radar .card-title { color: var(--green-deep); }
#view-bills-new .bills-new-radar-text {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted-10);
  line-height: 1.5;
}
#view-bills-new .bills-new-radar-text strong { font-weight: 800; }


/* HX11 · tela 09 · tarefas compartilhadas do casal (estilo Microsoft To Do, fiel ao mockup 09-tarefas-compartilhadas-casal.html) */

/* linhas clicáveis → abrem o editor (openTask) */
#view-tasks-new .row-item { cursor: pointer; }
#view-tasks-new .row-item:active { opacity: .72; }

/* checkbox ☐/✓ como botão real dentro da .row-icon */
#view-tasks-new .tasks-new-check {
  width: 34px; height: 34px; flex: none;
  border: 0; border-radius: 10px;
  background: var(--green-wash);
  color: var(--green-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  padding: 0;
  cursor: pointer;
}
#view-tasks-new .tasks-new-check.is-done {
  background: var(--green-deep);
  color: var(--gold-light);
}

/* linhas concluídas: tom suave + título riscado */
#view-tasks-new .tasks-new-done-row { opacity: .82; }
#view-tasks-new .tasks-new-done-row .row-text strong {
  text-decoration: line-through;
  color: var(--muted-9);
}

/* card de concluídas levemente translúcido (fiel ao mockup) */
#view-tasks-new .tasks-new-done-card { opacity: .88; }


/* selo verde "v36 Ativo" no cabeçalho — visível só na view tasks */
.top-header .tasks-new-badge { height: 24px; flex: none; }
.top-header .tasks-new-badge[hidden] { display: none; }


/* HX12 · tela 10 · metas, dinheiro guardado & eventos (fiel ao mockup 10-metas-caixinhas-eventos.html) */

/* selo dourado "+ Nova Meta" no cabeçalho — visível só na view goals */
.top-header .goals-new-add[hidden] { display: none; }

/* linha "Guardado: … / Meta: …" dos cards de meta */
#view-goals-new .goals-new-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted-4);
  margin: 8px 0 2px;
}
#view-goals-new .goals-new-meta strong { font-weight: 800; color: var(--ink); }

/* card de evento ativo: fundo dourado suave (fiel ao mockup) */
#view-goals-new .goals-new-event {
  background: var(--surface-wash);
  border-color: var(--gold);
}
#view-goals-new .goals-new-event-meta {
  font-size: 11.5px;
  color: var(--muted-10);
  margin: 0 0 4px;
}
#view-goals-new .goals-new-event-meta strong { font-weight: 800; color: var(--ink); }

/* botao de acesso dentro de Metas/Mais */
#view-goals-new .goals-new-agenda { margin-top: 10px; }

/* HX22-HX26 - estados e fluxo (telas 06-10) */

/* botao voltar da sub-tela de novo lancamento (tela 06) */
#view-tx .sub-back {
  margin: 0 0 10px;
  color: var(--ink);
  border-color: var(--line-input);
  background: var(--surface-cream);
}
#view-tx .view-error { margin: 0 0 10px; }
#view-tx #tx-view-error { margin: 0 0 12px; }

/* HX13 - tela 11 - agenda integrada (.ics) */

/* selo do cabecalho: visivel so na view agenda */
.top-header .agenda-new-badge { height: 24px; flex: none; }
.top-header .agenda-new-badge[hidden] { display: none; }

/* card escuro de sincronizacao (fiel ao mockup) */
#view-agenda .agenda-sync-card {
  background: #16302a;
  color: #f4f1ea;
  border-color: #c9a96e;
}
#view-agenda .agenda-sync-card .card-title { color: #dfc48f; }
#view-agenda .agenda-sync-text {
  font-size: 11.5px;
  color: #d7e3df;
  margin: 0 0 8px;
}
#view-agenda .agenda-sync-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* linhas da linha do tempo: botoes reais -> abrem o item */
#view-agenda .agenda-row {
  width: 100%;
  background: none;
  border: 0;
  border-bottom: 1px dashed var(--line-dash);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  padding: 0 0 7px;
}
#view-agenda .agenda-row:last-child { border-bottom: none; padding-bottom: 0; }
#view-agenda .agenda-row:active { opacity: .72; }
#view-agenda .agenda-row .row-icon { font-size: 17px; }

/* botao de acesso dentro de Metas/Mais */
#view-goals-new .goals-new-agenda { margin-top: 10px; }



/* HX14 - tela 12 - ritual de 2 minutos do casal (dark-hero) */

/* shell escuro quando a view ritual esta ativa (hero sempre escuro) */
#app.app-shell.app-ritual { background: var(--grad-hero); color: #f4f1ea; }
#app.app-shell.app-ritual > .top-header {
  background: rgba(14, 32, 28, 0.5);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
#app.app-shell.app-ritual .top-title-group span.eyebrow { color: var(--gold-light); }
#app.app-shell.app-ritual .month-label { color: #fff; }
#app.app-shell.app-ritual .icon-btn { color: #f4f1ea; }

/* cartoes brancos com texto escuro (fiel ao mockup) */
#app.app-shell.app-ritual .card { color: var(--ink); }
#app.app-shell.app-ritual .card-title { color: var(--green-deep); }

/* selo do cabecalho: visivel so na view ritual */
.top-header .ritual-new-badge { height: 24px; flex: none; }
.top-header .ritual-new-badge[hidden] { display: none; }

/* banner translucido (fiel ao mockup) */
#view-ritual .ritual-banner {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(223, 196, 143, 0.35);
}

/* texto dos cartoes brancos */
#view-ritual .ritual-card-text {
  font-size: 12px;
  color: var(--muted-10);
  margin: 0;
  line-height: 1.5;
}
#view-ritual .ritual-card-text strong { font-weight: 800; }

/* botao de acesso dentro de Metas/Mais */
#view-goals-new .goals-new-ritual { margin-top: 10px; }

/* HX15 - tela 13 - atividade, auditoria SHA-256 & gestao */

/* selo SHA-256 do cabecalho: visivel somente na view atividade */
.top-header .activity-new-badge { height: 24px; flex: none; }
.top-header .activity-new-badge[hidden] { display: none; }

/* selo vermelho para integridade nao verificada */
.badge-red { background: #fde0da; color: #a5321f; border: 1px solid #f3b7ad; }

/* titulo do banner menor, fiel ao mockup */
#view-activity-new .activity-new-banner h2 { font-size: 17px; }

/* estado de falha no canto do banner */
#view-activity-new .activity-new-status-fail { color: #f3b7ad; }

/* selo de exportar CSV reutilizado como botao real */
.activity-new-export {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  cursor: pointer;
}
.activity-new-export:active { opacity: .72; }

/* icone da linha de acao um pouco maior */
#view-activity-new .activity-new-row .row-icon { font-size: 17px; }
/* HX16 - tela 14 - ajustes, categorias, conta & privacidade LGPD */

/* selo do plano no cabecalho: visivel somente na view ajustes */
.top-header .settings-new-badge { height: 24px; flex: none; }
.top-header .settings-new-badge[hidden] { display: none; }

/* linhas de ajustes viram acoes reais (cursor + feedback) */
#view-settings-new .row-item { cursor: pointer; }
#view-settings-new .row-item:active { opacity: .72; }

/* painel de categorias expandivel ao tocar em "Abrir" */
#view-settings-new .settings-cats { margin-top: 2px; }
#view-settings-new .settings-cats-toolbar { display: flex; justify-content: flex-end; margin-bottom: 2px; }
#view-settings-new .settings-cats .cat-list { margin-top: 4px; }

/* card LGPD vermelho fiel ao mockup (tema claro fixo, como os demais selos) */
#view-settings-new .settings-lgpd-card {
  border-color: #d99b9b;
  background: #fff7f7;
}
#view-settings-new .settings-lgpd-card .card-title { color: #8f2424; }
#view-settings-new .settings-lgpd-badge {
  background: #fbe4e4;
  color: #8f2424;
  border: 1px solid #f3d2d2;
}
#view-settings-new .settings-lgpd-text { font-size: 11px; color: #5e3535; margin: 0 0 8px; }
#view-settings-new .settings-lgpd-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* botoes da acao LGPD: exportar (claro) e excluir (vermelho) */
#view-settings-new .settings-export-btn {
  min-height: 36px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #d5cebe;
  color: #2c443d;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  padding: 8px;
}
#view-settings-new .settings-delete-btn {
  min-height: 36px;
  border-radius: 10px;
  background: #a63232;
  border: none;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 8px;
}
#view-settings-new .settings-export-btn:active,
#view-settings-new .settings-delete-btn:active { opacity: .8; }

/* HX27-HX30 - estados e fluxo das telas 11-14 (agenda, ritual, atividade, ajustes) */

/* HX27 agenda: botao voltar e mensagens */
#view-agenda .sub-back { margin: 0 0 10px; }
#view-agenda .view-error { margin: 0 0 10px; }

/* HX28 ritual (fundo escuro): voltar, erro e carregando legiveis */
#view-ritual .sub-back {
  margin: 0 0 10px;
  color: var(--cream);
  border-color: rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .08);
}
#view-ritual .view-error {
  color: #ffd9d1;
  border-color: rgba(243, 183, 173, .55);
  background: rgba(211, 84, 63, .22);
}
#view-ritual .view-loading { color: #e8e2d4; }

/* HX29 atividade: erro no topo */
#view-activity-new .view-error { margin: 0 0 10px; }

/* HX30 ajustes: carregando e erro no topo */
#view-settings-new .view-error { margin: 0 0 10px; }
#view-settings-new .view-loading { margin: 0 0 10px; }

/* ==========================================================================
   T73/HX43 · cola de integração da camada clean-ui.
   O kit visual vive em public/clean-ui.css; aqui fica só o encaixe de layout
   que o kit não pode resolver sem o markup novo (ordem do header e marca).
   ========================================================================== */
body.clean-ui #top-header {
  flex-wrap: wrap;
  align-items: center;
  row-gap: 2px;
}
body.clean-ui #top-header .clean-brand { order: 1; flex: 1 1 auto; }
body.clean-ui #top-header .top-actions { order: 2; }
body.clean-ui #top-header .top-title-group { order: 3; flex: 1 1 100%; }
body.clean-ui #top-header .top-title-group .title-with-nav { flex-wrap: nowrap; }
body.clean-ui #top-header .top-title-group .eyebrow {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.clean-ui #login .clean-brand { margin: 0 0 8px; }
body.clean-ui #intro .clean-brand { margin: 0 0 8px; }
body.clean-ui #login > .top-header { flex-wrap: wrap; align-items: center; justify-content: flex-start; row-gap: 6px; }
body.clean-ui #login > .top-header .clean-brand { order: 1; flex: 1 1 auto; }
body.clean-ui #login > .top-header > .badge { order: 2; }
body.clean-ui #login > .top-header .top-title-group { order: 3; flex: 1 1 100%; }
body.clean-ui #login > .top-header .eyebrow { display: none; }
body.clean-ui #login #login-badge { display: none; }
body.clean-ui #login .input-box .link { min-height: 44px; padding: 0 8px; }


/* Sem navegação de mês, o título grande vive no conteúdo (.clean-page-title). */
body.clean-ui #top-header.no-month #header-title-group { display: none; }
body.clean-ui #top-header.no-month { padding-bottom: 6px; }
body.clean-ui .clean-page-title { margin-top: 2px; }
body.clean-ui .clean-page-title + .view-error,
body.clean-ui .clean-page-title + .view-loading { margin-top: 6px; }
/* Em telas com título de conteúdo, os selos de versão ficam secundários. */
body.clean-ui .top-actions > .badge { display: none; }
body.clean-ui #header-eyebrow { display: none; }
/* Cards Entradas/Saídas precisam caber em 360 px com os ícones circulares. */
body.clean-ui .clean-home-stat { gap: 8px; align-items: center; }
body.clean-ui .clean-home-stat .clean-icon { width: 36px; height: 36px; }
body.clean-ui .clean-home-stat .clean-icon svg { width: 19px; height: 19px; }
body.clean-ui .clean-home-stat strong { font-size: 17px; white-space: nowrap; letter-spacing: -.02em; }
body.clean-ui .clean-home-actions .clean-icon svg { width: 28px; height: 28px; }
@media (min-width: 1000px) {
  /* HX42/G2: desktop aproveita a largura em vez de repetir a coluna de 800 px. */
  body.clean-ui .view.screen:not(#view-home-new):not(#view-settings-new) > .content-area {
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
  }
  body.clean-ui #view-settings-new > .content-area { max-width: 1156px; }
}

/* HX44 · tela 01 · welcome (antes do login) */
body.clean-ui #login.welcome-mode #login-header,
body.clean-ui #login.welcome-mode .install-cta,
body.clean-ui #login.welcome-mode > div:last-child { display: none; }
body.clean-ui #login.welcome-mode > .content-area { display: none; }
body.clean-ui #welcome-pane {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 18px 22px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}
body.clean-ui #welcome-pane .welcome-logo {
  width: 84px; height: 84px; display: grid; place-items: center;
  border-radius: 24px; background: #087cf0; color: #fff;
  box-shadow: 0 10px 26px rgb(8 124 240 / 22%);
}
body.clean-ui #welcome-pane .welcome-logo svg { width: 52px; height: 52px; stroke-width: 1.6; }
body.clean-ui #welcome-pane h1 { font-size: clamp(30px, 8vw, 38px); margin: 6px 0 0; }
body.clean-ui #welcome-pane .welcome-lede { max-width: 380px; margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.5; }
body.clean-ui .welcome-art {
  width: min(100%, 330px); min-height: 150px; margin: 4px auto 0;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px;
}
body.clean-ui .welcome-art-card {
  width: 84px; height: 70px; display: grid; place-items: center;
  border-radius: 16px; font-size: 26px; border: 1px solid var(--line);
  box-shadow: 0 8px 20px rgb(15 23 42 / 8%);
}
body.clean-ui .welcome-art-card.wc-green { background: var(--clean-icon-green); transform: rotate(-7deg); }
body.clean-ui .welcome-art-card.wc-paper { background: var(--surface); font-weight: 800; font-size: 30px; color: var(--ink); transform: rotate(3deg); }
body.clean-ui .welcome-art-card.wc-coral { background: var(--clean-icon-coral); transform: rotate(6deg); }
body.clean-ui .welcome-art-card.wc-blue { background: var(--clean-icon-blue); transform: rotate(-4deg); }
body.clean-ui .welcome-art-card.wc-yellow { background: var(--clean-icon-yellow); transform: rotate(8deg); }
body.clean-ui .welcome-dots { display: flex; gap: 6px; margin: 2px 0 0; }
body.clean-ui .welcome-dots i { width: 7px; height: 7px; border-radius: 999px; background: var(--line); }
body.clean-ui .welcome-dots i.is-on { width: 20px; background: #087cf0; }
body.clean-ui .welcome-actions { width: 100%; display: grid; gap: 10px; margin-top: 4px; }
body.clean-ui .welcome-actions .btn-full, body.clean-ui .welcome-actions .btn { min-height: 52px; width: 100%; }
body.clean-ui .welcome-terms { margin: 2px 0 0; color: var(--muted); text-align: center; font-size: 12px; }
body.clean-ui .welcome-terms a { color: var(--brand-2); }

/* HX44 · tela 02 · progresso, nome e tiles */
body.clean-ui .intro-progress {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 2px 0 0;
}
body.clean-ui .intro-progress span {
  height: 4px;
  border-radius: 999px;
  background: var(--seg-track);
  transition: background .2s;
}
body.clean-ui .intro-progress span.is-on { background: #087cf0; }
body.clean-ui .intro-step-label {
  margin: 4px 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
body.clean-ui .intro-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
body.clean-ui .intro-tile {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid var(--line-input);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
body.clean-ui .intro-tile span { font-size: 20px; }
body.clean-ui .intro-tile.is-on { border-color: #087cf0; background: var(--clean-blue-wash); }
body.clean-ui .intro-tile.is-on::after { content: "✓"; margin-left: auto; color: #087cf0; font-weight: 700; }
body.clean-ui .intro-step-panel > .btn-full,
body.clean-ui .intro-step-panel > .row-btns { margin-top: 12px; }
/* HX44 · ajustes de fluxo/estado */
body.clean-ui .seg-item span { margin-left: 5px; font-weight: 600; font-variant-numeric: tabular-nums; }
body.clean-ui .tasks-new-tabs { margin-top: 10px; }
body.clean-ui .bills-new-item { display: block; }
body.clean-ui .bills-new-item + .bills-new-item { border-top: 1px solid var(--line); }
body.clean-ui .bills-new-item .bills-new-row { border-bottom: 0; }
body.clean-ui .bills-new-pay { margin: 0 0 10px 52px; min-height: 40px; }
body.clean-ui .goals-new-title { display: flex; align-items: center; gap: 8px; }
body.clean-ui .goals-new-title .clean-icon { width: 34px; height: 34px; }
body.clean-ui .goals-new-title .clean-icon svg { width: 19px; height: 19px; }
body.clean-ui .goals-add-value { width: auto; margin-top: 8px; }
body.clean-ui .settings-member-avatar { width: 34px; height: 34px; min-width: 34px; font-size: 16px; }








/* HX46-C1 · grupos Hoje/Ontem na Atividade */
body.clean-ui #view-activity-new .activity-day-group { margin: 14px 0 4px; }
body.clean-ui #view-activity-new .activity-day-group:first-child { margin-top: 2px; }
/* HX46-C1 · CTA sticky não cobre a bottom-nav e ganha respiro */
body.clean-ui .cta-sticky + * { margin-bottom: 4px; }
body.clean-ui #view-ritual #clean-review-split .progress-track { margin: 6px 0 4px; }
