.crypto-front-wrap {
    max-width: 1360px;
    margin: 1.5rem auto 3rem auto;
    padding: 0 1.25rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.crypto-front-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.4rem 1.75rem;
    border-radius: 14px;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #f8fafc;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
    margin-bottom: 1.25rem;
}
.crypto-front-title {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}
.crypto-front-title h1 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #ffffff;
}
.crypto-front-title p {
    margin: 0.25rem 0 0 0;
    font-size: 0.85rem;
    color: #94a3b8;
}
.crypto-front-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}
.crypto-admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.58rem 1.05rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.84rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: all 0.2s ease;
}
.crypto-admin-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Telemetry Summary Strip */
.spot-telemetry-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.15rem;
}
.telemetry-card {
    background: var(--card-bg, var(--bg-secondary, #1e293b));
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.2));
    border-left: 4px solid #3b82f6;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.telemetry-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary, #94a3b8);
}
.telemetry-val {
    font-size: 1.18rem;
    font-weight: 800;
    color: var(--text-main, var(--text-primary, #f8fafc));
    margin-top: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Multi-Timeframe Chart Terminal Card */
.spot-chart-terminal {
    background: var(--card-bg, var(--bg-secondary, #1e293b));
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.22));
    border-radius: 14px;
    padding: 1.1rem 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}
.spot-chart-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.85rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--border-color, rgba(148, 163, 184, 0.16));
}
.spot-coin-identity {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.spot-coin-identity img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.spot-coin-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}
.spot-coin-sym {
    font-size: 1.22rem;
    font-weight: 800;
    color: var(--text-main, var(--text-primary, #f8fafc));
    letter-spacing: -0.01em;
}
.spot-coin-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary, #94a3b8);
    background: rgba(148, 163, 184, 0.12);
    padding: 0.18rem 0.55rem;
    border-radius: 6px;
}
.ws-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.22rem 0.6rem;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.14);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    cursor: pointer;
    user-select: none;
    transition: all 0.18s ease;
}
.ws-live-badge.paused {
    background: rgba(148, 163, 184, 0.14);
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.28);
}
.ws-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}
.ws-live-badge.paused .ws-live-dot {
    background: #94a3b8;
    box-shadow: none;
}

/* Chart Toolbar */
.spot-chart-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 0.65rem;
    flex-wrap: wrap;
}
.itv-btn-group {
    display: inline-flex;
    background: var(--bg-color, var(--bg-primary, #0f172a));
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.28));
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
    height: 38px;
    align-items: center;
}
.itv-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary, #94a3b8);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.32rem 0.68rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.itv-btn:hover {
    color: var(--text-main, #f8fafc);
}
.itv-btn.active {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.4);
}

/* 5 Period Metric Strip inside Chart Card */
.spot-kline-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.65rem;
    margin: 0.85rem 0;
}
.spot-kline-metric-box {
    background: var(--bg-color, var(--bg-primary, #0f172a));
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.16));
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
}
.spot-kline-metric-lbl {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary, #94a3b8);
}
.spot-kline-metric-val {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-main, var(--text-primary, #f8fafc));
    margin-top: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Canvas Wrapper + Floating Legend */
.spot-canvas-wrap {
    position: relative;
    width: 100%;
    height: 540px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.2));
    background: #131722;
}
.spot-canvas-wrap.has-two-subpanes {
    height: 660px;
}
.spot-canvas-wrap.single-pane {
    height: 440px;
}
.spot-chart-legend {
    position: absolute;
    top: 10px;
    left: 12px;
    z-index: 10;
    pointer-events: none;
    background: rgba(19, 23, 34, 0.82);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.76rem;
    line-height: 1.45;
    color: #d1d4dc;
    max-width: calc(100% - 90px);
}
.spot-chart-loading {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(2px);
    color: #f8fafc;
    font-weight: 700;
    font-size: 0.92rem;
}

/* Controls Card */
.spot-controls-card {
    background: var(--card-bg, var(--bg-secondary, #1e293b));
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.2));
    border-radius: 14px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.15rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.spot-top-bar {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.ctrl-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.ctrl-field.grow {
    flex: 1;
    min-width: 220px;
}
.ctrl-field label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary, #94a3b8);
}
.ctrl-input,
.ctrl-select {
    height: 38px;
    padding: 0 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.3));
    background: var(--bg-color, var(--bg-primary, #0f172a));
    color: var(--text-main, var(--text-primary, #f8fafc));
    font-size: 0.84rem;
    outline: none;
}
.ctrl-input:focus,
.ctrl-select:focus {
    border-color: #3b82f6;
}
.spot-row-btn {
    height: 38px;
    padding: 0 0.95rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.25));
    background: var(--bg-color, var(--bg-primary, #0f172a));
    color: var(--text-main, var(--text-primary, #f8fafc));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.18s ease;
    white-space: nowrap;
    text-decoration: none;
}
.spot-row-btn:hover {
    border-color: #3b82f6;
}
.spot-row-btn.btn-primary {
    background: #2563eb;
    color: #ffffff;
    border-color: transparent;
}
.spot-row-btn.btn-primary:hover {
    background: #1d4ed8;
}

/* Table Card */
.crypto-table-card {
    background: var(--card-bg, var(--bg-secondary, #1e293b));
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.2));
    border-radius: 14px;
    padding: 1rem 1.15rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}
.crypto-market-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}
.crypto-market-table th {
    text-align: left;
    padding: 0.75rem 0.65rem;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary, #94a3b8);
    border-bottom: 2px solid var(--border-color, rgba(148, 163, 184, 0.22));
    white-space: nowrap;
}
.crypto-market-table td {
    padding: 0.68rem 0.65rem;
    border-bottom: 1px solid var(--border-color, rgba(148, 163, 184, 0.12));
    color: var(--text-main, var(--text-primary, #f1f5f9));
    vertical-align: middle;
    white-space: nowrap;
}
.crypto-market-table tr.spot-row-item {
    cursor: pointer;
    transition: background 0.14s ease;
}
.crypto-market-table tr.spot-row-item:hover td {
    background: rgba(59, 130, 246, 0.08);
}
.crypto-market-table tr.spot-row-item.active-row td {
    background: rgba(37, 99, 235, 0.14);
}
.coin-icon-img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
}
.coin-fallback-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #334155;
    color: #f8fafc;
    font-size: 0.65rem;
    font-weight: 800;
}
.chg-pill {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.78rem;
}
.chg-pill.up {
    color: #10b981;
    background: rgba(16, 185, 129, 0.12);
}
.chg-pill.down {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
}
.tbl-action-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.24rem 0.55rem;
    border-radius: 6px;
    font-size: 0.73rem;
    font-weight: 700;
    text-decoration: none;
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.25);
    transition: all 0.15s ease;
}
.tbl-action-link:hover {
    background: #2563eb;
    color: #ffffff;
}
.watch-star-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.12rem;
    line-height: 1;
    color: #64748b;
    padding: 0.15rem 0.3rem;
    border-radius: 6px;
    transition: transform 0.15s ease, color 0.15s ease;
    vertical-align: middle;
}
.watch-star-btn:hover {
    color: #fbbf24;
    transform: scale(1.18);
}
.watch-star-btn.starred {
    color: #f59e0b;
    text-shadow: 0 0 8px rgba(245, 158, 11, 0.35);
}
.spot-row-btn.btn-watchlist {
    border-color: rgba(245, 158, 11, 0.35);
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.08);
}
.spot-row-btn.btn-watchlist:hover {
    background: rgba(245, 158, 11, 0.16);
    border-color: #f59e0b;
}
.spot-row-btn.btn-watchlist.active {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.3);
}
.watch-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.16);
}
.empty-setup-cta {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-secondary, #94a3b8);
}

/* Light Mode Support — Top Banner */
[data-theme="light"] .crypto-front-hero {
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    color: #0f172a;
    border: 1px solid #cbd5e1;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06);
}
[data-theme="light"] .crypto-front-title h1 {
    color: #0f172a;
}
[data-theme="light"] .crypto-front-title p {
    color: #475569;
}
[data-theme="light"] .crypto-admin-btn {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #334155 !important;
}
[data-theme="light"] .crypto-admin-btn:hover {
    background: #e2e8f0;
}

@media (max-width: 1024px) {
    .spot-kline-metrics {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 900px) {
    .spot-telemetry-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .spot-kline-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
    .col-mobile-hide {
        display: none !important;
    }
}
