/*
 * CMC Modern Single Coin Page Design
 * Version: 1.2
 */

/* ═══════ CSS VARIABLES ═══════ */
.cmc-modern-page {
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --positive: #16c784;
    --positive-bg: rgba(22,199,132,0.08);
    --negative: #ea3943;
    --negative-bg: rgba(234,57,67,0.08);
    --bg: #ffffff;
    --card-bg: #ffffff;
    --text: #1e2329;
    --text-secondary: #707a8a;
    --text-muted: #a1aab5;
    --border: #eaecef;
    --border-light: #f2f3f5;
    --hover-bg: #f8f9fb;
    --card-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
    --radius: 12px;
    --radius-sm: 8px;
}

.cmc-modern-page {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 16px 60px;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif !important;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    color: var(--text);
}
/* Override theme's sidebar-none 1200px constraint */
.sidebar-none .entry-content:has(.cmc-modern-page) {
    max-width: 100% !important;
}

.cmc-modern-page *,
.cmc-modern-page *::before,
.cmc-modern-page *::after {
    box-sizing: border-box;
}

/* ═══════ BREADCRUMBS ═══════ */
.cmc-modern-page .cmc-breadcrumbs {
    padding: 12px 0;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}
.cmc-modern-page .cmc-breadcrumbs a {
    color: var(--primary);
    text-decoration: none;
}
.cmc-modern-page .cmc-breadcrumbs a:hover { text-decoration: underline; }
.cmc-modern-page .cmc-breadcrumb-sep { margin: 0 6px; color: var(--text-muted); }

/* ═══════ HEADER ═══════ */
.cmc-modern-page .coin-header {
    margin-bottom: 25px;
    max-width: 100%;
}

.cmc-modern-page .coin-header-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.cmc-modern-page .coin-logo-wrap {
    flex-shrink: 0;
    position: relative;
    display: inline-block;
}

/* 6) Logo fix — force square aspect ratio */
.cmc-modern-page .coin-logo-wrap img {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.cmc-modern-page .coin-title-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

@media (max-width: 768px) {
    .cmc-modern-page .coin-title-col {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

.cmc-modern-page .coin-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cmc-modern-page .coin-name-row h1 {
    font-size: 30px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: none;
    line-height: 1.3;
    flex-wrap: wrap;
    min-width: 0;
}

.cmc-modern-page .coin-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.cmc-modern-page .coin-badges-row {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
}

.cmc-modern-page .ticker-badge {
    background: #eff2f5;
	max-width: 99%;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    flex-shrink: 0;
	overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.cmc-modern-page .header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.cmc-modern-page .btn-icon {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-secondary);
    transition: all 0.2s;
    flex-shrink: 0;
}
.cmc-modern-page .btn-icon:hover { border-color: var(--primary); color: var(--primary); }

.cmc-modern-page .btn-action {
    border: 1px solid var(--border);
    background: var(--card-bg);
    padding: 7px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: var(--text);
    transition: all 0.2s;
    font-family: inherit;
}
.cmc-modern-page .btn-action:hover { border-color: var(--primary); color: var(--primary); }

/* ═══════ PRICE BLOCK ═══════ */
.cmc-modern-page .price-block {
    padding-bottom: 10px;
}

.cmc-modern-page .coin-price-label {
    font-size: 13px;
    color: #999;
    margin-bottom: 4px;
    font-weight: 400;
}
.cmc-modern-page .coin-price-ticker {
    color: #777;
    font-weight: 500;
}

.cmc-modern-page .price-line1 {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    margin-bottom: 6px;
}

.cmc-modern-page .price-main {
    font-size: 33px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.cmc-modern-page .price-change-badge {
    font-size: 14px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.cmc-modern-page .price-change-badge.up { background: var(--positive-bg); color: var(--positive); }
.cmc-modern-page .price-change-badge.down { background: var(--negative-bg); color: var(--negative); }

.cmc-modern-page .price-line2 {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.cmc-modern-page .price-btc {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.cmc-modern-page .price-range-24h {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.cmc-modern-page .range-label {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 12px;
}

.cmc-modern-page .range-val {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
}

.cmc-modern-page .range-bar {
    width: 120px;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    position: relative;
    overflow: visible;
}

.cmc-modern-page .range-bar-fill {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    background: var(--primary-light);
    border-radius: 3px;
    opacity: 0.3;
}

.cmc-modern-page .range-bar-marker {
    position: absolute;
    top: -3px;
    width: 12px; height: 12px;
    background: var(--primary);
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(37,99,235,0.2);
    transform: translateX(-50%);
}

/* ═══════ MAIN GRID ═══════ */
.cmc-modern-page .main-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    align-items: start;
    max-width: 100%;
    margin: 0 auto;
    overflow: visible;
}

/* ═══════ CARD — universal ═══════ */
.cmc-modern-page .cmc-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 20px;
    min-width: 0;
    overflow: hidden;
	width: 100%;
}
.cmc-modern-page .cmc-card:last-child { margin-bottom: 0; }

/* ═══════ LEFT COLUMN ═══════ */
.cmc-modern-page .left-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ═══════ Chart ═══════ */
.cmc-modern-page .cmc-card.block-chart {
    padding: 12px 16px;
}

.cmc-modern-page .chart-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-top: 1px solid var(--border-light);
    flex-wrap: wrap;
    gap: 8px;
}

/* 1) Unified toolbar row: tabs left + range right */
.cmc-modern-page .chart-toolbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 0;
    border-top: 1px solid var(--border-light);
}

.cmc-modern-page .chart-periods { display: flex; gap: 2px; }

.cmc-modern-page .period-btn {
    padding: 5px 12px;
    border: none;
    background: transparent;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.cmc-modern-page .period-btn:hover { background: var(--hover-bg); color: var(--primary); }
.cmc-modern-page .period-btn.active { background: var(--primary); color: #fff; }

.cmc-modern-page .chart-type-btns {
    display: flex;
    gap: 2px;
    background: var(--hover-bg);
    border-radius: 6px;
    padding: 2px;
}
.cmc-modern-page .chart-type-btn {
    padding: 5px 12px;
    border: none;
    background: transparent;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
    font-family: inherit;
}
.cmc-modern-page .chart-type-btn.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

.cmc-modern-page .chart-area {
    min-height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* Override chart container inside modern page */
.cmc-modern-page .cmc-chart {
    margin: 0;
    border: none;
    box-shadow: none;
    background: transparent;
}

/* 3) Responsive chart height */
.cmc-modern-page .cmc-wrp,
.cmc-modern-page #cmc-container-tv {
    min-height: 350px;
    height: clamp(280px, 40vw, 350px) !important;
    width: 100%;
}

/* Range buttons — styled same as tab-group-charts */
.cmc-modern-page .cmc-am4-range {
    display: flex;
    gap: 2px;
    background: var(--hover-bg);
    border-radius: 6px;
    padding: 2px;
    flex-wrap: nowrap;
    width: fit-content;
}
.cmc-modern-page .cmc-lw-range-buttons {
    display: flex;
    gap: 2px;
    flex-wrap: nowrap;
}
.cmc-modern-page .cmc-lw-range-btn {
    padding: 5px 12px;
    border: none;
    background: transparent;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    white-space: nowrap;
    line-height: 1.4;
}
.cmc-modern-page .cmc-lw-range-btn:hover { background: rgba(37,99,235,0.06); color: var(--primary); }
.cmc-modern-page .cmc-lw-range-btn.active {
    background: #fff;
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Chart tab switching */
.cmc-modern-page .cmc-tab-group-charts {
    list-style: none;
    margin: 0;
    padding: 2px;
    display: flex;
    gap: 2px;
    background: var(--hover-bg);
    border-radius: 6px;
    width: fit-content;
}
.cmc-modern-page .cmc-tab-group-charts li { margin: 0; padding: 0; }
.cmc-modern-page .cmc-tabsBtn-charts {
    padding: 5px 12px;
    border: none;
    background: transparent;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
    text-decoration: none;
}
.cmc-modern-page .cmc-tabsBtn-charts.active {
    background: #fff;
    color: var(--text);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ═══════ Lightweight Charts table/td reset (theme override) ═══════ */
.cmc-modern-page .tv-lightweight-charts table,
.cmc-modern-page .tv-lightweight-charts td,
.cmc-modern-page .tv-lightweight-charts tr,
.cmc-modern-page [data-lw-chart] table,
.cmc-modern-page [data-lw-chart] td,
.cmc-modern-page [data-lw-chart] tr,
.cmc-modern-page .cmc-wrp table,
.cmc-modern-page .cmc-wrp td,
.cmc-modern-page .cmc-wrp tr,
.cmc-modern-page .block-chart table,
.cmc-modern-page .block-chart td,
.cmc-modern-page .block-chart tr {
    border: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border-spacing: 0 !important;
    border-collapse: collapse !important;
}

/* ═══════ TABS ═══════ */
.cmc-modern-page .tabs-nav {
    display: flex;
    padding: 0 16px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border-light);
    list-style: none;
    margin: 0;
}

.cmc-modern-page .tab-btn {
    padding: 12px 16px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: inherit;
}
.cmc-modern-page .tab-btn:hover { color: var(--text); }
.cmc-modern-page .tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.cmc-modern-page .tab-btn i { font-size: 17px; }

.cmc-modern-page .tab-panel {
    padding: 20px 16px;
    display: none;
}
.cmc-modern-page .tab-panel.active { display: block; }
.cmc-modern-page .tab-panel p {
    color: #4d5662;
    line-height: 1.75;
    margin-bottom: 12px;
    font-size: 18px;
}
.cmc-modern-page .tab-panel p:last-child { margin-bottom: 0; }

/* Description inside tab */
.cmc-modern-page .tab-panel .cmc_custom_description,
.cmc-modern-page .tab-panel .cmc-limited-text,
.cmc-modern-page .tab-panel .cmc-full-text {
    color: #4d5662;
    line-height: 1.75;
    font-size: 18px;
}
.cmc-modern-page .tab-panel .cmc_custom_description p,
.cmc-modern-page .tab-panel .cmc-limited-text p,
.cmc-modern-page .tab-panel .cmc-full-text p {
    color: #4d5662;
    line-height: 1.75;
    margin-bottom: 12px;
    font-size: 18px;
}

/* ═══════ Info grid (Community / Dev / Tech) ═══════ */
/* 4) Info grid: full width, last orphan child stretches */
.cmc-modern-page .cmc-card.block-info-grid {
    width: 100%;
}
.cmc-modern-page .tab-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
/* Dynamic columns: 2 children = 2 cols, 1 child = 1 col */
.cmc-modern-page .tab-info-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}
.cmc-modern-page .tab-info-grid.cols-1 {
    grid-template-columns: 1fr;
}
/* When 2-col layout has orphan last item, span full row (tablet only) */
@media (max-width: 1100px) {
    .cmc-modern-page .tab-info-grid .tab-info-card:last-child:nth-child(odd):not(:first-child) {
        grid-column: 1 / -1;
    }
}

.cmc-modern-page .tab-info-card {
    background: var(--hover-bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 14px;
    min-width: 0;
}

.cmc-modern-page .tab-info-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.cmc-modern-page .tab-info-header i { font-size: 18px; color: var(--primary); }

.cmc-modern-page .metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    font-size: 13px;
}
.cmc-modern-page .metric-row:last-child { border-bottom: none; }

.cmc-modern-page .m-label {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}
.cmc-modern-page .m-label i { font-size: 17px; width: 20px; text-align: center; }

.cmc-modern-page .m-value { font-weight: 700; color: var(--text); }

.cmc-modern-page .sentiment-bar-wrap { margin-top: 8px; }
.cmc-modern-page .sentiment-label-sm { font-size: 11px; color: var(--text-muted); font-weight: 600; margin-bottom: 5px; }
.cmc-modern-page .sentiment-labels { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.cmc-modern-page .s-up { color: var(--positive); }
.cmc-modern-page .s-down { color: var(--negative); }
.cmc-modern-page .sentiment-bar { height: 8px; border-radius: 4px; display: flex; overflow: hidden; }
.cmc-modern-page .s-fill-up { background: var(--positive); }
.cmc-modern-page .s-fill-down { background: var(--negative); }

.cmc-modern-page .metric-big { text-align: center; padding: 4px 0; }
.cmc-modern-page .metric-big .m-value-big { font-size: 24px; font-weight: 800; color: var(--text); }
.cmc-modern-page .metric-big .m-label-sm { font-size: 11px; color: var(--text-muted); margin-top: 1px; font-weight: 500; }

.cmc-modern-page .contract-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    margin-top: 6px;
}
.cmc-modern-page .chain-icon {
    width: 20px; height: 20px; border-radius: 50%;
    background: #627eea;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 13px; flex-shrink: 0;
}
.cmc-modern-page .addr {
    font-family: 'SF Mono', 'Consolas', monospace;
    color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    flex: 1; font-size: 11px;
}
.cmc-modern-page .copy-btn {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; padding: 2px; font-size: 16px;
}
.cmc-modern-page .copy-btn:hover { color: var(--primary); }

.cmc-modern-page .platform-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.cmc-modern-page .platform-tag {
    padding: 2px 8px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 11px; font-weight: 600; color: #4b5563;
}

/* ═══════ RIGHT COLUMN — theiaStickySidebar ═══════ */
.cmc-modern-page .right-col {
    display: flex;
    flex-direction: column;
    position: relative;
}

.cmc-modern-page .sb-segment {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--card-shadow);
    margin-bottom: 12px;
}

.cmc-modern-page .sb-header {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.cmc-modern-page .sb-header i { font-size: 18px; color: var(--primary); }

.cmc-modern-page .stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
}
.cmc-modern-page .stat-row:last-child { border-bottom: none; }

.cmc-modern-page .stat-label {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}
.cmc-modern-page .stat-label i { font-size: 15px; width: 18px; text-align: center; }

.cmc-modern-page .stat-val {
    font-weight: 700;
    text-align: right;
    color: var(--text);
}
.cmc-modern-page .stat-val.positive { color: var(--positive); }
.cmc-modern-page .stat-val.negative { color: var(--negative); }

/* Supply bar */
.cmc-modern-page .supply-bar-wrap { margin-top: 6px; }
.cmc-modern-page .supply-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 500;
}
.cmc-modern-page .supply-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}
.cmc-modern-page .supply-bar-fill {
    height: 100%;
    background: var(--primary-light);
    border-radius: 3px;
    opacity: 0.5;
}

/* ATH/ATL rows */
.cmc-modern-page .ath-atl-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}
.cmc-modern-page .ath-atl-row:last-child { border-bottom: none; }

.cmc-modern-page .ath-atl-icon {
    width: 28px; height: 28px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; flex-shrink: 0;
}
.cmc-modern-page .ath-atl-icon.up { background: var(--positive-bg); color: var(--positive); }
.cmc-modern-page .ath-atl-icon.down { background: var(--negative-bg); color: var(--negative); }

.cmc-modern-page .ath-atl-info { flex: 1; min-width: 0; }
.cmc-modern-page .ath-atl-info .ath-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; font-weight: 700; }
.cmc-modern-page .ath-atl-info .ath-price { font-weight: 700; font-size: 14px; }

.cmc-modern-page .ath-atl-right { text-align: right; }
.cmc-modern-page .ath-atl-right .ath-pct { font-weight: 700; font-size: 13px; }
.cmc-modern-page .ath-atl-right .ath-pct.positive { color: var(--positive); }
.cmc-modern-page .ath-atl-right .ath-pct.negative { color: var(--negative); }
.cmc-modern-page .ath-atl-right .ath-date { font-size: 11px; color: var(--text-muted); }

/* 11) Changes strip — auto-fit columns based on item count */
.cmc-modern-page .changes-strip-sb {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 0;
    margin-bottom: 14px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.cmc-modern-page .ch-item-sb {
    text-align: center;
    padding: 8px 4px;
    border-right: 1px solid var(--border-light);
    background: #f8f9fb;
}
.cmc-modern-page .ch-item-sb:last-child { border-right: none; }

.cmc-modern-page .ch-period-sb {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 2px;
    letter-spacing: 0.3px;
}

.cmc-modern-page .ch-value-sb {
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 1px;
}
.cmc-modern-page .ch-value-sb.up { color: var(--positive); }
.cmc-modern-page .ch-value-sb.down { color: var(--negative); }
.cmc-modern-page .ch-value-sb i { font-size: 13px; }

/* Converter */
.cmc-modern-page .converter-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}
.cmc-modern-page .converter-field { position: relative; }
.cmc-modern-page .converter-input {
    width: 100%;
    padding: 10px 50px 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    background: var(--hover-bg);
    transition: border-color 0.2s;
    font-family: inherit;
}
.cmc-modern-page .converter-input:focus { outline: none; border-color: var(--primary); background: #fff; }
.cmc-modern-page .converter-currency {
    position: absolute;
    right: 12px; top: 50%; transform: translateY(-50%);
    font-size: 12px; font-weight: 700; color: var(--text-muted);
}
.cmc-modern-page .converter-swap-row {
    display: flex;
    justify-content: center;
    margin: -3px 0;
    position: relative;
    z-index: 1;
}
.cmc-modern-page .converter-swap {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: #fff;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
    font-size: 15px;
    transition: all 0.2s;
}
.cmc-modern-page .converter-swap:hover { border-color: var(--primary); color: var(--primary); }
.cmc-modern-page .converter-swap.swapped { transform: rotate(180deg); }

/* Links & Categories */
.cmc-modern-page .link-tags,
.cmc-modern-page .cat-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cmc-modern-page .link-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
    background: var(--hover-bg);
    text-decoration: none;
    transition: all 0.15s;
    cursor: pointer;
}
.cmc-modern-page .link-tag:hover {
    border-color: var(--primary);
    color: var(--primary);
    text-decoration: none;
}
.cmc-modern-page .link-tag i { font-size: 15px; color: var(--text-secondary); }
.cmc-modern-page .link-tag:hover i { color: var(--primary); }

.cmc-modern-page .cat-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(37,99,235,0.04);
    border: 1px solid rgba(37,99,235,0.12);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    transition: all 0.15s;
}
.cmc-modern-page .cat-tag:hover {
    background: rgba(37,99,235,0.08);
    border-color: rgba(37,99,235,0.25);
    color: var(--primary-dark);
    text-decoration: none;
}
.cmc-modern-page .cat-tag .cat-rank {
    font-size: 10px; font-weight: 700; color: #fff;
    background: var(--primary); border-radius: 3px; padding: 1px 4px;
}

/* Show more btn */
.cmc-modern-page .tags-overflow .link-tag.hidden,
.cmc-modern-page .tags-overflow .cat-tag.hidden { display: none; }

.cmc-modern-page .tags-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 4px 8px;
    border: 1px dashed var(--border);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.cmc-modern-page .tags-more-btn:hover { border-color: var(--primary); color: var(--primary); }
.cmc-modern-page .tags-more-btn i { font-size: 15px; transition: transform 0.2s; }
.cmc-modern-page .tags-more-btn.expanded i { transform: rotate(180deg); }

/* Exchanges tab */
.cmc-modern-page .tab-panel .exchanges-loading {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
}
.cmc-modern-page #cmc-exchanges-container table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.cmc-modern-page #cmc-exchanges-container th,
.cmc-modern-page #cmc-exchanges-container td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

/* No price data state */
.cmc-modern-page .no-price-state {
    padding: 40px 20px;
    text-align: center;
}
.cmc-modern-page .no-price-state i { font-size: 48px; color: var(--text-muted); margin-bottom: 12px; }
.cmc-modern-page .no-price-state h3 { margin: 0 0 8px 0; color: var(--text); font-weight: 700; }
.cmc-modern-page .no-price-state p { color: var(--text-secondary); margin: 0; font-size: 14px; }

/* ═══════ Disqus comments ═══════ */
.cmc-modern-page #disqus_thread {
    padding: 20px 16px;
}

/* ═══════ Watchlist / Favorite button ═══════ */
.cmc-modern-page .cmc-modern-fav-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
    padding: 0;
    flex-shrink: 0;
}
.cmc-modern-page .cmc-modern-fav-btn i.bx {
    font-size: 20px;
    line-height: 1;
}
.cmc-modern-page .cmc-modern-fav-btn:hover {
    border-color: #f59e0b;
    color: #f59e0b;
}
.cmc-modern-page .cmc-modern-fav-btn.active {
    color: #f59e0b;
    border-color: #f59e0b;
}
.cmc-modern-page .cmc-modern-fav-btn.active i.bx {
    font-weight: 900;
}

/* ═══════ RESPONSIVE ═══════ */

/* Large screens */
@media (min-width: 1400px) {
    .cmc-modern-page .main-grid {
        grid-template-columns: 1fr 360px;
    }
}

/* ═══════ Tablet & Mobile shared (≤1100): contents + ordering ═══════ */
@media (max-width: 1100px) {
    .cmc-modern-page {
        padding: 16px 12px 40px;
    }
    .cmc-modern-page .left-col,
    .cmc-modern-page .right-col {
        display: contents;
    }
    .cmc-modern-page .right-col { position: static !important; top: auto !important; }
    /* Dissolve theiaStickySidebar wrapper so order works on grid children */
    .cmc-modern-page .right-col > .theiaStickySidebar {
        display: contents;
    }

    /* Block ordering */
    .cmc-modern-page .block-chart      { order: 1; }
    .cmc-modern-page .block-market     { order: 2; }
    .cmc-modern-page .block-supply     { order: 3; }
    .cmc-modern-page .block-dynamics   { order: 4; }
    .cmc-modern-page .block-links      { order: 5; }
    .cmc-modern-page .block-converter  { order: 6; }
    .cmc-modern-page .block-info-grid  { order: 7; }
    .cmc-modern-page .block-tabs       { order: 8; }
    .cmc-modern-page .block-categories { order: 9; }

    /* All sidebar blocks fill width */
    .cmc-modern-page .sb-segment {
        width: 100%;
        margin-bottom: 12px;
    }

    /* Info grid: 2 cols, orphan stretches */
    .cmc-modern-page .cmc-card.block-info-grid { width: 100%; }
    .cmc-modern-page .tab-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .cmc-modern-page .tab-info-grid.cols-1 {
        grid-template-columns: 1fr;
    }

    /* Chart card */

    /* Chart responsive height */
    .cmc-modern-page .cmc-wrp,
    .cmc-modern-page #cmc-container-tv {
        height: clamp(250px, 45vw, 420px);
        min-height: 250px;
    }
}

/* ═══════ Tablet 570–1100: 2-column pairs ═══════ */
@media (min-width: 570px) and (max-width: 1100px) {
    .cmc-modern-page .main-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0 12px;
    }

    /* Default: all blocks span full width */
    .cmc-modern-page .left-col > *,
    .cmc-modern-page .right-col > *,
    .cmc-modern-page .right-col > .theiaStickySidebar > * {
        grid-column: 1 / -1;
    }

    /* Market + Supply: side by side 50/50, equal height */
    .cmc-modern-page .block-market,
    .cmc-modern-page .block-supply {
        grid-column: auto !important;
        align-self: stretch;
    }

    /* Inside block-dynamics: ATH + ATL rows side by side */
    .cmc-modern-page .block-dynamics {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0 12px;
    }
    .cmc-modern-page .block-dynamics > .sb-header,
    .cmc-modern-page .block-dynamics > .changes-strip-sb {
        grid-column: 1 / -1;
    }
    .cmc-modern-page .block-dynamics .ath-atl-row {
        border-bottom: none;
    }
}

/* ═══════ Small phone (≤569): single column for everything ═══════ */
@media (max-width: 569px) {
    .cmc-modern-page .main-grid {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    /* Info grid collapses to 1 column */
    .cmc-modern-page .tab-info-grid,
    .cmc-modern-page .tab-info-grid.cols-2 {
        grid-template-columns: 1fr;
    }
}

/* ═══════ ≤768: smaller fonts, mobile header ═══════ */
@media (max-width: 768px) {
    .cmc-modern-page .price-main { font-size: 26px; }
    .cmc-modern-page .range-bar { width: 80px; }

    .cmc-modern-page .chart-toolbar-row { flex-wrap: wrap; }

}

/* ═══════ ≤480: phone ═══════ */
@media (max-width: 480px) {
    .cmc-modern-page {
        padding: 12px 8px 30px;
    }

    .cmc-modern-page .price-range-24h { width: 100%; }
    .cmc-modern-page .range-bar { flex: 1; width: auto; }

    .cmc-modern-page .cmc-card.block-chart {
        padding: 8px;
        border-radius: 8px;
    }

    .cmc-modern-page .price-block { padding: 8px 8px 12px 8px; }

    .cmc-modern-page .sb-segment {
        padding: 14px;
        border-radius: 8px;
    }

    .cmc-modern-page .stat-row { font-size: 13px; }

    .cmc-modern-page .tab-btn {
        padding: 10px 12px;
        font-size: 13px;
    }

    .cmc-modern-page .tab-panel { padding: 14px 10px; }

    .cmc-modern-page .tab-panel p,
    .cmc-modern-page .tab-panel .cmc_custom_description p,
    .cmc-modern-page .tab-panel .cmc-limited-text p,
    .cmc-modern-page .tab-panel .cmc-full-text p {
        font-size: 15px;
    }

    .cmc-modern-page .converter-input {
        font-size: 14px;
        padding: 9px 45px 9px 10px;
    }

    .cmc-modern-page .cmc-lw-range-btn {
        padding: 4px 8px;
        font-size: 11px;
    }
    .cmc-modern-page .cmc-tabsBtn-charts {
        padding: 4px 8px;
        font-size: 11px;
    }

    .cmc-modern-page .cmc-am4-range,
    .cmc-modern-page .cmc-tab-group-charts {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .cmc-modern-page .cmc-wrp,
    .cmc-modern-page #cmc-container-tv {
        height: clamp(220px, 55vw, 350px);
        min-height: 220px;
    }
}

/* ═══════ TASK 1: Rank overlay badge on logo ═══════ */
.cmc-modern-page .rank-overlay-badge {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #201c3a;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 4px;
    border-radius: 5px;
    white-space: nowrap;
    z-index: 2;
    cursor: default;
    border: 1.5px solid #fff;
    line-height: 1.3;
}

/* ═══════ TASK 2: Mobile actions menu ═══════ */
.cmc-modern-page .header-actions-mobile {
    display: none;
    position: relative;
    margin-left: auto;
    flex-shrink: 0;
}
@media (max-width: 768px) {
    .cmc-modern-page .header-actions { display: none; }
    .cmc-modern-page .header-actions-mobile { display: block; }
}
.cmc-modern-page .header-actions-toggle {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
}
.cmc-modern-page .header-actions-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.cmc-modern-page .header-actions-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--card-bg, #fff);
    border: 0.5px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    min-width: 180px;
    z-index: 100;
    overflow: hidden;
}
.cmc-modern-page .header-actions-dropdown[hidden] { display: none; }
.cmc-modern-page .had-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    font-size: 14px;
    color: #1a1a1a;
    cursor: pointer;
    text-align: left;
    border-bottom: 0.5px solid #f0f0f0;
    font-family: inherit;
}
.cmc-modern-page .had-item:last-child { border-bottom: none; }
.cmc-modern-page .had-item:hover { background: #f7f7f7; }
.cmc-modern-page .had-item i { font-size: 18px; color: var(--text-secondary); }

/* ═══════ TASK 3: Badge buttons (Categories / Links) ═══════ */
.cmc-modern-page .coin-badge-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid #e0e0e0;
    background: #f8f9fb;
    font-size: 13px;
    color: #707a8a;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
    white-space: nowrap;
}
.cmc-modern-page .coin-badge-btn:hover {
    background: #ebebeb;
}

/* ═══════ TASK 3: Modal overlay ═══════ */
.cmc-modern-page .coin-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.cmc-modern-page .coin-modal-overlay[hidden] { display: none; }

.cmc-modern-page .coin-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 440px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.cmc-modern-page .coin-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 0.5px solid #eee;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
    border-radius: 16px 16px 0 0;
}
.cmc-modern-page .coin-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}
.cmc-modern-page .coin-modal-close {
    width: 30px;
    height: 30px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: background 0.15s;
}
.cmc-modern-page .coin-modal-close:hover { background: #e0e0e0; }
.cmc-modern-page .coin-modal-body {
    padding: 16px 20px;
}

/* Category chips inside modal */
.cmc-modern-page .category-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    border-radius: 20px;
    background: #EEF2FF;
    color: #3730A3;
    font-size: 13px;
    text-decoration: none;
    border: 1px solid #C7D2FE;
    transition: background 0.15s;
}
.cmc-modern-page .category-chip:hover { background: #E0E7FF; text-decoration: none; color: #3730A3; }
.cmc-modern-page .category-chip .cat-rank {
    font-size: 10px; font-weight: 700; color: #fff;
    background: var(--primary); border-radius: 3px; padding: 1px 4px;
}

