﻿/* MESHROOM - Main Stylesheet */
/* Theme: Dark Teal & Mint - Modern, Immersive, Tech */

:root {
    /* Core Colors - Matching YOGM Logo */
    --bg-primary: #0f1419;
    --bg-secondary: #1a1f2e;
    --bg-tertiary: #242d3f;
    --bg-elevated: #2a3548;

    /* Accent Colors - Logo Palette (Purple + Green + Teal) */
    --purple-deep: #32136f;
    --purple-medium: #5f25d5;
    --purple-light: #8a62ff;
    --rose-primary: #26d7b4;
    --rose-light: #00ffc5;
    --rose-dark: #1ea88f;
    --pink-deep: #008036;
    --pink-medium: #00b658;
    --pink-light: #00ff6c;

    /* Brand Tokens */
    --brand-purple: #5f25d5;
    --brand-purple-deep: #32136f;
    --brand-teal: #26d7b4;
    --brand-mint: #00ffc5;
    --brand-green: #00ff6c;

    /* Text Colors - Better contrast */
    --text-on-dark: #f5f7fa;
    --text-on-light: #0a0e13;
    --text-on-light-secondary: #1a1f2e;
    --text-on-light-muted: #424f63;
    --text-primary: var(--text-on-dark);
    --text-secondary: #a8b5c4;
    --text-muted: #6b7684;
    --text-accent: #00ffc5;

    /* Status Colors */
    --status-online: #00ff6c;
    --status-offline: #ff4444;
    --status-pending: #ffd700;

    /* Borders & Shadows */
    --border-subtle: rgba(95, 37, 213, 0.15);
    --border-medium: rgba(95, 37, 213, 0.25);
    --border-accent: rgba(0, 255, 197, 0.3);
    --shadow-soft: 0 4px 16px rgba(0, 0, 0, 0.6);
    --shadow-strong: 0 12px 40px rgba(0, 0, 0, 0.8);
    --shadow-purple: 0 8px 32px rgba(95, 37, 213, 0.25);

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Press Start 2P', monospace;
    --font-pixel: 'Press Start 2P', monospace;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
}

body.theme-windows {
    --bg-primary: #c0c0c0;
    --bg-secondary: #d6d6d6;
    --bg-tertiary: #e6e6e6;
    --bg-elevated: #f2f2f2;

    --purple-deep: #003a6b;
    --purple-medium: #005a9c;
    --purple-light: #2b7bd3;
    --rose-primary: #0078d7;
    --rose-light: #3a8dde;
    --rose-dark: #005a9c;
    --pink-deep: #003a6b;
    --pink-medium: #005a9c;
    --pink-light: #2b7bd3;

    --text-primary: #1a1a1a;
    --text-secondary: #3d3d3d;
    --text-muted: #5a5a5a;

    --border-subtle: rgba(0, 0, 0, 0.1);
    --border-medium: rgba(0, 0, 0, 0.2);
    --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-strong: 0 6px 16px rgba(0, 0, 0, 0.3);
    --font-primary: "Tahoma", "MS Sans Serif", Arial, sans-serif;
    --radius-sm: 0;
    --radius-md: 0;
    --radius-lg: 0;
    --radius-xl: 0;
}

body.theme-win96 {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #252525;
    --bg-elevated: #303030;

    --purple-deep: #444455;
    --purple-medium: #555566;
    --purple-light: #666677;
    --rose-primary: #555566;
    --rose-light: #666677;
    --rose-dark: #444455;
    --pink-deep: #444455;
    --pink-medium: #555566;
    --pink-light: #666677;

    --text-primary: #f0f0f0;
    --text-secondary: #c0c0c0;
    --text-muted: #777777;

    --border-subtle: rgba(255, 255, 255, 0.12);
    --border-medium: rgba(255, 255, 255, 0.2);
    --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.8);
    --shadow-strong: 0 6px 16px rgba(0, 0, 0, 0.95);
    --font-primary: "Tahoma", "MS Sans Serif", Arial, sans-serif;
    --radius-sm: 0;
    --radius-md: 0;
    --radius-lg: 0;
    --radius-xl: 0;
}

body.theme-fantasy {
    --bg-primary: #110b1d;
    --bg-secondary: #1c1330;
    --bg-tertiary: #241a3d;
    --bg-elevated: #2f234f;

    --purple-deep: #3a1c5c;
    --purple-medium: #5a2d8a;
    --purple-light: #7a4cc2;
    --rose-primary: #ffb86c;
    --rose-light: #ffd59e;
    --rose-dark: #e88f3f;
    --pink-deep: #6a237a;
    --pink-medium: #a63fa9;
    --pink-light: #e174e3;

    --text-primary: #f5f0ff;
    --text-secondary: #c7b9e6;
    --text-muted: #9c8abf;

    --border-subtle: rgba(255, 255, 255, 0.1);
    --border-medium: rgba(255, 255, 255, 0.2);
    --shadow-soft: 0 6px 18px rgba(10, 4, 24, 0.5);
    --shadow-strong: 0 10px 28px rgba(10, 4, 24, 0.65);
    --font-primary: "Poppins", "Inter", sans-serif;
}

body.theme-console {
    --bg-primary: #000000;
    --bg-secondary: #000000;
    --bg-tertiary: #000000;
    --bg-elevated: #000000;

    --purple-deep: #00aa00;
    --purple-medium: #00cc00;
    --purple-light: #00ff00;
    --rose-primary: #00ff00;
    --rose-light: #33ff33;
    --rose-dark: #00cc00;
    --pink-deep: #00aa00;
    --pink-medium: #00cc00;
    --pink-light: #00ff00;

    --text-primary: #ffffff;
    --text-secondary: #00ff00;
    --text-muted: #00aa00;

    --border-subtle: #00ff00;
    --border-medium: #00ff00;
    --shadow-soft: none;
    --shadow-strong: none;
    --font-primary: "Courier New", "Monaco", "Consolas", "Liberation Mono", monospace;
    --radius-sm: 0;
    --radius-md: 0;
    --radius-lg: 0;
    --radius-xl: 0;
}

body.theme-windows .enter-btn,
body.theme-windows .toggle-btn,
body.theme-windows .action-btn,
body.theme-windows .tool-btn,
body.theme-windows .disconnect-btn,
body.theme-windows .btn-save-profile,
body.theme-windows .btn-upload-avatar,
body.theme-windows .btn-clear-avatar,
body.theme-windows .btn-primary,
body.theme-windows .btn-secondary,
body.theme-windows .theme-toggle-btn {
    background: #dcdcdc;
    color: #111;
    border: 2px solid #7b7b7b;
    box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #888888;
    text-shadow: none;
}

body.theme-windows .enter-btn:hover,
body.theme-windows .toggle-btn:hover,
body.theme-windows .action-btn:hover,
body.theme-windows .tool-btn:hover,
body.theme-windows .disconnect-btn:hover,
body.theme-windows .btn-save-profile:hover,
body.theme-windows .btn-upload-avatar:hover,
body.theme-windows .btn-clear-avatar:hover,
body.theme-windows .btn-primary:hover,
body.theme-windows .btn-secondary:hover,
body.theme-windows .theme-toggle-btn:hover {
    background: #efefef;
    box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #7a7a7a;
    transform: none;
}

body.theme-windows .toggle-btn.active,
body.theme-windows .tool-btn.active,
body.theme-windows .theme-toggle-btn.is-active {
    background: #bfbfbf;
    border-color: #4f4f4f;
    box-shadow: inset 1px 1px 0 #9e9e9e, inset -1px -1px 0 #ffffff;
    color: #111;
}

body.theme-windows .profile-input,
body.theme-windows .profile-select,
body.theme-windows .message-input,
body.theme-windows .search-input {
    background: #ffffff;
    color: #111;
    border: 2px solid #7b7b7b;
}

body.theme-windows .modal-content,
body.theme-windows .profile-avatar-section,
body.theme-windows .ai-toggle-field,
body.theme-windows .theme-toggle {
    border: 2px solid #7b7b7b;
    box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #a0a0a0;
}

body.theme-windows .message-body {
    background: #f7f7f7;
    color: #111;
    border: 2px solid #7b7b7b;
    border-radius: 0;
    box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #b0b0b0;
}

body.theme-windows .message.own .message-body {
    background: #cfe8ff;
    color: #0f1f2f;
    border-color: #5a7aa5;
    box-shadow: inset 1px 1px 0 #e8f4ff, inset -1px -1px 0 #6b8ab0;
}

body.theme-windows .message-quote {
    background: #ffffff;
    border-left: 3px solid #5a7aa5;
    color: #1a1a1a;
}

body.theme-windows .message-quote-user {
    color: #004e7a;
}

body.theme-windows .message-quote-text {
    color: #2f2f2f;
}

body.theme-win96 .enter-btn,
body.theme-win96 .toggle-btn,
body.theme-win96 .action-btn,
body.theme-win96 .tool-btn,
body.theme-win96 .disconnect-btn,
body.theme-win96 .btn-save-profile,
body.theme-win96 .btn-upload-avatar,
body.theme-win96 .btn-clear-avatar,
body.theme-win96 .btn-primary,
body.theme-win96 .btn-secondary,
body.theme-win96 .theme-toggle-btn {
    background: #2a2a2a;
    color: #f0f0f0;
    border: 2px solid #1a1a1a;
    box-shadow: inset 1px 1px 0 #444444, inset -1px -1px 0 #0a0a0a;
    text-shadow: none;
}

body.theme-win96 .enter-btn:hover,
body.theme-win96 .toggle-btn:hover,
body.theme-win96 .action-btn:hover,
body.theme-win96 .tool-btn:hover,
body.theme-win96 .disconnect-btn:hover,
body.theme-win96 .btn-save-profile:hover,
body.theme-win96 .btn-upload-avatar:hover,
body.theme-win96 .btn-clear-avatar:hover,
body.theme-win96 .btn-primary:hover,
body.theme-win96 .btn-secondary:hover,
body.theme-win96 .theme-toggle-btn:hover {
    background: #3a3a3a;
    box-shadow: inset 1px 1px 0 #555555, inset -1px -1px 0 #000000;
    transform: none;
}

body.theme-win96 .toggle-btn.active,
body.theme-win96 .tool-btn.active,
body.theme-win96 .theme-toggle-btn.is-active {
    background: #1a1a1a;
    border-color: #0a0a0a;
    box-shadow: inset 1px 1px 0 #1a1a1a, inset -1px -1px 0 #444444;
    color: #f0f0f0;
}

body.theme-win96 .profile-input,
body.theme-win96 .profile-select,
body.theme-win96 .message-input,
body.theme-win96 .search-input {
    background: #1a1a1a;
    color: #f0f0f0;
    border: 2px solid #2a2a2a;
}

body.theme-win96 .modal-content,
body.theme-win96 .profile-avatar-section,
body.theme-win96 .ai-toggle-field,
body.theme-win96 .theme-toggle {
    border: 2px solid #2a2a2a;
    box-shadow: inset 1px 1px 0 #444444, inset -1px -1px 0 #0a0a0a;
}

body.theme-win96 .message-body {
    background: #1a1a1a;
    color: #f0f0f0;
    border: 2px solid #2a2a2a;
    border-radius: 0;
    box-shadow: inset 1px 1px 0 #333333, inset -1px -1px 0 #0a0a0a;
}

body.theme-win96 .message.own .message-body {
    background: #252535;
    color: #f0f0f0;
    border-color: #3a3a4a;
    box-shadow: inset 1px 1px 0 #444454, inset -1px -1px 0 #0a0a0f;
}

body.theme-win96 .message-quote {
    background: #1a1a1a;
    border-left: 3px solid #3a3a4a;
    color: #f0f0f0;
}

body.theme-win96 .message-quote-user {
    color: #666677;
}

body.theme-win96 .message-quote-text {
    color: #c0c0c0;
}

body.theme-fantasy .enter-btn,
body.theme-fantasy .toggle-btn,
body.theme-fantasy .action-btn,
body.theme-fantasy .tool-btn,
body.theme-fantasy .disconnect-btn,
body.theme-fantasy .btn-save-profile,
body.theme-fantasy .btn-upload-avatar,
body.theme-fantasy .btn-clear-avatar,
body.theme-fantasy .btn-primary,
body.theme-fantasy .btn-secondary,
body.theme-fantasy .theme-toggle-btn {
    background: linear-gradient(135deg, #3a1c5c, #7a4cc2);
    color: #fdf4ff;
    border: 1px solid rgba(255, 214, 158, 0.7);
    box-shadow: 0 0 14px rgba(255, 184, 108, 0.35);
    text-shadow: 0 0 6px rgba(255, 214, 158, 0.6);
}

body.theme-fantasy .enter-btn:hover,
body.theme-fantasy .toggle-btn:hover,
body.theme-fantasy .action-btn:hover,
body.theme-fantasy .tool-btn:hover,
body.theme-fantasy .disconnect-btn:hover,
body.theme-fantasy .btn-save-profile:hover,
body.theme-fantasy .btn-upload-avatar:hover,
body.theme-fantasy .btn-clear-avatar:hover,
body.theme-fantasy .btn-primary:hover,
body.theme-fantasy .btn-secondary:hover,
body.theme-fantasy .theme-toggle-btn:hover {
    background: linear-gradient(135deg, #4a2380, #9b5fe0);
    box-shadow: 0 0 18px rgba(255, 184, 108, 0.45);
    transform: translateY(-1px);
}

body.theme-fantasy .toggle-btn.active,
body.theme-fantasy .tool-btn.active,
body.theme-fantasy .theme-toggle-btn.is-active {
    background: linear-gradient(135deg, #ffb86c, #e174e3);
    color: #2a123c;
    border-color: rgba(255, 214, 158, 0.9);
    box-shadow: 0 0 18px rgba(255, 184, 108, 0.6);
}

body.theme-fantasy .profile-input,
body.theme-fantasy .profile-select,
body.theme-fantasy .message-input,
body.theme-fantasy .search-input {
    background: rgba(23, 12, 41, 0.7);
    color: #f5f0ff;
    border: 1px solid rgba(255, 214, 158, 0.4);
    box-shadow: inset 0 0 8px rgba(90, 45, 138, 0.5);
}

body.theme-fantasy .modal-content,
body.theme-fantasy .profile-avatar-section,
body.theme-fantasy .ai-toggle-field,
body.theme-fantasy .theme-toggle {
    border: 1px solid rgba(255, 214, 158, 0.5);
    box-shadow: 0 10px 30px rgba(12, 6, 24, 0.65);
}

body.theme-console .enter-btn,
body.theme-console .toggle-btn,
body.theme-console .action-btn,
body.theme-console .tool-btn,
body.theme-console .disconnect-btn,
body.theme-console .btn-save-profile,
body.theme-console .btn-upload-avatar,
body.theme-console .btn-clear-avatar,
body.theme-console .btn-primary,
body.theme-console .btn-secondary,
body.theme-console .theme-toggle-btn {
    background: #000000;
    color: #00ff00;
    border: 1px solid #00ff00;
    box-shadow: none;
    text-shadow: none;
    font-family: var(--font-primary);
}

body.theme-console .enter-btn:hover,
body.theme-console .toggle-btn:hover,
body.theme-console .action-btn:hover,
body.theme-console .tool-btn:hover,
body.theme-console .disconnect-btn:hover,
body.theme-console .btn-save-profile:hover,
body.theme-console .btn-upload-avatar:hover,
body.theme-console .btn-clear-avatar:hover,
body.theme-console .btn-primary:hover,
body.theme-console .btn-secondary:hover,
body.theme-console .theme-toggle-btn:hover {
    background: #00ff00;
    color: #000000;
    border-color: #00ff00;
}

body.theme-console .toggle-btn.active,
body.theme-console .tool-btn.active,
body.theme-console .theme-toggle-btn.is-active {
    background: #00ff00;
    color: #000000;
    border-color: #00ff00;
}

body.theme-console .profile-input,
body.theme-console .profile-select,
body.theme-console .message-input,
body.theme-console .search-input {
    background: #000000;
    color: #00ff00;
    border: 1px solid #00ff00;
    box-shadow: none;
    font-family: var(--font-primary);
}

body.theme-console .profile-input::placeholder,
body.theme-console .message-input::placeholder,
body.theme-console .search-input::placeholder {
    color: #00aa00;
}

body.theme-console .modal-content,
body.theme-console .profile-avatar-section,
body.theme-console .ai-toggle-field,
body.theme-console .theme-toggle {
    border: 3px double #00ff00;
    box-shadow: none;
    background: #000000;
}

body.theme-console .message-body {
    background: #000000;
    color: #ffffff;
    border: 1px solid #00ff00;
    border-radius: 0;
    box-shadow: none;
}

body.theme-console .message.own .message-body {
    background: #000000;
    color: #00ff00;
    border-color: #00ff00;
    box-shadow: none;
}

body.theme-console .message-quote {
    background: #000000;
    border-left: 3px solid #00ff00;
    color: #ffffff;
}

body.theme-console .message-quote-user {
    color: #00ff00;
}

body.theme-console .message-quote-text {
    color: #00aa00;
}

body.theme-console .evm-network-panel {
    background: #000000;
    border: 3px double #00ff00;
    box-shadow: none;
}

body.theme-console .evm-network-header {
    color: #00ff00;
    border-bottom: 1px solid #00ff00;
    background: #000000;
}

body.theme-console .evm-network-option {
    color: #ffffff;
    border-bottom: 1px solid #00aa00;
    background: #000000;
}

body.theme-console .evm-network-option:hover {
    background: #000000;
    color: #00ff00;
    border-left: 3px solid #00ff00;
}

body.theme-console .evm-network-option.is-active {
    background: #000000;
    color: #00ff00;
    border-left: 3px solid #00ff00;
}

body.theme-console .evm-network-option .network-badge {
    background: #000000;
    color: #00ff00;
    border: 1px solid #00ff00;
}

body.theme-win96 .evm-network-panel {
    background: #1a1a1a;
    border: 2px solid #2a2a2a;
    box-shadow: inset 1px 1px 0 #444444, inset -1px -1px 0 #0a0a0a, 0 8px 16px rgba(0, 0, 0, 0.6);
    border-radius: 0;
}

body.theme-win96 .evm-network-header {
    color: #c0c0c0;
    background: #1a1a1a;
}

body.theme-win96 .evm-network-option {
    background: #252525;
    color: #e8e8e8;
    border: 1px solid #3a3a3a;
    border-radius: 0;
}

body.theme-win96 .evm-network-option:hover {
    border-color: #555566;
    background: #303040;
    box-shadow: inset 1px 1px 0 #444454, inset -1px -1px 0 #0a0a0f;
}

body.theme-win96 .evm-network-option.is-active {
    border-color: #555566;
    background: #303040;
    color: #f0f0f0;
    box-shadow: inset 1px 1px 0 #444454, inset -1px -1px 0 #0a0a0f;
}

body.theme-win96 .evm-network-option .network-badge {
    color: #b8b8b8;
}

body.theme-console #token-selection-screen {
    background: #000000;
}

body.theme-console .token-item {
    background: #000000;
    border: 1px solid #00ff00;
    color: #ffffff;
    box-shadow: none;
}

body.theme-console .token-item:hover {
    background: #000000;
    color: #00ff00;
    border-color: #00ff00;
}

body.theme-console .token-item h3 {
    color: #00ff00;
}

body.theme-console .token-item p {
    color: #00aa00;
}

body.theme-console .token-item .balance {
    color: #ffffff;
}

body.theme-console .token-item .token-address {
    color: #00aa00;
}

body.theme-console .token-symbol {
    background: #000000;
    color: #00ff00;
    border: 1px solid #00ff00;
}

body.theme-console .token-network {
    color: #00aa00;
}

body.theme-console .token-chain-badge {
    background: #000000;
    color: #00ff00;
    border: 1px solid #00ff00;
}

body.theme-console .search-input {
    background: #000000;
    color: #00ff00;
    border: 1px solid #00ff00;
}

body.theme-console .search-input::placeholder {
    color: #00aa00;
}

body.theme-console .search-input:focus {
    box-shadow: none;
    border-color: #00ff00;
    outline: none;
}

body.theme-console .clear-search-btn {
    background: #000000;
    color: #00ff00;
    border: 1px solid #00ff00;
}

body.theme-console .clear-search-btn:hover {
    background: #00ff00;
    color: #000000;
    box-shadow: none;
}

/* Additional Console theme styles for comprehensive coverage */
body.theme-console #app-container,
body.theme-console #main-screen,
body.theme-console #chat-screen,
body.theme-console #token-selection-screen,
body.theme-console .panel,
body.theme-console .container,
body.theme-console .section {
    background: #000000;
}

body.theme-console #chat-container {
    background: #000000;
    border: 3px double #00ff00;
}

body.theme-console #messages-container {
    background: #000000;
}

body.theme-console #user-list-panel {
    background: #000000;
    border-left: 3px double #00ff00;
}

body.theme-console .user-item {
    background: #000000;
    border-bottom: 1px solid #00aa00;
    color: #ffffff;
}

body.theme-console .user-item:hover {
    background: #000000;
    color: #00ff00;
}

body.theme-console .user-item.is-current-user {
    color: #00ff00;
}

body.theme-console .status-indicator {
    border: none;
}

body.theme-console .message-avatar {
    border: 1px solid #00ff00;
}

body.theme-console #input-container {
    background: #000000;
    border-top: 1px solid #00ff00;
}

body.theme-console .profile-modal {
    background: #000000;
}

body.theme-console .avatar-preview {
    border: 3px double #00ff00;
    background: #000000;
}

body.theme-console .terms-modal-content {
    background: #000000;
    border: 3px double #00ff00;
}

body.theme-console .terms-text {
    background: #000000;
    color: #ffffff;
}

body.theme-console .terms-footer {
    background: #000000;
    border-top: 1px solid #00ff00;
}

body.theme-console .checkbox-label {
    color: #ffffff;
}

body.theme-console .checkbox-input:checked + .checkbox-label::before {
    background: #00ff00;
    border-color: #00ff00;
    color: #000000;
}

body.theme-console .ai-model-select,
body.theme-console .style-select {
    background: #000000;
    color: #00ff00;
    border: 1px solid #00ff00;
}

body.theme-console select option {
    background: #000000;
    color: #00ff00;
}

body.theme-console .slider {
    background: #000000;
    border: 1px solid #00ff00;
}

body.theme-console .slider-thumb {
    background: #00ff00;
    border: 1px solid #00ff00;
}

body.theme-console .slider-track {
    background: #000000;
}

body.theme-console .slider-track-fill {
    background: #00ff00;
}

body.theme-console hr {
    border-color: #00ff00;
}

body.theme-console a {
    color: #00ff00;
}

body.theme-console a:hover {
    color: #00cc00;
}

body.theme-console ::-webkit-scrollbar {
    width: 12px;
    height: 12px;
    background: #000000;
}

body.theme-console ::-webkit-scrollbar-track {
    background: #000000;
    border: 1px solid #00ff00;
}

body.theme-console ::-webkit-scrollbar-thumb {
    background: #00ff00;
    border: 1px solid #00ff00;
}

body.theme-console ::-webkit-scrollbar-thumb:hover {
    background: #00cc00;
}

body.theme-console ::-webkit-scrollbar-corner {
    background: #000000;
}

/* EVM Network Dropdown - Theme Overrides */
body.theme-windows .evm-network-dropdown {
    border-radius: 0;
}

body.theme-windows .evm-network-panel {
    background: #e6e6e6;
    border: 2px solid #7b7b7b;
    box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #a0a0a0, 0 8px 16px rgba(0, 0, 0, 0.15);
    border-radius: 0;
}

body.theme-windows .evm-network-header {
    color: #2a2a2a;
}

body.theme-windows .evm-network-option {
    background: #f7f7f7;
    color: #1a1a1a;
    border: 1px solid #c0c0c0;
    border-radius: 0;
}

body.theme-windows .evm-network-option:hover {
    border-color: #005a9c;
    background: #cfe8ff;
    box-shadow: inset 1px 1px 0 #e8f4ff, inset -1px -1px 0 #6b8ab0;
}

body.theme-windows .evm-network-option.is-active {
    border-color: #005a9c;
    background: #cfe8ff;
    color: #0f1f2f;
    box-shadow: inset 1px 1px 0 #e8f4ff, inset -1px -1px 0 #6b8ab0;
}

body.theme-windows .evm-network-option .network-badge {
    color: #3d3d3d;
}

body.theme-fantasy .evm-network-panel {
    background: linear-gradient(160deg, rgba(35, 18, 56, 0.95), rgba(58, 28, 92, 0.95));
    border: 1px solid rgba(255, 214, 158, 0.5);
    box-shadow: 0 18px 40px rgba(10, 4, 24, 0.65), inset 0 1px 0 rgba(255, 214, 158, 0.2);
}

body.theme-fantasy .evm-network-header {
    color: rgba(255, 214, 158, 0.8);
}

body.theme-fantasy .evm-network-option {
    background: rgba(90, 45, 138, 0.3);
    color: #f5f0ff;
    border: 1px solid rgba(255, 214, 158, 0.3);
}

body.theme-fantasy .evm-network-option:hover {
    border-color: rgba(255, 184, 108, 0.8);
    background: rgba(122, 76, 194, 0.4);
    box-shadow: 0 10px 20px rgba(255, 184, 108, 0.25), inset 0 0 8px rgba(255, 184, 108, 0.1);
}

body.theme-fantasy .evm-network-option.is-active {
    border-color: rgba(255, 184, 108, 0.9);
    background: linear-gradient(135deg, rgba(255, 184, 108, 0.3), rgba(225, 116, 227, 0.2));
    box-shadow: inset 0 0 0 1px rgba(255, 214, 158, 0.4), 0 0 12px rgba(255, 184, 108, 0.3);
}

body.theme-fantasy .evm-network-option .network-badge {
    color: rgba(255, 214, 158, 0.7);
}

/* Token Selection Screen - Theme Overrides */
body.theme-windows #token-selection-screen {
    background:
        radial-gradient(1000px 600px at 15% 10%, rgba(0, 58, 107, 0.08), transparent 55%),
        radial-gradient(900px 500px at 85% 80%, rgba(0, 90, 156, 0.08), transparent 55%),
        linear-gradient(180deg, #c0c0c0 0%, #d6d6d6 100%);
}

body.theme-windows .token-item {
    background: #f7f7f7;
    border: 1px solid #c0c0c0;
    color: #1a1a1a;
    box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #a0a0a0;
    border-radius: 0;
}

body.theme-windows .token-item:hover {
    border-color: #005a9c;
    background: #cfe8ff;
    box-shadow: inset 1px 1px 0 #e8f4ff, inset -1px -1px 0 #6b8ab0;
}

body.theme-windows .token-item h3 {
    color: #1a1a1a;
}

body.theme-windows .token-item p {
    color: #3d3d3d;
}

body.theme-windows .token-item .balance {
    color: #004e7a;
}

body.theme-windows .token-item .token-address {
    color: #5a5a5a;
}

body.theme-windows .token-symbol {
    background: rgba(0, 90, 156, 0.1);
    color: #004e7a;
    border: 1px solid rgba(0, 90, 156, 0.3);
}

body.theme-windows .search-input {
    background: #ffffff;
    border: 1px solid #c0c0c0;
    color: #1a1a1a;
    border-radius: 0;
}

body.theme-windows .search-input::placeholder {
    color: #5a5a5a;
}

body.theme-windows .search-input:focus {
    border-color: #005a9c;
    background: #cfe8ff;
    box-shadow: inset 1px 1px 0 #e8f4ff, inset -1px -1px 0 #6b8ab0;
}

body.theme-windows .clear-search-btn {
    color: #3d3d3d;
}

body.theme-windows .clear-search-btn:hover {
    color: #005a9c;
}

body.theme-fantasy #token-selection-screen {
    background:
        radial-gradient(1000px 600px at 15% 10%, rgba(255, 184, 108, 0.12), transparent 55%),
        radial-gradient(900px 500px at 85% 80%, rgba(122, 76, 194, 0.14), transparent 55%),
        linear-gradient(180deg, #110b1d 0%, #1c1330 100%);
}

body.theme-fantasy .token-item {
    background: linear-gradient(160deg, rgba(35, 18, 56, 0.8), rgba(58, 28, 92, 0.8));
    border: 1px solid rgba(255, 214, 158, 0.3);
}

body.theme-fantasy .token-item:hover {
    border-color: rgba(255, 184, 108, 0.8);
    box-shadow: 0 12px 26px rgba(255, 184, 108, 0.2), inset 0 0 8px rgba(255, 184, 108, 0.1);
}

body.theme-fantasy .token-symbol {
    background: rgba(255, 184, 108, 0.15);
    color: #ffd59e;
    border: 1px solid rgba(255, 184, 108, 0.4);
}

body.theme-fantasy .search-input {
    background: linear-gradient(135deg, rgba(35, 18, 56, 0.8), rgba(58, 28, 92, 0.8));
    border: 1px solid rgba(255, 214, 158, 0.3);
    color: #f5f0ff;
}

body.theme-fantasy .search-input::placeholder {
    color: #c7b9e6;
}

body.theme-fantasy .search-input:focus {
    border-color: rgba(255, 184, 108, 0.8);
    background: linear-gradient(135deg, rgba(45, 22, 70, 0.9), rgba(70, 35, 100, 0.9));
    box-shadow: 0 0 0 3px rgba(255, 184, 108, 0.2), 0 0 20px rgba(255, 184, 108, 0.15);
}

body.theme-fantasy .clear-search-btn {
    color: #c7b9e6;
}

body.theme-fantasy .clear-search-btn:hover {
    color: #ffd59e;
}

/* Token Network Badge - Theme Overrides */
body.theme-windows .token-network {
    background: rgba(0, 90, 156, 0.15);
    color: #004e7a;
    border: 1px solid rgba(0, 90, 156, 0.3);
    border-radius: 0;
}

body.theme-windows .token-chain-badge {
    background: rgba(0, 90, 156, 0.12);
    color: #004e7a;
    border: 1px solid rgba(0, 90, 156, 0.25);
    border-radius: 0;
}

body.theme-fantasy .token-network {
    background: rgba(255, 184, 108, 0.15);
    color: #e88f3f;
    border: 1px solid rgba(255, 184, 108, 0.4);
}

body.theme-fantasy .token-chain-badge {
    background: linear-gradient(135deg, rgba(255, 184, 108, 0.15), rgba(225, 116, 227, 0.15));
    color: #ffd59e;
    border: 1px solid rgba(255, 184, 108, 0.4);
}

/* WIN 96 THEME TOKEN SELECTION SCREEN */
body.theme-win96 #token-selection-screen {
    background:
        radial-gradient(1000px 600px at 15% 10%, rgba(68, 68, 85, 0.1), transparent 55%),
        radial-gradient(900px 500px at 85% 80%, rgba(80, 80, 100, 0.1), transparent 55%),
        linear-gradient(180deg, #0f0f0f 0%, #1a1a1a 100%);
}

body.theme-win96 .token-item {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    color: #e8e8e8;
    box-shadow: inset 1px 1px 0 #333333, inset -1px -1px 0 #0a0a0a;
    border-radius: 0;
}

body.theme-win96 .token-item:hover {
    border-color: #3a3a4a;
    background: #252535;
    box-shadow: inset 1px 1px 0 #444454, inset -1px -1px 0 #0a0a0f;
}

body.theme-win96 .token-item h3 {
    color: #f0f0f0;
}

body.theme-win96 .token-item p {
    color: #b8b8b8;
}

body.theme-win96 .token-item .balance {
    color: #666677;
}

body.theme-win96 .token-item .token-address {
    color: #888888;
}

body.theme-win96 .token-symbol {
    background: rgba(68, 68, 85, 0.2);
    color: #99aabb;
    border: 1px solid rgba(68, 68, 85, 0.4);
}

body.theme-win96 .search-input {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    color: #f0f0f0;
    border-radius: 0;
}

body.theme-win96 .search-input::placeholder {
    color: #888888;
}

body.theme-win96 .search-input:focus {
    border-color: #3a3a4a;
    background: #252535;
    box-shadow: inset 1px 1px 0 #333333, inset -1px -1px 0 #0a0a0a;
}

body.theme-win96 .clear-search-btn {
    color: #b8b8b8;
}

body.theme-win96 .clear-search-btn:hover {
    color: #d8d8d8;
}

/* Token Network Badge - Theme Overrides */
body.theme-win96 .token-network {
    background: rgba(68, 68, 85, 0.2);
    color: #99aabb;
    border: 1px solid rgba(68, 68, 85, 0.4);
    border-radius: 0;
}

body.theme-win96 .token-chain-badge {
    background: rgba(68, 68, 85, 0.2);
    color: #99aabb;
    border: 1px solid rgba(68, 68, 85, 0.4);
    border-radius: 0;
}

body.theme-console .token-network {
    background: rgba(0, 255, 0, 0.15);
    color: #00ff00;
    border: 1px solid rgba(0, 255, 0, 0.3);
}

body.theme-console .token-chain-badge {
    background: rgba(0, 255, 0, 0.15);
    color: #00ff00;
    border: 1px solid rgba(0, 255, 0, 0.3);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow: hidden;
    min-height: 100vh;
}

/* Default theme fonts and styling */
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) {
    --font-primary: "Fredoka", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: "Press Start 2P", monospace;
    --font-pixel: "Press Start 2P", monospace;
}

/* Default theme - Dark, Professional Background */
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) #login-screen {
    background:
        radial-gradient(900px 520px at 12% 0%, rgba(95, 37, 213, 0.25), transparent 55%),
        radial-gradient(900px 600px at 88% 10%, rgba(0, 255, 108, 0.18), transparent 55%),
        linear-gradient(180deg, #0f1419 0%, #1a1f2e 100%);
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) #token-selection-screen {
    background:
        radial-gradient(1200px 700px at 0% 0%, rgba(95, 37, 213, 0.2), transparent 55%),
        radial-gradient(900px 600px at 100% 20%, rgba(38, 215, 180, 0.22), transparent 55%),
        linear-gradient(180deg, #0f1419 0%, #1a1f2e 100%);
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .chat-panel {
    background: #060809;
    position: relative;
}

@keyframes chatBgShift {
    0%, 100% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 100% 100%;
    }
}

/* Default theme - Cards and Surfaces */
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .messages-container {
    margin: var(--spacing-md);
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .chat-input-area {
    background: linear-gradient(160deg, rgba(26, 31, 46, 0.9), rgba(36, 45, 63, 0.8));
    border-top: 2px solid rgba(95, 37, 213, 0.25);
    box-shadow:
        0 -8px 24px rgba(95, 37, 213, 0.15),
        inset 0 2px 12px rgba(0, 255, 197, 0.05);
    backdrop-filter: blur(8px);
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .message-body {
    background: linear-gradient(160deg, rgba(42, 53, 72, 0.95), rgba(36, 45, 63, 0.95));
    border: 1px solid rgba(0, 255, 197, 0.6);
    color: var(--text-primary);
    transition: all var(--transition-normal);
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .message:hover .message-body {
    border-color: rgba(0, 255, 197, 0.8);
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .message.own .message-body {
    background: linear-gradient(135deg, rgba(95, 37, 213, 0.5), rgba(0, 255, 108, 0.25));
    border: 1px solid rgba(0, 255, 197, 0.6);
    color: #ffffff;
}

/* Default theme - Modal and Form Elements */
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .modal-content,
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .profile-modal-content,
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .terms-modal-content,
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .login-methods-card {
    background: linear-gradient(160deg, rgba(26, 31, 46, 0.95), rgba(36, 45, 63, 0.95));
    border: 1px solid rgba(95, 37, 213, 0.25);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(95, 37, 213, 0.1);
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .profile-input,
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .profile-select,
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .search-input,
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .login-network-select select {
    background: rgba(42, 53, 72, 0.6);
    border: 1px solid rgba(95, 37, 213, 0.25);
    color: var(--text-primary);
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .profile-input:focus,
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .profile-select:focus,
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .search-input:focus,
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .login-network-select select:focus {
    border-color: rgba(0, 255, 197, 0.6);
    background: rgba(42, 53, 72, 0.8);
    box-shadow: 0 0 16px rgba(0, 255, 197, 0.15);
}

/* Default theme - Input Wrapper for Chat */
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .input-wrapper {
    background: rgba(42, 53, 72, 0.7);
    border: 2px solid rgba(95, 37, 213, 0.25);
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.3);
    transition: all var(--transition-normal);
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .input-wrapper:focus-within {
    border-color: rgba(0, 255, 197, 0.6);
    background: rgba(42, 53, 72, 0.9);
    box-shadow:
        inset 0 0 12px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(0, 255, 197, 0.2),
        0 0 40px rgba(95, 37, 213, 0.15);
}

/* Default theme - Token Selection */
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .token-item {
    background: linear-gradient(160deg, rgba(42, 53, 72, 0.8), rgba(36, 45, 63, 0.8));
    border: 1px solid rgba(95, 37, 213, 0.25);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), inset 0 0 12px rgba(95, 37, 213, 0.08);
    transition: all var(--transition-normal);
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .token-item:hover {
    border-color: rgba(0, 255, 197, 0.45);
    background: linear-gradient(160deg, rgba(50, 63, 85, 0.95), rgba(42, 53, 72, 0.95));
    box-shadow: 0 12px 32px rgba(95, 37, 213, 0.25), inset 0 0 16px rgba(0, 255, 197, 0.1);
    transform: translateY(-2px);
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .tokens-grid {
    background: rgba(26, 31, 46, 0.5);
    border: 1px solid rgba(95, 37, 213, 0.2);
    box-shadow: inset 0 0 20px rgba(95, 37, 213, 0.08);
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .token-symbol {
    background: rgba(95, 37, 213, 0.2);
    color: #00ffc5;
    border: 1px solid rgba(0, 255, 197, 0.35);
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .token-item .balance {
    color: #00ffc5;
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .token-network,
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .token-chain-badge {
    background: rgba(0, 255, 108, 0.15);
    color: #00ff6c;
    border: 1px solid rgba(0, 255, 108, 0.35);
}

/* Default theme - Message elements styling */
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .message-sender {
    color: #00ffc5;
    font-weight: 600;
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .message-bot-badge {
    background: rgba(0, 255, 108, 0.25);
    color: #00ff6c;
    border: 1px solid rgba(0, 255, 108, 0.5);
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .message-time {
    color: rgba(0, 255, 197, 0.6);
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .message-quote {
    background: rgba(95, 37, 213, 0.2);
    border-left-color: #00ffc5;
    border-left-width: 4px;
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .message-quote-user {
    color: #00ff6c;
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .message-quote-text {
    color: var(--text-secondary);
}

/* Default theme - Buttons */
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .btn-save-profile,
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .btn-primary {
    background: linear-gradient(135deg, #5f25d5 0%, #00ff6c 100%);
    color: #ffffff;
    border: 1px solid rgba(0, 255, 197, 0.4);
    font-weight: 600;
    transition: all var(--transition-normal);
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .btn-save-profile:hover,
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .btn-primary:hover {
    transform: translateY(-2px);
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .btn-token-back {
    background: linear-gradient(135deg, #32136f, #00ff6c);
    color: #ffffff;
    border: 1px solid rgba(0, 255, 197, 0.4);
    transition: all var(--transition-normal);
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .btn-token-back:hover {
    transform: translateY(-2px);
}

/* Default theme - Toggle & Action Buttons */
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .toggle-btn,
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .action-btn,
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .tool-btn {
    background: rgba(95, 37, 213, 0.1);
    border: 1px solid rgba(95, 37, 213, 0.25);
    color: var(--text-secondary);
    transition: all var(--transition-normal);
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .toggle-btn:hover,
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .action-btn:hover,
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .tool-btn:hover {
    background: rgba(95, 37, 213, 0.2);
    border-color: rgba(0, 255, 197, 0.4);
    color: #00ffc5;
    transform: translateY(-1px);
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .toggle-btn.active,
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .tool-btn.active,
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .theme-toggle-btn.is-active {
    background: linear-gradient(135deg, rgba(95, 37, 213, 0.35), rgba(0, 255, 108, 0.15));
    border-color: rgba(0, 255, 197, 0.6);
    color: #ffffff;
    box-shadow:
        0 8px 24px rgba(95, 37, 213, 0.35),
        inset 0 0 12px rgba(0, 255, 197, 0.12);
}

/* Default theme - App Cards & Components */
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .bas-app-card {
    background: linear-gradient(160deg, rgba(42, 53, 72, 0.85), rgba(36, 45, 63, 0.85));
    border: 1px solid rgba(95, 37, 213, 0.25);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4), inset 0 0 12px rgba(95, 37, 213, 0.08);
    transition: all var(--transition-normal);
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .bas-app-card:hover {
    border-color: rgba(0, 255, 197, 0.35);
    box-shadow: 0 14px 36px rgba(95, 37, 213, 0.25), inset 0 0 16px rgba(0, 255, 197, 0.08);
    transform: translateY(-4px);
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .bas-app-icon {
    background: linear-gradient(135deg, rgba(95, 37, 213, 0.25), rgba(0, 255, 108, 0.15));
    color: #00ffc5;
    border: 1px solid rgba(0, 255, 197, 0.35);
    box-shadow: inset 0 0 16px rgba(95, 37, 213, 0.15), 0 6px 16px rgba(0, 0, 0, 0.3);
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .bas-app-icon svg {
    filter: drop-shadow(0 2px 6px rgba(0, 255, 197, 0.3));
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .discovery-progress,
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .token-dropdown-menu,
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .mention-popup,
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .no-tokens-alert,
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .error-alert {
    background: linear-gradient(160deg, rgba(26, 31, 46, 0.95), rgba(36, 45, 63, 0.95));
    border: 1px solid rgba(95, 37, 213, 0.25);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

/* Default theme - Header & Sidebar improvements */
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .app-header {
    background: linear-gradient(160deg, rgba(95, 37, 213, 0.15), rgba(0, 255, 108, 0.08));
    border-bottom: 2px solid rgba(0, 255, 197, 0.2);
    box-shadow:
        0 8px 32px rgba(95, 37, 213, 0.2),
        inset 0 1px 0 rgba(0, 255, 197, 0.15),
        inset 0 -1px 0 rgba(95, 37, 213, 0.1);
    backdrop-filter: blur(8px);
    position: relative;
    z-index: 10;
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .sidebar {
    background: linear-gradient(180deg, rgba(95, 37, 213, 0.12), rgba(0, 255, 108, 0.06));
    border-right: 2px solid rgba(0, 255, 197, 0.2);
    box-shadow: inset 0 0 30px rgba(95, 37, 213, 0.1);
    backdrop-filter: blur(8px);
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .sidebar-section:not(.connection-status) {
    background: rgba(95, 37, 213, 0.08);
    border-radius: var(--radius-lg);
    margin: var(--spacing-sm);
    padding: var(--spacing-md);
    border: 1px solid rgba(0, 255, 197, 0.15);
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .sidebar-title {
    color: #00ffc5;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .sidebar-title svg {
    color: #00ff6c;
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .peer-item {
    background: linear-gradient(135deg, rgba(95, 37, 213, 0.15), rgba(0, 255, 108, 0.08));
    border: 1px solid rgba(0, 255, 197, 0.6);
    color: var(--text-primary);
    transition: all var(--transition-normal);
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .peer-item:hover {
    background: linear-gradient(135deg, rgba(95, 37, 213, 0.3), rgba(0, 255, 108, 0.15));
    border-color: rgba(0, 255, 197, 0.8);
    transform: translateX(4px);
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .peer-item.self {
    background: linear-gradient(135deg, rgba(95, 37, 213, 0.3), rgba(0, 255, 108, 0.2));
    border: 1px solid rgba(0, 255, 197, 0.6);
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .disconnect-btn:hover {
    background: rgba(95, 37, 213, 0.2);
    border-color: #00ff6c;
    color: #00ff6c;
}

/* Default theme - Peer Avatar Styling */
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .peer-avatar {
    background: linear-gradient(135deg, #5f25d5, #00ff6c);
}

/* Default theme - Room Label Styling */
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .room-label {
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.05em;
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .peer-count {
    color: #00ffc5;
    font-weight: 600;
}

/* Default theme - User Info */
body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .user-avatar {
    background: linear-gradient(135deg, #5f25d5, #00ff6c);
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .user-address {
    color: #00ffc5;
    font-weight: 600;
}

/* Utility Classes */
.hidden-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* App Container */
#app {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.screen {
    display: none;
    width: 100%;
    height: 100%;
}

.screen.active {
    display: flex;
}

/* ================================
   LOGIN SCREEN
   ================================ */
#login-screen {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background: var(--bg-primary);
}

/* THEME-SPECIFIC LOGIN SCREEN BACKGROUNDS */
body.theme-windows #login-screen {
    background: linear-gradient(135deg, #e8e8f0 0%, #d8d8e8 100%);
}

body.theme-fantasy #login-screen {
    background: linear-gradient(135deg, #1a0f3d 0%, #2d1b4e 100%);
}

body.theme-console #login-screen {
    background: #001100;
}

body.theme-win96 #login-screen {
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
}

.login-background {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.bg-pattern {
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 15% 30%, rgba(95, 37, 213, 0.35) 0%, transparent 55%),
        radial-gradient(circle at 80% 75%, rgba(38, 215, 180, 0.35) 0%, transparent 55%),
        radial-gradient(circle at 40% 0%, rgba(0, 255, 108, 0.22) 0%, transparent 55%);
    background-size: 200% 200%;
    animation: none;
}

/* WINDOWS 95 THEME BACKGROUND */
body.theme-windows .bg-pattern {
    background:
        linear-gradient(135deg, rgba(200, 210, 230, 0.5) 0%, transparent 40%),
        radial-gradient(ellipse at 70% 30%, rgba(240, 230, 200, 0.3) 0%, transparent 45%),
        radial-gradient(circle at 30% 70%, rgba(210, 200, 240, 0.25) 0%, transparent 40%),
        linear-gradient(225deg, rgba(220, 220, 255, 0.2) 0%, transparent 50%);
    animation: subtleWave 20s ease-in-out infinite;
}

/* FANTASY THEME BACKGROUND */
body.theme-fantasy .bg-pattern {
    background:
        radial-gradient(circle at 15% 40%, rgba(255, 215, 0, 0.3) 0%, transparent 45%),
        radial-gradient(circle at 85% 60%, rgba(186, 85, 211, 0.35) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(138, 43, 226, 0.2) 0%, transparent 60%),
        conic-gradient(from 0deg at 50% 50%, rgba(255, 215, 0, 0.15), rgba(186, 85, 211, 0.15), rgba(138, 43, 226, 0.15), rgba(255, 215, 0, 0.15));
    animation: magicalGlow 18s ease-in-out infinite;
}

/* CONSOLE THEME BACKGROUND */
body.theme-console .bg-pattern {
    background:
        linear-gradient(0deg,
            transparent 24%,
            rgba(0, 255, 0, 0.05) 25%,
            rgba(0, 255, 0, 0.05) 26%,
            transparent 27%,
            transparent 74%,
            rgba(0, 255, 0, 0.05) 75%,
            rgba(0, 255, 0, 0.05) 76%,
            transparent 77%,
            transparent
        ),
        radial-gradient(circle at 30% 40%, rgba(0, 255, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(0, 100, 0, 0.1) 0%, transparent 50%);
    animation: scanLines 8s linear infinite;
}

/* WIN 96 THEME BACKGROUND */
body.theme-win96 .bg-pattern {
    background:
        linear-gradient(135deg, rgba(68, 68, 85, 0.15) 0%, transparent 40%),
        radial-gradient(ellipse at 70% 30%, rgba(80, 80, 100, 0.1) 0%, transparent 45%),
        radial-gradient(circle at 30% 70%, rgba(60, 60, 80, 0.12) 0%, transparent 40%),
        linear-gradient(225deg, rgba(70, 70, 90, 0.1) 0%, transparent 50%);
    animation: subtleWave 20s ease-in-out infinite;
}

/* ANIMATIONS */
@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes subtleWave {
    0%, 100% {
        transform: translateX(0px) translateY(0px);
    }
    25% {
        transform: translateX(10px) translateY(-5px);
    }
    50% {
        transform: translateX(0px) translateY(-10px);
    }
    75% {
        transform: translateX(-10px) translateY(-5px);
    }
}

@keyframes magicalGlow {
    0%, 100% {
        filter: brightness(1) hue-rotate(0deg);
    }
    50% {
        filter: brightness(1.1) hue-rotate(10deg);
    }
}

@keyframes scanLines {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.8;
    }
}

.login-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 420px;
    padding: var(--spacing-2xl);
}

/* Logo Section */
.ark-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: var(--spacing-2xl);
}

.logo-icon {
    width: 256px;
    height: 256px;
    margin-bottom: var(--spacing-lg);
    animation: logoFloat 6s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.ark-symbol {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: none;
}

.app-title {
    font-family: var(--font-pixel);
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    color: #ffffff;
    text-align: center;
    margin-bottom: var(--spacing-sm);
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 1);
}

/* Login Content */
.login-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-methods {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 5, 5, 0.72);
    backdrop-filter: blur(6px);
    z-index: 3;
}

.login-methods-card {
    width: min(420px, 90vw);
    background: var(--bg-elevated);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    text-align: center;
    box-shadow: var(--shadow-strong);
}

.login-methods-card h2 {
    font-size: 1rem;
    margin-bottom: var(--spacing-sm);
}

.login-methods-card p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: var(--spacing-lg);
}

.login-methods-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}


.login-method-btn {
    padding: var(--spacing-sm) var(--spacing-lg);
    background: linear-gradient(135deg, var(--purple-deep), var(--rose-primary));
    color: #ffffff;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.login-method-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(5, 169, 156, 0.35);
}

.login-network-select {
    text-align: left;
    margin-bottom: var(--spacing-md);
}

.login-network-select label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
}

.login-network-select select {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.85rem;
    outline: none;
}

.login-back-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--spacing-xs) var(--spacing-md);
    cursor: pointer;
    transition: border-color var(--transition-fast), color var(--transition-fast);
}

.login-back-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.no-tokens-back-btn {
    margin-top: var(--spacing-md);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-md);
    margin-left: auto;
    margin-right: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-medium);
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: transform var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.no-tokens-back-btn:hover {
    transform: translateY(-1px);
    border-color: var(--rose-primary);
    color: var(--rose-primary);
}

.nickname-field {
    width: 100%;
    margin-bottom: var(--spacing-md);
}

.nickname-input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.875rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

.nickname-input:focus {
    border-color: var(--rose-primary);
}

.gate-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-xl);
}

.gate-icon {
    width: 24px;
    height: 24px;
    color: var(--rose-primary);
}

.gate-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Enter Button */
/* Network Selection */
.network-selection {
    display: flex;
    flex-direction: row;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-2xl);
    justify-content: center;
    align-items: center;
}

.evm-login-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.evm-network-dropdown {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.98);
    width: min(320px, 80vw);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal), transform var(--transition-normal);
    z-index: 1000;
}

.evm-network-dropdown.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.evm-network-panel {
    background: linear-gradient(160deg, rgba(20, 16, 30, 0.96), rgba(32, 22, 40, 0.96));
    border: 1px solid rgba(5, 169, 156, 0.45);
    border-radius: 14px;
    padding: 12px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
}

@media (max-width: 520px) {
    .evm-network-dropdown {
        width: min(320px, 90vw);
    }

    .evm-network-dropdown.is-open {
        transform: translate(-50%, -50%) scale(1);
    }

    .evm-network-panel {
        max-height: 70vh;
        overflow-y: auto;
    }
}

.evm-network-header {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.evm-network-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.evm-network-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.evm-network-option:hover {
    border-color: rgba(0, 255, 197, 0.7);
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(5, 169, 156, 0.25);
}

.evm-network-option.is-active {
    border-color: var(--rose-primary);
    box-shadow: inset 0 0 0 1px rgba(5, 169, 156, 0.4);
}

.evm-network-option .network-badge {
    font-size: 0.65rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.network-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    padding: 12px;
    border: 2px solid rgba(0, 255, 197, 0.35);
    border-radius: var(--radius-lg);
    background: linear-gradient(160deg, rgba(95, 37, 213, 0.15), rgba(0, 255, 108, 0.08));
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.network-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(95, 37, 213, 0.3), rgba(0, 255, 108, 0.2));
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: -1;
}

.network-btn:hover {
    border-color: #00ffc5;
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(95, 37, 213, 0.35), inset 0 0 16px rgba(0, 255, 197, 0.1);
}

.network-btn:hover::before {
    opacity: 1;
}

.network-btn:active {
    transform: translateY(-2px);
}

.network-icon {
    width: 60px;
    height: 60px;
    filter: brightness(1.15) saturate(1.1);
    transition: all var(--transition-normal);
}

.network-btn:hover .network-icon {
    filter: brightness(1.4) saturate(1.2) drop-shadow(0 0 12px rgba(0, 255, 197, 0.6));
    transform: scale(1.05);
}

.sol-btn .network-icon {
    width: 36px;
    height: 36px;
}

.enter-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-lg);
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    font-family: inherit;
    margin-bottom: var(--spacing-2xl);
}

.enter-arrow {
    width: 48px;
    height: 48px;
    color: #ffffff;
    animation: arrowBounce 2s ease-in-out infinite;
    transition: all var(--transition-normal);
}

@keyframes arrowBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.enter-label {
    font-family: var(--font-pixel);
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    color: #ffffff;
    text-align: center;
    margin: 0;
    text-shadow: 0 0 10px rgba(5, 169, 156, 0.5);
    transition: all var(--transition-normal);
}

.enter-btn:hover .enter-arrow {
    transform: scale(1.15) translateY(-4px);
    color: #00ffc5;
    filter: drop-shadow(0 0 12px rgba(0, 255, 197, 0.7)) drop-shadow(0 0 6px rgba(95, 37, 213, 0.5));
}

.enter-btn:hover .enter-label {
    text-shadow: 0 0 24px rgba(0, 255, 197, 0.9), 0 0 12px rgba(95, 37, 213, 0.6);
    color: #00ffc5;
}

.enter-btn:active {
    transform: scale(0.98);
}

.enter-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


/* Terms Agreement */
.terms-agreement {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: var(--spacing-lg) 0 var(--spacing-md) 0;
    padding: 0 var(--spacing-md);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.terms-checkbox-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    user-select: none;
    text-align: center;
}

.terms-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--rose-primary);
    flex-shrink: 0;
}

.terms-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.terms-link {
    color: var(--rose-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
    border-bottom: 1px solid transparent;
}

.terms-link:hover {
    color: var(--pink-light);
    border-bottom-color: var(--pink-light);
}

/* Login Status */
.login-status {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
}

.login-status.error {
    color: var(--pink-light);
}

.login-status.success {
    color: var(--purple-light);
}

.login-status.pending {
    color: var(--text-secondary);
}

.login-status.pending::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: var(--spacing-sm);
    border: 2px solid var(--purple-deep);
    border-top-color: var(--rose-primary);
    border-radius: 50%;
    animation: spinnerRotate 0.8s linear infinite;
}

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

.enter-btn:disabled {
    opacity: 1;
    cursor: not-allowed;
    display: none;
}

/* Login Footer */
.login-footer {
    margin-top: var(--spacing-lg);
    text-align: center;
}

.login-footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
}

.supported-wallets {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.divider {
    color: var(--border-medium);
}

/* ================================
   MAIN APPLICATION
   ================================ */
#main-app {
    flex-direction: column;
    background: var(--bg-primary);
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    height: 66px;
    flex-shrink: 0;
    overflow: visible;
}

.header-left {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
}

.logo-small {
    width: 46px;
    height: auto;
    margin-top: -16px;
    margin-bottom: -16px;
}

.ark-symbol-small {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: none;
}

.header-title {
    font-family: var(--font-pixel);
    font-size: 0.6rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    color: #ffffff;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 1);
    line-height: 1;
    display: flex;
    align-items: center;
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .app-header .header-title {
    color: var(--text-primary);
    text-shadow: none;
}

.header-center {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
    overflow: visible;
}

.room-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    overflow: visible;
}

.room-label {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

.peer-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    font-family: monospace;
    word-break: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        var(--purple-deep) 0%,
        var(--rose-primary) 50%,
        var(--pink-deep) 100%
    );
}

.user-address {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: monospace;
}

.disconnect-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.disconnect-btn svg {
    width: 14px;
    height: 14px;
}

.disconnect-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--pink-deep);
    color: var(--pink-light);
}

/* Main Layout */
.app-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 220px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-section {
    padding: var(--spacing-md);
}

.sidebar-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: var(--spacing-md);
}

.sidebar-title svg {
    width: 16px;
    height: 16px;
}

.peers-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.peer-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 0.813rem;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast);
    border: 1px solid transparent;
}

.peer-item.self {
    background: linear-gradient(135deg, var(--bg-tertiary), rgba(5, 169, 156, 0.1));
    border: 1px solid var(--rose-dark);
}

.peer-item:hover {
    background: var(--bg-elevated);
    border-color: var(--border-subtle);
}

.peer-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        var(--purple-deep),
        var(--rose-primary)
    );
}

.peer-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.peer-name {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    color: var(--text-secondary);
    font-family: monospace;
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.peer-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.peer-mute-icon {
    width: 12px;
    height: 12px;
    opacity: 0.65;
    flex-shrink: 0;
}

.peer-bot-badge {
    font-size: 0.55rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(5, 169, 156, 0.2);
    color: var(--rose-primary);
    border: 1px solid rgba(5, 169, 156, 0.45);
    flex-shrink: 0;
}

.peer-item.bot {
    border: 1px dashed rgba(5, 169, 156, 0.5);
}

.peer-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--status-online);
}

.connection-status {
    margin-top: auto;
    padding: var(--spacing-md);
    border-top: 1px solid var(--border-subtle);
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .connection-status {
    background: rgba(95, 37, 213, 0.08);
    border-top: 2px solid rgba(0, 255, 197, 0.15);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--status-pending);
    animation: statusPulse 2s ease-in-out infinite;
}

.status-dot.connected {
    background: var(--status-online);
    animation: none;
}

.status-dot.disconnected {
    background: var(--status-offline);
    animation: none;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}


body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .status-dot {
    width: 10px;
    height: 10px;
    border: 2px solid rgba(0, 255, 197, 0.5);
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .status-dot.connected {
    background: #00ff6c;
    border-color: #00ff6c;
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .status-dot.disconnected {
    background: #ff4444;
    border-color: #ff4444;
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .status-text {
    color: #00ffc5;
    font-weight: 600;
}

/* Content Area */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: linear-gradient(160deg, rgba(95, 37, 213, 0.12), rgba(0, 255, 108, 0.06));
    border-bottom: 2px solid rgba(0, 255, 197, 0.15);
    backdrop-filter: blur(8px);
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .view-toggle {
    background: linear-gradient(160deg, rgba(95, 37, 213, 0.15), rgba(0, 255, 108, 0.08));
    border-bottom: 2px solid rgba(0, 255, 197, 0.2);
    position: relative;
    z-index: 1;
}

.toggle-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-family: var(--font-primary);
    font-size: 0.813rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.toggle-btn svg {
    width: 16px;
    height: 16px;
}

.toggle-btn:hover {
    color: var(--text-secondary);
    background: var(--bg-tertiary);
}

.toggle-btn.active {
    color: var(--rose-primary);
    background: var(--bg-tertiary);
    border-color: var(--border-subtle);
}

.delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-left: auto;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.delete-btn svg {
    width: 20px;
    height: 20px;
}

.delete-btn:hover {
    color: var(--red-primary);
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--red-primary);
}

/* Panels */
.panel {
    display: none;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.panel.active {
    display: flex;
    flex-direction: column;
}

/* Split View */
.content-area.split-view {
    display: grid;
    grid-template-columns: 400px 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas:
        "toggle toggle"
        "chat canvas";
    min-height: 0;
    align-items: stretch;
    gap: 0;
}

.content-area.split-view .view-toggle {
    grid-area: toggle;
    width: 100%;
}

.content-area.split-view .chat-panel {
    grid-area: chat;
    border-right: 1px solid var(--border-subtle);
    min-height: 0;
}

.content-area.split-view .canvas-panel {
    grid-area: canvas;
    min-height: 0;
}

/* ================================
   CHAT PANEL
   ================================ */
.chat-panel {
    background: var(--bg-primary);
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.messages-container::-webkit-scrollbar {
    width: 8px;
}

.messages-container::-webkit-scrollbar-track {
    background: transparent;
}

.messages-container::-webkit-scrollbar-thumb {
    background: rgba(95, 37, 213, 0.3);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.messages-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 197, 0.5);
    background-clip: padding-box;
}

.message {
    display: flex;
    gap: var(--spacing-sm);
    max-width: 85%;
    cursor: pointer;
    transition: all var(--transition-normal);
    border-radius: var(--radius-md);
    padding: var(--spacing-xs);
    margin: -var(--spacing-xs);
    position: relative;
    animation: messageSlideIn 0.4s ease-out;
}

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

.message:hover {
    background: rgba(95, 37, 213, 0.1);
    transform: translateX(4px);
}

.message.own {
    flex-direction: row-reverse;
    align-self: flex-end;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        #5f25d5,
        #00ff6c
    );
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.message-avatar::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #5f25d5, #00ff6c, #00ffc5, #5f25d5);
    opacity: 0;
    z-index: -1;
}

@keyframes avatarGlow {
    0% { opacity: 0; transform: scale(1); }
    50% { opacity: 0.4; }
    100% { opacity: 0; transform: scale(1.3); }
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.message-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.message-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    flex-wrap: wrap;
}

.message-reaction-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
    opacity: 0;
    pointer-events: none;
}

.message-reaction-btn:hover {
    border-color: var(--rose-primary);
    color: var(--rose-light);
    transform: translateY(-1px);
}

.message:hover .message-reaction-btn {
    opacity: 1;
    pointer-events: auto;
}

.message-reaction-picker {
    position: absolute;
    top: -36px;
    left: 44px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-medium);
    border-radius: 14px;
    padding: 6px 8px;
    box-shadow: var(--shadow-soft);
    display: none;
    z-index: 2;
}

.message.own .message-reaction-picker {
    left: auto;
    right: 44px;
}

.message-reaction-picker.is-open {
    display: block;
}

.message-reaction-options {
    display: flex;
    align-items: center;
    gap: 6px;
}

.message-reaction-extra {
    display: none;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--border-subtle);
}

.message-reaction-extra.is-open {
    display: block;
}

.message-reaction-extra-list {
    display: grid;
    grid-template-columns: repeat(8, 24px);
    gap: 6px;
    max-height: 174px;
    overflow-y: auto;
    padding-right: 4px;
}

.message-reaction-extra-list::-webkit-scrollbar {
    width: 6px;
}

.message-reaction-extra-list::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.message-reaction-extra-list::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
}

.message-reaction-option,
.message-reaction-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.message-reaction-option:hover,
.message-reaction-more:hover {
    border-color: var(--rose-primary);
    transform: translateY(-1px);
}

.message-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.message-reaction-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(95, 37, 213, 0.3);
    background: rgba(95, 37, 213, 0.12);
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.message-reaction-chip:hover {
    border-color: rgba(0, 255, 197, 0.6);
    color: #00ffc5;
    background: rgba(0, 255, 197, 0.15);
    transform: translateY(-2px);
}

.message-reaction-chip.reacted {
    border-color: #00ff6c;
    color: #00ff6c;
    background: rgba(0, 255, 108, 0.2);
}

.message-sender {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
}

.message-bot-badge {
    font-size: 0.55rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(5, 169, 156, 0.2);
    color: var(--rose-primary);
    border: 1px solid rgba(5, 169, 156, 0.45);
}

.message-time {
    font-size: 0.688rem;
    color: var(--text-muted);
}

.message-delete {
    margin-left: auto;
    width: 18px;
    height: 18px;
    border: 1px solid transparent;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.message-delete:hover {
    background: var(--pink-deep);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.15);
}

.message-delete svg {
    width: 10px;
    height: 10px;
}

.message-body {
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border-top-left-radius: var(--radius-xs);
    font-size: 0.875rem;
    color: var(--text-primary);
    line-height: 1.5;
    word-break: break-word;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.message-gif {
    width: 220px;
    max-width: 100%;
    border-radius: var(--radius-lg);
    border: 2px solid rgba(0, 255, 197, 0.4);
    background: var(--bg-tertiary);
    box-shadow:
        0 8px 24px rgba(95, 37, 213, 0.2),
        inset 0 0 12px rgba(0, 255, 197, 0.1);
    transition: all var(--transition-normal);
}

.message-gif.is-clickable {
    cursor: pointer;
}

.message-quote {
    padding: var(--spacing-xs) var(--spacing-sm);
    border-left: 3px solid var(--border-medium);
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-xs);
}

.message-quote-user {
    font-size: 0.75rem;
    color: var(--rose-primary);
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.message-quote-text {
    font-size: 0.813rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.message.own .message-body {
    background: linear-gradient(
        135deg,
        var(--purple-deep),
        rgba(45, 122, 45, 0.8)
    );
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-xs);
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .message.own .message-body {
    color: var(--text-on-dark);
}

.message-body.file-body {
    padding: 0;
    background: transparent;
    border-radius: 0;
}

.message.own .message-body.file-body {
    background: transparent;
}

.message-file {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.message-file:hover {
    background: var(--bg-elevated);
    border-color: var(--rose-primary);
}

.message-file.image-file {
    flex-direction: column;
    align-items: stretch;
}

.file-preview {
    width: 240px;
    max-width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
}

.file-preview-image {
    display: block;
    width: 100%;
    height: auto;
}

.message-file.image-file .file-info {
    width: 100%;
}

.file-icon {
    width: 24px;
    height: 24px;
    color: var(--rose-primary);
}

.file-info {
    flex: 1;
}

.file-name {
    font-size: 0.813rem;
    color: var(--text-primary);
}

.file-size {
    font-size: 0.688rem;
    color: var(--text-muted);
}

.file-progress-container {
    width: 100%;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-top: var(--spacing-sm);
}

.file-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(
        90deg,
        var(--purple-deep),
        var(--rose-primary)
    );
    border-radius: var(--radius-sm);
    transition: width var(--transition-fast);
}

/* Quote Preview */
.quote-preview {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-tertiary);
    border-left: 3px solid var(--rose-primary);
    margin-bottom: var(--spacing-sm);
    border-radius: var(--radius-md);
}

.quote-preview-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    min-width: 0;
}

.quote-preview-header {
    font-size: 0.75rem;
    color: var(--rose-primary);
    font-weight: 600;
}

.quote-preview-user {
    display: block;
}

.quote-preview-text {
    font-size: 0.813rem;
    color: var(--text-secondary);
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.quote-preview-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.quote-preview-close:hover {
    background: var(--bg-elevated);
    border-color: var(--border-medium);
    color: var(--text-secondary);
}

.quote-preview-close svg {
    width: 14px;
    height: 14px;
}

/* Chat Input */
.chat-input-area {
    position: relative;
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    overflow: visible;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: var(--spacing-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--spacing-sm);
    transition: border-color var(--transition-fast);
    overflow: visible;
}

.input-wrapper:focus-within {
    border-color: var(--rose-primary);
}

.message-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.875rem;
    resize: none;
    padding: var(--spacing-sm);
    max-height: 120px;
    line-height: 1.5;
}

.message-input::placeholder {
    color: var(--text-muted);
}

.input-actions {
    display: flex;
    gap: var(--spacing-xs);
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(95, 37, 213, 0.1);
    border: 1px solid rgba(95, 37, 213, 0.2);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.action-btn:hover {
    background: rgba(95, 37, 213, 0.25);
    border-color: rgba(0, 255, 197, 0.4);
    color: var(--text-secondary);
}

.action-btn.send-btn {
    background: linear-gradient(135deg, rgba(95, 37, 213, 0.3), rgba(0, 255, 108, 0.15));
    border-color: rgba(0, 255, 197, 0.35);
    color: #00ffc5;
}

.action-btn.send-btn:hover {
    background: linear-gradient(135deg, #5f25d5, #00ff6c);
    border-color: #00ffc5;
    color: #ffffff;
    transform: translateY(-2px);
}

.action-btn.send-btn:active {
    transform: translateY(0);
}

.action-btn svg {
    width: 18px;
    height: 18px;
}

.gif-btn .gif-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.gif-btn:hover .gif-label {
    color: var(--rose-primary);
}

/* System Messages */
.system-message {
    display: flex;
    justify-content: center;
    padding: var(--spacing-md) var(--spacing-sm);
}

.system-message-content {
    font-size: 0.75rem;
    color: #00ffc5;
    background: rgba(95, 37, 213, 0.2);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 255, 197, 0.3);
}

/* ================================
   CANVAS PANEL
   ================================ */
.canvas-panel {
    background: var(--bg-primary);
}

.canvas-toolbar {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
}

.tool-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tool-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border-color: var(--border-medium);
}

.tool-btn.active {
    background: var(--purple-deep);
    border-color: var(--purple-medium);
    color: var(--text-primary);
}

.tool-btn svg {
    width: 18px;
    height: 18px;
}

.color-picker {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    background: var(--bg-tertiary);
    padding: 2px;
}

.color-picker::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.color-picker::-webkit-color-swatch {
    border-radius: var(--radius-sm);
    border: none;
}

.stroke-select {
    height: 36px;
    padding: 0 var(--spacing-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-size: 0.813rem;
    cursor: pointer;
    outline: none;
}

.stroke-select:focus {
    border-color: var(--rose-primary);
}

.canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, rgba(93, 45, 122, 0.03) 0%, transparent 70%);
    background-color: var(--bg-primary);
}

.canvas-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

#reasoning-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

/* Fabric.js canvas wrapper - ensure transparency and proper z-index */
.canvas-container .canvas-container {
    background: transparent !important;
    width: 100% !important;
    height: 100% !important;
}

.canvas-container .upper-canvas,
.canvas-container .lower-canvas {
    background: transparent !important;
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.canvas-container > div {
    z-index: 2;
}

/* ================================
   MODAL
   ================================ */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    width: 90%;
    max-width: 400px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-strong);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px var(--spacing-md);
    border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.modal-close svg {
    width: 16px;
    height: 16px;
}

.modal-body {
    padding: var(--spacing-md) var(--spacing-md);
}

.progress-container {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin: var(--spacing-md) 0;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(
        90deg,
        var(--purple-deep),
        var(--rose-primary)
    );
    border-radius: var(--radius-sm);
    transition: width var(--transition-fast);
}

.file-status {
    font-size: 0.813rem;
    color: var(--text-secondary);
    text-align: center;
}

/* ================================
   DELETE MESSAGES MODAL
   ================================ */
.delete-messages-modal-content {
    max-width: 400px;
}

.delete-messages-text {
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
    font-size: 0.938rem;
    line-height: 1.5;
}

.delete-messages-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
}

.btn-danger {
    background: var(--red-primary);
    color: white;
    border: none;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
}

/* ================================
   PROFILE MODAL
   ================================ */
.profile-modal-content {
    max-width: 420px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.profile-modal-content .modal-body {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-md);
    flex: 1;
}

.peer-modal-content {
    max-width: 420px;
    border: 1px solid var(--border-subtle);
}

.peer-modal-row {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border-subtle);
}

.peer-modal-row:last-child {
    border-bottom: none;
}

.peer-modal-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.peer-modal-value {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.peer-modal-address {
    font-family: monospace;
    font-size: 0.85rem;
    word-break: break-all;
}

.peer-modal-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
    flex-direction: column;
}

.peer-modal-actions .btn {
    width: 100%;
    padding: 10px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.peer-modal-actions .btn-mute {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.peer-modal-actions .btn-mute:hover {
    background: var(--bg-tertiary);
}

.peer-modal-actions .btn-mute.muted {
    background: var(--purple-deep);
    color: white;
    border-color: var(--purple-deep);
}

/* Avatar Preview Section */
.profile-avatar-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
}

.profile-avatar-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--purple-deep), var(--rose-primary));
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.profile-avatar-info span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.2;
}

.btn-clear-avatar {
    padding: 2px 6px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.65rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    width: fit-content;
}

.btn-clear-avatar:hover {
    background: var(--bg-elevated);
    border-color: var(--border-medium);
    color: var(--text-secondary);
}

.btn-upload-avatar {
    padding: 2px 6px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.65rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    width: fit-content;
}

.btn-upload-avatar:hover {
    background: var(--bg-elevated);
    border-color: var(--rose-primary);
    color: var(--text-secondary);
}

/* Profile Field */
.profile-field {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.profile-field-row {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: nowrap;
    align-items: flex-start;
}

.profile-field-row .profile-field {
    flex: 1 1 0;
    min-width: 0;
}

.profile-field-row #ai-temperature-field {
    flex: 0 0 220px;
}

@media (max-width: 520px) {
    .profile-field-row {
        flex-wrap: wrap;
    }

    .profile-field-row #ai-temperature-field {
        flex: 1 1 220px;
    }
}

.profile-field label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.profile-input {
    padding: 6px var(--spacing-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.8125rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

.profile-input:focus {
    border-color: var(--rose-primary);
}

/* Profile Note */
.profile-note {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin: -6px 0 -2px 0;
    line-height: 1.1;
    display: none;
}

/* Save Button */
.btn-save-profile {
    width: 100%;
    padding: 10px var(--spacing-md);
    background: linear-gradient(135deg, var(--purple-deep), var(--purple-medium));
    border: 1px solid var(--purple-light);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-top: auto;
}

.btn-save-profile:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(93, 45, 122, 0.4);
}

.btn-save-profile:active {
    transform: translateY(0);
}

/* AI Translation Settings */
.profile-section-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 8px 0;
}

.profile-section-divider::before,
.profile-section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

.profile-section-divider span {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.profile-select {
    padding: 6px var(--spacing-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.8125rem;
    outline: none;
    transition: border-color var(--transition-fast);
    width: 100%;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

.profile-select:focus {
    border-color: var(--rose-primary);
}

.profile-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 6px 8px;
}

.profile-hint {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: -2px;
    line-height: 1.1;
}

.temperature-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    flex-wrap: wrap;
}

.temperature-toggle-btn {
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.65rem;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    line-height: 1;
    letter-spacing: 0.02em;
}

.temperature-toggle-btn:hover {
    color: var(--text-primary);
}

.temperature-toggle-btn.is-active {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border-medium);
    box-shadow: var(--shadow-soft);
}

.theme-toggle-field label {
    margin-bottom: 2px;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.theme-toggle-btn {
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.65rem;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    line-height: 1;
    letter-spacing: 0.02em;
}

.theme-toggle-btn:hover {
    color: var(--text-primary);
}

.theme-toggle-btn.is-active {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border-medium);
    box-shadow: var(--shadow-soft);
}

/* AI Toggle Switch */
.ai-toggle-field {
    padding: 10px var(--spacing-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.ai-toggle-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    cursor: pointer;
    user-select: none;
}

.ai-toggle-checkbox {
    display: none;
}

.ai-toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--bg-elevated);
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.ai-toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.ai-toggle-checkbox:checked + .ai-toggle-slider {
    background: var(--purple-deep);
    border-color: var(--purple-medium);
}

.ai-toggle-checkbox:checked + .ai-toggle-slider::before {
    transform: translateX(20px);
    background: var(--rose-primary);
}

.ai-toggle-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.2;
}

.ai-toggle-checkbox:checked ~ .ai-toggle-text {
    color: var(--text-primary);
}

/* Hide AI fields when disabled */
#ai-language-field,
#ai-style-field,
#ai-temperature-field {
    transition: opacity var(--transition-fast), max-height var(--transition-fast);
}

#ai-language-field.hidden,
#ai-style-field.hidden,
#ai-temperature-field.hidden {
    opacity: 0.4;
    pointer-events: none;
}

/* Clickable Avatar in Header */
.user-avatar {
    cursor: pointer;
    transition: all var(--transition-fast);
}

.user-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(5, 169, 156, 0.4);
}

/* WalletConnect Modal Override */
#walletconnect-modal {
    position: fixed;
    z-index: 2000;
}

/* ================================
   BAS APPS MODAL
   ================================ */
.bas-apps-modal-content {
    max-width: 500px;
}

.bas-apps-content {
    text-align: center;
}

.bas-apps-greeting {
    font-family: var(--font-pixel);
    font-size: 1.2rem;
    color: var(--rose-primary);
    margin-bottom: var(--spacing-md);
    text-shadow: 0 0 10px rgba(5, 169, 156, 0.5);
}

.bas-apps-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
    line-height: 1.6;
}

.bas-apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--spacing-md);
}

.bas-app-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-lg);
    background: var(--bg-tertiary);
    border: 1px solid rgba(5, 169, 156, 0.4);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}

.bas-app-card:hover {
    border-color: var(--rose-primary);
    box-shadow: 0 12px 25px rgba(93, 45, 122, 0.25);
    transform: translateY(-2px);
}

.bas-app-card:active {
    transform: translateY(0);
}

.bas-app-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(93, 45, 122, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rose-primary);
    box-shadow: inset 0 0 12px rgba(5, 169, 156, 0.2);
}

.bas-app-icon svg {
    width: 26px;
    height: 26px;
}

.bas-app-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bas-app-name {
    font-weight: 600;
    font-size: 0.8rem;
}

.bas-app-tag {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.bas-app-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-lg);
    background: var(--bg-tertiary);
    border: 1px dashed var(--border-medium);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

.bas-app-placeholder svg {
    width: 32px;
    height: 32px;
    opacity: 0.5;
}

.bas-app-placeholder span {
    font-size: 0.75rem;
}

.bas-app-placeholder:hover {
    border-color: var(--rose-primary);
    background: var(--bg-elevated);
}

/* ================================
   BOT BUILDER MODAL
   ================================ */
.bot-builder-modal-content {
    max-width: 1000px;
    height: 560px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.bot-builder-body {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    flex: 1;
}

.bot-builder-container {
    display: flex;
    gap: 0;
    flex: 1;
    overflow: hidden;
}

.bot-builder-form-section {
    flex: 0 0 70%;
    width: 70%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: var(--spacing-md);
}

.bot-builder-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
}

.bot-form-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.bot-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bot-field.full {
    width: 100%;
}

.bot-field label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.bot-field input,
.bot-field select,
.bot-field textarea {
    background: var(--bg-primary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 6px 8px;
    font-size: 0.75rem;
    font-family: var(--font-body);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.bot-field textarea {
    height: 80px;
}

.bot-field input:focus,
.bot-field select:focus,
.bot-field textarea:focus {
    outline: none;
    border-color: var(--rose-primary);
    box-shadow: 0 0 0 2px rgba(5, 169, 156, 0.15);
}

.bot-field small {
    font-size: 0.6rem;
    color: var(--text-muted);
}

.bot-avatar-section {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
}

.bot-avatar-section.full {
    width: 100%;
    padding: 10px;
}

.bot-avatar-preview {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple-deep), var(--rose-primary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.6rem;
    overflow: hidden;
    flex-shrink: 0;
    margin: 5px;
}

.bot-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bot-avatar-controls {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.bot-avatar-actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.bot-form-status {
    font-size: 0.65rem;
    color: var(--text-muted);
    min-height: 0.9rem;
}

.bot-form-status.full {
    width: 100%;
}

.bot-builder-form .btn-primary {
    width: 100%;
}

.bot-builder-form .btn-primary.full {
    width: 100%;
}

.bot-form-status.error {
    color: #f28b82;
}

.bot-form-status.success {
    color: #7ff29f;
}

.bot-list-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    flex: 1;
    overflow-y: auto;
    min-width: 280px;
    padding-right: 4px;
    padding: var(--spacing-md);
}

/* Custom scrollbar for bot list */
.bot-list-section::-webkit-scrollbar {
    width: 6px;
}

.bot-list-section::-webkit-scrollbar-track {
    background: transparent;
}

.bot-list-section::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
    transition: background var(--transition-fast);
}

.bot-list-section::-webkit-scrollbar-thumb:hover {
    background: var(--rose-primary);
}

/* ================================
   INVITE AGENT MODAL
   ================================ */
.invite-agent-modal-content {
    max-width: 560px;
}

.invite-agent-body {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.invite-agent-panel {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}

.invite-agent-token,
.invite-agent-instruction {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 6px 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.invite-agent-token-label,
.invite-agent-instruction-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.invite-agent-token-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.invite-agent-token-address {
    font-size: 0.75rem;
    color: var(--text-secondary);
    word-break: break-all;
}

.invite-agent-instruction-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.invite-agent-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.invite-agent-field label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.invite-agent-field input {
    background: var(--bg-primary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 6px 8px;
    font-size: 0.8rem;
    font-family: var(--font-body);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.invite-agent-field input:focus {
    outline: none;
    border-color: var(--rose-primary);
    box-shadow: 0 0 0 2px rgba(5, 169, 156, 0.15);
}

.invite-agent-amount-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.invite-agent-amount-row input {
    flex: 1;
}

.invite-agent-amount-unit {
    padding: 6px 8px;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 0.75rem;
    white-space: nowrap;
}

.invite-agent-status {
    min-height: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.invite-agent-status.error {
    color: #f28b82;
}

.invite-agent-status.success {
    color: #7ff29f;
}

.invite-agent-skill {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 6px;
    background: var(--bg-tertiary);
    border: 1px dashed var(--border-medium);
    border-radius: var(--radius-lg);
}

.invite-agent-skill-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.invite-agent-skill-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.invite-agent-skill-command {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 1px 4px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
}

.invite-agent-skill-command code {
    font-size: 0.65rem;
    color: var(--text-primary);
    word-break: break-all;
    line-height: 1;
}

.invite-agent-copy-btn {
    width: 20px;
    height: 20px;
    padding: 0;
    min-height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    background: rgba(5, 169, 156, 0.18) !important;
    border: 1px solid rgba(5, 169, 156, 0.6) !important;
    color: #ffffff !important;
    cursor: pointer;
}

.invite-agent-copy-btn svg {
    width: 11px;
    height: 11px;
    stroke: currentColor;
    fill: none;
    display: block;
}

.bot-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    padding: 0 4px;
}

.bot-list-header h4 {
    font-size: 0.75rem;
    margin: 0;
    white-space: nowrap;
}

.bot-list-hint {
    font-size: 0.55rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: none;
}

.bot-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.bot-list-empty {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-align: center;
    padding: 4px;
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-md);
}

.bot-card {
    display: flex;
    gap: 6px;
    align-items: flex-start;
    padding: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
}

.bot-card-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--purple-deep), var(--rose-primary));
    flex-shrink: 0;
}

.bot-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bot-card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.bot-card-title {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 0;
}

.bot-card-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: help;
}

.bot-card-meta {
    font-size: 0.65rem;
    color: var(--text-secondary);
    line-height: 1.3;
    display: block;
}

.bot-card-delete {
    align-self: flex-start;
    padding: 4px 8px;
    font-size: 0.7rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.bot-card-delete:hover {
    color: var(--text-secondary);
    border-color: var(--rose-primary);
    background: var(--bg-elevated);
}

.bot-card-actions {
    display: flex;
    gap: 4px;
    align-self: flex-start;
    flex-wrap: wrap;
}

.bot-card-btn {
    padding: 2px 6px;
    font-size: 0.65rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.bot-card-btn:hover {
    color: var(--text-secondary);
    border-color: var(--rose-primary);
    background: var(--bg-elevated);
}

.bot-card-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: var(--border-subtle);
    color: var(--text-muted);
    background: transparent;
}

.bot-rent-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.bot-rent-hours {
    width: 70px;
    padding: 2px 6px;
    font-size: 0.65rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.bot-rent-unit {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: lowercase;
}

.bot-rent-price {
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.bot-rent-btn {
    background: linear-gradient(135deg, rgba(240, 109, 84, 0.22), rgba(255, 198, 110, 0.22));
    border-color: rgba(240, 109, 84, 0.6);
    color: var(--text-primary);
    font-weight: 600;
}

.bot-rent-btn:hover {
    border-color: rgba(240, 109, 84, 0.9);
    background: linear-gradient(135deg, rgba(240, 109, 84, 0.35), rgba(255, 198, 110, 0.35));
}

/* ================================
   BOT BUILDER MODAL - MOBILE
   ================================ */
@media (max-width: 768px) {
    .bot-builder-modal-content {
        max-width: 95%;
        height: auto;
        max-height: 90vh;
        display: flex;
        flex-direction: column;
    }

    .bot-builder-container {
        flex-direction: column;
        gap: 0;
    }

    .bot-builder-form-section {
        flex: 0 0 auto;
        width: 100%;
        max-height: 50vh;
        padding: var(--spacing-md);
    }

    .bot-builder-form {
        max-height: 45vh;
    }

    .bot-list-section {
        flex: 1;
        min-width: 100%;
        width: 100%;
        max-height: 35vh;
        border-top: 1px solid var(--border-subtle);
        border-left: none;
        padding: var(--spacing-md);
    }

    .bot-form-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .bot-field.full {
        grid-column: 1 / -1;
    }

    .bot-avatar-section.full {
        grid-column: 1 / -1;
    }

    .bot-form-status.full {
        grid-column: 1 / -1;
    }

    .bot-builder-form .btn-primary {
        grid-column: 1 / -1;
    }

    .bot-field textarea {
        height: 60px;
    }
}

@media (max-width: 480px) {
    .bot-builder-modal-content {
        max-width: 98%;
    }

    .bot-form-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .bot-field label {
        font-size: 0.6rem;
    }

    .bot-field input,
    .bot-field select,
    .bot-field textarea {
        font-size: 0.7rem;
        padding: 6px;
    }

    .bot-field textarea {
        height: 50px;
    }

    .bot-avatar-section.full {
        flex-direction: column;
        align-items: flex-start;
    }

    .bot-avatar-preview {
        width: 50px;
        height: 50px;
    }

    .bot-list-section {
        max-height: 30vh;
    }

    .bot-card {
        flex-wrap: wrap;
    }

    .bot-card-actions {
        width: 100%;
        justify-content: space-between;
    }
}

/* ================================
   GANJA FARMER MODAL
   ================================ */
/* ================================
   TERMS OF USE MODAL
   ================================ */
.terms-modal-content {
    max-width: 600px;
    max-height: 85vh;
}

.terms-modal-content .modal-header {
    justify-content: flex-end;
    border-bottom: none;
}

.modal-footer {
    padding: 6px var(--spacing-md);
    border-top: 1px solid var(--border-subtle);
}

.terms-modal-footer {
    height: 6px;
    padding: 6px 0;
}

.terms-modal-body {
    max-height: 70vh;
    overflow-y: auto;
    padding: var(--spacing-lg);
}

.terms-title-block {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.meshroom-main-title {
    font-family: var(--font-pixel);
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: #ffffff;
    margin: 0 0 var(--spacing-sm) 0;
}

.terms-subtitle {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--rose-primary);
    margin: 0;
}

.terms-content h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--rose-primary);
    margin-bottom: var(--spacing-md);
    text-align: center;
}

.terms-content h5 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
}

.terms-content p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

.terms-content ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: var(--spacing-md);
}

.terms-content ul li {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    padding-left: var(--spacing-lg);
    position: relative;
    margin-bottom: var(--spacing-sm);
}

.terms-content ul li::before {
    content: 'вЂў';
    position: absolute;
    left: var(--spacing-sm);
    color: var(--rose-primary);
}

.terms-footer {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-subtle);
    font-weight: 600;
    color: var(--text-primary) !important;
    text-align: center;
}

/* MESHROOM title styling */
.meshroom-title {
    font-family: var(--font-pixel);
    letter-spacing: 0.1em;
}

/* Scrollbar styling for terms modal */
.terms-modal-body::-webkit-scrollbar {
    width: 4px;
}

.terms-modal-body::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.terms-modal-body::-webkit-scrollbar-thumb {
    background: rgba(5, 169, 156, 0.4);
    border-radius: var(--radius-sm);
}

.terms-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--rose-primary);
}

/* ================================
   TODO LIST CANVAS OBJECT
   ================================ */
.canvas-todo-list {
    min-width: 200px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
}

.canvas-todo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: var(--spacing-sm);
}

.canvas-todo-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--rose-primary);
}

.canvas-todo-items {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.canvas-todo-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.canvas-todo-item:hover {
    background: var(--bg-elevated);
}

.canvas-todo-item.completed {
    background: rgba(93, 45, 122, 0.2);
}

.canvas-todo-item.completed .canvas-todo-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.canvas-todo-checkbox {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-medium);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.canvas-todo-item.completed .canvas-todo-checkbox {
    background: var(--purple-medium);
    border-color: var(--purple-light);
}

.canvas-todo-checkbox svg {
    width: 10px;
    height: 10px;
    color: var(--text-primary);
    opacity: 0;
}

.canvas-todo-item.completed .canvas-todo-checkbox svg {
    opacity: 1;
}

.canvas-todo-text {
    flex: 1;
    font-size: 0.813rem;
    color: var(--text-primary);
}

.canvas-todo-add {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    margin-top: var(--spacing-xs);
    background: transparent;
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.canvas-todo-add:hover {
    border-color: var(--rose-primary);
    color: var(--text-secondary);
}

/* Todo List Inline Edit Input */
.todo-edit-input {
    box-sizing: border-box;
    font-weight: 400;
}

.todo-edit-input:focus {
    border-color: var(--rose-primary);
    box-shadow: 0 0 0 2px rgba(5, 169, 156, 0.2);
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-subtle);
    border-top-color: var(--rose-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ================================
   TOKEN SELECTION SCREEN
   ================================ */
#token-selection-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(1000px 600px at 15% 10%, rgba(0, 255, 197, 0.18), transparent 55%),
        radial-gradient(900px 500px at 85% 80%, rgba(5, 169, 156, 0.22), transparent 55%),
        linear-gradient(180deg, #142f2a 0%, #24463e 100%);
}

.token-selection-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: min(900px, 100%);
    padding: 40px 20px;
    text-align: center;
}

.token-header {
    text-align: center;
    color: var(--text-primary);
    margin-bottom: 24px;
    max-width: 700px;
}

.token-header h1 {
    font-size: 2.3em;
    margin: 0 0 12px 0;
    letter-spacing: 0.02em;
}

.token-header p {
    font-size: 1.05em;
    color: var(--text-secondary);
    margin: 0;
}

.discovery-progress {
    width: 100%;
    max-width: 680px;
    background: var(--bg-elevated);
    border-radius: 16px;
    padding: 28px;
    box-shadow: var(--shadow-strong);
    border: 1px solid var(--border-medium);
}

.progress-content p {
    text-align: center;
    margin: 10px 0;
    color: var(--text-secondary);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--rose-light) 0%, var(--purple-light) 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
    width: 0%;
}

#discovery-percentage {
    font-weight: bold;
    color: var(--rose-light);
}

/* Tokens Toolbar - Search Bar */
.tokens-toolbar {
    width: 100%;
    display: flex;
    margin-bottom: var(--spacing-lg);
    justify-content: center;
}

.search-box {
    flex: 0 1 580px;
    position: relative;
    display: flex;
    align-items: center;
    height: 40px;
}

.search-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    pointer-events: none;
}

.search-input {
    width: 100%;
    height: 100%;
    padding: 0 16px 0 40px;
    background: linear-gradient(135deg, rgba(20, 15, 30, 0.8), rgba(25, 20, 35, 0.8));
    border: 1px solid rgba(5, 169, 156, 0.2);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    transition: all var(--transition-normal);
    outline: none;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    border-color: var(--rose-primary);
    background: linear-gradient(135deg, rgba(30, 20, 40, 0.9), rgba(35, 25, 45, 0.9));
    box-shadow: 0 0 0 3px rgba(5, 169, 156, 0.2), 0 0 20px rgba(5, 169, 156, 0.15);
}

.clear-search-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.clear-search-btn svg {
    width: 16px;
    height: 16px;
}

.clear-search-btn:hover {
    color: var(--rose-primary);
}

.btn-refresh {
    padding: 8px 10px;
    background: rgba(30, 25, 45, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    min-width: 40px;
}

.btn-refresh svg {
    width: 18px;
    height: 18px;
}

.btn-refresh:hover {
    border-color: var(--rose-primary);
    color: var(--rose-primary);
    background: rgba(30, 25, 45, 0.8);
    animation: spin 0.6s linear;
}

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

.btn-refresh-large {
    margin-top: var(--spacing-lg);
    padding: 12px 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-refresh-large svg {
    width: 18px;
    height: 18px;
}

.btn-refresh-large:hover {
    border-color: var(--rose-primary);
    color: var(--rose-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 169, 156, 0.2);
}

.btn-refresh-large:hover svg {
    animation: spin 0.6s linear;
}

.token-actions {
    margin-top: var(--spacing-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.token-actions #refresh-tokens-btn {
    margin: 0;
}

.btn-token-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-normal);
    padding: 0;
}

#no-tokens-back-btn {
    margin-top: 24px;
}

.btn-token-back svg {
    width: 20px;
    height: 20px;
}

.btn-token-back:hover {
    border-color: var(--rose-primary);
    color: var(--rose-primary);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(5, 169, 156, 0.2);
}

.tokens-grid {
    width: 100%;
    max-width: 880px;
    animation: slideUp 0.4s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(30, 25, 45, 0.4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
}

.tokens-scroll {
    width: 100%;
    max-height: min(50vh, 420px);
    overflow-y: auto;
    padding: 12px 6px;
}

.tokens-scroll::-webkit-scrollbar {
    width: 8px;
}

.tokens-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.tokens-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(5, 169, 156, 0.7), rgba(0, 255, 197, 0.9));
    border-radius: 999px;
}

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

#tokens-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.token-item {
    background: linear-gradient(160deg, rgba(24, 24, 32, 0.95), rgba(18, 18, 24, 0.98));
    border: 1px solid var(--border-medium);
    border-radius: 12px;
    padding: 9px 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
    position: relative;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
}

.token-item:hover {
    border-color: rgba(0, 255, 197, 0.6);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.token-item h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.9em;
    font-weight: 600;
}

.token-item p {
    margin: 2px 0 0 0;
    color: var(--text-secondary);
    font-size: 0.7em;
}

.token-item .balance {
    font-weight: bold;
    color: var(--rose-light);
    font-size: 0.85em;
    line-height: 1;
}

.token-item .token-address {
    font-size: 0.68em;
    color: var(--text-muted);
    opacity: 0.7;
    margin-top: 1px;
    font-family: monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.token-symbol {
    display: inline-block;
    background: rgba(255, 255, 255, 0.08);
    padding: 3px 8px;
    border-radius: 999px;
    font-weight: 600;
    color: var(--rose-light);
    font-size: 0.75em;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.token-row-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.token-online {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7em;
    color: #baf2c4;
    background: rgba(32, 120, 60, 0.18);
    border: 1px solid rgba(72, 185, 105, 0.45);
    white-space: nowrap;
}

.token-online-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #52d66b;
    box-shadow: 0 0 6px rgba(82, 214, 107, 0.6);
}

.token-online svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

.token-name {
    flex: 1;
    margin: 0;
    font-size: 0.85em;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.token-subtext {
    font-size: 0.65em;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
}

.token-balance-section {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 3px;
    min-width: max-content;
    white-space: nowrap;
}

#refresh-tokens-btn,
.btn-refresh {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--purple-deep), var(--rose-primary));
    color: var(--text-primary);
    border: 1px solid rgba(5, 169, 156, 0.3);
    cursor: pointer;
    transition: all var(--transition-normal);
    padding: 0;
    margin: 20px auto 0;
}

#refresh-tokens-btn svg,
.btn-refresh svg {
    width: 22px;
    height: 22px;
    transition: transform var(--transition-normal);
}

#refresh-tokens-btn:hover,
.btn-refresh:hover {
    transform: scale(1.12) rotate(20deg);
    box-shadow: 0 8px 25px rgba(93, 45, 122, 0.45);
    border-color: rgba(5, 169, 156, 0.6);
}

#refresh-tokens-btn:active,
.btn-refresh:active {
    transform: scale(0.95);
}

.token-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65em;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    padding: 4px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.token-network {
    display: inline-flex;
    align-items: center;
    font-size: 0.6em;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-primary);
    background: rgba(5, 169, 156, 0.15);
    border: 1px solid rgba(5, 169, 156, 0.3);
    padding: 4px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.token-chain-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65em;
    letter-spacing: 0.08em;
    color: #ffffff;
    background: linear-gradient(135deg, rgba(4, 60, 54, 0.4), rgba(5, 169, 156, 0.3));
    border: 1px solid rgba(5, 169, 156, 0.5);
    padding: 4px 8px;
    border-radius: 999px;
    white-space: nowrap;
    font-weight: 500;
}

.no-results-message {
    width: 100%;
    padding: 32px 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.02);
}

.no-tokens-alert,
.error-alert {
    background: var(--bg-elevated);
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    max-width: 540px;
    box-shadow: var(--shadow-strong);
    border: 1px solid var(--border-medium);
}

.no-tokens-alert h2,
.error-alert h2 {
    margin: 0 0 15px 0;
    color: var(--text-primary);
    font-size: 1.5em;
}

.no-tokens-alert p,
.error-alert p {
    margin: 10px 0;
    color: var(--text-secondary);
    word-break: break-word;
}

.no-tokens-alert #no-tokens-address {
    font-family: monospace;
    font-size: 12px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.no-tokens-alert #no-tokens-network {
    font-size: 14px;
}

.error-alert {
    border-left: 4px solid #ff6b6b;
}

.btn-primary,
.btn-secondary {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    margin: 10px 5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--purple-deep) 0%, var(--rose-primary) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(5, 169, 156, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 2px solid #e0e0e0;
}

.btn-secondary:hover {
    background: #e0e0e0;
    border-color: #d0d0d0;
}

#retry-token-discovery,
#retry-discovery-btn {
    display: block;
    margin: 20px auto 0;
}

@media (max-width: 768px) {
    /* Hide Split button on mobile devices */
    #toggle-split {
        display: none;
    }

    .token-header h1 {
        font-size: 1.5em;
        line-height: 1.2;
        margin-bottom: 8px;
    }

    .token-header {
        margin-bottom: 16px;
        padding: 0 6px;
    }

    .token-header p {
        font-size: 0.95em;
        line-height: 1.35;
    }

    #tokens-list {
        grid-template-columns: 1fr;
    }

    .token-selection-container {
        padding: 10px;
    }

    .tokens-grid {
        padding: 12px;
    }

    .tokens-scroll {
        max-height: 45vh;
        padding: 8px 4px;
    }

    .token-item {
        padding: 12px;
    }

    .token-row-header {
        flex-wrap: wrap;
        gap: 6px;
        align-items: center;
    }

    .token-name {
        flex-basis: 100%;
        order: 4;
    }

    .token-badge {
        order: 1;
    }

    .token-network {
        order: 2;
    }

    .token-online {
        order: 3;
        margin-left: auto;
    }
}

/* ================================
   RESPONSIVE
   ================================ */
@media (max-width: 900px) {
    .sidebar {
        width: 180px;
    }

    .content-area.split-view {
        grid-template-columns: 300px 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .content-area.split-view {
        display: flex;
        flex-direction: column;
    }

    .content-area.split-view .chat-panel {
        width: 100%;
        height: 50%;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
    }

    .content-area.split-view .canvas-panel {
        width: 100%;
        height: 50%;
    }

    .header-center {
        display: none;
    }

    .header-title {
        font-size: 0.875rem;
    }

    body,
    #app {
        touch-action: pan-x pan-y;
        overscroll-behavior: none;
    }

    .message-input {
        font-size: 1rem;
    }

    .canvas-container,
    .canvas-container .upper-canvas,
    .canvas-container .lower-canvas,
    #reasoning-canvas {
        touch-action: none;
    }
}

@media (max-width: 480px) {
    .app-header {
        padding: var(--spacing-sm) var(--spacing-md);
    }

    .user-address {
        display: none;
    }

    .view-toggle {
        justify-content: center;
    }

    .toggle-btn span:not(.toggle-btn svg) {
        display: none;
    }

    .canvas-toolbar {
        justify-content: center;
    }
}

/* ================================
   GIF MODAL
   ================================ */
.gif-modal-content {
    max-width: 760px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.gif-modal-body {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    overflow: hidden;
}

.gif-search {
    display: flex;
    align-items: center;
}

.gif-search-box {
    width: 100%;
}

.gif-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--spacing-sm);
    overflow-y: auto;
    padding-right: 6px;
    max-height: 50vh;
}

.gif-results::-webkit-scrollbar {
    width: 8px;
}

.gif-results::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 999px;
}

.gif-results::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(5, 169, 156, 0.7), rgba(0, 255, 197, 0.9));
    border-radius: 999px;
}

.gif-results::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(5, 169, 156, 0.9), rgba(0, 255, 197, 1));
}

body.theme-windows .gif-results::-webkit-scrollbar-track {
    background: #f2f2f2;
    border: 1px solid #b0b0b0;
}

body.theme-windows .gif-results::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border: 1px solid #7b7b7b;
}

body.theme-windows .gif-results::-webkit-scrollbar-thumb:hover {
    background: #a7a7a7;
}

body.theme-fantasy .gif-results::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ffb86c, #e174e3);
}

body.theme-fantasy .gif-results::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ffd59e, #f08cf0);
}

body.theme-console .gif-results::-webkit-scrollbar-track {
    background: #000000;
    border: 1px solid #00ff00;
}

body.theme-console .gif-results::-webkit-scrollbar-thumb {
    background: #00ff00;
    border: 1px solid #00ff00;
}

body.theme-console .gif-results::-webkit-scrollbar-thumb:hover {
    background: #b0ffb0;
}

.gif-tile {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.gif-tile:hover {
    transform: translateY(-2px);
    border-color: var(--rose-primary);
}

.gif-tile img {
    display: block;
    width: 100%;
    height: auto;
}

.gif-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: var(--spacing-md);
}

@media (max-width: 720px) {
    .gif-modal-content {
        max-width: 92vw;
    }

    .gif-results {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        max-height: 45vh;
    }

    .gif-tile {
        align-self: start;
    }

    .gif-tile img {
        width: 100%;
        height: auto;
        object-fit: contain;
    }
}

/* Token Dropdown Styles */
.token-dropdown-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    z-index: 1001;
    overflow: visible;
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .token-dropdown-wrapper {
    z-index: 1100;
}

body:not(.theme-windows):not(.theme-win96):not(.theme-fantasy):not(.theme-console) .token-dropdown-menu {
    z-index: 1100;
}

.token-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 4px;
    padding: 4px 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.token-dropdown-toggle:hover {
    background: var(--bg-hover, rgba(255, 255, 255, 0.05));
    border-color: var(--border-hover, rgba(255, 255, 255, 0.2));
}

.token-dropdown-toggle:active {
    background: var(--bg-active, rgba(255, 255, 255, 0.1));
}

.dropdown-chevron {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.token-dropdown-toggle.active .dropdown-chevron {
    transform: rotate(180deg);
}

.token-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: var(--bg-secondary, #1a1a1a);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    max-width: 400px;
    max-height: 320px;
    overflow-y: auto;
    min-width: 300px;
    pointer-events: auto;
}

/* Custom scrollbar for token dropdown */
.token-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.token-dropdown-menu::-webkit-scrollbar-track {
    background: transparent;
}

.token-dropdown-menu::-webkit-scrollbar-thumb {
    background: rgba(5, 169, 156, 0.4);
    border-radius: 3px;
}

.token-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(5, 169, 156, 0.6);
}

.token-dropdown-list {
    display: flex;
    flex-direction: column;
    padding: 4px;
}

.token-dropdown-item {
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.token-dropdown-item:hover {
    background: var(--bg-hover, rgba(255, 255, 255, 0.1));
}

.token-dropdown-item.active {
    background: rgba(5, 169, 156, 0.2);
    border-left: 2px solid var(--accent-color, #05a99c);
    padding-left: 10px;
}

.token-dropdown-item-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
}

.token-dropdown-item-address {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

/* ===== MANIFESTO MODAL STYLES ===== */

.login-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-lg) 0;
    margin-top: var(--spacing-lg);
}

.manifesto-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: var(--spacing-sm) 0;
    font-size: 0.875rem;
    cursor: pointer;
    border-radius: 0;
    transition: all var(--transition-normal);
    font-family: var(--font-primary);
    text-transform: lowercase;
    letter-spacing: 0.5px;
    text-decoration: underline;
    text-decoration-color: var(--text-secondary);
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.manifesto-btn:hover {
    color: var(--text-primary);
    text-decoration-color: var(--text-primary);
    background: transparent;
}

.manifesto-btn:active {
    transform: scale(0.98);
}

/* Manifesto Modal */
.manifesto-modal {
    z-index: 2000;
}

.manifesto-modal-content {
    width: 90%;
    max-width: 700px;
    height: 80vh;
    max-height: 600px;
    display: flex;
    flex-direction: column;
    padding: 0;
    border-radius: var(--radius-lg);
    background: var(--bg-elevated);
    border: 1px solid var(--border-medium);
    overflow: hidden;
    justify-content: space-between;
}

.manifesto-wrapper {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.manifesto-modal-header {
    display: flex;
    justify-content: flex-end;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-subtle);
}

.manifesto-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.manifesto-slides {
    display: flex;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    flex-wrap: nowrap;
}

.manifesto-slide {
    flex: 0 0 100%;
    min-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    overflow-y: auto;
}

.manifesto-slide::-webkit-scrollbar {
    width: 6px;
}

.manifesto-slide::-webkit-scrollbar-track {
    background: transparent;
}

.manifesto-slide::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
}

.manifesto-slide::-webkit-scrollbar-thumb:hover {
    background: var(--border-subtle);
}

.manifesto-slide-content {
    max-width: 500px;
    text-align: center;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.manifesto-slide h2 {
    font-family: var(--font-pixel);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
    line-height: 1.4;
    animation: slideInDown 0.6s ease-out;
}

.manifesto-slide p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: var(--spacing-md);
    animation: slideInUp 0.7s ease-out 0.2s both;
}

.manifesto-title {
    font-family: var(--font-pixel);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--rose-light);
    margin-bottom: var(--spacing-xl);
    line-height: 1.3;
    animation: slideInDown 0.6s ease-out;
}

.manifesto-emphasis {
    font-style: italic;
    color: var(--text-primary);
    margin-top: var(--spacing-lg);
}

.manifesto-closing {
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-top: var(--spacing-xl);
}

.manifesto-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-md);
    border-top: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.2);
}

.manifesto-twitter-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
    transition: all var(--transition-normal);
    text-decoration: none;
}

.manifesto-twitter-link:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    transform: scale(1.1);
}

.manifesto-twitter-link svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Manifesto Navigation Arrows */
.manifesto-arrow {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: auto;
    height: auto;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    padding: 0;
    flex-shrink: 0;
}

.manifesto-arrow:hover {
    color: var(--text-primary);
}

.manifesto-arrow:active {
    transform: scale(0.95);
}

.manifesto-arrow svg {
    width: 32px;
    height: 32px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

/* Manifesto Navigation Indicators */
.manifesto-nav {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) 0;
}

.manifesto-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-medium);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.manifesto-dot.active {
    background: var(--rose-light);
    transform: scale(1.3);
}

/* Mention Autocomplete Popup */
.mention-popup {
    position: absolute;
    bottom: calc(100% + var(--spacing-sm));
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-strong);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    animation: slideInUp var(--transition-fast);
    pointer-events: auto;
}

.mention-list {
    list-style: none;
    padding: var(--spacing-xs) 0;
    margin: 0;
}

.mention-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    transition: background var(--transition-fast);
    border: none;
    width: 100%;
    text-align: left;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-primary);
}

.mention-item:hover {
    background: var(--bg-secondary);
}

.mention-item.selected {
    background: var(--purple-medium);
}

.mention-item-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rose-primary), var(--purple-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
    overflow: hidden;
}

.mention-item-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mention-item-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mention-item-badge {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

/* Mobile specific styles */
@media (max-width: 768px) {
    .manifesto-modal-content {
        width: 95%;
        height: 85vh;
        max-height: none;
    }

    .manifesto-slide {
        padding: var(--spacing-md);
    }

    .manifesto-slide h2 {
        font-size: 1.2rem;
    }

    .manifesto-title {
        font-size: 1.5rem;
    }

    .manifesto-slide p {
        font-size: 0.9rem;
    }

    .manifesto-arrow svg {
        width: 24px;
        height: 24px;
    }

    .manifesto-modal-header {
        padding: var(--spacing-sm);
    }

    .manifesto-footer {
        padding: var(--spacing-sm);
    }
}

@media (max-width: 480px) {
    .manifesto-modal-content {
        width: 98%;
        height: 88vh;
    }

    .manifesto-wrapper {
        gap: var(--spacing-sm);
    }

    .manifesto-slide {
        padding: var(--spacing-sm);
        align-items: center;
    }

    .manifesto-slide-content {
        max-width: 100%;
    }

    .manifesto-slide h2 {
        font-size: 1rem;
        margin-bottom: var(--spacing-md);
    }

    .manifesto-title {
        font-size: 1.2rem;
        margin-bottom: var(--spacing-md);
    }

    .manifesto-slide p {
        font-size: 0.85rem;
        line-height: 1.5;
        margin-bottom: var(--spacing-sm);
    }

    .manifesto-closing {
        font-size: 0.9rem;
        margin-top: var(--spacing-md);
    }

    .manifesto-emphasis {
        margin-top: var(--spacing-md);
    }

    .manifesto-arrow svg {
        width: 20px;
        height: 20px;
    }

    .manifesto-arrow {
        padding: 0;
    }

    .manifesto-nav {
        gap: var(--spacing-xs);
        padding: var(--spacing-sm) 0;
    }

    .manifesto-dot {
        width: 6px;
        height: 6px;
    }

    .manifesto-twitter-link {
        width: 36px;
        height: 36px;
    }

    .manifesto-twitter-link svg {
        width: 18px;
        height: 18px;
    }
}

