/**
 * GLOBAL RESPONSIVE STYLES
 * Mobile-First Approach
 * Breakpoints: ≤320px, ≤375px, ≤480px, ≤768px, ≤1024px, ≥1280px
 */

/* ============================================
   HEADER - FULLY RESPONSIVE
   ============================================ */

/* Hide desktop menu on mobile/tablet */
@media (max-width: 1024px) {
    .main-header .desktop-menu {
        display: none !important;
    }

    .main-header .main-header__logo-section .main-header__logo-section__link.desktop {
        display: none !important;
    }

    .main-header .main-header__logo-section .main-header__logo-section__link-mobile {
        display: flex !important;
        align-items: center;
        gap: 8px;
    }

    /* Hide auth buttons on mobile - they go to mobile menu */
    .main-header .main-header__nav-button,
    .main-header .main-header__nav-button-primary {
        display: none !important;
    }

    /* Show burger button */
    .main-header .mobile-menu-button {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        cursor: pointer;
        z-index: 1001;
    }

    /* Spacer should be hidden on mobile */
    .main-header .spacer {
        flex: 1;
    }

    /* Language button - hide on mobile, show in mobile menu */
    .main-header .main-menu .lang-button {
        display: none !important;
    }
}

/* Show desktop menu on desktop */
@media (min-width: 1025px) {
    .main-header .desktop-menu {
        display: flex !important;
    }

    .main-header .mobile-menu-button {
        display: none !important;
    }

    .main-header .main-header__logo-section .main-header__logo-section__link.desktop {
        display: flex !important;
    }

    .main-header .main-header__logo-section .main-header__logo-section__link-mobile {
        display: none !important;
    }
}

/* Mobile menu styles */
.mobile-menu {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid var(--border-subtle);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.8);
    display: none;
}

.mobile-menu.active {
    transform: translateX(0);
    display: block;
}

/* Prevent body scroll when menu is open */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

.mobile-menu__content {
    padding: 20px;
    max-width: 100%;
}

.mobile-menu__section {
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 20px;
}

.mobile-menu__section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.mobile-menu__section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding: 0 4px;
}

.mobile-menu__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 12px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 500;
    min-height: 44px;
}

.mobile-menu__item:hover,
.mobile-menu__item:active {
    background: rgba(229, 229, 229, 0.05);
    color: var(--text-value);
}

.mobile-menu__item.active {
    background: rgba(46, 204, 113, 0.1);
    color: var(--success);
    border-left: 3px solid var(--success);
    padding-left: 9px;
}

.mobile-menu__item-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.mobile-menu__item-text {
    flex: 1;
}

/* Burger icon animation */
#nav-icon3 {
    width: 28px;
    height: 24px;
    position: relative;
    transform: rotate(0deg);
    transition: 0.3s ease-in-out;
    cursor: pointer;
}

#nav-icon3 span {
    display: block;
    position: absolute;
    height: 3px;
    width: 100%;
    background: var(--text-primary);
    border-radius: 3px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: 0.25s ease-in-out;
}

#nav-icon3 span:nth-child(1) {
    top: 0px;
}

#nav-icon3 span:nth-child(2),
#nav-icon3 span:nth-child(3) {
    top: 10px;
}

#nav-icon3 span:nth-child(4) {
    top: 20px;
}

#nav-icon3.open span:nth-child(1) {
    top: 10px;
    width: 0%;
    left: 50%;
}

#nav-icon3.open span:nth-child(2) {
    transform: rotate(45deg);
}

#nav-icon3.open span:nth-child(3) {
    transform: rotate(-45deg);
}

#nav-icon3.open span:nth-child(4) {
    top: 10px;
    width: 0%;
    left: 50%;
}

/* Header buttons responsive */
@media (max-width: 1024px) {
    .main-header .v-toolbar__content {
        padding: 0 12px !important;
        gap: 8px;
    }

    .main-header .main-header__logo-section {
        flex-shrink: 0;
    }

    .main-header .main-header__logo-section img {
        width: 32px;
        height: 32px;
    }

    .main-header .main-header__logo-section .main-header__logo-section__link-mobile span {
        display: inline-block;
        font-size: 16px;
        font-weight: 600;
        color: var(--text-primary);
        margin-left: 8px;
    }
}

@media (max-width: 480px) {
    .main-header {
        height: 56px !important;
    }

    .main-header .v-toolbar__content {
        height: 56px !important;
        padding: 0 8px !important;
    }

    .main-header .main-header__logo-section .main-header__logo-section__link-mobile span {
        font-size: 14px;
        margin-left: 6px;
    }

    .mobile-menu {
        top: 56px;
    }

    main.v-main {
        padding-top: 56px !important;
    }
}

/* ============================================
   MOBILE BOTTOM NAV - HIDDEN (removed per request)
   ============================================ */

.mobile-bottom-nav {
    display: none !important;
}

/* ============================================
   GLOBAL MOBILE - PREVENT OVERFLOW
   ============================================ */

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

@media (max-width: 768px) {
    /* Stack 2-column grids */
    .deposit-main-grid,
    .withdraw-main-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    /* Main content padding */
    .v-main,
    #box,
    main.fade-page {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .fintech-container {
        padding-left: 12px !important;
        padding-right: 12px !important;
        max-width: 100% !important;
    }
}

@media (max-width: 480px) {
    .fintech-container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}

/* ============================================
   BASE MOBILE STYLES (≤480px)
   ============================================ */

/* Touch-friendly tap areas */
@media (max-width: 480px) {
    /* Minimum tap area 44px */
    button,
    a:not(.fintech-link-action):not(.fintech-link-primary),
    .fintech-btn,
    .markets-tab-btn,
    .markets-pagination-btn,
    .chart-timeframe-btn,
    input[type="submit"],
    input[type="button"],
    select {
        min-height: 44px !important;
        min-width: 44px !important;
        padding: 12px 16px !important;
        font-size: 14px !important;
    }

    /* Typography improvements */
    body {
        font-size: clamp(13px, 3.5vw, 14px) !important;
        line-height: 1.6 !important;
    }

    h1, .fintech-heading-1 {
        font-size: clamp(20px, 6vw, 24px) !important;
        line-height: 1.3 !important;
    }

    h2, .fintech-heading-2 {
        font-size: clamp(18px, 5vw, 20px) !important;
        line-height: 1.4 !important;
    }

    h3, .fintech-heading-3 {
        font-size: clamp(16px, 4.5vw, 18px) !important;
        line-height: 1.4 !important;
    }

    h4, .fintech-heading-4 {
        font-size: clamp(13px, 3.5vw, 14px) !important;
    }

    /* Remove micro text */
    .fintech-text-tertiary {
        font-size: clamp(10px, 2.8vw, 11px) !important;
    }

    /* Container padding */
    .fintech-container,
    .markets-page-container,
    .fees-container,
    .kyc-container,
    .swap-container {
        padding: clamp(10px, 3vw, 12px) !important;
    }

    /* Cards spacing */
    .fintech-card {
        padding: clamp(14px, 4vw, 16px) !important;
        margin-bottom: 12px !important;
        border-radius: 12px !important;
    }

    /* Grid adjustments */
    .fintech-grid-2,
    .fintech-grid-3,
    .fintech-grid-4 {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* Forms */
    .fintech-input,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px !important; /* Prevent zoom on iOS */
        min-height: 44px !important;
        padding: 12px 16px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Labels */
    .fintech-input-label,
    label {
        font-size: clamp(11px, 3vw, 12px) !important;
        margin-bottom: 8px !important;
    }

    /* Disable hover effects on mobile */
    .fintech-card:hover {
        transform: none !important;
    }

    .fintech-btn:hover {
        transform: none !important;
    }

    /* Images */
    img {
        max-width: 100% !important;
        height: auto !important;
    }

    /* Remove fixed widths */
    [style*="width:"]:not([style*="max-width"]):not([style*="min-width"]) {
        max-width: 100% !important;
    }
}

/* ============================================
   MOBILE / TABLET PORTRAIT (≤768px)
   ============================================ */

@media (max-width: 768px) {
    /* Container adjustments */
    .fintech-container {
        padding: 16px;
        max-width: 100%;
    }

    /* Typography */
    body {
        font-size: 14px;
    }

    /* Grid adjustments */
    .fintech-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }

    .fintech-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Cards */
    .fintech-card {
        padding: 18px;
        border-radius: 12px;
    }

    /* Buttons */
    .fintech-btn {
        padding: 12px 20px;
        font-size: 13px;
        min-height: 44px;
    }

    /* Hide non-essential elements */
    .mobile-hide {
        display: none !important;
    }
}

/* ============================================
   TABLET LANDSCAPE (≤1024px)
   ============================================ */

@media (max-width: 1024px) {
    .fintech-container {
        padding: 20px;
    }

    .fintech-grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   TABLES - MOBILE CARD TRANSFORMATION
   UNIVERSAL SYSTEM FOR ALL TABLES
   ============================================ */

/* Convert ALL tables to cards on mobile - universal system */
@media (max-width: 768px) {
    /* Universal table card transformation */
    table.fintech-table,
    .fintech-table,
    .markets-table,
    .fees-table,
    .wallets-transactions-table,
    .data-table-dense table {
        display: block;
        width: 100%;
        min-width: 0 !important;
    }

    table.fintech-table thead,
    .fintech-table thead,
    .markets-table thead,
    .fees-table thead,
    .wallets-transactions-table thead,
    .data-table-dense thead {
        display: none;
    }

    table.fintech-table tbody,
    .fintech-table tbody,
    .markets-table tbody,
    .fees-table tbody,
    .wallets-transactions-table tbody,
    .data-table-dense tbody {
        display: block;
        width: 100%;
    }

    table.fintech-table tbody tr,
    .fintech-table tbody tr,
    .markets-table tbody tr,
    .fees-table tbody tr,
    .wallets-transactions-table tbody tr,
    .data-table-dense tbody tr {
        display: block;
        /*background: rgba(8, 8, 11, 0.85);*/
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid rgba(45, 45, 50, 0.4);
        border-radius: 14px;
        padding: 18px;
        margin-bottom: 14px;
        box-shadow:
            0 6px 20px rgba(0, 0, 0, 0.7),
            0 2px 8px rgba(0, 0, 0, 0.5),
            inset 0 1px 2px rgba(0, 0, 0, 0.3);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        overflow: hidden;
    }

    table.fintech-table tbody tr:last-child,
    .fintech-table tbody tr:last-child,
    .markets-table tbody tr:last-child,
    .fees-table tbody tr:last-child,
    .wallets-transactions-table tbody tr:last-child,
    .data-table-dense tbody tr:last-child {
        margin-bottom: 0;
    }

    table.fintech-table tbody td,
    .fintech-table tbody td,
    .markets-table tbody td,
    .fees-table tbody td,
    .wallets-transactions-table tbody td,
    .data-table-dense tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 14px 0;
        border-bottom: 1px solid rgba(45, 45, 50, 0.3);
        text-align: left !important;
        width: 100%;
        min-height: 44px;
    }

    table.fintech-table tbody td:last-child,
    .fintech-table tbody td:last-child,
    .markets-table tbody td:last-child,
    .fees-table tbody td:last-child,
    .wallets-transactions-table tbody td:last-child,
    .data-table-dense tbody td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    table.fintech-table tbody td::before,
    .fintech-table tbody td::before,
    .markets-table tbody td::before,
    .fees-table tbody td::before,
    .wallets-transactions-table tbody td::before,
    .data-table-dense tbody td::before {
        /*content: attr(data-label);*/
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--text-secondary);
        margin-right: 16px;
        min-width: 100px;
        flex-shrink: 0;
        opacity: 0.8;
    }

    /* Special handling for first column (Pair/Asset/Contract/Currency/VIP Level) */
    table.fintech-table tbody td[data-label="Pair"]::before,
    table.fintech-table tbody td[data-label="Asset"]::before,
    table.fintech-table tbody td[data-label="Contract"]::before,
    table.fintech-table tbody td[data-label="Currency"]::before,
    table.fintech-table tbody td[data-label="VIP Level"]::before,
    table.fintech-table tbody td[data-label="Trading Pairs"]::before,
    .fintech-table tbody td[data-label="Pair"]::before,
    .fintech-table tbody td[data-label="Asset"]::before,
    .fintech-table tbody td[data-label="Contract"]::before,
    .fintech-table tbody td[data-label="Currency"]::before,
    .fintech-table tbody td[data-label="VIP Level"]::before,
    .fintech-table tbody td[data-label="Trading Pairs"]::before,
    .markets-table tbody td[data-label="Trading Pairs"]::before,
    .fees-table tbody td[data-label="VIP Level"]::before {
        display: none;
    }

    table.fintech-table tbody td[data-label="Pair"],
    table.fintech-table tbody td[data-label="Asset"],
    table.fintech-table tbody td[data-label="Contract"],
    table.fintech-table tbody td[data-label="Currency"],
    table.fintech-table tbody td[data-label="VIP Level"],
    table.fintech-table tbody td[data-label="Trading Pairs"],
    .fintech-table tbody td[data-label="Pair"],
    .fintech-table tbody td[data-label="Asset"],
    .fintech-table tbody td[data-label="Contract"],
    .fintech-table tbody td[data-label="Currency"],
    .fintech-table tbody td[data-label="VIP Level"],
    .fintech-table tbody td[data-label="Trading Pairs"],
    .markets-table tbody td[data-label="Trading Pairs"],
    .fees-table tbody td[data-label="VIP Level"] {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding-bottom: 18px;
        margin-bottom: 10px;
        padding-top: 0;
        border-bottom: 2px solid rgba(45, 45, 50, 0.5);
    }

    /* Special handling for Action/Actions column */
    table.fintech-table tbody td[data-label="Action"],
    table.fintech-table tbody td[data-label="Actions"],
    .fintech-table tbody td[data-label="Action"],
    .fintech-table tbody td[data-label="Actions"],
    .markets-table tbody td[data-label="Actions"],
    .fees-table tbody td[data-label="Actions"] {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding-top: 16px;
        border-top: 1px solid rgba(45, 45, 50, 0.3);
    }

    table.fintech-table tbody td[data-label="Action"]::before,
    table.fintech-table tbody td[data-label="Actions"]::before,
    .fintech-table tbody td[data-label="Action"]::before,
    .fintech-table tbody td[data-label="Actions"]::before,
    .markets-table tbody td[data-label="Actions"]::before,
    .fees-table tbody td[data-label="Actions"]::before {
        margin-bottom: 8px;
        width: 100%;
        padding-bottom: 8px;
        border-bottom: 1px solid rgba(45, 45, 50, 0.3);
    }

    table.fintech-table tbody td[data-label="Action"] > div,
    table.fintech-table tbody td[data-label="Actions"] > div,
    .fintech-table tbody td[data-label="Action"] > div,
    .fintech-table tbody td[data-label="Actions"] > div {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    table.fintech-table tbody td[data-label="Action"] .fintech-btn,
    table.fintech-table tbody td[data-label="Actions"] .fintech-btn,
    .fintech-table tbody td[data-label="Action"] .fintech-btn,
    .fintech-table tbody td[data-label="Actions"] .fintech-btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
        padding: 12px 16px;
    }

    /* Hide mobile-hide columns */
    table.fintech-table tbody td.mobile-hide,
    .fintech-table tbody td.mobile-hide,
    .markets-table tbody td.mobile-hide,
    .fees-table tbody td.mobile-hide,
    .wallets-transactions-table tbody td.mobile-hide {
        display: none !important;
    }

    /* Remove overflow-x from all table containers */
    div[style*="overflow-x: auto"],
    .fees-table-container,
    .markets-table-container,
    .wallets-transactions-table-wrapper {
        overflow-x: visible !important;
        overflow-y: visible;
    }
}

/* Convert tables with fintech-table-mobile-card class to cards on mobile */
@media (max-width: 768px) {
    /* For tables that should become cards on mobile */
    .fintech-table-mobile-card,
    table.fintech-table-mobile-card,
    .fintech-card table.fintech-table-mobile-card,
    #live-markets-table.fintech-table-mobile-card {
        display: block;
        width: 100%;
    }

    .fintech-table-mobile-card thead,
    table.fintech-table-mobile-card thead,
    .fintech-card table.fintech-table-mobile-card thead,
    #live-markets-table.fintech-table-mobile-card thead {
        display: none;
    }

    .fintech-table-mobile-card tbody,
    table.fintech-table-mobile-card tbody,
    .fintech-card table.fintech-table-mobile-card tbody,
    #live-markets-table.fintech-table-mobile-card tbody {
        display: block;
        width: 100%;
    }

    .fintech-table-mobile-card tbody tr,
    table.fintech-table-mobile-card tbody tr,
    .fintech-card table.fintech-table-mobile-card tbody tr,
    #live-markets-table.fintech-table-mobile-card tbody tr {
        display: block;
        /*background: rgba(8, 8, 11, 0.85);*/
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border: 1px solid rgba(45, 45, 50, 0.4);
        border-radius: 14px;
        padding: 18px;
        margin-bottom: 14px;
        box-shadow:
            0 6px 20px rgba(0, 0, 0, 0.7),
            0 2px 8px rgba(0, 0, 0, 0.5),
            inset 0 1px 2px rgba(0, 0, 0, 0.3);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        overflow: hidden;
    }

    .fintech-table-mobile-card tbody tr::before,
    table.fintech-table-mobile-card tbody tr::before,
    .fintech-card table.fintech-table-mobile-card tbody tr::before,
    #live-markets-table.fintech-table-mobile-card tbody tr::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(229, 229, 229, 0.2), transparent);
        opacity: 0.8;
    }

    .fintech-table-mobile-card tbody tr:last-child,
    table.fintech-table-mobile-card tbody tr:last-child,
    .fintech-card table.fintech-table-mobile-card tbody tr:last-child,
    #live-markets-table.fintech-table-mobile-card tbody tr:last-child {
        margin-bottom: 0;
    }

    .fintech-table-mobile-card tbody tr:hover,
    table.fintech-table-mobile-card tbody tr:hover,
    .fintech-card table.fintech-table-mobile-card tbody tr:hover,
    #live-markets-table.fintech-table-mobile-card tbody tr:hover {
        border-color: rgba(229, 229, 229, 0.4);
        box-shadow:
            0 10px 30px rgba(0, 0, 0, 0.8),
            0 4px 12px rgba(0, 0, 0, 0.6),
            0 0 16px rgba(229, 229, 229, 0.1),
            inset 0 1px 2px rgba(0, 0, 0, 0.3);
        transform: translateY(-2px);
    }

    .fintech-table-mobile-card tbody td,
    table.fintech-table-mobile-card tbody td,
    .fintech-card table.fintech-table-mobile-card tbody td,
    #live-markets-table.fintech-table-mobile-card tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 14px 0;
        border-bottom: 1px solid rgba(45, 45, 50, 0.3);
        text-align: left !important;
        width: 100%;
        min-height: 44px;
    }

    .fintech-table-mobile-card tbody td:last-child,
    table.fintech-table-mobile-card tbody td:last-child,
    .fintech-card table.fintech-table-mobile-card tbody td:last-child,
    #live-markets-table.fintech-table-mobile-card tbody td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .fintech-table-mobile-card tbody td::before,
    table.fintech-table-mobile-card tbody td::before,
    .fintech-card table.fintech-table-mobile-card tbody td::before,
    #live-markets-table.fintech-table-mobile-card tbody td::before {
        content: attr(data-label);
        font-size: 10px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--text-secondary);
        margin-right: 16px;
        min-width: 100px;
        flex-shrink: 0;
        opacity: 0.8;
    }

    /* Special handling for Action/Actions column */
    .fintech-table-mobile-card tbody td[data-label="Action"],
    .fintech-table-mobile-card tbody td[data-label="Actions"],
    table.fintech-table-mobile-card tbody td[data-label="Action"],
    table.fintech-table-mobile-card tbody td[data-label="Actions"],
    .fintech-card table.fintech-table-mobile-card tbody td[data-label="Action"],
    .fintech-card table.fintech-table-mobile-card tbody td[data-label="Actions"],
    #live-markets-table.fintech-table-mobile-card tbody td[data-label="Action"],
    #live-markets-table.fintech-table-mobile-card tbody td[data-label="Actions"] {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding-top: 16px;
    }

    .fintech-table-mobile-card tbody td[data-label="Action"]::before,
    .fintech-table-mobile-card tbody td[data-label="Actions"]::before,
    table.fintech-table-mobile-card tbody td[data-label="Action"]::before,
    table.fintech-table-mobile-card tbody td[data-label="Actions"]::before,
    .fintech-card table.fintech-table-mobile-card tbody td[data-label="Action"]::before,
    .fintech-card table.fintech-table-mobile-card tbody td[data-label="Actions"]::before,
    #live-markets-table.fintech-table-mobile-card tbody td[data-label="Action"]::before,
    #live-markets-table.fintech-table-mobile-card tbody td[data-label="Actions"]::before {
        margin-bottom: 8px;
        width: 100%;
        padding-bottom: 8px;
        border-bottom: 1px solid rgba(45, 45, 50, 0.3);
    }

    .fintech-table-mobile-card tbody td[data-label="Action"] > div,
    .fintech-table-mobile-card tbody td[data-label="Actions"] > div,
    table.fintech-table-mobile-card tbody td[data-label="Action"] > div,
    table.fintech-table-mobile-card tbody td[data-label="Actions"] > div,
    .fintech-card table.fintech-table-mobile-card tbody td[data-label="Action"] > div,
    .fintech-card table.fintech-table-mobile-card tbody td[data-label="Actions"] > div,
    #live-markets-table.fintech-table-mobile-card tbody td[data-label="Action"] > div,
    #live-markets-table.fintech-table-mobile-card tbody td[data-label="Actions"] > div {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .fintech-table-mobile-card tbody td[data-label="Action"] .fintech-btn,
    .fintech-table-mobile-card tbody td[data-label="Actions"] .fintech-btn,
    table.fintech-table-mobile-card tbody td[data-label="Action"] .fintech-btn,
    table.fintech-table-mobile-card tbody td[data-label="Actions"] .fintech-btn,
    .fintech-card table.fintech-table-mobile-card tbody td[data-label="Action"] .fintech-btn,
    .fintech-card table.fintech-table-mobile-card tbody td[data-label="Actions"] .fintech-btn,
    #live-markets-table.fintech-table-mobile-card tbody td[data-label="Action"] .fintech-btn,
    #live-markets-table.fintech-table-mobile-card tbody td[data-label="Actions"] .fintech-btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
        padding: 12px 16px;
    }

    /* Special handling for Pair/Asset column - make it more prominent */
    .fintech-table-mobile-card tbody td[data-label="Pair"],
    .fintech-table-mobile-card tbody td[data-label="Asset"],
    table.fintech-table-mobile-card tbody td[data-label="Pair"],
    table.fintech-table-mobile-card tbody td[data-label="Asset"],
    .fintech-card table.fintech-table-mobile-card tbody td[data-label="Pair"],
    .fintech-card table.fintech-table-mobile-card tbody td[data-label="Asset"],
    #live-markets-table.fintech-table-mobile-card tbody td[data-label="Pair"],
    #live-markets-table.fintech-table-mobile-card tbody td[data-label="Asset"] {
        border-bottom: 2px solid rgba(45, 45, 50, 0.5);
        padding-bottom: 18px;
        margin-bottom: 10px;
        padding-top: 0;
    }

    .fintech-table-mobile-card tbody td[data-label="Pair"]::before,
    .fintech-table-mobile-card tbody td[data-label="Asset"]::before,
    table.fintech-table-mobile-card tbody td[data-label="Pair"]::before,
    table.fintech-table-mobile-card tbody td[data-label="Asset"]::before,
    .fintech-card table.fintech-table-mobile-card tbody td[data-label="Pair"]::before,
    .fintech-card table.fintech-table-mobile-card tbody td[data-label="Asset"]::before,
    #live-markets-table.fintech-table-mobile-card tbody td[data-label="Pair"]::before,
    #live-markets-table.fintech-table-mobile-card tbody td[data-label="Asset"]::before {
        display: none;
    }

    /* Make Pair/Asset content larger and more prominent */
    .fintech-table-mobile-card tbody td[data-label="Pair"] a,
    .fintech-table-mobile-card tbody td[data-label="Asset"] a,
    table.fintech-table-mobile-card tbody td[data-label="Pair"] a,
    table.fintech-table-mobile-card tbody td[data-label="Asset"] a,
    .fintech-card table.fintech-table-mobile-card tbody td[data-label="Pair"] a,
    .fintech-card table.fintech-table-mobile-card tbody td[data-label="Asset"] a,
    #live-markets-table.fintech-table-mobile-card tbody td[data-label="Pair"] a,
    #live-markets-table.fintech-table-mobile-card tbody td[data-label="Asset"] a {
        width: 100%;
    }

    .fintech-table-mobile-card tbody td[data-label="Pair"] img,
    .fintech-table-mobile-card tbody td[data-label="Asset"] img,
    table.fintech-table-mobile-card tbody td[data-label="Pair"] img,
    table.fintech-table-mobile-card tbody td[data-label="Asset"] img,
    .fintech-card table.fintech-table-mobile-card tbody td[data-label="Pair"] img,
    .fintech-card table.fintech-table-mobile-card tbody td[data-label="Asset"] img,
    #live-markets-table.fintech-table-mobile-card tbody td[data-label="Pair"] img,
    #live-markets-table.fintech-table-mobile-card tbody td[data-label="Asset"] img {
        width: 36px !important;
        height: 36px !important;
    }

    /* Hide mobile-hide columns in card view */
    .fintech-table-mobile-card tbody td.mobile-hide,
    table.fintech-table-mobile-card tbody td.mobile-hide,
    .fintech-card table.fintech-table-mobile-card tbody td.mobile-hide,
    #live-markets-table.fintech-table-mobile-card tbody td.mobile-hide {
        display: none !important;
    }
}

/* Remove overflow-x from containers with mobile-card tables */
@media (max-width: 768px) {
    /* Remove horizontal scroll for mobile-card tables - use class-based approach */
    .dashboard-market-table > div:last-child {
        overflow-x: visible !important;
    }

    /* For fintech-card tables - force card view */
    .fintech-card table.fintech-table-mobile-card {
        display: block !important;
        width: 100% !important;
    }

    /* Override inline styles that might prevent card view */
    div[style*="overflow-x: auto"],
    .fintech-card[style*="overflow: hidden"] {
        overflow: visible !important;
        overflow-x: visible !important;
    }

    /* Wallet table specific - ensure wrapper doesn't interfere */
    .fintech-card:has(table.fintech-table-mobile-card) {
        padding: 0 !important;
        overflow: visible !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    /* Wallet table wrapper - remove all constraints */
    .fintech-card:has(table.fintech-table-mobile-card) table {
        margin: 0;
        padding: 0;
    }

    /* Ensure tbody is block */
    .fintech-card table.fintech-table-mobile-card tbody {
        display: block !important;
        width: 100% !important;
        padding: 0;
        margin: 0;
    }

    /* Ensure rows are cards */
    .fintech-card table.fintech-table-mobile-card tbody tr {
        display: block !important;
        width: 100% !important;
        margin: 0 0 14px 0 !important;
        padding: 18px !important;
        /*background: rgba(8, 8, 11, 0.85) !important;*/
        backdrop-filter: blur(16px) !important;
        -webkit-backdrop-filter: blur(16px) !important;
        border: 1px solid rgba(45, 45, 50, 0.4) !important;
        border-radius: 14px !important;
        box-shadow:
            0 6px 20px rgba(0, 0, 0, 0.7),
            0 2px 8px rgba(0, 0, 0, 0.5),
            inset 0 1px 2px rgba(0, 0, 0, 0.3) !important;
    }

    /* Override inline styles on wallet table cells */
    .fintech-card table.fintech-table-mobile-card tbody td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 14px 0 !important;
        border-bottom: 1px solid rgba(45, 45, 50, 0.3) !important;
        text-align: left !important;
        width: 100% !important;
        min-height: 44px !important;
    }

    /* Asset column - special styling */
    .fintech-card table.fintech-table-mobile-card tbody td[data-label="Asset"] {
        flex-direction: row !important;
        align-items: center !important;
        gap: 12px !important;
        padding-bottom: 18px !important;
        margin-bottom: 10px !important;
        padding-top: 0 !important;
        border-bottom: 2px solid rgba(45, 45, 50, 0.5) !important;
    }

    .fintech-card table.fintech-table-mobile-card tbody td[data-label="Asset"]::before {
        display: none !important;
    }

    .fintech-card table.fintech-table-mobile-card tbody td[data-label="Asset"] a {
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        width: 100% !important;
    }

    .fintech-card table.fintech-table-mobile-card tbody td[data-label="Asset"] img {
        width: 36px !important;
        height: 36px !important;
        flex-shrink: 0 !important;
    }

    /* Actions column - vertical buttons */
    .fintech-card table.fintech-table-mobile-card tbody td[data-label="Actions"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        padding-top: 16px !important;
        border-top: 1px solid rgba(45, 45, 50, 0.3) !important;
    }

    .fintech-card table.fintech-table-mobile-card tbody td[data-label="Actions"]::before {
        margin-bottom: 8px !important;
        width: 100% !important;
        padding-bottom: 8px !important;
        border-bottom: 1px solid rgba(45, 45, 50, 0.3) !important;
    }

    .fintech-card table.fintech-table-mobile-card tbody td[data-label="Actions"] > div {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .fintech-card table.fintech-table-mobile-card tbody td[data-label="Actions"] .fintech-btn {
        width: 100% !important;
        justify-content: center !important;
        min-height: 44px !important;
        padding: 12px 16px !important;
        font-size: 13px !important;
    }

    /* Hide Locked column on mobile */
    .fintech-card table.fintech-table-mobile-card tbody td.mobile-hide,
    .fintech-card table.fintech-table-mobile-card tbody td[data-label="Locked"] {
        display: none !important;
    }

    /* Specific override for dashboard */
    .dashboard-market-table {
        overflow: visible !important;
    }
}

/* NO horizontal scroll on any screen size - all tables use card layout on mobile/tablet */

/* ============================================
   CHARTS - RESPONSIVE & FULLSCREEN
   ============================================ */

@media (max-width: 768px) {
    /* Chart containers */
    canvas,
    #price-chart,
    #volume-chart,
    .coin-graphics {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 250px;
        max-height: 400px;
    }

    /* Chart wrapper */
    .chart-container,
    .markets-chart-container {
        position: relative;
        width: 100%;
        height: 250px;
        min-height: 250px;
    }

    /* Fullscreen toggle button */
    .chart-fullscreen-btn {
        position: absolute;
        top: 12px;
        right: 12px;
        z-index: 10;
        width: 44px;
        height: 44px;
        background: rgba(10, 10, 13, 0.9);
        border: 1px solid rgba(45, 45, 50, 0.5);
        border-radius: 8px;
        color: #E5E5E5;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        transition: all 0.2s;
    }

    .chart-fullscreen-btn:active {
        background: rgba(18, 18, 24, 0.95);
        transform: scale(0.95);
    }

    /* Fullscreen mode */
    .chart-fullscreen {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
        background: #050508;
        display: flex;
        flex-direction: column;
        padding: 16px;
    }

    .chart-fullscreen canvas {
        flex: 1;
        width: 100% !important;
        height: 100% !important;
        max-height: none !important;
        min-height: auto !important;
    }

    .chart-fullscreen-close {
        position: absolute;
        top: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
        background: rgba(10, 10, 13, 0.9);
        border: 1px solid rgba(45, 45, 50, 0.5);
        border-radius: 8px;
        color: #E5E5E5;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10000;
    }
}

/* Chart resize observer */
.chart-resize-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* ============================================
   PRICE DIRECTION INDICATORS
   ============================================ */

@media (max-width: 768px) {
    /* Direction blocks - vertical stack */
    .price-direction-block,
    .markets-change {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        padding: 12px;
        min-height: 60px;
        justify-content: center;
    }

    /* Large arrows/indicators */
    .price-direction-arrow {
        font-size: 24px;
        line-height: 1;
    }

    /* Percentage - larger */
    .markets-change {
        font-size: 16px;
        font-weight: 700;
    }

    /* Price - larger */
    .markets-price {
        font-size: 18px;
        font-weight: 700;
    }
}

/* ============================================
   DASHBOARD ADAPTATIONS
   ============================================ */

@media (max-width: 1024px) {
    .dashboard-main-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    .dashboard-stats {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 16px !important;
    }

    /* Live Markets table - use card layout on mobile */
    .dashboard-market-table {
        overflow-x: visible !important;
    }

    .dashboard-market-table table {
        min-width: 0 !important;
    }
}

@media (max-width: 768px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .dashboard-main-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    /* Stat cards on mobile */
    .stat-card {
        padding: 16px;
    }

    .stat-card-label {
        font-size: 11px;
    }

    .stat-card-value {
        font-size: 20px;
    }

    /* Dashboard header */
    .dashboard-header {
        padding: 20px 16px !important;
    }

    .dashboard-header-content {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 16px !important;
    }

    .dashboard-header-badge {
        width: 100%;
        padding: 14px 20px !important;
    }

    /* Charts - responsive */
    .dashboard-chart-card canvas {
        max-height: 250px !important;
        min-height: 200px !important;
    }

    /* Live Markets table wrapper - remove horizontal scroll on mobile, use cards instead */
    .dashboard-market-table {
        margin: 0;
        padding: 0;
    }

    .dashboard-market-table > div:first-child {
        padding: 16px !important;
    }

    .dashboard-market-table > div:last-child {
        overflow-x: visible !important;
        padding: 0 16px 16px 16px;
    }

    /* Remove min-width for card view */
    .dashboard-market-table table.fintech-table-mobile-card {
        min-width: auto !important;
        width: 100% !important;
    }

    /* Top Assets - make buttons touch-friendly */
    .dashboard-top-asset-item a {
        flex-wrap: wrap;
        gap: 8px;
    }

    .dashboard-top-asset-item .fintech-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 8px 12px;
    }

    /* Recent Transactions - limit height */
    .dashboard-transaction-item {
        padding: 10px 0;
    }
}

@media (max-width: 480px) {
    .dashboard-stats {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .dashboard-header {
        padding: 16px 12px !important;
    }

    .dashboard-header-badge {
        padding: 12px 16px !important;
    }

    .dashboard-header-badge .fintech-number-large {
        font-size: 24px !important;
    }

    /* Charts - smaller on very small screens */
    .dashboard-chart-card canvas {
        max-height: 200px !important;
        min-height: 180px !important;
    }

    /* Chart column is already hidden by mobile-hide class in card view */

    /* Top Assets - stack vertically */
    .dashboard-top-asset-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px 0;
    }

    .dashboard-top-asset-item > div:last-child {
        width: 100%;
        justify-content: space-between;
    }

    /* Top Movers - smaller padding */
    .dashboard-mover-item {
        padding: 8px 0;
    }

    /* Recent Transactions - smaller */
    .dashboard-transaction-item {
        padding: 8px 0;
        font-size: 12px;
    }
}

/* ============================================
   TRADE PAGE ADAPTATIONS
   ============================================ */

@media (max-width: 768px) {
    /* Trade form - stack vertically */
    .trade-form-container {
        flex-direction: column;
    }

    /* Order panel - full width */
    .order-panel {
        width: 100%;
        margin-bottom: 16px;
    }

    /* Chart timeframe buttons - scrollable */
    .chart-timeframe-buttons {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        padding-bottom: 8px;
    }

    .chart-timeframe-btn {
        scroll-snap-align: start;
        flex-shrink: 0;
        min-width: 60px;
        padding: 10px 16px;
    }
}

/* ============================================
   MARKETS PAGE SPECIFIC
   ============================================ */

@media (max-width: 1024px) {
    .markets-page-container {
        padding: 24px 20px;
    }

    .markets-header-panel {
        padding: 24px;
    }

    .markets-stats {
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .markets-page-container {
        padding: 16px 12px;
    }

    .markets-header-panel {
        padding: 20px;
        border-radius: 12px;
    }

    .markets-header-title {
        font-size: 28px;
    }

    .markets-stats {
        flex-direction: row;
        gap: 16px;
        flex-wrap: wrap;
    }

    .markets-stat-item {
        flex: 1;
        min-width: 120px;
    }

    .markets-filters-panel {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 16px;
    }

    .markets-tabs {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }

    .markets-tab-btn {
        flex: 1;
        min-width: 100px;
        min-height: 44px;
        padding: 12px 16px;
    }

    .markets-search-wrapper {
        width: 100%;
        max-width: 100%;
    }

    /* Chart cell - stack vertically */
    .markets-chart-cell {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .markets-chart-container {
        width: 100%;
        height: 80px;
        min-height: 80px;
    }

    .markets-trade-btn {
        width: 100%;
        text-align: center;
        padding: 12px;
        min-height: 44px;
    }

    /* Advanced filters - stack on mobile */
    .markets-filters-panel > div:last-child,
    .markets-advanced-filters {
        flex-direction: column !important;
        width: 100% !important;
        margin-left: 0 !important;
    }

    .markets-filters-panel > div:last-child > *,
    .markets-advanced-filters > * {
        width: 100%;
        max-width: 100%;
    }

    /* NO horizontal scroll - card layout is used */
}

@media (max-width: 480px) {
    .markets-page-container {
        padding: 12px;
    }

    .markets-header-panel {
        padding: 16px;
    }

    .markets-header-title {
        font-size: 24px;
    }

    .markets-stats {
        flex-direction: column;
        gap: 12px;
    }

    .markets-stat-item {
        width: 100%;
    }

    .markets-stat-value {
        font-size: 16px;
    }

    .markets-filters-panel {
        padding: 12px;
    }

    .markets-tab-btn {
        min-width: 80px;
        font-size: 11px;
        padding: 10px 12px;
    }

    /* Hide some columns on very small screens */
    .markets-table th:nth-child(4),
    .markets-table th:nth-child(5),
    .markets-table td:nth-child(4),
    .markets-table td:nth-child(5) {
        display: none;
    }

    /* Make price and change more prominent */
    .markets-price {
        font-size: 16px;
        font-weight: 700;
    }

    .markets-change {
        font-size: 14px;
        font-weight: 700;
    }

    /* Visualization toggle - full width */
    .markets-visualization-toggle {
        width: 100%;
        justify-content: space-between;
    }
}

/* ============================================
   SWAP PAGE ADAPTATIONS
   ============================================ */

@media (max-width: 1024px) {
    .swap-container {
        max-width: 100%;
        padding: 0 24px;
        margin: 32px auto;
    }
}

@media (max-width: 768px) {
    .swap-container {
        padding: 0 16px;
        margin: 24px auto;
    }

    .swap-header {
        margin-bottom: 24px;
    }

    .swap-header h1 {
        font-size: 24px;
    }

    .swap-card {
        padding: 20px;
    }

    .swap-pair-info {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
        padding: 14px;
    }

    .swap-pair-info-left,
    .swap-pair-info-right {
        width: 100%;
    }

    .swap-pair-info-right {
        text-align: left;
    }

    .swap-switch-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
    }

    .swap-input-wrapper {
        padding: 14px;
    }

    .swap-asset-selector {
        min-height: 44px;
    }

    .swap-input-field {
        font-size: 16px; /* Prevent zoom on iOS */
        min-height: 44px;
    }

    .swap-submit-btn {
        min-height: 44px;
        padding: 14px;
    }

    .swap-confirm-content,
    .swap-success-content {
        width: 95%;
        max-width: 95%;
        padding: 24px;
        margin: 20px;
    }

    .swap-confirm-actions {
        flex-direction: column;
        gap: 12px;
    }

    .swap-confirm-btn {
        width: 100%;
        min-height: 44px;
    }

    .asset-selector-dropdown {
        max-height: 250px;
    }
}

@media (max-width: 480px) {
    .swap-container {
        padding: 0 12px;
        margin: 16px auto;
    }

    .swap-header {
        margin-bottom: 20px;
    }

    .swap-header h1 {
        font-size: 20px;
    }

    .swap-header p {
        font-size: 11px;
    }

    .swap-card {
        padding: 16px;
        border-radius: 10px;
    }

    .swap-pair-info {
        padding: 12px;
        border-radius: 8px;
    }

    .swap-pair-value {
        font-size: 14px;
    }

    .swap-rate {
        font-size: 13px;
    }

    .swap-input-wrapper {
        padding: 12px;
    }

    .swap-preview,
    .swap-details {
        padding: 14px;
    }

    .swap-preview-row,
    .swap-details-row {
        padding: 10px 0;
    }

    .swap-confirm-content,
    .swap-success-content {
        width: 100%;
        max-width: 100%;
        padding: 20px;
        margin: 0;
        border-radius: 12px;
    }

    .swap-confirm-title,
    .swap-success-title {
        font-size: 18px;
    }
}

/* ============================================
   WALLETS PAGE ADAPTATIONS
   ============================================ */

/* Wallets page specific styles */
.wallets-header-card {
    margin-bottom: 24px;
    padding: 24px;
}

.wallets-header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
}

.wallets-header-title-section h1 {
    margin: 0 0 8px 0;
    font-size: 32px;
}

.wallets-header-title-section p {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wallets-header-badges {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.wallets-demo-badge {
    padding: 12px 20px;
    font-size: 12px;
}

.wallets-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.wallets-main-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
    margin-bottom: 24px;
}

.wallets-assets-card {
    padding: 0;
    overflow: hidden;
    height: auto;
    min-height: auto;
    align-self: start;
}

.wallets-search-filter {
    display: flex;
    gap: 8px;
}

.wallets-search-input {
    padding: 8px 12px;
    font-size: 12px;
    width: 200px;
}

.wallets-filter-select {
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    width: auto;
}

.wallets-balances-card {
    padding: 0;
    overflow: hidden;
    margin-bottom: 24px;
}

.wallets-auto-update-text {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wallets-transaction-flow-card {
    margin-bottom: 24px;
}

.wallets-chart-canvas {
    max-height: 200px;
}

.wallets-transactions-card {
    padding: 0;
    overflow: hidden;
}

.wallets-transactions-table-wrapper {
    overflow-x: auto;
}

.wallets-transactions-table {
    width: 100%;
    border-collapse: collapse;
}

.wallets-transaction-row {
    border-bottom: 1px solid rgba(45, 45, 50, 0.4);
    transition: all 0.2s;
}

.wallets-transaction-row:hover {
    background: rgba(45, 45, 50, 0.2);
    border-color: rgba(45, 45, 50, 0.4);
}

/* Wallet table wrapper styles */
.wallet-table-wrapper {
    padding: 0;
    overflow: hidden;
    background: rgba(8, 8, 11, 0.8);
    backdrop-filter: blur(12px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.6);
}

/* Wallet table base styles */
.wallet-table-header-row {
    border-bottom: 1px solid rgba(45, 45, 50, 0.4);
    background: rgba(8, 8, 11, 0.8);
    backdrop-filter: blur(8px);
}

/* Header row — без тёмного фона и закругления */
.wallet-table-header-row-dark {
    border-bottom: 1px solid rgba(45, 45, 50, 0.5);
    background: transparent !important;
    background-color: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-radius: 0 !important;
}

.wallet-table-header-row-dark th,
.wallet-table-header-row-dark .wallet-table-header,
table .wallet-table-header-row-dark,
table .wallet-table-header-row-dark th,
.wallet-table-wrapper .wallet-table-header-row-dark,
.wallet-table-wrapper .wallet-table-header-row-dark th,
.fintech-card .wallet-table-header-row-dark,
.fintech-card .wallet-table-header-row-dark th,
.wallets-transactions-table .wallet-table-header-row-dark,
.wallets-transactions-table .wallet-table-header-row-dark th,
table.fintech-table-mobile-card .wallet-table-header-row-dark,
table.fintech-table-mobile-card .wallet-table-header-row-dark th,
.fintech-table .wallet-table-header-row-dark,
.fintech-table .wallet-table-header-row-dark th,
.fintech-table-mobile-card .wallet-table-header-row-dark,
.fintech-table-mobile-card .wallet-table-header-row-dark th,
thead .wallet-table-header-row-dark,
thead .wallet-table-header-row-dark th,
:root.theme-light .wallet-table-header-row-dark,
:root.theme-light .wallet-table-header-row-dark th,
:root.theme-light .wallet-table-header-row-dark .wallet-table-header,
:root.theme-light table .wallet-table-header-row-dark,
:root.theme-light table .wallet-table-header-row-dark th,
:root.theme-light .wallet-table-wrapper .wallet-table-header-row-dark,
:root.theme-light .wallet-table-wrapper .wallet-table-header-row-dark th,
:root.theme-light .fintech-card .wallet-table-header-row-dark,
:root.theme-light .fintech-card .wallet-table-header-row-dark th,
:root.theme-light table.fintech-table-mobile-card .wallet-table-header-row-dark,
:root.theme-light table.fintech-table-mobile-card .wallet-table-header-row-dark th,
:root.theme-light .fintech-table .wallet-table-header-row-dark,
:root.theme-light .fintech-table .wallet-table-header-row-dark th,
:root.theme-light .fintech-table-mobile-card .wallet-table-header-row-dark,
:root.theme-light .fintech-table-mobile-card .wallet-table-header-row-dark th,
:root.theme-light thead .wallet-table-header-row-dark,
:root.theme-light thead .wallet-table-header-row-dark th {
    background: transparent !important;
    background-color: transparent !important;
    border-radius: 0 !important;
    border-bottom: 1px solid rgba(45, 45, 50, 0.5) !important;
}

.wallet-table-header {
    padding: 12px 16px;
    text-align: left;
    color: #999DB5;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wallet-table-header-right {
    text-align: right;
}

.wallet-table-row {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.wallet-table-row:hover {
    background: rgba(229, 229, 229, 0.03);
    border-color: var(--border-medium);
}

.wallet-table-cell {
    padding: 12px 16px;
    text-align: right;
}

.wallet-table-asset {
    text-align: left;
}

.wallet-asset-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.wallet-asset-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
}

.wallet-asset-placeholder {
    width: 32px;
    height: 32px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #E5E5E5;
    font-weight: 700;
    font-size: 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
}

.wallet-asset-symbol {
    color: #FFFFFF;
    font-weight: 600;
}

.wallet-available,
.wallet-usd {
    color: #FFFFFF;
    font-family: 'Roboto Mono', monospace;
}

.wallet-usd {
    font-weight: 600;
}

.wallet-locked {
    color: #999DB5;
    font-family: 'Roboto Mono', monospace;
}

.wallet-actions-buttons {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
}

.wallet-action-btn {
    padding: 8px 12px;
    font-size: 11px;
    text-decoration: none;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    /* CRITICAL: Force wallet table to be cards on mobile */
    .wallet-table-wrapper,
    .fintech-card.wallet-table-wrapper {
        padding: 0 !important;
        overflow: visible !important;
        background: transparent !important;
        box-shadow: none !important;
        max-width: 100% !important;
    }

    /* Force table to be block */
    .wallet-table-wrapper table,
    .wallet-table-wrapper .fintech-table-mobile-card,
    .fintech-card.wallet-table-wrapper table,
    .fintech-card.wallet-table-wrapper .fintech-table-mobile-card {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        table-layout: fixed !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
    }

    /* Hide thead */
    .wallet-table-wrapper thead,
    .wallet-table-wrapper .wallet-table-header-row,
    .wallet-table-wrapper .wallet-table-header-row-dark,
    .fintech-card.wallet-table-wrapper thead,
    .fintech-card.wallet-table-wrapper .wallet-table-header-row,
    .fintech-card.wallet-table-wrapper .wallet-table-header-row-dark {
        display: none !important;
    }

    /* Force tbody to be block */
    .wallet-table-wrapper tbody,
    .fintech-card.wallet-table-wrapper tbody {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Force rows to be cards */
    .wallet-table-wrapper tbody tr,
    .wallet-table-wrapper .wallet-table-row,
    .fintech-card.wallet-table-wrapper tbody tr,
    .fintech-card.wallet-table-wrapper .wallet-table-row {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 14px 0 !important;
        padding: 18px !important;
        /*background: rgba(8, 8, 11, 0.85) !important;*/
        /*backdrop-filter: blur(16px) !important;*/
        -webkit-backdrop-filter: blur(16px) !important;
        border: 1px solid rgba(45, 45, 50, 0.4) !important;
        border-radius: 14px !important;
        box-shadow:
            0 6px 20px rgba(0, 0, 0, 0.7),
            0 2px 8px rgba(0, 0, 0, 0.5),
            inset 0 1px 2px rgba(0, 0, 0, 0.3) !important;
        position: relative !important;
        overflow: hidden !important;
    }

    .wallet-table-wrapper tbody tr:last-child,
    .fintech-card.wallet-table-wrapper tbody tr:last-child {
        margin-bottom: 0 !important;
    }

    /* Force cells to be flex */
    .wallet-table-wrapper tbody td,
    .wallet-table-wrapper .wallet-table-cell,
    .fintech-card.wallet-table-wrapper tbody td,
    .fintech-card.wallet-table-wrapper .wallet-table-cell {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 14px 0 !important;
        border-bottom: 1px solid rgba(45, 45, 50, 0.3) !important;
        text-align: left !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 44px !important;
        box-sizing: border-box !important;
    }

    .wallet-table-wrapper tbody td:last-child,
    .fintech-card.wallet-table-wrapper tbody td:last-child {
        border-bottom: none !important;
        padding-bottom: 0 !important;
    }

    /* Add labels using data-label */
    .wallet-table-wrapper tbody td[data-label]::before,
    .fintech-card.wallet-table-wrapper tbody td[data-label]::before {
        content: attr(data-label) !important;
        font-size: 10px !important;
        font-weight: 700 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        color: var(--text-secondary) !important;
        margin-right: 16px !important;
        min-width: 100px !important;
        flex-shrink: 0 !important;
        opacity: 0.8 !important;
    }

    /* Asset column - special styling */
    .wallet-table-wrapper tbody td[data-label="Asset"],
    .wallet-table-wrapper .wallet-table-asset,
    .fintech-card.wallet-table-wrapper tbody td[data-label="Asset"],
    .fintech-card.wallet-table-wrapper .wallet-table-asset {
        flex-direction: row !important;
        align-items: center !important;
        gap: 12px !important;
        padding-bottom: 18px !important;
        margin-bottom: 10px !important;
        padding-top: 0 !important;
        border-bottom: 2px solid rgba(45, 45, 50, 0.5) !important;
    }

    .wallet-table-wrapper tbody td[data-label="Asset"]::before,
    .wallet-table-wrapper .wallet-table-asset::before,
    .fintech-card.wallet-table-wrapper tbody td[data-label="Asset"]::before,
    .fintech-card.wallet-table-wrapper .wallet-table-asset::before {
        display: none !important;
    }

    .wallet-table-wrapper .wallet-asset-link,
    .fintech-card.wallet-table-wrapper .wallet-asset-link {
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
    }

    .wallet-table-wrapper .wallet-asset-icon,
    .wallet-table-wrapper .wallet-asset-placeholder,
    .fintech-card.wallet-table-wrapper .wallet-asset-icon,
    .fintech-card.wallet-table-wrapper .wallet-asset-placeholder {
        width: 36px !important;
        height: 36px !important;
        flex-shrink: 0 !important;
    }

    /* Actions column - vertical buttons */
    .wallet-table-wrapper tbody td[data-label="Actions"],
    .wallet-table-wrapper .wallet-table-actions,
    .fintech-card.wallet-table-wrapper tbody td[data-label="Actions"],
    .fintech-card.wallet-table-wrapper .wallet-table-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        padding-top: 16px !important;
        border-top: 1px solid rgba(45, 45, 50, 0.3) !important;
    }

    .wallet-table-wrapper tbody td[data-label="Actions"]::before,
    .wallet-table-wrapper .wallet-table-actions::before,
    .fintech-card.wallet-table-wrapper tbody td[data-label="Actions"]::before,
    .fintech-card.wallet-table-wrapper .wallet-table-actions::before {
        margin-bottom: 8px !important;
        width: 100% !important;
        padding-bottom: 8px !important;
        border-bottom: 1px solid rgba(45, 45, 50, 0.3) !important;
    }

    .wallet-table-wrapper .wallet-actions-buttons,
    .fintech-card.wallet-table-wrapper .wallet-actions-buttons {
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .wallet-table-wrapper .wallet-action-btn,
    .fintech-card.wallet-table-wrapper .wallet-action-btn {
        width: 100% !important;
        justify-content: center !important;
        min-height: 44px !important;
        padding: 12px 16px !important;
        font-size: 13px !important;
    }

    /* Hide Locked column */
    .wallet-table-wrapper tbody td[data-label="Locked"],
    .wallet-table-wrapper .wallet-table-locked,
    .wallet-table-wrapper .mobile-hide,
    .fintech-card.wallet-table-wrapper tbody td[data-label="Locked"],
    .fintech-card.wallet-table-wrapper .wallet-table-locked,
    .fintech-card.wallet-table-wrapper .mobile-hide {
        display: none !important;
    }

    /* Ensure values are readable */
    .wallet-table-wrapper .wallet-available,
    .wallet-table-wrapper .wallet-usd,
    .fintech-card.wallet-table-wrapper .wallet-available,
    .fintech-card.wallet-table-wrapper .wallet-usd {
        font-size: 14px !important;
        font-weight: 600 !important;
    }
}

@media (max-width: 480px) {
    .wallet-table-row {
        padding: 16px !important;
        margin-bottom: 12px !important;
    }

    .wallet-table-cell {
        padding: 12px 0 !important;
        font-size: 13px !important;
    }

    .wallet-table-cell::before {
        font-size: 9px !important;
        min-width: 80px !important;
    }

    .wallet-asset-icon,
    .wallet-asset-placeholder {
        width: 32px !important;
        height: 32px !important;
    }

    .wallet-available,
    .wallet-usd {
        font-size: 13px !important;
    }

    .wallet-action-btn {
        font-size: 12px !important;
        padding: 10px 14px !important;
    }
}

/* ============================================
   CRITICAL FIX: Wallet Table Mobile Cards
   Maximum specificity to override everything
   ============================================ */

@media (max-width: 768px) {
    /* Force table wrapper to not interfere - override inline styles */
    div.wallet-table-wrapper.fintech-card,
    .fintech-card.wallet-table-wrapper,
    div.fintech-card:has(> table.fintech-table-mobile-card),
    div[class*="wallet-table-wrapper"] {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
        overflow-x: visible !important;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
    }

    /* Override inline styles on wrapper */
    div[style*="overflow: hidden"].wallet-table-wrapper,
    div[style*="overflow: hidden"].fintech-card.wallet-table-wrapper {
        overflow: visible !important;
        overflow-x: visible !important;
    }

    /* Force table to be block - maximum specificity - override inline styles */
    div.wallet-table-wrapper.fintech-card table,
    .fintech-card.wallet-table-wrapper table,
    div.fintech-card:has(> table.fintech-table-mobile-card) table,
    table.fintech-table.fintech-table-mobile-card.wallet-table-wrapper,
    .wallet-table-wrapper table.fintech-table.fintech-table-mobile-card,
    table[class*="fintech-table-mobile-card"],
    table[style*="width: 100%"].fintech-table-mobile-card {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        table-layout: fixed !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Hide thead completely */
    div.wallet-table-wrapper.fintech-card thead,
    .fintech-card.wallet-table-wrapper thead,
    div.fintech-card:has(> table.fintech-table-mobile-card) thead,
    table.fintech-table.fintech-table-mobile-card thead,
    .wallet-table-wrapper table.fintech-table.fintech-table-mobile-card thead {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        overflow: hidden !important;
    }

    /* Force tbody to block */
    div.wallet-table-wrapper.fintech-card tbody,
    .fintech-card.wallet-table-wrapper tbody,
    div.fintech-card:has(> table.fintech-table-mobile-card) tbody,
    table.fintech-table.fintech-table-mobile-card tbody,
    .wallet-table-wrapper table.fintech-table.fintech-table-mobile-card tbody {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Force rows to be block cards */
    div.wallet-table-wrapper.fintech-card tbody tr,
    .fintech-card.wallet-table-wrapper tbody tr,
    div.fintech-card:has(> table.fintech-table-mobile-card) tbody tr,
    table.fintech-table.fintech-table-mobile-card tbody tr,
    .wallet-table-wrapper table.fintech-table.fintech-table-mobile-card tbody tr,
    tr.wallet-table-row {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 0 14px 0 !important;
        padding: 18px !important;
        /*background: rgba(8, 8, 11, 0.85) !important;*/
        backdrop-filter: blur(16px) !important;
        -webkit-backdrop-filter: blur(16px) !important;
        border: 1px solid rgba(45, 45, 50, 0.4) !important;
        border-radius: 14px !important;
        box-shadow:
            0 6px 20px rgba(0, 0, 0, 0.7),
            0 2px 8px rgba(0, 0, 0, 0.5),
            inset 0 1px 2px rgba(0, 0, 0, 0.3) !important;
        position: relative !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }

    /* Force cells to flex */
    div.wallet-table-wrapper.fintech-card tbody td,
    .fintech-card.wallet-table-wrapper tbody td,
    div.fintech-card:has(> table.fintech-table-mobile-card) tbody td,
    table.fintech-table.fintech-table-mobile-card tbody td,
    .wallet-table-wrapper table.fintech-table.fintech-table-mobile-card tbody td,
    td.wallet-table-cell {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 14px 0 !important;
        border-bottom: 1px solid rgba(45, 45, 50, 0.3) !important;
        text-align: left !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        min-height: 44px !important;
        box-sizing: border-box !important;
    }

    /* Add labels */
    td.wallet-table-cell[data-label]::before,
    div.wallet-table-wrapper.fintech-card tbody td[data-label]::before,
    .fintech-card.wallet-table-wrapper tbody td[data-label]::before {
        content: attr(data-label) !important;
        font-size: 10px !important;
        font-weight: 700 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        color: var(--text-secondary) !important;
        margin-right: 16px !important;
        min-width: 100px !important;
        flex-shrink: 0 !important;
        opacity: 0.8 !important;
    }

    /* Asset column */
    td.wallet-table-asset[data-label="Asset"],
    div.wallet-table-wrapper.fintech-card tbody td[data-label="Asset"],
    .fintech-card.wallet-table-wrapper tbody td[data-label="Asset"] {
        flex-direction: row !important;
        align-items: center !important;
        gap: 12px !important;
        padding-bottom: 18px !important;
        margin-bottom: 10px !important;
        padding-top: 0 !important;
        border-bottom: 2px solid rgba(45, 45, 50, 0.5) !important;
    }

    td.wallet-table-asset[data-label="Asset"]::before,
    div.wallet-table-wrapper.fintech-card tbody td[data-label="Asset"]::before,
    .fintech-card.wallet-table-wrapper tbody td[data-label="Asset"]::before {
        display: none !important;
    }

    /* Actions column */
    td.wallet-table-actions[data-label="Actions"],
    div.wallet-table-wrapper.fintech-card tbody td[data-label="Actions"],
    .fintech-card.wallet-table-wrapper tbody td[data-label="Actions"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
        padding-top: 16px !important;
        border-top: 1px solid rgba(45, 45, 50, 0.3) !important;
    }

    td.wallet-table-actions[data-label="Actions"]::before,
    div.wallet-table-wrapper.fintech-card tbody td[data-label="Actions"]::before,
    .fintech-card.wallet-table-wrapper tbody td[data-label="Actions"]::before {
        margin-bottom: 8px !important;
        width: 100% !important;
        padding-bottom: 8px !important;
        border-bottom: 1px solid rgba(45, 45, 50, 0.3) !important;
    }

    /* Buttons in actions */
    .wallet-actions-buttons {
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .wallet-action-btn {
        width: 100% !important;
        justify-content: center !important;
        min-height: 44px !important;
        padding: 12px 16px !important;
        font-size: 13px !important;
    }

    /* Hide locked */
    td.wallet-table-locked,
    td.mobile-hide,
    div.wallet-table-wrapper.fintech-card tbody td[data-label="Locked"],
    .fintech-card.wallet-table-wrapper tbody td[data-label="Locked"] {
        display: none !important;
    }
}

@media (max-width: 768px) {
    /* Header section - stack vertically */
    .wallets-header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .wallets-header-title-section h1 {
        font-size: 24px;
        margin-bottom: 8px;
    }

    /* Header badges - stack on mobile */
    .wallets-header-badges {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }

    .dashboard-header-badge {
        width: 100%;
        padding: 12px 16px;
    }

    /* Stats grid - 2 columns */
    .wallets-stats-grid,
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .dashboard-stat-card {
        padding: 16px;
    }

    .stat-card-label {
        font-size: 11px;
    }

    .stat-card-value {
        font-size: 20px;
    }

    /* Main grid - single column */
    .wallets-main-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Asset table card header */
    .fintech-card-header {
        padding: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .fintech-card-header-title {
        font-size: 18px;
        margin-bottom: 0;
    }

    /* Search and filter - full width */
    .wallets-search-filter {
        width: 100%;
        flex-direction: column;
        gap: 8px;
    }

    .wallets-search-input,
    .wallets-filter-select {
        width: 100%;
        min-width: auto;
    }

    /* Charts - responsive */
    canvas {
        max-height: 250px;
        min-height: 200px;
    }

    .dashboard-chart-card canvas {
        max-height: 220px;
    }

    /* Asset distribution list */
    .fintech-list-item {
        padding: 12px;
        font-size: 13px;
    }

    /* Performance summary */
    .summary-block-item {
        padding: 10px 0;
        font-size: 13px;
    }

    /* Recent transactions table - convert to cards */
    .wallets-transactions-table-wrapper {
        overflow-x: visible;
    }

    .wallets-transactions-table {
        display: block;
        width: 100%;
    }

    .wallets-transactions-table thead {
        display: none;
    }

    .wallets-transactions-table tbody {
        display: block;
    }

    .wallets-transactions-table tbody tr {
        display: block;
        background: var(--bg-secondary);
        border: 1px solid var(--border-subtle);
        border-radius: 12px;
        padding: 16px;
        margin-bottom: 12px;
        box-shadow: var(--shadow-sm);
    }

    .wallets-transactions-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid var(--border-subtle);
        text-align: left;
    }

    .wallets-transactions-table tbody td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    /* Use data-label attribute for transaction table */
    .wallets-transactions-table tbody td[data-label]::before {
        content: attr(data-label);
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--text-secondary);
        margin-right: 12px;
        flex-shrink: 0;
    }

    /* Asset column - special styling */
    .wallets-transactions-table tbody td:first-child {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding-bottom: 16px;
        border-bottom: 1px solid var(--border-subtle);
    }

    .wallets-transactions-table tbody td:first-child::before {
        display: none;
    }

    /* Remove horizontal scroll */
    .wallets-assets-card,
    .wallets-transactions-card {
        overflow: visible;
    }

    .fintech-input {
        width: 100%;
    }
}

@media (max-width: 480px) {
    /* Stats grid - single column */
    .wallets-stats-grid,
    .dashboard-stats {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .dashboard-stat-card {
        padding: 14px;
    }

    .stat-card-value {
        font-size: 18px;
    }

    /* Header - more compact */
    .wallets-header-card {
        padding: 16px;
    }

    .wallets-header-title-section h1 {
        font-size: 20px;
    }

    .dashboard-header-badge {
        padding: 10px 14px;
    }

    /* Card headers - more compact */
    .fintech-card-header {
        padding: 12px;
    }

    .fintech-card-header-title {
        font-size: 16px;
    }

    /* Charts - smaller */
    canvas {
        max-height: 200px;
        min-height: 180px;
    }

    /* Enhanced card styles for very small screens */
    .fintech-table-mobile-card tbody tr,
    table.fintech-table-mobile-card tbody tr,
    .fintech-card table.fintech-table-mobile-card tbody tr,
    #live-markets-table.fintech-table-mobile-card tbody tr {
        padding: 14px;
        margin-bottom: 10px;
        border-radius: 12px;
    }

    .fintech-table-mobile-card tbody td,
    table.fintech-table-mobile-card tbody td,
    .fintech-card table.fintech-table-mobile-card tbody td,
    #live-markets-table.fintech-table-mobile-card tbody td {
        padding: 10px 0;
        font-size: 13px;
    }

    .fintech-table-mobile-card tbody td::before,
    table.fintech-table-mobile-card tbody td::before,
    .fintech-card table.fintech-table-mobile-card tbody td::before,
    #live-markets-table.fintech-table-mobile-card tbody td::before {
        font-size: 9px;
        min-width: 80px;
    }

    /* Make values more prominent */
    .fintech-table-mobile-card tbody td .fintech-number,
    table.fintech-table-mobile-card tbody td .fintech-number,
    .fintech-card table.fintech-table-mobile-card tbody td .fintech-number,
    #live-markets-table.fintech-table-mobile-card tbody td .fintech-number {
        font-size: 14px;
        font-weight: 600;
    }

    /* Improve button spacing in cards */
    .fintech-table-mobile-card tbody td[data-label="Action"] .fintech-btn,
    .fintech-table-mobile-card tbody td[data-label="Actions"] .fintech-btn,
    table.fintech-table-mobile-card tbody td[data-label="Action"] .fintech-btn,
    table.fintech-table-mobile-card tbody td[data-label="Actions"] .fintech-btn,
    .fintech-card table.fintech-table-mobile-card tbody td[data-label="Action"] .fintech-btn,
    .fintech-card table.fintech-table-mobile-card tbody td[data-label="Actions"] .fintech-btn,
    #live-markets-table.fintech-table-mobile-card tbody td[data-label="Action"] .fintech-btn,
    #live-markets-table.fintech-table-mobile-card tbody td[data-label="Actions"] .fintech-btn {
        font-size: 12px;
        padding: 10px 14px;
    }
}

/* ============================================
   TRANSACTIONS PAGE ADAPTATIONS
   ============================================ */

@media (max-width: 768px) {
    .transactions-filters {
        flex-direction: column !important;
        gap: 12px !important;
    }

    .transactions-filters form {
        width: 100% !important;
        max-width: none !important;
    }

    .transactions-table {
        overflow-x: visible !important;
    }

    .transactions-table table {
        min-width: 700px;
    }

    .transactions-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 480px) {
    /* Convert table to cards on very small screens */
    .transactions-table table {
        display: block;
    }

    .transactions-table thead {
        display: none;
    }

    .transactions-table tbody {
        display: block;
    }

    .transactions-table tbody tr {
        display: block;
        background: var(--bg-secondary);
        border: 1px solid var(--border-subtle);
        border-radius: 12px;
        padding: 16px;
        margin-bottom: 12px;
        box-shadow: var(--shadow-sm);
    }

    .transactions-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid var(--border-subtle);
        text-align: left !important;
    }

    .transactions-table tbody td:last-child {
        border-bottom: none;
    }

    .transactions-table tbody td::before {
        content: attr(data-label);
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--text-secondary);
        margin-right: 12px;
    }
}

/* ============================================
   KYC PAGE ADAPTATIONS
   ============================================ */

@media (max-width: 768px) {
    .kyc-container {
        padding: 24px 16px;
    }

    .kyc-header h1 {
        font-size: 28px;
    }

    .kyc-stepper {
        padding: 0 20px;
    }

    .kyc-stepper::before {
        left: 40px;
        right: 40px;
    }

    .kyc-stepper-progress {
        left: 40px;
    }

    .kyc-step-circle {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .kyc-step-label {
        font-size: 10px;
    }

    .kyc-form-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .kyc-upload-area {
        padding: 24px;
    }

    .kyc-trust-block {
        padding: 24px;
    }

    .kyc-trust-features {
        grid-template-columns: 1fr;
    }

    .kyc-nav-buttons {
        flex-direction: column;
    }

    .kyc-nav-buttons button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .kyc-stepper {
        padding: 0 10px;
    }

    .kyc-stepper::before {
        left: 30px;
        right: 30px;
    }

    .kyc-stepper-progress {
        left: 30px;
    }

    .kyc-step-label {
        font-size: 9px;
    }
}

/* ============================================
   TOUCH-FIRST UX IMPROVEMENTS
   ============================================ */

/* Replace hover with active/focus on touch devices */
@media (hover: none) and (pointer: coarse) {
    .fintech-btn:hover,
    .markets-tab-btn:hover,
    .markets-pagination-btn:hover {
        transform: none;
        box-shadow: inherit;
    }

    .fintech-btn:active,
    .markets-tab-btn:active,
    .markets-pagination-btn:active {
        transform: scale(0.98);
        opacity: 0.9;
    }

    /* Focus states for accessibility */
    .fintech-btn:focus-visible,
    .markets-tab-btn:focus-visible {
        outline: 2px solid rgba(46, 204, 113, 0.6);
        outline-offset: 2px;
    }
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS
   ============================================ */

@media (max-width: 768px) {
    /* Reduce shadows for performance */
    .fintech-card {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    }

    .fintech-card:hover {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    }

    /* Остальная анимация короче; градиент и лоадер — те же что на ПК */
    * {
        animation-duration: 0.2s !important;
        transition-duration: 0.2s !important;
    }
    :root {
        animation: none !important;
        transition-duration: 0.6s !important;
        --gx: 51%; --gy: -12%; --go: 1;
        --bx: 98%; --by: 110%; --bo: 0.95;
        --px: -8%; --py: 51%; --po: 1;
    }
    .fintech-global-loader,
    .fintech-global-loader *,
    .fintech-loader-spinner {
        animation-duration: 0.9s !important;
        transition-duration: 0.35s !important;
    }

    /* Lazy load charts */
    canvas[data-lazy] {
        opacity: 0;
        transition: opacity 0.3s;
    }

    canvas[data-lazy].loaded {
        opacity: 1;
    }
}

/* ============================================
   MARKET TABLE COMPONENT
   ============================================ */

@media (max-width: 768px) {
    /* Market table wrapper */
    .fintech-card table.fintech-table {
        min-width: 600px;
    }

    .fintech-card {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
    }

    /* Make action buttons touch-friendly */
    .fintech-card table.fintech-table td:last-child .fintech-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 10px 14px;
    }

    /* Hide less important columns on very small screens */
    @media (max-width: 480px) {
        .fintech-card table.fintech-table th:nth-child(4),
        .fintech-card table.fintech-table td:nth-child(4) {
            display: none;
        }
    }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.mobile-only {
    display: none;
}

.desktop-only {
    display: block;
}

@media (max-width: 1024px) {
    .mobile-only {
        display: block;
    }

    .desktop-only {
        display: none;
    }
}

/* Safe area insets for iOS */
@supports (padding: max(0px)) {
    .markets-page-container,
    .fintech-container,
    .kyc-container,
    .swap-container {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }
}

/* ============================================
   OVERFLOW FIXES - NO HORIZONTAL SCROLL
   ============================================ */

html, body {
    overflow-x: hidden !important;
    max-width: 100vw;
    width: 100%;
}

* {
    box-sizing: border-box;
}

/* Prevent horizontal scroll on all pages - CRITICAL */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
        position: relative;
        width: 100%;
        max-width: 100vw;
    }

    .fintech-container,
    .markets-page-container,
    .kyc-container,
    .swap-container,
    .fees-container,
    .wallets-page-wrapper,
    .transactions-container {
        max-width: 100% !important;
        overflow-x: hidden !important;
        padding-left: clamp(8px, 4vw, 16px) !important;
        padding-right: clamp(8px, 4vw, 16px) !important;
    }

    /* Remove all overflow-x auto/scroll */
    div[style*="overflow-x: auto"],
    div[style*="overflow-x: scroll"],
    .overflow-x-auto,
    .overflow-x-scroll {
        overflow-x: visible !important;
    }

    /* Remove all min-width constraints */
    table[style*="min-width"],
    .min-width-800,
    .min-width-600 {
        min-width: 0 !important;
        width: 100% !important;
    }
}

@media (max-width: 480px) {
    html, body {
        overflow-x: hidden !important;
    }

    .fintech-container,
    .markets-page-container,
    .kyc-container,
    .swap-container,
    .fees-container {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}

/* ============================================
   TABLET SPECIFIC (768px - 1024px)
   ============================================ */

@media (min-width: 768px) and (max-width: 1024px) {
    .fintech-container {
        padding: clamp(20px, 3vw, 24px) clamp(16px, 2.5vw, 20px) !important;
    }

    .fintech-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-main-grid {
        grid-template-columns: 1fr !important;
    }

    .wallets-main-grid {
        grid-template-columns: 1fr !important;
    }

    /* Tables can stay as tables on tablet, but ensure no overflow */
    table.fintech-table,
    .fintech-table {
        width: 100% !important;
        max-width: 100% !important;
    }

    div[style*="overflow-x"] {
        overflow-x: visible !important;
    }
}

/* ============================================
   FORMS - MOBILE ADAPTATIONS
   ============================================ */

@media (max-width: 768px) {
    /* Swap form */
    .swap-container {
        max-width: 100% !important;
        padding: 0 clamp(12px, 4vw, 20px) !important;
        margin: 20px auto !important;
    }

    .swap-card {
        padding: clamp(16px, 4vw, 24px) !important;
    }

    .swap-input-wrapper {
        padding: 12px !important;
    }

    .swap-input-field {
        font-size: 16px !important; /* Prevent zoom on iOS */
        min-height: 44px !important;
    }

    .swap-switch-btn {
        width: 44px !important;
        height: 44px !important;
    }

    .swap-submit-btn {
        min-height: 48px !important;
        padding: 14px 16px !important;
        font-size: 14px !important;
    }

    /* Asset selector dropdown */
    .asset-selector-dropdown {
        max-height: 50vh !important;
    }

    .asset-selector-item {
        min-height: 44px !important;
        padding: 12px 16px !important;
    }

    /* All form inputs */
    .fintech-input,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px !important; /* Prevent zoom on iOS */
        min-height: 44px !important;
        padding: 12px 16px !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Form labels */
    .fintech-input-label,
    .swap-input-label-text,
    label {
        font-size: clamp(11px, 3vw, 12px) !important;
        margin-bottom: 8px !important;
    }

    /* Form groups */
    .form-group,
    .swap-input-section {
        margin-bottom: 20px !important;
    }
}

@media (max-width: 480px) {
    .swap-container {
        padding: 0 12px !important;
        margin: 16px auto !important;
    }

    .swap-card {
        padding: 16px !important;
    }

    .swap-header h1 {
        font-size: clamp(20px, 6vw, 24px) !important;
    }

    .swap-header p {
        font-size: clamp(10px, 2.8vw, 12px) !important;
    }
}

/* ============================================
   LIVE SUPPORT WIDGET - MOBILE
   ============================================ */

@media (max-width: 768px) {
    #support-widget {
        bottom: max(16px, env(safe-area-inset-bottom)) !important;
        right: max(12px, env(safe-area-inset-right)) !important;
    }

    #support-toggle-btn {
        padding: 12px 16px !important;
        font-size: 12px !important;
        min-height: 44px !important;
        border-radius: 12px !important;
    }

    /* Panel: fixed, full-width with margins, scrollable if needed */
    #support-panel {
        position: fixed !important;
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        max-width: none !important;
        max-height: calc(100vh - 100px) !important;
        overflow-y: auto !important;
        bottom: 60px !important;
        border-radius: 14px !important;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 480px) {
    #support-widget {
        bottom: max(12px, env(safe-area-inset-bottom)) !important;
        right: max(8px, env(safe-area-inset-right)) !important;
    }

    #support-toggle-btn {
        padding: 10px 14px !important;
        font-size: 11px !important;
    }

    #support-panel {
        left: 8px !important;
        right: 8px !important;
        bottom: 56px !important;
    }

    /* Form inputs - prevent iOS zoom, touch-friendly */
    #support-panel input,
    #support-panel textarea,
    #support-panel select {
        font-size: 16px !important;
        min-height: 44px !important;
    }

    #support-panel textarea {
        min-height: 80px !important;
    }
}

/* ============================================
   FOOTER - MOBILE ADAPTATIONS
   ============================================ */

@media (max-width: 768px) {
    .footer-container {
        flex-direction: column !important;
        gap: 24px !important;
        padding: 24px clamp(16px, 4vw, 24px) !important;
    }

    .footer-section {
        width: 100% !important;
    }

    .footer-title__wrapper {
        min-height: 44px !important;
        padding: 12px 0 !important;
    }

    .footer-section ul {
        padding-left: 0 !important;
    }

    .footer-section li {
        min-height: 44px !important;
        padding: 8px 0 !important;
    }

    .footer-bottom {
        padding: 16px clamp(16px, 4vw, 24px) !important;
        text-align: center !important;
        font-size: clamp(11px, 3vw, 12px) !important;
    }
}

/* ============================================
   CHARTS - MOBILE ADAPTATIONS
   ============================================ */

@media (max-width: 768px) {
    .chart-container,
    .tradingview-widget-container,
    .markets-chart-container,
    canvas {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 200px !important;
    }

    .tradingview-widget-small-container {
        width: 100% !important;
        height: 80px !important;
        min-height: 80px !important;
    }
}

@media (max-width: 480px) {
    .chart-container,
    .tradingview-widget-container {
        min-height: 180px !important;
    }

    .tradingview-widget-small-container {
        height: 60px !important;
        min-height: 60px !important;
    }
}
