/* =====================================================================
   Market trade chart - item detail right column page
   ===================================================================== */

.mkt-detail-page--right .mkt-trade-chart-section {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

.mkt-trade-chart-section .mkt-detail-order-title {
    margin-bottom: var(--space-sm);
}

.mkt-trade-chart__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-sm);
}

.mkt-trade-chart__legend {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-size-xs);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.mkt-trade-chart__legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.mkt-trade-chart__legend-item::before {
    content: '';
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 1px;
}

.mkt-trade-chart__legend-item--price::before {
    width: 0.85rem;
    height: 2px;
    border-radius: 0;
    background: var(--text-gold);
}

.mkt-trade-chart__legend-item--buy::before {
    background: var(--market-buy);
}

.mkt-trade-chart__legend-item--sell::before {
    background: var(--market-sell);
}

.mkt-trade-chart__range {
    display: flex;
    gap: 0.35rem;
}

.mkt-trade-chart-svg-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 560 / 184;
    overflow: visible;
    padding-bottom: 2px;
    padding-left: 6px;
}

.mkt-trade-chart-tooltip {
    position: absolute;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    transform: translate(-50%, calc(-100% - 6px));
    padding: 5px 10px;
    border-radius: 3px;
    border: 1px solid rgba(197, 160, 89, 0.35);
    background: var(--surface-raised);
    color: var(--text-gold);
    font-family: var(--font-body);
    font-size: var(--font-size-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

.mkt-trade-chart-tooltip__price {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.mkt-trade-chart-tooltip .mkt-coin-icon {
    width: 12px;
    height: 12px;
    vertical-align: middle;
}

.mkt-trade-chart-tooltip[hidden] {
    display: none;
}

.mkt-chart-hit {
    cursor: pointer;
    fill: transparent;
    stroke: transparent;
}

.mkt-chart-hit--active.mkt-chart-hit--bar {
    fill: rgba(197, 160, 89, 0.12);
    stroke: var(--text-gold);
    stroke-width: 1;
}

.mkt-chart-hit--active.mkt-chart-hit--price {
    fill: rgba(197, 160, 89, 0.15);
    stroke: var(--text-gold);
    stroke-width: 1.5;
}

.mkt-chart-hit:focus-visible {
    outline: 2px solid var(--text-gold);
    outline-offset: 1px;
}

.mkt-trade-chart-svg {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
}

.mkt-chart-grid-line {
    stroke: var(--market-chart-grid);
    stroke-width: 1;
}

.mkt-chart-axis {
    fill: var(--text-muted);
    font-size: 9px;
    font-family: var(--font-body);
}

.mkt-chart-axis--price {
    fill: rgba(197, 160, 89, 0.55);
}

.mkt-chart-axis-title {
    fill: var(--text-gold);
    font-family: var(--font-heading);
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    pointer-events: none;
}

.mkt-chart-bar--buy {
    fill: var(--market-buy);
}

.mkt-chart-bar--sell {
    fill: var(--market-sell);
}

.mkt-chart-bar--legacy {
    fill: var(--market-chart-volume-neutral);
}

.mkt-chart-price-area {
    fill: var(--market-chart-price-area);
    pointer-events: none;
}

.mkt-chart-price-line {
    stroke: var(--text-gold);
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
    pointer-events: none;
}

.mkt-chart-price-dot {
    fill: var(--text-gold);
    stroke: var(--surface-base);
    stroke-width: 1;
}

.mkt-trade-chart-empty {
    padding: var(--space-xl) var(--space-md);
    text-align: center;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    border: 1px dashed rgba(197, 160, 89, 0.2);
    border-radius: 4px;
}

.mkt-trade-chart-footnote {
    margin: var(--space-sm) 0 0;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    line-height: 1.45;
}

@media (max-width: 640px) {
    .mkt-trade-chart__toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .mkt-trade-chart__range {
        justify-content: flex-end;
    }
}
