@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ─── Tokens ─────────────────────────────────────────────────────────────── */
:root {
    --bg:           var(--tg-theme-bg-color, #f2f4f7);
    --text:         var(--tg-theme-text-color, #111111);
    --muted:        var(--tg-theme-hint-color, #6b7280);
    --link:         var(--tg-theme-link-color, #2563eb);
    --btn:          var(--tg-theme-button-color, #2563eb);
    --btn-text:     var(--tg-theme-button-text-color, #ffffff);
    --section-bg:   var(--tg-theme-section-bg-color, #ffffff);
    --secondary-bg: var(--tg-theme-secondary-bg-color, #e5e7eb);
    --hint:         var(--tg-theme-hint-color, #6b7280);

    --danger:        #dc2626;
    --warning:       #d97706;
    --income-color:  #16a34a;
    --expense-color: #dc2626;
    --income-bg:     rgba(22,163,74,.09);
    --expense-bg:    rgba(220,38,38,.09);

    --border:   color-mix(in srgb, var(--text) 12%, transparent);
    --radius:   12px;
    --radius-sm: 8px;
    --sh:       0 2px 14px rgba(0,0,0,.09);
    --sh-sm:    0 2px 8px rgba(0,0,0,.07), 0 0 0 1px var(--border);
    --sh-lg:    0 6px 24px rgba(0,0,0,.13);
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ─── Top bar ────────────────────────────────────────────────────────────── */
#top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 2px solid var(--btn);
    position: sticky;
    top: 0;
    background: var(--section-bg);
    z-index: 10;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
}
#top-bar h1 {
    font-size: 17px;
    font-weight: 800;
    flex: 1;
    text-align: center;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--btn), color-mix(in srgb, var(--btn) 60%, #7c3aed));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
#help-btn { font-size: 16px; font-weight: 700; opacity: 0.6; }

.icon-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--btn);
    padding: 4px 6px;
    line-height: 1;
    border-radius: var(--radius-sm);
    transition: background .15s;
}
.icon-btn:active { background: color-mix(in srgb, var(--btn) 12%, transparent); }
.icon-btn[hidden] { display: none !important; }

/* ─── Main ───────────────────────────────────────────────────────────────── */
main#root {
    padding: 14px 12px 90px;
    min-height: calc(100vh - 52px);
}

.loading { color: var(--muted); text-align: center; padding: 60px 0; font-size: 14px; }
.error   { color: var(--danger); text-align: center; padding: 20px; font-size: 14px; }
.empty   { color: var(--muted); text-align: center; padding: 60px 0; font-size: 14px; }
.empty-small { color: var(--muted); font-size: 13px; padding: 10px 0; }

/* ─── Status screens ─────────────────────────────────────────────────────── */
.status-screen {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; text-align: center;
    padding: 60px 28px 40px; gap: 18px; min-height: 70vh;
}
.status-icon { font-size: 64px; line-height: 1; }
.status-screen h2 { font-size: 18px; font-weight: 700; line-height: 1.4; }
.status-screen p  { font-size: 14px; color: var(--muted); line-height: 1.6; max-width: 300px; }
.status-hint { font-size: 13px !important; color: var(--link) !important; }

/* ─── Bottom nav ─────────────────────────────────────────────────────────── */
#bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--section-bg);
    border-top: 1px solid var(--border);
    display: flex;
    padding: 4px 0 env(safe-area-inset-bottom, 4px);
    z-index: 10;
    box-shadow: 0 -2px 10px rgba(0,0,0,.06);
}
.nav-btn {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    background: transparent; border: none;
    padding: 6px 2px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    border-radius: var(--radius-sm);
    transition: background .12s;
}
.nav-btn.active {
    background: color-mix(in srgb, var(--btn) 10%, transparent);
}
.nav-icon  { font-size: 20px; line-height: 1; transition: transform .15s; }
.nav-label { font-size: 10px; color: var(--muted); font-weight: 500; }
.nav-btn.active .nav-label { color: var(--btn); font-weight: 700; }
.nav-btn.active .nav-icon  { transform: scale(1.15); }

/* ─── Balance card ───────────────────────────────────────────────────────── */
.balance-card {
    background: linear-gradient(140deg, #1a3766 0%, #0d2547 40%, #16134a 100%);
    border-radius: 22px;
    box-shadow: 0 10px 36px rgba(13,37,71,.38), 0 2px 8px rgba(0,0,0,.14);
    padding: 24px 22px 20px;
    color: #fff;
    margin-bottom: 14px;
    position: relative;
    overflow: hidden;
}
.balance-card::before {
    content: '';
    position: absolute;
    top: -50px; right: -50px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(147,197,253,.2) 0%, transparent 65%);
    pointer-events: none;
}
.balance-card::after {
    content: '';
    position: absolute;
    bottom: -30px; left: -20px;
    width: 120px; height: 120px;
    background: radial-gradient(circle, rgba(167,139,250,.15) 0%, transparent 65%);
    pointer-events: none;
}
.balance-card.negative {
    background: linear-gradient(140deg, #5f1e1e 0%, #3b0f0f 40%, #2d0a2a 100%);
}
.balance-label {
    font-size: 11px;
    opacity: .6;
    margin-bottom: 10px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    font-weight: 600;
}
.balance-amount {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1.1;
    color: #ffffff;
}
.balance-card.negative .balance-amount { color: #fca5a5; }
.balance-month {
    font-size: 12px;
    opacity: .45;
    margin-top: 14px;
    font-weight: 500;
    letter-spacing: .3px;
}

/* ─── Stat cards ─────────────────────────────────────────────────────────── */
.stat-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}
.stat-card {
    background: var(--section-bg);
    border-radius: var(--radius);
    box-shadow: var(--sh-sm);
    border-left: 4px solid transparent;
    padding: 14px 12px 14px 14px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform .1s, box-shadow .1s;
}
.stat-card:active { transform: scale(0.97); box-shadow: none; }
.stat-card.income  { border-left-color: var(--income-color); background: linear-gradient(135deg, var(--section-bg), rgba(22,163,74,.04)); }
.stat-card.expense { border-left-color: var(--expense-color); background: linear-gradient(135deg, var(--section-bg), rgba(220,38,38,.04)); }
.stat-card.credit  { border-left-color: var(--warning); background: linear-gradient(135deg, var(--section-bg), rgba(217,119,6,.04)); }
.stat-card.credit  { grid-column: 1 / -1; }

.stat-label  { font-size: 12px; color: var(--muted); margin-bottom: 7px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.stat-amount { font-size: 20px; font-weight: 700; letter-spacing: -.5px; }
.stat-sub    { font-size: 11px; color: var(--muted); margin-top: 3px; }
.stat-card.income  .stat-amount { color: var(--income-color); }
.stat-card.expense .stat-amount { color: var(--expense-color); }
.stat-card.credit  .stat-amount { color: var(--warning); }

/* ─── Sections ───────────────────────────────────────────────────────────── */
.section {
    background: var(--section-bg);
    border-radius: var(--radius);
    box-shadow: var(--sh-sm);
    padding: 14px 16px;
    margin-bottom: 14px;
}
.section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .7px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 7px;
}
.section-title::before {
    content: '';
    display: inline-block;
    width: 3px; height: 13px;
    background: var(--btn);
    border-radius: 2px;
    flex-shrink: 0;
}

/* ─── Upcoming payments ──────────────────────────────────────────────────── */
.upcoming-row {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
}
.upcoming-row:last-child { border-bottom: none; }
.upcoming-icon {
    width: 34px; height: 34px;
    border-radius: var(--radius-sm);
    background: var(--secondary-bg);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; flex-shrink: 0;
}
.upcoming-name   { flex: 1; font-weight: 600; font-size: 14px; }
.upcoming-date   { font-size: 12px; color: var(--muted); }
.upcoming-amount { font-size: 14px; font-weight: 700; color: var(--expense-color); }
.upcoming-row.overdue .upcoming-date { color: var(--danger); font-weight: 700; }
.upcoming-row.soon    .upcoming-date { color: var(--warning); font-weight: 700; }

/* ─── Recent transactions (home) ─────────────────────────────────────────── */
.mini-tx-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.mini-tx-row:last-child { border-bottom: none; }
.mini-tx-icon {
    width: 38px; height: 38px;
    border-radius: var(--radius);
    background: var(--secondary-bg);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
}
.mini-tx-info  { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.mini-tx-cat   { font-size: 14px; font-weight: 600; }
.mini-tx-desc  { font-size: 12px; color: var(--muted); }
.mini-tx-amount { font-size: 15px; font-weight: 700; }
.mini-tx-amount.income  { color: var(--income-color); }
.mini-tx-amount.expense { color: var(--expense-color); }

/* ─── Month nav ──────────────────────────────────────────────────────────── */
.month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.month-label { font-size: 17px; font-weight: 700; }

/* ─── Type tabs ──────────────────────────────────────────────────────────── */
.type-tabs {
    display: flex; gap: 6px;
    margin-bottom: 14px;
}
.type-tab {
    flex: 1; background: var(--section-bg); border: none;
    border-radius: var(--radius-sm);
    padding: 10px 4px;
    color: var(--muted); font-size: 13px; font-weight: 600;
    cursor: pointer; text-transform: uppercase; letter-spacing: .2px;
    transition: background .12s, color .12s;
    box-shadow: var(--sh-sm);
}
.type-tab.active { background: var(--btn); color: var(--btn-text); box-shadow: 0 2px 8px rgba(0,0,0,.15); }

/* ─── TX summary ─────────────────────────────────────────────────────────── */
.tx-summary { text-align: center; font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.tx-summary .income  { color: var(--income-color); font-weight: 700; }
.tx-summary .expense { color: var(--expense-color); font-weight: 700; }
.tx-summary .sep     { margin: 0 6px; }

/* ─── Transaction groups ─────────────────────────────────────────────────── */
.tx-group { margin-bottom: 14px; }
.tx-date-header {
    font-size: 12px; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: .6px;
    padding: 0 2px; margin-bottom: 6px;
}
.tx-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px;
    background: var(--section-bg);
    border-radius: var(--radius);
    box-shadow: var(--sh-sm);
    margin-bottom: 6px;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
    transition: transform .1s, box-shadow .1s;
}
.tx-row:active { transform: scale(0.98); box-shadow: none; }
.tx-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius);
    background: var(--secondary-bg);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.tx-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.tx-cat  { font-size: 14px; font-weight: 600; }
.tx-desc { font-size: 12px; color: var(--muted); }
.tx-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.tx-amount { font-size: 15px; font-weight: 700; }
.tx-amount.income  { color: var(--income-color); }
.tx-amount.expense { color: var(--expense-color); }
.tx-del {
    background: transparent; border: 1.5px solid var(--muted);
    border-radius: 6px;
    color: var(--muted); font-size: 11px; cursor: pointer;
    padding: 3px 7px; line-height: 1; min-width: 26px; text-align: center;
    transition: all .1s;
}
.tx-del:active { color: var(--danger); border-color: var(--danger); background: var(--expense-bg); }

/* ─── Credits ────────────────────────────────────────────────────────────── */
.credit-summary { display: flex; gap: 10px; margin-bottom: 14px; }
.cs-item {
    flex: 1; background: var(--section-bg);
    border-radius: var(--radius); box-shadow: var(--sh-sm);
    padding: 14px 12px; text-align: center;
}
.cs-label  { font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.cs-amount { font-size: 17px; font-weight: 700; color: var(--warning); }

.credit-card {
    background: var(--section-bg);
    border-radius: var(--radius);
    border-left: 4px solid var(--warning);
    box-shadow: var(--sh-sm);
    padding: 16px; margin-bottom: 12px;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
    transition: transform .1s, box-shadow .1s;
}
.credit-card:active { transform: scale(0.98); box-shadow: none; }
.credit-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.credit-name { font-size: 16px; font-weight: 700; flex: 1; }
.credit-bank { font-size: 12px; color: var(--muted); }
.credit-type-tag { font-size: 10px; color: var(--hint); margin-left: 6px; }
.credit-progress-wrap { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.credit-progress-bar {
    flex: 1; height: 8px;
    background: var(--secondary-bg);
    border-radius: 99px; overflow: hidden;
}
.credit-progress-fill { height: 100%; background: var(--btn); border-radius: 99px; transition: width .3s; }
.credit-pct { font-size: 12px; font-weight: 700; color: var(--muted); flex-shrink: 0; }
.credit-meta { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 6px; }
.cm-label { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.cm-val   { font-size: 14px; font-weight: 700; }
.credit-next { font-size: 13px; color: var(--muted); margin-top: 10px; }

/* ─── Calc table ─────────────────────────────────────────────────────────── */
.calc-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.calc-table th { text-align: left; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.calc-table td { padding: 7px 0; border-bottom: 1px solid var(--border); }
.calc-table tr:last-child td { border-bottom: none; }

/* ─── Subscriptions ──────────────────────────────────────────────────────── */
.subs-header {
    background: var(--section-bg);
    border-radius: var(--radius); box-shadow: var(--sh-sm);
    padding: 16px 18px; margin-bottom: 14px;
    display: flex; align-items: center; justify-content: space-between;
}
.subs-total-label { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.subs-total { font-size: 18px; font-weight: 700; color: var(--expense-color); }

.sub-row {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
    background: var(--section-bg);
    border-radius: var(--radius); box-shadow: var(--sh-sm);
    margin-bottom: 8px;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
    transition: transform .1s, box-shadow .1s;
}
.sub-row:active { transform: scale(0.98); box-shadow: none; }
.sub-row.overdue { border: 1.5px solid var(--danger); box-shadow: 0 2px 8px rgba(220,38,38,.15); }
.sub-row.soon    { border: 1.5px solid var(--warning); box-shadow: 0 2px 8px rgba(217,119,6,.12); }
.sub-row.inactive { opacity: .5; }
.sub-icon {
    width: 42px; height: 42px;
    border-radius: var(--radius); background: var(--secondary-bg);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
}
.sub-info  { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.sub-name  { font-size: 15px; font-weight: 600; }
.sub-date  { font-size: 12px; color: var(--muted); }
.inactive-label { color: var(--muted); font-style: italic; }
.sub-amount { font-size: 15px; font-weight: 700; color: var(--expense-color); white-space: nowrap; }

/* ─── Report ─────────────────────────────────────────────────────────────── */
.report-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.rs-item {
    background: var(--section-bg);
    border-radius: var(--radius); box-shadow: var(--sh-sm);
    padding: 14px 12px; text-align: center;
}
.rs-label  { font-size: 12px; color: var(--muted); margin-bottom: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.rs-amount { font-size: 17px; font-weight: 700; }
.rs-item.income  .rs-amount { color: var(--income-color); }
.rs-item.expense .rs-amount { color: var(--expense-color); }

.report-cat { margin-bottom: 12px; }
.report-cat-head { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 5px; font-weight: 500; }
.report-bar-wrap { background: var(--secondary-bg); border-radius: 99px; height: 8px; overflow: hidden; }
.report-bar      { height: 100%; background: var(--expense-color); border-radius: 99px; transition: width .4s; }
.report-bar.income-bar { background: var(--income-color); }

/* ─── FAB ────────────────────────────────────────────────────────────────── */
.fab {
    position: fixed;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    width: 54px; height: 54px;
    background: linear-gradient(135deg, var(--btn), color-mix(in srgb, var(--btn) 70%, #7c3aed));
    color: var(--btn-text);
    border: none; border-radius: 50%;
    box-shadow: 0 4px 20px rgba(0,0,0,.25), 0 0 0 2px rgba(255,255,255,.15) inset;
    font-size: 26px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    z-index: 9; transition: transform .1s, box-shadow .1s;
}
.fab:active { transform: scale(0.92); box-shadow: 0 2px 8px rgba(0,0,0,.2); }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
button.primary {
    background: var(--btn); color: var(--btn-text);
    border: none; border-radius: var(--radius-sm);
    box-shadow: 0 2px 10px rgba(0,0,0,.15);
    padding: 14px 16px; font-size: 14px; font-weight: 700;
    cursor: pointer; width: 100%; text-transform: uppercase; letter-spacing: .4px;
    transition: transform .1s, box-shadow .1s;
}
button.primary:active { transform: scale(0.98); box-shadow: none; }
button.primary:disabled { opacity: .45; pointer-events: none; }

button.secondary {
    background: var(--section-bg); color: var(--text);
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    box-shadow: var(--sh-sm);
    padding: 12px 14px; font-size: 13px; font-weight: 600;
    cursor: pointer; text-transform: uppercase; letter-spacing: .3px;
    transition: transform .1s, box-shadow .1s;
}
button.secondary:active { transform: scale(0.98); box-shadow: none; }

button.danger {
    background: var(--danger); color: #fff;
    border: none; border-radius: var(--radius-sm);
    box-shadow: 0 2px 10px rgba(220,38,38,.3);
    padding: 12px 14px; font-size: 13px; font-weight: 700;
    cursor: pointer; text-transform: uppercase; letter-spacing: .3px;
    transition: transform .1s, box-shadow .1s;
}
button.danger:active { transform: scale(0.98); box-shadow: none; }

/* ─── KV ─────────────────────────────────────────────────────────────────── */
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 10px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.modal-sub { color: var(--muted); font-size: 14px; margin-bottom: 14px; line-height: 1.6; }

/* ─── Modal ──────────────────────────────────────────────────────────────── */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,.5);
    display: flex; align-items: flex-end; justify-content: center;
    z-index: 100; overscroll-behavior: none; touch-action: none;
}
.modal {
    background: var(--bg);
    width: 100%; max-width: 520px;
    border-radius: 20px 20px 0 0;
    padding: 6px 16px env(safe-area-inset-bottom, 20px);
    max-height: 92vh; max-height: 92dvh; overflow-y: auto;
    overscroll-behavior: contain; touch-action: pan-y;
    animation: modal-up .22s ease;
}
.modal::before {
    content: ''; display: block;
    width: 40px; height: 4px; background: var(--border);
    border-radius: 99px;
    margin: 10px auto 16px;
}
.modal h3 {
    font-size: 17px; font-weight: 700;
    margin-bottom: 16px; letter-spacing: -.2px;
}
@keyframes modal-up {
    from { transform: translateY(24px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ─── FAQ ────────────────────────────────────────────────────────────────── */
.faq-header { display: flex; align-items: center; justify-content: space-between; font-size: 17px; font-weight: 700; margin-bottom: 14px; }
.faq-body { display: flex; flex-direction: column; gap: 10px; }
.faq-section { background: var(--section-bg); border-radius: var(--radius-sm); padding: 13px 15px; }
.faq-title { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.faq-text  { font-size: 14px; line-height: 1.6; color: var(--muted); }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions > * { flex: 1; }

/* ─── Form ───────────────────────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 14px; margin-bottom: 4px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.field input, .field select, .field textarea {
    padding: 12px 14px; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--section-bg); color: var(--text);
    font-size: 16px; font-family: inherit; width: 100%;
    touch-action: manipulation;
    transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 64px; max-height: 120px; resize: none; overflow-y: auto; }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--btn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--btn) 18%, transparent);
}

/* ─── Type toggle ────────────────────────────────────────────────────────── */
.type-toggle-form { display: flex; gap: 0; margin-bottom: 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.ttf-btn {
    flex: 1; padding: 11px;
    border: none; border-right: 1.5px solid var(--border);
    background: transparent; color: var(--muted);
    font-size: 13px; font-weight: 600; cursor: pointer;
    text-transform: uppercase; letter-spacing: .3px;
    transition: all .12s;
}
.ttf-btn:last-child { border-right: none; }
.ttf-btn.active.expense { background: var(--expense-color); color: #fff; }
.ttf-btn.active.income  { background: var(--income-color);  color: #fff; }

/* ─── Category grid ──────────────────────────────────────────────────────── */
.cat-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.cat-btn {
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    padding: 12px 4px;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    background: var(--section-bg);
    color: var(--text); font-size: 11px; font-weight: 500;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
    box-shadow: var(--sh-sm);
    transition: transform .1s, box-shadow .1s;
}
.cat-btn span:first-child { font-size: 22px; }
.cat-btn:active { transform: scale(0.95); box-shadow: none; }
.cat-btn.active {
    border-color: var(--btn); background: var(--btn);
    color: var(--btn-text);
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

/* ─── Smart selector ─────────────────────────────────────────────────────── */
.smart-selector { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.smart-selector label { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.smart-selector select {
    padding: 11px 14px; border: 1.5px solid var(--btn);
    border-radius: var(--radius-sm);
    background: var(--section-bg); color: var(--text);
    font-size: 16px; font-family: inherit; width: 100%;
    touch-action: manipulation;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--btn) 12%, transparent);
}
.smart-hint {
    margin-top: 8px; font-size: 12px; color: var(--muted);
    padding: 8px 12px; background: var(--secondary-bg);
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border); line-height: 1.5;
}

/* ─── Icon picker ────────────────────────────────────────────────────────── */
.icon-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-pick {
    font-size: 22px; padding: 8px;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    background: var(--section-bg);
    cursor: pointer; line-height: 1;
    box-shadow: var(--sh-sm);
    transition: transform .1s, box-shadow .1s;
}
.icon-pick:active { transform: scale(0.9); box-shadow: none; }
.icon-pick.active { border-color: var(--btn); background: color-mix(in srgb, var(--btn) 12%, transparent); box-shadow: 0 0 0 2px var(--btn); }

/* ─── Toast ──────────────────────────────────────────────────────────────── */
.toast {
    position: fixed; bottom: calc(90px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%);
    background: var(--text); color: var(--bg);
    padding: 10px 20px; font-size: 13px; font-weight: 600;
    border-radius: 99px;
    z-index: 200; opacity: 0; transition: opacity .2s;
    pointer-events: none; white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.toast.show { opacity: 1; }

/* ─── Custom category ────────────────────────────────────────────────────── */
.cat-btn.custom-cat { border-style: dashed; position: relative; }
.cat-btn.add-cat    { border-style: dashed; color: var(--muted); opacity: .7; box-shadow: none; }
.cat-del-btn {
    position: absolute; top: -6px; right: -6px;
    width: 20px; height: 20px;
    background: var(--danger); color: #fff;
    border: none; border-radius: 50%;
    font-size: 11px; font-weight: 700; cursor: pointer;
    padding: 0; line-height: 20px; text-align: center; z-index: 2;
}

/* ─── Admin ──────────────────────────────────────────────────────────────── */
.admin-user-list { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; }
.admin-user-row {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; background: var(--section-bg);
    border-radius: var(--radius); box-shadow: var(--sh-sm);
}
.admin-user-info { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.admin-name { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-uname { font-size: 12px; color: var(--muted); }
.admin-status { font-size: 12px; font-weight: 700; margin-top: 2px; }
.admin-status.approved { color: var(--income-color); }
.admin-status.pending  { color: var(--warning); }
.admin-status.denied   { color: var(--danger); }
.admin-user-acts { display: flex; gap: 8px; flex-shrink: 0; }
.admin-act-btn {
    background: var(--secondary-bg); border: none;
    border-radius: var(--radius-sm);
    box-shadow: var(--sh-sm); font-size: 18px;
    width: 38px; height: 38px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    -webkit-tap-highlight-color: transparent;
    transition: transform .1s, box-shadow .1s;
}
.admin-act-btn:active { transform: scale(0.92); box-shadow: none; }
.admin-act-btn.approve { background: var(--income-bg); }
.admin-act-btn.deny    { background: var(--expense-bg); }

/* ─── Search / date filter ───────────────────────────────────────────────── */
.tx-date-filter { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.tx-date-filter input[type=date] {
    flex: 1; padding: 10px 12px;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    background: var(--section-bg);
    color: var(--text); font-size: 16px; font-family: inherit;
    touch-action: manipulation;
}
.tx-date-filter input[type=date]:focus { outline: none; border-color: var(--btn); }
.tx-date-label { font-size: 16px; flex-shrink: 0; }
.tx-date-hint  { font-size: 11px; color: var(--hint); flex-shrink: 0; white-space: nowrap; }
.tx-date-clear {
    background: var(--section-bg); border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text); font-size: 12px; font-weight: 600;
    padding: 8px 10px; cursor: pointer; line-height: 1; flex-shrink: 0;
}

.search-bar { margin-bottom: 14px; }
.search-bar input {
    width: 100%; padding: 11px 14px;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    background: var(--section-bg);
    color: var(--text); font-size: 16px; font-family: inherit;
    touch-action: manipulation;
    transition: border-color .15s, box-shadow .15s;
}
.search-bar input:focus { outline: none; border-color: var(--btn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--btn) 15%, transparent); }

/* ─── Report comparison ──────────────────────────────────────────────────── */
.report-comparison {
    background: var(--section-bg); border-radius: var(--radius);
    box-shadow: var(--sh-sm); padding: 14px 16px; margin-top: 14px;
}
.rc-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 12px; }
.rc-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.rc-row:last-child { border-bottom: none; }
.rc-delta { font-size: 14px; font-weight: 700; }
.rc-delta.up   { color: var(--income-color); }
.rc-delta.down { color: var(--expense-color); }

/* ─── Generic card ───────────────────────────────────────────────────────── */
.card { background: var(--section-bg); border-radius: var(--radius); box-shadow: var(--sh-sm); padding: 14px 16px; margin-bottom: 14px; }

/* ─── Afford / Daily ─────────────────────────────────────────────────────── */
.afford-card, .daily-card { margin-bottom: 14px; }
.afford-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; }
.afford-label { font-size: 14px; }
.afford-val   { font-size: 15px; font-weight: 700; }
.afford-divider { border-top: 1px solid var(--border); margin: 8px 0; }
.afford-result .afford-label { font-size: 15px; }
.afford-result .afford-val   { font-size: 17px; }
.afford-pos { color: var(--income-color); }
.afford-neg { color: var(--expense-color); }
.income-color  { color: var(--income-color); }
.expense-color { color: var(--expense-color); }

/* ─── Budget ─────────────────────────────────────────────────────────────── */
.budget-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.budget-item:last-of-type { border-bottom: none; }
.budget-item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.budget-cat  { font-size: 14px; font-weight: 600; }
.budget-nums { font-size: 13px; color: var(--muted); }
.budget-bar-bg { height: 8px; background: var(--secondary-bg); border-radius: 99px; overflow: hidden; }
.budget-bar { height: 100%; border-radius: 99px; transition: width .3s ease; }
.budget-bar-ok     { background: var(--income-color); }
.budget-bar-warn   { background: var(--warning); }
.budget-bar-danger { background: var(--expense-color); }
.budget-item-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.budget-del {
    background: transparent; border: 1.5px solid var(--muted);
    border-radius: 6px;
    color: var(--muted); font-size: 12px; cursor: pointer;
    padding: 3px 8px; line-height: 1; transition: all .1s;
}
.budget-del:active { color: var(--danger); border-color: var(--danger); }
.btn-primary {
    background: var(--btn); color: var(--btn-text);
    border: none; border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    padding: 10px 20px; font-size: 13px; font-weight: 700;
    cursor: pointer; text-transform: uppercase; letter-spacing: .3px;
    transition: transform .1s, box-shadow .1s;
}
.btn-primary:active { transform: scale(0.97); box-shadow: none; }
.btn-outline {
    background: transparent; color: var(--btn);
    border: 1.5px solid var(--btn); border-radius: var(--radius-sm);
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    padding: 9px 16px; font-size: 13px; font-weight: 600;
    cursor: pointer; text-transform: uppercase; letter-spacing: .3px;
    transition: transform .1s, box-shadow .1s;
}
.btn-outline:active { transform: scale(0.97); box-shadow: none; }
.info-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; font-size: 12px; cursor: pointer;
    opacity: .6; vertical-align: middle; margin-left: 3px;
    transition: opacity .15s;
}
.info-btn:active { opacity: 1; }
.info-tooltip {
    position: fixed; z-index: 99999;
    background: var(--section-bg); border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--sh-lg);
    padding: 12px 14px; font-size: 13px; line-height: 1.65;
    max-width: 260px; width: max-content; color: var(--text); pointer-events: auto;
}
.advisor-card { padding: 14px 16px; }
.advisor-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.advisor-block { margin-bottom: 12px; }
.advisor-block:last-child { margin-bottom: 0; }
.advisor-label { font-size: 12px; font-weight: 700; color: var(--hint); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.advisor-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; padding: 4px 0; }
.advisor-total { font-size: 12px; color: var(--hint); margin-top: 6px; border-top: 1px dashed var(--border); padding-top: 6px; }
.hint-shifted { font-size: 11px; color: var(--danger); opacity: .8; }
.advisor-settings { display: flex; align-items: center; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.advisor-set-label { font-size: 12px; color: var(--hint); }
.pay-day-inp {
    width: 52px; padding: 4px 8px; border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--secondary-bg); color: var(--text);
    font-size: 16px; font-weight: 700; text-align: center;
    touch-action: manipulation;
    -moz-appearance: textfield;
}
.pay-day-inp::-webkit-inner-spin-button,
.pay-day-inp::-webkit-outer-spin-button { -webkit-appearance: none; }

/* ─── Zoom ───────────────────────────────────────────────────────────────── */
.zoom-controls { display: flex; gap: 4px; }
.zoom-btn {
    background: var(--section-bg); border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text); font-size: 13px; font-weight: 700;
    padding: 4px 9px; cursor: pointer; line-height: 1;
    box-shadow: var(--sh-sm);
    transition: transform .1s, box-shadow .1s;
}
.zoom-btn:active { transform: scale(0.95); box-shadow: none; }

/* ─── Goals ──────────────────────────────────────────────────────────────── */
.goal-card {
    background: var(--section-bg);
    border-radius: var(--radius); border-left: 4px solid var(--btn);
    box-shadow: var(--sh-sm);
    padding: 16px 18px; margin-bottom: 14px;
    cursor: pointer; transition: transform .1s, box-shadow .1s;
}
.goal-card:active { transform: scale(0.98); box-shadow: none; }
.goal-header { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.goal-icon {
    width: 48px; height: 48px; border-radius: var(--radius);
    background: var(--secondary-bg);
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; flex-shrink: 0;
}
.goal-info { flex: 1; min-width: 0; }
.goal-name { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.goal-amounts { font-size: 13px; color: var(--hint); }
.goal-pct { font-size: 14px; font-weight: 700; color: var(--btn); flex-shrink: 0; }
.goal-done { color: var(--income-color) !important; }
.goal-bar-bg { height: 8px; background: var(--secondary-bg); border-radius: 99px; overflow: hidden; margin-bottom: 8px; }
.goal-bar { height: 100%; background: var(--btn); border-radius: 99px; transition: width .4s ease; }
.goal-bar-done { background: var(--income-color); }
.goal-left { font-size: 13px; color: var(--hint); }
.goal-notes { font-size: 11px; color: var(--muted); margin-top: 4px; font-style: italic; }
.pay-amt-inp { width: 90px !important; font-size: 16px !important; }
.no-split-row { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.no-split-row input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }
.advisor-rest { font-size: 13px; font-weight: 700; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border); }
.advisor-daily { font-size: 12px; color: var(--muted); margin-top: 3px; }
.goal-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.goal-add-btn {
    background: var(--btn); color: var(--btn-text);
    border: none; border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(0,0,0,.14);
    padding: 8px 14px; font-size: 13px; font-weight: 700;
    cursor: pointer; text-transform: uppercase;
    transition: transform .1s, box-shadow .1s;
}
.goal-add-btn:active { transform: scale(0.96); box-shadow: none; }
.split-row .split-amounts { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.split-hint { font-size: 11px; color: var(--hint); font-style: italic; }
.split-transfer { opacity: .75; font-style: italic; }
.split-transfer span:first-child { color: var(--hint); }

/* ─── Goals sections ─────────────────────────────────────────────────────── */
.goals-section-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.goals-section-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.goals-section-add {
    background: var(--btn); color: var(--btn-text);
    border: none; border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    padding: 6px 12px; font-size: 12px; font-weight: 700;
    cursor: pointer; text-transform: uppercase;
    transition: transform .1s, box-shadow .1s;
}
.goals-section-add:active { transform: scale(0.96); box-shadow: none; }
/* ─── Goal donut chart & toggle ─────────────────────────────────────────── */
.goals-hdr-actions { display: flex; align-items: center; gap: 8px; }
.goals-view-toggle {
    background: var(--secondary-bg); color: var(--text);
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    padding: 5px 10px; font-size: 11px; font-weight: 600;
    cursor: pointer; transition: background .15s, transform .1s;
}
.goals-view-toggle:active { transform: scale(0.96); background: var(--border); }

.goal-chart-card { padding: 14px 16px; }
.goal-chart-body { display: flex; align-items: center; gap: 16px; }
.goal-donut-wrap { flex-shrink: 0; width: 100px; height: 100px; }
.goal-donut-svg { display: block; }
.goal-chart-info { flex: 1; min-width: 0; }
.goal-chart-name { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.goal-chart-amounts { font-size: 13px; color: var(--hint); margin-bottom: 6px; }
.goal-chart-footer { font-size: 12px; }
.goal-chart-actions { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 10px; }
.goal-edit-btn {
    background: var(--secondary-bg); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 6px 12px; font-size: 12px; cursor: pointer;
    transition: background .15s;
}
.goal-edit-btn:active { background: var(--border); }


/* ─── Savings ────────────────────────────────────────────────────────────── */
.sa-card { background: var(--section-bg); border-radius: var(--radius); box-shadow: var(--sh-sm); padding: 16px 18px; margin-bottom: 14px; }
.sa-card-closed { opacity: .55; }
.sa-header { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.sa-icon { width: 48px; height: 48px; border-radius: var(--radius); background: var(--secondary-bg); display: flex; align-items: center; justify-content: center; font-size: 26px; flex-shrink: 0; }
.sa-info { flex: 1; min-width: 0; }
.sa-name { font-size: 15px; font-weight: 700; margin-bottom: 3px; }
.sa-meta { font-size: 13px; color: var(--hint); }
.sa-rate-badge { background: var(--income-bg); color: var(--income-color); border: 1.5px solid var(--income-color); border-radius: 99px; padding: 3px 10px; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.sa-closed-badge { background: var(--secondary-bg); color: var(--muted); border: 1.5px solid var(--border); border-radius: 99px; padding: 3px 10px; font-size: 12px; flex-shrink: 0; }
.sa-body { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.sa-row { display: flex; justify-content: space-between; font-size: 14px; }
.sa-label { color: var(--hint); }
.sa-earned { color: var(--income-color); font-weight: 700; }
.sa-total  { font-weight: 700; }
.sa-notes { font-size: 11px; color: var(--muted); font-style: italic; margin-bottom: 10px; }
.sa-actions { display: flex; gap: 8px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.sa-btns { display: flex; gap: 8px; }
.sa-delete-btn { background: transparent; color: var(--danger); border: 1.5px solid var(--danger); border-radius: var(--radius-sm); box-shadow: 0 1px 4px rgba(220,38,38,.15); padding: 6px 14px; font-size: 12px; font-weight: 700; cursor: pointer; text-transform: uppercase; transition: transform .1s, box-shadow .1s; }
.sa-delete-btn:active { transform: scale(0.96); box-shadow: none; }
.sa-deposit-btn { background: var(--btn); color: var(--btn-text); border: none; border-radius: var(--radius-sm); box-shadow: 0 2px 8px rgba(0,0,0,.12); padding: 6px 14px; font-size: 12px; font-weight: 700; cursor: pointer; text-transform: uppercase; transition: transform .1s, box-shadow .1s; }
.sa-deposit-btn:active { transform: scale(0.96); box-shadow: none; }
.sa-close-btn { background: var(--btn); color: var(--btn-text); border: none; border-radius: var(--radius-sm); box-shadow: 0 2px 8px rgba(0,0,0,.12); padding: 6px 16px; font-size: 12px; font-weight: 700; cursor: pointer; text-transform: uppercase; transition: transform .1s, box-shadow .1s; }
.sa-close-btn:active { transform: scale(0.96); box-shadow: none; }
.sa-remind-row { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.sa-remind-label { font-size: 12px; color: var(--muted); }
.sa-remind-toggle {
    background: var(--income-color); color: #fff;
    border: 1.5px solid transparent;
    border-radius: 99px; padding: 3px 14px;
    font-size: 12px; font-weight: 700; cursor: pointer;
    min-width: 82px; text-align: center; white-space: nowrap; flex-shrink: 0;
    transition: background .15s, color .15s, border-color .15s;
}
.sa-remind-toggle.sa-remind-off { background: transparent; color: var(--danger); border-color: var(--danger); }
.sa-archive-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin: 18px 0 10px; }

.sa-preview { margin-top: 8px; overflow: hidden; background: var(--income-bg); border: 1.5px solid var(--income-color); border-radius: var(--radius-sm); }
.sa-preview:empty { display: none; }
.sa-preview-title { font-size: 11px; font-weight: 700; color: var(--income-color); text-transform: uppercase; letter-spacing: .5px; padding: 8px 12px 4px; }
.sa-preview-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.sa-preview-table td { padding: 3px 12px; }
.sa-preview-table tr:last-child td { padding-bottom: 8px; }
.sa-preview-earned { color: var(--income-color); font-weight: 700; text-align: right; }
.sa-preview-total  { text-align: right; font-weight: 700; }

/* ─── Voice ──────────────────────────────────────────────────────────────── */
.fab-mic {
    position: fixed;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    right: 80px;
    width: 50px; height: 50px;
    background: var(--section-bg); border: none;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(0,0,0,.18), 0 0 0 1px var(--border);
    font-size: 22px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    z-index: 9; transition: transform .1s, box-shadow .1s;
}
.fab-mic:active { transform: scale(0.92); box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.fab-mic.recording { background: var(--expense-bg); box-shadow: 0 0 0 4px var(--danger), 0 4px 16px rgba(0,0,0,.18); animation: mic-pulse 1s ease-in-out infinite; }
@keyframes mic-pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.06); }
}
.voice-hint { margin: 8px 0 2px; padding: 10px 14px; font-size: 13px; line-height: 1.5; background: var(--secondary-bg); border-radius: var(--radius-sm); border: 1px dashed var(--border); white-space: pre-line; }
.voice-hint.error { background: var(--expense-bg); color: var(--expense-color); border-color: var(--expense-color); }
.voice-hint.ok    { background: var(--income-bg);  color: var(--income-color);  border-color: var(--income-color); }

/* ─── Theme toggle ───────────────────────────────────────────────────────── */
.theme-toggle-btn {
    background: var(--secondary-bg);
    border: 1.5px solid var(--border);
    border-radius: 99px;
    padding: 3px 10px;
    font-size: 11px; font-weight: 700;
    color: var(--muted);
    cursor: pointer;
    letter-spacing: .3px;
    white-space: nowrap;
    transition: background .15s, color .15s;
}

/* ─── Collapsible blocks ─────────────────────────────────────────────────── */
.col-title { cursor: pointer; user-select: none; }
.col-chevron {
    font-size: 13px;
    opacity: .45;
    transition: transform .25s ease;
    flex-shrink: 0;
    margin-left: auto;
    padding-left: 4px;
    line-height: 1;
}
.col-title-collapsed .col-chevron { transform: rotate(-90deg); }
.theme-toggle-btn:active { background: var(--btn); color: var(--btn-text); }
