:root {
  color-scheme: light;
  --ink: #151718;
  --muted: #70757a;
  --line: rgba(20, 23, 24, .09);
  --surface: rgba(255, 255, 255, .88);
  --background: #f5f5f7;
  --green: #1f8068;
  --green-dark: #145e4e;
  --green-soft: #dff3eb;
  --blue: #3977d5;
  --orange: #d88728;
  --red: #c9504f;
  --purple: #7158c7;
  --shadow: 0 18px 60px rgba(24, 30, 28, .08);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --max-width: 1260px;
}

* { box-sizing: border-box; }
html { background: var(--background); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 78% 0%, rgba(216, 235, 230, .7), transparent 28rem), var(--background); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, sans-serif; font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }

.topbar { position: sticky; top: 0; z-index: 30; height: 74px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 max(28px, calc((100vw - var(--max-width)) / 2)); border-bottom: 1px solid rgba(20, 23, 24, .05); background: rgba(245, 245, 247, .78); backdrop-filter: saturate(180%) blur(22px); }
.brand { display: inline-flex; align-items: center; gap: 11px; justify-self: start; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center; background: linear-gradient(145deg, #247966, #103e36); color: white; font-weight: 760; box-shadow: inset 0 1px rgba(255,255,255,.25), 0 5px 14px rgba(20,83,69,.2); }
.brand-mark.large { width: 50px; height: 50px; border-radius: 15px; font-size: 23px; }
.brand > span:last-child { display: flex; flex-direction: column; line-height: 1.05; font-size: 14px; }
.brand small { color: var(--muted); margin-top: 3px; font-size: 11px; letter-spacing: .02em; }
.desktop-nav { display: flex; gap: 6px; padding: 5px; border-radius: 14px; background: rgba(255,255,255,.48); }
.desktop-nav a { padding: 8px 15px; border-radius: 10px; color: #666c6a; font-size: 14px; font-weight: 620; }
.desktop-nav a:hover, .desktop-nav a.active { color: var(--ink); background: white; box-shadow: 0 2px 12px rgba(20,30,27,.07); }
.profile-pill { justify-self: end; display: flex; align-items: center; gap: 9px; padding: 5px 6px 5px 5px; border: 1px solid var(--line); background: rgba(255,255,255,.65); border-radius: 99px; }
.profile-link { display: flex; align-items: center; gap: 9px; border-radius: 99px; }
.profile-link:focus-visible { outline: 3px solid rgba(31,128,104,.22); outline-offset: 2px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: #e1e7e5; display: grid; place-items: center; color: #40514c; font-size: 12px; font-weight: 750; }
.profile-copy { font-size: 13px; font-weight: 650; }
.profile-pill form { display: contents; }
.logout-button { width: 28px; height: 28px; border: 0; background: transparent; color: var(--muted); }

.page-shell { width: min(var(--max-width), calc(100% - 56px)); margin: 0 auto; padding: 44px 0 110px; }
.dashboard-header { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 28px; }
.dashboard-header h1, .form-header h1 { margin: 2px 0 5px; font-size: clamp(34px, 4.1vw, 54px); line-height: 1.06; letter-spacing: -.045em; font-weight: 680; }
.eyebrow { margin: 0 0 7px; color: var(--green); font-size: 11px; letter-spacing: .14em; font-weight: 760; }
.lede, .form-header > p:last-child { margin: 0; color: var(--muted); font-size: 16px; }
.period-picker label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.period-picker select { min-width: 170px; padding: 11px 36px 11px 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.8); color: var(--ink); font-weight: 620; letter-spacing: 0; text-transform: none; }

.scope-switch { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 18px; border-radius: 13px; background: #e8e9ea; }
.scope-switch a { min-width: 96px; padding: 8px 15px; border-radius: 10px; text-align: center; color: #6b7073; font-size: 13px; font-weight: 650; }
.scope-switch a.active { color: var(--ink); background: white; box-shadow: 0 2px 9px rgba(25, 30, 28, .08); }

.hero-card { overflow: hidden; position: relative; min-height: 410px; padding: 31px 36px 0; border-radius: 34px; background: linear-gradient(145deg, #194f45 0%, #153c36 55%, #102f2b 100%); color: white; box-shadow: 0 24px 70px rgba(21, 67, 58, .22); }
.hero-card::after { content: ""; position: absolute; right: -80px; top: -160px; width: 460px; height: 460px; border-radius: 50%; background: radial-gradient(circle, rgba(158, 225, 202, .24), transparent 66%); pointer-events: none; }
.hero-card.risk-watch { background: linear-gradient(145deg, #6b4b1d, #493516); }
.hero-card.risk-danger { background: linear-gradient(145deg, #6a3030, #3d2424); }
.hero-topline { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; color: rgba(255,255,255,.68); font-size: 13px; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; border: 1px solid rgba(255,255,255,.17); border-radius: 99px; color: white; background: rgba(255,255,255,.08); font-weight: 650; }
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: #84e1bd; box-shadow: 0 0 0 4px rgba(132,225,189,.12); }
.risk-watch .status-pill i { background: #ffbd64; }
.risk-danger .status-pill i { background: #ff8c8a; }
.hero-copy { position: relative; z-index: 1; margin-top: 55px; }
.hero-copy p { margin: 0 0 2px; color: rgba(255,255,255,.7); font-size: 18px; }
.hero-copy h2 { margin: 0; font-size: clamp(68px, 10vw, 120px); line-height: 1; letter-spacing: -.07em; font-weight: 600; font-variant-numeric: tabular-nums; }
.hero-copy > span { display: block; margin-top: 12px; color: rgba(255,255,255,.58); }
.hero-meter { position: relative; z-index: 1; height: 4px; margin-top: 32px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; }
.hero-meter span { display: block; height: 100%; border-radius: inherit; background: #87d8bb; }
.hero-footer { position: absolute; z-index: 1; inset: auto 0 0; height: 84px; display: grid; grid-template-columns: repeat(3,1fr); background: rgba(255,255,255,.075); border-top: 1px solid rgba(255,255,255,.09); backdrop-filter: blur(10px); }
.hero-footer div { display: flex; flex-direction: column; justify-content: center; padding-left: 36px; border-right: 1px solid rgba(255,255,255,.08); }
.hero-footer small { color: rgba(255,255,255,.48); font-size: 9px; letter-spacing: .13em; font-weight: 750; }
.hero-footer strong { margin-top: 3px; font-size: 16px; }

.metric-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin: 15px 0 42px; }
.metric-card { min-height: 148px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: 0 4px 18px rgba(20,24,22,.025); }
.metric-card.accent { background: #e9f2ef; }
.metric-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: #e7eeec; color: var(--green); font-weight: 750; }
.metric-icon.income { background: #e2f2ea; color: #17805f; }
.metric-icon.reserved { background: #fff1dd; color: #bd7319; }
.metric-icon.spend { background: #f4e6e5; color: #b44b4b; }
.metric-icon.forecast { background: #dce9e6; color: #285f53; }
.metric-card p { margin: 14px 0 2px; color: var(--muted); font-size: 13px; }
.metric-card h3 { margin: 0; font-size: 25px; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.metric-card small { color: #909597; font-size: 11px; }

.capture-banner { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-bottom: 42px; padding: 27px 30px; border: 1px solid rgba(96,73,166,.12); border-radius: var(--radius-lg); background: linear-gradient(110deg, #f0ecfb, #f8f7fc); }
.capture-banner > div:first-child { display: flex; align-items: center; gap: 20px; }
.sparkle { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 19px; background: linear-gradient(145deg, #7964c8, #5744a7); color: white; font-size: 26px; box-shadow: 0 13px 30px rgba(85,64,163,.2); }
.capture-banner h2 { margin: 0 0 3px; font-size: 23px; letter-spacing: -.025em; }
.capture-banner p:not(.eyebrow) { margin: 0; color: var(--muted); }

.two-column { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; margin-bottom: 42px; }
.two-column.lower { grid-template-columns: 1.15fr .85fr; }
.panel { padding: 26px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 6px 30px rgba(20,24,22,.035); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-size: 23px; letter-spacing: -.035em; }
.section-heading > a { color: var(--green); font-size: 13px; font-weight: 680; }
.section-heading > span { color: var(--muted); font-size: 12px; }
.timeline-list { display: grid; }
.timeline-item { display: grid; grid-template-columns: 43px 1fr auto; gap: 13px; align-items: center; min-height: 68px; padding: 11px 0; border-top: 1px solid var(--line); }
.timeline-item:first-child { border-top: 0; }
.date-badge { width: 40px; height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 12px; background: #eef1f0; line-height: 1; }
.date-badge strong { font-size: 16px; }
.date-badge span { margin-top: 3px; color: var(--muted); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.timeline-copy, .activity-copy { min-width: 0; display: flex; flex-direction: column; }
.timeline-copy strong, .activity-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.timeline-copy span, .activity-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11px; }
.timeline-amount { display: flex; flex-direction: column; align-items: end; font-weight: 700; font-variant-numeric: tabular-nums; }
.timeline-amount small { color: var(--orange); font-size: 9px; text-transform: uppercase; }
.income-summary { padding: 18px; margin-bottom: 13px; border-radius: 17px; background: #edf5f2; }
.income-summary span { color: var(--muted); font-size: 12px; }
.income-summary strong { display: block; margin-top: 3px; font-size: 28px; letter-spacing: -.04em; }
.income-line { height: 4px; margin-top: 13px; border-radius: 99px; background: #d5e3df; overflow: hidden; }
.income-line i { display: block; height: 100%; background: var(--green); }
.compact-row { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); }
.compact-row > span:first-child { display: flex; flex-direction: column; }
.compact-row strong { font-size: 14px; }
.compact-row small { color: var(--muted); font-size: 11px; }
.muted-copy { color: var(--muted); font-size: 14px; }

.warning-panel { margin-bottom: 42px; border-color: rgba(216,135,40,.22); background: #fffaf2; }
.reconciliation-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 15px 0; border-top: 1px solid rgba(216,135,40,.14); }
.reconciliation-row > div:first-child { display: flex; flex-direction: column; }
.reconciliation-row span { color: var(--muted); font-size: 12px; }
.gap-value { display: flex; flex-direction: column; align-items: end; }
.gap-value small { color: var(--orange); font-size: 9px; font-weight: 750; letter-spacing: .08em; }
.gap-value strong { font-size: 19px; }

.section-block { margin-bottom: 42px; }
.category-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.category-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.category-top { display: flex; justify-content: space-between; align-items: center; }
.category-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--category-color) 15%, white); color: var(--category-color); font-weight: 750; }
.category-icon.small { width: 30px; height: 30px; border-radius: 9px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.risk-comfortable .status-dot { background: #6ba88e; }
.risk-watch .status-dot { background: var(--orange); box-shadow: 0 0 0 4px #faead7; }
.risk-danger .status-dot { background: var(--red); box-shadow: 0 0 0 4px #f5e0df; }
.category-card h3 { margin: 17px 0 11px; font-size: 15px; }
.category-numbers { display: flex; align-items: baseline; gap: 6px; }
.category-numbers strong { font-size: 22px; letter-spacing: -.04em; }
.category-numbers span { color: var(--muted); font-size: 11px; }
.category-meter { height: 5px; margin: 14px 0 10px; border-radius: 99px; overflow: hidden; background: #e8ebe9; }
.category-meter span { display: block; height: 100%; background: var(--green); border-radius: inherit; }
.risk-watch .category-meter span { background: var(--orange); }
.risk-danger .category-meter span { background: var(--red); }
.category-detail { display: flex; justify-content: space-between; color: var(--muted); font-size: 9px; }

.trend-panel { margin-bottom: 18px; }
.chart-legend { display: flex; gap: 14px; color: var(--muted); font-size: 11px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 7px; height: 7px; border-radius: 50%; background: #1f8068; }
.chart-legend i.member-2 { background: #9b83d2; }
.bar-chart { height: 230px; display: grid; grid-template-columns: repeat(6,1fr); gap: 18px; align-items: end; padding: 25px 8px 0; border-top: 1px solid var(--line); background-image: linear-gradient(to bottom, transparent 24%, rgba(20,23,24,.045) 25%, transparent 26%, transparent 49%, rgba(20,23,24,.045) 50%, transparent 51%, transparent 74%, rgba(20,23,24,.045) 75%, transparent 76%); }
.bar-group { height: 100%; display: grid; grid-template-rows: 1fr 22px; align-items: end; text-align: center; }
.bars { height: 100%; display: flex; gap: 5px; align-items: end; justify-content: center; }
.bar { position: relative; width: min(28px, 38%); min-height: 3px; border-radius: 7px 7px 3px 3px; background: linear-gradient(#3b9a81,#1f6f5f); }
.bar.member-2 { background: linear-gradient(#ac94dc,#7860b5); }
.bar em { position: absolute; left: 50%; top: -18px; transform: translateX(-50%); color: var(--muted); font-size: 8px; font-style: normal; opacity: 0; transition: opacity .15s; }
.bar:hover em { opacity: 1; }
.bar-group > strong { align-self: end; color: var(--muted); font-size: 10px; font-weight: 620; text-transform: uppercase; }

.activity-list { display: grid; }
.activity-row, .ledger-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; min-height: 63px; border-top: 1px solid var(--line); }
.activity-row:first-child { border-top: 0; }
.activity-row:hover, .ledger-row:hover { background: rgba(237,242,240,.45); }
.activity-glyph { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: #ecefed; color: #5b6863; font-size: 12px; font-weight: 750; text-transform: uppercase; }
.activity-glyph.income, .activity-glyph.refund { background: #e3f2ec; color: #157459; }
.activity-glyph.saving { background: #eeeafa; color: #644eb2; }
.activity-glyph.card_settlement, .activity-glyph.transfer { background: #edf0f5; color: #60708b; }
.activity-amount { font-size: 14px; font-variant-numeric: tabular-nums; }
.activity-amount.positive { color: var(--green); }
.capture-row { color: inherit; }
.capture-row > span:last-child { color: var(--green); font-size: 12px; font-weight: 680; }
.empty-state { min-height: 130px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); text-align: center; }
.empty-state > span { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 12px; background: #edf0ef; color: var(--green); }
.empty-state p { max-width: 300px; margin: 10px auto; font-size: 13px; }
.empty-state.large { min-height: 260px; grid-column: 1/-1; }

.primary-button, .secondary-button, .soft-button, .small-button, .upload-button { min-height: 43px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 17px; border: 0; border-radius: 13px; font-weight: 680; font-size: 13px; transition: transform .15s, box-shadow .15s; }
.primary-button { background: var(--green-dark); color: white; box-shadow: 0 7px 18px rgba(20,94,78,.16); }
.primary-button:hover, .secondary-button:hover { transform: translateY(-1px); }
.secondary-button { border: 1px solid var(--line); background: white; color: var(--ink); }
.soft-button { background: #edf1ef; color: #335c52; }
.small-button { min-height: 32px; padding: 0 12px; border-radius: 10px; background: var(--green-dark); color: white; font-size: 11px; }
.small-button.ghost { background: #edf0ef; color: var(--muted); }
.button-row { display: flex; gap: 9px; align-items: center; }
.full { width: 100%; }

.narrow-page { width: min(670px, 100%); margin: 0 auto; }
.back-link { display: inline-block; margin-bottom: 27px; color: var(--muted); font-size: 13px; font-weight: 620; }
.form-header { margin-bottom: 25px; }
.form-card { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.stacked-form { display: grid; gap: 18px; }
.stacked-form label { display: grid; gap: 7px; color: #5f6567; font-size: 12px; font-weight: 650; }
.field-control, .login-form input { width: 100%; min-height: 48px; padding: 10px 13px; border: 1px solid #dfe2e1; border-radius: 13px; outline: none; background: rgba(250,251,250,.85); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.field-control:focus, .login-form input:focus { border-color: #7fb3a6; box-shadow: 0 0 0 4px rgba(31,128,104,.10); }
textarea.field-control { resize: vertical; }
.amount-field { display: flex; align-items: center; gap: 10px; padding: 7px 17px; border-radius: 18px; background: #edf3f1; color: var(--green-dark); }
.amount-field span { font-size: 30px; font-weight: 500; }
.amount-field .field-control { min-height: 70px; padding: 0; border: 0; background: transparent; box-shadow: none; color: var(--green-dark); font-size: 46px; font-weight: 600; letter-spacing: -.045em; }
.form-grid.two { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; }
.form-details { padding: 12px 14px; border-radius: 13px; background: #f2f4f3; }
.form-details summary { color: #5e6663; font-size: 12px; font-weight: 680; cursor: pointer; }
.form-details label, .form-details textarea { margin-top: 10px; }
.check-row { grid-template-columns: auto 1fr !important; align-items: center; padding: 14px; border-radius: 14px; background: #f2f4f3; }
.check-row input { width: 19px; height: 19px; accent-color: var(--green); }
.check-row span { display: flex; flex-direction: column; }
.check-row small { color: var(--muted); font-weight: 450; }
.errorlist, .form-error { margin: 4px 0 0; padding: 9px 12px; border-radius: 10px; background: #f7e8e7; color: #9e3e3d; list-style: none; font-size: 12px; }
.danger-zone { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); text-align: center; }
.text-danger { border: 0; background: transparent; color: var(--red); font-size: 13px; }

.list-page { width: 100%; }
.filter-bar { display: grid; grid-template-columns: 190px 190px 1fr auto; gap: 10px; margin: 0 0 16px; }
.filter-bar input, .filter-bar select { min-height: 43px; padding: 0 13px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.8); outline: none; }
.ledger-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.ledger-row { grid-template-columns: 42px minmax(150px,1fr) 170px 110px; min-height: 72px; padding: 0 22px; }
.ledger-category { color: var(--muted); font-size: 12px; }

.plan-summary { display: grid; grid-template-columns: repeat(3,1fr); margin-bottom: 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); }
.plan-summary div { padding: 20px 24px; border-right: 1px solid var(--line); }
.plan-summary div:last-child { border: 0; }
.plan-summary small { display: block; color: var(--muted); font-size: 9px; letter-spacing: .1em; font-weight: 750; }
.plan-summary strong { font-size: 23px; }
.plan-panel { margin-bottom: 18px; }
.timeline-list.detailed .timeline-item { grid-template-columns: 43px 1fr auto auto; }
.state-expected { color: var(--orange) !important; }
.state-confirmed { color: var(--green) !important; }
.state-skipped { color: var(--muted) !important; }
.row-actions { display: flex; gap: 6px; }
.template-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.template-card { padding: 17px; border: 1px solid var(--line); border-radius: 17px; background: #fafbfa; }
.template-card > div { display: flex; align-items: center; justify-content: space-between; }
.template-state { padding: 4px 7px; border-radius: 99px; background: #eee; color: var(--muted); font-size: 8px; text-transform: uppercase; }
.template-state.on { background: var(--green-soft); color: var(--green-dark); }
.template-card h3 { margin: 14px 0 2px; font-size: 14px; }
.template-card p { margin: 0 0 12px; color: var(--muted); font-size: 10px; }
.template-card > strong { font-size: 17px; }
.template-card > strong small { color: var(--muted); font-size: 9px; font-weight: 500; }

.capture-page { width: min(1050px,100%); margin: 0 auto; }
.capture-layout { display: grid; grid-template-columns: repeat(2,1fr); gap: 18px; margin-bottom: 18px; }
.capture-card { min-height: 390px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 35px; border: 1px solid var(--line); border-radius: 31px; background: var(--surface); text-align: center; box-shadow: var(--shadow); }
.capture-orb { width: 66px; height: 66px; display: grid; place-items: center; border-radius: 22px; background: linear-gradient(145deg, #7760c3, #54419f); color: white; font-size: 29px; box-shadow: 0 15px 30px rgba(82,63,158,.18); }
.capture-orb.voice { background: linear-gradient(145deg, #2b7b69, #125246); }
.capture-card h2 { margin: 23px 0 5px; font-size: 24px; letter-spacing: -.035em; }
.capture-card p { max-width: 350px; margin: 0 0 24px; color: var(--muted); font-size: 14px; }
.capture-card input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-button { width: 100%; min-height: 56px; margin-bottom: 10px; border: 1px dashed #c5cbc8; background: #f7f8f7; color: #42504c; }
.record-button { width: 100%; min-height: 58px; display: flex; justify-content: center; align-items: center; gap: 11px; border: 0; border-radius: 16px; background: #153f37; color: white; font-weight: 680; }
.record-button i { width: 13px; height: 13px; border-radius: 50%; background: #ff716e; box-shadow: 0 0 0 5px rgba(255,113,110,.12); }
.record-button.recording i { border-radius: 3px; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.record-status { margin: 13px 0 3px; color: var(--green); font-size: 12px; }
.capture-card .microcopy { margin: 0; font-size: 10px; }
.capture-inbox { margin-top: 18px; }
.draft-preview { margin-bottom: 16px; padding: 18px; border-radius: var(--radius-md); background: #eeedf7; }
.draft-preview > a { display: inline-flex; gap: 9px; align-items: center; color: #5d4ba0; font-size: 13px; font-weight: 680; }
.draft-preview blockquote { margin: 16px 0 0; color: #53505d; font-size: 14px; }
.inline-alert { display: flex; flex-direction: column; margin-bottom: 16px; padding: 15px 17px; border: 1px solid #edd9ac; border-radius: 15px; background: #fff7e7; }
.inline-alert span { color: var(--muted); font-size: 12px; }

.settings-page { width: 100%; }
.settings-header { align-items: center; }
.settings-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.settings-card { align-self: start; box-shadow: 0 12px 40px rgba(24,30,28,.055); }
.settings-wide { grid-column: 1/-1; }
.settings-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.settings-card-heading h2 { margin: 0; font-size: 23px; letter-spacing: -.035em; }
.settings-card-heading .eyebrow { margin-bottom: 3px; }
.settings-copy { margin: -7px 0 0; color: var(--muted); font-size: 12px; }
.role-badge, .settings-total { padding: 6px 10px; border-radius: 99px; background: var(--green-soft); color: var(--green-dark); font-size: 10px; font-weight: 720; }
.settings-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: #e9efed; color: var(--green-dark); font-size: 18px; }
.member-settings-list, .account-settings-list { display: grid; gap: 10px; }
.member-settings-row { display: grid; grid-template-columns: minmax(180px,.8fr) minmax(180px,1fr) 160px; gap: 14px; align-items: end; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fafbfa; }
.member-identity { align-self: center; display: flex; align-items: center; gap: 11px; }
.large-avatar { width: 40px; height: 40px; }
.member-identity > span:last-child { display: flex; flex-direction: column; }
.member-identity small { color: var(--muted); font-size: 10px; }
.percent-field { display: flex; align-items: center; gap: 8px; }
.percent-field span { color: var(--muted); font-size: 14px; }
.account-settings-row { display: grid; grid-template-columns: minmax(180px,1.3fr) minmax(150px,.9fr) minmax(160px,1fr) 110px 150px; gap: 12px; align-items: end; padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: #fafbfa; }
.account-settings-row.account-new { border-style: dashed; background: #f3f7f5; }
.account-settings-row label, .member-settings-row label { display: grid; gap: 6px; color: #5f6567; font-size: 11px; font-weight: 650; }
.compact-check { min-height: 48px; padding: 8px 10px; }
.compact-check small { font-size: 9px; }
.household-summary dl { display: grid; gap: 8px; margin: 0; }
.household-summary dl div { display: flex; justify-content: space-between; gap: 20px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.household-summary dt { color: var(--muted); font-size: 12px; }
.household-summary dd { margin: 0; font-weight: 680; }

.quick-fab { position: fixed; z-index: 45; right: max(28px, calc((100vw - var(--max-width)) / 2)); bottom: 28px; width: 56px; height: 56px; display: grid; place-items: center; border: 0; border-radius: 19px; background: #153f37; color: white; font-size: 32px; font-weight: 300; box-shadow: 0 14px 35px rgba(19,65,55,.3); }
.action-sheet { width: min(510px, calc(100% - 28px)); padding: 12px 20px 22px; border: 0; border-radius: 27px; background: rgba(250,250,250,.96); box-shadow: 0 25px 80px rgba(0,0,0,.22); backdrop-filter: blur(20px); }
.action-sheet::backdrop { background: rgba(18,22,21,.28); backdrop-filter: blur(4px); }
.sheet-handle { width: 38px; height: 4px; margin: 0 auto 17px; border-radius: 99px; background: #d0d2d1; }
.sheet-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sheet-heading small { color: var(--green); font-size: 9px; letter-spacing: .12em; font-weight: 750; }
.sheet-heading h2 { margin: 2px 0 0; font-size: 24px; }
.icon-button { width: 35px; height: 35px; border: 0; border-radius: 50%; background: #e9eae9; color: #6b6f6d; font-size: 22px; }
.action-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; }
.action-tile { min-height: 124px; display: flex; flex-direction: column; padding: 17px; border-radius: 18px; background: white; border: 1px solid var(--line); }
.action-tile > span { width: 32px; height: 32px; display: grid; place-items: center; margin-bottom: auto; border-radius: 10px; background: #e9eeec; color: var(--green); font-size: 19px; }
.action-tile.income > span { background: #e1f1ea; }
.action-tile.transfer > span { background: #e7ecf4; color: #527099; }
.action-tile.capture > span { background: #ece7f8; color: var(--purple); }
.action-tile strong { font-size: 14px; }
.action-tile small { color: var(--muted); font-size: 10px; }
.mobile-nav { display: none; }

.toast-stack { position: fixed; z-index: 80; top: 86px; left: 50%; transform: translateX(-50%); width: min(500px, calc(100% - 30px)); }
.toast { padding: 13px 16px; margin-bottom: 7px; border: 1px solid rgba(28,82,69,.14); border-radius: 14px; background: rgba(239,248,245,.96); color: #255d50; box-shadow: 0 12px 30px rgba(0,0,0,.09); backdrop-filter: blur(15px); font-size: 13px; }
.toast.error { background: #fff0ef; color: #9b3f3e; }

.login-page { min-height: 100vh; background: radial-gradient(circle at 20% 10%, rgba(103,169,151,.27), transparent 32rem), radial-gradient(circle at 92% 85%, rgba(122,101,196,.13), transparent 28rem), #f1f3f2; }
.login-page .page-shell { width: 100%; padding: 0; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr minmax(400px, 520px); gap: 80px; align-items: center; width: min(1100px, calc(100% - 50px)); margin: 0 auto; }
.login-brand { align-self: start; display: flex; align-items: center; gap: 13px; padding-top: 32px; font-weight: 680; }
.login-card { grid-column: 2; grid-row: 1/3; padding: 42px; border: 1px solid rgba(255,255,255,.8); border-radius: 34px; background: rgba(255,255,255,.76); box-shadow: 0 30px 90px rgba(30,48,42,.13); backdrop-filter: blur(25px); }
.login-card h1 { margin: 4px 0 13px; font-size: clamp(43px,5vw,61px); line-height: .98; letter-spacing: -.055em; font-weight: 650; }
.login-card .lede { margin-bottom: 32px; }
.login-form { gap: 14px; }
.privacy-note { margin: 20px 0 0; color: #8a8f8d; text-align: center; font-size: 10px; }

@media (max-width: 980px) {
  .metric-grid, .category-grid, .template-grid { grid-template-columns: repeat(2,1fr); }
  .desktop-nav { display: none; }
  .topbar { grid-template-columns: 1fr auto; }
  .profile-pill { grid-column: 2; }
  .two-column, .two-column.lower { grid-template-columns: 1fr; }
  .quick-fab { bottom: 82px; }
  .mobile-nav { position: fixed; z-index: 40; inset: auto 12px max(10px, env(safe-area-inset-bottom)) 12px; height: 65px; display: grid; grid-template-columns: repeat(5,1fr); align-items: center; border: 1px solid rgba(255,255,255,.72); border-radius: 22px; background: rgba(249,249,249,.9); box-shadow: 0 14px 40px rgba(24,30,28,.16); backdrop-filter: saturate(180%) blur(20px); }
  .account-settings-row { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .compact-check { align-self: stretch; }
  .mobile-nav a { height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; color: #898e8c; font-size: 9px; font-weight: 650; }
  .mobile-nav a span { font-size: 19px; line-height: 1; }
  .mobile-nav a.active { color: var(--green-dark); }
  .nav-spacer { display: block; }
}

@media (max-width: 700px) {
  body { background: #f5f5f7; }
  .topbar { height: 62px; padding: 0 17px; }
  .brand > span:last-child, .profile-copy { display: none; }
  .brand-mark { width: 33px; height: 33px; }
  .page-shell { width: calc(100% - 30px); padding: 27px 0 120px; }
  .dashboard-header { align-items: start; flex-direction: column; gap: 17px; margin-bottom: 21px; }
  .dashboard-header h1, .form-header h1 { font-size: 36px; }
  .period-picker, .period-picker label, .period-picker select { width: 100%; }
  .scope-switch { width: 100%; overflow-x: auto; }
  .scope-switch a { min-width: 96px; flex: 1; }
  .hero-card { min-height: 365px; padding: 24px 21px 0; border-radius: 27px; }
  .hero-topline > span:last-child { display: none; }
  .hero-copy { margin-top: 54px; }
  .hero-copy p { font-size: 15px; }
  .hero-copy h2 { font-size: clamp(58px, 19vw, 82px); }
  .hero-copy > span { max-width: 290px; font-size: 12px; }
  .hero-footer { height: 76px; }
  .hero-footer div { padding-left: 18px; }
  .hero-footer strong { font-size: 13px; }
  .metric-grid { grid-template-columns: repeat(2,1fr); gap: 9px; margin-bottom: 30px; }
  .metric-card { min-height: 140px; padding: 16px; }
  .metric-card h3 { font-size: 21px; }
  .capture-banner { align-items: stretch; flex-direction: column; padding: 22px; margin-bottom: 30px; }
  .capture-banner > div:first-child { align-items: start; }
  .sparkle { width: 45px; height: 45px; flex: 0 0 45px; border-radius: 14px; }
  .capture-banner h2 { font-size: 19px; }
  .capture-banner p:not(.eyebrow) { font-size: 12px; }
  .capture-banner .button-row > * { flex: 1; }
  .panel { padding: 20px; border-radius: 22px; }
  .section-heading h2 { font-size: 20px; }
  .category-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .category-card { padding: 16px; }
  .category-numbers { align-items: start; flex-direction: column; gap: 0; }
  .category-detail { align-items: start; flex-direction: column; gap: 2px; }
  .bar-chart { gap: 8px; height: 210px; padding-left: 0; padding-right: 0; }
  .bar { width: min(20px, 42%); }
  .chart-legend { gap: 9px; }
  .two-column { margin-bottom: 30px; }
  .warning-panel { margin-bottom: 30px; }
  .reconciliation-row { align-items: start; flex-direction: column; }
  .gap-value { align-items: start; }
  .form-card { padding: 20px; border-radius: 23px; }
  .form-grid.two { grid-template-columns: 1fr; }
  .amount-field .field-control { font-size: 40px; }
  .form-card .button-row { flex-direction: column; }
  .form-card .button-row > * { width: 100%; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-wide { grid-column: auto; }
  .member-settings-row, .account-settings-row { grid-template-columns: 1fr; align-items: stretch; }
  .member-identity { margin-bottom: 3px; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .filter-bar input { grid-column: 1/-1; }
  .filter-bar .soft-button { grid-column: 1/-1; }
  .ledger-row { grid-template-columns: 40px minmax(0,1fr) auto; padding: 0 14px; }
  .ledger-category { display: none; }
  .plan-summary div { padding: 15px; }
  .plan-summary strong { font-size: 16px; }
  .timeline-list.detailed .timeline-item { grid-template-columns: 43px 1fr auto; }
  .timeline-list.detailed .row-actions { grid-column: 2/4; justify-content: end; }
  .template-grid { grid-template-columns: 1fr 1fr; }
  .capture-layout { grid-template-columns: 1fr; }
  .capture-card { min-height: 350px; padding: 25px; border-radius: 25px; }
  .quick-fab { left: 50%; right: auto; bottom: calc(25px + env(safe-area-inset-bottom)); width: 50px; height: 50px; border: 4px solid #f7f7f7; border-radius: 18px; transform: translateX(-50%); font-size: 26px; }
  .login-shell { display: flex; flex-direction: column; justify-content: center; gap: 20px; width: calc(100% - 30px); padding: 30px 0; }
  .login-brand { align-self: center; padding: 0; }
  .login-card { width: 100%; padding: 28px 22px; border-radius: 28px; }
  .login-card h1 { font-size: 44px; }
}

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