/* Мобильная версия (PWA). Цвета, шрифт и скругления — из темы (css/theme.css + переменные бренда). */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font); font-size: 16px; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased;
    padding-bottom: calc(64px + env(safe-area-inset-bottom));
}
button, input, select { font: inherit; }

.m-header {
    position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: var(--header-bg); color: var(--header-text);
    border-bottom: 1px solid var(--border);
}
.m-logo { height: 28px; width: auto; }
.m-title { flex: 1; font-weight: 600; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -0.01em; }
.m-user { max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 500; }

.m-install { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--color-primary-light); font-size: 14px; }
.m-install span { flex: 1; }
.m-link { background: none; border: 0; color: var(--color-primary); font-weight: 500; padding: 8px; min-height: 40px; cursor: pointer; }
.m-link.muted { color: var(--text-muted); }
.m-link.block { display: block; width: 100%; text-align: center; }

main { padding: 14px 16px; }
.m-view[hidden], [hidden] { display: none !important; }
h2 { font-size: 20px; font-weight: 600; margin: 4px 0 14px; letter-spacing: -0.01em; }

.m-filters { display: grid; gap: 8px; margin-bottom: 10px; }
.m-filters select, .m-filters input { width: 100%; min-height: 46px; padding: 8px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); }
.m-times { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.m-times label { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.m-times input { flex: 1; min-width: 0; }
.m-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.m-chips button { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); }
.m-chips button.active { border-color: var(--color-primary); background: var(--color-primary-light); color: var(--color-primary); font-weight: 500; }

.m-hint { color: var(--text-muted); font-size: 14px; padding: 6px 2px; }
.m-list { display: grid; gap: 8px; margin-bottom: 10px; }
.m-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.m-card .m-main { flex: 1; min-width: 0; }
.m-card .m-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-card .m-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.m-card.busy { opacity: 0.65; }
.m-card.mine { border-color: var(--desk-mine); }
.m-badge { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--success-light); color: var(--success); white-space: nowrap; font-weight: 500; }
.m-badge.busy { background: var(--danger-light); color: var(--danger); }

.m-btn { min-height: 46px; padding: 0 20px; border-radius: var(--radius-lg); font-weight: 500; background: var(--color-primary); color: #fff; border: 1px solid var(--color-primary); cursor: pointer; white-space: nowrap; }
.m-btn.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.m-btn.danger { background: var(--danger); border-color: var(--danger); }
.m-btn:disabled { opacity: 0.5; }
.m-btn.block { display: block; width: 100%; }

.m-tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(3, 1fr);
    background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom);
}
.m-tabs button, .m-tabs a { display: flex; align-items: center; justify-content: center; min-height: 56px; border: 0; background: none; color: var(--text-muted); text-decoration: none; font-size: 14px; font-weight: 500; }
.m-tabs .active { color: var(--color-primary); }

.m-sheet-overlay { position: fixed; inset: 0; z-index: 20; background: var(--overlay); display: flex; align-items: flex-end; }
.m-sheet { width: 100%; max-height: 90vh; overflow-y: auto; background: var(--surface); border-radius: 20px 20px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
.m-sheet h3 { margin: 0 0 4px; font-size: 19px; font-weight: 600; }
.m-sheet .m-sub { color: var(--text-2); margin: 0 0 14px; }
.m-sheet input[type="text"], .m-sheet input[type="password"], .m-sheet input[type="email"] { width: 100%; min-height: 46px; padding: 8px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); margin-bottom: 10px; background: var(--surface); color: var(--text); }
.m-sheet .m-row { display: grid; gap: 8px; margin-top: 8px; }
.m-sheet .m-tabs-inline { display: flex; gap: 6px; margin-bottom: 12px; }
.m-sheet .m-tabs-inline button { flex: 1; min-height: 40px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: var(--radius-lg); }
.m-sheet .m-tabs-inline button.active { border-color: var(--color-primary); color: var(--color-primary); font-weight: 500; }
.m-error { color: var(--danger); font-size: 14px; margin: 0 0 10px; }

.m-toast { pointer-events: none; position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30; max-width: 90%; background: rgba(17, 24, 39, 0.94); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; }

.m-checkin { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--warning-light); border-bottom: 1px solid var(--warning-border); font-size: 14px; }
.m-checkin span { flex: 1; }
.m-sub.warn { color: var(--warning); }
.m-sub.ok { color: var(--success); }

.m-evac { margin-left: auto; margin-right: 8px; padding: 6px 12px; border-radius: var(--radius, 8px); border: 1px solid #fca5a5; color: #b91c1c; text-decoration: none; font-weight: 600; font-size: 14px; background: var(--surface, #fff); }
