:root {
    --bg-dark: #080b11;
    --card-bg: #111622;
    --card-border: #1e2638;
    --card-hover: #171f30;
    --text-main: #f1f5f9;
    --text-muted: #7e8c9f;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.12);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --accent: #8b5cf6;
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-stack);
    font-size: 13px;
    line-height: 1.5;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--card-border);
    padding: 10px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 16px;
    flex-wrap: wrap;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.nav-brand-logo {
    width: 42px;
    height: 42px;
    filter: drop-shadow(0 0 12px rgba(245, 158, 11, 0.35)) drop-shadow(0 0 6px rgba(0, 242, 254, 0.25));
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-brand-logo:hover {
    transform: scale(1.1) rotate(5deg);
}

.login-brand-logo {
    width: 56px;
    height: 56px;
    display: inline-block;
    filter: drop-shadow(0 0 16px rgba(245, 158, 11, 0.45)) drop-shadow(0 0 8px rgba(0, 242, 254, 0.35));
    animation: floatLogo 3s ease-in-out infinite;
}

@keyframes floatLogo {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.nav-brand h2 {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.sub-text {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: block;
}

.pulse-indicator {
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.nav-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.stat-card {
    background: #090d14;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 5px 14px;
    display: flex;
    flex-direction: column;
    min-width: 120px;
}

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

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

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    white-space: nowrap;
}

/* Badges */
.badge {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    border: 1px solid var(--card-border);
    background: #18202f;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.badge-live { background: rgba(16, 185, 129, 0.15); color: #10b981; border-color: rgba(16, 185, 129, 0.4); }
.badge-paper { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border-color: rgba(59, 130, 246, 0.4); }
.badge-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.badge-success { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning); }
.badge-info { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border-color: rgba(139, 92, 246, 0.4); }

/* Buttons */
.btn {
    padding: 7px 13px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: transparent; border: 1px solid var(--card-border); color: var(--text-main); }
.btn-outline:hover { background: var(--card-hover); border-color: var(--text-muted); }
.btn-outline-warning { background: transparent; border: 1px solid var(--warning); color: var(--warning); }
.btn-outline-warning:hover { background: var(--warning-bg); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }
.btn-sm { padding: 4px 10px; font-size: 11px; border-radius: 4px; }

/* Main Container */
.container {
    max-width: 1440px;
    margin: 18px auto;
    padding: 0 20px;
}

/* Alert Banner */
.alert-banner {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 8px;
    padding: 12px 18px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: #fef3c7;
}

.alert-banner i {
    font-size: 22px;
    color: var(--warning);
}

.alert-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
    flex: 1;
}

.alert-content strong {
    color: var(--warning);
    font-size: 13px;
}

/* Top 3 PSL-AI Coins Grid */
.top3-coins-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
}

@media (max-width: 992px) {
    .top3-coins-grid {
        grid-template-columns: 1fr;
    }
}

.top3-card {
    background: linear-gradient(135deg, #111622 0%, #0d121c 100%);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s, border-color 0.2s;
    position: relative;
    overflow: hidden;
}

.top3-card:hover {
    transform: translateY(-2px);
    border-color: rgba(59, 130, 246, 0.5);
}

.top3-card.rank-1 {
    border-color: rgba(245, 158, 11, 0.4);
}
.top3-card.rank-1::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.top3-card.rank-2 {
    border-color: rgba(16, 185, 129, 0.4);
}
.top3-card.rank-2::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #10b981, #34d399);
}

.top3-card.rank-3 {
    border-color: rgba(139, 92, 246, 0.4);
}
.top3-card.rank-3::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
}

.top3-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top3-coin-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.top3-coin-icon {
    font-size: 24px;
    width: 38px;
    height: 38px;
    min-width: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.coin-logo-img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.top3-coin-name {
    font-size: 15px;
    font-weight: 800;
    color: #ffffff;
}

.top3-coin-sub {
    font-size: 11px;
    color: var(--text-muted);
}

.top3-pdf-badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 700;
}

.top3-price-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.top3-price {
    font-size: 22px;
    font-weight: 800;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    color: #ffffff;
}

.top3-stats-mini {
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 8px;
    justify-content: space-between;
}

/* PEPE Hero Section */
.section-tickers {
    margin-bottom: 18px;
    width: 100%;
}

.pepe-hero-card {
    background: linear-gradient(135deg, #111622 0%, #0d121c 100%);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 12px;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.pepe-main-col {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.pepe-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pepe-emoji {
    font-size: 34px;
}

.pepe-title {
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    display: block;
}

.pepe-price-wrap {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.pepe-price {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #ffffff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.pepe-stats-grid {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.pepe-stat-item {
    background: #090d14;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 6px 14px;
    display: flex;
    flex-direction: column;
    min-width: 105px;
}

/* Chart Section */
.section-chart {
    margin-bottom: 18px;
}

.chart-header-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--card-border);
}

.chart-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.chart-header-left h3 {
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-stats-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.timeframe-buttons {
    display: flex;
    background: #090d14;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 3px;
    gap: 4px;
}

.btn-time {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-time:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.btn-time.active {
    background: var(--primary);
    color: white;
}

.chart-canvas-wrap {
    height: 220px;
    width: 100%;
    position: relative;
    padding: 6px 0;
}

.chart-notice {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(14, 18, 28, 0.94);
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 10px;
    padding: 14px 22px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-main);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    z-index: 5;
    text-align: center;
    max-width: 90%;
}

/* Dashboard Two Columns */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 18px;
}

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

/* Card */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    overflow: hidden;
}

.card-header {
    padding: 12px 18px;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 16px;
}

/* Table */
.table-responsive {
    overflow-x: auto;
}

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

.custom-table th, .custom-table td {
    padding: 10px 14px;
    text-align: left;
    font-size: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.custom-table th {
    background: #090d14;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
}

.custom-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Parameters Grid */
.params-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

@media (max-width: 640px) {
    .params-grid {
        grid-template-columns: 1fr;
    }
}

.param-box {
    background: #090d14;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.param-title {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.param-val {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main);
}

/* Signal Feed */
.signal-feed {
    max-height: 420px;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.signal-item {
    background: #090d14;
    border: 1px solid var(--card-border);
    border-left: 4px solid var(--primary);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 12px;
}

.signal-item.success { border-left-color: var(--success); }
.signal-item.danger { border-left-color: var(--danger); }
.signal-item.warning { border-left-color: var(--warning); }

.signal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.signal-title {
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.signal-time {
    font-size: 11px;
    color: var(--text-muted);
}

.signal-msg {
    color: #cbd5e1;
    margin-bottom: 6px;
    font-size: 12px;
}

.signal-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.3);
    padding: 4px 8px;
    border-radius: 4px;
}

/* Forms */
.form-row {
    display: flex;
    gap: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 10px;
}

.form-group.col-4 { flex: 1; }
.form-group.col-6 { flex: 1; }

label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.form-control {
    background: #090d14;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    color: var(--text-main);
    padding: 7px 12px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
}

/* Modals */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 999;
    align-items: center;
    justify-content: center;
}

.modal-backdrop.active {
    display: flex;
}

.modal {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    width: 90%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

.modal.modal-lg {
    max-width: 720px;
}

.modal-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
}

.btn-close:hover { color: var(--text-main); }
.modal-body { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; }

/* Code box */
.code-box {
    background: #090d14;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 12px;
    font-family: monospace;
    font-size: 12px;
    line-height: 1.8;
    margin-top: 8px;
}

.btn-copy {
    background: #232c3d;
    border: none;
    color: var(--text-main);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    margin-left: 8px;
}

.btn-copy:hover { background: var(--primary); }

.link { color: var(--primary); text-decoration: none; }
.link:hover { text-decoration: underline; }

/* Toast */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-left: 4px solid var(--primary);
    padding: 10px 16px;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.5);
    min-width: 250px;
    max-width: 360px;
    font-size: 12px;
    animation: slideIn 0.3s ease;
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-error { border-left-color: var(--danger); }
.toast.toast-info { border-left-color: var(--primary); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Login Overlay */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #111622 0%, #080b11 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.login-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 32px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
    text-align: center;
}

.login-header h2 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 4px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 20px;
}

/* Helpers */
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.w-100 { width: 100%; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 18px; }

/* PSL AI Live Tracking Table */
.psl-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

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

.psl-stats-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.psl-stat-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 4px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
}

.psl-stat-pill .lbl {
    color: var(--text-muted);
    font-weight: 600;
}

.psl-stat-pill .val {
    font-weight: 700;
}

.psl-table th {
    white-space: nowrap;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.psl-table td {
    vertical-align: middle;
}

.badge-sell {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.4);
    font-weight: 700;
}

.badge-buy {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.4);
    font-weight: 700;
}

.target-pills-wrap {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.target-pill {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

.target-pill.hit {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.5);
    color: #10b981;
    font-weight: 700;
}

.sl-pill {
    font-size: 11px;
    font-family: monospace;
    color: #f87171;
    background: rgba(239, 68, 68, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px dashed rgba(239, 68, 68, 0.3);
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE STYLES (iOS & Android Touch-Friendly & PWA)
   ========================================================================== */

/* Tablet & Mobile Screens (<= 768px) */
@media (max-width: 768px) {
    body {
        font-size: 13px;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .container {
        padding: 0 10px;
        margin: 10px auto;
    }

    /* Navbar: Layered mobile header */
    .navbar {
        padding: 10px 12px;
        gap: 10px;
        flex-direction: column;
        align-items: stretch;
    }

    .nav-brand {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        gap: 10px;
    }

    .nav-brand-logo {
        width: 36px;
        height: 36px;
    }

    .nav-brand h2 {
        font-size: 15px;
        letter-spacing: 0.3px;
    }

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

    /* Quick stats: 3-column compact grid */
    .nav-stats {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        width: 100%;
    }

    .stat-card {
        min-width: 0;
        padding: 6px 4px;
        text-align: center;
        border-radius: 6px;
    }

    .stat-label {
        font-size: 9.5px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }

    .stat-val {
        font-size: 12.5px;
        font-weight: 700;
    }

    /* Nav actions: Touch-friendly grid */
    .nav-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        width: 100%;
    }

    .nav-actions .badge {
        grid-column: span 1;
        justify-content: center;
        padding: 8px 6px;
        font-size: 10px;
        text-align: center;
    }

    .nav-actions .btn {
        justify-content: center;
        padding: 8px 10px;
        font-size: 12px;
        min-height: 38px;
    }

    .nav-actions .btn:last-child {
        grid-column: span 2;
    }

    /* Top 3 Cards Grid */
    .top3-coins-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .top3-card {
        padding: 12px 14px;
        gap: 10px;
    }

    .top3-coin-icon {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }

    .coin-logo-img {
        width: 30px;
        height: 30px;
    }

    .top3-coin-name {
        font-size: 14px;
    }

    .top3-price {
        font-size: 20px;
    }

    .top3-stats-mini {
        font-size: 10px;
        flex-wrap: wrap;
        gap: 6px;
    }

    /* Alert Banner */
    .alert-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 14px;
    }

    .alert-banner .btn {
        width: 100%;
        justify-content: center;
    }

    /* Cards general */
    .card-header {
        padding: 10px 14px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .card-header h3 {
        font-size: 13px;
    }

    .card-body {
        padding: 12px;
    }

    /* Chart Section */
    .chart-header-wrap {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px 14px;
    }

    .chart-header-left {
        justify-content: space-between;
        gap: 8px;
    }

    .chart-header-left h3 {
        font-size: 13px;
    }

    .chart-stats-mini {
        font-size: 11px;
    }

    .timeframe-buttons {
        width: 100%;
        display: flex;
    }

    .btn-time {
        flex: 1;
        text-align: center;
        padding: 6px 2px;
        font-size: 11px;
    }

    .chart-canvas-wrap {
        height: 190px;
    }

    .chart-notice {
        width: 90%;
        padding: 10px 14px;
        font-size: 11px;
        flex-direction: column;
        gap: 6px;
    }

    /* Two Columns Grid -> Stack */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    /* Tables & Responsive Touch Scrolling */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
        width: 100%;
        scrollbar-width: thin;
        scrollbar-color: rgba(59, 130, 246, 0.4) transparent;
        padding-bottom: 6px;
    }

    .table-responsive::-webkit-scrollbar {
        height: 4px;
    }

    .table-responsive::-webkit-scrollbar-thumb {
        background: rgba(59, 130, 246, 0.4);
        border-radius: 4px;
    }

    .custom-table th, .custom-table td {
        padding: 8px 10px;
        font-size: 11px;
        white-space: nowrap;
    }

    /* PSL AI Table Header & Stats */
    .psl-table-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px 14px;
    }

    .psl-stats-bar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
        width: 100%;
    }

    .psl-stat-pill {
        justify-content: space-between;
        padding: 5px 8px;
        font-size: 10px;
    }

    /* Forms in Simulator & Settings */
    .form-row {
        flex-direction: column;
        gap: 8px;
    }

    .form-group.col-4,
    .form-group.col-6 {
        flex: 1 1 100%;
        width: 100%;
    }

    .form-control {
        font-size: 14px;
        min-height: 40px;
    }

    /* Modals */
    .modal-backdrop {
        padding: 10px;
        align-items: center;
    }

    .modal {
        width: 100%;
        max-width: 100%;
        max-height: 90vh;
        border-radius: 12px;
        margin: 0;
    }

    .modal.modal-lg {
        max-width: 100%;
    }

    .modal-header {
        padding: 12px 16px;
    }

    .modal-header h3 {
        font-size: 14px;
    }

    .modal-body {
        padding: 14px 16px;
    }

    .modal-footer {
        flex-direction: column-reverse;
        gap: 8px;
    }

    .modal-footer .btn {
        width: 100%;
        justify-content: center;
        min-height: 42px;
    }

    .code-box {
        font-size: 11px;
        word-break: break-all;
        padding: 10px;
    }

    .btn-copy {
        display: inline-block;
        margin-top: 6px;
        margin-left: 0;
        padding: 4px 10px;
    }

    /* Login / Auth Overlay */
    .login-card {
        width: 94%;
        max-width: 360px;
        padding: 24px 18px;
        border-radius: 12px;
    }

    .login-brand-logo {
        width: 48px;
        height: 48px;
    }

    .login-header h2 {
        font-size: 18px;
    }

    .login-card .form-control {
        min-height: 44px;
        font-size: 14px;
    }

    .login-card .btn {
        min-height: 44px;
        font-size: 13px;
    }

    /* Toast Notifications on Mobile */
    .toast-container {
        bottom: 12px;
        right: 12px;
        left: 12px;
    }

    .toast {
        min-width: 0;
        max-width: 100%;
        font-size: 12px;
    }
}

/* Extra Small Mobile Screens (<= 480px) */
@media (max-width: 480px) {
    .nav-brand h2 {
        font-size: 14px;
    }

    .stat-val {
        font-size: 12px;
    }

    .stat-label {
        font-size: 9px;
    }

    .top3-price {
        font-size: 18px;
    }

    .top3-stats-mini {
        font-size: 9px;
    }

    .psl-stat-pill {
        font-size: 9px;
        padding: 4px 6px;
    }

    .nav-actions {
        grid-template-columns: 1fr;
    }

    .nav-actions .badge {
        grid-column: span 1;
    }

    .nav-actions .btn:last-child {
        grid-column: span 1;
    }
}


