/* MESHROOM - Main Stylesheet */
/* Theme: Dark Purple & Rose - Modern, Immersive, Tech */

:root {
    /* Core Colors */
    --bg-primary: #0d0d0d;
    --bg-secondary: #141414;
    --bg-tertiary: #1a1a1a;
    --bg-elevated: #202020;

    /* Accent Colors - Purple Rose Palette */
    --purple-deep: #3d1a5a;
    --purple-medium: #5d2d7a;
    --purple-light: #7d3d9a;
    --rose-primary: #c23d6d;
    --rose-light: #d65a88;
    --rose-dark: #a32d5d;
    --pink-deep: #8b1a4a;
    --pink-medium: #b02d5a;
    --pink-light: #d4407a;

    /* Text Colors */
    --text-primary: #e8e8e8;
    --text-secondary: #a0a0a0;
    --text-muted: #6a6a6a;
    --text-accent: var(--rose-light);

    /* Status Colors */
    --status-online: var(--rose-light);
    --status-offline: var(--pink-light);
    --status-pending: var(--purple-light);

    /* Borders & Shadows */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-medium: rgba(255, 255, 255, 0.1);
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-strong: 0 8px 40px rgba(0, 0, 0, 0.6);

    /* 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;
}

/* 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;
}

/* 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: linear-gradient(
        135deg,
        var(--bg-primary) 0%,
        #0a0f0a 50%,
        var(--bg-primary) 100%
    );
}

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

.bg-pattern {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(93, 45, 122, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(194, 61, 109, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(210, 100, 150, 0.04) 0%, transparent 60%);
    animation: patternPulse 20s ease-in-out infinite;
}

@keyframes patternPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.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: 100px;
    height: 100px;
    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;
}

.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: 0 0 10px rgba(194, 61, 109, 0.5);
}

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

.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 */
.enter-btn {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 28px;
    border-radius: 24px;
    background: linear-gradient(
        135deg,
        var(--purple-deep) 0%,
        var(--purple-medium) 100%
    );
    border: 2px solid var(--purple-light);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    font-family: Georgia, serif;
    line-height: 1;
}

.enter-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        transparent 0%,
        rgba(194, 61, 109, 0.1) 50%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.enter-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 35px rgba(93, 45, 122, 0.5);
}

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

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

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

.enter-text {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.enter-btn svg {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-normal);
    flex-shrink: 0;
}

.enter-btn:hover svg {
    transform: translateX(2px);
}

/* 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 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: 64px;
    flex-shrink: 0;
}

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

.logo-small {
    width: 32px;
    height: 32px;
}

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

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

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

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

.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(194, 61, 109, 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 {
    flex: 1;
    color: var(--text-secondary);
    font-family: monospace;
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.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);
}

.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; }
}

.status-text {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* 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: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
}

.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);
}

/* 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: 6px;
}

.messages-container::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.messages-container::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
}

.message {
    display: flex;
    gap: var(--spacing-sm);
    max-width: 85%;
    cursor: pointer;
    transition: opacity var(--transition-fast);
    border-radius: var(--radius-md);
    padding: var(--spacing-xs);
    margin: -var(--spacing-xs);
}

.message:hover {
    opacity: 0.8;
    background: rgba(255, 255, 255, 0.02);
}

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

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

.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-sender {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
}

.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-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);
}

.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);
}

/* 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 {
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
}

.input-wrapper {
    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);
}

.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: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.action-btn.send-btn:hover {
    background: var(--purple-deep);
    color: var(--text-primary);
}

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

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

.system-message-content {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-lg);
}

/* ================================
   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;
}

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

.canvas-container .upper-canvas,
.canvas-container .lower-canvas {
    background: transparent !important;
}

.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;
}

/* ================================
   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;
}

/* 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: 4px 8px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.7rem;
    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: 4px 8px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.7rem;
    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 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;
}

/* 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 {
    transition: opacity var(--transition-fast), max-height var(--transition-fast);
}

#ai-language-field.hidden,
#ai-style-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(194, 61, 109, 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(194, 61, 109, 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: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-lg);
    background: var(--bg-tertiary);
    border: 1px solid rgba(194, 61, 109, 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(194, 61, 109, 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);
}

/* ================================
   GANJA FARMER MODAL
   ================================ */
.ganjafarmer-modal-content {
    max-width: 960px;
}

.ganjafarmer-body {
    display: flex;
    justify-content: center;
}

.ganjafarmer-canvas-wrap {
    background: linear-gradient(180deg, rgba(10, 30, 20, 0.6), rgba(5, 10, 8, 0.8));
    border-radius: var(--radius-lg);
    border: 1px solid rgba(194, 61, 109, 0.25);
    padding: var(--spacing-sm);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

#ganjafarmer-canvas {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-md);
    background: #6bb7ff;
}

/* ================================
   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(194, 61, 109, 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(210, 74, 125, 0.18), transparent 55%),
        radial-gradient(900px 500px at 85% 80%, rgba(93, 45, 122, 0.22), transparent 55%),
        linear-gradient(180deg, #0c0c0f 0%, #111118 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-grid {
    width: 100%;
    max-width: 880px;
    animation: slideUp 0.4s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    justify-content: center;
}

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

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

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

.tokens-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(110, 65, 187, 0.7), rgba(198, 61, 109, 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(214, 90, 136, 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-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(194, 61, 109, 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(194, 61, 109, 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;
}

.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);
}

.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, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 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) {
    .token-header h1 {
        font-size: 1.8em;
    }

    #tokens-list {
        grid-template-columns: 1fr;
    }

    .token-selection-container {
        padding: 10px;
    }

    .token-item {
        padding: 15px;
    }
}

/* ================================
   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;
    }
}

@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;
    }
}
