/* 
    Modern Mobile Trading Interface
    Inspired by: https://webtrader.ifc-f1nance.online/
    ✅ Modern, clean, user-friendly mobile UI
    ✅ Slide-out drawer menus
    ✅ Clean typography
    ✅ Modern grid systems
*/

/* ============================================================
   GLOBAL VISIBILITY HELPERS
   ============================================================ */
.mobile-only {
    display: none !important;
}

/* ============================================================
   MODERN MOBILE APP STYLES (IFC Style)
   ============================================================ */
@media (max-width: 768px) {
    :root {
        --m-bg: #ffffff;
        --m-surface: #f2f2f2;
        --m-surface-hover: #e8f7f7;
        --m-border: #e8ecef;
        --m-text: #20225b;
        --m-text-muted: #63657e;
        --m-accent: #00b172;
        --m-primary: #00b172;
        --m-success: #00b172;
        --m-danger: #e53935;
        --m-warning: #ffab00;
        --m-muted: #8a8c9e;
        --m-radius: 12px;
        --m-radius-sm: 8px;
        --m-radius-lg: 16px;
    }

    * {
        -webkit-tap-highlight-color: transparent;
    }

    body {
        background: var(--m-bg);
        color: var(--m-text);
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
        overflow-x: hidden;
    }

    /* Modern Header */
    .m-premium-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 56px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 16px;
        background: var(--m-bg);
        border-bottom: 1px solid var(--m-border);
        z-index: 1000;
    }

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

    .m-menu-btn {
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: var(--m-radius-sm);
        background: var(--m-surface);
        color: var(--m-text);
        border: none;
        cursor: pointer;
    }

    .m-logo-text {
        font-size: 18px;
        font-weight: 700;
        color: var(--m-text);
    }

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

    .m-balance-pill {
        background: var(--m-surface);
        padding: 6px 12px;
        border-radius: 20px;
        font-size: 13px;
        font-weight: 600;
        color: var(--m-success);
        cursor: pointer;
    }

    .m-header-user {
        cursor: pointer;
    }

    .m-header-user .user-avatar {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: var(--m-accent);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        font-weight: 700;
        color: white;
    }

    /* Slide-out Drawer */
    .m-drawer {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        background: var(--m-surface);
        z-index: 2000;
        transition: left 0.3s ease;
        display: flex;
        flex-direction: column;
    }

    .m-drawer.open {
        left: 0;
    }

    .m-drawer-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .m-drawer-overlay.open {
        opacity: 1;
        visibility: visible;
    }

    .m-drawer-header {
        padding: 20px 16px;
        border-bottom: 1px solid var(--m-border);
    }

    .m-user-info {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .m-avatar {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: var(--m-accent);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        font-weight: 600;
    }

    .m-user-details h3 {
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 2px;
    }

    .m-user-details p {
        font-size: 13px;
        color: var(--m-text-muted);
    }

    .m-drawer-nav {
        flex: 1;
        padding: 16px 0;
        overflow-y: auto;
    }

    .m-nav-section {
        margin-bottom: 24px;
    }

    .m-nav-title {
        font-size: 11px;
        font-weight: 600;
        color: var(--m-text-muted);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        padding: 0 16px 8px;
    }

    .m-nav-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
        color: var(--m-text);
        text-decoration: none;
        font-size: 15px;
        transition: background 0.2s;
    }

    .m-nav-item:hover,
    .m-nav-item.active {
        background: var(--m-surface-hover);
    }

    .m-nav-item i {
        width: 24px;
        text-align: center;
        color: var(--m-text-muted);
    }

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

    /* Main Content Area */
    .m-main-content {
        padding-top: 56px;
        padding-bottom: 70px;
        min-height: 100vh;
    }

    /* Market Grid/List Container */
    .m-market-container {
        padding: 0 16px 16px;
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #mSymbolPicker .m-market-container {
        height: calc(100vh - 200px);
        overflow-y: auto;
    }

    .m-section-title {
        font-size: 20px;
        font-weight: 700;
        margin-bottom: 16px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .m-view-all {
        font-size: 13px;
        color: var(--m-accent);
        text-decoration: none;
    }

    /* Modern Market Cards */
    .m-market-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-bottom: 24px;
    }

    .m-market-card {
        background: var(--m-surface);
        border-radius: var(--m-radius);
        padding: 16px;
        border: 1px solid var(--m-border);
    }

    .m-card-header {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 12px;
    }

    .m-card-icon {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: var(--m-bg);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
    }

    .m-card-title {
        font-size: 14px;
        font-weight: 600;
    }

    .m-card-price {
        font-size: 18px;
        font-weight: 700;
        margin-bottom: 4px;
    }

    .m-card-change {
        font-size: 13px;
        font-weight: 500;
    }

    .m-card-change.up {
        color: var(--m-success);
    }

    .m-card-change.down {
        color: var(--m-danger);
    }

    /* Modern List View */
    .m-list-view {
        background: var(--m-surface);
        border-radius: var(--m-radius);
        border: 1px solid var(--m-border);
        overflow: hidden;
    }

    .m-list-header {
        display: grid;
        grid-template-columns: 1fr auto auto;
        padding: 12px 16px;
        background: var(--m-surface-hover);
        border-bottom: 1px solid var(--m-border);
        font-size: 12px;
        font-weight: 600;
        color: var(--m-text-muted);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .m-list-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 16px;
        border-bottom: 1px solid var(--m-border);
        transition: background 0.2s;
        min-height: 56px;
    }

    .m-list-row:last-child {
        border-bottom: none;
    }

    .m-list-row:active {
        background: var(--m-surface-hover);
    }

    .m-asset-info {
        display: flex;
        align-items: center;
        gap: 10px;
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }

    /* === SYMBOL FLAG STYLES === */
    .symbol-flags {
        display: flex;
        align-items: center;
        margin-right: 12px;
        flex-shrink: 0;
        gap: 4px;
    }

    .s-flag {
        width: 26px;
        height: 26px;
        border-radius: 50%;
        object-fit: cover;
        border: 1.5px solid var(--m-surface);
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    }

    .q-flag {
        margin-left: -10px;
        z-index: 1;
    }

    .symbol-logo {
        width: 26px;
        height: 26px;
        border-radius: 50%;
        overflow: hidden;
        margin-right: 12px;
        background: #fff;
        border: 1.5px solid var(--m-surface);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    }

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

    .m-asset-meta {
        min-width: 0;
        overflow: hidden;
    }

    .m-asset-meta h4 {
        font-size: 15px;
        font-weight: 600;
        margin-bottom: 2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .m-asset-meta span {
        font-size: 12px;
        color: var(--m-text-muted);
        white-space: nowrap;
    }

    .m-asset-price {
        text-align: right;
        flex-shrink: 0;
        margin-left: 12px;
    }

    .m-asset-price .price {
        font-size: 15px;
        font-weight: 600;
        display: block;
        margin-bottom: 2px;
        white-space: nowrap;
    }

    .m-asset-price .change {
        font-size: 12px;
        font-weight: 500;
    }

    .m-asset-price .change.up,
    .m-asset-price .change.val-green {
        color: var(--m-success);
    }

    .m-asset-price .change.down,
    .m-asset-price .change.val-red {
        color: var(--m-danger);
    }

    .m-favorite-btn {
        width: 28px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: transparent;
        border: none;
        color: var(--m-text-muted);
        font-size: 14px;
        flex-shrink: 0;
        padding: 0;
        cursor: pointer;
    }

    .m-favorite-btn:active {
        transform: scale(0.95);
    }

    .m-favorite-btn.active {
        color: #fbbf24;
    }

    /* Bottom Navigation */
    .m-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 64px;
        background: var(--m-surface);
        border-top: 1px solid var(--m-border);
        display: flex;
        align-items: center;
        justify-content: space-around;
        z-index: 1000;
    }

    .m-nav-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        padding: 8px 12px;
        color: var(--m-text-muted);
        text-decoration: none;
        font-size: 11px;
        border: none;
        background: transparent;
    }

    .m-nav-btn i {
        font-size: 20px;
    }

    .m-nav-btn.active {
        color: var(--m-accent);
    }

    /* Search Bar */
    .m-search-container {
        padding: 12px 16px;
        background: var(--m-bg);
    }

    .m-search-box {
        display: flex;
        align-items: center;
        gap: 12px;
        background: var(--m-surface);
        border: 1px solid var(--m-border);
        border-radius: var(--m-radius-sm);
        padding: 10px 14px;
    }

    .m-search-box i {
        color: var(--m-text-muted);
        font-size: 16px;
    }

    .m-search-box input {
        flex: 1;
        border: none;
        background: transparent;
        color: var(--m-text);
        font-size: 15px;
        outline: none;
    }

    .m-search-box input::placeholder {
        color: var(--m-text-muted);
    }

    /* Modern Order Modal */
    .m-order-modal {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--m-surface);
        border-radius: var(--m-radius) var(--m-radius) 0 0;
        z-index: 3000;
        transform: translateY(100%);
        transition: transform 0.3s ease;
        max-height: 85vh;
        overflow-y: auto;
    }

    .m-order-modal.open {
        transform: translateY(0);
    }

    .m-modal-handle {
        width: 40px;
        height: 4px;
        background: var(--m-border);
        border-radius: 2px;
        margin: 12px auto;
    }

    .m-modal-header {
        padding: 16px;
        border-bottom: 1px solid var(--m-border);
    }

    .m-pair-display {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .m-pair-icons-large {
        position: relative;
        width: 48px;
        height: 32px;
    }

    .m-pair-icons-large img {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        position: absolute;
        border: 2px solid var(--m-surface);
    }

    .m-pair-icons-large img:first-child {
        left: 0;
        z-index: 1;
    }

    .m-pair-icons-large img:last-child {
        right: 0;
        z-index: 2;
    }

    .m-pair-info h2 {
        font-size: 18px;
        font-weight: 700;
    }

    .m-pair-info .price {
        font-size: 14px;
        color: var(--m-text-muted);
    }

    .m-order-tabs {
        display: flex;
        padding: 16px;
        gap: 8px;
    }

    .m-tab-btn {
        flex: 1;
        padding: 12px;
        border-radius: var(--m-radius-sm);
        border: none;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
    }

    .m-tab-btn.buy {
        background: rgba(63, 185, 80, 0.2);
        color: var(--m-success);
    }

    .m-tab-btn.sell {
        background: rgba(248, 81, 73, 0.2);
        color: var(--m-danger);
    }

    .m-order-form {
        padding: 16px;
    }

    .m-form-group {
        margin-bottom: 16px;
    }

    .m-form-label {
        display: block;
        font-size: 13px;
        color: var(--m-text-muted);
        margin-bottom: 8px;
    }

    .m-input-group {
        display: flex;
        background: var(--m-bg);
        border: 1px solid var(--m-border);
        border-radius: var(--m-radius-sm);
        overflow: hidden;
    }

    .m-input-group input {
        flex: 1;
        padding: 12px 14px;
        border: none;
        background: transparent;
        color: var(--m-text);
        font-size: 16px;
        outline: none;
    }

    .m-input-group .unit {
        padding: 12px 14px;
        background: var(--m-surface-hover);
        color: var(--m-text-muted);
        font-size: 14px;
        font-weight: 500;
    }

    .m-quick-amounts {
        display: flex;
        gap: 8px;
        margin-top: 8px;
    }

    .m-quick-btn {
        padding: 8px 14px;
        background: var(--m-surface-hover);
        border: 1px solid var(--m-border);
        border-radius: 20px;
        color: var(--m-text);
        font-size: 12px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s;
        display: flex;
        align-items: center;
        gap: 6px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    #m-category-tabs {
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    #m-category-tabs::-webkit-scrollbar {
        display: none;
    }

    .m-quick-btn:hover {
        background: var(--m-surface);
    }

    .m-quick-btn.active {
        background: var(--m-accent);
        border-color: var(--m-accent);
        color: white;
    }

    /* Mobile Page Overlay */
    .m-page-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--m-bg);
        z-index: 2500;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
    }

    .m-page-overlay .m-premium-header {
        position: sticky;
        top: 0;
    }

    .m-page-header {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 16px;
        border-bottom: 1px solid var(--m-border);
    }

    .m-page-header i {
        font-size: 20px;
        cursor: pointer;
        padding: 4px;
    }

    .m-page-header h2 {
        font-size: 20px;
        font-weight: 700;
        margin: 0;
    }

    .m-page-content {
        padding: 16px;
        flex: 1;
    }

    .m-page-desc {
        font-size: 13px;
        color: var(--m-text-muted);
        margin-bottom: 20px;
        line-height: 1.5;
    }

    .m-submit-btn {
        width: 100%;
        padding: 14px;
        border-radius: var(--m-radius-sm);
        border: none;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        margin-top: 24px;
    }

    .m-submit-btn.buy {
        background: var(--m-success);
        color: white;
    }

    .m-submit-btn.sell {
        background: var(--m-danger);
        color: white;
    }

    /* Chart Section */
    .m-chart-container {
        background: var(--m-surface);
        border-radius: var(--m-radius);
        margin: 16px;
        padding: 16px;
        border: 1px solid var(--m-border);
    }

    .m-chart-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 16px;
    }

    .m-timeframes {
        display: flex;
        gap: 8px;
    }

    .m-timeframe-btn {
        padding: 6px 10px;
        background: transparent;
        border: 1px solid var(--m-border);
        border-radius: var(--m-radius-sm);
        color: var(--m-text-muted);
        font-size: 12px;
        font-weight: 500;
    }

    .m-timeframe-btn.active {
        background: var(--m-accent);
        color: white;
        border-color: var(--m-accent);
    }

    .m-chart-placeholder {
        height: 250px;
        background: var(--m-bg);
        border-radius: var(--m-radius-sm);
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--m-text-muted);
    }

    /* Stats Grid */
    .m-stats-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        padding: 16px;
    }

    .m-stat-box {
        background: var(--m-surface);
        border-radius: var(--m-radius-sm);
        padding: 12px;
        text-align: center;
        border: 1px solid var(--m-border);
    }

    .m-stat-label {
        font-size: 11px;
        color: var(--m-text-muted);
        margin-bottom: 4px;
    }

    .m-stat-value {
        font-size: 14px;
        font-weight: 600;
    }

    /* Responsive adjustments */
    @media (max-width: 380px) {
        .m-market-grid {
            grid-template-columns: 1fr;
        }

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

    /* Legacy Icon Compatibility - Eski ikonlar için destek */
    .symbol-flags {
        display: flex;
        align-items: center;
        position: relative;
        width: 40px;
        height: 28px;
        flex-shrink: 0;
    }

    .symbol-flags .s-flag {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        border: 2px solid var(--m-surface);
        position: absolute;
        object-fit: cover;
    }

    .symbol-flags .s-flag:first-child {
        left: 0;
        top: 0;
        z-index: 1;
    }

    .symbol-flags .s-flag.q-flag {
        right: 0;
        bottom: 0;
        z-index: 2;
        margin-left: 0;
    }

    .symbol-logo {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        overflow: hidden;
        background: var(--m-bg);
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px solid var(--m-border);
        flex-shrink: 0;
    }

    .symbol-logo img,
    .symbol-logo .s-logo {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* m-asset-info içindeki eski ikonlar için */
    .m-asset-info .symbol-flags,
    .m-asset-info .symbol-logo {
        margin: 0;
    }

    /* Active Pair Bar Legacy Styles */
    .m-active-pair-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 16px;
        background: var(--m-surface);
        border-bottom: 1px solid var(--m-border);
        cursor: pointer;
    }

    .m-active-pair-bar .pair-info {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .m-active-pair-bar .pair-icons {
        display: flex;
        align-items: center;
        position: relative;
        width: 40px;
        height: 28px;
    }

    .m-active-pair-bar .pair-icons img {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        border: 2px solid var(--m-surface);
        position: absolute;
        object-fit: cover;
    }

    .m-active-pair-bar .pair-icons img:first-child {
        left: 0;
        top: 0;
        z-index: 1;
    }

    .m-active-pair-bar .pair-icons img:last-child {
        right: 0;
        bottom: 0;
        z-index: 2;
        margin-left: 0;
    }

    .m-active-pair-bar .pair-meta {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .m-active-pair-bar .pair-name-row {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .m-active-pair-bar .pair-name {
        font-size: 16px;
        font-weight: 700;
        color: var(--m-text);
    }

    .m-active-pair-bar .pair-name-row i {
        font-size: 12px;
        color: var(--m-text-muted);
    }

    .m-active-pair-bar .pair-change {
        font-size: 13px;
        font-weight: 600;
    }

    .m-active-pair-bar .pair-change.val-green {
        color: var(--m-success);
    }

    .m-active-pair-bar .pair-change.val-red {
        color: var(--m-danger);
    }

    .m-active-pair-bar .pair-extra-icons {
        display: flex;
        gap: 16px;
        color: var(--m-text-muted);
        font-size: 20px;
    }
}

/* ============================================================
   MAIN MOBILE APP STRUCTURE (Ana Sayfa)
   ============================================================ */
@media (max-width: 768px) {
    .m-main-content {
        padding-top: 56px;
        padding-bottom: 100px;
        min-height: 100vh;
        background: var(--m-bg);
    }

    /* Chart Section */
    .m-chart-section {
        background: var(--m-bg);
        border-bottom: 1px solid var(--m-border);
    }

    .m-chart-toolbar {
        height: 40px;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 0 12px;
        background: var(--m-surface);
        border-bottom: 1px solid var(--m-border);
        color: var(--m-text-muted);
        font-size: 13px;
        overflow-x: auto;
    }

    .m-chart-toolbar i {
        font-size: 14px;
        padding: 4px;
    }

    .m-chart-toolbar span {
        white-space: nowrap;
    }

    .m-tv-container {
        height: 300px;
        background: var(--m-bg);
    }

    /* Bottom Tabs */
    .m-bottom-tabs {
        display: flex;
        background: var(--m-surface);
        border-bottom: 1px solid var(--m-border);
    }

    .m-b-tab {
        flex: 1;
        padding: 12px 8px;
        text-align: center;
        font-size: 13px;
        font-weight: 500;
        color: var(--m-text-muted);
        cursor: pointer;
        border-bottom: 2px solid transparent;
        white-space: nowrap;
    }

    .m-b-tab.active {
        color: var(--m-accent);
        border-bottom-color: var(--m-accent);
    }

    .m-bottom-content {
        background: var(--m-bg);
        min-height: 150px;
    }

    .m-list-empty {
        padding: 32px 24px;
        text-align: center;
        color: var(--m-text-muted);
        font-size: 14px;
    }

    /* Fixed Action Bar */
    .m-action-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 80px;
        background: var(--m-bg);
        border-top: 1px solid var(--m-border);
        display: flex;
        padding: 12px 16px;
        gap: 12px;
        z-index: 1000;
    }

    .m-btn-buy, .m-btn-sell {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 10px;
        border: none;
        border-radius: var(--m-radius-sm);
        cursor: pointer;
        font-family: inherit;
    }

    .m-btn-buy {
        background: var(--m-success);
        color: white;
    }

    .m-btn-sell {
        background: var(--m-danger);
        color: white;
    }

    .m-btn-buy .btn-lbl, .m-btn-sell .btn-lbl {
        font-size: 12px;
        font-weight: 600;
        opacity: 0.9;
    }

    .m-btn-buy .btn-price, .m-btn-sell .btn-price {
        font-size: 16px;
        font-weight: 700;
    }

    /* Order Overlay/Modal */
    .m-order-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.8);
        z-index: 3000;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
    }

    .m-order-header {
        background: var(--m-surface);
        padding: 16px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid var(--m-border);
    }

    .m-order-pair {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .m-order-pair .pair-icons {
        display: flex;
        align-items: center;
        position: relative;
        width: 40px;
        height: 28px;
    }

    .m-order-pair .pair-icons img {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        border: 2px solid var(--m-surface);
        position: absolute;
        object-fit: cover;
    }

    .m-order-pair .pair-icons img:first-child {
        left: 0;
        z-index: 1;
    }

    .m-order-pair .pair-icons img:last-child {
        right: 0;
        z-index: 2;
    }

    .m-order-pair .pair-meta {
        display: flex;
        flex-direction: column;
    }

    .m-order-pair .pair-meta strong {
        font-size: 16px;
        color: var(--m-text);
    }

    .m-order-pair .pair-meta span {
        font-size: 13px;
        color: var(--m-text-muted);
    }

    .m-order-header > i {
        font-size: 20px;
        color: var(--m-text-muted);
        cursor: pointer;
        padding: 8px;
    }

    .m-order-content {
        background: var(--m-surface);
        padding: 16px;
        max-height: 70vh;
        overflow-y: auto;
    }

    .m-order-type-toggle {
        display: flex;
        gap: 8px;
        margin-bottom: 16px;
    }

    .m-order-type-toggle button {
        flex: 1;
        padding: 12px;
        border: 1px solid var(--m-border);
        background: var(--m-bg);
        color: var(--m-text);
        border-radius: var(--m-radius-sm);
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
    }

    .m-order-type-toggle button.active {
        background: var(--m-success);
        border-color: var(--m-success);
        color: white;
    }

    .m-order-type-toggle button:last-child.active {
        background: var(--m-danger);
        border-color: var(--m-danger);
    }

    /* Order Form Elements */
    .m-order-form {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .m-form-group {
        margin-bottom: 8px;
    }

    .m-form-group > label {
        display: block;
        font-size: 13px;
        font-weight: 500;
        color: var(--m-text);
        margin-bottom: 8px;
    }

    .m-form-sub {
        font-size: 12px;
        color: var(--m-text-muted);
        margin-top: 6px;
    }

    .m-form-sub span {
        color: var(--m-accent);
        font-weight: 600;
    }

    /* Input Stepper */
    .m-input-stepper {
        display: flex;
        align-items: center;
        gap: 0;
        background: var(--m-bg);
        border: 1px solid var(--m-border);
        border-radius: var(--m-radius-sm);
        overflow: hidden;
    }

    .m-input-stepper button {
        width: 36px;
        height: 40px;
        background: var(--m-surface);
        border: none;
        color: var(--m-text);
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .m-input-stepper button:active {
        background: var(--m-surface-hover);
    }

    .m-input-stepper input {
        flex: 1;
        height: 40px;
        background: transparent;
        border: none;
        color: var(--m-text);
        font-size: 15px;
        font-weight: 600;
        text-align: center;
        outline: none;
    }

    .m-input-stepper.small {
        height: 36px;
    }

    .m-input-stepper.small button {
        width: 32px;
        height: 36px;
        font-size: 14px;
    }

    .m-input-stepper.small input {
        height: 36px;
        font-size: 13px;
    }

    /* Order Options (TP/SL/Limit) */
    .m-order-options {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .m-opt-row {
        background: var(--m-bg);
        border: 1px solid var(--m-border);
        border-radius: var(--m-radius-sm);
        padding: 12px;
    }

    .m-opt-row .m-input-stepper {
        width: 100%;
        margin-top: 0;
    }

    .m-opt-row .m-input-stepper input {
        text-align: center;
    }

    .m-opt-head {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 10px;
        font-size: 14px;
        font-weight: 500;
        color: var(--m-text);
    }

    .m-opt-inputs {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
    }

    .m-opt-inputs input {
        flex: 1 1 0;
        min-width: 0;
        height: 40px;
        background: var(--m-surface);
        border: 1px solid var(--m-border);
        border-radius: var(--m-radius-sm);
        padding: 0 12px;
        color: var(--m-text);
        font-size: 13px;
        outline: none;
        box-sizing: border-box;
    }

    .m-opt-inputs input:focus {
        border-color: var(--m-accent);
    }

    .m-opt-inputs input::placeholder {
        color: var(--m-text-muted);
    }

    .m-opt-inputs .sep {
        font-size: 12px;
        color: var(--m-text-muted);
        white-space: nowrap;
        flex-shrink: 0;
        padding: 0 4px;
    }

    /* Toggle Switch */
    .m-switch {
        position: relative;
        display: inline-block;
        width: 44px;
        height: 24px;
    }

    .m-switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

    .m-switch .slider {
        position: absolute;
        cursor: pointer;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: var(--m-border);
        transition: 0.3s;
        border-radius: 24px;
    }

    .m-switch .slider:before {
        position: absolute;
        content: "";
        height: 18px;
        width: 18px;
        left: 3px;
        bottom: 3px;
        background-color: white;
        transition: 0.3s;
        border-radius: 50%;
    }

    .m-switch input:checked + .slider {
        background-color: var(--m-accent);
    }

    .m-switch input:checked + .slider:before {
        transform: translateX(20px);
    }

    /* Execute Button */
    .m-btn-execute {
        width: 100%;
        padding: 16px;
        border: none;
        border-radius: var(--m-radius-sm);
        background: var(--m-success);
        color: white;
        font-size: 15px;
        font-weight: 700;
        cursor: pointer;
        margin-top: 8px;
    }

    .m-btn-execute.sell {
        background: var(--m-danger);
    }

    /* Auth Form Stilleri (Login/Register) */
    .login-container {
        min-height: 100vh;
        background: var(--m-bg);
        padding: 20px;
        display: flex;
        flex-direction: column;
    }

    .m-header-logo {
        text-align: center;
        padding: 20px 0;
    }

    .m-header-logo img {
        height: 32px;
        opacity: 0.9;
    }

    .m-auth-card {
        background: var(--m-surface);
        border-radius: var(--m-radius-lg);
        padding: 28px 24px;
        margin-top: auto;
        margin-bottom: auto;
    }

    .m-auth-title {
        font-size: 28px;
        font-weight: 800;
        color: var(--m-text);
        margin: 0 0 8px 0;
    }

    .m-auth-subtitle {
        font-size: 14px;
        color: var(--m-text-muted);
        margin: 0 0 28px 0;
    }

    .m-form-group {
        margin-bottom: 20px;
    }

    .m-form-label {
        display: block;
        font-size: 13px;
        font-weight: 500;
        color: var(--m-text-muted);
        margin-bottom: 8px;
    }

    .m-form-input {
        width: 100%;
        height: 48px;
        background: var(--m-bg);
        border: 1px solid var(--m-border);
        border-radius: var(--m-radius-sm);
        padding: 0 16px;
        color: var(--m-text);
        font-size: 15px;
        outline: none;
        transition: border-color 0.2s;
        box-sizing: border-box;
    }

    .m-form-input:focus {
        border-color: var(--m-accent);
    }

    .m-form-input::placeholder {
        color: var(--m-text-muted);
    }

    .m-btn-submit {
        width: 100%;
        height: 48px;
        background: var(--m-accent);
        border: none;
        border-radius: var(--m-radius-sm);
        color: white;
        font-size: 15px;
        font-weight: 700;
        cursor: pointer;
        margin-top: 8px;
        transition: opacity 0.2s;
    }

    .m-btn-submit:active {
        opacity: 0.8;
    }

    /* Phone Input */
    .m-phone-input {
        display: flex;
        align-items: center;
        gap: 0;
        background: var(--m-bg);
        border: 1px solid var(--m-border);
        border-radius: var(--m-radius-sm);
        overflow: hidden;
    }

    .m-phone-prefix {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 0 12px;
        height: 48px;
        background: var(--m-surface);
        border-right: 1px solid var(--m-border);
        font-size: 14px;
        font-weight: 600;
        color: var(--m-text);
        white-space: nowrap;
    }

    .m-phone-input input {
        flex: 1;
        height: 48px;
        background: transparent;
        border: none;
        padding: 0 16px;
        color: var(--m-text);
        font-size: 15px;
        outline: none;
    }

    /* Password Hint */
    .m-password-hint {
        font-size: 12px;
        color: var(--m-text-muted);
        margin-top: 8px;
        line-height: 1.5;
    }

    /* Profile List Stilleri - Tek Satır Düzen */
    .m-profile-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .m-p-item {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 14px 0;
        border-bottom: 1px solid var(--m-border);
        min-height: 50px;
    }

    .m-p-item .p-label {
        font-size: 14px;
        font-weight: 400;
        color: var(--m-text);
        min-width: 120px;
        flex-shrink: 0;
    }

    .m-p-item .p-val {
        font-size: 14px;
        font-weight: 500;
        color: var(--m-text);
        flex: 1;
        text-align: left;
        padding: 0 12px;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .m-p-item .p-val:empty::before {
        content: "-";
        color: var(--m-text-muted);
    }

    .m-p-item .p-edit {
        padding: 8px 16px;
        background: var(--m-surface);
        border: 1px solid var(--m-border);
        border-radius: 8px;
        color: var(--m-text);
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        font-family: inherit;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .m-p-item .p-edit:active {
        background: var(--m-surface-hover);
    }

    /* ============================================================
       ACCOUNT PANEL STYLES (Görsel 2)
       ============================================================ */
    .m-account-overlay {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1500;
    backdrop-filter: blur(2px);
    transition: all 0.3s ease;
}

.m-account-content {
    background: var(--m-surface);
    padding: 10px 16px;
    border-bottom: 1px solid var(--m-border);
    animation: slideDownPanel 0.3s ease forwards;
}

@keyframes slideDownPanel {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.m-acc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.m-acc-row:last-of-type {
    border-bottom: none;
}

.m-acc-row span {
    font-size: 14px;
    color: var(--m-text-muted);
    font-weight: 500;
}

.m-acc-row strong {
    font-size: 14px;
    color: var(--m-text);
    font-weight: 600;
}

.m-acc-chart-placeholder {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding: 16px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.m-mini-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 24px;
}

.m-mini-bar-chart .bar {
    width: 6px;
    background: var(--m-primary);
    border-radius: 2px;
    opacity: 0.6;
}

    .chart-val {
        font-size: 14px;
        font-weight: 700;
        color: var(--m-text);
    }
}

/* ============================================================
   LEGACY MOBILE STYLES (Backward Compatibility)
   ============================================================ */
@media (max-width: 768px) {
    .mobile-only {
        display: block !important;
    }

    .desktop-only {
        display: none !important;
    }
}

/* ============================================================
   MOBILE LOGIN & AUTH STYLES (PREMIUM DESIGN)
   ============================================================ */
@media (max-width: 768px) {
    .login-container {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        justify-content: center;
        min-height: 100vh;
        min-height: 100dvh;
        padding: calc(16px + env(safe-area-inset-top, 0)) 16px calc(16px + env(safe-area-inset-bottom, 0));
        background: radial-gradient(circle at top, var(--m-surface) 0%, var(--m-bg) 100%);
        position: relative;
        overflow: hidden;
    }

    /* Decorative background elements */
    .login-container::before {
        content: '';
        position: absolute;
        top: -10%;
        left: -10%;
        width: 300px;
        height: 300px;
        background: rgba(59, 130, 246, 0.15);
        filter: blur(100px);
        border-radius: 50%;
        z-index: 0;
    }

    .login-container::after {
        content: '';
        position: absolute;
        bottom: -10%;
        right: -10%;
        width: 300px;
        height: 300px;
        background: rgba(14, 203, 129, 0.1);
        filter: blur(100px);
        border-radius: 50%;
        z-index: 0;
    }

    .m-header-logo {
        position: relative;
        z-index: 1;
        margin-bottom: 40px;
        animation: fadeDown 0.6s ease-out forwards;
    }

    .m-header-logo img {
        height: 36px !important;
        /* Turn the blue logo white for better dark mode contrast */
        filter: brightness(0) invert(1) drop-shadow(0 4px 6px rgba(0,0,0,0.3));
    }

    .m-auth-card {
        position: relative;
        z-index: 1;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        background: rgba(26, 29, 36, 0.6);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 24px;
        padding: 32px 24px;
        box-shadow: 0 20px 40px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05);
        animation: fadeUp 0.6s ease-out forwards;
    }

    .m-auth-title {
        font-size: 28px;
        font-weight: 800;
        margin-bottom: 8px;
        background: linear-gradient(135deg, #ffffff 0%, #a0aec0 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        letter-spacing: -0.5px;
    }

    .m-auth-subtitle {
        font-size: 14px;
        color: var(--m-text-muted);
        margin-bottom: 32px;
        line-height: 1.5;
    }

    .m-form-group {
        margin-bottom: 20px;
        position: relative;
    }

    .m-form-label {
        display: block;
        font-size: 13px;
        font-weight: 600;
        color: var(--m-text);
        margin-bottom: 8px;
        letter-spacing: 0.3px;
    }

    .m-form-input {
        width: 100%;
        height: 52px;
        background: rgba(0, 0, 0, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        padding: 0 16px;
        color: #ffffff;
        font-size: 15px;
        transition: all 0.3s ease;
        box-sizing: border-box;
    }

    .m-form-input::placeholder {
        color: rgba(255, 255, 255, 0.3);
    }

    .m-form-input:focus {
        outline: none;
        background: rgba(0, 0, 0, 0.4);
        border-color: var(--m-primary);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    }

    .m-btn-submit {
        width: 100%;
        height: 52px;
        border: none;
        border-radius: 12px;
        background: linear-gradient(135deg, var(--m-accent) 0%, #0ca668 100%);
        color: #ffffff;
        font-size: 16px;
        font-weight: 700;
        letter-spacing: 0.5px;
        cursor: pointer;
        margin-top: 12px;
        box-shadow: 0 8px 16px rgba(14, 203, 129, 0.2);
        transition: all 0.2s ease;
        position: relative;
        overflow: hidden;
    }

    .m-btn-submit::after {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 50%;
        height: 100%;
        background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0) 100%);
        transform: skewX(-20deg);
        animation: btnShimmer 3s infinite;
    }

    .m-btn-submit:active {
        transform: scale(0.97);
        box-shadow: 0 4px 8px rgba(14, 203, 129, 0.2);
    }

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

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

    .login-container.m-auth-full,
    .login-container.m-auth-full .m-auth-card {
        width: 100%;
        max-width: 100%;
    }

    .m-auth-full {
        padding-left: 16px;
        padding-right: 16px;
        box-sizing: border-box;
    }

    @keyframes btnShimmer {
        0% { left: -100%; }
        20% { left: 200%; }
        100% { left: 200%; }
    }
}

/* ============================================================
   COMPREHENSIVE RESPONSIVE SYSTEM
   Breakpoints: 480px (phone), 768px (tablet), 1024px (desktop)
   ============================================================ */

/* --- Global: safe area, touch targets, overflow --- */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-size: 14px;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

a, button, .btn, .nav-item, .m-nav-btn, .turan-mobile-nav a,
input[type="submit"], input[type="button"], .py-tab, .py-copy-btn {
    min-height: 44px;
    min-width: 44px;
}

button, .btn, input[type="submit"] {
    touch-action: manipulation;
}

img, video, svg, canvas {
    max-width: 100%;
    height: auto;
}

/* --- Mobile dashboard shell (portfolio, para-yatir, etc.) --- */
.m-dash-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(56px + env(safe-area-inset-top, 0));
    padding-top: env(safe-area-inset-top, 0);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 12px;
    padding-right: 12px;
    background: #fff;
    border-bottom: 1px solid #e8ecef;
    z-index: 900;
    font-family: 'Onest', sans-serif;
}

.m-dash-menu-btn,
.m-dash-home {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #f2f2f2;
    border-radius: 10px;
    color: #20225b;
    font-size: 18px;
    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
}

.m-dash-title {
    font-size: 16px;
    font-weight: 700;
    color: #20225b;
    flex: 1;
    text-align: center;
    padding: 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.m-dash-drawer {
    position: fixed;
    top: 0;
    left: -300px;
    width: min(300px, 85vw);
    height: 100vh;
    height: 100dvh;
    background: #fff;
    z-index: 9500;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    padding-top: env(safe-area-inset-top, 0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.12);
}

.m-dash-drawer.open { left: 0; }

.m-dash-drawer-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 24px 20px;
    border-bottom: 1px solid #e8ecef;
}

.m-dash-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00b172, #00d492);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.m-dash-drawer-head strong {
    display: block;
    font-size: 15px;
    color: #20225b;
}

.m-dash-drawer-head span {
    font-size: 12px;
    color: #63657e;
}

.m-dash-drawer-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
    -webkit-overflow-scrolling: touch;
}

.m-dash-nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    color: #364152;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    min-height: 48px;
}

.m-dash-nav-link i {
    width: 22px;
    text-align: center;
    color: #63657e;
}

.m-dash-nav-link.active,
.m-dash-nav-link:active {
    background: #e8f7f7;
    color: #00b172;
}

.m-dash-nav-link.active i { color: #00b172; }

.m-dash-logout { color: #e53935 !important; margin-top: 8px; }

.m-dash-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 9400;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.m-dash-overlay.open {
    opacity: 1;
    visibility: visible;
}

body.dash-drawer-open { overflow: hidden; }

html[data-theme="dark"] .m-dash-header {
    background: #1e293b;
    border-bottom-color: #334155;
}

html[data-theme="dark"] .m-dash-title { color: #f8fafc; }

html[data-theme="dark"] .m-dash-menu-btn,
html[data-theme="dark"] .m-dash-home {
    background: #334155;
    color: #f8fafc;
}

html[data-theme="dark"] .m-dash-drawer { background: #1e293b; }

html[data-theme="dark"] .m-dash-drawer-head { border-bottom-color: #334155; }

html[data-theme="dark"] .m-dash-drawer-head strong { color: #f8fafc; }

html[data-theme="dark"] .m-dash-nav-link { color: #cbd5e1; }

html[data-theme="dark"] .m-dash-nav-link.active { background: rgba(0,177,114,0.12); }

/* --- Landing page mobile nav --- */
.rj-mobile-toggle {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #20225B;
    font-size: 22px;
    cursor: pointer;
    flex-shrink: 0;
}

.rj-mobile-nav-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(320px, 90vw);
    height: 100vh;
    height: 100dvh;
    background: #fff;
    z-index: 10000;
    transition: right 0.3s ease;
    padding: calc(20px + env(safe-area-inset-top, 0)) 24px calc(24px + env(safe-area-inset-bottom, 0));
    overflow-y: auto;
    box-shadow: -4px 0 24px rgba(0,0,0,0.15);
}

.rj-mobile-nav-drawer.open { right: 0; }

.rj-mobile-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.rj-mobile-nav-overlay.open { opacity: 1; visibility: visible; }

.rj-mobile-nav-drawer ul {
    list-style: none;
    padding: 0;
    margin: 24px 0;
}

.rj-mobile-nav-drawer ul li { margin-bottom: 4px; }

.rj-mobile-nav-drawer ul a {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 12px 0;
    color: #20225B;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #f0f0f0;
}

.rj-mobile-nav-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.rj-mobile-nav-actions a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 14px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
}

.rj-mobile-nav-actions .rj-btn-register {
    background: linear-gradient(135deg, #4508DB, #00B172);
    color: #fff;
}

.rj-mobile-nav-actions .rj-btn-login {
    border: 2px solid #4508DB;
    color: #4508DB;
}

/* --- Tablet breakpoint (768px) --- */
@media (max-width: 768px) {
    .dashboard-body {
        display: block !important;
        height: auto !important;
        min-height: 100vh;
        min-height: 100dvh;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    .main-content {
        width: 100% !important;
        max-width: 100% !important;
        padding: calc(72px + env(safe-area-inset-top, 0)) 16px calc(88px + env(safe-area-inset-bottom, 0)) !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }

    .summary-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

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

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

    .summary-info .value {
        font-size: 1.4rem !important;
    }

    .summary-icon {
        width: 48px !important;
        height: 48px !important;
        font-size: 1.2rem !important;
    }

    .data-panel,
    .glass-panel {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table,
    .portfolio-table,
    table {
        min-width: 480px;
    }

    .table-scroll-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        margin-bottom: 16px;
    }

    .button-group {
        flex-direction: column !important;
    }

    .button-group a,
    .button-group button {
        width: 100%;
        text-align: center;
    }

    .vip-whatsapp-float {
        bottom: calc(80px + env(safe-area-inset-bottom, 0)) !important;
        right: 16px !important;
        width: 52px !important;
        height: 52px !important;
        font-size: 28px !important;
    }

    .login-layout {
        min-height: 100vh;
        min-height: 100dvh;
    }

    .login-card {
        width: 100% !important;
        max-width: 100% !important;
        margin: 16px !important;
        padding: 24px 20px !important;
        box-sizing: border-box !important;
    }

    .form-group-login input,
    .login-form input {
        width: 100% !important;
        box-sizing: border-box !important;
        font-size: 16px !important;
    }

    .m-menu-btn {
        width: 44px !important;
        height: 44px !important;
    }

    .m-bottom-nav,
    .m-action-bar,
    .turan-mobile-nav {
        padding-bottom: env(safe-area-inset-bottom, 0) !important;
        height: calc(64px + env(safe-area-inset-bottom, 0)) !important;
    }

    .m-premium-header {
        padding-top: env(safe-area-inset-top, 0) !important;
        height: calc(56px + env(safe-area-inset-top, 0)) !important;
    }

    .m-main-content {
        padding-top: calc(56px + env(safe-area-inset-top, 0)) !important;
        padding-bottom: calc(100px + env(safe-area-inset-bottom, 0)) !important;
    }

    .m-tv-container {
        width: 100% !important;
        height: 280px !important;
    }

    .m-chart-section {
        width: 100%;
        overflow: hidden;
    }

    #m-category-tabs {
        display: flex !important;
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        padding: 8px 16px !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .m-quick-btn {
        min-height: 36px;
        padding: 8px 16px !important;
    }

    .m-action-bar {
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0)) !important;
        height: auto !important;
        min-height: calc(80px + env(safe-area-inset-bottom, 0)) !important;
    }

    .m-btn-buy, .m-btn-sell {
        min-height: 56px !important;
    }

    .m-order-modal,
    .m-order-overlay .m-order-content {
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .rj-mobile-toggle { display: flex !important; }

    .rj-header-container {
        padding: 0 16px !important;
        height: 64px !important;
    }

    .rj-top-actions {
        display: none !important;
    }

    .rj-main-nav { display: none !important; }

    .rj-hero-image {
        height: min(50vh, 420px) !important;
        background-size: cover !important;
        background-position: center !important;
    }

    .rj-about-overlay-wrapper {
        margin-top: -60px !important;
        padding: 0 16px !important;
    }

    .rj-about-overlay {
        padding: 32px 20px !important;
    }

    .rj-container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .para-yatir-page {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .py-tabs {
        display: flex !important;
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .py-tab {
        flex: 0 0 auto !important;
        min-width: 120px !important;
    }

    .py-field input,
    .py-field select,
    .py-field textarea {
        width: 100% !important;
        box-sizing: border-box !important;
        font-size: 16px !important;
    }

    .py-bank-row {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
    }

    .py-history {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Admin mobile */
    .admin-layout {
        flex-direction: column !important;
        height: auto !important;
        min-height: 100vh;
        overflow: visible !important;
    }

    .admin-sidebar {
        position: fixed !important;
        top: 0;
        left: -280px;
        width: 280px !important;
        height: 100vh !important;
        height: 100dvh !important;
        z-index: 10000;
        transition: left 0.3s ease;
        overflow-y: auto;
    }

    .admin-sidebar.open { left: 0 !important; }

    .admin-main {
        padding: calc(72px + env(safe-area-inset-top, 0)) 16px 24px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .admin-mobile-topbar {
        display: flex !important;
    }

    .form-row {
        flex-direction: column !important;
    }

    .table-container {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .table { min-width: 600px; }

    .m-auth-card form > div[style*="flex"] {
        flex-direction: column !important;
        gap: 0 !important;
    }

    .login-card,
    .register-card {
        width: 100% !important;
        max-width: 100% !important;
    }

    .py-panel {
        padding: 20px 16px !important;
    }

    .py-card-grid {
        grid-template-columns: 1fr !important;
    }

    .rj-header {
        padding-top: env(safe-area-inset-top, 0);
    }

    .m-order-content {
        max-height: calc(85vh - env(safe-area-inset-bottom, 0));
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
    }

    .m-bottom-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .m-bottom-tabs::-webkit-scrollbar {
        display: none;
    }

    .m-b-tab {
        flex: 0 0 auto;
        min-width: 80px;
        min-height: 44px;
    }

    .crm-layout {
        grid-template-columns: 1fr !important;
    }

    .crm-user-list {
        max-height: 300px !important;
    }
}

/* --- Small phone (480px) --- */
@media (max-width: 480px) {
    body { font-size: 14px; }

    .summary-info .value { font-size: 1.25rem !important; }

    .m-market-grid { grid-template-columns: 1fr !important; }

    .m-stats-grid { grid-template-columns: repeat(2, 1fr) !important; }

    .m-auth-card { padding: 24px 16px !important; }

    .m-auth-card form > div[style*="flex"] {
        flex-direction: column !important;
        gap: 0 !important;
    }

    .m-phone-input {
        width: 100%;
    }

    .login-card,
    .register-card {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    .py-panel {
        padding: 20px 16px !important;
    }

    .py-card-grid {
        grid-template-columns: 1fr !important;
    }

    .rj-header {
        padding-top: env(safe-area-inset-top, 0);
    }

    .m-auth-title { font-size: 24px !important; }

    .rj-about-overlay h1 { font-size: 24px !important; }

    .rj-3-grid,
    .rj-4-grid { grid-template-columns: 1fr !important; }

    .admin-main { padding: 72px 12px 20px !important; }

    th, td { padding: 10px 12px !important; font-size: 0.82rem !important; }
}

/* --- Tablet landscape / small desktop (1024px) --- */
@media (max-width: 1024px) and (min-width: 769px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

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

    .main-content {
        padding: 32px 24px !important;
    }

    .rj-3-grid,
    .rj-4-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* --- Desktop: hide mobile shell --- */
@media (min-width: 769px) {
    .m-dash-header,
    .m-dash-drawer,
    .m-dash-overlay,
    .admin-mobile-topbar,
    .admin-sidebar-overlay {
        display: none !important;
    }
}

/* --- Admin mobile topbar (shown via JS in admin-sidebar) --- */
.admin-mobile-topbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(56px + env(safe-area-inset-top, 0));
    padding-top: env(safe-area-inset-top, 0);
    background: var(--admin-navy, #20225B);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    align-items: center;
    padding-left: 12px;
    padding-right: 16px;
    z-index: 9990;
    gap: 12px;
}

.admin-mobile-menu-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.08);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

.admin-mobile-topbar-title {
    flex: 1;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
}

.admin-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9995;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.admin-sidebar-overlay.open {
    opacity: 1;
    visibility: visible;
}

body.admin-drawer-open { overflow: hidden; }
