/* ===== Va8ti theme ===== */
:root {
    --bg: #F2F5F3;
    --card: #FFFFFF;
    --ink: #0F1A14;
    --muted: #4B5563;
    --line: #EEF2EF;
    --border: #D1DDD6;

    --brand: #065F46;
    --brand-2: #047857;
    --brand-dark: #022C22;
    --brand-gradient: linear-gradient(140deg, #047857 0%, #065F46 45%, #022C22 100%);
    --mint: #A7F3D0;
    --mint-2: #D1FAE5;

    --income: #15803D;
    --income-bg: #F0FDF4;
    --income-tint: #DCFCE7;
    --expense: #B91C1C;
    --expense-bg: #FEF2F2;
    --expense-tint: #FECACA;

    --amber-bg: #FFFBEB;
    --amber-line: #F59E0B;
    --amber-ink: #92400E;
    --amber-title: #78350F;
    --amber-chip: #FEF3C7;

    --radius-lg: 24px;
    --radius: 16px;
    --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.4;
}

a { color: var(--brand); }
a:hover { color: var(--brand-dark); }

button, input, select, textarea { font: inherit; color: inherit; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ===== Layout ===== */
.app {
    max-width: 480px;
    margin: 0 auto;
    padding: 14px 16px 120px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
@media (max-width: 1023px) {
    .desktop-only { display: none !important; }
}
.sidebar { display: none; }

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; }
.topbar-actions { display: flex; gap: 8px; }
.icon-button {
    width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--border); background: #FFFFFF;
    color: var(--brand); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.icon-button:disabled { opacity: 0.6; cursor: progress; }
.cycle-head { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-width: 0; }
.cycle-head img { border-radius: 8px; flex-shrink: 0; }
.cycle-head strong { display: block; font-size: 16px; font-weight: 800; }
.cycle-head small { display: block; font-size: 12px; color: var(--muted); }
.logo { display: inline-flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; letter-spacing: -0.5px; color: var(--brand); text-decoration: none; }
.logo img { display: block; border-radius: 8px; }
.logo--stacked { flex-direction: column; gap: 12px; }
.logo--stacked img { border-radius: 16px; }
.page-title { font-size: 24px; font-weight: 800; margin: 0; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.page-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; text-decoration: none; }

/* Big screens: sidebar instead of the bottom bar */
@media (min-width: 1024px) {
    .mobile-only { display: none !important; }
    .shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
    .sidebar {
        display: flex; flex-direction: column; gap: 22px;
        position: sticky; top: 0; height: 100vh; overflow-y: auto;
        background: #FFFFFF; border-right: 1px solid #E3EAE6; padding: 24px 16px;
    }
    .sidebar .logo { padding: 0 8px; }
    .app { max-width: 1240px; margin: 0; padding: 28px 36px 40px; gap: 18px; }
    .footer { padding: 0 36px 32px; text-align: left; }
    .nav { display: none !important; }
}
.cycle-box { display: flex; flex-direction: column; background: var(--bg); border-radius: 14px; padding: 12px 14px; text-decoration: none; color: var(--ink); }
.cycle-box small { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; }
.cycle-box strong { font-size: 15px; font-weight: 800; margin-top: 2px; }
.cycle-box span { font-size: 12px; color: var(--muted); }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a {
    display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 12px;
    color: #374151; font-weight: 600; font-size: 14px; text-decoration: none;
}
.side-nav a:hover { background: var(--bg); color: var(--ink); }
.side-nav a[aria-current="page"] { background: #ECFDF5; color: var(--brand); font-weight: 800; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 0 8px; }
.side-account { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 0; }
.link-button { background: none; border: none; padding: 0; color: var(--brand); font-weight: 700; font-size: 12px; cursor: pointer; }
.link-button:hover { color: var(--brand-dark); text-decoration: underline; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 48px; padding: 0 18px;
    border-radius: 14px; border: none;
    font-weight: 800; font-size: 15px;
    text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--brand); color: #FFFFFF; }
.btn-primary:hover { background: var(--brand-dark); color: #FFFFFF; }
.btn-white { background: #FFFFFF; color: var(--brand); }
.btn-white:hover { background: var(--mint-2); color: var(--brand-dark); }
.btn-outline { background: #FFFFFF; color: var(--ink); border: 1.5px solid var(--border); }
.btn-outline:hover { color: var(--ink); border-color: var(--muted); }
.btn-danger { background: #FFFFFF; color: var(--expense); border: 1.5px solid var(--expense-tint); }
.btn-danger:hover { color: var(--expense); background: var(--expense-bg); }
.btn-income { background: var(--income); color: #FFFFFF; }
.btn-expense { background: var(--expense); color: #FFFFFF; }
.btn-soft-income { background: var(--income-tint); color: var(--income); }
.btn-soft-expense { background: #FEE2E2; color: var(--expense); }
.btn-soft-pending { background: var(--amber-chip); color: var(--amber-ink); }
.btn-soft-income:hover, .btn-soft-expense:hover, .btn-soft-pending:hover { filter: brightness(0.97); }
.btn-sm { min-height: 40px; padding: 0 14px; border-radius: 12px; font-size: 13px; font-weight: 700; }
.btn-block { width: 100%; }
.btn-pill {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 40px; padding: 0 14px; border-radius: 20px;
    border: 1px solid var(--border); background: #FFFFFF; color: var(--brand);
    font-weight: 700; font-size: 13px; cursor: pointer; text-decoration: none;
}
.btn-pill:disabled { opacity: 0.6; cursor: progress; }
.icon { width: 20px; height: 20px; flex-shrink: 0; }
.icon-sm { width: 16px; height: 16px; flex-shrink: 0; }
form.inline { display: inline; margin: 0; }

/* ===== Hero card ===== */
.hero {
    background: var(--brand-gradient);
    color: #FFFFFF;
    border-radius: 28px;
    padding: 22px;
    display: flex; flex-direction: column; gap: 16px;
}
.hero-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hero-label { font-size: 13px; color: var(--mint); }
.hero-number { display: flex; align-items: baseline; gap: 6px; margin-top: 2px; }
.hero-number strong { font-size: 56px; font-weight: 800; letter-spacing: -2.5px; line-height: 1; }
.hero-number span { font-size: 18px; font-weight: 700; }
.hero-sub { font-size: 12px; color: var(--mint); margin-top: 6px; }
.hero-negative strong { color: #FECACA; }

.ring { position: relative; width: 104px; height: 104px; flex-shrink: 0; }
.ring svg { display: block; }
.ring-label {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ring-label strong { font-size: 28px; font-weight: 800; line-height: 1; }
.ring-label span { font-size: 10px; color: var(--mint); max-width: 64px; text-align: center; line-height: 1.15; }

.hero-free {
    display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
    background: rgba(255, 255, 255, 0.10); border-radius: var(--radius); padding: 14px 16px;
    font-size: 13px; color: var(--mint-2);
}
.hero-free strong { font-size: 18px; font-weight: 800; color: #FFFFFF; white-space: nowrap; }
.hero-free strong.is-negative { color: #FECACA; }

/* ===== Dashboard ===== */
.dash-top, .dash-main, .dash-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
@media (min-width: 1024px) {
    .dash-top { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
    .dash-top .hero { grid-column: span 2; justify-content: center; padding: 24px 26px; }
    .dash-top .hero-number strong { font-size: 64px; }
    .dash-top .ring { width: 116px; height: 116px; }
    .dash-top .ring svg { width: 116px; height: 116px; }
    .dash-main { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; align-items: start; }
}
.stat { background: var(--card); border-radius: var(--radius-lg); padding: 22px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 30px; font-weight: 800; letter-spacing: -1px; }
.stat-note { font-size: 12px; color: var(--muted); }
.stat-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.stat-line b { font-size: 18px; }
.stat--split { justify-content: flex-start; }
.stat--split .stat-line + .stat-line { padding-top: 10px; border-top: 1px solid var(--line); }
.planned-bar { height: 10px; border-radius: 5px; background: var(--income-tint); overflow: hidden; margin-top: auto; }
.planned-bar div { height: 10px; background: #F87171; }

/* Phone tiles: what is still left this cycle */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tiles--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile {
    background: var(--card); border-radius: 18px; padding: 12px; text-decoration: none; color: var(--ink);
    display: flex; flex-direction: column; gap: 6px; min-width: 0;
}
.tile strong { font-size: clamp(14px, 4.4vw, 18px); font-weight: 800; white-space: nowrap; letter-spacing: -0.3px; }
.tile--pending { background: var(--amber-bg); border: 1.5px dashed var(--amber-line); padding: 11px; }
.tile--pending strong, .tile--pending .tile-head, .tile--pending small { color: var(--amber-ink); }
.tile-head { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--muted); line-height: 1.2; min-width: 0; }
.badge { width: 22px; height: 22px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 14px; font-weight: 800; }
.badge svg { width: 14px; height: 14px; }
.badge--in { background: var(--income-tint); color: var(--income); }
.badge--out { background: #FEE2E2; color: var(--expense); }
.badge--pending { background: var(--amber-chip); color: #B45309; }
.progress { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; }
.progress small { font-size: 11px; color: var(--muted); margin-left: 2px; white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 4px; display: inline-block; }
.dot--in { background: var(--income-tint); }
.dot--in.is-on { background: var(--income); }
.dot--out { background: #FEE2E2; }
.dot--out.is-on { background: var(--expense); }

/* Plan: In / Out tabs on phones, side by side on big screens */
.tabs { display: flex; gap: 4px; background: var(--bg); border-radius: 12px; padding: 4px; }
.tabs button {
    flex: 1 1 0; min-height: 40px; border: none; border-radius: 9px; background: transparent;
    color: var(--muted); font-weight: 700; font-size: 13px; cursor: pointer;
}
.tabs button[aria-selected="true"] { background: #FFFFFF; color: var(--ink); font-weight: 800; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.plan-panel { display: none; }
.plan-panel.is-active { display: block; }
.group-label { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; margin-top: 14px; }
.plan .row:first-of-type { border-top: none; }
.row.is-done { opacity: 0.55; }
.row.is-done .row-title { text-decoration: line-through; }
.panel-title { display: flex; justify-content: space-between; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px; padding-bottom: 8px; margin-top: 14px; }
.panel-title--in { color: var(--income); border-bottom: 2px solid var(--income-tint); }
.panel-title--out { color: var(--expense); border-bottom: 2px solid #FEE2E2; }
@media (min-width: 1024px) {
    .plan { padding: 22px 24px; }
    .plan-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
    .plan-panel, .plan-panel.is-active { display: block; }
}

.savings-card { display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: var(--ink); }
.savings-card:hover { color: var(--ink); box-shadow: 0 0 0 2px var(--line) inset; }
.see-all { font-size: 13px; font-weight: 700; color: var(--brand); white-space: nowrap; }
.mini-goal { display: block; }
.mini-goal-head { display: flex; justify-content: space-between; font-size: 13px; }
.mini-goal-head span { color: var(--muted); }
.mini-goal .bar { display: block; margin-top: 4px; height: 8px; }
.mini-goal .bar span { display: block; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #10B981 0%, #047857 100%); }

/* ===== Cards ===== */
.card { background: var(--card); border-radius: var(--radius-lg); padding: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card-title { font-size: 16px; font-weight: 800; margin: 0; }
.card-hint { font-size: 12px; color: var(--muted); }
.text-income { color: var(--income); }
.text-expense { color: var(--expense); }
.text-muted { color: var(--muted); }
.empty { font-size: 14px; color: var(--muted); padding: 12px 0 2px; }

.rows { display: flex; flex-direction: column; margin-top: 10px; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.row-main { flex-grow: 1; min-width: 0; }
.row-title { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.row-sub { font-size: 12px; color: var(--muted); }
.row-sub.warn { color: var(--expense); font-weight: 600; }
.row-sub.owed { color: var(--income); font-weight: 600; }

.tick {
    width: 44px; height: 44px; margin: -10px -10px -10px -10px;
    display: flex; align-items: center; justify-content: center;
    background: transparent; border: none; cursor: pointer; padding: 0;
}
.tick span {
    width: 24px; height: 24px; border-radius: 12px;
    border: 2px solid #D1D5DB;
    display: flex; align-items: center; justify-content: center;
}
.tick.is-done span { border: none; background: var(--income-tint); color: var(--income); }
.tick svg { width: 14px; height: 14px; }

.amount-btn {
    min-height: 36px; padding: 0 10px; border-radius: 10px; border: none;
    font-weight: 800; font-size: 14px; text-decoration: none; white-space: nowrap;
    display: inline-flex; align-items: center;
}
.amount-btn.income { background: var(--income-bg); color: var(--income); }
.amount-btn.expense { background: var(--expense-bg); color: var(--expense); }

/* ===== Not confirmed yet ===== */
.pending { background: var(--amber-bg); border: 1.5px dashed var(--amber-line); border-radius: var(--radius-lg); padding: 18px; }
.pending-head { display: flex; align-items: center; gap: 8px; color: var(--amber-title); flex-wrap: wrap; }
.pending-head h2 { font-size: 16px; font-weight: 800; margin: 0; flex-grow: 1; white-space: nowrap; }
.pending-total { font-size: 12px; font-weight: 700; color: var(--amber-ink); white-space: nowrap; }
.pending-note { font-size: 12px; color: var(--amber-ink); margin-top: 4px; }
.pending-item { display: flex; align-items: center; gap: 12px; margin-top: 10px; background: #FFFFFF; border-radius: var(--radius); padding: 12px; }
.pending-item .row-main a { text-decoration: none; color: inherit; }
.pending-meta { display: flex; align-items: center; gap: 6px; margin-top: 2px; flex-wrap: wrap; }
.pending-meta strong { font-size: 14px; font-weight: 800; }
.chip { font-size: 11px; font-weight: 700; color: var(--amber-ink); background: var(--amber-chip); border-radius: 6px; padding: 2px 6px; }

/* ===== AI ===== */
.ai-card { background: var(--card); border-radius: var(--radius-lg); padding: 18px; border: 1.5px solid var(--mint-2); }
.ai-card[hidden] { display: none; }
.ai-text { white-space: pre-wrap; font-size: 14px; margin-top: 10px; }

/* ===== Bottom navigation (phones) ===== */
.nav {
    position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
    width: calc(100% - 32px); max-width: 440px; height: 68px;
    border-radius: 22px; background: #FFFFFF;
    box-shadow: 0 6px 20px rgba(2, 44, 34, 0.14);
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center;
    z-index: 20;
}
.nav a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 100%;
    font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none;
}
.nav a[aria-current="page"] { color: var(--brand); font-weight: 800; }
.nav svg { width: 22px; height: 22px; }
.nav-add { display: flex; justify-content: center; }
.nav-add button {
    width: 60px; height: 60px; margin-top: -28px; border-radius: 20px; border: none; cursor: pointer;
    background: var(--brand); color: #FFFFFF; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 18px rgba(6, 95, 70, 0.35);
}
.nav-add svg { width: 26px; height: 26px; }
.is-form .nav { display: none; }

/* ===== Add sheet ===== */
.add-sheet {
    border: none; padding: 12px 20px 28px; width: 100%; max-width: 520px;
    margin: auto auto 0; border-radius: 28px 28px 0 0; background: #FFFFFF; color: var(--ink);
}
.add-sheet::backdrop { background: rgba(15, 26, 20, 0.55); }
.add-sheet[open] { display: flex; flex-direction: column; gap: 12px; }
.add-sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: #D1D5DB; align-self: center; }
.add-sheet-head { display: flex; justify-content: space-between; align-items: center; }
.add-sheet-head h2 { font-size: 20px; font-weight: 800; margin: 0; }
.add-sheet-close { width: 44px; height: 44px; border: none; background: transparent; cursor: pointer; color: var(--muted); display: flex; align-items: center; justify-content: center; }
.add-choice { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 18px; text-decoration: none; color: var(--ink); }
.add-choice b { display: block; font-size: 16px; }
.add-choice small { font-size: 13px; color: var(--muted); }
.add-choice-icon { width: 48px; height: 48px; border-radius: 14px; color: #FFFFFF; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.add-choice--income { background: var(--income-bg); }
.add-choice--income b { color: var(--income); }
.add-choice--income .add-choice-icon { background: var(--income); }
.add-choice--expense { background: var(--expense-bg); }
.add-choice--expense b { color: var(--expense); }
.add-choice--expense .add-choice-icon { background: var(--expense); }
.add-choice--pending { background: var(--amber-bg); }
.add-choice--pending b { color: var(--amber-ink); }
.add-choice--pending .add-choice-icon { background: var(--amber-line); }
.add-choice--save { background: #ECFDF5; }
.add-choice--save b { color: var(--brand); }
.add-choice--save .add-choice-icon { background: var(--brand); }
.add-choice:hover { filter: brightness(0.98); color: var(--ink); }
@media (min-width: 1024px) {
    .add-sheet { margin: auto; border-radius: 24px; padding: 20px 24px 24px; }
    .add-sheet-handle { display: none; }
}

/* ===== Forms ===== */
.sheet { background: var(--card); border-radius: var(--radius-lg); padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.sheet h1 { font-size: 22px; font-weight: 800; margin: 0; }
.sheet .lead { font-size: 14px; color: var(--muted); margin: -8px 0 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field-label { font-size: 13px; font-weight: 700; }
.field input[type="text"], .field input[type="number"], .field input[type="date"],
.field input[type="password"], .field textarea, .field select {
    width: 100%; min-height: 52px; padding: 12px 14px;
    border: 1.5px solid var(--border); border-radius: 14px; background: #FFFFFF;
    font-size: 16px;
}
.field textarea { min-height: 88px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--brand-2); outline-offset: 1px; border-color: var(--brand-2); }
.field .help, .helptext { font-size: 12px; color: var(--muted); }
.errorlist { list-style: none; margin: 0; padding: 0; color: var(--expense); font-size: 13px; font-weight: 600; }
.form-errors { background: var(--expense-bg); color: var(--expense); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.big-amount { display: flex; align-items: center; gap: 8px; min-height: 64px; border: 2px solid var(--brand); border-radius: 16px; padding: 0 16px; }
.big-amount input { flex-grow: 1; width: 100%; min-width: 0; border: none !important; outline: none !important; min-height: 0 !important; padding: 0 !important; font-size: 28px !important; font-weight: 800; background: transparent; }
.big-amount span { font-size: 16px; font-weight: 700; color: var(--muted); }
.big-amount input::-webkit-outer-spin-button,
.big-amount input::-webkit-inner-spin-button,
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.big-amount input, .stepper input { -moz-appearance: textfield; appearance: textfield; }
.big-amount.is-income { border-color: var(--income); color: var(--income); }
.big-amount.is-expense { border-color: var(--expense); color: var(--expense); }

/* Radio groups rendered as segmented buttons */
.segmented ul, .segmented > div { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; list-style: none; margin: 0; padding: 0; }
.segmented label {
    display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px;
    border-radius: 12px; border: 1.5px solid var(--border); background: #FFFFFF;
    font-weight: 700; font-size: 13px; cursor: pointer; text-align: center; padding: 0 6px;
}
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented label:has(input:checked) { border: 2px solid var(--brand); background: #ECFDF5; color: var(--brand); }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.segmented.kind label:has(input[value="income"]:checked) { border-color: var(--income); background: var(--income-bg); color: var(--income); }
.segmented.kind label:has(input[value="expense"]:checked) { border-color: var(--expense); background: var(--expense-bg); color: var(--expense); }
.segmented.certainty label:has(input[value="probable"]),
.segmented.certainty label:has(input[value="uncertain"]) { border-color: #FCD34D; background: var(--amber-bg); color: var(--amber-ink); }
.segmented.certainty label:has(input[value="probable"]:checked),
.segmented.certainty label:has(input[value="uncertain"]:checked) { border: 2px solid var(--amber-line); background: var(--amber-chip); }

.check-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    min-height: 52px; border: 1.5px solid #E5E7EB; border-radius: 14px; padding: 0 14px;
    font-size: 14px; font-weight: 600; cursor: pointer;
}
.check-row input { width: 22px; height: 22px; accent-color: var(--brand); flex-shrink: 0; }

.impact { background: var(--income-bg); border-radius: var(--radius); padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: #14532D; }
.impact strong { font-size: 15px; font-weight: 800; color: var(--income); }
.impact.is-worse { background: var(--expense-bg); color: #7F1D1D; }
.impact.is-worse strong { color: var(--expense); }
.impact[hidden] { display: none; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.help--tight { margin-top: -8px; font-size: 12px; color: var(--muted); }
.field-pair { display: flex; flex-direction: column; gap: 16px; }
.form-layout { display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 1024px) {
    .app--form .sheet, .app > .sheet { max-width: 680px; padding: 26px; }
    .form-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; max-width: 1080px; }
    .form-layout .sheet { max-width: none; }
    .field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
    .sheet .actions { justify-content: flex-end; }
    .sheet .actions .btn-primary { flex-grow: 0; padding: 0 28px; }
}
.impact-panel { background: var(--brand-gradient); color: #FFFFFF; border-radius: var(--radius-lg); padding: 22px; display: flex; flex-direction: column; gap: 12px; position: sticky; top: 28px; }
.impact-panel-label { font-size: 13px; color: var(--mint); }
.impact-panel-day { display: flex; align-items: baseline; gap: 10px; }
.impact-panel-day s { font-size: 22px; font-weight: 700; color: var(--mint); }
.impact-panel-day strong { font-size: 44px; font-weight: 800; letter-spacing: -1.5px; }
.impact-panel-day span { font-size: 15px; font-weight: 700; }
.impact-panel-free { display: flex; justify-content: space-between; gap: 8px; background: rgba(255, 255, 255, 0.10); border-radius: 14px; padding: 12px 14px; font-size: 13px; color: var(--mint-2); }
.impact-panel-free b { color: #FFFFFF; white-space: nowrap; }
.impact-panel p { margin: 0; font-size: 12px; color: var(--mint); }
.impact-panel p[hidden], .impact-panel s[hidden] { display: none; }
@media (max-width: 1023px) {
    .is-form .app { padding-bottom: 40px; }
    .is-form .sheet .actions {
        position: sticky; bottom: 0; z-index: 5;
        margin: 0 -20px -20px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
        background: #FFFFFF; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    }
}
.actions .btn-primary, .actions .grow { flex-grow: 1; }

/* ===== Savings ===== */
.savings-top, .goal-grid { display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 1024px) {
    .savings-top { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: 16px; }
    .goal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
    .chart-card { padding: 22px 24px; }
}
.chart-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.big-total { font-size: 34px; font-weight: 800; letter-spacing: -1px; }
.chart { width: 100%; height: auto; display: block; margin-top: 14px; }
.chart-axis { position: relative; display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; min-height: 16px; }
.chart-axis .today { position: absolute; top: 0; transform: translateX(-50%); }
.legend { display: flex; gap: 14px; font-size: 11px; color: #374151; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { display: inline-block; width: 14px; }
.legend .solid { height: 3px; background: var(--brand-2); border-radius: 2px; }
.legend .dashed { border-top: 2px dashed var(--brand-2); }
.legend .dotted { border-top: 2px dotted #B45309; }

.goal-card { display: flex; flex-direction: column; gap: 10px; }
.goal-card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.goal-card-actions { display: flex; gap: 6px; }
.goal-card-actions .btn { min-height: 36px; padding: 0 12px; font-size: 12px; }
.goal-amounts { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.goal-card .bar { margin-top: 0; }
.set-one { font-weight: 700; text-decoration: none; }
.history { margin-top: 8px; }
.history-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; }
.history-row > :last-child { text-align: right; }
.history-head { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; border-top: none; padding-top: 4px; }

.projection { background: var(--brand-gradient); color: #FFFFFF; border-radius: var(--radius-lg); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.projection h2 { font-size: 16px; font-weight: 800; margin: 0; }
.projection label { font-size: 12px; color: var(--mint); }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 44px; height: 44px; border-radius: 12px; border: none; background: rgba(255, 255, 255, 0.14); color: #FFFFFF; font-size: 20px; font-weight: 700; cursor: pointer; }
.stepper div { flex-grow: 1; min-height: 44px; border-radius: 12px; background: rgba(255, 255, 255, 0.10); display: flex; align-items: center; justify-content: center; gap: 6px; }
.stepper input { width: 110px; border: none; outline: none; background: transparent; color: #FFFFFF; font-size: 20px; font-weight: 800; text-align: right; }
.stepper span { font-size: 14px; font-weight: 700; color: var(--mint); }
.horizons { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.horizons button { min-height: 36px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.25); background: transparent; color: var(--mint-2); font-size: 12px; font-weight: 700; cursor: pointer; }
.horizons button[aria-pressed="true"] { border: none; background: #FFFFFF; color: var(--brand); font-weight: 800; }
.projection-result { background: rgba(255, 255, 255, 0.10); border-radius: var(--radius); padding: 14px; }
.projection-result small { display: block; font-size: 12px; color: var(--mint); }
.projection-result strong { font-size: 32px; font-weight: 800; letter-spacing: -1px; }
.projection-result p { font-size: 12px; color: var(--mint-2); margin: 4px 0 0; }

.bar { height: 10px; background: #E7EEEA; border-radius: 5px; margin-top: 8px; overflow: hidden; }
.bar div { height: 10px; border-radius: 5px; background: linear-gradient(90deg, #10B981 0%, #047857 100%); }
.goal-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }

/* ===== Settings ===== */
.settings-grid { display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 1024px) {
    .settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; max-width: 1080px; }
}

/* ===== Auth / misc ===== */
.auth { max-width: 420px; margin: 0 auto; padding: 48px 20px; display: flex; flex-direction: column; gap: 20px; }
.auth .logo { font-size: 32px; align-self: center; }
.footer { text-align: center; font-size: 12px; color: var(--muted); padding: 0 20px 100px; }
.footer p { margin: 0; }
.welcome { text-align: center; padding: 28px 20px; }
.welcome h1 { font-size: 22px; margin: 0 0 8px; }
.welcome p { color: var(--muted); margin: 0 0 18px; }
.lang-switch { display: flex; gap: 8px; }
.lang-switch button { min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1.5px solid var(--border); background: #FFFFFF; font-weight: 700; cursor: pointer; }
.lang-switch--small button { min-height: 36px; padding: 0 12px; border-radius: 10px; font-size: 12px; }
.lang-switch button[aria-pressed="true"] { border: 2px solid var(--brand); color: var(--brand); background: #ECFDF5; }
.not-found { text-align: center; }
.not-found img { max-width: 220px; width: 100%; height: auto; }
