body { 
            font-family: 'IBM Plex Mono', monospace; 
            background: #000; 
            color: #e0f2ff; 
            transition: background 0.2s ease, color 0.2s ease;
        }

        .scanline { 
            position: fixed; 
            top: 0; left: 0; 
            width: 100%; height: 100%; 
            background: linear-gradient(to bottom, transparent 50%, rgba(0,255,180,0.03) 50%); 
            background-size: 100% 4px; 
            pointer-events: none; 
            animation: scan 8s linear infinite; 
            z-index: 10; 
            opacity: 0.15; 
        }

        @keyframes scan { 
            0% { background-position: 0 0; } 
            100% { background-position: 0 100%; } 
        }

        .cyber-text { 
            text-shadow: 0 0 10px #00ffb3; 
        }

        .mobile-bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: #0a0a0a;
            border-top: 2px solid #00ffb3;
            box-shadow: 0 -4px 20px rgba(0, 255, 179, 0.25);
            z-index: 50;
            padding: 10px 0 max(14px, env(safe-area-inset-bottom));
            transition: all 0.3s ease;
        }

        .mobile-bottom-nav-inner {
            display: flex;
            justify-content: space-around;
            align-items: center;
            padding: 0 8px;
            position: relative;
        }

        .mobile-tab {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: 'IBM Plex Mono', monospace;
            font-size: 11.5px;
            font-weight: 600;
            letter-spacing: 1px;
            color: #888;
            padding: 10px 4px;
            transition: all 0.25s ease;
            position: relative;
        }

        .mobile-tab:not(:last-child)::after {
            content: '';
            position: absolute;
            right: -1px;
            top: 50%;
            transform: translateY(-50%);
            width: 1px;
            height: 26px;
            background: linear-gradient(to bottom, transparent, #00ffb3, transparent);
            opacity: 0.35;
        }

        .mobile-tab span:first-child {
            font-size: 26px;
            line-height: 1;
            transition: all 0.25s ease;
            filter: drop-shadow(0 0 8px currentColor);
        }

        .mobile-tab.active {
            color: #00ffb3;
            text-shadow: 0 0 12px #00ffb3;
            transform: translateY(-1px);
        }

        .mobile-tab.active span:first-child {
            filter: drop-shadow(0 0 14px #00ffb3) 
                     drop-shadow(0 0 6px #00ffcc);
            font-size: 28px;
        }

        .mobile-tab:active {
            transform: scale(0.92);
        }

        .no-round * {
            border-radius: 0 !important;
        }

        #modal-fields {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1.25rem 2rem;
        }

        .mobile-damage {
            font-family: 'IBM Plex Mono', monospace;
            font-weight: 300;
            font-size: 1.3rem; 
            letter-spacing: 1px;
            text-shadow: 
                0 0 5px #00ffcc,
                0 0 10px #00ffcc;
            color: #00ffcc;
            line-height: 1;
            white-space: nowrap;
        }

        @media (max-width: 480px) {
            .mobile-damage {
                font-size: 0.9rem;
            }
        }
        .mobile-group-damage {
            font-family: 'IBM Plex Mono', monospace;
            font-weight: 400;
            font-size: 1.45rem;
            letter-spacing: 2px;
            text-shadow: 
                0 0 6px #00ffcc,
                0 0 12px #00ffcc;
            color: #00ffcc;
            line-height: 1;
            white-space: nowrap;
        }

        .mobile-nav {
            font-family: 'IBM Plex Mono', monospace;
            font-weight: 400;
            font-size: 1.45rem;
            letter-spacing: 2px;
            text-shadow: 
                0 0 6px #00ffcc,
                0 0 12px #00ffcc;
            color: #00ffcc;
            line-height: 1;
            white-space: nowrap;
        }

        @media (max-width: 480px) {
            .mobile-group-damage {
                font-size: 1.25rem;
            }
        }

        @media (max-width: 768px) {
            body {
                font-size: 14px;
            }
            .mobile-damage {
                font-size: 1rem !important;
            }
            .mobile-group-damage {
                font-size: 1rem !important;
            }
            #mobile-users-list > div {
                margin-bottom: 1rem;
            }
            #mobile-users-list .px-6 {
                padding-left: 1rem;
                padding-right: 1rem;
            }
            #mobile-users-list .py-5 {
                padding-top: 0.75rem;
                padding-bottom: 0.75rem;
            }
            #mobile-users-list .bg-\[#111\] span:first-child {
                font-size: 1rem;
            }
            #mobile-accounts-list .bg-\[#111\] {
                padding: 1rem;
            }
            #mobile-accounts-list .text-xl {
                font-size: 1.1rem;
            }
            #mobile-accounts-list .text-3xl {
                font-size: 1.6rem;
            }
            #mobile-accounts-list .grid {
                gap: 1rem;
                margin-top: 1rem;
            }
            #mobile-operations-list .bg-\[#111\] {
                padding: 1rem;
            }
            #mobile-operations-list .text-lg {
                font-size: 1rem;
            }
            .mobile-operation-damage {
                font-size: 1rem;
            }
        }

        @media (max-width: 480px) {
            .mobile-damage {
                font-size: 0.9rem !important;
            }
            .mobile-group-damage {
                font-size: 0.8rem !important;
            }
            #mobile-users-list .px-6 {
                padding-left: 0.75rem;
                padding-right: 0.75rem;
            }
            #mobile-users-list .py-5 {
                padding-top: 0.6rem;
                padding-bottom: 0.6rem;
            }
            #mobile-accounts-list .bg-\[#111\] {
                padding: 0.75rem;
            }
            #mobile-accounts-list .text-3xl {
                font-size: 1.3rem;
            }
            #mobile-operations-list .bg-\[#111\] {
                padding: 0.75rem;
            }
            .mobile-operation-damage {
                font-size: 0.9rem;
            }
        }

        body.theme-gray {
            background: #121212;
            color: #e0e0e0;
        }

        body.theme-gray .bg-black,
        body.theme-gray .bg-\[#111\],
        body.theme-gray .bg-\[\#0a0a0a\],
        body.theme-gray .bg-\[\#111\]\/80,
        body.theme-gray .bg-\[\#0a0a0a\]\/80,
        body.theme-gray .bg-\[\#1a1a1a\] {
            background-color: #1e1e1e !important;
        }

        body.theme-gray .bg-\[\#00ffb3\] {
            background-color: #3a3a3a !important;
        }

        body.theme-gray .bg-\[\#00ffb3\]\/70,
        body.theme-gray .bg-\[\#00ffb3\]\/30 {
            background-color: #3a3a3a !important;
        }

        body.theme-gray .border-\[\#00ffb3\],
        body.theme-gray .border-\[\#00ffb3\]\/70,
        body.theme-gray .border-\[\#00ffb3\]\/30,
        body.theme-gray .border-\[\#00ffb3\]\/20 {
            border-color: #444 !important;
        }

        body.theme-gray .text-\[\#00ffb3\],
        body.theme-gray .nav-active,
        body.theme-gray .mobile-tab.active,
        body.theme-gray .group-header .text-\[\#00ffb3\] {
            color: #cccccc !important;
            text-shadow: none !important;
        }

        body.theme-gray #login-screen .cyber-text,
        body.theme-gray #mobile-login-screen .cyber-text {
            text-shadow: 0 0 4px rgba(255,255,255,0.8), 0 0 8px rgba(255,255,255,0.5) !important;
        }

        body.theme-gray .mobile-damage,
        body.theme-gray .mobile-group-damage,
        body.theme-gray .mobile-operation-damage,
        body.theme-gray .mobile-nav,
        body.theme-gray .text-\[\#00ffaa\] {
            color: #ffffff !important;
            text-shadow: 0 0 4px rgba(255,255,255,0.8), 0 0 8px rgba(255,255,255,0.5) !important;
        }

        .terminal-line,
        .auth-terminal .terminal-line {
            font-family: 'IBM Plex Mono', monospace;
            font-weight: 300;
            font-size: 1.3rem;
            letter-spacing: 1px;
            text-shadow: 0 0 5px #00ffcc, 0 0 10px #00ffcc;
            color: #00ffcc;
            line-height: 1.2;
            white-space: nowrap;
            overflow: hidden;
        }

        .terminal-line {
            border-right: 2px solid #00ffb3;
            width: 0;
            animation: typing 0.8s steps(30, end) forwards;
        }
        .auth-terminal {
            min-height: 200px;
        }

        .auth-terminal .terminal-line {
            font-family: 'IBM Plex Mono', monospace;
            font-weight: 300;
            font-size: 0.9rem;
            letter-spacing: 0.5px;
            text-shadow: 0 0 5px #00ffcc, 0 0 10px #00ffcc;
            color: #00ffcc;
            line-height: 1.4;
            white-space: normal;
            word-break: normal;
            overflow-wrap: break-word;
            border-right: none;
            animation: none;
            margin-bottom: 0.6rem;
            overflow: visible;
            display: inline-block;
            width: 100%;
        }

        body.theme-gray .terminal-line,
        body.theme-gray .auth-terminal .terminal-line {
            color: #ffffff !important;
            text-shadow: 0 0 4px rgba(255,255,255,0.8), 0 0 8px rgba(255,255,255,0.5) !important;
        }

        body.theme-gray button.bg-\[\#00ffb3\],
        body.theme-gray .bg-\[\#00ffb3\].text-black {
            background-color: #3a3a3a !important;
            color: #f0f0f0 !important;
        }

        body.theme-gray button.bg-\[\#00ffb3\]:hover,
        body.theme-gray .bg-\[\#00ffb3\]:hover {
            background-color: #555 !important;
        }

        body.theme-gray .bg-\[\#111\],
        body.theme-gray thead.bg-\[\#111\],
        body.theme-gray .group-header.bg-\[\#111\],
        body.theme-gray .group-header {
            background-color: #222 !important;
        }

        body.theme-gray .border-\[\#00ffb3\]\/30 {
            border-color: #3a3a3a !important;
        }

        body.theme-gray .hover\:bg-\[\#1a1a1a\]:hover,
        body.theme-gray .hover\:bg-\[\#1f1f1f\]:hover,
        body.theme-gray .table-row:hover {
            background-color: #2a2a2a !important;
        }

        body.theme-gray .divide-\[\#222\] > :not([hidden]) ~ :not([hidden]) {
            border-color: #2c2c2c !important;
        }

        body.theme-gray .bg-black\/95 {
            background-color: rgba(18, 18, 18, 0.98) !important;
        }

        body.theme-gray .mobile-bottom-nav {
            background: #1a1a1a;
            border-top-color: #555;
            box-shadow: 0 -4px 15px rgba(255,255,255,0.08);
        }

        body.theme-gray .mobile-tab:not(:last-child)::after {
            background: linear-gradient(to bottom, transparent, #aaa, transparent);
            opacity: 0.4;
        }

        body.theme-gray .scanline {
            opacity: 0.03;
        }

        body.theme-gray input.bg-black,
        body.theme-gray input.bg-black:focus {
            background-color: #1a1a1a !important;
            border-color: #555 !important;
            color: #eee !important;
        }

        body.theme-gray button.text-red-400 {
            color: #dd8888 !important;
        }

        body.theme-gray .bg-\[\#111\] {
            background-color: #1e1e1e !important;
        }

        body.theme-gray .cyber-text {
            text-shadow: none !important;
        }

        body.theme-gray .group-header .text-\[\#00ffb3\] {
            text-shadow: none;
        }

        body.theme-gray .text-gray-400,
        body.theme-gray .text-gray-500 {
            color: #aaa !important;
        }
        

        @keyframes typing {
            0% { width: 0; }
            100% { width: 100%; }
        }

        .cursor-blink {
            display: inline-block;
            width: 10px;
            background-color: #00ffb3;
            animation: blink 1s step-end infinite;
        }

        @keyframes blink {
            0%, 100% { opacity: 1; }
            50% { opacity: 0; }
        }

        body.theme-gray .cursor-blink {
            background-color: #aaa;
        }

        .login-animation-container {
            background: rgba(0,0,0,0.4);
            padding: 1rem;
            font-size: 0.75rem;
            border-left: 3px solid #00ffb3;
        }

        .login-animation-container {
            padding: 0.75rem !important;
            margin-bottom: 1rem !important;
        }
        body.theme-gray .login-animation-container {
            border-left-color: #666;
        }

        .auth-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.85);
            backdrop-filter: blur(4px);
            z-index: 1000;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: opacity 0.3s ease;
        }
        body.theme-gray .auth-overlay {
            background: rgba(18,18,18,0.95);
        }
        .auth-terminal {
            background: #0a0a0a;
            border: 2px solid #00ffb3;
            padding: 1.5rem 2rem;
            max-width: 90%;
            width: 450px;
            box-shadow: 0 0 20px rgba(0,255,179,0.2);
        }
        body.theme-gray .auth-terminal {
            border-color: #666;
            background: #1a1a1a;
            box-shadow: none;
        }
        .auth-cursor {
            display: inline-block;
            width: 10px;
            height: 1.2rem;
            background-color: #00ffb3;
            vertical-align: middle;
            margin-left: 4px;
            animation: blink 1s step-end infinite;
        }
        body.theme-gray .auth-cursor {
            background-color: #aaa;
        }
        body.theme-gray #universal-modal .cyber-text {
            text-shadow: 0 0 4px rgba(255,255,255,0.8), 0 0 8px rgba(255,255,255,0.5) !important;
        }

        body.theme-gray button.bg-\[\#00ffb3\],
        body.theme-gray .bg-\[\#00ffb3\].text-black {
            text-shadow: 0 0 2px rgba(255,255,255,0.6) !important;
        }

        body.theme-gray .mobile-tab.active {
            color: #ddd;
            text-shadow: 0 0 10px #ddd;
        }

        body.theme-gray .mobile-tab.active span:first-child {
            filter: drop-shadow(0 0 10px #ddd);
        }

        .login-error-message {
            color: #ff4444 !important;
            text-shadow: 0 0 4px rgba(255,68,68,0.8), 0 0 8px rgba(255,68,68,0.5) !important;
            font-weight: 500;
            letter-spacing: 0.5px;
        }
        #mobile-terminal-lines {
            height: 240px !important;
        }
        #desktop-terminal-lines,
        #mobile-terminal-lines {
            height: 200px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            scroll-behavior: smooth;
            gap: 4px;
        }

        #auth-terminal-lines {
            height: 400px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            scroll-behavior: smooth;
            gap: 8px;
        }

        #desktop-terminal-lines > div,
        #mobile-terminal-lines > div,
        #auth-terminal-lines > div {
            white-space: normal !important;
            word-break: break-word;
            overflow-wrap: break-word;
            border-right: none !important;
            animation: none !important;
            width: 100% !important;
        }

        #mobile-terminal-lines > div {
            font-size: 0.7rem !important;
            margin-bottom: 0.25rem !important;
        }

        #desktop-terminal-lines::-webkit-scrollbar,
        #mobile-terminal-lines::-webkit-scrollbar,
        #auth-terminal-lines::-webkit-scrollbar {
            width: 6px;
        }

        #desktop-terminal-lines::-webkit-scrollbar-track,
        #mobile-terminal-lines::-webkit-scrollbar-track,
        #auth-terminal-lines::-webkit-scrollbar-track {
            background: rgba(0, 0, 0, 0.2);
        }

        #desktop-terminal-lines::-webkit-scrollbar-thumb,
        #mobile-terminal-lines::-webkit-scrollbar-thumb,
        #auth-terminal-lines::-webkit-scrollbar-thumb {
            background: #00ffb3;
            border-radius: 3px;
        }

        body.theme-gray #desktop-terminal-lines::-webkit-scrollbar-thumb,
        body.theme-gray #mobile-terminal-lines::-webkit-scrollbar-thumb,
        body.theme-gray #auth-terminal-lines::-webkit-scrollbar-thumb {
            background: #aaa;
        }



        @media (max-width: 640px) {
            #mobile-login-screen .bg-\[#111\] {
                padding: 1rem 1rem !important;
            }

            #mobile-login-screen .flex.justify-between.items-center.mb-4 {
                margin-bottom: 0.5rem !important;
            }

            #mobile-login-screen h1 {
                font-size: 1.2rem !important;
                letter-spacing: 1px;
                margin-bottom: 0.25rem !important;
            }

            #mobile-login-screen h2 {
                font-size: 0.9rem !important;
                margin-top: 0 !important;
                margin-bottom: 0.5rem !important;
            }

            .login-animation-container {
                padding: 0.5rem !important;
                margin-bottom: 0.5rem !important;
            }
        
            #mobile-terminal-lines {
                height: 180px !important; 
            }

            #mobile-terminal-lines > div {
                font-size: 0.7rem !important;
                margin-bottom: 0.2rem !important;
            }

            #mobile-login-screen input {
                padding: 0.6rem 1rem !important;
                margin-bottom: 0.7rem !important;
                font-size: 0.85rem;
            }

            #mobile-login-screen button[type="submit"] {
                padding: 0.7rem 0 !important;
                font-size: 0.9rem;
            }

            #mobile-login-error {
                margin-top: 0.5rem !important;
                font-size: 0.75rem;
            }
        }
        .user-accounts-mobile {
            background-color: #0c0c0c;
        }
        body.theme-gray .user-accounts-mobile {
            background-color: #1e1e1e;
        }
        .regiment-body {
            display: none;
        }
        .regiment-body.open {
            display: block;
        }
        .user-accounts {
            display: none;
        }
        .user-accounts.open {
            display: block;
        }
        .group-body {
            display: none;
        }
        .group-body.open {
            display: block;
        }

        @keyframes fadeSlideIn {
            from {
                opacity: 0;
                transform: translateY(12px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        .anim-in {
            opacity: 0;
            animation: fadeSlideIn 0.45s ease forwards;
        }

        .anim-fade {
            opacity: 0;
            animation: fadeIn 0.4s ease forwards;
        }

        .c-body,
        .war-body {
            overflow: hidden;
            transition: max-height 0.4s ease, opacity 0.35s ease, padding 0.3s ease;
            will-change: max-height;
        }

        .c-body.collapsed,
        .war-body.collapsed {
            max-height: 0 !important;
            opacity: 0;
            padding-top: 0 !important;
            padding-bottom: 0 !important;
        }

        .c-arrow,
        .war-arrow {
            display: inline-block;
            transition: transform 0.3s ease;
        }
        .c-arrow.rotated,
        .war-arrow.rotated {
            transform: rotate(90deg);
        }

        .chart-box {
            opacity: 0;
            animation: fadeSlideIn 0.5s ease forwards;
        }
        .chart-box:nth-child(1) { animation-delay: 0.05s; }
        .chart-box:nth-child(2) { animation-delay: 0.15s; }
        .chart-box:nth-child(3) { animation-delay: 0.25s; }

        .flex.justify-between.items-center {
            transition: background-color 0.2s ease;
        }

        .chat-shell {
            height: min(720px, calc(100vh - 170px));
            min-height: 480px;
            display: flex;
            flex-direction: column;
            overflow: hidden;

            background:
                radial-gradient(circle at 85% 0%, rgba(0, 255, 179, 0.08), transparent 30%),
                #0b0d0d;

            border: 1px solid rgba(0, 255, 179, 0.22);
            border-radius: 16px;
            box-shadow: 0 16px 55px rgba(0, 0, 0, 0.35);
        }

        .chat-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
        
            padding: 15px 18px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.07);
            background: rgba(13, 17, 17, 0.82);
        }

        .chat-header-title {
            display: flex;
            align-items: center;
            gap: 10px;
        
            color: #f3f4f6;
            font-size: 14px;
            font-weight: 700;
            letter-spacing: 0.05em;
        }

        .chat-header-dot {
            color: #00ffb3;
        }

        .chat-status {
            display: flex;
            align-items: center;
            gap: 7px;
        
            color: #89938f;
            font-size: 12px;
        }

        .chat-status-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #00ffb3;
            box-shadow: 0 0 10px rgba(0, 255, 179, 0.8);
        }

        .chat-status-dot.connected {
            background: #00ffb3;
            box-shadow: 0 0 10px rgba(0, 255, 179, 0.8);
        }

        .chat-status-dot.connecting,
        .chat-status-dot.reconnecting {
            background: #facc15;
            box-shadow: 0 0 10px rgba(250, 204, 21, 0.8);
        }

        .chat-status-dot.offline {
            background: #ff5b5b;
            box-shadow: 0 0 10px rgba(255, 91, 91, 0.8);
        }

        .chat-channel-toggle {
            min-height: 34px;
            padding: 6px 9px;
            border: 1px solid rgba(0, 255, 179, 0.5);
            background: transparent;
            color: #c9ccc9;
            cursor: pointer;
            font-size: 11px;
            touch-action: manipulation;
        }

        .chat-channel-toggle:hover {
            color: #00ffb3;
            border-color: #00ffb3;
        }

        .chat-body {
            position: relative;
            flex: 1;
            min-height: 0;
            display: flex;
            flex-direction: column;
        }

        #chat-messages {
            flex: 1;
            min-height: 0;
            overflow-y: auto;
        
            display: flex;
            flex-direction: column;
            gap: 10px;
        
            padding: 18px;
        }

        .chat-scroll-new {
            display: none;
            position: absolute;
            right: 14px;
            bottom: 12px;
            z-index: 2;
        
            align-items: center;
            gap: 6px;
            min-height: 42px;
            min-width: 42px;
            padding: 0 14px;
        
            border: 1px solid rgba(0, 255, 179, 0.4);
            border-radius: 22px;
            background: #0f1313;
            color: #00ffb3;
            cursor: pointer;
        
            font-size: 13px;
            font-weight: 700;
            box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
            touch-action: manipulation;
        }

        .chat-scroll-new.show {
            display: inline-flex;
        }

        #chat-messages::-webkit-scrollbar {
            width: 7px;
        }

        #chat-messages::-webkit-scrollbar-track {
            background: transparent;
        }

        #chat-messages::-webkit-scrollbar-thumb {
            background: rgba(0, 255, 179, 0.28);
            border-radius: 20px;
        }

        .chat-message {
            display: flex;
            width: 100%;
        }

        .chat-message--own {
            justify-content: flex-end;
        }

        .chat-message--other,
        .chat-message--system-user {
            justify-content: flex-start;
        }

        .chat-bubble {
            width: fit-content;
            max-width: min(76%, 620px);
            padding: 11px 13px 9px;
        
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: 14px;
        
            background: #161a1a;
            color: #e5e7eb;
        
            transition: transform 0.15s ease, border-color 0.15s ease;
        }

        .chat-bubble:hover {
            border-color: rgba(0, 255, 179, 0.3);
        }

        .chat-message--other .chat-bubble {
            border-top-left-radius: 4px;
            background: linear-gradient(145deg, #191d1d, #111414);
        }

        .chat-message--own .chat-bubble {
            border-top-right-radius: 4px;
            border-color: rgba(0, 255, 179, 0.28);
            background: linear-gradient(
                145deg,
                rgba(0, 255, 179, 0.19),
                rgba(0, 152, 106, 0.17)
            );
        }

        .chat-message--system-user .chat-bubble {
            border-top-left-radius: 4px;
            border-color: rgba(250, 204, 21, 0.35);
            background: linear-gradient(
                145deg,
                rgba(250, 204, 21, 0.13),
                rgba(108, 78, 0, 0.16)
            );
        }

        .chat-message-head {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 7px;
        }

        .chat-message--own .chat-message-head {
            justify-content: flex-end;
        }

        .chat-username {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        
            color: #00ffb3;
            font-size: 12px;
            font-weight: 700;
        }

        .chat-message--system-user .chat-username {
            color: #facc15;
        }

        .chat-time {
            flex-shrink: 0;
            color: #7a8381;
            font-size: 11px;
        }

        .chat-text {
            color: #e2e8e6;
            font-size: 14px;
            line-height: 1.5;
            white-space: pre-wrap;
            overflow-wrap: anywhere;
        }

        .chat-message--own .chat-text {
            color: #f0fffa;
        }

        .reply-quote-button {
            display: block;
            width: 100%;
            margin-bottom: 9px;
            padding: 7px 9px;
        
            overflow: hidden;
            text-align: left;
        
            border-left: 2px solid #00ffb3;
            border-radius: 0 7px 7px 0;
            background: rgba(0, 0, 0, 0.2);
        
            touch-action: manipulation;
            transition: background 0.15s ease;
        }

        .reply-quote-button:hover {
            background: rgba(0, 255, 179, 0.08);
        }

        .reply-quote-author {
            margin-bottom: 2px;
            color: #00ffb3;
            font-size: 11px;
            font-weight: 700;
        }

        .reply-quote-text {
            overflow: hidden;
            color: #a6afac;
            font-size: 11px;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .reply-button {
            display: inline-flex;
            align-items: center;
            gap: 5px;
        
            margin-top: 8px;
            padding: 2px 0;
        
            border: 0;
            background: transparent;
            color: #8a9591;
            cursor: pointer;
        
            font-size: 11px;
            touch-action: manipulation;
            transition: color 0.15s ease;
        }

        .reply-button:hover {
            color: #00ffb3;
        }

        .chat-system-notice {
            align-self: center;
            max-width: 90%;
            padding: 7px 12px;
        
            color: #8d9694;
            font-size: 12px;
            font-style: italic;
            text-align: center;
        
            border: 1px solid rgba(255, 255, 255, 0.07);
            border-radius: 999px;
            background: rgba(255, 255, 255, 0.035);
        }

        .chat-composer {
            padding: 12px;
            border-top: 1px solid rgba(255, 255, 255, 0.07);
            background: rgba(10, 13, 13, 0.9);
        }

        .chat-input-row {
            display: flex;
            align-items: flex-end;
            gap: 10px;
        }

        #chat-input {
            min-width: 0;
            flex: 1;
            min-height: 46px;
            height: auto;
            resize: none;
        
            padding: 12px 14px;
            color: #e5e7eb;
        
            outline: none;
            border: 1px solid rgba(255, 255, 255, 0.13);
            border-radius: 10px;
            background: #101414;
        
            font-size: 14px;
            line-height: 1.45;
            overflow-y: hidden;
            touch-action: manipulation;
            transition: border-color 0.15s ease, box-shadow 0.15s ease;
        }

        #chat-input:focus {
            border-color: rgba(0, 255, 179, 0.75);
            box-shadow: 0 0 0 3px rgba(0, 255, 179, 0.08);
        }

        #chat-input::placeholder {
            color: #69716f;
        }

        .chat-send-button {
            height: 46px;
            padding: 0 18px;
        
            border: 0;
            border-radius: 10px;
            background: #00ffb3;
            color: #06110d;
            cursor: pointer;
        
            font-size: 12px;
            font-weight: 800;
            letter-spacing: 0.04em;
        
            transition: transform 0.15s ease, background 0.15s ease;
        }

        .chat-send-button:hover {
            background: #4dffca;
            transform: translateY(-1px);
        }

        .chat-send-button:active {
            transform: translateY(0);
        }

        .chat-send-button:disabled {
            opacity: 0.45;
            cursor: not-allowed;
            transform: none;
        }

        .chat-send-button.is-offline {
            filter: grayscale(1);
        }

        .chat-shell {
            touch-action: manipulation;
        }

        #reply-preview {
            margin-bottom: 9px;
        }

        .reply-preview-card {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
        
            padding: 9px 11px;
        
            border-left: 3px solid #00ffb3;
            border-radius: 8px;
            background: rgba(0, 255, 179, 0.07);
        }

        .reply-preview-title {
            color: #00ffb3;
            font-size: 11px;
            font-weight: 700;
        }

        .reply-preview-text {
            overflow: hidden;
            margin-top: 2px;
            color: #aab3b0;
            font-size: 11px;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .reply-cancel-button {
            flex-shrink: 0;
            width: 26px;
            height: 26px;
        
            border: 0;
            border-radius: 7px;
            background: transparent;
            color: #8c9692;
            cursor: pointer;
        
            font-size: 20px;
            line-height: 1;
            touch-action: manipulation;
        }

        .reply-cancel-button:hover {
            color: #ff7777;
            background: rgba(255, 80, 80, 0.1);
        }

        @media (max-width: 640px) {
            .chat-shell {
                height: calc(100dvh - 155px);
                min-height: 0;
                border-right: 0;
                border-left: 0;
            }
        
            .chat-header {
                padding: 13px 14px;
            }
        
            #chat-messages {
                gap: 9px;
                padding: 12px;
            }
        
            .chat-bubble {
                max-width: 88%;
                padding: 10px 11px 8px;
            }
        
            .chat-text {
                font-size: 13px;
            }
        
            .chat-composer {
                padding: 10px 12px;
            }
        
            .chat-input-row {
                width: 100%;
                min-width: 0;
                gap: 8px;
                align-items: flex-end;
            }
        
            #chat-input {
                min-width: 0;
                width: 0;
                flex: 1 1 auto;
                font-size: 16px;
            }
        
            .reply-button {
                min-height: 40px;
                padding: 8px 10px;
            }
        
            .reply-quote-button {
                padding: 10px 12px;
            }
        
            .reply-cancel-button {
                width: 44px;
                height: 44px;
            }
        
            .chat-send-button {
                flex: 0 0 52px;
                width: 52px;
                min-width: 52px;
                max-width: 52px;
                height: 52px;
                overflow: hidden;
                padding: 0;
            
                font-size: 0;
                line-height: 1;
            }
        
        }

        #mobile-tab-content.chat-mode {
            padding: 0;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        #mobile-tab-content.chat-mode .chat-shell {
            flex: 0 0 auto;
            height: auto;
            min-height: 0;
            border: 0;
            border-radius: 0;
        }

        .chat-shell {
            background: #0a0a0a;
            border: 1px solid rgba(0, 255, 179, 0.25);
            border-radius: 0;
            box-shadow: none;
        }

        .chat-header {
            background: #0d0d0d;
            border-bottom: 1px solid rgba(0, 255, 179, 0.18);
        }

        .chat-status-dot {
            background: #00ffb3;
            box-shadow: none; 
        }

        .chat-bubble,
        .chat-message--other .chat-bubble,
        .chat-message--own .chat-bubble,
        .chat-message--system-user .chat-bubble {
            border-radius: 0;
            box-shadow: none;
            background-image: none;
        }

        .chat-message--other .chat-bubble {
            background: #1d1d1d;
            border-color: #383838;
        }

        .chat-message--own .chat-bubble {
            background: #063f31;
            border-color: rgba(0, 255, 179, 0.4);
        }

        .chat-message--system-user .chat-bubble {
            background: #1d1a0c;
            border-color: rgba(250, 204, 21, 0.45);
        }

        .chat-bubble:hover {
            border-color: rgba(0, 255, 179, 0.45);
        }

        .reply-quote-button {
            border-radius: 0;
            background: rgba(0, 0, 0, 0.16);
        }

        .reply-quote-button:hover {
            background: rgba(255, 255, 255, 0.04);
        }

        .reply-preview-card {
            border-radius: 0;
            background: #17170e;
        }

        #chat-input {
            border-radius: 0;
            background: #151515;
        }

        #chat-input:focus {
            border-color: #00ffb3;
            box-shadow: none;
        }

        .chat-send-button {
            border-radius: 0;
            box-shadow: none;
        }

        .chat-send-button:hover {
            background: #00ffb3;
            transform: none;
        }

        .chat-send-button {
            flex: 0 0 46px;
            width: 46px;
            min-width: 46px;
            height: 46px;
            padding: 0;
                
            border: 0;
            border-radius: 0;
            background: #00ffb3;
            color: #06110d;
            cursor: pointer;
                
            font-size: 19px;
            font-weight: 700;
            line-height: 46px;
            text-align: center;
                
            box-shadow: none;
            transition: background 0.15s ease;
        }
        
        .chat-send-button:hover {
            background: #4dffca;
            transform: none;
        }
.profile-panel { max-width: 780px; margin: 0 auto; padding: 24px; border: 1px solid #00ffb3; background: #111; overflow-wrap: anywhere; }
.profile-button { padding: 10px 14px; border: 1px solid #00ffb3; color: #00ffb3; margin: 4px 0; background: transparent; transition: background 0.15s ease, border-color 0.15s ease; }
.profile-button:hover { background: rgba(0, 255, 179, 0.08); }
.profile-input { display: block; width: 100%; padding: 10px; margin-top: 6px; background: #080808; border: 1px solid #555; color: #e0f2ff; }
.profile-input:focus { outline: none; border-color: #00ffb3; }
.profile-alert { display: block; margin-top: 10px; padding: 10px 12px; border: 1px solid #ff6b6b; background: rgba(255, 80, 80, 0.08); color: #ff8a8a; font-size: 14px; }
.profile-alert.hidden { display: none; }
.profile-status { display: inline-block; padding: 2px 10px; font-size: 12px; line-height: 1.6; border: 1px solid #555; color: #888; white-space: nowrap; }
.profile-status.pending { color: #ffd24a; border-color: #ffd24a; background: rgba(255, 210, 74, 0.08); }
.profile-status.approved { color: #00ffb3; border-color: #00ffb3; background: rgba(0, 255, 179, 0.08); }
.profile-status.rejected { color: #ff6b6b; border-color: #ff6b6b; background: rgba(255, 80, 80, 0.08); }
.profile-button.approve { background: #00ffb3; border-color: #00ffb3; color: #06110d; font-weight: 700; }
.profile-button.approve:hover { background: #4dffca; }
.profile-button.reject { color: #ff6b6b; border-color: #ff6b6b; }
.profile-button.reject:hover { background: rgba(255, 80, 80, 0.12); }
button:disabled { opacity: .5; cursor: wait; }
@media (max-width: 1023px) { .profile-panel { padding: 16px; margin-bottom: 90px; } }

body.theme-gray .profile-panel { background: #1e1e1e; border-color: #444; }
body.theme-gray .profile-button { border-color: #3a3a3a; color: #ccc; background: #1a1a1a; }
body.theme-gray .profile-button:hover { background: #2a2a2a; }
body.theme-gray .profile-button.approve { background: #3a3a3a; border-color: #3a3a3a; color: #f0f0f0; }
body.theme-gray .profile-button.approve:hover { background: #555; }
body.theme-gray .profile-button.reject { color: #dd8888; border-color: #555; }
body.theme-gray .profile-button.reject:hover { background: #2a2a2a; }
body.theme-gray .profile-input { background: #1a1a1a; border-color: #555; color: #eee; }
body.theme-gray .profile-alert { border-color: #804444; background: rgba(80, 40, 40, 0.3); color: #dd8888; }
body.theme-gray .profile-status.pending { color: #ccaa55; border-color: #555; background: transparent; }
body.theme-gray .profile-status.approved { color: #cccccc; border-color: #555; background: transparent; }
body.theme-gray .profile-status.rejected { color: #dd8888; border-color: #555; background: transparent; }
body.theme-gray .border-\[\#00ffb3\]\/10 { border-color: #2c2c2c !important; }

@media (max-width: 640px) {
    .chat-send-button {
        flex: 0 0 52px;
        width: 52px;
        min-width: 52px;
        max-width: 52px;
        height: 52px;
        line-height: 52px;
        font-size: 20px;
    }
}

body.theme-gray .chat-header-dot { color: #ccc; }
body.theme-gray .chat-status-dot.connected { background: #bbb; box-shadow: none; }
body.theme-gray .chat-status-dot.connecting,
body.theme-gray .chat-status-dot.reconnecting { background: #ccaa55; box-shadow: none; }
body.theme-gray .chat-status-dot.offline { background: #dd6a6a; box-shadow: none; }
body.theme-gray .chat-channel-toggle { border-color: #555; color: #ccc; }
body.theme-gray .chat-channel-toggle:hover { color: #fff; border-color: #888; }
body.theme-gray .chat-username { color: #ccc; }
body.theme-gray .chat-message--system-user .chat-username { color: #e0c84a; }
body.theme-gray .chat-message--own .chat-bubble { background: #2a2a2a; border-color: #444; }
body.theme-gray .reply-quote-author { color: #ccc; }
body.theme-gray .reply-quote-button { border-left-color: #555; background: rgba(255, 255, 255, 0.03); }
body.theme-gray .reply-preview-title { color: #ccc; }
body.theme-gray .reply-preview-card { border-left-color: #555; background: #232323; }
body.theme-gray #chat-input:focus { border-color: #888; box-shadow: none; }
body.theme-gray .chat-send-button { background: #3a3a3a; color: #f0f0f0; }
body.theme-gray .chat-send-button:hover { background: #555; }
body.theme-gray .chat-scroll-new { border-color: #555; color: #ccc; background: #1a1a1a; }
body.theme-gray #chat-messages::-webkit-scrollbar-thumb { background: #555; }

.account-name { cursor: pointer; }
.account-details { animation: fadeIn 0.25s ease; }
.account-details.hidden { display: none; }
.profile-button.details { border-color: #00ffb3; color: #00ffb3; }
.profile-button.link-account { border-color: #00ffb3; color: #06110d; background: #00ffb3; font-weight: 700; }
.profile-button.link-account:hover { background: #4dffca; }
body.theme-gray .profile-button.link-account { background: #3a3a3a; color: #f0f0f0; border-color: #3a3a3a; }
body.theme-gray .profile-button.link-account:hover { background: #555; }

/* Chat attachments, author avatars and reactions (desktop admin shell). */
.chat-message { align-items: flex-start; }
.chat-avatar,
.chat-avatar--grouped {
    flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: #0f1313; border: 1px solid rgba(0, 255, 179, 0.3); color: #00ffb3;
    font-weight: 700; font-size: 12px; position: relative; overflow: hidden;
    margin-right: 8px; padding: 0; cursor: pointer;
}
.chat-avatar--grouped { visibility: hidden; }
.chat-avatar__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.chat-attachment { margin-top: 8px; border: 1px solid rgba(255, 255, 255, 0.1); cursor: pointer; }
.chat-attachment__thumb { display: block; max-width: 280px; }
.chat-attachment-loading { margin-top: 8px; padding: 8px 10px; font-size: 12px; color: #8d9694; border: 1px dashed rgba(255, 255, 255, 0.15); }
.chat-reactions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.chat-reaction { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 999px; background: rgba(255, 255, 255, 0.04); color: #c9ccc9; font-size: 12px; cursor: pointer; }
.chat-reaction.is-mine { border-color: #00ffb3; background: rgba(0, 255, 179, 0.12); color: #e5e7eb; }
.chat-reaction-count { font-weight: 700; }
.chat-link { color: #00ffb3; text-decoration: underline; word-break: break-all; }
.chat-photo-btn { flex: 0 0 46px; width: 46px; height: 46px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(255, 255, 255, 0.13); border-radius: 10px; background: #101414; color: #8a9591; cursor: pointer; }
.chat-photo-btn:hover { color: #00ffb3; border-color: rgba(0, 255, 179, 0.4); }
.chat-photo-btn svg { width: 20px; height: 20px; }
#attachment-preview { margin-bottom: 9px; }
.attachment-preview { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 6px; border: 1px solid rgba(255, 255, 255, 0.13); background: rgba(0, 255, 179, 0.05); }
.attachment-preview__img { width: 64px; height: 64px; object-fit: cover; }
.attachment-preview__loading { padding: 10px; font-size: 12px; color: #8d9694; }
.attachment-preview__remove { position: absolute; top: -9px; right: -9px; width: 24px; height: 24px; border: 1px solid #555; border-radius: 50%; background: #1a1a1a; color: #eee; font-size: 16px; line-height: 1; cursor: pointer; }
.chat-header-avatar { position: relative; width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #0f1313; border: 1px solid rgba(0, 255, 179, 0.3); color: #00ffb3; font-weight: 700; font-size: 13px; overflow: hidden; margin-right: 4px; }

/* Desktop: private messages selector inside the chat header. */
.chat-dm-select {
    min-height: 34px;
    max-width: 220px;
    padding: 6px 9px;
    border: 1px solid rgba(0, 255, 179, 0.5);
    background: #0f1313;
    color: #c9ccc9;
    font-size: 11px;
    cursor: pointer;
}
.chat-dm-select:focus { outline: none; border-color: #00ffb3; }
.chat-dm-select option { background: #0f1313; color: #e5e7eb; }
.chat-dm-back {
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid rgba(0, 255, 179, 0.5);
    background: transparent;
    color: #c9ccc9;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.chat-dm-back:hover { color: #00ffb3; border-color: #00ffb3; }
body.theme-gray .chat-dm-select { border-color: #555; background: #1a1a1a; color: #ccc; }
body.theme-gray .chat-dm-back { border-color: #555; color: #ccc; }
