/* Kizuna Finance - Anime Neon Glassmorphism Theme */
:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #12122a;
    --bg-card: rgba(255,255,255,0.04);
    --bg-glass: rgba(255,255,255,0.06);
    --border-glass: rgba(255,255,255,0.08);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-primary: #818cf8;
    --accent-secondary: #c084fc;
    --accent-pink: #f472b6;
    --accent-green: #34d399;
    --accent-red: #f87171;
    --accent-yellow: #fbbf24;
    --gradient-main: linear-gradient(135deg, #6366f1, #8b5cf6, #c084fc);
    --gradient-card: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(139,92,246,0.05));
    --shadow-neon: 0 0 20px rgba(129,140,248,0.15);
    --radius: 16px;
    --radius-sm: 10px;
    --sidebar-width: 300px;
    --font-main: 'Inter', 'Noto Sans JP', -apple-system, sans-serif;
    --chart-label: #94a3b8;
    --chart-grid: rgba(255,255,255,0.05);
    --alert-error-bg: rgba(248,113,113,0.1);
    --alert-error-border: rgba(248,113,113,0.3);
    --alert-error-text: #fca5a5;
    --alert-success-bg: rgba(52,211,153,0.1);
    --alert-success-border: rgba(52,211,153,0.3);
    --alert-success-text: #6ee7b7;
    --topbar-bg: rgba(12, 12, 28, 0.92);
    --toggle-bg: rgba(255,255,255,0.06);
    --toggle-border: rgba(255,255,255,0.12);
    --toggle-bar: #e2e8f0;
    --select-option-bg: #12122a;
    --select-option-text: #f1f5f9;
    color-scheme: dark;
}

[data-theme="light"] {
    --bg-primary: #f3f0fc;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255,255,255,0.92);
    --bg-glass: rgba(255,255,255,0.85);
    --border-glass: rgba(124, 92, 196, 0.14);
    --text-primary: #2a2148;
    --text-secondary: #6a6280;
    --text-muted: #8b849e;
    --gradient-card: linear-gradient(135deg, rgba(124,92,196,0.08), rgba(243,198,222,0.12));
    --shadow-neon: 0 8px 24px rgba(88, 50, 160, 0.08);
    --chart-label: #6a6280;
    --chart-grid: rgba(124, 92, 196, 0.12);
    --alert-error-bg: rgba(220, 38, 38, 0.08);
    --alert-error-border: rgba(220, 38, 38, 0.22);
    --alert-error-text: #b91c1c;
    --alert-success-bg: rgba(5, 150, 105, 0.08);
    --alert-success-border: rgba(5, 150, 105, 0.22);
    --alert-success-text: #047857;
    --topbar-bg: rgba(247, 244, 252, 0.92);
    --toggle-bg: #fff;
    --toggle-border: rgba(124, 58, 237, 0.14);
    --toggle-bar: #7c5cc4;
    --select-option-bg: #ffffff;
    --select-option-text: #2a2148;
    color-scheme: light;
}

[data-theme="dark"] {
    --chart-label: #94a3b8;
    --chart-grid: rgba(255,255,255,0.05);
    --select-option-bg: #12122a;
    --select-option-text: #f1f5f9;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100%;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(99,102,241,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(192,132,252,0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(244,114,182,0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

a { color: var(--accent-primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-secondary); }

/* Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
    z-index: 1;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-glass);
    padding: 24px 16px;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 300;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s;
    overflow-y: auto;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 24px;
    border-bottom: 1px solid var(--border-glass);
    margin-bottom: 24px;
}

.sidebar-logo h1 {
    font-size: 20px;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.sidebar-logo .logo-icon { font-size: 28px; }
.sidebar-coin-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 12px 14px;
    padding: 8px 12px;
    border-radius: 14px;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.28);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-weight: 600;
}
.sidebar-coin-pill img {
    flex-shrink: 0;
    filter: drop-shadow(0 2px 6px rgba(251, 191, 36, 0.35));
}
.sidebar-coin-pill.kizu-coin-pulse {
    animation: kizuTargetPulse 0.7s ease;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    line-height: 0;
    text-decoration: none;
}
.brand-logo img {
    display: block;
    height: auto;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}
.brand-logo--nav img {
    height: 36px;
    max-width: 180px;
}
.brand-logo--sidebar img {
    height: 66px;
    max-width: 200px;
}
.brand-logo--admin img {
    height: 66px;
    max-width: 264px;
}
.landing-nav .logo {
    display: flex;
    align-items: center;
}
.landing-nav .logo a {
    -webkit-text-fill-color: unset;
    background: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.nav-item:hover, .nav-item.active {
    background: rgba(129,140,248,0.1);
    color: var(--accent-primary);
}

.nav-item.active { box-shadow: var(--shadow-neon); }

.nav-item .icon { font-size: 18px; width: 28px; text-align: center; }
.nav-item .icon--svg {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.nav-item .icon--svg img {
    width: 28px;
    height: 28px;
    display: block;
    object-fit: contain;
}
.nav-accordion-label .icon--svg {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.nav-accordion-label .icon--svg img {
    width: 28px;
    height: 28px;
    display: block;
}
.nav-item .icon--mascot {
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.nav-item .icon--mascot img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    display: block;
    animation: float 2.4s ease-in-out infinite;
    will-change: transform;
}
.nav-item--kizu {
    gap: 10px;
    padding-top: 10px;
    padding-bottom: 10px;
}
.nav-item--kizu .icon--mascot img {
    animation: float 2.4s ease-in-out infinite;
}
.page-header-mascot {
    width: 50px;
    height: 50px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 8px;
    animation: float 2.4s ease-in-out infinite;
    display: inline-block;
}
.page-header-icon {
    width: 50px;
    height: 50px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 8px;
    display: inline-block;
    flex-shrink: 0;
}
.page-header h2 {
    display: inline-flex;
    align-items: center;
    gap: 0;
}
@media (prefers-reduced-motion: reduce) {
    .nav-item .icon--mascot img,
    .page-header-mascot,
    .stat-card .stat-mascot { animation: none; }
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 8px;
    min-height: 0;
}
.sidebar-footer {
    margin-top: auto;
    padding-top: 8px;
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 6px;
}
.sidebar-footer .nav-item--footer {
    flex: 1;
    min-width: 0;
    gap: 6px;
    padding: 8px 8px;
    margin-bottom: 0;
    font-size: 12px;
    font-weight: 600;
    justify-content: center;
    white-space: nowrap;
}
.sidebar-footer .nav-item--footer .icon--svg {
    width: 18px;
    height: 18px;
}
.sidebar-footer .nav-item--footer .icon--svg img {
    width: 18px;
    height: 18px;
}
.nav-divider {
    height: 1px;
    background: var(--border-glass);
    margin: 10px 8px;
}
.nav-accordion {
    margin-bottom: 4px;
}
.nav-accordion-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s, color 0.2s;
}
.nav-accordion-toggle:hover,
.nav-accordion.is-open > .nav-accordion-toggle {
    background: rgba(129,140,248,0.08);
    color: var(--accent-primary);
}
.nav-accordion-label {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.nav-accordion-label .icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}
.nav-accordion-chevron {
    font-size: 12px;
    opacity: 0.7;
    transition: transform 0.2s ease;
}
.nav-accordion.is-open .nav-accordion-chevron {
    transform: rotate(180deg);
}
.nav-accordion-panel {
    padding: 2px 0 6px 8px;
    border-left: 2px solid rgba(129,140,248,0.18);
    margin: 0 8px 4px 18px;
}
.nav-accordion-panel .nav-item {
    padding: 8px 10px;
    font-size: 15px;
}
.nav-accordion-panel[hidden] {
    display: none !important;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px 32px;
    min-height: 100vh;
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;
}

/* Cards */
.glass-card {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    padding: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.glass-card:hover { box-shadow: var(--shadow-neon); }

.settings-stack {
    display: grid;
    gap: 20px;
    max-width: 640px;
}
.settings-card { max-width: none; }
.settings-help {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0 0 16px;
    line-height: 1.5;
}
.settings-meta {
    color: var(--text-muted);
    font-size: 12px;
    margin: -8px 0 16px;
}
.check-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    cursor: pointer;
}
.check-row input { margin-top: 3px; flex-shrink: 0; }
.currency-setup {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 0;
}
.currency-setup-card {
    width: min(560px, 100%);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
    overflow: visible;
    position: relative;
}
.stat-card .stat-icon {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stat-card .stat-icon img {
    width: 72px;
    height: 72px;
    object-fit: contain;
    display: block;
}
.stat-card .stat-body {
    flex: 1;
    min-width: 0;
}
.stat-card .stat-value { font-size: 28px; font-weight: 700; margin-bottom: 4px; line-height: 1.15; }
.dashboard-stat-grid .stat-card .stat-value { font-size: 20px; }
.stat-card .stat-label { font-size: 10px; color: var(--text-secondary); }
.stat-card .stat-sub {
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.35;
    color: var(--text-muted);
    opacity: 0.9;
}
.stat-card.income .stat-value { color: var(--accent-green); }
.stat-card.expense .stat-value { color: var(--accent-red); }
.stat-card.savings .stat-value { color: var(--accent-primary); }
.stat-card.carryover .stat-value { color: #f59e0b; }
.stat-card.carryover.is-positive .stat-value { color: var(--accent-green); }
.stat-card.carryover.is-negative .stat-value { color: var(--accent-red); }
.stat-card.has-mascot {
    overflow: visible;
    z-index: 1;
}
.stat-card .stat-icon--mascot {
    width: 96px;
    height: 96px;
    margin: -18px 0 -18px -8px;
    position: relative;
    z-index: 2;
}
.stat-card .stat-mascot {
    width: 110px !important;
    height: 110px !important;
    object-fit: contain;
    animation: float 2.4s ease-in-out infinite;
    filter: drop-shadow(0 8px 16px rgba(129, 140, 248, 0.28));
}

/* Mascot / dashboard hero — soft split card like mockup */
.mascot-section {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 22px 26px;
    background: linear-gradient(135deg, #f7f4fc 0%, #efe8fb 55%, #f8f5ff 100%);
    border-radius: 22px;
    border: 1px solid rgba(124, 92, 196, 0.12);
    box-shadow: 0 14px 36px rgba(88, 50, 160, 0.08);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    color: #2a2148;
}

.mascot-section--split {
    display: grid;
    grid-template-columns: minmax(280px, 0.95fr) minmax(300px, 1.2fr);
    align-items: center;
    gap: 8px 28px;
}

.mascot-panel { position: relative; z-index: 1; min-width: 0; }

.mascot-panel--user {
    display: flex;
    align-items: stretch;
    padding-right: 8px;
    min-height: 128px;
}

.user-hero {
    display: flex;
    align-items: stretch;
    gap: 30px;
    width: 100%;
    min-height: inherit;
}

.user-hero-avatar {
    margin: 10px;
    margin-right: 0;
    box-sizing: border-box;
    align-self: center;
    aspect-ratio: 1 / 1;
    height: 70%;
    width: auto;
    min-height: 86px;
    min-width: 86px;
    flex: 0 0 auto;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    border: 3px solid #f3c6de;
    box-shadow:
        0 0 0 4px rgba(243, 198, 222, 0.35),
        0 12px 28px rgba(192, 132, 252, 0.22);
}

.user-hero-avatar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    align-self: center;
    flex: 0 0 auto;
    margin: 10px;
    margin-right: 0;
}

.user-hero-avatar-wrap .user-hero-avatar {
    margin: 0;
    height: auto;
    width: 108px;
    min-width: 108px;
    min-height: 108px;
}

.user-plan-name {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.25;
    max-width: 140px;
}

.user-plan-days {
    margin-top: 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #6d28d9;
    background: rgba(124, 92, 196, 0.12);
    border: 1px solid rgba(124, 92, 196, 0.18);
    border-radius: 999px;
    padding: 4px 10px;
    white-space: nowrap;
    text-align: center;
    line-height: 1.2;
}

.user-plan-days.is-expired {
    color: #b91c1c;
    background: rgba(248, 113, 113, 0.14);
    border-color: rgba(248, 113, 113, 0.28);
}

.user-hero-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.user-hero-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
    padding: 10px 0;
}

.user-hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 18px;
    min-width: 0;
}

.user-hero-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: inherit;
    white-space: nowrap;
}

.user-hero-stat strong { font-weight: 800; }

.user-hero-stat .stat-ico {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    filter: drop-shadow(0 2px 4px rgba(88, 50, 160, 0.15));
}

.mascot-panel--kizu {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mascot-section::after {
    content: '';
    position: absolute;
    top: -40%;
    right: -12%;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(192,132,252,0.16), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.mascot-avatar {
    width: 228px;
    height: 228px;
    flex-shrink: 0;
    animation: float 3s ease-in-out infinite;
    object-fit: contain;
    border-radius: 0;
    background: transparent;
    filter: drop-shadow(0 10px 18px rgba(88, 50, 160, 0.18));
}
.auth-mascot img { width: 110px; height: 110px; border-radius: 0; object-fit: contain; background: transparent; animation: float 3s ease-in-out infinite; }
.hero-mascot { width: 320px; max-width: 100%; height: auto; animation: float 4s ease-in-out infinite; filter: drop-shadow(0 12px 28px rgba(37, 99, 235, 0.25)); border-radius: 0; background: transparent; }
.mascot-speech { flex: 1; z-index: 1; min-width: 0; }
.mascot-speech .greeting {
    font-size: clamp(18px, 2vw, 24px);
    font-weight: 800;
    margin-bottom: 8px;
    line-height: 1.35;
    color: #2a2148;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.mascot-speech .greeting-line {
    display: block;
}
.mascot-speech .message {
    color: #6a6280;
    font-size: 16px;
    line-height: 1.55;
}
[data-theme="dark"] .mascot-speech .greeting { color: var(--text-primary); }
[data-theme="dark"] .mascot-speech .message { color: var(--text-secondary); }

.mascot-stats { display: flex; gap: 16px; margin-top: 16px; flex-wrap: wrap; }
.mascot-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255,255,255,0.05);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.user-hero-main .xp-bar {
    width: 100%;
    height: 10px;
    background: rgba(124, 92, 196, 0.14);
    border-radius: 999px;
    overflow: hidden;
    margin: 0;
    flex: 0 0 auto;
}

.xp-bar {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
}

.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #9b7dd4, #7c5cc4);
    border-radius: 999px;
    transition: width 0.5s ease;
}

@media (max-width: 900px) {
    .mascot-section--split {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .mascot-panel--user { padding-right: 0; }
    .mascot-panel--kizu {
        order: -1;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    .mascot-avatar {
        width: 132px;
        height: 132px;
        margin: 0 auto;
    }
    .mascot-speech {
        width: 100%;
    }
    .mascot-speech .greeting {
        font-size: 16px;
        line-height: 1.4;
    }
    .mascot-speech .message {
        font-size: 15px;
    }
    .user-hero {
        gap: 14px;
        align-items: center;
    }
    .user-hero-avatar-wrap {
        margin: 4px;
    }
    .user-hero-avatar-wrap .user-hero-avatar,
    .user-hero-avatar {
        width: 72px;
        height: 72px;
        min-width: 72px;
        min-height: 72px;
        margin: 0;
    }
    .user-plan-days { font-size: 10px; padding: 3px 8px; }
    .user-hero-main { padding: 4px 0; gap: 10px; }
    .user-hero-stats { gap: 8px 10px; }
    .user-hero-stat {
        font-size: 12px;
        white-space: normal;
        gap: 6px;
    }
    .user-hero-stat .stat-ico {
        width: 18px;
        height: 18px;
        flex-basis: 18px;
    }
}

/* Quests */
.quest-list { display: flex; flex-direction: column; gap: 8px; }
.quest-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.03);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-glass);
    transition: all 0.2s;
}

.quest-item.completed { opacity: 0.6; border-color: rgba(52,211,153,0.3); }
.quest-item.completed .quest-check { background: var(--accent-green); color: #fff; }

.quest-check {
    width: 24px; height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border-glass);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

.quest-info { flex: 1; }
.quest-name { font-size: 14px; font-weight: 600; }
.quest-xp { font-size: 12px; color: var(--accent-yellow); font-weight: 700; }

/* Transactions */
.tx-list { display: flex; flex-direction: column; gap: 4px; }
.tx-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.tx-item:hover { background: rgba(255,255,255,0.03); }
.tx-icon { font-size: 24px; width: 40px; text-align: center; display: inline-flex; align-items: center; justify-content: center; }
.tx-icon .cat-ico { width: 28px; height: 28px; display: block; }
.tx-info { flex: 1; }
.tx-name { font-size: 14px; font-weight: 600; }
.tx-date { font-size: 12px; color: var(--text-muted); }
.tx-amount { font-size: 15px; font-weight: 700; }
.tx-amount.income { color: var(--accent-green); }
.tx-amount.expense { color: var(--accent-red); }

.tx-filters { margin-bottom: 0; }
.tx-filters .form-label {
    font-size: 11px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tx-filters .form-input,
.tx-filters .form-select {
    padding: 8px 10px;
    font-size: 13px;
}
.tx-filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
}
.tx-filter-form .form-group {
    margin-bottom: 0;
    flex: 1 1 110px;
    min-width: 0;
}
.tx-filter-form .form-group:first-child {
    flex: 1.4 1 140px;
}
.tx-filter-form .tx-filter-period {
    flex: 1.15 1 130px;
}
.tx-filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 0 0 auto;
    padding-bottom: 1px;
}
.tx-filter-actions .btn {
    padding: 8px 12px;
    font-size: 13px;
    white-space: nowrap;
}

/* Subscriptions page */
.sub-page {
    --sub-brand: #635bff;
    --sub-brand-dark: #4f46e5;
    --sub-surface: #ffffff;
    --sub-border: rgba(124, 92, 196, 0.14);
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.sub-page-hero {
    position: relative;
    min-height: 300px;
    border-radius: 18px;
    overflow: hidden;
    background: #ece6ff url('../images/subscriptions/hero-banner.jpg') center top / cover no-repeat;
    box-shadow: 0 8px 28px rgba(99, 91, 255, 0.12);
}
.sub-page-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.92) 0%, rgba(255,255,255,0.55) 42%, rgba(255,255,255,0.08) 100%);
}
.sub-page-hero-content {
    position: relative;
    z-index: 1;
    max-width: 52%;
    padding: 34px 36px;
    margin-top: 80px;
}
.sub-page-hero-title {
    margin: 0 0 8px;
    font-size: clamp(28px, 3vw, 36px);
    font-weight: 800;
    color: #2a2148;
    letter-spacing: -0.02em;
}
.sub-page-hero-lead {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: #6a6280;
    max-width: 420px;
}
.sub-page-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
.sub-page-stat-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    border-radius: 16px;
    background: var(--sub-surface);
    border: 1px solid var(--sub-border);
    box-shadow: 0 4px 18px rgba(42, 33, 72, 0.05);
}
.sub-page-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.sub-page-stat-icon svg { width: 22px; height: 22px; }
.sub-page-stat-icon.is-purple { color: #635bff; background: rgba(99, 91, 255, 0.12); }
.sub-page-stat-icon.is-pink { color: #ec4899; background: rgba(236, 72, 153, 0.12); }
.sub-page-stat-icon.is-orange { color: #f97316; background: rgba(249, 115, 22, 0.12); }
.sub-page-stat-icon.is-green { color: #10b981; background: rgba(16, 185, 129, 0.12); }
.sub-page-stat-body { min-width: 0; }
.sub-page-stat-label {
    display: block;
    font-size: 13px;
    color: #6a6280;
    margin-bottom: 4px;
}
.sub-page-stat-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #2a2148;
    line-height: 1.2;
}
.sub-page-stat-sub {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #8b849e;
}
.sub-page-panel {
    padding: 0;
    overflow: hidden;
    background: var(--sub-surface);
    border: 1px solid var(--sub-border);
}
.sub-page-panel-head {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px 20px;
    align-items: center;
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--sub-border);
}
.sub-page-panel-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #2a2148;
    white-space: nowrap;
}
.sub-page-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
.sub-page-tab {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: #6a6280;
    border: 1px solid var(--sub-border);
    background: #fff;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.sub-page-tab:hover {
    color: var(--sub-brand);
    border-color: rgba(99, 91, 255, 0.35);
}
.sub-page-tab.is-active {
    color: #fff;
    background: var(--sub-brand);
    border-color: var(--sub-brand);
}
.sub-page-panel-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
}
.sub-page-add-btn { white-space: nowrap; }
.sub-page-filter { position: relative; }
.sub-page-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    cursor: pointer;
}
.sub-page-filter-btn::-webkit-details-marker { display: none; }
.sub-page-filter-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 20;
    width: min(520px, calc(100vw - 48px));
    padding: 16px;
    border-radius: 14px;
    background: var(--sub-surface);
    border: 1px solid var(--sub-border);
    box-shadow: 0 16px 40px rgba(42, 33, 72, 0.12);
}
.sub-page-filter-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.sub-page-filter-form .form-group { margin-bottom: 0; }
.sub-page-filter-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.sub-page-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}
.sub-page-table-wrap {
    overflow-x: auto;
    padding: 0 8px;
}
.sub-page-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
}
.sub-page-table th,
.sub-page-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--sub-border);
    font-size: 14px;
    vertical-align: middle;
}
.sub-page-table th {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8b849e;
}
.sub-page-table tbody tr:hover td { background: rgba(99, 91, 255, 0.03); }
.sub-page-service {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 180px;
}
.sub-page-service-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 18px;
    background: color-mix(in srgb, var(--sub-accent, #818cf8) 14%, white);
    color: var(--sub-accent, #818cf8);
    font-weight: 700;
    flex-shrink: 0;
}
.sub-page-service-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.sub-page-service-text strong {
    color: #2a2148;
    font-size: 14px;
}
.sub-page-service-text small {
    color: #8b849e;
    font-size: 12px;
}
.sub-page-cat-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--cat-color, #635bff);
    background: color-mix(in srgb, var(--cat-color, #635bff) 14%, white);
}
.sub-page-amount {
    font-weight: 700;
    color: #2a2148;
    white-space: nowrap;
}
.sub-page-status {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}
.sub-page-status.is-active {
    color: #047857;
    background: rgba(16, 185, 129, 0.14);
}
.sub-page-status.is-cancelled {
    color: #b91c1c;
    background: rgba(248, 113, 113, 0.14);
}
.sub-page-row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.sub-page-action-btn,
.sub-page-delete-form button.sub-page-action-btn {
    width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--sub-border);
    border-radius: 8px;
    background: #fff;
    color: #6a6280;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.sub-page-action-btn:hover {
    color: var(--sub-brand);
    border-color: rgba(99, 91, 255, 0.35);
    background: rgba(99, 91, 255, 0.06);
}
.sub-page-action-btn.is-danger:hover {
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.35);
    background: rgba(248, 113, 113, 0.08);
}
.sub-page-delete-form { display: inline; margin: 0; }
.sub-page-tip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 24px;
    background: rgba(99, 91, 255, 0.08);
    border-top: 1px solid var(--sub-border);
}
.sub-page-tip-text {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #4f4580;
}
.sub-page-tip-text svg { color: var(--sub-brand); flex-shrink: 0; }
.sub-page-tip-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--sub-brand);
    text-decoration: none;
    white-space: nowrap;
}
.sub-page-tip-link:hover { text-decoration: underline; }

/* Subscription modal */
/* Transaction add modal — share subscription modal look */
.tx-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 24px 16px;
    background: rgba(15, 12, 35, 0.55);
    backdrop-filter: blur(4px);
}
.tx-modal-overlay[hidden] { display: none; }
.tx-modal {
    width: min(560px, 100%);
    max-height: min(90vh, 820px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    background: #fff;
    border: 1px solid rgba(124, 92, 196, 0.16);
    box-shadow: 0 24px 60px rgba(42, 33, 72, 0.22);
}
.tx-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 22px 0;
}
.tx-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #2a2148;
}
.tx-modal-close {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: none;
    border-radius: 10px;
    background: rgba(99, 91, 255, 0.08);
    color: #6a6280;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.tx-modal-close:hover {
    background: rgba(99, 91, 255, 0.14);
    color: #635bff;
}
.tx-modal-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.tx-modal-body {
    padding: 18px 22px 8px;
    overflow-y: auto;
}
.tx-modal-hint {
    margin: 8px 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.tx-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 22px 20px;
    border-top: 1px solid rgba(124, 92, 196, 0.12);
}
body.tx-modal-open { overflow: hidden; }
[data-theme="dark"] .tx-modal {
    background: #16162e;
    border-color: rgba(255,255,255,0.1);
}
[data-theme="dark"] .tx-modal-title { color: var(--text-primary); }
[data-theme="dark"] .tx-modal-close {
    background: rgba(255,255,255,0.06);
    color: var(--text-secondary);
}
[data-theme="dark"] .tx-modal-footer {
    border-top-color: rgba(255,255,255,0.08);
}

.sub-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 24px 16px;
    background: rgba(15, 12, 35, 0.55);
    backdrop-filter: blur(4px);
}
.sub-modal-overlay[hidden] { display: none; }
.sub-modal {
    width: min(560px, 100%);
    max-height: min(90vh, 820px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    background: #fff;
    border: 1px solid rgba(124, 92, 196, 0.16);
    box-shadow: 0 24px 60px rgba(42, 33, 72, 0.22);
}
.sub-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 22px 0;
}
.sub-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #2a2148;
}
.sub-modal-close {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: none;
    border-radius: 10px;
    background: rgba(99, 91, 255, 0.08);
    color: #6a6280;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.sub-modal-close:hover {
    background: rgba(99, 91, 255, 0.14);
    color: #635bff;
}
.sub-modal-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.sub-modal-body {
    padding: 18px 22px 8px;
    overflow-y: auto;
}
.sub-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.sub-modal-hint {
    margin: 8px 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.sub-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 22px 20px;
    border-top: 1px solid rgba(124, 92, 196, 0.12);
}
body.sub-modal-open { overflow: hidden; }
.sub-modal-form.is-readonly .form-input[readonly],
.sub-modal-form.is-readonly .form-select:disabled {
    opacity: 1;
    cursor: default;
    background: rgba(99, 91, 255, 0.04);
    border-color: rgba(124, 92, 196, 0.12);
    color: inherit;
}
.sub-modal-form.is-readonly .form-input[readonly]:focus,
.sub-modal-form.is-readonly .form-select:disabled:focus {
    outline: none;
    box-shadow: none;
}

.sub-modal-form.is-readonly #sub-modal-submit {
    display: none !important;
}
.sub-modal-form.is-readonly .sub-modal-footer {
    justify-content: flex-end;
}

[data-theme="dark"] .sub-modal {
    background: #16162e;
    border-color: rgba(255,255,255,0.1);
}
[data-theme="dark"] .sub-modal-title { color: var(--text-primary); }
[data-theme="dark"] .sub-modal-close {
    background: rgba(255,255,255,0.06);
    color: var(--text-secondary);
}
[data-theme="dark"] .sub-modal-footer {
    border-top-color: rgba(255,255,255,0.08);
}

@media (max-width: 560px) {
    .sub-modal-grid { grid-template-columns: 1fr; }
}

[data-theme="dark"] .sub-page {
    --sub-surface: rgba(255,255,255,0.04);
    --sub-border: rgba(255,255,255,0.08);
}
[data-theme="dark"] .sub-page-hero-overlay {
    background: linear-gradient(90deg, rgba(10,10,26,0.92) 0%, rgba(10,10,26,0.62) 45%, rgba(10,10,26,0.15) 100%);
}
[data-theme="dark"] .sub-page-hero-title,
[data-theme="dark"] .sub-page-stat-value,
[data-theme="dark"] .sub-page-panel-title,
[data-theme="dark"] .sub-page-service-text strong,
[data-theme="dark"] .sub-page-amount {
    color: var(--text-primary);
}
[data-theme="dark"] .sub-page-hero-lead,
[data-theme="dark"] .sub-page-stat-label,
[data-theme="dark"] .sub-page-stat-sub,
[data-theme="dark"] .sub-page-service-text small {
    color: var(--text-secondary);
}
[data-theme="dark"] .sub-page-tab {
    background: rgba(255,255,255,0.03);
    color: var(--text-secondary);
}
[data-theme="dark"] .sub-page-action-btn,
[data-theme="dark"] .sub-page-delete-form button.sub-page-action-btn {
    background: rgba(255,255,255,0.03);
}

@media (max-width: 1100px) {
    .sub-page-panel-head {
        grid-template-columns: 1fr;
    }
    .sub-page-tabs { justify-content: flex-start; }
    .sub-page-panel-actions { justify-content: flex-start; flex-wrap: wrap; }
}
@media (max-width: 900px) {
    .sub-page-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sub-page-hero-content { max-width: 100%; padding: 28px 24px; }
}
@media (max-width: 560px) {
    .sub-page-stat-grid { grid-template-columns: 1fr; }
    .sub-page-filter-form { grid-template-columns: 1fr; }
    .sub-page-tip { flex-direction: column; align-items: flex-start; }
}

/* Legacy subscription badges (edit forms) */
.sub-stats-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 16px 20px;
    margin-bottom: 24px;
}
.sub-stats-cards {
    flex: 1 1 420px;
    margin-bottom: 0;
    min-width: 0;
}
.sub-add-btn {
    align-self: center;
    margin-left: auto;
    flex-shrink: 0;
    white-space: nowrap;
}
@media (max-width: 640px) {
    .sub-add-btn {
        width: 100%;
        margin-left: 0;
        text-align: center;
        justify-content: center;
    }
}
.tx-card.is-inactive {
    opacity: 0.72;
}
.sub-status-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 4px 8px;
    border-radius: 999px;
    margin-right: auto;
}
.sub-status-badge.is-active {
    color: #065f46;
    background: rgba(52, 211, 153, 0.18);
}
.sub-status-badge.is-inactive {
    color: #7f1d1d;
    background: rgba(248, 113, 113, 0.16);
}
[data-theme="dark"] .sub-status-badge.is-active {
    color: #a7f3d0;
}
[data-theme="dark"] .sub-status-badge.is-inactive {
    color: #fecaca;
}

.tx-results.is-loading {
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.tx-card.is-unpaid {
    border-style: dashed;
    opacity: 0.92;
}

/* Upcoming subscription payments */
.tx-upcoming {
    margin-top: 20px;
    padding: 20px 22px;
    border: 1px solid rgba(99, 91, 255, 0.18);
    background: linear-gradient(180deg, rgba(99, 91, 255, 0.06) 0%, rgba(255,255,255,0.02) 100%);
}
.tx-upcoming-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.tx-upcoming-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}
.tx-upcoming-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #635bff;
    background: rgba(99, 91, 255, 0.12);
}
.tx-upcoming-grid {
    margin-bottom: 0;
}
.tx-upcoming-card {
    border-color: rgba(99, 91, 255, 0.22);
}
.tx-upcoming-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
}
.tx-upcoming-paid-btn {
    white-space: nowrap;
}

.tx-pay-toggle {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 2px;
}
.tx-pay-form {
    display: inline;
    margin: 0;
}
.tx-pay-badge {
    appearance: none;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 4px 9px;
    border-radius: 999px;
    line-height: 1.2;
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.tx-pay-badge.is-unpaid.is-selected {
    color: #9a3412;
    background: rgba(251, 146, 60, 0.2);
    border-color: rgba(251, 146, 60, 0.35);
}
.tx-pay-badge.is-paid.is-selected {
    color: #065f46;
    background: rgba(52, 211, 153, 0.2);
    border-color: rgba(52, 211, 153, 0.35);
}
.tx-pay-badge:not(.is-selected):hover {
    border-color: rgba(124, 92, 196, 0.35);
    color: var(--text-primary);
}
[data-theme="dark"] .tx-pay-badge.is-unpaid.is-selected {
    color: #fdba74;
}
[data-theme="dark"] .tx-pay-badge.is-paid.is-selected {
    color: #a7f3d0;
}
.kakeibo-pay-pill {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    vertical-align: middle;
}
.kakeibo-pay-pill.is-unpaid {
    color: #9a3412;
    background: rgba(251, 146, 60, 0.18);
}
.kakeibo-pay-pill.is-paid {
    color: #065f46;
    background: rgba(52, 211, 153, 0.18);
}

.tx-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}
.tx-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-glass);
    background: rgba(255,255,255,0.02);
    min-height: 148px;
}
.tx-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.tx-card .tx-icon {
    width: auto;
    font-size: 28px;
    line-height: 1;
}
.tx-card .tx-icon .cat-ico { width: 32px; height: 32px; }
.tx-card .tx-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}
.tx-card-actions {
    margin-top: auto;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.tx-locked-hint {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
}
.form-hint {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}
.tx-delete-form { display: inline; margin: 0; }
.tx-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-glass);
}
.tx-pager-info {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 0 8px;
    font-weight: 600;
}
.btn.is-disabled,
.btn.is-disabled:hover {
    opacity: 0.45;
    pointer-events: none;
    cursor: default;
}
.btn-danger {
    background: rgba(248, 113, 113, 0.18);
    color: var(--accent-red);
    border: 1px solid rgba(248, 113, 113, 0.35);
}
.btn-danger:hover {
    background: rgba(248, 113, 113, 0.28);
}

@media (max-width: 1200px) {
    .tx-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .tx-filter-form { flex-wrap: wrap; }
    .tx-filter-form .form-group {
        flex: 1 1 calc(33.333% - 10px);
        min-width: 140px;
    }
}

/* Forms */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.form-input, .form-select,
select.form-input, select.form-select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    color-scheme: inherit;
}

.form-input:focus, .form-select:focus,
select.form-input:focus, select.form-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(129,140,248,0.15);
}

/* Native dropdown list: prevent light text on white popup in dark UI */
select,
.form-select,
.lang-select {
    color-scheme: inherit;
}

select option,
.form-select option,
.form-input option,
.lang-select option {
    background-color: var(--select-option-bg);
    color: var(--select-option-text);
}

select option:checked,
.form-select option:checked,
.form-input option:checked,
.lang-select option:checked {
    background-color: #4f46e5 linear-gradient(0deg, #4f46e5 0%, #4f46e5 100%);
    color: #ffffff;
}

select option:disabled,
.form-select option:disabled {
    color: var(--text-muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-main);
    color: #fff;
    box-shadow: 0 4px 15px rgba(99,102,241,0.3);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(99,102,241,0.4); color: #fff; }
.btn-secondary { background: var(--bg-glass); color: var(--text-primary); border: 1px solid var(--border-glass); }
.btn-sm { padding: 8px 16px; font-size: 13px; }

/* Budget bar */
.budget-bar { margin-top: 12px; }
.budget-bar-track { height: 10px; background: rgba(255,255,255,0.1); border-radius: 5px; overflow: hidden; }
.budget-bar-fill { height: 100%; border-radius: 5px; transition: width 0.5s; }
.budget-bar-fill.safe { background: var(--accent-green); }
.budget-bar-fill.warning { background: var(--accent-yellow); }
.budget-bar-fill.danger { background: var(--accent-red); }

/* Landing */
.landing-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 40px;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    background: rgba(10,10,26,0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
}

.landing-nav .logo { display: flex; align-items: center; }
.landing-nav .nav-links { display: flex; gap: 32px; align-items: center; }
.landing-nav .nav-links a { color: var(--text-secondary); font-size: 14px; font-weight: 500; }
.landing-nav .nav-links a:hover { color: var(--text-primary); }

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 120px 40px 80px;
    max-width: 1200px;
    margin: 0 auto;
    gap: 60px;
}

.hero-content { flex: 1; }
.hero-content h1 { font-size: clamp(36px, 5vw, 56px); font-weight: 800; line-height: 1.2; margin-bottom: 20px; }
.hero-content h1 span { background: var(--gradient-main); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero-content p { font-size: 18px; color: var(--text-secondary); margin-bottom: 32px; max-width: 500px; }
.hero-buttons { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-visual { flex: 1; display: flex; justify-content: center; }
.hero-mascot { width: 320px; max-width: 100%; height: auto; animation: float 4s ease-in-out infinite; filter: drop-shadow(0 12px 28px rgba(37, 99, 235, 0.25)); border-radius: 0; background: transparent; }

.features-section { padding: 80px 40px; max-width: 1200px; margin: 0 auto; }
.section-title { text-align: center; font-size: 36px; font-weight: 700; margin-bottom: 16px; }
.section-subtitle { text-align: center; color: var(--text-secondary); margin-bottom: 48px; font-size: 16px; }

.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.feature-card { padding: 32px; text-align: center; }
.feature-card .feature-icon { font-size: 48px; margin-bottom: 16px; }
.feature-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.feature-card p { color: var(--text-secondary); font-size: 14px; }

.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; max-width: 1000px; margin: 0 auto; }
.pricing-card { padding: 40px 32px; text-align: center; position: relative; }
.pricing-card.featured { border-color: var(--accent-primary); box-shadow: var(--shadow-neon); }
.pricing-card .plan-name { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.pricing-card .plan-price { font-size: 40px; font-weight: 800; margin-bottom: 4px; }
.pricing-card .plan-price span { font-size: 16px; color: var(--text-secondary); font-weight: 400; }
.pricing-card .plan-features { list-style: none; margin: 24px 0; text-align: left; }
.pricing-card .plan-features li { padding: 8px 0; font-size: 14px; color: var(--text-secondary); }
.pricing-card .plan-features li::before { content: 'âœ“ '; color: var(--accent-green); font-weight: 700; }

.landing-footer { padding: 40px; text-align: center; border-top: 1px solid var(--border-glass); color: var(--text-muted); font-size: 13px; }

/* Auth */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 40px;
}

.auth-card h2 { text-align: center; font-size: 24px; margin-bottom: 8px; }
.auth-card .auth-subtitle { text-align: center; color: var(--text-secondary); margin-bottom: 32px; font-size: 14px; }
.auth-mascot { text-align: center; margin-bottom: 24px; }
.auth-mascot img { width: 110px; height: 110px; border-radius: 0; object-fit: contain; background: transparent; animation: float 3s ease-in-out infinite; }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; }
.alert-error { background: var(--alert-error-bg); border: 1px solid var(--alert-error-border); color: var(--alert-error-text); }
.alert-success { background: var(--alert-success-bg); border: 1px solid var(--alert-success-border); color: var(--alert-success-text); }

/* Admin */
.admin-sidebar { width: 280px; }
.admin-sidebar .nav-section { margin-bottom: 24px; }
.admin-sidebar .nav-section-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); padding: 0 16px; margin-bottom: 8px; }

.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 16px; }
.page-header h2 { font-size: 24px; font-weight: 700; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border-glass); font-size: 14px; }
.data-table th { color: var(--text-secondary); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }

.badge { display: inline-block; padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge-success { background: rgba(52,211,153,0.15); color: var(--accent-green); }
.badge-warning { background: rgba(251,191,36,0.15); color: var(--accent-yellow); }
.badge-danger { background: rgba(248,113,113,0.15); color: var(--accent-red); }

/* Mobile topbar + sidebar */
.app-topbar { display: none; }
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 250;
    background: rgba(15, 10, 30, 0.45);
    backdrop-filter: blur(2px);
    border: 0;
    padding: 0;
    cursor: pointer;
}
.sidebar-backdrop.is-visible { display: block; }
.sidebar-close {
    display: none;
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    background: var(--bg-glass);
    color: var(--text-primary);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.mobile-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--toggle-border);
    border-radius: 12px;
    background: var(--toggle-bg);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    padding: 0;
    color: var(--toggle-bar);
    flex-shrink: 0;
}
.mobile-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--toggle-bar);
    border-radius: 2px;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(129,140,248,0.15); }
    50% { box-shadow: 0 0 30px rgba(129,140,248,0.3); }
}

@media (max-width: 768px) {
    body::before {
        content: none;
    }

    .app-topbar {
        display: block;
        position: sticky;
        top: 0;
        z-index: 200;
        background: var(--topbar-bg);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border-glass);
    }
    .app-topbar-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 10px 16px;
        min-height: 64px;
    }
    .app-topbar .brand-logo--nav img {
        height: 40px;
        max-width: 160px;
    }
    .mobile-toggle { display: inline-flex; }

    .sidebar {
        transform: translateX(-100%);
        z-index: 300;
        box-shadow: 16px 0 40px rgba(0, 0, 0, 0.35);
        background: var(--bg-secondary);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close { display: inline-flex; }
    .sidebar-logo { padding-right: 48px; }

    .main-content {
        margin-left: 0;
        padding: 16px;
        padding-top: 16px;
    }

    body.sidebar-open { overflow: hidden; }

    .mascot-section {
        padding: 16px;
        text-align: left;
    }
    .hero { flex-direction: column; text-align: center; padding: 100px 20px 60px; }
    .hero-content p { margin: 0 auto 32px; }
    .hero-buttons { justify-content: center; }
    .hero-mascot { width: 320px; max-width: 100%; height: auto; animation: float 4s ease-in-out infinite; filter: drop-shadow(0 12px 28px rgba(37, 99, 235, 0.25)); border-radius: 0; background: transparent; }
    .landing-nav { padding: 16px 20px; }
    .landing-nav .nav-links { gap: 16px; }
    .card-grid { grid-template-columns: 1fr 1fr; }
    .tx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tx-filter-form { flex-wrap: wrap; }
    .tx-filter-form .form-group {
        flex: 1 1 calc(50% - 10px);
        min-width: 120px;
    }
}

@media (max-width: 480px) {
    .card-grid { grid-template-columns: 1fr; }
    .tx-grid { grid-template-columns: 1fr; }
    .mascot-avatar {
        width: 112px;
        height: 112px;
    }
    .app-topbar .brand-logo--nav img {
        height: 36px;
        max-width: 140px;
    }
}

/* Chart container */
.chart-container { position: relative; height: 300px; margin-top: 16px; }

.section-title-sm { font-size: 16px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.section-title-ico {
    width: 45px;
    height: 45px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 8px;
}
.lang-switch-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}
.lang-select {
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 8px 32px 8px 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    min-width: 120px;
    color-scheme: inherit;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%9494a3' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}
.lang-select:hover, .lang-select:focus {
    border-color: rgba(129,140,248,0.45);
    outline: none;
}
.lang-switch--compact .lang-select {
    min-width: 110px;
    padding: 6px 28px 6px 10px;
    font-size: 12px;
    width: 100%;
}

.streak-fire { font-size: 20px; animation: pulse-glow 2s infinite; }

.goal-progress { margin-top: 8px; }
.goal-bar { height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; }
.goal-bar-fill { height: 100%; background: var(--gradient-main); border-radius: 3px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 768px) { .two-col { grid-template-columns: 1fr; } }

/* Account (subscription / billing) */
.account-stack {
    display: grid;
    gap: 20px;
    max-width: 960px;
}
.account-card { max-width: none; }
.account-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    border: 1px solid rgba(129, 140, 248, 0.35);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(255, 255, 255, 0.03));
}
.account-banner--warn {
    border-color: rgba(248, 113, 113, 0.35);
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.1), rgba(255, 255, 255, 0.03));
}
.account-banner-text { flex: 1; min-width: 200px; }
.account-banner-text strong {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
}
.account-banner-text p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.45;
}
.account-plan-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}
.account-plan-name {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}
.account-days {
    text-align: center;
    min-width: 88px;
    padding: 10px 14px;
    border-radius: var(--radius);
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(129, 140, 248, 0.25);
}
.account-days-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--accent-primary);
}
.account-days-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.account-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.account-meta {
    padding: 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
}
.account-meta-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.account-meta-value {
    font-size: 15px;
    font-weight: 600;
}
.account-table-wrap { overflow-x: auto; }
.account-upgrade-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}
.account-upgrade-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border-glass);
    background: rgba(255, 255, 255, 0.03);
    transition: border-color 0.2s, transform 0.2s;
}
.account-upgrade-card:hover {
    border-color: rgba(129, 140, 248, 0.4);
    transform: translateY(-2px);
}
.account-upgrade-card.is-featured {
    border-color: rgba(129, 140, 248, 0.45);
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.1), rgba(255, 255, 255, 0.02));
}
.account-upgrade-card.is-current {
    border-color: rgba(52, 211, 153, 0.4);
}
.account-upgrade-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(52, 211, 153, 0.15);
    color: var(--accent-green);
}
.account-upgrade-badge--hot {
    background: rgba(99, 102, 241, 0.18);
    color: var(--accent-primary);
}
.account-upgrade-card h3 {
    margin: 0 28px 0 0;
    font-size: 18px;
}
.account-upgrade-prices {
    display: grid;
    gap: 4px;
    color: var(--text-secondary);
    font-size: 13px;
}
.account-upgrade-prices strong {
    color: var(--text-primary);
    font-size: 18px;
}
.account-feature-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
    flex: 1;
}
.account-feature-list li {
    position: relative;
    padding-left: 18px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}
.account-feature-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-green);
    font-weight: 700;
}
.account-upgrade-btn { width: 100%; text-align: center; margin-top: auto; }
.account-pricing-link {
    margin: 16px 0 0;
    text-align: center;
}
.account-pricing-link a {
    color: var(--accent-primary);
    font-size: 14px;
    font-weight: 600;
}
@media (max-width: 768px) {
    .account-meta-grid { grid-template-columns: 1fr; }
    .account-plan-hero { flex-direction: column; }
}

/* Cart / Checkout */
.checkout-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
    gap: 20px;
    width: min(920px, 100%);
    margin: 0 auto;
    padding: 0 16px;
}
.checkout-form-card,
.checkout-summary-card { width: 100%; max-width: none; }
.checkout-line {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-glass);
}
.checkout-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    font-size: 18px;
}
@media (max-width: 768px) {
    .checkout-layout { grid-template-columns: 1fr; }
}


/* ===== Kakeibo cash ledger ===== */
.kakeibo-page {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
}
.kakeibo-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.kakeibo-header h2 {
    min-width: 0;
    word-break: break-word;
}
.kakeibo-month-nav {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.kakeibo-month-label {
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--text-primary);
    min-width: 6.5em;
    text-align: center;
}
.kakeibo-lead {
    margin: -4px 0 20px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.55;
    max-width: 52em;
}
.kakeibo-workspace {
    display: grid;
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
    gap: 18px;
    margin: 24px 0;
    align-items: start;
    min-width: 0;
}
.kakeibo-cal,
.kakeibo-ledger {
    min-width: 0;
}
.kakeibo-cal {
    padding: 16px;
}
.kakeibo-cal-title {
    font-weight: 800;
    font-size: 0.92rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}
.kakeibo-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}
.kakeibo-cal-wd {
    text-align: center;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 4px 0;
    letter-spacing: 0.02em;
}
.kakeibo-cal-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.85rem;
    background: rgba(124, 92, 196, 0.06);
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.kakeibo-cal-cell.is-empty {
    background: transparent;
    pointer-events: none;
}
.kakeibo-cal-cell:hover {
    background: rgba(124, 92, 196, 0.14);
    border-color: rgba(124, 92, 196, 0.25);
}
.kakeibo-cal-cell.is-today {
    box-shadow: inset 0 0 0 1.5px rgba(124, 92, 196, 0.45);
}
.kakeibo-cal-cell.is-selected {
    background: linear-gradient(145deg, #8b6fd4, #6d52b8);
    color: #fff;
    border-color: transparent;
}
.kakeibo-cal-cell.has-activity .kakeibo-cal-num { margin-bottom: 2px; }
.kakeibo-cal-dots {
    display: flex;
    gap: 3px;
    height: 5px;
}
.kakeibo-cal-dots .dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    display: block;
}
.kakeibo-cal-dots .dot.income { background: var(--accent-green); }
.kakeibo-cal-dots .dot.expense { background: var(--accent-red); }
.kakeibo-cal-cell.is-selected .dot.income { background: #b8f5d0; }
.kakeibo-cal-cell.is-selected .dot.expense { background: #ffc9d4; }

.kakeibo-cal-mascot {
    margin-top: 16px;
    padding: 14px 10px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    border-radius: 16px;
    background: rgba(124, 92, 196, 0.06);
    border: 1px dashed rgba(124, 92, 196, 0.18);
}
.kakeibo-cal-mascot img {
    width: auto;
    height: 165px;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 18px rgba(70, 50, 120, 0.22));
}
.kakeibo-cal-mascot-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 4px;
}
.kakeibo-cal-mascot-meta strong {
    font-size: 0.95rem;
    color: var(--text-primary);
}
.kakeibo-cal-mascot-meta span {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    word-break: break-word;
}
.kakeibo-cal-mascot.mood-celebrate { background: rgba(52, 211, 153, 0.12); border-color: rgba(52, 211, 153, 0.28); }
.kakeibo-cal-mascot.mood-cheer,
.kakeibo-cal-mascot.mood-yay { background: rgba(110, 231, 183, 0.1); border-color: rgba(110, 231, 183, 0.24); }
.kakeibo-cal-mascot.mood-great { background: rgba(196, 181, 253, 0.12); border-color: rgba(167, 139, 250, 0.28); }
.kakeibo-cal-mascot.mood-calm { background: rgba(124, 92, 196, 0.06); }
.kakeibo-cal-mascot.mood-think { background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.28); }
.kakeibo-cal-mascot.mood-worried { background: rgba(251, 146, 60, 0.12); border-color: rgba(251, 146, 60, 0.28); }
.kakeibo-cal-mascot.mood-oops,
.kakeibo-cal-mascot.mood-sad { background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.28); }

.kakeibo-ledger-frame {
    position: relative;
    border-radius: 18px;
    padding: 22px 20px 16px;
    background:
        linear-gradient(180deg, rgba(255, 252, 247, 0.97), rgba(248, 242, 232, 0.95));
    color: #3d3428;
    border: 1.5px solid rgba(140, 110, 70, 0.28);
    box-shadow:
        0 14px 36px rgba(70, 50, 30, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.75);
    overflow: hidden;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
[data-theme="dark"] .kakeibo-ledger-frame {
    background:
        linear-gradient(180deg, rgba(48, 40, 58, 0.96), rgba(36, 30, 48, 0.98));
    color: #efe6d8;
    border-color: rgba(196, 168, 120, 0.28);
    box-shadow:
        0 14px 36px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.kakeibo-ledger-frame::before {
    content: "";
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(140, 110, 70, 0.18);
    border-radius: 12px;
    pointer-events: none;
}
[data-theme="dark"] .kakeibo-ledger-frame::before {
    border-color: rgba(196, 168, 120, 0.16);
}
.kakeibo-ledger-head {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1.5px double rgba(140, 110, 70, 0.35);
}
[data-theme="dark"] .kakeibo-ledger-head {
    border-bottom-color: rgba(196, 168, 120, 0.3);
}
.kakeibo-ledger-seal {
    margin: 0 0 4px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #9a6b3c;
}
[data-theme="dark"] .kakeibo-ledger-seal { color: #d4b07a; }
.kakeibo-ledger-head h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}
.kakeibo-ledger-date {
    font-weight: 700;
    font-size: 0.95rem;
    opacity: 0.85;
}
.kakeibo-ledger-table {
    position: relative;
    display: grid;
    gap: 0;
}
.kakeibo-ledger-section-label {
    margin: 12px 0 4px;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9a6b3c;
    background: rgba(154, 107, 60, 0.08);
    border-radius: 6px;
}
[data-theme="dark"] .kakeibo-ledger-section-label {
    color: #d4b07a;
    background: rgba(212, 176, 122, 0.1);
}
.kakeibo-ledger-row {
    display: grid;
    grid-template-columns: 7.5em minmax(0, 1fr) auto;
    gap: 10px;
    align-items: baseline;
    padding: 9px 8px;
    border-bottom: 1px dashed rgba(140, 110, 70, 0.22);
    font-size: 0.9rem;
}
[data-theme="dark"] .kakeibo-ledger-row {
    border-bottom-color: rgba(196, 168, 120, 0.18);
}
.kakeibo-ledger-label { font-weight: 700; opacity: 0.8; }
.kakeibo-ledger-desc {
    min-width: 0;
    line-height: 1.4;
}
.kakeibo-ledger-desc small {
    display: block;
    margin-top: 2px;
    font-size: 0.75rem;
    opacity: 0.65;
}
.kakeibo-ledger-amt {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}
.kakeibo-ledger-amt.is-plus { color: #1f8a5b; }
.kakeibo-ledger-amt.is-minus { color: #c0455c; }
[data-theme="dark"] .kakeibo-ledger-amt.is-plus { color: #5ee0a0; }
[data-theme="dark"] .kakeibo-ledger-amt.is-minus { color: #ff8fa3; }
.kakeibo-ledger-row.is-carry {
    background: rgba(154, 107, 60, 0.07);
    border-radius: 8px;
    border-bottom: none;
    margin-bottom: 4px;
}
.kakeibo-ledger-row.is-empty-row { opacity: 0.55; font-style: italic; }
.kakeibo-ledger-row.is-subtotal {
    border-bottom-style: solid;
    border-bottom-color: rgba(140, 110, 70, 0.28);
}
.kakeibo-ledger-row.is-diff {
    background: rgba(124, 92, 196, 0.08);
    border-radius: 8px;
    border-bottom: none;
    margin-top: 6px;
}
.kakeibo-ledger-row.is-closing {
    margin-top: 6px;
    background: rgba(154, 107, 60, 0.12);
    border-radius: 8px;
    border-bottom: none;
    font-size: 0.98rem;
}
.kakeibo-reflect {
    margin-top: 8px;
    max-width: none;
}
.kakeibo-notebook {
    position: relative;
    border-radius: 18px;
    padding: 24px 22px 20px;
    background:
        repeating-linear-gradient(
            transparent,
            transparent 27px,
            rgba(140, 110, 70, 0.12) 28px
        ),
        linear-gradient(180deg, #fbf6ec 0%, #f3e8d4 100%);
    color: #3d3428;
    border: 1.5px solid rgba(140, 110, 70, 0.32);
    box-shadow:
        0 14px 36px rgba(70, 50, 30, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    overflow: hidden;
}
.kakeibo-notebook::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 28px;
    background:
        linear-gradient(90deg, rgba(180, 60, 60, 0.14), rgba(180, 60, 60, 0.05) 70%, transparent),
        repeating-linear-gradient(
            180deg,
            transparent 0 18px,
            rgba(120, 70, 40, 0.18) 18px 19px
        );
    border-right: 1px solid rgba(180, 60, 60, 0.28);
    pointer-events: none;
}
.kakeibo-notebook::after {
    content: "";
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(140, 110, 70, 0.16);
    border-radius: 12px;
    pointer-events: none;
}
[data-theme="dark"] .kakeibo-notebook {
    background:
        repeating-linear-gradient(
            transparent,
            transparent 27px,
            rgba(196, 168, 120, 0.1) 28px
        ),
        linear-gradient(180deg, rgba(52, 42, 58, 0.98), rgba(38, 30, 46, 0.98));
    color: #efe6d8;
    border-color: rgba(196, 168, 120, 0.28);
    box-shadow:
        0 14px 36px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
[data-theme="dark"] .kakeibo-notebook::before {
    background:
        linear-gradient(90deg, rgba(212, 120, 120, 0.16), rgba(212, 120, 120, 0.04) 70%, transparent),
        repeating-linear-gradient(
            180deg,
            transparent 0 18px,
            rgba(196, 168, 120, 0.16) 18px 19px
        );
    border-right-color: rgba(212, 140, 140, 0.28);
}
[data-theme="dark"] .kakeibo-notebook::after {
    border-color: rgba(196, 168, 120, 0.14);
}
.kakeibo-notebook-head {
    position: relative;
    z-index: 1;
    margin: 0 0 18px 22px;
    padding-bottom: 12px;
    border-bottom: 1.5px double rgba(140, 110, 70, 0.35);
}
[data-theme="dark"] .kakeibo-notebook-head {
    border-bottom-color: rgba(196, 168, 120, 0.3);
}
.kakeibo-notebook-seal {
    margin: 0 0 4px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #9a6b3c;
}
[data-theme="dark"] .kakeibo-notebook-seal { color: #d4b07a; }
.kakeibo-notebook-head h3 {
    margin: 0;
    font-size: clamp(1.15rem, 2.2vw, 1.4rem);
    font-weight: 800;
    letter-spacing: 0.01em;
    color: inherit;
}
.kakeibo-notebook-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 20px;
    margin-left: 22px;
}
.kakeibo-notebook-field { margin-bottom: 0; }
.kakeibo-notebook-field .form-label {
    color: inherit;
    opacity: 0.9;
    font-weight: 800;
}
.kakeibo-notebook-input {
    background: rgba(255, 252, 245, 0.72) !important;
    border: 1px solid rgba(140, 110, 70, 0.28) !important;
    color: #3d3428 !important;
    border-radius: 12px !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
    min-height: 150px;
    line-height: 1.65;
    resize: vertical;
}
.kakeibo-notebook-input:focus {
    border-color: rgba(154, 107, 60, 0.55) !important;
    box-shadow: 0 0 0 3px rgba(154, 107, 60, 0.15);
}
.kakeibo-notebook-input::placeholder { color: rgba(61, 52, 40, 0.45); }
[data-theme="dark"] .kakeibo-notebook-input {
    background: rgba(28, 22, 36, 0.55) !important;
    border-color: rgba(196, 168, 120, 0.25) !important;
    color: #efe6d8 !important;
}
[data-theme="dark"] .kakeibo-notebook-input::placeholder { color: rgba(239, 230, 216, 0.4); }
.kakeibo-notebook-actions {
    position: relative;
    z-index: 1;
    margin: 18px 0 0 22px;
}

@media (max-width: 1100px) {
    .kakeibo-workspace {
        grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
        gap: 14px;
    }
}
@media (max-width: 900px) {
    .kakeibo-workspace {
        grid-template-columns: 1fr;
    }
    .kakeibo-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .kakeibo-header h2 {
        font-size: clamp(1.2rem, 5vw, 1.5rem);
    }
    .kakeibo-month-nav {
        justify-content: space-between;
        width: 100%;
    }
    .kakeibo-lead {
        font-size: 0.9rem;
        margin-bottom: 16px;
    }
    .kakeibo-cal {
        order: 0;
    }
    .kakeibo-ledger {
        order: 1;
        min-width: 0;
    }
    .kakeibo-cal-mascot img {
        height: 120px;
    }
}
@media (max-width: 800px) {
    .kakeibo-notebook-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .kakeibo-page,
    .kakeibo-workspace,
    .kakeibo-reflect {
        width: 100%;
        max-width: 100%;
    }
    .kakeibo-cal {
        padding: 12px;
    }
    .kakeibo-cal-grid {
        gap: 3px;
    }
    .kakeibo-cal-wd {
        font-size: 0.62rem;
        padding: 2px 0;
    }
    .kakeibo-cal-cell {
        min-height: 36px;
        font-size: 0.78rem;
        border-radius: 8px;
    }
    .kakeibo-cal-mascot {
        margin-top: 12px;
        padding: 12px 8px 8px;
    }
    .kakeibo-cal-mascot img {
        height: 100px;
    }
    .kakeibo-cal-mascot-meta strong { font-size: 0.9rem; }
    .kakeibo-cal-mascot-meta span { font-size: 0.75rem; }
    .kakeibo-ledger-frame {
        padding: 16px 12px 12px;
        border-radius: 14px;
    }
    .kakeibo-ledger-frame::before {
        inset: 6px;
    }
    .kakeibo-ledger-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        margin-bottom: 12px;
    }
    .kakeibo-ledger-head h3 {
        font-size: 1.05rem;
    }
    .kakeibo-ledger-date {
        font-size: 0.85rem;
    }
    .kakeibo-ledger-row {
        grid-template-columns: 1fr;
        gap: 2px 8px;
        padding: 10px 6px;
    }
    .kakeibo-ledger-amt {
        text-align: left;
        font-size: 0.95rem;
    }
    .kakeibo-ledger-label {
        font-size: 0.8rem;
    }
    .kakeibo-notebook {
        padding: 16px 12px 14px;
        border-radius: 14px;
    }
    .kakeibo-notebook::before {
        width: 16px;
    }
    .kakeibo-notebook-head,
    .kakeibo-notebook-grid,
    .kakeibo-notebook-actions {
        margin-left: 10px;
    }
    .kakeibo-notebook-head h3 {
        font-size: 1.05rem;
        line-height: 1.35;
    }
    .kakeibo-notebook-input {
        min-height: 120px;
        font-size: 0.92rem;
    }
    .kakeibo-notebook-actions .btn {
        width: 100%;
    }
}
@media (max-width: 420px) {
    .kakeibo-cal-cell {
        min-height: 32px;
        font-size: 0.72rem;
    }
    .kakeibo-cal-mascot img {
        height: 88px;
    }
    .kakeibo-month-label {
        font-size: 0.95rem;
        min-width: 0;
        flex: 1;
    }
}

/* ===== Admin: KIZUNA CHRONICLES ===== */
.chronicle-admin-layout {
    display: grid;
    grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}
.chronicle-admin-form .form-hint {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--text-muted);
}
.chronicle-cover-preview {
    margin-bottom: 10px;
}
.chronicle-cover-preview img {
    width: 120px;
    height: 170px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border-glass);
    display: block;
}
.chronicle-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}
.chronicle-admin-card {
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    overflow: hidden;
    background: rgba(255,255,255,0.02);
    display: flex;
    flex-direction: column;
}
.chronicle-admin-card.is-inactive {
    opacity: 0.55;
}
.chronicle-admin-card-cover {
    position: relative;
    aspect-ratio: 3 / 4;
    background: rgba(124, 92, 196, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}
.chronicle-admin-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.chronicle-admin-card-placeholder {
    font-size: 2rem;
    opacity: 0.5;
}
.chronicle-admin-card-no {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(0,0,0,0.55);
    color: #fff;
}
.chronicle-admin-card-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.chronicle-admin-card-body h3 {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.35;
    font-weight: 700;
}
.chronicle-admin-card-meta {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.chronicle-admin-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
    padding-top: 8px;
}
.chronicle-admin-card-actions form {
    display: inline;
    margin: 0;
}
@media (max-width: 900px) {
    .chronicle-admin-layout {
        grid-template-columns: 1fr;
    }
}

/* ===== User: KIZUNA CHRONICLES ===== */
.sidebar-nav .icon--favicon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sidebar-nav .icon--favicon img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 6px;
}
.chronicle-page-header {
    align-items: center;
    gap: 14px;
}
.chronicle-coin-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(251, 191, 36, 0.14);
    border: 1px solid rgba(251, 191, 36, 0.28);
    color: var(--text-primary);
    font-size: 0.92rem;
    white-space: nowrap;
}
.chronicle-coin-pill img {
    flex-shrink: 0;
}
.chronicle-lead {
    margin: -8px 0 22px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.55;
    max-width: 40em;
}
.chronicle-empty {
    text-align: center;
    padding: 36px 16px;
    color: var(--text-muted);
    margin: 0;
}
.chronicle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}
.chronicle-card {
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    border: 1px solid var(--border-glass);
    background: rgba(255,255,255,0.03);
    overflow: hidden;
    min-width: 0;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.chronicle-card.is-next {
    border-color: rgba(167, 139, 250, 0.55);
    box-shadow: 0 0 0 1px rgba(167, 139, 250, 0.15);
}
.chronicle-card.is-unlocked {
    border-color: rgba(52, 211, 153, 0.28);
}
.chronicle-card-cover {
    position: relative;
    aspect-ratio: 3 / 4;
    background: rgba(124, 92, 196, 0.12);
}
.chronicle-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.chronicle-card-cover img.is-dimmed {
    filter: grayscale(0.35) brightness(0.72);
}
.chronicle-card-no {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(0,0,0,0.55);
    color: #fff;
}
.chronicle-card-lock {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    background: rgba(10, 8, 20, 0.28);
    pointer-events: none;
}
.chronicle-card-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.chronicle-card-title {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.chronicle-card-meta {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}
.chronicle-card-actions {
    margin-top: auto;
    padding-top: 8px;
}
.chronicle-card-actions .btn {
    width: 100%;
    justify-content: center;
}
.chronicle-card-actions form {
    margin: 0;
}
.chronicle-need-coins {
    margin: 6px 0 0;
    font-size: 0.72rem;
    color: var(--accent-red, #f87171);
    line-height: 1.35;
}
.chronicle-reader-header {
    gap: 12px;
}
.chronicle-reader-no {
    display: inline-block;
    margin-right: 6px;
    opacity: 0.7;
    font-weight: 800;
}
.chronicle-reader {
    padding: 0;
    overflow: hidden;
}
.chronicle-reader-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(12, 10, 28, 0.72);
}
.chronicle-reader-nav,
.chronicle-reader-zoom {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.chronicle-reader-page {
    min-width: 4.5em;
    text-align: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.chronicle-reader-body {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 72vh;
    height: calc(100vh - 260px);
}
.chronicle-reader-viewport {
    position: relative;
    overflow: auto;
    background:
        radial-gradient(ellipse at top, rgba(88, 60, 140, 0.18), transparent 55%),
        #0b0b16;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 16px;
    user-select: none;
    -webkit-user-select: none;
}
.chronicle-pdf-page {
    position: relative;
    margin: 0 auto;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    border-radius: 4px;
    background: #fff;
    overflow: hidden;
}
.chronicle-reader-viewport canvas {
    display: block;
    max-width: none;
    height: auto;
    background: #fff;
}
.chronicle-reader-status {
    position: absolute;
    left: 50%;
    top: 40%;
    transform: translate(-50%, -50%);
    padding: 10px 16px;
    border-radius: 12px;
    background: rgba(20, 16, 40, 0.9);
    border: 1px solid rgba(196, 181, 253, 0.25);
    color: var(--text-primary);
    font-size: 0.92rem;
    z-index: 2;
    pointer-events: none;
}
@media (max-width: 720px) {
    .chronicle-page-header {
        flex-direction: column;
        align-items: stretch;
    }
    .chronicle-coin-pill {
        justify-content: center;
        width: 100%;
    }
    .chronicle-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
    .chronicle-card-body {
        padding: 10px;
    }
    .chronicle-card-title {
        font-size: 0.85rem;
    }
    .chronicle-reader-header {
        flex-direction: column;
        align-items: stretch;
    }
    .chronicle-reader-header .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    .chronicle-reader-toolbar {
        padding: 10px;
    }
    .chronicle-reader-body {
        min-height: 60vh;
        height: calc(100vh - 240px);
    }
}
@media (max-width: 380px) {
    .chronicle-grid {
        grid-template-columns: 1fr;
    }
}

@media print {
    .sidebar,
    .app-topbar,
    .chronicle-reader-toolbar,
    .chronicle-reader-header {
        display: none !important;
    }
    .chronicle-reader-viewport canvas {
        display: none !important;
    }
    body:has(.chronicle-reader)::after {
        content: 'Printing is disabled for KIZUNA CHRONICLES.';
        display: block;
        padding: 2rem;
        font-size: 1.1rem;
    }
}

/* ===== Kizu Coin celebration ===== */
body.kizu-celebrate-lock {
    overflow: hidden;
}
.kizu-celebrate-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, rgba(40, 24, 72, 0.55), rgba(6, 6, 18, 0.82));
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}
.kizu-celebrate-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
}
.kizu-celebrate-overlay.is-done {
    opacity: 0;
    transition: opacity 0.35s ease;
}
.kizu-celebrate-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.kizu-celebrate-stage {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(92vw, 420px);
}
.kizu-celebrate-burst {
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.35), transparent 70%);
    transform: scale(0.4);
    opacity: 0;
}
.kizu-celebrate-overlay.is-active .kizu-celebrate-burst {
    animation: kizuBurst 1.1s ease-out forwards;
}
.kizu-celebrate-card {
    position: relative;
    text-align: center;
    padding: 28px 24px 24px;
    border-radius: 24px;
    background: linear-gradient(160deg, rgba(124, 92, 196, 0.28), rgba(30, 20, 50, 0.92));
    border: 1px solid rgba(196, 181, 253, 0.35);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 40px rgba(167, 139, 250, 0.2);
    transform: scale(0.6) translateY(24px);
    opacity: 0;
}
.kizu-celebrate-overlay.is-active .kizu-celebrate-card {
    animation: kizuCardIn 0.7s cubic-bezier(0.22, 1.2, 0.36, 1) forwards;
}
.kizu-celebrate-card.is-departing {
    animation: kizuCardOut 0.45s ease forwards;
}
.kizu-celebrate-coin {
    width: 88px;
    height: 88px;
    object-fit: contain;
    filter: drop-shadow(0 12px 20px rgba(251, 191, 36, 0.45));
    animation: kizuCoinSpin 1.4s ease-in-out infinite;
}
.kizu-celebrate-amount {
    margin-top: 10px;
    font-size: clamp(2.4rem, 10vw, 3.4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(120deg, #fde68a, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1;
}
.kizu-celebrate-title {
    margin-top: 10px;
    font-size: 1.15rem;
    font-weight: 800;
    color: #efe8ff;
}
.kizu-celebrate-sub {
    margin-top: 6px;
    font-size: 0.9rem;
    color: rgba(226, 216, 255, 0.75);
    line-height: 1.4;
}
.kizu-celebrate-flyer {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 10000;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    pointer-events: none;
    filter: drop-shadow(0 8px 16px rgba(251, 191, 36, 0.55));
}
.kizu-celebrate-flyer.is-flying {
    opacity: 1;
}
.kizu-celebrate-flyer img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
#kizu-coin-target.kizu-coin-pulse {
    animation: kizuTargetPulse 0.7s ease;
}
@keyframes kizuCardIn {
    to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes kizuCardOut {
    to { opacity: 0; transform: scale(0.85) translateY(-12px); }
}
@keyframes kizuBurst {
    0% { opacity: 0; transform: scale(0.4); }
    40% { opacity: 1; }
    100% { opacity: 0; transform: scale(1.8); }
}
@keyframes kizuCoinSpin {
    0%, 100% { transform: rotate(-8deg) scale(1); }
    50% { transform: rotate(8deg) scale(1.06); }
}
@keyframes kizuTargetPulse {
    0% { transform: scale(1); box-shadow: none; }
    40% { transform: scale(1.08); box-shadow: 0 0 0 6px rgba(251, 191, 36, 0.25); }
    100% { transform: scale(1); box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
    .kizu-celebrate-coin { animation: none; }
    .kizu-celebrate-overlay.is-active .kizu-celebrate-card {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* Kizu Assistant — monthly financial report (lavender theme) */
.kizu-report {
    --kr-bg: #f3e8ff;
    --kr-bg2: #ebe4ff;
    --kr-card: #ffffff;
    --kr-text: #3b2a6e;
    --kr-muted: #6b628a;
    --kr-purple: #6d28d9;
    --kr-purple-soft: #ede9fe;
    --kr-green: #16a34a;
    --kr-green-bg: #ecfdf5;
    --kr-red: #e11d48;
    --kr-orange: #ea580c;
    --kr-radius: 18px;
    --kr-shadow: 0 10px 28px rgba(109, 40, 217, 0.08);
    margin-bottom: 28px;
    color: var(--kr-text);
}
.kizu-report-surface {
    background:
        radial-gradient(120% 80% at 70% 0%, #ebe4ff 0%, transparent 55%),
        linear-gradient(165deg, #f8f5ff 0%, #f3e8ff 100%);
    border: 1px solid rgba(124, 58, 237, 0.1);
    border-radius: 28px;
    padding: 16px 16px 20px;
    box-shadow: var(--kr-shadow);
}
.kizu-report-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(180px, 0.95fr) minmax(180px, 0.72fr);
    gap: 18px 22px;
    align-items: center;
    margin-bottom: 22px;
    padding: 28px 28px 24px;
    border-radius: 24px;
    border: 1px solid rgba(124, 58, 237, 0.16);
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(ellipse 70% 90% at 55% 45%, rgba(255, 255, 255, 0.72) 0%, transparent 58%),
        radial-gradient(ellipse 50% 70% at 12% 80%, rgba(167, 139, 250, 0.28) 0%, transparent 55%),
        radial-gradient(ellipse 45% 60% at 92% 20%, rgba(196, 181, 253, 0.35) 0%, transparent 50%),
        linear-gradient(120deg, #ddd6fe 0%, #efe7ff 38%, #f7f3ff 55%, #e9e0ff 100%);
    box-shadow: var(--kr-shadow);
}
.kizu-report-hero::before {
    content: "";
    position: absolute;
    inset: -20% -10%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.45;
    background:
        repeating-linear-gradient(
            115deg,
            transparent 0 18px,
            rgba(124, 58, 237, 0.045) 18px 19px
        ),
        repeating-linear-gradient(
            -20deg,
            transparent 0 26px,
            rgba(109, 40, 217, 0.035) 26px 27px
        );
    mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000 20%, transparent 75%);
    animation: kizu-hero-mesh 18s linear infinite;
}
.kizu-report-hero > * {
    position: relative;
    z-index: 1;
}
.kizu-report-title {
    margin: 0 0 12px;
    font-size: clamp(1.35rem, 2.2vw, 1.85rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #4c1d95;
    line-height: 1.2;
}
.kizu-report-summary {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--kr-muted);
    max-width: 42rem;
}
.kizu-report-hero-art {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 220px;
}
.kizu-report-hero-stage {
    position: relative;
    width: min(100%, 300px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
}
.kizu-report-hero-stage::after {
    content: "";
    position: absolute;
    left: 12%;
    right: 12%;
    bottom: 8%;
    height: 18%;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(109, 40, 217, 0.22), transparent 70%);
    filter: blur(6px);
    animation: kizu-hero-glow 3.6s ease-in-out infinite;
}
.kizu-report-hero-img {
    width: 100%;
    height: auto;
    display: block;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 14px 22px rgba(91, 33, 182, 0.22));
    animation: kizu-hero-float 4.2s ease-in-out infinite;
    transform-origin: 50% 70%;
}
.kizu-report-rate-card {
    background: #fff;
    border-radius: 20px;
    padding: 22px 20px 18px;
    box-shadow:
        0 18px 40px rgba(91, 33, 182, 0.16),
        0 2px 0 rgba(255, 255, 255, 0.8) inset;
    border: 1px solid rgba(124, 58, 237, 0.08);
    text-align: center;
    min-width: 0;
}
.kizu-report-rate-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: #8b83a5;
}
.kizu-report-rate-value {
    margin: 10px 0 14px;
    font-size: clamp(2rem, 3.2vw, 2.6rem);
    font-weight: 800;
    color: var(--kr-purple);
    letter-spacing: -0.03em;
    line-height: 1;
}
.kizu-report-rate-goal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.86rem;
    font-weight: 600;
    color: #7c3aed;
}
.kizu-r-ico {
    display: inline-block;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    object-fit: contain;
}
.kizu-r-ico--title {
    width: 32px;
    height: 32px;
}
.kizu-r-ico--item {
    width: 32px;
    height: 32px;
}
.kizu-r-ico--inline {
    width: 18px;
    height: 18px;
    vertical-align: -3px;
}
.kizu-r-ico--btn {
    width: 18px;
    height: 18px;
    vertical-align: -3px;
}
.cat-ico.kizu-r-ico--item {
    width: 32px;
    height: 32px;
}

.kizu-report-body { display: flex; flex-direction: column; gap: 16px; }
.kizu-report-row {
    display: grid;
    gap: 16px;
    align-items: stretch;
}
.kizu-report-row--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kizu-report-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.kizu-report-card {
    background: var(--kr-card);
    border-radius: var(--kr-radius);
    padding: 18px 18px 16px;
    border: 1px solid rgba(124, 58, 237, 0.08);
    box-shadow: 0 6px 18px rgba(76, 29, 149, 0.05);
    min-width: 0;
}
.kizu-report-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--kr-text);
}

.kizu-report-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.kizu-report-list > li {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 10px 12px;
    align-items: start;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--kr-muted);
}
.kizu-report-list--areas > li,
.kizu-report-list--budget > li,
.kizu-report-list--save > li {
    display: block;
}
.kizu-report-area-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.kizu-report-area-head strong {
    color: var(--kr-text);
    font-weight: 700;
}
.kizu-report-msg {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--kr-muted);
}
.kizu-report-budget-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 4px 0 6px;
    font-size: 0.88rem;
    color: var(--kr-text);
}
.kizu-report-budget-row em {
    display: block;
    font-style: normal;
    font-size: 0.72rem;
    color: var(--kr-muted);
    margin-bottom: 2px;
}
.kizu-report-arrow {
    color: var(--kr-purple);
    font-weight: 700;
}
.kizu-report-save-amt {
    font-size: 0.88rem;
    color: var(--kr-muted);
    margin-bottom: 4px;
}
.kizu-report-save-amt b {
    color: var(--kr-green);
    font-weight: 700;
}

.kizu-sev {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.kizu-sev--low { background: rgba(22, 163, 74, 0.12); color: var(--kr-green); }
.kizu-sev--medium { background: rgba(234, 88, 12, 0.12); color: var(--kr-orange); }
.kizu-sev--high { background: rgba(225, 29, 72, 0.12); color: var(--kr-red); }

.kizu-report-card--summary {
    display: flex;
    flex-direction: column;
    padding: 0;
    padding-left: 30px;
    padding-right: 30px;
    overflow: hidden;
    background: linear-gradient(180deg, #9333ea 0%, #a855f7 22%, #c4b5fd 62%, #f5f3ff 100%);
    color: #fff;
    border: none;
    box-shadow: 0 14px 32px rgba(147, 51, 234, 0.28);
}
.kizu-report-summary-head {
    padding: 18px 0 12px;
    margin: 0;
}
.kizu-report-card--summary .kizu-report-card-title { color: #fff; }
.kizu-report-card--summary .kizu-r-ico {
    filter: brightness(0) invert(1);
}
.kizu-report-summary-body {
    padding: 0 0 16px;
}
.kizu-report-summary-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding-bottom: 14px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.28);
}
.kizu-report-summary-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.kizu-report-summary-label {
    font-size: 0.78rem;
    opacity: 0.88;
    font-weight: 500;
}
.kizu-report-summary-value {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.kizu-report-summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}
.kizu-report-summary-row-label {
    font-size: 0.86rem;
    opacity: 0.9;
}
.kizu-report-summary-row-value,
.kizu-report-summary-rate-val {
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.kizu-report-summary-row.is-neg .kizu-report-summary-row-value {
    color: #fda4af;
}
.kizu-report-summary-row.is-pos .kizu-report-summary-row-value {
    color: #bbf7d0;
}
.kizu-report-summary-rate {
    padding-bottom: 14px;
    margin-bottom: 4px;
}
.kizu-report-summary-rate .kizu-report-summary-row {
    border-bottom: none;
    padding-bottom: 8px;
}
.kizu-report-summary-rate-val {
    font-size: 1.35rem;
}
.kizu-report-card--summary .kizu-report-progress {
    height: 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.28);
    overflow: hidden;
    margin: 0;
}
.kizu-report-card--summary .kizu-report-progress > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #f9a8d4, #fda4af);
}
.kizu-report-card--summary .kizu-report-progress.is-pos > span {
    background: linear-gradient(90deg, #86efac, #bbf7d0);
}
.kizu-report-card--summary .kizu-report-cta {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 14px;
    padding: 13px 16px;
    background: #fff;
    color: #7c3aed;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(91, 33, 182, 0.18);
}
.kizu-report-card--summary .kizu-report-cta:hover { filter: brightness(1.03); }
.kizu-report-card--summary .kizu-report-cta .kizu-r-ico { filter: none; }
.kizu-report-summary-foot {
    padding: 16px 30px 18px;
    background: rgba(255, 255, 255, 0.72);
    border-top: 1px solid rgba(255, 255, 255, 0.45);
}
.kizu-report-summary-foot .kizu-report-quote {
    margin: 0;
    text-align: center;
    font-size: 0.82rem;
    line-height: 1.5;
    font-style: italic;
    color: #5b21b6;
    opacity: 1;
}
.kizu-report-quote-by {
    margin: 8px 0 0;
    text-align: right;
    font-size: 0.78rem;
    font-weight: 600;
    color: #6d28d9;
}

.kizu-report-footer {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(124, 58, 237, 0.12);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.kizu-report-disclaimer {
    margin: 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: 52rem;
    font-size: 0.75rem;
    line-height: 1.45;
    color: var(--kr-muted);
}
.kizu-report-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.kizu-share-wrap {
    position: relative;
}
.kizu-share-popover {
    position: absolute;
    bottom: calc(100% + 30px);
    right: 0;
    z-index: 40;
    min-width: 280px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid rgba(124, 58, 237, 0.22);
    background: var(--card-bg, #fff);
    box-shadow: 0 16px 40px rgba(109, 40, 217, 0.18);
    transform: translateX(24px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
}
.kizu-share-popover.is-open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}
.kizu-share-popover-title {
    margin: 0 0 10px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--kr-purple, #7c3aed);
}
.kizu-share-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.kizu-share-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(248, 250, 252, 0.9);
    color: var(--text, #1e293b);
    font-size: 0.82rem;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.kizu-share-item:hover {
    background: rgba(124, 58, 237, 0.08);
    border-color: rgba(124, 58, 237, 0.35);
    transform: translateY(-1px);
}
.kizu-share-item-ico {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    flex-shrink: 0;
    color: #fff;
}
.kizu-share-item--x .kizu-share-item-ico { background: #0f1419; }
.kizu-share-item--facebook .kizu-share-item-ico { background: #1877f2; font-family: Georgia, serif; }
.kizu-share-item--linkedin .kizu-share-item-ico { background: #0a66c2; font-size: 0.62rem; }
.kizu-share-item--whatsapp .kizu-share-item-ico { background: #25d366; font-size: 0.58rem; }
.kizu-share-item--telegram .kizu-share-item-ico { background: #229ed9; font-size: 0.58rem; }
.kizu-share-item--email .kizu-share-item-ico { background: #64748b; }
.kizu-share-item--copy .kizu-share-item-ico { background: #7c3aed; }
.kizu-report-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 12px;
    border: 1.5px solid rgba(109, 40, 217, 0.45);
    background: transparent;
    color: var(--kr-purple);
    font-weight: 650;
    font-size: 0.85rem;
    cursor: pointer;
}
.kizu-report-btn:hover {
    background: rgba(124, 58, 237, 0.06);
}

@keyframes kizu-hero-float {
    0%, 100% { transform: translateY(0) rotate(-0.6deg); }
    50% { transform: translateY(-10px) rotate(0.6deg); }
}
@keyframes kizu-hero-glow {
    0%, 100% { opacity: 0.55; transform: scaleX(1); }
    50% { opacity: 0.9; transform: scaleX(1.08); }
}
@keyframes kizu-hero-mesh {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(-24px, 10px, 0); }
}

@media (max-width: 1100px) {
    .kizu-report-row--3 { grid-template-columns: 1fr 1fr; }
    .kizu-report-card--summary { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
    .kizu-report-hero {
        grid-template-columns: 1fr;
        text-align: left;
        padding: 20px 16px 18px;
    }
    .kizu-report-hero-art { order: -1; min-height: 0; }
    .kizu-report-hero-stage { width: min(100%, 240px); }
    .kizu-report-rate-card { max-width: 280px; }
    .kizu-report-row--2,
    .kizu-report-row--3 { grid-template-columns: 1fr; }
    .kizu-report-card--summary { grid-column: auto; }
    .kizu-report-surface { padding: 12px 10px 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .kizu-report-hero::before,
    .kizu-report-hero-img,
    .kizu-report-hero-stage::after {
        animation: none !important;
    }
}
@media print {
    @page {
        size: A4 portrait;
        margin: 10mm 8mm;
    }

    html,
    body.kizu-report-print {
        width: auto !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
        background: #fff !important;
    }

    body.kizu-report-print .app-topbar,
    body.kizu-report-print .sidebar,
    body.kizu-report-print .sidebar-backdrop,
    body.kizu-report-print .mobile-toggle,
    body.kizu-report-print .kizu-assistant-header,
    body.kizu-report-print .kizu-report-footer,
    body.kizu-report-print .kizu-report-cta,
    body.kizu-report-print .kizu-gt-wrap,
    body.kizu-report-print .kizu-gt-host,
    body.kizu-report-print .alert,
    body.kizu-report-print #kizu-coin-celebrate,
    body.kizu-report-print #kizu-assistant-page > :not(#kizu-monthly-report) {
        display: none !important;
    }

    body.kizu-report-print .app-layout {
        display: block !important;
        min-height: 0 !important;
        height: auto !important;
    }

    body.kizu-report-print .main-content {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        min-height: 0 !important;
        height: auto !important;
        max-width: none !important;
        width: 100% !important;
        overflow: visible !important;
    }

    body.kizu-report-print #kizu-assistant-page,
    body.kizu-report-print #kizu-monthly-report,
    body.kizu-report-print .kizu-report {
        display: block !important;
        position: static !important;
        width: 100% !important;
        max-width: none !important;
        min-height: 0 !important;
        height: auto !important;
        margin: 0 !important;
        overflow: visible !important;
    }

    body.kizu-report-print .kizu-report-surface {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        background: #fff !important;
        overflow: visible !important;
    }

    body.kizu-report-print .kizu-report-body {
        display: block !important;
        position: static !important;
        width: 100% !important;
        max-width: none !important;
        min-height: 0 !important;
        height: auto !important;
        margin: 0 !important;
        overflow: visible !important;
    }

    body.kizu-report-print .kizu-report-row,
    body.kizu-report-print .kizu-report-row--2,
    body.kizu-report-print .kizu-report-row--3 {
        display: block !important;
        width: 100% !important;
        overflow: visible !important;
        gap: 0 !important;
    }

    body.kizu-report-print .kizu-report-hero {
        display: block !important;
        overflow: visible !important;
        page-break-inside: auto !important;
        break-inside: auto !important;
        grid-template-columns: none !important;
        padding: 0 0 12px !important;
        margin: 0 0 12px !important;
    }

    body.kizu-report-print .kizu-report-hero::before {
        display: none !important;
    }

    body.kizu-report-print .kizu-report-hero-art {
        min-height: 0 !important;
        margin: 8px auto !important;
    }

    body.kizu-report-print .kizu-report-hero-stage {
        width: 140px !important;
        margin: 0 auto !important;
    }

    body.kizu-report-print .kizu-report-rate-card {
        max-width: none !important;
        margin: 10px 0 !important;
    }

    body.kizu-report-print .kizu-report-card {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        page-break-inside: auto !important;
        break-inside: auto !important;
        overflow: visible !important;
        box-shadow: none !important;
        border: 1px solid rgba(124, 58, 237, 0.15) !important;
        margin: 0 0 12px 0 !important;
    }

    body.kizu-report-print .kizu-report-card--summary {
        page-break-inside: auto !important;
        break-inside: auto !important;
        grid-column: auto !important;
        overflow: visible !important;
    }

    body.kizu-report-print .kizu-report-summary-top {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
    }

    body.kizu-report-print .kizu-report-hero-img {
        animation: none !important;
        filter: none !important;
        transform: none !important;
    }

    body.kizu-report-print .kizu-report,
    body.kizu-report-print .kizu-report * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* Kizu Google Translate — single header control, full page content */
.kizu-assistant-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 0;
}
.kizu-assistant-header h2 {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 1 auto;
}
.kizu-assistant-header .kizu-gt-wrap {
    position: relative;
    flex-shrink: 0;
    margin-left: 30px;
}
.kizu-gt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(124, 92, 196, 0.28);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    padding: 0;
}
.kizu-gt-btn:hover {
    border-color: rgba(124, 92, 196, 0.55);
    background: rgba(124, 92, 196, 0.12);
}
.kizu-gt-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: auto;
    z-index: 40;
    min-width: 180px;
    max-width: min(240px, calc(100vw - 48px));
    max-height: 280px;
    overflow: auto;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid rgba(124, 92, 196, 0.25);
    background: var(--bg-card, #16162a);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}
.kizu-gt-lang {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--text);
    text-align: left;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
}
.kizu-gt-lang:hover {
    background: rgba(124, 92, 196, 0.14);
}
.kizu-gt-lang.is-active {
    background: rgba(124, 92, 196, 0.22);
    font-weight: 700;
}
.kizu-gt-host {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}
/* Hide native Google Translate top bar / chrome */
.kizu-gt-page .goog-te-banner-frame,
.kizu-gt-page .skiptranslate iframe.goog-te-banner-frame,
.kizu-gt-page .goog-te-balloon-frame,
.kizu-gt-page #goog-gt-tt,
.kizu-gt-page .goog-tooltip,
.kizu-gt-page .goog-te-spinner-pos {
    display: none !important;
    visibility: hidden !important;
}
.kizu-gt-page body {
    top: 0 !important;
}
.kizu-gt-page .goog-logo-link,
.kizu-gt-page .goog-te-gadget {
    display: none !important;
}
.kizu-gt-page .goog-te-gadget {
    font-size: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    left: -9999px !important;
}
/* Extra: iframe banner injected at document top */
body > .skiptranslate,
.goog-te-banner-frame.skiptranslate {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
}

/* Kizuna category icons + picker */
.cat-ico {
    display: inline-block;
    vertical-align: middle;
    object-fit: contain;
    flex-shrink: 0;
}
.cat-ico--emoji {
    font-size: 1.15em;
    line-height: 1;
}
.cat-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: 8px;
    max-height: 240px;
    overflow: auto;
    padding: 4px;
}
.cat-picker-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 8px;
    border-radius: 12px;
    border: 1px solid rgba(124, 92, 196, 0.18);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    cursor: pointer;
    text-align: center;
    transition: border-color .15s ease, background .15s ease, transform .12s ease;
}
.cat-picker-item[hidden] {
    display: none !important;
}
.cat-picker-item:hover {
    border-color: rgba(124, 92, 196, 0.45);
    background: rgba(124, 92, 196, 0.08);
}
.cat-picker-item.is-selected {
    border-color: rgba(167, 139, 250, 0.75);
    background: rgba(129, 140, 248, 0.16);
    box-shadow: 0 0 0 1px rgba(192, 132, 252, 0.25);
}
.cat-picker-ico {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}
.cat-picker-ico .cat-ico {
    width: 28px;
    height: 28px;
}
.cat-picker-name {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-muted);
}
.cat-picker-item.is-selected .cat-picker-name {
    color: var(--text);
}
.sub-page-service-icon .cat-ico,
.sub-page-service-icon .sub-page-cat-ico {
    width: 22px;
    height: 22px;
}

/* Customizable dashboard widgets */
.dash-board { margin-top: 24px; }
.dash-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.dash-toolbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.dash-month-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--card-bg);
    border: 1px solid var(--border);
}
.dash-month-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    text-decoration: none;
    font-size: 22px;
    line-height: 1;
    border: 1px solid transparent;
}
.dash-month-btn:hover { background: var(--bg-hover); border-color: var(--border); }
.dash-month-btn.is-disabled { opacity: 0.35; pointer-events: none; }
.dash-month-label {
    min-width: 140px;
    text-align: center;
    font-weight: 700;
    font-size: 15px;
}
.dash-customize-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
}
.dash-customize-btn.is-active,
.dash-customize-btn:hover {
    border-color: rgba(124, 58, 237, 0.45);
    color: #7c3aed;
}
.dash-add-panel {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px dashed rgba(124, 58, 237, 0.45);
    background: rgba(124, 58, 237, 0.06);
}
.dash-add-title { margin: 0 0 8px; font-size: 13px; font-weight: 700; }
.dash-add-list { display: flex; flex-wrap: wrap; gap: 8px; }
.dash-add-btn {
    border: 1px solid var(--border);
    background: var(--card-bg);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
}
.dash-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}
.dash-widget {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px 16px 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
    min-height: 180px;
}
.dash-widget--span-1 { grid-column: span 1; }
.dash-widget--span-2 { grid-column: span 2; }
.dash-widget--span-3 { grid-column: span 3; }
.dash-widget--span-4 { grid-column: span 4; }
.dash-widget-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}
.dash-widget-head--wide,
.dash-widget-head--actions {
    justify-content: space-between;
}
.dash-widget-head h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
}
.dash-widget-head p {
    margin: 4px 0 0;
    font-size: 12px;
    color: var(--text-muted);
}
.dash-widget-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(124, 58, 237, 0.12);
    color: #7c3aed;
    font-weight: 700;
    flex-shrink: 0;
}
.dash-widget-body { min-height: 80px; }
.dash-widget-body--split {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 12px;
    align-items: center;
}
.dash-metric-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.dash-metric-value { font-size: 28px; font-weight: 800; line-height: 1.1; color: #7c3aed; }
.dash-metric-value--blue { color: #2563eb; }
.dash-metric-sub { margin-top: 6px; font-size: 12px; color: var(--text-secondary); }
.dash-trend { margin-top: 8px; font-size: 12px; font-weight: 700; }
.dash-trend.is-up { color: #16a34a; }
.dash-trend.is-down { color: #ef4444; }
.dash-mini-chart {
    position: relative;
    height: 120px;
    width: 150px;
}
.dash-line-chart,
.dash-trend-chart { position: relative; height: 120px; }
.dash-trend-chart { height: 260px; }
.dash-donut-wrap {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 12px;
    align-items: center;
}
.dash-donut-chart { position: relative; height: 150px; }
.dash-donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    text-align: center;
}
.dash-donut-center strong { font-size: 14px; }
.dash-donut-center span { font-size: 11px; color: var(--text-muted); }
.dash-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dash-legend li {
    display: grid;
    grid-template-columns: 10px 1fr auto auto;
    gap: 8px;
    align-items: center;
    font-size: 11px;
}
.dash-legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.dash-legend-name { color: var(--text-secondary); }
.dash-legend-amt,
.dash-legend-pct { font-weight: 700; }
.dash-ring svg { width: 110px; height: 110px; transform: rotate(-90deg); }
.dash-ring-track { fill: none; stroke: rgba(148,163,184,0.25); stroke-width: 10; }
.dash-ring-fill {
    fill: none;
    stroke: #22c55e;
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 283;
    transition: stroke-dashoffset 0.4s ease;
}
.dash-widget-foot {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    font-weight: 700;
}
.dash-widget-foot a { color: #7c3aed; text-decoration: none; }
.dash-trend-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}
.dash-trend-stats div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
}
.dash-trend-stats strong { font-size: 16px; }
.dash-trend-stats em { font-size: 11px; color: var(--text-muted); font-style: normal; }
.dash-stat-ico {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 800;
}
.dash-stat-ico.is-income { background: rgba(124,58,237,0.12); color: #7c3aed; }
.dash-stat-ico.is-expense { background: rgba(236,72,153,0.12); color: #ec4899; }
.dash-stat-ico.is-rate { background: rgba(34,197,94,0.12); color: #16a34a; }
.dash-top-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.dash-top-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    margin-bottom: 4px;
}
.dash-top-bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(148,163,184,0.2);
    overflow: hidden;
}
.dash-top-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
}
.dash-health { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: start; }
.dash-gauge {
    position: relative;
    width: 120px;
    height: 70px;
    border-radius: 120px 120px 0 0;
    background: linear-gradient(90deg, #ef4444, #f59e0b 50%, #22c55e);
    overflow: hidden;
}
.dash-gauge::after {
    content: '';
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 0;
    height: 55px;
    border-radius: 100px 100px 0 0;
    background: var(--card-bg);
}
.dash-gauge-needle {
    position: absolute;
    left: 50%;
    bottom: 4px;
    width: 3px;
    height: 48px;
    background: #334155;
    transform-origin: bottom center;
    transform: translateX(-50%) rotate(var(--needle-rotate, -90deg));
    z-index: 2;
}
.dash-gauge-score {
    position: absolute;
    left: 50%;
    bottom: 8px;
    transform: translateX(-50%);
    z-index: 3;
    font-size: 22px;
    font-weight: 800;
}
.dash-gauge-band {
    position: absolute;
    left: 50%;
    bottom: -18px;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 700;
    color: #16a34a;
}
.dash-health-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; }
.dash-health-item {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 12px;
    line-height: 1.35;
}
.dash-health-item.is-ok span { color: #16a34a; }
.dash-health-item.is-warn span { color: #f59e0b; }
.dash-empty { color: var(--text-muted); text-align: center; padding: 16px 8px; margin: 0; }
.dash-goal { margin-bottom: 12px; }
.dash-goal-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 6px;
}
.dash-widget-drag {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 14px;
    letter-spacing: -2px;
    color: var(--text-muted);
    cursor: grab;
    user-select: none;
}
.dash-widget-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text-muted);
    cursor: pointer;
    z-index: 2;
}
.dash-widget-resize-wrap {
    position: absolute;
    bottom: 10px;
    right: 10px;
    z-index: 2;
    display: none;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    border-radius: 999px;
    border: 1px solid rgba(124, 58, 237, 0.28);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.12);
}
.dash-board.is-customizing .dash-widget-resize-wrap {
    display: inline-flex;
}
.dash-widget-drag,
.dash-widget-remove {
    display: none;
}
.dash-board.is-customizing .dash-widget-drag {
    display: block;
}
.dash-board.is-customizing .dash-widget-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.dash-widget-resize {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid rgba(124, 58, 237, 0.35);
    background: rgba(124, 58, 237, 0.08);
    color: #7c3aed;
    font-size: 16px;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.dash-widget-resize:hover:not(:disabled) {
    background: rgba(124, 58, 237, 0.16);
    border-color: rgba(124, 58, 237, 0.55);
}
.dash-widget-resize:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.dash-widget-span-label {
    min-width: 28px;
    text-align: center;
    font-size: 11px;
    font-weight: 800;
    color: #7c3aed;
}
.dash-board.is-customizing .dash-widget {
    outline: 2px dashed rgba(124, 58, 237, 0.35);
    cursor: grab;
}
.dash-widget.is-dragging { opacity: 0.55; }
.dash-widget.is-drop-target { outline-color: #7c3aed; }
@media (max-width: 1200px) {
    .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-widget--span-2,
    .dash-widget--span-3,
    .dash-widget--span-4 { grid-column: span 2; }
}
@media (max-width: 768px) {
    .dash-grid { grid-template-columns: 1fr; }
    .dash-widget--span-2,
    .dash-widget--span-3,
    .dash-widget--span-4 { grid-column: span 1; }
    .dash-widget-body--split,
    .dash-donut-wrap,
    .dash-health { grid-template-columns: 1fr; }
    .dash-trend-stats { grid-template-columns: 1fr; }
}

/* Transactions page */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.tx-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
}
.tx-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #6a6280;
    margin-bottom: 10px;
}
.tx-breadcrumb a { color: #7c3aed; text-decoration: none; font-weight: 600; }
.tx-hero,
.bud-hero,
.goal-hero,
.inv-hero {
    background-color: #f3eeff;
    background-image: url('../images/landing/howto-hero-bg.png');
    background-repeat: no-repeat;
    background-position: 72% 28%;
    background-size: cover;
}
.tx-hero {
    position: relative;
    min-height: 280px;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(99, 91, 255, 0.1);
}
.tx-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.97) 0%, rgba(255,255,255,0.94) 46%, rgba(255,255,255,0.55) 58%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
}
.tx-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 62%;
    padding: 24px 32px 28px;
}
.tx-hero-title {
    margin: 0 0 8px;
    font-size: clamp(32px, 3.2vw, 40px);
    font-weight: 800;
    color: #2a2148;
    letter-spacing: -0.02em;
}
.tx-hero-lead {
    margin: 0 0 18px;
    font-size: 14px;
    line-height: 1.55;
    color: #6a6280;
    max-width: 520px;
}
.tx-hero-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.tx-hero-features li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}
.tx-hero-feature-ico {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: block;
}
.tx-hero-feature-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.tx-hero-feature-copy strong {
    font-size: 13px;
    color: #2a2148;
    line-height: 1.3;
}
.tx-hero-feature-copy em {
    font-size: 11px;
    color: #6a6280;
    font-style: normal;
    line-height: 1.4;
}
.tx-hero-art {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}
.tx-hero-bubble {
    position: absolute;
    right: 50%;
    top: 22%;
    max-width: 240px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(124, 58, 237, 0.35);
    border-radius: 999px;
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 600;
    font-style: italic;
    color: #2a2148;
    box-shadow: 0 10px 28px rgba(42, 33, 72, 0.12);
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.35;
}
.tx-hero-bubble span { flex: 1; }

/* Hero speech bubble — mobile dismiss */
.hero-bubble-close {
    display: none;
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    font-size: 15px;
    line-height: 1;
    font-weight: 700;
    font-style: normal;
    cursor: pointer;
    padding: 0;
    align-items: center;
    justify-content: center;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    -webkit-tap-highlight-color: transparent;
}
.hero-bubble-close:focus-visible {
    outline: 2px solid #7c3aed;
    outline-offset: 2px;
}
@media (max-width: 768px) {
    .hero-bubble-close {
        display: flex;
    }
    .hero-bubble.is-dismissed {
        display: none !important;
    }
    .tx-hero-art .hero-bubble,
    .bud-hero-art .hero-bubble {
        pointer-events: auto;
    }
}

.tx-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    gap: 18px;
    align-items: start;
    width: 100%;
    min-width: 0;
    overflow-x: clip;
}
.tx-main {
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;
}
.tx-panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
    overflow-x: clip;
    overflow-y: visible;
    min-width: 0;
    max-width: 100%;
}
.tx-tabs {
    display: flex;
    gap: 4px;
    padding: 0 16px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.tx-tab {
    padding: 14px 16px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}
.tx-tab.is-active {
    color: #7c3aed;
    border-bottom-color: #7c3aed;
}
.tx-toolbar { padding: 14px 16px 0; min-width: 0; overflow-x: clip; }
.tx-toolbar-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
    min-width: 0;
}
.tx-toolbar-row--filters .tx-search {
    flex: 1 1 240px;
    min-width: 200px;
}
.tx-month-picker,
.tx-select,
.tx-btn {
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    font-size: 13px;
}
.tx-month-picker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
    max-width: 100%;
    flex-wrap: nowrap;
    flex-shrink: 0;
}
.tx-month-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 18px;
    flex-shrink: 0;
}
.tx-month-btn.is-disabled { opacity: 0.35; }
.tx-month-label {
    font-weight: 700;
    min-width: 0;
    flex: 1;
    text-align: center;
    font-size: 12px;
    white-space: nowrap;
}
.tx-select { padding: 0 12px; min-width: 140px; max-width: 100%; }
.tx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 14px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
}
.tx-btn--ghost:hover { border-color: rgba(124, 58, 237, 0.4); color: #7c3aed; }
.tx-btn--primary {
    background: #7c3aed;
    border-color: #7c3aed;
    color: #fff;
}
.tx-search {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 12px;
    background: var(--card-bg);
    min-width: 0;
    width: 100%;
}
.tx-search input {
    border: 0;
    background: transparent;
    width: 100%;
    min-width: 0;
    font-size: 13px;
    color: var(--text);
    outline: none;
}
.tx-advanced {
    margin: 0 0 12px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(124, 58, 237, 0.04);
    border: 1px dashed rgba(124, 58, 237, 0.25);
}
.tx-advanced-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.tx-advanced-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.tx-results {
    padding: 0 16px 16px;
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;
}
.tx-results.is-loading { opacity: 0.55; pointer-events: none; }
.tx-table-wrap {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    contain: inline-size;
}
.tx-table {
    width: 100%;
    min-width: 780px;
    border-collapse: collapse;
    font-size: 16px;
}
.tx-table th,
.tx-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}
.tx-table th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 700;
    white-space: nowrap;
}
.tx-col-check { width: 36px; }
.tx-col-amount { text-align: right; white-space: nowrap; }
.tx-col-actions {
    width: 44px;
    text-align: center;
    position: relative;
    overflow: visible;
}
.tx-col-date { white-space: nowrap; color: var(--text-secondary); font-size: 14px; }
.tx-col-desc {
    font-weight: 600;
    max-width: 240px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tx-col-cat,
.tx-col-account,
.tx-col-type { white-space: nowrap; }
.tx-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--cat-color) 14%, transparent);
    color: var(--cat-color);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}
.tx-account-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: var(--text-secondary);
}
.tx-type-ico {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-grid;
    place-items: center;
    font-weight: 800;
}
.tx-type-ico.is-income { background: rgba(34, 197, 94, 0.12); color: #16a34a; }
.tx-type-ico.is-expense { background: rgba(239, 68, 68, 0.12); color: #ef4444; }
.tx-type-ico.is-transfer { background: rgba(124, 58, 237, 0.12); color: #7c3aed; }
.tx-amount-cell { font-weight: 800; }
.tx-amount-cell.income { color: #16a34a; }
.tx-amount-cell.expense { color: #ef4444; }
.tx-amount-cell.transfer { color: #7c3aed; }
.tx-row-menu { position: relative; }
.tx-row-menu[open] {
    z-index: 100;
}
.tx-table tbody tr:has(.tx-row-menu[open]) {
    position: relative;
    z-index: 100;
}
.tx-col-actions:has(.tx-row-menu[open]) {
    z-index: 101;
}
.tx-row-menu summary {
    list-style: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: var(--text-muted);
}
.tx-row-menu summary::-webkit-details-marker { display: none; }
.tx-row-menu-panel {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 150;
    min-width: 120px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 6px;
}
.tx-row-menu-panel a,
.tx-row-menu-panel button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border: 0;
    background: none;
    color: var(--text);
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
    border-radius: 6px;
}
.tx-row-menu-panel a:hover,
.tx-row-menu-panel button:hover { background: var(--bg-hover); }
.tx-table-empty,
.tx-side-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 32px 16px;
    margin: 0;
}
.tx-pager--table {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 12px;
}
.tx-pager-pages { display: flex; gap: 6px; align-items: center; }
.tx-page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: inline-grid;
    place-items: center;
    text-decoration: none;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}
.tx-page-btn.is-active {
    background: #7c3aed;
    border-color: #7c3aed;
    color: #fff;
}
.tx-pager-summary { margin: 0; font-size: 12px; color: var(--text-muted); }
.tx-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    max-width: 100%;
}
.tx-side-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}
.tx-side-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}
.tx-side-head h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 800;
}
.tx-side-head--split {
    justify-content: space-between;
}
.tx-side-head--split a {
    font-size: 12px;
    font-weight: 700;
    color: #7c3aed;
    text-decoration: none;
}
.tx-overview-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}
.tx-overview-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    color: var(--text-muted);
}
.tx-overview-stat strong { font-size: 14px; font-weight: 800; }
.tx-overview-stat.is-income strong { color: #16a34a; }
.tx-overview-stat.is-expense strong { color: #ef4444; }
.tx-overview-stat.is-savings strong { color: #2563eb; }
.tx-overview-donut-wrap {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 10px;
    align-items: center;
}
.tx-overview-donut { position: relative; width: 110px; height: 110px; }
.tx-overview-donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.tx-donut-track { fill: none; stroke: rgba(148,163,184,0.25); stroke-width: 10; }
.tx-donut-fill {
    fill: none;
    stroke: #7c3aed;
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 283;
}
.tx-donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.tx-donut-center strong { font-size: 16px; }
.tx-donut-center span { font-size: 10px; color: var(--text-muted); }
.tx-donut-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
    font-size: 11px;
}
.tx-donut-legend li { display: flex; align-items: center; gap: 6px; }
.tx-donut-legend em { margin-left: auto; font-style: normal; font-weight: 700; }
.tx-donut-legend .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.tx-donut-legend .dot.is-income { background: #16a34a; }
.tx-donut-legend .dot.is-expense { background: #ef4444; }
.tx-donut-legend .dot.is-savings { background: #7c3aed; }
.tx-side-cats { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tx-side-cat-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    margin-bottom: 4px;
}
.tx-side-cat-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.tx-side-cat-amt { color: var(--text-muted); white-space: nowrap; }
.tx-side-cat-bar {
    height: 5px;
    border-radius: 999px;
    background: rgba(148,163,184,0.2);
    overflow: hidden;
}
.tx-side-cat-bar span { display: block; height: 100%; border-radius: inherit; }
.tx-quick-add { display: grid; gap: 10px; }
.tx-quick-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    cursor: pointer;
    text-align: left;
}
.tx-quick-btn.is-income { background: rgba(34, 197, 94, 0.08); border-color: rgba(34, 197, 94, 0.2); }
.tx-quick-btn.is-expense { background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.2); }
.tx-quick-ico {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 20px;
    font-weight: 800;
    background: #fff;
}
.tx-quick-btn strong { display: block; font-size: 13px; }
.tx-quick-btn em { display: block; font-size: 11px; color: var(--text-muted); font-style: normal; }
.tx-manage-cats {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: #7c3aed;
    text-decoration: none;
}
.tx-footer-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 18px 22px;
    border-radius: 16px;
    background: linear-gradient(90deg, #7c3aed, #9333ea);
    color: #fff;
    min-width: 0;
    max-width: 100%;
}
.tx-footer-banner-copy {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    max-width: 720px;
}
.tx-footer-banner-copy p { margin: 0; font-size: 13px; line-height: 1.5; }
.tx-footer-banner-ico { font-size: 22px; }
.tx-page .tx-upcoming {
    margin: 0 16px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: none;
}
[data-theme="dark"] .tx-hero-overlay {
    background: linear-gradient(90deg, rgba(10,10,26,0.96) 0%, rgba(10,10,26,0.92) 46%, rgba(10,10,26,0.55) 58%, rgba(10,10,26,0.08) 100%);
}
[data-theme="dark"] .tx-hero-title,
[data-theme="dark"] .tx-hero-feature-copy strong { color: #f1ecff; }
[data-theme="dark"] .tx-hero-lead,
[data-theme="dark"] .tx-hero-feature-copy em,
[data-theme="dark"] .tx-breadcrumb { color: #c4b5fd; }
[data-theme="dark"] .tx-hero-bubble {
    background: rgba(20, 16, 40, 0.92);
    color: #f1ecff;
    border-color: rgba(167, 139, 250, 0.45);
}
@media (max-width: 1100px) {
    .tx-layout { grid-template-columns: 1fr; }
    .tx-hero-inner { max-width: 100%; }
    .tx-hero-features { grid-template-columns: 1fr; }
    .tx-hero-bubble { right: 50%; top: auto; bottom: 12px; max-width: 200px; font-size: 11px; }
}
@media (max-width: 768px) {
    .tx-page { gap: 14px; }
    .tx-hero,
    .bud-hero,
    .goal-hero,
    .inv-hero {
        min-height: 220px;
        background-position: 68% 24%;
        border-radius: 14px;
    }
    .tx-hero-inner {
        max-width: 100%;
        padding: 18px 16px 20px;
    }
    .tx-hero-title { font-size: 28px; }
    .tx-hero-lead { font-size: 13px; margin-bottom: 14px; }
    .tx-hero-feature-ico { width: 40px; height: 40px; }
    .tx-hero-bubble { right: 50%; top: auto; bottom: 12px; max-width: 200px; font-size: 11px; }
    .tx-panel { border-radius: 14px; }
    .tx-tabs { padding: 0 10px; }
    .tx-tab { padding: 12px 12px; font-size: 12px; }
    .tx-toolbar {
        padding: 10px 12px 0;
        overflow-x: clip;
    }
    .tx-toolbar-row--filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        gap: 8px;
        margin-bottom: 10px;
        padding-bottom: 2px;
        scrollbar-width: none;
    }
    .tx-toolbar-row--filters::-webkit-scrollbar { display: none; }
    .tx-toolbar-row--filters .tx-month-picker,
    .tx-toolbar-row--filters .tx-select,
    .tx-toolbar-row--filters .tx-btn,
    .tx-toolbar-row--filters .tx-search {
        flex: 0 0 auto;
        width: auto;
        height: 34px;
        min-height: 34px;
        font-size: 12px;
    }
    .tx-toolbar-row--filters .tx-month-picker {
        width: 200px;
        min-width: 200px;
        max-width: none;
        padding: 0 6px;
        flex-shrink: 0;
        flex-wrap: nowrap;
    }
    .tx-toolbar-row--filters .tx-month-label {
        font-size: 11px;
        flex: 1 1 auto;
        min-width: 0;
    }
    .tx-toolbar-row--filters .tx-month-btn {
        width: 26px;
        height: 26px;
        flex-shrink: 0;
    }
    .tx-toolbar-row--filters .tx-select {
        min-width: 96px;
        max-width: 112px;
        padding: 0 8px;
    }
    .tx-toolbar-row--filters .tx-btn {
        padding: 0 10px;
        white-space: nowrap;
    }
    .tx-toolbar-row--filters .tx-search {
        flex: 0 0 260px;
        width: 260px;
        min-width: 260px;
        max-width: 260px;
    }
    .tx-toolbar-row--filters .tx-search input {
        font-size: 12px;
    }
    .tx-results {
        padding: 0;
        overflow-x: clip;
    }
    .tx-table-wrap {
        margin: 0;
        padding: 0 12px;
        max-width: 100%;
    }
    .tx-table {
        min-width: 720px;
        font-size: 14px;
    }
    .tx-table th,
    .tx-table td { padding: 10px 8px; }
    .tx-col-date { font-size: 13px; }
    .tx-cat-pill { font-size: 12px; }
    .tx-account-pill { font-size: 13px; }
    .tx-advanced-grid { grid-template-columns: 1fr; }
    .tx-overview-stats {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 30px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
        margin-bottom: 14px;
        padding-bottom: 4px;
    }
    .tx-overview-stats::-webkit-scrollbar { display: none; }
    .tx-overview-stat {
        flex: 0 0 auto;
        min-width: max-content;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 4px;
    }
    .tx-overview-stat span {
        line-height: 1.3;
        white-space: nowrap;
    }
    .tx-overview-stat strong {
        line-height: 1.2;
        white-space: nowrap;
    }
    .tx-pager--table {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 0 12px;
    }
    .tx-pager-pages { justify-content: center; flex-wrap: wrap; }
    .tx-pager-summary { text-align: center; }
    .tx-page .tx-upcoming {
        margin-left: 12px;
        margin-right: 12px;
    }
    .tx-footer-banner {
        padding: 14px 16px;
        border-radius: 14px;
    }
}
@media (max-width: 480px) {
    .tx-hero-title { font-size: 24px; }
    .tx-table { min-width: 680px; }
    .tx-toolbar-row--filters .tx-month-picker {
        width: 188px;
        min-width: 188px;
    }
    .tx-toolbar-row--filters .tx-search {
        flex: 0 0 240px;
        width: 240px;
        min-width: 240px;
        max-width: 240px;
    }
}

/* Dashboard home (mockup layout) */
.home-dash {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
.home-dash-board { margin-top: 0; min-width: 0; }
.home-dash-board .dash-toolbar {
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
}
.dash-toolbar-spacer { flex: 1; min-width: 0; }
.home-dash-grid {
    width: 100%;
    min-width: 0;
}
.home-dash-grid .home-dash-widget {
    min-height: 0;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
}
.home-dash-grid .dash-widget--span-2 { grid-column: span 2; }
.home-dash-grid .dash-widget--span-3 { grid-column: span 3; }
.home-dash-grid .dash-widget--span-4 { grid-column: span 4; }
.home-dash-grid .home-trend-chart { height: 280px; }
.home-dash-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
    min-width: 0;
}
.home-kpi {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    border-radius: 18px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
    min-width: 0;
}
.home-kpi-body { min-width: 0; flex: 1; }
.home-kpi-icon {
    width: 66px;
    height: 66px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.home-kpi-icon img {
    width: 66px;
    height: 66px;
    display: block;
    object-fit: contain;
}
.home-kpi-label {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.home-kpi-month {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
    opacity: 0.85;
}
.home-kpi-value {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.15;
    color: var(--text);
    word-break: break-word;
}
.home-kpi-trend { font-size: 11px; margin-top: 6px; font-weight: 600; line-height: 1.35; }
.home-kpi-trend.is-good { color: #16a34a; }
.home-kpi-trend.is-bad { color: #ef4444; }
.home-kpi--all-time {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(236, 72, 153, 0.08));
    border-color: rgba(124, 58, 237, 0.28);
    box-shadow: 0 10px 28px rgba(124, 58, 237, 0.1);
}
.home-kpi--all-time .home-kpi-value {
    color: #7c3aed;
    font-size: 26px;
}
.home-kpi-all-time-note {
    margin-top: 6px;
    font-size: 11px;
    font-weight: 600;
    color: rgba(124, 58, 237, 0.75);
}

.home-dash-row { display: grid; gap: 16px; }
.home-dash-row--charts { grid-template-columns: 1fr 1.15fr; }
.home-dash-row--details { grid-template-columns: 1.6fr 0.9fr 0.9fr; }

.home-panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}
.home-panel-head {
    padding: 18px 20px 0;
}
.home-panel-head h3 { margin: 0; font-size: 17px; font-weight: 800; }
.home-panel-head p { margin: 4px 0 0; font-size: 12px; color: var(--text-secondary); }
.home-panel-head--actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.home-link {
    font-size: 12px;
    font-weight: 700;
    color: #7c3aed;
    text-decoration: none;
    white-space: nowrap;
}
.home-link:hover { text-decoration: underline; }
.home-panel-body { padding: 16px 20px 20px; }
.home-panel-body--flush { padding-top: 8px; }

.home-spending {
    display: grid;
    grid-template-columns: minmax(160px, 220px) 1fr;
    gap: 16px;
    align-items: center;
    min-height: 240px;
}
.home-dash-widget[data-widget-id="spending-overview"] .home-spending {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    gap: 0;
}
.home-dash-widget[data-widget-id="spending-overview"] .home-donut-wrap {
    position: relative;
    height: 200px;
    width: 200px;
    max-width: 100%;
    margin: 0 auto;
    flex-shrink: 0;
}
.home-dash-widget[data-widget-id="spending-overview"] .home-cat-list {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto auto;
    column-gap: 12px;
    row-gap: 10px;
    width: 100%;
    margin: 20px 0 0;
    padding: 0;
    align-self: flex-start;
}
.home-dash-widget[data-widget-id="spending-overview"] .home-cat-list li {
    display: contents;
}
.home-dash-widget[data-widget-id="spending-overview"] .home-cat-name {
    text-align: left;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.home-dash-widget[data-widget-id="spending-overview"] .home-cat-amt,
.home-dash-widget[data-widget-id="spending-overview"] .home-cat-pct {
    text-align: right;
    white-space: nowrap;
}
.home-donut-wrap {
    position: relative;
    height: 200px;
    width: 200px;
    max-width: 100%;
    margin: 0 auto;
}
.home-donut-wrap canvas,
.home-trend-chart canvas,
.home-budget-gauge canvas {
    display: block;
    max-width: 100%;
    touch-action: manipulation;
}
.home-donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1;
    text-align: center;
    padding: 12px;
}
.home-donut-center strong { font-size: 18px; font-weight: 800; }
.home-donut-center span { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

.home-cat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.home-cat-list li {
    display: grid;
    grid-template-columns: 24px 1fr auto auto;
    gap: 8px;
    align-items: center;
    font-size: 12px;
}
.home-cat-name { font-weight: 600; }
.home-cat-amt { color: var(--text-secondary); }
.home-cat-pct { font-weight: 700; min-width: 42px; text-align: right; }

.home-trend-chart {
    position: relative;
    height: 280px;
    width: 100%;
    min-width: 0;
}

.home-tx-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}
.home-tx-table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 12px; }
.home-tx-table th {
    text-align: left;
    padding: 10px 12px;
    color: var(--text-secondary);
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.home-tx-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    vertical-align: middle;
}
.home-tx-desc { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.home-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    background: color-mix(in srgb, var(--pill-color) 16%, transparent);
    color: var(--pill-color);
}
.home-cat-pill.is-muted { background: var(--bg-hover); color: var(--text-secondary); }
.home-tx-amt { font-weight: 800; text-align: right; white-space: nowrap; }
.home-tx-amt.is-income { color: #16a34a; }
.home-tx-amt.is-expense { color: #ef4444; }

.home-budget {
    display: grid;
    grid-template-columns: minmax(140px, 180px) 1fr;
    gap: 12px;
    align-items: center;
}
.home-budget-gauge {
    position: relative;
    height: 150px;
    width: 100%;
    max-width: 220px;
    margin: 0 auto;
}
.home-budget-gauge-label {
    position: absolute;
    left: 50%;
    bottom: 8px;
    transform: translateX(-50%);
    text-align: center;
    pointer-events: none;
    z-index: 1;
    width: 90%;
}
.home-budget-gauge-label strong { display: block; font-size: 22px; font-weight: 800; }
.home-budget-gauge-label span { display: block; font-size: 11px; color: var(--text-secondary); margin-top: 2px; word-break: break-word; }
.home-budget-gauge-label em { display: block; font-style: normal; font-size: 10px; color: var(--text-secondary); margin-top: 2px; }
.home-budget-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.home-budget-list li {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    font-size: 12px;
}
.home-budget-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-budget-pct { font-weight: 800; color: #7c3aed; }

.home-goals { display: flex; flex-direction: column; gap: 14px; }
.home-goal {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}
.home-goal-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(124, 58, 237, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.home-goal-main { min-width: 0; }
.home-goal-title { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-goal-amt { font-size: 11px; color: var(--text-secondary); margin: 2px 0 6px; word-break: break-word; }
.home-goal-bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.2);
    overflow: hidden;
}
.home-goal-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #7c3aed, #ec4899);
    transition: width 1s ease;
}
.home-goal-pct { font-size: 13px; font-weight: 800; color: #7c3aed; }

.home-banner {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px 24px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(236, 72, 153, 0.08));
    border: 1px solid rgba(124, 58, 237, 0.15);
}
.home-banner-icon { font-size: 42px; line-height: 1; }
.home-banner-text { flex: 1; min-width: 0; }
.home-banner-text strong { display: block; font-size: 18px; margin-bottom: 4px; }
.home-banner-text p { margin: 0; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.home-banner-cta { white-space: nowrap; flex-shrink: 0; }
.home-empty { color: var(--text-secondary); font-size: 13px; margin: 0; }

/* Floating Chart.js HTML tooltip (body-level, never clipped) */
.home-chart-tooltip {
    position: fixed;
    z-index: 10050;
    pointer-events: none;
    min-width: 120px;
    max-width: min(280px, calc(100vw - 24px));
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.96);
    color: #e2e8f0;
    border: 1px solid rgba(124, 58, 237, 0.45);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.28);
    font-size: 12px;
    line-height: 1.4;
    transition: opacity 0.08s ease;
}
.home-chart-tooltip[hidden] { display: none !important; }
.home-chart-tooltip-title {
    font-weight: 800;
    color: #f8fafc;
    margin-bottom: 6px;
}
.home-chart-tooltip-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 4px;
}
.home-chart-tooltip-swatch {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    border: 1px solid transparent;
    flex-shrink: 0;
    margin-top: 3px;
}

@media (max-width: 1200px) {
    .home-dash-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .home-kpi--all-time { grid-column: 1 / -1; }
    .home-dash-grid .dash-widget--span-2,
    .home-dash-grid .dash-widget--span-3,
    .home-dash-grid .dash-widget--span-4 { grid-column: span 2; }
    .home-budget { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .home-dash { gap: 16px; margin-top: 16px; }
    .home-dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .home-kpi--all-time { grid-column: 1 / -1; }
    .home-dash-grid { grid-template-columns: 1fr !important; gap: 14px; }
    .home-dash-grid .dash-widget--span-1,
    .home-dash-grid .dash-widget--span-2,
    .home-dash-grid .dash-widget--span-3,
    .home-dash-grid .dash-widget--span-4 { grid-column: 1 / -1; }
    .home-trend-chart,
    .home-dash-grid .home-trend-chart { height: 240px; }
    .dash-widget-head--actions {
        flex-wrap: wrap;
        gap: 8px;
    }
}
@media (max-width: 640px) {
    .home-dash-kpis { grid-template-columns: 1fr; gap: 10px; }
    .home-kpi {
        padding: 14px 16px;
        gap: 12px;
        border-radius: 14px;
    }
    .home-kpi-icon,
    .home-kpi-icon img {
        width: 48px;
        height: 48px;
    }
    .home-kpi-value { font-size: 20px; }
    .home-kpi--all-time .home-kpi-value { font-size: 22px; }
    .home-dash-widget {
        padding: 14px 14px 12px;
        border-radius: 14px;
    }
    .dash-widget-head h3 { font-size: 14px; }
    .dash-widget-head p { font-size: 11px; }
    .home-spending { grid-template-columns: 1fr; min-height: 0; }
    .home-dash-widget[data-widget-id="spending-overview"] .home-donut-wrap,
    .home-donut-wrap {
        width: min(180px, 70vw);
        height: min(180px, 70vw);
    }
    .home-donut-center strong { font-size: 15px; }
    .home-trend-chart,
    .home-dash-grid .home-trend-chart { height: 220px; }
    .home-budget-gauge { height: 140px; max-width: 180px; }
    .home-budget-gauge-label strong { font-size: 18px; }
    .home-tx-table { min-width: 480px; font-size: 11px; }
    .home-tx-table th,
    .home-tx-table td { padding: 10px 8px; }
    .home-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
        gap: 12px;
    }
    .home-banner-icon { font-size: 32px; }
    .home-banner-text strong { font-size: 16px; }
    .home-banner-cta {
        width: 100%;
        text-align: center;
        white-space: normal;
    }
    .home-dash-board .dash-customize-btn {
        width: 100%;
        justify-content: center;
    }
    .dash-toolbar-spacer { display: none; }
    .home-goal {
        grid-template-columns: 36px minmax(0, 1fr) auto;
        gap: 8px;
    }
    .home-goal-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}
@media (max-width: 380px) {
    .home-kpi-icon,
    .home-kpi-icon img {
        width: 40px;
        height: 40px;
    }
    .home-kpi-value { font-size: 18px; }
    .home-dash-widget[data-widget-id="spending-overview"] .home-cat-list {
        column-gap: 8px;
        font-size: 11px;
    }
}

/* ── Budget page ── */
.bud-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
}
.bud-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #6a6280;
    margin-bottom: 10px;
}
.bud-breadcrumb a { color: #7c3aed; text-decoration: none; font-weight: 600; }
.bud-hero {
    position: relative;
    min-height: 280px;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(99, 91, 255, 0.1);
}
.bud-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.97) 0%, rgba(255,255,255,0.92) 42%, rgba(255,255,255,0.5) 56%, rgba(255,255,255,0.08) 68%, transparent 100%);
    pointer-events: none;
}
.bud-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 58%;
    padding: 24px 32px 28px;
}
.bud-feature-tag {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 12px;
    border-radius: 999px;
    background: #fce7f3;
    color: #db2777;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
}
.bud-hero-title {
    margin: 0 0 8px;
    font-size: clamp(32px, 3.2vw, 42px);
    font-weight: 800;
    color: #2a2148;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
}
.bud-hero-sakura { font-size: 0.9em; }
.bud-hero-tagline {
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 700;
    color: #4c3d78;
    line-height: 1.4;
}
.bud-hero-lead {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: #6a6280;
    max-width: 480px;
}
.bud-hero-art {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}
.bud-hero-bubble {
    position: absolute;
    right: 50%;
    top: 20%;
    max-width: 260px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(124, 58, 237, 0.35);
    border-radius: 999px;
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 600;
    font-style: italic;
    color: #2a2148;
    box-shadow: 0 10px 28px rgba(42, 33, 72, 0.12);
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.35;
}
.bud-feature-strip {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.bud-feature-strip li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
}
.bud-feature-strip img { flex-shrink: 0; }
.bud-feature-strip strong {
    display: block;
    font-size: 13px;
    color: #2a2148;
    margin-bottom: 4px;
}
.bud-feature-strip em {
    display: block;
    font-size: 11px;
    color: #6a6280;
    font-style: normal;
    line-height: 1.4;
}
.bud-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    gap: 18px;
    align-items: start;
    width: 100%;
    min-width: 0;
}
.bud-main,
.bud-sidebar {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.bud-panel,
.bud-side-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
    overflow: hidden;
    min-width: 0;
}
.bud-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 0;
    flex-wrap: wrap;
}
.bud-panel-head h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: #2a2148;
}
.bud-panel-head--split { padding-bottom: 12px; }
.bud-month-picker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card-bg);
}
.bud-month-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
    font-size: 18px;
}
.bud-month-btn.is-disabled { opacity: 0.35; }
.bud-month-label {
    font-weight: 700;
    font-size: 12px;
    white-space: nowrap;
    min-width: 110px;
    text-align: center;
}
.bud-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 0 18px 16px;
}
.bud-kpi {
    position: relative;
    padding: 14px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(124, 58, 237, 0.04) 0%, rgba(124, 58, 237, 0.01) 100%);
    border: 1px solid rgba(124, 58, 237, 0.1);
    min-height: 88px;
}
.bud-kpi-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}
.bud-kpi-value {
    display: block;
    font-size: clamp(18px, 2vw, 22px);
    font-weight: 800;
    color: #2a2148;
    line-height: 1.2;
}
.bud-kpi--spent .bud-kpi-value { color: #dc2626; }
.bud-kpi--remaining .bud-kpi-value { color: #059669; }
.bud-kpi-ico {
    position: absolute;
    right: 12px;
    top: 12px;
    font-size: 16px;
    opacity: 0.7;
}
.bud-kpi--ring {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.bud-kpi-gauge {
    position: relative;
    width: 72px;
    height: 72px;
    margin-top: 4px;
}
.bud-kpi-gauge svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.bud-gauge-track {
    fill: none;
    stroke: #ece6ff;
    stroke-width: 10;
}
.bud-gauge-fill {
    fill: none;
    stroke: #7c3aed;
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 283;
    transition: stroke-dashoffset 0.4s ease;
}
.bud-gauge-center {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: #7c3aed;
}
.bud-progress-foot {
    padding: 0 18px 18px;
}
.bud-progress-bar {
    height: 8px;
    border-radius: 999px;
    background: #ece6ff;
    overflow: hidden;
    margin-bottom: 8px;
}
.bud-progress-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
    transition: width 0.4s ease;
}
.bud-progress-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}
.bud-link {
    font-size: 12px;
    font-weight: 700;
    color: #7c3aed;
    text-decoration: none;
    white-space: nowrap;
}
.bud-link--block {
    display: block;
    text-align: center;
    padding: 12px 18px 16px;
    border-top: 1px solid var(--border);
}
.bud-table-wrap {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 18px 18px;
}
.bud-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    font-size: 14px;
}
.bud-table th,
.bud-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}
.bud-table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 700;
}
.bud-col-cat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    white-space: nowrap;
}
.bud-cat-ico { font-size: 16px; }
.bud-col-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
}
.bud-col-progress em {
    font-size: 11px;
    color: var(--text-muted);
    font-style: normal;
    min-width: 36px;
}
.bud-bar {
    flex: 1;
    height: 8px;
    border-radius: 999px;
    background: #f1f5f9;
    overflow: hidden;
}
.bud-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    min-width: 2px;
}
.bud-status {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.bud-status--on_track { background: #ecfdf5; color: #059669; }
.bud-status--good { background: #eff6ff; color: #2563eb; }
.bud-status--warning { background: #fff7ed; color: #ea580c; }
.bud-status--over { background: #fef2f2; color: #dc2626; }
.bud-status--muted { color: var(--text-muted); }
.bud-empty {
    margin: 0;
    padding: 24px 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}
.bud-side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 16px 18px 12px;
}
.bud-side-head h2 {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    color: #2a2148;
}
.bud-side-head--split { padding-bottom: 8px; }
.bud-glance {
    display: grid;
    grid-template-columns: minmax(120px, 140px) minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 0 18px 12px;
}
.bud-donut-wrap {
    position: relative;
    width: 130px;
    height: 130px;
    margin: 0 auto;
}
.bud-donut-wrap canvas {
    display: block;
    max-width: 100%;
    touch-action: manipulation;
}
.bud-donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    text-align: center;
    padding: 8px;
}
.bud-donut-center strong {
    font-size: 13px;
    font-weight: 800;
    color: #2a2148;
    line-height: 1.2;
}
.bud-donut-center span {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}
.bud-glance-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 11px;
}
.bud-glance-legend li {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto auto;
    gap: 6px;
    align-items: center;
}
.bud-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.bud-legend-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
}
.bud-legend-amt { font-weight: 700; white-space: nowrap; }
.bud-legend-pct { color: var(--text-muted); white-space: nowrap; }
.bud-alerts {
    list-style: none;
    margin: 0;
    padding: 0 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.bud-alert {
    display: flex;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fafafa;
}
.bud-alert--warning { background: #fff7ed; border-color: #fed7aa; }
.bud-alert--critical { background: #fef2f2; border-color: #fecaca; }
.bud-alert--caution { background: #fffbeb; border-color: #fde68a; }
.bud-alert--info { background: #eff6ff; border-color: #bfdbfe; }
.bud-alert--positive { background: #ecfdf5; border-color: #a7f3d0; }
.bud-alert-ico {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.8);
}
.bud-alert strong {
    display: block;
    font-size: 13px;
    margin-bottom: 2px;
}
.bud-alert p {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}
.bud-tip-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: center;
    padding: 16px 18px;
}
.bud-tip-card h2 {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 800;
}
.bud-tip-card p {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.45;
}
.bud-tip-art img { display: block; }
.bud-create-section {
    position: relative;
    overflow: hidden;
    padding: 32px 36px;
    border-radius: 20px;
    background: linear-gradient(135deg, #faf5ff 0%, #f3eeff 48%, #fce7f3 100%);
    border: 1px solid rgba(124, 58, 237, 0.14);
    box-shadow: 0 12px 36px rgba(99, 91, 255, 0.08);
}
.bud-create-petals {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 12% 22%, rgba(244, 114, 182, 0.18) 0, transparent 42px),
        radial-gradient(circle at 88% 18%, rgba(167, 139, 250, 0.16) 0, transparent 36px),
        radial-gradient(circle at 72% 78%, rgba(244, 114, 182, 0.14) 0, transparent 48px),
        radial-gradient(circle at 24% 82%, rgba(196, 181, 253, 0.12) 0, transparent 40px);
}
.bud-create-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.15fr) minmax(160px, 220px);
    gap: 28px 32px;
    align-items: center;
}
.bud-create-copy h2 {
    margin: 0 0 10px;
    font-size: clamp(22px, 2.4vw, 28px);
    font-weight: 800;
    color: #2a2148;
    line-height: 1.25;
}
.bud-create-copy p {
    margin: 0 0 20px;
    font-size: 14px;
    color: #5b4f7a;
    line-height: 1.6;
    max-width: 380px;
}
.bud-create-btn {
    font-weight: 700;
    padding: 12px 22px;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.28);
}
.bud-create-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 20px;
}
.bud-create-features li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}
.bud-create-features img {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
}
.bud-create-features strong {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: #2a2148;
    margin-bottom: 3px;
    line-height: 1.3;
}
.bud-create-features em {
    display: block;
    font-size: 11px;
    font-style: normal;
    color: #6a6280;
    line-height: 1.45;
}
.bud-create-phone {
    justify-self: end;
    align-self: end;
}
.bud-create-phone img {
    display: block;
    max-width: 200px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 16px 32px rgba(42, 33, 72, 0.18));
}
.bud-footer-banner {
    position: relative;
    overflow: hidden;
    padding: 24px 28px;
    border-radius: 18px;
    background: linear-gradient(90deg, #f8f5ff 0%, #f3eeff 55%, #ede9fe 100%);
    border: 1px solid rgba(124, 58, 237, 0.12);
    box-shadow: 0 8px 24px rgba(99, 91, 255, 0.06);
}
.bud-footer-watermark {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.12;
    pointer-events: none;
}
.bud-footer-watermark img {
    display: block;
    width: min(140px, 28vw);
    height: auto;
}
.bud-footer-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}
.bud-footer-shield {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.12) 0%, rgba(167, 139, 250, 0.2) 100%);
    border: 1px solid rgba(124, 58, 237, 0.18);
}
.bud-footer-shield img {
    display: block;
    width: 32px;
    height: 32px;
}
.bud-footer-text {
    flex: 1;
    min-width: min(100%, 280px);
}
.bud-footer-quote {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 800;
    color: #2a2148;
    line-height: 1.45;
}
.bud-footer-sub {
    margin: 0;
    font-size: 13px;
    color: #6a6280;
    line-height: 1.5;
}
.bud-footer-cta {
    flex-shrink: 0;
    font-weight: 700;
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .bud-layout { grid-template-columns: 1fr; }
    .bud-hero-inner { max-width: 100%; }
    .bud-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bud-feature-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bud-create-section {
        padding: 24px 20px;
    }
    .bud-create-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .bud-create-phone {
        justify-self: center;
        order: 3;
    }
}
@media (max-width: 768px) {
    .bud-hero-inner { max-width: 100%; padding: 18px 16px 20px; }
    .bud-hero-bubble {
        right: 50%;
        top: auto;
        bottom: 12px;
        max-width: 200px;
        font-size: 11px;
        padding: 8px 12px;
    }
    .bud-hero-title { font-size: clamp(28px, 8vw, 34px); }
    .bud-hero-tagline { font-size: 14px; }
    .bud-hero-lead { font-size: 13px; }
    .bud-feature-strip { grid-template-columns: 1fr; }
    .bud-kpis { grid-template-columns: 1fr 1fr; }
    .bud-kpi--ring { grid-column: 1 / -1; }
    .bud-glance { grid-template-columns: 1fr; }
    .bud-donut-wrap { width: 160px; height: 160px; }
    .bud-create-section {
        padding: 20px 16px;
    }
    .bud-create-features { grid-template-columns: 1fr; }
    .bud-footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    .bud-footer-cta {
        width: 100%;
        text-align: center;
    }
    .bud-footer-watermark {
        right: 12px;
        opacity: 0.08;
    }
    .bud-table { font-size: 13px; min-width: 640px; }
}
@media (max-width: 480px) {
    .bud-kpis { grid-template-columns: 1fr; }
    .bud-progress-meta { flex-direction: column; gap: 4px; }
    .bud-side-head { flex-wrap: wrap; }
    .bud-glance-legend { font-size: 10px; }
    .bud-create-phone img { max-width: 160px; }
}

/* ── Goals page ── */
.goal-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
}
.goal-kpis.bud-kpis {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    position: relative;
    z-index: 2;
    overflow: visible;
}
.goal-overview.bud-panel {
    overflow: visible;
}
.goal-overview .goal-panel-head.bud-panel-head {
    position: relative;
    z-index: 1;
}
.goal-kpi--track .goal-kpi-value { color: #059669; }
.goal-kpi--done .goal-kpi-value { color: #7c3aed; }
.goal-kpi--saved .goal-kpi-value { color: #059669; }
.goal-kpi--target .goal-kpi-value { color: #7c3aed; }
.goal-kpi[data-goal-tip] {
    cursor: help;
    position: relative;
    z-index: 1;
}
.goal-kpi[data-goal-tip]:hover,
.goal-kpi[data-goal-tip]:focus-visible {
    z-index: 100;
}
.goal-kpi[data-goal-tip]::after {
    content: attr(data-goal-tip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    min-width: 160px;
    max-width: 220px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #2a2148;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    box-shadow: 0 8px 24px rgba(42, 33, 72, 0.2);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 101;
}
.goal-kpi[data-goal-tip]:hover::after,
.goal-kpi[data-goal-tip]:focus-visible::after {
    opacity: 1;
    visibility: visible;
}
.goal-progress-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #2a2148;
}
.goal-progress-note {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--text-muted);
}
.goal-new-btn {
    font-size: 13px;
    padding: 8px 14px;
    border-radius: 10px;
}
.goal-col-goal {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 180px;
}
.goal-row-ico {
    font-size: 22px;
    flex-shrink: 0;
    width: 36px;
    text-align: center;
}
.goal-row-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.goal-row-copy strong {
    font-weight: 700;
    color: #2a2148;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.goal-row-copy em {
    font-size: 11px;
    color: var(--text-muted);
    font-style: normal;
}
.goal-status {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.goal-status--on_track { background: #ecfdf5; color: #059669; }
.goal-status--in_progress { background: #fef9c3; color: #a16207; }
.goal-status--completed { background: #ede9fe; color: #7c3aed; }
.goal-status--behind { background: #fce7f3; color: #db2777; }
.goal-table-foot {
    padding: 0 18px 16px;
    text-align: right;
}
.goal-trend-wrap {
    padding: 0 18px 18px;
    height: 200px;
}
.goal-trend-wrap canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}
.goal-motivation-card blockquote {
    margin: 0 0 6px;
    font-size: 13px;
    font-style: italic;
    color: #4c3d78;
    line-height: 1.5;
}
.goal-motivation-card cite {
    font-size: 11px;
    color: var(--text-muted);
    font-style: normal;
}
.goal-create-features--six {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.goal-footer-banner .goal-footer-petal {
    position: absolute;
    top: -8px;
    right: 100px;
    opacity: 0.35;
    width: 32px;
    height: 32px;
}
.goal-footer-watermark {
    display: flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 1200px) {
    .goal-kpis.bud-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
    .goal-layout.bud-layout { grid-template-columns: 1fr; }
    .goal-hero-inner.bud-hero-inner { max-width: 100%; }
    .goal-create-grid.bud-create-grid { grid-template-columns: 1fr; }
    .goal-create-phone.bud-create-phone { justify-self: center; order: 3; }
}
@media (max-width: 768px) {
    .goal-feature-strip.bud-feature-strip { grid-template-columns: 1fr; }
    .goal-kpis.bud-kpis { grid-template-columns: 1fr 1fr; }
    .goal-kpi[data-goal-tip]::after { display: none; }
    .goal-table.bud-table { min-width: 680px; font-size: 13px; }
    .goal-new-btn { width: 100%; }
    .goal-panel-head.bud-panel-head--split { flex-direction: column; align-items: stretch; }
    .goal-create-features--six { grid-template-columns: 1fr; }
    .goal-trend-wrap { height: 180px; }
    .goal-footer-inner.bud-footer-inner { flex-direction: column; align-items: flex-start; }
    .goal-footer-cta.bud-footer-cta { width: 100%; text-align: center; }
}
@media (max-width: 480px) {
    .goal-kpis.bud-kpis { grid-template-columns: 1fr; }
    .goal-create-phone.bud-create-phone img { max-width: 160px; }
}

/* ── Investments page ── */
.inv-page {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
}
.inv-hero-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: 520px;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.14);
    font-size: 11px;
    line-height: 1.45;
    color: #4c3d78;
}
.inv-hero-disclaimer img { flex-shrink: 0; margin-top: 1px; }
.inv-journey-card {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: min(240px, 42vw);
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(124, 58, 237, 0.12);
    box-shadow: 0 12px 32px rgba(42, 33, 72, 0.12);
    backdrop-filter: blur(8px);
}
.inv-journey-card h3 {
    margin: 0 0 6px;
    font-size: 12px;
    font-weight: 800;
    color: #2a2148;
}
.inv-journey-level {
    margin: 0 0 10px;
    font-size: 11px;
    font-weight: 700;
    color: #7c3aed;
}
.inv-journey-bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.12);
    overflow: hidden;
    margin-bottom: 8px;
}
.inv-journey-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
}
.inv-journey-xp {
    margin: 0;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
}
.inv-overview-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.inv-filter-select {
    height: 36px;
    padding: 0 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    min-width: 130px;
}
.inv-kpis.bud-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.inv-kpi--gain .inv-kpi-value { color: #059669; }
.inv-kpi--today .inv-kpi-value { color: #059669; }
.inv-kpi-delta {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 700;
}
.inv-kpi-delta--up { color: #059669; }
.inv-kpi-delta--down { color: #dc2626; }
.inv-kpi[data-inv-tip] {
    cursor: help;
    position: relative;
    z-index: 1;
}
.inv-kpi[data-inv-tip]:hover,
.inv-kpi[data-inv-tip]:focus-visible { z-index: 100; }
.inv-kpi[data-inv-tip]::after {
    content: attr(data-inv-tip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    min-width: 160px;
    max-width: 240px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #2a2148;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    box-shadow: 0 8px 24px rgba(42, 33, 72, 0.2);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 101;
}
.inv-kpi[data-inv-tip]:hover::after,
.inv-kpi[data-inv-tip]:focus-visible::after {
    opacity: 1;
    visibility: visible;
}
.inv-overview.bud-panel { overflow: visible; }
.inv-overview .inv-panel-head.bud-panel-head { position: relative; z-index: 1; }
.inv-kpis.bud-kpis { position: relative; z-index: 2; overflow: visible; }
.inv-range-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.inv-range-tab {
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
}
.inv-range-tab.is-active,
.inv-range-tab:hover {
    color: #7c3aed;
    background: rgba(124, 58, 237, 0.08);
    border-color: rgba(124, 58, 237, 0.12);
}
.inv-performance-wrap {
    padding: 0 18px 18px;
    height: 240px;
}
.inv-performance-wrap canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}
.inv-new-btn {
    font-size: 13px;
    padding: 8px 14px;
    border-radius: 10px;
}
.inv-col-asset {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 180px;
}
.inv-row-ico {
    font-size: 22px;
    flex-shrink: 0;
    width: 36px;
    text-align: center;
}
.inv-row-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.inv-row-copy strong {
    font-weight: 700;
    color: #2a2148;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.inv-row-copy em {
    font-size: 11px;
    color: var(--text-muted);
    font-style: normal;
}
.inv-col-gain--up { color: #059669; font-weight: 700; }
.inv-col-gain--down { color: #dc2626; font-weight: 700; }
.inv-col-alloc {
    min-width: 100px;
}
.inv-alloc-bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(124, 58, 237, 0.1);
    overflow: hidden;
    margin-bottom: 4px;
}
.inv-alloc-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
}
.inv-table-foot { padding: 0 18px 16px; text-align: right; }
.inv-insights-list {
    list-style: none;
    margin: 0;
    padding: 0 18px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.inv-insight {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px;
    border-radius: 12px;
    background: rgba(124, 58, 237, 0.04);
    border: 1px solid rgba(124, 58, 237, 0.08);
}
.inv-insight img { flex-shrink: 0; }
.inv-insight strong {
    display: block;
    font-size: 12px;
    font-weight: 800;
    color: #2a2148;
    margin-bottom: 4px;
}
.inv-insight p {
    margin: 0;
    font-size: 11px;
    line-height: 1.45;
    color: var(--text-muted);
}
.inv-motivation-card blockquote {
    margin: 0;
    font-size: 13px;
    font-style: italic;
    color: #4c3d78;
    line-height: 1.5;
}
.inv-footer-features {
    list-style: none;
    margin: 0;
    padding: 16px 18px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    border-radius: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
}
.inv-footer-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.inv-footer-features strong {
    font-size: 12px;
    font-weight: 800;
    color: #2a2148;
}
.inv-learn-section {
    padding: 24px 20px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(124, 58, 237, 0.04) 0%, rgba(124, 58, 237, 0.01) 100%);
    border: 1px solid rgba(124, 58, 237, 0.1);
}
.inv-learn-section h2 {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 800;
    color: #2a2148;
    text-align: center;
}
.inv-learn-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.inv-learn-grid li {
    display: flex;
    gap: 10px;
    padding: 14px;
    border-radius: 14px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    min-width: 0;
}
.inv-learn-grid strong {
    display: block;
    font-size: 12px;
    font-weight: 800;
    color: #2a2148;
    margin-bottom: 4px;
}
.inv-learn-grid p {
    margin: 0 0 8px;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}
.inv-learn-grid a {
    font-size: 11px;
    font-weight: 700;
    color: #7c3aed;
    text-decoration: none;
}
.inv-footer-banner .inv-footer-petal {
    position: absolute;
    top: -8px;
    right: 100px;
    opacity: 0.35;
    width: 32px;
    height: 32px;
}
[data-theme="dark"] .inv-journey-card {
    background: rgba(20, 16, 36, 0.92);
    border-color: rgba(167, 139, 250, 0.2);
}
[data-theme="dark"] .inv-journey-card h3,
[data-theme="dark"] .inv-row-copy strong,
[data-theme="dark"] .inv-insight strong,
[data-theme="dark"] .inv-footer-features strong,
[data-theme="dark"] .inv-learn-grid strong,
[data-theme="dark"] .inv-learn-section h2 { color: #f1ecff; }
[data-theme="dark"] .inv-hero-disclaimer { color: #d8cff5; }

@media (max-width: 1200px) {
    .inv-kpis.bud-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .inv-learn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .inv-footer-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
    .inv-layout.bud-layout { grid-template-columns: 1fr; }
    .inv-hero-inner.bud-hero-inner { max-width: 100%; }
    .inv-journey-card {
        position: static;
        transform: none;
        width: 100%;
        max-width: 280px;
        margin: 12px 18px 0 auto;
    }
}
@media (max-width: 768px) {
    .inv-feature-strip.bud-feature-strip { grid-template-columns: 1fr; }
    .inv-kpis.bud-kpis { grid-template-columns: 1fr; }
    .inv-kpi[data-inv-tip]::after { display: none; }
    .inv-table.bud-table { min-width: 760px; font-size: 13px; }
    .inv-new-btn { width: 100%; }
    .inv-panel-head.bud-panel-head--split { flex-direction: column; align-items: stretch; }
    .inv-overview-filters { width: 100%; }
    .inv-filter-select { flex: 1; min-width: 0; }
    .inv-performance-wrap { height: 200px; }
    .inv-range-tabs { width: 100%; }
    .inv-learn-grid { grid-template-columns: 1fr; }
    .inv-footer-features { grid-template-columns: 1fr; }
    .inv-footer-inner.bud-footer-inner { flex-direction: column; align-items: flex-start; }
    .inv-footer-cta.bud-footer-cta { width: 100%; text-align: center; }
    .inv-hero-art { position: relative; min-height: auto; }
}
@media (max-width: 480px) {
    .inv-hero-disclaimer { font-size: 10px; }
}

.inv-col-actions {
    min-width: 200px;
    white-space: nowrap;
}
.inv-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.inv-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: #4c3d78;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.inv-action-btn svg {
    flex-shrink: 0;
}
.inv-action-btn--update:hover {
    color: #7c3aed;
    border-color: rgba(124, 58, 237, 0.35);
    background: rgba(124, 58, 237, 0.08);
}
.inv-action-btn--delete:hover {
    color: #dc2626;
    border-color: rgba(220, 38, 38, 0.35);
    background: rgba(248, 113, 113, 0.08);
}
.inv-delete-form {
    display: inline;
    margin: 0;
}
[data-theme="dark"] .inv-action-btn {
    color: #d8cff5;
    background: rgba(255, 255, 255, 0.04);
}
.inv-edit-page .inv-panel-head h2 {
    margin: 8px 0 0;
    font-size: 18px;
    font-weight: 800;
    color: #2a2148;
}
.inv-edit-body {
    padding: 0 18px 20px;
    max-width: 640px;
}
.inv-edit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}
@media (max-width: 768px) {
    .inv-table.bud-table { min-width: 920px; font-size: 13px; }
    .inv-action-btn span { display: none; }
    .inv-action-btn {
        min-width: 40px;
        padding: 0;
    }
}

