/*
Theme Name: spark9909-ai Terminal
Theme URI: https://spark9909-ai.ru
Author: Gruz & AI Engine
Description: Кибер-терминал с перфокартой, светофором и фабрикой статей.
Version: 11.3 – добавлены стили для тост-уведомлений, модальных окон и черновиков
*/

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@600;700&display=swap');

/* ========== ГЛОБАЛЬНЫЕ СБРОСЫ ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html, body, #page, .site, .site-content, .site-main {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background-color: #0F1115 !important;
    color: #9CA3AF !important;
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    min-height: 100vh !important;
    overflow: hidden !important;
    position: relative !important;
    left: 0 !important;
    top: 0 !important;
}

/* ========== ШАПКА ========== */
.cyber-main-header {
    background-color: #111317 !important;
    border-bottom: 3px solid #7C3AED !important;
    padding: 10px 20px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    height: 55px !important;
    max-height: 55px !important;
    min-height: 55px !important;
    flex-shrink: 0 !important;
    z-index: 999999 !important;
    position: relative !important;
    width: 100% !important;
    overflow: visible !important;
}
.site-title {
    font-family: 'Orbitron', monospace !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    background: linear-gradient(135deg, #00FF66 0%, #C084FC 60%, #00FF66 100%);
    -webkit-background-clip: text !important;
    background-clip: text !important;
    color: transparent !important;
    text-shadow: 0 0 8px rgba(0,255,102,0.3), 0 0 12px rgba(192,132,252,0.2) !important;
    letter-spacing: 1.5px !important;
    cursor: default !important;
    animation: logoPulse 3s ease-in-out infinite;
}
@keyframes logoPulse {
    0% { filter: drop-shadow(0 0 2px #00FF66); }
    50% { filter: drop-shadow(0 0 8px #C084FC); }
    100% { filter: drop-shadow(0 0 2px #00FF66); }
}
@media (max-width: 768px) {
    .site-title { font-size: 1rem !important; margin-top: 8px !important; }
}

/* ========== БУРГЕР (44×44) ========== */
#cyber-burger-trigger {
    display: block !important;
    font-family: monospace !important;
    font-size: 1.2rem !important;
    font-weight: bold !important;
    color: #7C3AED !important;
    background-color: #15181F !important;
    text-align: center !important;
    cursor: pointer !important;
    user-select: none !important;
    position: absolute !important;
    right: 20px !important;
    top: 12px !important;
    width: 44px !important;
    height: 44px !important;
    line-height: 44px !important;
    z-index: 9999999 !important;
    border-top: 3px solid #D1D5DB !important;
    border-left: 3px solid #D1D5DB !important;
    border-right: 3px solid #000000 !important;
    border-bottom: 3px solid #000000 !important;
    box-shadow: 4px 4px 0px #000000 !important;
    border-radius: 0px !important;
    transition: all 0.05s linear;
}
#cyber-burger-trigger:active {
    transform: translate(4px, 4px) !important;
    box-shadow: none !important;
}

/* ========== НАВИГАЦИЯ (МЕНЮ) ========== */
nav.cyber-nav, #cyber-nav-menu {
    display: none !important;
    flex-direction: column !important;
    position: absolute !important;
    top: 55px !important;
    right: 20px !important;
    left: auto !important;
    width: 220px !important;
    max-width: calc(100vw - 40px) !important;
    background: #111317 !important;
    border-left: 2px solid #7C3AED !important;
    border-bottom: 2px solid #7C3AED !important;
    padding: 15px 0 !important;
    gap: 12px !important;
    z-index: 999995 !important;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    opacity: 0;
    visibility: hidden;
    box-sizing: border-box !important;
}
nav.cyber-nav.burger-active, #cyber-nav-menu.burger-active {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}
#cyber-nav-menu a,
#cyber-nav-menu .cyber-universal-legal {
    all: unset;
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    text-align: center !important;
    color: #4B5563 !important;
    background-color: transparent !important;
    padding: 10px 12px !important;
    font-size: 0.85rem !important;
    font-weight: bold !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    border-bottom: 1px solid #242933 !important;
    font-family: monospace !important;
}
#cyber-nav-menu a:hover,
#cyber-nav-menu .cyber-universal-legal:hover {
    color: #00FF66 !important;
    background: #1E222D !important;
    text-shadow: 0 0 8px rgba(0,255,102,0.4) !important;
}
#cyber-nav-menu #btn-logout-gate { color: #EF4444 !important; }
#cyber-nav-menu a:last-child { border-bottom: none; }
#cyber-nav-menu #btn-login-gate { display: none !important; }
#cyber-nav-menu a[onclick*="toggleMobileMenu"] { color: #EF4444 !important; margin-top: 8px; }
@media (max-width: 768px) {
    #cyber-nav-menu {
        width: 50vw !important;
        min-width: 200px !important;
        right: 0 !important;
        border: 2px solid #7C3AED !important;
        border-top: none !important;
        border-right: none !important;
        box-shadow: -5px 0 15px rgba(124,58,237,0.6), 0 0 12px rgba(124,58,237,0.4);
        background: #111317e6 !important;
        backdrop-filter: blur(4px);
    }
    #cyber-nav-menu a, #cyber-nav-menu .cyber-universal-legal {
        padding: 12px 16px !important;
        font-size: 0.9rem !important;
    }
}

/* ========== ПАНЕЛИ ========== */
.panel-box {
    background-color: #0F1115 !important;
    border: 2px solid #242933 !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 1100px !important;
    overflow: hidden !important;
    margin: 0 !important;
    height: 100% !important;
    box-shadow: 0 0 15px rgba(0,0,0,0.75) !important;
}
.panel-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0 12px !important;
    height: 38px !important;
    background-color: #15181F !important;
    border-top: 3px solid #D1D5DB !important;
    border-left: 3px solid #D1D5DB !important;
    border-right: 3px solid #000000 !important;
    border-bottom: 3px solid #000000 !important;
    box-shadow: 4px 4px 0px #000000 !important;
    margin-bottom: 4px !important;
    font-family: monospace !important;
    font-weight: bold !important;
    color: #9CA3AF !important;
}
.panel-header-left {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}
/* Цветные кружки в заголовках панелей */
.panel-bullet {
    width: 10px !important;
    height: 10px !important;
    border-radius: 50% !important;
    display: inline-block !important;
    flex-shrink: 0 !important;
}
.bullet-terminal { background-color: #00FF66; box-shadow: 0 0 4px #00FF66; }
.bullet-automation { background-color: #3B82F6; box-shadow: 0 0 4px #3B82F6; }
.bullet-mail { background-color: #F59E0B; box-shadow: 0 0 4px #F59E0B; }
.bullet-info { background-color: #7C3AED; box-shadow: 0 0 4px #7C3AED; }
.bullet-account { background-color: #EF4444; box-shadow: 0 0 4px #EF4444; }
.bullet-factory { background-color: #6B7280; box-shadow: 0 0 4px #6B7280; }
.bullet-catalog { background-color: #14B8A6; box-shadow: 0 0 4px #14B8A6; }

/* Единый стиль заголовков панелей (маленький шрифт) */
.panel-title {
    font-size: 6pt !important;
    font-family: monospace !important;
    font-weight: bold !important;
    color: #9CA3AF !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60vw;
}
@media (max-width: 768px) {
    .panel-title {
        font-size: 5pt !important;
        white-space: normal;
        max-width: 55vw;
    }
}
@media (max-width: 480px) {
    .panel-title { font-size: 3.5pt !important; }
}

main.cyber-main-canvas { padding: 12px 24px !important; }
@media (max-width: 768px) { main.cyber-main-canvas { padding: 0 !important; } }

/* ========== СВЕТОФОР (3 функциональные кнопки) ========== */
.traffic-light-red, .traffic-light-yellow, .traffic-light-green {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    transition: all 0.1s ease !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5), inset 0 1px 1px rgba(255,255,255,0.15) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
}
.traffic-light-red {
    background: linear-gradient(145deg, #8B0000, #4A0000) !important;
    border-color: #ff4d4d !important;
    box-shadow: 0 0 6px #ff4d4d, 0 2px 4px rgba(0,0,0,0.5) !important;
}
.traffic-light-yellow {
    background: linear-gradient(145deg, #D97706, #92400E) !important;
    border-color: #F59E0B !important;
    box-shadow: 0 0 6px #F59E0B, 0 2px 4px rgba(0,0,0,0.5) !important;
}
.traffic-light-green {
    background: linear-gradient(145deg, #15803D, #0A4D2A) !important;
    border-color: #4ADE80 !important;
    box-shadow: 0 0 6px #4ADE80, 0 2px 4px rgba(0,0,0,0.5) !important;
}
.traffic-light-green.sound-muted {
    background: linear-gradient(145deg, #4B5563, #1F2937) !important;
    border-color: #9CA3AF !important;
    box-shadow: none !important;
}
.traffic-light-green.sound-muted svg path {
    stroke: #9CA3AF !important;
}

/* ========== КНОПКА КОПИРОВАНИЯ ========== */
.copy-msg-btn {
    cursor: pointer;
    margin-left: 10px;
    font-size: 0.7rem;
    opacity: 0.4;
    transition: 0.1s;
    display: inline-block;
}
.copy-msg-btn:hover { opacity: 1; }

/* ========== ПАНЕЛЬ ЭМОДЗИ ========== */
.emoji-panel {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: #111317;
    border: 2px solid #7C3AED;
    border-radius: 8px;
    padding: 8px;
    display: none;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 250px;
    z-index: 1000;
    margin-bottom: 8px;
}
.emoji-panel span { font-size: 1.3rem; cursor: pointer; padding: 4px; border-radius: 4px; }
.emoji-panel span:hover { background: #242933; transform: scale(1.1); }
.emoji-trigger, .mic-trigger {
    all: unset;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-family: monospace !important;
    background-color: #15181F !important;
    color: #00FF66 !important;
    border-top: 2px solid #9CA3AF !important;
    border-left: 2px solid #9CA3AF !important;
    border-right: 2px solid #000000 !important;
    border-bottom: 2px solid #000000 !important;
    box-shadow: 3px 3px 0px #000000 !important;
    cursor: pointer !important;
    transition: all 0.05s linear !important;
    margin: 2px 4px !important;
}
.emoji-trigger:active, .mic-trigger:active { transform: translate(3px, 3px) !important; box-shadow: none !important; }
@media (min-width: 769px) {
    .emoji-trigger, .mic-trigger { width: 32px; height: 32px; font-size: 1rem; margin: 0; }
    .buttons-vertical { display: flex; flex-direction: column; gap: 6px; margin-left: 8px; }
}
@media (max-width: 768px) {
    .emoji-trigger, .mic-trigger { width: 34px; height: 34px; font-size: 1.1rem; }
    .buttons-vertical { display: inline-flex; flex-direction: row; gap: 0; }
}

/* ========== ПОДСВЕТКА КОДА ========== */
pre code.hljs { display: block; overflow-x: auto; padding: 1em; background: #0F1115; border-left: 3px solid #00FF66; font-family: monospace; font-size: 0.85rem; }
.hljs { color: #abb2bf; background: #0F1115; }
.hljs-keyword, .hljs-operator, .hljs-selector-tag { color: #c678dd; }
.hljs-string, .hljs-regexp { color: #98c379; }
.hljs-number, .hljs-literal { color: #d19a66; }
.hljs-comment { color: #5c6370; }
.hljs-function, .hljs-title { color: #61afef; }

/* ========== ТЕЛЕМЕТРИЯ ========== */
.cyber-telemetry-strip {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0 12px !important;
    border-bottom: 2px solid #242933 !important;
    width: 100% !important;
    height: 28px !important;
    min-height: 28px !important;
    background-color: #111317 !important;
    font-family: monospace !important;
    font-size: 0.78rem !important;
    user-select: none !important;
}
.telemetry-item { color: #4B5563 !important; }
#bkw-load-1, #bkw-load-2 { color: #00FF66 !important; font-weight: bold; transition: text-shadow 0.2s; }
#tok-speed { color: #3B82F6 !important; font-weight: bold; transition: text-shadow 0.2s; }
.pulse-green { animation: pulse-green 0.4s ease; }
.pulse-blue { animation: pulse-blue 0.4s ease; }
@keyframes pulse-green { 0% { text-shadow: 0 0 0 #00FF66; } 50% { text-shadow: 0 0 8px #00FF66; } 100% { text-shadow: 0 0 0 #00FF66; } }
@keyframes pulse-blue { 0% { text-shadow: 0 0 0 #3B82F6; } 50% { text-shadow: 0 0 8px #3B82F6; } 100% { text-shadow: 0 0 0 #3B82F6; } }

/* ========== ЭКРАН ТЕРМИНАЛА ========== */
.terminal-screen {
    flex: 1;
    width: 100%;
    padding: 12px;
    font-size: 0.85rem;
    font-family: monospace;
    color: #9CA3AF;
    background-color: #0F1115;
    overflow-y: auto !important;
    overflow-x: hidden;
    box-sizing: border-box;
    text-align: left;
    line-height: 1.4;
    position: relative;
}
.terminal-screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 255, 102, 0.02) 50%, rgba(0, 0, 0, 0) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 1;
    animation: scan 20s linear infinite;
}
@keyframes scan { 0% { background-position: 0 0; } 100% { background-position: 0 100%; } }
.cyber-container-wrapper::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg, rgba(0,0,0,0.05) 0px, rgba(0,0,0,0.05) 2px, transparent 2px, transparent 6px);
    pointer-events: none;
    z-index: 99999;
}

/* ========== СПИННЕР ========== */
.cyber-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    border: 2px solid #00FF66;
    border-top: 2px solid #7C3AED;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.loader-message { display: inline-flex; align-items: center; font-family: monospace; color: #3B82F6; }

/* ========== КНОПКИ (ЕДИНЫЙ СТИЛЬ) ========== */
button, input[type="submit"], input[type="reset"], .cyber-nav a, .cyber-universal-legal,
.auth-graphite-container button, #cyber-login-form button, #cyber-reg-form button,
#cyber-automation-form button, #cyber-mail-form button,
label[style*="cursor:pointer"] {
    all: unset;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 36px !important;
    padding: 0 16px !important;
    font-family: monospace !important;
    font-weight: bold !important;
    font-size: 0.8rem !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    user-select: none !important;
    white-space: nowrap !important;
    background-color: #15181F !important;
    color: #00FF66 !important;
    border-top: 2px solid #9CA3AF !important;
    border-left: 2px solid #9CA3AF !important;
    border-right: 2px solid #000000 !important;
    border-bottom: 2px solid #000000 !important;
    box-shadow: 3px 3px 0px #000000 !important;
    transition: all 0.05s linear !important;
    border-radius: 0px !important;
}
button:active, input[type="submit"]:active, input[type="reset"]:active,
.cyber-nav a:active, .cyber-universal-legal:active,
label[style*="cursor:pointer"]:active {
    transform: translate(3px, 3px) !important;
    box-shadow: none !important;
}
button:not(.matrix-pill-btn):hover,
.cyber-nav a:hover,
.cyber-universal-legal:hover,
#cyber-automation-form label:hover,
#cyber-mail-form button:hover {
    filter: brightness(1.2);
    box-shadow: 3px 3px 0px #000000, 0 0 6px currentColor;
}
.auth-graphite-container button,
#cyber-login-form button,
#cyber-reg-form button { width: 100% !important; box-sizing: border-box !important; }
#cyber-login-form button[type="button"]:first-of-type { background-color: #0A3A1A !important; color: #00FF66 !important; }
#cyber-login-form button[type="button"]:last-of-type { background-color: #1A1A2E !important; color: #3B82F6 !important; }
#cyber-reg-form button[type="button"]:first-of-type { background-color: #7C2D12 !important; color: #F97316 !important; }
#cyber-reg-form button[type="button"]:last-of-type { background-color: #1A0D0E !important; color: #EF4444 !important; }
#cyber-automation-form button { background-color: #0A3A1A !important; color: #00FF66 !important; }
#cyber-mail-form button { background-color: #1A1A2E !important; color: #3B82F6 !important; }
#cyber-automation-form label {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 36px !important;
    padding: 0 16px !important;
    background-color: #15181F !important;
    color: #93C5FD !important;
    border-top: 2px solid #9CA3AF !important;
    border-left: 2px solid #9CA3AF !important;
    border-right: 2px solid #000000 !important;
    border-bottom: 2px solid #000000 !important;
    box-shadow: 3px 3px 0px #000000 !important;
    cursor: pointer !important;
    font-family: monospace !important;
    font-weight: bold !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
}
#cyber-automation-form label:active { transform: translate(3px, 3px) !important; box-shadow: none !important; }

/* Капсулы Нео – только для кнопок Сброс и Ввод в терминале */
.matrix-pill-btn {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    height: 40px !important;
    border-radius: 40px !important;
    background: linear-gradient(145deg, #1a1f2a, #0f1119) !important;
    border: none !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.5), inset 0 1px 1px rgba(255,255,255,0.1) !important;
    cursor: pointer !important;
    font-family: monospace !important;
    font-weight: bold !important;
    font-size: 0.85rem !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.1s ease !important;
    color: #fff !important;
    text-shadow: 0 0 2px rgba(0,0,0,0.5) !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}
.matrix-pill-btn.pill-red {
    background: linear-gradient(145deg, #3a0a0e, #1f0508) !important;
    box-shadow: 0 0 8px #ff4d4d, inset 0 1px 1px rgba(255,255,255,0.2) !important;
    color: #ffb3b3 !important;
    border: 1px solid #ff4d4d !important;
}
.matrix-pill-btn.pill-green {
    background: linear-gradient(145deg, #0a3a1a, #051f0a) !important;
    box-shadow: 0 0 8px #00ff66, inset 0 1px 1px rgba(255,255,255,0.2) !important;
    color: #b3ffcc !important;
    border: 1px solid #00ff66 !important;
}
.matrix-pill-btn:active { transform: translateY(2px) !important; box-shadow: 0 2px 4px rgba(0,0,0,0.7), inset 0 1px 2px rgba(255,255,255,0.1) !important; }

/* ========== ПОЛЯ ВВОДА ========== */
textarea.terminal-input {
    width: 100%;
    height: 50px;
    min-height: 50px;
    max-height: 33vh;
    font-size: 0.95rem;
    padding: 6px 65px 6px 10px;
    margin: 0;
    background-color: #08090A;
    border: 2px solid #242933;
    color: #FFFFFF;
    font-family: monospace;
    box-sizing: border-box;
    outline: none;
    resize: none;
    border-radius: 0px;
}
.auth-graphite-container input,
#cyber-login-form input,
#cyber-reg-form input,
input#user_login,
input#user_pass,
input#reg_user_login,
input#reg_user_email,
input#reg_user_pass,
input#reg_user_pass_confirm {
    background-color: #08090A !important;
    border: 2px solid #242933 !important;
    color: #FFFFFF !important;
    -webkit-text-fill-color: #FFFFFF !important;
    -webkit-box-shadow: 0 0 0px 1000px #08090A inset !important;
    box-shadow: 0 0 0px 1000px #08090A inset !important;
    caret-color: #00FF66 !important;
}
.char-counter {
    position: absolute;
    right: 10px;
    bottom: 6px;
    z-index: 50;
    font-family: monospace;
    font-size: 0.7rem;
    font-weight: bold;
    pointer-events: none;
    user-select: none;
}

/* ========== КАПЧА (ЕДИНЫЙ СТИЛЬ) ========== */
#input-captcha-field,
#input-captcha-field-mobile,
#aut-captcha-input,
#mail-captcha-input,
#article-captcha-input {
    width: 48px !important;
    min-width: 48px !important;
    max-width: 48px !important;
    text-align: center;
    background-color: #08090A;
    border: 2px solid #242933;
    color: #00FF66;
    font-family: monospace;
    font-size: 0.85rem;
    border-radius: 0px;
    outline: none;
    box-sizing: border-box;
    padding: 0;
    -moz-appearance: textfield;
    height: 36px;
}
#input-captcha-field-mobile { height: 40px; }
#input-captcha-label,
#article-captcha-label,
#aut-captcha-label,
#mail-captcha-label {
    color: #7C3AED;
    font-weight: bold;
    font-size: 0.85rem;
    font-family: monospace;
    user-select: none;
}
input::-webkit-inner-spin-button, input::-webkit-outer-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
    display: none !important;
}

/* ========== ЧЕКБОКС ФЗ-152 ========== */
.law-box {
    width: 100%;
    box-sizing: border-box;
    margin-top: 6px;
    padding: 8px 12px;
    background-color: #10B981;
    border-top: 2px solid #047857;
    display: flex;
    align-items: center;
}
#custom-dos-checkbox {
    width: 22px;
    height: 22px;
    background-color: #08090A;
    border-top: 2px solid #000000;
    border-left: 2px solid #000000;
    border-right: 2px solid #D1D5DB;
    border-bottom: 2px solid #D1D5DB;
    box-shadow: inset 1px 1px 0px #000000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 0px;
}
#cyber-neon-check-mark {
    display: none;
    color: #00FF66;
    font-size: 1rem;
    font-weight: bold;
    font-family: monospace;
    line-height: 1;
    text-shadow: 0 0 5px #00FF66;
}
.law-text-label {
    font-size: 0.88rem;
    font-family: monospace;
    font-weight: bold;
    color: #064E3B;
    margin-left: 12px;
    user-select: none;
    cursor: pointer;
}

/* ========== СКРОЛЛБАРЫ ========== */
::-webkit-scrollbar { width: 8px; background-color: #08090A; }
::-webkit-scrollbar-track { background: #08090A; }
::-webkit-scrollbar-thumb { background: #7C3AED; border: 1px solid #15181F; }
::-webkit-scrollbar-thumb:hover { background: #00FF66; }
* { scrollbar-width: thin; scrollbar-color: #7C3AED #08090A; }

/* ========== МОБИЛЬНАЯ АДАПТАЦИЯ ========== */
@media (max-width: 768px) {
    .terminal-screen, #terminal-main-screen { padding: 10px; font-size: 0.82rem; overflow-y: auto !important; }
    .terminal-input-row > div:first-child { flex-direction: column !important; gap: 12px !important; }
    .textarea-wrapper { width: 100% !important; min-width: 100% !important; }
    .pills-and-captcha-wrapper .captcha-wrapper-block { display: none !important; }
    .captcha-and-counter { display: flex !important; flex-direction: row !important; align-items: center !important; justify-content: space-between !important; width: 100% !important; margin-top: 8px !important; }
    .captcha-and-counter .captcha-wrapper-block { display: flex !important; gap: 8px !important; }
    .pills-action-right { justify-content: center !important; flex-wrap: wrap !important; gap: 8px !important; }
    .matrix-pill-btn { flex: 0 1 auto !important; min-width: 100px !important; width: auto !important; }
    .mic-trigger { font-size: 1.3rem !important; margin: 0 !important; }
    .mobile-buttons-row { margin-top: 16px !important; gap: 12px !important; }
    .char-counter { display: none !important; }
    .prompt-symbol { display: none !important; }
    .auth-graphite-container { max-height: 280px !important; overflow-y: scroll !important; padding: 12px !important; }
    button, .cyber-nav a, .cyber-universal-legal,
    .auth-graphite-container button, #cyber-login-form button, #cyber-reg-form button,
    #cyber-automation-form button, #cyber-mail-form button,
    label[style*="cursor:pointer"] { padding: 0 12px !important; font-size: 0.75rem !important; }
    .cyber-telemetry-strip { font-size: 0.58rem !important; padding: 0 6px !important; height: 24px !important; }
    .telemetry-item { font-size: 0.58rem !important; white-space: nowrap !important; }
    .char-counter-mobile { font-family: 'Courier New', monospace; font-size: 0.65rem; background: rgba(0,0,0,0.6); padding: 0 4px; border-radius: 2px; display: inline-flex !important; }
    .panel-title { white-space: normal !important; font-size: 5pt !important; max-width: 55vw !important; }
}
@media (max-width: 480px) { .panel-title { font-size: 3.5pt !important; } }
@media (max-width: 1024px) and (orientation: landscape) {
    body > :not(.rotate-warning) { display: none !important; }
    .rotate-warning { display: flex !important; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #0F1115; color: #00FF66; font-family: monospace; align-items: center; justify-content: center; text-align: center; z-index: 999999; flex-direction: column; }
}
.rotate-warning { display: none; }
.edit-msg-btn, .copy-msg-btn, .speak-msg-btn {
    cursor: pointer;
    margin-left: 8px;
    font-size: 0.7rem;
    opacity: 0.4;
    transition: 0.1s;
    display: inline-block;
}
.edit-msg-btn:hover, .copy-msg-btn:hover, .speak-msg-btn:hover { opacity: 1; }
.save-edit-btn, .cancel-edit-btn { border: none; border-radius: 4px; cursor: pointer; font-family: monospace; }

/* ========== ПЕРЕОПРЕДЕЛЕНИЕ АВТОЗАПОЛНЕНИЯ ========== */
input, textarea {
    background-color: #08090A !important;
    background: #08090A !important;
    color: #00FF66 !important;
    caret-color: #00FF66 !important;
}
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
textarea:-webkit-autofill:active {
    -webkit-text-fill-color: #00FF66 !important;
    -webkit-box-shadow: 0 0 0px 1000px #08090A inset !important;
    transition: background-color 5000s ease-in-out 0s;
    background-color: #08090A !important;
    caret-color: #00FF66 !important;
}
#article-topic, #cyber-main-textarea, #aut-prompt-field, #mail-to, #mail-subject, #mail-body {
    background-color: #08090A !important;
    color: #00FF66 !important;
}

/* ========== ПЕРФОКАРТА ДЛЯ СООБЩЕНИЙ ИИ (усиленная) ========== */
.assistant-message {
    background: #F5F0E1 !important;
    color: #1A1A1A !important;
    font-family: 'Courier New', 'Fira Code', monospace;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    line-height: 1.5;
    margin: 12px 0;
    padding: 14px 18px;
    border-left: 6px solid #D4B483;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1), inset 0 0 0 1px #FFF8E7;
    position: relative;
    transition: all 0.1s ease;
}
.assistant-message::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 10px;
    width: 24px;
    height: 24px;
    background-image: radial-gradient(circle, #A58E6F 1.5px, transparent 1.5px);
    background-size: 6px 6px;
    opacity: 0.25;
    pointer-events: none;
}
.assistant-message::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, transparent 0%, transparent 70%, #D4B483 70%, #D4B483 100%);
    pointer-events: none;
}
.operator-message {
    color: #9CA3AF;
    font-family: monospace;
    margin: 8px 0;
    padding-left: 8px;
    border-left: 2px solid #7C3AED;
    background: transparent;
}
#article-edit, #article-result, #article-view {
    background: #F5F0E1 !important;
    color: #1A1A1A !important;
    font-family: 'Courier New', monospace;
    border: 1px solid #D4B483;
    box-shadow: inset 0 0 0 1px #FFF8E7;
    padding: 15px;
}
@keyframes punchCard {
    0% { background-color: #F0E3C8; transform: scale(0.99); }
    100% { background-color: #F5F0E1; transform: scale(1); }
}
.assistant-message { animation: punchCard 0.2s ease; }

/* ========== АНИМИРОВАННЫЙ КУРСОР ========== */
.prompt-symbol {
    position: relative;
    display: inline-block;
}
.blinking-cursor {
    display: inline-block;
    animation: blinkCursor 1s step-end infinite;
    margin-left: 2px;
}
@keyframes blinkCursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ========== КНОПКИ ФАБРИКИ СТАТЕЙ (одинаковые, не капсулы) ========== */
.factory-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 36px !important;
    padding: 0 16px !important;
    font-family: monospace !important;
    font-weight: bold !important;
    font-size: 0.8rem !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    user-select: none !important;
    white-space: nowrap !important;
    background-color: #15181F !important;
    color: #00FF66 !important;
    border-top: 2px solid #9CA3AF !important;
    border-left: 2px solid #9CA3AF !important;
    border-right: 2px solid #000000 !important;
    border-bottom: 2px solid #000000 !important;
    box-shadow: 3px 3px 0px #000000 !important;
    transition: all 0.05s linear !important;
    border-radius: 0px !important;
}
.factory-btn:active {
    transform: translate(3px, 3px) !important;
    box-shadow: none !important;
}
.factory-btn:hover {
    filter: brightness(1.2);
    box-shadow: 3px 3px 0px #000000, 0 0 6px currentColor;
}

/* ========== МОДАЛЬНОЕ ОКНО ПРЕДПРОСМОТРА (крестик) ========== */
#preview-modal {
    position: fixed;
    top: 10%;
    left: 10%;
    width: 80%;
    height: 80%;
    background: #0F1115;
    border: 2px solid #7C3AED;
    overflow: auto;
    padding: 0;
    z-index: 10000;
    border-radius: 8px;
    box-shadow: 0 0 30px black;
    display: none;
    flex-direction: column;
}
.preview-modal-header {
    display: flex;
    justify-content: flex-end;
    padding: 10px;
    background-color: #111317;
    border-bottom: 1px solid #7C3AED;
}
.preview-modal-close {
    background: none;
    border: none;
    color: #00FF66;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    padding: 0 10px;
}
.preview-modal-close:hover {
    color: #EF4444;
    transform: scale(1.1);
}
#preview-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    color: #E5E7EB;
    font-family: monospace;
    white-space: pre-wrap;
}

/* ========== КНОПКИ ОБРАТНОЙ СВЯЗИ (👍/👎) ========== */
.feedback-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.6;
    transition: 0.1s;
    padding: 0 4px;
    font-family: monospace;
}
.feedback-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}
.feedback-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ========== МОДАЛЬНОЕ ОКНО ДЛЯ ДИЗЛАЙКА (обратная связь) ========== */
.feedback-modal {
    position: fixed;
    top: 30%;
    left: 30%;
    width: 40%;
    background: #111317;
    border: 2px solid #7C3AED;
    padding: 20px;
    z-index: 100001;
    color: #00FF66;
    font-family: monospace;
    border-radius: 8px;
    box-shadow: 0 0 30px black;
}
@media (max-width: 768px) {
    .feedback-modal {
        top: 20%;
        left: 10%;
        width: 80%;
    }
}
.feedback-modal select,
.feedback-modal textarea {
    width: 100%;
    background: #08090A;
    border: 2px solid #242933;
    color: #00FF66;
    padding: 6px;
    font-family: monospace;
    margin: 8px 0;
}
.feedback-modal button {
    margin: 4px;
}

/* ========== СТИЛИ ДЛЯ ТОСТ-УВЕДОМЛЕНИЙ (новая система) ========== */
#cyber-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 320px;
}
.cyber-toast {
    background: #111317;
    border-left: 4px solid #00FF66;
    padding: 10px 16px;
    font-family: monospace;
    font-size: 0.85rem;
    color: #E5E7EB;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    animation: fadeInUp 0.2s ease;
    border-radius: 0 4px 4px 0;
    word-break: break-word;
}
.cyber-toast.error {
    border-left-color: #EF4444;
    background: #1A0D0E;
}
.cyber-toast.warning {
    border-left-color: #F59E0B;
}
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== МОДАЛЬНОЕ ОКНО ПОДТВЕРЖДЕНИЯ (confirm) ========== */
.cyber-confirm-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #111317;
    border: 2px solid #7C3AED;
    padding: 20px;
    z-index: 100001;
    color: #00FF66;
    font-family: monospace;
    border-radius: 8px;
    box-shadow: 0 0 30px black;
    min-width: 280px;
    text-align: center;
}
.cyber-confirm-modal button {
    margin: 12px 8px 0;
    padding: 6px 16px;
    background: #15181F;
    border: 1px solid #00FF66;
    color: #00FF66;
    cursor: pointer;
    font-family: monospace;
    font-weight: bold;
}
.cyber-confirm-modal button:hover {
    background: #00FF66;
    color: #0A0C10;
}
/* ============================================================
   FIREFOX MOBILE (ANDROID) — ФИНАЛЬНЫЙ ЧИСТЫЙ ВАРИАНТ
   ============================================================ */
@-moz-document url-prefix() {
    
    /* --- ОБЩИЙ КОНТЕЙНЕР --- */
    .cyber-container-wrapper {
        height: -moz-available !important;
        min-height: -moz-available !important;
        max-height: -moz-available !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    /* --- ШАПКА --- */
    .cyber-main-header {
        flex-shrink: 0 !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 999999 !important;
        height: 56px !important;
        min-height: 56px !important;
        padding: 6px 16px !important;
        background-color: #111317 !important;
    }
    .site-title {
        font-size: 0.9rem !important;
    }
    
    /* --- БУРГЕР --- */
    #cyber-burger-trigger {
        position: fixed !important;
        top: 8px !important;
        right: 12px !important;
        width: 44px !important;
        height: 44px !important;
        line-height: 44px !important;
        font-size: 1.3rem !important;
        z-index: 99999999 !important;
    }
    
    /* --- ПАНЕЛЬ ЗАГОЛОВОК (светофоры) --- */
    .panel-header {
        flex-shrink: 0 !important;
        height: 44px !important;
        min-height: 44px !important;
        padding: 0 8px !important;
        gap: 4px !important;
        flex-wrap: nowrap !important;
        overflow: hidden !important;
    }
    .panel-header-left {
        gap: 4px !important;
        flex-wrap: nowrap !important;
        overflow: hidden !important;
    }
    .panel-title {
        font-size: 7pt !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 40vw !important;
    }
    
    /* --- СВЕТОФОР --- */
    .traffic-light-red,
    .traffic-light-yellow,
    .traffic-light-green {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        border-radius: 50% !important;
        flex-shrink: 0 !important;
        padding: 0 !important;
        margin: 0 2px !important;
    }
    .traffic-light-red svg,
    .traffic-light-yellow svg,
    .traffic-light-green svg {
        width: 16px !important;
        height: 16px !important;
    }
    .panel-bullet {
        width: 8px !important;
        height: 8px !important;
        min-width: 8px !important;
    }
    
    /* --- ТЕЛЕМЕТРИЯ (BKW) --- */
    .cyber-telemetry-strip {
        flex-shrink: 0 !important;
        height: 24px !important;
        min-height: 24px !important;
        font-size: 0.6rem !important;
        padding: 0 8px !important;
    }
    .telemetry-item {
        font-size: 0.6rem !important;
    }
    
    /* --- ОСНОВНАЯ ЧАСТЬ (терминал + ввод) --- */
    main.cyber-main-canvas {
        flex: 1 1 auto !important;
        min-height: 0 !important;  /* КЛЮЧЕВОЙ ФИКС ДЛЯ СКРОЛЛА */
        height: auto !important;
        padding: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }
    
    /* --- ВСЕ ПАНЕЛИ --- */
    .panel-box {
        flex: 1 1 auto !important;
        min-height: 0 !important;  /* КЛЮЧЕВОЙ ФИКС ДЛЯ СКРОЛЛА */
        height: auto !important;
        max-height: none !important;
        display: flex !important;
        flex-direction: column !important;
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
    }
    .panel-box:not(#block-terminal) {
        display: none !important;  /* Скрываем все панели, кроме терминала, по умолчанию */
    }
    #block-terminal {
        display: flex !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        flex-direction: column !important;
    }
    
    /* --- СКРОЛЛ ТЕРМИНАЛА --- */
    .terminal-screen {
        flex: 1 1 0 !important;
        min-height: 0 !important;  /* КЛЮЧЕВОЙ ФИКС */
        overflow-y: auto !important;
        -moz-overflow-y: scroll !important;
        padding: 10px !important;
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* --- ПАНЕЛЬ ВВОДА --- */
    .terminal-input-row {
        flex-shrink: 0 !important;
        padding: 8px !important;
        gap: 6px !important;
        min-height: 80px !important;
        border-top: 2px solid #242933 !important;
        background-color: #0F1115 !important;
    }
    
    /* --- ПОЛЕ ВВОДА --- */
    .terminal-input-row textarea {
        font-size: 0.9rem !important;
        height: 44px !important;
        min-height: 44px !important;
        padding: 8px !important;
    }
    .textarea-wrapper {
        min-width: 0 !important;
        flex: 1 !important;
    }
    .pills-and-captcha-wrapper {
        flex-wrap: wrap !important;
        gap: 6px !important;
    }
    
    /* --- КАПЧА --- */
    #input-captcha-field {
        width: 48px !important;
        min-width: 48px !important;
        height: 34px !important;
        font-size: 0.9rem !important;
    }
    #input-captcha-label {
        font-size: 0.8rem !important;
    }
    
    /* --- КНОПКИ --- */
    .matrix-pill-btn {
        height: 34px !important;
        min-width: 80px !important;
        font-size: 0.7rem !important;
        padding: 0 10px !important;
    }
    .factory-btn {
        height: 36px !important;
        padding: 0 12px !important;
        font-size: 0.75rem !important;
    }
    
    /* --- ТОСТЫ --- */
    #cyber-toast-container {
        bottom: 10px !important;
        right: 10px !important;
        gap: 6px !important;
        max-width: 90% !important;
    }
    .cyber-toast {
        padding: 10px 14px !important;
        font-size: 0.8rem !important;
    }
    
    /* --- МОДАЛЬНЫЕ ОКНА --- */
    .feedback-modal,
    .cyber-confirm-modal {
        max-width: 90vw !important;
        max-height: 80vh !important;
        overflow-y: auto !important;
    }
}

/* ============================================================
   FIREFOX MOBILE — ФИНАЛЬНЫЙ ИСПРАВЛЕННЫЙ ВАРИАНТ
   ============================================================ */
@-moz-document url-prefix() {
    
    /* --- ОБЩИЙ КОНТЕЙНЕР --- */
    .cyber-container-wrapper {
        height: -moz-available !important;
        min-height: -moz-available !important;
        max-height: -moz-available !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        background: #0F1115 !important;
    }
    
    /* --- ШАПКА --- */
    .cyber-main-header {
        flex-shrink: 0 !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 999999 !important;
        height: 56px !important;
        min-height: 56px !important;
        padding: 6px 16px !important;
        background: #111317 !important;
    }
    .site-title {
        font-size: 0.9rem !important;
    }
    
    /* --- БУРГЕР --- */
    #cyber-burger-trigger {
        position: fixed !important;
        top: 8px !important;
        right: 12px !important;
        width: 44px !important;
        height: 44px !important;
        line-height: 44px !important;
        font-size: 1.3rem !important;
        z-index: 99999999 !important;
        background: #15181F !important;
        border: 2px solid #7C3AED !important;
        text-align: center !important;
        cursor: pointer !important;
    }
    
    /* --- ПАНЕЛЬ ЗАГОЛОВКОВ --- */
    .panel-header {
        flex-shrink: 0 !important;
        height: 44px !important;
        min-height: 44px !important;
        padding: 0 8px !important;
        gap: 4px !important;
        display: flex !important;
        align-items: center !important;
        background: #15181F !important;
        border-bottom: 2px solid #242933 !important;
    }
    .panel-header-left {
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
        flex: 1 !important;
        overflow: hidden !important;
    }
    .panel-title {
        font-size: 7pt !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 40vw !important;
        color: #9CA3AF !important;
    }
    
    /* --- СВЕТОФОР --- */
    .traffic-light-red,
    .traffic-light-yellow,
    .traffic-light-green {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        border-radius: 50% !important;
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
    }
    .traffic-light-red svg,
    .traffic-light-yellow svg,
    .traffic-light-green svg {
        width: 16px !important;
        height: 16px !important;
    }
    .panel-bullet {
        width: 8px !important;
        height: 8px !important;
        min-width: 8px !important;
        border-radius: 50% !important;
        display: inline-block !important;
    }
    
    /* --- ТЕЛЕМЕТРИЯ --- */
    .cyber-telemetry-strip {
        flex-shrink: 0 !important;
        height: 24px !important;
        min-height: 24px !important;
        font-size: 0.6rem !important;
        padding: 0 8px !important;
        display: flex !important;
        align-items: center !important;
        background: #111317 !important;
        border-bottom: 1px solid #242933 !important;
    }
    .telemetry-item {
        font-size: 0.6rem !important;
        color: #4B5563 !important;
        margin-right: 12px !important;
    }
    
    /* --- ОСНОВНАЯ ЧАСТЬ --- */
    main.cyber-main-canvas {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: auto !important;
        padding: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        background: #0F1115 !important;
    }
    
    /* --- ВСЕ ПАНЕЛИ --- */
    .panel-box {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        display: flex !important;
        flex-direction: column !important;
        border: none !important;
        border-radius: 0 !important;
        background: #0F1115 !important;
    }
    .panel-box:not(#block-terminal) {
        display: none !important;
    }
    #block-terminal {
        display: flex !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        flex-direction: column !important;
    }
    
    /* --- СКРОЛЛ ТЕРМИНАЛА --- */
    .terminal-screen {
        flex: 1 1 0 !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        padding: 10px !important;
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
        background: #0F1115 !important;
        color: #9CA3AF !important;
        font-family: monospace !important;
        font-size: 0.85rem !important;
        line-height: 1.5 !important;
    }
    
    /* --- ПАНЕЛЬ ВВОДА (ВСЕГДА ВНИЗУ) --- */
    .terminal-input-row {
        flex-shrink: 0 !important;
        padding: 8px !important;
        gap: 6px !important;
        min-height: 70px !important;
        border-top: 2px solid #242933 !important;
        background: #0F1115 !important;
        display: flex !important;
        flex-direction: column !important;
        position: relative !important;
        bottom: 0 !important;
        z-index: 10 !important;
    }
    
    /* --- ПОЛЕ ВВОДА (РАСКРЫВАЕТСЯ) --- */
    .terminal-input-row textarea {
        font-size: 0.9rem !important;
        height: 44px !important;
        min-height: 44px !important;
        max-height: 200px !important;
        padding: 8px !important;
        resize: vertical !important;
        overflow-y: auto !important;
        background: #08090A !important;
        border: 2px solid #242933 !important;
        color: #FFFFFF !important;
        font-family: monospace !important;
        width: 100% !important;
        box-sizing: border-box !important;
        border-radius: 0 !important;
    }
    .terminal-input-row textarea:focus {
        border-color: #00FF66 !important;
        outline: none !important;
    }
    
    /* --- ОСТАЛЬНЫЕ ЭЛЕМЕНТЫ ВВОДА --- */
    .textarea-wrapper {
        min-width: 0 !important;
        flex: 1 !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
    }
    .pills-and-captcha-wrapper {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        gap: 6px !important;
        flex-shrink: 0 !important;
    }
    .captcha-block {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
    }
    
    /* --- КАПЧА --- */
    #input-captcha-field {
        width: 48px !important;
        min-width: 48px !important;
        height: 34px !important;
        font-size: 0.9rem !important;
        text-align: center !important;
        background: #08090A !important;
        border: 2px solid #242933 !important;
        color: #00FF66 !important;
        font-family: monospace !important;
    }
    #input-captcha-label {
        font-size: 0.8rem !important;
        color: #7C3AED !important;
        font-weight: bold !important;
        font-family: monospace !important;
    }
    
    /* --- КНОПКИ --- */
    .matrix-pill-btn {
        height: 34px !important;
        min-width: 70px !important;
        font-size: 0.7rem !important;
        padding: 0 10px !important;
        border-radius: 20px !important;
        border: 1px solid !important;
        cursor: pointer !important;
        font-family: monospace !important;
        font-weight: bold !important;
        text-transform: uppercase !important;
    }
    .pill-red {
        background: #3a0a0e !important;
        color: #ffb3b3 !important;
        border-color: #ff4d4d !important;
    }
    .pill-green {
        background: #0a3a1a !important;
        color: #b3ffcc !important;
        border-color: #00ff66 !important;
    }
    .factory-btn {
        height: 34px !important;
        padding: 0 12px !important;
        font-size: 0.7rem !important;
        background: #15181F !important;
        color: #00FF66 !important;
        border: 2px solid #00FF66 !important;
        cursor: pointer !important;
        font-family: monospace !important;
        font-weight: bold !important;
    }
    .emoji-trigger,
    .mic-trigger {
        width: 30px !important;
        height: 30px !important;
        font-size: 1rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        background: #15181F !important;
        border: 2px solid #242933 !important;
    }
    
    /* --- ТОСТЫ --- */
    #cyber-toast-container {
        position: fixed !important;
        bottom: 10px !important;
        right: 10px !important;
        z-index: 100000 !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 6px !important;
        max-width: 90% !important;
    }
    .cyber-toast {
        padding: 10px 14px !important;
        font-size: 0.8rem !important;
        background: #111317 !important;
        border-left: 4px solid #00FF66 !important;
        color: #E5E7EB !important;
        font-family: monospace !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.4) !important;
    }
    .cyber-toast.error {
        border-left-color: #EF4444 !important;
    }
    
    /* --- МОДАЛЬНЫЕ ОКНА --- */
    .feedback-modal,
    .cyber-confirm-modal {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        max-width: 90vw !important;
        max-height: 80vh !important;
        overflow-y: auto !important;
        background: #111317 !important;
        border: 2px solid #7C3AED !important;
        padding: 20px !important;
        z-index: 100001 !important;
        color: #00FF66 !important;
        font-family: monospace !important;
        box-shadow: 0 0 30px black !important;
    }
    
    /* --- ЛИЧНЫЙ КАБИНЕТ --- */
    #account-content-area {
        padding: 15px !important;
        color: #9CA3AF !important;
        font-family: monospace !important;
        overflow-y: auto !important;
        flex: 1 !important;
    }
    #account-content-area input {
        background: #08090A !important;
        border: 2px solid #242933 !important;
        color: #FFF !important;
        padding: 6px !important;
        font-family: monospace !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    #account-content-area button {
        background: #0A3A1A !important;
        color: #00FF66 !important;
        border: 2px solid #00FF66 !important;
        padding: 6px 16px !important;
        cursor: pointer !important;
        font-family: monospace !important;
        font-weight: bold !important;
    }
}

/* ============================================================
   FIREFOX MOBILE (ANDROID) — ПОЛНЫЙ ФИНАЛЬНЫЙ ВАРИАНТ
   ============================================================ */
@-moz-document url-prefix() {

    /* --- ОБЩИЙ КОНТЕЙНЕР --- */
    .cyber-container-wrapper {
        height: -moz-available !important;
        min-height: -moz-available !important;
        max-height: -moz-available !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        background: #0F1115 !important;
    }

    /* --- ШАПКА --- */
    .cyber-main-header {
        flex-shrink: 0 !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 999999 !important;
        height: 56px !important;
        min-height: 56px !important;
        padding: 6px 16px !important;
        background: #111317 !important;
    }
    .site-title {
        font-size: 0.9rem !important;
    }

    /* --- БУРГЕР --- */
    #cyber-burger-trigger {
        position: fixed !important;
        top: 8px !important;
        right: 12px !important;
        width: 44px !important;
        height: 44px !important;
        line-height: 44px !important;
        font-size: 1.3rem !important;
        z-index: 99999999 !important;
        background: #15181F !important;
        border: 2px solid #7C3AED !important;
        text-align: center !important;
        cursor: pointer !important;
    }

    /* --- ПАНЕЛЬ ЗАГОЛОВКОВ (СВЕТОФОРЫ) --- */
    .panel-header {
        flex-shrink: 0 !important;
        height: 44px !important;
        min-height: 44px !important;
        padding: 0 8px !important;
        gap: 4px !important;
        display: flex !important;
        align-items: center !important;
        background: #15181F !important;
        border-bottom: 2px solid #242933 !important;
    }
    .panel-header-left {
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
        flex: 1 !important;
        overflow: hidden !important;
    }
    .panel-title {
        font-size: 7pt !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 40vw !important;
        color: #9CA3AF !important;
    }

    /* --- СВЕТОФОР --- */
    .traffic-light-red,
    .traffic-light-yellow,
    .traffic-light-green {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        border-radius: 50% !important;
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
    }
    .traffic-light-red svg,
    .traffic-light-yellow svg,
    .traffic-light-green svg {
        width: 16px !important;
        height: 16px !important;
    }
    .panel-bullet {
        width: 8px !important;
        height: 8px !important;
        min-width: 8px !important;
        border-radius: 50% !important;
        display: inline-block !important;
    }

    /* --- ТЕЛЕМЕТРИЯ (BKW) --- */
    .cyber-telemetry-strip {
        flex-shrink: 0 !important;
        height: 24px !important;
        min-height: 24px !important;
        font-size: 0.6rem !important;
        padding: 0 8px !important;
        display: flex !important;
        align-items: center !important;
        background: #111317 !important;
        border-bottom: 1px solid #242933 !important;
    }
    .telemetry-item {
        font-size: 0.6rem !important;
        color: #4B5563 !important;
        margin-right: 12px !important;
    }

    /* --- ОСНОВНАЯ ЧАСТЬ (ТЕРМИНАЛ) --- */
    main.cyber-main-canvas {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: auto !important;
        padding: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        background: #0F1115 !important;
    }

    /* --- ВСЕ ПАНЕЛИ --- */
    .panel-box {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        display: flex !important;
        flex-direction: column !important;
        border: none !important;
        border-radius: 0 !important;
        background: #0F1115 !important;
    }
    .panel-box:not(#block-terminal) {
        display: none !important;
    }
    #block-terminal {
        display: flex !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        flex-direction: column !important;
    }

    /* --- СКРОЛЛ ТЕРМИНАЛА --- */
    .terminal-screen {
        flex: 1 1 0 !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        -moz-overflow-y: scroll !important;
        padding: 10px !important;
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
        background: #0F1115 !important;
        color: #9CA3AF !important;
        font-family: monospace !important;
        font-size: 0.85rem !important;
        line-height: 1.5 !important;
    }

    /* --- ПАНЕЛЬ ВВОДА (ЕДИНСТВЕННАЯ) --- */
    .terminal-input-row {
        flex-shrink: 0 !important;
        padding: 8px !important;
        gap: 4px !important;
        min-height: 70px !important;
        border-top: 2px solid #242933 !important;
        background: #0F1115 !important;
        display: flex !important;
        flex-direction: column !important;
        position: relative !important;
        bottom: 0 !important;
        z-index: 10 !important;
    }

    /* --- УБИРАЕМ ДУБЛИРУЮЩИЕСЯ МОБИЛЬНЫЕ БЛОКИ --- */
    .captcha-and-counter,
    .mobile-buttons-row {
        display: none !important;
    }

    /* --- ПОЛЕ ВВОДА (РАСКРЫВАЕТСЯ) --- */
    .terminal-input-row > div:first-child {
        display: flex !important;
        flex-direction: column !important;
        gap: 4px !important;
        width: 100% !important;
    }
    .textarea-wrapper {
        width: 100% !important;
        flex: none !important;
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
    }
    .terminal-input-row textarea {
        width: 100% !important;
        height: 44px !important;
        min-height: 44px !important;
        max-height: 200px !important;
        font-size: 0.9rem !important;
        padding: 8px !important;
        resize: vertical !important;
        overflow-y: auto !important;
        background: #08090A !important;
        border: 2px solid #242933 !important;
        color: #FFFFFF !important;
        font-family: monospace !important;
        box-sizing: border-box !important;
        border-radius: 0 !important;
    }
    .terminal-input-row textarea:focus {
        border-color: #00FF66 !important;
        outline: none !important;
    }
    .prompt-symbol {
        display: none !important;
    }

    /* --- КНОПКИ И КАПЧА В ОДНУ СТРОКУ --- */
    .pills-and-captcha-wrapper {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px !important;
        width: 100% !important;
    }
    .captcha-block {
        display: flex !important;
        align-items: center !important;
        gap: 4px !important;
        flex-shrink: 0 !important;
    }
    #input-captcha-field {
        width: 44px !important;
        min-width: 44px !important;
        height: 30px !important;
        font-size: 0.8rem !important;
        text-align: center !important;
        background: #08090A !important;
        border: 2px solid #242933 !important;
        color: #00FF66 !important;
        font-family: monospace !important;
    }
    #input-captcha-label {
        font-size: 0.7rem !important;
        color: #7C3AED !important;
        font-weight: bold !important;
        font-family: monospace !important;
    }
    .matrix-pill-btn {
        height: 30px !important;
        min-width: 50px !important;
        font-size: 0.6rem !important;
        padding: 0 6px !important;
        border-radius: 20px !important;
        border: 1px solid !important;
        cursor: pointer !important;
        font-family: monospace !important;
        font-weight: bold !important;
        text-transform: uppercase !important;
    }
    .pill-red {
        background: #3a0a0e !important;
        color: #ffb3b3 !important;
        border-color: #ff4d4d !important;
    }
    .pill-green {
        background: #0a3a1a !important;
        color: #b3ffcc !important;
        border-color: #00ff66 !important;
    }
    .emoji-trigger,
    .mic-trigger {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.8rem !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        background: #15181F !important;
        border: 2px solid #242933 !important;
    }
    .buttons-vertical {
        display: flex !important;
        flex-direction: row !important;
        gap: 2px !important;
    }
    .pills-action-right {
        display: flex !important;
        gap: 4px !important;
    }

    /* --- ТОСТЫ --- */
    #cyber-toast-container {
        position: fixed !important;
        bottom: 10px !important;
        right: 10px !important;
        z-index: 100000 !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 6px !important;
        max-width: 90% !important;
    }
    .cyber-toast {
        padding: 10px 14px !important;
        font-size: 0.8rem !important;
        background: #111317 !important;
        border-left: 4px solid #00FF66 !important;
        color: #E5E7EB !important;
        font-family: monospace !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.4) !important;
    }
    .cyber-toast.error {
        border-left-color: #EF4444 !important;
    }

    /* --- МОДАЛЬНЫЕ ОКНА --- */
    .feedback-modal,
    .cyber-confirm-modal {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        max-width: 90vw !important;
        max-height: 80vh !important;
        overflow-y: auto !important;
        background: #111317 !important;
        border: 2px solid #7C3AED !important;
        padding: 20px !important;
        z-index: 100001 !important;
        color: #00FF66 !important;
        font-family: monospace !important;
        box-shadow: 0 0 30px black !important;
    }

    /* --- ЛИЧНЫЙ КАБИНЕТ --- */
    #account-content-area {
        padding: 15px !important;
        color: #9CA3AF !important;
        font-family: monospace !important;
        overflow-y: auto !important;
        flex: 1 !important;
    }
    #account-content-area input {
        background: #08090A !important;
        border: 2px solid #242933 !important;
        color: #FFF !important;
        padding: 6px !important;
        font-family: monospace !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    #account-content-area button {
        background: #0A3A1A !important;
        color: #00FF66 !important;
        border: 2px solid #00FF66 !important;
        padding: 6px 16px !important;
        cursor: pointer !important;
        font-family: monospace !important;
        font-weight: bold !important;
    }
}
/* ============================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ (< 768px)
   ============================================================ */
@media (max-width: 768px) {
    @-moz-document url-prefix() {
        .cyber-main-header {
            height: 48px !important;
            min-height: 48px !important;
            padding: 4px 10px !important;
        }
        #cyber-burger-trigger {
            top: 4px !important;
            right: 6px !important;
            width: 38px !important;
            height: 38px !important;
            line-height: 38px !important;
            font-size: 1rem !important;
        }
        .site-title {
            font-size: 0.7rem !important;
        }
        .panel-header {
            height: 36px !important;
            min-height: 36px !important;
            padding: 0 6px !important;
        }
        .panel-title {
            font-size: 5pt !important;
            max-width: 25vw !important;
        }
        .traffic-light-red,
        .traffic-light-yellow,
        .traffic-light-green {
            width: 26px !important;
            height: 26px !important;
            min-width: 26px !important;
            min-height: 26px !important;
        }
        .traffic-light-red svg,
        .traffic-light-yellow svg,
        .traffic-light-green svg {
            width: 12px !important;
            height: 12px !important;
        }
        .panel-bullet {
            width: 6px !important;
            height: 6px !important;
            min-width: 6px !important;
        }
        .cyber-telemetry-strip {
            height: 18px !important;
            min-height: 18px !important;
            font-size: 0.45rem !important;
            padding: 0 6px !important;
        }
        .telemetry-item {
            font-size: 0.45rem !important;
            margin-right: 8px !important;
        }
        .terminal-screen {
            padding: 6px !important;
            font-size: 0.75rem !important;
        }
        .terminal-input-row {
            padding: 4px !important;
            min-height: 60px !important;
        }
        .terminal-input-row textarea {
            font-size: 0.8rem !important;
            height: 36px !important;
            min-height: 36px !important;
            max-height: 150px !important;
        }
        #input-captcha-field {
            width: 38px !important;
            min-width: 38px !important;
            height: 28px !important;
            font-size: 0.7rem !important;
        }
        #input-captcha-label {
            font-size: 0.65rem !important;
        }
        .matrix-pill-btn {
            height: 28px !important;
            min-width: 44px !important;
            font-size: 0.5rem !important;
            padding: 0 4px !important;
        }
        .emoji-trigger,
        .mic-trigger {
            width: 24px !important;
            height: 24px !important;
            font-size: 0.7rem !important;
        }
        #cyber-toast-container {
            max-width: 95% !important;
            bottom: 5px !important;
            right: 5px !important;
        }
        .cyber-toast {
            font-size: 0.7rem !important;
            padding: 6px 10px !important;
        }
        #account-content-area {
            padding: 10px !important;
            font-size: 0.75rem !important;
        }
        #account-content-area input {
            padding: 4px !important;
            font-size: 0.75rem !important;
        }
        #account-content-area button {
            padding: 4px 10px !important;
            font-size: 0.65rem !important;
        }
        .feedback-modal,
        .cyber-confirm-modal {
            padding: 12px !important;
            max-width: 95vw !important;
        }
    }
}