/* ===== CHART CONTENT ===== */
#league-content {
    width: 100% !important;
    min-width: 0 !important;
    align-items: stretch;
    background: var(--chart-surface-color);
}

#team-sheets-content {
    min-width: 1000px !important;
}

.vega-embed {
    display: block !important;
    width: fit-content !important;
    height: fit-content !important;
    transform-origin: top left;
    position: relative;
}

.vega-embed.has-actions {
    padding: 0 !important;
}

.chart-embed-host {
    display: inline-block;
    width: auto;
    min-width: 100%;
}

.chart-host--intrinsic .chart-embed-host {
    min-width: 0;
    width: auto;
    max-width: max-content;
}

.chart-host--intrinsic,
.player-stats-chart-container {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}

.chart-host--intrinsic .vega-embed,
.chart-host--intrinsic .vega-embed > div {
    width: max-content !important;
    min-width: 0 !important;
}

.chart-embed-host--team-sheets {
    min-width: max-content;
}

.player-stats-chart-container {
    display: inline-block;
    min-height: 0;
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

.team-sheets-page-shell {
    padding-top: 1.25rem !important;
}

.team-sheets-header {
    margin-bottom: 0.9rem !important;
}

.team-sheets-chart-shell {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    min-height: 0 !important;
    padding: 0 !important;
}

#teamSheetsChart .vega-embed,
#teamSheetsChart .vega-embed > div {
    width: max-content !important;
    min-width: max-content !important;
}

#teamSheetsChart .vega-embed {
    margin: 0 !important;
}

#teamSheetsChart .vega-bindings {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

#teamSheetsChart svg,
#teamSheetsChart canvas {
    display: block;
}

/* ===== OPT-IN MOBILE SCALE UTILITIES =====
   Apply to a chart wrapper when tighter mobile scaling is needed:
   <div class="chart-scale-mobile-tight">...</div>
*/
.chart-scale-mobile-tight {
    --chart-mobile-scale: 0.85;
    --chart-mobile-scale-xs: 0.7;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {

    .chart-scale-mobile-tight .vega-embed {
        transform: scale(var(--chart-mobile-scale));
        transform-origin: top left;

    }

    .chart-host--intrinsic .chart-embed-host,
    .player-stats-chart-container .chart-embed-host {
        min-width: 0;
        max-width: 100%;
    }

    .team-sheets-page-shell {
        padding-top: 0.85rem !important;
    }

    .team-sheets-header {
        margin-bottom: 0.65rem !important;
    }
}

/* Very narrow screens */
@media (max-width: 480px) {

    .chart-scale-mobile-tight .vega-embed {
        transform: scale(var(--chart-mobile-scale-xs));
        transform-origin: top left;
    }
}