/*
    Стили KidTime. Дизайн-система — из MyDeals (D:\_MyDeals\src\MyDeals.Web\wwwroot\css\styles.css):
    те же токены светлой/тёмной темы и базовые компоненты. Ниже секции «KidTime» — свои компоненты,
    нарисованные только через переменные, поэтому тема переключается одним атрибутом data-theme.
*/

/* ---------- Тема ---------- */

:root {
    color-scheme: light;

    --bg: #f4f6f9;
    --bg-glow: radial-gradient(1200px 600px at 15% -10%, #e5e9ff 0%, transparent 60%),
               radial-gradient(900px 500px at 90% 0%, #e6f7f4 0%, transparent 55%);
    --surface: #ffffff;
    --surface-2: #f7f8fb;
    --surface-3: #eef1f6;
    --border: #e3e7ee;
    --border-strong: #d3d9e4;
    --text: #131722;
    --text-dim: #667085;
    --text-faint: #98a2b3;
    --accent: #5b5ef4;
    --accent-soft: #ecedff;
    --accent-text: #ffffff;
    --ok: #12a678;
    --ok-soft: #e3f7f0;
    --warn: #e0850c;
    --warn-soft: #fdf1de;
    --danger: #e0435a;
    --danger-soft: #fdeaed;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .04);
    --shadow-md: 0 4px 16px rgba(16, 24, 40, .08);
    --shadow-lg: 0 24px 60px rgba(16, 24, 40, .18);

    --radius: 14px;
    --radius-sm: 10px;
    --header-h: 60px;
}

html[data-theme="dark"] {
    color-scheme: dark;

    --bg: #0d0f14;
    --bg-glow: radial-gradient(1200px 600px at 15% -10%, #1a1c3a 0%, transparent 60%),
               radial-gradient(900px 500px at 90% 0%, #102b2b 0%, transparent 55%);
    --surface: #161920;
    --surface-2: #1c2029;
    --surface-3: #232833;
    --border: #262b36;
    --border-strong: #333a48;
    --text: #e8ebf2;
    --text-dim: #99a2b3;
    --text-faint: #6c7688;
    --accent: #7b7ffb;
    --accent-soft: #21234a;
    --accent-text: #0d0f14;
    --ok: #2ed3a3;
    --ok-soft: #10302a;
    --warn: #f0a93a;
    --warn-soft: #33260f;
    --danger: #ff6178;
    --danger-soft: #351720;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, .35);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
}

/* ---------- База ---------- */

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    background: var(--bg);
    background-image: var(--bg-glow);
    background-attachment: fixed;
    color: var(--text);
    font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior-y: none;
}

button, input, select, textarea { font: inherit; color: inherit; }

/* Наши кнопки — flex, поэтому обычный [hidden] их не прячет. */
[hidden] { display: none !important; }

button { cursor: pointer; border: none; background: none; }

h1, h2, h3, p { margin: 0; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Шапка ---------- */

.header {
    position: sticky;
    top: 0;
    z-index: 20;
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 650;
    letter-spacing: -.01em;
    font-size: 16px;
}

.header__spacer { margin-right: auto; }

/* ---------- Переключатель (в MyDeals — досок, здесь — компьютеров) ---------- */

.board-switch {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 34px;
    padding: 0 10px 0 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -.01em;
    max-width: 260px;
    transition: background .15s, border-color .15s;
}

.board-switch:hover { background: var(--surface-3); border-color: var(--border-strong); }
.board-switch span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-switch svg { flex: none; color: var(--text-faint); }

.menu {
    position: fixed;
    z-index: 60;
    width: 280px;
    padding: 6px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    animation: pop .12s ease-out;
    max-height: min(70vh, 460px);
    overflow-y: auto;
}

.menu__title {
    padding: 6px 10px 4px;
    font-size: 11.5px;
    font-weight: 650;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.menu__item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 9px 10px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    text-align: left;
    transition: background .12s, color .12s;
}

.menu__item:hover { background: var(--surface-3); }
.menu__item.is-current { font-weight: 650; }

.menu__check { width: 14px; flex: none; color: var(--accent); font-weight: 700; }
.menu__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.menu__count {
    flex: none;
    min-width: 22px;
    padding: 1px 7px;
    border-radius: 99px;
    background: var(--warn-soft);
    color: var(--warn);
    font-size: 11.5px;
    font-weight: 650;
    text-align: center;
}

.menu__sep { height: 1px; margin: 6px 4px; background: var(--border); }

.brand__mark {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--ok)));
    color: #fff;
    flex: none;
}

.icon-btn {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    border: 1px solid transparent;
    transition: background .15s, color .15s, border-color .15s;
}

.icon-btn:hover { background: var(--surface-3); color: var(--text); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 16px;
    border-radius: var(--radius-sm);
    font-weight: 550;
    font-size: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    white-space: nowrap;
    transition: transform .1s, background .15s, border-color .15s, opacity .15s;
}

.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }

.btn--primary {
    background: var(--accent);
    border-color: transparent;
    color: #fff;
}

.btn--primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }

.btn--ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-dim); }
.btn--ghost:hover { background: var(--surface-3); color: var(--text); }

.btn--danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: transparent; box-shadow: none; }
.btn--danger:hover { background: var(--danger-soft); }

.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Сегментированный переключатель (как вкладки колонок в MyDeals) ---------- */

.tabs__inner {
    display: flex;
    width: 100%;
    gap: 3px;
    padding: 4px;
    border-radius: 12px;
    background: var(--surface-3);
    border: 1px solid var(--border);
}

.tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 34px;
    padding: 0 10px;
    border-radius: 9px;
    font-size: 13.5px;
    font-weight: 550;
    color: var(--text-dim);
    white-space: nowrap;
    transition: background .15s, color .15s;
}

.tab[aria-selected="true"] {
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.tab__count {
    min-width: 20px;
    height: 18px;
    padding: 0 5px;
    border-radius: 99px;
    background: var(--surface-2);
    color: var(--text-faint);
    font-size: 11.5px;
    font-weight: 600;
    display: grid;
    place-items: center;
}

.tab[aria-selected="true"] .tab__count { background: var(--accent-soft); color: var(--accent); }

/* ---------- Чипы ---------- */

.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 22px;
    padding: 0 8px;
    border-radius: 7px;
    background: var(--surface-3);
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 550;
    white-space: nowrap;
}

@keyframes pulse { 50% { opacity: .35; } }

/* ---------- Модалки ---------- */

dialog {
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text);
    max-width: min(560px, calc(100vw - 24px));
    width: 100%;
}

dialog::backdrop { background: rgba(9, 11, 16, .55); backdrop-filter: blur(3px); }

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: pop .16s ease-out;
}

@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }

.modal__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px 6px;
}

.modal__title { font-size: 17px; font-weight: 650; letter-spacing: -.015em; margin-right: auto; }

.modal__body { padding: 12px 20px 4px; max-height: min(70vh, 620px); overflow-y: auto; }

.modal__foot {
    display: flex;
    gap: 8px;
    padding: 16px 20px 18px;
    align-items: center;
}

.modal__foot .spacer { margin-left: auto; }

.task-meta {
    font-size: 12px;
    color: var(--text-faint);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 11px;
    margin-bottom: 16px;
    line-height: 1.5;
    word-break: break-word;
}

.field { margin-bottom: 18px; }

.field__label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 6px;
    letter-spacing: .01em;
}

.field__hint { font-size: 12px; color: var(--text-faint); margin-top: 6px; line-height: 1.4; }

.input, .textarea, .select {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    outline: none;
    transition: border-color .15s, box-shadow .15s, background .15s;
}

.input:focus, .textarea:focus, .select:focus {
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

/* Сегменты */

.segments { display: flex; gap: 6px; }

.segment {
    flex: 1;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 550;
    display: grid;
    place-items: center;
    transition: all .15s;
}

.segment:hover { border-color: var(--border-strong); }

.segment[aria-pressed="true"] {
    background: color-mix(in srgb, var(--seg-color) 14%, var(--surface));
    border-color: var(--seg-color);
    color: var(--seg-color);
    font-weight: 650;
}

.hours-presets { display: flex; gap: 6px; flex-wrap: wrap; }

.preset {
    height: 30px;
    padding: 0 11px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-dim);
    font-size: 12.5px;
    font-weight: 550;
    transition: all .15s;
}

.preset:hover { border-color: var(--border-strong); color: var(--text); }
.preset[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* Режимы */

.mode-option {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    cursor: pointer;
    margin-bottom: 8px;
    transition: all .15s;
}

.mode-option:hover { border-color: var(--border-strong); }

.mode-option.is-active {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.mode-option input { margin-top: 3px; accent-color: var(--accent); }

.mode-option__name { font-weight: 600; font-size: 13.5px; }
.mode-option__note { font-size: 12px; color: var(--text-faint); margin-top: 3px; }

.number-row { display: flex; align-items: center; gap: 10px; }
.number-row .input { width: 92px; text-align: center; font-variant-numeric: tabular-nums; }

.link-btn {
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent);
    font: inherit;
    cursor: pointer;
    text-decoration: none;
}

.link-btn:hover { text-decoration: underline; }

/* Сводка */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.stat {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.stat__value { font-size: 20px; font-weight: 680; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat__label { font-size: 12px; color: var(--text-faint); margin-top: 2px; }

/* ---------- Вход ---------- */

.login { max-width: min(420px, calc(100vw - 24px)); }
.login .modal__head { gap: 12px; padding-top: 22px; }
.login::backdrop { background: rgba(9, 11, 16, .72); backdrop-filter: blur(6px); }

.input--code {
    font-size: 22px;
    letter-spacing: .4em;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* ---------- Тосты ---------- */

.toasts {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    pointer-events: none;
    width: min(440px, calc(100vw - 24px));
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 15px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    font-size: 13.5px;
    font-weight: 500;
    animation: toast-in .2s ease-out;
    max-width: 100%;
}

.toast--warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.toast--error { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.toast--ok { border-color: color-mix(in srgb, var(--ok) 45%, transparent); }

@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }

/* =====================================================================
   KidTime — свои компоненты на тех же токенах
   ===================================================================== */

.page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 20px 110px;
}

/* Точка «на связи» у компьютера */

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 99px;
    flex: none;
    background: var(--text-faint);
}

.status-dot.is-online {
    background: var(--ok);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent);
}

/* Пустое состояние */

.empty {
    max-width: 520px;
    margin: 8vh auto 0;
    padding: 34px 28px;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-md);
}

.empty__icon {
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    border-radius: 16px;
    background: var(--accent-soft);
    color: var(--accent);
}

.empty__title { font-size: 20px; font-weight: 680; letter-spacing: -.02em; margin-bottom: 10px; }
.empty__text { color: var(--text-dim); margin-bottom: 22px; }

/* Сводка по компьютеру */

.stat-grid--summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stat { position: relative; }
.stat .stat__label { margin: 0 0 4px; }
.stat__note { font-size: 12px; color: var(--text-faint); margin-top: 4px; }
.stat__value--small { font-size: 15.5px; line-height: 1.35; }
.stat__value--status { display: flex; align-items: center; gap: 8px; font-size: 16px; }

.stat--clickable { cursor: pointer; transition: border-color .15s, background .15s; }
.stat--clickable:hover { border-color: var(--border-strong); }
.stat--clickable.has-new { border-color: color-mix(in srgb, var(--warn) 55%, transparent); background: color-mix(in srgb, var(--warn) 7%, var(--surface-2)); }
.stat--clickable.has-new .stat__value { color: var(--warn); }

/* Полоска расхода времени */

.meter {
    height: 6px;
    border-radius: 99px;
    background: var(--surface-3);
    overflow: hidden;
    margin-top: 8px;
}

.meter__fill {
    height: 100%;
    width: 0;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--ok)));
    transition: width .3s;
}

.meter.is-warn .meter__fill { background: var(--warn); }
.meter.is-over .meter__fill { background: var(--danger); }

/* Панель над списком */

.toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
}

.filters { width: auto; flex: 1; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }

.input--search { width: 230px; flex: none; height: 44px; }

/* Список приложений */

.app-list { display: flex; flex-direction: column; gap: 8px; }

.app-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, background .15s;
}

.app-row:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }

.app-row.is-selected {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}

.app-row.is-blocked .app-row__name { color: var(--text-dim); text-decoration: line-through; text-decoration-color: var(--border-strong); }

.app-row__check {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

.app-row__main { min-width: 0; }

.app-row__title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.app-row__name {
    font-weight: 600;
    font-size: 14.5px;
    letter-spacing: -.005em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.app-row__exe { font-size: 12px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.app-row__usage { width: 190px; text-align: right; }
.app-row__time { font-weight: 650; font-size: 14px; font-variant-numeric: tabular-nums; }
.app-row__limit { font-size: 12px; color: var(--text-faint); }
.app-row__usage .meter { margin-top: 6px; }

.chip--game { background: var(--accent-soft); color: var(--accent); }
.chip--other { background: var(--ok-soft); color: var(--ok); }
.chip--new { background: var(--warn-soft); color: var(--warn); }
.chip--blocked { background: var(--danger-soft); color: var(--danger); }

.chip--new::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 99px;
    background: currentColor;
    animation: pulse 2s ease-in-out infinite;
}

.list-empty {
    padding: 28px 16px;
    text-align: center;
    color: var(--text-faint);
    font-size: 13.5px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
}

.list-hint { margin-top: 12px; font-size: 12.5px; color: var(--text-faint); text-align: center; }

/* Панель массовых действий */

.bulk-bar {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 10px 10px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    animation: toast-in .2s ease-out;
    max-width: calc(100vw - 24px);
}

.bulk-bar__count { font-weight: 650; font-size: 14px; margin-right: 6px; white-space: nowrap; }

/* Подсказка-предупреждение */

.notice {
    padding: 12px 14px;
    margin-bottom: 16px;
    border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent);
    background: var(--warn-soft);
    border-radius: var(--radius-sm);
}

.notice__title { font-weight: 650; font-size: 13.5px; margin-bottom: 4px; }
.notice__text { font-size: 13px; color: var(--text-dim); margin-bottom: 10px; }

/* Подключение компьютера */

.steps { margin: 0 0 14px; padding-left: 20px; color: var(--text-dim); font-size: 14px; }
.steps li { margin-bottom: 8px; }
.steps b { color: var(--text); }

.pair-code {
    margin: 6px 0 8px;
    padding: 18px 12px;
    text-align: center;
    font: 700 34px/1 ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    letter-spacing: .12em;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent);
    border-radius: var(--radius);
    user-select: all;
}

.pair-timer { text-align: center; font-size: 13px; color: var(--text-dim); margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.pair-timer.is-expired { color: var(--danger); }

.pair-done { text-align: center; padding: 10px 0 6px; }

.pair-done__icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    border-radius: 99px;
    background: var(--ok-soft);
    color: var(--ok);
}

.pair-done__title { font-size: 17px; font-weight: 650; margin-bottom: 6px; }

/* Окно приложения: галочки «что менять» видны только при массовом изменении */

.apply-check {
    display: none;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
}

.apply-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }

.is-bulk .apply-check { display: flex; }
.is-bulk [data-single-label] { display: none; }
/* Неотмеченный раздел только приглушён, но кликабелен: правка поля сама ставит галочку «изменить». */
.is-bulk .field.is-off > :not(.apply-check) { opacity: .5; transition: opacity .15s; }

.bulk-note { margin: -4px 0 16px; }

/* Переключатель */

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }

.switch__track {
    position: relative;
    width: 40px;
    height: 24px;
    border-radius: 99px;
    background: var(--surface-3);
    border: 1px solid var(--border-strong);
    transition: background .15s, border-color .15s;
    flex: none;
}

.switch__thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 99px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform .15s;
}

.switch input:checked + .switch__track { background: var(--danger); border-color: var(--danger); }
.switch input:checked + .switch__track .switch__thumb { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.switch__label { font-size: 14px; font-weight: 550; }

/* ---------- Адаптив ---------- */

@media (max-width: 880px) {
    .header { padding: 0 10px; gap: 6px; }
    .brand__name { display: none; }
    .board-switch { max-width: 44vw; }
    .menu { width: calc(100vw - 16px); }
    .btn--new span { display: none; }
    .btn--new { padding: 0; width: 38px; }

    .page { padding: 12px 12px 120px; }
    .stat-grid--summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

    .toolbar { flex-direction: column; align-items: stretch; }
    .input--search { width: 100%; }

    .app-row { grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; padding: 12px; }
    .app-row__usage { grid-column: 2; width: auto; text-align: left; }

    .bulk-bar { left: 12px; right: 12px; transform: none; bottom: 12px; flex-wrap: wrap; justify-content: flex-end; }
    .bulk-bar__count { flex-basis: 100%; }

    .modal { border-radius: 16px 16px 0 0; }
    dialog { max-width: 100vw; margin: auto auto 0; }
    .modal__body { max-height: 68vh; }
    .modal__foot { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
