/* CSS Variables - Light Mode (Default) */
:root {
    --primary-color: #1a73e8;
    --primary-dark: #1557b0;
    --secondary-color: #34a853;
    --background-dark: #0f172a;
    --background-light: #f1f5f9;
    --background-white: #ffffff;
    --background-body: #f1f5f9;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --text-white: #ffffff;
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.12);
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --transition: all 0.3s ease;
    --border-color: #e2e8f0;
    --chart-grid: rgba(0, 0, 0, 0.05);
    --tooltip-bg: rgba(15, 23, 42, 0.9);

    /* Stablecoin brand colors */
    --usdt-color: #26a17b;
    --usdc-color: #2775ca;
    --dai-color: #f5ac37;
    --fdusd-color: #0052ff;
    --usde-color: #8b5cf6;
    --frax-color: #000000;
    --tusd-color: #002868;
    --usdd-color: #216cff;
    --pyusd-color: #003087;
    --lusd-color: #745ddf;

    /* Status colors */
    --positive-color: #10b981;
    --negative-color: #ef4444;
}

/* Dark Mode */
[data-theme="dark"] {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --background-dark: #0f172a;
    --background-light: #1e293b;
    --background-white: #0f172a;
    --background-body: #020617;
    --text-dark: #f1f5f9;
    --text-light: #94a3b8;
    --text-white: #ffffff;
    --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    --card-shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.4);
    --border-color: #334155;
    --chart-grid: rgba(255, 255, 255, 0.1);
    --tooltip-bg: rgba(30, 41, 59, 0.95);
    --positive-color: #34d399;
    --negative-color: #f87171;
}

/* Reset and Base Styles */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 56px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--background-body);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Theme Toggle */
/* Language Switcher (footer) */
.footer-languages {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4px 8px;
    margin: 16px 0;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.footer-lang-label {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-right: 4px;
}

.footer-lang {
    background: none;
    border: 1px solid transparent;
    color: var(--text-light);
    font-size: 0.78rem;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    transition: all 0.15s;
}

.footer-lang:hover {
    color: var(--text-dark);
    border-color: var(--border-color);
}

.footer-lang.active {
    color: var(--primary-color);
    font-weight: 600;
    border-color: var(--primary-color);
    background: rgba(26, 115, 232, 0.06);
}

.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.theme-toggle svg {
    width: 22px;
    height: 22px;
    fill: var(--text-white);
}

.theme-toggle .sun-icon {
    display: none;
}

.theme-toggle .moon-icon {
    display: block;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: block;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: none;
}

/* Header */
.header {
    background: linear-gradient(135deg, #0741AD 0%, #0a5dd4 100%);
    color: var(--text-white);
    padding: 26px 20px;
    margin: 0 0 30px;
    border-radius: var(--border-radius);
    text-align: center;
    position: relative;
}

[data-theme="dark"] .header {
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
}

.header-home-link {
    text-decoration: none;
    color: inherit;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.header .subtitle {
    font-size: 1.1rem;
    opacity: 0.85;
    font-weight: 400;
}

.header .data-update-note {
    font-size: 0.8rem;
    opacity: 0.7;
    font-weight: 400;
    margin-top: 8px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Card Base Styles */
.card {
    background: var(--background-white);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    border: 1px solid transparent;
}

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

[data-theme="dark"] .card {
    border-color: var(--border-color);
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    padding: 24px;
    text-align: center;
    overflow: visible;
}

.card-label {
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.card-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
}

.card-value.positive {
    color: var(--positive-color);
}

.card-value.negative {
    color: var(--negative-color);
}

.card-date-range {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 400;
    margin-top: 6px;
    line-height: 1.3;
}

.summary-period-buttons {
    display: flex;
    gap: 3px;
    margin-top: 8px;
}

.btn-tiny {
    padding: 2px 8px;
    font-size: 0.65rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    background: var(--background-light);
    color: var(--text-light);
    cursor: pointer;
    border-radius: 4px;
    line-height: 1.4;
}

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

.btn-tiny:hover:not(.active) {
    background: rgba(255, 255, 255, 0.5);
}

/* Change Card with Period Selector */
.change-card {
    position: relative;
}

.card-label-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}

.card-label-row .card-label {
    margin-bottom: 0;
}

.change-period-select {
    padding: 4px 8px;
    border: 1px solid var(--background-light);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-dark);
    background: var(--background-white);
    cursor: pointer;
    outline: none;
}

.change-period-select:hover {
    border-color: var(--primary-color);
}

.change-period-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

/* Date Range Wrapper */
.date-range-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Custom Date Dropdown */
.custom-date-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--background-white);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 20px;
    min-width: 280px;
    z-index: 100;
}

.custom-date-dropdown.visible {
    display: block;
}

.dropdown-row {
    margin-bottom: 16px;
}

.dropdown-row label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 6px;
}

.dropdown-row .date-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 0.9rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-dark);
    background: var(--background-white);
    outline: none;
}

.dropdown-row .date-input:focus {
    border-color: var(--primary-color);
}

.dropdown-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid var(--background-light);
}

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--text-white);
}

/* Controls Panel */
.controls-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--background-white);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.control-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
}

.button-group {
    display: flex;
    gap: 8px;
}

.btn {
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    background: var(--background-white);
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
}

.btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

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

.btn-small {
    padding: 6px 12px;
    font-size: 0.75rem;
}

/* Date Range Display */
.date-range-display {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-left: 8px;
}

/* Coin Selection Panel */
.coin-selection-panel {
    margin-top: -15px;
}

.coin-selection-group {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

.coin-selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 12px;
}

.selection-actions {
    display: flex;
    gap: 8px;
}

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

.coin-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.coin-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--background-light);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.coin-checkbox:hover {
    background: #e2e8f0;
}

.coin-checkbox.selected {
    background: var(--coin-color, var(--primary-color));
    color: white;
}

.coin-checkbox input {
    display: none;
}

.coin-checkbox-color {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

.coin-checkbox.selected .coin-checkbox-color {
    background: white !important;
}

.coin-checkbox-label {
    font-size: 0.8rem;
    font-weight: 500;
}

.coin-checkbox-rank {
    font-size: 0.7rem;
    color: var(--text-light);
    margin-left: 2px;
}

.coin-checkbox.selected .coin-checkbox-rank {
    color: rgba(255, 255, 255, 0.7);
}

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

.chart-card {
    padding: 24px;
}

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

.chart-title-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.chart-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.chart-download-buttons {
    display: flex;
    gap: 8px;
}

.chart-download-buttons .btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.75rem;
}

.chart-download-buttons .btn svg {
    flex-shrink: 0;
}

.chart-download-buttons .btn .dropdown-arrow {
    margin-left: 2px;
    opacity: 0.7;
}

.csv-dropdown-wrapper {
    position: relative;
}

.csv-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: var(--background-white);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 100;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.csv-dropdown.visible {
    display: block;
}

.csv-option {
    display: block;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: none;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
}

.csv-option:hover {
    background: var(--background-light);
}

.csv-option:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.csv-option .option-desc {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-light);
    margin-top: 2px;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
}

.legend-item:hover {
    color: var(--text-dark);
}

.legend-item.hidden {
    opacity: 0.4;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.chart-container {
    position: relative;
    height: 450px;
}

#circulationChart {
    width: 100% !important;
    height: 100% !important;
}

.chart-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    z-index: 10;
}

.chart-loading.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--background-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

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

/* Market Dominance Section */
.dominance-section {
    margin-bottom: 30px;
}

.dominance-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.dominance-header-row .section-title {
    margin-bottom: 0;
}

.dominance-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dominance-date-buttons {
    display: flex;
    gap: 4px;
}

.dominance-date-buttons .btn {
    padding: 6px 10px;
    font-size: 0.7rem;
}

.dominance-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 20px;
    align-items: stretch;
}

.dominance-chart-card {
    padding: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dominance-chart-container {
    position: relative;
    width: 100%;
    height: 320px;
    max-width: 320px;
}

#dominanceChart {
    width: 100% !important;
    height: 100% !important;
}

.dominance-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--background-white);
    z-index: 5;
}

.dominance-loading.hidden {
    display: none;
}

.dominance-stats-card {
    padding: 24px;
}

.dominance-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
}

.dominance-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--background-light);
    border-radius: var(--border-radius-sm);
}

.dominance-stat-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dominance-stat-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.dominance-stat-symbol {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.dominance-stat-right {
    text-align: right;
}

.dominance-stat-percent {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-dark);
}

.dominance-stat-value {
    font-size: 0.75rem;
    color: var(--text-light);
}

.dominance-stat-change {
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 2px;
}

.dominance-stat-change.positive {
    color: var(--positive-color);
}

.dominance-stat-change.negative {
    color: var(--negative-color);
}

/* Market Movers Section */
.movers-section {
    margin-bottom: 30px;
}

.movers-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.movers-header-row .section-title {
    margin-bottom: 0;
}

.movers-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.movers-date-buttons {
    display: flex;
    gap: 4px;
}

.movers-date-buttons .btn {
    padding: 6px 10px;
    font-size: 0.7rem;
}

.movers-sort-toggle {
    display: flex;
    gap: 2px;
    background: var(--background-light);
    padding: 3px;
    border-radius: var(--border-radius-sm);
}

.movers-sort-toggle .btn {
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 2px solid var(--border-color);
    background: var(--background-white);
    color: var(--text-dark);
}

.movers-sort-toggle .btn.active {
    background: var(--primary-color);
    color: white;
}

.movers-sort-toggle .btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.5);
}

.movers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.movers-card {
    padding: 20px;
}

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

.movers-card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.gainers-card .movers-card-header h3 {
    color: var(--positive-color);
}

.losers-card .movers-card-header h3 {
    color: var(--negative-color);
}

.movers-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mover-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.mover-item:not(:last-child) {
    border-bottom: 1px solid var(--background-light);
}

.mover-rank {
    width: 24px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-light);
}

.mover-symbol {
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 55px;
}

.mover-change {
    margin-left: auto;
    text-align: right;
}

.mover-percent {
    font-weight: 600;
    font-size: 0.9rem;
}

.mover-value {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 2px;
}

.gainers-card .mover-percent {
    color: var(--positive-color);
}

.losers-card .mover-percent {
    color: var(--negative-color);
}

.no-movers {
    text-align: center;
    color: var(--text-light);
    font-size: 0.875rem;
    padding: 20px 0;
}

/* Chain Breakdown Section */
.chain-breakdown-section {
    margin-bottom: 30px;
}

.chain-breakdown-header-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 8px;
}

.chain-breakdown-header-row .section-title {
    margin-bottom: 0;
}

.chain-breakdown-subtitle {
    font-size: 0.8rem;
    color: var(--text-light);
}

.chain-breakdown-grid {
    display: grid;
    grid-template-columns: 0.7fr 1.3fr;
    gap: 20px;
}

.chain-chart-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.chain-chart-container {
    position: relative;
    width: 100%;
    max-width: 280px;
    height: 280px;
}

.chain-table-card {
    padding: 20px 24px;
}

.chain-table-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

.chain-table-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.chain-table-note {
    font-size: 0.75rem;
    color: var(--text-light);
}

.chain-table-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.82rem;
}

.chain-table-row:last-child {
    border-bottom: none;
}

.chain-rank {
    width: 22px;
    color: var(--text-light);
    font-size: 0.75rem;
    text-align: right;
    flex-shrink: 0;
}

.chain-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.chain-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-color);
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chain-supply {
    width: 65px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--text-color);
    flex-shrink: 0;
}

.chain-percent {
    width: 42px;
    text-align: right;
    color: var(--text-light);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.chain-change {
    width: 140px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    font-size: 0.78rem;
}

.chain-change.positive {
    color: var(--positive-color);
}

.chain-change.negative {
    color: var(--negative-color);
}

/* Trading Volume Section */
.volume-section {
    margin-bottom: 30px;
}

.volume-header-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 8px;
}

.volume-header-row .section-title {
    margin-bottom: 0;
}

.volume-subtitle {
    font-size: 0.8rem;
    color: var(--text-light);
}

.volume-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.volume-chart-card {
    padding: 20px;
}

.volume-chart-container {
    position: relative;
    height: 400px;
}

.volume-table-card {
    padding: 20px 24px;
}

.volume-table-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

.volume-table-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.volume-table-controls {
    display: flex;
    align-items: center;
    gap: 14px;
}

.volume-exclude-toggles {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.volume-exclude-btn {
    padding: 3px 8px;
    font-size: 0.68rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    background: var(--background-white);
    color: var(--text-light);
    border: none;
    border-right: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.volume-exclude-btn:last-child {
    border-right: none;
}

.volume-exclude-btn:hover {
    background: var(--hover-bg, rgba(0, 0, 0, 0.04));
}

.volume-exclude-btn.active {
    background: var(--primary-color);
    color: #fff;
}

.volume-table-note {
    font-size: 0.75rem;
    color: var(--text-light);
}

.volume-table-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.82rem;
}

.volume-table-row:last-child {
    border-bottom: none;
}

.volume-table-row-header {
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.vol-symbol {
    width: 55px;
    font-weight: 500;
    color: var(--text-color);
    flex-shrink: 0;
}

.vol-amount {
    flex: 1;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.vol-circ {
    flex: 1;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--text-light);
}

.vol-velocity {
    width: 55px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    flex-shrink: 0;
}

.velocity-high {
    color: var(--positive-color);
    font-weight: 600;
}

.volume-empty {
    text-align: center;
    color: var(--text-light);
    font-size: 0.85rem;
    font-style: italic;
    padding: 20px 0;
}

/* Lending Yields Section */
.lending-section {
    margin-bottom: 30px;
}

.lending-header-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 8px;
}

.lending-header-row .section-title {
    margin-bottom: 0;
}

.lending-subtitle {
    font-size: 0.8rem;
    color: var(--text-light);
}

.lending-card {
    padding: 20px 24px;
}

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

.lending-table thead th {
    padding: 10px 16px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    border-bottom: 2px solid var(--border-color);
}

.lending-sub-header th {
    padding: 6px 16px !important;
    font-size: 0.72rem !important;
    font-weight: 500 !important;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--border-color) !important;
}

.lending-table tbody td {
    padding: 12px 16px;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--border-color);
    font-variant-numeric: tabular-nums;
}

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

.lending-asset {
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.lending-asset-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.lending-apy-supply {
    color: var(--positive-color);
    font-weight: 600;
}

.lending-apy-borrow {
    color: var(--negative-color);
    font-weight: 500;
}

.lending-best-rate {
    background: rgba(16, 185, 129, 0.08);
    border-radius: 4px;
}

.lending-na {
    color: var(--text-light);
    font-style: italic;
}

.lending-empty {
    text-align: center;
    color: var(--text-light);
    font-size: 0.85rem;
    font-style: italic;
    padding: 20px 0;
}

/* Peg Watch Section */
.peg-watch-section {
    margin-bottom: 30px;
}

.peg-watch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.peg-watch-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.peg-watch-title-row .section-title {
    margin-bottom: 0;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-light);
    padding: 4px 10px;
    background: var(--background-light);
    border-radius: 12px;
}

.live-indicator.connected {
    color: var(--positive-color);
}

.live-indicator.disconnected {
    color: var(--negative-color);
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-light);
}

.live-indicator.connected .live-dot {
    background: var(--positive-color);
    animation: pulse 2s infinite;
}

.live-indicator.disconnected .live-dot {
    background: var(--negative-color);
}

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

.peg-watch-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.peg-watch-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.peg-watch-card {
    background: var(--background-white);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    border: 2px solid transparent;
}

.peg-watch-card:hover {
    box-shadow: var(--card-shadow-hover);
}

.peg-watch-card.on-peg {
    border-color: var(--positive-color);
}

.peg-watch-card.off-peg {
    border-color: var(--negative-color);
}

.peg-card-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.peg-symbol {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
}

.peg-name {
    font-size: 0.875rem;
    color: var(--text-light);
}

.peg-current {
    margin-bottom: 16px;
}

.peg-current-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.peg-current-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    font-family: 'Inter', monospace;
}

.peg-current-deviation {
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 4px;
}

.peg-current-deviation.on-peg {
    color: var(--positive-color);
}

.peg-current-deviation.off-peg {
    color: var(--negative-color);
}

.peg-historical {
    background: var(--background-light);
    border-radius: 8px;
    padding: 12px 16px;
}

.peg-historical-dynamic {
    margin-bottom: 12px;
}

.peg-historical-label {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.peg-period-select {
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--background-white);
    color: var(--text-dark);
    cursor: pointer;
    text-transform: none;
}

.peg-period-select:hover {
    border-color: var(--primary-color);
}

.peg-period-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.peg-price-display {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.peg-deviation-positive {
    color: var(--positive-color);
}

.peg-deviation-negative {
    color: var(--negative-color);
}

.peg-historical-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
}

.peg-historical-value.significant {
    color: var(--negative-color);
}

.peg-max-dollar {
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.8;
}

.peg-historical-date {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 4px;
}

.info-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    background: var(--text-light);
    color: var(--background-white);
    border-radius: 50%;
    font-size: 0.6rem;
    font-weight: 700;
    font-style: italic;
    margin-left: 6px;
    cursor: help;
    position: relative;
}

.info-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--tooltip-bg);
    color: var(--text-white);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-style: normal;
    font-weight: 400;
    white-space: normal;
    max-width: 240px;
    width: max-content;
    text-align: center;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.info-tooltip:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--tooltip-bg);
    z-index: 100;
}

.peg-historical-short {
    margin-bottom: 12px;
}

@media (max-width: 600px) {
    .peg-watch-grid {
        grid-template-columns: 1fr;
    }

    .peg-watch-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .peg-current-value {
        font-size: 1.5rem;
    }
}

/* Breakdown Section */
.breakdown-section {
    margin-bottom: 40px;
}

.breakdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.breakdown-header .section-title {
    margin-bottom: 0;
}

.breakdown-title-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.breakdown-subtitle {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 400;
}

.global-controls-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.global-chains-btn {
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 2px solid var(--border-color);
    background: var(--background-white);
    color: var(--text-dark);
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    white-space: nowrap;
}

.global-chains-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Rankings Table */
.rankings-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--background-white);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 4px;
    transition: var(--transition);
}

.rankings-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.85rem;
    min-width: 700px;
}

.rankings-table thead th {
    padding: 14px 18px;
    font-weight: 600;
    font-size: 0.7rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    text-align: left;
    position: sticky;
    top: 0;
    background: var(--background-white);
    z-index: 1;
    cursor: grab;
    user-select: none;
    transition: background 0.15s;
}

.rankings-table thead th:hover {
    background: var(--background-light);
}

.rankings-table thead th:active {
    cursor: grabbing;
}

.rankings-table thead th.drag-over {
    background: rgba(26, 115, 232, 0.1);
}

.rankings-table thead th .sort-arrow {
    font-size: 0.6rem;
    margin-left: 4px;
    opacity: 0.3;
}

.rankings-table thead th .sort-arrow.active {
    opacity: 1;
    color: var(--primary-color);
}

.rankings-table thead th.col-rank {
    width: 48px;
    text-align: center;
    cursor: default;
}

.rankings-table thead th.col-value,
.rankings-table thead th.col-native {
    text-align: right;
}

.rankings-table tbody tr {
}

.rankings-table tbody tr.non-usd-row {
    box-shadow: inset 3px 0 0 var(--primary-color);
}

.rankings-table tbody td {
    padding: 12px 18px;
    border-bottom: 1px solid transparent;
    color: var(--text-dark);
    text-align: left;
    vertical-align: middle;
}

.rankings-table tbody td.col-rank {
    text-align: center;
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--text-light);
}

.rankings-table tbody td.col-rank.rank-gold {
    color: #d4a017;
    font-size: 0.9rem;
}

.rankings-table tbody td.col-rank.rank-silver {
    color: #9ca3af;
    font-size: 0.88rem;
}

.rankings-table tbody td.col-rank.rank-bronze {
    color: #b87333;
    font-size: 0.86rem;
}

.rankings-table tbody td.col-value {
    text-align: right;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: 0.85rem;
    color: var(--text-dark);
}

.rankings-table tbody td.col-native {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-size: 0.82rem;
}

.rankings-table tbody td.col-symbol {
    font-weight: 700;
    font-size: 0.88rem;
}

.rankings-table tbody td.col-name {
    color: var(--text-light);
    font-size: 0.82rem;
}

.rankings-table tbody td.col-backing {
    color: var(--text-light);
    font-size: 0.78rem;
    font-style: italic;
}

.rankings-table .coin-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
}

.rankings-table .mechanism-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.rankings-table .mechanism-pill.mech-fiat {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.rankings-table .mechanism-pill.mech-crypto {
    background: rgba(139, 92, 246, 0.1);
    color: #7c3aed;
}

.rankings-table .mechanism-pill.mech-algo {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.rankings-table .gecko-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.2s;
    margin-left: 6px;
}

.rankings-table tbody tr:hover .gecko-link {
    opacity: 0.7;
}

.rankings-table tbody tr:hover .gecko-link:hover {
    opacity: 1;
}

.rankings-table .native-value {
    color: var(--text-light);
    font-weight: 500;
}

.rankings-hidden {
    display: none;
}

.rankings-show-more-row td {
    text-align: center;
    padding: 16px;
    border-bottom: none;
}

.rankings-show-more-btn {
    padding: 8px 24px;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    background: var(--background-light);
    color: var(--text-dark);
    cursor: pointer;
    border-radius: 20px;
    transition: var(--transition);
}

.rankings-show-more-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Dark mode */
[data-theme="dark"] .rankings-table-wrapper {
    background: var(--background-card);
}

[data-theme="dark"] .rankings-table thead th {
    background: var(--background-card);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .rankings-table thead th:hover {
    background: rgba(255, 255, 255, 0.05);
}


[data-theme="dark"] .rankings-table .coin-dot {
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .mechanism-pill.mech-fiat {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

[data-theme="dark"] .mechanism-pill.mech-crypto {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
}

[data-theme="dark"] .mechanism-pill.mech-algo {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.global-currency-filter {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
    background: var(--background-light);
    padding: 3px;
    border-radius: var(--border-radius-sm);
}

.global-currency-filter .btn {
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 2px solid var(--border-color);
    background: var(--background-white);
    color: var(--text-dark);
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    white-space: nowrap;
}

.global-currency-filter .btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.global-currency-filter .btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.5);
}

.breakdown-date-buttons {
    display: flex;
    gap: 4px;
}

.breakdown-date-buttons .btn {
    padding: 6px 12px;
    font-size: 0.75rem;
}

.custom-breakdown-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--background-white);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 16px;
    min-width: 200px;
    z-index: 100;
}

.custom-breakdown-dropdown.visible {
    display: block;
}

.breakdown-controls {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Toggle Switch */
.chain-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    background: var(--background-white);
    padding: 10px 16px;
    border-radius: var(--border-radius-sm);
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.chain-toggle:hover {
    background: rgba(26, 115, 232, 0.05);
}

.chain-toggle input {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--background-light);
    border-radius: 12px;
    transition: var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: var(--background-white);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    transition: var(--transition);
}

.chain-toggle input:checked + .toggle-slider {
    background: var(--primary-color);
}

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

.toggle-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Export Button */
.breakdown-controls .btn {
    display: flex;
    align-items: center;
    gap: 6px;
}

.breakdown-controls .btn svg {
    flex-shrink: 0;
}


.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.section-title span {
    font-weight: 400;
    color: var(--text-light);
    font-size: 0.9em;
}

.breakdown-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.stablecoin-card {
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.stablecoin-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--coin-color, var(--primary-color));
}

.coin-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.coin-symbol {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
}

.coin-name {
    font-size: 0.75rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.coin-circulation {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 2px;
}

.coin-circulation-usd {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 6px;
}

.coin-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.market-share {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 500;
}

.change {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.change.positive {
    background: rgba(16, 185, 129, 0.1);
    color: var(--positive-color);
}

.change.negative {
    background: rgba(239, 68, 68, 0.1);
    color: var(--negative-color);
}

/* Chain Breakdown */
.coin-chains {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    display: none;
}

.coin-chains.visible {
    display: block;
}

.chain-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.chain-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: var(--background-light);
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-light);
}

.chain-tag.primary {
    background: var(--primary-color);
    color: white;
}

.chain-tag-more {
    cursor: pointer;
    transition: var(--transition);
}

.chain-tag-more:hover {
    background: var(--primary-color);
    color: white;
}

/* Expanded chains container */
.chain-expanded {
    display: none;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border-color);
}

.chain-expanded.visible {
    display: block;
}

.chain-expanded .chain-tag {
    margin-bottom: 4px;
}

/* Loading States */
.loading-placeholder {
    display: block;
    height: 24px;
    background: linear-gradient(90deg, var(--background-light) 25%, var(--border-color) 50%, var(--background-light) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.loading-card .loading-placeholder {
    height: 80px;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

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

.stablecoin-card {
    animation: fadeIn 0.3s ease forwards;
}

.mover-item {
    animation: fadeIn 0.2s ease forwards;
}

.dominance-stat {
    animation: fadeIn 0.2s ease forwards;
}

/* Global Stablecoins Section */
.global-section {
    margin-bottom: 30px;
}

.global-table-wrapper {
    overflow-x: auto;
}

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

.global-table th {
    text-align: left;
    padding: 10px 14px;
    color: var(--text-light);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
}

.global-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-dark);
}

.global-table tr:last-child td {
    border-bottom: none;
}

.global-currency-header td {
    background: var(--background-light);
    padding: 8px 14px;
    font-size: 0.82rem;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-color);
}

.global-table .positive {
    color: var(--positive-color);
}

.global-table .negative {
    color: var(--negative-color);
}

.gecko-link-small {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.75rem;
    margin-left: 4px;
}

.gecko-link-small:hover {
    color: var(--primary-color);
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-light);
    font-size: 0.875rem;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.footer a:hover {
    text-decoration: underline;
}

.last-updated {
    margin-top: 8px;
    font-size: 0.75rem;
}

.footer-qr {
    margin-bottom: 16px;
}

.footer-qr a {
    text-decoration: none;
}

.footer-qr a:hover {
    text-decoration: none;
}

.footer-qr img {
    width: 120px;
    height: 120px;
    border-radius: 8px;
}

.footer-qr p {
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--text-light);
}

.footer-qr p:hover {
    text-decoration: underline;
    color: var(--primary-color);
}

.footer-subscribe {
    margin-bottom: 16px;
}

.footer-subscribe-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.footer-subscribe iframe {
    max-width: 100%;
}

/* Error State */
.error-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--negative-color);
}

.error-message h3 {
    margin-bottom: 8px;
}

.error-message button {
    margin-top: 16px;
    padding: 10px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    cursor: pointer;
}

/* ============================================ */
/* Weekly Insights Section                      */
/* ============================================ */

.insights-section {
    margin-bottom: 30px;
}

.insights-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.insights-header-row .section-title {
    margin-bottom: 0;
}

.insights-subtitle {
    color: var(--text-light);
    font-size: 0.85rem;
    margin: -12px 0 16px 0;
}

.insights-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Mode Toggle (Weekly | Monthly) */
.insights-mode-toggle {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.insights-mode-btn {
    padding: 5px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    border: none;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
}

.insights-mode-btn:not(:last-child) {
    border-right: 1px solid var(--border-color);
}

.insights-mode-btn.active {
    background: var(--primary-color);
    color: #fff;
}

.insights-mode-btn:hover:not(.active) {
    background: var(--background-light);
}

/* Period Select Dropdown */
.insights-period-select {
    padding: 5px 28px 5px 10px;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    background-color: var(--background-white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    min-width: 260px;
    max-width: 260px;
}

.insights-period-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.15);
}

/* Commentary Card */
.insights-commentary-card {
    padding: 20px 24px;
    margin-bottom: 20px;
}

.insights-commentary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.insights-commentary-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.insights-commentary-badge {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary-color);
    background: rgba(26, 115, 232, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
}

[data-theme="dark"] .insights-commentary-badge {
    background: rgba(59, 130, 246, 0.15);
}

.insights-commentary-body {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-dark);
}

.insights-commentary-body p {
    margin-bottom: 12px;
}

.insights-commentary-body p:last-child {
    margin-bottom: 0;
}

.insights-commentary-error {
    color: var(--text-light);
    font-size: 0.85rem;
    font-style: italic;
}

.insights-generate-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 24px 16px;
}

.insights-generate-text {
    color: var(--text-light);
    font-size: 0.85rem;
    margin: 0;
}

.insights-generate-btn {
    padding: 8px 24px;
    font-size: 0.85rem;
}

/* Sources List */
.insights-sources {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.insights-sources-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
}

.insights-sources ul {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.insights-sources li {
    font-size: 0.8rem;
    line-height: 1.4;
}

.insights-sources a {
    color: var(--primary-color);
    text-decoration: none;
}

.insights-sources a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .breakdown-grid {
        grid-template-columns: repeat(3, 1fr);
    }

}

@media (max-width: 900px) {
    .summary-cards {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .chart-container {
        height: 350px;
    }

}

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

    .dominance-chart-container {
        height: 280px;
        max-width: 280px;
        margin: 0 auto;
    }

    .chain-breakdown-grid {
        grid-template-columns: 1fr;
    }

    .chain-chart-container {
        max-width: 240px;
        height: 240px;
        margin: 0 auto;
    }

    .volume-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .header h1 {
        font-size: 1.75rem;
    }

    .header .subtitle {
        font-size: 0.9rem;
    }

    .theme-toggle {
        top: 10px;
        right: 10px;
        width: 38px;
        height: 38px;
    }

    .summary-cards {
        grid-template-columns: 1fr;
    }

    .card-value {
        font-size: 1.5rem;
    }

    .controls-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .control-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .button-group {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
    }

    .btn {
        padding: 10px 8px;
        font-size: 0.8rem;
    }

    .breakdown-grid {
        grid-template-columns: 1fr;
    }

    .news-columns {
        grid-template-columns: 1fr;
    }

    .breakdown-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .breakdown-controls {
        width: 100%;
        justify-content: space-between;
    }

    .movers-grid {
        grid-template-columns: 1fr;
    }

    .movers-header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .chain-breakdown-header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .chain-change {
        width: auto;
        font-size: 0.72rem;
    }

    .chain-supply {
        width: 55px;
    }

    .volume-header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .volume-chart-container {
        height: 300px;
    }

    .lending-header-row {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .lending-table {
        min-width: 500px;
    }

    .dominance-grid {
        grid-template-columns: 1fr;
    }

    .dominance-header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .dominance-chart-container {
        height: 240px;
        max-width: 240px;
    }

    .chart-container {
        height: 300px;
    }

    .chart-header {
        flex-direction: column;
    }

    .coin-selection-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .selection-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .date-range-display {
        display: block;
        margin-left: 0;
        margin-top: 8px;
    }

    .insights-header-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .insights-controls {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }

    .insights-period-select {
        max-width: 100%;
        flex: 1;
        min-width: 180px;
    }

    /* Rankings table: compact on mobile, tap to expand */
    .rankings-table {
        min-width: 0;
    }

    .rankings-table .col-mechanism,
    .rankings-table .col-backing,
    .rankings-table .col-native {
        display: none;
    }

    .rankings-table thead th {
        padding: 10px 10px;
        font-size: 0.65rem;
    }

    .rankings-table tbody td {
        padding: 8px 10px;
        font-size: 0.82rem;
    }

    .rankings-table tbody td.col-value {
        font-size: 0.8rem;
    }

    .rankings-table tbody td.col-name {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .rankings-table .coin-dot {
        width: 6px;
        height: 6px;
        margin-right: 4px;
    }

    .rankings-table tbody tr {
        cursor: pointer;
    }

    /* Expanded detail row on mobile */
    .rankings-detail-row td {
        padding: 0 10px 10px;
        border-bottom: 1px solid var(--border-color);
    }

    .rankings-detail {
        display: flex;
        flex-wrap: wrap;
        gap: 6px 16px;
        padding: 8px 12px;
        background: var(--background-light);
        border-radius: 6px;
        font-size: 0.78rem;
        color: var(--text-light);
    }

    .rankings-detail span {
        white-space: nowrap;
    }

    .rankings-detail strong {
        color: var(--text-dark);
        font-weight: 600;
    }

    /* Watchlist table: no forced min-width */
    .watchlist-table {
        min-width: 100%;
    }

    /* Lending table: no forced min-width */
    .lending-table {
        min-width: 100%;
    }

    /* Stablecoin cards: full width, no fixed sizing */
    .stablecoin-card {
        padding: 14px;
        min-width: 100% !important;
        max-width: 100% !important;
    }

    .coin-circulation {
        font-size: 1.1rem;
    }

    .coin-circulation-usd {
        font-size: 0.78rem;
    }

    /* Non-USD cards: tighter on mobile */
    .global-controls-row {
        gap: 6px;
    }

    .global-currency-filter {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .global-currency-filter .btn {
        padding: 4px 8px;
        font-size: 0.68rem;
        flex-shrink: 0;
    }

    /* Prevent any element from causing horizontal page scroll */
    .container {
        overflow-x: hidden;
    }

    .breakdown-header {
        overflow: hidden;
    }

    .breakdown-subtitle {
        word-break: break-word;
    }

}

/* Section Background Tints — removed per user preference */

/* ============================================ */
/* Dark Mode Polish                             */
/* ============================================ */

[data-theme="dark"] .card:hover {
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.12), 0 0 0 1px rgba(96, 165, 250, 0.1);
}

[data-theme="dark"] .card {
    border-color: rgba(51, 65, 85, 0.8);
}

[data-theme="dark"] .section-title {
    color: #f1f5f9;
}

[data-theme="dark"] .chart-card:hover,
[data-theme="dark"] .insights-commentary-card:hover,
[data-theme="dark"] .lending-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: none;
}

/* ============================================ */
/* Sticky Section Navigation                    */
/* ============================================ */

.section-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--background-white);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border-radius: var(--border-radius-sm);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .section-nav {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.section-nav-inner {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}

.section-nav-inner::-webkit-scrollbar {
    display: none;
}

.nav-link {
    flex-shrink: 0;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--text-dark);
}

.nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

@media (max-width: 600px) {
    .nav-link {
        padding: 8px 12px;
        font-size: 0.75rem;
    }

}

/* ============================================ */
/* Sparkline Charts in Grid Cards               */
/* ============================================ */

.sparkline-container {
    height: 28px;
    margin: 8px 0 4px;
    position: relative;
}

.sparkline-container canvas {
    display: block;
    max-width: 100%;
}

/* ============================================ */
/* CoinGecko Info Links in Grid Cards           */
/* ============================================ */

.coin-info-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    float: right;
    margin-top: 6px;
    padding: 2px 6px;
    font-size: 0.6rem;
    color: var(--text-secondary);
    text-decoration: none;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    opacity: 0.7;
    transition: color 0.2s, border-color 0.2s, background-color 0.2s, opacity 0.2s;
}

.coin-info-link:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background-color: rgba(59, 130, 246, 0.06);
    opacity: 1;
}

.coin-info-link svg {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
}

/* ============================================ */
/* Favourites / Watchlist                       */
/* ============================================ */

.favourite-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-light);
    opacity: 0.3;
    transition: color 0.2s, opacity 0.2s, transform 0.2s;
    padding: 0;
    margin-left: auto;
    line-height: 1;
}

.favourite-btn:hover {
    opacity: 0.7;
    transform: scale(1.15);
}

.favourite-btn.active {
    color: #f59e0b;
    opacity: 1;
}

.favourite-btn.active:hover {
    opacity: 0.8;
}

.watchlist-section {
    margin-bottom: 24px;
}

.watchlist-embedded {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.watchlist-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.watchlist-header-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 16px;
}

.watchlist-subtitle {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Watchlist Prompt (before Compare clicked) */
.watchlist-prompt-card {
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.watchlist-prompt-coins {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.watchlist-empty-hint {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
}

.watchlist-prompt-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--hover-background);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.watchlist-prompt-chip .watchlist-coin-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.watchlist-compare-btn {
    white-space: nowrap;
    padding: 8px 24px;
    font-weight: 600;
}

@media (max-width: 600px) {
    .watchlist-prompt-card {
        flex-direction: column;
        align-items: stretch;
    }

    .watchlist-compare-btn {
        width: 100%;
    }
}

/* Comparison Table */
.watchlist-comparison-card {
    padding: 0;
    margin-bottom: 16px;
    overflow: hidden;
}

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

.watchlist-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    min-width: 500px;
}

.watchlist-table thead th {
    padding: 14px 16px;
    text-align: center;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-dark);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.watchlist-table thead th:first-child {
    text-align: left;
    color: var(--text-light);
    font-weight: 500;
    width: 130px;
}

.watchlist-table tbody td {
    padding: 10px 16px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-dark);
}

.watchlist-table tbody td:first-child {
    text-align: left;
    font-weight: 500;
    color: var(--text-light);
    font-size: 0.8rem;
}

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

.watchlist-table tbody tr:nth-child(even) {
    background: var(--hover-background);
}

.watchlist-coin-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.watchlist-coin-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}

.watchlist-coin-symbol {
    font-weight: 700;
    font-size: 0.9rem;
}

.watchlist-coin-name {
    font-size: 0.7rem;
    color: var(--text-light);
    font-weight: 400;
}

.watchlist-table .positive {
    color: var(--positive-color);
    font-weight: 600;
}

.watchlist-table .negative {
    color: var(--negative-color);
    font-weight: 600;
}

.watchlist-unstar-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #f59e0b;
    font-size: 0.85rem;
    padding: 0;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.watchlist-unstar-btn:hover {
    opacity: 1;
}

/* Circulation Trends Chart */
.watchlist-chart-card {
    padding: 20px;
    position: relative;
}

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

.watchlist-chart-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.watchlist-chart-wrapper {
    height: 300px;
    position: relative;
}

.watchlist-chart-wrapper canvas {
    width: 100% !important;
    height: 100% !important;
}

.watchlist-chart-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

@media (max-width: 600px) {
    .watchlist-chart-wrapper {
        height: 250px;
    }

    .watchlist-chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .watchlist-table {
        font-size: 0.8rem;
    }

    .watchlist-table thead th,
    .watchlist-table tbody td {
        padding: 8px 10px;
    }
}

/* Watchlist Limit Toast */
.watchlist-limit-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--card-background);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 24px;
    font-size: 0.85rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    z-index: 250;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
}

.watchlist-limit-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* ============================================ */
/* New Entrant Tracker Badges                   */
/* ============================================ */

.peg-badge {
    display: inline-block;
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 2px 5px;
    border-radius: 3px;
    margin-left: 5px;
    vertical-align: middle;
    line-height: 1.4;
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.entrant-badge {
    display: inline-block;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    margin-left: 6px;
    vertical-align: middle;
    line-height: 1.4;
}

.entrant-new {
    background: #10b981;
    color: #fff;
}

.entrant-surging {
    background: #f59e0b;
    color: #fff;
}

/* ============================================ */
/* Comparison Mode                              */
/* ============================================ */

.compare-mode .stablecoin-card {
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.compare-mode .stablecoin-card:hover {
    border-color: var(--primary-color);
}

.compare-mode .stablecoin-card.compare-selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.compare-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    z-index: 200;
}

.compare-bar-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Comparison Modal */
.comparison-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 300;
}

.comparison-modal-overlay.visible {
    display: flex;
}

.comparison-modal {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

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

.comparison-modal-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.comparison-close-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0 4px;
    line-height: 1;
}

.comparison-close-btn:hover {
    color: var(--text-primary);
}

.comparison-modal-body {
    padding: 20px;
}

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

.comparison-table th,
.comparison-table td {
    padding: 10px 12px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.comparison-table th {
    font-weight: 600;
    vertical-align: bottom;
}

.comparison-table td:first-child,
.comparison-table th:first-child {
    text-align: left;
}

.compare-coin-symbol {
    font-weight: 700;
    font-size: 0.95rem;
}

.compare-coin-name {
    font-size: 0.7rem;
    color: var(--text-light);
}

.compare-metric-label {
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.compare-metric-value {
    font-size: 0.85rem;
    font-weight: 500;
}

@media (max-width: 600px) {
    .comparison-modal {
        width: 95%;
        max-height: 90vh;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 8px 6px;
        font-size: 0.75rem;
    }

    .compare-bar {
        bottom: 10px;
        padding: 8px 14px;
        gap: 8px;
    }
}

/* ============================================ */
/* Share, Subscribe & Support Nav Links           */
/* ============================================ */

.share-nav-link {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
}

.subscribe-nav-link {
    color: var(--primary-color) !important;
    font-weight: 600 !important;
}

.donate-nav-link {
    color: #ef4444 !important;
    font-weight: 600 !important;
}

[data-theme="dark"] .donate-nav-link {
    color: #f87171 !important;
}

/* Like button */
.like-nav-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
    white-space: nowrap;
    transition: color 0.2s ease;
}

.like-nav-btn:hover {
    color: var(--text-dark);
}

.like-heart-icon {
    transition: transform 0.2s ease, fill 0.2s ease;
}

.like-nav-btn.liked .like-heart-icon {
    fill: #ef4444;
    stroke: #ef4444;
}

.like-nav-btn.liked {
    color: #ef4444;
}

[data-theme="dark"] .like-nav-btn.liked .like-heart-icon {
    fill: #f87171;
    stroke: #f87171;
}

[data-theme="dark"] .like-nav-btn.liked {
    color: #f87171;
}

.like-count {
    font-variant-numeric: tabular-nums;
}

@keyframes likeBounce {
    0% { transform: scale(1); }
    30% { transform: scale(1.3); }
    60% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.like-heart-icon.bounce {
    animation: likeBounce 0.4s ease;
}

@media (max-width: 600px) {
    .like-nav-btn {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
}

/* ============================================ */
/* Ask the Data Section                          */
/* ============================================ */

/* ============================================ */
/* Net Issuance Section                         */
/* ============================================ */

.issuance-section {
    margin-bottom: 40px;
}

.issuance-card {
    padding: 20px 24px;
}

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

.issuance-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.issuance-range-toggles {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.issuance-range-btn {
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    background: var(--background-white);
    color: var(--text-light);
    border: none;
    border-right: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.issuance-range-btn:last-child {
    border-right: none;
}

.issuance-range-btn:hover {
    background: var(--hover-bg, rgba(0, 0, 0, 0.04));
}

.issuance-range-btn.active {
    background: var(--primary-color);
    color: #fff;
}

.issuance-coin-select {
    padding: 5px 28px 5px 10px;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    color: var(--text-dark);
    background-color: var(--background-white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    min-width: 120px;
}

.issuance-coin-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.15);
}

.issuance-description {
    font-size: 0.8rem;
    color: var(--text-light);
    margin: 0 0 8px 0;
}

.issuance-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 0 10px 0;
    font-size: 0.85rem;
}

.issuance-date-range {
    color: var(--text-light);
}

.issuance-total {
    font-weight: 600;
    font-size: 1rem;
}

.issuance-chart-container {
    position: relative;
    height: 300px;
}

@media (max-width: 600px) {
    .issuance-card {
        padding: 16px;
    }

    .issuance-chart-container {
        height: 220px;
    }

    .issuance-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .issuance-controls {
        width: 100%;
        flex-wrap: wrap;
    }
}

/* ============================================ */
/* Ask the Data Section                         */
/* ============================================ */

.ask-section {
    margin-bottom: 40px;
}

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

.ask-card {
    padding: 20px 24px;
}

.ask-description {
    font-size: 0.8rem;
    color: var(--text-light);
    margin: 0 0 14px 0;
}

.ask-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.ask-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--background-light);
    color: var(--text-dark);
    transition: border-color 0.2s;
}

.ask-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

.ask-input::placeholder {
    color: var(--text-light);
}

.ask-submit {
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.ask-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

.ask-suggestions-label {
    font-size: 0.75rem;
    color: var(--text-light);
    padding: 4px 0;
}

.ask-chip {
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: transparent;
    color: var(--text-dark);
    font-size: 0.78rem;
    font-family: 'Inter', -apple-system, sans-serif;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
    line-height: 1.3;
}

.ask-chip:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.ask-answer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.ask-answer-question {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.ask-answer-body {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-dark);
}

.ask-answer-body p {
    margin-bottom: 12px;
}

.ask-answer-body p:last-child {
    margin-bottom: 0;
}

.ask-loading {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ask-chip:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ask-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ask-remaining-badge {
    font-size: 0.7rem;
    color: var(--text-light);
    padding: 3px 10px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    white-space: nowrap;
}

/* Follow-up question chips */
.ask-followups {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.ask-followups-label {
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
}

.ask-followups-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ask-followup-chip {
    background: transparent;
    border: 1px dashed var(--border-color);
    color: var(--primary-color);
    font-size: 0.78rem;
}

.ask-followup-chip:hover {
    background: var(--primary-color);
    border-style: solid;
    border-color: var(--primary-color);
    color: #fff;
}

/* Conversation controls */
.ask-conversation-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.ask-new-conversation {
    padding: 5px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: transparent;
    color: var(--text-light);
    font-size: 0.75rem;
    font-family: 'Inter', -apple-system, sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.ask-new-conversation:hover {
    background: var(--background-light);
    color: var(--text-dark);
    border-color: var(--text-light);
}

.ask-thread-indicator {
    font-size: 0.7rem;
    color: var(--text-light);
}

@media (max-width: 600px) {
    .ask-card {
        padding: 16px;
    }

    .ask-input-row {
        flex-direction: column;
    }

    .ask-submit {
        width: 100%;
    }
}

/* ============================================ */
/* Lending Table Enhancements                    */
/* ============================================ */

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

.lending-chain-tag {
    display: block;
    font-size: 0.65rem;
    color: var(--text-light);
    font-weight: 400;
    margin-top: 1px;
}

.lending-tvl {
    font-size: 0.8rem;
    color: var(--text-light);
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .lending-table {
        font-size: 0.72rem;
    }

    .lending-table thead th,
    .lending-table tbody td {
        padding: 8px 5px;
    }
}

/* ============================================ */
/* Social Sharing                                */
/* ============================================ */

.share-buttons {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.share-label {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-right: 2px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--background-white);
    color: var(--text-light);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, background-color 0.2s;
    padding: 0;
}

.share-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.share-btn-telegram:hover {
    color: #0088cc;
    border-color: #0088cc;
}

.share-btn-whatsapp:hover {
    color: #25d366;
    border-color: #25d366;
}

.share-btn-email:hover {
    color: #ea4335;
    border-color: #ea4335;
}

.share-btn-copy:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.share-buttons {
    flex-wrap: wrap;
}

.insights-share {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

/* Stories Worth Reading */
.insights-stories-card {
    margin-top: 16px;
    padding: 20px 24px;
}

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


.stories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.story-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.story-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.story-link {
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    line-height: 1.4;
}

.story-link:hover {
    text-decoration: underline;
}

.story-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.story-source {
    font-size: 0.75rem;
    color: var(--text-light);
}

.story-summary {
    font-size: 0.82rem;
    color: var(--text-light);
    margin-top: 4px;
    line-height: 1.4;
}

/* Coin Deep Dive Section */
.coin-dive-section {
    margin-bottom: 30px;
}

.ask-share {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    display: none;
}

.footer-share {
    margin-top: 12px;
}

/* ============================================ */
/* Chart Fullscreen                              */
/* ============================================ */

.chart-card.chart-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 200;
    border-radius: 0;
    margin: 0;
    max-width: none;
    overflow-y: auto;
    padding: 20px;
    background: var(--background-body);
    transition: all 0.3s ease;
}

.chart-card.chart-fullscreen .chart-container {
    height: calc(100vh - 140px);
}

.chart-card.chart-fullscreen .chart-container canvas {
    max-height: 100%;
}

body.fullscreen-active {
    overflow: hidden;
}

@media (max-width: 600px) {
    .chart-card.chart-fullscreen .chart-container {
        height: calc(100vh - 180px);
    }

    .chart-card.chart-fullscreen {
        padding: 12px;
    }
}

/* ============================================ */
/* Toast Notification                            */
/* ============================================ */

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--tooltip-bg);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 500;
    white-space: nowrap;
}

.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================ */
/* Keyboard Shortcuts Modal                      */
/* ============================================ */

.keyboard-shortcuts-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 300;
}

.keyboard-shortcuts-overlay.visible {
    display: flex;
}

.keyboard-shortcuts-modal {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    max-width: 480px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    padding: 24px;
}

.keyboard-shortcuts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.keyboard-shortcuts-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.keyboard-shortcuts-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.keyboard-shortcuts-close:hover {
    color: var(--text-dark);
}

.keyboard-shortcuts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

kbd {
    display: inline-block;
    padding: 3px 7px;
    font-size: 0.72rem;
    font-family: 'SF Mono', 'Monaco', 'Menlo', monospace;
    background: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    min-width: 24px;
    text-align: center;
    color: var(--text-dark);
    box-shadow: 0 1px 0 var(--border-color);
    line-height: 1.4;
    white-space: nowrap;
}

.shortcut-sections {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.shortcut-sections-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.shortcut-sections-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.shortcut-sections-grid span {
    display: flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 600px) {
    .keyboard-shortcuts-grid {
        grid-template-columns: 1fr;
    }

    .shortcut-sections-grid {
        grid-template-columns: 1fr;
    }

    .keyboard-shortcuts-modal {
        padding: 16px;
    }
}

/* ============================================
   Historical Snapshot Styles
   ============================================ */

.snapshot-section {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.snapshot-controls {
    margin-bottom: 20px;
}

.snapshot-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 4px 0;
}

.snapshot-hint {
    font-size: 0.8rem;
    color: var(--text-light);
    margin: 0 0 12px 0;
}

.snapshot-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.snapshot-date-input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--background-white);
    color: var(--text-dark);
    font-size: 0.88rem;
    min-width: 160px;
}

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

.snapshot-go-btn {
    white-space: nowrap;
}

.snapshot-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px 0;
    color: var(--text-light);
    font-size: 0.88rem;
}

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

.snapshot-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
}

.snapshot-table thead th {
    padding: 10px 16px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.snapshot-table tbody td {
    padding: 12px 16px;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--border-color);
    font-variant-numeric: tabular-nums;
}

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

.snapshot-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.04);
}

[data-theme="dark"] .snapshot-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.08);
}

@media (max-width: 600px) {
    .snapshot-input-row {
        flex-direction: column;
        align-items: stretch;
    }

    .snapshot-date-input {
        width: 100%;
    }

    .snapshot-go-btn {
        width: 100%;
    }

    .snapshot-table {
        min-width: 450px;
    }

    .snapshot-table thead th,
    .snapshot-table tbody td {
        padding: 10px 12px;
        font-size: 0.82rem;
    }
}

/* ============================================
   Mobile Polish — Touch Targets & Small Screens
   ============================================ */

@media (max-width: 600px) {
    /* Improve touch targets — Apple HIG recommends 44px minimum */
    .btn,
    .btn-small {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .section-nav .nav-link {
        min-height: 40px;
        padding: 10px 12px;
    }

    /* Favourite / star buttons need bigger tap area */
    .favourite-btn,
    .watchlist-unstar-btn {
        min-width: 44px;
        min-height: 44px;
    }

    /* Table cells slightly more generous */
    .lending-table tbody td,
    .watchlist-table td,
    .watchlist-table th {
        padding: 10px 12px;
        font-size: 0.82rem;
    }
}

/* Extra-small screens (narrow phones) */
@media (max-width: 400px) {
    .header h1 {
        font-size: 1.4rem;
    }

    .header .subtitle {
        font-size: 0.75rem;
    }

    .section-nav .nav-link {
        font-size: 0.7rem;
        padding: 8px 8px;
    }

    .summary-cards {
        gap: 8px;
    }

    .card {
        padding: 14px;
    }

    .section-title {
        font-size: 1rem;
    }

    .breakdown-subtitle {
        font-size: 0.72rem;
    }

    .btn,
    .btn-small {
        font-size: 0.75rem;
        padding: 8px 10px;
    }

    .snapshot-title {
        font-size: 1rem;
    }
}

/* ============================================
   Liquid Glass Effect — Mobile
   ============================================ */

@media (max-width: 600px) {
    @supports (backdrop-filter: blur(1px)) {
        .section-nav {
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            background: rgba(241, 245, 249, 0.75);
            border-bottom: 1px solid rgba(255, 255, 255, 0.18);
        }

        [data-theme="dark"] .section-nav {
            background: rgba(15, 23, 42, 0.7);
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        }

        .summary-cards .card {
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            background: rgba(255, 255, 255, 0.7);
            border: 1px solid rgba(255, 255, 255, 0.3);
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
        }

        [data-theme="dark"] .summary-cards .card {
            background: rgba(30, 41, 59, 0.6);
            border: 1px solid rgba(255, 255, 255, 0.08);
            box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
        }

        .breakdown-header,
        .movers-header,
        .snapshot-controls {
            backdrop-filter: blur(6px);
            -webkit-backdrop-filter: blur(6px);
            background: rgba(255, 255, 255, 0.5);
            border-radius: var(--border-radius-sm);
            padding: 12px;
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        [data-theme="dark"] .breakdown-header,
        [data-theme="dark"] .movers-header,
        [data-theme="dark"] .snapshot-controls {
            background: rgba(30, 41, 59, 0.45);
            border: 1px solid rgba(255, 255, 255, 0.06);
        }
    }
}
