/* One final set of semantic surfaces, type sizes and controls for the app. */
/* Movement is brief, uses compositor properties and never delays a financial action. */
@media (prefers-reduced-motion: no-preference) {
    body#appBody :is(.zad-btn, .native-primary-button, .native-secondary-button, .transaction-pagination button) {
        transition: transform .14s ease, background-color .18s ease, border-color .18s ease;
    }
    body#appBody :is(.zad-btn, .native-primary-button, .native-secondary-button, .transaction-pagination button):active:not(:disabled) { transform: scale(.98); }
    body#appBody .spending-track > span { transition: width .3s cubic-bezier(.22,1,.36,1); }
    body#appBody dialog[open] { animation: zad-dialog-arrive .22s cubic-bezier(.22,1,.36,1); }
    @keyframes zad-dialog-arrive { from {opacity: .5; transform: translateY(8px);} to {opacity: 1; transform: none;} }
}
body#appBody {
    --surface-card: #111c2b; --surface-subcard: #172335; --surface-input: #101a29;
    --border-default: #29384c; --border-subtle: #263449;
    --ink: #f0f5fc; --ink-secondary: #b6c3d4; --ink-muted: #a5b4c8;
    --tone-income: #5ee0b0; --tone-expense: #ffa3b5; --tone-gold: #f5cb75; --tone-investment: #b7bfff;
    --app-shadow: 0 6px 24px rgba(0, 5, 15, .18);
    background: #0b1320 !important; color: var(--ink) !important; padding: 0 !important;
    -webkit-font-smoothing: antialiased;
}
html[data-theme="light"] body#appBody, body#appBody.theme-light {
    --surface-card: #fff; --surface-subcard: #f4f7fb; --surface-input: #f8fafc;
    --border-default: #dce4ee; --border-subtle: #e4eaf2;
    --ink: #172338; --ink-secondary: #475970; --ink-muted: #52647a;
    --tone-income: #006a4a; --tone-expense: #b21840; --tone-gold: #86530b; --tone-investment: #4834b5;
    --app-shadow: 0 5px 22px rgba(28, 48, 79, .045);
    background: #f3f6fa !important; color: var(--ink) !important;
}
body#appBody :is(.glass-card, .zad-card, .asset-card, .nw-card) {
    background: var(--surface-card) !important; border-color: var(--border-default) !important;
    box-shadow: var(--app-shadow) !important; border-radius: 18px !important; color: var(--ink) !important;
}
body#appBody .zad-subcard { background: var(--surface-subcard) !important; border-color: var(--border-subtle) !important; }
body#appBody :is(.text-white, .text-slate-100, .text-slate-200) { color: var(--ink) !important; }
body#appBody :is(.text-slate-300, .zad-text-secondary) { color: var(--ink-secondary) !important; }
body#appBody :is(.text-slate-400, .text-slate-500, .zad-text-muted, .zad-badge-subtle, .zad-btn-ghost) { color: var(--ink-muted) !important; }
body#appBody :is(.text-emerald-300, .text-emerald-400, .text-emerald-500, .text-green-400, .nw-pos, .asset-pl.pos) { color: var(--tone-income) !important; }
body#appBody :is(.text-rose-300, .text-rose-400, .text-rose-500, .text-red-400, .nw-neg, .nw-hero-neg, .asset-pl.neg) { color: var(--tone-expense) !important; }
body#appBody :is(.text-amber-200\/80, .text-amber-300, .text-amber-400, .text-amber-500, .text-yellow-400, .accent-text, .asset-currency, .site-text-link) { color: var(--tone-gold) !important; }
body#appBody :is(.text-indigo-300, .text-indigo-400, .text-blue-400, .nw-info) { color: var(--tone-investment) !important; }
body#appBody :is(.bg-black\/20, .bg-black\/25, .bg-black\/30, .bg-black\/40, .bg-black\/50, .bg-slate-800, .bg-slate-800\/40, .bg-slate-950\/60) { background-color: var(--surface-subcard) !important; border-color: var(--border-subtle) !important; }
body#appBody :is(input, select, textarea) {
    background-color: var(--surface-input) !important; color: var(--ink) !important; border-color: var(--border-default) !important;
    min-height: 46px; border-radius: 12px; line-height: 1.5;
}
body#appBody :is(input, textarea)::placeholder { color: var(--ink-muted) !important; opacity: 1; }
body#appBody input:is([type="checkbox"], [type="radio"]) { min-height: 18px; width: 18px; height: 18px; flex-shrink: 0; }
body#appBody label:is([for="regAgreeGmail"], [for="regTerms"]) { min-height: 44px; }
body#appBody select option, body#appBody select optgroup { background: var(--surface-card) !important; color: var(--ink) !important; }
body#appBody :is(.border-white\/5, .border-white\/10, .border-slate-700\/30) { border-color: var(--border-subtle) !important; }
body#appBody :is(.accent-bg, button.bg-amber-500, button.bg-amber-600) { background: #f6be50 !important; color: #182335 !important; }
body#appBody :is(.accent-bg, button.bg-amber-500, button.bg-amber-600) :is(span, svg) { color: #182335 !important; }
body#appBody :is(button.bg-rose-600, button.bg-rose-500) { background: #bc1742 !important; color: #fff !important; }
body#appBody :is(button.bg-emerald-600, button.bg-emerald-500) { background: #047857 !important; color: #fff !important; }
body#appBody :is(button.bg-rose-600, button.bg-rose-500, button.bg-emerald-600, button.bg-emerald-500) :is(span, svg) { color: #fff !important; }
body#appBody .zad-btn-subtle { color: var(--ink) !important; background: var(--surface-subcard) !important; border-color: var(--border-default) !important; }
body#appBody :is(.mini-action, .modal-close) { color: var(--ink-secondary) !important; background: var(--surface-subcard) !important; border-color: var(--border-default) !important; }
body#appBody :is(.asset-pl.zero, .asset-cell small, .asset-secondary-val) { color: var(--ink-muted) !important; }
body#appBody .asset-secondary-val { font-size: 12px; }
body#appBody .asset-cell, body#appBody .nw-cell { background: var(--surface-subcard) !important; }
body#appBody .asset-head { background: transparent !important; }
body#appBody .asset-hero-value { color: var(--ink) !important; }
body#appBody :is(.asset-label, .asset-hero-label, .asset-cell-label, .nw-label, .nw-currency) { color: var(--ink-secondary) !important; }
body#appBody .asset-cell-label { font-size: 12px; line-height: 1.6; }
body#appBody .asset-pct-badge { color: var(--tone-gold) !important; border-color: var(--border-default) !important; }
body#appBody .asset-progress-label { color: var(--tone-gold) !important; }
body#appBody .asset-progress-label.is-complete { color: var(--tone-income) !important; }
body#appBody .asset-pct-badge span { opacity: 1; }
body#appBody #tab-planning h3.truncate { white-space: normal; overflow-wrap: anywhere; }
body#appBody #watchlistCardsContainer button:focus-visible,
body#appBody #watchlistCardsContainer .group:focus-within button { opacity: 1 !important; }
body#appBody .asset-btn-buy { background: #047857 !important; color: #fff !important; }
body#appBody .asset-btn-buy :is(span, svg) { color: #fff !important; }
body#appBody .asset-btn-sell { color: var(--tone-expense) !important; }
body#appBody .asset-pl { font-size: 12px; }
body#appBody .asset-cell small { font-size: 11px; }
body#appBody .nw-grid { background: var(--border-subtle) !important; }
body#appBody .nw-hero > span:first-child { color: var(--ink) !important; }
#appContainer { padding: 16px 20px 12px !important; max-width: 1320px !important; }
#appContainer > * + * { margin-top: 16px; }
#appContainer .tab-view > * + * { margin-top: 16px !important; }
#appContainer .tab-view :is(.zad-card, .glass-card) { padding: 16px !important; }
#appContainer header.finance-header { position: relative; flex-wrap: nowrap !important; padding: 8px 12px !important; margin-bottom: 0 !important; border-radius: 14px !important; gap: 8px; }
.finance-brand { gap: 8px !important; }
.finance-logo-frame { background: transparent !important; border: 0 !important; padding: 0 !important; box-shadow: none !important; border-radius: 0 !important; }
.finance-wordmark { display: block; width: 160px; height: 32px; object-fit: cover; }
.finance-header .finance-logo-frame { width: 36px; height: 36px; }
.finance-header .finance-wordmark { width: 110px; height: 22px; }
.finance-brand-copy p { letter-spacing: .09em !important; font-size: 10px !important; }
.finance-header-tools { gap: 2px !important; width: auto !important; }
body#appBody .finance-header .btn-pill { border-radius: 12px; background: var(--surface-subcard) !important; color: var(--ink-secondary) !important; border: 1px solid var(--border-subtle) !important; }
body#appBody .finance-header .btn-pill:hover { border-color: #c49c55 !important; }
body#appBody .finance-header .btn-pill svg { color: inherit !important; }
body#appBody #syncStatus { background: transparent !important; border: 0; color: var(--tone-income) !important; }
body#appBody #bottomNavBar:not(.hidden) { background: var(--surface-card) !important; border: 1px solid var(--border-default) !important; box-shadow: var(--app-shadow) !important; border-radius: 18px !important; }
body#appBody #bottomNavBar:not(.hidden) button[data-tab] { color: var(--ink-muted) !important; min-height: 48px; font-weight: 600; }
body#appBody #bottomNavBar:not(.hidden) button[data-tab][aria-current="page"] { background: #dca8461c !important; color: var(--tone-gold) !important; }
body#appBody #bottomNavBar:not(.hidden) button[onclick="openTransactionModal()"] { background: #f6be50 !important; color: #172338 !important; border-color: var(--surface-card) !important; box-shadow: 0 4px 12px #b9841722 !important; }
body#appBody #bottomNavBar button[data-tab] span { font-size: 12px !important; }
.finance-overview { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.finance-overview h1 { font-size: 24px; font-weight: 800; line-height: 1.6; color: var(--ink); margin: 0; }
.finance-overview p { font-size: 13px; color: var(--ink-secondary); margin-top: 2px; }
.finance-overview-date { color: var(--ink-secondary); font-size: 12px; white-space: nowrap; }
body#appBody #netWorthCard { background: radial-gradient(ellipse at top right, #b8892922, transparent 65%), #172337 !important; border: 1px solid #374459 !important; box-shadow: 0 8px 28px #0c172610 !important; }
body#appBody #netWorthCard .zad-display-hero { color: #f7faff !important; font-size: clamp(30px, 3.5vw, 44px); font-weight: 800; line-height: 1.3; }
body#appBody #netWorthCard .zad-subcard { background: #ffffff06 !important; border-color: #ffffff14 !important; padding: 12px; }
body#appBody #netWorthCard :is(.text-slate-100, .text-white, .zad-currency-symbol) { color: #f5f8ff !important; }
body#appBody #netWorthCard :is(.zad-text-muted, .zad-text-secondary) { color: #c1cddd !important; }
body#appBody #netWorthCard :is(.text-amber-300, .zad-badge-gold) { color: #f8d68b !important; }
body#appBody #netWorthCard .text-indigo-300 { color: #bec8ff !important; }
body#appBody #netWorthCard .text-emerald-300 { color: #83e5c1 !important; }
body#appBody #netWorthCard .zad-badge-gold { background: #f6be5015 !important; border-color: #f6be5044 !important; }
body#appBody.theme-light #netWorthCard { background: var(--surface-card) !important; border-color: var(--border-default) !important; box-shadow: var(--app-shadow) !important; }
body#appBody.theme-light #netWorthCard :is(.zad-display-hero, .text-slate-100, .text-white, .zad-currency-symbol) { color: var(--ink) !important; }
body#appBody.theme-light #netWorthCard :is(.zad-text-muted, .zad-text-secondary) { color: var(--ink-secondary) !important; }
body#appBody.theme-light #netWorthCard .zad-subcard { background: var(--surface-subcard) !important; border-color: var(--border-subtle) !important; }
body#appBody.theme-light #netWorthCard :is(.text-amber-300, .zad-badge-gold) { color: var(--tone-gold) !important; }
body#appBody.theme-light #netWorthCard .text-indigo-300 { color: var(--tone-investment) !important; }
body#appBody.theme-light #netWorthCard .text-emerald-300 { color: var(--tone-income) !important; }
body#appBody.theme-light #netWorthCard .finance-networth-icon { background: var(--surface-subcard) !important; box-shadow: none !important; }
body#appBody #netWorthCard .finance-liquidity-grid { margin-top: 12px !important; padding-top: 12px !important; }
#netWorthCard .zad-text-caption { max-width: 52ch; }
body#appBody #financialHealthCard { background: var(--surface-card) !important; border-color: var(--border-default) !important; }
.finance-summary-label { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: -8px !important; }
.finance-summary-label h2 { font-size: 15px; font-weight: 700; color: var(--ink); }
.finance-summary-label span { font-size: 12px; color: var(--ink-muted); }
.finance-summary-grid .zad-card { padding: 14px; min-height: 100px; }
.finance-summary-grid .zad-card > div:last-child > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 6px; font-size: clamp(17px, 1.8vw, 25px); line-height: 1.5; }
.finance-summary-grid .currency-symbol { white-space: nowrap; }
#appContainer .zad-text-title-3 { font-size: 16px; line-height: 1.65; }
#appContainer .zad-text-caption { font-size: 13px; line-height: 1.7; }
#appContainer .zad-text-micro { font-size: 12px; line-height: 1.6; }
#appContainer [class~="text-[9px]"], #appContainer [class~="text-[10px]"], #appContainer [class~="text-[11px]"] { font-size: 12px !important; line-height: 1.65 !important; }
#monthComparisonCard > div:first-child { flex-wrap: wrap; gap: 8px; }
#monthComparisonCard .grid-cols-3 { gap: 10px; }
#monthComparisonCard .zad-subcard { padding: 12px 8px; }
.finance-chart-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.finance-chart-head h2 { font-size: 18px; font-weight: 700; color: var(--ink); }
.finance-chart-head p, .finance-chart-note { font-size: 12px; color: var(--ink-secondary); line-height: 1.8; }
.finance-chart-head select { width: auto; font-size: 13px; min-width: 150px; padding: 8px 12px; }
.finance-chart-wrap { position: relative; height: 220px; }
.finance-chart-empty { display: none; align-items: center; justify-content: center; position: absolute; inset: 0; color: var(--ink-secondary); font-size: 13px; text-align: center; background: var(--surface-card); padding: 20px; border-radius: 14px; }
.finance-chart-wrap.is-empty .finance-chart-empty { display: flex; }
.finance-chart-wrap.is-empty canvas { visibility: hidden; }
.finance-chart-key { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--ink-secondary); }
.finance-chart-key span { display: inline-flex; gap: 8px; align-items: center; }
.finance-chart-key i { width: 9px; height: 9px; border-radius: 3px; background: #158768; }
.finance-chart-key span:nth-child(2) i { background: #d77d48; }
.finance-chart-data { margin-top: 4px; border-top: 1px solid var(--border-subtle); padding-top: 4px; }
.finance-context-note { margin-top: 4px; color: var(--ink-secondary); font-size: 12px; }
.finance-context-note summary { min-height: 36px; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.finance-context-note summary::after { content: '+'; margin-inline-start: auto; }
.finance-context-note[open] summary::after { content: '−'; }
.finance-context-note .finance-chart-note { margin-top: 0; margin-bottom: 8px; }
.finance-chart-data summary { min-height: 44px; display: flex; align-items: center; color: var(--ink-secondary); font-size: 12px; cursor: pointer; }
.finance-chart-data > div { overflow-x: auto; }
.finance-chart-data table { width: 100%; border-collapse: collapse; font-size: 12px; }
.finance-chart-data th, .finance-chart-data td { padding: 10px 8px; text-align: start; border-bottom: 1px solid var(--border-subtle); white-space: nowrap; }
.finance-chart-data th { color: var(--ink-secondary); font-weight: 600; }
.finance-chart-private { display: none; }
body.privacy-mode .finance-chart-wrap canvas { visibility: hidden; }
body.privacy-mode .finance-chart-wrap .finance-chart-empty { display: none; }
body.privacy-mode .finance-chart-private { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; color: var(--ink-secondary); font-size: 13px; background: var(--surface-card); border-radius: 14px; }
body.privacy-mode .finance-chart-data { display: none; }
.finance-chart-note { margin-top: 12px; }
body#appBody .finance-account-row { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px !important; background: var(--surface-subcard) !important; }
.finance-account-row .finance-account-name { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; white-space: normal; overflow-wrap: anywhere; }
.finance-account-actions { margin-inline-start: auto; flex-wrap: wrap; justify-content: flex-end; }
.finance-account-actions .finance-account-balance { font-size: 16px; }
.finance-account-actions button { min-width: 44px; min-height: 44px; opacity: 1 !important; border-radius: 10px; }
body#appBody #chatIconTrigger { width: 46px !important; height: 46px !important; box-shadow: 0 5px 18px #0c172615 !important; background: var(--surface-card) !important; border-color: var(--border-default) !important; }
body#appBody #chatSlidePanel { background: var(--surface-card) !important; color: var(--ink) !important; }
body#appBody.theme-light #chatSlidePanel > div { background: var(--surface-card) !important; border-color: var(--border-default) !important; }
body#appBody.theme-light #unifiedAiHistory { background: var(--surface-subcard) !important; }
body#appBody.theme-light #unifiedAiHistory :is(.bg-slate-800, .bg-slate-800\/90, .bg-slate-900, .bg-black\/30) { background: var(--surface-card) !important; border-color: var(--border-default) !important; }
body#appBody.theme-light #chatSlidePanel button.bg-white\/5 { background: var(--surface-subcard) !important; border-color: var(--border-default) !important; }
body#appBody #unifiedAiHistory .ai-bot-bubble { background: var(--surface-card) !important; color: var(--ink) !important; border-color: var(--border-default) !important; }
body#appBody #unifiedAiHistory .ai-user-bubble { background: var(--surface-subcard) !important; color: var(--ink) !important; border-color: var(--border-default) !important; }
body#appBody .finance-chat-status { border: 2px solid var(--surface-card); box-shadow: none; }
body#appBody .finance-status-dot { display: inline-block; width: 8px; height: 8px; min-width: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--ink-muted); }
body#appBody .finance-status-dot[data-connected="true"] { background: var(--tone-income); }
body#appBody .finance-status-dot[data-state="partial"] { background: var(--tone-gold); }
.finance-quote-time { display: block; color: var(--ink-muted); font-size: 10px; white-space: nowrap; margin-top: 3px; }
.finance-quote-stale { display: block; color: var(--tone-gold); font-size: 9px; }
.finance-watchlist-header { gap: 8px; }
.finance-watchlist-heading { min-width: 0; flex: 1; }
.finance-watchlist-heading > div:first-child { flex-shrink: 0; }
.finance-watchlist-heading > div:last-child { min-width: 0; }
.finance-watchlist-add { flex-shrink: 0; align-items: center; justify-content: center; min-height: 44px; }
.finance-watchlist-add > svg { display: block; flex: 0 0 18px; width: 18px; height: 18px; }
@media (max-width: 640px) { body#appBody .finance-watchlist-add { width: 44px; height: 44px; padding: 0; gap: 0; } .finance-watchlist-add > span { display: none; } }
body#appBody .finance-transaction-badge { display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; line-height: 1.7; padding: 3px 8px; }
body#appBody.theme-light #transactionsTableBody tr:hover { background-color: #f1f5f9 !important; }
body#appBody .finance-chat-camera { display: inline-flex; flex: 0 0 44px; align-items: center; justify-content: center; width: 44px; height: 46px; border: 1px solid var(--border-default); border-radius: 12px; color: var(--ink-secondary); background: var(--surface-subcard); }
body#appBody #unifiedAiInput { min-width: 0; padding-inline: 10px; }
body#appBody .finance-receipt-preview { display: flex; flex-shrink: 0; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--border-default); color: var(--ink-secondary); font-size: 11px; }
body#appBody .finance-receipt-preview.hidden { display: none; }
body#appBody .finance-receipt-preview img { width: 44px; height: 54px; object-fit: cover; border-radius: 8px; }
body#appBody .finance-receipt-preview > div { flex: 1; min-width: 0; }
body#appBody .finance-receipt-preview strong { color: var(--ink); }
body#appBody .finance-receipt-preview p { margin-top: 3px; line-height: 1.6; }
body#appBody #unifiedAiHistory .finance-receipt-thumbnail { display: block; width: 120px; max-height: 150px; object-fit: contain; margin-bottom: 8px; border-radius: 8px; }
body#appBody .finance-ai-review { background: var(--surface-card); color: var(--ink-secondary); border: 1px solid var(--border-default); border-radius: 16px; padding: 14px; width: min(340px, 100%); font-size: 12px; }
body#appBody .finance-ai-review label { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; margin-top: 8px; }
body#appBody .finance-ai-review label :is(input, select) { width: 62%; min-width: 130px; padding: 6px 8px; font-size: 12px; }
body#appBody #zadSplashScreen { background: var(--surface-subcard) !important; }
.finance-splash-logo img { animation: zad-logo-arrive .7s cubic-bezier(.22, 1, .36, 1) both, zad-logo-breathe 2.4s .7s ease-in-out infinite; transform-origin: center; }
@keyframes zad-logo-arrive { from { opacity: 0; transform: translateY(12px) scale(.8) rotate(-12deg); } to { opacity: 1; transform: translateY(0) scale(1) rotate(0); } }
@keyframes zad-logo-breathe { 0%, 100% { transform: translateY(0) scale(1); filter: drop-shadow(0 0 0 transparent); } 50% { transform: translateY(-4px) scale(1.04); filter: drop-shadow(0 5px 12px #b9841740); } }
@media (prefers-reduced-motion: reduce) { .finance-splash-logo img { animation: none; } }
body#appBody .site-footer, body#appBody .site-footer :is(h2, .site-brand) { color: var(--ink-secondary) !important; }
body#appBody .site-footer .store-badge { background: #06090f !important; color: #fff !important; }
body#appBody .site-footer .store-badge span { color: #fcd34d !important; }
body#appBody .site-footer .store-badge strong { color: #fff !important; }
body#appBody .site-footer .site-text-link { color: var(--tone-gold) !important; }
body#appBody .site-footer { margin-top: 36px; border-color: var(--border-default) !important; }
#loginScreen, #registerScreen, #verifyEmailScreen, #verifyPhoneScreen, #offlineStartupScreen { background: var(--surface-subcard) !important; }
#phoneWhatsAppLink[aria-disabled="true"] { opacity: .55; cursor: wait; }
#loginScreen > .glass-card { border-radius: 26px !important; }
body#appBody #toastContainer > div { max-width: min(400px, calc(100vw - 32px)); }
body#appBody #toastContainer .toast {pointer-events:none !important;}
@media (min-width: 768px) { body#appBody #bottomNavBar:not(.hidden) { top: 12px !important; padding: 8px !important; margin-bottom: 24px !important; } }
@media (max-width: 767px) {
    #appContainer { padding: 10px 12px 8px !important; }
    #appContainer > * + *, #appContainer .tab-view > * + * { margin-top: 12px !important; }
    #appContainer .tab-view :is(.zad-card, .glass-card) { padding: 12px !important; }
    #appContainer .tab-view :is(.space-y-4, .space-y-5, .space-y-6) > * + * { margin-top: 12px !important; }
    #appContainer header.finance-header { min-height: 58px; padding: 6px 8px !important; gap: 6px !important; }
    #appContainer header.finance-header .finance-brand { width: auto !important; min-width: 0; flex: 1 1 auto; gap: 6px !important; }
    .finance-header .finance-logo-frame { width: 32px; height: 32px; }
    .finance-header .finance-brand-copy { min-width: 0; }
    .finance-header .finance-wordmark { width: 86px; height: 18px; max-width: 100%; }
    .finance-header .finance-brand-copy p { display: none !important; }
    #appContainer header.finance-header .finance-header-tools { width: auto !important; flex: 0 0 auto; justify-content: flex-end; gap: 2px !important; }
    body#appBody .finance-header .btn-pill { width: 42px !important; min-width: 42px !important; height: 42px !important; min-height: 42px !important; padding: 0 !important; border: 0 !important; background: transparent !important; border-radius: 10px !important; }
    body#appBody .finance-header .btn-pill:hover { background: var(--surface-subcard) !important; }
    body#appBody .finance-header .btn-pill svg { width: 18px; height: 18px; stroke-width: 2; }
    body#appBody .finance-header #syncStatus { position: absolute; inset-inline-start: 31px; top: 39px; padding: 0; width: 8px; min-height: 0; }
    body#appBody .finance-header #syncStatus > span:first-child { width: 6px; height: 6px; box-shadow: 0 0 0 2px var(--surface-card); }
    body#appBody #bottomNavBar:not(.hidden) { width: calc(100% - 24px) !important; max-width: 460px !important; padding: 6px !important; gap: 4px !important; bottom: calc(10px + env(safe-area-inset-bottom)) !important; }
    body#appBody #bottomNavBar:not(.hidden) button[data-tab] { min-height: 54px !important; padding: 6px 4px !important; }
    body#appBody #bottomNavBar:not(.hidden) button[data-tab] span { font-size: 11px !important; }
    body#appBody #bottomNavBar:not(.hidden) button[onclick="openTransactionModal()"] { top: 0 !important; width: 46px !important; height: 46px !important; min-width: 46px !important; min-height: 46px !important; border: 0 !important; margin-inline: 2px !important; }
    .finance-overview h1 { font-size: 20px; }
    #appContainer .finance-description { font-size: 11px !important; line-height: 1.6 !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .finance-overview-date { display: none; }
    body#appBody #netWorthCard .zad-display-hero { font-size: 30px; }
    body#appBody #netWorthCard .zad-subcard { padding: 8px; }
    .finance-summary-grid { gap: 8px; }
    #appContainer .finance-summary-grid .zad-card { padding: 10px !important; min-height: 88px; }
    .finance-summary-grid .zad-text-caption { white-space: normal; font-size: 12px; }
    #monthComparisonCard .grid-cols-3 { grid-template-columns: 1fr; }
    #monthComparisonCard .zad-subcard { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; text-align: start; padding: 12px; }
    #monthComparisonCard .zad-subcard > div { grid-column: 1; grid-row: 1 / 3; justify-content: flex-start; }
    #monthComparisonCard .zad-subcard > strong, #monthComparisonCard .zad-subcard > span { text-align: end; }
    .finance-chart-wrap { height: 190px; }
    .finance-chart-head h2 { font-size: 16px; }
    .finance-chart-head select { min-width: 130px; min-height: 38px; padding-block: 5px; }
    .finance-metrics { grid-template-columns: minmax(0, 1fr) !important; gap: 6px !important; }
    .finance-metrics > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 42px; padding: 8px 10px !important; text-align: start !important; }
    .finance-metrics > div > span:first-child { margin-bottom: 0 !important; font-size: 11px !important; }
    .finance-metrics > div > :is(strong, span:last-child) { font-size: 15px !important; white-space: nowrap; }
    .tab-view :is(.zad-subcard, .nw-card) { padding: 10px !important; }
    #appContainer .asset-head { padding: 10px; }
    #appContainer .asset-hero { padding: 10px 14px; }
    body#appBody .asset-pct-input { min-height: 30px; height: 30px; border-radius: 6px; }
    #appContainer .asset-head-actions { gap: 4px; }
    body#appBody .site-footer { margin-top: 16px !important; }
    #appContainer > .site-footer { padding-inline: 2px; }
    body#appBody #toastContainer { top: auto !important; bottom: calc(86px + env(safe-area-inset-bottom)) !important; left: 50% !important; transform: translateX(-50%) !important; width: max-content; max-width: calc(100vw - 32px); }
    body#appBody [role="dialog"] > .glass-card { border-radius: 24px 24px 0 0 !important; padding: 20px !important; }
    body#appBody [role="dialog"] > .glass-card::before { background: var(--ink-muted) !important; opacity: .35; }
    body#appBody #watchlistCardsContainer button { opacity: 1 !important; min-width: 44px; min-height: 44px; }
}
@media (hover: none) { body#appBody #watchlistCardsContainer button { opacity: 1 !important; min-width: 44px; min-height: 44px; } }
@media (max-width: 359px) { .finance-header .finance-wordmark { width: 62px; height: 14px; } .finance-summary-label { flex-wrap: wrap; gap: 0; } body#appBody #bottomNavBar:not(.hidden) button[data-tab] span { font-size: 10px !important; } }
@media (prefers-reduced-motion: reduce) { body#appBody *, body#appBody *::before, body#appBody *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* Keep navigation in one desktop header; retain the phone's bottom dock. */
#appContainer { overflow-x: clip !important; }
html:has(body#appBody), body#appBody { overflow-x: clip !important; }
body#appBody .finance-chat-prompts { flex-wrap: wrap; gap: 6px; }
body#appBody .finance-chat-prompts button { flex: 0 1 auto; min-height: 40px; font-size: 11px; }
#recentTransactionsList > div { gap: 12px; }
#recentTransactionsList > div > div:first-child { flex: 1; min-width: 0; }
.finance-recent-meta { flex-wrap: wrap; overflow-wrap: anywhere; }
.finance-recent-meta span { min-width: 0; max-width: 100%; }
#healthGradeLabel { display: block; margin-top: 2px; white-space: nowrap; }
@media (min-width: 768px) {
    #appContainer header.finance-header { position: sticky; top: 12px; z-index: 40; gap: 12px; }
    body#appBody .finance-header #bottomNavBar:not(.hidden) {
        position: static !important; flex: 1 1 auto; min-width: 0 !important; width: auto !important;
        margin: 0 !important; padding: 0 !important; gap: 4px !important; justify-content: center !important;
        border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: transparent !important;
    }
    body#appBody .finance-header #bottomNavBar button[data-tab] { min-height: 42px; padding: 8px 10px !important; gap: 6px !important; }
    body#appBody .finance-header #bottomNavBar button[data-tab] span { font-size: 12px !important; }
    body#appBody .finance-header #bottomNavBar button[onclick="openTransactionModal()"] {
        width: 42px !important; min-width: 42px !important; max-width: 42px !important; min-height: 42px !important;
        padding: 0 !important; margin-inline-start: 4px !important;
    }
    .finance-header .desktop-add-label { display: none; }
    .finance-header #userName { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (min-width: 768px) and (max-width: 1279px) {
    body#appBody .finance-header .btn-pill { width: 42px; min-width: 42px; padding: 0; }
    .finance-header .btn-pill > span, .finance-header #syncStatus > span:last-child { display: none !important; }
    .finance-header #syncStatus { padding-inline: 0; }
}
@media (min-width: 768px) and (max-width: 1023px) {
    .finance-header #bottomNavBar button[data-tab] > span { display: none; }
    body#appBody .finance-header #bottomNavBar button[data-tab] { min-width: 42px; padding: 8px !important; }
}
@media (max-width: 420px) {
    #modalExpenseForm > .grid { grid-template-columns: minmax(0, 1fr); }
    body#appBody .asset-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 10px; }
    body#appBody .asset-identity { display: contents; }
    body#appBody .asset-name-wrap { grid-column: 1 / -1; grid-row: 2; }
    body#appBody .asset-head-actions { grid-column: 2; grid-row: 1; flex-wrap: nowrap; }
    body#appBody .asset-type-select { padding-inline: 10px; font-size: 13px; }
    body#appBody .asset-name-input { font-size: 14px; padding-inline: 10px; }
}
@media (max-width: 767px) {
    #appContainer > .site-footer .site-footer-brand { display: none; }
    #appContainer > .site-footer nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    #appContainer > .site-footer nav > a:first-of-type { display: none; }
}

@media (max-width: 1023px) {
    #exportSection thead { display: none !important; }
    body#appBody #exportSection tbody tr:has(td:nth-child(9)) { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 12px !important; margin-bottom: 8px !important; background: var(--surface-card) !important; border-color: var(--border-default) !important; border-radius: 14px !important; }
    body#appBody #exportSection tbody tr td { min-width: 0; padding: 0 !important; border: 0 !important; width: auto !important; }
    body#appBody #exportSection tbody tr:has(td:nth-child(9)) td { display: block !important; text-align: start !important; }
    body#appBody #exportSection tbody td::before { display: none !important; }
    #exportSection tbody tr td:nth-child(1) { grid-area: 1 / 1; color: var(--ink-muted); font-size: 12px; }
    #exportSection tbody tr td:nth-child(2) { grid-area: 1 / 2; text-align: end !important; }
    #exportSection tbody tr td:nth-child(3) { grid-area: 2 / 1; font-size: 14px; font-weight: 700; }
    #exportSection tbody tr td:nth-child(4) { grid-area: 3 / 1; font-size: 12px; color: var(--ink-muted); }
    #exportSection tbody tr td:nth-child(5) { grid-area: 3 / 2; font-size: 12px; text-align: end !important; }
    #exportSection tbody tr td:nth-child(6) { grid-area: 4 / 1 / auto / 3; font-size: 13px; overflow-wrap: anywhere; }
    #exportSection tbody tr td:nth-child(7) { grid-area: 2 / 2; font-size: 14px; text-align: end !important; }
    #exportSection tbody tr td:nth-child(8) { grid-area: 5 / 1; }
    #exportSection tbody tr td:nth-child(9) { grid-area: 5 / 2; }
    #exportSection tbody tr td:nth-child(9) > div { justify-content: flex-end; gap: 4px; }
    #exportSection tbody tr td:nth-child(9) button { min-width: 44px; }
}

/* Authenticated Android security controls use the same palette as the website. */
.native-security-card { padding: 16px; border: 1px solid var(--border-default); border-radius: 18px; background: var(--surface-subcard); }
.native-security-card[hidden] { display: none; }
.native-security-heading, .native-security-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.native-security-heading { justify-content: flex-start; }
.native-security-heading svg { width: 22px; height: 22px; color: var(--tone-gold); }
.native-security-heading h4 { margin: 0; font-weight: 700; color: var(--ink); }
.native-security-card p, .native-security-row span { font-size: 12px; color: var(--ink-muted); line-height: 1.7; }
.native-security-card p { margin: 8px 0 12px; }
.native-primary-button, .native-secondary-button, .native-text-button { font: inherit; cursor: pointer; min-height: 44px; padding: 10px 16px; border-radius: 14px; font-size: 13px; font-weight: 700; transition: opacity .18s, transform .18s; }
.native-primary-button { background: #f6be50; color: #182335; border: 1px solid transparent; }
.native-secondary-button { background: var(--surface-card); color: var(--ink); border: 1px solid var(--border-default); }
.native-text-button { background: transparent; color: var(--tone-gold); border: 0; padding-inline: 0; margin-top: 8px; }
.native-primary-button:disabled, .native-secondary-button:disabled { opacity: .6; cursor: wait; }
.native-biometric-dialog { width: min(360px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; margin: auto; padding: 28px 24px; background: var(--surface-card); color: var(--ink); border: 1px solid var(--border-default); border-radius: 24px; text-align: center; box-shadow: 0 24px 80px #0004; }
.native-biometric-dialog::backdrop { background: #060c17a6; backdrop-filter: blur(6px); }
.native-biometric-dialog img { margin: 0 auto 18px; object-fit: contain; }
.native-biometric-dialog h2 { font-size: 19px; font-weight: 800; line-height: 1.6; margin: 0 0 10px; }
.native-biometric-dialog p { color: var(--ink-muted); font-size: 13px; line-height: 1.85; margin: 0 0 20px; }
.native-biometric-dialog button { display: block; width: 100%; margin-top: 10px; }
.native-biometric-dialog small { display: block; color: var(--ink-muted); font-size: 11px; line-height: 1.7; margin-top: 18px; }
.stock-market-selector, .stock-picker-search { flex-shrink: 0; }
.stock-market-selector label, .stock-picker-search label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 7px; color: var(--text-primary, #f8fafc); }
.stock-market-selector select, .stock-picker-search input { width: 100%; min-height: 44px; border-radius: 12px; border: 1px solid rgba(148, 163, 184, .25); background: rgba(0, 0, 0, .25); color: #f8fafc; padding: 10px 12px; font: inherit; font-size: 13px; }
.stock-market-selector select option { background: #0f172a; color: #f8fafc; }
.stock-market-selector select:focus-visible, .stock-picker-search input:focus-visible, .stock-picker-follow:focus-visible { outline: 2px solid #818cf8; outline-offset: 2px; }
.stock-market-selector p { color: #94a3b8; font-size: 11px; line-height: 1.65; margin: 8px 0 0; }
.stock-picker-search input:disabled { opacity: .5; cursor: not-allowed; }
.stock-picker-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid rgba(148, 163, 184, .12); border-radius: 12px; background: rgba(0, 0, 0, .2); }
.stock-picker-company { min-width: 0; }
.stock-picker-company strong { display: block; font-size: 12px; color: #f8fafc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stock-picker-company span { display: block; font-size: 10px; color: #94a3b8; margin-top: 4px; }
.stock-picker-follow { flex-shrink: 0; display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 44px; min-width: 70px; padding: 6px 9px; color: #c7d2fe; background: rgba(99, 102, 241, .18); border: 1px solid rgba(99, 102, 241, .3); border-radius: 10px; font-size: 12px; font-weight: 700; }
.stock-picker-follow.is-added { color: #6ee7b7; background: rgba(16, 185, 129, .12); border-color: rgba(16, 185, 129, .3); }
.stock-picker-empty { padding: 24px 10px; color: #94a3b8; font-size: 12px; line-height: 1.7; text-align: center; }
html[data-theme="light"] .stock-market-selector label, html[data-theme="light"] .stock-picker-search label, html[data-theme="light"] .stock-picker-company strong { color: #0f172a; }
html[data-theme="light"] .stock-market-selector select, html[data-theme="light"] .stock-picker-search input, html[data-theme="light"] .stock-market-selector select option { background: #fff; color: #0f172a; border-color: #cbd5e1; }
html[data-theme="light"] .stock-picker-row { background: #f8fafc; border-color: #e2e8f0; }
html[data-theme="light"] .stock-market-selector p, html[data-theme="light"] .stock-picker-company span, html[data-theme="light"] .stock-picker-empty { color: #64748b; }
html[data-theme="light"] .stock-picker-follow { color: #4338ca; background: #eef2ff; border-color: #c7d2fe; }
html[data-theme="light"] .stock-picker-follow.is-added { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
@media (max-width: 480px) { #stockPickerModal > div { padding: 16px; max-height: min(85dvh, 720px); } #stockSearchResults { min-height: 80px; } }

.bank-review-card { border: 1px solid var(--border-default); border-radius: 16px; background: var(--surface-subcard); padding: 14px; color: var(--ink); }
.bank-review-message { font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; max-height: 140px; overflow-y: auto; }
.bank-review-reason { font-size: 11px; line-height: 1.6; color: var(--ink-muted); margin: 8px 0 12px; }
.bank-review-fields { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.bank-review-fields label { display: grid; gap: 6px; min-width: 0; font-size: 11px; }
.bank-review-fields :is(input,select) { width: 100%; min-width: 0; min-height: 44px; padding: 8px; border-radius: 10px; border: 1px solid var(--border-default); background: var(--surface-card); color: var(--ink); font-size: 12px; }
.bank-review-fields [hidden] { display: none !important; }
.bank-review-remember { display: flex; align-items: center; gap: 8px; font-size: 11px; margin: 12px 0; }
.bank-review-remember input { width: 18px; height: 18px; flex-shrink: 0; }
.bank-review-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bank-review-actions button { min-height: 44px; padding: 8px 12px; font-size: 12px; border-radius: 10px; border: 1px solid var(--border-default); }
.bank-review-actions button:not(.accent-bg) { color: var(--ink); background: var(--surface-card); }
.bank-review-actions button:disabled { opacity: .6; }
body.privacy-mode :is(.bank-review-message,.bank-review-fields input[name="amount"]) { filter: blur(8px); }
@media (max-width: 767px) { .bank-review-fields { grid-template-columns: repeat(2,minmax(0,1fr)); } }
.spending-total { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:12px 0; color:var(--ink-secondary); }
.spending-total strong { color:var(--ink); font-size:20px; }
.spending-needs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:14px 0; }
.spending-needs > div { background:var(--surface-card); border:1px solid var(--border-default); border-radius:12px; padding:10px; min-width:0; }
.spending-needs span,.spending-needs strong { display:block; font-size:12px; color:var(--ink-secondary); overflow-wrap:anywhere; }
.spending-needs strong { color:var(--ink); margin-top:6px; }
.spending-breakdown { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px 24px; }
.spending-bar-row > div:first-child { display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:12px; color:var(--ink); }
.spending-bar-row strong { flex-shrink:0; font-size:12px; }
.spending-track { height:6px; background:var(--border-default); border-radius:6px; margin-top:8px; overflow:hidden; }
.spending-track span { display:block; height:100%; border-radius:inherit; background:#158768; }
.spending-bar-row small { font-size:11px; color:var(--ink-secondary); }
.spending-actions { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
.spending-actions button { white-space:normal; min-height:44px; }
.spending-actions .zad-btn,.spending-dialog .zad-btn { min-height:44px; padding:10px 14px; border-radius:12px; border:1px solid var(--border-default); font-size:12px; }
body#appBody :is(.spending-actions,.spending-dialog) .zad-btn-primary { background:#087451 !important; color:#fff !important; border-color:#087451 !important; }
.spending-actions .zad-btn-ghost { background:var(--surface-subcard); }
.spending-dialog form > button[type="submit"] { position:sticky; bottom:0; width:100%; margin-top:12px; box-shadow:0 -8px 12px var(--surface-card); }
.spending-dialog { background:var(--surface-card); color:var(--ink); border:1px solid var(--border-default); border-radius:20px; padding:20px; width:min(680px,calc(100% - 24px)); max-height:calc(100dvh - 48px); overflow-y:auto; margin:auto; }
.spending-dialog::backdrop { background:rgba(0,0,0,.65); }
.spending-dialog-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:16px; }
.spending-dialog-head h2 { font-size:16px; }
.spending-dialog label,.expense-split-row label { display:block; min-width:0; font-size:12px; }
.spending-dialog label > span,.expense-split-row label > span { display:block; margin-bottom:6px; color:var(--ink-secondary); }
.spending-dialog select,.spending-dialog input { width:100%; min-width:0; padding:9px; min-height:44px; margin-bottom:10px; }
.expense-split-row { display:grid; grid-template-columns:1fr 1.2fr .7fr 1fr auto; align-items:end; gap:8px; border-block-end:1px solid var(--border-default); padding:10px 0; }
.expense-split-row button { margin-bottom:10px; min-width:40px; min-height:44px; }
body#appBody .finance-ai-review .expense-split-row { grid-template-columns:1fr 1fr; }
body#appBody .finance-ai-review .expense-split-row label { display:block; }
body#appBody .finance-ai-review .expense-split-row :is(input,select) { width:100%; min-width:0; }
body.privacy-mode :is(.spending-total strong,.spending-needs strong) { filter:blur(8px); }
@media(max-width:600px) { .spending-breakdown { grid-template-columns:1fr; } .expense-split-row { grid-template-columns:1fr 1fr; } .expense-split-row > button { grid-column:2; justify-self:end; } .spending-dialog { padding:14px; } .spending-needs > div { padding:8px 6px; } .spending-total strong { font-size:17px; } }

.research-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:12px 0; }
.research-metrics > div { padding:10px; border:1px solid var(--border-default); border-radius:12px; }
.research-metrics span,.research-metrics strong { display:block; font-size:12px; }
.research-metrics strong { margin-top:6px; color:var(--ink); }
#researchResults { font-size:13px; color:var(--ink-secondary); overflow-wrap:anywhere; }
#researchResults h3 { color:var(--ink); margin:12px 0; }
.research-news { display:grid; gap:12px; margin:14px 0; }
.research-news a { color:var(--ink); text-decoration:underline; text-underline-offset:3px; }
.research-news small { display:block; margin-top:4px; }
@media(max-width:600px) { .research-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); } }

.transaction-pagination { display:flex; align-items:center; justify-content:space-between; gap:12px; color:var(--ink-secondary); font-size:12px; }
.transaction-pagination > div { display:flex; gap:4px; flex-shrink:0; }
.transaction-pagination button { min-width:44px; min-height:44px; padding:10px; border:1px solid var(--border-default); border-radius:10px; }
.transaction-pagination button:disabled { opacity:.35; cursor:default; }
html[dir="ltr"] .transaction-pagination svg { transform:rotate(180deg); }
#exportSection { scroll-margin-top:80px; }
.copilot-market { min-width:0; }
.copilot-market[hidden] { display:none; }
.copilot-market h4,.copilot-market-name { font-weight:600; color:var(--ink); }
.copilot-market h4 { font-size:13px; margin-bottom:8px; }
.copilot-market-preview { display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
#researchResults > p { margin:6px 0; }
#researchResults details { margin-top:8px; border-top:1px solid var(--border-default); padding-top:8px; }
#researchResults summary { min-height:36px; cursor:pointer; color:var(--ink); font-size:12px; }
#researchResults details p { white-space:pre-line; margin:8px 0; }

.copilot-market-quote { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 8px; font-size:12px; }
.copilot-market-quote bdi { direction:ltr; }
.copilot-market-quote time { font-size:11px; }
.copilot-market-quote > span { flex-basis:100%; font-size:11px; }

/* Destructive account action remains readable in both themes. */
.account-deletion-card {display:grid;gap:.65rem;padding:1rem;border:1px solid var(--border-color,rgba(148,163,184,.25));border-radius:1rem;}
.account-deletion-card p,#deleteUserDescription {font-size:.85rem;line-height:1.8;}
.deletion-danger {background:#b91c1c!important;color:#fff!important;border-color:#b91c1c!important;}
.deletion-danger:hover {background:#991b1b!important;}
.deletion-confirm {display:flex!important;align-items:flex-start;gap:.65rem;}
.deletion-confirm input {width:1.1rem!important;flex:none;margin-top:.25rem;}
.deletion-actions {display:flex;flex-wrap:wrap;gap:.7rem;}
#deleteUserError {color:#dc2626;font-size:.85rem;}
#deleteUserDialog::backdrop {background:rgba(0,0,0,.65);}

.finance-ai-privacy {font-size:.65rem;line-height:1.6;padding:.5rem .9rem;color:var(--text-muted,#94a3b8);flex-shrink:0;}

/* Keep all three translated type filters inside their mobile segment. */
@media (max-width: 640px) {
  #tab-transactions .type-pill {min-width:0!important;padding-inline:4px!important;font-size:11px!important;white-space:nowrap;}
}

@media (max-width: 360px) {#tab-transactions .transaction-type-pills {grid-column:1 / -1;}}

/* Device engagement preferences share the app's light/dark design tokens. */
.engagement-card { padding:16px; border:1px solid var(--border-default); border-radius:18px; background:var(--surface-subcard); color:var(--ink); }
.engagement-card h4,.engagement-card h5 {font-weight:700;font-size:15px;margin-bottom:8px;}
.engagement-card p {color:var(--ink-secondary);font-size:12px;line-height:1.65;margin:6px 0 12px;}
.engagement-card fieldset {border:0;padding:0;margin:0;min-width:0;}
.engagement-toggle {display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;font-size:13px;cursor:pointer;}
.engagement-toggle input {width:20px;height:20px;flex:0 0 20px;accent-color:var(--tone-gold);}
.engagement-options {padding-inline-start:10px;border-inline-start:2px solid var(--tone-gold);margin:8px 0;}
.engagement-fields {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:8px 0;}
.engagement-fields label,.engagement-goal {display:flex;flex-direction:column;gap:6px;font-size:12px;min-width:0;}
.engagement-card select,.engagement-card input[type=time] {width:100%;min-width:0;min-height:44px;border-radius:10px;padding:8px;background:var(--surface-input,transparent);color:var(--ink);border:1px solid var(--border-default);}
.engagement-card input[type=time] {direction:ltr;}
.engagement-widget-buttons {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-top:12px;}
.engagement-widget-buttons button {min-height:44px;padding:8px 4px;border:1px solid var(--border-default);border-radius:12px;font-size:11px;color:var(--ink);}
.engagement-links {display:flex;gap:8px;flex-wrap:wrap;}
.engagement-summary-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0;}
.engagement-summary-grid div {display:flex;flex-direction:column;gap:6px;min-width:0;}
.engagement-summary-grid strong {font-size:20px;overflow-wrap:anywhere;}
.engagement-summary-grid span {color:var(--ink-secondary);}
.engagement-card :focus-visible {outline:2px solid var(--tone-gold);outline-offset:3px;}
.engagement-card details {margin:6px 0 14px;}
.engagement-card summary {min-height:44px;display:list-item;cursor:pointer;font-size:13px;color:var(--ink-secondary);padding:12px 0;}
.engagement-card h5 {margin-top:14px;}

.service-consent{display:flex;align-items:center;gap:.65rem;min-height:44px;color:var(--ink);font-size:.8rem;cursor:pointer}.service-consent input{width:18px;height:18px;flex:0 0 auto;accent-color:var(--tone-gold)}#fxDataStatus[data-status="stale"],#fxDataStatus[data-status="unavailable"]{color:var(--tone-gold)}

.fx-data-warning{color:var(--tone-gold);font-size:.75rem;border-inline-start:2px solid var(--tone-gold);padding-inline-start:.65rem;margin:0}.fx-data-warning[hidden]{display:none}

/* Account loading is distinct from a confirmed empty account. */
.cloud-load-status:not([hidden]){display:flex;align-items:center;gap:12px;justify-content:space-between;padding:12px 14px;border:1px solid var(--border-default);border-radius:14px;background:var(--surface-card);color:var(--ink-secondary);font-size:13px}
.cloud-load-status p{margin:0;min-width:0}
.cloud-load-status button{flex-shrink:0;min-height:44px;padding:8px 12px;border-radius:10px}
@media(max-width:380px){.cloud-load-status:not([hidden]){flex-wrap:wrap}}

/* Financial confirmation dialogs retain usable controls on narrow screens. */
#reminderPaymentDialog,#financialSettlementDialog{width:min(480px,calc(100vw - 24px));}
.spending-dialog-actions{display:flex;gap:10px;justify-content:flex-end;flex-wrap:wrap;margin-top:16px;}
.spending-dialog-actions button{min-height:44px;padding:10px 16px;}

.market-rise{color:#166534!important;border-radius:8px;}.market-fall{color:#be123c!important;border-radius:8px;}body.theme-dark .market-rise{color:#34d399!important;}body.theme-dark .market-fall{color:#fb7185!important;}
body#appBody.theme-light #appContainer .market-rise{color:#166534!important;}
body#appBody.theme-light #appContainer .market-fall{color:#be123c!important;}
body#appBody.theme-dark #appContainer .market-rise{color:#34d399!important;}
body#appBody.theme-dark #appContainer .market-fall{color:#fb7185!important;}
