/* ===== ROOT VARIABLES ===== */
:root {
    --bg-primary: #f5f7fb;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --border-color: #eef2ff;
    --shadow-sm: 0 8px 20px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 8px 22px rgba(0,0,0,.08);
    --tab-bg: #ffffff;
    --tab-inactive: #64748b;
    --tab-active: #f59e0b;
    --gradient-start: #fbbf24;
    --gradient-end: #f59e0b;
    --skeleton-bg: #e2e8f0;
    --sidebar-width: 280px;
    --container-max: 760px;
    --header-height: 64px;
    --radius-card: 20px;
    --radius-btn: 40px;
    --transition: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-smooth: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #a1a1aa;
    --border-color: #334155;
    --shadow-sm: 0 8px 20px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 10px 28px rgba(0,0,0,.24);
    --tab-bg: #1e293b;
    --tab-inactive: #94a3b8;
    --tab-active: #f59e0b;
    --skeleton-bg: #334155;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
}
input,
textarea {
    user-select: text;
    -webkit-user-select: text;
}

body {
    font-family: 'IRANSansXFaNum', 'Segoe UI Emoji', 'Apple Color Emoji', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: background 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--tab-active);
    border-radius: 10px;
    transition: background 0.3s;
}
::-webkit-scrollbar-thumb:hover {
    background: #d97706;
}

/* ============================================================
   SIDEBAR OVERLAY
   ============================================================ */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}
.sidebar-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(300px, 85vw);
    height: 100%;
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    z-index: 950;
    display: flex;
    flex-direction: column;
    transition: right 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.12);
    overflow-y: auto;
    overscroll-behavior: contain;
}
.sidebar.open {
    right: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    flex-shrink: 0;
}
.sidebar-logo {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s, transform 0.25s;
    flex-shrink: 0;
}
.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: rotate(90deg);
}

/* ---- User Panel ---- */
.user-panel {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    flex-wrap: wrap;
}
.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--tab-active);
    flex-shrink: 0;
}
.user-info {
    flex: 1;
    min-width: 60px;
}
.user-name {
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1.3;
}
.user-status {
    font-size: 0.7rem;
    color: var(--text-secondary);
}
.user-login-btn {
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid var(--tab-active);
    background: transparent;
    color: var(--tab-active);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
    white-space: nowrap;
}
.user-login-btn:hover {
    background: var(--tab-active);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

/* ---- Sidebar Nav ---- */
.sidebar-nav {
    padding: 8px 0;
    flex: 1;
    overflow-y: auto;
}
.nav-section-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 10px 18px 4px;
    margin-top: 4px;
    opacity: 0.7;
}
.nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    transition: transform 0.25s ease, opacity 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
    border-radius: 12px;
    margin: 2px 8px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
    gap: 6px;
    position: relative;
}
.nav-item::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: var(--tab-active);
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}
.nav-item:hover::after {
    opacity: 0.05;
    transform: scale(1);
}
.nav-item:hover {
    color: var(--tab-active);
}
.nav-item.active {
    background: rgba(245, 158, 11, 0.12);
    color: var(--tab-active);
}
.nav-item.active::after {
    opacity: 0.08;
    transform: scale(1);
}

.nav-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    position: relative;
    z-index: 1;
}
.nav-item-icon {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--tab-active);
    transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
}
.nav-item:hover .nav-item-icon,
.nav-item.active .nav-item-icon {
    background: var(--tab-active);
    color: #fff;
    transform: scale(1.05) rotate(-3deg);
}
.nav-chevron {
    font-size: 0.65rem;
    color: var(--text-secondary);
    transition: transform 0.4s ease;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}
.nav-item.expanded .nav-chevron {
    transform: rotate(90deg);
}

/* Sub-menu */
.sub-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease;
    opacity: 0;
}
.sub-menu.open {
    max-height: 320px;
    opacity: 1;
}
.sub-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 20px;
    margin: 2px 8px 2px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text-secondary);
    transition: transform 0.25s ease, opacity 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
    font-weight: 500;
    position: relative;
}
.sub-nav-item::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    background: var(--tab-active);
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}
.sub-nav-item:hover::after {
    opacity: 0.06;
    transform: scale(1);
}
.sub-nav-item:hover {
    color: var(--tab-active);
}
.sub-nav-item.active {
    color: var(--tab-active);
    background: rgba(245, 158, 11, 0.08);
}
.sub-nav-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border-color);
    transition: background 0.3s, transform 0.3s;
    flex-shrink: 0;
}
.sub-nav-item:hover .sub-nav-dot,
.sub-nav-item.active .sub-nav-dot {
    background: var(--tab-active);
    transform: scale(1.4);
}

.sidebar-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--border-color);
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-align: center;
    flex-shrink: 0;
    line-height: 1.5;
}

/* ============================================================
   PAGE VIEWS
   ============================================================ */
.page-view {
    display: none;
    animation:fadeSlideUp .22s ease forwards;
}
.page-view.active {
    display: block;
}

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

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.page-wrapper {
    padding: 16px 12px 40px;
    min-height: 100vh;
}
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding-inline: 20px;
}

/* ============================================================
   HEADER
   ============================================================ */
header {
    margin-bottom: 20px;
}
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 8px;
    flex-wrap: wrap;
}
.header-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}
.theme-toggle,
.sidebar-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--text-primary);
    transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
    position: relative;
    overflow: hidden;
}
.theme-toggle::after,
.sidebar-toggle::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50px;
    background: var(--tab-active);
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s, transform 0.3s;
}
.theme-toggle:hover::after,
.sidebar-toggle:hover::after {
    opacity: 0.08;
    transform: scale(1);
}
.theme-toggle:hover {
    transform: rotate(20deg) scale(1.05);
    border-color: var(--tab-active);
}
.sidebar-toggle:hover {
    transform: scale(1.05);
    border-color: var(--tab-active);
}

h1 {
    font-size: clamp(1.3rem, 4vw, 1.9rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
h1 i {
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    color: #f59e0b;
    font-size: clamp(1.1rem, 3vw, 1.6rem);
    animation: pulseIcon 3s ease-in-out infinite;
}
@keyframes pulseIcon {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.refresh-btn {
    background: var(--tab-active);
    color: #fff;
    border: none;
    padding: 7px 16px;
    border-radius: var(--radius-btn);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}
.refresh-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-btn);
    background: rgba(255, 255, 255, 0.2);
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.3s, transform 0.3s;
}
.refresh-btn:hover::after {
    opacity: 1;
    transform: translateY(0);
}
.refresh-btn:hover {
    background: #d97706;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.3);
}
.refresh-btn:active {
    transform: scale(0.96);
}
.refresh-btn i {
    transition: transform 0.5s ease;
}
.refresh-btn:hover i {
    transform: rotate(180deg);
}

.update-badge {
    background: var(--bg-secondary);
    padding: 5px 12px;
    border-radius: var(--radius-btn);
    font-size: 0.7rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.update-badge i {
    animation: spinSlow 8s linear infinite;
}
@keyframes spinSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================================
   BANNER AD
   ============================================================ */
.banner-ad-wrapper {
    margin-bottom: 20px;
    border-radius: var(--radius-card);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: box-shadow 0.4s ease, transform 0.4s ease;
    background: var(--bg-card);
    aspect-ratio: 16 / 4.5;
    width: 100%;
}
.banner-ad-wrapper:hover {
    box-shadow: 0 10px 40px rgba(245, 158, 11, 0.18);
    transform: translateY(-3px);
}
.banner-ad-wrapper a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}
.banner-ad-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
    border-radius: var(--radius-card);
}
.banner-ad-wrapper:hover img {
    transform: scale(1.02);
}

.banner-ad-placeholder {
    background: var(--bg-card);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-card);
    padding: 16px 20px;
    text-align: center;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    transition: border-color 0.3s, background 0.3s;
}
.banner-ad-placeholder:hover {
    border-color: var(--tab-active);
    background: rgba(245, 158, 11, 0.03);
}
.banner-ad-placeholder p {
    font-size: clamp(0.85rem, 2vw, 1rem);
    font-weight: 600;
    margin: 0;
}
.banner-ad-placeholder .sub {
    font-size: clamp(0.7rem, 1.5vw, 0.85rem);
    margin-top: 4px;
}
.banner-ad-placeholder a {
    color: var(--tab-active);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s;
}
.banner-ad-placeholder a:hover {
    text-decoration: underline;
    color: #d97706;
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    background: var(--tab-bg);
    padding: 4px;
    border-radius: 60px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    flex: 1 0 auto;
    background: transparent;
    border: none;
    padding: 10px 12px;
    font-size: clamp(0.75rem, 1.8vw, 0.9rem);
    font-weight: 600;
    border-radius: 40px;
    cursor: pointer;
    transition: transform 0.35s ease, opacity 0.35s ease, background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease, box-shadow 0.35s ease;
    color: var(--tab-inactive);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    min-width: 56px;
    position: relative;
}
.tab-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 40px;
    background: var(--tab-active);
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.3s, transform 0.3s;
}
.tab-btn:hover::after {
    opacity: 0.06;
    transform: scale(1);
}
.tab-btn i {
    font-size: clamp(0.85rem, 2vw, 1rem);
    transition: transform 0.3s;
}
.tab-btn:hover i {
    transform: translateY(-2px);
}
.tab-btn.active {
    background: var(--tab-active);
    color: #fff;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
    transform: translateY(-1px);
}
.tab-btn.active i {
    transform: none;
}

.tab-content {
    display: none;
    animation:fadeSlideUp .20s ease forwards;
}
.tab-content.active {
    display: block;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    padding: clamp(14px, 2.5vw, 22px);
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform 0.4s ease, opacity 0.4s ease, background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease, box-shadow 0.4s ease;
    position: relative;
    overflow: hidden;
}
.card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 0;
    background: linear-gradient(180deg, var(--gradient-start), var(--gradient-end));
    border-radius: 0 0 4px 0;
    transition: height 0.5s ease;
}
.card:hover::before {
    height: 100%;
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.card h2 {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    font-weight: 600;
    border-right: 4px solid var(--tab-active);
    padding-right: 10px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card h2 i {
    color: var(--tab-active);
    font-size: clamp(0.95rem, 2vw, 1.2rem);
}

/* ============================================================
   PRICE ITEMS
   ============================================================ */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.price-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    padding: 8px 4px;
    border-bottom: 1px dashed var(--border-color);
    transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
    gap: 4px 8px;
    border-radius: 10px;
    min-height: 42px;
}
.price-item:hover {
    background: var(--bg-primary);
        border-bottom-color: transparent;
    transform: translateX(-4px);
}
.item-name {
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: clamp(0.82rem, 1.6vw, 0.95rem);
}
.item-price {
    font-weight: 700;
    color: var(--text-primary);
    direction: ltr;
    font-size: clamp(0.82rem, 1.6vw, 0.95rem);
    text-align: left;
}

.item-change,
.currency-change {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 600;
    transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}
.change-up {
    color: #10b981 !important;
    background: rgba(16, 185, 129, 0.15) !important;
}
.change-down {
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.15) !important;
}
.change-stable {
    color: var(--text-secondary) !important;
    background: var(--bg-primary) !important;
}

/* ============================================================
   CURRENCIES GRID
   ============================================================ */
.currencies-grid {
    display: grid;
    gap: 12px;
}
.currencies-grid.two-columns {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
}

.currency-card {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid var(--border-color);
    transition: transform 0.35s ease, opacity 0.35s ease, background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease, box-shadow 0.35s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-height: 80px;
}
.currency-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s ease;
}
.currency-card:hover::after {
    transform: scaleX(1);
}
.currency-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--tab-active);
}
.currency-card:active {
    transform: scale(0.97);
}

.currency-name {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: clamp(0.8rem, 1.6vw, 0.9rem);
}
.currency-name span {
    font-size: clamp(1rem, 2vw, 1.2rem);
}
.currency-price {
    font-weight: 800;
    font-size: clamp(0.85rem, 1.8vw, 1rem);
    direction: ltr;
    color: var(--text-primary);
}
.currency-details {
    font-size: 0.65rem;
    color: var(--text-secondary);
    line-height: 1.4;
}
.currency-buy-sell {
    display: flex;
    gap: 14px;
    font-size: clamp(0.8rem, 1.6vw, 0.9rem);
    margin: 6px 0 2px;
    flex-wrap: wrap;
    direction: ltr;
    unicode-bidi: plaintext;
}
.currency-buy-sell .buy-price,
.currency-buy-sell .sell-price {
    direction: ltr;
    unicode-bidi: plaintext;
    white-space: nowrap;
    min-width: max-content;
}
.currency-buy-sell .buy-price {
    color: #10b981 !important;
    font-weight: 700;
    font-size: clamp(0.9rem, 1.8vw, 1.05rem);
}
.currency-buy-sell .sell-price {
    color: #ef4444 !important;
    font-weight: 700;
    font-size: clamp(0.9rem, 1.8vw, 1.05rem);
}
.currency-card.buy-sell {
    border: 1.5px solid #e2e8f0;
    padding: 12px 14px;
}
[data-theme="dark"] .currency-card.buy-sell {
    border-color: #334155;
}
.currency-card.buy-sell:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(245, 158, 11, 0.18);
    border-color: var(--tab-active);
}

/* ============================================================
   CRYPTO CARDS
   ============================================================ */
.crypto-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-primary);
    padding: 2px;
    margin-left: 6px;
    flex-shrink: 0;
    border: 1px solid var(--border-color);
}
[data-theme="dark"] .crypto-icon {
    background: #334155;
    border-color: #475569;
}

.crypto-card {
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    transition: transform 0.35s ease, opacity 0.35s ease, background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease, box-shadow 0.35s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    min-height: 80px;
}
.crypto-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s ease;
}
.crypto-card:hover::after {
    transform: scaleX(1);
}
.crypto-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--tab-active);
}
.crypto-card:active {
    transform: scale(0.97);
}

.crypto-price-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: baseline;
    margin-top: 6px;
    font-size: clamp(0.8rem, 1.6vw, 0.9rem);
    gap: 4px;
    min-width: 0;
}
.price-label {
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.7rem;
}
.price-value {
    font-weight: 700;
    direction: ltr;
    unicode-bidi: plaintext;
    font-family: monospace;
    font-size: clamp(0.8rem, 1.6vw, 0.9rem);
    white-space: nowrap;
    display: inline-block;
    min-width: max-content;
    flex: 0 0 auto;
    text-align: left;
}
.symbol {
    font-size: 0.65rem;
    color: var(--text-secondary);
    margin-right: 4px;
}
.crypto-card .item-change {
    font-size: 0.65rem;
    padding: 2px 6px;
}

/* ============================================================
   SKELETON
   ============================================================ */
.skeleton-item {
    background: linear-gradient(90deg, var(--skeleton-bg) 25%, var(--bg-primary) 50%, var(--skeleton-bg) 75%);
    background-size: 200% 100%;
    animation:none;
    border-radius: 12px;
}

.skeleton-price-item {
    min-height: 42px;
    padding: 8px 4px;
    border-radius: 10px;
    margin: 0 0 6px 0;
    background: var(--skeleton-bg);
    position: relative;
    overflow: hidden;
}
.skeleton-price-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 25%, var(--bg-primary) 50%, transparent 75%);
    background-size: 200% 100%;
    animation:none;
    border-radius: inherit;
}

.skeleton-currency-card,
.skeleton-crypto-card {
    min-height: 80px;
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--skeleton-bg);
    position: relative;
    overflow: hidden;
}
.skeleton-currency-card::after,
.skeleton-crypto-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 25%, var(--bg-primary) 50%, transparent 75%);
    background-size: 200% 100%;
    animation:none;
    border-radius: inherit;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================================
   COPY TABLE BTN
   ============================================================ */
.copy-table-btn {
    width: 100%;
    margin-top: 16px;
    padding: 10px 16px;
    background: var(--tab-active);
    color: #fff;
    border: none;
    border-radius: var(--radius-btn);
    font-size: clamp(0.8rem, 1.6vw, 0.9rem);
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.35s ease, opacity 0.35s ease, background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease, box-shadow 0.35s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}
.copy-table-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-btn);
    background: rgba(255, 255, 255, 0.15);
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.3s, transform 0.3s;
}
.copy-table-btn:hover::after {
    opacity: 1;
    transform: translateY(0);
}
.copy-table-btn:hover {
    background: #d97706;
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(245, 158, 11, 0.3);
}
.copy-table-btn:active {
    transform: scale(0.97);
}
.copy-table-btn i {
    transition: transform 0.4s;
}
.copy-table-btn:hover i {
    transform: scale(1.15) rotate(-6deg);
}

/* ============================================================
   TOAST
   ============================================================ */
.toast-message {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 10px 22px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: clamp(0.8rem, 1.6vw, 0.9rem);
    font-weight: 500;
    z-index: 9999;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
    direction: rtl;
    max-width: 92vw;
    opacity: 0;
}
.toast-message.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.toast-message.toast-success {
    border-right: 4px solid #10b981;
}
.toast-message.toast-success i {
    color: #10b981;
}
.toast-message.toast-error {
    border-right: 4px solid #ef4444;
    background: var(--bg-card);
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.15);
}
.toast-message.toast-error i {
    color: #ef4444;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    animation:modalFade .18s ease;
}
@keyframes modalFade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-card);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    padding: 16px;
    max-width: 1100px;
    width: 95%;
    margin: 3% auto;
    border: 1px solid var(--border-color);
    position: relative;
    max-height: 96vh;
    overflow-y: auto;
    animation: modalSlide 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}
.modal-header h3 {
    margin: 0;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
}
.close {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s, transform 0.3s;
}
.close:hover {
    color: var(--tab-active);
    transform: rotate(90deg);
}

#candlestick-chart {
    height: clamp(350px, 50vh, 500px);
    width: 100%;
    margin-top: 12px;
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    min-height: 300px;
}

.chart-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}
.currency-toggle-btn {
    background: var(--tab-active);
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: var(--radius-btn);
    font-size: clamp(0.75rem, 1.6vw, 0.85rem);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}
.currency-toggle-btn:hover {
    background: #d97706;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.25);
}

.timeframe-buttons {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-top: 14px;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}
.tf-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 4px 12px;
    border-radius: 30px;
    font-size: clamp(0.7rem, 1.4vw, 0.8rem);
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
    color: var(--text-primary);
}
.tf-btn:hover {
    background: var(--tab-active);
    color: #fff;
    border-color: var(--tab-active);
    transform: translateY(-2px);
}
.tf-btn.active {
    background: var(--tab-active);
    color: #fff;
    border-color: var(--tab-active);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.25);
}

/* ============================================================
   FOOTER & SOCIAL LINKS
   ============================================================ */
footer {
    text-align: center;
    font-size: clamp(0.6rem, 1.2vw, 0.7rem);
    color: var(--text-secondary);
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    line-height: 1.8;
}
footer a {
    color: var(--tab-active);
    text-decoration: none;
    transition: color 0.3s;
}
footer a:hover {
    text-decoration: underline;
    color: #d97706;
}
footer i {
    margin: 0 4px;
    transition: transform 0.3s;
}
footer a:hover i {
    transform: scale(1.2);
}
.social-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 6px;
    flex-wrap: wrap;
}
.social-links a {
    font-size: 1.1rem;
}

/* ============================================================
   AI WIDGET
   ============================================================ */
.ai-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.ai-fab {
    width: clamp(52px, 8vw, 64px);
    height: clamp(52px, 8vw, 64px);
    border-radius: 50%;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border: none;
    box-shadow: 0 8px 32px rgba(245, 158, 11, 0.45);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    color: #fff;
    font-size: clamp(22px, 4vw, 28px);
}
.ai-fab:hover {
    transform: scale(1.1) rotate(-6deg);
    box-shadow: 0 12px 48px rgba(245, 158, 11, 0.6);
}
.ai-fab:active {
    transform: scale(0.93);
}

.ai-fab .ripple {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(245, 158, 11, 0.25);
    animation: rippleRing 2.4s ease-out infinite;
}
.ai-fab .ripple:nth-child(2) {
    animation-delay: 0.8s;
}
@keyframes rippleRing {
    0% { transform: scale(0.85); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}

.ai-fab .online-dot {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 12px;
    height: 12px;
    background: #10b981;
    border-radius: 50%;
    border: 2px solid #fff;
    animation: blinkDot 1.8s infinite;
}
@keyframes blinkDot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.25; }
}

/* ---- Chat Box ---- */
.ai-chat-box {
    width: min(380px, 92vw);
    height: min(480px, 70vh);
    background: var(--bg-card);
    border-radius: 28px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: chatSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ai-chat-box.open {
    display: flex;
}

@keyframes chatSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.92);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ai-chat-header {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    padding: 14px 18px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.ai-chat-header .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    animation: avatarPulse 3s ease-in-out infinite;
}
@keyframes avatarPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.ai-chat-header .info {
    flex: 1;
    min-width: 0;
}
.ai-chat-header .info .title {
    font-weight: 700;
    font-size: clamp(0.85rem, 2vw, 1rem);
}
.ai-chat-header .info .sub {
    font-size: 0.65rem;
    opacity: 0.85;
}
.ai-chat-header .close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s, transform 0.25s;
    flex-shrink: 0;
}
.ai-chat-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: rotate(90deg);
}

.ai-chat-messages {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg-primary);
}
.ai-chat-messages .msg {
    max-width: 88%;
    padding: 8px 14px;
    border-radius: 18px;
    font-size: clamp(0.8rem, 1.6vw, 0.9rem);
    line-height: 1.5;
    word-wrap: break-word;
    animation: msgIn 0.3s ease;
}
@keyframes msgIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ai-chat-messages .msg.user {
    background: var(--tab-active);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}
.ai-chat-messages .msg.bot {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.ai-chat-messages .msg .time {
    font-size: 0.55rem;
    opacity: 0.6;
    display: block;
    margin-top: 4px;
    direction: ltr;
    text-align: left;
}
.copy-msg-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 0.65rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: transform 0.25s ease, opacity 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    direction: ltr;
}
.copy-msg-btn:hover {
    background: var(--tab-active);
    color: #fff;
    border-color: var(--tab-active);
}
.copy-msg-btn i {
    font-size: 0.65rem;
}

.ai-chat-input {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}
.ai-chat-input input {
    flex: 1;
    padding: 8px 14px;
    border-radius: 40px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: clamp(0.8rem, 1.6vw, 0.9rem);
    outline: none;
    transition: border 0.3s, box-shadow 0.3s;
    min-width: 0;
}
.ai-chat-input input:focus {
    border-color: var(--tab-active);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.12);
}
.ai-chat-input input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ai-chat-input button {
    padding: 8px 16px;
    border-radius: 40px;
    border: none;
    background: var(--tab-active);
    color: #fff;
    font-weight: 700;
    font-size: clamp(0.8rem, 1.6vw, 0.9rem);
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}
.ai-chat-input button:hover:not(:disabled) {
    background: #d97706;
    transform: scale(1.04);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.25);
}
.ai-chat-input button:active:not(:disabled) {
    transform: scale(0.95);
}
.ai-chat-input button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ai-limit-msg {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    padding: 6px 12px;
    background: var(--bg-primary);
    border-radius: 30px;
    margin-top: 4px;
    border: 1px dashed var(--border-color);
    flex-shrink: 0;
}
.ai-limit-msg a {
    color: var(--tab-active);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s;
}
.ai-limit-msg a:hover {
    text-decoration: underline;
    color: #d97706;
}

/* ============================================================
   UTILITY
   ============================================================ */
.clickable {
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
    border-radius: 12px;
    padding: 6px;
    margin: 0 -6px;
}
.clickable:hover {
    background: var(--bg-primary);
    transform: translateX(4px);
}
.clickable:active {
    transform: scale(0.97);
}

.error-message {
    background: rgba(239, 68, 68, 0.08);
    border-right: 4px solid #ef4444;
    padding: 16px 20px;
    border-radius: 16px;
    text-align: center;
    color: var(--text-primary);
    font-weight: 500;
}

/* ApexCharts overrides */
.apexcharts-text,
.apexcharts-title-text,
.apexcharts-legend-text {
    fill: var(--text-primary) !important;
    color: var(--text-primary) !important;
}
.apexcharts-tooltip {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

/* ============================================================
   RESPONSIVE — موبایل
   ============================================================ */
@media (max-width: 768px) {
    .page-wrapper {
        padding: 10px 6px 24px;
    }
    .container {
        padding: 0 4px;
    }
    .header-top {
        flex-wrap: nowrap;
        gap: 4px;
    }
    h1 {
        font-size: 0.95rem;
        gap: 4px;
    }
    h1 i {
        font-size: 0.85rem;
    }
    .theme-toggle,
    .sidebar-toggle {
        padding: 4px 6px;
        min-width: 30px;
        min-height: 30px;
        font-size: 0.75rem;
    }
    .header-controls {
        gap: 3px;
    }
    .header-actions {
        gap: 4px;
        flex-wrap: nowrap;
    }
    .refresh-btn {
        padding: 4px 10px;
        font-size: 0.6rem;
        gap: 3px;
    }
    .refresh-btn i {
        font-size: 0.6rem;
    }
    .update-badge {
        padding: 3px 8px;
        font-size: 0.5rem;
        gap: 3px;
    }
    .update-badge i {
        font-size: 0.5rem;
    }
    .tabs {
        gap: 3px;
        padding: 3px;
        border-radius: 30px;
        margin-bottom: 12px;
        overflow-x: auto;
    }
    .tab-btn {
        padding: 5px 8px;
        font-size: 0.6rem;
        min-width: 36px;
        gap: 3px;
        border-radius: 30px;
    }
    .tab-btn i {
        font-size: 0.65rem;
    }
    .card {
        padding: 10px 8px;
        border-radius: 14px;
        margin-bottom: 10px;
    }
    .card h2 {
        font-size: 0.85rem;
        padding-right: 6px;
        margin-bottom: 8px;
        gap: 4px;
    }
    .card h2 i {
        font-size: 0.8rem;
    }
    .currencies-grid.two-columns {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    .currency-card {
        padding: 8px 8px;
        border-radius: 10px;
        min-height: 64px;
    }
    .currency-name {
        font-size: 0.7rem;
    }
    .currency-price {
        font-size: 0.7rem;
    }
    .crypto-card {
        padding: 8px 10px;
        border-radius: 12px;
        min-height: 64px;
    }
    .crypto-card .currency-name {
        font-size: 0.7rem;
    }
    .crypto-card .price-value {
        font-size: 0.7rem;
    }
    .crypto-card .crypto-price-row {
        font-size: 0.7rem;
    }
    .crypto-icon {
        width: 20px;
        height: 20px;
        margin-left: 4px;
    }
    .price-item {
        padding: 5px 0;
        font-size: 0.7rem;
        min-height: 32px;
        gap: 2px 4px;
    }
    .price-item:hover {
        padding: 5px 6px;
        margin: 0 -4px;
    }
    .item-name {
        font-size: 0.7rem;
    }
    .item-price {
        font-size: 0.7rem;
    }
    .banner-ad-wrapper {
        aspect-ratio: 16 / 5;
        border-radius: 12px;
        margin-bottom: 12px;
    }
    .banner-ad-placeholder {
        padding: 10px 12px;
    }
    .banner-ad-placeholder p {
        font-size: 0.7rem;
    }
    .banner-ad-placeholder .sub {
        font-size: 0.55rem;
    }
    .copy-table-btn {
        padding: 6px 10px;
        font-size: 0.65rem;
        margin-top: 10px;
        border-radius: 30px;
    }
    .copy-table-btn i {
        font-size: 0.65rem;
    }
    .sidebar {
        width: 80vw;
        max-width: 260px;
    }
    .sidebar-header {
        padding: 12px 12px;
    }
    .sidebar-logo {
        font-size: 0.85rem;
    }
    .user-panel {
        padding: 8px 12px;
        gap: 6px;
    }
    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    .user-name {
        font-size: 0.7rem;
    }
    .user-status {
        font-size: 0.6rem;
    }
    .user-login-btn {
        font-size: 0.6rem;
        padding: 3px 8px;
    }
    .nav-item {
        padding: 6px 10px;
        font-size: 0.75rem;
        margin: 1px 4px;
        border-radius: 8px;
    }
    .nav-item-icon {
        width: 22px;
        height: 22px;
        font-size: 0.65rem;
        border-radius: 6px;
    }
    .sub-nav-item {
        padding: 5px 10px 5px 14px;
        font-size: 0.68rem;
        margin: 1px 4px 1px 8px;
        border-radius: 8px;
    }
    .nav-section-label {
        font-size: 0.55rem;
        padding: 4px 12px 2px;
    }
    .sidebar-footer {
        font-size: 0.55rem;
        padding: 8px 12px;
    }
    .ai-chat-box {
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        bottom: 0;
        right: 0;
        animation: chatSlideUpMobile 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    @keyframes chatSlideUpMobile {
        from {
            opacity: 0;
            transform: translateY(40px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    .ai-chat-box .ai-chat-header {
        padding: 10px 14px;
        border-radius: 0;
    }
    .ai-chat-box .ai-chat-header .avatar {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    .ai-chat-box .ai-chat-header .info .title {
        font-size: 0.8rem;
    }
    .ai-chat-box .ai-chat-messages {
        padding: 10px;
    }
    .ai-chat-box .ai-chat-messages .msg {
        max-width: 92%;
        font-size: 0.75rem;
        padding: 6px 10px;
        border-radius: 14px;
    }
    .ai-chat-box .ai-chat-input {
        padding: 6px 10px;
        gap: 4px;
    }
    .ai-chat-box .ai-chat-input input {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
    .ai-chat-box .ai-chat-input button {
        padding: 5px 12px;
        font-size: 0.7rem;
    }
    .ai-widget-container {
        bottom: 10px;
        right: 10px;
    }
    .ai-fab {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
    .ai-fab .online-dot {
        width: 8px;
        height: 8px;
        bottom: 2px;
        right: 2px;
        border-width: 1.5px;
    }
    .modal-content {
        padding: 10px 8px;
        width: 98%;
        margin: 2% auto;
        border-radius: 16px;
    }
    .modal-header h3 {
        font-size: 0.85rem;
    }
    #candlestick-chart {
        height: 220px;
        min-height: 180px;
    }
    .timeframe-buttons {
        gap: 3px;
        padding-top: 6px;
        margin-top: 6px;
    }
    .tf-btn {
        padding: 2px 8px;
        font-size: 0.55rem;
        border-radius: 20px;
    }
    .chart-toolbar {
        margin-bottom: 4px;
    }
    .currency-toggle-btn {
        padding: 3px 10px;
        font-size: 0.6rem;
    }
    .toast-message {
        padding: 6px 14px;
        font-size: 0.65rem;
        bottom: 14px;
        max-width: 96vw;
        border-radius: 30px;
    }
    footer {
        font-size: 0.55rem;
        margin-top: 14px;
        padding-top: 10px;
    }
}

@media (max-width: 360px) {
    .currencies-grid.two-columns {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .tab-btn {
        font-size: 0.5rem;
        padding: 4px 6px;
        min-width: 30px;
    }
    h1 {
        font-size: 0.85rem;
    }
    .refresh-btn {
        font-size: 0.5rem;
        padding: 3px 6px;
    }
    .update-badge {
        font-size: 0.45rem;
        padding: 2px 6px;
    }
    .card {
        padding: 6px 4px;
    }
    .price-item {
        font-size: 0.6rem;
        min-height: 28px;
    }
    .currency-card,
    .crypto-card {
        padding: 6px 6px;
        min-height: 56px;
    }
    .currency-name {
        font-size: 0.6rem;
    }
    .currency-price {
        font-size: 0.6rem;
    }
    .crypto-card .currency-name {
        font-size: 0.6rem;
    }
    .crypto-card .price-value {
        font-size: 0.6rem;
    }
}

/* ============================================================
   صفحات اختصاصی دارایی‌ها
   ============================================================ */
.asset-link-card {
    text-decoration: none;
    color: inherit;
    display: block;
}
.asset-page-shell {
    max-width: 980px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}
.asset-page-header,
.asset-page-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-md);
}
.asset-page-header {
    padding: 24px;
    display: flex;
    gap: 18px;
    align-items: center;
    margin-bottom: 18px;
}
.asset-page-icon {
    width: 68px;
    height: 68px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    overflow: hidden;
    flex: 0 0 auto;
}
.asset-page-icon img { width: 54px; height: 54px; object-fit: contain; }
.asset-page-heading { flex: 1; min-width: 0; }
.asset-page-kicker { color: var(--text-secondary); font-size: .78rem; margin-bottom: 4px; }
.asset-page-title { font-size: clamp(1.35rem, 3vw, 2rem); font-weight: 700; margin: 0; }
.asset-page-symbol { color: var(--text-secondary); font-size: .9rem; margin-top: 5px; }
.asset-page-live { display: inline-flex; align-items: center; gap: 6px; margin-top: 9px; font-size: .73rem; color: var(--tab-active); }
.asset-page-live-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: assetPulse 1.6s infinite; }
@keyframes assetPulse { 0%,100% { opacity: .45; } 50% { opacity: 1; } }
.asset-page-price-box { text-align: left; }
.asset-page-price { font-size: clamp(1.35rem, 3vw, 2rem); font-weight: 800; }
.asset-page-change { margin-top: 4px; font-size: .85rem; }
.asset-page-change.up { color: #10b981; }
.asset-page-change.down { color: #ef4444; }
.asset-page-change.stable { color: var(--text-secondary); }
.asset-page-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.asset-page-card { padding: 22px; margin-bottom: 18px; }
.asset-page-card h2 { font-size: 1rem; margin-bottom: 12px; }
.asset-page-intro { line-height: 2; color: var(--text-secondary); }
.asset-page-body { line-height: 2.15; color: var(--text-primary); }
.asset-page-stats { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.asset-stat { padding: 12px; border-radius: 14px; background: var(--bg-primary); border: 1px solid var(--border-color); }
.asset-stat-label { font-size: .7rem; color: var(--text-secondary); }
.asset-stat-value { margin-top: 4px; font-size: 1rem; font-weight: 700; }

.asset-share-panel { position:relative; margin: 0 0 18px; }
.asset-share-actions { display:flex; gap:10px; flex-wrap:wrap; }
.asset-action-btn { border:1px solid var(--border-color); background:var(--bg-card); color:var(--text-primary); padding:10px 16px; border-radius:12px; cursor:pointer; font-family:inherit; font-size:.82rem; font-weight:600; display:inline-flex; align-items:center; gap:8px; transition: transform .25s ease, opacity .25s ease, background-color .25s ease, border-color .25s ease, color .25s ease, box-shadow .25s ease; box-shadow:var(--shadow-sm); }
.asset-action-btn:hover { transform:translateY(-1px); border-color:var(--tab-active); box-shadow:var(--shadow-md); }
.asset-copy-price-btn { background:linear-gradient(135deg,var(--gradient-start),var(--gradient-end)); color:#fff; border-color:transparent; }
.asset-share-price-btn { color:var(--tab-active); }
.asset-share-menu { margin-top:10px; padding:14px; background:var(--bg-card); border:1px solid var(--border-color); border-radius:16px; box-shadow:var(--shadow-lg); max-width:520px; }
.asset-share-menu-title { font-size:.78rem; color:var(--text-secondary); margin-bottom:10px; font-weight:600; }
.asset-share-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.asset-share-option { border:1px solid var(--border-color); background:var(--bg-primary); color:var(--text-primary); min-height:52px; border-radius:12px; cursor:pointer; font-family:inherit; display:flex; align-items:center; justify-content:center; gap:7px; font-size:.74rem; font-weight:600; transition: transform .2s ease, opacity .2s ease, background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease; }
.asset-share-option:hover { border-color:var(--tab-active); transform:translateY(-1px); }
.asset-share-option i { font-size:1rem; }
.asset-share-brand { width:20px; height:20px; border-radius:6px; display:inline-flex; align-items:center; justify-content:center; background:var(--tab-active); color:#fff; font-size:.68rem; font-weight:800; }
@media (max-width:600px) { .asset-share-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .asset-share-actions .asset-action-btn { flex:1 1 180px; justify-content:center; } }

.asset-chart-card { overflow: hidden; }
.asset-chart-toolbar { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:14px; align-items:center; }
.asset-chart-btn { border:1px solid var(--border-color); background:var(--bg-primary); color:var(--text-primary); padding:7px 12px; border-radius:999px; cursor:pointer; font-family:inherit; font-size:.76rem; }
.asset-chart-btn.active { background:var(--tab-active); color:#fff; border-color:var(--tab-active); }
.asset-chart { min-height: 440px; }
.asset-back-link { display:inline-flex; margin-bottom:12px; color:var(--tab-active); text-decoration:none; font-size:.8rem; }
@media (max-width: 720px) {
    .asset-page-header { flex-wrap: wrap; }
    .asset-page-price-box { width: 100%; text-align: right; }
    .asset-page-grid { grid-template-columns: 1fr; }
    .asset-page-shell { padding: 16px 10px 40px; }
    .asset-chart { min-height: 360px; }
}


/* ============================================================
   PRICELIVE GLASS UI / iOS LIQUID GLASS OVERRIDES
   هدف: شیشه‌ای، مات، تمیز و خوانا، بدون تغییر منطق برنامه
   ============================================================ */

:root {
    --glass-bg: rgba(255, 255, 255, 0.56);
    --glass-bg-strong: rgba(255, 255, 255, 0.72);
    --glass-bg-soft: rgba(255, 255, 255, 0.40);
    --glass-border: rgba(255, 255, 255, 0.62);
    --glass-border-soft: rgba(148, 163, 184, 0.22);
    --glass-highlight: rgba(255, 255, 255, 0.72);
    --glass-blur: 24px;
    --glass-shadow: 0 18px 50px rgba(15, 23, 42, 0.10), inset 0 1px 0 rgba(255,255,255,.66);
    --glass-shadow-hover: 0 24px 64px rgba(15, 23, 42, 0.15), inset 0 1px 0 rgba(255,255,255,.78);
}

[data-theme="dark"] {
    --glass-bg: rgba(15, 23, 42, 0.54);
    --glass-bg-strong: rgba(15, 23, 42, 0.70);
    --glass-bg-soft: rgba(30, 41, 59, 0.42);
    --glass-border: rgba(148, 163, 184, 0.22);
    --glass-border-soft: rgba(148, 163, 184, 0.18);
    --glass-highlight: rgba(255, 255, 255, 0.10);
    --glass-shadow: 0 20px 55px rgba(0, 0, 0, 0.30), inset 0 1px 0 rgba(255,255,255,.07);
    --glass-shadow-hover: 0 26px 72px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255,255,255,.10);
}

html,
body {
    min-height: 100%;
}

body {
    position: relative;
    isolation: isolate;
    background:
        radial-gradient(circle at 8% 8%, rgba(245,158,11,.13), transparent 26%),
        radial-gradient(circle at 92% 20%, rgba(59,130,246,.10), transparent 28%),
        radial-gradient(circle at 50% 105%, rgba(245,158,11,.07), transparent 32%),
        var(--bg-primary);
}

[data-theme="dark"] body {
    background:
        radial-gradient(circle at 8% 8%, rgba(245,158,11,.10), transparent 25%),
        radial-gradient(circle at 92% 20%, rgba(59,130,246,.08), transparent 28%),
        radial-gradient(circle at 50% 105%, rgba(245,158,11,.05), transparent 34%),
        #0a1220;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        linear-gradient(135deg, rgba(255,255,255,.12), transparent 35%),
        linear-gradient(315deg, rgba(255,255,255,.06), transparent 30%);
    opacity: .65;
}

.background-character {
    position: fixed;
    z-index: 0;
    pointer-events: none;
    user-select: none;
    width: clamp(320px, 42vw, 600px);
    height: clamp(320px, 42vw, 600px);
    left: clamp(-52px, 2vw, 32px);
    bottom: clamp(-4px, 2vh, 30px);
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    opacity: .29;
    filter: saturate(1.06) contrast(1.02) drop-shadow(0 18px 34px rgba(15,23,42,.18)) drop-shadow(0 0 28px rgba(245,158,11,.11));
    transform: translateZ(0);
    transition: opacity .35s ease, transform .5s ease;
}

.background-character img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: bottom left;
    pointer-events: none;
    -webkit-user-drag: none;
}

[data-theme="dark"] .background-character {
    opacity: .34;
    filter: saturate(1.08) brightness(.96) contrast(1.04) drop-shadow(0 22px 40px rgba(0,0,0,.38)) drop-shadow(0 0 30px rgba(245,158,11,.10));
}

.page-wrapper {
    position: relative;
    z-index: 1;
}

/* سطح شیشه‌ای مشترک */
.card,
.tabs,
.banner-ad-wrapper,
.banner-ad-placeholder,
.update-badge,
.theme-toggle,
.sidebar-toggle,
.sidebar,
.user-panel,
.nav-item,
.sub-nav-item,
.ai-chat-box,
.modal-content,
.asset-page-card,
.asset-share-menu,
.asset-action-btn,
.asset-stat,
footer,
.card-section,
.panel,
.table-card,
.table-wrapper {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.card,
.banner-ad-wrapper,
.modal-content,
.asset-page-card,
footer {
    position: relative;
    overflow: hidden;
}

.card::before,
.tabs::before,
.banner-ad-wrapper::before,
.modal-content::before,
footer::before,
.ai-chat-box::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255,255,255,.22), transparent 34%, transparent 68%, rgba(255,255,255,.07));
    opacity: .9;
}

[data-theme="dark"] .card::before,
[data-theme="dark"] .tabs::before,
[data-theme="dark"] .banner-ad-wrapper::before,
[data-theme="dark"] .modal-content::before,
[data-theme="dark"] footer::before,
[data-theme="dark"] .ai-chat-box::before {
    background: linear-gradient(135deg, rgba(255,255,255,.08), transparent 34%, transparent 68%, rgba(255,255,255,.025));
}

.card {
    border-color: var(--glass-border);
    transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease, background .35s ease;
}

.card:hover {
    box-shadow: var(--glass-shadow-hover);
    border-color: rgba(245,158,11,.34);
}

/* جدول‌ها / ردیف‌های قیمت */
.items-list,
.currencies-grid {
    position: relative;
    z-index: 1;
}

.price-item {
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.26);
    border-bottom: 1px solid rgba(148,163,184,.16);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.22);
    transition: transform .28s ease, opacity .28s ease, background-color .28s ease, border-color .28s ease, color .28s ease, box-shadow .28s ease;
}

.price-item:hover {
    background: rgba(255,255,255,.34);
    border-color: rgba(245,158,11,.30);
    box-shadow: 0 10px 24px rgba(15,23,42,.08), inset 0 1px 0 rgba(255,255,255,.48);
}

[data-theme="dark"] .price-item {
    background: rgba(15,23,42,.30);
    border-color: rgba(148,163,184,.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

[data-theme="dark"] .price-item:hover {
    background: rgba(30,41,59,.50);
    border-color: rgba(245,158,11,.34);
}

.currency-card,
.crypto-card {
    background: rgba(255,255,255,.30);
    border: 1px solid rgba(255,255,255,.42);
    box-shadow: 0 10px 28px rgba(15,23,42,.07), inset 0 1px 0 rgba(255,255,255,.38);
}

.currency-card:hover,
.crypto-card:hover {
    background: rgba(255,255,255,.43);
    box-shadow: var(--glass-shadow-hover);
    border-color: rgba(245,158,11,.40);
}

[data-theme="dark"] .currency-card,
[data-theme="dark"] .crypto-card {
    background: rgba(15,23,42,.34);
    border-color: rgba(148,163,184,.16);
    box-shadow: 0 12px 30px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.045);
}

[data-theme="dark"] .currency-card:hover,
[data-theme="dark"] .crypto-card:hover {
    background: rgba(30,41,59,.52);
}

/* تب‌ها، نزدیک به دکمه‌های iOS */
.tabs {
    position: relative;
    overflow: hidden;
    padding: 5px;
    border-radius: 999px;
    background: rgba(255,255,255,.38);
}

.tab-btn {
    min-height: 42px;
    border: 1px solid transparent;
    background: rgba(255,255,255,.18);
    color: var(--tab-inactive);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.24);
}

.tab-btn:hover {
    background: rgba(255,255,255,.30);
}

.tab-btn.active {
    background: linear-gradient(180deg, rgba(255,255,255,.86), rgba(255,255,255,.62));
    color: #b76500;
    border-color: rgba(255,255,255,.72);
    box-shadow: 0 7px 22px rgba(15,23,42,.12), inset 0 1px 0 rgba(255,255,255,.88);
    transform: none;
}

[data-theme="dark"] .tabs {
    background: rgba(15,23,42,.44);
}

[data-theme="dark"] .tab-btn {
    background: rgba(30,41,59,.28);
    color: #a9b7ca;
}

[data-theme="dark"] .tab-btn:hover {
    background: rgba(51,65,85,.38);
}

[data-theme="dark"] .tab-btn.active {
    background: linear-gradient(180deg, rgba(71,85,105,.78), rgba(30,41,59,.74));
    color: #f59e0b;
    border-color: rgba(148,163,184,.20);
    box-shadow: 0 9px 25px rgba(0,0,0,.26), inset 0 1px 0 rgba(255,255,255,.10);
}

/* دکمه‌ها */
.theme-toggle,
.sidebar-toggle,
.user-login-btn,
.asset-action-btn,
.copy-msg-btn,
.close,
.tf-btn,
.currency-toggle-btn {
}

.refresh-btn,
.copy-table-btn {
    border: 1px solid rgba(255,255,255,.28);
    background: linear-gradient(180deg, rgba(251,191,36,.96), rgba(245,158,11,.90));
    box-shadow: 0 8px 24px rgba(245,158,11,.20), inset 0 1px 0 rgba(255,255,255,.34);
}

.refresh-btn:hover,
.copy-table-btn:hover {
    box-shadow: 0 14px 32px rgba(245,158,11,.27), inset 0 1px 0 rgba(255,255,255,.38);
}

.update-badge,
.theme-toggle,
.sidebar-toggle {
    background: rgba(255,255,255,.44);
}

[data-theme="dark"] .update-badge,
[data-theme="dark"] .theme-toggle,
[data-theme="dark"] .sidebar-toggle {
    background: rgba(15,23,42,.48);
}

/* سایدبار شیشه‌ای */
.sidebar {
    background: rgba(248,250,252,.63);
    border-color: rgba(255,255,255,.72);
}

.sidebar-header {
    background: linear-gradient(135deg, rgba(251,191,36,.90), rgba(245,158,11,.84));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.34);
}

.user-panel {
    background: rgba(255,255,255,.28);
}

.nav-item {
    background: rgba(255,255,255,.12);
    border-color: transparent;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}

.nav-item:hover,
.sub-nav-item:hover {
    background: rgba(255,255,255,.28);
}

.nav-item.active,
.sub-nav-item.active {
    background: rgba(245,158,11,.13);
    border-color: rgba(245,158,11,.16);
}

[data-theme="dark"] .sidebar {
    background: rgba(15,23,42,.70);
    border-color: rgba(148,163,184,.18);
}

[data-theme="dark"] .user-panel,
[data-theme="dark"] .nav-item {
    background: rgba(15,23,42,.28);
}

[data-theme="dark"] .nav-item:hover,
[data-theme="dark"] .sub-nav-item:hover {
    background: rgba(51,65,85,.30);
}

/* بنر شیشه‌ای */
.banner-ad-wrapper,
.banner-ad-placeholder {
    background: var(--glass-bg);
}

/* ویجت AI */
.ai-chat-box {
    background: rgba(255,255,255,.66);
    border-color: rgba(255,255,255,.74);
}

.ai-chat-header {
    background: linear-gradient(135deg, rgba(251,191,36,.94), rgba(245,158,11,.88));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.30);
}

.ai-chat-messages {
    background: rgba(248,250,252,.38);
}

.ai-chat-messages .msg.bot {
    background: rgba(255,255,255,.44);
    border-color: rgba(255,255,255,.58);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.38);
}

.ai-chat-input {
    background: rgba(255,255,255,.44) !important;
    border-top: 1px solid rgba(255,255,255,.50) !important;
}

.ai-chat-input input {
    background: rgba(255,255,255,.48) !important;
    border: 1px solid rgba(255,255,255,.62) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.46);
}

.ai-chat-input button {
    border: 1px solid rgba(255,255,255,.28) !important;
    box-shadow: 0 6px 18px rgba(245,158,11,.18), inset 0 1px 0 rgba(255,255,255,.30);
}

[data-theme="dark"] .ai-chat-box {
    background: rgba(15,23,42,.68);
    border-color: rgba(148,163,184,.20);
}

[data-theme="dark"] .ai-chat-messages {
    background: rgba(2,6,23,.38);
}

[data-theme="dark"] .ai-chat-messages .msg.bot {
    background: rgba(30,41,59,.50);
    border-color: rgba(148,163,184,.18);
}

[data-theme="dark"] .ai-chat-input {
    background: rgba(15,23,42,.50) !important;
    border-top-color: rgba(148,163,184,.18) !important;
}

[data-theme="dark"] .ai-chat-input input {
    background: rgba(30,41,59,.52) !important;
    border-color: rgba(148,163,184,.22) !important;
}

/* Modal */
.modal {
    background: rgba(2,6,23,.52);
}

.modal-content {
    background: var(--glass-bg-strong);
}

/* فوتر */
footer {
    background: var(--glass-bg);
    border-color: var(--glass-border);
}

/* متن و لایه‌بندی */
.card > *,
.tabs > *,
.banner-ad-wrapper > *,
.modal-content > *,
footer > *,
.ai-chat-box > * {
    position: relative;
    z-index: 1;
}

/* موبایل: کاراکتر عقب‌تر و کوچک‌تر تا مزاحم محتوا نشود */
@media (max-width: 768px) {
    .background-character {
        width: clamp(220px, 58vw, 360px);
        height: clamp(220px, 58vw, 360px);
        left: -28px;
        bottom: 6px;
        opacity: .19;
    }

    [data-theme="dark"] .background-character {
        opacity: .23;
    }

    .card,
    .tabs,
    .banner-ad-wrapper,
    .modal-content,
    footer,
    .ai-chat-box {
    }
}

@media (max-width: 480px) {
    .background-character {
        width: 265px;
        height: 265px;
        left: -42px;
        bottom: 10px;
    }
}

@media (prefers-reduced-transparency: reduce) {
    .card,
    .tabs,
    .banner-ad-wrapper,
    .sidebar,
    .modal-content,
    .ai-chat-box,
    footer {
        background: var(--bg-card);
    }

    .background-character {
        opacity: .15;
    }
}

/* PriceLive WebView performance layer */
@media (hover:none),(pointer:coarse){
  .card:hover,.currency-card:hover,.crypto-card:hover,.banner-ad-wrapper:hover,.price-item:hover,.tab-btn:hover,.nav-item:hover,.sub-nav-item:hover,.refresh-btn:hover,.copy-table-btn:hover{
    transform:none;
    box-shadow:inherit;
  }
  .card:hover::before,.currency-card:hover::after,.crypto-card:hover::after,.tab-btn:hover::after,.nav-item:hover::after,.sub-nav-item:hover::after,.refresh-btn:hover::after,.copy-table-btn:hover::after{
    opacity:0;
    transform:none;
  }
  .banner-ad-wrapper img,.refresh-btn:hover i,.theme-toggle:hover,.sidebar-toggle:hover{
    transform:none!important;
  }
}
.card,.currency-card,.crypto-card,.banner-ad-wrapper{
  contain:layout paint;
}
@media (max-width:768px){
  .card,.tabs,.banner-ad-wrapper,.modal-content,footer,.ai-chat-box{
    backdrop-filter:none!important;
    -webkit-backdrop-filter:none!important;
  }
}
