:root {
    --bg-color: #0d1117;
    --card-bg: #161b22;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --accent: #58a6ff;
    --border: #30363d;
    --short-bg: rgba(248, 81, 73, 0.15);
    --short-color: #f85149;
    --long-bg: rgba(63, 185, 80, 0.15);
    --long-color: #3fb950;
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    padding-bottom: 20px;
    border-bottom: none;
    gap: 16px;
}

/* Page Navigation Tabs */
.page-nav-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.nav-tab {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.nav-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 200px;
    /* Ensure logo doesn't crush */
}

.logo i {
    color: var(--accent);
    font-size: 24px;
}

.logo h1 {
    font-size: 20px;
    font-weight: 600;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    /* Allow wrapping on mobile */
    gap: 12px;
    align-items: flex-end;
    justify-content: flex-start;
    /* Align left logic on mobile */
}

/* Desktop: No wrap for filters to prevent shifting */
@media (min-width: 1024px) {
    .filters {
        flex-wrap: nowrap;
        justify-content: flex-end;
        flex: 2;
    }
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
    /* Prevent inputs from squishing */
}

/* ... existing inputs ... */

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--long-color);
    background: var(--long-bg);
    padding: 6px 12px;
    border-radius: 20px;
    white-space: nowrap;
    /* Keep text on one line */
    flex-shrink: 0;
}

.filter-group label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
}

input,
select {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: var(--transition);
}

input:focus,
select:focus {
    border-color: var(--accent);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--long-color);
    background: var(--long-bg);
    padding: 6px 12px;
    border-radius: 20px;
    margin-left: auto;
}

.status-indicator.offline {
    color: var(--short-color);
    background: var(--short-bg);
}

.total-count {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: flex-end;
    padding-bottom: 4px;
}

.dot {
    width: 6px;
    height: 6px;
    background-color: currentColor;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

/* Table Styles */
.table-container {
    background-color: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.table-header {
    display: grid;
    grid-template-columns: 50px 1fr 1fr 1fr 80px 70px;
    padding: 12px 16px;
    background-color: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.liquidation-item {
    display: grid;
    grid-template-columns: 50px 1fr 1fr 1fr 80px 70px;
    padding: 14px 16px;
    align-items: center;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    transition: background-color 0.2s;
    animation: slideIn 0.3s ease-out;
}

.liquidation-item:last-child {
    border-bottom: none;
}

.liquidation-item:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.col-icon img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: contain;
}

.col-pair {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.chart-link {
    color: var(--text-secondary);
    font-size: 12px;
    opacity: 0.5;
    transition: opacity 0.2s;
    text-decoration: none;
}

.chart-link:hover {
    opacity: 1;
    color: var(--accent);
}

.col-price {
    font-family: 'Roboto Mono', monospace;
    font-size: 13px;
}

.col-amount {
    font-weight: 600;
}

.side-badge {
    padding: 4px 8px;
    border-radius: 12px;
    /* Pill shape */
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    display: inline-block;
    min-width: 50px;
    text-align: center;
}

.side-short {
    background-color: rgba(105, 240, 174, 0.2);
    /* Light Green bg */
    color: var(--short-color);
    border: 1px solid var(--short-color);
}

.side-long {
    background-color: rgba(255, 82, 82, 0.2);
    /* Light Red bg */
    color: var(--long-color);
    border: 1px solid var(--long-color);
}

/* Row background coloring for visual impact (like in the image) */
/* Standard Liquidations */
/* Long Liq (Price fell) -> Red */
.row-long {
    background-color: rgba(255, 82, 82, 0.1);
    border-left: 3px solid var(--short-color);
}

/* Short Liq (Price rose) -> Green */
.row-short {
    background-color: rgba(105, 240, 174, 0.1);
    border-left: 3px solid var(--long-color);
}

/* --- TIERED HIGHLIGHTING --- */

/* Medium Tier ($25k+) - Slightly saturated */
.liq-medium-long {
    background-color: rgba(255, 82, 82, 0.25) !important;
    border-left: 3px solid #ff5252 !important;
}

.liq-medium-short {
    background-color: rgba(105, 240, 174, 0.25) !important;
    border-left: 3px solid #69f0ae !important;
}

/* Large Tier ($100k+) - Darker, Bold */
.liq-large-long {
    background-color: rgba(183, 28, 28, 0.6) !important;
    /* Dark Red */
    border-left: 4px solid #ff1744 !important;
    color: #ffebee;
}

.liq-large-short {
    background-color: rgba(27, 94, 32, 0.6) !important;
    /* Dark Green */
    border-left: 4px solid #00e676 !important;
    color: #e8f5e9;
}

/* Mega Tier ($500k+) - Very Dark + Accent */
.liq-mega-long {
    background-color: rgba(120, 0, 0, 0.85) !important;
    /* Deepest Red */
    border-left: 5px solid #ffd700 !important;
    /* Gold Border */
    box-shadow: inset 0 0 10px rgba(255, 0, 0, 0.2);
    color: #fff;
    font-weight: bold;
}

.liq-mega-short {
    background-color: rgba(0, 70, 0, 0.85) !important;
    /* Deepest Green */
    border-left: 5px solid #ffd700 !important;
    /* Gold Border */
    box-shadow: inset 0 0 10px rgba(0, 255, 0, 0.2);
    color: #fff;
    font-weight: bold;
}

.col-time {
    color: var(--text-secondary);
    font-size: 12px;
    text-align: right;
}

.loading-state {
    padding: 40px;
    text-align: center;
    color: var(--text-secondary);
}

.loading-state i {
    font-size: 24px;
    margin-bottom: 12px;
    color: var(--accent);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Mobile Responsive Table and Layout */
@media (max-width: 600px) {

    .table-header,
    .liquidation-item {
        /* Icon | Pair | Amount | Side | Time */
        grid-template-columns: 30px 1fr 0.7fr 50px 50px;
        font-size: 11px;
        padding: 10px 6px;
        gap: 8px;
        /* Slightly larger gap */
    }

    /* Hide Price only */
    .col-price {
        display: none;
    }

    .col-side {
        display: flex;
        justify-content: center;
        transform: scale(0.9);
    }

    /* Show Time */
    .col-time {
        display: block;
        font-size: 11px;
    }

    .col-amount {
        text-align: right;
        font-size: 12px;
    }

    .col-pair {
        font-size: 12px;
    }
}

/* Sidebar Layout */
.main-content {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.table-container {
    flex: 1;
}

.sidebar {
    width: 300px;
    /* Removed container styles to allow splitting */
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-section {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    /* Removed border-bottom logic as they are now separate cards */
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
}

.sidebar-filter-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    opacity: 0.5;
}

.sidebar-filter-btn:hover {
    opacity: 1;
    border-color: var(--accent);
    color: var(--accent);
}

.sidebar-filter-btn-done {
    opacity: 1;
    border-color: var(--long-color);
    color: var(--long-color);
}

.natr-value.gain-pos {
    color: #69f0ae;
    /* Light Green */
    font-weight: 600;
}

.natr-value.gain-neg {
    color: #ff5252;
    /* Light Red */
    font-weight: 600;
}

.natr-header {
    display: flex;
    justify-content: space-between;
    padding: 8px 16px;
    background-color: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.natr-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    transition: var(--transition);
    cursor: pointer;
}

.natr-item:last-child {
    border-bottom: none;
}

.natr-item:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.natr-coin {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.natr-exchange-icon {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    opacity: 0.7;
}

.natr-value {
    font-family: 'Roboto Mono', monospace;
    color: var(--accent);
    font-weight: 500;
}

.loading-state-small {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
}

/* Responsive Sidebar */
@media (max-width: 900px) {
    .main-content {
        flex-direction: column;
    }

    .table-container {
        width: 100%;
    }

    .sidebar {
        width: 100%;
        /* order: -1; Removed to move sidebar to bottom */
        /* Show sidebar on top or bottom? Prompt didnt specify. Top might be annoying if long. Let's keep default (bottom) or move to top? Let's leave order normal (bottom on mobile) */
        margin-bottom: 20px;
        margin-bottom: 20px;
    }
}

/* Bottom Pagination specific styles - REMOVED */
/* Override for spacing */
.sidebar-section {
    margin-bottom: 2px !important;
}

.sidebar-section:last-child {
    margin-bottom: 0 !important;
}

/* User Requested Style Updates */
.natr-item {
    background: #141E30;
    /* fallback for old browsers */
    background: -webkit-linear-gradient(to right, #243B55, #141E30);
    /* Chrome 10-25, Safari 5.1-6 */
    background: linear-gradient(to right, #243B55, #141E30);
    /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
}

.sidebar-section {
    border: 0px !important;
}

/* Settings Button */
.settings-btn {
    background: #0a4086;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: #ffffff;
    padding: 4px 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: -5px;
}

.settings-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

/* Modal Content */
.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--danger);
}

/* Modal Body */
.modal-body {
    padding: 20px;
}

.setting-group {
    margin-bottom: 24px;
}

.setting-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.setting-desc {
    color: var(--text-secondary);
    font-size: 13px;
    margin: 0 0 12px 0;
}

.setting-group input[type="text"],
.setting-group input[type="number"] {
    width: 100%;
    padding: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    box-sizing: border-box;
}

.setting-group input:focus {
    outline: none;
    border-color: var(--accent);
}

.setting-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.setting-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.setting-row input[type="number"] {
    width: 120px;
}

/* Modal Footer */
.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    text-align: right;
}

.btn-save {
    background: var(--accent);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-save:hover {
    background: #3a7bd5;
}

#min-volume {
    width: 120px;
}

.filter-group.pagination-controls {
    margin: 0 0 4px 0 !important;
}


/* Split-Flap Airport Display Animation */
@keyframes splitFlapFlip {
    0% {
        transform: perspective(400px) rotateX(-90deg);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: perspective(400px) rotateX(0deg);
        opacity: 1;
    }
}

/* Container for new rows - disable default slideIn */
.airport-row {
    animation: none !important;
}

/* Each cell in the row gets a staggered flip animation */
.airport-row>div {
    transform-origin: center top;
    animation: splitFlapFlip 0.4s ease-out forwards;
    opacity: 0;
    backface-visibility: hidden;
}

/* Stagger each column */
.airport-row>div:nth-child(1) {
    animation-delay: 0s;
}

.airport-row>div:nth-child(2) {
    animation-delay: 0.05s;
}

.airport-row>div:nth-child(3) {
    animation-delay: 0.1s;
}

.airport-row>div:nth-child(4) {
    animation-delay: 0.15s;
}

.airport-row>div:nth-child(5) {
    animation-delay: 0.2s;
}

/* Chart Modal Styles */
.chart-modal-content {
    max-width: 1100px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
}

.chart-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.chart-select {
    padding: 6px 12px;
    border-radius: 6px;
    background: var(--bg-color);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.chart-filter-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-filter-input label {
    font-size: 12px;
    color: var(--text-secondary);
}

.chart-filter-input input {
    width: 80px;
    padding: 6px;
}

.no-padding {
    padding: 0;
}

.modal-footer.start {
    justify-content: flex-start;
    text-align: left;
}

.chart-legend {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dot.green {
    background-color: rgba(0, 255, 0, 0.6);
    border: 1px solid #00ff00;
}

.dot.red {
    background-color: rgba(255, 0, 0, 0.6);
    border: 1px solid #ff0000;
}

.airport-row>div:nth-child(6) {
    animation-delay: 0.25s;
}

/* Multi-Select Dropdown Styles */
.multi-select-dropdown {
    position: relative;
    width: 200px;
    font-size: 13px;
    user-select: none;
}

.multi-select-trigger {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.multi-select-trigger:hover,
.multi-select-dropdown.active .multi-select-trigger {
    border-color: var(--accent);
}

.multi-select-trigger span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
}

.multi-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-top: 4px;
    z-index: 100;
    max-height: 250px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.multi-select-dropdown.active .multi-select-options {
    display: block;
}

.checkbox-option {
    display: block;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.1s;
    color: var(--text-primary);
}

.checkbox-option:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.checkbox-option input {
    margin-right: 8px;
    cursor: pointer;
    width: auto;
    /* Override generic input styling if necessary */
    vertical-align: middle;
}

/* Ensure mobile responsiveness */
@media (max-width: 600px) {
    .multi-select-dropdown {
        width: 100%;
    }
}

/* Active ticker filter highlight */
#ticker-filter.filter-active {
    border-color: #f0b90b !important;
    box-shadow: 0 0 8px rgba(240, 185, 11, 0.5);
    background-color: rgba(240, 185, 11, 0.1);
}

/* Indicator Toggle Buttons */
.indicator-toggles {
    display: flex;
    gap: 4px;
    margin-left: 8px;
}

.indicator-btn {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

.indicator-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.indicator-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Fullscreen Button */
.fullscreen-btn {
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 8px;
}

.fullscreen-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Fullscreen Mode */
#chart-modal.fullscreen .chart-modal-content {
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
}

#chart-modal.fullscreen #chart-container {
    height: calc(100vh - 180px) !important;
}

#chart-modal.fullscreen .sub-chart {
    height: 120px !important;
}

/* Sub-chart containers */
.sub-chart {
    border-top: 1px solid var(--border);
    background: var(--card-bg);
}

/* Chart controls responsive */
.chart-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .indicator-toggles {
        margin-left: 0;
        margin-top: 8px;
    }

    .chart-controls {
        flex-wrap: wrap;
    }
}
/* Indicator Settings Inputs */
.indicator-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.indicator-settings {
    align-items: center;
    gap: 4px;
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 4px;
    margin-left: 4px;
}

.indicator-settings input {
    width: 45px;
    height: 24px;
    padding: 2px 4px;
    font-size: 11px;
    background-color: var(--bg-color);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 3px;
    text-align: center;
}

.indicator-settings input:focus {
    border-color: var(--accent);
}

/* Sub Chart Container */
.sub-chart {
    border-top: 1px solid var(--border);
    position: relative;
    background-color: #161b22;
}


/* CVD Sub-Charts */
.cvd-sub-chart {
    position: relative;
    width: 100%;
    height: 70px;
    border-top: 1px solid #30363d;
    background: #0d1117;
}

.cvd-sub-chart-compact {
    height: 24px !important;
    display: flex;
    align-items: center;
}

.cvd-sub-chart-compact .cvd-sub-chart-label {
    position: static;
    padding-left: 8px;
}

/* Hide TradingView logo in CVD sub-charts */
.cvd-sub-chart a,
#cvd-charts-container a,
#modal-cvd-container a {
    display: none !important;
}

/* Chart refresh button */
.chart-refresh-btn {
    background: var(--card-bg, #161b22);
    border: 1px solid var(--border, #30363d);
    color: var(--text-secondary, #8b949e);
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chart-refresh-btn:hover:not(:disabled) {
    border-color: var(--accent, #58a6ff);
    color: var(--accent, #58a6ff);
}

.chart-refresh-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.chart-refresh-btn .fa-spin {
    animation: fa-spin 1s linear infinite;
}

@keyframes fa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Token Stats Bar (above chart) */
.token-stats-bar {
    display: flex;
    align-items: center;
    gap: 0;
    background: #0d1117;
    border-bottom: 1px solid #30363d;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    font-weight: 600;
    padding: 0;
    min-height: 22px;
}

.token-stats-bar .ts-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-right: 1px solid #30363d;
    white-space: nowrap;
}

.token-stats-bar .ts-item:last-child {
    border-right: none;
}

.token-stats-bar .ts-label {
    color: #8b949e;
}

.token-stats-bar .ts-value {
    font-weight: 700;
}

.cvd-sub-chart-label {
    position: absolute;
    top: 3px;
    left: 8px;
    font-size: 11px;
    color: #8b949e;
    z-index: 10;
    pointer-events: none;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    text-shadow: 0 0 4px rgba(0,0,0,0.8);
}

.cvd-no-data {
    width: 100%;
    padding: 15px;
    text-align: center;
    color: #484f58;
    font-size: 12px;
    border-top: 1px solid #30363d;
    background: #0d1117;
}

/* Ruler Measurement Tool - Updated */
.ruler-btn {
    background: transparent;
    border: 1px solid #30363d;
    color: #8b949e;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}
.ruler-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e6edf3;
}
.ruler-btn.active {
    background: #f0883e;
    border-color: #d29922;
    color: #fff;
}
.ruler-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    cursor: crosshair;
    pointer-events: none;
}
.ruler-overlay.active {
    pointer-events: auto;
}
.ruler-line {
    position: absolute;
    background: #58a6ff;
    height: 2px;
    transform-origin: left center;
    pointer-events: none;
}
.ruler-label {
    position: absolute;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
    pointer-events: none;
    border: 1px solid #58a6ff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    z-index: 101;
}
.ruler-label .percent {
    font-size: 18px;
    color: #58a6ff;
}
.ruler-label .percent.positive { color: #3fb950; }
.ruler-label .percent.negative { color: #f85149; }
.ruler-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #58a6ff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}
