/*
    The phone shape of the shared kit — everything that is decided by the width of the screen and that no component
    of ours wraps. Global rather than scoped for that reason: the edit dialogs are opened by IDialogService into
    MudBlazor's own container, and the page container is the layout's. The breakpoint is MudBlazor's md (960px), the
    same line MudHidden and CollapsibleButton draw, so a screen is either wide or a phone — never one thing in the
    markup and another in the stylesheet.

    Why a media query here and not MudHidden (claude/ui-design.md, "Отзивчивостта е идиом"): MudHidden decides what
    is RENDERED, and these rules change how something already rendered is LAID OUT. A dialog is not two dialogs.

    Телефонният облик на споделения „кит" — всичко, което се решава от широчината на екрана и което никой наш
    компонент не обвива. Глобален, а не scoped, по същата причина: диалозите се отварят от IDialogService в
    контейнера на MudBlazor, а контейнерът на страницата е на оформлението. „Точката на пречупване" е md на
    MudBlazor (960px) — същата черта, която теглят MudHidden и CollapsibleButton.
*/

/* The page's own padding lives here rather than in a utility class, so the phone can halve it without !important. */
.tsg-page {
    padding: 24px;
}

/* Two utilities for content INSIDE a row or a card template, where a MudHidden around each element would be one
   per row, hundreds of times — the case ui-design.md names for a media query. */
.tsg-phone-only {
    display: none !important;
}

@media (max-width: 959.98px) {
    .tsg-page {
        padding: 12px;
    }

    .tsg-phone-only {
        display: revert !important;
    }

    .tsg-wide-only {
        display: none !important;
    }

    /* Every dialog that asks for a medium width or more is a document on a phone: full screen, no margin, the
       content scrolling and the action bar pinned at the bottom — MudBlazor's own fullscreen rule, applied by
       width rather than by an option, because the option is set where each dialog is opened and there are
       thirty of those. A small dialog (a confirmation) keeps its size. */
    .mud-dialog.mud-dialog-width-md,
    .mud-dialog.mud-dialog-width-lg,
    .mud-dialog.mud-dialog-width-xl,
    .mud-dialog.mud-dialog-width-xxl {
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: none;
        margin: 0;
        border-radius: 0;
        overflow-y: hidden;
    }

    /* The action bar wraps instead of overflowing, and every button is a thumb target. */
    .mud-dialog .mud-dialog-actions {
        flex-wrap: wrap;
    }

    .mud-dialog .mud-dialog-actions > .mud-button-root {
        min-height: 44px;
    }
}
