        :root {
            --bg-main: #030712;
            --bg-card: rgba(15, 23, 42, 0.72);
            --bg-surface: rgba(2, 6, 23, 0.65);
            --border-color: rgba(148, 163, 184, 0.12);
            --border-highlight: rgba(59, 130, 246, 0.35);
            --text-primary: #f8fafc;
            --text-secondary: #94a3b8;
            --text-muted: #64748b;
            --accent-blue: #3b82f6;
            --accent-indigo: #6366f1;
            --accent-purple: #a855f7;
            --success: #10b981;
            --warning: #f59e0b;
            --danger: #ef4444;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            background-color: var(--bg-main);
            color: var(--text-primary);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            background-image:
                radial-gradient(ellipse 80% 50% at 50% -10%, rgba(59, 130, 246, 0.18), transparent),
                radial-gradient(ellipse 60% 40% at 85% 20%, rgba(168, 85, 247, 0.10), transparent);
            overflow-x: hidden;
        }

        .mono {
            font-family: 'JetBrains Mono', monospace;
            font-variant-numeric: tabular-nums;
        }

        /* --- Custom Scrollbar --- */
        ::-webkit-scrollbar {
            width: 6px;
            height: 6px;
        }
        ::-webkit-scrollbar-track {
            background: rgba(2, 6, 23, 0.4);
        }
        ::-webkit-scrollbar-thumb {
            background: rgba(148, 163, 184, 0.25);
            border-radius: 999px;
        }
        ::-webkit-scrollbar-thumb:hover {
            background: rgba(148, 163, 184, 0.45);
        }

        /* --- Loading Screen --- */
        #loader {
            position: fixed;
            inset: 0;
            background: var(--bg-main);
            display: flex;
            flex-direction: column;
            gap: 1rem;
            justify-content: center;
            align-items: center;
            z-index: 9999;
            transition: opacity 0.4s ease, visibility 0.4s ease;
        }

        .spinner {
            width: 42px;
            height: 42px;
            border: 3px solid rgba(59, 130, 246, 0.15);
            border-top-color: var(--accent-blue);
            border-radius: 50%;
            animation: spin 0.9s linear infinite;
        }

        @keyframes spin { to { transform: rotate(360deg); } }

        /* --- Top Navigation / Header --- */
        header {
            max-width: 1240px;
            width: 100%;
            margin: 0 auto;
            padding: 2rem 2rem 1.15rem;
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: space-between;
            gap: 1rem;
        }

        .brand-group {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .brand-icon {
            width: 46px;
            height: 46px;
            border-radius: 14px;
            background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(168, 85, 247, 0.25));
            border: 1px solid rgba(96, 165, 250, 0.35);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.25rem;
            color: #60a5fa;
            box-shadow: 0 0 24px rgba(59, 130, 246, 0.2);
        }

        h1 {
            font-size: 1.75rem;
            font-weight: 700;
            letter-spacing: -0.03em;
            background: linear-gradient(135deg, #ffffff 30%, #94a3b8 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .tagline {
            color: var(--text-secondary);
            font-size: 0.875rem;
            margin-top: 0.15rem;
        }

        .stream-controls {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            flex-wrap: wrap;
        }

        .stream-pill {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.45rem 0.9rem;
            border-radius: 9999px;
            font-size: 0.78rem;
            font-weight: 600;
            background: rgba(16, 185, 129, 0.1);
            border: 1px solid rgba(16, 185, 129, 0.25);
            color: var(--success);
            transition: all 0.25s ease;
        }

        .stream-pill.reconnecting {
            background: rgba(245, 158, 11, 0.12);
            border-color: rgba(245, 158, 11, 0.3);
            color: var(--warning);
        }

        .pulse-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background-color: currentColor;
            box-shadow: 0 0 10px currentColor;
            animation: pulse 2s infinite;
        }

        @keyframes pulse {
            0%, 100% { opacity: 1; transform: scale(1); }
            50% { opacity: 0.45; transform: scale(0.8); }
        }

        .last-sync {
            font-size: 0.75rem;
            color: var(--text-muted);
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            padding: 0.45rem 0.75rem;
            border-radius: 10px;
        }

        /* --- Dedicated Admin Console Page View --- */
        .admin-console-page {
            max-width: 1240px;
            width: 100%;
            margin: 0 auto;
            padding: 0.5rem 2rem 3.5rem;
            display: none;
            flex-direction: column;
            gap: 1.25rem;
            min-width: 0;
            overflow: hidden;
        }

        .admin-console-page.active {
            display: flex;
        }

        .user-console-page {
            max-width: 1240px;
            width: 100%;
            margin: 0 auto;
            padding: 0.5rem 2rem 3.5rem;
            display: none;
            flex-direction: column;
            gap: 1rem;
            min-width: 0;
        }

        .user-console-page.active {
            display: flex;
        }
        .task-manager-page {
            display: none;
            max-width: 1240px;
            width: 100%;
            margin: 0 auto;
            padding: 0.5rem 2rem 3.5rem;
            flex-direction: column;
            gap: 1rem;
            min-width: 0;
            box-sizing: border-box;
        }
        .task-manager-page.active {
            display: flex;
        }
        .task-manager-head,
        .task-manager-actions {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem;
            flex-wrap: wrap;
        }
        .task-manager-list {
            display: flex;
            flex-direction: column;
            gap: 0.55rem;
        }

        .user-console-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem;
            flex-wrap: wrap;
        }

        .user-console-head .admin-back-btn,
        .task-manager-head .admin-back-btn {
            display: inline-flex;
            align-items: center;
            gap: 0.45rem;
            appearance: none;
            -webkit-appearance: none;
            border: 1px solid rgba(96, 165, 250, 0.35);
            border-radius: 10px;
            padding: 0.48rem 0.85rem;
            background: rgba(15, 23, 42, 0.92);
            color: var(--text-primary);
            font-family: inherit;
            font-size: 0.76rem;
            font-weight: 600;
            line-height: 1.2;
            cursor: pointer;
            box-shadow: none;
        }

        .user-console-head .admin-back-btn:hover,
        .task-manager-head .admin-back-btn:hover {
            border-color: rgba(96, 165, 250, 0.65);
            background: rgba(30, 41, 59, 0.95);
        }

        .user-console-head .admin-back-btn:focus-visible,
        .task-manager-head .admin-back-btn:focus-visible {
            outline: 2px solid rgba(96, 165, 250, 0.8);
            outline-offset: 2px;
        }

        .user-console-grid {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 1rem;
        }

        .user-console-card {
            width: 100%;
            min-width: 0;
            background: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 14px;
            padding: 1rem;
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
            box-sizing: border-box;
        }

        .user-console-card.span-2 {
            grid-column: 1 / -1;
        }

        .user-console-title {
            display: flex;
            align-items: center;
            gap: 0.55rem;
            color: #93c5fd;
            font-size: 0.78rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.06em;
        }

        .user-console-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
        }

        .user-field {
            width: 100%;
            max-width: 100%;
            min-width: 0;
            box-sizing: border-box;
            background: rgba(15, 23, 42, 0.85);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 0.55rem 0.7rem;
            color: var(--text-primary);
            font-family: inherit;
            font-size: 0.76rem;
            outline: none;
        }

        .user-textarea {
            min-height: 92px;
            resize: vertical;
            line-height: 1.45;
        }

        .user-status {
            color: var(--text-secondary);
            font-size: 0.72rem;
            line-height: 1.45;
        }

        .admin-bar {
            background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.9));
            backdrop-filter: blur(16px);
            border: 1px solid rgba(96, 165, 250, 0.35);
            border-radius: 20px;
            padding: 1.35rem 1.5rem;
            display: flex;
            flex-direction: column;
            gap: 1.15rem;
            box-shadow: 0 10px 30px rgba(59, 130, 246, 0.14);
            width: 100%;
            min-width: 0;
        }

        .admin-bar-top {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: space-between;
            gap: 0.85rem;
        }

        .admin-identity {
            display: flex;
            align-items: center;
            gap: 0.6rem;
            font-size: 0.84rem;
            font-weight: 600;
            color: #93c5fd;
        }

        .admin-badge {
            background: rgba(59, 130, 246, 0.2);
            border: 1px solid rgba(96, 165, 250, 0.4);
            color: #60a5fa;
            padding: 0.22rem 0.6rem;
            border-radius: 6px;
            font-size: 0.7rem;
            text-transform: uppercase;
            letter-spacing: 0.06em;
        }

        .admin-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 0.6rem;
        }

        .admin-btn {
            border: 1px solid var(--border-color);
            border-radius: 10px;
            padding: 0.5rem 0.9rem;
            font-size: 0.78rem;
            font-weight: 600;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 0.45rem;
            transition: all 0.2s ease;
            color: var(--text-primary);
            background: rgba(2, 6, 23, 0.7);
            font-family: inherit;
        }

        .admin-btn:hover:not(:disabled) {
            border-color: rgba(148, 163, 184, 0.35);
            background: rgba(15, 23, 42, 0.9);
        }

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

        .admin-btn.purge {
            border-color: rgba(239, 68, 68, 0.35);
            color: #fca5a5;
            background: rgba(239, 68, 68, 0.12);
        }
        .admin-btn.purge:hover:not(:disabled) {
            background: rgba(239, 68, 68, 0.24);
        }

        .admin-btn.heal {
            border-color: rgba(16, 185, 129, 0.35);
            color: #6ee7b7;
            background: rgba(16, 185, 129, 0.12);
        }
        .admin-btn.heal:hover:not(:disabled) {
            background: rgba(16, 185, 129, 0.24);
        }

        .admin-btn.pause {
            border-color: rgba(245, 158, 11, 0.35);
            color: #fcd34d;
            background: rgba(245, 158, 11, 0.12);
        }
        .admin-btn.pause:hover:not(:disabled) {
            background: rgba(245, 158, 11, 0.24);
        }

        .admin-btn.paused-active {
            border-color: rgba(239, 68, 68, 0.5);
            color: #ffffff;
            background: rgba(239, 68, 68, 0.28);
        }

        .admin-btn.primary {
            border-color: rgba(59, 130, 246, 0.4);
            color: #93c5fd;
            background: rgba(59, 130, 246, 0.16);
        }
        .admin-btn.primary:hover:not(:disabled) {
            background: rgba(59, 130, 246, 0.28);
        }

        .admin-btn-xs {
            padding: 0.26rem 0.55rem;
            font-size: 0.7rem;
            border-radius: 7px;
        }

        /* --- Unified Admin Tools Grid --- */
        .admin-drawer {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 1rem;
            padding-top: 1rem;
            border-top: 1px solid rgba(148, 163, 184, 0.14);
            width: 100%;
            min-width: 0;
        }

        .admin-panel {
            background: var(--bg-surface);
            border: 1px solid var(--border-color);
            border-radius: 14px;
            padding: 1rem;
            display: flex;
            flex-direction: column;
            gap: 0.65rem;
            width: 100%;
            min-width: 0;
            box-sizing: border-box;
        }

        #admin-worker-list,
        #admin-queue-list {
            width: 100%;
            max-width: 100%;
            min-width: 0;
        }

        #admin-worker-list > div,
        #admin-queue-list > div {
            width: 100%;
            max-width: 100%;
            box-sizing: border-box;
            flex-wrap: wrap;
        }

        #admin-worker-list > div > div:first-child,
        #admin-queue-list > div > div:first-child {
            min-width: 0;
            flex: 1 1 180px;
        }

        .admin-panel.broadcast-full {
            grid-column: 1 / -1;
        }

        .admin-panel-title {
            font-size: 0.74rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: #93c5fd;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.5rem;
            flex-wrap: wrap;
        }

        .admin-input, .admin-textarea, .admin-select {
            width: 100%;
            background: rgba(15, 23, 42, 0.85);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 0.48rem 0.65rem;
            color: var(--text-primary);
            font-family: inherit;
            font-size: 0.76rem;
            outline: none;
            transition: border-color 0.2s ease;
        }

        .admin-input:focus, .admin-textarea:focus, .admin-select:focus {
            border-color: rgba(96, 165, 250, 0.5);
        }

        .admin-textarea {
            min-height: 92px;
            resize: vertical;
            line-height: 1.45;
        }

        .admin-row {
            display: flex;
            gap: 0.45rem;
            flex-wrap: wrap;
            align-items: center;
        }

        .user-lookup-box {
            background: rgba(15, 23, 42, 0.75);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 0.6rem;
            font-size: 0.74rem;
            display: none;
            flex-direction: column;
            gap: 0.5rem;
        }

        /* --- Broadcast Studio (Formatting Toolbar, Media Picker & Live Preview) --- */
        .bc-studio-grid {
            display: grid;
            grid-template-columns: 1.2fr 0.8fr;
            gap: 0.9rem;
            align-items: stretch;
        }

        .bc-composer-col {
            display: flex;
            flex-direction: column;
            gap: 0.55rem;
        }

        .bc-toolbar {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 0.3rem;
            background: rgba(15, 23, 42, 0.92);
            border: 1px solid var(--border-color);
            border-bottom: none;
            border-radius: 8px 8px 0 0;
            padding: 0.35rem 0.45rem;
        }

        .bc-fmt-btn {
            background: rgba(30, 41, 59, 0.75);
            border: 1px solid rgba(148, 163, 184, 0.16);
            color: var(--text-primary);
            border-radius: 6px;
            padding: 0.22rem 0.48rem;
            font-size: 0.7rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.15s ease;
            font-family: inherit;
        }

        .bc-fmt-btn:hover {
            border-color: rgba(96, 165, 250, 0.45);
            background: rgba(59, 130, 246, 0.2);
            color: #93c5fd;
        }

        .bc-fmt-btn.disabled {
            opacity: 0.35;
            pointer-events: none;
        }

        .bc-textarea-attached {
            border-top-left-radius: 0;
            border-top-right-radius: 0;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.74rem;
        }

        .bc-media-drop {
            border: 1px dashed rgba(96, 165, 250, 0.35);
            background: rgba(15, 23, 42, 0.65);
            border-radius: 8px;
            padding: 0.5rem 0.7rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.5rem;
            cursor: pointer;
            font-size: 0.73rem;
            color: var(--text-secondary);
            transition: border-color 0.2s ease, background 0.2s ease;
        }

        .bc-media-drop:hover, .bc-media-drop.dragover {
            border-color: rgba(96, 165, 250, 0.65);
            background: rgba(59, 130, 246, 0.12);
            color: var(--text-primary);
        }

        .bc-media-url-row {
            display: grid;
            grid-template-columns: 1fr 125px;
            gap: 0.45rem;
        }

        .bc-preview-col {
            background: rgba(15, 23, 42, 0.65);
            border: 1px solid var(--border-color);
            border-radius: 10px;
            padding: 0.7rem;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            gap: 0.5rem;
        }

        .bc-preview-label {
            font-size: 0.66rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: var(--text-muted);
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .tg-preview-bubble {
            background: #17253b;
            border: 1px solid rgba(148, 163, 184, 0.18);
            border-radius: 12px 12px 12px 4px;
            overflow: hidden;
            box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
        }

        .tg-preview-media {
            display: none;
            background: #0b1220;
            border-bottom: 1px solid rgba(148, 163, 184, 0.14);
        }

        .tg-preview-media.visible {
            display: block;
        }

        .tg-preview-media img, .tg-preview-media video {
            width: 100%;
            max-height: 155px;
            object-fit: cover;
            display: block;
        }

        .tg-preview-file-badge {
            padding: 0.55rem 0.75rem;
            display: flex;
            align-items: center;
            gap: 0.55rem;
            font-size: 0.73rem;
            color: var(--text-primary);
        }

        .tg-preview-body {
            padding: 0.65rem 0.8rem;
            font-size: 0.78rem;
            line-height: 1.45;
            color: var(--text-primary);
            word-break: break-word;
            white-space: pre-wrap;
        }

        .tg-preview-body code {
            font-family: 'JetBrains Mono', monospace;
            background: rgba(2, 6, 23, 0.7);
            padding: 0.08rem 0.32rem;
            border-radius: 4px;
            font-size: 0.72rem;
            color: #93c5fd;
        }

        .tg-preview-body pre {
            font-family: 'JetBrains Mono', monospace;
            background: rgba(2, 6, 23, 0.85);
            padding: 0.45rem 0.6rem;
            border-radius: 6px;
            font-size: 0.71rem;
            overflow-x: auto;
            margin: 0.25rem 0;
        }

        .tg-preview-body blockquote {
            border-left: 2px solid #60a5fa;
            padding-left: 0.5rem;
            color: #cbd5e1;
            margin: 0.2rem 0;
        }

        .tg-preview-body a {
            color: #60a5fa;
            text-decoration: underline;
        }

        .tg-spoiler-span {
            background: rgba(148, 163, 184, 0.3);
            color: transparent;
            border-radius: 3px;
            padding: 0 3px;
            cursor: pointer;
        }

        .tg-spoiler-span:hover {
            color: var(--text-primary);
        }

        .tg-preview-meta {
            padding: 0 0.75rem 0.45rem;
            text-align: right;
            font-size: 0.64rem;
            color: var(--text-secondary);
        }

        /* --- Bento Grid Dashboard --- */
        .dashboard {
            max-width: 1240px;
            margin: 0 auto;
            padding: 0.5rem 2rem 3.5rem;
            display: grid;
            grid-template-columns: repeat(12, 1fr);
            gap: 1.25rem;
            width: 100%;
        }

        .card {
            background: var(--bg-card);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1px solid var(--border-color);
            border-radius: 20px;
            padding: 1.5rem;
            box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.45);
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            transition: border-color 0.25s ease, transform 0.25s ease;
            min-width: 0;
        }

        .card:hover {
            border-color: rgba(148, 163, 184, 0.24);
        }

        .card-bot { grid-column: span 7; }
        .card-users { grid-column: span 5; }
        .card-full { grid-column: span 12; }
        .card-system { grid-column: span 6; }
        .card-network { grid-column: span 6; }

        .card-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem;
            margin-bottom: 1.25rem;
            flex-wrap: wrap;
        }

        .card-title {
            font-size: 0.8rem;
            font-weight: 600;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.07em;
            display: flex;
            align-items: center;
            gap: 0.55rem;
        }

        .card-title i {
            color: var(--accent-blue);
            font-size: 0.95rem;
        }

        .status-badge {
            background: rgba(16, 185, 129, 0.12);
            color: var(--success);
            border: 1px solid rgba(16, 185, 129, 0.25);
            padding: 0.25rem 0.75rem;
            border-radius: 9999px;
            font-size: 0.75rem;
            font-weight: 600;
            display: inline-flex;
            align-items: center;
            gap: 0.45rem;
        }

        .status-badge.paused {
            background: rgba(245, 158, 11, 0.14);
            color: var(--warning);
            border-color: rgba(245, 158, 11, 0.35);
        }

        .real-db-pill {
            display: none;
            font-size: 0.65rem;
            font-weight: 700;
            padding: 0.18rem 0.5rem;
            border-radius: 6px;
            background: rgba(245, 158, 11, 0.16);
            border: 1px solid rgba(245, 158, 11, 0.35);
            color: #fcd34d;
            letter-spacing: 0.05em;
        }

        /* --- User Plan & Daily Quota Card --- */
        .quota-grid {
            display: grid;
            grid-template-columns: repeat(5, minmax(0, 1fr));
            gap: 0.9rem;
        }

        .quota-bar-wrap {
            margin-top: 0.95rem;
            background: var(--bg-surface);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 0.75rem 0.95rem;
        }

        .quota-bar-meta {
            display: flex;
            justify-content: space-between;
            font-size: 0.74rem;
            color: var(--text-secondary);
            margin-bottom: 0.45rem;
        }

        .quota-guest-note {
            background: var(--bg-surface);
            border: 1px dashed rgba(148, 163, 184, 0.24);
            border-radius: 12px;
            padding: 0.85rem 1rem;
            font-size: 0.8rem;
            color: var(--text-secondary);
            display: flex;
            align-items: center;
            gap: 0.6rem;
            line-height: 1.45;
        }

        /* --- Stat Blocks --- */
        .stat-grid {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 0.9rem;
        }

        .stat-grid-2 {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 0.9rem;
        }

        .stat-block {
            background: var(--bg-surface);
            padding: 1rem 1.1rem;
            border-radius: 14px;
            border: 1px solid var(--border-color);
            display: flex;
            flex-direction: column;
            justify-content: center;
            min-width: 0;
            overflow: hidden;
        }

        .stat-label {
            font-size: 0.75rem;
            color: var(--text-secondary);
            margin-bottom: 0.35rem;
            display: flex;
            align-items: center;
            gap: 0.4rem;
            line-height: 1.25;
            min-width: 0;
        }

        .stat-label i {
            flex-shrink: 0;
        }

        .stat-value {
            font-size: clamp(1.1rem, 2.5vw, 1.45rem);
            font-weight: 700;
            color: var(--text-primary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* --- Traffic, Sparkline & Processing Layout --- */
        .traffic-layout {
            display: grid;
            grid-template-columns: 240px 1fr;
            gap: 1.25rem;
            align-items: stretch;
        }

        .processing-block {
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            text-align: center;
            padding: 1.5rem 1rem;
            background: linear-gradient(160deg, rgba(168, 85, 247, 0.10), rgba(59, 130, 246, 0.05));
            border: 1px solid rgba(168, 85, 247, 0.25);
            border-radius: 16px;
            position: relative;
            overflow: hidden;
            transition: border-color 0.3s ease, box-shadow 0.3s ease;
        }

        .processing-block.active-glow {
            border-color: rgba(168, 85, 247, 0.55);
            box-shadow: 0 0 28px rgba(168, 85, 247, 0.16);
        }

        .processing-block .stat-label {
            color: #c084fc;
            font-size: 0.78rem;
            font-weight: 700;
            letter-spacing: 0.1em;
            text-transform: uppercase;
            margin-bottom: 0.4rem;
        }

        .processing-block .stat-value {
            font-size: 3.25rem;
            line-height: 1;
            color: #ffffff;
        }

        .processing-sub {
            margin-top: 0.6rem;
            font-size: 0.75rem;
            color: var(--text-secondary);
        }

        .speed-subcard {
            background: var(--bg-surface);
            border: 1px solid var(--border-color);
            border-radius: 16px;
            padding: 1.25rem;
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .speed-top-bar {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 0.9rem;
        }

        .speed-pill-box {
            background: rgba(15, 23, 42, 0.65);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 0.85rem 1rem;
        }

        .speed-pill-label {
            font-size: 0.72rem;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: 0.3rem;
            display: flex;
            align-items: center;
            gap: 0.4rem;
        }

        .speed-pill-val {
            font-size: 1.2rem;
            font-weight: 700;
        }

        .sparkline-wrapper {
            position: relative;
            width: 100%;
            height: 82px;
            background: rgba(2, 6, 23, 0.5);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 0.4rem;
            overflow: hidden;
        }

        .sparkline-legend {
            position: absolute;
            top: 8px;
            right: 12px;
            display: flex;
            gap: 0.9rem;
            font-size: 0.7rem;
            color: var(--text-secondary);
            pointer-events: none;
            z-index: 2;
        }

        .legend-item {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
        }

        .legend-swatch {
            width: 8px;
            height: 8px;
            border-radius: 2px;
        }

        canvas.sparkline-canvas {
            width: 100%;
            height: 100%;
            display: block;
        }

        /* --- 7-Day & 24-Hour Volume & Rename History Chart --- */
        .history-header-right {
            display: flex;
            align-items: center;
            gap: 0.55rem;
            flex-wrap: wrap;
        }

        .history-summary-pill {
            background: var(--bg-surface);
            border: 1px solid var(--border-color);
            border-radius: 999px;
            padding: 0.3rem 0.75rem;
            font-size: 0.73rem;
            color: var(--text-secondary);
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
        }

        .history-summary-pill strong {
            color: var(--text-primary);
            font-weight: 700;
        }

        .history-chart-box {
            position: relative;
            width: 100%;
            height: auto;
            background: var(--bg-surface);
            border: 1px solid var(--border-color);
            border-radius: 16px;
            padding: 0.85rem 0.9rem 0.8rem;
            display: flex;
            flex-direction: column;
            gap: 0.65rem;
        }

        .history-toolbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 0.65rem;
            font-size: 0.72rem;
            color: var(--text-secondary);
        }

        .history-legend-items {
            display: flex;
            align-items: center;
            gap: 0.85rem;
            flex-wrap: wrap;
        }

        .history-controls-right {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            flex-wrap: wrap;
        }

        .history-mode-tabs {
            display: inline-flex;
            align-items: center;
            background: rgba(15, 23, 42, 0.85);
            border: 1px solid var(--border-color);
            border-radius: 999px;
            padding: 0.18rem;
            gap: 0.15rem;
        }

        .history-mode-btn, .history-range-btn {
            background: transparent;
            border: none;
            color: var(--text-secondary);
            font-family: inherit;
            font-size: 0.7rem;
            font-weight: 600;
            padding: 0.25rem 0.65rem;
            border-radius: 999px;
            cursor: pointer;
            transition: all 0.18s ease;
        }

        .history-mode-btn:hover, .history-range-btn:hover {
            color: var(--text-primary);
        }

        .history-mode-btn.active {
            background: rgba(59, 130, 246, 0.22);
            color: #93c5fd;
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
        }

        .history-range-btn.active {
            background: rgba(168, 85, 247, 0.24);
            color: #e9d5ff;
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
        }

        .history-canvas-wrap {
            position: relative;
            width: 100%;
            height: 215px;
        }

        canvas#history-7d-canvas {
            width: 100%;
            height: 100%;
            display: block;
            cursor: pointer;
            touch-action: manipulation;
        }

        .history-inspector {
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 0.6rem 1rem;
            background: rgba(15, 23, 42, 0.72);
            border: 1px solid rgba(59, 130, 246, 0.22);
            border-radius: 12px;
            padding: 0.55rem 0.85rem;
            font-size: 0.74rem;
        }

        .inspector-date {
            font-weight: 700;
            color: #93c5fd;
            display: inline-flex;
            align-items: center;
            gap: 0.45rem;
        }

        .inspector-metrics {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 0.85rem;
            color: var(--text-secondary);
        }

        .inspector-metric {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
        }

        .inspector-dot {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            display: inline-block;
        }

        .inspector-metric strong {
            color: var(--text-primary);
            font-weight: 700;
        }

        /* --- Live Telemetry Terminal --- */
        .filter-tabs {
            display: flex;
            align-items: center;
            gap: 0.4rem;
            flex-wrap: wrap;
        }

        .filter-btn {
            background: var(--bg-surface);
            color: var(--text-secondary);
            border: 1px solid var(--border-color);
            border-radius: 999px;
            padding: 0.35rem 0.85rem;
            font-size: 0.75rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
        }

        .filter-btn:hover {
            color: var(--text-primary);
            border-color: rgba(148, 163, 184, 0.35);
        }

        .filter-btn.active {
            background: rgba(59, 130, 246, 0.16);
            color: #60a5fa;
            border-color: rgba(59, 130, 246, 0.45);
        }

        .filter-count {
            background: rgba(255, 255, 255, 0.08);
            padding: 0.05rem 0.45rem;
            border-radius: 999px;
            font-size: 0.7rem;
        }

        .queue-terminal {
            background: #02050e;
            border: 1px solid var(--border-color);
            border-radius: 14px;
            padding: 1.15rem;
            max-height: 460px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 0.8rem;
            box-shadow: inset 0 2px 14px rgba(0, 0, 0, 0.65);
        }

        .q-item {
            background: rgba(15, 23, 42, 0.65);
            border: 1px solid rgba(148, 163, 184, 0.12);
            border-radius: 12px;
            padding: 0.95rem 1.1rem;
            display: flex;
            flex-direction: column;
            gap: 0.55rem;
            transition: border-color 0.2s ease;
        }

        .q-item:hover {
            border-color: rgba(148, 163, 184, 0.28);
        }

        .q-top {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.6rem;
        }

        .q-badges {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 0.45rem;
            min-width: 0;
        }

        .q-tag {
            font-size: 0.65rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            padding: 0.2rem 0.55rem;
            border-radius: 6px;
            flex-shrink: 0;
        }

        .q-tag.dl {
            background: rgba(16, 185, 129, 0.14);
            color: var(--success);
            border: 1px solid rgba(16, 185, 129, 0.28);
        }

        .q-tag.up {
            background: rgba(168, 85, 247, 0.15);
            color: #c084fc;
            border: 1px solid rgba(168, 85, 247, 0.3);
        }

        .q-tag.wait {
            background: rgba(245, 158, 11, 0.14);
            color: var(--warning);
            border: 1px solid rgba(245, 158, 11, 0.28);
        }

        .q-ext-pill {
            font-size: 0.65rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: #fde68a;
            background: rgba(245, 158, 11, 0.14);
            border: 1px solid rgba(245, 158, 11, 0.32);
            padding: 0.16rem 0.48rem;
            border-radius: 5px;
            flex-shrink: 0;
        }

        .q-worker-pill {
            font-size: 0.65rem;
            color: #93c5fd;
            background: rgba(59, 130, 246, 0.12);
            border: 1px solid rgba(59, 130, 246, 0.25);
            padding: 0.16rem 0.48rem;
            border-radius: 5px;
            flex-shrink: 0;
        }

        .q-owner-pill {
            font-size: 0.63rem;
            font-weight: 700;
            color: #6ee7b7;
            background: rgba(16, 185, 129, 0.14);
            border: 1px solid rgba(16, 185, 129, 0.3);
            padding: 0.14rem 0.45rem;
            border-radius: 5px;
            flex-shrink: 0;
        }

        .q-filename {
            font-size: 0.84rem;
            font-weight: 500;
            color: var(--text-primary);
            line-height: 1.4;
            word-break: break-word;
            overflow-wrap: anywhere;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .q-pct {
            font-size: 0.85rem;
            font-weight: 700;
            color: var(--text-primary);
            flex-shrink: 0;
        }

        .q-bar-bg {
            height: 6px;
            background: rgba(2, 6, 23, 0.9);
            border-radius: 999px;
            overflow: hidden;
            position: relative;
        }

        .q-bar-fill {
            height: 100%;
            border-radius: 999px;
            background: linear-gradient(90deg, #059669, #34d399);
            transition: width 0.35s ease;
            position: relative;
            overflow: hidden;
        }

        .q-bar-fill.up {
            background: linear-gradient(90deg, #7c3aed, #c084fc);
        }

        .q-bar-fill::after {
            content: "";
            position: absolute;
            inset: 0;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
            animation: shimmer 1.6s infinite;
        }

        @keyframes shimmer {
            0% { transform: translateX(-100%); }
            100% { transform: translateX(100%); }
        }

        .q-stats {
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            gap: 0.5rem;
            font-size: 0.74rem;
            color: var(--text-secondary);
        }

        .queue-empty {
            color: var(--text-muted);
            text-align: center;
            padding: 2.5rem 1rem;
            font-size: 0.875rem;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.5rem;
        }

        /* --- Fleet Architecture & Per-Node Cards --- */
        .fleet-summary-grid {
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 0.9rem;
            margin-bottom: 1.15rem;
        }

        .node-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(225px, 1fr));
            gap: 0.85rem;
        }

        .fleet-header-actions {
            display: flex;
            align-items: center;
            gap: 0.7rem;
            flex-wrap: wrap;
            justify-content: flex-end;
            max-width: 70%;
        }

        .fleet-dots {
            display: flex;
            align-items: center;
            align-content: flex-start;
            gap: 0.32rem;
            flex-wrap: wrap;
            min-height: 18px;
            max-width: 420px;
        }

        .fleet-dot {
            width: 9px;
            height: 9px;
            border-radius: 50%;
            background: var(--success);
            box-shadow: 0 0 8px rgba(16, 185, 129, 0.75);
        }

        .fleet-dot.busy {
            background: var(--warning);
            box-shadow: 0 0 8px rgba(245, 158, 11, 0.75);
        }

        .fleet-dot.limited {
            background: var(--danger);
            box-shadow: 0 0 8px rgba(239, 68, 68, 0.75);
        }

        .fleet-toggle {
            border: 1px solid rgba(96, 165, 250, 0.35);
            background: rgba(59, 130, 246, 0.12);
            color: #93c5fd;
            border-radius: 999px;
            padding: 0.42rem 0.75rem;
            font-size: 0.72rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .fleet-toggle:hover {
            border-color: rgba(96, 165, 250, 0.65);
            background: rgba(59, 130, 246, 0.2);
        }

        .fleet-details[hidden] {
            display: none;
        }

        .node-card {
            background: var(--bg-surface);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 0.85rem 1rem;
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
            transition: border-color 0.25s ease;
        }

        .node-card.rate-limited {
            border-color: rgba(239, 68, 68, 0.45);
            background: rgba(239, 68, 68, 0.06);
        }

        .node-card.busy-node {
            border-color: rgba(59, 130, 246, 0.35);
        }

        .node-top {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.5rem;
        }

        .node-name {
            font-size: 0.82rem;
            font-weight: 600;
            color: var(--text-primary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .node-status {
            font-size: 0.68rem;
            font-weight: 700;
            padding: 0.15rem 0.55rem;
            border-radius: 999px;
            flex-shrink: 0;
        }

        .node-status.idle {
            background: rgba(16, 185, 129, 0.12);
            color: var(--success);
        }

        .node-status.busy {
            background: rgba(59, 130, 246, 0.15);
            color: #60a5fa;
        }

        .node-status.limited {
            background: rgba(239, 68, 68, 0.18);
            color: #fca5a5;
            border: 1px solid rgba(239, 68, 68, 0.35);
        }

        .node-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 0.72rem;
            color: var(--text-secondary);
        }

        .node-speed {
            font-weight: 600;
            color: #a7f3d0;
        }

        .node-speed.idle-speed {
            color: var(--text-muted);
            font-weight: 400;
        }

        .node-bar {
            height: 4px;
            background: rgba(15, 23, 42, 0.9);
            border-radius: 999px;
            overflow: hidden;
        }

        .node-bar-fill {
            height: 100%;
            background: var(--accent-blue);
            border-radius: 999px;
            transition: width 0.3s ease;
        }

        .node-bar-fill.limited-bar {
            background: var(--danger);
        }

        /* --- Hardware Meters --- */
        .meter {
            margin-bottom: 1rem;
        }

        .meter-header {
            display: flex;
            justify-content: space-between;
            font-size: 0.8rem;
            color: var(--text-secondary);
            margin-bottom: 0.45rem;
        }

        .meter-value {
            color: var(--text-primary);
            font-weight: 600;
        }

        .progress-track {
            height: 8px;
            background: rgba(2, 6, 23, 0.85);
            border-radius: 999px;
            overflow: hidden;
        }

        .progress-fill {
            height: 100%;
            border-radius: 999px;
            transition: width 0.35s ease, background 0.35s ease;
        }

        .fill-cpu { background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple)); }
        .fill-ram { background: linear-gradient(90deg, var(--success), var(--accent-blue)); }
        .fill-warn { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
        .fill-danger { background: linear-gradient(90deg, #dc2626, #f87171); }

        /* --- Action Buttons --- */
        .actions {
            display: flex;
            gap: 0.85rem;
            margin-top: 1.15rem;
        }

        .btn {
            flex: 1;
            padding: 0.8rem 1rem;
            border-radius: 12px;
            text-align: center;
            text-decoration: none;
            font-weight: 600;
            font-size: 0.84rem;
            transition: all 0.2s ease;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            white-space: nowrap;
        }

        .btn-tg {
            background: rgba(59, 130, 246, 0.12);
            color: #60a5fa;
            border: 1px solid rgba(59, 130, 246, 0.25);
        }

        .btn-tg:hover {
            background: rgba(59, 130, 246, 0.22);
            transform: translateY(-1px);
        }

        .btn-gh {
            background: rgba(255, 255, 255, 0.05);
            color: var(--text-primary);
            border: 1px solid var(--border-color);
        }

        .btn-gh:hover {
            background: rgba(255, 255, 255, 0.1);
            transform: translateY(-1px);
        }

        /* --- Toast Notifications --- */
        #toast-container {
            position: fixed;
            bottom: 1.5rem;
            right: 1.5rem;
            z-index: 9998;
            display: flex;
            flex-direction: column;
            gap: 0.6rem;
            pointer-events: none;
        }

        .toast {
            background: rgba(15, 23, 42, 0.95);
            backdrop-filter: blur(12px);
            border: 1px solid rgba(148, 163, 184, 0.25);
            color: var(--text-primary);
            padding: 0.75rem 1rem;
            border-radius: 12px;
            font-size: 0.8rem;
            font-weight: 500;
            box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
            display: flex;
            align-items: center;
            gap: 0.6rem;
            animation: slideIn 0.25s ease forwards;
        }

        @keyframes slideIn {
            from { opacity: 0; transform: translateY(12px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* --- Footer --- */
        footer {
            margin-top: auto;
            text-align: center;
            padding: 1.75rem 2rem;
            border-top: 1px solid var(--border-color);
            color: var(--text-secondary);
            font-size: 0.84rem;
        }

        footer a {
            color: #60a5fa;
            text-decoration: none;
        }

        footer a:hover {
            text-decoration: underline;
        }

        /* --- Responsive --- */
        @media (max-width: 960px) {
            .card-bot, .card-users, .card-system, .card-network, .card-full {
                grid-column: span 12;
            }
            .traffic-layout {
                grid-template-columns: 1fr;
            }
            .admin-drawer, .bc-studio-grid {
                grid-template-columns: 1fr;
            }
            .quota-grid {
                grid-template-columns: repeat(3, minmax(0, 1fr));
            }
        }

        @media (max-width: 640px) {
            header, .dashboard, .admin-console-page, .user-console-page {
                padding-left: 1.15rem;
                padding-right: 1.15rem;
            }
            .admin-bar {
                padding: 1rem;
                border-radius: 16px;
            }
            .admin-panel {
                padding: 0.85rem;
            }
            .admin-drawer {
                gap: 0.75rem;
            }
            .user-console-grid {
                grid-template-columns: 1fr;
            }
            .user-console-card.span-2 {
                grid-column: 1;
            }
            .admin-panel-title,
            .admin-identity {
                min-width: 0;
            }
            .bc-toolbar {
                max-width: 100%;
            }
            .fleet-card-header {
                align-items: flex-start;
            }
            .fleet-header-actions {
                flex-basis: 100%;
                width: 100%;
                max-width: none;
                justify-content: flex-end;
            }
            .fleet-dots {
                flex-basis: 100%;
                max-width: 100%;
                row-gap: 0.32rem;
            }
            .fleet-toggle {
                margin-left: auto;
            }
            .stat-grid, .speed-top-bar {
                grid-template-columns: 1fr;
            }
            .fleet-summary-grid, .quota-grid {
                grid-template-columns: repeat(2, minmax(0, 1fr));
                gap: 0.65rem;
            }
            .quota-grid .stat-block {
                padding: 0.85rem 0.85rem;
            }
            .quota-grid .stat-label {
                font-size: 0.69rem;
                gap: 0.32rem;
            }
            .quota-grid .stat-value {
                font-size: clamp(0.95rem, 3.6vw, 1.3rem);
            }
            .actions {
                flex-direction: column;
            }
            .admin-bar-top {
                flex-direction: column;
                align-items: stretch;
            }
            .admin-actions {
                flex-direction: column;
            }
            .admin-btn {
                justify-content: center;
            }
            .bc-media-url-row {
                grid-template-columns: 1fr;
            }
        }
