/**
 * Оули - Стили
 * Современный дизайн, цветовая схема «Мудрая сова»
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    /* Owl Colors — чуть насыщеннее и контрастнее */
    --bg-primary: #0C1015;
    --bg-secondary: #161C24;
    --surface: #1E252E;
    --surface-hover: #262E39;
    --surface-elevated: #252D38;
    
    --text-primary: #F5EDE0;
    --text-secondary: #B8A990;
    --text-tertiary: #7A6F5C;
    
    --accent-orange: #E09B4D;
    --accent-orange-dim: rgba(224, 155, 77, 0.15);
    --accent-brown: #B8722E;
    --accent-gold: #EBB563;
    
    --accent-green: #6BC46E;
    --accent-green-dim: rgba(107, 196, 110, 0.18);
    --accent-red: #E85A5A;
    --accent-red-dim: rgba(232, 90, 90, 0.18);
    
    --border: rgba(245, 237, 224, 0.06);
    --border-strong: rgba(245, 237, 224, 0.12);
    
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 22px;
    --radius-2xl: 28px;
    --radius-full: 9999px;
    
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 20px;
    --spacing-2xl: 24px;
    --spacing-3xl: 32px;
    
    --header-glass-bg: rgba(22, 28, 36, 0.5);
    --header-glass-filter: blur(20px) saturate(150%);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.5);
    --glow-orange: 0 0 24px rgba(224, 155, 77, 0.35);
    --glow-soft: 0 0 60px rgba(224, 155, 77, 0.08);
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Светлая тема */
html.theme-light {
    --header-glass-bg: rgba(239, 233, 224, 0.55);
    --bg-primary: #F8F5EF;
    --bg-secondary: #EFE9E0;
    --surface: #E5DDD2;
    --surface-hover: #D9CFC2;
    --surface-elevated: #EDE6DC;
    --text-primary: #1A1F26;
    --text-secondary: #4A4F57;
    --text-tertiary: #6B7280;
    --border: rgba(26, 31, 38, 0.08);
    --border-strong: rgba(26, 31, 38, 0.14);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);
}

body {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: pan-y;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

.hidden { display: none !important; }

/* Хедер: эффект стекла (blur под контентом), закругление снизу */
.app-header {
    background: var(--header-glass-bg);
    backdrop-filter: var(--header-glass-filter);
    -webkit-backdrop-filter: var(--header-glass-filter);
    border-radius: 0 0 var(--radius-2xl) var(--radius-2xl);
    padding: var(--spacing-sm) var(--spacing-lg);
    padding-top: max(4vh, calc(8px + env(safe-area-inset-top, 0px)));
    padding-bottom: var(--spacing-md);
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
}
/* Светлая тема: --header-glass-bg задаётся в html.theme-light */
/* На страницах ИИ, Новости, Уведомления — закругление как на главной, нижний край на 10px выше */
.sub-page-active .app-header {
    border-radius: 0 0 var(--radius-2xl) var(--radius-2xl);
    padding-bottom: 20px;
    margin-bottom: 0;
}
/* Подзаголовок внутри app-header: заголовок по центру, «Назад» слева */
.app-header-sub-row {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 600px;
    margin: 0 auto;
    padding: var(--spacing-md) var(--spacing-lg) var(--spacing-lg);
    padding-top: var(--spacing-sm);
    position: relative;
    min-height: 48px;
}
.app-header-sub-row .header-left {
    position: absolute;
    left: var(--spacing-lg);
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}
.app-header-sub-row .header-title {
    margin: 0;
}
.app-header-inner {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
}
.app-header-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    min-width: 0;
}
.app-header-logo-img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    flex-shrink: 0;
}
.app-header-greeting {
    font-size: 17px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.app-header-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}
.app-header-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    position: relative;
    transition: background var(--transition-fast), transform var(--transition-fast);
}
.app-header-icon-btn:hover {
    background: var(--surface-hover);
}
.app-header-icon-btn:active {
    transform: scale(0.95);
}
.app-header-notifications {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-primary);
    border-radius: var(--radius-md);
    position: relative;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background var(--transition-fast), transform var(--transition-fast);
}
.app-header-notifications:hover {
    background: var(--surface-hover);
}
.app-header-notifications:active {
    transform: scale(0.95);
}
.app-header-notifications-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: var(--accent-red);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
}
.app-header-notifications-badge.hidden { display: none !important; }

/* Страница чата с ИИ: контейнер до низа экрана; панель ввода — летающая над страницей */
.ai-chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 56px - 64px - var(--spacing-md) - env(safe-area-inset-bottom, 0px));
    padding-top: 56px;
    padding-bottom: 0;
}
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-lg);
    padding-bottom: 100px;
    min-height: 0;
}
.ai-chat-placeholder {
    text-align: center;
    padding: var(--spacing-3xl) var(--spacing-xl);
    color: var(--text-secondary);
}
.ai-chat-placeholder-icon {
    font-size: 64px;
    margin-bottom: var(--spacing-lg);
    opacity: 0.8;
}
.ai-chat-placeholder-note {
    margin-top: var(--spacing-lg);
    font-size: 14px;
    color: var(--text-tertiary);
}
.ai-chat-input-wrap {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - var(--spacing-xl) * 2);
    max-width: 360px;
    bottom: calc(64px + var(--spacing-md) + 5px + env(safe-area-inset-bottom, 0px));
    display: flex;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: var(--bg-primary);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
    z-index: 10;
}
html.theme-light .ai-chat-input-wrap {
    background: rgba(239, 233, 224, 0.92);
    border: none;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}
.ai-chat-input {
    flex: 1;
    padding: 14px var(--spacing-lg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 16px;
}
.ai-chat-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.ai-chat-send {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--accent-orange);
    color: white;
    border: none;
    font-size: 20px;
    cursor: pointer;
}
.ai-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Список уведомлений в приложении */
.notification-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: var(--surface);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-sm);
    border-left: 4px solid transparent;
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast);
}
.notification-item:active {
    transform: scale(0.99);
    background: var(--surface-hover);
}
.notification-item.unread { border-left-color: var(--accent-orange); }
.notification-item .notification-item-title { font-weight: 600; margin-bottom: 4px; }
.notification-item .notification-item-body { font-size: 14px; color: var(--text-secondary); }
.notification-item .notification-item-date { font-size: 12px; color: var(--text-tertiary); margin-top: 8px; }
.notification-item.has-content::after { content: ' ›'; color: var(--accent-orange); }

/* Контент ближе к app-header */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    padding-top: var(--spacing-md);
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
}

/* ========== LOADING ========== */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2xl);
    z-index: 9999;
}

.logo-container {
    width: 120px;
    height: 120px;
    background: linear-gradient(145deg, var(--accent-orange), var(--accent-brown));
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-xl), var(--glow-orange), inset 0 1px 0 rgba(255,255,255,0.15);
    animation: float 2.5s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--border);
    border-top-color: var(--accent-orange);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.init-error-block {
    text-align: center;
    padding: var(--spacing-2xl);
    max-width: 320px;
}
.init-error-block.hidden { display: none !important; }
.init-error-text {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}
.init-error-hint {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: var(--spacing-xl);
}

/* ========== HEADER ========== */
.header {
    background: var(--bg-secondary);
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Подзаголовок на странице (например Юридическая): липкий, тот же фон что app-header */
.page-sub-header {
    position: sticky;
    top: calc(max(12vh, calc(16px + env(safe-area-inset-top, 0px))) + 100px);
    z-index: 9;
    background: var(--header-glass-bg);
    backdrop-filter: var(--header-glass-filter);
    -webkit-backdrop-filter: var(--header-glass-filter);
    border-radius: 0 0 var(--radius-2xl) var(--radius-2xl);
    border-bottom: none;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.header-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.2s;
}

.icon-btn:active {
    transform: scale(0.95);
    background: var(--surface-hover);
}

/* ========== BALANCE CARD ========== */
.balance-card {
    background: linear-gradient(145deg, #D4914A 0%, var(--accent-brown) 50%, #8B4E1F 100%);
    border-radius: var(--radius-2xl);
    padding: var(--spacing-2xl);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-xl), var(--glow-orange), inset 0 1px 0 rgba(255,255,255,0.12);
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-fast), box-shadow var(--transition-normal);
}

.balance-card::before {
    content: '';
    position: absolute;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(255,255,255,0.18) 0%, transparent 65%);
    top: -60%;
    right: -30%;
    pointer-events: none;
}

.balance-card::after {
    content: '';
    position: absolute;
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    bottom: -20%;
    left: -10%;
    pointer-events: none;
}

.balance-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.balance-label {
    font-size: 13px;
    font-weight: 600;
    opacity: 0.92;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.balance-period {
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    backdrop-filter: blur(8px);
}

.balance-amount {
    font-size: 40px;
    font-weight: 800;
    margin-bottom: var(--spacing-lg);
    letter-spacing: -0.03em;
    line-height: 1.1;
    text-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.balance-amount-tappable {
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.balance-card.balance-hidden .balance-amount {
    font-variant-numeric: tabular-nums;
}
.balance-currency-cards {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}
.balance-currency-card {
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm) var(--spacing-lg);
    display: flex;
    align-items: baseline;
    gap: var(--spacing-sm);
    min-width: 0;
    backdrop-filter: blur(6px);
}
.balance-currency-sym {
    font-size: 16px;
    font-weight: 700;
    opacity: 0.95;
}
.balance-currency-sum {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.balance-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
}

.balance-change {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.22);
    border-radius: var(--radius-full);
    font-weight: 700;
    backdrop-filter: blur(6px);
}

/* ========== STATS ========== */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
    min-width: 0;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    min-width: 0;
    overflow: hidden;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.stat-card:active {
    transform: scale(0.98);
}

.stat-card .stat-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stat-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--surface-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.stat-value {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.stat-value.income { color: var(--accent-green); }
.stat-value.expense { color: var(--accent-red); }

.stat-trend {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 6px;
    font-weight: 500;
}

/* ========== CATEGORY DASHBOARD (donut) ========== */
.category-dashboard-card {
    margin-bottom: var(--spacing-xl);
}

.category-dashboard-type-tabs {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.category-dashboard-type-tab {
    flex: 1;
    padding: 8px var(--spacing-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.category-dashboard-type-tab.active {
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-brown));
    border-color: transparent;
    color: white;
}

.category-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.category-dashboard-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
    color: var(--text-primary);
}

.category-dashboard-filter-wrap {
    position: relative;
}

.category-dashboard-filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.category-dashboard-filter-btn:hover {
    background: var(--surface-elevated);
    border-color: var(--border-strong);
}

.category-dashboard-filter-chevron {
    transition: transform var(--transition-fast);
}

.category-dashboard-filter-wrap.open .category-dashboard-filter-chevron {
    transform: rotate(180deg);
}

.category-dashboard-filter-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    min-width: 140px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 20;
    overflow: hidden;
}

.category-dashboard-filter-dropdown.hidden {
    display: none !important;
}

.category-dashboard-filter-option {
    display: block;
    width: 100%;
    padding: 10px 14px;
    text-align: left;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.category-dashboard-filter-option:hover {
    background: var(--surface-hover);
}

.category-dashboard-chart-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) 0;
    touch-action: pan-y;
}

.category-dashboard-donut-wrap {
    position: relative;
    width: 100%;
    max-width: 280px;
    aspect-ratio: 1;
}

.category-dashboard-chart {
    width: 100% !important;
    height: 100% !important;
    max-height: 280px;
}

.category-dashboard-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.category-dashboard-period-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 4px;
}

.category-dashboard-total {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.category-dashboard-total.income {
    color: var(--accent-green);
}

.category-dashboard-total.expense {
    color: var(--accent-red);
}

.category-dashboard-nav {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 24px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.category-dashboard-nav:hover {
    background: var(--surface-hover);
}

.category-dashboard-nav:active {
    transform: scale(0.92);
}

.category-dashboard-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    justify-content: center;
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border);
}

.category-dashboard-legend-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.category-dashboard-legend-pill-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.category-dashboard-legend-empty {
    color: var(--text-tertiary);
    font-size: 14px;
    padding: var(--spacing-lg);
    text-align: center;
}

/* ========== CARD ========== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
    margin-bottom: var(--spacing-xl);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.card-action {
    color: var(--accent-orange);
    font-size: 13px;
    font-weight: 700;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    background: var(--accent-orange-dim);
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.card-action:active {
    transform: scale(0.96);
}

/* ========== ACCOUNTS PREVIEW (Твои счета и карты) ========== */
.accounts-preview-card {
    padding: var(--spacing-xl);
}

.accounts-preview-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.accounts-preview-list {
    margin-bottom: var(--spacing-md);
}

.account-preview-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.account-preview-row:last-child {
    border-bottom: none;
}

.account-preview-row:active {
    background: var(--surface-hover);
}

.accounts-preview-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.accounts-preview-icon-cash {
    background: rgba(130, 199, 133, 0.2);
}

.account-preview-logo {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-hover);
}

.account-preview-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.account-preview-info {
    flex: 1;
    min-width: 0;
}

.account-preview-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: block;
}

.account-preview-type {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    display: block;
    margin-top: 2px;
}

.account-preview-balance {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.account-preview-amount {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.account-preview-currency {
    font-size: 14px;
    color: var(--text-secondary);
}

.accounts-preview-open {
    display: block;
    width: 100%;
    padding: var(--spacing-md);
    background: transparent;
    border: none;
    font-size: 14px;
    color: var(--text-tertiary);
    cursor: pointer;
    text-align: center;
    transition: color var(--transition-fast);
}

.accounts-preview-open:hover,
.accounts-preview-open:active {
    color: var(--accent-orange);
}

.accounts-preview-empty {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-tertiary);
    font-size: 14px;
}

/* ========== OPERATIONS ========== */
#pageOperations .container > .card {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin-bottom: var(--spacing-xl);
}

#pageOperations #allOperations {
    display: flex;
    flex-direction: column;
    gap: 0;
}

#pageOperations .operation-item {
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    border-bottom: 1px solid var(--border);
}

#pageOperations .operation-item:first-child {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

#pageOperations .operation-item:last-child {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    border-bottom: none;
}

.operation-item {
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    display: flex;
    gap: 14px;
    margin-bottom: var(--spacing-md);
    cursor: pointer;
    transition: border-color var(--transition-fast), transform var(--transition-fast), background var(--transition-fast);
}

.operation-item:active {
    transform: scale(0.98);
    background: var(--surface-hover);
}

.operation-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.operation-icon.income {
    background: var(--accent-green-dim);
}

.operation-icon.expense {
    background: var(--accent-red-dim);
}

.operation-info {
    flex: 1;
    min-width: 0;
}

.operation-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.operation-meta {
    font-size: 13px;
    color: var(--text-tertiary);
}

.operation-amount {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.operation-amount.income { color: var(--accent-green); }
.operation-amount.expense { color: var(--accent-red); }

/* ========== CATEGORIES ========== */
.category-section {
    margin-bottom: var(--spacing-2xl);
}

.category-section:last-child {
    margin-bottom: 0;
}

.category-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.category-item {
    margin-bottom: var(--spacing-lg);
}

.category-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
    font-size: 14px;
}

.category-name {
    font-weight: 600;
}

.category-value {
    color: var(--text-secondary);
}

.category-bar {
    height: 8px;
    background: var(--surface-hover);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.category-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-bar-fill.expense {
    background: linear-gradient(90deg, var(--accent-red), #F08080);
}

.category-bar-fill.income {
    background: linear-gradient(90deg, var(--accent-green), #81C784);
}

/* ========== PERIOD SELECTOR ========== */
.period-selector {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
}

.analytics-custom-range {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}
.analytics-custom-range .analytics-range-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 14px;
    color: var(--text-secondary);
}
.analytics-custom-range .form-input { width: 140px; }

.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    font-size: 12px;
}
.heatmap-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    min-height: 28px;
}
.heatmap-cell.heatmap-empty { background: var(--surface); opacity: 0.4; }

/* Вкладка «Операции»: те же логика и стили, что у фильтров новостей — стеклянные кнопки, контейнер по центру */
#periodSelector {
    justify-content: center;
    background: transparent;
    padding: var(--spacing-md) 0;
    margin-bottom: var(--spacing-lg);
}
#periodSelector .period-btn {
    padding: 10px 16px;
    border-radius: 20px;
    border: 2px solid var(--border);
    background: var(--header-glass-bg);
    backdrop-filter: var(--header-glass-filter);
    -webkit-backdrop-filter: var(--header-glass-filter);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
}
#periodSelector .period-btn:hover,
#periodSelector .period-btn.active {
    border-color: var(--accent-orange);
    background: rgba(207, 132, 58, 0.25);
    backdrop-filter: var(--header-glass-filter);
    -webkit-backdrop-filter: var(--header-glass-filter);
    color: var(--accent-orange);
}
#periodSelector .period-btn.active {
    border-color: var(--accent-orange);
}

.period-btn {
    padding: 10px var(--spacing-lg);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.period-btn:active {
    transform: scale(0.97);
}

.period-btn.active {
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-brown));
    border-color: transparent;
    color: white;
    box-shadow: var(--shadow-sm);
}

/* ========== OPERATIONS FILTERS (dropdowns) ========== */
.operations-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    justify-content: center;
}

.operations-filter-wrap {
    position: relative;
}

.operations-filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: var(--header-glass-bg);
    backdrop-filter: var(--header-glass-filter);
    -webkit-backdrop-filter: var(--header-glass-filter);
    border: 2px solid var(--border);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.operations-filter-btn:hover {
    border-color: var(--accent-orange);
    background: rgba(224, 155, 77, 0.2);
}

.operations-filter-chevron {
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

.operations-filter-wrap.open .operations-filter-chevron {
    transform: rotate(180deg);
}

.operations-filter-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 180px;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    padding: var(--spacing-sm);
    max-height: 280px;
    overflow-y: auto;
}

.operations-filter-dropdown.hidden {
    display: none !important;
}

.operations-filter-option {
    display: block;
    width: 100%;
    padding: 10px 14px;
    text-align: left;
    background: none;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.operations-filter-option:hover {
    background: var(--surface-hover);
}

.operations-filter-option.active {
    background: var(--accent-orange-dim);
    color: var(--accent-orange);
}

.operations-filter-custom-dates {
    padding: var(--spacing-md);
    border-top: 1px solid var(--border);
    margin-top: var(--spacing-sm);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.operations-filter-custom-dates.hidden {
    display: none !important;
}

.operations-filter-date-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 13px;
    color: var(--text-secondary);
}

.operations-filter-date {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 14px;
}

.operations-filter-apply {
    padding: 10px 14px;
    background: linear-gradient(145deg, var(--accent-orange), var(--accent-brown));
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: var(--spacing-sm);
}

.operations-filter-dropdown-accounts {
    min-width: 220px;
}

.operations-filter-option-account {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 10px 14px;
    text-align: left;
    background: none;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    width: 100%;
}

.operations-filter-option-account:hover {
    background: var(--surface-hover);
}

.operations-filter-option-account input {
    margin: 0;
}

.operations-filter-reset {
    padding: 10px 14px;
    background: transparent;
    border: 2px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color var(--transition-fast), color var(--transition-fast);
}

.operations-filter-reset:hover {
    border-color: var(--accent-orange);
    color: var(--accent-orange);
}

.categories-tabs, .legal-tabs, .analytics-tabs {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}
.categories-tab, .legal-tab, .analytics-tab {
    flex: 1;
    padding: 10px var(--spacing-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.categories-tab:hover, .legal-tab:hover, .analytics-tab:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}
.categories-tab:active, .legal-tab:active, .analytics-tab:active {
    transform: scale(0.98);
}
.categories-tab.active, .legal-tab.active, .analytics-tab.active {
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-brown));
    border-color: transparent;
    color: white;
}

/* ========== NEWS ========== */
.news-page-layout {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 140px - 80px - env(safe-area-inset-bottom, 0px));
    min-height: 0;
}
/* Фильтры закреплены при скролле; карточки новостей пролетают под ними и под app-header */
.news-filter-static {
    position: fixed;
    left: 0;
    right: 0;
    top: calc(max(12vh, 16px + env(safe-area-inset-top, 0px)) + 148px);
    padding: var(--spacing-md) var(--spacing-lg);
    padding-bottom: var(--spacing-sm);
    background: transparent;
    display: flex;
    justify-content: center;
    z-index: 10;
}
.news-filter-static .news-categories-chips {
    margin-bottom: 0;
}
.news-list-scroll {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    background: var(--bg-primary);
    margin-top: 0;
    padding-top: 56px;
}
.news-list-scroll .container {
    padding: 0 var(--spacing-md);
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
    max-width: 600px;
    margin: 0 auto;
}
.news-list-scroll #newsList.card {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
    border-radius: 0;
}
.news-categories-chips {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    margin-bottom: var(--spacing-md);
}
.news-categories-chips::-webkit-scrollbar { height: 4px; }
.news-categories-chips::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.news-chip {
    padding: 10px 16px;
    border-radius: 20px;
    border: 2px solid var(--border);
    background: var(--header-glass-bg);
    backdrop-filter: var(--header-glass-filter);
    -webkit-backdrop-filter: var(--header-glass-filter);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.news-chip:hover, .news-chip.active {
    border-color: var(--accent-orange);
    background: rgba(207, 132, 58, 0.25);
    backdrop-filter: var(--header-glass-filter);
    -webkit-backdrop-filter: var(--header-glass-filter);
    color: var(--accent-orange);
}

.news-list-scroll .news-item {
    border-radius: var(--radius-lg);
    margin-left: 0;
    margin-right: 0;
}
.news-item {
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: var(--spacing-md);
    cursor: pointer;
    transition: border-color var(--transition-fast), transform var(--transition-fast), background var(--transition-fast);
}

.news-item:active {
    transform: scale(0.98);
    background: var(--surface-hover);
}

.news-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.news-excerpt {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.news-footer {
    display: flex;
    justify-content: space-between;
}

.news-date {
    font-size: 12px;
    color: var(--text-tertiary);
}

.news-tag {
    font-size: 11px;
    padding: 4px 10px;
    background: rgba(207, 132, 58, 0.15);
    color: var(--accent-orange);
    border-radius: 12px;
    font-weight: 600;
}

/* News Detail */
.news-detail-meta {
    color: var(--text-tertiary);
    font-size: 13px;
    margin-bottom: var(--spacing-lg);
}

.news-detail-title {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: var(--spacing-2xl);
}

.news-detail-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-brown));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    margin-bottom: var(--spacing-2xl);
}

.news-detail-content {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.news-detail-content h2 {
    font-size: 22px;
    font-weight: 700;
    margin: var(--spacing-2xl) 0 var(--spacing-lg);
    color: var(--text-primary);
}

.news-detail-content p {
    margin-bottom: var(--spacing-lg);
}

/* ========== SETTINGS ========== */
.settings-section {
    margin-bottom: var(--spacing-2xl);
}

#pageMore .container {
    padding-top: var(--spacing-xl);
}

#pageMore .settings-section {
    margin-bottom: var(--spacing-2xl);
}


.settings-section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 1px;
}

#pageMore .settings-section-title {
    font-size: 12px;
    letter-spacing: 1.2px;
    color: var(--text-tertiary);
    margin-bottom: var(--spacing-sm);
    padding-left: 2px;
}

.settings-list {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

#pageMore .settings-list {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
}

.settings-item {
    padding: 18px var(--spacing-xl);
    display: flex;
    justify-content: space-between;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
}

#pageMore .settings-item {
    padding: 16px var(--spacing-xl);
    align-items: center;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition-fast), transform var(--transition-fast);
}

#pageMore .settings-item:last-child {
    border-bottom: none;
}

#pageMore .settings-item:active {
    background: var(--surface-hover);
    transform: scale(0.995);
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item:active {
    background: var(--surface);
}

.app-version-roadmap {
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border);
}

.app-version-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) 0;
    margin-bottom: var(--spacing-lg);
}

.app-version-label {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.app-version-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.roadmap-block {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
}

#pageMore .roadmap-block {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: var(--spacing-lg) 0;
}

.roadmap-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.roadmap-list {
    margin: 0;
    padding-left: 20px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
}

.roadmap-list li {
    margin-bottom: 6px;
}

.settings-item-left {
    display: flex;
    gap: 14px;
}

#pageMore .settings-item-left {
    gap: var(--spacing-lg);
    align-items: center;
    flex: 1;
    min-width: 0;
}

.settings-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

#pageMore .settings-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    background: var(--accent-orange-dim);
    font-size: 22px;
    flex-shrink: 0;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

#pageMore .settings-item:active .settings-icon {
    background: rgba(224, 155, 77, 0.25);
}

.settings-label {
    font-size: 16px;
}

#pageMore .settings-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: left;
    display: flex;
    align-items: center;
    min-height: 44px;
}

.settings-value {
    font-size: 14px;
    color: var(--text-tertiary);
}

#pageMore .settings-value {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color var(--transition-fast);
}

#pageMore .settings-item .settings-value {
    display: none;
}

#pageMore .settings-item:active .settings-value {
    color: var(--accent-orange);
}

/* Переключатель темы на вкладке Ещё */
.theme-switcher-wrap {
    flex-shrink: 0;
    cursor: pointer;
    padding: 2px;
    margin: -2px -2px -2px 0;
}

.theme-switcher {
    width: 52px;
    height: 28px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    position: relative;
    transition: background var(--transition-normal), border-color var(--transition-normal);
}

.theme-switcher.light {
    background: linear-gradient(145deg, var(--accent-orange), var(--accent-brown));
    border-color: transparent;
}

.theme-switcher-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: transform var(--transition-normal);
}

.theme-switcher.light .theme-switcher-thumb {
    transform: translateX(24px);
}

html.theme-light .theme-switcher:not(.light) {
    background: var(--surface-elevated);
}

html.theme-light .theme-switcher.light .theme-switcher-thumb {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* ========== PROFILE ========== */
.profile-header {
    text-align: center;
    padding: var(--spacing-3xl) var(--spacing-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    margin-bottom: var(--spacing-xl);
}

#pageMore .profile-header {
    padding: var(--spacing-3xl) var(--spacing-xl);
    background: var(--header-glass-bg);
    backdrop-filter: var(--header-glass-filter);
    -webkit-backdrop-filter: var(--header-glass-filter);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    margin-bottom: var(--spacing-2xl);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.03);
}

html.theme-light #pageMore .profile-header {
    background: rgba(239, 233, 224, 0.7);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.profile-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--accent-orange), var(--accent-brown));
    margin: 0 auto var(--spacing-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 44px;
    box-shadow: var(--shadow-md), var(--glow-orange), inset 0 1px 0 rgba(255,255,255,0.2);
}

#pageMore .profile-avatar {
    width: 96px;
    height: 96px;
    font-size: 48px;
    margin-bottom: var(--spacing-md);
    box-shadow: 0 8px 24px rgba(224, 155, 77, 0.35), inset 0 1px 0 rgba(255,255,255,0.25);
    border: 3px solid rgba(255, 255, 255, 0.15);
    overflow: hidden;
}

.profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.profile-name {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.02em;
}

#pageMore .profile-name {
    font-size: 24px;
    margin-bottom: var(--spacing-xs);
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

html.theme-light #pageMore .profile-name {
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.profile-info {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

#pageMore .profile-info {
    font-size: 14px;
    color: var(--text-tertiary);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.profile-header .btn-subscribe {
    display: block;
    width: 100%;
    max-width: 280px;
    margin: var(--spacing-xl) auto 0;
    padding: 14px 20px;
    background: linear-gradient(145deg, var(--accent-orange), var(--accent-brown));
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.15);
    transition: transform var(--transition-fast), opacity var(--transition-fast);
}
.profile-header .btn-subscribe:active:not(:disabled) {
    transform: scale(0.98);
}
.profile-header .btn-subscribe:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#pageMore .profile-header .btn-subscribe {
    max-width: 260px;
    margin-top: var(--spacing-2xl);
    padding: 16px 24px;
    border-radius: var(--radius-xl);
    font-size: 15px;
    box-shadow: 0 4px 16px rgba(224, 155, 77, 0.3), inset 0 1px 0 rgba(255,255,255,0.2);
}
#pageMore .profile-header .btn-subscribe:disabled {
    opacity: 0.65;
}
#pageMore .profile-header .btn-subscribe.hidden {
    display: none;
}

.subscription-status-wrap {
    max-width: 280px;
    margin: var(--spacing-xl) auto 0;
    padding: 10px 16px;
    text-align: center;
    border-radius: var(--radius-lg);
    background: rgba(129, 199, 132, 0.15);
    border: 1px solid rgba(129, 199, 132, 0.4);
}
.subscription-status-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-green, #81C784);
}
html.theme-light .subscription-status-wrap {
    background: rgba(129, 199, 132, 0.2);
    border-color: rgba(129, 199, 132, 0.5);
}

.profile-subscribe-info {
    display: block;
    width: 100%;
    max-width: 280px;
    margin: var(--spacing-md) auto 0;
    padding: var(--spacing-md);
    background: transparent;
    border: none;
    font-size: 14px;
    color: var(--text-tertiary);
    cursor: pointer;
    text-align: center;
    transition: color var(--transition-fast);
}

.profile-subscribe-info:hover,
.profile-subscribe-info:active {
    color: var(--accent-orange);
}

.subscription-benefits-content .modal-body {
    padding: var(--spacing-xl);
}

.subscription-benefits-list {
    list-style: none;
    margin: 0 0 var(--spacing-xl);
    padding: 0;
}

.subscription-benefits-list li {
    padding: var(--spacing-sm) 0;
    padding-left: 1.5em;
    position: relative;
    color: var(--text-primary);
    line-height: 1.5;
}

.subscription-benefits-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-green);
    font-weight: 700;
}

.subscription-price {
    font-size: 16px;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.subscription-referral {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ========== ACCOUNTS ========== */
.account-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
    cursor: pointer;
}

.account-header {
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.account-card-logo {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-hover);
}

.account-card-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.account-card-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.account-card-info {
    flex: 1;
    min-width: 0;
}

.account-name {
    font-size: 16px;
    font-weight: 600;
    display: block;
}

.account-type {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    display: block;
    margin-top: 2px;
}

.account-balance {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-green);
}

/* ========== BOTTOM NAV ========== */
/* «Летающая» панель: стеклянный эффект как у app-header (blur + полупрозрачность) */
.bottom-nav {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(var(--spacing-md) + env(safe-area-inset-bottom, 0px));
    width: calc(100% - var(--spacing-xl) * 2);
    max-width: 360px;
    height: 64px;
    min-height: 64px;
    padding: 0 var(--spacing-md);
    border-radius: 9999px;
    overflow: visible;
    background: rgba(22, 28, 36, 0.5);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid rgba(245, 237, 224, 0.08);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 500;
    gap: 0;
}

html.theme-light .bottom-nav {
    background: rgba(239, 233, 224, 0.55);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

/* Скользящая подсветка активной вкладки: прямоугольник с закруглёнными краями, с отступом от краёв панели */
.nav-highlight {
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: 0;
    width: 0;
    border-radius: 32px;
    background: rgba(224, 155, 77, 0.22);
    pointer-events: none;
    z-index: 0;
    transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1), width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

html.theme-light .nav-highlight {
    background: rgba(207, 132, 58, 0.2);
}

.nav-item {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm) var(--spacing-lg);
    cursor: pointer;
    color: var(--text-tertiary);
    border: none;
    background: transparent;
    min-width: 58px;
    min-height: 48px;
    margin: 0 -4px;
    border-radius: 9999px;
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.nav-item:active {
    transform: scale(0.92);
}

.nav-item.active {
    color: var(--accent-orange);
}

/* Иконки не меняют вид при выборе — сохраняют оригинальные цвета SVG (Главная, Ещё и др.) */
.nav-icon-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.nav-item-add {
    min-width: 60px;
    min-height: 60px;
    flex-shrink: 0;
}

.nav-item-add .nav-add-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--accent-orange), var(--accent-brown));
    color: white;
    font-size: 26px;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md), var(--glow-orange), inset 0 1px 0 rgba(255,255,255,0.2);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.nav-item-add:active .nav-add-icon {
    transform: scale(0.92);
    box-shadow: var(--shadow-sm), 0 0 12px rgba(224, 155, 77, 0.4);
}

.nav-icon {
    width: 34px;
    height: 34px;
}

.nav-icon svg {
    width: 100%;
    height: 100%;
}

/* Подписи иконок скрыты — только иконки */
.bottom-nav .nav-label {
    display: none;
}

/* Обучение: подсветка кнопки «Добавить операцию» */
body.tutorial-step-fab .nav-item-add .nav-add-icon {
    animation: tutorial-fab-pulse 1.5s ease-in-out infinite;
    box-shadow: var(--shadow-lg), 0 0 0 4px rgba(255, 255, 255, 0.4), var(--glow-orange);
}
@keyframes tutorial-fab-pulse {
    0%, 100% { transform: scale(1); box-shadow: var(--shadow-lg), 0 0 0 4px rgba(255, 255, 255, 0.4), var(--glow-orange); }
    50% { transform: scale(1.08); box-shadow: var(--shadow-lg), 0 0 0 8px rgba(255, 255, 255, 0.25), 0 0 24px rgba(210, 105, 30, 0.6); }
}

/* ========== FLOATING BACK BUTTON ========== */
.floating-back-btn {
    position: fixed;
    top: calc(20px + env(safe-area-inset-top));
    left: var(--spacing-xl);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(15, 15, 15, 0.8);
    backdrop-filter: blur(10px);
    color: var(--accent-orange);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: all 0.3s ease;
}

.floating-back-btn:hover {
    background: rgba(15, 15, 15, 0.95);
    transform: translateX(-2px);
}

.floating-back-btn:active {
    transform: scale(0.9) translateX(-2px);
}

/* ========== MODAL ========== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.modal-header {
    padding: var(--spacing-2xl);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 10;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.close-modal {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 18px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.close-modal:active {
    transform: scale(0.92);
    background: var(--surface-hover);
}

.modal-body {
    padding: var(--spacing-2xl);
    max-height: min(70vh, 480px);
    overflow-y: auto;
}

/* ========== FORM ========== */
.form-group {
    margin-bottom: var(--spacing-xl);
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 14px var(--spacing-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-orange);
    box-shadow: 0 0 0 3px var(--accent-orange-dim);
}

.type-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-2xl);
}

.type-btn {
    padding: var(--spacing-lg);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.type-btn.active.income {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: white;
}

.type-btn.active.expense {
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: white;
}

.quick-operations-wrap {
    margin-bottom: var(--spacing-lg);
}
.quick-operations-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}
.quick-operations-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    align-items: center;
}
.quick-op-chip {
    padding: 8px 12px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}
.quick-op-chip:active {
    background: var(--surface-hover);
}
.quick-op-chip.quick-op-add {
    opacity: 0.8;
    font-weight: 600;
}

.btn-primary {
    width: 100%;
    padding: 16px 20px;
    background: linear-gradient(145deg, var(--accent-orange), var(--accent-brown));
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: var(--spacing-md);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.15);
}

.btn-primary:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.account-modal-actions {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--border);
}

.btn-danger {
    width: 100%;
    padding: 12px 20px;
    background: transparent;
    color: var(--accent-red);
    border: 1px solid var(--accent-red);
    border-radius: var(--radius-lg);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.btn-danger:hover, .btn-danger:active {
    background: rgba(229, 115, 115, 0.15);
}

.btn-icon {
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
    font-size: 1.1em;
}
.btn-icon:hover {
    background: var(--surface);
    color: var(--text);
}

.reminders-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.btn-add-reminder {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 8px;
    background: var(--accent);
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
}
.btn-add-reminder:hover, .btn-add-reminder:active {
    opacity: 0.9;
    transform: scale(0.98);
}

.analytics-filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 4px 4px;
}
.analytics-filter-row label {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}
.analytics-filter-row .form-input,
.analytics-filter-row select {
    flex: 1;
}
.analytics-page-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}
.analytics-summary {
    padding: 12px 16px;
    margin-bottom: 16px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--accent);
}
.analytics-summary #analyticsSummaryText {
    font-size: 15px;
    color: var(--text-secondary);
}
.analytics-card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin: -4px 0 12px 0;
}
.analytics-trend-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    padding: 16px;
    text-align: center;
    font-size: 14px;
    color: var(--text-tertiary);
    background: rgba(251, 240, 208, 0.03);
    border-radius: var(--radius-md);
    border: 1px dashed var(--border);
}
.chart-container-trend {
    height: 220px;
    margin-top: 8px;
}

.btn-back {
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    font-size: 14px;
    display: flex;
    gap: var(--spacing-sm);
    cursor: pointer;
}

/* ========== CATEGORIES MODAL ========== */
.categories-toggle {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.toggle-btn {
    flex: 1;
    padding: var(--spacing-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.toggle-btn.active {
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-brown));
    border-color: var(--accent-orange);
    color: white;
}

.category-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.category-emoji {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: rgba(207, 132, 58, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.category-info {
    flex: 1;
}

.category-card-title {
    font-size: 16px;
    font-weight: 600;
}

.category-card-subtitle {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* ========== CHART ========== */
.chart-container {
    position: relative;
    height: 280px;
}

.inc-exp-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}
.inc-exp-summary-item {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.inc-exp-summary-item .label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}
.inc-exp-summary-item.income {
    background: rgba(129, 199, 132, 0.15);
    border: 1px solid rgba(129, 199, 132, 0.4);
}
.inc-exp-summary-item.income .amount { color: #81C784; font-weight: 700; font-size: 20px; }
.inc-exp-summary-item.expense {
    background: rgba(229, 115, 115, 0.15);
    border: 1px solid rgba(229, 115, 115, 0.4);
}
.inc-exp-summary-item.expense .amount { color: #E57373; font-weight: 700; font-size: 20px; }

.chart-container-inc-exp {
    height: 260px;
}

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 60px var(--spacing-xl);
    color: var(--text-tertiary);
}

.empty-icon {
    font-size: 64px;
    opacity: 0.3;
    margin-bottom: var(--spacing-xl);
}

/* ========== TUTORIAL / ONBOARDING ========== */
#tutorialOverlay {
    animation: fadeIn 0.3s ease;
}

#tutorialTooltip {
    animation: slideUp 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Элемент без дымки, с яркой рамкой */
.tutorial-highlight {
    position: relative !important;
    z-index: 10001 !important;
    box-shadow: 0 0 0 5px var(--accent-orange),
                0 0 0 8px rgba(207, 132, 58, 0.4),
                0 0 30px 10px rgba(207, 132, 58, 0.6) !important;
    border-radius: 12px !important;
    animation: tutorialPulse 2s infinite;
}

@keyframes tutorialPulse {
    0%, 100% {
        box-shadow: 0 0 0 5px rgba(207, 132, 58, 1),
                    0 0 0 10px rgba(207, 132, 58, 0.5),
                    0 0 40px 15px rgba(207, 132, 58, 0.8);
    }
    50% {
        box-shadow: 0 0 0 5px rgba(207, 132, 58, 1),
                    0 0 0 15px rgba(207, 132, 58, 0.3),
                    0 0 60px 20px rgba(207, 132, 58, 1);
    }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 400px) {
    .balance-amount { font-size: 36px; }
    .stat-value { font-size: 24px; }
    
    #tutorialTooltip {
        max-width: calc(100vw - 32px) !important;
        width: calc(100vw - 32px) !important;
        left: 16px !important;
        right: 16px !important;
        box-sizing: border-box;
    }
}
