/* Staff phone presentation. Keep resident controls, source order and print intact. */
@media screen and (max-width: 760px) {
    html:root body.layout-app {
        --mobile-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
        --control-height: 44px;
        --page-gutter: 8px;
        font-family: var(--mobile-font);
        font-size: 16px;
        line-height: 1.45;
    }
    html:root body.layout-app :is(h1, h2, h3, h4, input, select, textarea, button, .btn, summary) {
        font-family: var(--mobile-font);
        letter-spacing: normal;
    }
    html:root body.layout-app :is(h1, h2),
    html:root body.layout-app .wo-pilot h2 {
        font-style: normal;
        text-transform: none;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }
    html:root body.layout-app h1 { font-size: 24px; }
    html:root body.layout-app h2,
    html:root body.layout-app .wo-pilot h2 { font-size: 21px; }
    html:root body.layout-app h3 { font-size: 18px; line-height: 1.3; }
    html:root body.layout-app :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea, .searchable-select__button, .status-multiselect > summary) {
        font-size: 16px;
        min-height: 44px;
    }
    /* Native WebKit selects need an explicit height as well as min-height. */
    html:root body.layout-app select:not([multiple]):not([size]) { height: 44px; }
    html:root body.layout-app :is(.btn, .actions > button, .actions > form > button, .report-filter-actions > button) {
        min-height: 44px;
        font-size: 15px;
        line-height: 1.3;
        word-break: normal;
        overflow-wrap: normal;
    }
    html:root body.layout-app :is(.actions, .report-filter-actions) {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }
    /* Short actions share a row; longer labels wrap as whole readable words. */
    html:root body.layout-app :is(.actions, .report-filter-actions) > :is(.btn, button, form),
    html:root body.layout-app .actions > form > :is(.btn, button) {
        width: auto;
        max-width: 100%;
        min-width: 0;
    }
    html:root body.layout-app .actions > .badge { width: auto; }
    html:root body.layout-app .card { padding: 12px; margin-bottom: 10px; }
    html:root body.layout-app .card > :is(h1, h2, h3) { margin-top: 0; margin-bottom: 10px; }
    html:root body.layout-app :is(.card > form:has(> .form-row), .report-filter-grid, .filters, .form-grid) {
        grid-template-columns: minmax(0, 1fr) !important;
        min-width: 0;
    }
    html:root body.layout-app input[type="file"] { min-width: 0; width: 100%; }
    html:root body.layout-app .form-row > label { font-size: 14px; line-height: 1.35; }
    html:root body.layout-app .collapsible-section > summary { font-size: 17px; line-height: 1.35; }
    html:root body.layout-app .table-scroll.table-scroll--mobile-cards table { font-size: 15px; }
    html:root body.layout-app .table-scroll.table-scroll--mobile-cards table tbody tr {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px 12px;
        padding: 10px;
    }
    html:root body.layout-app .table-scroll.table-scroll--mobile-cards table :is(td, th) { grid-column: 1 / -1; }
    html:root body.layout-app .table-scroll.table-scroll--mobile-cards table td:is([data-mobile-kind="date"], [data-mobile-kind="money"], [data-mobile-kind="short"]):not([data-mobile-wide="1"]) {
        grid-column: auto;
    }
    html:root body.layout-app .table-scroll.table-scroll--mobile-cards table td::before { font-size: 13px; font-weight: 600; }
    html:root[data-workspace-frame="1"] body.layout-app { padding: 8px; }
    html:root body.layout-app.workspace-shell { padding: 6px; }
    html:root body.layout-app .vision-workspace-brandbar {
        align-items: center;
        min-height: 52px;
        padding: 6px 8px;
        gap: 8px;
    }
    html:root body.layout-app .vision-brand-wordmark > strong {
        font: 600 18px/1.3 var(--mobile-font);
        display: block;
        max-height: none;
        overflow: visible;
        overflow-wrap: anywhere;
        letter-spacing: normal;
    }
    html:root body.layout-app .vision-workspace-brandbar .vision-brand-toggle { font-size: 13px; }
    html:root body.layout-app .vision-brand-wordmark > a { font-size: 12px; margin-bottom: 0; }
    html:root body.layout-app #finance-workspace .workspace-toolbar { padding-left: 0; padding-right: 0; }
    html:root body.layout-app #finance-workspace .workspace-tablist { gap: 4px; }
    html:root body.layout-app #finance-workspace .workspace-tab button { font-size: 14px; }
    html:root body.layout-app #finance-workspace .workspace-tab-close { width: 44px; min-width: 44px; }
    html:root body.layout-app #finance-workspace .workspace-refresh { min-width: 44px; min-height: 44px; }
    html:root body.layout-app > .workspace-menu-toggle { min-height: 44px; font-size: 15px; margin-bottom: 4px; }
    html:root body.layout-app > .app-navigation :is(.nav-main > a, summary) { font-size: 15px; min-height: 44px; }
}

/* Attendance: one selected day on phones; source table/export/print stay complete. */
@media screen and (max-width: 760px) {
    html:root body.layout-app [data-attendance-mobile-view] .attendance-day-nav:not([hidden]){display:grid;gap:8px;margin:14px 0;padding:12px;border:1px solid #d7dde8;border-radius:10px;background:#fff}
    html:root body.layout-app [data-attendance-mobile-search]{display:block;box-sizing:border-box;width:100%;min-width:0;min-height:44px;margin:0;padding:10px;border:1px solid #b8c4d4;border-radius:6px;background:#fff;color:#111827;font:inherit;font-size:16px;-webkit-appearance:none;appearance:none}
    html:root body.layout-app .attendance-day-navigation{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;gap:6px;align-items:center}
    html:root body.layout-app .attendance-day-navigation .btn{width:44px;min-width:44px;min-height:44px;padding:6px!important}
    html:root body.layout-app .attendance-day-navigation select{min-width:0;width:100%;min-height:44px;font-size:16px}
    html:root body.layout-app [data-attendance-mobile-view] .attendance-day-nav p{margin:0;font-size:13px;line-height:1.4}
    html:root body.layout-app [data-attendance-mobile-view] .attendance-scroll{overflow:visible;max-height:none;border:0;background:transparent}
    html:root body.layout-app .attendance-grid.attendance-mobile-ready{display:block!important;min-width:0!important;width:100%!important;max-width:100%!important;border:0!important}
    html:root body.layout-app .attendance-grid.attendance-mobile-ready colgroup,
    html:root body.layout-app .attendance-grid.attendance-mobile-ready thead{display:none!important}
    html:root body.layout-app .attendance-grid.attendance-mobile-ready caption{display:block;padding:8px 10px;font-size:16px;height:auto}
    html:root body.layout-app .attendance-grid.attendance-mobile-ready .attendance-section-label{position:static}
    html:root body.layout-app .attendance-grid.attendance-mobile-ready tbody{display:grid;gap:12px;width:100%}
    html:root body.layout-app .attendance-grid.attendance-mobile-ready tbody > tr{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));padding:12px;border:1px solid #d7dde8;border-radius:10px;background:#fff;min-width:0}
    html:root body.layout-app .attendance-grid.attendance-mobile-ready .employee-cell,
    html:root body.layout-app .attendance-grid.attendance-mobile-ready .position-cell{position:static;left:auto;width:auto!important;min-width:0!important;max-width:none;box-shadow:none;grid-column:1/-1;border:0;padding:0 0 8px;white-space:normal!important;overflow-wrap:anywhere;background:transparent}
    html:root body.layout-app .attendance-grid.attendance-mobile-ready .employee-cell a{font-size:16px;font-weight:700;line-height:1.35}
    html:root body.layout-app .attendance-grid.attendance-mobile-ready .attendance-bulk-open{min-height:44px;width:auto;white-space:normal;font-size:14px!important}
    html:root body.layout-app .attendance-grid.attendance-mobile-ready .position-cell{font-size:14px;line-height:1.4;color:#475569}
    html:root body.layout-app .attendance-grid.attendance-mobile-ready tbody > tr > td[data-attendance-date]{grid-column:1/-1;min-width:0;border:0;padding:0;margin:0 0 10px}
    html:root body.layout-app .attendance-grid.attendance-mobile-ready tr[data-attendance-employee-id] > td[data-attendance-date]::before{content:attr(data-attendance-mobile-date-label);display:block;margin:2px 0 6px;text-align:left;font-size:14px;font-weight:650;color:#334155}
    html:root body.layout-app .attendance-grid.attendance-mobile-ready .attendance-mobile-away,
    html:root body.layout-app .attendance-grid.attendance-mobile-ready tr.attendance-mobile-filtered{display:none!important}
    html:root body.layout-app .attendance-grid.attendance-mobile-ready .attendance-cell{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:10px;border:1px solid #d7dde8;border-radius:8px;min-width:0}
    html:root body.layout-app .attendance-grid.attendance-mobile-ready .attendance-cell-line{display:grid;align-content:start;gap:5px;min-width:0}
    html:root body.layout-app .attendance-grid.attendance-mobile-ready .attendance-cell-line > span{width:auto;font-size:0;text-align:center}
    html:root body.layout-app .attendance-grid.attendance-mobile-ready .attendance-cell-line > span::before{content:'План, ч';font-size:14px;color:#334155}
    html:root body.layout-app .attendance-grid.attendance-mobile-ready .attendance-cell-line + .attendance-cell-line > span::before{content:'Факт, ч'}
    html:root body.layout-app .attendance-grid.attendance-mobile-ready .attendance-hours-button{width:100%;min-width:60px;min-height:44px;height:auto;font-size:18px;padding:8px}
    html:root body.layout-app .attendance-grid.attendance-mobile-ready .attendance-position-badges{max-width:none;gap:4px;margin-top:5px}
    html:root body.layout-app .attendance-grid.attendance-mobile-ready .attendance-role-badge{max-width:none;width:auto;font-size:12px;white-space:normal;overflow-wrap:anywhere}
    html:root body.layout-app .attendance-grid.attendance-mobile-ready .attendance-total-cell{display:block;width:auto;min-width:0;max-width:none;border:0;padding:6px 3px;text-align:center;background:#f8fafc;font-size:14px}
    html:root body.layout-app .attendance-grid.attendance-mobile-ready .attendance-total-cell::before{content:attr(data-attendance-mobile-label);display:block;font-size:12px;font-weight:400;white-space:normal}
    html:root body.layout-app .attendance-grid.attendance-mobile-ready .attendance-count-row{background:#0f2438;color:#fff}
    html:root body.layout-app .attendance-grid.attendance-mobile-ready .attendance-count-row .position-cell{color:#fff;font-size:13px}
    html:root body.layout-app .attendance-grid.attendance-mobile-ready .attendance-count-row > td:not(.employee-cell):not(.position-cell):not([data-attendance-date]){display:none!important}
    html:root body.layout-app .attendance-grid.attendance-mobile-ready .attendance-count-row td{background:transparent;color:#fff;white-space:normal!important;min-width:0;height:auto}
}
