:root {
  --bg: #f4f8f6; --card: #fff; --text: #123b31; --muted: #66807a; --line: #e3ece8;
  --primary: #1f9d6b; --primary-d: #167a52; --blue: #2f80ed; --danger: #d64545;
  --ok: #1f9d6b; --p80: #e0a800; --p90: #f2994a; --over: #d64545;
  --r: 16px; --shadow: 0 1px 2px rgba(18,59,49,.06), 0 4px 14px rgba(18,59,49,.05);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; line-height: 1.4; }
body.no-scroll { overflow: hidden; }
#app { max-width: 520px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
h2 { font-size: 1.25rem; } h3 { font-size: 1rem; margin-bottom: 8px; } h4 { margin: 14px 0 6px; font-size: .9rem; color: var(--muted); }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); } .tiny { font-size: .78rem; } .center { text-align: center; } .mt { margin-top: 18px; }
.neg { color: var(--danger); } .pos { color: var(--primary-d); }
[hidden] { display: none !important; }
.splash { text-align: center; padding: 30vh 0; font-size: 3rem; } .splash span { font-size: 1rem; color: var(--muted); }

/* topo */
#topbar { position: sticky; top: 0; z-index: 20; background: var(--bg); padding: env(safe-area-inset-top) 14px 6px; }
.top-row { display: flex; align-items: center; gap: 6px; padding-top: 10px; }
.top-row h1 { flex: 1; font-size: 1.3rem; }
.icon-btn { background: transparent; border: 0; width: 40px; height: 40px; border-radius: 50%; font-size: 1.3rem; line-height: 1; position: relative; }
.icon-btn:active { background: rgba(31,157,107,.12); }
.icon-btn.sm { width: 30px; height: 30px; font-size: .7rem; color: var(--muted); }
.icon-btn.on { color: var(--primary); } .icon-btn b { position: absolute; top: 2px; right: 2px; background: var(--primary); color: #fff; font-size: .65rem; border-radius: 9px; padding: 0 5px; }
.cycle-nav { display: flex; align-items: center; gap: 4px; background: var(--card); border-radius: 999px; padding: 2px; box-shadow: var(--shadow); margin-top: 6px; }
.cycle-label { flex: 1; background: none; border: 0; display: flex; flex-direction: column; align-items: center; padding: 2px; }
.cycle-label strong { font-size: 1rem; } .cycle-label span { font-size: .72rem; color: var(--muted); }
#view { padding: 8px 14px 24px; }

/* abas */
#tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px; z-index: 30; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 7px; text-decoration: none; color: var(--muted); font-size: .68rem; }
.tab.on { color: var(--primary); font-weight: 700; }

/* cartões */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; margin: 0 0 12px; }
.card.compact { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mini { display: flex; flex-direction: column; gap: 1px; } .mini strong { font-size: 1.05rem; } .mini.soon { opacity: .55; }
.label { font-size: .75rem; color: var(--muted); display: block; }
.hero { background: linear-gradient(160deg, #fff 0%, #eefaf4 100%); }
.hero-top { display: flex; justify-content: space-between; align-items: center; }
.hero-main { display: flex; justify-content: space-between; align-items: flex-end; margin: 4px 0 10px; }
.big { font-size: 2.1rem; font-weight: 800; letter-spacing: -.5px; }
.big-s { font-size: 1.3rem; font-weight: 700; margin: 0 0 4px; }
.hero-pct { font-size: 1.6rem; font-weight: 800; color: var(--primary); }
.hero-nums { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; }
.hero-nums strong { font-size: 1.05rem; }
.method { margin: 12px 0 0; font-size: .78rem; color: var(--muted); }
.link { background: none; border: 0; color: var(--primary-d); font-weight: 600; padding: 0; text-decoration: underline; text-underline-offset: 2px; }
.link.small { font-size: .85rem; } .link.skip { display: block; margin: 0 0 10px auto; font-size: .85rem; }
.hint { font-size: .8rem; color: var(--muted); margin: 8px 0; } .hint.warn { color: #a06a00; }

/* barras */
.bar { height: 9px; background: #e6efeb; border-radius: 99px; overflow: hidden; margin: 4px 0; }
.bar-fill { height: 100%; border-radius: 99px; background: var(--ok); transition: width .3s; }
.bar-fill.lv-p80 { background: var(--p80); } .bar-fill.lv-p90 { background: var(--p90); } .bar-fill.lv-over { background: var(--over); }
.lv-text-p80 { color: #b88a00; } .lv-text-p90 { color: #d9731c; } .lv-text-over { color: var(--over); }
.banner { border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; font-size: .88rem; background: #e8f3ff; }
.banner.demo { background: #fff6dc; } .banner.lv-p80 { background: #fff3c9; } .banner.lv-p90 { background: #ffe5cc; } .banner.lv-over { background: #fde0e0; }

/* botões */
.btn { border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 700; background: #e9f2ee; color: var(--text); }
.btn.primary { background: var(--primary); color: #fff; } .btn.primary:active { background: var(--primary-d); }
.btn.ghost { background: #eaf2ef; } .btn.danger { background: var(--danger); color: #fff; }
.btn.danger-text, .danger-text { color: var(--danger); }
.btn.big { padding: 16px; font-size: 1.05rem; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.btn.exp { background: #fdeaea; color: #b73636; } .btn.inc { background: #e1f5ec; color: var(--primary-d); }
.btn-row { display: flex; gap: 10px; margin-top: 14px; } .btn-row .btn { flex: 1; } .btn-row.wrap { flex-wrap: wrap; }
.btn-row.sticky { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--card) 22%); padding: 14px 0 4px; }
.btn-col { display: flex; flex-direction: column; gap: 10px; align-items: stretch; margin-top: 18px; }
.file-btn { display: block; text-align: center; margin-top: 10px; }
.row-btn { width: 100%; display: flex; justify-content: space-between; align-items: center; background: #f3f8f6; border: 0; border-radius: 12px; padding: 13px 14px; margin-top: 8px; text-align: left; }
.fab { position: fixed; right: max(16px, calc(50% - 244px)); bottom: calc(86px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--primary); color: #fff; font-size: 2rem; box-shadow: 0 6px 18px rgba(31,157,107,.4); z-index: 25; }

/* categorias */
.sec-head { display: flex; justify-content: space-between; align-items: baseline; }
.cat-row { display: flex; gap: 12px; width: 100%; background: none; border: 0; padding: 10px 0; text-align: left; border-bottom: 1px solid var(--line); align-items: center; }
.cat-row:last-child { border-bottom: 0; } .cat-row.static { cursor: default; }
.cat-ico { display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.cat-ico.round { width: 40px; height: 40px; border-radius: 50%; flex: none; background: color-mix(in srgb, var(--c) 18%, #fff); }
.cat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cat-line { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.cat-name { font-weight: 600; } .cat-val { font-weight: 700; white-space: nowrap; }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.trio > div { display: flex; flex-direction: column; gap: 2px; } .trio strong { font-size: .98rem; }
.pay-row { display: grid; grid-template-columns: 1.2fr 1.4fr auto; gap: 8px; align-items: center; padding: 5px 0; font-size: .9rem; }
.pay-bar { height: 8px; background: #e6efeb; border-radius: 9px; overflow: hidden; } .pay-bar div { height: 100%; background: var(--blue); border-radius: 9px; }
.shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shortcut { display: flex; gap: 10px; align-items: center; border: 0; text-align: left; margin: 0; } .shortcut span:last-child { display: flex; flex-direction: column; }
.sc-ico { font-size: 1.6rem; }
.empty { text-align: center; padding: 18px 8px; } .empty-ico { font-size: 2.2rem; } .empty h3 { margin: 6px 0 4px; }
.badge { display: inline-block; background: #eef3f1; color: var(--muted); font-size: .68rem; padding: 1px 7px; border-radius: 99px; } .badge.ok { background: #dff4ea; color: var(--primary-d); }

/* formulários */
.field { display: block; margin: 12px 0; } .field-label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
input:not([type=checkbox]):not([type=radio]), select, textarea { width: 100%; background: #f3f8f6; border: 1.5px solid transparent; border-radius: 12px; padding: 12px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); background: #fff; }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); width: 20px; height: 20px; flex: none; }
.money-wrap { display: flex; align-items: center; background: #f3f8f6; border-radius: 12px; padding-left: 12px; border: 1.5px solid transparent; }
.money-wrap:focus-within { border-color: var(--primary); background: #fff; }
.money-wrap .rs { color: var(--muted); font-weight: 700; } .money-wrap input { background: transparent !important; border: 0 !important; }
.big-amount .money-wrap input { font-size: 2rem; font-weight: 800; padding: 10px 12px 10px 8px; } .big-amount .rs { font-size: 1.3rem; }
.money-wrap.sm { width: 112px; padding-left: 8px; } .money-wrap.sm input { padding: 8px 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; } .chips.sub { margin-top: 8px; }
.chip { border: 1.5px solid var(--line); background: #fff; border-radius: 99px; padding: 7px 12px; font-size: .88rem; } .chip.on { background: var(--primary); color: #fff; border-color: var(--primary); } .chip.small { padding: 4px 10px; font-size: .78rem; }
.segmented { display: flex; background: #e9f1ee; border-radius: 12px; padding: 3px; gap: 3px; margin: 8px 0; } .segmented.scroll { overflow-x: auto; }
.seg { flex: 1; border: 0; background: transparent; padding: 9px 10px; border-radius: 10px; font-weight: 600; white-space: nowrap; color: var(--muted); }
.seg.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.1); } .seg.on.exp { color: #b73636; } .seg.on.inc { color: var(--primary-d); }
.type-switch { display: flex; background: #e9f1ee; border-radius: 12px; padding: 3px; margin-bottom: 4px; }
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cat-chip { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 1.5px solid var(--line); background: #fff; border-radius: 14px; padding: 8px 4px; font-size: .74rem; text-align: center; }
.cat-chip .cat-ico { font-size: 1.4rem; } .cat-chip.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, #fff); font-weight: 700; }
.radio-list { display: flex; flex-direction: column; gap: 8px; }
.radio { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font-size: .92rem; } .radio.on { border-color: var(--primary); background: #f0faf5; }
.radio input[type=number], .inline-num { width: 64px !important; display: inline-block; padding: 4px 8px !important; margin: 0 4px; text-align: center; }
.radio input[type=date] { width: auto; display: inline-block; padding: 4px 8px; margin-top: 4px; }
.check { display: flex; gap: 8px; align-items: center; font-size: .9rem; white-space: nowrap; }
.more { margin: 8px 0; } .more summary { cursor: pointer; color: var(--primary-d); font-weight: 600; padding: 6px 0; }
.form-error { color: var(--danger); background: #fde8e8; border-radius: 10px; padding: 9px 12px; font-size: .88rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.inline-add { display: flex; gap: 8px; margin: 8px 0; } .inline-add input { flex: 1; } .inline-add .btn { flex: none; }
.chip-row { display: flex; justify-content: space-between; align-items: center; background: #f0f7f4; border-radius: 12px; padding: 4px 4px 4px 12px; margin: 6px 0; font-size: .92rem; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: .92rem; } .kv:last-of-type { border-bottom: 0; }

/* janelas */
.sheet-wrap { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(10,30,24,.45); opacity: 0; transition: opacity .18s; } .sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet { position: relative; width: 100%; max-width: 520px; max-height: 92vh; background: var(--card); border-radius: 22px 22px 0 0; display: flex; flex-direction: column; transform: translateY(40px); opacity: 0; transition: transform .2s, opacity .2s; padding-bottom: env(safe-area-inset-bottom); }
.sheet-wrap.open .sheet { transform: none; opacity: 1; }
.sheet-grip { width: 40px; height: 4px; background: #d3dfda; border-radius: 4px; margin: 8px auto 0; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 12px 0 18px; }
.sheet-body { overflow-y: auto; padding: 4px 18px 18px; -webkit-overflow-scrolling: touch; }
.toast-root, #toast-root { position: fixed; left: 0; right: 0; bottom: calc(86px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 200; pointer-events: none; }
.toast { pointer-events: auto; background: #123b31; color: #fff; padding: 11px 16px; border-radius: 14px; max-width: min(92vw, 480px); font-size: .9rem; display: flex; gap: 14px; align-items: center; opacity: 0; transform: translateY(10px); transition: all .2s; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.toast.show { opacity: 1; transform: none; } .toast.warn { background: #8a2b2b; } .toast-btn { background: none; border: 0; color: #8be3bd; font-weight: 800; }

/* lançamentos */
.detail-amount { font-size: 2rem; font-weight: 800; text-align: center; margin: 6px 0 10px; } .detail-amount.neg { color: var(--danger); } .detail-amount.pos { color: var(--primary-d); }
.detail { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; } .detail dt { color: var(--muted); font-size: .85rem; } .detail dd { margin: 0; text-align: right; font-weight: 600; }
.tx-row { display: flex; gap: 12px; align-items: center; width: 100%; background: var(--card); border: 0; border-radius: 14px; padding: 10px 12px; margin-bottom: 6px; text-align: left; box-shadow: var(--shadow); }
.tx-row.expected { opacity: .7; border: 1.5px dashed var(--line); }
.tx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; } .tx-desc { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .tx-sub { font-size: .75rem; color: var(--muted); }
.tx-amt { font-weight: 800; white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; } .tx-amt.pos { color: var(--primary-d); } .tx-amt small { font-weight: 500; font-size: .68rem; color: var(--muted); }
.day-head::first-letter { text-transform: uppercase; }
.day-head { font-size: .78rem; color: var(--muted); margin: 14px 4px 6px; font-weight: 700; }
.list-sum { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); margin: 4px 4px 0; flex-wrap: wrap; gap: 4px; }
.search-row { display: flex; gap: 6px; margin: 8px 0 4px; } .search-row input { flex: 1; }
.scope-row { display: flex; justify-content: space-between; align-items: center; margin: 4px 2px 0; }
.soon-list { margin-top: 18px; } .soon-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--muted); } .soon-row:last-child { border: 0; }
.inv-row { display: flex; justify-content: space-between; width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 10px 0; text-align: left; align-items: center; } .inv-row span { display: flex; flex-direction: column; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.cat-edit { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); } .cat-edit.sub { padding-left: 28px; } .cat-edit.archived { opacity: .55; }
.cat-edit-main { flex: 1; background: none; border: 0; text-align: left; display: flex; flex-direction: column; }
.reorder { display: flex; }
.icon-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; } .ico-opt { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 6px 0; font-size: 1.2rem; } .ico-opt.on { border-color: var(--primary); background: #eefaf4; }
.color-grid { display: flex; flex-wrap: wrap; gap: 10px; } .col-opt { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--line); display: inline-block; } .col-opt.on { box-shadow: 0 0 0 3px var(--text); }
.cycle-row { display: block; width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 10px 0; text-align: left; } .cycle-row:last-child { border: 0; }
.menu .row-btn { margin-top: 8px; }

/* assistente inicial */
.onboarding { padding-top: calc(16px + env(safe-area-inset-top)); }
.dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 14px; } .dots span { width: 26px; height: 5px; border-radius: 5px; background: #d8e6e0; } .dots span.on { background: var(--primary); } .dots span.done { background: #8bd2b4; }
.welcome { text-align: center; padding-top: 6vh; } .logo-big { font-size: 4rem; } .welcome h1 { font-size: 1.9rem; margin: 6px 0 10px; }
.ob-cat { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); } .ob-cat.off { opacity: .5; }
.plan { text-align: left; padding-left: 20px; color: var(--text); font-size: .92rem; } .plan li { margin: 6px 0; }
.card.soon { text-align: center; } .soon-ico { font-size: 3rem; }

/* ajustes da Etapa 1 (v0.1.1) */
.btn.mini-btn { padding: 6px 10px; font-size: .78rem; border-radius: 99px; flex: none; background: #e1f5ec; color: var(--primary-d); }
.btn.full { width: 100%; margin-top: 8px; }
.sub-label { margin-top: 10px; }
.more-link { display: block; margin: 4px auto 12px; }
.sub-row { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; } .sub-row:last-of-type { border: 0; }
.sub-row:not(:has(.sub-line)) { flex-direction: row; justify-content: space-between; }
.sub-line { display: flex; justify-content: space-between; gap: 8px; }
.badge.nec-essential { background: #dff4ea; color: var(--primary-d); } .badge.nec-nonessential { background: #ffe9d4; color: #b25a0a; }
.stack { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: #e6efeb; margin: 10px 0; }
.stack .nec-essential, .dot.nec-essential { background: var(--primary); } .stack .nec-nonessential, .dot.nec-nonessential { background: var(--p90); } .stack .nec-none, .dot.nec-none { background: #b6c4bf; }
.nec-row { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 12px 0; text-align: left; }
.nec-name { flex: 1; } .nec-row .pct { width: 34px; text-align: right; }
.kv-btn { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; }

/* v0.1.2: percentuais e gráfico por categoria */
.hero-pct-box { text-align: right; line-height: 1; } .hero-pct-box .hero-pct { font-size: 2.6rem; font-weight: 800; color: inherit; letter-spacing: -1px; }
.hero-pct-box .hero-pct-cap { font-size: .72rem; color: var(--muted); margin-top: 4px; }
.lv-text-ok { color: var(--primary); } .hero-pct-box.lv-text-ok .hero-pct { color: var(--primary); }
.cat-pcts { margin-top: 3px; gap: 6px; flex-wrap: wrap; align-items: center; }
.pill-share { background: #e8f1fd; color: #1f5fb8; border-radius: 99px; padding: 1px 8px; white-space: nowrap; } .pill-share strong { font-weight: 800; }
.meta-pct strong { font-weight: 800; } .lv-text-none { color: var(--muted); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.stat { background: #f3f8f6; border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.stat strong { font-size: 1.6rem; line-height: 1.1; } .stat span { font-size: .78rem; font-weight: 600; color: var(--text); } .stat small { font-size: .7rem; color: var(--muted); }
.stat.share { background: #e8f1fd; } .stat.share strong { color: #1f5fb8; }
.bar.thin { height: 6px; margin: 2px 0; }
.hbars { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; }
.hbar { width: 100%; background: none; border: 0; padding: 8px 0 6px; text-align: left; display: block; }
.hbar-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; font-size: .9rem; margin-bottom: 5px; }
.hbar-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .hbar-val { white-space: nowrap; }
.hbar-track { display: block; height: 12px; background: #eaf1ee; border-radius: 0 6px 6px 0; }
.hbar-fill { display: block; height: 100%; border-radius: 0 6px 6px 0; }
.hbar-detail { padding: 4px 0 8px 12px; border-left: 3px solid var(--line); margin: 0 0 6px 4px; }
.hbar-item + .hbar-item { border-top: 1px solid var(--line); }
.sub-line > span:first-child { flex: 1; min-width: 0; } .sub-line strong { text-align: right; font-size: .88rem; }

/* v0.1.3: compras parceladas */
.inst-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; align-items: start; }
.inst-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.inst-line { display: grid; grid-template-columns: 38px minmax(110px, 1fr); gap: 2px 8px; align-items: center; padding: 6px 8px; background: #f3f8f6; border-radius: 12px; }
.inst-line .inst-due { grid-column: 2; }
.inst-line .money-wrap { padding: 4px 8px; } .inst-line .money-wrap input { width: 100%; min-width: 0; font-size: 1rem; }
.inst-no { font-weight: 800; color: var(--primary); font-size: .85rem; } .inst-amt { font-size: 1rem; }
.inst-sum { border-radius: 12px; padding: 8px 10px; font-size: .85rem; background: #f3f8f6; margin: 6px 0; }
.inst-sum.ok { background: #e6f6ee; color: #14633f; } .inst-sum.bad { background: #fdecec; color: #8f1d1d; }
.btn.small { padding: 6px 10px; font-size: .8rem; min-height: 0; }
.inst-table { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 12px; }
.inst-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 8px; align-items: center; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; width: 100%; }
.inst-row .inst-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.inst-row.st-canceled { opacity: .6; } .inst-row.st-future { border-style: dashed; background: #f7fbff; }
.badge.st-future { background: #e8f1fd; color: #1f5fb8; } .badge.st-billed { background: #eef0ef; color: #4a5a55; }
.badge.st-canceled, .badge.st-refunded { background: #fdecec; color: #8f1d1d; } .badge.st-partial, .badge.st-anticipated { background: #fff4d6; color: #7a5800; }
.inst-card.future { border: 1.5px dashed #9ec2f0; background: #f7fbff; }
.inst-items { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.inst-item { display: flex; justify-content: space-between; gap: 8px; text-align: left; border-radius: 12px; padding: 8px 10px; width: 100%; background: #f7fbff; border: 1px dashed #9ec2f0; }
.inst-item.done { background: #f3f5f4; border: 1px solid var(--line); }
.inst-item .inst-main { display: flex; flex-direction: column; min-width: 0; } .inst-val { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; }
.commit { color: #1f5fb8; } .up-title { margin: 12px 0 2px; }
.row-link { width: 100%; background: none; border: 0; text-align: left; } .kv.total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 6px; }
.hist { list-style: none; padding: 0; margin: 6px 0; display: flex; flex-direction: column; gap: 6px; font-size: .85rem; }
.check-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }

.act-grid .btn { flex: 1 1 44%; white-space: normal; text-align: center; }

/* v0.1.4: faturas, despesas fixas */
.inv-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.badge.inv-open { background: #e8f1fd; color: #1f5fb8; } .badge.inv-partial { background: #fff4d6; color: #7a5800; } .badge.inv-paid { background: #e6f6ee; color: #14633f; } .badge.inv-empty { background: #eef0ef; color: #4a5a55; }
.stat-grid.three { grid-template-columns: repeat(3, 1fr); } .stat-grid.three .stat strong { font-size: 1.05rem; } .stat.warnbox { background: #fff4d6; }
.pay-line, .inv-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 10px 0; text-align: left; }
.inv-item span { display: flex; flex-direction: column; min-width: 0; }
.inv-amt { display: flex; flex-direction: column; align-items: flex-end; }
.occ-row { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 10px 0; text-align: left; }
.occ-row .tx-amt { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.occ-row.oc-planned, .occ-row.oc-late { background: #f7fbff; } .occ-row.oc-canceled { opacity: .6; }
.badge.fx-planned { background: #e8f1fd; color: #1f5fb8; } .badge.fx-late { background: #fff4d6; color: #7a5800; } .badge.fx-confirmed { background: #e6f6ee; color: #14633f; } .badge.fx-canceled { background: #fdecec; color: #8f1d1d; }
.fixed-card { border: 1.5px dashed #9ec2f0; background: #f7fbff; }
.occ-link { background: #f7fbff; border: 1px dashed #9ec2f0; border-radius: 12px; padding: 8px 10px; }

/* v0.1.5: resumo do orçamento, barra de cor única, extras e ajustes */
.hero .big { font-size: 2.2rem; line-height: 1.1; margin: 2px 0 4px; }
.adj-line { font-size: .92rem; color: var(--muted, #52625c); margin-bottom: 10px; }
.adj-line strong { white-space: nowrap; font-size: 1.05rem; color: inherit; }
.spend-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 8px 0 6px; }
.spend-pct { font-size: 1.15rem; } .spend-pct .muted-weight { font-size: .75rem; font-weight: 500; color: var(--muted, #52625c); }
.spend-bar { height: 14px; }
.bar-fill.spend-green { background: #2e9e63; } .bar-fill.spend-yellow { background: #e3b923; } .bar-fill.spend-orange { background: #f08a24; } .bar-fill.spend-red { background: #d43d3d; }
.spend-pct.sp-green { color: #1d7a49; } .spend-pct.sp-yellow { color: #8a6d00; } .spend-pct.sp-orange { color: #b25b05; } .spend-pct.sp-red { color: #b32626; }
.hero-rows { margin-top: 12px; border-top: 1px solid var(--line); }
.hrow { display: grid; grid-template-columns: 1fr auto 62px; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.hrow > span:first-child { color: var(--muted, #52625c); } .hrow .link { text-align: right; }
.badge.aj-active { background: #e6f6ee; color: #14633f; } .badge.aj-scheduled, .badge.aj-postponed { background: #e8f1fd; color: #1f5fb8; } .badge.aj-paused { background: #fff4d6; color: #7a5800; } .badge.aj-disabled { background: #eef0ef; color: #4a5a55; } .badge.aj-done { background: #eef0ef; color: #4a5a55; }
.hist-line { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }

/* v0.1.6: orçamentos específicos */
.sp-link { margin: 4px 0 10px; }
.sp-card { display: block; width: 100%; text-align: left; margin-bottom: 10px; }
.sp-top, .sp-nums, .sp-foot, .sp-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sp-nums { margin: 6px 0; } .sp-foot { margin-top: 6px; }
.badge.sp-active { background: #e6f6ee; color: #14633f; } .badge.sp-closed { background: #fff4d6; color: #7a5800; } .badge.sp-arch { background: #eef0ef; color: #4a5a55; }
.sp-item { border-bottom: 1px solid var(--line); padding: 8px 0; }
.sp-item-main { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; width: 100%; background: none; border: 0; padding: 0; text-align: left; }
.sp-amt { display: flex; flex-direction: column; align-items: flex-end; }
.sp-parcels { margin: 6px 0 2px; padding: 6px 8px; background: #f7fbff; border-radius: 10px; }
.sp-parcels > div { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ---- Etapa 2C: responsabilidade, pessoas e acertos ---- */
.segmented.wrap4 { flex-wrap: wrap; } .segmented.wrap4 .seg { flex: 1 1 45%; }
.share-rows { display: grid; gap: 8px; margin: 8px 0; } .share-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; }
.inline-add { display: flex; gap: 8px; align-items: center; margin: 8px 0; } .inline-add input { flex: 1; }
.resp-box { border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin: 12px 0; background: #f7fbf9; }
.resp-box h4 { margin: 0 0 6px; } .resp-line { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 6px 0; border-bottom: 1px solid var(--line); } .resp-line .tiny { grid-column: 1 / -1; }
.st-list { display: grid; gap: 8px; margin: 8px 0; } .st-item { display: grid; grid-template-columns: 1fr minmax(120px, 150px); gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 12px; }
.st-item .st-info { display: grid; } .st-group { grid-template-columns: 1fr; } .st-sub { display: grid; grid-template-columns: 1fr minmax(120px, 150px); gap: 8px; align-items: center; padding: 4px 0; }
.check { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; }
.hrow.sub { opacity: .85; font-size: .92em; } .kv.sub { padding-left: 12px; opacity: .85; }
.card-head { display: flex; justify-content: space-between; align-items: center; }

/* Telas muito estreitas (≈320 px): nada pode passar da largura da tela */
@media (max-width: 359px) {
  .cat-line { flex-wrap: wrap; row-gap: 0; }
  .cat-val { white-space: normal; text-align: right; margin-left: auto; }
  .cat-val .muted { display: inline-block; white-space: nowrap; }
  .cat-name { min-width: 0; overflow-wrap: anywhere; }
  .cat-row { gap: 8px; }
  .cat-edit { gap: 6px; } .cat-edit.sub { padding-left: 14px; }
  .cat-edit-main { min-width: 0; overflow-wrap: anywhere; }
}
