/* ============================================
   Thảo Nguyên Trading — Premium Light Theme
   ============================================ */

/* === CSS Custom Properties === */
:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-glass: rgba(255, 255, 255, 0.7);

    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --buy: #0f766e;
    --buy-bg: #ccfbf1;
    --buy-border: #2dd4bf;
    --buy-glow: rgba(45, 212, 191, 0.2);

    --sell: #b91c1c;
    --sell-bg: #fee2e2;
    --sell-border: #f87171;
    --sell-glow: rgba(248, 113, 113, 0.2);

    --sideway: #b45309;
    --sideway-bg: #fef3c7;
    --sideway-border: #fbbf24;
    --sideway-glow: rgba(251, 191, 36, 0.2);

    --accent: #2f602f;
    --accent-hover: #1e3f1e;
    --accent-bg: rgba(47, 96, 47, 0.08);

    --border: #e2e8f0;
    --border-hover: #cbd5e1;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow: 0 4px 20px rgba(47, 96, 47, 0.05), 0 1px 3px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.06), 0 1px 5px rgba(0, 0, 0, 0.02);

    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(ellipse at 20% 0%, rgba(47, 96, 47, 0.06) 0%, transparent 50%),
                radial-gradient(ellipse at 80% 100%, rgba(100, 116, 139, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* === Header === */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

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

.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon { font-size: 28px; filter: drop-shadow(0 2px 4px rgba(47, 96, 47, 0.2)); }
.logo-text h1 {
    font-size: 18px;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.5px;
}

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

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}
.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--sideway-border);
    animation: pulse 2s infinite;
}
.status-dot.online { background: #10b981; }
.status-dot.error { background: #ef4444; animation: none; }

.last-update {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

/* === Header Nav === */
.header-nav {
    display: flex;
    gap: 8px;
    margin-right: 20px;
}

.nav-link {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 15px;
    font-weight: 800;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.nav-link:hover {
    background: var(--bg-card-hover);
    color: var(--accent);
}

.nav-link.active {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(47, 96, 47, 0.2);
}

/* === Legacy Navigation Tabs === */
.nav-tabs {
    display: flex;
    gap: 4px;
    padding: 12px 24px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 1;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--accent-bg);
    color: var(--accent);
    box-shadow: inset 0 -2px 0 var(--accent);
}

.tab-icon { font-size: 16px; }

/* === Main Content === */
.main-content {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.tab-content { display: none; animation: fadeIn 0.3s ease; }
.tab-content.active { display: block; }

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

/* === Dashboard Layout === */
.dashboard-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    align-items: start;
}

/* === Sidebar === */
.sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

.sidebar-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

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

.strategy-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.strategy-btn:hover:not(:disabled) {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.strategy-btn.active {
    background: var(--accent-bg);
    border-color: rgba(47, 96, 47, 0.2);
    color: var(--accent);
}

.strategy-btn.placeholder {
    opacity: 0.5;
    cursor: not-allowed;
}

.strategy-icon {
    font-size: 16px;
}

/* === Main Panel === */
.main-panel {
    display: flex;
    flex-direction: column;
}

.page-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page-content.active {
    display: block;
}

/* === Filter Bar === */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.filter-btn {
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.filter-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(47, 96, 47, 0.2);
}

/* === Advanced Filters === */
.advanced-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.filter-select {
    padding: 6px 10px;
    font-size: 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    cursor: pointer;
    min-width: 120px;
    outline: none;
    font-family: var(--font);
    transition: var(--transition);
}

.filter-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-bg);
}

#confluenceFilter.active, #nguyenFilter.active, #khangFilter.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 4px 10px rgba(47, 96, 47, 0.2);
}

/* === Signal Table === */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

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

.signal-table thead th {
    padding: 16px 20px;
    text-align: left;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
}

.signal-table tbody tr {
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border);
}

.signal-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.signal-table tbody tr:last-child { border-bottom: none; }

.signal-table td {
    padding: 16px 20px;
    font-size: 14px;
    vertical-align: middle;
}

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

.symbol-emoji { font-size: 20px; }
.symbol-name { font-weight: 700; color: var(--text-primary); }
.symbol-display { font-size: 12px; color: var(--text-muted); font-weight: 500; }

.category-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-xl);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-badge.forex { background: rgba(99, 102, 241, 0.1); color: #4f46e5; }
.category-badge.metal { background: rgba(217, 119, 6, 0.1); color: #d97706; }
.category-badge.crypto { background: rgba(147, 51, 234, 0.1); color: #9333ea; }

/* === Signal Badges (Pastel + Solid Border) === */
.signal-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-xl);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: var(--transition);
    border: 1px solid transparent;
}

.signal-badge.buy {
    background: var(--buy-bg);
    color: var(--buy);
    border-color: var(--buy-border);
    box-shadow: 0 2px 6px var(--buy-glow);
}
.signal-badge.sell {
    background: var(--sell-bg);
    color: var(--sell);
    border-color: var(--sell-border);
    box-shadow: 0 2px 6px var(--sell-glow);
}
.signal-badge.sideway {
    background: var(--sideway-bg);
    color: var(--sideway);
    border-color: var(--sideway-border);
    box-shadow: 0 2px 6px var(--sideway-glow);
}
.signal-badge.none {
    background: #f1f5f9;
    color: var(--text-muted);
    border-color: #cbd5e1;
}

/* === Signal Cell Container & Evaluation Badges === */
.signal-cell-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.eval-badge {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.eval-badge.eval-strong {
    background: rgba(15, 118, 110, 0.1);
    color: var(--buy);
}

.eval-badge.eval-weak {
    background: rgba(185, 28, 28, 0.1);
    color: var(--sell);
}

.eval-badge.eval-volatile {
    background: rgba(79, 70, 229, 0.1);
    color: #4f46e5;
}

.eval-badge.eval-squeeze {
    background: rgba(180, 83, 9, 0.1);
    color: var(--sideway);
}

.eval-badge.eval-bias-buy {
    background: rgba(13, 148, 136, 0.08);
    color: #0d9488;
}

.eval-badge.eval-bias-sell {
    background: rgba(220, 38, 38, 0.08);
    color: #dc2626;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 2px 6px var(--buy-glow); }
    50% { box-shadow: 0 4px 15px var(--buy-glow); }
}

.signal-badge.buy.fresh { animation: glowPulse 2s infinite; }

/* === Loading & Empty States === */
.loading-state, .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

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

.empty-icon { font-size: 48px; margin-bottom: 12px; }

/* === Cards === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-lg); }

.card-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--text-primary);
}

/* === Forms === */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-group label {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.form-input {
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-bg);
}

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

select.form-input { cursor: pointer; }

/* === Buttons === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 12px rgba(47, 96, 47, 0.2);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(47, 96, 47, 0.3);
}

.btn-primary:active { transform: translateY(0); }

.btn-sm {
    padding: 6px 14px !important;
    font-size: 13px !important;
    height: 34px;
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

/* === Calculator === */
.calc-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.result-grid {
    display: grid;
    gap: 16px;
}

.result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.result-item.highlight {
    background: var(--accent-bg);
    border-color: rgba(47, 96, 47, 0.2);
}

.result-label { font-size: 13px; color: var(--text-secondary); font-weight: 700; }
.result-value { font-size: 24px; font-weight: 800; color: var(--text-primary); }
.result-unit { font-size: 12px; color: var(--text-muted); font-weight: 700; }

.result-item.highlight .result-value { color: var(--accent); }

.settings-container { max-width: 600px; }

.save-msg {
    margin-top: 12px;
    font-size: 13px;
    color: var(--buy);
    opacity: 0;
    transition: opacity 0.3s;
}
.save-msg.show { opacity: 1; }

/* === Modal === */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.97) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-header h2 { font-size: 18px; font-weight: 800; color: var(--text-primary); }

.modal-close {
    width: 36px; height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover { background: var(--sell-bg); color: var(--sell); border-color: var(--sell-border); }

.modal-body { padding: 24px; }

/* === Modal Timeframe Cards === */
.tf-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.tf-card {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
}

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

.tf-label { font-size: 14px; font-weight: 800; color: var(--text-primary); }

.tf-row {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 13px;
}

.tf-row-label {
    color: var(--text-muted);
    font-weight: 700;
    white-space: nowrap;
}

.tf-row-value {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: left;
    color: var(--text-primary);
}

.tf-row-delta {
    font-size: 12px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 4px;
    text-align: right;
    white-space: nowrap;
    min-width: 70px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.delta-up { color: #0f766e; background: #ccfbf1; }
.delta-down { color: #b91c1c; background: #fee2e2; }
.delta-zero { color: var(--text-muted); }

.div-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 4px;
    margin-top: 4px;
}

.div-divergence { background: #fef3c7; color: #b45309; }
.div-convergence { background: #d1fae5; color: #065f46; }
.div-equal { background: #f1f5f9; color: var(--text-muted); }

/* === Responsive === */
@media (max-width: 768px) {
    /* Header Stacked Segmented Controls */
    .header {
        flex-direction: column;
        align-items: center;
        padding: 12px;
        gap: 12px;
    }
    .header-left {
        width: 100%;
        justify-content: center;
    }
    .logo-text h1 {
        font-size: 16px;
    }
    .header-right {
        width: 100%;
        font-size: 12px;
        justify-content: center;
    }
    .header-nav {
        width: 100%;
        margin-right: 0;
        gap: 4px;
        background: #f1f5f9;
        padding: 4px;
        border-radius: var(--radius-sm);
    }
    .nav-link {
        flex: 1;
        text-align: center;
        padding: 6px 10px;
        font-size: 12px;
        border-radius: 6px;
    }
    .nav-link.active {
        background: #ffffff;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        color: var(--accent);
    }

    .main-content { padding: 12px; }
    
    .dashboard-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    /* Sidebar list as pill badges */
    .sidebar {
        padding: 14px;
    }
    .sidebar-title {
        font-size: 10px;
        margin-bottom: 10px;
    }
    .strategy-list {
        flex-direction: row;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
        -ms-overflow-style: none;  /* IE and Edge */
        scrollbar-width: none;  /* Firefox */
    }
    .strategy-list::-webkit-scrollbar {
        display: none; /* Hide scrollbar for Chrome, Safari and Opera */
    }
    .strategy-btn {
        white-space: nowrap;
        width: auto;
        padding: 8px 14px;
        font-size: 12px;
        border: 1px solid var(--border);
        border-radius: var(--radius-xl);
        background: #ffffff;
    }
    .strategy-btn.active {
        background: var(--accent);
        color: #ffffff;
        border-color: var(--accent);
    }
    .strategy-btn.placeholder {
        background: #f8fafc;
        border-color: var(--border);
    }

    /* Category Pill Row */
    .filter-bar {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 4px;
        flex-wrap: nowrap;
        gap: 6px;
        -webkit-overflow-scrolling: touch;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    .filter-bar::-webkit-scrollbar {
        display: none;
    }
    .filter-btn {
        white-space: nowrap;
        padding: 6px 12px;
        font-size: 11px;
    }

    /* Advanced Filters list */
    .advanced-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px;
    }
    .filter-group {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
    }
    .filter-select {
        min-width: 160px;
        flex-grow: 1;
        font-size: 12px;
        padding: 8px 12px; /* Bigger touch target */
        height: 38px;
    }
    #resetFilters, #confluenceFilter {
        width: 100%;
        justify-content: center;
        height: 40px; /* Bigger touch target */
        font-size: 13px !important;
    }

    /* Table adjustments */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: var(--radius-md);
    }
    .signal-table {
        min-width: 480px;
    }
    .signal-table th, .signal-table td {
        padding: 10px 8px;
        font-size: 12px;
    }
    .symbol-emoji {
        font-size: 18px;
    }
    .symbol-name {
        font-size: 13px;
    }
    .symbol-display {
        font-size: 10px;
    }
    
    /* Badges adjustments */
    .signal-badge {
        padding: 4px 10px;
        font-size: 11px;
    }
    .eval-badge {
        font-size: 9px;
        padding: 1px 4px;
    }
    
    /* Volume Calculator Touch optimization */
    .calc-container { grid-template-columns: 1fr; gap: 16px; }
    .form-grid { grid-template-columns: 1fr; gap: 12px; }
    .form-input {
        height: 44px; /* Standard touch target size */
        font-size: 14px;
    }
    .btn {
        height: 44px; /* Standard touch target size */
        font-size: 14px;
    }
    .result-item {
        padding: 12px;
    }
    .result-value {
        font-size: 20px;
    }

    /* Modal Mobile optimization */
    .modal-overlay {
        padding: 12px;
    }
    .modal {
        max-height: 92vh;
        border-radius: var(--radius-md);
    }
    .modal-header {
        padding: 14px 16px;
    }
    .modal-header h2 {
        font-size: 16px;
    }
    .modal-body {
        padding: 16px;
    }
    .tf-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .tf-card {
        padding: 12px;
    }
    .tf-row {
        padding: 6px 0;
        font-size: 12px;
    }
    .tf-row-delta {
        font-size: 11px;
        padding: 2px 8px;
        min-width: 60px;
    }
    .quick-calc {
        margin-top: 16px;
    }
    .quick-calc h3 {
        font-size: 13px !important;
    }

    /* About page typography sizing */
    #pageAbout .card {
        padding: 16px;
    }
    #pageAbout h2 {
        font-size: 18px !important;
    }
    #pageAbout h3 {
        font-size: 14px !important;
    }
    #pageAbout p {
        font-size: 13px !important;
    }
    #pageAbout li {
        font-size: 12px !important;
    }
}

@media (max-width: 480px) {
    .signal-badge { padding: 4px 8px; font-size: 10px; }
    .signal-table { min-width: 440px; }
    .signal-table th, .signal-table td { padding: 10px 6px; }
}

/* === Telegram Floating Button === */
.telegram-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background-color: #229ed9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(34, 158, 217, 0.4);
    z-index: 999;
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
}

.telegram-float:hover {
    transform: translateY(-4px) scale(1.05);
    background-color: #1e8cb8;
    box-shadow: 0 6px 20px rgba(34, 158, 217, 0.5);
}

.telegram-float svg {
    width: 28px;
    height: 28px;
    fill: #ffffff;
}

@media (max-width: 768px) {
    .telegram-float {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        box-shadow: 0 4px 12px rgba(34, 158, 217, 0.3);
    }
    .telegram-float svg {
        width: 24px;
        height: 24px;
    }
}
