/* ============================================================
 * static/css/style.css
 * Ant Legion Helper — корневой styles.css
 * Концепция: «Field Ops Dossier»
 * Тёмная тема — базовая. Светлая — через :root[data-theme="light"].
 *
 * v2:
 *   - Убраны дубли: .theme-toggle, .session-filter, .session-pagination,
 *     .tm-pulse (оставлен один), .tm-empty (один).
 *   - Перенесены классы лэндинга: .navbar-inner, .navbar-logo,
 *     .navbar-title, .navbar-links, .navbar-actions, .btn-install,
 *     .hero, .marquee, .section (лендинг), .eyebrow, .h1, .h2, .lead,
 *     .mono, .btn-*, расширенный .footer-*, .fade-in, .faq-*.
 *   - Добавлены общие классы модулей: .tool-badge-local, .tool-inline-form,
 *     .mj-advice*, .mj-log-details*, .mj-log-pre.
 *   - Добавлены .admin-icon-btn* для admin-таблиц.
 * ============================================================ */

/* ============================================================
 * 1. TOKENS — переменные
 * ============================================================ */
:root {
    /* ── Ground ── */
    --bg:            #0c0b08;
    --bg-soft:       #121109;
    --panel:         #16150e;
    --panel-alt:     #1c1a10;
    --panel-raised:  #201e12;

    /* ── Lines ── */
    --line:          #2c2818;
    --line-soft:     #201e13;
    --line-brass:    rgba(198, 162, 89, 0.35);

    /* ── Accents ── */
    --brass:         #c6a259;
    --brass-light:   #e8d19a;
    --brass-dim:     #8a723c;
    --rust:          #b0501f;
    --rust-light:    #d97a45;

    /* ── Ink ── */
    --ink:           #ece5d3;
    --ink-dim:       #a39c86;
    --ink-faint:     #6f6a58;

    /* ── Status stamps ── */
    --status-testing:      #7fa3b8;
    --status-testing-bg:   rgba(127, 163, 184, 0.12);
    --status-dev:          #c07a5a;
    --status-dev-bg:       rgba(192, 122, 90, 0.12);
    --status-ready:        #86a06a;
    --status-ready-bg:     rgba(134, 160, 106, 0.12);

    /* ── Log accents ── */
    --log-a: var(--brass);
    --log-b: var(--rust-light);
    --log-c: #86a06a;
    --log-d: #7fa3b8;

    /* ── Radii ── */
    --radius-sm: 4px;
    --radius:    8px;

    /* ── Fonts ── */
    --font-display: 'Zilla Slab', 'Georgia', serif;
    --font-body:    'Inter', 'Segoe UI', system-ui, sans-serif;
    --font-mono:    'IBM Plex Mono', 'Consolas', monospace;

    /* ── Shadows ── */
    --shadow-panel: 0 30px 80px rgba(0, 0, 0, 0.55);
    --shadow-card:  0 20px 50px rgba(0, 0, 0, 0.35);
    --shadow-soft:  0 8px 24px rgba(0, 0, 0, 0.25);

    /* ── Legacy (для совместимости с текущими страницами) ── */
    --canvas:         var(--bg);
    --primary:        var(--brass);
    --primary-dark:   var(--brass-dim);
    --surface-card:   var(--panel-alt);
    --surface-dark:   var(--panel);
    --surface-dark-soft: var(--panel-alt);
    --on-dark:        var(--ink);
    --on-dark-soft:   var(--ink-dim);
    --on-primary:     var(--bg);
    --muted:          var(--ink-dim);
    --body:           var(--ink);
    --hairline:       var(--line);
    --error:          var(--rust);
    --accent-teal:    var(--status-ready);
}

/* ── Light theme ── */
:root[data-theme="light"] {
    --bg:            #eee9dc;
    --bg-soft:       #e4dece;
    --panel:         #faf7ef;
    --panel-alt:     #f3eedf;
    --panel-raised:  #fffdf7;

    --line:          #d5cab3;
    --line-soft:     #e4dccb;
    --line-brass:    rgba(135, 100, 35, 0.42);

    --brass:         #8a641d;
    --brass-light:   #6d4d13;
    --brass-dim:     #b79754;
    --rust:          #99471d;
    --rust-light:    #a8572b;

    --ink:           #292519;
    --ink-dim:       #625b49;
    --ink-faint:     #887e6a;

    --status-testing:    #47758e;
    --status-testing-bg: rgba(72, 117, 142, 0.14);
    --status-dev:        #9c5030;
    --status-dev-bg:     rgba(156, 80, 48, 0.14);
    --status-ready:      #4f7139;
    --status-ready-bg:   rgba(79, 113, 57, 0.14);

    --shadow-panel: 0 30px 80px rgba(80, 60, 20, 0.18);
    --shadow-card:  0 20px 50px rgba(80, 60, 20, 0.12);
    --shadow-soft:  0 8px 24px rgba(80, 60, 20, 0.08);
}

/* ============================================================
 * 2. RESET и базовая типографика
 * ============================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    transition: background 0.2s ease, color 0.2s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.3px;
    margin: 0 0 0.6em;
    color: var(--ink);
}

h1 { font-size: clamp(1.9rem, 4.4vw, 2.7rem); text-transform: uppercase; letter-spacing: 0.5px; }
h2 { font-size: clamp(1.3rem, 3.4vw, 1.65rem); text-transform: uppercase; letter-spacing: 0.6px; }
h3 { font-size: 1.28rem; letter-spacing: 0.2px; }
h4 { font-size: 1.1rem; }

p { margin: 0 0 0.9em; }

a {
    color: var(--brass);
    text-decoration: none;
    transition: color 0.15s ease;
}
a:hover { color: var(--brass-light); }

code, pre, kbd, samp {
    font-family: var(--font-mono);
    font-size: 0.92em;
}

pre {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 0.9rem 1rem;
    overflow: auto;
    color: var(--ink);
}

::selection {
    background: var(--brass);
    color: var(--bg);
}

main.flex-grow-1 { flex: 1 0 auto; }
footer.footer {
    flex-shrink: 0;
    margin-top: auto;
}

/* ============================================================
 * 3. Терминал-скроллбары
 * ============================================================ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: var(--panel);
    border-radius: 6px;
}
::-webkit-scrollbar-thumb {
    background: var(--brass-dim);
    border-radius: 6px;
    border: 2px solid var(--panel);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--brass);
}
:root[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: var(--line);
}
:root[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: var(--brass-dim);
}

/* ============================================================
 * 4. Переключатель темы (один раз, без дублей)
 * ============================================================ */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: var(--panel);
    border: 1px solid var(--line);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
    flex-shrink: 0;
}

.theme-toggle:hover { border-color: var(--brass); }

.theme-toggle .theme-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--brass);
    transition: transform 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg);
    font-size: 10px;
    line-height: 1;
}

:root[data-theme="light"] .theme-toggle .theme-thumb {
    transform: translateX(18px);
}

/* ============================================================
 * 5. Navbar (общий + лэндинг)
 * ============================================================ */
.navbar {
    background: var(--panel) !important;
    border-bottom: 1px solid var(--line) !important;
    padding: 0.6rem 0;
}

.navbar-brand {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--ink) !important;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-size: 1.1rem;
}

.navbar-brand .badge {
    background: var(--rust) !important;
    color: var(--ink) !important;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 1.2px;
    padding: 3px 7px;
    border-radius: var(--radius-sm);
}

.navbar-nav .nav-link {
    color: var(--ink-dim) !important;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 0.5rem 0.85rem !important;
    border-radius: var(--radius-sm);
    transition: color 0.15s ease, background 0.15s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--brass) !important;
    background: var(--panel-alt);
}

.navbar .dropdown-menu {
    background: var(--panel-alt);
    border: 1px solid var(--line) !important;
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 0.4rem;
    min-width: 260px;
}

.navbar .dropdown-item {
    color: var(--ink) !important;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.4px;
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.8rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.navbar .dropdown-item:hover,
.navbar .dropdown-item.active {
    background: var(--panel-raised);
    color: var(--brass-light) !important;
}

.navbar .dropdown-divider {
    border-color: var(--line-soft);
    margin: 0.3rem 0;
}

.navbar .btn-outline-secondary {
    color: var(--ink-dim);
    border-color: var(--line);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.15s ease;
}

.navbar .btn-outline-secondary:hover {
    background: var(--panel-alt);
    color: var(--brass);
    border-color: var(--brass);
}

.text-body-secondary { color: var(--ink-dim) !important; }
.text-ink { color: var(--ink) !important; }

.fs-sm { font-size: 0.85rem; }
.fs-xs { font-size: 0.7rem; }

.badge.bg-coral {
    background: var(--rust) !important;
    color: var(--ink) !important;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

/* Лэндинг-вариант navbar */
.navbar-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0.9rem 0;
}
.navbar-logo {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 2px solid var(--brass);
    background: var(--panel-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: transform .5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.navbar-brand:hover .navbar-logo { transform: rotate(-4deg); }
.navbar-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ink);
}
.navbar-links {
    display: flex;
    gap: 1.6rem;
    margin-left: auto;
    list-style: none;
    padding: 0;
}
.navbar-links a {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--ink-dim);
    padding: 0.4rem 0;
    position: relative;
}
.navbar-links a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 0; height: 1px;
    background: var(--brass);
    transition: width .3s ease;
}
.navbar-links a:hover { color: var(--ink); }
.navbar-links a:hover::after { width: 100%; }
.navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
@media (max-width: 900px) {
    .navbar-links { display: none; }
}
@media (max-width: 480px) {
    .navbar-title { display: none; }
}

/* Кнопка-пилюля */
.btn-install {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    padding: 8px 16px;
    background: var(--panel-raised);
    border: 1px solid var(--brass);
    border-radius: 999px;
    color: var(--brass);
    transition: all .3s ease;
    white-space: nowrap;
}
.btn-install:hover {
    background: var(--brass);
    color: var(--bg);
    transform: translateY(-2px);
}
@media (max-width: 480px) {
    .btn-install { padding: 6px 12px; font-size: 0.68rem; }
}

/* ============================================================
 * 6. Лэндинг — базовые классы
 * ============================================================ */
.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--brass);
    margin: 0 0 0.75rem 0;
}
.h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4.6vw, 3.2rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--ink);
    margin: 0 0 1rem 0;
}
.h2 {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3.4vw, 2.1rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--ink);
    margin: 0 0 1.2rem 0;
}
.lead {
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    color: var(--ink-dim);
    line-height: 1.65;
    max-width: 640px;
    margin: 0 0 2rem 0;
}
.mono { font-family: var(--font-mono); }

/* ============================================================
 * 7. Основной layout
 * ============================================================ */
main {
    flex: 1 0 auto;
    padding: 0;
}

.section {
    padding: 5rem 0;
}
.section-soft { background: var(--bg-soft); }
.section-head { text-align: center; margin-bottom: 3rem; }
.section-head .eyebrow { display: block; }
.section-head .h2 { margin-bottom: 0.5rem; }

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.3rem, 3.4vw, 1.65rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--ink);
    margin: 0 0 1.2rem;
}
.section-title::after {
    content: '';
    display: block;
    width: 46px;
    height: 3px;
    background: var(--brass);
    margin-top: 0.6rem;
    border-radius: 2px;
}

@media (max-width: 768px) {
    .section { padding: 3.5rem 0; }
    .section-head { margin-bottom: 2rem; }
}

/* ============================================================
 * 8. Container / .tool-wrap
 * ============================================================ */
.tool-wrap,
.container-xl {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
}
@media (max-width: 992px) {
    .tool-wrap, .container-xl { padding: 0 20px; }
}
@media (max-width: 576px) {
    .tool-wrap, .container-xl { padding: 0 16px; }
}
@media (max-width: 400px) {
    .tool-wrap, .container-xl { padding: 0 12px; }
}

.container {
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 0 32px !important;
}
@media (max-width: 992px) { .container { padding: 0 20px !important; } }
@media (max-width: 576px) { .container { padding: 0 16px !important; } }
@media (max-width: 400px) { .container { padding: 0 12px !important; } }

/* ============================================================
 * 9. Кнопки (общие + .tool-btn + лэндинг)
 * ============================================================ */
.btn,
.tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--ink);
    padding: 0.55rem 1.05rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease,
                border-color 0.15s ease, transform 0.1s ease;
    min-height: 38px;
    touch-action: manipulation;
    user-select: none;
    white-space: nowrap;
}

.btn:hover,
.tool-btn:hover {
    background: var(--panel-raised);
    border-color: var(--brass-dim);
    color: var(--brass-light);
    transform: translateY(-1px);
}
.btn:active,
.tool-btn:active { transform: translateY(0); }
.btn:disabled,
.tool-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

/* Primary / акцент */
.btn-primary,
.tool-btn-accent {
    background: var(--brass);
    border-color: var(--brass);
    color: var(--bg);
}
.btn-primary:hover,
.tool-btn-accent:hover {
    background: var(--brass-light);
    border-color: var(--brass-light);
    color: var(--bg);
}

/* Danger / rust */
.btn-danger {
    background: transparent;
    border-color: var(--rust);
    color: var(--rust-light);
}
.btn-danger:hover {
    background: var(--rust);
    color: var(--ink);
}

/* Иконочные .tool-btn */
.tool-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border-color: var(--line-brass);
}
.tool-btn.tool-btn-accent {
    border-color: var(--brass);
}
@media (max-width: 400px) {
    .tool-btn { width: 36px; height: 36px; }
}

/* Ghost / outline */
.btn-outline-secondary {
    background: transparent;
    border-color: var(--line);
    color: var(--ink-dim);
}
.btn-outline-secondary:hover {
    background: var(--panel-alt);
    border-color: var(--brass);
    color: var(--brass);
}

/* Лэндинг-варианты кнопок */
.btn-ghost {
    background: transparent;
    color: var(--ink);
    border-color: var(--line);
}
.btn-ghost:hover {
    border-color: var(--brass);
    color: var(--brass);
    transform: translateY(-2px);
}
.btn-rust {
    background: transparent;
    color: var(--rust-light);
    border-color: var(--rust);
}
.btn-rust:hover {
    background: var(--rust);
    color: var(--ink);
    transform: translateY(-2px);
}
.btn-sm { padding: 10px 18px; font-size: 0.72rem; min-height: 38px; }

/* ============================================================
 * 10. HERO
 * ============================================================ */
.hero {
    position: relative;
    padding: 5rem 0 4rem;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -200px; left: 50%;
    transform: translateX(-50%);
    width: 900px; height: 600px;
    background: radial-gradient(ellipse, rgba(198, 162, 89, 0.15), transparent 60%);
    pointer-events: none;
}
:root[data-theme="light"] .hero::before {
    background: radial-gradient(ellipse, rgba(138, 100, 29, 0.12), transparent 60%);
}
.hero-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 4rem;
    align-items: center;
    position: relative;
}
.hero-content { min-width: 0; }
.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.8rem;
}
.hero-trust {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--ink-faint);
}
.hero-trust span::before { content: '●'; color: var(--brass); margin-right: 6px; }

.hero-art {
    position: relative;
    aspect-ratio: 1;
    max-width: 400px;
    margin-left: auto;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--panel);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    box-shadow: var(--shadow-panel);
    animation: float 6s ease-in-out infinite;
}
.hero-art::before,
.hero-art::after {
    content: '';
    position: absolute;
    width: 22px; height: 22px;
    border: 2px solid var(--line-brass);
}
.hero-art::before { top: 10px; left: 10px; border-right: none; border-bottom: none; }
.hero-art::after  { bottom: 10px; right: 10px; border-left: none; border-top: none; }
.hero-art-img {
    font-size: 12rem;
    line-height: 1;
    filter: drop-shadow(0 8px 24px rgba(198, 162, 89, 0.3));
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-12px); }
}
@media (max-width: 992px) {
    .hero { padding: 3rem 0 2.5rem; }
    .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; }
    .hero-art { max-width: 280px; margin: 0 auto; }
    .hero-art-img { font-size: 8rem; }
}

/* ============================================================
 * 11. MARQUEE
 * ============================================================ */
.marquee {
    background: var(--panel-alt);
    border-top: 1px solid var(--line-brass);
    border-bottom: 1px solid var(--line-brass);
    padding: 14px 0;
    overflow: hidden;
    position: relative;
}
.marquee::before,
.marquee::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    width: 80px;
    z-index: 2;
    pointer-events: none;
}
.marquee::before { left: 0; background: linear-gradient(90deg, var(--panel-alt), transparent); }
.marquee::after  { right: 0; background: linear-gradient(-90deg, var(--panel-alt), transparent); }
.marquee-track {
    display: flex;
    gap: 2.5rem;
    white-space: nowrap;
    animation: marquee 40s linear infinite;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--ink-dim);
}
.marquee-track span { display: inline-flex; align-items: center; }
.marquee-track span::after {
    content: '◆';
    color: var(--brass);
    margin-left: 2.5rem;
}
@keyframes marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
    .marquee-track, .hero-art { animation: none; }
}

/* ============================================================
 * 12. Карточки общие (.card)
 * ============================================================ */
.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem;
    color: var(--ink);
    position: relative;
    box-shadow: var(--shadow-soft);
}
.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--brass);
    border-radius: var(--radius) var(--radius) 0 0;
}
.card-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    color: var(--ink);
    margin: 0 0 0.8rem;
}

/* ============================================================
 * 13. Модальные окна (Bootstrap)
 * ============================================================ */
.modal-content {
    background: var(--panel);
    border: 1px solid var(--line);
    border-top: 2px solid var(--brass);
    border-radius: var(--radius);
    color: var(--ink);
    box-shadow: var(--shadow-panel);
}
.modal-header {
    background: var(--panel-alt);
    border-bottom: 1px solid var(--line);
    padding: 0.9rem 1.2rem;
    border-radius: var(--radius) var(--radius) 0 0;
}
.modal-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--ink);
    margin: 0;
}
.modal-title i { color: var(--brass); margin-right: 0.5rem; }

.modal-body {
    background: var(--panel);
    color: var(--ink);
    padding: 1.2rem 1.4rem;
}
.modal-body h1, .modal-body h2, .modal-body h3,
.modal-body h4, .modal-body h5, .modal-body h6 {
    color: var(--brass);
}
.modal-footer {
    background: var(--panel);
    border-top: 1px solid var(--line);
    padding: 0.8rem 1.2rem;
    border-radius: 0 0 var(--radius) var(--radius);
}
.modal-backdrop { background: rgba(0, 0, 0, 0.75); }
:root[data-theme="light"] .modal-backdrop { background: rgba(40, 30, 10, 0.6); }
.modal-backdrop.show {
    opacity: 1;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.modal-footer .btn-secondary {
    background: transparent;
    border: 1px solid var(--brass);
    color: var(--brass);
}
.modal-footer .btn-secondary:hover {
    background: var(--brass);
    color: var(--bg);
}
.btn-close {
    filter: invert(1) brightness(0.85);
    opacity: 0.7;
    transition: opacity 0.15s ease;
}
.btn-close:hover { opacity: 1; }
:root[data-theme="light"] .btn-close { filter: none; }

.modal .nav-tabs {
    border-bottom: 1px solid var(--line);
    background: var(--panel-alt);
    padding: 0.4rem 0.4rem 0;
    border-radius: var(--radius) var(--radius) 0 0;
    gap: 4px;
}
.modal .nav-tabs .nav-link {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--ink-dim);
    border: 1px solid transparent;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    padding: 0.55rem 0.9rem;
    background: transparent;
    transition: color 0.15s ease, background 0.15s ease;
}
.modal .nav-tabs .nav-link:hover {
    color: var(--brass);
    background: var(--panel);
    border-color: var(--line-soft);
}
.modal .nav-tabs .nav-link.active {
    color: var(--brass-light);
    background: var(--panel);
    border-color: var(--line) var(--line) var(--panel);
}
:root[data-theme="light"] .modal .nav-tabs .nav-link.active {
    color: var(--brass);
}

/* Alerts */
.alert {
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--panel-alt);
    color: var(--ink);
    padding: 0.8rem 1rem;
}
.alert-info {
    background: var(--status-testing-bg);
    border-color: var(--status-testing);
    color: var(--ink);
}
.alert-success {
    background: var(--status-ready-bg);
    border-color: var(--status-ready);
    color: var(--ink);
}
.alert-warning {
    background: var(--status-dev-bg);
    border-color: var(--status-dev);
    color: var(--ink);
}
.alert-danger {
    background: rgba(176, 80, 31, 0.12);
    border-color: var(--rust);
    color: var(--ink);
}

/* ============================================================
 * 14. Формы
 * ============================================================ */
.form-control,
.form-select,
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
textarea,
select {
    background: var(--panel);
    border: 1px solid var(--line);
    color: var(--ink);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    padding: 0.5rem 0.75rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-control:focus,
.form-select:focus,
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--brass);
    box-shadow: 0 0 0 2px rgba(198, 162, 89, 0.18);
    background: var(--panel);
    color: var(--ink);
}
.form-control::placeholder { color: var(--ink-faint); }

.form-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--ink-dim);
    margin-bottom: 0.35rem;
}

.form-check-input {
    background-color: var(--panel);
    border-color: var(--line);
    cursor: pointer;
}
.form-check-input:checked {
    background-color: var(--brass);
    border-color: var(--brass);
}
.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(198, 162, 89, 0.2);
    outline: none;
}
.form-check-label {
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.6px;
}

/* ============================================================
 * 15. .tool-* — каркас инструмента
 * ============================================================ */
.tool-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: nowrap;
    padding: 0.75rem 1.1rem;
    background: linear-gradient(180deg, var(--panel-alt), var(--panel));
    border: 1px solid var(--line);
    border-bottom: 1px solid var(--line-brass);
    border-radius: var(--radius);
    margin: 1.2rem 0;
    position: relative;
}
.tool-toolbar-left,
.tool-toolbar-right,
.tool-toolbar-center {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}
.tool-toolbar-left { flex: 0 0 auto; }
.tool-toolbar-right { flex: 0 0 auto; margin-left: auto; }
.tool-toolbar-center { flex: 0 0 auto; margin: 0 auto; }
.tool-toolbar-title {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
}
.tool-toolbar-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 0.15rem;
}
.tool-toolbar-heading {
    font-family: var(--font-display);
    font-size: clamp(1.1rem, 2.4vw, 1.5rem);
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--ink);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (max-width: 576px) {
    .tool-toolbar {
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        gap: 0.6rem 0.8rem;
        padding: 0.7rem 0.9rem;
    }
    .tool-toolbar-title {
        order: 1;
        flex: 1 1 100%;
        text-align: center;
        min-width: 0;
    }
    .tool-toolbar-left {
        order: 2;
        flex: 0 1 auto;
        min-width: 0;
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
    }
    .tool-toolbar-right {
        order: 2;
        flex: 0 1 auto;
        min-width: 0;
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        margin-left: auto;
    }
    .tool-toolbar-center {
        order: 2;
        flex: 0 1 auto;
        margin: 0 auto;
    }
    .tool-toolbar-heading { font-size: 1rem; }
    .tool-toolbar-eyebrow { font-size: 0.6rem; letter-spacing: 1.5px; }
}

.tool-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 1.4rem;
    align-items: start;
    margin-bottom: 2rem;
}
.tool-layout.tool-layout-reverse {
    grid-template-columns: 380px minmax(0, 1fr);
}
.tool-column-main { min-width: 0; }
.tool-column-side { min-width: 0; }
@media (max-width: 1100px) {
    .tool-layout { grid-template-columns: minmax(0, 1fr) 340px; }
}
@media (max-width: 992px) {
    .tool-layout,
    .tool-layout.tool-layout-reverse {
        grid-template-columns: 1fr;
    }
    .tool-column-side {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    @media (max-width: 768px) {
        .tool-column-side { grid-template-columns: 1fr; }
    }
}

.tool-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.2rem 1.4rem 1.4rem;
    position: relative;
    box-shadow: var(--shadow-card);
    margin-bottom: 1.2rem;
}
.tool-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--brass);
    border-radius: var(--radius) var(--radius) 0 0;
}
.tool-panel::after {
    content: '';
    position: absolute;
    top: 8px; right: 8px;
    width: 16px; height: 16px;
    border-top: 1px solid var(--line-brass);
    border-right: 1px solid var(--line-brass);
    pointer-events: none;
}
.tool-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.tool-panel-title {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--brass);
    margin: 0;
}
.tool-panel-badges {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

/* .tool-badge */
.tool-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 3px 9px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel-alt);
    color: var(--ink-dim);
    transform: rotate(-1.5deg);
    white-space: nowrap;
}
.tool-badge-ready {
    color: var(--status-ready);
    border-color: var(--status-ready);
    background: var(--status-ready-bg);
}
.tool-badge-testing {
    color: var(--status-testing);
    border-color: var(--status-testing);
    background: var(--status-testing-bg);
}
.tool-badge-dev {
    color: var(--status-dev);
    border-color: var(--status-dev);
    background: var(--status-dev-bg);
}
.tool-badge--flat { transform: none; }

/* Локальный бейдж без поворота */
.tool-badge-local {
    transform: none;
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 3px 9px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel-alt);
    color: var(--ink-dim);
    white-space: nowrap;
}

/* .tool-stat */
.tool-stat {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: stretch;
    margin: 0;
    padding: 0;
}
.tool-stat-cell {
    flex: 1 1 120px;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.7rem 0.85rem;
    background: var(--panel-alt);
    border: 1px solid var(--line);
    border-left: 2px solid var(--brass);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    overflow: hidden;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.tool-stat-cell:hover {
    border-left-color: var(--brass-light, var(--brass));
    background: var(--panel-raised, var(--panel-alt));
}
.tool-stat-value {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.1;
    color: var(--ink);
    letter-spacing: 0.5px;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
}
.tool-stat-label {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: var(--ink-faint);
    line-height: 1.35;
    word-break: break-word;
    overflow-wrap: anywhere;
    min-width: 0;
    max-width: 100%;
}

/* .tool-actions / .tool-action */
.tool-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
}
@media (max-width: 576px) {
    .tool-actions { grid-template-columns: 1fr; }
}
.tool-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--panel);
    color: var(--ink);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    min-height: 42px;
    touch-action: manipulation;
}
.tool-action:hover {
    border-color: var(--brass);
    color: var(--brass);
    background: var(--panel-raised);
    transform: translateY(-1px);
}
.tool-action.tool-action-primary {
    border-color: var(--brass);
    color: var(--brass);
}
.tool-action.tool-action-primary:hover {
    background: var(--brass);
    color: var(--bg);
}
.tool-action.tool-action-accent {
    color: var(--brass-light);
    border-color: var(--line-brass);
}
.tool-action.tool-action-rust {
    color: var(--rust-light);
    border-color: var(--rust);
}
.tool-action.tool-action-rust:hover {
    background: var(--rust);
    color: var(--ink);
    border-color: var(--rust);
}
.tool-action.tool-action-ghost {
    color: var(--ink-dim);
    background: transparent;
}
.tool-action--block { width: 100%; }

.tool-action[disabled],
.tool-action:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

/* Утилиты .tool-* */
.tool-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.tool-cell-dim {
    font-size: 0.85em;
    color: var(--ink-dim);
}
.tool-code-block {
    word-break: break-all;
    font-family: var(--font-mono);
    background: var(--bg);
    border: 1px solid var(--line);
    border-left: 3px solid var(--brass);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    color: var(--ink);
    font-size: 0.82rem;
    line-height: 1.5;
}
.tool-search {
    min-width: 220px;
    max-width: 260px;
}
.tool-inline-form {
    display: inline;
    margin: 0;
    padding: 0;
}

/* ============================================================
 * 16. .tool-tabs
 * ============================================================ */
.tool-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.tool-tab {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 0.6rem 1rem;
    color: var(--ink-dim);
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: transparent;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}
.tool-tab:hover {
    color: var(--brass);
    background: var(--panel-alt);
}
.tool-tab.tool-tab-active {
    color: var(--brass-light);
    background: var(--panel);
    border-color: var(--line) var(--line) var(--panel);
}

/* ============================================================
 * 17. Терминал
 * ============================================================ */
.terminal-window {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.terminal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 1rem;
    background: linear-gradient(180deg, var(--panel-alt), var(--panel));
    border-bottom: 1px solid var(--line-brass);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--ink-dim);
}
.terminal-header .indicator {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--ink-faint);
    transition: background 0.2s ease;
}
.terminal-window .stream-log {
    background: var(--bg);
    padding: 0.8rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.6;
    color: var(--ink);
    overflow-y: auto;
}
.stream-entry {
    padding: 2px 0;
    border-bottom: 1px dashed var(--line-soft);
    word-break: break-all;
    overflow-wrap: anywhere;
}
.stream-entry .tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    background: var(--panel-alt);
    border: 1px solid var(--line);
    color: var(--ink-dim);
}

/* ============================================================
 * 18. Мелкие утилиты
 * ============================================================ */
.font-mono    { font-family: var(--font-mono); }
.font-display { font-family: var(--font-display); }

.text-muted  { color: var(--ink-dim) !important; }
.text-dim    { color: var(--ink-faint) !important; }
.text-brass  { color: var(--brass) !important; }
.text-rust   { color: var(--rust-light) !important; }
.text-ready  { color: var(--status-ready) !important; }

.bg-canvas    { background: var(--bg) !important; }
.bg-panel     { background: var(--panel) !important; }
.bg-panel-alt { background: var(--panel-alt) !important; }

.border-brass { border-color: var(--line-brass) !important; }

.divider {
    height: 1px;
    background: var(--line-soft);
    margin: 1rem 0;
}

/* ============================================================
 * 19. Footer (общий + расширенный сеткой)
 * ============================================================ */
.footer {
    background: var(--bg-soft);
    border-top: 1px solid var(--line);
    padding: 4rem 0 2rem;
    color: var(--ink-faint);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 1px;
}
.footer a { color: var(--ink-dim); }
.footer a:hover { color: var(--brass); }

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}
.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.footer-logo {
    width: 44px; height: 44px;
    border-radius: 50%;
    border: 2px solid var(--brass);
    background: var(--panel-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}
.footer-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ink);
}
.footer-tag {
    font-size: 0.95rem;
    color: var(--ink-dim);
    line-height: 1.6;
    margin: 0;
    max-width: 320px;
    text-transform: none;
    letter-spacing: normal;
    font-family: var(--font-body);
}
.footer-col h4 {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--brass);
    margin: 0 0 1rem 0;
}
.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-col li { margin-bottom: 0.6rem; }
.footer-col a {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    letter-spacing: 0.6px;
    color: var(--ink-dim);
    text-transform: uppercase;
}
.footer-col a:hover { color: var(--brass); }

.footer-bottom {
    border-top: 1px solid var(--line);
    padding-top: 1.5rem;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--ink-faint);
}
@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
    .footer { padding: 3rem 0 1.5rem; }
}

/* ============================================================
 * 20. Анимации
 * ============================================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes iconPop {
    0%   { transform: scale(0.85); }
    60%  { transform: scale(1.04); }
    100% { transform: scale(1); }
}
@keyframes tipSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp 0.5s ease both; }

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .6s ease, transform .6s ease;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

@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;
    }
    .fade-in { opacity: 1; transform: none; transition: none; }
}

/* ============================================================
 * 21. Печать
 * ============================================================ */
@media print {
    .navbar,
    .footer,
    .tool-toolbar,
    .btn,
    .tool-btn {
        display: none !important;
    }
    body {
        background: #ffffff;
        color: #000000;
    }
    .tool-panel,
    .card {
        border: 1px solid #cccccc;
        box-shadow: none;
    }
}

/* ============================================================
 * 22. Служебные страницы — admin
 * ============================================================ */

/* Модалка «Права» */
.admin-perm-hint {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background: var(--bg);
    border: 1px solid var(--line);
    border-left: 3px solid var(--brass);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--ink-dim);
    line-height: 1.5;
}
.admin-perm-hint i { color: var(--brass); margin-top: 2px; }

.admin-perm-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.admin-perm-group-title {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--brass);
    margin-bottom: 0.5rem;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--line);
}
.admin-perm-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px dashed var(--line-soft);
}
.admin-perm-row:last-child { border-bottom: none; }
.admin-perm-info { min-width: 0; flex: 1 1 auto; }
.admin-perm-code {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--ink-dim);
    letter-spacing: 0.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.admin-perm-title {
    font-size: 0.85rem;
    color: var(--ink);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.admin-perm-toggle {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}
.admin-perm-btn {
    background: var(--panel);
    border: none;
    border-right: 1px solid var(--line);
    color: var(--ink-dim);
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.admin-perm-btn:last-child { border-right: none; }
.admin-perm-btn:hover {
    background: var(--panel-raised);
    color: var(--ink);
}
.admin-perm-btn.is-active {
    background: var(--brass);
    color: var(--bg);
}
.admin-perm-btn.is-active.is-grant {
    background: var(--status-ready);
    color: var(--bg);
}
.admin-perm-btn.is-active.is-deny {
    background: var(--rust);
    color: var(--ink);
}
@media (max-width: 576px) {
    .admin-perm-row {
        flex-direction: column;
        align-items: stretch;
    }
    .admin-perm-toggle { width: 100%; }
    .admin-perm-btn { flex: 1; text-align: center; }
}

/* Кнопки-иконки в admin-таблицах */
.admin-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px; height: 30px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--ink-dim);
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.15s ease;
}
.admin-icon-btn:hover {
    border-color: var(--brass);
    color: var(--brass);
    background: var(--panel);
}
.admin-icon-btn--danger:hover {
    border-color: var(--rust);
    color: var(--rust-light);
}
.admin-icon-btn--ok {
    color: var(--status-ready);
    border-color: var(--status-ready);
}

/* Модалки admin_users */
.admin-role-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}
.admin-role-btn {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--ink-dim);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.admin-role-btn:hover {
    border-color: var(--brass-dim);
    color: var(--ink);
}
.admin-role-btn.is-active {
    background: var(--brass);
    border-color: var(--brass);
    color: var(--bg);
}
.admin-password-row { display: flex; gap: 0.5rem; }
.admin-status,
.admin-actions {
    display: inline-flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* ============================================================
 * 23. Telemetry — .tm-*
 * ============================================================ */
.tm-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ink-dim);
    white-space: nowrap;
}
.tm-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brass);
    box-shadow: 0 0 8px rgba(198, 162, 89, 0.6);
    animation: tm-pulse 1.5s ease-in-out infinite;
    flex-shrink: 0;
}
.tm-status.is-live .tm-status-dot { background: var(--status-ready); box-shadow: 0 0 8px rgba(134, 160, 106, 0.6); }
.tm-status.is-down .tm-status-dot { background: var(--rust); box-shadow: 0 0 8px rgba(176, 80, 31, 0.6); }

@keyframes tm-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.35; }
}

.tm-terminal {
    padding: 1rem 1.2rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    border-radius: var(--radius-sm);
    min-height: 400px;
    max-height: 70vh;
    overflow-y: auto;
}
.tm-terminal .tm-line {
    white-space: pre-wrap;
    word-break: break-all;
    padding: 2px 0;
    border-bottom: 1px solid var(--line-soft);
}
.tm-terminal .tm-line:last-child { border-bottom: none; }
.tm-terminal .tm-line-time { color: var(--ink-faint); }
.tm-terminal .tm-line-mod  { color: var(--brass); }
.tm-terminal .tm-line-dir  { color: var(--status-testing); }
.tm-terminal .tm-line-cmd  { color: var(--rust-light); }
.tm-terminal .tm-line-pay  { color: var(--ink-dim); }

.tm-empty {
    color: var(--ink-faint);
    font-style: italic;
    padding: 2rem 0;
    text-align: center;
}

.tm-modules-list { list-style: none; padding: 0; margin: 0; }
.tm-module {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    border-bottom: 1px dashed var(--line-soft);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--ink-dim);
    transition: background 0.15s ease;
}
.tm-module:last-child { border-bottom: none; }
.tm-module.is-active {
    background: var(--panel-raised);
    color: var(--ink);
}
.tm-module-count {
    color: var(--brass);
    font-weight: 600;
    min-width: 2em;
    text-align: right;
}

/* Доп. элементы телеметрии */
.tm-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
    background: var(--ink-faint);
}
.tm-dot[data-state="idle"]       { background: var(--ink-faint); }
.tm-dot[data-state="active"]     { background: var(--status-ready); box-shadow: 0 0 8px rgba(134,160,106,0.6); animation: tm-pulse 1.5s ease-in-out infinite; }
.tm-dot[data-state="error"]      { background: var(--rust); box-shadow: 0 0 8px rgba(176,80,31,0.6); }
.tm-dot[data-state="connecting"] { background: var(--brass); animation: tm-pulse 1.2s ease-in-out infinite; }

.tm-conn {
    display: inline-block;
    padding: 5px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ink-dim);
    background: var(--panel);
    white-space: nowrap;
}
.tm-conn[data-state="active"]     { color: var(--status-ready); border-color: var(--status-ready); background: var(--status-ready-bg); }
.tm-conn[data-state="error"]      { color: var(--rust); border-color: var(--rust); background: var(--status-dev-bg); }
.tm-conn[data-state="connecting"] { color: var(--brass); border-color: var(--brass); }

.tm-stream {
    padding: 0.75rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    border-radius: var(--radius-sm);
    min-height: 400px;
    max-height: 70vh;
    overflow-y: auto;
}
.tm-entry {
    padding: 3px 0;
    border-bottom: 1px solid var(--line-soft);
    word-break: break-all;
    white-space: pre-wrap;
}
.tm-entry:last-child { border-bottom: none; }
.tm-entry.tm-supported { border-left: 2px solid var(--brass); padding-left: 8px; margin-left: -10px; }
.tm-ts  { color: var(--ink-faint); }
.tm-tag {
    display: inline-block;
    padding: 1px 6px;
    margin: 0 2px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 0.72em;
    color: var(--ink-dim);
    background: var(--panel-alt);
}
.tm-tag-mod { color: var(--brass); border-color: var(--brass-dim); }
.tm-payload { color: var(--ink-dim); }

.tm-filters-hint {
    padding: 0 0 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 1px;
    color: var(--ink-faint);
    text-transform: uppercase;
}
.tm-modules {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.tm-mod-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 8px 10px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--ink-dim);
    font-family: var(--font-mono);
    font-size: 0.76rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
}
.tm-mod-btn:hover {
    background: var(--panel-raised);
    border-color: var(--brass-dim);
    color: var(--ink);
}
.tm-mod-btn.tm-active {
    background: var(--brass);
    border-color: var(--brass);
    color: var(--bg);
}
.tm-mod-btn.tm-active .tm-mod-count { color: var(--bg); }
.tm-mod-name {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tm-mod-sub {
    color: var(--ink-faint);
    font-size: 0.85em;
    margin-left: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tm-mod-btn.tm-active .tm-mod-sub { color: var(--bg); opacity: 0.85; }
.tm-mod-count {
    color: var(--brass);
    font-weight: 600;
    margin-left: 8px;
    flex-shrink: 0;
}
.tm-dot-green {
    color: var(--status-ready);
    font-size: 0.55em;
    vertical-align: middle;
}

@media (max-width: 992px) {
    .tm-stream,
    .tm-terminal { min-height: 300px; }
}
@media (max-width: 576px) {
    .tm-stream,
    .tm-terminal { font-size: 0.7rem; padding: 0.6rem; }
    .tool-search { min-width: 0; max-width: 100%; flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
    .tm-status-dot,
    .tm-dot { animation: none; }
}

/* ============================================================
 * 24. Nav-tabs на служебных страницах
 * ============================================================ */
.nav-tabs {
    border-bottom: 1px solid var(--line);
    gap: 0.25rem;
}
.nav-tabs .nav-link {
    background: transparent;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    color: var(--ink-dim);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    padding: 0.6rem 1.1rem;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: -1px;
}
.nav-tabs .nav-link i {
    color: var(--ink-faint);
    transition: color 0.2s ease;
}
.nav-tabs .nav-link:hover {
    border-color: transparent;
    border-bottom: 2px solid var(--brass-dim);
    color: var(--ink);
    background: var(--panel-alt);
}
.nav-tabs .nav-link:hover i { color: var(--brass); }
.nav-tabs .nav-link.active {
    background: var(--panel);
    border-color: var(--line);
    border-bottom: 2px solid var(--brass);
    color: var(--ink);
    position: relative;
}
.nav-tabs .nav-link.active i { color: var(--brass); }
.nav-tabs .nav-link:focus-visible {
    outline: 2px solid var(--brass);
    outline-offset: -2px;
}

/* ============================================================
 * 25. Таблицы на служебных страницах
 * ============================================================ */
.tool-panel .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--ink);
    --bs-table-border-color: var(--line-soft);
    --bs-table-striped-bg: var(--panel-alt);
    --bs-table-striped-color: var(--ink);
    --bs-table-active-bg: var(--panel-raised);
    --bs-table-active-color: var(--ink);
    --bs-table-hover-bg: var(--panel-alt);
    --bs-table-hover-color: var(--ink);
    color: var(--ink);
    border-color: var(--line-soft);
    margin-bottom: 0;
}
.tool-panel .table > :not(caption) > * > * {
    border-bottom-color: var(--line-soft);
    background: transparent;
}
.tool-panel .table thead th {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--ink-dim);
    border-bottom: 1px solid var(--brass);
    background: var(--panel-alt);
    padding: 0.7rem 0.75rem;
    vertical-align: middle;
}
.tool-panel .table tbody td {
    color: var(--ink);
    padding: 0.6rem 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--line-soft);
}
.tool-panel .table tbody tr:hover td { background: var(--panel-alt); }
.tool-panel .table tbody tr:last-child td { border-bottom: none; }
.tool-panel .table code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    color: var(--brass);
    background: var(--panel-alt);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 2px 6px;
}
.tool-panel .table a {
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px dotted var(--brass-dim);
    transition: color 0.15s ease, border-color 0.15s ease;
}
.tool-panel .table a:hover {
    color: var(--brass);
    border-bottom-color: var(--brass);
}

.tool-panel .pagination .page-link {
    background: var(--panel);
    border: 1px solid var(--line);
    color: var(--ink-dim);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    padding: 0.4rem 0.7rem;
    transition: all 0.15s ease;
}
.tool-panel .pagination .page-link:hover {
    background: var(--panel-raised);
    border-color: var(--brass-dim);
    color: var(--ink);
}
.tool-panel .pagination .page-item.active .page-link {
    background: var(--brass);
    border-color: var(--brass);
    color: var(--bg);
}
.tool-panel .pagination .page-item.disabled .page-link {
    background: var(--panel-alt);
    color: var(--ink-faint);
    border-color: var(--line-soft);
}

/* ============================================================
 * 26. PCAPdroid — .pcd-*
 * ============================================================ */
.pcd-info {
    padding: 0.85rem 1.2rem;
    margin: 1.2rem 0;
    background: var(--panel);
    border: 1px solid var(--line);
    border-left: 3px solid var(--brass);
    border-radius: var(--radius);
}
.pcd-info-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.pcd-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ink-dim);
}
.pcd-url {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--brass);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    word-break: break-all;
    flex: 1 1 auto;
    min-width: 0;
}
.pcd-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ink-dim);
    white-space: nowrap;
}
.pcd-status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--ink-faint);
    flex-shrink: 0;
}
.pcd-status[data-state="idle"] .pcd-status-dot     { background: var(--ink-faint); }
.pcd-status[data-state="active"] .pcd-status-dot   { background: var(--status-ready); box-shadow: 0 0 8px rgba(134,160,106,0.6); animation: pcd-pulse 1.5s ease-in-out infinite; }
.pcd-status[data-state="error"] .pcd-status-dot    { background: var(--rust); box-shadow: 0 0 8px rgba(176,80,31,0.6); }

@keyframes pcd-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.35; }
}
.pcd-head code {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--brass);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 1px 5px;
}
.pcd-steps {
    padding-left: 1.1rem;
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.8;
    color: var(--ink-dim);
}
.pcd-steps li { margin-bottom: 4px; }
.pcd-steps code {
    font-family: var(--font-mono);
    font-size: 0.8em;
    color: var(--brass);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 1px 5px;
}
.pcd-legend {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.7;
    color: var(--ink-dim);
}
.pcd-legend b {
    font-family: var(--font-mono);
    color: var(--brass);
    font-weight: 600;
}
@media (prefers-reduced-motion: reduce) {
    .pcd-status[data-state="active"] .pcd-status-dot { animation: none; }
}

/* ============================================================
 * 27. session.php — фильтры / пагинация / очистка
 * ============================================================ */
.session-filter {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    margin: 0.75rem 0 1rem;
    background: var(--bg);
    border: 1px solid var(--line);
    border-left: 3px solid var(--brass);
    border-radius: var(--radius-sm);
}
.session-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}
.session-filter-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1 1 180px;
}
.session-filter-item--narrow { flex: 0 1 120px; }
.session-filter-item--wide   { flex: 2 1 240px; }
.session-filter-label {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ink-dim);
}
.session-filter-item .form-control {
    background: var(--panel);
    border: 1px solid var(--line);
    color: var(--ink);
    font-size: 0.85rem;
    padding: 6px 10px;
    min-height: 36px;
}
.session-filter-item .form-control:focus {
    border-color: var(--brass);
    box-shadow: 0 0 0 2px rgba(198, 162, 89, 0.2);
    outline: none;
}
.session-filter-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.session-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}
.session-pagination-pages,
.session-pagination-per {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.session-danger-form {
    padding: 0.85rem 0;
    border-bottom: 1px dashed var(--line-soft);
}
.session-danger-form:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.session-danger-form + .session-danger-form { margin-top: 0.5rem; }
.session-danger-hint {
    margin: 0.5rem 0 0;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    line-height: 1.5;
    color: var(--ink-faint);
}
.session-danger-delete {
    border-color: var(--rust) !important;
    color: var(--rust) !important;
}
.session-danger-delete:hover {
    background: var(--rust) !important;
    color: var(--ink) !important;
}

@media (max-width: 768px) {
    .session-filter-item,
    .session-filter-item--narrow,
    .session-filter-item--wide { flex: 1 1 100%; }
    .session-filter-actions { justify-content: stretch; }
    .session-filter-actions .tool-action {
        flex: 1 1 auto;
        justify-content: center;
    }
    .session-pagination {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ============================================================
 * 28. tokens.php
 * ============================================================ */
.tokens-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0 0 1rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: 0.75rem;
}
.tokens-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--ink-dim);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.tokens-tab:hover {
    border-color: var(--brass-dim);
    color: var(--ink);
    background: var(--panel-raised);
    text-decoration: none;
}
.tokens-tab.is-active {
    background: var(--brass);
    border-color: var(--brass);
    color: var(--bg);
}
.tokens-tab-count {
    display: inline-block;
    min-width: 1.5em;
    text-align: center;
    padding: 1px 5px;
    border-radius: 999px;
    background: var(--bg);
    color: var(--ink-dim);
    font-size: 0.85em;
}
.tokens-tab.is-active .tokens-tab-count {
    background: rgba(12, 11, 8, 0.25);
    color: var(--bg);
}
.tokens-actions {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}
.tokens-delete-btn {
    color: var(--rust) !important;
    border-color: var(--rust) !important;
}
.tokens-delete-btn:hover {
    background: var(--rust) !important;
    color: var(--ink) !important;
}
@media (max-width: 576px) {
    .tokens-tab {
        flex: 1 1 auto;
        justify-content: center;
    }
    .tokens-actions { gap: 4px; }
}

/* ============================================================
 * 29. Navbar toggler — мобильный гамбургер
 * ============================================================ */
@media (min-width: 992px) {
    .site-navbar .navbar-toggler { display: none !important; }
}
@media (max-width: 991.98px) {
    .site-navbar .navbar-toggler {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 46px;
        height: 46px;
        padding: 0;
        margin-left: auto;
        background: var(--panel-alt);
        border: 1px solid var(--line-brass);
        border-radius: var(--radius-sm);
        color: var(--ink);
        font-size: 1.15rem;
        line-height: 1;
        transition: background 0.2s ease, border-color 0.2s ease,
                    color 0.2s ease, transform 0.15s ease;
    }
    .site-navbar .navbar-toggler:hover,
    .site-navbar .navbar-toggler:focus {
        background: var(--panel-raised);
        border-color: var(--brass);
        color: var(--brass);
        outline: none;
        box-shadow: 0 0 0 3px rgba(198, 162, 89, 0.2);
    }
    .site-navbar .navbar-toggler:active { transform: translateY(1px); }
    .site-navbar .navbar-toggler:focus-visible {
        outline: 2px solid var(--brass);
        outline-offset: 2px;
    }
    .site-navbar .navbar-toggler i,
    .site-navbar .navbar-toggler .fas,
    .site-navbar .navbar-toggler .far {
        color: inherit;
        pointer-events: none;
    }
    .site-navbar .navbar-toggler-icon { display: none; }
}

/* ============================================================
 * 30. Дропдаун «Игры» в навигации
 * ============================================================ */
.navbar-nav .dropdown-menu.nav-games-menu { min-width: 260px; }

.dropdown-menu .nav-game-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.nav-game-main {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex: 1 1 auto;
}
.nav-game-main i {
    width: 1.1em;
    text-align: center;
    color: var(--brass-dim);
    flex-shrink: 0;
}
.nav-game-item:hover .nav-game-main i,
.nav-game-item:focus .nav-game-main i { color: var(--brass); }

.nav-game-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-status {
    display: inline-block;
    margin-left: auto;
    padding: 1px 6px;
    font-family: var(--font-mono);
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 3px;
    vertical-align: middle;
    white-space: nowrap;
    line-height: 1.4;
    flex-shrink: 0;
}
.nav-status-testing {
    color: var(--status-testing);
    border: 1px solid var(--status-testing);
    background: var(--status-testing-bg);
}
.nav-status-dev {
    color: var(--status-dev);
    border: 1px solid var(--status-dev);
    background: var(--status-dev-bg);
}

.dropdown-menu .dropdown-item > i {
    width: 1.1em;
    margin-right: 0.5rem;
    color: var(--brass-dim);
    text-align: center;
}
.dropdown-menu .dropdown-item:hover > i,
.dropdown-menu .dropdown-item:focus > i { color: var(--brass); }

/* ============================================================
 * 31. Роль и тариф в шапке
 * ============================================================ */
.nav-user-link {
    display: inline-flex !important;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}
.nav-user-name {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}
.nav-user-role {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 3px;
    line-height: 1.4;
    white-space: nowrap;
    flex-shrink: 0;
    vertical-align: middle;
    margin-left: 0.15rem;
    color: var(--ink-faint);
    border: 1px solid var(--line);
    background: var(--panel-alt);
}
.nav-user-role-admin {
    color: var(--status-dev);
    border-color: var(--status-dev);
    background: var(--status-dev-bg);
}
.nav-user-role-moder {
    color: var(--status-testing);
    border-color: var(--status-testing);
    background: var(--status-testing-bg);
}
.nav-user-role-user {
    color: var(--status-ready);
    border-color: var(--status-ready);
    background: var(--status-ready-bg);
}
.nav-user-role-pending {
    color: var(--status-testing);
    border-color: var(--status-testing);
    background: var(--status-testing-bg);
}

.nav-user-plan {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.55rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 3px;
    line-height: 1.4;
    white-space: nowrap;
    flex-shrink: 0;
    vertical-align: middle;
    margin-left: 0.25rem;
    color: var(--ink-faint);
    border: 1px solid var(--line);
    background: var(--panel-alt);
}
.nav-user-plan-free   { color: var(--ink-faint); border-color: var(--line); background: var(--panel-alt); }
.nav-user-plan-pro    { color: var(--status-ready); border-color: var(--status-ready); background: var(--status-ready-bg); }
.nav-user-plan-legion { color: var(--status-dev); border-color: var(--status-dev); background: var(--status-dev-bg); }

.impersonate-banner ~ nav .nav-user-role { filter: brightness(1.1); }
.impersonate-banner-text { color: var(--ink-faint); }

/* ============================================================
 * 32. Лэндинг — секции, FAQ, quote, product
 * ============================================================ */
/* Features / cards лэндинга */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 22px;
}
.card-num {
    position: absolute;
    top: 1rem; right: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--ink-faint);
}
.card-icon {
    width: 64px; height: 64px;
    border-radius: 12px;
    border: 1px solid var(--line-brass);
    background: var(--panel-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1.25rem;
    transition: transform .5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.card:hover .card-icon { transform: scale(1.08) rotate(-4deg); }
.card-text {
    font-size: 0.98rem;
    line-height: 1.6;
    color: var(--ink-dim);
    margin: 0;
}

/* Steps */
.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    position: relative;
}
.steps::before {
    content: '';
    position: absolute;
    top: 32px; left: 16%; right: 16%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line-brass), transparent);
    z-index: 0;
}
.step {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 0 0.5rem;
}
.step-num {
    width: 64px; height: 64px;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    background: var(--panel);
    border: 2px solid var(--brass);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--brass);
    letter-spacing: 1px;
}
.step-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ink);
    margin: 0 0 0.5rem 0;
}
.step-text {
    font-size: 0.95rem;
    color: var(--ink-dim);
    line-height: 1.6;
    margin: 0;
}
.steps-note {
    text-align: center;
    margin-top: 2.5rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--ink-faint);
}
@media (max-width: 768px) {
    .steps { grid-template-columns: 1fr; gap: 2rem; }
    .steps::before { display: none; }
}

/* Module cards (лэндинг) */
.module-card {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.75rem 1.5rem;
    transition: all .3s ease;
    display: flex;
    flex-direction: column;
}
.module-card:hover {
    transform: translateY(-4px);
    border-color: var(--line-brass);
    box-shadow: var(--shadow-card);
}
.module-num {
    position: absolute;
    top: 1rem; right: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--ink-faint);
}
.module-icon {
    width: 96px; height: 96px;
    border-radius: 16px;
    border: 1px solid var(--line-brass);
    background: var(--panel-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin-bottom: 1.25rem;
    position: relative;
    transition: transform .5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.module-icon::before,
.module-icon::after {
    content: '';
    position: absolute;
    width: 14px; height: 14px;
    border: 2px solid var(--brass-dim);
}
.module-icon::before { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.module-icon::after  { bottom: -2px; right: -2px; border-left: none; border-top: none; }
.module-card:hover .module-icon { transform: scale(1.08) rotate(-2deg); }
.module-title {
    font-family: var(--font-display);
    font-size: 1.28rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0 0 0.5rem 0;
}
.module-text {
    font-size: 0.95rem;
    color: var(--ink-dim);
    line-height: 1.6;
    margin: 0 0 1.25rem 0;
    flex: 1;
}
.module-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line-soft);
    flex-wrap: wrap;
}
.stamp {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid;
    transform: rotate(-1.5deg);
}
.stamp-ready    { color: var(--status-ready);   border-color: var(--status-ready);   background: var(--status-ready-bg); }
.stamp-testing  { color: var(--status-testing); border-color: var(--status-testing); background: var(--status-testing-bg); }
.stamp-dev      { color: var(--status-dev);     border-color: var(--status-dev);     background: var(--status-dev-bg); }
.module-meta {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ink-faint);
}
.modules-footer {
    text-align: center;
    margin-top: 2.5rem;
}

/* Product */
.product {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}
.product-list {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
}
.product-list li {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.6px;
    color: var(--ink);
    padding: 0.5rem 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-transform: uppercase;
}
.product-list li::before {
    content: '✓';
    color: var(--brass);
    font-weight: 700;
    flex-shrink: 0;
}
.product-note {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-top: 0.75rem;
}
.product-screenshot {
    aspect-ratio: 4/3;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--panel);
    padding: 1.5rem;
    position: relative;
    box-shadow: var(--shadow-panel);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.product-screenshot::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--brass);
}
.product-screenshot::after {
    content: '';
    position: absolute;
    top: 12px; right: 12px;
    width: 18px; height: 18px;
    border: 2px solid var(--line-brass);
    border-left: none; border-bottom: none;
}
.screenshot-mock {
    width: 100%; height: 100%;
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--ink-dim);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow: hidden;
}
.mock-bar { height: 8px; background: var(--line); border-radius: 4px; }
.mock-bar.accent { background: var(--brass); width: 40%; }
.mock-bar.wide   { width: 80%; }
.mock-bar.mid    { width: 60%; }
.mock-bar.short  { width: 30%; }
.mock-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.4rem;
    border-bottom: 1px solid var(--line-soft);
}
.mock-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--status-ready);
    flex-shrink: 0;
}
.mock-dot.rust { background: var(--rust); }
.mock-dot.test { background: var(--status-testing); }
@media (max-width: 900px) {
    .product { grid-template-columns: 1fr; gap: 2.5rem; }
}

/* Trust */
.trust {
    background: var(--panel);
    border-top: 3px solid var(--brass);
    border-bottom: 1px solid var(--line);
    padding: 3.5rem 0;
}
.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
}
.trust-item { text-align: left; }
.trust-icon {
    font-size: 1.8rem;
    color: var(--brass);
    margin-bottom: 0.75rem;
}
.trust-title {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--ink);
    margin: 0 0 0.5rem 0;
}
.trust-text {
    font-size: 0.92rem;
    color: var(--ink-dim);
    line-height: 1.6;
    margin: 0;
}

/* Community */
.quotes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}
.quote {
    background: var(--panel);
    border: 1px solid var(--line);
    border-left: 3px solid var(--brass);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.quote-text {
    font-size: 1rem;
    line-height: 1.65;
    color: var(--ink);
    margin: 0 0 1rem 0;
    font-style: italic;
}
.quote-author {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--brass);
}
.quote-role {
    display: block;
    font-weight: 500;
    color: var(--ink-faint);
    margin-top: 2px;
    letter-spacing: 1px;
}
.community-cta {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    align-items: stretch;
}
.community-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}
.community-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--brass);
}
.community-card.rust::before { background: var(--rust); }
.community-card.rust {
    background: linear-gradient(135deg, rgba(176, 80, 31, 0.1), var(--panel-alt));
}
.community-card h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 0.5rem 0;
    color: var(--ink);
}
.community-card p {
    font-size: 0.95rem;
    color: var(--ink-dim);
    line-height: 1.6;
    margin: 0 0 1.5rem 0;
}
@media (max-width: 768px) {
    .community-cta { grid-template-columns: 1fr; }
}

/* FAQ */
.faq { max-width: 820px; margin: 0 auto; }
.faq-item {
    background: var(--panel);
    border: 1px solid var(--line);
    border-left: 3px solid var(--brass);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    overflow: hidden;
    transition: border-color .3s ease;
}
.faq-item:hover { border-left-color: var(--brass-light); }
.faq-question {
    width: 100%;
    background: transparent;
    border: none;
    padding: 1.25rem 1.5rem;
    text-align: left;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    transition: color .2s ease;
}
.faq-question:hover { color: var(--brass); }
.faq-question::after {
    content: '+';
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--brass);
    transition: transform .3s ease;
    flex-shrink: 0;
    line-height: 1;
}
.faq-item.open .faq-question::after { transform: rotate(45deg); }
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height .4s ease, padding .4s ease;
    padding: 0 1.5rem;
}
.faq-item.open .faq-answer {
    max-height: 400px;
    padding: 0 1.5rem 1.5rem;
}
.faq-answer p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--ink-dim);
    line-height: 1.65;
}

/* Pricing */
.pricing {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
    align-items: stretch;
    max-width: 1180px;
    margin: 0 auto;
}
.plan {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2.5rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    transition: all .3s ease;
    overflow: hidden;
}
.plan::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--line);
    transition: background .3s ease;
}
.plan:hover {
    transform: translateY(-6px);
    border-color: var(--line-brass);
    box-shadow: var(--shadow-card);
}
.plan:hover::before { background: var(--brass); }
.plan-featured {
    background: var(--panel-raised);
    border-color: var(--line-brass);
    box-shadow: var(--shadow-card);
    transform: scale(1.02);
}
.plan-featured::before { background: var(--brass); height: 4px; }
.plan-featured:hover { transform: translateY(-6px) scale(1.02); }
.plan-badge {
    position: absolute;
    top: 1.25rem; right: 1.25rem;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    background: var(--brass);
    color: var(--bg);
    transform: rotate(-1.5deg);
}
.plan-icon {
    width: 56px; height: 56px;
    border-radius: 12px;
    border: 1px solid var(--line-brass);
    background: var(--panel-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin-bottom: 1.25rem;
}
.plan-featured .plan-icon { border-color: var(--brass); background: var(--panel); }
.plan-name {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--ink);
    margin: 0 0 0.4rem 0;
}
.plan-tagline {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin: 0 0 1.5rem 0;
}
.plan-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 1.75rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--line-soft);
    flex-wrap: wrap;
}
.plan-price-value {
    font-family: var(--font-mono);
    font-size: 2.4rem;
    font-weight: 600;
    line-height: 1;
    color: var(--ink);
    letter-spacing: -1px;
}
.plan-featured .plan-price-value { color: var(--brass); }
.plan-price-period {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ink-faint);
}
.plan-price-note {
    display: block;
    width: 100%;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-top: 4px;
}
.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
    flex: 1;
}
.plan-features li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--ink-dim);
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--line-soft);
}
.plan-features li:last-child { border-bottom: none; }
.plan-features li::before {
    content: '✓';
    color: var(--brass);
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1.5;
}
.plan-features li.muted { color: var(--ink-faint); }
.plan-features li.muted::before { content: '—'; color: var(--ink-faint); }
.plan-cta { width: 100%; margin-top: auto; }
.pricing-note {
    text-align: center;
    margin-top: 2rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--ink-faint);
}
.pricing-note a { color: var(--brass); }
@media (max-width: 992px) {
    .pricing { grid-template-columns: 1fr; max-width: 480px; }
    .plan-featured { transform: none; }
    .plan-featured:hover { transform: translateY(-6px); }
}
@media (max-width: 480px) {
    .plan { padding: 2rem 1.5rem 1.5rem; }
    .plan-price-value { font-size: 2rem; }
}

/* Final CTA */
.final-cta {
    position: relative;
    padding: 6rem 0;
    text-align: center;
    overflow: hidden;
}
.final-cta::before {
    content: '';
    position: absolute;
    bottom: -200px; left: 50%;
    transform: translateX(-50%);
    width: 900px; height: 500px;
    background: radial-gradient(ellipse, rgba(198, 162, 89, 0.18), transparent 60%);
    pointer-events: none;
}
:root[data-theme="light"] .final-cta::before {
    background: radial-gradient(ellipse, rgba(138, 100, 29, 0.14), transparent 60%);
}
.final-cta .h2 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    margin-bottom: 1rem;
    position: relative;
}
.final-cta .lead {
    margin: 0 auto 2rem;
    text-align: center;
    position: relative;
}
.final-cta .btn-row {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    position: relative;
}
.final-cta .mono-note {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--ink-faint);
    position: relative;
}

/* ============================================================
 * 33. Модули — общие помощники (mahjong, watersort, ...)
 * ============================================================ */
.mj-advice {
    padding: 1rem 1.2rem;
    background: var(--bg);
    border: 1px solid var(--line);
    border-left: 3px solid var(--brass);
    border-radius: var(--radius-sm);
}
.mj-advice-text {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: var(--ink);
    line-height: 1.25;
}
.mj-advice-note {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-top: 0.4rem;
}

.mj-log-details { margin: 0; }
.mj-log-details summary {
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--brass);
    padding: 0.4rem 0;
    list-style: none;
}
.mj-log-details summary::-webkit-details-marker { display: none; }
.mj-log-details summary::before { content: '▸ '; color: var(--brass); }
.mj-log-details[open] summary::before { content: '▾ '; }

.mj-log-pre {
    margin: 0.4rem 0 0;
    padding: 0.75rem 0.9rem;
    background: var(--bg);
    border: 1px solid var(--line);
    border-left: 3px solid var(--brass);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    line-height: 1.55;
    color: var(--ink);
    white-space: pre-wrap;
    word-break: break-word;
    overflow: auto;
    max-height: 400px;
}
/* ============================================================
 * 19. Footer (общий + расширенный сеткой)
 * ============================================================ */
.footer {
    background: var(--bg-soft);
    border-top: 1px solid var(--line);
    padding: 4rem 0 2rem;
    color: var(--ink-faint);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 1px;
}
.footer a { color: var(--ink-dim); transition: color .2s ease; }
.footer a:hover { color: var(--brass); }

/* Сетка: бренд + 4 колонки ссылок */
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 2rem 2.4rem;
    margin-bottom: 3rem;
    align-items: start;
}
.footer-col-brand { min-width: 0; }

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1.2rem;
    min-width: 0;
}
.footer-logo-img {
    display: block;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 1.5px solid var(--brass);
    background: var(--panel-alt);
    object-fit: cover;
    flex-shrink: 0;
}
.footer-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ink);
    line-height: 1.15;
    white-space: nowrap;
}
.footer-tag {
    font-size: 0.95rem;
    color: var(--ink-dim);
    line-height: 1.6;
    margin: 0;
    max-width: 320px;
    text-transform: none;
    letter-spacing: normal;
    font-family: var(--font-body);
}

.footer-col h4 {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--brass);
    margin: 0 0 1rem 0;
}
.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-col li { margin-bottom: 0.6rem; }
.footer-col a {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    letter-spacing: 0.6px;
    color: var(--ink-dim);
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: color .15s ease;
}
.footer-col a i {
    font-size: 0.85rem;
    color: var(--brass-dim);
    width: 14px;
    text-align: center;
    flex-shrink: 0;
    transition: color .15s ease;
}
.footer-col a:hover i { color: var(--brass); }

.footer-bottom {
    border-top: 1px solid var(--line);
    padding-top: 1.5rem;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--ink-faint);
}

/* Планшет: 5 колонок → 3 */
@media (max-width: 1100px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr;
    }
    .footer-col-brand {
        grid-column: 1 / -1;
    }
}

/* Планшет узкий: 3 → 2 */
@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.6rem;
    }
    .footer {
        padding: 3rem 0 1.5rem;
    }
    .footer-brand { margin-bottom: 1rem; }
}

/* Мобильный: 1 колонка */
@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .footer-logo-img {
        width: 44px;
        height: 44px;
    }
    .footer-title { font-size: 1rem; }
}
/* ============================================================
 * 35. Общие admin-поля (используются в admin_plans, admin_bugs, admin_users)
 * ------------------------------------------------------------
 * Раньше жили в <style> отдельных файлов. Перенесены сюда.
 * ============================================================ */

.admin-field { margin-bottom: 1rem; }

.admin-field-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ink-dim);
    margin-bottom: 0.35rem;
}

.admin-field-hint {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--ink-faint);
    margin-bottom: 0.3rem;
    display: block;
    line-height: 1.5;
}

.admin-field-input {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-left: 3px solid var(--brass);
    border-radius: var(--radius-sm);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 0.9rem;
}
.admin-field-input:focus {
    outline: none;
    border-color: var(--brass);
    box-shadow: 0 0 0 3px rgba(198, 162, 89, 0.2);
}
.admin-field-textarea {
    resize: vertical;
    line-height: 1.5;
    min-height: 80px;
}

.admin-checkbox-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--ink);
    cursor: pointer;
    margin-bottom: 0.3rem;
}
.admin-checkbox-line input { accent-color: var(--brass); }

.admin-radio-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}
.admin-radio-line {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--ink);
    cursor: pointer;
}
.admin-radio-line input { accent-color: var(--brass); }

/* ============================================================
 * 36. Bug tracker — .bug-*
 * ============================================================ */

/* --- Фильтры --- */
.bug-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
    background: var(--bg);
    border: 1px solid var(--line);
    border-left: 3px solid var(--brass);
    border-radius: var(--radius-sm);
}
.bug-filter-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1 1 180px;
}
.bug-filter-item--wide { flex: 2 1 260px; }
.bug-filter-label {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--ink-dim);
}
.bug-filter-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}
@media (max-width: 576px) {
    .bug-filter-item,
    .bug-filter-item--wide { flex: 1 1 100%; }
}

/* --- Список --- */
.bug-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.bug-pagination {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* --- Строка списка --- */
.bug-row {
    display: grid;
    grid-template-columns: 60px 1fr auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    background: var(--panel-alt);
    border: 1px solid var(--line);
    border-left: 3px solid var(--brass);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--ink);
    transition: background 0.15s ease, border-color 0.15s ease;
}
.bug-row:hover {
    background: var(--panel-raised);
    border-left-color: var(--brass-light);
    color: var(--ink);
}
.bug-row-id {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--ink-faint);
    letter-spacing: 1px;
}
.bug-row-main { min-width: 0; }
.bug-row-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.bug-row-meta {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--ink-dim);
    letter-spacing: 0.5px;
    margin-top: 3px;
}
.bug-row-meta code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: var(--brass);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 3px;
    padding: 1px 5px;
}
.bug-row-status { flex-shrink: 0; }

@media (max-width: 576px) {
    .bug-row {
        grid-template-columns: 1fr auto;
        grid-auto-rows: auto;
    }
    .bug-row-id { grid-column: 1 / -1; }
}

/* --- Бейджи типа / статуса / приоритета --- */
.bug-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid;
    line-height: 1.4;
    white-space: nowrap;
}
.bug-type-bug      { color: var(--rust-light);      border-color: var(--rust);            background: rgba(176, 80, 31, 0.12); }
.bug-type-idea     { color: var(--brass);           border-color: var(--brass);           background: rgba(198, 162, 89, 0.12); }
.bug-type-question { color: var(--status-testing);  border-color: var(--status-testing);  background: var(--status-testing-bg); }
.bug-type-other    { color: var(--ink-dim);         border-color: var(--line);            background: var(--panel-alt); }

.bug-status-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: var(--radius-sm);
    border: 1px solid;
    white-space: nowrap;
    transform: rotate(-1.5deg);
}
.bug-status-new      { color: var(--brass);           border-color: var(--brass);           background: rgba(198, 162, 89, 0.12); }
.bug-status-progress { color: var(--status-testing);  border-color: var(--status-testing);  background: var(--status-testing-bg); }
.bug-status-resolved { color: var(--status-ready);    border-color: var(--status-ready);    background: var(--status-ready-bg); }
.bug-status-wontfix  { color: var(--ink-faint);       border-color: var(--ink-faint);       background: var(--panel-alt); }
.bug-status-dup      { color: var(--status-dev);      border-color: var(--status-dev);      background: var(--status-dev-bg); }

.bug-prio-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 3px;
    border: 1px solid;
    white-space: nowrap;
}
.bug-prio-low      { color: var(--ink-faint);  border-color: var(--line); }
.bug-prio-normal   { color: var(--ink-dim);    border-color: var(--line); }
.bug-prio-high     { color: var(--status-dev); border-color: var(--status-dev); }
.bug-prio-critical { color: var(--rust-light); border-color: var(--rust); }

/* --- Детали заявки --- */
.bug-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    padding: 0.7rem 0 0.9rem;
    border-bottom: 1px dashed var(--line-soft);
    margin-bottom: 0.9rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--ink-dim);
}
.bug-detail-meta b { color: var(--ink); }
.bug-detail-meta code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    color: var(--brass);
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 3px;
    padding: 1px 5px;
}
.bug-detail-desc {
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--ink);
    word-break: break-word;
}
.bug-detail-screenshot {
    margin-top: 1rem;
    padding: 0.6rem;
    background: var(--bg);

    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    text-align: center;
}
.bug-detail-screenshot img {
    max-width: 100%;
    max-height: 480px;
    border-radius: var(--radius-sm);
}

/* --- Смена статуса --- */
.bug-status-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* --- Комментарии --- */
.bug-comments {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.bug-comment {
    padding: 0.7rem 0.9rem;
    background: var(--bg);
    border: 1px solid var(--line);
    border-left: 3px solid var(--line);
    border-radius: var(--radius-sm);
}
.bug-comment-admin {
    border-left-color: var(--brass);
    background: var(--panel-alt);
}
.bug-comment-head {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--ink-dim);
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.bug-comment-head b { color: var(--ink); }
.bug-comment-body {
    font-family: var(--font-body);
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--ink);
    word-break: break-word;
}
.bug-comment-form {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--line-soft);
}
.bug-comment-actions {
    margin-top: 0.6rem;
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

/* --- Плавающая кнопка 🐞 --- */
.bug-float-btn {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 900;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--panel-raised);
    border: 1.5px solid var(--brass);
    color: var(--brass);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    transition: all 0.2s ease;
}
.bug-float-btn:hover {
    background: var(--brass);
    color: var(--bg);
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
@media (max-width: 576px) {
    .bug-float-btn { right: 14px; bottom: 14px; width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    .bug-float-btn { transition: none; }
}
