/*
 * Écran Marché : en-tête, KPI, courbe d'indice, barres par segment, tableau des mouvements (T64).
 * Les KPI, le sélecteur de période, l'avertissement « périmé » et les tableaux réemploient les
 * composants du tableau de bord ; seuls les gabarits propres à l'écran vivent ici.
 */
.rb-market {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rb-market__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.rb-market__title {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.rb-market__subtitle {
    margin: 7px 0 0;
    color: var(--rb-text-subdued);
    font-size: 14px;
}

.rb-market__filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.rb-market__filter-label {
    color: var(--rb-text-label);
    font-size: 12px;
}

.rb-market__filter-select {
    padding: 7px 10px;
    color: var(--rb-text-muted);
    font-size: 12px;
    background-color: var(--rb-bg-inset);
    border: 1px solid var(--rb-border-chip);
    border-radius: var(--rb-radius-md);
}

.rb-market__kpis {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(3, 1fr);
    margin: 0;
}

/* Une valeur absente se lit sur le pointillé, pas sur la seule couleur. */
.rb-market__kpi--empty {
    border-style: dashed;
}

.rb-market__split {
    display: grid;
    gap: 20px;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    align-items: start;
}

.rb-market__block {
    min-width: 0;
    padding: 16px 18px;
    background-color: var(--rb-bg-panel);
    border: 1px solid var(--rb-border-default);
    border-radius: 14px;
}

.rb-market__block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.rb-market__block-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

.rb-market__block-note {
    color: var(--rb-text-faint);
    font-family: var(--rb-font-mono);
    font-size: 11.5px;
}

.rb-market__segments {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.rb-market__curve {
    width: 100%;
    height: 190px;
}

.rb-market__curve-fill {
    fill: color-mix(in srgb, var(--rb-accent-cyan) 10%, transparent);
    stroke: none;
}

.rb-market__curve-line {
    fill: none;
    stroke: var(--rb-accent-cyan);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

.rb-market__axis {
    display: flex;
    justify-content: space-between;
    margin: 8px 0 0;
    padding: 0;
    color: var(--rb-text-faint);
    font-family: var(--rb-font-mono);
    font-size: 10.5px;
    list-style: none;
}

.rb-market__bars {
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.rb-market__bar {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 7px 0;
}

/* Sous-grille : la colonne des notes est commune à toutes les lignes, les pistes ont donc toutes la même longueur. */
.rb-market__bars--stacked {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 10px;
}

.rb-market__bar--stacked {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    row-gap: 7px;
    padding: 9px 0;
    border-bottom: 1px solid var(--rb-border-default);
}

.rb-market__bar--up { --rb-market-bar-color: var(--rb-accent-green); }
.rb-market__bar--down { --rb-market-bar-color: var(--rb-accent-red); }

.rb-market__bar-label {
    flex: none;
    width: 112px;
    color: var(--rb-text-muted);
    font-size: 12.5px;
}

.rb-market__bar--stacked .rb-market__bar-label {
    width: auto;
    color: var(--rb-text-heading);
    font-size: 13px;
    font-weight: 600;
}

.rb-market__bar-track {
    flex: 1;
    height: 6px;
    overflow: hidden;
    background-color: var(--rb-border-default);
    border-radius: 3px;
}

.rb-market__bar--stacked .rb-market__bar-track {
    height: 4px;
    border-radius: 2px;
}

.rb-market__bar--stacked .rb-market__bar-value {
    font-size: 12.5px;
}

.rb-market__bar-fill {
    display: block;
    width: var(--rb-market-bar);
    height: 100%;
    background-color: var(--rb-market-bar-color);
}

.rb-market__bar-value {
    font-family: var(--rb-font-mono);
    font-size: 12px;
    text-align: right;
}

.rb-market__bar-note {
    color: var(--rb-text-faint);
    font-family: var(--rb-font-mono);
    font-size: 10.5px;
}

.rb-market__tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    border-bottom: 1px solid var(--rb-auth-divider);
}

.rb-market__tab {
    margin-bottom: -1px;
    padding: 10px 14px;
    color: var(--rb-text-subdued);
    font-size: 13.5px;
    white-space: nowrap;
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

.rb-market__tab:hover {
    color: var(--rb-text-heading);
}

.rb-market__tab--active {
    color: var(--rb-nav-text-active);
    font-weight: 700;
    border-bottom-color: var(--rb-accent-cyan);
}

.rb-market__row-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.rb-market__identity {
    min-width: 0;
}

.rb-market__card-name {
    display: block;
    overflow: hidden;
    color: var(--rb-text-heading);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.rb-market__card-meta {
    display: block;
    margin-top: 3px;
    color: var(--rb-text-label);
    font-size: 11px;
}

.rb-market__rarity--common { color: var(--rb-rarity-common); }
.rb-market__rarity--uncommon { color: var(--rb-rarity-uncommon); }
.rb-market__rarity--rare { color: var(--rb-rarity-rare); }
.rb-market__rarity--epic { color: var(--rb-rarity-epic); }
.rb-market__rarity--showcase { color: var(--rb-rarity-showcase); }

.rb-market__price,
.rb-market__change,
.rb-market__offers {
    font-family: var(--rb-font-mono);
}

.rb-market__offers {
    display: block;
    margin-top: 3px;
    color: var(--rb-text-faint);
    font-size: 10.5px;
}

.rb-market__liquidity {
    font-size: 12.5px;
}

.rb-market__liquidity--very-strong { color: var(--rb-accent-green); }
.rb-market__liquidity--correct { color: var(--rb-accent-cyan); }
.rb-market__liquidity--tight { color: var(--rb-accent-orange); }
.rb-market__liquidity--rare { color: var(--rb-accent-red); }
.rb-market__liquidity--empty { color: var(--rb-text-faint); }

.rb-market__col--signal {
    text-align: right;
}

.rb-market__pagination {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    color: var(--rb-text-secondary);
    font-size: 12px;
}

.rb-market__pagination-link {
    color: var(--rb-accent-purple);
}

@media (max-width: 759px) {
    .rb-market__kpis,
    .rb-market__split {
        grid-template-columns: 1fr;
    }

    .rb-market__col--wide {
        display: none;
    }
}
