/* Intentional compact layouts, kept separate from the desktop page composition. */
@media (max-width: 900px) {
    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        right: var(--gutter);
        left: var(--gutter);
        padding: .75rem;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--r-md);
        box-shadow: var(--shadow-lg);
        z-index: var(--z-dropdown);
    }
    .site-nav.is-open {
        display: grid;
        gap: .1rem;
    }
    .site-nav.is-open a { padding: .75rem; border-radius: var(--r-sm); }
    .site-nav.is-open a:hover { background: var(--surface-2); }
    .table-wrap { margin-inline: -0.25rem; }
    .wizard-steps { grid-template-columns: 1fr 1fr; }
    .pickup-pass { grid-template-columns: 1fr; }
    .quick-actions .btn { flex: 1; min-width: calc(50% - 0.75rem); }
    .chat-layout { grid-template-columns: 1fr; }
    .chat-layout > .card:first-child { max-height: 16rem; }
    .chat-shell { height: 60vh; height: 60dvh; }
    /* The detail pane's inner chat+summary split (admin/chat.php) only had its own
       collapse at <=560px; between that and 900px the outer .chat-layout has already
       gone to one column, so the detail pane takes the full (still-narrowed-by-sidebar)
       width and a 2-column split there gets cramped — collapse it at the same breakpoint. */
    .chat-layout .grid-2 { grid-template-columns: 1fr; }

    /* Admin mobile navigation — sidebar already hides at this breakpoint via the
       shared .dash-sidebar rule; these are the mobile-only surfaces that replace it. */
    .dash-header__menu-toggle { display: inline-flex; }
    .admin-bottom-nav { display: flex; }
    .admin-fab { display: inline-flex; }
    .dash-header__name { display: none; }
    .mobile-filters-toggle { display: inline-flex; }
}
@media (min-width: 901px) {
    .admin-drawer, .admin-quick-menu, .admin-fab, .admin-bottom-nav { display: none !important; }
}

@media (max-width: 560px) {
    .card__head { align-items: flex-start; flex-direction: column; }
    .segmented { max-width: 100%; overflow-x: auto; }
    .segmented__btn { flex: 0 0 auto; }
    .auth-form { padding: 1.25rem; }
    .auth-form .card { border: 0; padding: 0; background: transparent; }
    .grid-2, .grid-4 { grid-template-columns: 1fr; }

    /* Six languages means header real estate is tight on phones — the
       language switch keeps its flag + chevron (still fully functional,
       the full language names remain in the open dropdown) and drops the
       2-letter code, matching how .header-actions .btn--ghost already
       gets hidden here for the same reason. */
    .lang-switch__toggle { padding: 0.5em; }
    .lang-switch__code { display: none; }
    .dash-header__right { gap: 0.6rem; }

    /* Data tables become stacked cards on phones instead of horizontal-scroll
       grids — each <td> needs data-label="Column name" for the row label. */
    .table--cards { border: 0; }
    .table--cards .table { border-collapse: separate; border-spacing: 0 0.6rem; }
    .table--cards .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .table--cards .table tbody tr {
        display: block;
        border: 1px solid var(--line);
        border-radius: var(--r-md);
        background: var(--surface);
        padding: 0.25rem 0.9rem;
    }
    .table--cards .table tbody tr:hover { background: var(--surface); }
    .table--cards .table tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        text-align: right;
        padding: 0.6rem 0;
        border-bottom: 1px solid var(--line);
        white-space: normal;
    }
    .table--cards .table tbody td:last-child { border-bottom: 0; }
    .table--cards .table tbody td::before {
        content: attr(data-label);
        font-size: var(--fs-xs);
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--muted);
        text-align: left;
    }
    .table--cards .table tbody td[data-label=""]::before,
    .table--cards .table tbody td:not([data-label])::before { content: none; }
}

