/* Mobile and tablet hardening for Reports & Analytics. */
.report-bar-scroll,
.report-table-view,
.report-city-table-scroll,
.report-mini-table,
.report-range-presets,
.report-pagination nav {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
}

.report-bar-scroll {
    touch-action: pan-x pan-y;
}

@media (max-width: 1199px) {
    .reports-page {
        gap: 16px;
    }

    .reports-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 780px) {
    .reports-page {
        width: 100%;
        max-width: 100%;
        overflow-x: clip;
    }

    .reports-hero {
        min-height: 0;
        gap: 16px;
        padding: 18px;
    }

    .reports-hero-copy {
        align-items: flex-start;
        gap: 14px;
        min-width: 0;
    }

    .reports-hero-copy > div {
        min-width: 0;
    }

    .reports-hero-copy h2 {
        font-size: 20px;
        line-height: 1.2;
    }

    .reports-hero-copy p {
        font-size: 13px;
        line-height: 1.45;
    }

    .reports-download-button {
        width: 100%;
        align-self: stretch;
        min-height: 44px;
    }

    .reports-metrics {
        gap: 10px;
    }

    .report-metric-card {
        min-height: 76px;
        padding: 14px;
    }

    .report-metric-card strong {
        font-size: clamp(18px, 4.8vw, 22px);
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .reports-filter-card {
        width: 100%;
        padding: 14px;
        overflow: hidden;
    }

    .report-range-presets {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: thin;
    }

    .report-range-button,
    .report-apply-button,
    .report-reset-button {
        flex: 0 0 auto;
        min-height: 44px;
    }

    .report-date-form {
        width: 100%;
        gap: 10px;
    }

    .report-date-field {
        flex: 1 1 calc(50% - 5px);
        min-width: 0;
    }

    .report-date-field input {
        min-height: 44px;
    }

    .report-date-form > .report-apply-button {
        flex: 0 0 100%;
        width: 100%;
    }

    .report-advanced-filters summary {
        width: 100%;
        min-height: 44px;
        padding: 12px 0 0;
    }

    .report-filter-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .report-filter-grid select {
        width: 100%;
        min-height: 44px;
    }

    .report-filter-actions {
        flex-direction: column;
    }

    .report-filter-actions > * {
        width: 100%;
    }

    .report-card-header {
        padding: 18px 16px 10px;
    }

    .report-card-header h3 {
        font-size: 16px;
    }

    .report-view-toggle {
        flex: 0 0 auto;
    }

    .report-view-toggle button {
        min-height: 36px;
        padding-inline: 12px;
    }

    .report-chart-view {
        grid-template-columns: 34px minmax(0, 1fr);
        gap: 8px;
        height: 285px;
        padding: 10px 12px 22px 8px;
    }

    .report-chart-scale {
        font-size: 9px;
    }

    .report-table-view {
        max-width: 100%;
        padding: 0 14px 16px;
    }

    .report-table-view table {
        min-width: 560px;
    }

    .report-table-view th:first-child,
    .report-table-view td:first-child {
        position: sticky;
        left: 0;
        z-index: 1;
        background: #fff;
        box-shadow: 1px 0 0 #e0e5ec;
    }

    .report-table-view th:first-child {
        z-index: 2;
        background: #f6f8fb;
    }

    .report-donut-layout {
        min-height: 0;
        gap: 18px;
        padding: 8px 20px 24px;
    }

    .report-donut {
        width: 160px;
        height: 160px;
    }

    .report-donut::after {
        inset: 22px;
    }

    .report-donut strong {
        font-size: 26px;
    }

    .report-donut-legend {
        width: 100%;
        max-width: 360px;
        margin-inline: auto;
    }

    .report-insight-card {
        min-height: 0;
        padding: 18px;
    }

    .city-header {
        align-items: stretch;
        flex-direction: column;
    }

    .report-export-button {
        width: 100%;
        min-height: 44px;
    }

    .report-city-table-scroll {
        max-width: calc(100% - 28px);
        margin-inline: 14px;
        scrollbar-width: thin;
    }

    .report-city-table {
        min-width: 620px;
    }

    .report-city-table th,
    .report-city-table td {
        padding: 12px 14px;
    }

    .report-city-table th:first-child,
    .report-city-table td:first-child {
        position: sticky;
        left: 0;
        z-index: 1;
        background: #fff;
        box-shadow: 1px 0 0 #e0e5ec;
    }

    .report-city-table th:first-child {
        z-index: 2;
        background: #f6f8fb;
    }

    .report-rate-cell {
        grid-template-columns: minmax(110px, 1fr) 60px;
        gap: 10px;
    }

    .report-pagination {
        align-items: stretch;
        gap: 12px;
        padding: 16px 14px 18px;
    }

    .report-pagination nav {
        width: 100%;
        max-width: 100%;
        padding-bottom: 4px;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .report-pagination a,
    .report-pagination nav > span {
        flex: 0 0 auto;
        min-width: 42px;
        height: 42px;
    }

    .report-status-details > summary {
        min-height: 48px;
        padding: 14px 16px;
    }

    .report-status-grid {
        gap: 14px;
        padding: 0 14px 14px;
    }

    .report-mini-table {
        max-width: 100%;
        padding: 0 14px 14px;
    }

    .report-mini-table table {
        min-width: 420px;
    }
}

@media (max-width: 520px) {
    .reports-page {
        gap: 12px;
    }

    .reports-hero {
        padding: 16px;
    }

    .reports-hero-copy {
        gap: 12px;
    }

    .reports-hero-icon {
        flex-basis: 44px;
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }

    .reports-metrics {
        grid-template-columns: 1fr;
    }

    .report-metric-card {
        min-height: 72px;
    }

    .report-date-field {
        flex-basis: 100%;
    }

    .report-card-header {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .report-view-toggle {
        width: 100%;
    }

    .report-view-toggle button {
        flex: 1 1 0;
        min-height: 40px;
    }

    .report-chart-view {
        grid-template-columns: 30px minmax(0, 1fr);
        height: 250px;
        padding: 8px 8px 20px 6px;
    }

    .report-bar-scroll.is-scrollable {
        scroll-snap-type: x proximity;
    }

    .report-bar-scroll.is-scrollable .report-bar-column {
        scroll-snap-align: end;
    }

    .report-donut-layout {
        padding-inline: 16px;
    }

    .report-donut {
        width: 148px;
        height: 148px;
    }

    .report-donut::after {
        inset: 20px;
    }

    .report-insight-card {
        gap: 13px;
        padding: 16px;
    }

    .report-insight-icon {
        flex-basis: 38px;
        width: 38px;
        height: 38px;
    }

    .report-city-table-scroll {
        max-width: calc(100% - 20px);
        margin-inline: 10px;
    }

    .report-pagination {
        padding-inline: 10px;
    }
}

@media (max-width: 380px) {
    .reports-hero-copy h2 {
        font-size: 18px;
    }

    .reports-hero-copy p {
        font-size: 12px;
    }

    .report-chart-view {
        height: 235px;
    }

    .report-rate-cell {
        grid-template-columns: minmax(90px, 1fr) 54px;
    }
}
