/* La page des courbes occupe toute la largeur, sans navigation. */
body.annexe-moha .layout {
    grid-template-columns: minmax(0, 1fr);
}
body.annexe-moha .content {
    min-width: 0;
}

body.annexe-moha .panel-heading > div,
body.annexe-moha .technique-report-panel,
body.annexe-moha .technique-report-chart,
body.annexe-moha .report-chart-card {
    min-width: 0;
}

body.annexe-moha .panel-heading {
    flex-wrap: wrap;
}

body.annexe-moha .report-chart-card {
    overflow: hidden;
}

/* Seule la courbe defile : les valeurs et legendes restent dans la page. */
.report-chart-viewport {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
}

.report-chart-scroll-hint {
    display: none;
    margin: 8px 12px;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

body.annexe-moha .report-chart-card-heading {
    flex-wrap: wrap;
}

body.annexe-moha .report-chart-click-state,
body.annexe-moha .technique-report-summary,
body.annexe-moha .report-chart-card-heading {
    overflow-wrap: anywhere;
}

.report-chart-viewport:focus-visible,
.report-mode-switch label:has(input:focus-visible) {
    outline: 2px solid var(--blue);
    outline-offset: -2px;
}

.report-chart-viewport [data-report-point-state]:focus-visible {
    outline: 2px solid var(--blue-dark);
    outline-offset: 3px;
}

@media (max-width: 900px) {
    body.annexe-moha .content {
        padding: 16px;
    }

    body.annexe-moha .panel-heading {
        flex-direction: column;
        align-items: stretch;
        margin-bottom: 0;
    }

    body.annexe-moha .history-filter-group {
        justify-content: flex-start;
    }

    body.annexe-moha .history-site-filter {
        width: 100%;
        min-width: 0;
    }

    body.annexe-moha .history-site-filter span {
        font-size: 0.85rem;
    }

    body.annexe-moha .history-site-filter select {
        min-height: 48px;
        font-size: 16px;
    }

    body.annexe-moha .report-mode-switch {
        min-width: 0;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.annexe-moha .report-mode-switch label {
        min-width: 0;
        min-height: 48px;
        padding: 10px;
        font-size: 0.85rem;
        line-height: 1.4;
    }

    body.annexe-moha .report-mode-switch input {
        flex: 0 0 auto;
        width: 18px;
        height: 18px;
        margin: 0;
    }

    body.annexe-moha .report-chart-card svg {
        min-width: 860px;
    }

    .report-chart-scroll-hint {
        display: block;
    }

    body.annexe-moha .report-chart-card-heading {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    body.annexe-moha .report-chart-card-heading span,
    body.annexe-moha .report-chart-click-state,
    body.annexe-moha .report-chart-legend-item {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    body.annexe-moha .technique-report-summary {
        font-size: 0.95rem;
        line-height: 1.6;
    }
}

@media (max-width: 480px) {
    body.annexe-moha .content {
        padding: 10px;
        padding-bottom: max(16px, env(safe-area-inset-bottom));
        gap: 12px;
    }

    body.annexe-moha .technique-report-panel {
        padding: 12px;
    }

    body.annexe-moha .topbar {
        padding: 14px;
    }
}

@media (max-width: 360px) {
    body.annexe-moha .report-mode-switch {
        grid-template-columns: minmax(0, 1fr);
    }
}
