/* ============================================================
   НЕумный дом — основной стиль (СКОМПИЛИРОВАН)
   Сгенерировано: 2026-10-13 21:22:06 (админка → 🎨 Assets)
   НЕ редактировать вручную! Правьте исходники в assets/css/
   ============================================================ */

/* ============================================================
 * r01-variables.css — SSOT: все CSS-токены
 *                     (Phase 1 + Phase 3.d RGB-компаньоны)
 *
 * @version 3.0.0 (2026-10-13, ADR-0061 — color-mix elimination):
 *   • 🟢 +12 RGB-компаньонов `--*-rgb` для rgba()-композиции
 *     (см. ADR-0061 §3.1): --primary-rgb, --success-rgb,
 *     --warning-rgb, --danger-rgb, --info-rgb, --card-bg-rgb,
 *     --card-bg-hover-rgb, --border-rgb, --text-rgb, --muted-rgb,
 *     --header-bg-rgb, --input-bg-rgb.
 *   • 🟢 6 структурных RGB-токенов (--card-bg-rgb, --card-bg-hover-rgb,
 *     --border-rgb, --text-rgb, --muted-rgb, --header-bg-rgb,
 *     --input-bg-rgb) переопределены в [data-theme="dark"].
 *   • 🟢 5 акцентных RGB-токенов (--primary/success/warning/danger/info-rgb)
 *     НЕ переопределяются: те же значения в обеих темах.
 *   • ⚠️ Правило синхронизации hex ↔ rgb — pre-commit hook
 *     (см. ADR-0061 §5.5).
 *   • ✅ Phase 1 (--header-h, #ffffff → #fff) сохранён.
 *
 * @version 2.0.0 (2026-10-13, CodingStyleCSS Phase 1 hygiene):
 *   • 🟢 `#ffffff` → `#fff`.
 *   • 🟢 +`--header-h: 60px` (переехал из r04-header).
 *
 * @version 1.0.0 (T-0): базовый набор.
 *
 * Потребители: все файлы assets/css/**/*.css.
 * Единственный источник: --primary, --success, --danger,
 *   --warning, --info, --bg, --card-bg, --border, --text,
 *   --muted, --header-bg, --input-bg, --shadow(-lg),
 *   --chat-*, --push-*, --font-main, --geek-mono,
 *   --radius*, --header-h, --*-rgb (ADR-0061).
 * ============================================================ */

:root {
    /* Основные цвета */
    --primary: #2f6fed;
    --primary-hover: #1e5ad6;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #0ea5e9;

    /* Структурные цвета (светлая тема) */
    --bg: #f0f2f5;
    --card-bg: #fff;
    --card-bg-hover: #f6f8fa;
    --border: #d0d7de;
    --text: #1e2a3a;
    --muted: #656d76;
    --header-bg: #fff;
    --input-bg: #fff;
    --shadow: rgba(0, 0, 0, 0.08);
    --shadow-lg: rgba(0, 0, 0, 0.15);

    /* Цвета чата (СВЕТЛАЯ тема) */
    --chat-bg: #fff;
    --chat-header-bg: #f6f8fa;
    --chat-border: #d0d7de;
    --chat-text: #1e2a3a;
    --chat-muted: #656d76;
    --chat-mine-bg: #e7f6ec;
    --chat-mine-border: #22c55e;
    --chat-mine-text: #15803d;
    --chat-other-bg: #eef4ff;
    --chat-other-border: #2f6fed;
    --chat-other-text: #1d4ed8;
    --chat-accent: #b45309;
    --chat-overlay: rgba(30, 42, 58, 0.05);
    --chat-overlay-hover: rgba(30, 42, 58, 0.1);

    /* Кнопка пуш-уведомлений (СВЕТЛАЯ тема) */
    --push-on-color: #1e5ad6;
    --push-on-bg: rgba(47, 111, 237, 0.12);
    --push-on-bg-hover: rgba(47, 111, 237, 0.2);
    --push-off-color: #656d76;

    /* Шрифты */
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --geek-mono: "JetBrains Mono", "Fira Code", "Courier New", monospace;

    /* Радиусы */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-full: 999px;

    /* Высота шапки (Phase 1: переехала из r04-header) */
    --header-h: 60px;

    /* 🆕 v3.0.0 (ADR-0061): RGB-компаньоны для rgba()-композиции.
       Правило синхронизации: hex ↔ rgb.
       Акцентные цвета — едины в обеих темах. */
    --primary-rgb: 47, 111, 237;
    --success-rgb: 34, 197, 94;
    --warning-rgb: 245, 158, 11;
    --danger-rgb: 239, 68, 68;
    --info-rgb: 14, 165, 233;

    /* 🆕 v3.0.0: структурные RGB — светлая тема. */
    --card-bg-rgb: 255, 255, 255;
    --card-bg-hover-rgb: 246, 248, 250;
    --border-rgb: 208, 215, 222;
    --text-rgb: 30, 42, 58;
    --muted-rgb: 101, 109, 118;
    --header-bg-rgb: 255, 255, 255;
    --input-bg-rgb: 255, 255, 255;
}

/* Тёмная тема */
[data-theme="dark"] {
    /* Структурные цвета */
    --bg: #0d1117;
    --card-bg: #1a1f2e;
    --card-bg-hover: #222839;
    --border: #2d3548;
    --text: #e6edf3;
    --muted: #8b949e;
    --header-bg: #161b22;
    --input-bg: #161b22;
    --shadow: rgba(0, 0, 0, 0.4);
    --shadow-lg: rgba(0, 0, 0, 0.6);

    /* Терминальные цвета чата (ТЁМНАЯ тема) */
    --chat-bg: #0a0e1a;
    --chat-header-bg: #141a2e;
    --chat-border: #1e2a4a;
    --chat-text: #e6edf3;
    --chat-muted: #8b949e;
    --chat-mine-bg: #1a3a2e;
    --chat-mine-border: #2ea95f;
    --chat-mine-text: #7ee2a8;
    --chat-other-bg: #141a2e;
    --chat-other-border: #2f6fed;
    --chat-other-text: #b8d4ff;
    --chat-accent: #ffd700;
    --chat-overlay: rgba(255, 255, 255, 0.05);
    --chat-overlay-hover: rgba(255, 255, 255, 0.1);

    /* Кнопка пуш-уведомлений (ТЁМНАЯ тема) */
    --push-on-color: #7ab0ff;
    --push-on-bg: rgba(47, 111, 237, 0.3);
    --push-on-bg-hover: rgba(47, 111, 237, 0.42);
    --push-off-color: #8b949e;

    /* 🆕 v3.0.0 (ADR-0061): структурные RGB-компаньоны (dark).
       Акцентные --*-rgb не переопределяются — едины в обеих темах. */
    --card-bg-rgb: 26, 31, 46;
    --card-bg-hover-rgb: 34, 40, 57;
    --border-rgb: 45, 53, 72;
    --text-rgb: 230, 237, 243;
    --muted-rgb: 139, 148, 158;
    --header-bg-rgb: 22, 27, 34;
    --input-bg-rgb: 22, 27, 34;
}

/* ============================================================
   2. СБРОС И БАЗОВЫЕ СТИЛИ
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background 0.3s ease, color 0.3s ease;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text);
    margin-bottom: 0.6em;
    line-height: 1.3;
}

h1 { font-size: 1.8rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.9rem; }

p {
    margin-bottom: 1em;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

code, pre {
    font-family: var(--geek-mono);
    background: var(--card-bg-hover);
    border-radius: var(--radius-sm);
}

code {
    padding: 2px 6px;
    font-size: 0.9em;
}

pre {
    padding: 12px;
    overflow-x: auto;
    border: 1px solid var(--border);
}

/* ============================================================
   3. КОНТЕЙНЕР И РАСКЛАДКА + 6. ФУТЕР
   ============================================================ */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

.site-main {
    flex: 1;
    padding: 24px 0;
}

/* ФУТЕР */
.site-footer {
    background: var(--header-bg);
    border-top: 1px solid var(--border);
    color: var(--muted);
    padding: 16px 0;
    font-size: 13px;
    margin-top: auto;
}

/* ============================================================
 * r04-header.css — Шапка сайта + навигация (compact-UX)
 *
 * @version 1.2.0 (2026-10-13, CodingStyleCSS Phase 1 hygiene):
 *   • 🟢 −`:root { --header-h: 60px }` — токен переехал в
 *     01-variables.css (единственный SSOT, см. §3.1).
 *   • 🟢 `z-index` — все магические числа заменены на токены:
 *     .site-header     100 → var(--z-header)
 *     .site-nav-backdrop 200 → var(--z-backdrop)
 *     .site-nav (mobile) 210 → var(--z-drawer)
 *     .user-menu__dropdown 300 → var(--z-dropdown)
 *     (SSOT шкалы — 07-mobile-shell.css, §3.1).
 *   • 🟢 `@media (max-width: 420px)` → `@media (max-width: 640px)`
 *     (CodingStyleCSS §6.2: удалены 420/480/600).
 *
 * @version 1.1.0 (2026-10-07, structural fix — user-menu base split):
 *   • 🔴 РЕФАКТОРИНГ: hover / [open] / transition для
 *     `.user-menu__toggle` вынесены из базы в селектор
 *     `.user-menu:not(.user-menu--sidebar)`. Причина:
 *     `.user-menu--sidebar` наследовал hover-фон + border-color +
 *     transition из базы → в collapsed sidebar это давало
 *     «затухающую белую рамку» при expansion.
 *   • 🟢 База `.user-menu__toggle`: только layout + border без
 *     transition. Hover/[open]/transition — только header-контекст.
 *
 * @version 1.0.5 (2026-10-06, ADR-0044 + compact-UX).
 * @version 1.0.4 / 1.0.3 / 1.0.2 / 1.0.1 / 1.0.0 (см. git history).
 *
 * Зависимости: 01-variables.css (--header-h, --z-*),
 *   16-avatars.css (для .avatar--initial).
 * ============================================================ */

/* ─── Header shell ──────────────────────────────────────── */

.site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    height: var(--header-h);
    display: flex;
    align-items: stretch;
    padding-top: env(safe-area-inset-top, 0);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    height: 100%;
}

.header-inner {
    position: relative;
}

/* ─── Left: hamburger + logo ───────────────────────────── */

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
    text-decoration: none;
    line-height: 1;
    padding: 8px 4px;
    border-radius: 6px;
    transition: background .15s ease;
    white-space: nowrap;
}
.site-logo:hover { background: var(--card-bg-hover); text-decoration: none; }
.site-logo__glyph { font-size: 20px; line-height: 1; }
.site-logo__text { display: inline-block; }

/* ─── Hamburger (mobile only) ──────────────────────────── */

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
    -webkit-tap-highlight-color: transparent;
}
.menu-toggle:hover {
    background: var(--card-bg-hover);
    border-color: var(--primary);
}
.menu-toggle__bar {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
    transition: transform .2s ease, opacity .2s ease;
}
.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ─── Desktop nav (≥769px): компактный ряд ─────────────── */

.site-nav-desktop {
    display: none;
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
}

.site-nav-desktop__list {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav-desktop__item { display: flex; }

.site-nav-desktop__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    min-height: 40px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}
.site-nav-desktop__link:hover {
    background: var(--card-bg-hover);
    border-color: var(--border);
    text-decoration: none;
    color: var(--text);
}
.site-nav-desktop__link.is-active,
.site-nav-desktop__link[aria-current="page"] {
    background: rgba(47, 111, 237, .10);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}
.site-nav-desktop__icon { font-size: 18px; line-height: 1; flex-shrink: 0; }
.site-nav-desktop__label { line-height: 1; }

.site-nav-desktop__badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ─── Right: actions (theme + push + user menu / login) ── */

.header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.theme-toggle--icon-only,
.push-toggle--icon-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text);
    font-family: inherit;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}
.theme-toggle--icon-only:hover,
.push-toggle--icon-only:hover {
    background: var(--card-bg-hover);
    border-color: var(--border);
}
.theme-toggle--icon-only .theme-toggle__glyph,
.push-toggle--icon-only .push-toggle__glyph {
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.push-toggle--icon-only { position: relative; }
.push-toggle--icon-only.is-subscribed {
    background: rgba(34, 197, 94, .12);
    border-color: var(--success);
    color: var(--success);
}
.push-toggle--icon-only.is-subscribed::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
}

/* ─── User menu (native <details>) ─────────────────────── */

.user-menu {
    position: relative;
    display: inline-block;
}

.user-menu__toggle {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px 5px 5px;
    min-height: 40px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    white-space: nowrap;
}
.user-menu__toggle::-webkit-details-marker { display: none; }
.user-menu__toggle::marker { display: none; content: ''; }

.user-menu:not(.user-menu--sidebar) .user-menu__toggle {
    transition: background .15s ease, border-color .15s ease;
}
.user-menu:not(.user-menu--sidebar) .user-menu__toggle:hover {
    background: var(--card-bg-hover);
    border-color: var(--border);
}
.user-menu:not(.user-menu--sidebar)[open] > .user-menu__toggle {
    background: var(--card-bg-hover);
    border-color: var(--border);
}

.user-menu__avatar {
    width: 32px;
    height: 32px;
    font-size: 14px;
    flex-shrink: 0;
}

.user-menu__name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu__caret {
    font-size: 10px;
    color: var(--muted);
    transition: transform .15s ease;
    line-height: 1;
}
.user-menu[open] .user-menu__caret { transform: rotate(180deg); }

.user-menu__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    padding: 6px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 10px 32px var(--shadow-lg);
    z-index: var(--z-dropdown);
    animation: userMenuIn .16s ease-out;
}
@keyframes userMenuIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.user-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    min-height: 40px;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background .12s ease, color .12s ease;
    -webkit-tap-highlight-color: transparent;
}
.user-menu__item:hover {
    background: var(--card-bg-hover);
    color: var(--primary);
    text-decoration: none;
}
.user-menu__item--danger { color: var(--danger); }
.user-menu__item--danger:hover { background: rgba(239, 68, 68, .10); color: var(--danger); }
.user-menu__icon { font-size: 16px; line-height: 1; width: 20px; text-align: center; flex-shrink: 0; }
.user-menu__label { flex: 1; min-width: 0; }

.user-menu__divider {
    margin: 6px 4px;
    border: none;
    border-top: 1px solid var(--border);
}

.user-menu__form { display: block; margin: 0; }

/* ─── Legacy nav-icon (используется в mobile drawer) ──── */

.nav-icon {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    min-height: 40px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}
.nav-icon:hover {
    background: var(--card-bg-hover);
    border-color: var(--border);
    text-decoration: none;
    color: var(--text);
}
/* @deprecated 1.2.0 — compound-класс для state. Канон: .is-active.
   Оставлен как legacy-shim (templates drawer). */
.nav-icon.is-active,
.nav-icon.active {
    background: rgba(47, 111, 237, .10);
    border-color: var(--primary);
    color: var(--primary);
}
.nav-icon__glyph {
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.nav-icon__label {
    display: inline-block;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

button.nav-icon { font-family: inherit; }

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

.site-nav__divider,
.nav-divider {
    flex-shrink: 0;
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 4px;
    align-self: center;
}
.nav-form { display: inline-flex; margin: 0; }
.nav-form button { cursor: pointer; font-family: inherit; }
.nav-form button:hover { color: var(--primary); }

/* ─── Legacy .theme-toggle / .push-toggle (mobile drawer) ─ */

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    min-height: 40px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}
.theme-toggle:hover { background: var(--card-bg-hover); border-color: var(--primary); }
.theme-toggle__glyph {
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.theme-toggle__label { display: inline-block; line-height: 1; min-width: 0; }

.push-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    min-height: 40px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}
.push-toggle__glyph,
.push-toggle .push-icon {
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.push-toggle__label { display: inline-block; line-height: 1; min-width: 0; }
.push-toggle:hover { background: var(--card-bg-hover); border-color: var(--primary); }
.push-toggle:hover .push-icon,
.push-toggle:hover .push-toggle__glyph { filter: brightness(1.1); }
.push-toggle.is-loading { opacity: .7; pointer-events: none; }
.push-toggle.is-subscribed {
    background: rgba(34, 197, 94, .12);
    border-color: var(--success);
    color: var(--success);
}
.push-toggle.is-subscribed:hover {
    background: rgba(34, 197, 94, .22);
    border-color: var(--success);
    color: var(--success);
}
.push-toggle.is-subscribed::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
}
[data-theme="dark"] .push-toggle.is-subscribed::after { background: var(--success); }
.push-toggle.is-unsubscribed {
    background: transparent;
    border-color: var(--border);
    color: var(--muted);
}
.push-toggle.is-unsubscribed:hover { color: var(--text); }

/* ─── Site-nav / site-nav__* (mobile drawer) ──────────── */

.site-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
    justify-content: flex-end;
    min-width: 0;
}
.site-nav__header { display: none; }
.site-nav__list {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.site-nav__item { display: flex; }
.site-nav__actions { display: flex; align-items: center; gap: 6px; }
.site-nav__user {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 4px;
}
.site-nav__user-name {
    font-size: 13px;
    color: var(--muted);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: var(--z-backdrop);
    animation: navBackdropIn .18s ease-out;
}
.site-nav-backdrop[hidden] { display: none; }
@keyframes navBackdropIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ─── Mobile (≤768px) ─────────────────────────────────── */

@media (max-width: 768px) {
    .menu-toggle { display: inline-flex; }
    .site-logo__text { display: none; }
    .site-nav-desktop { display: none !important; }

    .push-toggle--icon-only { display: none; }
    .user-menu__name { display: none; }
    .user-menu__toggle { padding: 4px; min-height: 40px; }
    .user-menu__caret { display: none; }

    .site-nav {
        position: fixed;
        top: calc(var(--header-h) + env(safe-area-inset-top, 0));
        left: 0; right: 0; bottom: 0;
        max-height: calc(100dvh - var(--header-h) - env(safe-area-inset-top, 0));
        padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0));
        background: var(--header-bg);
        border-top: 1px solid var(--border);
        box-shadow: 0 8px 32px rgba(0, 0, 0, .18);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        z-index: var(--z-drawer);
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        justify-content: flex-start;
        transform: translateY(-8px);
        opacity: 0;
        pointer-events: none;
        visibility: hidden;
        transition: transform .2s ease, opacity .2s ease, visibility 0s .2s;
    }
    .site-nav.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
        visibility: visible;
        transition: transform .2s ease, opacity .2s ease, visibility 0s 0s;
    }

    .site-nav__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 4px 4px 12px;
        border-bottom: 1px solid var(--border);
        margin-bottom: 8px;
    }
    .site-nav__title { font-size: 16px; font-weight: 700; color: var(--text); }
    .site-nav__close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px; height: 36px;
        padding: 0;
        background: transparent;
        border: 1px solid var(--border);
        border-radius: 6px;
        color: var(--text);
        font-size: 22px;
        line-height: 1;
        font-family: inherit;
        cursor: pointer;
        transition: background .15s ease, border-color .15s ease;
        -webkit-tap-highlight-color: transparent;
    }
    .site-nav__close:hover {
        background: var(--card-bg-hover);
        border-color: var(--danger);
        color: var(--danger);
    }

    .site-nav__list {
        display: flex;
        flex-direction: column;
        gap: 4px;
        width: 100%;
    }
    .site-nav__item { width: 100%; }

    .nav-icon {
        display: flex;
        width: 100%;
        min-height: 48px;
        padding: 10px 12px;
        gap: 12px;
        font-size: 15px;
        justify-content: flex-start;
        text-align: left;
        border-radius: 8px;
    }
    .nav-icon__glyph { font-size: 22px; width: 28px; justify-content: flex-start; }
    .nav-icon__label { flex: 1; text-align: left; overflow: visible; text-overflow: clip; }
    .nav-badge { margin-left: auto; }

    .site-nav__divider,
    .nav-divider {
        width: 100%;
        height: 1px;
        margin: 8px 0;
        align-self: stretch;
    }

    .site-nav__actions { flex-direction: column; align-items: stretch; gap: 4px; width: 100%; }

    .theme-toggle,
    .push-toggle {
        display: flex;
        width: 100%;
        min-height: 48px;
        padding: 10px 12px;
        gap: 12px;
        justify-content: flex-start;
        text-align: left;
        border-radius: 8px;
        font-size: 15px;
    }
    .theme-toggle__glyph,
    .push-toggle__glyph { font-size: 22px; width: 28px; justify-content: flex-start; }
    .theme-toggle__label,
    .push-toggle__label { flex: 1; text-align: left; overflow: visible; text-overflow: clip; }

    .site-nav__user {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-top: auto;
        padding-top: 12px;
        border-top: 1px solid var(--border);
    }
    .site-nav__user-name { font-size: 14px; font-weight: 600; color: var(--text); max-width: none; }
}

/* ─── Desktop ≥769px ──────────────────────────────────── */

@media (min-width: 769px) {
    .menu-toggle { display: none; }
    .site-nav-desktop { display: flex; }
    .site-nav { display: none; }
    .site-nav-backdrop { display: none; }
}

/* ─── Small phones (≤640px) ────────────────────────────
   🆕 v1.2.0: было 420px → 640px (канон §6.2 CodingStyleCSS). */

@media (max-width: 640px) {
    .site-logo { font-size: 15px; padding: 8px 2px; }
    .site-nav { padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0)); }
    .nav-icon, .theme-toggle, .push-toggle { padding: 10px 10px; }
}

/* ─── Touch-devices: снять hover-эффекты ──────────────── */

@media (hover: none) and (pointer: coarse) {
    .nav-icon:hover, .theme-toggle:hover, .push-toggle:hover {
        background: transparent;
        border-color: var(--border);
    }
    .menu-toggle:hover { background: transparent; border-color: var(--border); }
    .site-nav__close:hover { background: transparent; border-color: var(--border); color: var(--text); }
    .site-nav-desktop__link:hover { background: transparent; border-color: transparent; }
    .user-menu__toggle:hover { background: transparent; border-color: transparent; }
}

/* ─── Reduced motion ─────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .user-menu__dropdown { animation: none; }
    .site-nav, .site-nav-backdrop { transition: none; }
}

/* ============================================================
 * END OF FILE r04-header.css v1.2.0
 * ============================================================ */

/* ============================================================
   23. СКРОЛЛБАР
   ============================================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--bg);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: var(--border);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

/* ============================================================
 * 06-mobile-pwa.css — PWA / mobile baseline
 * @version 1.0.2 (2026-10-06, P2 — mobile theme v2):
 *   • 🧹 Убрано: .nav-icon { width: 100%; text-align: left;
 *     justify-content: center } — это ломало desktop-навигацию
 *     и создавало «одинокие эмодзи» на mobile.
 *     Теперь ответственность полностью на 04-header.css.
 *   • 🧹 Убрано: .toast-container (SSOT = 15-modal-toast.css).
 *   • 🧹 Убрано: дубли .site-nav, .nav-icon media-queries —
 *     они конфликтовали с 04-header.css v1.0.2.
 *   • 🟢 Оставлено: safe-area, dvh, iOS-зум, tap-highlight,
 *     prefers-reduced-motion, PWA-install-btn.
 *
 * @version 1.0.1 (2026-10-05, v98: -дубль .toast-container)
 * @version 1.0.0
 * ============================================================ */

/* ─── Global mobile baseline ──────────────────────────── */

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    text-size-adjust: 100%;
}

body {
    min-height: 100dvh;
    overscroll-behavior-y: none;
}

/* iOS: input font-size < 16px → autozoom. Ставим 16px. */
@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="search"],
    input[type="tel"],
    input[type="url"],
    textarea,
    select,
    .form-input,
    .form-textarea,
    .form-select {
        font-size: 16px;
    }
}

/* ─── Tap-targets: >= 40x40 на touch ─────────────────── */

@media (hover: none) and (pointer: coarse) {
    button,
    .btn,
    .nav-icon,
    .theme-toggle,
    .push-toggle,
    .menu-toggle,
    .site-nav__close {
        min-height: 40px;
    }

    /* Отключаем hover-эффекты на touch */
    .btn:hover {
        transform: none;
    }
}

/* ─── Safe-area (notch) ──────────────────────────────── */

.site-footer {
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
}

.site-main {
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

/* ─── PWA install button ─────────────────────────────── */

.pwa-install-btn {
    position: fixed;
    right: calc(16px + env(safe-area-inset-right, 0));
    bottom: calc(16px + env(safe-area-inset-bottom, 0));
    z-index: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(47, 111, 237, .35);
    transition: transform .15s ease, box-shadow .15s ease;
    -webkit-tap-highlight-color: transparent;
}

.pwa-install-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(47, 111, 237, .42);
}

.pwa-install-btn[hidden] {
    display: none;
}

/* ─── prefers-reduced-motion ─────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .btn:hover,
    .pwa-install-btn:hover {
        transform: none;
    }
}

/* ─── Dark theme mobile scrollbar ─────────────────────── */

@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 4px;
        height: 4px;
    }

    ::-webkit-scrollbar-thumb {
        background: rgba(127, 127, 127, .35);
        border-radius: 2px;
    }
}

/* ============================================================
 * 07-mobile-shell.css — Mobile-first shell (drawer + bottom-nav)
 * @version 1.0.0 (2026-10-06, P2 — mobile theme v2):
 *   • Новый слой mobile-first UI. Заменяет «заплатки» из
 *     06-mobile-pwa.css (который был не SSOT, а доработкой).
 *   • Отвечает за:
 *       - z-index шкалу приложения (SSOT)
 *       - единый mobile drawer (каркас + анимации + safe-area)
 *       - опциональный bottom-nav для PWA (можно скрыть через body.no-bottom-nav)
 *       - поведение body при открытом drawer (scroll-lock)
 *   • Совместим с 04-header.css v1.0.2 (не переопределяет .site-nav,
 *     только добавляет каркас вокруг).
 *   • ADR-0042 (R7: <style> только в _head.php) — не нарушает,
 *     это отдельный CSS-файл.
 * ============================================================ */

/* ─── Z-index шкала (SSOT приложения) ─────────────────── */

:root {
    --z-base:            1;
    --z-sticky:          50;
    --z-header:          100;
    --z-backdrop:        200;
    --z-drawer:          210;
    --z-bottom-nav:      150;
    --z-dropdown:        300;
    --z-modal:           1000;
    --z-lightbox:        9999;
    --z-context-menu:    10001;
    --z-toast:           10002;

    /* Ширина drawer (для tablet) */
    --drawer-w:          min(360px, 88vw);
    --bottom-nav-h:      56px;
}

/* ─── Body scroll-lock при открытом drawer ───────────── */

body.is-nav-open {
    overflow: hidden;
    touch-action: none;
}

body.is-nav-open .site-nav-backdrop {
    display: block;
}

/* ─── Mobile drawer shell ─────────────────────────────── */

@media (max-width: 768px) {

    /* Drawer = .site-nav (см. 04-header.css). Здесь — только каркас. */
    .site-nav {
        /* На случай если 04-header.css не подключён раньше — fallback: */
        -webkit-user-select: none;
        user-select: none;
    }

    /* Плавный скролл внутри drawer на iOS */
    .site-nav__list {
        scrollbar-width: thin;
    }

    .site-nav__list::-webkit-scrollbar {
        width: 4px;
    }

    .site-nav__list::-webkit-scrollbar-thumb {
        background: rgba(127, 127, 127, .3);
        border-radius: 2px;
    }

    /* Фокус-стили для keyboard-навигации */
    .nav-icon:focus-visible,
    .theme-toggle:focus-visible,
    .push-toggle:focus-visible,
    .menu-toggle:focus-visible,
    .site-nav__close:focus-visible,
    .site-nav__user .btn:focus-visible {
        outline: 2px solid var(--primary);
        outline-offset: 2px;
    }

    /* Уменьшаем нагрузку на GPU при анимации */
    .site-nav {
        will-change: transform, opacity;
        backface-visibility: hidden;
    }
}

/* ─── Tablet: drawer как sidebar (опционально) ────────── */

@media (min-width: 769px) and (max-width: 1024px) {
    .site-nav {
        gap: 2px;
    }

    .nav-icon {
        padding: 8px 8px;
        font-size: 13px;
    }

    .nav-icon__label {
        /* На планшете подписи можно оставить — места хватает */
    }
}

/* ─── Bottom-nav (PWA, опционально) ──────────────────── */

.site-bottom-nav {
    display: none;               /* desktop — скрыт */
}

@media (max-width: 768px) {
    .site-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: var(--z-bottom-nav);
        display: flex;
        align-items: stretch;
        height: var(--bottom-nav-h);
        padding-bottom: env(safe-area-inset-bottom, 0);
        background: var(--header-bg);
        border-top: 1px solid var(--border);
        box-shadow: 0 -4px 16px rgba(0, 0, 0, .08);
    }

    .site-bottom-nav__item {
        flex: 1 1 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-width: 0;
        padding: 6px 4px;
        color: var(--muted);
        text-decoration: none;
        font-size: 11px;
        font-weight: 500;
        transition: color .15s ease, background .15s ease;
        -webkit-tap-highlight-color: transparent;
        position: relative;
    }

    .site-bottom-nav__item:active {
        background: var(--card-bg-hover);
    }

    .site-bottom-nav__item.is-active {
        color: var(--primary);
    }

    .site-bottom-nav__item.is-active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 20%;
        right: 20%;
        height: 2px;
        background: var(--primary);
        border-radius: 0 0 2px 2px;
    }

    .site-bottom-nav__glyph {
        font-size: 20px;
        line-height: 1;
    }

    .site-bottom-nav__label {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .site-bottom-nav__badge {
        position: absolute;
        top: 4px;
        right: 50%;
        transform: translateX(calc(50% + 12px));
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        border-radius: 999px;
        background: var(--danger);
        color: #fff;
        font-size: 10px;
        font-weight: 700;
        line-height: 16px;
        text-align: center;
    }
}

/* ─── Bottom-nav: placeholder для body ───────────────── */

@media (max-width: 768px) {
    /* Если на странице есть bottom-nav — нужно добавить отступ body,
       чтобы контент не обрезался футером.
       Включается классом body.has-bottom-nav. */
    body.has-bottom-nav .site-main {
        padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0) + 16px);
    }
}

/* ─── Utility: скрыть bottom-nav ─────────────────────── */

body.no-bottom-nav .site-bottom-nav {
    display: none !important;
}

/* ─── Utility: скрыть hamburger (например, на странице логина) ── */

body.no-nav-toggle .menu-toggle {
    display: none !important;
}

body.no-nav-toggle .site-nav {
    display: none !important;
}

/* ─── Fallback для браузеров без dvh ─────────────────── */

@supports not (height: 100dvh) {
    @media (max-width: 768px) {
        .site-nav {
            max-height: calc(100vh - var(--header-h) - env(safe-area-inset-top, 0));
        }

        body {
            min-height: 100vh;
        }
    }
}

/* ============================================================
 * r08-sidebar.css — Sidebar (universal, DeepSeek-style)
 *
 * @version 3.2.0 (2026-10-13, CodingStyleCSS Phase 1 hygiene):
 *   • 🟢 −`--sidebar-header-h: 60px` из `:root` — дублировал
 *     `--header-h` (SSOT в 01-variables.css, §3.1).
 *   • 🟢 `.sidebar__header { min-height: var(--sidebar-header-h) }`
 *     → `min-height: var(--header-h)`.
 *   • ✅ Визуально ничего не меняется — значение то же (60px).
 *
 * @version 3.1.1 (2026-10-11, drawer-state fix + SSOT cleanup):
 *   • 🔴 CRITICAL FIX: удалена `--sidebar-drawer-x: 0px` из `:root`.
 *     Причина: `transform: translateX(var(--sidebar-drawer-x, -100%))`
 *     ВСЕГДА получал `0px` → drawer был ВИДЕН на mobile без
 *     `body.is-sidebar-open`.
 *   • 🟢 `body:not(.has-sidebar) .sidebar-edge { display: none; }`.
 *   • 🟢 Удалены дублирующие `--z-backdrop: 200` и `--z-drawer: 210`
 *     из `:root` — SSOT в 07-mobile-shell.css.
 *   • 🟢 Объединены два раздельных правила `body.is-sidebar-open`.
 *
 * @version 3.1.0 (2026-10-11, mobile swipe fix):
 *   • 🆕 Edge-zone `.sidebar-edge` (touch-action: none).
 *   • 🆕 `--sidebar-drawer-x` — drag-переменная.
 *   • 🆕 `.sidebar.is-sidebar-dragging { transition: none; }`.
 *   • 🔴 FIX: `touch-action: none` → `pan-y`.
 *   • 🔴 FIX: `overscroll-behavior-x: contain;`.
 *   • 🔴 FIX: hamburger z-index 100 → var(--z-menu-toggle, 220).
 *
 * @version 3.0.9 (2026-10-07): footer divider removed.
 * @version 3.0.8–3.0.0: sidebar SSOT polish.
 * @version 2.0.x / 1.0.x.
 *
 * Зависимости: 01-variables.css (--header-h),
 *   07-mobile-shell.css (--z-*), 24-user-menu.css (модификатор).
 * ============================================================ */

:root {
    --sidebar-w:             280px;
    --sidebar-w-collapsed:   64px;
    /* 🟢 v3.2.0: --sidebar-header-h удалён — используем --header-h
       из 01-variables.css (SSOT). */
    --sidebar-nav-padding:   8px 0;
    --sidebar-link-gap:      12px;
    --sidebar-link-padding:  8px 12px;
    --sidebar-link-radius:   6px;
    --sidebar-transition:    200ms cubic-bezier(.2, .8, .2, 1);
    --sidebar-backdrop:      rgba(0, 0, 0, .45);
    --sidebar-edge-w:        20px;
    --z-menu-toggle:         220;
}

/* ═══════════════════════════════════════════════════════════
 * v3.1.0: Edge-zone для swipe-to-open
 * ═══════════════════════════════════════════════════════════ */

.sidebar-edge {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-edge-w);
    z-index: 5;
    background: transparent;
    pointer-events: auto;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}
@media (min-width: 769px) {
    .sidebar-edge { display: none; }
}
body:not(.has-sidebar) .sidebar-edge {
    display: none;
}
body.is-sidebar-open .sidebar-edge,
body.is-nav-open .sidebar-edge {
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════
 * BASE = MOBILE (≤768px) — off-canvas drawer
 * ═══════════════════════════════════════════════════════════ */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(var(--sidebar-w), 88vw);
    z-index: var(--z-drawer);
    background: var(--card-bg);
    border-right: 1px solid var(--border);
    box-shadow: 0 0 32px rgba(0, 0, 0, .18);

    display: flex;
    flex-direction: column;
    overflow: hidden;

    transform: translateX(var(--sidebar-drawer-x, -100%));
    transition: transform var(--sidebar-transition);
    will-change: transform;
    backface-visibility: hidden;

    touch-action: pan-y;
}

.sidebar.is-sidebar-dragging {
    transition: none;
}

body.is-sidebar-open {
    --sidebar-drawer-x: 0px;
    touch-action: pan-y;
    overscroll-behavior-x: contain;
    overflow: hidden;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--z-backdrop);
    background: var(--sidebar-backdrop);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--sidebar-transition);
}

body.is-sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
}

/* Floating hamburger (mobile) */
body.has-sidebar .menu-toggle {
    display: inline-flex;
    position: fixed;
    top: calc(12px + env(safe-area-inset-top, 0));
    left: 12px;
    z-index: var(--z-menu-toggle);
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--sidebar-link-radius);
    padding: 8px;
    cursor: pointer;
    transition: opacity .15s, border-color .15s;
}
body.has-sidebar .menu-toggle:hover { border-color: var(--primary); }
body.has-sidebar .menu-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
body.has-sidebar .menu-toggle__bar {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    margin: 3px 0;
}
body.is-sidebar-open .menu-toggle { opacity: 0; pointer-events: none; }

@media (max-width: 768px) {
    .sidebar__collapse { display: none; }
}

/* ═══════════════════════════════════════════════════════════
 * TABLET + DESKTOP (≥769px)
 * ═══════════════════════════════════════════════════════════ */

@media (min-width: 769px) {

    body.has-sidebar {
        display: grid;
        grid-template-columns: var(--sidebar-w) 1fr;
        transition: grid-template-columns var(--sidebar-transition);
    }
    body.has-sidebar.is-sidebar-collapsed {
        grid-template-columns: var(--sidebar-w-collapsed) 1fr;
    }

    .sidebar {
        position: sticky;
        top: 0;
        width: 100%;
        transform: none;
        box-shadow: none;
        transition: width var(--sidebar-transition);
        align-self: start;
        height: 100dvh;
        max-height: 100dvh;
        touch-action: auto;
    }

    .sidebar-backdrop { display: none; }
    body.has-sidebar .menu-toggle { display: none; }

    body.is-sidebar-open {
        --sidebar-drawer-x: initial;
        touch-action: auto;
        overscroll-behavior-x: auto;
        overflow: auto;
    }

    /* ─── COLLAPSED STATE ─────────────────────────────── */

    body.is-sidebar-collapsed .sidebar__label,
    body.is-sidebar-collapsed .sidebar__badge,
    body.is-sidebar-collapsed .sidebar__section-title,
    body.is-sidebar-collapsed .sidebar__user-name,
    body.is-sidebar-collapsed .sidebar__body,
    body.is-sidebar-collapsed .sidebar__meta {
        display: none;
    }

    body.is-sidebar-collapsed .sidebar__logo {
        display: none;
        visibility: hidden;
        width: 0;
        height: 0;
        overflow: hidden;
        padding: 0;
        margin: 0;
        flex: 0 0 0;
    }

    body.is-sidebar-collapsed .sidebar__header {
        padding-left: 10px;
        padding-right: 10px;
    }

    body.is-sidebar-collapsed .sidebar__collapse {
        right: auto;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    body.is-sidebar-collapsed .sidebar__footer {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 8px;
        padding: 10px 6px;
    }

    body.is-sidebar-collapsed .sidebar__section {
        padding: 4px 6px;
    }

    body.is-sidebar-collapsed .sidebar__link {
        justify-content: center;
        padding: 8px;
        gap: 0;
    }

    body.is-sidebar-collapsed .sidebar__icon,
    body.is-sidebar-collapsed .sidebar__avatar {
        font-size: 22px;
    }

    body.is-sidebar-collapsed .sidebar__user {
        flex: 0 0 auto;
        justify-content: center;
        padding: 2px;
        width: auto;
    }
    body.is-sidebar-collapsed .sidebar__actions {
        flex-direction: column;
        gap: 6px;
    }
    body.is-sidebar-collapsed .sidebar__logout-form {
        display: flex;
        width: 100%;
        justify-content: center;
    }
}

/* ═══════════════════════════════════════════════════════════
 * .site-wrap
 * ═══════════════════════════════════════════════════════════ */

body.has-sidebar .site-wrap {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100dvh;
}

@media (min-width: 769px) {
    body.has-sidebar .site-main > .container { max-width: 100%; }
}

@media (max-width: 768px) {
    body.has-sidebar .site-main,
    body.has-sidebar .site-main--messenger {
        padding-top: calc(64px + env(safe-area-inset-top, 0));
    }
}

.site-main--messenger {
    display: flex;
    flex-direction: column;
    padding: 24px;
    touch-action: pan-y;
}
@media (max-width: 768px) {
    .site-main--messenger { padding: 16px; }
}

/* ═══════════════════════════════════════════════════════════
 * SIDEBAR — структура
 * ═══════════════════════════════════════════════════════════ */

.sidebar__header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    /* 🟢 v3.2.0: --sidebar-header-h → --header-h (SSOT). */
    min-height: var(--header-h);
    padding: 14px 56px 14px 16px;
    padding-top: calc(14px + env(safe-area-inset-top, 0));
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar__logo {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
}
.sidebar__logo:hover { color: var(--primary); text-decoration: none; }
.sidebar__logo:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.sidebar__logo-glyph {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}
.sidebar__logo-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar__collapse {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: var(--sidebar-link-radius);
    cursor: pointer;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, color .15s;
}
.sidebar__collapse:hover {
    background: var(--card-bg-hover);
    color: var(--text);
}
.sidebar__collapse:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.sidebar__collapse-icon {
    display: block;
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.sidebar__nav {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: var(--sidebar-nav-padding);
}
.sidebar__nav::-webkit-scrollbar { width: 4px; }
.sidebar__nav::-webkit-scrollbar-thumb {
    background: rgba(127, 127, 127, .3);
    border-radius: 2px;
}

.sidebar__section { padding: 8px 8px 4px; }
.sidebar__section + .sidebar__section { margin-top: 4px; }

body.has-sidebar--messenger .sidebar__section + .sidebar__section {
    border-top: 1px solid var(--border);
    margin-top: 4px;
    padding-top: 8px;
}

.sidebar__section-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    color: var(--muted);
    text-transform: uppercase;
    padding: 4px 12px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: none;
}
body.has-sidebar--messenger .sidebar__section-title {
    font-size: 10px;
    letter-spacing: .6px;
    padding: 4px 12px 6px;
}

.sidebar__list { list-style: none; margin: 0; padding: 0; }
.sidebar__item { display: block; }

.sidebar__link {
    display: flex;
    align-items: center;
    gap: var(--sidebar-link-gap);
    min-height: 40px;
    padding: var(--sidebar-link-padding);
    border-radius: var(--sidebar-link-radius);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
    -webkit-tap-highlight-color: transparent;
}
.sidebar__link:hover {
    background: var(--card-bg-hover);
    text-decoration: none;
    color: var(--text);
}
.sidebar__link.is-active,
.sidebar__link[aria-current="page"] {
    background: rgba(47, 111, 237, .10);
    color: var(--primary);
    font-weight: 600;
}
.sidebar__link.is-active:hover { background: rgba(47, 111, 237, .15); }
.sidebar__link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.sidebar__icon {
    font-size: 18px;
    line-height: 1;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
}
.sidebar__label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar__badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar__link--dialog {
    gap: 10px;
    min-height: 52px;
    padding: 6px 10px;
}
.sidebar__avatar-wrap { flex-shrink: 0; display: inline-flex; }
.sidebar__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg-hover);
    border: 1px solid var(--border);
    flex-shrink: 0;
}
.sidebar__avatar--initial {
    font-weight: 700;
    font-size: 14px;
    color: var(--primary);
    text-transform: uppercase;
    user-select: none;
}
.sidebar__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sidebar__row {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}
.sidebar__name {
    font-weight: 600;
    font-size: 13px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1 1 auto;
    min-width: 0;
}
.sidebar__type {
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    padding: 2px 5px;
    border-radius: 5px;
    background: rgba(47, 111, 237, .15);
    color: var(--primary);
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.sidebar__preview {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    flex-shrink: 0;
    min-width: 40px;
}
.sidebar__time {
    font-size: 10px;
    color: var(--muted);
    line-height: 1;
    white-space: nowrap;
}

.sidebar__footer {
    flex-shrink: 0;
    padding: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0));
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar__user {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    border-radius: var(--sidebar-link-radius);
    text-decoration: none;
    color: var(--text);
    transition: background .15s ease;
    -webkit-tap-highlight-color: transparent;
}
.sidebar__user:hover {
    background: var(--card-bg-hover);
    color: var(--text);
    text-decoration: none;
}
.sidebar__user:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.sidebar__user-avatar {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}
.sidebar__user-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar__actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    align-items: center;
}
.sidebar__action {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
.sidebar__action--danger:hover {
    border-color: var(--danger);
    color: var(--danger);
}
.sidebar__logout-form { display: inline-flex; margin: 0; }

.sidebar__action.push-toggle.is-subscribed { position: relative; }
.sidebar__action.push-toggle.is-subscribed::after {
    content: '';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--success);
}

/* Touch targets */
@media (hover: none) and (pointer: coarse) {
    .sidebar__link { min-height: 44px; }
    .sidebar__action,
    .sidebar__collapse {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Dark theme */
[data-theme="dark"] .sidebar {
    box-shadow: 0 0 32px rgba(0, 0, 0, .45);
}
[data-theme="dark"] .sidebar-backdrop {
    background: rgba(0, 0, 0, .65);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .sidebar-backdrop,
    body.has-sidebar,
    body.has-sidebar .menu-toggle {
        transition: none;
    }
    .sidebar.is-sidebar-dragging { transition: none; }
}

/* iOS < 15.4 fallback */
@supports not (height: 100dvh) {
    @media (min-width: 769px) {
        .sidebar { height: 100vh; max-height: 100vh; }
    }
    body.has-sidebar .body-wrap { min-height: 100vh; }
}

/* ============================================================
 * END OF FILE r08-sidebar.css v3.2.0
 * ============================================================ */

/* ============================================================
 * r10-buttons.css — Кнопки (Phase 1 + Phase 2 consolidation)
 *
 * @version 1.3.0 (2026-10-13, CodingStyleCSS Phase 2):
 *   • 🟢 +`.btn--xs` — переехал из r44-logs.css (§13.2 п.16:
 *     `.btn-xs` не-BEM → BEM-канон `.btn--xs`). Теперь SSOT
 *     размера «xs» — здесь.
 *   • 🟢 +`.btn-xs` — `@deprecated 1.3.0 — remove after Phase 3`
 *     (legacy shim для совместимости, чтобы ничего не сломалось
 *     до финальной миграции logs-шаблонов).
 *   • ✅ Phase 1 правки сохранены.
 *
 * @version 1.2.0 (2026-10-13, CodingStyleCSS Phase 1 hygiene):
 *   • 🟢 Compound-shim'ы `.btn.primary/ghost/success/danger/warning/
 *     small/large` помечены `@deprecated` (CodingStyleCSS §4.4).
 *
 * @version 1.1.0 (2026-10-05, T-3 finalization).
 * @version 1.0.0: legacy.
 *
 * Зависимости: 01-variables.css.
 * ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius);
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    white-space: nowrap;
}

.btn:hover {
    background: var(--primary-hover);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.4);
}

/* ═══ BEM-размеры ═════════════════════════════════════════
   🆕 v1.3.0: .btn--small / .btn--large — канон;
              .btn--xs — добавлен (перенос из r44-logs). */

.btn--small { padding: 6px 12px; font-size: 13px; }
.btn--large { padding: 14px 24px; font-size: 16px; }

/* 🆕 v1.3.0: xs — переехал из r44-logs (§13.2 п.16). */
.btn--xs {
    font-size: 0.75rem;
    padding: 4px 8px;
}

/* ═══ Compound modifiers ═════════════════════════════════
   @deprecated 1.2.0 — remove after Phase 3
   (§4.4 case 1: legacy compat-shim).
   Канон: .btn--primary / .btn--ghost / .btn--success /
          .btn--danger / .btn--warning / .btn--small / .btn--large. */

.btn.primary {
    background: var(--primary);
}
.btn.primary:hover {
    background: var(--primary-hover);
}

.btn.ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn.ghost:hover {
    background: var(--card-bg-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.btn.success {
    background: var(--success);
}
.btn.success:hover {
    background: #16a34a;
}

.btn.danger {
    background: var(--danger);
}
.btn.danger:hover {
    background: #dc2626;
}

.btn.warning {
    background: var(--warning);
    color: #1e2a3a;
}
.btn.warning:hover {
    background: #d97706;
    color: #1e2a3a;
}

.btn.small {
    padding: 6px 12px;
    font-size: 13px;
}

.btn.large {
    padding: 14px 24px;
    font-size: 16px;
}

/* ═══ @deprecated size modifier: .btn-xs ═════════════════
   @deprecated 1.3.0 — remove after Phase 3
   (не-BEM, §12.1 п.16: канон `.btn--xs` выше).
   Оставлен как legacy shim для logs-шаблонов. */

.btn-xs {
    font-size: 0.75rem;
    padding: 4px 8px;
}

/* ═══ BEM-shim: .btn--primary/success/danger/warning/ghost ═══
   @deprecated 1.1.0 — remove after Phase 3. */

.btn--primary { background: var(--primary); }
.btn--primary:hover { background: var(--primary-hover); }

.btn--success { background: var(--success); }
.btn--success:hover { background: #16a34a; }

.btn--danger { background: var(--danger); }
.btn--danger:hover { background: #dc2626; }

.btn--warning { background: var(--warning); color: #1e2a3a; }
.btn--warning:hover { background: #d97706; color: #1e2a3a; }

.btn--ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn--ghost:hover {
    background: var(--card-bg-hover);
    border-color: var(--primary);
    color: var(--primary);
}

/* ═══ Reduced motion ═════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    .btn,
    .btn:hover,
    .btn:active {
        transition: background 0.15s ease;
        transform: none;
    }
}

/* ============================================================
 * END OF FILE r10-buttons.css v1.3.0
 * ============================================================ */

/* ============================================================
 * r11-cards.css — Cards + Empty states + Flash
 *                 (Phase 2 consolidation)
 *
 * @version 1.1.0 (2026-10-13, CodingStyleCSS Phase 2):
 *   • 🟢 `.empty-state*` — SSOT (§12.1 п.1). Дубль из
 *     51-admin.css §0 удалён (см. r51-admin v2.4.0).
 *   • 🟢 `.card-title` — `@deprecated 1.1.0 — remove after
 *     Phase 3` (§12.1 п.12, legacy shim для legacy Views).
 *   • 🟢 `.empty-state .icon` / `.empty-state h3` — `@deprecated`
 *     (тег-селектор; канон `.empty-state__icon`/`__title`).
 *   • ⚠️ `@media (max-width: 768px) { h1 { font-size: 1.5rem } }`
 *     оставлен — Phase 2 не затрагивает (Phase 3, reset-audit).
 *
 * @version 1.0.1 (2026-10-06, P2 — DoD-10 cleanup):
 *   • 🆕 +.flash-message.
 *   • 🆕 +.card__* и .empty-state__* BEM-элементы.
 *
 * @version 1.0.0 (T-0, ADR-0042): базовый набор.
 *
 * Зависимости: 01-variables.css.
 * ============================================================ */

/* ═══ CARDS ══════════════════════════════════════════════ */

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px var(--shadow);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 12px var(--shadow);
}

.card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.card__title-block {
    flex: 1;
    min-width: 0;
}

.card__title {
    font-size: 1.1rem;
    margin: 0 0 4px;
    color: var(--text);
    line-height: 1.3;
}

.card__subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.4;
}

.card__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.card__action-icon {
    margin-right: 4px;
}

/* @deprecated 1.1.0 — remove after Phase 3
   (не-BEM, §12.1 п.12: канон `.card__title` выше).
   Используется в legacy Views до T-6.x. */

.card-title {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--text);
}

/* ═══ FLASH MESSAGE ═══════════════════════════════════════ */

.flash-message {
    border-left: 4px solid var(--primary);
    margin-bottom: 16px;
    padding: 12px 16px;
}

/* ═══ EMPTY STATES — SSOT (§12.1 п.1) ═════════════════════ */

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
}

.empty-state__icon {
    font-size: 48px;
    margin-bottom: 12px;
    line-height: 1;
}

.empty-state__title {
    margin: 0 0 8px;
    color: var(--text);
}

.empty-state__message {
    margin: 0 0 8px;
    line-height: 1.5;
}

.empty-state__action {
    margin-top: 12px;
}

/* @deprecated 1.1.0 — remove after Phase 3
   (тег-селекторы; канон `.empty-state__icon`/`__title`).
   Используется в conversation.php, groups.php до T-6. */

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-state h3 {
    margin-bottom: 8px;
    color: var(--text);
}

/* ═══ АДАПТИВНОСТЬ ═══════════════════════════════════════ */

@media (max-width: 768px) {
    .card {
        padding: 16px;
    }

    .card__header {
        margin-bottom: 12px;
    }

    /* ⚠️ Scope-note (Phase 3 candidate):
       h1 — legacy из монолитного style.css. Логически принадлежит
       02-reset.css. Оставлен для совместимости каскада
       (01-core → 02-components). Перенос — отдельная задача
       reset-audit. */
    h1 { font-size: 1.5rem; }
}

/* ============================================================
 * END OF FILE r11-cards.css v1.1.0
 * ============================================================ */

/* ============================================================
 * 12-forms.css — Формы
 * @version 2.0.3 (2026-10-06, T-6.x — архитектурная чистка):
 *   - 🔴 FIX (module bleed): из @media ≤768px удалён селектор
 *     `.reply-form-actions .btn` — он относится к messages-модулю
 *     (класс `.reply-form-actions` определён в `20-messages.css`,
 *     где touch-target уже задан в v1.12.1). Дублирование нарушало
 *     принцип «один селектор — одна зона ответственности»
 *     (ADR-0042 §9.2). Оставлен только `.form-actions .btn` —
 *     это действительно зона ответственности форм.
 *   - 🟢 Changelog v2.0.2 скорректирован (без изменения поведения).
 *
 * @version 2.0.2 (2026-10-06, P2-fix — восстановлены селекторы):
 *   - 🔴 FIX: восстановлены `.form-actions .btn` и
 *     `.reply-form-actions .btn` (min-height: 44px в @media ≤768px) —
 *     были потеряны при P2 mobile theme v2 (06-mobile-pwa.css v1.0.2
 *     убрал блок «кнопки форм — во всю ширину пальцем»).
 *     Touch-target для пальцевого тапа (Apple HIG).
 *     Регрессия обнаружена diff-check (`2 removed: .form-actions .btn,
 *     .push-toggle.is-subscribed:hover`).
 * @version 2.0.1 (2026-10-04, T-3, R1-fix):
 *   - 🔴 FIX: восстановлен общий `input:focus` (потерян в v2.0.0
 *     при разбиении на `input[type="*"]:focus`).
 *     Теперь `:focus` работает и для checkbox/radio/file/color
 *     и любых будущих типов.
 *   - 🔴 FIX: восстановлен общий `input[disabled]` (то же самое).
 * @version 2.0.0 (2026-10-04, T-3, ADR-0042):
 *   - слито с .form-* из 25-ui-kit.css (удалён).
 *   - BEM: .form-group, .form-label, .form-label__required,
 *          .form-input, .form-textarea, .form-select,
 *          .form-hint, .form-error, .form-actions, .form-actions--end.
 *   - + base container .form / .form--inline.
 *   - Legacy selectors (input[type="text"], textarea, select) — сохранены.
 * @version 1.0.0: legacy.
 * ============================================================ */

/* ═══ Base container ═══════════════════════════════════════ */

.form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form--inline {
    flex-direction: row;
    align-items: flex-end;
    gap: 8px;
}

/* ═══ Form group ═══════════════════════════════════════════ */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 0 0 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.form-label__required {
    color: var(--danger);
    margin-left: 3px;
}

/* ═══ Inputs / textareas / selects ══════════════════════════
   Legacy (raw input[type]) + new (BEM .form-*)
   — общие свойства через единый селектор. */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
textarea,
select,
.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 9px 12px;
    font: inherit;
    font-size: 14px;
    color: var(--text);
    background: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-sizing: border-box;
    transition: border-color .15s ease, box-shadow .15s ease;
}

/* 🆕 v2.0.1: общий `input:focus` + `input[type="*"]:focus`
   Дублирование умышленно: общий — для чекбоксов/радио/файлов/цветов,
   конкретные — для «обычных» текстовых полей (одинаковые правила,
   каскад не ломается). */

input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus,
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.15);
}

/* 🆕 v2.0.1: общий `input[disabled]` (был потерян) */
input[disabled],
input:disabled,
input[type="text"][disabled],
input[type="email"][disabled],
input[type="password"][disabled],
input[type="number"][disabled],
input[type="search"][disabled],
input[type="tel"][disabled],
input[type="url"][disabled],
textarea[disabled],
textarea:disabled,
select[disabled],
select:disabled,
.form-input[disabled],
.form-textarea[disabled],
.form-select[disabled] {
    opacity: .55;
    cursor: not-allowed;
}

textarea,
.form-textarea {
    resize: vertical;
    min-height: 100px;
}

/* ═══ Select — SVG arrow ══════════════════════════════════ */

.form-select,
select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 34px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23888' d='M6 8L0 0h12z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px auto;
}

/* ═══ Validation states ═══════════════════════════════════ */

input.is-invalid,
textarea.is-invalid,
.form-input--error,
.form-textarea--error,
.form-select--error {
    border-color: var(--danger);
}

input.is-valid,
textarea.is-valid {
    border-color: var(--success);
}

/* ═══ Helpers ══════════════════════════════════════════════ */

.form-hint {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.form-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 3px;
}

/* ═══ Actions ══════════════════════════════════════════════ */

.form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.form-actions--end {
    justify-content: flex-end;
}

/* ═══ Mobile (iOS: не зумить при фокусе + touch-target) ═══
   🆕 v2.0.3: удалён `.reply-form-actions .btn` — это зона
   ответственности messages-модуля (см. `20-messages.css` v1.12.1,
   где touch-target для .reply-form-actions .btn уже определён
   рядом с базовым .reply-form-actions). Здесь оставлен только
   `.form-actions .btn` — собственный селектор форм.
   min-height: 44px — рекомендация Apple HIG для пальцевого тапа. */

@media (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="search"],
    input[type="tel"],
    input[type="url"],
    textarea,
    select,
    .form-input,
    .form-textarea,
    .form-select {
        font-size: 16px;
    }

    /* 🆕 v2.0.2: touch-target для кнопок формы.
       🆕 v2.0.3: только .form-actions .btn (module-scoped). */
    .form-actions .btn {
        min-height: 44px;
    }
}

/* ============================================================
 * r13-badges.css — Бейджи и статусы (Phase 1 hygiene)
 *
 * @version 3.0.0 (2026-10-13, CodingStyleCSS Phase 1):
 *   • 🟢 `.muted` ПЕРЕНЕСЁН в 17-utilities.css (SSOT утилит,
 *     см. CodingStyleCSS §12.2 п.27). Здесь — удалён.
 *   • 🟢 Compound-shim `.badge.primary/success/danger/warning`
 *     помечен `@deprecated 3.0.0 — remove after T-6` (R43,
 *     CodingStyleCSS §4.4 case 1). Поведение сохранено.
 *   • 🟢 `.online-dot.online` помечен `@deprecated` — state
 *     должен идти через `.is-*` (§4.3). Сохранён как legacy-shim.
 *
 * @version 2.1.1 (2026-10-06, P2 — DoD-10 cleanup):
 *   • 🆕 +.badge--small modifier — заменяет inline font-size:10px.
 *
 * @version 2.1.0 (2026-10-05, T-3 finalization):
 *   • 🆕 +.badge--owner / .badge--admin (роли).
 *
 * @version 2.0.0 (2026-10-04, T-3, ADR-0042):
 *   • BEM-modifiers + solid-варианты + .badge__icon.
 *   • Compat-shim для legacy .badge.{primary,success,danger,warning}.
 *
 * @version 1.0.0: legacy.
 *
 * Зависимости: 01-variables.css.
 * Потребители: templates/**/*.php (см. §30 TemplateService.md).
 * ============================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    vertical-align: middle;
    white-space: nowrap;
    background: var(--card-bg-hover);
    color: var(--muted);
}

.badge__icon {
    margin-right: 3px;
}

/* ═══ BEM modifiers (ghost background) ═══════════════════ */

.badge--success { background: rgba(34, 197, 94, .15);   color: var(--success); }
.badge--danger  { background: rgba(239, 68, 68, .15);   color: var(--danger); }
.badge--warning { background: rgba(245, 158, 11, .15);  color: var(--warning); }
.badge--info    { background: rgba(14, 165, 233, .15);  color: var(--info); }
.badge--primary { background: rgba(47, 111, 237, .15);  color: var(--primary); }
.badge--muted   { background: rgba(127, 127, 127, .12); color: var(--muted); }

/* ═══ Solid variants ══════════════════════════════════════ */

.badge--primary-solid { background: var(--primary); color: #fff; }
.badge--success-solid { background: var(--success); color: #fff; }
.badge--danger-solid  { background: var(--danger);  color: #fff; }
.badge--warning-solid { background: var(--warning); color: #fff; }

/* ═══ Roles: owner / admin ═══════════════════════════════
   Убирает inline-стили из conversation.php. */

.badge--owner {
    background: #ffd700;
    color: #000;
}

.badge--admin {
    background: #4caf50;
    color: #fff;
}

/* ═══ Size modifier ═══════════════════════════════════════
   Заменяет inline font-size:10px из conversation.php,
   inbox.php. Не конфликтует с .badge__icon. */

.badge--small {
    font-size: 10px;
    padding: 1px 6px;
    line-height: 1.4;
    border-radius: 8px;
}

/* ═══ Compat-shim: legacy .badge.{primary,success,danger,warning} ═══
   @deprecated 3.0.0 — remove after T-6
   (миграция templates/*.php на .badge--*-solid). */

.badge.primary { background: var(--primary); color: #fff; }
.badge.success { background: var(--success); color: #fff; }
.badge.danger  { background: var(--danger);  color: #fff; }
.badge.warning { background: var(--warning); color: #fff; }

/* ═══ Online dot (для user-card, conversation-status) ════ */

.online-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #9ca3af;
}

/* @deprecated 3.0.0 — compound-класс для state.
   Канон: .online-dot.is-online (см. §4.3 CodingStyleCSS). */
.online-dot.online {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
    animation: pulse-online 2s infinite;
}

@keyframes pulse-online {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50%      { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0); }
}

.conversation-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--muted);
}

/* 🧹 v3.0.0: .muted → перенесён в 17-utilities.css */

/* ============================================================
   19. ТАБЛИЦЫ
   ============================================================ */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

th, td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

th {
    background: var(--card-bg-hover);
    font-weight: 600;
    font-size: 13px;
}

tr:hover td {
    background: var(--card-bg-hover);
}

/* ============================================================
 * r15-modal-toast.css — Модальные окна и тосты (Phase 1 hygiene)
 *
 * @version 2.1.0 (2026-10-13, CodingStyleCSS Phase 1 hygiene):
 *   • 🟢 `.modal-overlay`, `.modal-overlay.active`, `.modal-overlay
 *     .modal`, `.modal-header`, `.modal-close`, `.modal-body`,
 *     `.modal-footer` помечены `@deprecated 2.1.0 — remove after
 *     Phase 3` (§4.4 case 1: legacy compat-shim, канон — `.dialog`).
 *     Поведение сохранено.
 *   • 🟢 Аналогично `.toast.success/.danger/.warning` (legacy compound
 *     shim — канон `.toast--*`).
 *   • ✅ `[hidden] !important` guard сохранён — контракт атрибута
 *     (§5.8 case 3).
 *
 * @version 2.0.1 (2026-10-11, 🛡️ defensive [hidden] guard):
 *   • 🛡️ `.dialog[hidden], .modal-overlay[hidden] {
 *     display: none !important }`. Причина: author-стили с
 *     `display: flex` на bare `.modal-overlay` перебивают
 *     user-agent `[hidden] { display: none }`.
 *
 * @version 2.0.0 (2026-10-04, T-3, ADR-0042):
 *   • NEW: .dialog — BEM-overlay (переименован из .modal).
 *   • LEGACY: .modal-overlay > .modal сохранён для transition.
 *   • Unify: .toast + .toast__* + .toast--* modifiers.
 *
 * @version 1.0.0: legacy.
 *
 * Зависимости: 01-variables.css (--card-bg, --border, --radius*,
 *   --muted, --danger, --success, --warning, --primary,
 *   --shadow-lg, --geek-mono).
 * ============================================================ */

/* ═══ ЧАСТЬ 0. DEFENSIVE [hidden] GUARD (v2.0.1) ═════════════
 *
 * 🛡️ `[hidden]` всегда побеждает `display: *`. Нужно, потому что
 * авторские стили типа `.modal-overlay { display: flex }` имеют
 * специфичность (0,2,0) — ту же, что `.modal-overlay[hidden]` (0,2,0).
 * При равной специфичности побеждает более поздний источник.
 *
 * `!important` здесь оправдан — контракт HTML-атрибута `hidden`
 * (CodingStyleCSS §5.8 case 3), аналогично `.hidden`/`.muted`.
 * ═══════════════════════════════════════════════════════════ */

.dialog[hidden],
.modal-overlay[hidden] {
    display: none !important;
}

/* ═══ ЧАСТЬ 1. NEW BEM: .dialog ═════════════════════════════ */

.dialog {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.dialog[hidden] { display: none; }

.dialog__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(2px);
}

.dialog__box {
    position: relative;
    z-index: 1;
    width: 100%;
    background: var(--card-bg);
    color: var(--text);
    border-radius: 12px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, .3);
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dialog--sm .dialog__box { max-width: 380px; }
.dialog--md .dialog__box { max-width: 520px; }
.dialog--lg .dialog__box { max-width: 760px; }
.dialog--xl .dialog__box { max-width: 1000px; }

.dialog__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.dialog__title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
}

.dialog__close {
    background: transparent;
    border: 0;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: var(--muted);
    padding: 0 4px;
    border-radius: var(--radius-sm);
}

.dialog__close:hover {
    color: var(--danger);
    background: var(--card-bg-hover);
}

.dialog__body {
    padding: 18px 20px;
    overflow-y: auto;
    flex: 1 1 auto;
}

.dialog__footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

/* ═══ ЧАСТЬ 2. LEGACY: .modal-overlay > .modal ═══════════════
 * @deprecated 2.1.0 — remove after Phase 3
 * (миграция admin/Views + backups-modals на `.dialog`).
 *
 * ⚠️ ВАЖНО: `.modal-overlay` НЕ имеет `display: flex` по умолчанию —
 * использует `.active`-модификатор. Любой add-on файл, добавляющий
 * `display: flex` на bare-`.modal-overlay`, ДОЛЖЕН быть scoped
 * (например `.backups-modals .modal-overlay`) ИЛИ добавлен в
 * allow-list `.style-allow-removed.json`.
 * ═══════════════════════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal);
    padding: 16px;
}

.modal-overlay.active { display: flex; }

.modal-overlay .modal {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    max-width: 420px;
    width: 100%;
    box-shadow: 0 10px 40px var(--shadow-lg);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--muted);
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    border-radius: var(--radius-sm);
}

.modal-close:hover {
    color: var(--danger);
    background: var(--card-bg-hover);
}

.modal-body {
    padding: 20px;
    color: var(--text);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

/* ═══ ЧАСТЬ 3. UNIFIED: .toast + .toast-container ═══════════ */

.toast-container {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top));
    right: calc(12px + env(safe-area-inset-right));
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: calc(100vw - 24px);
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius);
    background: var(--card-bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-left: 4px solid var(--muted);
    box-shadow: 0 4px 14px var(--shadow-lg);
    font-size: 14px;
    line-height: 1.4;
    min-width: 280px;
    max-width: 380px;
    pointer-events: auto;
    animation: toast-in .18s ease-out;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

.toast__icon {
    flex: 0 0 auto;
    font-size: 16px;
    line-height: 1.2;
}

.toast__message {
    flex: 1 1 auto;
    min-width: 0;
    word-break: break-word;
}

.toast__close {
    flex: 0 0 auto;
    background: transparent;
    border: 0;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: var(--muted);
    padding: 0 4px;
}

.toast__close:hover { color: var(--text); }

/* BEM modifiers */
.toast--info    { border-left-color: var(--primary); }
.toast--success { border-left-color: var(--success); }
.toast--warning { border-left-color: var(--warning); }
.toast--error   { border-left-color: var(--danger); }

/* ═══ Compat-shim: legacy .toast.{success,danger,warning} ═══
 * @deprecated 2.1.0 — remove after Phase 3
 * (канон: .toast--*). */

.toast.success { border-left-color: var(--success); }
.toast.danger  { border-left-color: var(--danger);  }
.toast.warning { border-left-color: var(--warning); }

/* ============================================================
 * END OF FILE r15-modal-toast.css v2.1.0
 * ============================================================ */

/* ============================================================
 * r16-avatars.css — Аватары (Phase 2 consolidation)
 *
 * @version 1.2.0 (2026-10-13, CodingStyleCSS Phase 2):
 *   • 🟢 `.avatar-sm` / `.avatar-lg` — `@deprecated 1.2.0 —
 *     remove after Phase 3` (§12.2 п.7: legacy → BEM `.avatar--sm`/
 *     `--lg`). Оставлены как shim до завершения миграции
 *     templates/*.php на BEM.
 *   • ✅ Phase 1 изменений не было (файл уже был чистым).
 *
 * @version 1.1.0 (2026-10-06, T-6.2-fix — DoD-10 delta):
 *   • 🆕 .avatar--initial — текстовый fallback.
 *   • 🆕 .avatar--sm / .avatar--lg — BEM-алиасы.
 *   • 🟢 .avatar-sm / .avatar-lg — legacy-алиасы сохранены.
 *   • 🔴 Fix DoD-6: добавлен @version-заголовок.
 *
 * @version 1.0.0 (2026-10-04, T-3) — базовый набор.
 *
 * Зависимости: 01-variables.css.
 * Потребители:
 *   • templates/01-partials/_header.php (site-nav__user)
 *   • templates/03-modules/users/profile.php
 *   • templates/03-modules/admin/users.php
 *   • templates/03-modules/admin/user_dashboard.php ← основной
 *   • includes/Modules/Messages/Views_OLD/_message_item.php
 * ============================================================ */

/* ─── Базовый аватар ───────────────────────────────────────── */

.avatar {
    display: inline-block;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--card-bg-hover);
    border: 1px solid var(--border);
    flex-shrink: 0;
    vertical-align: middle;
}

/* ─── BEM-размеры (ADR-0043, канон) ───────────────────────── */

.avatar--sm {
    width: 32px;
    height: 32px;
}

.avatar--lg {
    width: 80px;
    height: 80px;
}

/* ─── @deprecated legacy-размеры ───────────────────────────
   @deprecated 1.2.0 — remove after Phase 3
   (§12.2 п.7: legacy → BEM `.avatar--sm`/`--lg`).
   Пока оставлены как shim для templates/*.php до миграции. */

.avatar-sm {
    width: 32px;
    height: 32px;
}

.avatar-lg {
    width: 80px;
    height: 80px;
}

/* ─── Fallback: текстовый инициал ──────────────────────────── */

.avatar--initial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg-hover);
    color: var(--primary);
    font-weight: 700;
    font-size: 1.2rem;
    line-height: 1;
    text-transform: uppercase;
    user-select: none;
    font-family: inherit;
    object-fit: initial;  /* override .avatar object-fit для span */
}

/* ─── Размеры initial-аватара ──────────────────────────────── */

.avatar--initial.avatar-sm,
.avatar--initial.avatar--sm {
    font-size: 0.85rem;
}

.avatar--initial.avatar-lg,
.avatar--initial.avatar--lg {
    font-size: 2rem;
}

/* ─── Dark-theme ───────────────────────────────────────────── */

[data-theme="dark"] .avatar--initial {
    background: var(--card-bg-hover);
    color: var(--primary);
}

/* ============================================================
 * END OF FILE r16-avatars.css v1.2.0
 * ============================================================ */

/* ============================================================
 * r17-utilities.css — Утилиты (Phase 1 hygiene, SSOT)
 *
 * @version 2.0.0 (2026-10-13, CodingStyleCSS Phase 1):
 *   • 🟢 +`.muted` — переехал из 13-badges.css (SSOT утилит,
 *     CodingStyleCSS §12.2 п.27). `!important` оправдан:
 *     контракт утилиты (§5.8 case 2).
 *
 * @version 1.0.0 (T-0): базовый набор утилит.
 *
 * Назначение: единственный источник утилитарных классов
 * (§3.5 CodingStyleCSS). Расширять только по согласованию —
 * никаких `.mt-3`, `.p-4`, `.text-lg` и т.п.
 *
 * Разрешённый набор:
 *   .flex .items-center .justify-between
 *   .gap-1 .gap-2
 *   .text-center .text-right
 *   .mt-1 .mt-2 .mb-1 .mb-2
 *   .hidden
 *   .muted
 * ============================================================ */

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.hidden { display: none !important; }

/* 🆕 v2.0.0: SSOT утилиты приглушённого текста (переехала
   из 13-badges.css). `!important` — контракт утилиты (§5.8). */
.muted {
    color: var(--muted) !important;
}

/* ============================================================
 * 18-alert.css — Alert (сообщения об ошибке/успехе/предупреждении)
 * @version 1.0.0 (2026-10-04, T-3, ADR-0042)
 *
 * Извлечено из 25-ui-kit.css (удалён).
 * Используется в templates/02-components/alert.php.
 * ============================================================ */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    margin: 0 0 14px;
    border-radius: var(--radius);
    border-left: 4px solid var(--muted);
    background: var(--card-bg-hover);
    color: var(--text);
    font-size: 14px;
    line-height: 1.4;
}

.alert__message {
    flex: 1 1 auto;
    min-width: 0;
    word-break: break-word;
}

.alert__close {
    flex: 0 0 auto;
    background: transparent;
    border: 0;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: var(--muted);
    padding: 0 4px;
}

.alert__close:hover { color: var(--text); }

.alert--error   { border-left-color: var(--danger);  color: var(--danger); }
.alert--success { border-left-color: var(--success); color: var(--success); }
.alert--warning { border-left-color: var(--warning); color: var(--warning); }
.alert--info    { border-left-color: var(--primary); color: var(--primary); }

/* ============================================================
 * 19-pagination.css — Постраничная навигация (BEM)
 * @version 1.0.0 (2026-10-04, T-3, ADR-0042)
 *
 * Извлечено из 25-ui-kit.css (удалён).
 * Используется в templates/02-components/pagination.php.
 * ============================================================ */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex-wrap: wrap;
    margin: 22px 0 8px;
    font-size: 14px;
}

.pagination__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    background: transparent;
    border: 1px solid transparent;
    transition: background .12s ease, border-color .12s ease;
}

.pagination__item:hover {
    background: var(--card-bg-hover);
    border-color: var(--border);
}

.pagination__item--current {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 600;
}

.pagination__item--current:hover {
    background: var(--primary);
    color: #fff;
}

.pagination__item--disabled {
    opacity: .4;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination__item--dots {
    cursor: default;
    opacity: .6;
}

.pagination__item--prev,
.pagination__item--next,
.pagination__item--edge {
    font-weight: 600;
}

/* ============================================================
 * r20-admin-nav.css — Admin navigation (BEM)
 *                     (Phase 1 + Phase 2 consolidation)
 *
 * @version 1.2.0 (2026-10-13, CodingStyleCSS Phase 2):
 *   • 🟢 Файл стал ЕДИНСТВЕННЫМ источником .admin-nav* (§12.1 п.2).
 *     Дубль из 51-admin.css §19 удалён (см. r51-admin v2.4.0).
 *   • 🟢 Перенесены из r51-admin.css §19 (были только там):
 *     `.admin-nav__back`, `.admin-nav__link--active`
 *     (используются в render_admin_nav(), render.php v6.16.13).
 *   • ✅ Phase 1 (600→640) сохранён.
 *
 * @version 1.1.0 (2026-10-13, CodingStyleCSS Phase 1 hygiene):
 *   • 🟢 `@media (max-width: 600px)` → `640px` (§6.2).
 *
 * @version 1.0.1 (2026-10-07, ADR-0042 — переименован 26-admin-nav.css).
 * @version 1.0.0 (2026-10-04, T-3, ADR-0042).
 *
 * Зависимости: 01-variables.css.
 * Потребители: templates/01-partials/nav/admin.php,
 *   includes/helpers/render.php (render_admin_nav(), @deprecated).
 * ============================================================ */

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin: 0 0 22px;
    padding: 8px 4px;
    background: var(--card-bg-hover);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow-x: auto;
}

.admin-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text);
    font-size: 13px;
    white-space: nowrap;
    transition: background .12s ease, color .12s ease;
}

.admin-nav__link:hover {
    background: var(--card-bg-hover);
}

.admin-nav__link.is-active {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

/* 🆕 v1.2.0: перенесён из r51-admin §19 (SSOT §12.1 п.2).
   Используется render_admin_nav() для кнопки "← Назад".
   ⚠️ Класс `--active` — не-BEM state; канон `.is-active`.
   Пока оставлен для обратной совместимости render_admin_nav(). */
.admin-nav__back {
    margin-right: 12px;
}

/* @deprecated 1.2.0 — remove after Phase 3
   (§4.3: state через `.is-active`, не `--active` modifier).
   Используется render_admin_nav() v6.16.13. */
.admin-nav__link--active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.admin-nav__icon  { font-size: 14px; line-height: 1; }
.admin-nav__label { font-size: 13px; }

/* 🟢 Phase 1: 600 → 640 (канонический breakpoint). */
@media (max-width: 640px) {
    .admin-nav__label { display: none; }
    .admin-nav__link  { padding: 8px 10px; }
    .admin-nav__icon  { font-size: 16px; }
}

/* ============================================================
 * END OF FILE r20-admin-nav.css v1.2.0
 * ============================================================ */

/* ============================================================
 * 21-user-card.css — User card (BEM)
 * @version 1.0.2 (2026-10-07, ADR-0042 — переименован 27-user-card.css):
 *   • 🔴 ПЕРЕИМЕНОВАН 27-user-card.css → 21-user-card.css.
 *     Единая 3-диапазонная сетка (10-39 для 02-components).
 *   • 🟢 Содержимое CSS НЕ менялось.
 *
 * @version 1.0.1 (2026-10-06, P2 — DoD-10 cleanup):
 *   • 🆕 +.user-card__avatar--initial — fallback-аватар без картинки
 *     (display:inline-flex; align-items:center; justify-content:center;
 *      font-weight:600;) вместо inline-стиля из user-card.php v1.0.1.
 *
 * @version 1.0.0 (2026-10-04, T-3, ADR-0042):
 *   • Извлечено из 25-ui-kit.css (удалён).
 *   • Используется в templates/02-components/user-card.php.
 * ============================================================ */

.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: border-color .15s ease, transform .1s ease;
    position: relative;
}

.user-card:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.user-card__avatar-wrap {
    position: relative;
    flex: 0 0 auto;
}

.user-card__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--card-bg-hover);
    display: block;
}

/* fallback-аватар без картинки (первая буква имени). */
.user-card__avatar--initial {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
    line-height: 1;
    color: var(--text);
    user-select: none;
    -webkit-user-select: none;
}

.user-card__online-dot {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--muted);
    border: 2px solid var(--card-bg);
}

.user-card__online-dot--online {
    background: var(--success);
}

.user-card__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-card__name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-card__handle {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-card__actions {
    flex: 0 0 auto;
    display: flex;
    gap: 4px;
}

.user-card__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: background .12s ease, color .12s ease;
    -webkit-tap-highlight-color: transparent;
}

.user-card__action:hover {
    background: var(--card-bg-hover);
    color: var(--text);
}

@media (hover: none) and (pointer: coarse) {
    .user-card__action {
        width: 40px;
        height: 40px;
    }
}

/* ============================================================
 * 22-timezone-selector.css — Timezone selector (BEM)
 * @version 1.0.1 (2026-10-07, ADR-0042 — переименован 28-timezone-selector.css):
 *   • 🔴 ПЕРЕИМЕНОВАН 28-timezone-selector.css → 22-timezone-selector.css.
 *     Единая 3-диапазонная сетка (10-39 для 02-components).
 *   • 🟢 Содержимое CSS НЕ менялось.
 *
 * @version 1.0.0 (2026-10-04, T-3, ADR-0042):
 *   • Извлечено из 25-ui-kit.css (удалён).
 *   • Используется в templates/01-partials/_timezone_selector.php.
 * ============================================================ */

.timezone-selector {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.timezone-selector__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.timezone-selector__hint {
    font-size: 12px;
    color: var(--muted);
    margin-top: 3px;
}

.timezone-selector__current {
    font-size: 12px;
    color: var(--muted);
}

.timezone-selector__offset {
    color: var(--muted);
    font-size: 11px;
    margin-left: 4px;
}

/* ============================================================
 * 23-group-search.css — Group user search (shared component)
 * @version 1.0.1 (2026-10-07, ADR-0042 — переименован 29-group-search.css):
 *   • 🔴 ПЕРЕИМЕНОВАН 29-group-search.css → 23-group-search.css.
 *     Единая 3-диапазонная сетка (10-39 для 02-components).
 *   • 🟢 Содержимое CSS НЕ менялось.
 *
 * @version 1.0.0 (2026-10-06, P2 — DoD-10 cleanup):
 *   • 🆕 Новый файл. Все классы .group-search__* для
 *     templates/03-modules/messages/create_group.php v1.0.3 +
 *     group_members.php v1.0.3.
 *   • Используется JS-модулем assets/js/groups/group-user-search.js
 *     (интерфейс initGroupUserSearch() — не менялся).
 * ============================================================ */

.group-search {
    position: relative;
}

.group-search__input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text);
    font-family: inherit;
}

.group-search__input:focus {
    border-color: var(--primary);
    outline: none;
}

.group-search__results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 120;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    max-height: 240px;
    overflow-y: auto;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    margin-top: 4px;
}

.group-search__results[hidden] {
    display: none;
}

.group-search__item {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.12s ease;
}

.group-search__item.active,
.group-search__item:hover {
    background: var(--card-bg-hover);
}

.group-search__item img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.group-search__item-name {
    font-weight: 600;
    font-size: 14px;
}

.group-search__item-handle {
    font-size: 12px;
    color: var(--muted);
}

.group-search__status {
    padding: 10px 12px;
    font-size: 13px;
    color: var(--muted);
}

.group-search__status--err {
    color: var(--danger);
}

.group-search__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.group-search__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary);
    color: #fff;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.4;
}

.group-search__chip img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

.group-search__chip-handle {
    opacity: 0.75;
    font-size: 11px;
}

.group-search__chip-x {
    background: none;
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}

.group-search__chip-x:hover {
    opacity: 0.8;
}

/* ============================================================
 * r24-user-menu.css — User menu: SIDEBAR override
 *                     (Phase 3.a — снятие !important)
 *
 * @version 3.0.0 (2026-10-13, CodingStyleCSS Phase 3):
 *   • 🟢 УДАЛЕНЫ все 10 `!important` — стали избыточны после
 *     r04-header v1.1.0: transition/hover/[open] для
 *     `.user-menu__toggle` уже вынесены в селектор
 *     `.user-menu:not(.user-menu--sidebar)` → `.user-menu--sidebar`
 *     не наследует их из базы.
 *   • 🟢 Явные reset-правила (border-color, outline, box-shadow,
 *     transition) оставлены без `!important` — для документирования
 *     контракта и защиты от случайных browser-default. Специфичность
 *     `.user-menu--sidebar .user-menu__toggle` (0,2,0) > база
 *     `.user-menu__toggle` (0,1,0) → работает через каскад.
 *   • 🟢 `:focus-visible` — `outline: 2px solid var(--primary)`
 *     без `!important`. Специфичность (0,3,0) побеждает base.
 *   • ✅ Layout, dropdown-up, collapsed-state, safety-net — сохранены.
 *
 * @version 2.1.0 (2026-10-07, cleanup + hard reset border/outline):
 *   • 🔴 FIX мигания border/outline при развороте sidebar:
 *     временный hard reset через `!important` (до T-6.5).
 *
 * Зависимости:
 *   r04-header.css  — база `.user-menu__*`.
 *   r08-sidebar.css — `.sidebar__footer`.
 *   r16-avatars.css — база `.avatar--initial`.
 * ============================================================ */

/* ─── Sidebar: layout ─────────────────────────────────── */

.user-menu--sidebar {
    width: 100%;
    position: relative;
}

/* 🟢 v3.0.0: без !important — контракт:
   в sidebar-контексте toggle полностью статичен; hover только фон,
   никакого transition/border/outline/box-shadow от базы r04.
   Специфичность (0,2,0) > base (0,1,0) — каскад достаточен. */
.user-menu--sidebar .user-menu__toggle {
    width: 100%;
    justify-content: flex-start;
    border-color: transparent;
    outline: 0;
    box-shadow: none;
    transition: none;
}

/* Hover — только мягкий фон, без border (expanded). */
.user-menu--sidebar .user-menu__toggle:hover {
    background: var(--card-bg-hover);
}

/* Focus-visible для Tab-навигации (a11y) — синий outline.
   Специфичность (0,3,0) побеждает базу. */
.user-menu--sidebar .user-menu__toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ─── Sidebar: dropdown открывается ВВЕРХ ─────────────── */

.user-menu--sidebar .user-menu__dropdown {
    top: auto;
    bottom: calc(100% + 6px);
    left: 0;
    right: 0;
    min-width: 100%;
    max-width: none;
}

/* ─── Footer collaboration ───────────────────────────── */

.sidebar__footer .user-menu--sidebar {
    flex: 1 1 auto;
    min-width: 0;
}

.sidebar__footer .user-menu--sidebar .user-menu__toggle {
    padding: 4px 6px;
}

/* ─── COLLAPSED — статичная аватарка, без интерактива ── */

body.is-sidebar-collapsed .user-menu--sidebar .user-menu__name,
body.is-sidebar-collapsed .user-menu--sidebar .user-menu__caret {
    display: none;
}

body.is-sidebar-collapsed .sidebar__footer .user-menu--sidebar {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    pointer-events: none;
    cursor: default;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body.is-sidebar-collapsed .user-menu--sidebar .user-menu__toggle {
    width: 100%;
    justify-content: center;
    align-items: center;
    padding: 4px;
    gap: 0;
}

/* ─── SAFETY NET — dropdown у [open] в collapsed ────────
   JS (sidebar.js) снимает [open] при collapse. Это CSS —
   страховка на случай race / JS-off / bfcache. */

body.is-sidebar-collapsed .sidebar__footer .user-menu--sidebar[open] > .user-menu__dropdown {
    display: none;
}

/* ============================================================
 * END OF FILE r24-user-menu.css v3.0.0
 * ============================================================ */

/* ============================================================
 * r40a-messages-inbox.css — Messenger: INBOX (inbox page)
 *
 * @version 1.0.0 (2026-10-13, CodingStyleCSS Phase 3.c — split):
 *   • 🟢 Выделено из r40-messages.css v1.14.0 (секция INBOX +
 *     относящиеся media-queries).
 *   • Причина: файл разросся до ~1870 строк (§13.3 Phase 3).
 *   • 🟢 Зависимости: 01-variables.css, 10-buttons.css,
 *     11-cards.css, 13-badges.css, 16-avatars.css.
 *   • 🟢 `.inbox-item.unread` — @deprecated (Phase 1) сохранён.
 *
 * Зависимости: 01-variables.css, 10-buttons.css, 11-cards.css,
 *   13-badges.css, 16-avatars.css.
 * ============================================================ */

/* ─────────────────────────────────────────────────────────
   ВХОДЯЩИЕ (inbox)
   ───────────────────────────────────────────────────────── */

.inbox-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.inbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    transition: border-color 0.15s ease,
                box-shadow 0.15s ease,
                transform 0.15s ease,
                background 0.15s ease;
}

.inbox-item:hover,
.inbox-item:focus-visible {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(47, 111, 237, 0.1);
    transform: translateY(-1px);
    text-decoration: none;
    background: var(--card-bg-hover);
}

.inbox-item:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* @deprecated 1.14.0 — legacy state-класс без `is-`.
   Канон: .inbox-item.is-unread (CodingStyleCSS §4.3). */
.inbox-item.unread {
    background: var(--card-bg);
    border-left: 3px solid var(--primary);
    border-color: var(--primary);
}

[data-theme="dark"] .inbox-item.unread {
    background: rgba(47, 111, 237, 0.08);
}

.inbox-avatar-wrap { flex-shrink: 0; }
.inbox-avatar-wrap .avatar { width: 48px; height: 48px; }

.inbox-content { flex: 1; min-width: 0; }

.inbox-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
    gap: 8px;
}

.inbox-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inbox-item.unread .inbox-name { font-weight: 700; }

.inbox-time {
    font-size: 12px;
    color: var(--muted);
    flex-shrink: 0;
}

.inbox-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.inbox-message {
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.inbox-item.unread .inbox-message {
    color: var(--text);
    font-weight: 500;
}

.inbox-badge {
    flex-shrink: 0;
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.inbox-handle {
    font-size: 12px;
    font-family: var(--geek-mono);
}

/* Inbox: header-row + actions */

.inbox-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.inbox-h1 { margin: 0; }

.inbox-header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.inbox-empty-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.inbox-row { position: relative; }

.inbox-row__actions {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 4px;
    z-index: 2;
}

.inbox-row__form { display: inline; margin: 0; }

.inbox-row__btn {
    min-width: 36px;
    min-height: 36px;
    padding: 6px 8px;
    border-color: transparent;
    background: transparent;
    opacity: 0.4;
    transition: opacity 0.15s ease,
                background 0.15s ease,
                border-color 0.15s ease;
}

.inbox-row:hover .inbox-row__btn,
.inbox-row__btn:focus-visible {
    opacity: 1;
}

.inbox-row__btn--clear { color: var(--warning); }
.inbox-row__btn--clear:hover {
    background: var(--card-bg-hover);
    border-color: var(--warning);
}

.inbox-row__btn--delete { color: var(--danger); }
.inbox-row__btn--delete:hover {
    background: var(--card-bg-hover);
    border-color: var(--danger);
}

.inbox-item--with-actions { padding-right: 96px; }

@keyframes inbox-flash {
    0%   { background: rgba(79, 172, 254, 0.14); }
    100% { background: transparent; }
}

.inbox-row--updated .inbox-item {
    animation: inbox-flash 1.5s ease-out;
}

/* ═══ Media: mobile ≤640px (Phase 1: 600 → 640) ══════════ */

@media (max-width: 640px) {
    .inbox-item { padding: 10px 12px; gap: 10px; }
    .inbox-avatar-wrap .avatar { width: 40px; height: 40px; }
    .inbox-name { font-size: 14px; }
    .inbox-message { font-size: 12px; }

    .inbox-row__btn {
        opacity: 1;
        min-width: 40px;
        min-height: 40px;
    }
    .inbox-item--with-actions { padding-right: 96px; }
    .inbox-header-row {
        flex-direction: column;
        align-items: stretch;
    }
    .inbox-header-actions { justify-content: flex-start; }
}

/* ═══ Media: touch-devices ══════════════════════════════ */

@media (hover: none) and (pointer: coarse) {
    .inbox-row__btn { opacity: 1; }
}

/* ============================================================
 * END OF FILE r40a-messages-inbox.css v1.0.0
 * ============================================================ */

/* ============================================================
 * r40b-messages-dialog.css — Messenger: DIALOG + LIGHTBOX +
 *                            CONTEXT MENU + TOAST + typing/
 *                            reply/emoji/attachment
 *
 * @version 1.0.0 (2026-10-13, CodingStyleCSS Phase 3.c — split):
 *   • 🟢 Выделено из r40-messages.css v1.14.0:
 *       • ДИАЛОГ (.conversation-*, .message-*, .messages-list)
 *       • LIGHTBOX (.messenger-lightbox*)
 *       • CONTEXT MENU + TOAST (.messenger-context-menu*,
 *         .messenger-toast, .unread-divider, .scroll-down-*,
 *         .typing-*, .quote-preview, .edit-preview, .reply-form*,
 *         .emoji-*, .attachment-input, .attachment-label)
 *   • 🟢 Phase 1 правки сохранены:
 *       • fallback'и var(--x, #hardcoded) → var(--x);
 *       • @media 600 → 640.
 *
 * Зависимости: 01-variables.css, 10-buttons.css, 11-cards.css,
 *   13-badges.css, 16-avatars.css.
 * ============================================================ */

/* ─────────────────────────────────────────────────────────
   ДИАЛОГ
   ───────────────────────────────────────────────────────── */

.conversation-container {
    position: relative;
    background: var(--chat-bg);
    border: 1px solid var(--chat-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px var(--shadow-lg);
    overflow: hidden;
    font-family: var(--geek-mono);
    margin-bottom: 16px;
}

.conversation-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 8px;
}

.conversation__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.conversation__handle { font-size: 14px; }

.conversation__toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.conversation__clear-form { display: inline; margin: 0; }

.conversation__clear-btn {
    color: var(--warning);
    border-color: transparent;
    background: transparent;
}

.conversation__clear-btn:hover {
    background: var(--chat-overlay-hover);
    border-color: var(--warning);
}

.conversation-status .badge { margin-left: 8px; }

.conversation-status__description {
    margin-top: 4px;
    font-size: 12px;
}

.conversation__readonly { text-align: center; }

.reply-form__textarea { min-height: 80px; }

.messages-list {
    height: 60vh;
    max-height: 600px;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--chat-bg);
    position: relative;
}

/* Сообщение */
.message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 90%;
    font-size: 13px;
    line-height: 1.5;
}

.message-mine { align-self: flex-end; flex-direction: row-reverse; }
.message-other { align-self: flex-start; }

.message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--chat-border);
}

.message-bubble {
    padding: 8px 12px;
    border-radius: 4px;
    max-width: 100%;
    word-wrap: break-word;
    position: relative;
    border: 1px solid;
}

.message-other .message-bubble {
    background: var(--chat-other-bg);
    border-color: var(--chat-other-border);
    color: var(--chat-other-text);
}

.message-mine .message-bubble {
    background: var(--chat-mine-bg);
    border-color: var(--chat-mine-border);
    color: var(--chat-mine-text);
}

.message-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 4px;
    font-size: 11px;
}

.message-sender { font-weight: 600; color: var(--chat-accent); }
.message-other .message-sender::before { content: '> '; color: var(--chat-other-border); }
.message-mine .message-sender::before { content: '$ '; color: var(--chat-mine-border); }

.message-text {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: var(--geek-mono);
}

.message-deleted-text {
    font-style: italic;
    color: var(--chat-muted);
    font-size: 12px;
}

.message-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 4px;
    font-size: 10px;
    color: var(--chat-muted);
}

.message-time { font-size: 10px; opacity: 0.7; }

.message-edited {
    font-size: 10px;
    font-family: var(--geek-mono);
    color: var(--chat-muted);
    font-style: italic;
    letter-spacing: 0.3px;
    opacity: 0.7;
    user-select: none;
    cursor: help;
}
.message-footer .message-edited {
    line-height: 1;
    margin-right: auto;
}

.message-status {
    font-family: var(--geek-mono);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0;
}
.message-status.sent { color: var(--chat-muted); }
.message-status.read {
    color: var(--chat-accent);
    animation: readPulse 0.4s ease;
}

@keyframes readPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.message-actions {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.message:hover .message-actions { opacity: 1; }

.msg-action-btn {
    background: var(--chat-overlay);
    border: 1px solid var(--chat-border);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    color: var(--chat-muted);
    transition: background 0.15s ease,
                color 0.15s ease,
                border-color 0.15s ease;
}
.msg-action-btn:hover {
    background: var(--chat-overlay-hover);
    color: var(--chat-text);
    border-color: var(--chat-accent);
}

.message-quote {
    background: var(--chat-overlay);
    border-left: 3px solid var(--chat-accent);
    padding: 6px 10px;
    border-radius: 2px;
    margin-bottom: 6px;
    font-size: 11px;
}
.quote-author { font-weight: 600; margin-bottom: 2px; color: var(--chat-accent); }
.quote-body { opacity: 0.8; }

/* ─────────────────────────────────────────────────────────
   LIGHTBOX
   ───────────────────────────────────────────────────────── */

.messenger-lightbox {
    position: fixed;
    inset: 0;
    z-index: var(--z-lightbox);
    display: none;
    align-items: center;
    justify-content: center;
    font-family: var(--geek-mono);
    touch-action: none;
    overscroll-behavior: contain;
}
.messenger-lightbox.is-open { display: flex; }

.messenger-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    cursor: default;
    will-change: opacity;
}

.messenger-lightbox__img {
    position: relative;
    max-width: 92vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    cursor: zoom-in;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: auto;
    transition: none;
    transform-origin: 50% 50%;
    touch-action: none;
    will-change: transform, opacity;
    backface-visibility: hidden;
}
.messenger-lightbox__img.is-zoomed { cursor: grab; }
.messenger-lightbox__img.is-grabbing { cursor: grabbing; }

.messenger-lightbox__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    z-index: 3;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.messenger-lightbox__close:hover { background: rgba(255, 255, 255, 0.2); }

.messenger-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 64px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    z-index: 3;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.messenger-lightbox__nav:hover { background: rgba(255, 255, 255, 0.16); }
.messenger-lightbox__nav--prev { left: 16px; }
.messenger-lightbox__nav--next { right: 16px; }

.messenger-lightbox__toolbar {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    color: #fff;
    font-size: 13px;
    max-width: 90vw;
    z-index: 3;
    flex-wrap: nowrap;
}
.messenger-lightbox__counter {
    font-variant-numeric: tabular-nums;
    opacity: 0.85;
    padding-right: 8px;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    margin-right: 4px;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
}
.messenger-lightbox__download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    /* 🟢 v1.14.0: fallback #2f6fed удалён (§3.3). */
    background: var(--chat-accent);
    color: #fff;
    border-radius: 3px;
    text-decoration: none;
    font-weight: 600;
    transition: filter 0.15s ease;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.messenger-lightbox__download:hover {
    filter: brightness(1.1);
    text-decoration: none;
    color: #fff;
}
.messenger-lightbox__filename {
    opacity: 0.85;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 30vw;
    user-select: none;
    -webkit-user-select: none;
}

.messenger-lightbox__zoom {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding-left: 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    margin-left: 4px;
}
.messenger-lightbox__zoom button {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    transition: background 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.messenger-lightbox__zoom button:hover {
    background: rgba(255, 255, 255, 0.16);
}
.messenger-lightbox__zoom-pct {
    min-width: 44px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    opacity: 0.85;
    font-size: 12px;
    user-select: none;
    -webkit-user-select: none;
}
.messenger-lightbox__zoom-reset { margin-left: 2px; }

body.messenger-lightbox-open { overflow: hidden; }

/* ─────────────────────────────────────────────────────────
   CONTEXT MENU + TOAST
   ───────────────────────────────────────────────────────── */

.messenger-context-menu {
    position: fixed;
    z-index: var(--z-context-menu);
    min-width: 200px;
    max-width: 300px;
    /* 🟢 v1.14.0: fallback'и удалены (§3.3). */
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    padding: 6px;
    display: none;
    opacity: 0;
    transform: scale(0.96);
    transform-origin: top left;
    transition: opacity 0.12s ease, transform 0.12s ease;
    font-family: var(--geek-mono);
    color: var(--text);
    user-select: none;
    -webkit-user-select: none;
}
.messenger-context-menu.is-open {
    opacity: 1;
    transform: scale(1);
}
.messenger-context-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: inherit;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s ease;
    -webkit-tap-highlight-color: transparent;
}
.messenger-context-menu__item:hover,
.messenger-context-menu__item:focus-visible {
    /* 🟢 v1.14.0: fallback удалён (§3.3). */
    background: var(--card-bg-hover);
    outline: none;
}
/* 🟢 v1.14.0: fallback удалён (§3.3). */
.messenger-context-menu__item--danger { color: var(--danger); }
.messenger-context-menu__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    flex-shrink: 0;
    font-size: 15px;
    opacity: 0.85;
}
.messenger-context-menu__label {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.messenger-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 13px;
    font-family: var(--geek-mono);
    z-index: var(--z-toast);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    max-width: calc(100vw - 32px);
    text-align: center;
}
.messenger-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.message-unread-highlight .message-bubble {
    animation: unreadPulse 1.5s ease 2;
}
@keyframes unreadPulse {
    0%   { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.6); }
    50%  { box-shadow: 0 0 0 8px rgba(255, 215, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 215, 0, 0); }
}

.unread-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0 4px;
    font-size: 10px;
    font-family: var(--geek-mono);
    color: var(--chat-accent);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
    user-select: none;
    pointer-events: none;
}
.unread-divider::before,
.unread-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--chat-accent);
    opacity: 0.45;
}
.unread-divider__label {
    flex-shrink: 0;
    padding: 0 6px;
}

.scroll-down-btn {
    position: absolute;
    bottom: 110px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background: var(--chat-header-bg);
    color: var(--chat-accent);
    border: 1px solid var(--chat-border);
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease,
                border-color 0.2s ease;
    z-index: 10;
    font-family: var(--geek-mono);
}
.scroll-down-btn:hover { transform: translateY(-2px); border-color: var(--chat-accent); }

.scroll-down-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 2px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--chat-bg);
    font-family: var(--geek-mono);
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 12px;
    color: var(--chat-muted);
    background: var(--chat-bg);
    font-family: var(--geek-mono);
}
.typing-indicator::before {
    content: '>';
    color: var(--chat-accent);
    animation: blink-cursor 1s infinite;
}
@keyframes blink-cursor {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 1px;
    background: var(--chat-muted);
    animation: typingBounce 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-4px); opacity: 1; }
}
.typing-text { font-style: italic; margin-left: 6px; }

.quote-preview,
.edit-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--chat-header-bg);
    border-left: 3px solid var(--chat-accent);
    margin: 8px 16px;
    border-radius: 3px;
    font-family: var(--geek-mono);
    font-size: 12px;
}
.quote-preview-content,
.edit-preview-content { flex: 1; min-width: 0; }

.quote-preview-author,
.edit-preview-label {
    font-weight: 600;
    font-size: 12px;
    color: var(--chat-accent);
    margin-bottom: 2px;
}
.quote-preview-body,
.edit-preview-body {
    font-size: 12px;
    color: var(--chat-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.quote-cancel,
.edit-cancel {
    background: transparent;
    border: 1px solid var(--chat-border);
    color: var(--chat-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 3px;
    transition: color 0.15s ease,
                border-color 0.15s ease;
}
.quote-cancel:hover,
.edit-cancel:hover {
    color: var(--danger);
    border-color: var(--danger);
}

.reply-form {
    padding: 12px 16px;
    border-top: 1px solid var(--chat-border);
    background: var(--chat-header-bg);
}
.reply-form textarea {
    background: var(--chat-bg);
    color: var(--chat-text);
    border: 1px solid var(--chat-border);
    border-radius: 3px;
    font-family: var(--geek-mono);
    font-size: 13px;
    margin-bottom: 10px;
    min-height: 70px;
}
.reply-form textarea:focus {
    border-color: var(--chat-accent);
    box-shadow: 0 0 0 3px var(--chat-overlay-hover);
}
.reply-form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.reply-form-actions .btn { margin-left: auto; font-family: var(--geek-mono); }

.emoji-toggle {
    background: transparent;
    border: 1px solid var(--chat-border);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 3px;
    transition: background 0.15s ease,
                border-color 0.15s ease;
}
.emoji-toggle:hover { background: var(--chat-overlay-hover); border-color: var(--chat-accent); }

.emoji-picker {
    position: absolute;
    bottom: 110px;
    left: 16px;
    background: var(--chat-header-bg);
    border: 1px solid var(--chat-border);
    border-radius: 4px;
    padding: 12px;
    box-shadow: 0 8px 24px var(--shadow-lg);
    max-width: 320px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 20;
}
.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
}
.emoji-btn {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    padding: 4px;
    font-size: 18px;
    line-height: 1;
    transition: background 0.15s ease,
                border-color 0.15s ease,
                transform 0.15s ease;
}
.emoji-btn:hover {
    background: var(--chat-overlay-hover);
    border-color: var(--chat-accent);
    transform: scale(1.15);
}

.attachment-input {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.attachment-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--chat-border);
    border-radius: 3px;
    color: var(--chat-text);
    font-size: 12px;
    cursor: pointer;
    transition: border-color 0.15s ease,
                color 0.15s ease;
    font-family: var(--geek-mono);
}
.attachment-label:hover { border-color: var(--chat-accent); color: var(--chat-accent); }

/* ═══ Media: dialog — mobile ≤768px ══════════════════════ */

@media (max-width: 768px) {
    .message { max-width: 95%; }
    .messages-list { height: 55vh; }
    .reply-form-actions .btn { min-height: 44px; }
}

/* ═══ Media: dialog — small ≤640px (Phase 1) ═════════════ */

@media (max-width: 640px) {
    .reply-form { padding: 10px 12px; }
    .emoji-picker { max-width: calc(100vw - 40px); left: 12px; }
    .scroll-down-btn { bottom: 100px; right: 12px; }
    .message-bubble { padding: 6px 10px; font-size: 12px; }

    .conversation__title { font-size: 1.25rem; }
    .conversation__handle { font-size: 13px; }

    .messenger-lightbox__close {
        top: 10px;
        right: 10px;
        width: 44px;
        height: 44px;
        font-size: 22px;
    }
    .messenger-lightbox__nav {
        width: 44px;
        height: 52px;
        font-size: 26px;
    }
    .messenger-lightbox__nav--prev { left: 6px; }
    .messenger-lightbox__nav--next { right: 6px; }
    .messenger-lightbox__toolbar {
        bottom: 12px;
        padding: 6px 10px;
        font-size: 12px;
        gap: 8px;
        max-width: calc(100vw - 20px);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .messenger-lightbox__toolbar::-webkit-scrollbar { display: none; }
    .messenger-lightbox__filename { display: none; }
    .messenger-lightbox__zoom {
        padding-left: 6px;
        margin-left: 0;
    }
    .messenger-lightbox__zoom button {
        width: 26px;
        height: 26px;
        font-size: 14px;
    }
    .messenger-lightbox__zoom-pct {
        min-width: 38px;
        font-size: 11px;
    }

    .messenger-context-menu {
        min-width: 220px;
        max-width: calc(100vw - 24px);
    }
    .messenger-context-menu__item {
        padding: 12px 14px;
        font-size: 14px;
    }
}

/* ═══ Media: dialog — touch-devices ═══════════════════════ */

@media (hover: none) and (pointer: coarse) {
    .messenger-lightbox__close {
        background: rgba(255, 255, 255, 0.08);
        opacity: 0.9;
    }
    .messenger-lightbox__close:hover {
        background: rgba(255, 255, 255, 0.08);
    }
    .messenger-lightbox__nav {
        background: rgba(255, 255, 255, 0.05);
        opacity: 0.75;
    }
    .messenger-lightbox__nav:hover {
        background: rgba(255, 255, 255, 0.05);
    }
    .messenger-lightbox__zoom button:hover {
        background: rgba(255, 255, 255, 0.06);
    }
    .messenger-lightbox__download:hover {
        filter: none;
    }
}

/* ============================================================
 * END OF FILE r40b-messages-dialog.css v1.0.0
 * ============================================================ */

/* ============================================================
 * r40c-messages-groups.css — Messenger: COMPOSE + GROUPS +
 *                            SETTINGS + CREATE + MEMBERS
 *
 * @version 1.0.0 (2026-10-13, CodingStyleCSS Phase 3.c — split):
 *   • 🟢 Выделено из r40-messages.css v1.14.0:
 *       • COMPOSE PAGE
 *       • GROUPS LIST
 *       • GROUP SETTINGS
 *       • GROUP CREATE
 *       • GROUP MEMBERS
 *   • ⚠️ .group-search__* — вынесена в r23-group-search.css
 *     (shared component, см. §40-messages). Публично не здесь.
 *   • ✅ Phase 1 правки сохранены.
 *
 * Зависимости: 01-variables.css, 10-buttons.css, 11-cards.css,
 *   12-forms.css, 13-badges.css, 16-avatars.css, 23-group-search.css.
 * ============================================================ */

/* ─────────────────────────────────────────────────────────
   COMPOSE PAGE
   ───────────────────────────────────────────────────────── */

.compose-page { display: block; }

.compose-header {
    margin: 0 0 16px;
    font-size: 22px;
    font-weight: 700;
}

.compose-search-card {
    padding: 16px;
    margin-bottom: 16px;
}

.compose-search-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.compose-search-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.compose-search-input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text);
    font-size: 16px;
}

.compose-search-spinner {
    padding: 10px;
    color: var(--muted);
}

.compose-search-hint {
    margin-top: 8px;
    font-size: 13px;
}

.compose-result { display: block; }

.compose-form-wrap { display: block; }

.compose-form-card { padding: 16px; }

.compose-form-title {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 600;
}

.compose-form-textarea {
    width: 100%;
    min-height: 100px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
}
.compose-form-textarea:focus {
    border-color: var(--primary);
    outline: none;
}

.compose-form-actions {
    margin-top: 10px;
    text-align: right;
}

.compose-user-card {
    padding: 16px;
    margin-bottom: 16px;
}
.compose-user-card__head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.compose-user-card__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
}
.compose-user-card__name {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.compose-user-card__meta {
    font-size: 13px;
}
.compose-user-card__actions {
    text-align: right;
}

.compose-hint-card {
    padding: 16px;
    margin-bottom: 16px;
}

/* ─────────────────────────────────────────────────────────
   GROUPS LIST
   ───────────────────────────────────────────────────────── */

.groups-page { display: block; }

.groups-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.groups-header__title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

.groups-header__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.groups-empty-action {
    margin-top: 12px;
}

/* ─────────────────────────────────────────────────────────
   GROUP SETTINGS
   ───────────────────────────────────────────────────────── */

.group-settings-page { display: block; }

.group-settings-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    font-size: 22px;
    font-weight: 700;
}

.group-settings-card {
    padding: 20px;
    max-width: 700px;
    margin: 0 auto;
}

.group-settings-section { display: block; }

.group-settings-section__title {
    margin: 0 0 12px;
    font-size: 17px;
    font-weight: 600;
}

.group-settings-avatar-row {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.group-settings-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
}

.group-settings-avatar-info {
    flex: 1;
    min-width: 200px;
}

.group-settings-avatar-upload {
    margin-top: 8px;
}

.group-settings-hint {
    font-size: 12px;
    margin-top: 6px;
}

.group-settings-divider {
    margin: 20px 0;
    border: none;
    border-top: 1px solid var(--border);
}

.group-settings-field {
    margin-bottom: 12px;
}

.group-settings-label {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
}

.group-settings-input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text);
}

.group-settings-textarea {
    width: 100%;
    min-height: 70px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
}

.group-settings-types {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.group-settings-type {
    flex: 1;
    min-width: 140px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    background: var(--card-bg);
    transition: border-color 0.15s ease, background 0.15s ease;
}
.group-settings-type:hover {
    border-color: var(--primary);
    background: var(--card-bg-hover);
}
.group-settings-type input[type="radio"] {
    margin-right: 4px;
}

.group-settings-type__title {
    display: inline-block;
    font-weight: 600;
}

.group-settings-type__hint {
    display: block;
    font-size: 12px;
    margin-top: 4px;
}

.group-settings-actions {
    text-align: right;
    margin-top: 6px;
}

.group-settings-footer {
    font-size: 12px;
    margin: 0;
}

/* ─────────────────────────────────────────────────────────
   GROUP CREATE
   ───────────────────────────────────────────────────────── */

.group-create-page { display: block; }

.group-create-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    font-size: 22px;
    font-weight: 700;
    flex-wrap: wrap;
}

.group-create-card {
    padding: 20px;
    max-width: 640px;
    margin: 0 auto;
}

.group-create-fieldset {
    border: none;
    padding: 0;
    margin: 0 0 16px;
}

.group-create-legend {
    font-size: 13px;
    margin-bottom: 6px;
}

.group-create-types {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.group-type-card {
    flex: 1;
    min-width: 140px;
    display: block;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    text-align: center;
    background: var(--card-bg);
    transition: border-color 0.15s ease, background 0.15s ease;
}
.group-type-card:hover {
    border-color: var(--primary);
    background: var(--card-bg-hover);
}
.group-type-card input[type="radio"] {
    margin-right: 4px;
}
.group-type-card__title {
    display: inline-block;
}
.group-type-card__hint {
    display: block;
    color: var(--muted);
    margin-top: 4px;
    font-size: 12px;
}

.group-create-field {
    margin-bottom: 16px;
}

.group-create-label {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
}

.group-create-input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text);
}

.group-create-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 12px;
    gap: 8px;
}

.group-create-error {
    color: var(--danger);
}
.group-create-error[hidden] {
    display: none;
}

.group-create-hint {
    font-size: 12px;
    margin-top: 6px;
}

.group-create-actions {
    text-align: right;
}

/* ─────────────────────────────────────────────────────────
   GROUP MEMBERS
   ───────────────────────────────────────────────────────── */

.group-members-page { display: block; }

.group-members-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    font-size: 22px;
    font-weight: 700;
    flex-wrap: wrap;
}

.group-members-card {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.group-members-section { display: block; }

.group-members-section__title {
    margin: 0 0 12px;
    font-size: 17px;
    font-weight: 600;
}

.group-members-divider {
    margin: 20px 0;
    border: none;
    border-top: 1px solid var(--border);
}

.group-members-add-form {
    margin-bottom: 0;
}

.group-members-hint {
    font-size: 12px;
    margin-top: 6px;
}

.group-members-add-btn {
    margin-top: 10px;
}

.group-members-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.group-members-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
}

.group-members-item__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.group-members-item__info {
    flex: 1;
    min-width: 0;
}

.group-members-item__name {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.group-members-item__meta {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.group-members-item__action {
    flex-shrink: 0;
}

.group-members-remove {
    color: var(--danger);
}

/* ⚠️ GROUP SEARCH (.group-search__*) — вынесено в
   assets/css/02-components/23-group-search.css (shared component). */

/* ═══ Media: groups — mobile ≤768px ══════════════════════ */

@media (max-width: 768px) {
    .compose-header { font-size: 20px; }

    .groups-header__title { font-size: 20px; }
    .group-settings-header,
    .group-create-header,
    .group-members-header { font-size: 20px; }
}

/* ============================================================
 * END OF FILE r40c-messages-groups.css v1.0.0
 * ============================================================ */

/* ============================================================
 * r40d-messages-search.css — Messenger: SEARCH PAGE
 *
 * @version 1.0.0 (2026-10-13, CodingStyleCSS Phase 3.c — split):
 *   • 🟢 Выделено из r40-messages.css v1.14.0 (SEARCH PAGE).
 *   • ✅ Phase 1 правки сохранены.
 *
 * Зависимости: 01-variables.css, 10-buttons.css, 11-cards.css.
 * ============================================================ */

.search-page { display: flex; flex-direction: column; gap: 0; }

.search-header {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.search-header__title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.search-card {
    padding: 16px;
    margin-bottom: 16px;
}

.search-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-form__input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text);
    font-size: 15px;
}
.search-form__input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.15);
}

.search-live {
    margin-top: 8px;
    font-size: 13px;
    min-height: 20px;
}

.search-empty {
    text-align: center;
    padding: 40px;
}
.search-empty__icon {
    font-size: 48px;
    margin-bottom: 12px;
    line-height: 1;
}
.search-empty__title {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 600;
}
.search-empty__text {
    margin: 0;
    line-height: 1.5;
}
.search-empty__hint {
    margin-top: 8px;
    font-size: 13px;
}

.search-warning {
    border-left: 4px solid var(--warning);
    padding: 14px 16px;
}

.search-summary {
    padding: 16px;
    margin-bottom: 16px;
    background: var(--card-bg-hover);
}
.search-summary__count {
    font-size: 15px;
}
.search-summary__query {
    margin-left: 4px;
}
.search-summary__terms {
    margin-top: 6px;
    font-size: 12px;
}
.search-summary__time {
    margin-top: 4px;
    font-size: 11px;
}

.search-mode-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}
.search-mode-badge--success { background: var(--success); }
.search-mode-badge--primary { background: var(--primary); }
.search-mode-badge--warning { background: var(--warning); }
.search-mode-badge--muted   { background: var(--muted); color: var(--text); }

.search-results {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-result {
    display: block;
    padding: 14px;
    text-decoration: none;
    color: inherit;
    border-left: 3px solid var(--primary);
    transition: transform 0.15s ease,
                box-shadow 0.15s ease;
}
.search-result[data-kind="group"] { border-left-color: var(--primary); }
.search-result[data-kind="mine"]  { border-left-color: var(--primary); }
.search-result[data-kind="other"] { border-left-color: var(--success); }

.search-result:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: inherit;
}

.search-result__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.search-result__author-wrap {
    flex: 1;
    min-width: 0;
}

.search-result__author {
    font-size: 15px;
    font-weight: 600;
}

.search-result__handle {
    font-weight: 400;
    font-size: 13px;
    margin-left: 6px;
}

.search-result__badge {
    margin-left: 8px;
}

.search-result__time {
    font-size: 12px;
    white-space: nowrap;
}

.search-result__body {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    word-wrap: break-word;
}

.search-result__relevance {
    margin-top: 6px;
    font-size: 11px;
}

.search-result__footer {
    margin-top: 8px;
    font-size: 12px;
}

mark.search-highlight {
    background: linear-gradient(120deg, #fde68a 0%, #fbbf24 100%);
    color: #1e2a3a;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 600;
    box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.4);
}
[data-theme="dark"] mark.search-highlight {
    background: linear-gradient(120deg, #f59e0b 0%, #d97706 100%);
    color: #1e2a3a;
}

/* ═══ Media: search — mobile ≤768px ══════════════════════ */

@media (max-width: 768px) {
    .search-header { margin-bottom: 16px; }
    .search-header__title { font-size: 18px; }
    .search-empty { padding: 32px 16px; }
    .search-empty__icon { font-size: 40px; }
}

/* ═══ Media: search — small ≤640px ═══════════════════════ */

@media (max-width: 640px) {
    .search-form {
        flex-wrap: wrap;
    }
    .search-form__input {
        min-width: 100%;
    }
}

/* ============================================================
 * END OF FILE r40d-messages-search.css v1.0.0
 * ============================================================ */

/* ============================================================
 * r41-contacts.css — Legacy: Contacts (единственное число)
 *                    (Phase 1 hygiene)
 *
 * @version 1.1.0 (2026-10-13, CodingStyleCSS Phase 1 hygiene):
 *   • 🟢 `.contact-card { transition: all 0.15s ease }` →
 *     `transition: box-shadow .15s ease, border-color .15s ease`
 *     (CodingStyleCSS §5.5 anti-pattern #1).
 *   • 🟢 `@media (max-width: 600px)` → `640px` (§6.2: удалены
 *     600/480/420).
 *
 * @version 1.0.1 (2026-10-07, ADR-0042 — переименован 21-contacts.css):
 *   • 🔴 ПЕРЕИМЕНОВАН 21-contacts.css → 41-contacts.css.
 *
 * @version 1.0.0 (T-0): базовый набор .contact-* (legacy).
 *
 * ⚠️ Не путать с 46-contacts.css (.contacts-* — множественное).
 * ⚠️ Кандидат на удаление в Phase 2 (проверить использование
 *    в templates — см. §12.2 п.6).
 * ============================================================ */

.contact-item {
    margin-bottom: 12px;
    transition: opacity 0.2s ease;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 2px 8px var(--shadow);
    /* 🟢 v1.1.0: было transition: all → explicit (§5.5). */
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.contact-card:hover {
    box-shadow: 0 4px 12px var(--shadow);
    border-color: var(--primary);
}

.contact-info {
    flex: 1;
    min-width: 0;
}

.contact-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
    color: var(--text);
}

.contact-handle,
.contact-code {
    font-size: 13px;
    color: var(--muted);
    font-family: var(--geek-mono);
}

.contact-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Адаптивность контактов.
   🟢 v1.1.0: 600px → 640px (канонический breakpoint). */
@media (max-width: 640px) {
    .contact-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .contact-actions {
        width: 100%;
    }

    .contact-actions .btn {
        flex: 1;
    }
}

/* ============================================================
 * END OF FILE r41-contacts.css v1.1.0
 * ============================================================ */

/* ============================================================
 * r42-reactions.css — Реакции на сообщения (Phase 1 hygiene)
 *
 * @version 4.4.0 (2026-10-13, CodingStyleCSS Phase 1 hygiene):
 *   • 🟢 `.reaction-btn { transition: all .15s ease }` →
 *     `transition: background .15s ease, border-color .15s ease,
 *      transform .15s ease` (§5.5 anti-pattern #1).
 *   • 🟢 `.reaction-add-btn { transition: all .15s ease }` →
 *     `transition: opacity .15s ease, background .15s ease,
 *      color .15s ease, border-color .15s ease, transform .15s ease`.
 *   • 🟢 `@media (max-width: 600px)` → `640px` (§6.2).
 *
 * @version 4.3.1 (2026-10-07, ADR-0042 — переименован 22-reactions.css):
 *   • 🔴 ПЕРЕИМЕНОВАН 22-reactions.css → 42-reactions.css.
 *
 * @version 4.3.0 (2026-10-05, T-3 finalization — DoD-6 fix):
 *   • 🔴 FIX: убран `!important` из `.reaction-add-btn:hover`.
 *
 * @version 4.2.0 (2026-09-25): предыдущая версия.
 *
 * Зависимости: 01-variables.css (--chat-*, --radius-full,
 *   --geek-mono).
 * ============================================================ */

/* Контейнер реакций — под текстом, над footer */
.message-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
    align-items: center;
    position: relative;
    max-width: 100%;
    min-height: 28px;
}

/* Пилюля реакции (👍 3) */
.reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border: 1px solid var(--chat-border);
    background: var(--chat-overlay);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 12px;
    line-height: 1.4;
    /* 🟢 v4.4.0: было transition: all → explicit (§5.5). */
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
    color: var(--chat-text);
    font-family: var(--geek-mono);
}

.reaction-btn:hover {
    background: var(--chat-overlay-hover);
    border-color: var(--chat-accent);
    transform: translateY(-1px);
}

.reaction-btn:active {
    transform: translateY(0);
}

/* Своя реакция — акцентная */
.reaction-btn.mine {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.reaction-btn.mine:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    opacity: 0.95;
}

.reaction-emoji {
    font-size: 14px;
    line-height: 1;
}

.reaction-count {
    font-size: 11px;
    font-weight: 600;
    min-width: 10px;
    text-align: center;
    font-family: var(--geek-mono);
}

/* Кнопка "+" (появляется при hover на сообщение) */
.reaction-add-btn {
    width: 24px;
    height: 24px;
    border: 1px dashed var(--chat-border);
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    color: var(--chat-muted);
    /* 🟢 v4.4.0: было transition: all → explicit (§5.5). */
    transition: opacity 0.15s ease, background 0.15s ease,
                color 0.15s ease, border-color 0.15s ease,
                transform 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    padding: 0;
    line-height: 1;
}

.message:hover .reaction-add-btn {
    opacity: 0.7;
}

.message .reaction-add-btn:hover {
    opacity: 1;
    background: var(--chat-overlay-hover);
    color: var(--chat-accent);
    border-style: solid;
    border-color: var(--chat-accent);
    transform: scale(1.1);
}

/* Пикер эмодзи — всплывает НАД реакциями */
.reaction-picker {
    position: absolute;
    bottom: calc(100% + 4px);
    left: 0;
    background: var(--chat-header-bg);
    border: 1px solid var(--chat-border);
    border-radius: var(--radius);
    padding: 6px 8px;
    display: flex;
    gap: 2px;
    box-shadow: 0 4px 16px var(--shadow-lg);
    z-index: 20;
    animation: reactionPickerIn 0.15s ease;
    backdrop-filter: blur(4px);
}

@keyframes reactionPickerIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Кнопка эмодзи в пикере */
.reaction-pick {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: transform 0.1s ease, background 0.1s ease;
    padding: 0;
    line-height: 1;
}

.reaction-pick:hover {
    background: var(--chat-overlay-hover);
    transform: scale(1.25);
}

.reaction-pick:active {
    transform: scale(1.1);
}

/* ═══ ВЫРАВНИВАНИЕ ДЛЯ СВОИХ/ЧУЖИХ СООБЩЕНИЙ ════════════ */

.message-mine .message-reactions {
    justify-content: flex-end;
}

.message-mine .reaction-picker {
    left: auto;
    right: 0;
}

.message-mine .reaction-add-btn {
    order: -1;
    margin-right: 2px;
}

.message-other .reaction-add-btn {
    margin-left: 2px;
}

/* ═══ АДАПТИВНОСТЬ ══════════════════════════════════════ */

/* 🟢 v4.4.0: 600px → 640px (канонический breakpoint). */
@media (max-width: 640px) {
    .reaction-picker {
        flex-wrap: wrap;
        max-width: 220px;
        padding: 4px 6px;
    }

    .reaction-pick {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }

    .reaction-add-btn {
        opacity: 0.7;
    }

    .reaction-btn {
        padding: 2px 6px;
        font-size: 11px;
    }

    .reaction-emoji {
        font-size: 13px;
    }

    .reaction-count {
        font-size: 10px;
    }
}

/* ═══ АНИМАЦИЯ ПОЯВЛЕНИЯ НОВОЙ РЕАКЦИИ ═══════════════════ */

@keyframes reactionPop {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.reaction-btn {
    animation: reactionPop 0.2s ease;
}

/* ============================================================
 * END OF FILE r42-reactions.css v4.4.0
 * ============================================================ */

/* ============================================================
 * r43-attachments.css — Вложения в сообщениях (SSOT)
 *                       (Phase 1 hygiene)
 *
 * @version 4.4.0 (2026-10-13, CodingStyleCSS Phase 1 hygiene):
 *   • 🟢 `.attachment-file, .attachment-file-link { transition: all
 *     .15s ease }` → `transition: background .15s ease,
 *     border-color .15s ease, color .15s ease,
 *     transform .15s ease` (§5.5 anti-pattern #1).
 *   • 🟢 `@media (max-width: 600px)` → `640px` (§6.2).
 *
 * @version 4.3.1 (2026-10-07, ADR-0042 — переименован 23-attachments.css):
 *   • 🔴 ПЕРЕИМЕНОВАН 23-attachments.css → 43-attachments.css.
 *
 * @version 4.3.0 (2026-10-04, T-3, ADR-0042):
 *   • SSOT для всех стилей вложений.
 *   • Перенесено из 20-messages.css v1.8.0.
 *   • Разрешён конфликт .message-attachments.
 *   • Перенесён mobile-override .attachment-download-btn { opacity: 1 }.
 *
 * @version 4.2.1: предыдущая версия.
 *
 * Зависимости: 01-variables.css (--radius, --chat-*, --shadow-lg,
 *   --danger, --warning, --geek-mono).
 * ============================================================ */

/* ═══ Container ═══════════════════════════════════════════ */

.message-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    max-width: 100%;
}

/* ═══ Image attachment ════════════════════════════════════ */

.attachment-image-wrap {
    position: relative;
    display: inline-block;
    line-height: 0;
    border-radius: var(--radius);
    overflow: hidden;
    max-width: 100%;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.attachment-image,
.attachment-image-link {
    display: inline-block;
    line-height: 0;
    text-decoration: none;
    max-width: 240px;
    max-height: 240px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--chat-border);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    -webkit-touch-callout: none;
}

.attachment-image:hover,
.attachment-image-link:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px var(--shadow-lg);
}

.attachment-image img,
.attachment-image-link img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 240px;
    cursor: zoom-in;
    transition: filter 0.15s ease;
    -webkit-user-drag: none;
}

.attachment-image:hover img,
.attachment-image-link:hover img {
    filter: brightness(0.92);
    text-decoration: none;
}

.attachment-download-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 15px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease;
    z-index: 2;
    -webkit-tap-highlight-color: transparent;
}

.attachment-image-wrap:hover .attachment-download-btn,
.attachment-download-btn:focus-visible {
    opacity: 1;
}

.attachment-download-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    text-decoration: none;
}

/* ═══ File attachment ═════════════════════════════════════ */

.attachment-file,
.attachment-file-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--chat-overlay);
    border: 1px solid var(--chat-border);
    border-radius: var(--radius);
    color: var(--chat-text);
    text-decoration: none;
    max-width: 280px;
    /* 🟢 v4.4.0: было transition: all → explicit (§5.5). */
    transition: background 0.15s ease, border-color 0.15s ease,
                color 0.15s ease, transform 0.15s ease;
    font-family: var(--geek-mono);
    font-size: 12px;
    -webkit-touch-callout: none;
}

.attachment-file:hover,
.attachment-file-link:hover {
    background: var(--chat-overlay-hover);
    border-color: var(--chat-accent);
    color: var(--chat-accent);
    text-decoration: none;
    transform: translateY(-1px);
}

.attachment-file .att-icon {
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
}

.attachment-file .att-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.attachment-file .att-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
}

.attachment-file .att-size {
    font-size: 10px;
    color: var(--chat-muted);
    opacity: 0.8;
}

.attachment-file .att-dl-hint {
    margin-left: 6px;
    opacity: 0.4;
    font-size: 13px;
    flex-shrink: 0;
    transition: opacity 0.15s ease;
}

.attachment-file:hover .att-dl-hint {
    opacity: 1;
}

/* ═══ Preview (before send) ══════════════════════════════ */

.attachment-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    width: 100%;
}

.att-preview-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 28px 6px 6px;
    background: var(--chat-header-bg);
    border: 1px solid var(--chat-border);
    border-radius: var(--radius-sm);
    max-width: 220px;
    font-size: 11px;
    animation: attachmentIn 0.2s ease;
}

@keyframes attachmentIn {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1); }
}

.att-preview-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.att-preview-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--chat-overlay);
    border-radius: 4px;
    font-size: 20px;
    flex-shrink: 0;
}

.att-preview-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
    font-family: var(--geek-mono);
}

.att-preview-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 11px;
    color: var(--chat-text);
}

.att-preview-size {
    font-size: 10px;
    color: var(--chat-muted);
}

.att-preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border: none;
    background: var(--danger);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
}

.att-preview-remove:hover {
    transform: scale(1.15);
}

.att-preview-warning {
    padding: 4px 8px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--warning);
    border-radius: var(--radius-sm);
    color: var(--warning);
    font-size: 11px;
    font-family: var(--geek-mono);
}

/* ═══ Mobile ══════════════════════════════════════════════
   🟢 v4.4.0: 600px → 640px (канонический breakpoint). */

@media (max-width: 640px) {
    .attachment-image,
    .attachment-image-link { max-width: 180px; max-height: 180px; }
    .attachment-file,
    .attachment-file-link  { max-width: 220px; padding: 6px 10px; }
    .att-preview-card      { max-width: 180px; }

    .attachment-download-btn { opacity: 1; }
}

/* ============================================================
 * END OF FILE r43-attachments.css v4.4.0
 * ============================================================ */

/* ============================================================
 * r44-logs.css — Admin Log Browser (Phase 5b/5c, ADR-0041)
 *               (Phase 1 + Phase 2 consolidation)
 *
 * @version 1.5.0 (2026-10-13, CodingStyleCSS Phase 2):
 *   • 🟢 `.btn-xs` УДАЛЁН — перенесён в `r10-buttons.css` v1.3.0
 *     как BEM-канон `.btn--xs` (§13.2 п.16). Здесь остаётся только
 *     legacy `@deprecated .btn-xs` shim в r10 для совместимости.
 *   • ✅ Phase 1 правки сохранены.
 *
 * @version 1.4.0 (2026-10-13, CodingStyleCSS Phase 1 hygiene):
 *   • 🟢 `@deprecated .btn-xs` — помечен.
 *   • 🟢 `var(--geek-mono, monospace)` → `var(--geek-mono)`.
 *
 * @version 1.3.0 (2026-10-08, ADR-0044 R-4 — миграция на Templates SSOT).
 * @version 1.2.2 (2026-10-07, ADR-0042 — переименован 24-logs.css).
 * @version 1.2.1 (2026-10-03).
 * @version 1.2.0 / 1.1.0.
 *
 * Зависимости: 01-variables.css, 10-buttons.css (для .btn--xs),
 *   11-cards.css, 13-badges.css.
 * ============================================================ */

.logs-page h1 {
    margin-bottom: 6px;
}

.logs-page__lead {
    margin-bottom: 16px;
}

.logs-empty {
    text-align: center;
    padding: 24px 0;
    font-style: italic;
}

.logs-inline-form {
    display: inline;
}

.logs-code--sm {
    font-size: 0.85rem;
}

.logs-date-range {
    font-size: 0.85rem;
}

/* Фиксированные ширины th (были inline style="width:...") */
.logs-table__th--time      { width: 150px; }
.logs-table__th--lvl       { width: 90px; }
.logs-table__th--chan      { width: 100px; }
.logs-table__th--evt       { width: 180px; }
.logs-table__th--evt-sm    { width: 200px; }
.logs-table__th--files     { width: 80px; }
.logs-table__th--size      { width: 120px; }
.logs-table__th--range     { width: 140px; }
.logs-table__th--retention { width: 90px; }
.logs-table__th--actions   { width: 120px; }
.logs-table__th--date      { width: 120px; }

/* ─── Summary cards ───────────────────────────────────── */
.logs-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.logs-summary__item {
    text-align: center;
    padding: 12px 8px;
}
.logs-summary__value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}
.logs-summary__label {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-top: 4px;
}

/* ═══ Errors Panel ═════════════════════════════════════════ */
.logs-errors {
    margin-bottom: 16px;
    border-left: 4px solid var(--warning);
}
.logs-errors--clean { border-left-color: var(--success); }
.logs-errors--alert { border-left-color: var(--danger); }

.logs-errors__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.logs-errors__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}
.logs-errors__period {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 400;
}
.logs-errors__badge {
    display: inline-block;
    min-width: 28px;
    padding: 2px 8px;
    border-radius: 12px;
    background: var(--card-bg-hover);
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    color: var(--text);
}
.logs-errors--alert .logs-errors__badge { background: #fee2e2; color: #991b1b; }
.logs-errors--clean .logs-errors__badge { background: #dcfce7; color: #166534; }
.logs-errors__head-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.logs-errors__aggregates {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 12px;
}
.logs-errors__agg-block {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}
.logs-errors__agg-label {
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 600;
}
.logs-errors__empty {
    padding: 14px 4px;
    color: var(--muted);
    font-size: 0.9rem;
}
.logs-errors__more {
    padding: 10px 0 0;
    font-size: 0.9rem;
    color: var(--muted);
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.logs-table--errors { font-size: 0.82rem; margin-top: 4px; }
.logs-table--errors tbody td { padding: 6px 10px; }

.logs-row--error     > td { background: rgba(220, 38, 38, 0.04); }
.logs-row--critical  > td { background: rgba(220, 38, 38, 0.08); }
.logs-row--alert     > td { background: rgba(220, 38, 38, 0.12); }
.logs-row--emergency > td { background: rgba(220, 38, 38, 0.16); font-weight: 500; }

.logs-cell-time {
    font-family: var(--geek-mono);
    color: var(--muted);
    white-space: nowrap;
}
.logs-cell-event code { color: var(--text); font-weight: 600; }
.logs-cell-context {
    font-family: var(--geek-mono);
    font-size: 0.76rem;
    word-break: break-word;
    line-height: 1.5;
}

.logs-badge--error     { background: #fee2e2; color: #991b1b; }
.logs-badge--critical  { background: #fecaca; color: #7f1d1d; font-weight: 600; }
.logs-badge--alert     { background: #fca5a5; color: #7f1d1d; font-weight: 600; }
.logs-badge--emergency { background: #dc2626; color: #fff;    font-weight: 700; }

/* ─── Filters ─────────────────────────────────────────── */
.logs-filters__title { margin: 0 0 12px; font-size: 1.05rem; }
.logs-filters__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}
.logs-field { display: flex; flex-direction: column; gap: 4px; }
.logs-field--narrow { max-width: 110px; }
.logs-field--wide { grid-column: span 2; }
.logs-field--check {
    flex-direction: row;
    align-items: center;
    gap: 6px;
    align-self: end;
    padding-bottom: 6px;
    font-size: 0.9rem;
}
.logs-field__label {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
}
.logs-field__input {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg-hover);
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
}
.logs-field__input:focus { outline: none; border-color: var(--primary); }
.logs-filters__actions { margin-top: 14px; display: flex; gap: 8px; }

/* ─── Stats ───────────────────────────────────────────── */
.logs-stats__row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    text-align: center;
}
.logs-stats__value { font-size: 1.4rem; font-weight: 700; color: var(--primary); }
.logs-stats__value--error { color: var(--danger); }
.logs-stats__label {
    font-size: 0.72rem;
    text-transform: uppercase;
    color: var(--muted);
    letter-spacing: 0.4px;
}

/* ─── Toolbar ─────────────────────────────────────────── */
.logs-toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.logs-live { display: flex; align-items: center; gap: 6px; font-size: 0.9rem; font-weight: 600; }
.logs-live input[type="checkbox"] { accent-color: var(--primary); }
.logs-count { color: var(--muted); font-size: 0.85rem; margin-left: auto; }
.logs-toolbar__actions { display: flex; gap: 6px; }

/* ─── Table ───────────────────────────────────────────── */
.logs-results { padding: 0; }
.logs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.logs-table thead th {
    background: var(--card-bg-hover);
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 2;
}
.logs-table tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.logs-table tbody tr:hover td { background: var(--card-bg-hover); }
.logs-table__empty {
    text-align: center;
    padding: 32px 12px;
    color: var(--muted);
    font-style: italic;
}
.logs-td--ts { font-family: var(--geek-mono); color: var(--muted); white-space: nowrap; }
.logs-td--chan code { color: var(--muted); }
.logs-td--msg code { color: var(--text); font-weight: 600; }
.logs-td--ctx {
    font-family: var(--geek-mono);
    font-size: 0.78rem;
    word-break: break-word;
    line-height: 1.5;
}
.logs-ctx__k { color: var(--primary); }
.logs-ctx__v { color: var(--text); }

/* ─── Level badges ────────────────────────────────────── */
.logs-lvl {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    background: var(--card-bg-hover);
    color: var(--text);
}
.logs-lvl--debug     { background: #1e293b; color: #94a3b8; }
.logs-lvl--info      { background: #075985; color: #bae6fd; }
.logs-lvl--notice    { background: #1e40af; color: #bfdbfe; }
.logs-lvl--warning   { background: #78350f; color: #fed7aa; }
.logs-lvl--error     { background: #7f1d1d; color: #fecaca; }
.logs-lvl--critical  { background: #991b1b; color: #fff; }
.logs-lvl--alert     { background: #9a3412; color: #fff; }
.logs-lvl--emergency { background: #dc2626; color: #fff; }

/* ─── Pagination ──────────────────────────────────────── */
.logs-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-top: 1px solid var(--border);
}
.logs-pagination__info { font-size: 0.85rem; color: var(--muted); }

/* ─── Channels & files ────────────────────────────────── */
.logs-channels h2,
.logs-files h2 {
    margin: 0 0 12px;
    font-size: 1.1rem;
}

/* 🟢 v1.5.0: `.btn-xs` удалён — переехал в `r10-buttons.css`
   как BEM-канон `.btn--xs` (§13.2 п.16). Здесь больше не определён. */

/* ─── Mobile ──────────────────────────────────────────── */
@media (max-width: 640px) {
    .logs-filters__grid { grid-template-columns: 1fr 1fr; }
    .logs-field--wide { grid-column: span 2; }
    .logs-toolbar { gap: 8px; }
    .logs-count { margin-left: 0; width: 100%; }
    .logs-table thead { display: none; }
    .logs-table tbody td { display: block; padding: 4px 12px; }
    .logs-td--ts { font-size: 0.75rem; }
    .logs-errors__head { align-items: flex-start; }
}

/* ============================================================
 * END OF FILE r44-logs.css v1.5.0
 * ============================================================ */

/* ============================================================
 * r45-profile.css — Profile page (BEM)
 *                   (Phase 1 hygiene)
 *
 * @version 1.1.0 (2026-10-13, CodingStyleCSS Phase 1 hygiene):
 *   • 🟢 `@media (max-width: 600px)` → `640px` (§6.2).
 *
 * @version 1.0.1 (2026-10-07, ADR-0042 — переименован 25-profile.css):
 *   • 🔴 ПЕРЕИМЕНОВАН 25-profile.css → 45-profile.css.
 *
 * @version 1.0.0 (2026-10-06, P2 — DoD-10 cleanup):
 *   • 🆕 Новый файл. Все классы .profile-* из
 *     templates/03-modules/users/profile.php v1.0.1.
 *
 * Зависимости: 01-variables.css, 12-forms.css (.form-input),
 *   16-avatars.css.
 * ============================================================ */

.profile-page {
    display: block;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 20px;
}

.profile-header__avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.profile-header__name {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    word-break: break-word;
}

.profile-header__handle {
    font-size: 0.9rem;
}

/* ─── Cards ──────────────────────────────────────────── */

.profile-card {
    padding: 20px;
}

.profile-card__title {
    margin: 0 0 14px;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.profile-card__title-hint {
    font-size: 13px;
    font-weight: 400;
}

/* ─── Grid ───────────────────────────────────────────── */

.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.profile-grid--wide {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* ─── Labels ─────────────────────────────────────────── */

.profile-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
}

.profile-label--inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Marker-class. Стили приходят из .form-input / .form-select. */
.profile-input {
}

.profile-field-hint {
    display: block;
    font-size: 12px;
    margin-top: 3px;
}

/* ─── Actions ────────────────────────────────────────── */

.profile-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

/* ─── Handle row ─────────────────────────────────────── */

.profile-handle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px;
    background: var(--card-bg-hover);
    border-radius: var(--radius);
    margin-top: 8px;
    font-size: 13px;
}

.profile-handle-row__value {
    font-family: var(--geek-mono);
    font-size: 14px;
    padding: 3px 8px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.profile-handle-row__hint {
    font-size: 12px;
}

/* ─── Timezone info ─────────────────────────────────── */

.profile-tz-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    background: var(--card-bg-hover);
    border-radius: var(--radius);
    margin-bottom: 14px;
    font-size: 13px;
    line-height: 1.5;
}

.profile-tz-info code {
    font-family: var(--geek-mono);
    font-size: 12px;
    padding: 1px 5px;
    background: var(--card-bg);
    border-radius: 3px;
    border: 1px solid var(--border);
}

.profile-tz-hint {
    font-size: 12px;
    line-height: 1.5;
    margin: 14px 0 0;
}

/* ─── Avatar row ─────────────────────────────────────── */

.profile-avatar-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.profile-avatar-row__img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.profile-avatar-upload {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.profile-avatar-upload__input {
    display: none;
}

/* ─── Devices & sessions ─────────────────────────────── */

.profile-devices-summary {
    margin: 0 0 8px;
    font-size: 14px;
}

.profile-devices-summary__value {
    font-size: 16px;
    color: var(--primary);
    font-weight: 700;
}

.profile-devices-descr {
    margin: 0 0 14px;
    font-size: 13px;
    line-height: 1.5;
}

.profile-sessions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.profile-session {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--card-bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.profile-session--current {
    border-color: var(--primary);
    background: rgba(47, 111, 237, 0.06);
}

.profile-session__icon {
    font-size: 22px;
    flex-shrink: 0;
    line-height: 1;
}

.profile-session__info {
    flex: 1;
    min-width: 0;
}

.profile-session__device {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.profile-session__badge {
    font-size: 12px;
    font-weight: 400;
}

.profile-session__meta {
    font-size: 12px;
    line-height: 1.4;
}

.profile-session__action {
    flex-shrink: 0;
    display: inline;
    margin: 0;
}

.profile-session__revoke {
    color: var(--danger);
}

.profile-session__revoke:hover {
    background: var(--card-bg);
    border-color: var(--danger);
    color: var(--danger);
}

.profile-session__revoke-all {
    color: var(--danger);
}

.profile-sessions-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

/* ─── Mobile ───────────────────────────────────────────
   🟢 v1.1.0: 600px → 640px (канонический breakpoint). */

@media (max-width: 640px) {
    .profile-header__name {
        font-size: 1.2rem;
    }

    .profile-handle-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-session {
        flex-wrap: wrap;
    }

    .profile-session__action {
        width: 100%;
    }

    .profile-session__action .btn {
        width: 100%;
    }
}

/* ============================================================
 * END OF FILE r45-profile.css v1.1.0
 * ============================================================ */

/* ============================================================
 * r46-contacts.css — Contacts page (BEM, множественное число)
 *                   (Phase 1 hygiene)
 *
 * @version 1.1.0 (2026-10-13, CodingStyleCSS Phase 1 hygiene):
 *   • 🟢 `@media (max-width: 600px)` → `640px` (§6.2).
 *
 * @version 1.0.1 (2026-10-07, ADR-0042 — переименован 26-contacts.css):
 *   • 🔴 ПЕРЕИМЕНОВАН 26-contacts.css → 46-contacts.css.
 *     Причина: коллизия номера 26 с 02-components/26-admin-nav.css
 *     (уже сдвинут в 20-admin-nav.css).
 *
 * @version 1.0.0 (2026-10-06, P2 — DoD-10 cleanup):
 *   • 🆕 Новый файл. Все классы .contacts-* из
 *     templates/03-modules/users/contacts.php v1.0.1.
 *
 * ⚠️ Не путать с 41-contacts.css (legacy .contact-* — един. число,
 *    старые Views). Файлы не конфликтуют.
 *
 * Зависимости: 01-variables.css, 10-buttons.css, 12-forms.css.
 * ============================================================ */

.contacts-page {
    display: block;
}

.contacts-header {
    margin: 0 0 20px;
    font-size: 1.5rem;
    font-weight: 700;
}

/* ─── Search card ────────────────────────────────────── */

.contacts-search-card {
    padding: 16px;
    margin-bottom: 16px;
}

.contacts-search-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.contacts-search-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.contacts-search-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
}

.contacts-search-input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.15);
}

.contacts-search-spinner {
    padding: 0 8px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1;
}

.contacts-search-hint {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.5;
}

/* ─── Section title ──────────────────────────────────── */

.contacts-section-title {
    margin: 20px 0 12px;
    font-size: 1.1rem;
    font-weight: 600;
}

/* ─── Grid of cards ──────────────────────────────────── */

.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

/* ─── Contact card ───────────────────────────────────── */

.contacts-card {
    padding: 14px;
    margin-bottom: 0;
}

.contacts-card__head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.contacts-card__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--card-bg-hover);
}

.contacts-card__info {
    flex: 1;
    min-width: 0;
}

.contacts-card__name {
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contacts-card__handle {
    font-size: 12px;
    font-family: var(--geek-mono);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contacts-card__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.contacts-card__write {
    flex: 1;
    justify-content: center;
}

/* ─── Pagination ─────────────────────────────────────── */

.contacts-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.contacts-pagination__current {
    background: var(--primary);
    color: #fff;
    border: 1px solid var(--primary);
    font-weight: 600;
    cursor: default;
}

.contacts-pagination__current:hover {
    background: var(--primary);
    color: #fff;
    transform: none;
}

/* ─── Empty ──────────────────────────────────────────── */

.contacts-empty {
    padding: 24px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

/* ─── Mobile ───────────────────────────────────────────
   🟢 v1.1.0: 600px → 640px (канонический breakpoint). */

@media (max-width: 640px) {
    .contacts-grid {
        grid-template-columns: 1fr;
    }

    .contacts-search-row {
        flex-wrap: wrap;
    }

    .contacts-search-input {
        min-width: 100%;
    }
}

/* ============================================================
 * END OF FILE r46-contacts.css v1.1.0
 * ============================================================ */

/* ============================================================
 * 47-devices.css — Devices page (BEM)
 *
 * @version 1.0.1 (2026-10-07, hotfix — недостающие селекторы):
 *   • 🔴 FIX: добавлены .devices-empty, .devices-page__badge-ndp —
 *     были использованы в devices.php v1.0.0/v1.0.1, но не определены
 *     в CSS v1.0.0 (R12 violation).
 *
 * @version 1.0.0 (2026-10-07, ADR-0042 + ADR-0044 — sidebar rollout R-2):
 *   • 🆕 Новый файл. Все классы .devices-* / .device-* / .ndp-* / .battery
 *     из templates/03-modules/users/devices.php.
 *   • Заменяет ~120 inline-стилей из legacy Views/user_devices.php.
 * ============================================================ */

/* ---------- Page wrapper ---------- */

.devices-page__title {
    margin: 0 0 4px;
}

.devices-page__lead {
    margin: 0 0 20px;
    font-size: 14px;
}

/* 🆕 v1.0.1 */
.devices-page__badge-ndp {
    opacity: 0.7;
    font-size: 10px;
}

/* 🆕 v1.0.1 */
.devices-empty {
    text-align: center;
    padding: 24px 0;
}

/* ---------- Summary card ---------- */

.devices-summary {
    padding: 16px;
    margin-bottom: 16px;
}

.devices-summary__row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.devices-summary__title {
    font-weight: 600;
}

.devices-summary__hint {
    font-size: 13px;
    margin-top: 2px;
}

/* ---------- Devices grid ---------- */

.devices-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 24px;
}

.device-card {
    padding: 14px;
}

.device-card--current {
    border-left: 4px solid var(--primary);
}

.device-card__row {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.device-card__icon {
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
}

.device-card__body {
    flex: 1;
    min-width: 220px;
}

.device-card__title {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.device-card__ip {
    font-size: 13px;
    margin-top: 4px;
}

.device-card__meta {
    font-size: 12px;
    margin-top: 2px;
}

.device-card__actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.device-card__badge--current {
    background: var(--primary);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
}

/* ---------- NDP section ---------- */

.devices-ndp {
    padding: 16px;
    margin-bottom: 24px;
}

.devices-ndp__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.devices-ndp__title {
    margin: 0 0 4px;
}

.devices-ndp__desc {
    margin: 0;
    font-size: 13px;
}

.devices-ndp__empty {
    margin-top: 16px;
    text-align: center;
    padding: 20px 0;
}

.devices-ndp__warn {
    font-size: 12px;
    margin-top: 10px;
    padding: 8px 10px;
    background: var(--surface);
    border-left: 3px solid var(--warning);
    border-radius: 4px;
}

.devices-ndp__hint {
    font-size: 11px;
    margin-top: 10px;
}

/* ---------- NDP table ---------- */

.ndp-table-wrap {
    overflow-x: auto;
    margin-top: 12px;
}

.ndp-table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
}

.ndp-table__head {
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.ndp-table__th {
    padding: 6px 8px;
    font-weight: 600;
}

.ndp-table__th--right {
    text-align: right;
}

.ndp-table__row {
    border-bottom: 1px solid var(--border);
}

.ndp-table__row--current {
    background: rgba(56, 189, 248, 0.05);
}

.ndp-table__cell {
    padding: 8px;
}

.ndp-table__cell--sm {
    font-size: 12px;
}

.ndp-table__cell--xs {
    font-size: 11px;
}

.ndp-table__cell--mono {
    font-family: var(--geek-mono);
}

.ndp-table__cell--nowrap {
    white-space: nowrap;
}

.ndp-table__cell--actions {
    text-align: right;
    white-space: nowrap;
}

/* ---------- Lag indicator ---------- */

.ndp-lag {
    font-size: 11px;
    margin-top: 2px;
}

.ndp-lag--ok       { color: var(--success); }
.ndp-lag--soft     { color: var(--warning); }
.ndp-lag--hard     { color: var(--danger); }
.ndp-lag--critical { color: var(--danger); font-weight: 600; }

/* ---------- Session ID ---------- */

.ndp-session-id {
    font-family: var(--geek-mono);
    font-size: 10px;
    margin-bottom: 4px;
}

/* ---------- Capabilities ---------- */

.ndp-caps {
    font-family: var(--geek-mono);
    font-size: 11px;
    color: var(--muted);
    cursor: help;
}

/* ---------- Battery (text-only, color-coded — R7' compliant) ---------- */

.battery {
    font-family: var(--geek-mono);
    font-size: 11px;
    font-weight: 600;
}

.battery--high { color: var(--success); }
.battery--mid  { color: var(--warning); }
.battery--low  { color: var(--danger); }

/* ---------- Login history ---------- */

.devices-history {
    padding: 16px;
}

.devices-history__title {
    margin-top: 0;
}

.history-table-wrap {
    overflow-x: auto;
}

.history-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
}

.history-table__head {
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.history-table__th {
    padding: 6px 8px;
    font-weight: 600;
}

.history-table__row {
    border-bottom: 1px solid var(--border);
}

.history-table__cell {
    padding: 6px 8px;
}

.history-table__cell--nowrap {
    white-space: nowrap;
}

.history-table__cell--mono {
    font-family: var(--geek-mono);
    font-size: 12px;
}

.history-table__cell--sm {
    font-size: 13px;
}

/* ---------- Footer actions ---------- */

.devices-footer {
    margin-top: 16px;
}

/* ============================================================
 * END OF FILE 47-devices.css v1.0.1
 * ============================================================ */

/* ============================================================
 * r50-auth.css — Auth pages + Magic links (BEM)
 *                (Phase 1 + Phase 3.a)
 *
 * @version 1.2.0 (2026-10-13, CodingStyleCSS Phase 3):
 *   • 🟢 `.auth-error` и `.auth-error-message` помечены
 *     `@deprecated 1.2.0 — remove after Phase 3`
 *     (§13.3: унификация с каноном `.alert.alert--error`).
 *     Визуал сохранён. План: шаблоны auth-страниц мигрируют
 *     на `<div class="alert alert--error">…</div>`, после чего
 *     эти правила удаляются.
 *   • ✅ Phase 1 (600 → 640) сохранён.
 *
 * @version 1.1.0 (2026-10-13, CodingStyleCSS Phase 1 hygiene):
 *   • 🟢 `@media (max-width: 600px)` → `640px` (§6.2).
 *
 * @version 1.0.1 (2026-10-07, ADR-0042 — переименован 30-auth.css).
 * @version 1.0.0 (2026-10-06, P2 — DoD-10 cleanup).
 *
 * Зависимости: 01-variables.css, 10-buttons.css, 11-cards.css,
 *   18-alert.css (для канонической унификации).
 * ============================================================ */

/* ═══ PART 1. AUTH ════════════════════════════════════════ */

.auth-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0;
}

.auth-page--left {
    align-items: flex-start;
}

.auth-page__title {
    margin: 0 0 16px;
    font-size: 1.5rem;
    font-weight: 700;
}

.auth-card {
    width: 100%;
    padding: 24px;
    margin-bottom: 0;
}

.auth-card--sm {
    max-width: 420px;
}

.auth-card--md {
    max-width: 450px;
}

.auth-card--left {
    margin-left: 0;
    text-align: left;
}

.auth-card__title {
    margin: 0 0 16px;
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
}

.auth-card__subtitle {
    margin: -8px 0 16px;
    font-size: 13px;
    text-align: center;
}

/* ─── Error box (с левой полосой) ──────────────────────
   @deprecated 1.2.0 — remove after Phase 3
   (§13.3: унификация с каноном .alert.alert--error из 18-alert.css).
   План миграции шаблонов:
     <div class="auth-error">…</div>
     → <div class="alert alert--error">…</div>
   После миграции — удалить это правило. */

.auth-error {
    padding: 10px 14px;
    margin-bottom: 14px;
    background: rgba(239, 68, 68, 0.08);
    border-left: 4px solid var(--danger);
    border-radius: var(--radius-sm);
    color: var(--danger);
    font-size: 13px;
    line-height: 1.4;
}

/* @deprecated 1.2.0 — remove after Phase 3
   (аналогично .auth-error; см. выше). */

.auth-error-message {
    margin: 0;
    padding: 12px 0;
    color: var(--danger);
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
}

/* ─── Form ───────────────────────────────────────────── */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.auth-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.auth-actions .btn {
    width: 100%;
    justify-content: center;
}

.auth-actions--row {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.auth-actions--row .btn {
    width: auto;
}

/* ─── Footer links ───────────────────────────────────── */

.auth-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 13px;
}

.auth-footer--center {
    justify-content: center;
}

/* ═══ PART 2. MAGIC LINK ══════════════════════════════════ */

.magic-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0;
}

.magic-card {
    width: 100%;
    max-width: 680px;
    padding: 24px;
    margin-bottom: 0;
}

.magic-card__title {
    margin: 0 0 8px;
    font-size: 1.3rem;
    font-weight: 700;
}

.magic-descr {
    margin: 0 0 16px;
    font-size: 13px;
    line-height: 1.5;
}

.magic-info {
    padding: 10px 14px;
    margin-bottom: 16px;
    background: rgba(47, 111, 237, 0.08);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.4;
}

/* ─── Link box ───────────────────────────────────────── */

.magic-link-box {
    padding: 14px 16px;
    background: var(--card-bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 14px;
}

.magic-link-box--permanent {
    border-left: 4px solid var(--danger);
}

.magic-link-box--once {
    border-left: 4px solid var(--primary);
}

.magic-link-box__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.magic-link-box__label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 14px;
}

.magic-link-box__text {
    word-break: break-all;
}

.magic-link-box__link {
    font-family: var(--geek-mono);
    font-size: 12px;
    color: var(--primary);
    line-height: 1.4;
    word-break: break-all;
}

/* ─── Warning blocks ─────────────────────────────────── */

.magic-warning {
    margin-bottom: 14px;
    padding: 14px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    line-height: 1.6;
}

.magic-warning--permanent {
    background: rgba(239, 68, 68, 0.08);
    border-left: 4px solid var(--danger);
    color: var(--text);
}

.magic-warning--once {
    background: rgba(245, 158, 11, 0.08);
    border-left: 4px solid var(--warning);
    color: var(--text);
}

/* ─── Form ───────────────────────────────────────────── */

.magic-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 16px;
}

.magic-form__field {
    display: block;
}

.magic-form__label {
    display: block;
    font-size: 13px;
    margin-bottom: 8px;
}

.magic-modes {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.magic-mode {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
}

.magic-mode__hint {
    font-size: 12px;
}

.magic-divider {
    margin: 20px 0;
    border: none;
    border-top: 1px solid var(--border);
}

.magic-revoke-form {
    display: block;
    margin: 0;
}

.magic-revoke-btn {
    color: var(--danger);
    border-color: var(--danger);
}

.magic-revoke-btn:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: var(--danger);
    color: var(--danger);
}

.magic-footer {
    margin: 20px 0 0;
    font-size: 12px;
    line-height: 1.5;
}

/* ═══ PART 3. MAGIC CONFIRM ═══════════════════════════════ */

.magic-confirm-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0;
}

.magic-confirm-card {
    width: 100%;
    max-width: 560px;
    padding: 24px;
    margin-bottom: 0;
}

.magic-confirm-card__title {
    margin: 0 0 12px;
    font-size: 1.3rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.magic-confirm-card__badge {
    vertical-align: middle;
    margin-left: 6px;
}

.magic-confirm-hint {
    margin: 0 0 12px;
    font-size: 13px;
}

.magic-confirm-account {
    padding: 14px 16px;
    background: var(--card-bg-hover);
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.magic-confirm-account__name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 2px;
    line-height: 1.3;
}

.magic-confirm-account__login {
    font-weight: 400;
    font-size: 13px;
    margin-left: 4px;
}

.magic-confirm-account__role {
    font-size: 13px;
    margin-top: 2px;
}

.magic-confirm-form {
    display: block;
    margin: 0 0 12px;
}

.magic-confirm-submit {
    width: 100%;
    justify-content: center;
}

.magic-confirm-footer {
    margin-top: 12px;
    text-align: center;
    font-size: 13px;
}

.magic-confirm-note {
    margin: 16px 0 0;
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}

/* ═══ Mobile (Phase 1: 600 → 640) ═══════════════════════ */

@media (max-width: 640px) {
    .auth-card,
    .magic-card,
    .magic-confirm-card {
        padding: 18px;
    }

    .auth-card__title,
    .magic-card__title,
    .magic-confirm-card__title {
        font-size: 1.15rem;
    }

    .magic-modes {
        flex-direction: column;
        gap: 8px;
    }

    .magic-link-box__header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================================
 * END OF FILE r50-auth.css v1.2.0
 * ============================================================ */

/* ============================================================
 * r51a-admin-users.css — Admin Users page (SECTION 3 + 3.1)
 *
 * @version 1.0.0 (2026-10-13, CodingStyleCSS Phase 3.b — split):
 *   • 🟢 Выделено из r51-admin.css v2.4.0 (SECTION 3 + 3.1).
 *     Причина: файл разросся до 2251 строки (§13.3 Phase 3).
 *   • 🟢 Зависимости от r51f-admin-misc.css:
 *       • `.users-page` (display:block) — SECTION 0 PRIMITIVES
 *       • `.admin-table*` — SECTION 0 (не используется здесь)
 *   • ✅ Логика v2.4.0 сохранена (включая `.users-tab.active`
 *     с @deprecated от Phase 1).
 *
 * Зависимости: 01-variables.css, 10-buttons.css, 11-cards.css,
 *   14-tables.css, 16-avatars.css, r51f-admin-misc.css.
 * ============================================================ */


/* ═══════════════════════════════════════════════════════════
   SECTION 3. USERS PAGE (ex-51-admin §3)
   ═══════════════════════════════════════════════════════════ */

.users-page .users-head {
    margin-bottom: 16px;
}

.users-page .users-stats {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.users-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 12px;
    flex-wrap: wrap;
}

.users-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.users-tab:hover {
    background: var(--card-bg-hover);
    border-color: var(--primary);
}

/* @deprecated 2.3.0 — remove after Phase 3
   (§4.3: state через `.is-active`, не `.active`). */
.users-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.users-tab-count {
    background: rgba(255, 255, 255, 0.18);
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

/* @deprecated 2.3.0 — уйдёт вместе с `.users-tab.active`. */
.users-tab:not(.active) .users-tab-count {
    background: var(--card-bg-hover);
}

.users-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.users-toolbar .users-search {
    flex: 1;
    min-width: 200px;
}

.users-toolbar .users-select {
    width: auto;
}

.users-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.users-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
}

.users-table td {
    vertical-align: middle;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-wrap {
    position: relative;
    flex: none;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 1px solid var(--border);
    background: var(--card-bg-hover);
}

.user-avatar-badge {
    position: absolute;
    right: -3px;
    bottom: -3px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    border-radius: 50%;
    font-size: 11px;
    border: 2px solid var(--card-bg);
}

.user-meta {
    min-width: 0;
}

.user-name {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.user-sub {
    font-size: 12.5px;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.user-sub a {
    color: inherit;
    text-decoration: none;
}

.user-sub a:hover {
    color: var(--primary);
}

.user-handle {
    color: var(--primary);
    font-weight: 500;
}

.copy-btn {
    border: none;
    background: none;
    cursor: pointer;
    color: var(--muted);
    font-size: 13px;
    line-height: 1;
    padding: 1px 3px;
    border-radius: 4px;
}

.copy-btn:hover {
    color: var(--primary);
    background: var(--card-bg-hover);
}

.copy-btn.copied {
    color: var(--success);
}

.bot-persona {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bot-persona-emoji {
    font-size: 22px;
    line-height: 1;
}

.bot-persona-style {
    font-weight: 500;
    font-size: 13px;
}

.role-form {
    display: flex;
    gap: 6px;
    align-items: center;
}

.role-form .role-select {
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
    font-size: 13px;
}

.bot-actions {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}

.inline-form {
    display: inline;
}

.activity-online {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--success);
    font-weight: 600;
    font-size: 13px;
}

.users-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.users-pagination {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.users-pagination a,
.users-pagination .page-current {
    display: inline-block;
    padding: 5px 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    background: var(--card-bg);
}

.users-pagination a:hover {
    background: var(--card-bg-hover);
    border-color: var(--primary);
}

.users-pagination .page-current {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}


/* ═══════════════════════════════════════════════════════════
   SECTION 3.1 USERS — SOFT-BLOCK UI (ex-51-admin §3.1)
   ═══════════════════════════════════════════════════════════ */

.users-page__title {
    margin: 0;
}

.users-stat-link {
    color: inherit;
    text-decoration: none;
    padding: 1px 6px;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}

.users-stat-link:hover {
    background: var(--card-bg-hover);
}

.users-stat-link--blocked {
    color: var(--danger);
    font-weight: 700;
}

.users-table__row--blocked {
    background: rgba(239, 68, 68, 0.06);
}

.users-table__row--blocked:hover td {
    background: rgba(239, 68, 68, 0.10);
}

.user-avatar-badge--blocked {
    background: var(--danger);
    border-color: var(--card-bg);
}

.badge--blocked {
    background: #7f1d1d;
    color: #fecaca;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    cursor: help;
}

.user-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.activity-blocked {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--danger);
    font-weight: 600;
    font-size: 13px;
    cursor: help;
}

.bot-persona__hint {
    font-size: 11px;
}

.users-table__col--role    { width: 135px; }
.users-table__col--persona { width: 180px; }
.users-table__col--reg     { width: 110px; }
.users-table__col--act     { width: 145px; }
.users-table__col--actions { width: 220px; }

.users-table--bots .users-table__col--actions { width: 260px; }

@media (max-width: 640px) {
    .user-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ============================================================
 * END OF FILE r51a-admin-users.css v1.0.0
 * ============================================================ */

/* ============================================================
 * r51b-admin-devices.css — Admin Devices page (SECTION 22)
 *
 * @version 1.0.0 (2026-10-13, CodingStyleCSS Phase 3.b — split):
 *   • 🟢 Выделено из r51-admin.css v2.4.0 (SECTION 22).
 *   • Зависимости от r51f-admin-misc.css:
 *       • `.admin-devices` (display:block) — SECTION 0 PRIMITIVES.
 *   • ✅ Логика v2.2.0 не изменена.
 *
 * Зависимости: 01-variables.css, 10-buttons.css, 11-cards.css,
 *   12-forms.css, 13-badges.css, r51f-admin-misc.css.
 * ============================================================ */

.admin-devices__header {
    margin-bottom: 20px;
}

.admin-devices__title {
    margin: 0 0 6px;
    font-size: 1.5rem;
}

.admin-devices__lead {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.admin-devices__legend {
    font-size: 12px;
    display: inline-block;
    margin-top: 6px;
}

.admin-devices__stats {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    margin-bottom: 20px;
}

.admin-devices__stat {
    padding: 12px;
    text-align: center;
}

.admin-devices__stat-num {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
}

.admin-devices__stat-num--primary { color: var(--primary); }
.admin-devices__stat-num--success { color: var(--success); }
.admin-devices__stat-num--danger  { color: var(--danger); }

.admin-devices__stat-lbl {
    font-size: 0.85rem;
    margin-top: 2px;
}

.admin-devices__stat-note {
    font-size: 11px;
    margin-top: 2px;
}

.admin-devices__notice {
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    border-radius: 6px;
    background: var(--card-bg-hover);
}

.admin-devices__notice--warn {
    border-left: 4px solid var(--warning);
    background: rgba(245, 158, 11, 0.06);
}

.admin-devices__filters {
    padding: 14px;
    margin-bottom: 20px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.admin-devices__filters-field {
    display: flex;
    flex-direction: column;
}

.admin-devices__filters-field--sm   { flex: 0 0 120px; }
.admin-devices__filters-field--md   { flex: 0 0 260px; }
.admin-devices__filters-field--grow { flex: 1; min-width: 200px; }

.admin-devices__filters-label {
    font-size: 12px;
    margin-bottom: 2px;
}

.admin-devices__filters-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.admin-devices__table-wrap {
    padding: 16px;
}

.admin-devices__scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-devices__table {
    width: 100%;
    min-width: 950px;
    table-layout: fixed;
}

.admin-devices__col--when    { width: 130px; }
.admin-devices__col--user    { width: 180px; }
.admin-devices__col--status  { width: 170px; }
.admin-devices__col--ip      { width: 130px; }
.admin-devices__col--actions { width: 230px; }

.admin-devices__th-actions {
    text-align: right;
}

.admin-devices__cell {
    vertical-align: top;
}

.admin-devices__cell--when {
    white-space: nowrap;
    font-size: 13px;
}

.admin-devices__cell--user {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-devices__cell--status {
    white-space: nowrap;
}

.admin-devices__cell--ip {
    font-family: var(--geek-mono);
    font-size: 12px;
    white-space: nowrap;
}

.admin-devices__cell--device {
    font-size: 13px;
    overflow: hidden;
}

.admin-devices__cell--actions {
    text-align: right;
    white-space: nowrap;
}

.admin-devices__user-link {
    color: inherit;
    text-decoration: none;
}

.admin-devices__user-link:hover {
    color: var(--primary);
}

.admin-devices__user-meta {
    font-size: 11px;
}

.admin-devices__badge-ndp {
    opacity: 0.7;
    font-size: 10px;
}

.admin-devices__badge-bot {
    font-size: 10px;
    margin-right: 4px;
}

.admin-devices__badge-state {
    font-size: 9px;
    margin-left: 4px;
    padding: 1px 5px;
}

.admin-devices__device-str {
    font-size: 13px;
}

.admin-devices__device-id {
    font-size: 11px;
    font-family: var(--geek-mono);
    margin-left: 6px;
}

.admin-devices__row--blocked {
    background: rgba(239, 68, 68, 0.04);
}

.admin-devices__row--revoked {
    background: rgba(148, 163, 184, 0.04);
}

.admin-devices__inline-form {
    display: inline;
    margin: 0;
}

.admin-devices__block-form {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    margin: 0;
    vertical-align: middle;
}

.admin-devices__reason {
    font-size: 11px;
    padding: 2px 4px;
    width: 110px;
    max-width: 110px;
}

.admin-devices__btn-block {
    color: var(--danger);
    white-space: nowrap;
}

.admin-devices__icon-btn {
    padding: 0.25rem 0.5rem;
}

.admin-devices__self {
    font-size: 12px;
}

.admin-devices__empty {
    text-align: center;
    padding: 24px 0 8px;
}

.admin-devices__empty-reset {
    text-align: center;
    margin: 0 0 16px;
}

.admin-devices__empty-note {
    font-size: 12px;
    margin-left: 12px;
}

@media (max-width: 640px) {
    .admin-devices__filters-field--sm,
    .admin-devices__filters-field--md {
        flex: 1 1 100%;
    }

    .admin-devices__table {
        min-width: 700px;
    }

    .admin-devices__stat {
        padding: 10px;
    }

    .admin-devices__stat-num {
        font-size: 1.4rem;
    }
}

/* ============================================================
 * END OF FILE r51b-admin-devices.css v1.0.0
 * ============================================================ */

/* ============================================================
 * r51c-admin-cron.css — Admin Cron page (SECTION 6 + 14 + 21)
 *
 * @version 1.0.0 (2026-10-13, CodingStyleCSS Phase 3.b — split):
 *   • 🟢 Выделено из r51-admin.css v2.4.0
 *     (SECTION 6 TASK-LEVEL + SECTION 14 PAGE-LEVEL + SECTION 21 PRIMARY).
 *   • Зависимости от r51f-admin-misc.css:
 *       • `.cron-page` (display:block) — SECTION 0 PRIMITIVES
 *       • `.cron-empty*` — SECTION 0
 *       • `.cron-key` (border-left warning) — SECTION 0
 *       • `.cron-summary__row` — SECTION 0 (action-row)
 *       • `.cron-summary__note` — определён здесь (расширение §0)
 *   • ✅ Логика v2.1.0 + v2.2.1 не изменена.
 *
 * Зависимости: 01-variables.css, 10-buttons.css, 11-cards.css,
 *   12-forms.css, r51f-admin-misc.css.
 * ============================================================ */


/* ═══════════════════════════════════════════════════════════
   SECTION 6. CRON — TASK-LEVEL BEM (ex-51-admin §6)
   ═══════════════════════════════════════════════════════════ */

.cron-summary {
    margin-bottom: 16px;
}

.cron-summary__stat {
    padding: 8px 14px;
    background: var(--card-bg-hover);
    border-radius: 8px;
    font-size: 13px;
}

.cron-summary__stat--error {
    color: var(--danger);
}

/* v2.1.0: плашка «N задач без описания». */
.cron-summary__note {
    margin-top: 8px;
    padding: 6px 10px;
    background: rgba(47, 111, 237, 0.06);
    border-left: 3px solid var(--primary);
    border-radius: 4px;
    font-size: 12px;
}

.cron-tasks {
    display: grid;
    gap: 8px;
}

.cron-task {
    padding: 10px 12px;
    background: var(--card-bg-hover);
    border-radius: 8px;
    border-left: 3px solid var(--muted);
}

.cron-task--success {
    border-left-color: var(--success);
}

.cron-task--error {
    border-left-color: var(--danger);
}

.cron-task--skipped,
.cron-task--disabled {
    border-left-color: var(--muted);
}

.cron-task__title {
    font-weight: 600;
}

.cron-task__desc {
    font-size: 12px;
    margin-top: 2px;
    color: var(--muted);
    font-family: var(--geek-mono);
    word-break: break-all;
}

.cron-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    font-size: 13px;
}

.cron-table th,
.cron-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.cron-table__key {
    font-family: var(--geek-mono);
    font-size: 11px;
    color: var(--muted);
}

.cron-command {
    margin-bottom: 14px;
}

.cron-command__label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.cron-command__row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.cron-command__input {
    flex: 1;
    padding: 8px;
    font-family: var(--geek-mono);
    font-size: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text);
}

.cron-command__input:focus {
    outline: none;
    border-color: var(--primary);
}

.cron-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: var(--card-bg-hover);
    border-radius: 8px;
}

.cron-toggle__info {
    min-width: 0;
    flex: 1;
}

.cron-toggle__desc {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 2px;
}


/* ═══════════════════════════════════════════════════════════
   SECTION 14. CRON PAGE — PAGE-LEVEL BEM (ex-51-admin §14)
   ═══════════════════════════════════════════════════════════ */

.cron-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.cron-header__title {
    margin: 0;
}

.cron-header__action {
    display: inline;
}

.cron-status {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.cron-status__note {
    font-size: 13px;
}

.cron-toggles {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cron-table__hint {
    font-size: 12px;
}

.cron-command__copy {
    flex: none;
}

.cron-command__hint {
    font-size: 0.85rem;
    margin-top: 16px;
}

.cron-command__input.is-copied {
    border-color: var(--success);
}

.cron-key__title {
    margin-bottom: 16px;
}

.cron-key__row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.cron-key__hint {
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.cron-key__form {
    display: inline;
}


/* ═══════════════════════════════════════════════════════════
   SECTION 21. CRON — COMMAND PRIMARY (ex-51-admin §21)
   ═══════════════════════════════════════════════════════════ */

.cron-command--primary .cron-command__input {
    border-color: var(--primary);
    background: rgba(47, 111, 237, 0.04);
}

.cron-command--primary .cron-command__label {
    color: var(--text);
    font-weight: 600;
}

.cron-command__label .badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 500;
    padding: 1px 8px;
    border-radius: 8px;
    margin-left: 6px;
    vertical-align: middle;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.4;
}

/* ============================================================
 * END OF FILE r51c-admin-cron.css v1.0.0
 * ============================================================ */

/* ============================================================
 * r51d-admin-backups.css — Admin Backups + Dumps + Excludes
 *                          (SECTION 17 + 18)
 *
 * @version 1.0.0 (2026-10-13, CodingStyleCSS Phase 3.b — split):
 *   • 🟢 Выделено из r51-admin.css v2.4.0
 *     (SECTION 17 BACKUPS+DUMPS+UPDATES + SECTION 18 EXCLUDES).
 *   • Зависимости от r51f-admin-misc.css:
 *       • `.backups-page` / `.dumps-page` (display:block) — SECTION 0
 *       • `.backups-table` / `.dumps-table` / `.admin-table` — SECTION 0
 *       • `.backups-actions` / `.backups-actions__form` — SECTION 0
 *       • `.backups-notice` / `.backups-section--danger` —
 *         SECTION 0 (bordered-left)
 *       • `.backups-checkbox` — SECTION 0
 *       • `.backups-section--primary` — SECTION 0
 *       • `.backups-status*` — SECTION 0
 *   • 🔴 R46 (scoped modal-overlay) сохранён.
 *   • ✅ Логика v2.0.0–v2.0.1 не изменена.
 *
 * Зависимости: 01-variables.css, 10-buttons.css, 11-cards.css,
 *   12-forms.css, 13-badges.css, 14-tables.css, 15-modal-toast.css,
 *   r51f-admin-misc.css.
 * ============================================================ */


/* ═══════════════════════════════════════════════════════════
   SECTION 17. BACKUPS + DUMPS + UPDATES (ex-51-admin §17)
   Базовые таблицы — см. r51f-admin-misc SECTION 0.
   ═══════════════════════════════════════════════════════════ */

/* ─── Notice / Section / Grid ─── */

.backups-notice {
    padding: 12px 16px;
    margin-bottom: 16px;
}

.backups-section {
    margin-bottom: 20px;
}

.backups-section--muted {
    background: var(--card-bg-hover);
}

.backups-section--danger {
    margin-top: 16px;
}

.backups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    align-items: end;
    margin-bottom: 16px;
}

/* ─── Tabs ─── */

.backups-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 12px;
    flex-wrap: wrap;
}

/* ─── List + rows ─── */

.backups-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.backups-row {
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.backups-row--missing {
    opacity: 0.5;
}

.backups-row__main {
    flex: 1;
    min-width: 250px;
}

.backups-row__title {
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.backups-row__meta {
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.backups-row__badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.backups-row__comment {
    margin-top: 8px;
    padding: 8px 12px;
    border-left: 3px solid var(--warning);
    background: rgba(245, 158, 11, 0.06);
    border-radius: 4px;
}

/* ─── Actions ─── */

.backups-actions__form {
    display: inline;
}

/* ─── Tables: специфика ─── */

.backups-table__date,
.dumps-table__date {
    font-size: 0.85rem;
}

.backups-table__actions,
.dumps-table__actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ─── Page-level (dumps.php) ─── */

.dumps-page__actions {
    margin-bottom: 20px;
}

/* ─── Inline helpers ─── */

.backups-inline-note {
    margin-left: 8px;
}

.backups-inline-form {
    display: inline;
}

/* ─── Warning blocks ─── */

.backups-warning {
    padding: 12px 16px;
    background: rgba(245, 158, 11, 0.08);
    border-left: 3px solid var(--warning);
    border-radius: 6px;
    font-size: 0.9rem;
}

.backups-warning-inline {
    color: var(--warning);
    font-size: 0.85rem;
    margin-bottom: 16px;
}

/* ─── File input ─── */

.backups-file-input {
    padding: 10px;
    border: 2px dashed var(--border);
    border-radius: 8px;
    width: 100%;
}

.backups-restore-options {
    margin: 16px 0;
}

.backups-restore-options label {
    padding: 8px;
}

/* ─── Admin table: специфика ─── */

.admin-table__key {
    font-weight: 600;
    width: 220px;
}

/* ═══════════════════════════════════════════════════════════
   Modal overlay — SCOPED под .backups-modals (R46, §12.4 п.7).
   🔴 НЕ применять глобальный `.modal-overlay { display: flex }`.
   ═══════════════════════════════════════════════════════════ */

.backups-modals .modal-overlay {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: var(--z-modal);
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.backups-modals .modal-overlay[hidden] {
    display: none;
}

.backups-modals .modal-dialog {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 8px 32px var(--shadow);
}

.backups-modals .modal-dialog h3 {
    margin-top: 0;
    margin-bottom: 16px;
}

.backups-modals .modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}


/* ═══════════════════════════════════════════════════════════
   SECTION 18. BACKUP EXCLUDES UI (ex-51-admin §18)
   ═══════════════════════════════════════════════════════════ */

.exc-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    min-height: 32px;
    align-items: center;
}

.exc-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 16px;
    background: var(--card-bg-hover);
    border: 1px solid var(--border);
    font-family: var(--geek-mono);
    font-size: 13px;
    color: var(--text);
}

.exc-chip--locked {
    opacity: 0.7;
    cursor: not-allowed;
}

.exc-chip__remove {
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--muted);
    font-size: 16px;
    line-height: 1;
    padding: 0 2px;
    border-radius: 4px;
}

.exc-chip__remove:hover {
    color: var(--danger);
    background: rgba(220, 38, 38, 0.1);
}

.exc-add {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.exc-add .form-input {
    flex: 1;
    min-width: 200px;
    font-family: var(--geek-mono);
}

.exc-analysis__title {
    margin: 12px 0 6px;
    font-size: 1rem;
}

.exc-analysis__form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
    max-width: 560px;
}

.exc-analysis__details {
    margin-top: 16px;
}

.exc-analysis__details summary {
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 10px;
    user-select: none;
}

/* ============================================================
 * END OF FILE r51d-admin-backups.css v1.0.0
 * ============================================================ */

/* ============================================================
 * r51e-admin-webdav.css — Admin WebDAV page (SECTION 20)
 *
 * @version 1.0.0 (2026-10-13, CodingStyleCSS Phase 3.b — split):
 *   • 🟢 Выделено из r51-admin.css v2.4.0 (SECTION 20).
 *   • Зависимости от r51f-admin-misc.css:
 *       • `.webdav-page` (display:block) — SECTION 0
 *       • `.webdav-status` (border-left primary) — SECTION 0
 *       • `.webdav-actions` — SECTION 0 (action-row)
 *   • ✅ Логика v2.0.0 + v2.0.1 не изменена.
 *
 * Зависимости: 01-variables.css, 10-buttons.css, 11-cards.css,
 *   12-forms.css, r51f-admin-misc.css.
 * ============================================================ */

.webdav-back {
    margin-bottom: 12px;
}

.webdav-status {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    background: rgba(47, 111, 237, 0.08);
}

.webdav-status--on {
    border-left-color: var(--success);
    background: rgba(34, 197, 94, 0.08);
}

.webdav-status--off {
    border-left-color: var(--warning);
    background: rgba(245, 158, 11, 0.08);
}

.webdav-section {
    margin-bottom: 20px;
}

.webdav-form .form-group {
    margin-bottom: 14px;
}

.webdav-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.webdav-pass-wrap {
    position: relative;
}

.webdav-pass-wrap .form-input {
    padding-right: 40px;
}

.webdav-pass-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    cursor: pointer;
    font-size: 16px;
    color: var(--muted);
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
}

.webdav-pass-toggle:hover {
    color: var(--text);
    background: var(--card-bg-hover);
}

.webdav-verdict {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.6;
}

.webdav-verdict--ok {
    background: rgba(34, 197, 94, 0.12);
    border-left: 3px solid var(--success);
}

.webdav-verdict--warn {
    background: rgba(245, 158, 11, 0.12);
    border-left: 3px solid var(--warning);
}

.webdav-verdict--err {
    background: rgba(220, 38, 38, 0.12);
    border-left: 3px solid var(--danger);
}

.webdav-upload-form .form-group {
    margin-bottom: 14px;
}

.webdav-upload-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin-top: 12px;
    background: rgba(47, 111, 237, 0.08);
    border-left: 3px solid var(--primary);
    border-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.webdav-upload-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: webdav-spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes webdav-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .webdav-upload-spinner {
        animation: none;
        border-top-color: var(--primary);
    }
}

/* ============================================================
 * END OF FILE r51e-admin-webdav.css v1.0.0
 * ============================================================ */

/* ============================================================
 * r51f-admin-misc.css — Admin misc: PRIMITIVES + базовые секции
 *
 * @version 1.1.0 (2026-10-13, Phase 2 P1-fix + ADR-0061 partial):
 *   • 🔴 FIX P1: из SECTION 19 удалён `.pagination { margin: 20px 0; }`.
 *     Причина: r51f загружается ПОСЛЕ r19-pagination.css
 *     (директория 03-modules > 02-components), поэтому legacy-shim
 *     перебивал канон `margin: 22px 0 8px` из r19-pagination → pagination
 *     получал неверный отступ `20px 0` без нижнего буфера.
 *     Канон margin остаётся единственным в r19-pagination.css.
 *     Shim `.pagination__list / __current / __sep` (BEM-структура
 *     render_pagination()) сохранён без изменений, @deprecated.
 *   • 🟢 ADR-0061 (partial): 4 hardcoded rgba акцентных токенов
 *     заменены на rgba(var(--*-rgb), α):
 *       `.backups-status`                    rgba(47, 111, 237, .08)
 *                                            → rgba(var(--primary-rgb), .08)
 *       `.cron-summary__note`                rgba(47, 111, 237, .06)
 *                                            → rgba(var(--primary-rgb), .06)
 *       `.cron-command--primary .cron-command__input`
 *                                            rgba(47, 111, 237, .04)
 *                                            → rgba(var(--primary-rgb), .04)
 *       `.admin-devices__notice--warn`       rgba(245, 158, 11, .06)
 *                                            → rgba(var(--warning-rgb), .06)
 *   • ✅ Логика v1.0.0 не изменена — только цвета-композиция
 *     и удаление перебивающего margin.
 *
 * @version 1.0.0 (2026-10-13, CodingStyleCSS Phase 3.b — split):
 *   • 🟢 Выделено из r51-admin.css v2.4.0:
 *       SECTION 0  PRIMITIVES
 *       SECTION 1  BREADCRUMBS
 *       SECTION 2  GENERIC HELPERS
 *       SECTION 4  DASHBOARD
 *       SECTION 5  SYSTEM INFO
 *       SECTION 7  ASSETS
 *       SECTION 8  MODULES
 *       SECTION 9  MAIL + SMTP
 *       SECTION 10 EDIT POST
 *       SECTION 11 MISC
 *       SECTION 12 GENERIC ADMIN
 *       SECTION 13 TIME SYNC FALLBACK
 *       SECTION 15 RESPONSIVE (единый блок)
 *       SECTION 16 TOUCH-TARGET
 *       SECTION 19 DEPRECATED HELPERS (pagination shim)
 *   • 🟢 Сортировка ksort гарантирует: r51f идёт ПОСЛЕ r51a–r51e →
 *     PRIMITIVES работают как «базовый слой» поверх частных стилей.
 *   • ✅ Логика v2.4.0 сохранена (включая Phase 2 удаления
 *     `.empty-state*` из §0 и `.admin-nav*` из §19).
 *
 * Зависимости: 01-variables.css, 10-buttons.css, 11-cards.css,
 *   12-forms.css, 13-badges.css, 14-tables.css, 15-modal-toast.css,
 *   17-utilities.css, 18-alert.css, 19-pagination.css (канон),
 *   20-admin-nav.css (канон).
 * ============================================================ */


/* ═══════════════════════════════════════════════════════════
   SECTION 0. PRIMITIVES — universal patterns
   ═══════════════════════════════════════════════════════════ */

.users-page,
.assets-page,
.dumps-page,
.backups-page,
.cron-page,
.webdav-page,
.admin-devices {
    display: block;
}

.backups-page__lead,
.backups-subtitle,
.backups-section__desc,
.dumps-page__lead,
.cron-page__lead,
.assets-page__lead {
    margin-bottom: 16px;
}

.system-table,
.backups-table,
.dumps-table,
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.system-table th,
.system-table td,
.backups-table th,
.backups-table td,
.dumps-table th,
.dumps-table td,
.admin-table th,
.admin-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.system-table thead th,
.backups-table thead th,
.dumps-table thead th,
.admin-table thead th {
    background: var(--card-bg-hover);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.system-table tr:hover td,
.backups-table tr:hover td,
.dumps-table tr:hover td,
.admin-table tr:hover td {
    background: var(--card-bg-hover);
}

.backups-actions,
.admin-actions,
.admin-form-actions,
.system-actions__row,
.cron-summary__row,
.webdav-actions,
.dashboard-sections,
.bots-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.backups-actions,
.admin-actions,
.admin-form-actions,
.webdav-actions {
    align-items: center;
}

.backups-actions,
.admin-actions,
.bots-actions {
    margin-bottom: 16px;
}

.admin-form-actions,
.webdav-actions {
    margin-top: 16px;
}

/* 🟢 v2.4.0: `.empty-state*` убран — SSOT в r11-cards.css
   (§12.1 п.1). Здесь — только `.cron-empty*` (именованный
   alias для cron-страницы). */

.cron-empty {
    text-align: center;
    padding: 48px 16px;
}

.cron-empty__icon {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 16px;
    opacity: 0.5;
}

.cron-empty__title {
    margin: 0 0 8px;
    font-weight: 600;
    font-size: 1.05rem;
}

.cron-empty__desc {
    margin: 0 0 16px;
    font-size: 0.9rem;
}

.admin-form-check,
.backups-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.backups-notice,
.backups-section--primary,
.modules-install,
.modules-help,
.assets-note,
.webdav-status {
    border-left: 4px solid var(--primary);
}

.backups-section--danger,
.assets-diff {
    border-left: 4px solid var(--danger);
}

.cron-key {
    border-left: 4px solid var(--warning);
}

.backups-status {
    padding: 10px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    border-left: 3px solid var(--primary);
    /* 🟢 v1.1.0: ADR-0061 — было rgba(47, 111, 237, 0.08). */
    background: rgba(var(--primary-rgb), 0.08);
}

.backups-status--on {
    border-left-color: var(--success);
}

.backups-status--off {
    border-left-color: var(--primary);
}

.backups-status__on {
    color: var(--success);
    font-weight: 600;
}

.backups-status__off {
    color: var(--primary);
    font-weight: 600;
}

.backups-status__meta {
    font-size: 0.8rem;
    margin-top: 4px;
}


/* ═══════════════════════════════════════════════════════════
   SECTION 1. BREADCRUMBS (admin.php layout)
   ═══════════════════════════════════════════════════════════ */

.breadcrumbs {
    margin: 0 0 16px;
    font-size: 13px;
    color: var(--muted);
}

.breadcrumbs__list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.breadcrumbs__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.breadcrumbs__link {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumbs__link:hover {
    text-decoration: underline;
}

.breadcrumbs__sep {
    color: var(--border);
}

.breadcrumbs__current {
    color: var(--text);
}


/* ═══════════════════════════════════════════════════════════
   SECTION 2. GENERIC HELPERS
   ═══════════════════════════════════════════════════════════ */

.admin-layout .site-main {
    padding-top: 16px;
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.version-badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 8px;
    background: var(--card-bg-hover);
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--geek-mono);
}


/* ═══════════════════════════════════════════════════════════
   SECTION 4. DASHBOARD
   ═══════════════════════════════════════════════════════════ */

.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.dashboard-stat {
    display: block;
    text-align: center;
    padding: 16px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s, transform 0.15s;
}

.dashboard-stat:hover {
    text-decoration: none;
    color: inherit;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow);
}

.dashboard-stat:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px var(--shadow);
}

.dashboard-stat__icon {
    font-size: 2rem;
    line-height: 1;
}

.dashboard-stat__value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.1;
    margin-top: 4px;
}

.dashboard-stat__value--success {
    color: var(--success);
}

.dashboard-stat__label {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 4px;
}

.dashboard-stat__badge {
    margin-top: 6px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.dashboard-widget {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px var(--shadow);
}

.widget-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--card-bg-hover);
    font-size: 1.4rem;
    flex-shrink: 0;
}

.widget-icon.messages {
    background: rgba(47, 111, 237, 0.15);
    color: var(--primary);
}

.widget-content {
    min-width: 0;
    flex: 1;
}

.widget-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.widget-label {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 2px;
}

.dashboard-status {
    font-family: var(--geek-mono);
    font-size: 0.85rem;
}

.dashboard-status__title {
    margin-bottom: 8px;
}

.dashboard-status__ok {
    color: var(--success);
}


/* ═══════════════════════════════════════════════════════════
   SECTION 5. SYSTEM INFO — специфика
   ═══════════════════════════════════════════════════════════ */

.system-table__th--right {
    text-align: right;
}

.system-table__cell--right {
    text-align: right;
}

.system-table__cell--mono {
    font-family: var(--geek-mono);
    font-size: 0.85rem;
}

.system-row__label {
    font-weight: 600;
    white-space: nowrap;
    vertical-align: top;
    width: 220px;
}

.system-row__note {
    margin-left: 8px;
    font-size: 0.9rem;
}

.system-row__code {
    margin-left: 8px;
    font-size: 0.85rem;
}

.system-row__link {
    margin-left: 8px;
}

.system-row__count {
    color: var(--primary);
}

.disk-progress {
    margin-top: 16px;
}

.disk-progress__label {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.9rem;
}

.disk-progress__track {
    position: relative;
    background: var(--card-bg-hover);
    border-radius: 8px;
    height: 24px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.disk-progress__bar {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    background: var(--success);
    transition: width 0.3s ease;
}

.disk-progress__bar--warning {
    background: var(--warning);
}

.disk-progress__bar--danger {
    background: var(--danger);
}

.disk-progress__bar--pct-0   { width: 0%;   }
.disk-progress__bar--pct-10  { width: 10%;  }
.disk-progress__bar--pct-20  { width: 20%;  }
.disk-progress__bar--pct-30  { width: 30%;  }
.disk-progress__bar--pct-40  { width: 40%;  }
.disk-progress__bar--pct-50  { width: 50%;  }
.disk-progress__bar--pct-60  { width: 60%;  }
.disk-progress__bar--pct-70  { width: 70%;  }
.disk-progress__bar--pct-80  { width: 80%;  }
.disk-progress__bar--pct-90  { width: 90%;  }
.disk-progress__bar--pct-100 { width: 100%; }

.system-actions {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.system-actions__title {
    margin-bottom: 12px;
}

.system-actions__summary {
    margin-top: 12px;
}


/* ═══════════════════════════════════════════════════════════
   SECTION 7. ASSETS
   ═══════════════════════════════════════════════════════════ */

.assets-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.assets-summary__info {
    min-width: 0;
    flex: 1;
}

.assets-summary__size {
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 6px;
}

.assets-compile {
    margin-bottom: 24px;
}

.assets-compile__title {
    margin: 0 0 6px;
}

.assets-compile__meta {
    font-size: 0.85rem;
}

.assets-compile__meta--mt {
    margin-top: 12px;
}

.assets-compile__link {
    color: inherit;
    text-decoration: none;
}

.assets-compile__link:hover {
    color: var(--primary);
}

.assets-status--missing {
    color: var(--danger);
}

.assets-details {
    margin-top: 16px;
}

.assets-details__summary {
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 10px;
}

.assets-sources {
    font-family: var(--geek-mono);
    font-size: 0.8rem;
    line-height: 1.9;
}

.assets-sources__row {
    padding: 2px 8px;
    border-bottom: 1px solid var(--border);
}

.assets-sources__num {
    color: var(--muted);
    display: inline-block;
    min-width: 22px;
}

.assets-diff {
    margin-bottom: 24px;
}

.assets-diff__title {
    color: var(--danger);
    margin-top: 0;
}

.assets-diff__count {
    margin: 8px 0;
}

.assets-diff__details {
    margin-top: 12px;
}

.assets-diff__summary {
    cursor: pointer;
    font-weight: 600;
}

.assets-diff__list {
    max-height: 300px;
    overflow: auto;
    padding: 10px;
    background: var(--card-bg-hover);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    line-height: 1.5;
    margin-top: 8px;
    font-family: var(--geek-mono);
    white-space: pre-wrap;
    word-break: break-all;
}

.assets-diff__hint {
    margin-top: 12px;
    font-size: 0.85rem;
}

.assets-diff__actions {
    margin-top: 12px;
}

.assets-diff__cmd {
    margin-top: 8px;
    font-size: 0.8rem;
}

.assets-js-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.assets-js-empty {
    text-align: center;
    padding: 24px 0;
    font-style: italic;
}

.assets-note__list {
    margin: 10px 0 0;
    padding-left: 20px;
    line-height: 1.8;
    font-size: 0.9rem;
}


/* ═══════════════════════════════════════════════════════════
   SECTION 8. MODULES
   ═══════════════════════════════════════════════════════════ */

.modules-install {
    margin-bottom: 28px;
}

.modules-install__hint {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 6px 0 12px;
}

.modules-install__form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.modules-install__file {
    flex: 1;
    min-width: 220px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.modules-grid .card {
    margin: 0;
    padding: 16px;
}

.module-card {
    border-left: 4px solid var(--border);
}

.module-card--enabled {
    border-left-color: var(--success);
}

.module-card--disabled {
    opacity: 0.75;
}

.module-card__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.module-card__title {
    font-weight: 700;
    font-size: 1.05rem;
}

.module-card__desc {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 10px 0 8px;
    min-height: 40px;
}

.module-card__routes {
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 10px;
}

.module-card__route {
    background: var(--card-bg-hover);
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 4px;
    font-family: var(--geek-mono);
}

.module-card__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.module-card__badge-version,
.module-card__badge-builtin {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--border);
    color: var(--text);
    margin-left: 4px;
}

.module-card__badge-manifest {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #2196f3;
    color: #fff;
    margin-left: 4px;
}

.system-modules-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.system-modules-list .badge {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.modules-help {
    margin-top: 20px;
}

.modules-help__list {
    margin: 10px 0 0;
    padding-left: 20px;
    line-height: 1.8;
    font-size: 0.9rem;
}


/* ═══════════════════════════════════════════════════════════
   SECTION 9. MAIL + SMTP
   ═══════════════════════════════════════════════════════════ */

.mail-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px;
}

.mail-page h1 {
    margin: 0 0 6px;
}

.mail-page__intro {
    margin-bottom: 16px;
    color: var(--muted);
}

.mail-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.mail-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mail-field__label {
    font-size: 13px;
    color: var(--muted);
}

.mail-actions {
    margin-top: 16px;
}

.mail-divider {
    margin: 20px 0;
    border: none;
    border-top: 1px solid var(--border);
}

.mail-test-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: end;
}

.mail-test-row__field {
    flex: 1;
    min-width: 220px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.hint,
.form-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 4px;
}


/* ═══════════════════════════════════════════════════════════
   SECTION 10. EDIT POST
   ═══════════════════════════════════════════════════════════ */

.edit-post-page {
    max-width: 900px;
}


/* ═══════════════════════════════════════════════════════════
   SECTION 11. MISC
   ═══════════════════════════════════════════════════════════ */

.sensor-value {
    font-family: var(--geek-mono);
    font-size: 1.1rem;
    font-weight: 600;
}

.sensor-value--voltage {
    color: var(--warning);
}

.sensor-value--temperature {
    color: var(--primary);
}

.inline-note {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 4px;
}


/* ═══════════════════════════════════════════════════════════
   SECTION 12. GENERIC ADMIN
   ═══════════════════════════════════════════════════════════ */

.admin-actions--end {
    justify-content: flex-end;
}

.admin-actions--top {
    margin-top: 16px;
    margin-bottom: 0;
}

.admin-page--narrow {
    max-width: 700px;
}


/* ═══════════════════════════════════════════════════════════
   SECTION 13. TIME SYNC FALLBACK
   ═══════════════════════════════════════════════════════════ */

.admin-simple-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-simple-table td {
    padding: 6px 0;
    vertical-align: top;
}

.admin-simple-table__label {
    font-weight: 600;
    padding: 6px 10px 6px 0;
    vertical-align: top;
    width: 220px;
    white-space: nowrap;
}

.admin-inline-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.admin-inline-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: var(--muted);
}

.admin-inline-form select,
.admin-inline-form input {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
}

.admin-inline-form select:focus,
.admin-inline-form input:focus {
    outline: none;
    border-color: var(--primary);
}


/* ═══════════════════════════════════════════════════════════
   SECTION 15. RESPONSIVE (единый блок)
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .users-tabs,
    .backups-tabs {
        gap: 4px;
    }

    .users-tab {
        font-size: 12px;
        padding: 5px 10px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cron-table {
        min-width: 0;
    }

    .system-row__label,
    .admin-simple-table__label {
        width: auto;
        white-space: normal;
    }

    .backups-section {
        margin-bottom: 14px;
    }
}

@media (max-width: 640px) {
    .users-toolbar .users-search {
        min-width: 100%;
    }

    .users-table {
        min-width: 600px;
    }

    .modules-grid {
        grid-template-columns: 1fr;
    }

    .admin-inline-form {
        flex-direction: column;
        align-items: stretch;
    }

    .system-table__th--right,
    .system-table__cell--right {
        text-align: right;
    }

    .backups-grid {
        grid-template-columns: 1fr;
    }

    .cron-key__row {
        flex-wrap: wrap;
    }

    .cron-command__copy {
        width: 100%;
    }

    .backups-row {
        flex-direction: column;
    }

    .backups-row__main {
        min-width: 0;
    }

    .admin-table__key {
        width: auto;
    }

    .backups-modals .modal-dialog {
        padding: 16px;
        max-width: 100%;
    }

    .backups-table,
    .dumps-table {
        font-size: 0.9rem;
    }

    .backups-table th,
    .backups-table td,
    .dumps-table th,
    .dumps-table td {
        padding: 8px 10px;
    }

    .admin-nav {
        padding: 10px;
        gap: 4px;
    }

    .admin-nav__back {
        margin-right: 8px;
    }

    .empty-state {
        padding: 32px 12px;
    }

    .empty-state__icon {
        font-size: 40px;
    }

    .pagination__list {
        gap: 6px;
    }

    .exc-add {
        flex-direction: column;
        align-items: stretch;
    }

    .exc-add .form-input {
        min-width: 0;
    }

    .exc-chip {
        font-size: 12px;
        padding: 3px 8px;
    }

    .webdav-grid {
        grid-template-columns: 1fr;
    }
}


/* ═══════════════════════════════════════════════════════════
   SECTION 16. TOUCH-TARGET (mobile)
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) and (hover: none) and (pointer: coarse) {
    .users-pagination a,
    .users-pagination .page-current {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 8px 12px;
    }

    .copy-btn,
    .role-form button {
        min-height: 44px;
        min-width: 44px;
    }

    .users-tab {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .backups-actions .btn,
    .backups-table__actions .btn,
    .dumps-table__actions .btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .pagination__list .btn {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .admin-nav__link {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}


/* ═══════════════════════════════════════════════════════════
   SECTION 19. DEPRECATED HELPERS (pagination shim)
   🟢 v2.4.0: `.admin-nav*` убраны — SSOT в r20-admin-nav.css
   (§12.1 п.2). Остались только `.pagination*` — legacy shim
   для render_pagination() (§12.1 п.3: канон `.pagination__item*`
   в r19-pagination.css).
   🟢 v1.1.0: `.pagination { margin: 20px 0 }` удалён (см. §шапка).
   ═══════════════════════════════════════════════════════════ */

/* @deprecated 2.4.0 — remove after Phase 4.1
   (§12.1 п.3: канон `.pagination__item*` в r19-pagination.css;
   это legacy BEM-структура `__list/__current/__sep`, используется
   в render_pagination() v6.16.13).
   🟢 v1.1.0: контейнерный `.pagination { margin: 20px 0 }` удалён —
   канон margin 22px 0 8px остаётся единственным в r19-pagination.css. */

.pagination__list {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
}

.pagination__current {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    font-weight: 600;
}

.pagination__sep {
    color: var(--muted);
    padding: 0 4px;
    user-select: none;
}

/* ============================================================
 * END OF FILE r51f-admin-misc.css v1.1.0
 * ============================================================ */

/* ============================================================
 * r52-errors.css — Страницы ошибок (403, 404, 500, 502, 503)
 *                  (Phase 1 hygiene)
 *
 * @version 1.1.0 (2026-10-13, CodingStyleCSS Phase 1 hygiene):
 *   • 🟢 `@media (max-width: 480px)` → `640px` (§6.2).
 *
 * @version 1.0.1 (2026-10-07, ADR-0042 — переименован 32-errors.css):
 *   • 🔴 ПЕРЕИМЕНОВАН 32-errors.css → 52-errors.css.
 *
 * @version 1.0.0 (2026-10-06, T-7, ADR-0042 / ADR-0043):
 *   • 🆕 Покрывает BEM-классы из templates/03-modules/errors/*.php.
 *   • R6  — все селекторы BEM, без compound-classes.
 *   • R7' — никаких inline-стилей в шаблонах (всё здесь).
 *   • R12 — покрывает 5 error-шаблонов + их fallback-аналоги.
 *
 * Назначение:
 *   Страницы каскадных ошибок (Apache ErrorDocument):
 *     • 403 Доступ запрещён
 *     • 404 Страница не найдена
 *     • 500 Внутренняя ошибка сервера
 *     • 502 Bad Gateway
 *     • 503 Сервис временно недоступен (с таймером auto-retry)
 *
 * Зависимости: 01-variables.css, 10-buttons.css, 11-cards.css,
 *   17-utilities.css, 18-alert.css.
 * ============================================================ */

/* ─── Обёртка страницы ─────────────────────────────────────── */

.error-page {
    margin: 24px auto;
    max-width: 520px;
    text-align: center;
    padding: 40px 32px;
}

/* ─── Крупная цифра кода (403 / 404 / 500 / 502 / 503) ─────── */

.error-page__code {
    font-size: 120px;
    font-weight: 900;
    line-height: 1;
    opacity: 0.3;
    font-variant-numeric: tabular-nums;
    user-select: none;
}

.error-page__code--warning {
    color: var(--warning);
}

.error-page__code--danger {
    color: var(--danger);
}

.error-page__code--success {
    color: var(--success);
}

.error-page__code--primary {
    color: var(--primary);
}

/* ─── Эмодзи-иконка ────────────────────────────────────────── */

.error-page__icon {
    font-size: 64px;
    line-height: 1;
    margin: 20px 0;
    user-select: none;
}

/* ─── Заголовок и описание ─────────────────────────────────── */

.error-page__title {
    margin: 0 0 12px;
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

.error-page__message {
    color: var(--muted);
    line-height: 1.5;
    margin: 0 0 16px;
}

/* ─── URI-блок (для 404: показать запрошенный путь) ────────── */

.error-page__uri {
    background: var(--card-bg-hover);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    margin: 16px auto;
    max-width: 400px;
    font-family: var(--geek-mono);
    font-size: 13px;
    color: var(--muted);
    word-break: break-all;
    text-align: left;
}

/* ─── Блок «что можно сделать» (502) ───────────────────────── */

.error-page__hint {
    text-align: left;
    background: var(--card-bg-hover);
    border: 1px solid var(--primary);
    border-radius: 8px;
    padding: 16px;
    margin: 0 0 24px;
    color: var(--primary);
    font-size: 14px;
}

.error-page__hint-title {
    color: var(--text);
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
}

.error-page__hint-list {
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
    line-height: 1.6;
}

.error-page__hint-list li + li {
    margin-top: 4px;
}

/* ─── Кнопки-действия ──────────────────────────────────────── */

.error-page__actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

/* ─── Таймер (503): обратный отсчёт ───────────────────────── */

.error-page__timer {
    background: rgba(245, 158, 11, .12);
    border: 1px solid var(--warning);
    color: var(--warning);
    border-radius: 10px;
    max-width: 360px;
    margin: 24px auto 0;
    padding: 20px;
    text-align: center;
}

.error-page__timer-label {
    font-size: 12px;
    color: var(--warning);
    margin-bottom: 4px;
    opacity: 0.85;
}

.error-page__timer-value {
    font-size: 48px;
    font-weight: 700;
    margin: 8px 0;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.error-page__timer-note {
    font-size: 13px;
    color: var(--warning);
    opacity: 0.85;
}

/* ─── Адаптив: маленькие экраны ──────────────────────────────
   🟢 v1.1.0: 480px → 640px (канонический breakpoint). */

@media (max-width: 640px) {
    .error-page {
        padding: 32px 20px;
    }

    .error-page__code {
        font-size: 88px;
    }

    .error-page__icon {
        font-size: 52px;
        margin: 14px 0;
    }

    .error-page__title {
        font-size: 20px;
    }

    .error-page__timer-value {
        font-size: 40px;
    }
}

/* ============================================================
 * END OF FILE r52-errors.css v1.1.0
 * ============================================================ */

/* ============================================================
 * 54-home.css — Главная страница (SSOT-layout)
 *
 * @version 1.0.1 (2026-10-07, ADR-0042 — переименован 34-home.css):
 *   • 🔴 ПЕРЕИМЕНОВАН 34-home.css → 54-home.css.
 *     Единая 3-диапазонная сетка (40-79 для 03-modules).
 *     Пропущены 53 (не существует изначально) — сохранён
 *     исходный номер 34 → 54.
 *   • 🟢 Содержимое CSS НЕ менялось.
 *
 * @version 1.0.0 (2026-10-06, ADR-0044 — миграция home.php):
 *   • 🆕 Перенос inline <style> из includes/Modules/Posts/Views/home.php.
 *   • 🆕 BEM: .home-page / .home-hero / .home-widget / .home-posts /
 *     .home-post / .home-actions / .home-system-info / .time-widget.
 *   • 🟢 R12: все классы определены здесь, шаблон — только разметка.
 *   • 🌙 Dark theme: через var(--*) — работает автоматически.
 *   • ♿ prefers-reduced-motion.
 *
 * Зависимости:
 *   01-variables.css  — --card-bg, --card-bg-hover, --primary,
 *                       --success, --muted, --text, --border,
 *                       --radius, --geek-mono, --shadow.
 * ============================================================ */

/* ─── PAGE ─────────────────────────────────────────── */

.home-page {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ─── HERO ─────────────────────────────────────────── */

.home-hero {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--card-bg-hover) 100%);
    border-left: 4px solid var(--primary);
}

.home-hero__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.home-hero__text {
    flex: 1 1 auto;
    min-width: 0;
}

.home-hero__title {
    margin: 0 0 8px;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    background: linear-gradient(90deg, var(--primary), var(--success));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.home-hero__subtitle {
    margin: 0;
}

/* ─── TIME WIDGET ──────────────────────────────────── */

.time-widget {
    padding: 12px 20px;
    background: rgba(47, 111, 237, .05);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: right;
    flex-shrink: 0;
}

.time-widget__time {
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--geek-mono, monospace);
    color: var(--primary);
    line-height: 1.1;
}

.time-widget__date {
    font-size: .85rem;
    margin-top: 4px;
}

.time-widget__tz {
    font-size: .75rem;
    margin-top: 4px;
}

/* ─── WIDGETS (grid) ───────────────────────────────── */

.home-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.home-widget {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    transition: transform .2s ease, border-color .15s ease, box-shadow .15s ease;
}
.home-widget:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 4px 12px var(--shadow);
    text-decoration: none;
    color: inherit;
}

.home-widget__icon {
    font-size: 2.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.home-widget__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.home-widget__label {
    font-size: .85rem;
}

.home-widget__value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
}
.home-widget__value--empty {
    color: var(--muted);
    font-weight: 400;
}

/* ─── POSTS ────────────────────────────────────────── */

.home-posts__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.home-posts__title {
    margin: 0;
    font-size: 1.25rem;
}

.home-post {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.home-post:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.home-post__row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.home-post__title {
    margin: 0 0 4px;
    font-size: 1.05rem;
    font-weight: 600;
}

.home-post__edit {
    flex-shrink: 0;
}

.home-post__meta {
    font-size: .75rem;
    margin-bottom: 8px;
}

.home-post__excerpt {
    font-style: italic;
    color: var(--muted);
    margin: 0 0 8px;
}

.home-post__body {
    line-height: 1.7;
}

/* ─── ACTIONS ──────────────────────────────────────── */

.home-actions__title {
    margin: 0 0 16px;
    font-size: 1.15rem;
}

.home-actions__buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ─── SYSTEM INFO ──────────────────────────────────── */

.home-system-info {
    font-family: var(--geek-mono, monospace);
    font-size: .85rem;
}

.home-system-info__label {
    margin-bottom: 8px;
}

.home-system-info__lines > div {
    line-height: 1.7;
}

.home-system-info__ok {
    color: var(--success);
}

/* ─── RESPONSIVE ───────────────────────────────────── */

@media (max-width: 768px) {
    .home-hero__row {
        flex-direction: column;
        align-items: flex-start;
    }

    .time-widget {
        text-align: left;
        width: 100%;
    }

    .home-hero__title {
        font-size: 1.25rem;
    }

    .time-widget__time {
        font-size: 1.5rem;
    }
}

/* ─── REDUCED MOTION ───────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .home-widget {
        transition: none;
    }
    .home-widget:hover {
        transform: none;
    }
}

/* ============================================================
 * END OF FILE 54-home.css v1.0.1
 * ============================================================ */

/* ============================================================
 * r55-map.css — Map page + tile brouser (BEM)
 *               (Phase 1 + Phase 3.a + Phase 3.d / ADR-0061)
 *
 * @version 1.4.0 (2026-10-13, ADR-0061 — color-mix elimination):
 *   • 🟢 Заменены ВСЕ 28 вхождений `color-mix(in srgb, …)` на:
 *       • rgba(var(--*-rgb), α) — 15 мест (категория 1);
 *       • var(--card-bg) + linear-gradient overlay — 8 мест
 *         (категория 2 — pseudo-mix);
 *       • локальные computed-токены `--map-*` — 5 мест
 *         (категория 3, см. §local tokens ниже).
 *   • 🟢 +Локальный блок computed-токенов в шапке файла:
 *     --map-input-border-hover, --map-badge-bg,
 *     --map-nspd-border, --map-alpinequest-border
 *     (light + dark override). Не затрагивает глобальный SSOT.
 *   • ⚠️ Требуется ADR-0061 + pre-commit hook (hex ↔ rgb sync).
 *
 * @version 1.3.0 (2026-10-13, CodingStyleCSS Phase 3):
 *   • 🟢 Удалён legacy `body.theme-light` shim.
 *
 * @version 1.2.0 (2026-10-13, CodingStyleCSS Phase 1 hygiene):
 *   • 🟢 @media (max-width: 480px) → 640px.
 *
 * @version 1.1.1 (2026-10-08, T-Map.10 admin UI).
 * @version 1.1.0 (2026-10-08, T-Map, AlpineQuest).
 * @version 1.0.9–1.0.0 (см. git history).
 *
 * Зависимости: r01-variables.css (--*-rgb, --header-h, --z-*),
 *   11-cards.css, 10-buttons.css.
 * ============================================================ */

/* ═══════════════════════════════════════════════════════════
 * Local computed tokens (ADR-0061 §3.3, категория 3)
 * Псевдо-миксы: --border 60% --text 40% и др.
 * Не затрагивают глобальный SSOT (r01-variables.css).
 * Переопределяются в [data-theme="dark"].
 * ═══════════════════════════════════════════════════════════ */

.map-page,
.map-brouser {
    /* mix(--border 60%, --text 40%) — light */
    --map-input-border-hover: #89929c;
    /* mix(--card-bg 60%, --border 40%) — light */
    --map-badge-bg: #eceff2;
    /* mix(--primary 25%, --border 75%) — light */
    --map-nspd-border: #a8bde2;
    /* mix(--primary 30%, --border 70%) — light */
    --map-alpinequest-border: #a0b8e3;
}

[data-theme="dark"] .map-page,
[data-theme="dark"] .map-brouser {
    /* mix(--border 60%, --text 40%) — dark */
    --map-input-border-hover: #777f8c;
    /* mix(--card-bg 60%, --border 40%) — dark */
    --map-badge-bg: #222838;
    /* mix(--primary 25%, --border 75%) — dark */
    --map-nspd-border: #2e4471;
    /* mix(--primary 30%, --border 70%) — dark */
    --map-alpinequest-border: #2e467a;
}

/* ─── Page-level ─────────────────────────────────────────── */

.map-page { max-width: 100%; }

.map-page__lead { margin: 0 0 16px; line-height: 1.55; }

.map-page__hint {
    margin: 16px 0 0;
    font-size: 0.85rem;
    line-height: 1.6;
}

.map-attribution-inline {
    color: var(--text);
    font-weight: 500;
    white-space: nowrap;
}

/* ─── Toolbar ────────────────────────────────────────────── */

.map-toolbar {
    padding: 14px 16px;
    margin-bottom: 16px;
}

.map-toolbar__row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.map-toolbar__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: auto;
}

/* ─── Field (label + input) ──────────────────────────────── */

.map-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.map-field__label {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.map-field__input {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    min-width: 220px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.map-field__input:focus {
    outline: none;
    border-color: var(--primary);
    /* 🟢 ADR-0061: было color-mix(--primary 20%, transparent) */
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.20);
}

.map-field__input:hover:not(:disabled):not(:focus) {
    /* 🟢 ADR-0061: было color-mix(--border 60%, --text 40%) */
    border-color: var(--map-input-border-hover);
}

.map-field__input:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    /* 🟢 ADR-0061: было color-mix(--card-bg 80%, --border 20%) */
    background: var(--card-bg);
    background-image: linear-gradient(
        rgba(var(--border-rgb), 0.20),
        rgba(var(--border-rgb), 0.20)
    );
}

/* ─── Provider switcher ──────────────────────────────────── */

.map-field--provider {
    padding-left: 10px;
    border-left: 3px solid var(--primary);
    border-radius: 2px;
}

.map-field--provider .map-field__label {
    color: var(--text);
    text-transform: none;
    letter-spacing: 0;
    font-size: 12px;
    font-weight: 600;
}

.map-field__input--provider {
    min-width: 260px;
    font-weight: 500;
    font-size: 0.9rem;
    padding-right: 28px;
    background-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.map-field__input--provider:disabled {
    border-left-color: var(--muted);
    opacity: 0.6;
}

.map-field__badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 8px;
    /* 🟢 ADR-0061: было color-mix(--card-bg 60%, --border 40%) */
    background: var(--map-badge-bg);
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2px;
    text-transform: none;
    vertical-align: middle;
}

/* ─── North button ───────────────────────────────────────── */

.map-north {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.map-north__icon {
    display: inline-block;
    font-size: 1em;
    transition: transform 0.3s ease;
}

.map-north__label {
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    min-width: 3.2em;
    text-align: left;
}

.map-north.is-active {
    border-color: var(--primary);
    color: var(--primary);
    /* 🟢 ADR-0061: было color-mix(--primary 10%, transparent) */
    background: rgba(var(--primary-rgb), 0.10);
}

.map-north.is-active:hover {
    /* 🟢 ADR-0061: было color-mix(--primary 18%, transparent) */
    background: rgba(var(--primary-rgb), 0.18);
}

.map-north.is-active .map-north__icon {
    animation: map-north-pulse 2s ease-in-out infinite;
}

@keyframes map-north-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.12); }
}

/* ─── Crosshair toggle button ────────────────────────────── */

.map-crosshair-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.map-crosshair-toggle__icon {
    display: inline-block;
    font-size: 1.15em;
    line-height: 1;
}

.map-crosshair-toggle.is-active {
    border-color: var(--primary);
    color: var(--primary);
    /* 🟢 ADR-0061: было color-mix(--primary 10%, transparent) */
    background: rgba(var(--primary-rgb), 0.10);
}

.map-crosshair-toggle.is-active:hover {
    /* 🟢 ADR-0061: было color-mix(--primary 18%, transparent) */
    background: rgba(var(--primary-rgb), 0.18);
}

/* ─── Status line ────────────────────────────────────────── */

.map-toolbar__status {
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    background: var(--card-bg-hover);
    border-left: 3px solid var(--primary);
    font-size: 0.85rem;
    line-height: 1.5;
    word-break: break-word;
}

.map-toolbar__status--ok {
    border-left-color: var(--success);
}

.map-toolbar__status--warn {
    border-left-color: var(--warning);
}

.map-toolbar__status--error {
    border-left-color: var(--danger);
}

/* ─── Map container + crosshair ──────────────────────────── */

.map-container {
    position: relative;
    padding: 0;
    overflow: hidden;
}

.map-canvas {
    width: 100%;
    height: 70vh;
    min-height: 480px;
    background: #0e1116;
}

.map-canvas[hidden] { display: none; }

.map-crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-left: -20px;
    margin-top: -20px;
    pointer-events: none;
    z-index: 5;
    color: rgba(255, 255, 255, 0.85);
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.75))
            drop-shadow(0 0 1px rgba(0, 0, 0, 0.5));
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.map-crosshair.is-visible { display: block; opacity: 1; }

.map-crosshair__svg { display: block; width: 100%; height: 100%; }

.map-crosshair__ring,
.map-crosshair__line { stroke: currentColor; stroke-linecap: round; }

.map-crosshair__dot { fill: currentColor; }

/* Канон — только [data-theme="light"] (атрибут на <html>). */
[data-theme="light"] .map-crosshair {
    color: rgba(20, 20, 20, 0.85);
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.9))
            drop-shadow(0 0 1px rgba(255, 255, 255, 0.6));
}

/* ─── Coordinates display ────────────────────────────────── */

.map-coords {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 8px 0 0;
    padding: 8px 12px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--text);
    user-select: none;
}

.map-coords__item {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    white-space: nowrap;
}

.map-coords__item:hover {
    /* 🟢 ADR-0061: было color-mix(--primary 10%, transparent) */
    background: rgba(var(--primary-rgb), 0.10);
}
.map-coords__item:active {
    /* 🟢 ADR-0061: было color-mix(--primary 18%, transparent) */
    background: rgba(var(--primary-rgb), 0.18);
}
.map-coords__item.is-copied {
    /* 🟢 ADR-0061: было color-mix(--success 20%, transparent) */
    background: rgba(var(--success-rgb), 0.20);
    animation: map-coords-flash 0.9s ease;
}

@keyframes map-coords-flash {
    0%   {
        /* 🟢 ADR-0061: было color-mix(--success 35%, transparent) */
        background: rgba(var(--success-rgb), 0.35);
    }
    100% {
        /* 🟢 ADR-0061: было color-mix(--success 20%, transparent) */
        background: rgba(var(--success-rgb), 0.20);
    }
}

.map-coords__label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.map-coords__value {
    font-family: ui-monospace, "SF Mono", "Consolas", monospace;
    font-size: 12.5px;
    color: var(--text);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.map-coords__sep { color: var(--muted); opacity: 0.5; user-select: none; }
.map-coords__hint {
    margin-left: auto;
    color: var(--muted);
    font-size: 10.5px;
    font-style: italic;
    opacity: 0.75;
}

/* ═══ NSPD settings (admin-only, на ?action=map) ═════════ */

.map-nspd-settings {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    /* 🟢 ADR-0061: было color-mix(--primary 5%, --card-bg) */
    background: var(--card-bg);
    background-image: linear-gradient(
        rgba(var(--primary-rgb), 0.05),
        rgba(var(--primary-rgb), 0.05)
    );
    /* 🟢 ADR-0061: было color-mix(--primary 25%, --border) */
    border: 1px solid var(--map-nspd-border);
}

.map-nspd-settings > summary {
    cursor: pointer;
    user-select: none;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.map-nspd-settings > summary::-webkit-details-marker { display: none; }

.map-nspd-settings > summary::before {
    content: '▸';
    display: inline-block;
    transition: transform 0.15s ease;
    font-size: 10px;
}

.map-nspd-settings[open] > summary::before { content: '▾'; }

.map-nspd-settings[open] > summary { margin-bottom: 10px; }

.map-nspd-settings__row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.map-nspd-settings__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.map-nspd-settings__label {
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.map-nspd-settings__input {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text);
    font-family: ui-monospace, "SF Mono", "Consolas", monospace;
    font-size: 0.9rem;
    min-width: 120px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.map-nspd-settings__input:focus {
    outline: none;
    border-color: var(--primary);
    /* 🟢 ADR-0061: было color-mix(--primary 20%, transparent) */
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.20);
}

.map-nspd-settings__input:hover:not(:focus):not(:disabled) {
    /* 🟢 ADR-0061: было color-mix(--border 60%, --text 40%) */
    border-color: var(--map-input-border-hover);
}

.map-nspd-settings__input:invalid {
    border-color: var(--danger);
}

.map-nspd-settings__actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-left: auto;
}

.map-nspd-settings__hint {
    margin: 10px 0 0;
    font-size: 11.5px;
    line-height: 1.55;
}

.map-nspd-settings__hint code {
    font-family: ui-monospace, "SF Mono", "Consolas", monospace;
    font-size: 11.5px;
    padding: 1px 5px;
    border-radius: 3px;
    /* 🟢 ADR-0061: было color-mix(--card-bg 60%, --border 40%) */
    background: var(--map-badge-bg);
    color: var(--text);
}

/* ─── MapLibre controls (theme overrides) ────────────────── */

.maplibregl-ctrl-attrib,
.maplibregl-ctrl-attrib a {
    color: var(--muted) !important;
    background: rgba(0, 0, 0, 0.5) !important;
    font-size: 11px;
}

.maplibregl-ctrl-scale {
    background: rgba(14, 17, 22, 0.75) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
    font-size: 10px;
    font-family: ui-monospace, "SF Mono", "Consolas", monospace;
    padding: 1px 6px;
    border-radius: 3px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.maplibregl-ctrl-group {
    background: var(--card-bg) !important;
    border: 1px solid var(--border) !important;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.maplibregl-ctrl-group button { color: var(--text) !important; }

.maplibregl-ctrl-group button:hover {
    background: var(--card-bg-hover) !important;
}

.maplibregl-popup-content {
    background: var(--card-bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.maplibregl-popup-tip { border-top-color: var(--card-bg); }

/* ─── Device marker ──────────────────────────────────────── */

.map-marker {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: transform 0.15s ease;
}

.map-marker:hover { transform: scale(1.1); }
.map-marker--offline { background: var(--muted); }

/* ═══════════════════════════════════════════════════════════
 * Tile brouser (?action=map_brouser)
 * ═══════════════════════════════════════════════════════════ */

.map-brouser { max-width: 100%; }

.map-brouser .map-toolbar__row + .map-toolbar__row {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}

/* ─── Tabs ───────────────────────────────────────────────── */

.map-brouser__tabs { gap: 8px; align-items: center; }

.map-brouser__tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.map-brouser__tab.is-active {
    border-color: var(--primary);
    color: var(--primary);
    /* 🟢 ADR-0061: было color-mix(--primary 10%, transparent) */
    background: rgba(var(--primary-rgb), 0.10);
}

.map-brouser__tab.is-active:hover {
    /* 🟢 ADR-0061: было color-mix(--primary 18%, transparent) */
    background: rgba(var(--primary-rgb), 0.18);
}

.map-brouser__mode-hint {
    margin-left: 4px;
    font-size: 11.5px;
    font-style: italic;
    align-self: center;
}

/* ─── URL field ──────────────────────────────────────────── */

.map-field--brouser-url { flex: 1 1 480px; min-width: 0; }

.map-brouser__url-input {
    width: 100%;
    min-width: 0;
    font-family: ui-monospace, "SF Mono", "Consolas", monospace;
    font-size: 12.5px;
    letter-spacing: 0.2px;
}

/* ─── Saved-list field ───────────────────────────────────── */

.map-field--brouser-saved { flex: 1 1 420px; min-width: 0; }

.map-brouser__saved-select {
    width: 100%;
    min-width: 0;
    font-family: ui-monospace, "SF Mono", "Consolas", monospace;
    font-size: 12.5px;
}

/* ─── Page-info ──────────────────────────────────────────── */

.map-brouser__page-info {
    margin-top: 10px;
    padding: 6px 10px;
    border-radius: 6px;
    /* 🟢 ADR-0061: было color-mix(--primary 8%, transparent) */
    background: rgba(var(--primary-rgb), 0.08);
    border-left: 3px solid var(--primary);
    font-size: 12.5px;
    display: flex;
    gap: 8px;
    align-items: baseline;
    flex-wrap: wrap;
}

.map-brouser__page-info-label {
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-size: 11px;
}

.map-brouser__page-info-value {
    font-family: ui-monospace, "SF Mono", "Consolas", monospace;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

/* ─── iframe ─────────────────────────────────────────────── */

.map-brouser__iframe {
    width: 100%;
    height: 70vh;
    min-height: 480px;
    border: 0;
    background: #0e1116;
    display: none;
}

.map-brouser__iframe:not([hidden]) { display: block; }

/* ─── Headers editor ─────────────────────────────────────── */

.map-brouser__headers {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    /* 🟢 ADR-0061: было color-mix(--card-bg 92%, --border 8%) */
    background: var(--card-bg);
    background-image: linear-gradient(
        rgba(var(--border-rgb), 0.08),
        rgba(var(--border-rgb), 0.08)
    );
    border: 1px solid var(--border);
}

.map-brouser__headers > summary {
    cursor: pointer;
    user-select: none;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.map-brouser__headers > summary::-webkit-details-marker { display: none; }

.map-brouser__headers > summary::before {
    content: '▸';
    display: inline-block;
    transition: transform 0.15s ease;
    font-size: 10px;
}

.map-brouser__headers[open] > summary::before { content: '▾'; }

.map-brouser__headers[open] > summary {
    margin-bottom: 10px;
    color: var(--text);
}

.map-brouser__headers-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.map-brouser__headers-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.map-brouser__headers-label {
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.map-brouser__headers-label code {
    text-transform: none;
    letter-spacing: 0;
    color: var(--muted);
    font-family: ui-monospace, "SF Mono", "Consolas", monospace;
    font-size: 11px;
    background: transparent;
    padding: 0;
}

.map-brouser__headers-input {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text);
    font-family: ui-monospace, "SF Mono", "Consolas", monospace;
    font-size: 12px;
    letter-spacing: 0.2px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.map-brouser__headers-input:focus {
    outline: none;
    border-color: var(--primary);
    /* 🟢 ADR-0061: было color-mix(--primary 20%, transparent) */
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.20);
}

.map-brouser__headers-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.map-brouser__headers-hint {
    margin-left: auto;
    font-size: 11px;
    font-style: italic;
    opacity: 0.8;
}

/* ─── Appearance ─────────────────────────────────────────── */

.map-brouser__appearance {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    /* 🟢 ADR-0061: было color-mix(--card-bg 92%, --border 8%) */
    background: var(--card-bg);
    background-image: linear-gradient(
        rgba(var(--border-rgb), 0.08),
        rgba(var(--border-rgb), 0.08)
    );
    border: 1px solid var(--border);
}

.map-brouser__appearance > summary {
    cursor: pointer;
    user-select: none;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.map-brouser__appearance > summary::-webkit-details-marker { display: none; }

.map-brouser__appearance > summary::before {
    content: '▸';
    display: inline-block;
    transition: transform 0.15s ease;
    font-size: 10px;
}

.map-brouser__appearance[open] > summary::before { content: '▾'; }

.map-brouser__appearance[open] > summary {
    margin-bottom: 10px;
    color: var(--text);
}

.map-brouser__appearance-row {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.map-brouser__appearance-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex-shrink: 0;
}

.map-brouser__appearance-label {
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.map-brouser__appearance-color {
    width: 48px;
    height: 32px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.map-brouser__appearance-color:hover {
    /* 🟢 ADR-0061: было color-mix(--border 60%, --text 40%) */
    border-color: var(--map-input-border-hover);
}

.map-brouser__appearance-color:focus {
    outline: none;
    border-color: var(--primary);
    /* 🟢 ADR-0061: было color-mix(--primary 20%, transparent) */
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.20);
}

.map-brouser__appearance-color::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 4px;
    overflow: hidden;
}

.map-brouser__appearance-color::-webkit-color-swatch {
    border: 0;
    border-radius: 4px;
}

.map-brouser__appearance-color::-moz-color-swatch {
    border: 0;
    border-radius: 4px;
}

.map-brouser__appearance-presets {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.map-brouser__preset {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    min-width: 64px;
    text-align: center;
}

.map-brouser__preset:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.map-brouser__preset:active { transform: translateY(0); }

.map-brouser__preset:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.map-brouser__appearance-hint {
    margin-left: auto;
    font-size: 11px;
    font-style: italic;
    opacity: 0.8;
}

/* ─── Probe / Scanner ────────────────────────────────────── */

.map-brouser__probe-row {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    /* 🟢 ADR-0061: было color-mix(--success 8%, transparent) */
    background: rgba(var(--success-rgb), 0.08);
    border-left: 3px solid var(--success);
}

.map-field--brouser-probe { flex: 1 1 480px; min-width: 0; }

.map-brouser__probe-select {
    width: 100%;
    min-width: 0;
    font-family: ui-monospace, "SF Mono", "Consolas", monospace;
    font-size: 12.5px;
}

/* ═══ AlpineQuest (.map-brouser__alpinequest*) ═══════════ */

.map-brouser__alpinequest {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    /* 🟢 ADR-0061: было color-mix(--primary 6%, --card-bg) */
    background: var(--card-bg);
    background-image: linear-gradient(
        rgba(var(--primary-rgb), 0.06),
        rgba(var(--primary-rgb), 0.06)
    );
    /* 🟢 ADR-0061: было color-mix(--primary 30%, --border) */
    border: 1px solid var(--map-alpinequest-border);
}

.map-brouser__alpinequest > summary {
    cursor: pointer;
    user-select: none;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.map-brouser__alpinequest > summary::-webkit-details-marker { display: none; }

.map-brouser__alpinequest > summary::before {
    content: '▸';
    display: inline-block;
    transition: transform 0.15s ease;
    font-size: 10px;
}

.map-brouser__alpinequest[open] > summary::before { content: '▾'; }

.map-brouser__alpinequest[open] > summary {
    margin-bottom: 10px;
}

.map-brouser__alpinequest-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.map-brouser__alpinequest-hint {
    font-size: 12px;
    line-height: 1.55;
    margin: 0;
}

.map-brouser__alpinequest-create {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.map-brouser__alpinequest-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 280px;
    min-width: 0;
}

.map-brouser__alpinequest-label {
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.map-brouser__alpinequest-input {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.map-brouser__alpinequest-input:focus {
    outline: none;
    border-color: var(--primary);
    /* 🟢 ADR-0061: было color-mix(--primary 20%, transparent) */
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.20);
}

.map-brouser__alpinequest-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.map-brouser__alpinequest-token {
    padding: 12px;
    border-radius: 6px;
    /* 🟢 ADR-0061: было color-mix(--warning 10%, --card-bg) */
    background: var(--card-bg);
    background-image: linear-gradient(
        rgba(var(--warning-rgb), 0.10),
        rgba(var(--warning-rgb), 0.10)
    );
    border-left: 3px solid var(--warning);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.map-brouser__alpinequest-warning {
    margin: 0;
    color: var(--warning);
    font-size: 12px;
    font-weight: 600;
}

.map-brouser__alpinequest-token-value {
    display: block;
    padding: 8px 10px;
    border-radius: 4px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    font-family: ui-monospace, "SF Mono", "Consolas", monospace;
    font-size: 11.5px;
    word-break: break-all;
    user-select: all;
    cursor: text;
    color: var(--text);
}

.map-brouser__alpinequest-token-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.map-brouser__alpinequest-list {
    overflow-x: auto;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.map-brouser__alpinequest-empty {
    padding: 12px;
    text-align: center;
    font-size: 12.5px;
}

.map-brouser__alpinequest-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.map-brouser__alpinequest-table th,
.map-brouser__alpinequest-table td {
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.map-brouser__alpinequest-table th {
    /* 🟢 ADR-0061: было color-mix(--card-bg 85%, --border 15%) */
    background: var(--card-bg);
    background-image: linear-gradient(
        rgba(var(--border-rgb), 0.15),
        rgba(var(--border-rgb), 0.15)
    );
    font-weight: 600;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.map-brouser__alpinequest-table tr:last-child td { border-bottom: none; }

.map-brouser__alpinequest-table code {
    font-family: ui-monospace, "SF Mono", "Consolas", monospace;
    font-size: 11.5px;
    color: var(--text);
    background: transparent;
    padding: 0;
}

.map-brouser__alpinequest-status--active  { color: var(--success); font-weight: 600; }
.map-brouser__alpinequest-status--revoked { color: var(--danger);  font-weight: 600; }
.map-brouser__alpinequest-status--expired { color: var(--warning); font-weight: 600; }

/* ═══ Mobile ═════════════════════════════════════════════ */

@media (max-width: 768px) {
    .map-toolbar__row {
        flex-direction: column;
        align-items: stretch;
    }

    .map-field--provider {
        order: -1;
        padding-left: 0;
        padding-top: 10px;
        border-left: none;
        border-top: 3px solid var(--primary);
    }

    .map-field__input,
    .map-field__input--provider {
        min-width: 0;
        width: 100%;
        font-size: 16px;
    }

    .map-field--brouser-url,
    .map-field--brouser-saved,
    .map-field--brouser-probe { flex: 1 1 100%; }

    .map-brouser__url-input,
    .map-brouser__saved-select,
    .map-brouser__probe-select { font-size: 14px; }

    .map-brouser__mode-hint { display: none; }

    .map-brouser__iframe {
        height: 60vh;
        min-height: 360px;
    }

    .map-brouser__headers-hint { display: none; }

    .map-brouser__headers-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .map-brouser__headers-actions .btn { width: 100%; }

    .map-brouser__appearance-row { gap: 10px; }
    .map-brouser__appearance-hint { display: none; }
    .map-brouser__appearance-presets { width: 100%; }
    .map-brouser__preset {
        flex: 1 1 0;
        min-width: 0;
        padding: 8px 6px;
        font-size: 11.5px;
    }

    .map-toolbar__actions {
        margin-left: 0;
        width: 100%;
    }

    .map-toolbar__actions .btn {
        flex: 1 1 auto;
        text-align: center;
        justify-content: center;
    }

    .map-canvas {
        height: 60vh;
        min-height: 360px;
    }

    .map-page__lead,
    .map-page__hint { font-size: 0.85rem; }

    .map-coords {
        padding: 6px 10px;
        font-size: 11.5px;
        gap: 8px;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .map-coords::-webkit-scrollbar { display: none; }
    .map-coords__hint { display: none; }
    .map-coords__value { font-size: 11.5px; }

    .map-north__label,
    .map-crosshair-toggle__label { display: none; }

    .map-north,
    .map-crosshair-toggle {
        padding-left: 12px;
        padding-right: 12px;
    }

    .map-nspd-settings__row {
        flex-direction: column;
        align-items: stretch;
    }
    .map-nspd-settings__input {
        min-width: 0;
        width: 100%;
        font-size: 16px;
    }
    .map-nspd-settings__actions {
        margin-left: 0;
        width: 100%;
    }
    .map-nspd-settings__actions .btn {
        width: 100%;
    }
    .map-nspd-settings__hint {
        font-size: 11px;
    }

    .map-brouser__alpinequest-create {
        flex-direction: column;
        align-items: stretch;
    }
    .map-brouser__alpinequest-actions { width: 100%; }
    .map-brouser__alpinequest-actions .btn { flex: 1 1 auto; }
    .map-brouser__alpinequest-token-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .map-brouser__alpinequest-token-actions .btn {
        width: 100%;
        text-align: center;
    }
    .map-brouser__alpinequest-table th,
    .map-brouser__alpinequest-table td {
        padding: 4px 6px;
        font-size: 11px;
    }
}

/* ─── Mobile small (Phase 1: 480 → 640) ───────────────── */

@media (max-width: 640px) {
    .map-toolbar { padding: 12px; }
    .map-toolbar__actions { flex-direction: column; }
    .map-toolbar__actions .btn { width: 100%; }

    .map-canvas { height: 55vh; min-height: 320px; }
    .map-coords__label { font-size: 10px; }
    .map-coords__value { font-size: 11px; }

    .map-crosshair {
        width: 32px;
        height: 32px;
        margin-left: -16px;
        margin-top: -16px;
    }

    .map-brouser__url-input,
    .map-brouser__saved-select,
    .map-brouser__probe-select {
        font-size: 13px;
        padding: 8px 10px;
    }

    .map-brouser__iframe {
        height: 55vh;
        min-height: 320px;
    }

    .map-brouser__headers-input { font-size: 12.5px; }

    .map-brouser__preset {
        flex: 1 1 calc(50% - 3px);
        padding: 8px 4px;
        font-size: 11px;
    }
}

/* ─── Prefers-reduced-motion ─────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .map-field__input,
    .map-marker,
    .map-coords__item,
    .map-north,
    .map-crosshair-toggle,
    .map-crosshair,
    .map-nspd-settings > summary::before,
    .map-nspd-settings__input,
    .map-brouser__tab,
    .map-brouser__headers > summary::before,
    .map-brouser__appearance > summary::before,
    .map-brouser__alpinequest > summary::before,
    .map-brouser__preset,
    .map-brouser__appearance-color {
        transition: none;
    }

    .map-coords__item.is-copied { animation: none; }
    .map-north.is-active .map-north__icon { animation: none; }
}

/* ============================================================
 * END OF FILE r55-map.css v1.4.0
 * ============================================================ */

/* ============================================================
   ServerPanel — v2.0.0 (CodingStyleCSS Phase 1 hygiene)
   ============================================================

   @version 2.0.0 (2026-10-13, Phase 1 hygiene):
     • 🟢 УДАЛЕНЫ все `var(--x, #hardcoded-fallback)`, где
       fallback ≠ токен (CodingStyleCSS §3.3 anti-pattern):
       var(--success, #3fb950) → var(--success)
       var(--warning, #f0a020) → var(--warning)
       var(--danger,  #e74c3c) → var(--danger)
       var(--card-bg-hover, color-mix(...)) → var(--card-bg-hover)
       var(--z-toast, 10000) → var(--z-toast)
       (Fallback был dead-code: токен всегда определён в
        01-variables.css / 07-mobile-shell.css → визуально
        ничего не меняется.)
     • 🟢 Оставлены 2 легитимных fallback'а:
       var(--pct, 0%)     — inline CSS-var, ставит JS (§3.3)
     • ✅ Логика v1.5.4 не изменена.

   @version 1.5.4 (2026-10-12, cron task list):
     - 🆕 +SECTION 24: cron-таблица, task-list, schedule,
       human, user, command (используется в cron.php v1.6.0).

   @version 1.5.3 (2026-10-12, comment-hygiene).

   @version 1.5.2 (2026-10-12, settings-v1.4.0 support).

   @version 1.5.1 (2026-10-12, sites-v1.5.0 support).

   @version 1.5.0 (2026-10-12, backups-sections).

   @version 1.4.1 (2026-10-11, audit).

   @version 1.4.0 (2026-10-10, opcache+toast).

   @version 1.3.3 (2026-10-10, a11y polish).

   @version 1.3.2 (2026-10-10, audit).

   @version 1.3.1 (2026-10-10, audit — remove !important).

   BEM conventions. Important not allowed (except .hidden/.muted from core).
   ============================================================ */

/* ─── Tabs (внутренняя навигация модуля) ────────────────── */
.server-panel-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    padding: 6px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow-x: auto;
    flex-wrap: wrap;
}

.server-panel-tabs__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.server-panel-tabs__item:hover {
    background: var(--card-bg-hover);
}

.server-panel-tabs__item.is-active {
    background: var(--primary);
    color: #fff;
}

.server-panel-tabs__icon  { font-size: 1rem; }
.server-panel-tabs__label { font-size: 0.9rem; }

/* ─── Panel root ────────────────────────────────────────── */
.server-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.server-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.server-panel__title {
    margin: 0;
    font-size: 1.5rem;
}

.server-panel__meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.server-panel__generated {
    font-size: 0.8rem;
    color: var(--muted);
}

/* ─── Notices ───────────────────────────────────────────── */
.server-panel__notice {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
    border-left: 4px solid var(--border);
    background: var(--card-bg-hover);
}

.server-panel__notice--info {
    background: var(--card-bg-hover);
    border-left-color: var(--primary);
}

.server-panel__notice--success {
    background: rgba(63, 185, 80, 0.08);
    border-left-color: var(--success);
}

.server-panel__notice--warning {
    background: rgba(240, 160, 32, 0.08);
    border-left-color: var(--warning);
}

.server-panel__notice--error {
    background: rgba(231, 76, 60, 0.08);
    border-left-color: var(--danger);
    color: var(--danger);
}

.server-panel__notice code {
    background: var(--card-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
}

/* ─── Grid + Cards ──────────────────────────────────────── */
.server-panel__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.server-panel__card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
}

.server-panel__card--wide {
    grid-column: 1 / -1;
}

.server-panel__card-title {
    margin: 0 0 12px 0;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* ─── Key-Value table ───────────────────────────────────── */
.server-panel__kv {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.server-panel__kv td {
    padding: 4px 0;
    vertical-align: top;
}

.server-panel__kv td:first-child {
    color: var(--muted);
    width: 40%;
}

.server-panel__kv td:last-child {
    text-align: right;
    font-weight: 500;
}

.server-panel__kv--small {
    font-size: 0.8rem;
    margin-top: 8px;
}

.server-panel__kv code {
    background: var(--card-bg-hover);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
}

.server-panel__kv--settings td:first-child { width: 40%; text-align: left; }
.server-panel__kv--settings td:last-child  { text-align: left; }

/* ─── Metrics (load) ────────────────────────────────────── */
.server-panel__metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.server-panel__metric {
    text-align: center;
    padding: 8px 4px;
    background: var(--card-bg-hover);
    border-radius: 6px;
}

.server-panel__metric-label {
    font-size: 0.7rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.server-panel__metric-value {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 2px;
}

/* ─── Bars (RAM, disk) ──────────────────────────────────── */
.server-panel__bar {
    position: relative;
    height: 12px;
    border-radius: 6px;
    background: var(--card-bg-hover);
    overflow: hidden;
    margin: 8px 0;
}

/* ✅ легитимный fallback: --pct ставится inline JS (§3.3) */
.server-panel__bar-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--pct, 0%);
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
}

.server-panel__bar--warn .server-panel__bar-fill { background: var(--warning); }
.server-panel__bar--err  .server-panel__bar-fill { background: var(--danger); }

.server-panel__bar-label {
    font-size: 0.8rem;
    color: var(--muted);
    text-align: right;
}

.server-panel__path {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─── Badges ────────────────────────────────────────────── */
.server-panel__badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}

.server-panel__badge--ok   { background: rgba(63, 185, 80, 0.15);   color: var(--success); }
.server-panel__badge--warn { background: rgba(240, 160, 32, 0.15);  color: var(--warning); }
.server-panel__badge--err  { background: rgba(231, 76, 60, 0.15);   color: var(--danger); }

/* ─── Extensions ────────────────────────────────────────── */
.server-panel__extensions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ─── Services table (используется и в diagnostics) ─────── */
.server-panel__services {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.server-panel__services th,
.server-panel__services td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.server-panel__services thead th {
    background: var(--card-bg-hover);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.server-panel__services td:last-child { white-space: nowrap; }

.server-panel__services code {
    background: var(--card-bg-hover);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
}

/* ─── Buttons ───────────────────────────────────────────── */
.server-panel__btn {
    display: inline-block;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--card-bg);
    color: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.15s ease;
    text-decoration: none;
}

.server-panel__btn:hover:not([disabled]) {
    background: var(--card-bg-hover);
}

.server-panel__btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.server-panel__btn--warn {
    border-color: var(--warning);
    color: var(--warning);
}

.server-panel__btn--primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.server-panel__btn--sm {
    padding: 2px 8px;
    font-size: 0.75rem;
}

.server-panel__btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
}

.server-panel__actions-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* ─── Charts ────────────────────────────────────────────── */
.server-panel__charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.server-panel__chart {
    background: var(--card-bg-hover);
    border-radius: 6px;
    padding: 8px;
}

.server-panel__chart-title {
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.server-panel__chart-svg {
    width: 100%;
    height: 100px;
    display: block;
    background: transparent;
}

.server-panel__chart-svg polyline {
    fill: none;
    stroke: var(--primary);
    stroke-width: 1.5;
    vector-effect: non-scaling-stroke;
}

.server-panel__chart-svg polyline.sp-chart--warn { stroke: var(--warning); }
.server-panel__chart-svg polyline.sp-chart--err  { stroke: var(--danger); }

.server-panel__chart-svg line.sp-chart-axis {
    stroke: var(--border);
    stroke-dasharray: 2 2;
    vector-effect: non-scaling-stroke;
}

.server-panel__chart-svg text.sp-chart-label {
    font-size: 8px;
    fill: var(--muted);
}

/* ─── Settings ─────────────────────────────────────────── */
.server-panel__settings-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.server-panel__settings-textarea {
    width: 100%;
    min-height: 240px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #1e1e1e;
    color: #d4d4d4;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    resize: vertical;
}

.server-panel__input {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--card-bg);
    color: inherit;
    font-size: 0.9rem;
    width: 120px;
}

.server-panel__checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    cursor: pointer;
}

/* ─── Alerts banner (страницы diagnostics/dashboard) ────── */
.server-panel-alert {
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid var(--border);
    background: var(--card-bg-hover);
}

.server-panel-alert--warning {
    border-left-color: var(--warning);
    background: rgba(240, 160, 32, 0.08);
}

.server-panel-alert--error {
    border-left-color: var(--danger);
    background: rgba(231, 76, 60, 0.08);
}

.server-panel-alert--critical {
    border-left-color: var(--danger);
    background: rgba(231, 76, 60, 0.15);
}

.server-panel-alert__title {
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.server-panel-alert__list {
    margin: 0;
    padding-left: 20px;
    font-size: 0.9rem;
}

.server-panel-alert__item { margin: 4px 0; }
.server-panel-alert__item--critical { font-weight: 600; }

/* ─── Form row (inline editor) ─────────────────────────── */
.server-panel__form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
}

.server-panel__form-row label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.8rem;
    color: var(--muted);
}

.server-panel__form-row .server-panel__input        { width: 180px; }
.server-panel__form-row .server-panel__input--wide  { width: 280px; }

/* ─── Range toggle (24h / 7d / 30d) ────────────────────── */
.server-panel__range-toggle {
    display: inline-flex;
    gap: 2px;
    margin-left: 12px;
}

.server-panel__range-toggle .server-panel__btn.is-active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ─── Errors / cron / db-link ──────────────────────────── */
.server-panel__error-msg {
    font-size: 0.8rem;
    max-width: 600px;
    word-break: break-word;
    white-space: normal;
}

.server-panel__cron-line {
    background: var(--card-bg-hover);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    cursor: text;
}

.server-panel__db-link {
    text-decoration: none;
    color: inherit;
}

.server-panel__db-link:hover code {
    background: var(--primary);
    color: #fff;
}

/* ─── Settings/SSL/Deploy: select со стрелкой ──────────── */
.server-panel select.server-panel__input {
    appearance: none;
    -webkit-appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                      linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 14px) calc(1em + 2px),
                         calc(100% - 9px) calc(1em + 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 30px;
}

/* ─── Diagnostics: колонки таблиц ──────────────────────── */
.server-panel__diag-table td {
    vertical-align: middle;
}

.server-panel__diag-table td:nth-child(2) {
    white-space: nowrap;
}

.server-panel__diag-table td:nth-child(4) code {
    word-break: break-all;
}

/* ─── Diagnostics: fix-команда (клик-копирование) ──────── */
.server-panel__diag-fix {
    display: inline-block;
    background: rgba(240, 160, 32, 0.1);
    color: var(--warning);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    line-height: 1.3;
    cursor: copy;
    transition: background 0.15s ease;
}

.server-panel__diag-fix:hover {
    background: rgba(240, 160, 32, 0.2);
}

.server-panel__diag-fix:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.sp-diag-row--warning {
    background: rgba(240, 160, 32, 0.06);
}

.sp-diag-row--error,
.sp-diag-row--critical {
    background: rgba(231, 76, 60, 0.06);
}

/* Highlight — повышенная специфичность вместо !important */
.server-panel__diag-table tr.sp-diag-row--highlight {
    background: rgba(240, 160, 32, 0.25);
    transition: background 0.3s ease;
}

/* ─── Diagnostics: колонки таблиц (ширины) ─────────────── */
.server-panel__col-status { width: 50px; }
.server-panel__col-check  { width: 22%; }
.server-panel__col-fix    { width: 28%; }
.server-panel__col-num    { width: 80px; text-align: right; }

/* ─── Утилиты для шаблонов ─────────────────────────────── */
.server-panel__hint {
    margin: 6px 0 0 0;
    font-size: 0.8rem;
}

.server-panel__hint-sm {
    font-size: 0.8rem;
    font-style: italic;
}

.server-panel__text-xs {
    font-size: 0.75rem;
    margin-top: 2px;
}

.server-panel__group-count {
    font-weight: 400;
    font-size: 0.8rem;
}

.server-panel__ml-auto {
    margin-left: auto;
}

.server-panel__mb-12 {
    margin-bottom: 12px;
}

.server-panel__mt-12 {
    margin-top: 12px;
}

.server-panel__chart-note {
    font-size: 0.75rem;
    font-weight: 400;
    margin-left: auto;
}

/* ═══════════════════════════════════════════════════════════
 * v1.5.0: Секции страницы «Бэкапы» (панель + сайты)
 * ═══════════════════════════════════════════════════════════ */

.server-panel__section-head {
    margin-bottom: 12px;
}

.server-panel__section-title {
    margin: 0 0 4px 0;
    font-size: 1.05rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.server-panel__section-desc {
    margin: 0 0 10px 0;
    font-size: 0.85rem;
    line-height: 1.5;
}

.server-panel__section-desc code {
    background: var(--card-bg-hover);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
}

.server-panel__empty {
    padding: 16px 0;
    text-align: center;
    font-size: 0.9rem;
    font-style: italic;
}

.server-panel__form-hint {
    align-self: flex-end;
    padding-bottom: 6px;
    font-size: 0.8rem;
}

.server-panel__actions-row--top {
    margin-top: 12px;
}

.server-panel__col-cb {
    width: 32px;
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════
 * v1.5.1: Sites v1.5.0 — row-actions + label-checkbox
 * ═══════════════════════════════════════════════════════════ */

.server-panel__row-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    justify-content: flex-start;
}

.server-panel__form-row .server-panel__label-checkbox {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    color: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    align-self: flex-end;
    padding-bottom: 6px;
}

.server-panel__form-row .server-panel__label-checkbox input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.server-panel__form-row .server-panel__label-checkbox code {
    background: var(--card-bg-hover);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
    color: var(--text);
}

/* ═══════════════════════════════════════════════════════════
 * v1.5.2: Settings v1.4.0 — inline-form + input--file
 * ═══════════════════════════════════════════════════════════ */

.server-panel__inline-form {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    margin: 0;
}

.server-panel__input--file {
    width: auto;
    max-width: 280px;
    padding: 4px 8px;
    font-size: 0.85rem;
}

/* ═══════════════════════════════════════════════════════════
 * v1.5.4: SECTION 24 · Cron task list (cron.php v1.6.0)
 * ═══════════════════════════════════════════════════════════ */

.server-panel__cron-table td.server-panel__cron-tasks {
    vertical-align: top;
    white-space: normal;
}

.server-panel__cron-task-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.server-panel__cron-task {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 6px 10px;
    border-left: 3px solid var(--primary);
    background: var(--card-bg-hover);
    border-radius: 3px;
}

.server-panel__cron-task-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    line-height: 1.4;
}

.server-panel__cron-schedule {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 0.95em;
    letter-spacing: 0.02em;
    color: var(--primary);
    background: var(--card-bg);
    padding: 1px 6px;
    border-radius: 3px;
    cursor: text;
}

.server-panel__cron-human {
    font-size: 0.92em;
}

.server-panel__cron-user {
    font-size: 0.92em;
    margin-left: auto;
}

.server-panel__cron-user code {
    background: var(--card-bg);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
}

.server-panel__cron-command {
    display: block;
    font-size: 0.82em;
    line-height: 1.5;
    word-break: break-all;
    white-space: pre-wrap;
    cursor: pointer;
    background: var(--card-bg);
    padding: 4px 8px;
    border-radius: 3px;
}

.server-panel__cron-command:hover {
    background: var(--card-bg-hover);
}

/* ─── Toast (bottom-right; SSOT z-index = 07-mobile-shell.css) ───
   Не конфликтует со стандартными тостами (15-modal-toast.css
   -> top-right). */
.server-panel__toasts {
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    right:  calc(20px + env(safe-area-inset-right,  0px));
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: var(--z-toast);
    pointer-events: none;
    max-width: 380px;
    max-height: 50vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.server-panel__toast {
    padding: 10px 14px;
    border-radius: 6px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-left-width: 4px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.4;
    pointer-events: auto;
    flex-shrink: 0;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    word-break: break-word;
    white-space: pre-wrap;
}

.server-panel__toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.server-panel__toast--ok   { border-left-color: var(--success); }
.server-panel__toast--err  { border-left-color: var(--danger);  }
.server-panel__toast--warn { border-left-color: var(--warning); }
.server-panel__toast--info { border-left-color: var(--primary); }

.server-panel__group-title [aria-hidden="true"] {
    margin-right: 0.35rem;
}

/* ─── A11y: reduce motion ───────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .server-panel-tabs__item,
    .server-panel__bar-fill,
    .server-panel__btn,
    .server-panel__diag-fix,
    .server-panel__toast,
    .server-panel__diag-table tr.sp-diag-row--highlight {
        transition: none;
    }
}

/* ─── Mobile ────────────────────────────────────────────── */
@media (max-width: 640px) {
    .server-panel__grid {
        grid-template-columns: 1fr;
    }

    .server-panel__metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .server-panel__services th,
    .server-panel__services td {
        padding: 6px 4px;
        font-size: 0.8rem;
    }

    .server-panel__btn {
        padding: 3px 6px;
        font-size: 0.75rem;
    }

    .server-panel-tabs {
        padding: 4px;
        gap: 2px;
    }

    .server-panel-tabs__item {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .server-panel__charts {
        grid-template-columns: 1fr;
    }

    .server-panel__form-row .server-panel__input,
    .server-panel__form-row .server-panel__input--wide {
        width: 100%;
    }

    .server-panel__range-toggle {
        margin-left: 0;
    }

    .server-panel__col-status,
    .server-panel__col-check,
    .server-panel__col-fix,
    .server-panel__col-num {
        width: auto;
    }

    .server-panel__form-hint {
        align-self: flex-start;
        padding-bottom: 0;
    }

    .server-panel__section-title {
        font-size: 0.95rem;
    }

    .server-panel__form-row .server-panel__label-checkbox {
        align-self: flex-start;
        padding-bottom: 0;
        width: 100%;
    }

    .server-panel__row-actions {
        gap: 3px;
    }

    .server-panel__inline-form {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .server-panel__input--file {
        width: 100%;
        max-width: none;
    }

    .server-panel__toasts {
        left:   calc(12px + env(safe-area-inset-left,  0px));
        right:  calc(12px + env(safe-area-inset-right, 0px));
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        max-width: none;
    }

    .server-panel__cron-task {
        padding: 5px 8px;
    }
    .server-panel__cron-user {
        margin-left: 0;
    }
    .server-panel__cron-command {
        font-size: 0.78em;
    }
}

/* ============================================================
 * END OF FILE r60-server-panel.css v2.0.0
 * ============================================================ */

