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

:root {
    --bg: #050508;
    --surface: #0f0f1a;
    --surface2: #161625;
    --border: rgba(255, 255, 255, 0.08);
    --accent: #8b5cf6;
    --accent-glow: rgba(139, 92, 246, 0.35);
    --green: #10b981;
    --red: #f43f5e;
    --text: #f8fafc;
    --muted: #94a3b8;
    --r: 16px;
    --nav: 70px;
    --nav-bottom: 12px;
    /* Safe Area o'zgaruvchilari */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --tg-safe-top: 0px;
    --tg-safe-bottom: 0px;
    --tg-safe-left: 0px;
    --tg-safe-right: 0px;
    --tg-content-safe-top: 0px;
    --tg-content-safe-bottom: 0px;
    --tg-content-safe-left: 0px;
    --tg-content-safe-right: 0px;
    --tg-header-offset: 0px;
    --vv-top: 0px;
    --vv-bottom: 0px;
    --app-height: 100dvh;
    --app-top-reserve: calc(var(--safe-top) + var(--tg-header-offset) + var(--vv-top));
    --app-bottom-reserve: calc(var(--safe-bottom) + var(--vv-bottom));
    --app-side-left-reserve: max(var(--safe-left), var(--tg-safe-left), var(--tg-content-safe-left));
    --app-side-right-reserve: max(var(--safe-right), var(--tg-safe-right), var(--tg-content-safe-right));
    --overlay-top-reserve: var(--app-top-reserve);
    --overlay-bottom-reserve: var(--app-bottom-reserve);
    --overlay-max-height: calc(var(--app-height) - var(--overlay-top-reserve) - var(--overlay-bottom-reserve) - 8px);
    --sheet-safe-top: calc(var(--app-top-reserve) * 0.35);
    /* JS orqali o'zgaradi */
}

html,
body {
    height: var(--app-height);
    min-height: var(--app-height);
    overflow: hidden;
    background: var(--bg);
    background-image:
        radial-gradient(circle at top left, rgba(26, 16, 51, 0.8) 0%, transparent 50%),
        radial-gradient(circle at bottom right, rgba(10, 26, 46, 0.6) 0%, transparent 50%);
    color: var(--text);
    font-family: "Plus Jakarta Sans", sans-serif;
    -webkit-font-smoothing: auto;
    padding: 0;
    margin: 0;
    /* Safe-area uchun qo'shimcha xavfsizlik */
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

#app {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    max-width: 430px;
    min-height: var(--app-height);
    height: var(--app-height);
    margin: 0 auto;
    position: relative;
    padding-top: calc(var(--safe-top) + var(--tg-header-offset) + var(--vv-top));
    padding-left: var(--app-side-left-reserve);
    padding-right: var(--app-side-right-reserve);
}

#views {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.view {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    /* Pastki nav va home indicator uchun joy */
    padding: calc(12px + var(--app-top-reserve)) 16px calc(var(--nav) + var(--nav-bottom) + var(--app-bottom-reserve) + 20px);
    display: none;
    flex-direction: column;
    gap: 12px;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.view.active {
    display: flex;
}

.finance-tab-shell {
    position: sticky;
    top: 0;
    z-index: 8;
    padding: 2px 0 4px;
    background: linear-gradient(180deg, var(--bg) 0%, rgba(0, 0, 0, 0) 100%);
}

.finance-segmented {
    padding: 6px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.finance-pane {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.view-profile {
    gap: 14px;
}

.profile-view-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 2px 0;
}

.profile-view-head h2 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.4px;
}

.profile-view-shell {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 8px;
}

/* ─── APP HEADER ──────────────────────────────── */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 12px;
    background: var(--surface);
    margin-top: calc(var(--app-top-reserve));
    z-index: 50;
    border-radius: 26px;
    border: 1px solid #ffffff1a;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-user {
    min-width: 0;
}

.header-logo {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.14);
    border: 1px solid rgba(139, 92, 246, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 18px;
    line-height: 1;
    color: var(--text);
}

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

.header-logo .stg-avatar-initials {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.header-title {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: -0.3px;
    background-clip: text;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.header-sub {
    font-size: 11px;
    color: var(--muted);
    margin-top: 1px;
}

.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.header-plan-indicator {
    position: relative;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 12px;
    background: var(--surface2);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.header-plan-indicator:active {
    transform: scale(0.94);
}

.header-plan-indicator[data-state="free"] {
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.04);
}

.header-plan-indicator[data-state="expired"] {
    color: #fda4af;
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.24);
}

.header-plan-indicator[data-state="premium"] {
    color: #ffe7a3;
    background: linear-gradient(135deg, rgba(241, 185, 59, 0.16), rgba(255, 255, 255, 0.05));
    border-color: rgba(241, 185, 59, 0.3);
    box-shadow: 0 10px 24px rgba(241, 185, 59, 0.14);
}

.header-plan-icon {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
}

.header-plan-icon svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.9;
}

.header-plan-indicator.is-premium {
    animation: headerPremiumPulse 2.8s ease-in-out infinite;
}

.header-plan-indicator.is-premium::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 18%, rgba(255, 255, 255, 0.18) 50%, transparent 82%);
    transform: translateX(-140%);
    animation: headerPremiumShimmer 3.2s ease-in-out infinite;
}

@keyframes headerPremiumPulse {

    0%,
    100% {
        opacity: 0.72;
        box-shadow: 0 10px 24px rgba(241, 185, 59, 0.1);
    }

    50% {
        opacity: 1;
        box-shadow: 0 12px 28px rgba(241, 185, 59, 0.2);
    }
}

@keyframes headerPremiumShimmer {
    0% {
        transform: translateX(-150%);
        opacity: 0;
    }

    18% {
        opacity: 0.22;
    }

    55% {
        transform: translateX(150%);
        opacity: 0.08;
    }

    100% {
        transform: translateX(150%);
        opacity: 0;
    }
}

.header-btn {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--surface2);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--muted);
    transition: all 0.2s;
}

.header-btn:active {
    transform: scale(0.92);
    background: var(--surface);
}

.header-btn svg {
    width: 17px;
    height: 17px;
    stroke-width: 1.8;
    stroke: var(--muted);
}

.settings-btn:hover {
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.3);
}

.settings-btn:hover svg {
    stroke: #a78bfa;
}

/* ─── NAV ─────────────────────────────────────── */
#nav {
    position: fixed;
    /* Pastki safe-area (iPhone Home Indicator) uchun qo'shimcha masofa */
    bottom: calc(var(--nav-bottom) + var(--app-bottom-reserve));
    left: 16px;
    right: 16px;
    background: rgba(15, 15, 26, 0.88);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 26px;
    height: var(--nav);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    z-index: 40;
}

.nb {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
    transition: color 0.2s;
    padding: 8px;
    letter-spacing: 0.3px;
}

.nb svg {
    width: 22px;
    height: 22px;
    transition: transform 0.2s;
    stroke-width: 1.8;
}

.nb.active {
    color: var(--accent);
}

.nb.active svg {
    transform: scale(1.12);
}

.nb:active svg {
    transform: scale(0.9);
}

.add-ring {
    width: 54px;
    height: 54px;
    background: linear-gradient(135deg, var(--accent), #d946ef);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 28px var(--accent-glow), 0 4px 16px rgba(0, 0, 0, 0.4);
    transform: translateY(-18px);
    border: 1px solid var(--accent);
    margin-bottom: 2px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.nb:active .add-ring {
    transform: translateY(-18px) scale(0.92);
    box-shadow: 0 0 16px var(--accent-glow);
}

.add-ring svg {
    stroke: var(--text);
}

.add-btn-txt {
    font-size: 10px;
    font-weight: 700;
    margin-top: -12px;
}



/* ─── FIVE TAB NAV PATCH ─────────────────────── */
#nav.nav-five {
    justify-content: space-between;
    padding: 0 6px;
    gap: 2px;
}

#nav.nav-five .nb {
    min-width: 0;
}

.nb-compact {
    gap: 3px;
    padding: 8px 4px 10px;
}

.nb-compact span {
    display: block;
    max-width: 100%;
    font-size: 10px;
    line-height: 1.05;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nb-add-main {
    flex: 0 0 78px;
    padding-inline: 0;
}

/* .add-ring-smaller {
    width: 48px;
    height: 48px;
    transform: translateY(-14px);
    border-width: 1px;
} */

.nb:active .add-ring-smaller {
    transform: translateY(-14px) scale(0.92);
}

.add-btn-txt-five {
    margin-top: -10px;
    font-size: 10px;
}

@media (max-width: 380px) {
    #nav.nav-five {
        left: 12px;
        right: 12px;
        padding: 0 4px;
    }

    .nb-compact span {
        font-size: 9px;
        letter-spacing: 0;
    }

    .nb-add-main {
        flex-basis: 72px;
    }

    .add-ring-smaller {
        width: 44px;
        height: 44px;
    }
}

/* ─── ROUTE PLACEHOLDERS ─────────────────────── */
.section-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 18px 16px;
    border-radius: 26px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.22);
}

.debts-hero {
    background: linear-gradient(180deg, rgba(14, 165, 233, 0.14), rgba(255, 255, 255, 0.02));
    margin-top: calc(var(--app-top-reserve));
}

.plan-hero {
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.18), rgba(255, 255, 255, 0.02));
    margin-top: calc(var(--app-top-reserve));
}

.section-eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .3px;
    margin-bottom: 12px;
}

.section-hero h2 {
    font-size: 24px;
    line-height: 1.05;
    margin-bottom: 8px;
}

.section-hero p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    max-width: 250px;
}

.hero-pill {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border-radius: 16px;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 700;
}

.hero-pill svg {
    width: 16px;
    height: 16px;
}

.split-stat-grid,
.roadmap-grid {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.split-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.split-stat-card,
.roadmap-card {
    border-radius: 22px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.split-stat-card strong,
.roadmap-card strong {
    display: block;
    font-size: 18px;
    margin: 8px 0 6px;
}

.split-stat-card small,
.roadmap-card p {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.split-stat-top {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.split-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
}

.split-stat-card.positive {
    color: #34d399;
}

.split-stat-card.warning {
    color: #f59e0b;
}

.route-panel {
    margin-top: calc(16px + var(--sheet-safe-top));
}

.empty-route-state {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
    padding: 16px 10px 6px;
}

.empty-route-state.compact {
    min-height: 180px;
}

.empty-route-ico {
    width: 72px;
    height: 72px;
    border-radius: 24px;
    display: grid;
    place-items: center;
    font-size: 30px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.empty-route-state h3 {
    font-size: 18px;
    line-height: 1.2;
}

.empty-route-state p {
    max-width: 280px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.roadmap-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.roadmap-step {
    flex: 0 0 40px;
    height: 40px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 800;
    background: rgba(139, 92, 246, 0.14);
    color: #c4b5fd;
}

@media (max-width: 420px) {
    .section-hero {
        flex-direction: column;
    }

    .hero-pill {
        width: 100%;
        justify-content: center;
    }
}

/* ─── BALANCE CARD ────────────────────────────── */
.balance-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 28px;
    padding: 28px 22px 22px;
    position: relative;
    overflow: hidden;
    cursor: grab;
    user-select: none;
    flex-shrink: 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4), 0 0 80px rgba(139, 92, 246, 0.06);
    transition: transform 0.3s ease;
}

.balance-card:active {
    transform: scale(0.99);
    cursor: grabbing;
}

.balance-card::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -40px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.18), transparent 70%);
    pointer-events: none;
}

.balance-card::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: -20px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1), transparent 70%);
    pointer-events: none;
}

.bc-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 8px;
    font-weight: 600;
}

.bc-amount {
    font-size: 42px;
    font-weight: 900;
    letter-spacing: -1.5px;
    line-height: 1.3;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: opacity 0.2s;
    position: relative;
    z-index: 1;
}

.bc-amount.loading {
    opacity: 0.3;
    -webkit-text-fill-color: var(--muted);
    background: none;
}

.bc-pills {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    position: relative;
    z-index: 1;
}

.cpill {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.cpill.on {
    background: rgba(139, 92, 246, 0.4);
    color: #fff;
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.25);
}

.bc-row {
    display: flex;
    gap: 24px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    position: relative;
    z-index: 1;
}

.bcs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bcs-ico {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bcs-ico.i {
    background: rgba(16, 185, 129, 0.15);
}

.bcs-ico.e {
    background: rgba(244, 63, 94, 0.15);
}

.bcs-ico svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.5;
}

.bcs-ico.i svg {
    stroke: var(--green);
}

.bcs-ico.e svg {
    stroke: var(--red);
}

.bcs-lbl {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.35);
    font-weight: 500;
}

.bcs-val {
    font-size: 14px;
    font-weight: 800;
}

.bcs-val.i {
    color: var(--green);
}

.bcs-val.e {
    color: var(--red);
}

/* ─── FILTER ROW ──────────────────────────────── */
.filter-row {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    flex-shrink: 0;
    scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
    display: none;
}

.fp {
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
}

.fp.on {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border-color: rgba(139, 92, 246, 0.35);
}

.fp:active {
    transform: scale(0.95);
}

/* ─── TYPE CARDS ──────────────────────────────── */
.type-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    flex-shrink: 0;
}

.tc {
    background: var(--surface2);
    border: 1.5px solid var(--border);
    border-radius: 20px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.tc:active {
    transform: scale(0.97);
}

.tc:hover {
    background: rgba(255, 255, 255, 0.04);
}

.tc.on-i {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.35);
}

.tc.on-e {
    background: rgba(244, 63, 94, 0.1);
    border-color: rgba(244, 63, 94, 0.35);
}

.tc-ico {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.tc-ico.i {
    background: rgba(16, 185, 129, 0.15);
}

.tc-ico.e {
    background: rgba(244, 63, 94, 0.15);
}

.tc-ico svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.tc-ico.i svg {
    stroke: var(--green);
}

.tc-ico.e svg {
    stroke: var(--red);
}

.tc-ttl {
    font-size: 11px;
    color: var(--muted);
    font-weight: 500;
}

.tc-sub {
    font-size: 12px;
    font-weight: 700;
    margin-top: 2px;
}

.tc-sub.i {
    color: var(--green);
}

.tc-sub.e {
    color: var(--red);
}

/* ─── PANEL ───────────────────────────────────── */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 18px;
}

.panel-ttl {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 14px;
}

#chart-wrap {
    position: relative;
    height: 170px;
}

#no-data {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    gap: 8px;
    font-size: 13px;
}

#no-data svg {
    width: 36px;
    height: 36px;
    opacity: 0.2;
}

.ctr {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.ctr:last-child {
    border-bottom: none;
}

.ctr-n {
    font-size: 13px;
    color: var(--text);
    text-transform: capitalize;
}

.ctr-v {
    font-size: 13px;
    font-weight: 700;
}

/* ─── TRENDS ──────────────────────────────────── */
#trend-sec {
    display: none;
    flex-direction: column;
    gap: 8px;
}

.tgrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.tcard {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tc-cat {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 2px;
}

.tc-val {
    font-size: 13px;
    font-weight: 700;
}

.tc-pct {
    font-size: 12px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 8px;
}

.tc-pct.up {
    color: var(--red);
    background: rgba(244, 63, 94, 0.1);
}

.tc-pct.dn {
    color: var(--green);
    background: rgba(16, 185, 129, 0.1);
}

.dash-widget-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dash-panel-sub {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.dash-widget-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.dash-widget-card {
    position: relative;
    min-height: 122px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border-radius: 22px;
    border: 1px solid var(--border);
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.06), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.14);
}

.dash-widget-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 100%;
    opacity: 0.9;
    pointer-events: none;
    background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.08), transparent 42%);
}

.dash-widget-card.tone-balance::before {
    background: radial-gradient(circle at top left, rgba(245, 158, 11, 0.22), transparent 42%);
}

.dash-widget-card.tone-count::before {
    background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.18), transparent 42%);
}

.dash-widget-card.tone-average::before {
    background: radial-gradient(circle at top left, rgba(16, 185, 129, 0.18), transparent 42%);
}

.dash-widget-card.tone-category::before {
    background: radial-gradient(circle at top left, rgba(244, 63, 94, 0.18), transparent 42%);
}

.dash-widget-label {
    position: relative;
    z-index: 1;
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.dash-widget-value {
    position: relative;
    z-index: 1;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.6px;
    line-height: 1.08;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.dash-widget-card.tone-category .dash-widget-value {
    font-size: 18px;
    line-height: 1.22;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dash-widget-sub {
    position: relative;
    z-index: 1;
    font-size: 12px;
    line-height: 1.45;
    color: var(--muted);
}

.dash-analytics-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dash-panel-chip {
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(241, 185, 59, 0.18);
    background: rgba(241, 185, 59, 0.08);
    color: #ffd978;
    font-size: 12px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.dash-panel-chip:active {
    transform: scale(0.96);
}

.dash-panel-chip.is-premium {
    border-color: rgba(241, 185, 59, 0.28);
    background:
        linear-gradient(135deg, rgba(241, 185, 59, 0.18), rgba(255, 255, 255, 0.04));
    box-shadow: 0 10px 22px rgba(241, 185, 59, 0.12);
}

.dash-analytics-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding-bottom: 4px;
}

.dash-analytics-card {
    min-width: 0;
    min-height: 192px;
    padding: 16px;
    border-radius: 22px;
    border: 1px solid var(--border);
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.05), transparent 34%),
        var(--surface2);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.14);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dash-analytics-card.wide {
    grid-column: 1 / -1;
}

.dash-analytics-card.is-locked {
    background:
        radial-gradient(circle at top right, rgba(241, 185, 59, 0.18), transparent 34%),
        linear-gradient(180deg, rgba(255, 248, 230, 0.04), rgba(255, 255, 255, 0.02));
}

.dash-analytics-card.is-preview {
    justify-content: center;
}

.premium-dashboard-card.hero {
    grid-column: 1 / -1;
    min-height: 238px;
}

.premium-dashboard-card.is-loading {
    justify-content: space-between;
}

.premium-widget-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.premium-widget-head-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.premium-widget-title {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.premium-widget-main {
    color: var(--text);
    font-size: 24px;
    line-height: 1.05;
    font-weight: 900;
    letter-spacing: -0.7px;
    font-variant-numeric: tabular-nums;
}

.premium-dashboard-card.hero .premium-widget-main {
    font-size: 30px;
}

.premium-widget-subtext {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.premium-widget-icon {
    width: 42px;
    height: 42px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.premium-widget-icon-svg {
    width: 18px;
    height: 18px;
}

.premium-dashboard-card.tone-balance .premium-widget-icon {
    color: #ffd978;
    background: rgba(241, 185, 59, 0.14);
    border-color: rgba(241, 185, 59, 0.2);
}

.premium-dashboard-card.tone-balance::before {
    background: radial-gradient(circle at top left, rgba(241, 185, 59, 0.24), transparent 46%);
}

.premium-widget-metrics {
    display: grid;
    gap: 8px;
}

.premium-dashboard-card.hero .premium-widget-metrics {
    grid-template-columns: 1fr;
}

.premium-widget-metric {
    padding: 11px 12px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(255, 255, 255, 0.03);
    display: grid;
    gap: 5px;
}

.premium-widget-metric span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.premium-widget-metric strong {
    color: var(--text);
    font-size: 14px;
    line-height: 1.35;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.premium-widget-metric.good strong {
    color: var(--green);
}

.premium-widget-metric.bad strong {
    color: var(--red);
}

.premium-widget-metric.warn strong {
    color: #ffd978;
}

.premium-widget-loading {
    display: grid;
    gap: 10px;
}

.premium-progress-list,
.premium-list,
.premium-alert-list {
    display: grid;
    gap: 10px;
}

.premium-progress-row,
.premium-list-row,
.premium-alert-card {
    padding: 12px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(255, 255, 255, 0.03);
}

.premium-progress-row.exceeded {
    border-color: rgba(244, 63, 94, 0.14);
    background: rgba(244, 63, 94, 0.08);
}

.premium-progress-row.near {
    border-color: rgba(241, 185, 59, 0.16);
    background: rgba(241, 185, 59, 0.08);
}

.premium-progress-head,
.premium-progress-meta,
.premium-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.premium-progress-head strong,
.premium-list-copy strong,
.premium-alert-card strong {
    color: var(--text);
    font-size: 13px;
    line-height: 1.35;
}

.premium-progress-head span,
.premium-progress-meta span,
.premium-list-copy span,
.premium-list-value,
.premium-alert-card span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
    font-variant-numeric: tabular-nums;
}

.premium-progress-bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
    margin: 8px 0;
}

.premium-progress-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(241, 185, 59, 0.96), rgba(248, 113, 113, 0.92));
}

.premium-list-row.income .premium-list-value {
    color: var(--green);
}

.premium-list-row.expense .premium-list-value {
    color: var(--red);
}

.premium-list-row.recurring .premium-list-value {
    color: #ffd978;
}

.premium-list-copy {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.premium-list-copy strong,
.premium-list-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.premium-alert-card {
    display: grid;
    gap: 4px;
}

.premium-alert-card.danger {
    border-color: rgba(244, 63, 94, 0.14);
    background: rgba(244, 63, 94, 0.08);
}

.premium-alert-card.warn {
    border-color: rgba(241, 185, 59, 0.16);
    background: rgba(241, 185, 59, 0.08);
}

.premium-alert-card.good {
    border-color: rgba(16, 185, 129, 0.14);
    background: rgba(16, 185, 129, 0.08);
}

.premium-trend-chart {
    height: 148px;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    align-items: end;
}

.premium-trend-col {
    min-width: 0;
    display: grid;
    gap: 8px;
    justify-items: center;
}

.premium-trend-bars {
    width: 100%;
    height: 120px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    align-items: end;
}

.premium-trend-bars span {
    border-radius: 999px 999px 4px 4px;
    min-height: 4px;
}

.premium-trend-bars .income {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.82), rgba(16, 185, 129, 0.32));
}

.premium-trend-bars .expense {
    background: linear-gradient(180deg, rgba(244, 63, 94, 0.82), rgba(244, 63, 94, 0.32));
}

.premium-trend-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.premium-chart-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.premium-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.premium-chart-legend i {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}

.premium-chart-legend i.income {
    background: var(--green);
}

.premium-chart-legend i.expense {
    background: var(--red);
}

.dash-analytics-card-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.dash-analytics-head-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dash-analytics-card h3 {
    font-size: 18px;
    line-height: 1.2;
    letter-spacing: -0.4px;
    margin: 0;
}

.dash-analytics-eyebrow {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 4px;
}

.dash-period-meta {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    max-width: 100%;
    min-width: 0;
    gap: 8px;
    padding: 6px 10px 6px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
}

.dash-period-chip {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(241, 185, 59, 0.14);
    color: #ffd978;
    flex-shrink: 0;
}

.dash-period-chip svg {
    width: 12px;
    height: 12px;
    stroke-width: 2;
}

.dash-period-text {
    min-width: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-compare-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dash-compare-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(255, 255, 255, 0.02);
}

.dash-compare-label {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 4px;
}

.dash-compare-row strong {
    font-size: 14px;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.dash-delta-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid transparent;
    font-variant-numeric: tabular-nums;
}

.dash-delta-badge.good {
    color: var(--green);
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.16);
}

.dash-delta-badge.bad {
    color: var(--red);
    background: rgba(244, 63, 94, 0.12);
    border-color: rgba(244, 63, 94, 0.16);
}

.dash-delta-badge.neutral {
    color: var(--muted);
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.12);
}

.dash-delta-badge.accent {
    color: #ffd978;
    background: rgba(241, 185, 59, 0.12);
    border-color: rgba(241, 185, 59, 0.18);
}

.dash-category-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dash-category-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dash-category-row-head,
.dash-category-row-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.dash-category-row-head strong,
.dash-category-row-meta span:first-child {
    font-size: 13px;
    line-height: 1.3;
}

.dash-category-row-head span,
.dash-category-row-meta span:first-child {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.dash-category-bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.dash-category-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, rgba(241, 185, 59, 0.96), rgba(248, 113, 113, 0.92));
}

.dash-widget-empty {
    padding: 14px;
    border-radius: 18px;
    border: 1px dashed rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--muted);
    line-height: 1.5;
}

.dash-widget-empty strong {
    color: var(--text);
    font-size: 14px;
}

.dash-analytics-preview-line {
    position: relative;
    height: 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.dash-analytics-preview-line::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    transform: translateX(-120%);
    animation: dashPreviewShimmer 2.6s ease-in-out infinite;
}

.dash-analytics-preview-line.w-40 {
    width: 40%;
}

.dash-analytics-preview-line.w-48 {
    width: 48%;
}

.dash-analytics-preview-line.w-55 {
    width: 55%;
}

.dash-analytics-preview-line.w-58 {
    width: 58%;
}

.dash-analytics-preview-line.w-64 {
    width: 64%;
}

.dash-analytics-preview-line.w-72 {
    width: 72%;
}

.dash-analytics-preview-line.w-82 {
    width: 82%;
}

.dash-analytics-preview-line.w-90 {
    width: 90%;
}

@keyframes dashPreviewShimmer {
    0% {
        transform: translateX(-120%);
    }

    100% {
        transform: translateX(120%);
    }
}

body.light .dash-widget-card,
body.light .dash-analytics-card {
    background:
        radial-gradient(circle at top right, rgba(15, 23, 42, 0.04), transparent 34%),
        rgba(255, 255, 255, 0.94);
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
}

body.light .dash-analytics-card.is-locked {
    background:
        radial-gradient(circle at top right, rgba(241, 185, 59, 0.18), transparent 34%),
        rgba(255, 255, 255, 0.96);
}

body.light .dash-period-meta,
body.light .dash-compare-row,
body.light .dash-widget-empty,
body.light .dash-analytics-preview-line,
body.light .premium-widget-metric,
body.light .premium-progress-row,
body.light .premium-list-row,
body.light .premium-alert-card,
body.light .premium-widget-icon {
    background: rgba(15, 23, 42, 0.04);
    border-color: rgba(15, 23, 42, 0.07);
}

body.light .dash-period-chip {
    background: rgba(241, 185, 59, 0.14);
}

body.light .premium-dashboard-card.tone-balance .premium-widget-icon {
    background: rgba(241, 185, 59, 0.14);
    border-color: rgba(241, 185, 59, 0.18);
}

@media (max-width: 380px) {
    .dash-widget-grid {
        grid-template-columns: 1fr;
    }

    .premium-dashboard-card.hero .premium-widget-metrics {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 720px) {
    .dash-analytics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 560px) {
    .premium-dashboard-card.hero .premium-widget-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

#view-add {
    /* Tugmalarni nav bar ustiga ko'tarish uchun ko'proq padding */
    padding-bottom: calc(var(--nav) + var(--nav-bottom) + var(--safe-bottom) + 28px);
}

.add-hdr h2 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-top: calc(var(--safe-top) + var(--tg-header-offset) + 34px);
}

.add-hdr p {
    font-size: 12px;
    color: var(--muted);
    margin-top: 3px;
}

#chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    min-height: 80px;
    padding-bottom: 8px;
}

.msg {
    max-width: 88%;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.5;
    border-radius: 4px 18px 18px 18px;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    animation: popIn 0.22s ease;
}

.msg.u {
    align-self: flex-end;
    border-radius: 18px 4px 18px 18px;
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.25);
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.97);
    }

    to {
        opacity: 1;
        /* transform: none; */
    }
}

.add-ctrl {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

#flow-start {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.fbtn {
    padding: 16px;
    border-radius: var(--r);
    border: 1.5px solid;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: -0.3px;
}

.fbtn:active {
    transform: scale(0.96);
}

.fbtn.i {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--green);
}

.fbtn.e {
    background: rgba(244, 63, 94, 0.08);
    border-color: rgba(244, 63, 94, 0.3);
    color: var(--red);
}

.fbtn svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

#flow-cats {
    display: none;
    flex-direction: column;
    gap: 10px;
}

.cats-hdr {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cats-hdr span {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}

.add-cat-b {
    font-size: 12px;
    color: #a78bfa;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 10px;
    padding: 5px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

.add-cat-b svg {
    width: 12px;
    height: 12px;
    stroke-width: 2.5;
}

#cat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-height: 170px;
    overflow-y: auto;
    scrollbar-width: none;
}

#cat-grid::-webkit-scrollbar {
    display: none;
}

.ci {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.15s;
}

.ci:active {
    transform: scale(0.93);
}

.ci span {
    font-size: 10px;
    color: var(--text);
    text-align: center;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
    font-weight: 500;
}

.ci svg {
    width: 22px;
    height: 22px;
    stroke-width: 1.8;
}

.ci.ci-i svg {
    stroke: var(--green);
}

.ci.ci-e svg {
    stroke: var(--red);
}

.cflow-cancel {
    font-size: 13px;
    color: var(--muted);
    background: none;
    border: none;
    cursor: pointer;
    text-align: center;
    padding: 10px;
    font-weight: 500;
    border: 1px solid var(--border);
    border-radius: 14px;
}

#flow-input {
    display: none;
    flex-direction: column;
    gap: 10px;
}

.flow-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.flow-type-badge,
.flow-cat-pill {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid var(--border);
    background: var(--surface2);
}

.flow-type-badge.income {
    color: var(--green);
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.24);
}

.flow-type-badge.expense {
    color: var(--red);
    background: rgba(244, 63, 94, 0.1);
    border-color: rgba(244, 63, 94, 0.24);
}

.flow-cat-pill {
    color: var(--text);
    font-weight: 700;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.in-row {
    display: flex;
    gap: 8px;
}

.cur-btn {
    padding: 0 14px;
    height: 50px;
    border-radius: 14px;
    border: 1.5px solid rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.07);
    color: var(--green);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.cur-btn.usd {
    border-color: rgba(139, 92, 246, 0.35);
    background: rgba(139, 92, 246, 0.07);
    color: #a78bfa;
}

#amt-in {
    flex: 1;
    height: 50px;
    background: var(--surface2);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    padding: 0 16px;
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
    letter-spacing: -0.5px;
}

#amt-in:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

#amt-in::placeholder {
    font-size: 14px;
    font-weight: 400;
    color: var(--muted);
    letter-spacing: 0;
}

#rec-area {
    display: none;
    align-items: center;
    gap: 12px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px 14px;
}

#rec-area.income-mode {
    border-color: rgba(16, 185, 129, 0.24);
    background: rgba(16, 185, 129, 0.06);
}

#rec-area.expense-mode {
    border-color: rgba(244, 63, 94, 0.24);
    background: rgba(244, 63, 94, 0.06);
}

#rec-area img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
}

.rec-del {
    font-size: 12px;
    color: var(--red);
    background: none;
    border: none;
    cursor: pointer;
    margin-top: 3px;
    display: block;
    font-weight: 600;
}

.act-row {
    display: flex;
    gap: 8px;
}

.clip-b {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: var(--surface2);
    border: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
}

.clip-b:active {
    transform: scale(0.93);
}

.clip-b svg {
    width: 20px;
    height: 20px;
    stroke: var(--muted);
    stroke-width: 1.8;
}

.save-b {
    flex: 1;
    height: 50px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), #d946ef);
    border: none;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.15s;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.35);
    font-family: inherit;
    letter-spacing: -0.3px;
}

.save-b.income-mode {
    background: linear-gradient(135deg, #14b87a, #22c55e);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.28);
}

.save-b.expense-mode {
    background: linear-gradient(135deg, #ef4444, #f43f5e);
    box-shadow: 0 4px 20px rgba(244, 63, 94, 0.28);
}

.save-b:active {
    opacity: 0.88;
    transform: scale(0.98);
}

.cancel-x {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: var(--surface2);
    border: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
}

.cancel-x:active {
    transform: scale(0.93);
}

.cancel-x svg {
    width: 18px;
    height: 18px;
    stroke: var(--muted);
    stroke-width: 2.5;
}

/* ─── HISTORY VIEW ────────────────────────────── */
.view-hist-hdr {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex-shrink: 0;
    padding: 12px 0 8px;
    z-index: 40;
    margin-top: calc(var(--app-top-reserve));
}

.vh-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.view-hist-hdr h2 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.hist-filter-row {
    display: flex;
    gap: 6px;
}

#tx-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.tx-day {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tx-day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 4px;
}

.tx-day-date {
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
}

.tx-day-sums {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    justify-content: flex-end;
    font-size: 13px;
    font-weight: 800;
}

.tx-day-sep {
    color: rgba(255, 255, 255, 0.32);
}

.tx-day-sum-inc {
    color: var(--green);
}

.tx-day-sum-exp {
    color: var(--red);
}

.tx-day-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.txi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.15s;
}

.txi:active {
    transform: scale(0.98);
    background: var(--surface2);
}

.txi-l {
    display: flex;
    align-items: center;
    gap: 12px;
}

.txi-ico {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.txi-ico.i {
    background: rgba(16, 185, 129, 0.12);
}

.txi-ico.e {
    background: rgba(244, 63, 94, 0.12);
}

.txi-ico svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.2;
}

.txi-ico.i svg {
    stroke: var(--green);
}

.txi-ico.e svg {
    stroke: var(--red);
}

.txi-cat {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.txi-type {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.2px;
}

.txi-type.i {
    color: var(--green);
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.18);
}

.txi-type.e {
    color: var(--red);
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.18);
}

.txi-dt {
    font-size: 11px;
    color: var(--muted);
    margin-top: 3px;
}

.txi-amt {
    font-size: 15px;
    font-weight: 800;
    flex-shrink: 0;
    letter-spacing: -0.3px;
}

.txi-amt.i {
    color: var(--green);
}

.txi-amt.e {
    color: var(--red);
}

.chek-b {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(139, 92, 246, 0.12);
    color: #a78bfa;
    font-weight: 600;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

#empty-s {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--muted);
    gap: 10px;
}

#empty-s svg {
    width: 56px;
    height: 56px;
    opacity: 0.15;
}

#empty-s p {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

#empty-s small {
    font-size: 13px;
}

/* ─── PIN ─────────────────────────────────────── */
#pin-screen {
    position: fixed;
    inset: 0;
    z-index: 250;
    background: var(--bg);
    background-image:
        radial-gradient(circle at top left, rgba(26, 16, 51, 0.8) 0%, transparent 50%),
        radial-gradient(circle at bottom right, rgba(10, 26, 46, 0.6) 0%, transparent 50%);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: calc(40px + var(--safe-top)) 20px calc(40px + var(--safe-bottom));
}

#pin-screen.on {
    display: flex;
}

#pin-ttl {
    font-size: 24px;
    font-weight: 900;
    text-align: center;
    letter-spacing: -0.5px;
}

#pin-sub {
    font-size: 14px;
    color: var(--muted);
    margin-top: 4px;
    text-align: center;
}

#pin-dots {
    display: flex;
    gap: 16px;
}

.pd {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--surface2);
    border: 2px solid var(--border);
    transition: all 0.15s;
}

.pd.on {
    background: var(--accent);
    border-color: var(--accent);
    transform: scale(1.25);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.5);
}

.pin-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 270px;
}

.pk {
    height: 64px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text);
    font-size: 24px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.pk:active {
    background: rgba(139, 92, 246, 0.18);
    transform: scale(0.92);
}

#pin-cancel-b {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
    display: none;
    margin-top: -8px;
    font-family: inherit;
}

#pin-bio-b {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #a78bfa;
    font-size: 12px;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
}

#pin-bio-b svg {
    width: 38px;
    height: 38px;
    stroke-width: 1.5;
    stroke: #a78bfa;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-10px);
    }

    40% {
        transform: translateX(8px);
    }

    60% {
        transform: translateX(-6px);
    }

    80% {
        transform: translateX(4px);
    }
}

.shk {
    animation: shake 0.4s ease;
}

/* ─── OVERLAYS / MODALS ───────────────────────── */
.ov {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s, backdrop-filter 0.25s;
    padding: calc(8px + var(--overlay-top-reserve)) calc(12px + var(--app-side-right-reserve)) var(--overlay-bottom-reserve) calc(12px + var(--app-side-left-reserve));
}

.ov.on {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Yangi kategoriya modali boshqa overlaylar (masalan stg-sub-cats) ustida bo'lsin */
#ov-addcat.ov.on,
#ov-editcat.ov.on {
    z-index: 85;
}

.ov.center {
    align-items: center;
    padding: calc(20px + var(--overlay-top-reserve)) calc(20px + var(--app-side-right-reserve)) calc(20px + var(--overlay-bottom-reserve)) calc(20px + var(--app-side-left-reserve));
}

.sheet {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 28px 28px 0 0;
    width: 100%;
    max-width: 430px;
    padding: calc(20px + var(--sheet-safe-top)) calc(20px + var(--app-side-right-reserve)) calc(40px + var(--app-bottom-reserve)) calc(20px + var(--app-side-left-reserve));
    max-height: max(260px, var(--overlay-max-height));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scroll-padding-top: calc(64px + var(--sheet-safe-top));
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.ov.on .sheet {
    transform: translateY(0);
}

.sheet.c {
    border-radius: 24px;
    padding: calc(24px + var(--sheet-safe-top)) calc(24px + var(--app-side-right-reserve)) calc(24px + var(--overlay-bottom-reserve)) calc(24px + var(--app-side-left-reserve));
    max-width: 360px;
    max-height: min(560px, max(220px, var(--overlay-max-height)));
    margin: auto;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s;
}

.ov.on .sheet.c {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.sh-hdl {
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 2px;
    margin: 0 auto 16px;
}

.sh-ttl {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.3px;
    padding-right: calc(56px + var(--app-side-right-reserve));
}

.sh-close {
    position: absolute;
    top: calc(14px + var(--sheet-safe-top));
    right: calc(12px + var(--app-side-right-reserve));
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 50%;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
    z-index: 10;
}

.sh-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: rotate(90deg);
}

body.light .sh-close {
    background: rgba(0, 0, 0, 0.05);
    color: #64748b;
}

body.light .sh-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #0f172a;
}

.as-b {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 8px;
    font-family: inherit;
}

.as-b:last-child {
    margin-bottom: 0;
}

.as-b:active {
    transform: scale(0.96);
}

.as-b svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
    flex-shrink: 0;
}

.as-b.blue {
    color: #60a5fa;
}

.as-b.blue svg {
    stroke: #60a5fa;
}

.as-b.green {
    color: var(--green);
}

.as-b.green svg {
    stroke: var(--green);
}

.as-b.red {
    color: var(--red);
}

.as-b.red svg {
    stroke: var(--red);
}

.del-ico {
    width: 60px;
    height: 60px;
    border-radius: 20px;
    background: rgba(244, 63, 94, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}

.del-ico svg {
    width: 26px;
    height: 26px;
    stroke: var(--red);
    stroke-width: 2;
}

.mrow {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.bcl {
    flex: 1;
    padding: 13px;
    border-radius: 14px;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.bcl:active {
    transform: scale(0.97);
}

.bdng {
    flex: 1;
    padding: 13px;
    border-radius: 14px;
    background: var(--red);
    border: none;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.15s;
}

.bdng:active {
    opacity: 0.85;
}

.bpri {
    width: 100%;
    padding: 13px;
    border-radius: 14px;
    /* background: linear-gradient(135deg, var(--accent), #d946ef); */
    background: var(--accent);
    border: none;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.15s;
    font-family: inherit;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}

.bpri:active {
    opacity: 0.85;
    transform: scale(0.98);
}

.fld {
    margin-bottom: 14px;
}

.fld label {
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 6px;
}

.fld input,
.fld select {
    width: 100%;
    background: var(--surface2);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
}

.fld input:focus,
.fld select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.fld select option {
    background: var(--surface2);
}

#icon-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    max-height: 280px;
    overflow-y: auto;
    margin-top: 12px;
    padding: 2px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
}

#icon-grid::-webkit-scrollbar {
    width: 4px;
}

#icon-grid::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

.io {
    background: rgba(255, 255, 255, 0.03);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.io:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(139, 92, 246, 0.4);
}

.io.on {
    border-color: #b356e9cf;
    background: rgba(139, 92, 246, 0.2);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

.io:active {
    transform: scale(0.92);
}

.io svg {
    width: 22px;
    height: 22px;
    stroke: var(--muted);
    stroke-width: 1.8;
    transition: stroke 0.2s;
}

.io.on svg {
    stroke: #b356e9cf;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

/* ─── NEW SETTINGS ───────────────────────────── */
/* Sozlamalar — butun ekran (Telegram WebApp) */
#ov-settings.ov {
    align-items: stretch;
    justify-content: flex-start;
    padding: var(--overlay-top-reserve) var(--app-side-right-reserve) var(--overlay-bottom-reserve) var(--app-side-left-reserve);
}

#ov-settings .stg-sheet {
    width: 100%;
    max-width: none;
    min-height: calc(var(--app-height) - var(--overlay-top-reserve) - var(--overlay-bottom-reserve));
    max-height: none;
    height: calc(var(--app-height) - var(--overlay-top-reserve) - var(--overlay-bottom-reserve));
    margin: 0;
    padding-left: calc(18px + var(--app-side-left-reserve));
    padding-right: calc(18px + var(--app-side-right-reserve));
    padding-top: 12px;
    padding-bottom: calc(40px + var(--app-bottom-reserve));
    box-shadow: none;
}

#ov-settings .sh-close {
    top: calc(12px + var(--sheet-safe-top));
    right: calc(12px + var(--app-side-right-reserve));
}

.stg-sheet {
    padding-bottom: 40px;
    max-height: calc(var(--app-height) - var(--overlay-top-reserve) - var(--overlay-bottom-reserve));
    height: calc(var(--app-height) - var(--overlay-top-reserve) - var(--overlay-bottom-reserve));
    overflow-y: auto;
    border-radius: 0 !important;
    border: none !important;
}

.stg-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 0 20px;
    gap: 8px;
}

.stg-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.1);
    border: 2px solid rgba(139, 92, 246, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.stg-avatar.lg {
    width: 80px;
    height: 80px;
}

.stg-avatar svg {
    width: 32px;
    height: 32px;
    stroke: var(--muted);
}

.stg-avatar.lg svg {
    width: 40px;
    height: 40px;
}

.stg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stg-avatar-initials {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--text);
}

.stg-avatar.lg .stg-avatar-initials {
    font-size: 30px;
}

.profile-photo-actions {
    display: flex;
    gap: 10px;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}

.profile-photo-btn {
    min-width: 140px;
    color: var(--text);
}

.profile-photo-btn.danger {
    border-color: rgba(239, 68, 68, 0.28);
    background: rgba(239, 68, 68, 0.1);
    color: var(--red);
}

.profile-photo-btn.is-disabled,
.profile-photo-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.profile-photo-note {
    font-size: 12px;
    line-height: 1.5;
    color: var(--muted);
    text-align: center;
    max-width: 280px;
}

.stg-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.stg-sub-info {
    font-size: 12px;
    color: var(--muted);
    background: rgba(139, 92, 246, 0.08);
    padding: 4px 12px;
    border-radius: 12px;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.stg-group {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-bottom: 12px;
    overflow: hidden;
}

.stg-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    gap: 12px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border);
}

.notif-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 10px;
}

.notif-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .03);
}

.notif-head {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.notif-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    color: var(--txt);
    font-size: 12px;
    font-weight: 700;
}

.notif-badge[data-state="ready"] {
    background: rgba(16, 185, 129, .18);
    color: #86efac;
}

.notif-badge[data-state="warn"] {
    background: rgba(245, 158, 11, .18);
    color: #fde68a;
}

.notif-badge[data-state="error"] {
    background: rgba(239, 68, 68, .18);
    color: #fecaca;
}

.notif-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    font-size: 13px;
}

.notif-row span {
    color: var(--muted);
}

.notif-row strong {
    flex: 1;
    text-align: right;
    line-height: 1.45;
    font-size: 13px;
    color: var(--txt);
}

.notif-note {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.notif-actions {
    display: flex;
    gap: 10px;
}

.notif-actions .bpri,
.notif-actions .bcl,
.notif-disable-btn {
    flex: 1;
}

.notif-disable-btn {
    width: 100%;
}

body.light .notif-card {
    background: rgba(15, 23, 42, .03);
    border-color: rgba(15, 23, 42, .08);
}

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

.stg-item:active {
    background: rgba(139, 92, 246, 0.05);
}

.stg-item.stg-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.stg-ico {
    font-size: 18px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.stg-txt {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.stg-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stg-sub {
    font-size: 12px;
    color: var(--muted);
}

.stg-arrow {
    font-size: 20px;
    color: var(--muted);
    font-weight: 300;
    flex-shrink: 0;
}

.stg-badge {
    text-align: center;
    font-size: 10px;
    color: var(--accent);
    padding: 4px 8px;
    border-radius: 8px;
    letter-spacing: 0.3px;
    white-space: nowrap;
    border: 1px solid;
}

.stg-danger {
    color: var(--red) !important;
}

.stg-badge[data-state="premium"] {
    background: rgba(241, 185, 59, 0.14);
    border-color: rgba(241, 185, 59, 0.34);
    color: #ffd978;
}

.stg-badge[data-state="trial"] {
    background: rgba(59, 130, 246, 0.14);
    border-color: rgba(59, 130, 246, 0.3);
    color: #93c5fd;
}

.stg-badge[data-state="expired"] {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.28);
    color: #fda4af;
}

.stg-badge[data-state="free"] {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--muted);
}

.subscription-sheet {
    gap: 14px;
}

.subscription-current-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 20px;
    border-radius: 24px;
    border: 1px solid rgba(241, 185, 59, 0.16);
    background:
        radial-gradient(circle at top right, rgba(241, 185, 59, 0.12), transparent 34%),
        rgba(255, 255, 255, 0.03);
}

.subscription-current-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.subscription-eyebrow {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.54);
}

.subscription-current-card h3 {
    margin: 6px 0 0;
    font-size: 26px;
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.subscription-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    white-space: normal;
    line-height: 1.2;
}

.subscription-status-badge[data-state="premium"],
.subscription-status-badge.premium {
    background: rgba(241, 185, 59, 0.14);
    border-color: rgba(241, 185, 59, 0.34);
    color: #ffd978;
}

.subscription-status-badge[data-state="trial"] {
    background: rgba(59, 130, 246, 0.14);
    border-color: rgba(59, 130, 246, 0.28);
    color: #93c5fd;
}

.subscription-status-badge[data-state="expired"] {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.28);
    color: #fda4af;
}

.subscription-status-badge[data-state="free"] {
    color: var(--muted);
}

.subscription-facts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.subscription-fact-item,
.subscription-period-card,
.upgrade-current-card>div {
    position: relative;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.02));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.subscription-fact-item {
    min-height: 108px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
}

.subscription-fact-item[data-state="premium"] {
    border-color: rgba(241, 185, 59, 0.18);
    background:
        radial-gradient(circle at top right, rgba(241, 185, 59, 0.1), transparent 36%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
}

.subscription-fact-item[data-state="expired"] {
    border-color: rgba(239, 68, 68, 0.16);
    background:
        radial-gradient(circle at top right, rgba(239, 68, 68, 0.08), transparent 36%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
}

.subscription-fact-item span,
.subscription-period-item span,
.upgrade-current-card span {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.subscription-fact-item strong,
.subscription-period-item strong,
.upgrade-current-card strong {
    display: block;
    font-size: 18px;
    line-height: 1.2;
    letter-spacing: -0.03em;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.subscription-fact-item strong {
    margin-top: auto;
}

.subscription-price-fact {
    gap: 12px;
}

.subscription-price-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
}

.subscription-price-old {
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.46);
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
    text-decoration-color: rgba(255, 255, 255, 0.2);
}

.subscription-price-sale-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    color: #ffd978;
    border: 1px solid rgba(241, 185, 59, 0.24);
    background: rgba(241, 185, 59, 0.12);
}

.subscription-fact-item[data-state="premium"] strong,
.subscription-status-badge[data-state="premium"],
.subscription-status-badge.premium {
    color: #fff1c7;
}

.subscription-fact-item strong {
    word-break: break-word;
}

.subscription-fact-item#stg-subscription-price-card strong {
    color: #dbeafe;
}

.subscription-fact-item[data-state="trial"] strong {
    color: #bfdbfe;
}

.subscription-fact-item[data-state="expired"] strong {
    color: #fecdd3;
}

.subscription-period-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.subscription-period-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.subscription-period-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: -0.01em;
}

.subscription-period-badge {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.14);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
}

.subscription-period-badge[data-state="active"],
.subscription-period-badge[data-state="grace"],
.subscription-period-badge[data-state="canceled"] {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(16, 185, 129, 0.22);
    color: #bbf7d0;
}

.subscription-period-badge[data-state="trial"] {
    background: rgba(59, 130, 246, 0.14);
    border-color: rgba(59, 130, 246, 0.22);
    color: #bfdbfe;
}

.subscription-period-badge[data-state="expired"] {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.18);
    color: #fecdd3;
}

.subscription-period-badge[data-state="free"] {
    background: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.12);
    color: var(--muted);
}

.subscription-period-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
}

.subscription-period-grid[data-layout="single"] {
    grid-template-columns: 1fr;
}

.subscription-period-item {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subscription-period-item strong {
    font-size: 20px;
    line-height: 1.18;
}

.subscription-period-divider {
    width: 1px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
}

.subscription-live-countdown {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 2px;
}

.subscription-live-head,
.pricing-countdown-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.subscription-live-label,
.pricing-countdown-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}

.subscription-live-head strong,
.pricing-countdown-head strong {
    font-size: 15px;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.subscription-note {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.pricing-grid {
    display: grid;
    gap: 14px;
    margin-top: 16px;
}

.pricing-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.pricing-card.premium {
    border-color: rgba(241, 185, 59, 0.24);
    background:
        radial-gradient(circle at top right, rgba(241, 185, 59, 0.18), transparent 34%),
        linear-gradient(180deg, rgba(31, 26, 12, 0.9), rgba(17, 18, 24, 0.96));
}

.pricing-card.is-current {
    box-shadow: 0 0 0 1px rgba(241, 185, 59, 0.18), 0 16px 34px rgba(0, 0, 0, 0.16);
}

.pricing-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.pricing-card-label {
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.54);
}

.pricing-card h3 {
    margin: 4px 0 0;
    font-size: 24px;
    letter-spacing: -0.03em;
}

.pricing-card-chip {
    display: inline-flex;
    align-items: center;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
}

.pricing-card-chip.premium {
    border-color: rgba(241, 185, 59, 0.28);
    color: #ffd978;
    background: rgba(241, 185, 59, 0.12);
}

.pricing-sale-banner,
.pricing-countdown-card {
    border-radius: 18px;
    border: 1px solid rgba(241, 185, 59, 0.16);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.02));
    padding: 14px;
}

.pricing-sale-banner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.pricing-sale-copy {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.pricing-sale-label {
    font-size: 12px;
    font-weight: 800;
    color: #ffd978;
}

.pricing-sale-copy strong {
    font-size: 15px;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: var(--text);
}

.pricing-sale-discount {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    color: #fff1c7;
    border: 1px solid rgba(241, 185, 59, 0.22);
    background: rgba(241, 185, 59, 0.12);
}

.pricing-price-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pricing-price-old {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 13px;
}

.pricing-price-old strong {
    font-size: 15px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.62);
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
    text-decoration-color: rgba(255, 255, 255, 0.24);
}

.pricing-price {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
}

.pricing-price strong {
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    line-height: inherit;
    color: var(--text);
}

.pricing-price span {
    font-size: 15px;
    font-weight: 600;
    color: var(--muted);
}

.countdown-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.countdown-board-compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.countdown-unit {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 10px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.countdown-unit small {
    font-size: 11px;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.countdown-roll-window {
    position: relative;
    display: block;
    height: 1.1em;
    overflow: hidden;
    font-size: 24px;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.05em;
    font-variant-numeric: tabular-nums;
    color: var(--text);
}

.countdown-roll-current,
.countdown-roll-next {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.42s ease;
}

.countdown-roll-current {
    transform: translateY(0);
    opacity: 1;
}

.countdown-roll-next {
    transform: translateY(100%);
    opacity: 0;
}

.countdown-unit.is-animating .countdown-roll-current {
    transform: translateY(-100%);
    opacity: 0;
}

.countdown-unit.is-animating .countdown-roll-next {
    transform: translateY(0);
    opacity: 1;
}

.countdown-unit.is-resetting .countdown-roll-current,
.countdown-unit.is-resetting .countdown-roll-next {
    transition: none;
}

.countdown-unit[data-urgent="true"] {
    border-color: rgba(241, 185, 59, 0.24);
    background:
        radial-gradient(circle at top center, rgba(241, 185, 59, 0.14), transparent 55%),
        rgba(255, 255, 255, 0.04);
}

.pricing-card-copy {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

.pricing-feature-list,
.upgrade-benefits {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pricing-feature-list li,
.upgrade-benefits li {
    position: relative;
    padding-left: 18px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text);
}

.pricing-feature-list li::before,
.upgrade-benefits li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--accent);
    font-weight: 800;
}

.pricing-action-btn {
    width: 100%;
    margin-top: auto;
}

.upgrade-modal {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#ov-upgrade .upgrade-close-btn {
    top: calc(12px + var(--sheet-safe-top));
    right: calc(12px + var(--app-side-right-reserve));
    width: 46px;
    height: 46px;
    border-radius: 18px;
    background:
        radial-gradient(circle at 30% 25%, rgba(241, 185, 59, 0.16), transparent 42%),
        rgba(21, 24, 33, 0.92);
    border: 1px solid rgba(241, 185, 59, 0.18);
    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    overflow: hidden;
}

#ov-upgrade .upgrade-close-btn::before {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#ov-upgrade .upgrade-close-btn:hover {
    transform: translateY(-1px) scale(1.02);
    border-color: rgba(241, 185, 59, 0.28);
    box-shadow:
        0 16px 38px rgba(0, 0, 0, 0.38),
        0 0 0 1px rgba(241, 185, 59, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

#ov-upgrade .upgrade-close-btn:active {
    transform: scale(0.95);
}

.upgrade-close-icon {
    position: relative;
    width: 16px;
    height: 16px;
    display: block;
    z-index: 1;
}

.upgrade-close-icon::before,
.upgrade-close-icon::after {
    content: "";
    position: absolute;
    left: 7px;
    top: -1px;
    width: 2px;
    height: 18px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(203, 213, 225, 0.9));
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.08);
}

.upgrade-close-icon::before {
    transform: rotate(45deg);
}

.upgrade-close-icon::after {
    transform: rotate(-45deg);
}

body.light #ov-upgrade .upgrade-close-btn {
    background:
        radial-gradient(circle at 30% 25%, rgba(241, 185, 59, 0.2), transparent 42%),
        rgba(255, 255, 255, 0.92);
    border-color: rgba(241, 185, 59, 0.22);
    box-shadow:
        0 16px 32px rgba(15, 23, 42, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

body.light #ov-upgrade .upgrade-close-btn::before {
    border-color: rgba(15, 23, 42, 0.05);
}

body.light .upgrade-close-icon::before,
body.light .upgrade-close-icon::after {
    background: linear-gradient(180deg, #1f2937, #475569);
}

.upgrade-body {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

.upgrade-current-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

body.light .subscription-current-card,
body.light .pricing-card,
body.light .subscription-fact-item,
body.light .subscription-period-card,
body.light .upgrade-current-card>div {
    background: rgba(15, 23, 42, 0.03);
    border-color: rgba(15, 23, 42, 0.08);
}

body.light .pricing-card.premium {
    background:
        radial-gradient(circle at top right, rgba(241, 185, 59, 0.18), transparent 34%),
        linear-gradient(180deg, rgba(255, 251, 235, 0.94), rgba(255, 255, 255, 0.98));
}

body.light .pricing-card h3,
body.light .subscription-current-card h3 {
    color: #0f172a;
}

body.light .pricing-card-label,
body.light .subscription-eyebrow {
    color: #64748b;
}

body.light .pricing-card-copy,
body.light .subscription-note,
body.light .upgrade-body {
    color: #64748b;
}

body.light .subscription-price-old,
body.light .pricing-price-old strong {
    color: rgba(15, 23, 42, 0.48);
    text-decoration-color: rgba(15, 23, 42, 0.18);
}

body.light .pricing-sale-banner,
body.light .pricing-countdown-card,
body.light .countdown-unit {
    background: rgba(15, 23, 42, 0.03);
    border-color: rgba(15, 23, 42, 0.08);
}

body.light .pricing-sale-label,
body.light .pricing-sale-discount,
body.light .subscription-price-sale-badge {
    color: #7c5a06;
}

body.light .subscription-fact-item[data-state="premium"] strong {
    color: #7c5a06;
}

body.light .subscription-fact-item[data-state="trial"] strong {
    color: #1d4ed8;
}

body.light .subscription-fact-item[data-state="expired"] strong {
    color: #be123c;
}

body.light .subscription-fact-item#stg-subscription-price-card strong {
    color: #1d4ed8;
}

body.light .subscription-period-badge[data-state="active"],
body.light .subscription-period-badge[data-state="grace"],
body.light .subscription-period-badge[data-state="canceled"] {
    color: #15803d;
}

body.light .subscription-period-badge[data-state="trial"] {
    color: #1d4ed8;
}

body.light .subscription-period-badge[data-state="expired"] {
    color: #be123c;
}

@media (max-width: 380px) {

    .subscription-facts-grid,
    .subscription-period-grid,
    .upgrade-current-card {
        grid-template-columns: 1fr;
    }

    .subscription-current-top,
    .pricing-card-top {
        flex-direction: column;
    }

    .subscription-period-divider {
        display: none;
    }
}

/* @media (max-width: 520px) {

    .pricing-sale-banner,
    .subscription-live-head,
    .pricing-countdown-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .countdown-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .countdown-board-compact {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .pricing-price {
        align-items: flex-start;
    }
} */

.stg-action-btn {
    font-size: 12px;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 10px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    background: rgba(139, 92, 246, 0.08);
    color: #a78bfa;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: all 0.15s;
    flex-shrink: 0;
}

.stg-action-btn:active {
    transform: scale(0.94);
}

.stg-check {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.stg-cat-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.stg-cat-tab {
    flex: 1;
    padding: 10px;
    background: var(--surface2);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    font-family: inherit;
}

.stg-cat-tab.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(139, 92, 246, 0.08);
}

.stg-cat-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 8px;
    gap: 10px;
}

.stg-cat-item .sti-ico {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(139, 92, 246, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stg-cat-item .sti-ico svg {
    width: 16px;
    height: 16px;
    stroke: var(--accent);
}

.stg-cat-item .sti-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.stg-cat-item .sti-del {
    width: 28px;
    height: 28px;
    background: rgba(244, 63, 94, 0.1);
    border: none;
    border-radius: 8px;
    color: var(--red);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s;
}

.stg-cat-item .sti-del:active {
    transform: scale(0.9);
}

.stg-legal-text {
    font-size: 14px;
    line-height: 1.7;
    color: var(--muted);
    white-space: pre-wrap;
}

.stg-legal-text p {
    margin-bottom: 10px;
}

.stg-legal-text strong {
    color: var(--text);
}

/* ─── OLD SETTINGS (kept for compatibility) ──── */
.si {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.si:last-of-type {
    border-bottom: none;
}

.si-l {
    font-size: 14px;
    font-weight: 600;
}

.si-s {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.si-a {
    font-size: 12px;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    background: rgba(139, 92, 246, 0.08);
    color: #a78bfa;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: all 0.15s;
}

.si-a:active {
    transform: scale(0.94);
}

.si-i {
    width: 120px;
    background: var(--surface2);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    text-align: right;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

.si-i:focus {
    border-color: var(--accent);
}

.tgl {
    width: 46px;
    height: 28px;
    background: var(--border);
    border-radius: 14px;
    position: relative;
    cursor: pointer;
    transition: background 0.25s;
    flex-shrink: 0;
}

.tgl.on {
    background: var(--accent);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.35);
}

.tgl::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: left 0.25s;
}

.tgl.on::after {
    left: 22px;
}

.dbtn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 8px;
    transition: all 0.15s;
    color: var(--text);
    font-family: inherit;
}

.dbtn:active {
    transform: scale(0.98);
}

.dbtn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
    stroke: var(--muted);
}

.dbtn.red {
    color: var(--red);
}

.dbtn.red svg {
    stroke: var(--red);
}

.pin-rm {
    font-size: 12px;
    color: var(--red);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 0;
    display: none;
    font-family: inherit;
    font-weight: 600;
}

/* ─── CONTEXT MENU ────────────────────────────── */
#ctx-menu {
    position: fixed;
    z-index: 60;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    display: none;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    min-width: 160px;
}

.ctx-i {
    width: 100%;
    padding: 13px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
    transition: background 0.15s;
    font-family: inherit;
}

.ctx-i:hover {
    background: rgba(255, 255, 255, 0.05);
}

.ctx-i svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

.ctx-i.blue {
    color: #60a5fa;
}

.ctx-i.blue svg {
    stroke: #60a5fa;
}

.ctx-i.red {
    color: var(--red);
}

.ctx-i.red svg {
    stroke: var(--red);
}

.ctx-div {
    height: 1px;
    background: var(--border);
}

/* ─── RECEIPT VIEW ────────────────────────────── */
#rec-view {
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(18px + var(--overlay-top-reserve)) 18px calc(18px + var(--overlay-bottom-reserve));
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s;
}

#rec-view.on {
    opacity: 1;
    visibility: visible;
}

.rec-shell {
    width: min(100%, 780px);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rec-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.rec-tool {
    height: 40px;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.rec-tool.primary {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(16, 185, 129, 0.26);
    color: #d1fae5;
}

.rec-tool:disabled {
    opacity: 0.55;
    cursor: wait;
}

.rec-stage {
    position: relative;
    min-height: min(520px, max(220px, calc(var(--overlay-max-height) - 92px)));
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 15, 26, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.rec-loader,
.rec-error {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

#rec-img {
    max-width: 100%;
    max-height: min(720px, max(220px, calc(var(--overlay-max-height) - 120px)));
    object-fit: contain;
    border-radius: 18px;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: scale(0.985);
}

#rec-view[data-state="ready"] #rec-img {
    opacity: 1;
    transform: scale(1);
}

/* ─── LOADER ──────────────────────────────────── */
#loader {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    transition: opacity 0.4s;
}

#loader.out {
    opacity: 0;
    pointer-events: none;
}

.spin {
    width: 40px;
    height: 40px;
    border: 3px solid var(--surface2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.2);
}

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

#loader p {
    font-size: 14px;
    color: var(--muted);
    transition: opacity 0.3s, transform 0.3s;
}

#loader p.fade {
    opacity: 0;
    transform: translateY(-5px);
}

/* ─── ERROR BAR ───────────────────────────────── */
#err-bar {
    display: none;
    position: fixed;
    top: 16px;
    left: 0;
    right: 0;
    transform: translateY(15px);
    z-index: 99;
    margin: 0 auto;
    width: 90%;
    background: rgba(63, 244, 81, 0.08);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(96, 244, 63, 0.25);
    border-radius: 16px;
    padding: 14px 18px 14px 44px;
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
    box-shadow:
        0 10px 25px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    animation: popIn 0.3s ease;
}

/* ─── EXPORT MODAL ────────────────────────────── */
.exp-s {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.exp-s:last-child {
    border-bottom: none;
}

.exp-s span:last-child {
    font-weight: 700;
}

/* ─── SCROLLBAR ───────────────────────────────── */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

::-webkit-scrollbar {
    width: 3px;
    height: 3px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

/* ─── LIGHT THEME ─────────────────────────────── */
body.light {
    --bg: #f0f2f8;
    --surface: #ffffff;
    --surface2: #f0f2f8;
    --border: rgba(0, 0, 0, 0.08);
    --text: #111827;
    --muted: #6b7280;
    background-image: none;
}

body.light .balance-card {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-color: transparent;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
}

body.light .bc-amount {
    -webkit-text-fill-color: #fff;
    background: none;
}

body.light #nav {
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

body.light .nb {
    color: #64748b;
}

body.light .nb.active {
    color: var(--accent);
}


body.light .section-hero,
body.light .split-stat-card,
body.light .roadmap-card,
body.light .empty-route-ico,
body.light .hero-pill {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(15, 23, 42, 0.08);
}

body.light .section-eyebrow,
body.light .hero-pill,
body.light .split-stat-top,
body.light .split-stat-card small,
body.light .roadmap-card p,
body.light .empty-route-state p {
    color: #64748b;
}

body.light #pin-screen {
    background: #f8fafc;
    background-image: none;
}

body.light .header-title {
    -webkit-text-fill-color: #0f172a;
    background: none;
}

body.light .io {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.05);
}

body.light .io:hover {
    background: rgba(0, 0, 0, 0.06);
}

body.light .sh-close {
    background: rgba(0, 0, 0, 0.05);
    color: #64748b;
}

body.light .sh-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #0f172a;
}

body.light .sheet {
    background: #ffffff;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

body.light .sh-ttl {
    color: #0f172a;
}

body.light .stg-group {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.06);
}

body.light .stg-item {
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

body.light .stg-item:active {
    background: rgba(99, 102, 241, 0.05);
}

body.light .stg-txt {
    color: #1e293b;
}

body.light .stg-name {
    color: #0f172a;
}

body.light .stg-sub-info {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.06);
    border-color: rgba(99, 102, 241, 0.15);
}

body.light .stg-badge {
    color: #6366f1;
    background: rgba(99, 102, 241, 0.06);
    border-color: rgba(99, 102, 241, 0.15);
}

body.light .stg-cat-tab {
    background: #f8fafc;
    border-color: rgba(0, 0, 0, 0.08);
    color: #64748b;
}

body.light .stg-cat-tab.active {
    background: rgba(99, 102, 241, 0.06);
    border-color: #6366f1;
    color: #6366f1;
}

body.light .stg-cat-item {
    background: #f8fafc;
    border-color: rgba(0, 0, 0, 0.06);
}

body.light .stg-legal-text {
    color: #475569;
}

body.light .stg-legal-text strong {
    color: #0f172a;
}

body.light .stg-action-btn {
    background: rgba(99, 102, 241, 0.06);
    border-color: rgba(99, 102, 241, 0.2);
    color: #6366f1;
}

/* ─── PAGINATION ──────────────────────────────── */
.load-more-s {
    display: flex;
    justify-content: center;
    padding: 24px;
    width: 100%;
}

.spin.small {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

/* ─── DYNAMIC FONT SIZES ──────────────────────── */
.bc-amount.sm {
    font-size: 34px;
    letter-spacing: -1px;
}

.bc-amount.xs {
    font-size: 28px;
    letter-spacing: -0.8px;
}

.bc-amount.xxs {
    font-size: 22px;
    letter-spacing: -0.5px;
}

/* ─── EXPORT MODAL ENHANCED ───────────────────── */
.exp-modal {
    max-width: min(100%, 560px);
    background:
        radial-gradient(circle at top right, rgba(139, 92, 246, 0.16), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(7, 8, 14, 0.96));
    border-color: rgba(255, 255, 255, 0.09);
}

.exp-hint {
    margin: 10px 0 16px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--muted);
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
}

.exp-presets {
    display: flex;
    gap: 8px;
    margin: 0 0 14px;
    flex-wrap: wrap;
}

.exp-chip {
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--text);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.18s ease;
}

.exp-chip.active {
    border-color: rgba(124, 58, 237, 0.45);
    background: rgba(124, 58, 237, 0.16);
    color: #ddd6fe;
}

.exp-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.exp-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0;
}

.exp-card {
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02));
    border-radius: 16px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.exp-card.wide {
    grid-column: 1 / -1;
}

.exp-card.income strong {
    color: var(--green);
}

.exp-card.expense strong {
    color: var(--red);
}

.exp-card.balance strong {
    color: var(--accent2);
}

.exp-label {
    font-size: 12px;
    color: var(--muted);
}

.exp-card strong {
    font-size: 16px;
    line-height: 1.25;
}

.exp-meta {
    margin: 0 0 14px;
    padding: 0 14px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.025);
}

.exp-s {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.exp-s:last-child {
    border-bottom: none;
}

.exp-s span:last-child {
    font-weight: 700;
    text-align: right;
    word-break: break-word;
}

@media (max-width: 520px) {

    .exp-grid,
    .exp-cards {
        grid-template-columns: 1fr;
    }
}


/* ===== Feature upgrade: debts, plans, category manager ===== */
.route-list {
    display: grid;
    gap: 12px;
}

.route-item {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .03);
    border-radius: 18px;
    padding: 14px;
    display: grid;
    gap: 10px;
}

.route-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.route-item-title {
    font-size: 15px;
    font-weight: 800;
}

.route-item-sub {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.route-item-amount {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.route-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.route-badge {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .04);
}

.route-badge.good {
    color: #34d399;
    background: rgba(16, 185, 129, .12);
    border-color: rgba(16, 185, 129, .25);
}

.route-badge.warn {
    color: #fbbf24;
    background: rgba(245, 158, 11, .12);
    border-color: rgba(245, 158, 11, .25);
}

.route-badge.danger {
    color: #fb7185;
    background: rgba(244, 63, 94, .12);
    border-color: rgba(244, 63, 94, .25);
}

.route-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.route-action {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .04);
    color: var(--text);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 700;
}

.route-action.primary {
    background: linear-gradient(180deg, rgba(124, 58, 237, .3), rgba(109, 40, 217, .18));
    border-color: rgba(167, 139, 250, .3);
}

.route-action.danger {
    color: #fb7185;
}

.debt-modal textarea {
    width: 100%;
    resize: vertical;
    min-height: 84px;
    background: var(--bg-soft);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    font: inherit;
}

.plan-progress {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
    overflow: hidden;
}

.plan-progress>span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #8b5cf6, #22c55e);
}

.plan-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.plan-stat {
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 14px;
    padding: 10px;
    background: rgba(255, 255, 255, .03);
}

.plan-stat-label {
    display: block;
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 6px;
}

.plan-stat-value {
    display: block;
    font-size: 13px;
    font-weight: 800;
}

.stg-cat-card {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .03);
    border-radius: 18px;
    padding: 14px;
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.stg-cat-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.stg-cat-main {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    min-width: 0;
}

.stg-cat-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(180deg, rgba(124, 58, 237, .45), rgba(59, 130, 246, .2));
    border: 1px solid rgba(167, 139, 250, .2);
    flex: 0 0 auto;
}

.stg-cat-icon svg {
    width: 20px;
    height: 20px;
}

.stg-cat-meta {
    min-width: 0;
}

.stg-cat-name {
    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
}

.stg-cat-keywords {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.45;
    margin-top: 4px;
    word-break: break-word;
}

.stg-cat-usage {
    font-size: 11px;
    color: var(--muted);
    margin-top: 6px;
}

.stg-cat-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.stg-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, .04);
    color: var(--text);
    display: grid;
    place-items: center;
}

.stg-icon-btn.danger {
    color: #fb7185;
}

#edit-icon-grid,
#icon-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.settings-feature-live .stg-badge {
    display: none !important;
}

/* @media (max-width: 380px) {

    .route-item-top,
    .stg-cat-row {
        flex-direction: column;
    }

    .stg-cat-actions {
        width: 100%;
    }

    .stg-icon-btn {
        flex: 1;
    }

    .plan-stats {
        grid-template-columns: 1fr;
    }
} */

/* ===== v1.2 visual refresh ===== */
:root {
    --bg: #0a0d12;
    --surface: rgba(14, 17, 24, 0.88);
    --surface2: rgba(19, 24, 34, 0.92);
    --border: rgba(255, 255, 255, 0.08);
    --accent: #f1b93b;
    --accent-glow: rgba(241, 185, 59, 0.32);
    --green: #3ddc97;
    --red: #ff667d;
    --text: #f3f5f7;
    --muted: #9ea9bb;
    --r: 18px;
    --nav: 72px;
    --nav-bottom: 10px;
}

html,
body {
    background:
        radial-gradient(circle at 14% 8%, rgba(255, 193, 59, 0.22), transparent 23%),
        radial-gradient(circle at 87% 18%, rgba(65, 212, 160, 0.16), transparent 18%),
        radial-gradient(circle at 50% 100%, rgba(104, 67, 201, 0.18), transparent 26%),
        linear-gradient(180deg, #0a0d12 0%, #0b0f16 38%, #090c11 100%);
}

#app {
    max-width: 420px;
}

.view {
    gap: 10px;
    padding: 10px 14px calc(var(--nav) + var(--nav-bottom) + var(--safe-bottom) + 18px);
}

.header-logo {
    width: 42px;
    height: 42px;
    min-width: 42px;
    background: linear-gradient(135deg, rgba(241, 185, 59, 0.24), rgba(255, 255, 255, 0.06));
    border-color: rgba(241, 185, 59, 0.24);
    box-shadow: 0 10px 26px rgba(241, 185, 59, 0.12);
}

.header-title {
    font-size: 16px;
    -webkit-text-fill-color: transparent;
}

.header-sub {
    font-size: 10px;
}

.header-btn {
    width: 36px;
    height: 36px;
    border-radius: 13px;
}

#nav {
    left: 12px;
    right: 12px;
    height: var(--nav);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(11, 13, 20, 0.96), rgba(13, 16, 25, 0.9));
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.nav-five .nb {
    gap: 3px;
    padding: 6px 4px;
}

.nav-five .nb svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.9;
}

.nav-five .nb span {
    font-size: 9px;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.nav-five .nb-add-main {
    flex: 0 0 70px;
}

.add-ring,
.add-ring-smaller {
    background: linear-gradient(135deg, #efb43b, #d85eff 84%);
    box-shadow: 0 16px 36px rgba(216, 94, 255, 0.22), 0 10px 28px rgba(239, 180, 59, 0.18);
    width: 48px;
    height: 48px;
    border: 5px solid var(--bg);
}

.add-btn-txt-five {
    font-size: 9px;
}

.balance-card,
.section-hero,
.panel,
.route-item,
.stg-group,
.stg-cat-card,
.roadmap-card,
.split-stat-card {
    background: linear-gradient(180deg, rgba(17, 21, 30, 0.96), rgba(12, 16, 24, 0.9));
    border-color: rgba(255, 255, 255, 0.07);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.balance-card {
    padding: 22px 18px 18px;
    border-radius: 26px;
    border-color: rgba(241, 185, 59, 0.14);
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.balance-card::before {
    top: -36px;
    right: -30px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(65, 212, 160, 0.22), transparent 68%);
}

.balance-card::after {
    bottom: -30px;
    left: -10px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(241, 185, 59, 0.22), transparent 68%);
}

.bc-label,
.panel-ttl {
    font-size: 10px;
    letter-spacing: 1.1px;
}

.bc-amount {
    font-size: 36px;
    background: linear-gradient(135deg, #ffffff 0%, #f6d879 42%, #95e3bf 100%);
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bc-pills {
    margin-top: 8px;
}

.cpill {
    font-size: 9px;
    padding: 4px 10px;
}

.cpill.on {
    background: rgba(241, 185, 59, 0.18);
    border-color: rgba(241, 185, 59, 0.26);
    box-shadow: 0 0 16px rgba(241, 185, 59, 0.14);
    color: #f8df8e;
}

.bc-row {
    gap: 18px;
    margin-top: 16px;
    padding-top: 14px;
}

.bcs-lbl,
.tc-ttl,
.route-item-sub,
.plan-stat-label,
.stg-cat-usage,
.stg-cat-keywords,
.section-hero p,
.split-stat-card small,
.roadmap-card p,
.empty-route-state p,
.panel-head-meta {
    font-size: 11px;
}

.bcs-val,
.tc-sub,
.route-item-title,
.stg-cat-name {
    font-size: 13px;
}

.bcs-ico,
.tc-ico {
    width: 34px;
    height: 34px;
}

.type-cards {
    gap: 8px;
}

.tc {
    border-radius: 18px;
    padding: 13px;
}

.filter-row {
    gap: 7px;
}

.fp {
    padding: 7px 12px;
    font-size: 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
}

.fp.on {
    background: rgba(241, 185, 59, 0.14);
    color: #f7d67f;
    border-color: rgba(241, 185, 59, 0.26);
}

.section-hero {
    padding: 16px;
    border-radius: 24px;
}

.section-eyebrow {
    padding: 5px 9px;
    font-size: 10px;
    margin-bottom: 10px;
}

.section-hero h2 {
    font-size: 22px;
    margin-bottom: 6px;
}

.hero-pill {
    min-height: 38px;
    border-radius: 14px;
    padding: 10px 12px;
    font-size: 11px;
}

.hero-pill-strong {
    background: linear-gradient(135deg, rgba(241, 185, 59, 0.18), rgba(65, 212, 160, 0.08));
    border-color: rgba(241, 185, 59, 0.22);
    color: #f7f4ea;
}

.hero-action-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 132px;
}

.compact-two-up {
    gap: 10px;
}

.compact-stat {
    padding: 14px;
    border-radius: 20px;
}

.compact-stat strong {
    font-size: 16px;
}

.mini-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.mini-stat-card {
    border-radius: 18px;
    padding: 12px 13px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: linear-gradient(180deg, rgba(18, 23, 33, 0.94), rgba(13, 17, 24, 0.92));
    display: grid;
    gap: 6px;
}

.mini-stat-card.wide {
    grid-column: span 2;
}

.mini-stat-card span {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.mini-stat-card strong {
    font-size: 15px;
    line-height: 1.2;
}

.mini-stat-card.accent strong {
    color: #f8d77f;
}

.mini-stat-card.positive strong {
    color: var(--green);
}

.mini-stat-card.danger strong {
    color: var(--red);
}

.route-filter-wrap {
    display: grid;
    gap: 8px;
}

.muted-row .fp {
    background: rgba(255, 255, 255, 0.025);
}

.route-panel-tight {
    padding: 14px;
    border-radius: 22px;
}

.panel-head-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.panel-head-inline .panel-ttl {
    margin-bottom: 0;
}

.panel-head-meta {
    color: var(--muted);
    font-weight: 700;
}

.route-list {
    gap: 10px;
}

.route-item {
    padding: 12px;
    border-radius: 18px;
    gap: 9px;
}

.route-item-amount {
    font-size: 16px;
}

.route-badges {
    gap: 6px;
}

.route-badge {
    padding: 5px 9px;
    font-size: 10px;
}

.route-actions {
    gap: 6px;
}

.route-action {
    padding: 9px 11px;
    border-radius: 12px;
    font-size: 11px;
}

.debt-route-item-overdue,
.plan-route-item-danger {
    border-color: rgba(255, 102, 125, 0.28);
    box-shadow: 0 18px 38px rgba(255, 102, 125, 0.06);
}

.plan-progress {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
}

.plan-progress>span {
    background: linear-gradient(90deg, #41d4a0, #efb43b 54%, #d85eff 100%);
}

.plan-stats {
    gap: 8px;
}

.plan-stat {
    padding: 9px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.025);
}

.stg-group {
    border-radius: 22px;
}

.stg-item {
    min-height: 58px;
}

.stg-action-btn,
.stg-badge {
    font-size: 11px;
    min-width: 96px;
}

.stg-cat-card {
    padding: 12px;
}

.stg-cat-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(241, 185, 59, 0.18), rgba(65, 212, 160, 0.12));
    border-color: rgba(241, 185, 59, 0.16);
}

.debt-modal-v12 .fld.two-col-grid,
.plan-modal-v12 .fld.two-col-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.debt-hint {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.5;
    margin-top: -4px;
}

.debt-modal-v12 textarea,
.plan-modal-v12 textarea {
    min-height: 80px;
}

/* @media (max-width: 390px) {

    .mini-stats-grid,
    .debt-modal-v12 .fld.two-col-grid,
    .plan-modal-v12 .fld.two-col-grid,
    .plan-stats {
        grid-template-columns: 1fr;
    }

    .mini-stat-card.wide {
        grid-column: span 1;
    }

    .hero-action-stack {
        width: 100%;
    }
} */

/* ===== v1.2.1 polish moved to /public/theme.css ===== */

.compact-grid {
    align-items: end;
}

.inline-note {
    min-height: 48px;
    display: grid;
    place-items: center start;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.035);
    color: var(--muted);
    font-size: 11px;
    line-height: 1.4;
}

.segmented {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.seg-btn {
    min-height: 46px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.16s ease;
}

.seg-btn.active {
    background: rgba(var(--accent-rgb), 0.14);
    border-color: rgba(var(--accent-rgb), 0.30);
    color: var(--accent-contrast);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.quick-chip-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 2px 0 10px;
}

.quick-chip {
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s ease;
}

.quick-chip.active,
.quick-chip:hover {
    background: rgba(var(--accent-rgb), 0.14);
    border-color: rgba(var(--accent-rgb), 0.28);
    color: var(--accent-contrast);
}

.plan-option-stack {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.plan-option-card,
.debt-form-card {
    position: relative;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.03);
}

.plan-option-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.plan-option-head strong,
.plan-option-copy strong {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: var(--text);
}

.plan-option-head small,
.plan-option-copy small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.checkbox-card {
    cursor: pointer;
    user-select: none;
}

.checkbox-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checkbox-mark {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    margin-top: 2px;
    border-radius: 7px;
    border: 1.5px solid rgba(var(--accent-rgb), 0.24);
    background: rgba(255, 255, 255, 0.03);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: all 0.15s ease;
    position: relative;
}

.checkbox-mark::after {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 4px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    opacity: 0;
    transform: scale(0.7);
    transition: all 0.15s ease;
}

.checkbox-card input:checked+.checkbox-mark {
    border-color: rgba(var(--accent-rgb), 0.45);
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.08);
}

.checkbox-card input:checked+.checkbox-mark::after {
    opacity: 1;
    transform: scale(1);
}

.plan-option-copy {
    min-width: 0;
}

.debt-datetime-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.debt-state-note {
    min-height: 48px;
}

.debt-hint {
    margin-top: 0;
    background: rgba(var(--accent-rgb), 0.06);
    border: 1px solid rgba(var(--accent-rgb), 0.14);
    border-radius: 14px;
    padding: 10px 12px;
}


/* ===== v1.2.2 debt reconstruction ===== */
.debt-toolkit {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.debt-search-shell,
.debt-filter-shell,
.debt-spotlight,
.debt-card,
.debt-glance-item {
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.035);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
}

.debt-search-shell {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) 26px;
    align-items: center;
    gap: 10px;
    border-radius: 18px;
    padding: 0 14px;
    min-height: 54px;
}

.debt-search-shell svg {
    width: 18px;
    height: 18px;
    color: var(--muted);
}

.debt-search-shell input {
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 13px;
}

.debt-search-shell input::placeholder {
    color: var(--muted);
}

.debt-search-clear {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font: inherit;
    cursor: pointer;
    opacity: .55;
}

.debt-filter-shell {
    padding: 12px;
    border-radius: 20px;
}

.debt-route-panel {
    margin-top: 14px;
}

.debt-panel-head {
    align-items: start;
    gap: 12px;
}

.panel-head-sub {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.debt-list-v2 {
    display: grid;
    gap: 16px;
}

.debt-list-section {
    display: grid;
    gap: 10px;
}

.debt-list-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 2px;
}

.debt-list-section-head h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 900;
    color: var(--text);
}

.debt-list-section-head span {
    min-width: 28px;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.12);
    border: 1px solid rgba(var(--accent-rgb), 0.22);
    font-size: 12px;
    font-weight: 800;
}

.debt-card-stack {
    display: grid;
    gap: 12px;
}

.debt-card {
    border-radius: 22px;
    padding: 16px;
    display: grid;
    gap: 12px;
}

.debt-card-collapsible {
    padding: 0;
    overflow: hidden;
}

.debt-card-summary {
    list-style: none;
    cursor: pointer;
    padding: 16px;
    display: grid;
    gap: 10px;
}

.debt-card-summary::-webkit-details-marker {
    display: none;
}

.debt-card-summary-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.debt-card-summary-tail {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.debt-card-chevron {
    color: var(--muted);
    font-size: 14px;
    font-weight: 900;
    transition: transform .2s ease;
}

.debt-card-collapsible[open] .debt-card-chevron {
    transform: rotate(180deg);
}

.debt-card-summary-sub {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.debt-summary-meta {
    font-size: 11px;
    font-weight: 800;
    color: var(--muted);
}

.debt-summary-meta.warn {
    color: #f7c76f;
}

.debt-summary-meta.good {
    color: #23d6a0;
}

.debt-summary-meta.danger {
    color: #ff5d7c;
}

.debt-card-details {
    padding: 0 16px 16px;
    display: grid;
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, .06);
}

.debt-card.is-overdue {
    border-color: rgba(255, 88, 117, 0.22);
    box-shadow: 0 16px 34px rgba(87, 15, 27, 0.22);
}

.debt-card.is-paid {
    opacity: .94;
}

.debt-card-top {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
}

.debt-card-person-wrap {
    min-width: 0;
}

.debt-card-person {
    font-size: 16px;
    font-weight: 900;
    color: var(--text);
}

.debt-card-note {
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.debt-card-amount {
    text-align: right;
    font-size: 17px;
    font-weight: 900;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.debt-card-amount.is-positive {
    color: #23d6a0;
}

.debt-card-amount.is-negative {
    color: #ff5d7c;
}

.debt-card-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.debt-glance-item {
    border-radius: 16px;
    padding: 12px;
    display: grid;
    gap: 5px;
}

.debt-glance-item span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.debt-glance-item strong {
    color: var(--text);
    font-size: 12px;
    font-weight: 900;
    line-height: 1.45;
}

.debt-card-badges {
    gap: 8px;
}

.debt-card-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.debt-card-actions .route-action {
    justify-content: center;
    min-height: 40px;
}

.debt-modal-v13 {
    width: min(560px, calc(100vw - 20px));
    max-height: min(900px, max(260px, var(--overlay-max-height)));
    overflow: auto;
    padding: calc(18px + var(--sheet-safe-top)) 18px calc(18px + var(--overlay-bottom-reserve));
}

.debt-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.debt-sheet-close {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    cursor: pointer;
    font: inherit;
    font-size: 16px;
}

.debt-spotlight {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border-radius: 20px;
    margin-bottom: 14px;
}

.debt-spotlight strong {
    display: block;
    color: var(--text);
    font-size: 14px;
    font-weight: 900;
}

.debt-spotlight small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.debt-spotlight-badge {
    height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--accent-rgb), 0.14);
    border: 1px solid rgba(var(--accent-rgb), 0.26);
    color: var(--accent);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.debt-form-grid {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 12px;
}

.debt-form-block {
    display: grid;
    gap: 12px;
}

.debt-inline-field {
    margin: 0;
}

.debt-form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 18px;
}

.debt-form-actions .bcl,
.debt-form-actions .bpri {
    width: 100%;
}

/* @media (max-width: 720px) {

    .debt-form-grid,
    .debt-datetime-grid,
    .debt-card-meta-grid,
    .debt-card-actions,
    .segmented {
        grid-template-columns: 1fr;
    }

    .debt-card-top,
    .debt-spotlight,
    .debt-panel-head,
    .debt-card-summary-main,
    .plan-progress-head,
    .plan-card-summary .route-item-top {
        grid-template-columns: 1fr;
        display: grid;
    }

    .debt-card-amount,
    .plan-progress-head span,
    .plan-card-summary-tail {
        text-align: left;
    }

    .plan-card-summary-tail {
        justify-content: space-between;
    }
} */

/* ===== v1.2.3 mobile full-screen modals + compact plans ===== */
.plan-card-collapsible {
    padding: 0;
    overflow: hidden;
}

.plan-card-summary {
    list-style: none;
    cursor: pointer;
    padding: 18px;
    display: grid;
    gap: 12px;
}

.plan-card-summary::-webkit-details-marker {
    display: none;
}

.plan-card-summary-tail {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.plan-card-chevron {
    color: var(--muted);
    font-size: 14px;
    font-weight: 900;
    transition: transform .2s ease;
}

.plan-card-collapsible[open] .plan-card-chevron {
    transform: rotate(180deg);
}

.plan-card-details {
    padding: 0 18px 18px;
    display: grid;
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, .06);
}

/* ===== v1.2.3 mobile full-screen modals + compact plans ===== */
.plan-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 2px;
}

.plan-progress-head strong {
    font-size: 12px;
    font-weight: 900;
    color: var(--text);
}

.plan-progress-head span {
    font-size: 12px;
    color: var(--muted);
    text-align: right;
}

.plan-stats.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* @media (max-width: 720px) {

    #ov-plan-form .sheet,
    #ov-export .sheet,
    #ov-debt-form .sheet,
    #ov-addcat .sheet {
        width: calc(100vw - 10px - var(--app-side-left-reserve) - var(--app-side-right-reserve));
        max-width: none;
        min-height: max(320px, var(--overlay-max-height));
        max-height: max(320px, var(--overlay-max-height));
        margin-top: auto;
        border-radius: 26px 26px 0 0;
        padding-bottom: calc(34px + var(--app-bottom-reserve));
    }

    #ov-export.ov.center,
    #ov-debt-form.ov.center {
        align-items: flex-end;
        padding: calc(8px + var(--overlay-top-reserve)) calc(8px + var(--app-side-right-reserve)) var(--overlay-bottom-reserve) calc(8px + var(--app-side-left-reserve));
    }

    #ov-export .sheet.c,
    #ov-debt-form .sheet.c {
        transform: translateY(100%);
        opacity: 1;
        border-radius: 26px 26px 0 0;
        box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
    }

    #ov-export.ov.on .sheet.c,
    #ov-debt-form.ov.on .sheet.c {
        transform: translateY(0);
    }

    .plan-stats.compact {
        grid-template-columns: 1fr;
    }
} */

.sheet-scroll-dialog {
    max-height: min(560px, max(220px, var(--overlay-max-height))) !important;
    overflow-y: auto !important;
}