/* UX Studio - Main Stylesheet */

/* ===== CSS Variables ===== */
:root {
    /* Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a24;
    --bg-hover: #252530;
    --bg-active: #2a2a3a;

    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --text-muted: #606070;

    --border-color: #2a2a3a;
    --border-light: #3a3a4a;

    --accent-primary: #6366f1;
    --accent-secondary: #818cf8;
    --accent-hover: #7c3aed;

    --success: #10b981;
    --success-light: #34d399;
    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --error: #ef4444;
    --error-light: #f87171;
    --info: #3b82f6;

    /* Agent Colors (v2.2.0 - 11 agents) */
    --agent-orchestrator: #6366f1;
    --agent-analyzer: #8B5CF6;
    --agent-kase: #06b6d4;
    --agent-alan: #f59e0b;
    --agent-rosanna: #ec4899;
    --agent-david: #3b82f6;
    --agent-sarah: #10b981;
    --agent-laban: #8b5cf6;
    --agent-trixie: #f43f5e;
    --agent-quinn: #10B981;
    --agent-nate: #84cc16;

    /* Sizing */
    --header-height: 60px;
    --sidebar-width: 280px;
    --chat-width: 420px;
    --border-radius: 8px;
    --border-radius-lg: 12px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.4);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Reset button defaults */
button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-shadow: none;
}

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
}

#root {
    height: 100%;
}

/* ===== App Layout ===== */
.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--bg-primary);
}

.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ===== Header ===== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.logo-icon {
    font-size: 1.5rem;
}

.header-center {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--border-radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: var(--shadow-glow);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: transparent;
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-icon {
    padding: 0.5rem;
    min-width: 36px;
    min-height: 36px;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
}

/* ===== Agent Selector ===== */
.agent-selector {
    position: relative;
}

.agent-selector-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.agent-selector-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
}

.agent-selector-icon {
    font-size: 1.25rem;
}

.agent-selector-name {
    font-weight: 500;
}

.agent-selector-chevron {
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.agent-selector-btn.open .agent-selector-chevron {
    transform: rotate(180deg);
}

.agent-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 280px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    overflow: hidden;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.agent-menu-header {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

.agent-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

.agent-menu-label {
    padding: 0.5rem 1rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.agent-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.agent-menu-item:hover {
    background: var(--bg-hover);
}

.agent-menu-item.active {
    background: var(--bg-active);
}

.agent-menu-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.agent-menu-item-icon {
    font-size: 1.25rem;
}

.agent-menu-item-info {
    flex: 1;
    min-width: 0;
}

.agent-menu-item-name {
    font-weight: 500;
    color: var(--text-primary);
}

.agent-menu-item-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.agent-status-indicator {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
}

.agent-status-indicator.pending {
    color: var(--text-muted);
}

.agent-status-indicator.ready {
    color: var(--info);
}

.agent-status-indicator.active {
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

.agent-status-indicator.completed {
    color: var(--success);
}

.agent-status-indicator.blocked {
    color: var(--error);
}

.optional-badge {
    font-size: 0.65rem;
    padding: 0.125rem 0.375rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    color: var(--text-muted);
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-section {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-footer {
    margin-top: auto;
    border-bottom: none;
    border-top: 1px solid var(--border-color);
}

.sidebar-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}

.sidebar-nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-nav-item.active {
    background: var(--bg-active);
    color: var(--text-primary);
}

.sidebar-nav-item-icon {
    font-size: 1.125rem;
}

/* ===== Agent Pipeline ===== */
.agent-pipeline {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.pipeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.pipeline-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.pipeline-status {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.pipeline-agents {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.agent-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.agent-item::before {
    content: '';
    position: absolute;
    left: 1.5rem;
    top: -0.25rem;
    width: 2px;
    height: 0.25rem;
    background: var(--border-color);
}

.agent-item:first-child::before {
    display: none;
}

.agent-item:hover {
    background: var(--bg-hover);
}

.agent-item.active {
    background: var(--bg-active);
    border: 1px solid var(--accent-primary);
}

.agent-item.completed {
    opacity: 0.8;
}

.agent-item.optional {
    border-style: dashed;
    border-color: var(--border-light);
}

.agent-item-icon {
    font-size: 1.25rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.agent-item-info {
    flex: 1;
    min-width: 0;
}

.agent-item-name {
    font-weight: 500;
    font-size: 0.875rem;
}

.agent-item-status {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.agent-item-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.agent-item-indicator.pending {
    background: var(--text-muted);
}

.agent-item-indicator.active {
    background: var(--accent-primary);
    box-shadow: 0 0 8px var(--accent-primary);
    animation: pulse 2s infinite;
}

.agent-item-indicator.completed {
    background: var(--success);
}

.agent-item-indicator.blocked {
    background: var(--error);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Parallel agents group */
.parallel-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem;
    margin: 0.25rem 0;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    border: 1px dashed var(--border-color);
    position: relative;
}

.parallel-group::before {
    content: 'PARALLEL';
    position: absolute;
    top: -0.5rem;
    left: 0.75rem;
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 0 0.5rem;
    letter-spacing: 0.05em;
}

.parallel-group .agent-item::before {
    display: none;
}

/* Optional agents group */
.optional-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem;
    margin: 0.25rem 0;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    border: 1px dashed var(--border-color);
    position: relative;
    opacity: 0.8;
}

.optional-group::before {
    content: 'OPTIONAL';
    position: absolute;
    top: -0.5rem;
    left: 0.75rem;
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 0 0.5rem;
    letter-spacing: 0.05em;
}

.optional-group .agent-item::before {
    display: none;
}

/* ===== Chat Window ===== */
.chat-window {
    width: 100%;
    height: 100%;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    border-radius: var(--border-radius);
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.chat-header-agent {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-header-agent-icon {
    font-size: 1.5rem;
}

.chat-header-agent-name {
    font-weight: 600;
}

.chat-header-agent-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* AI Status - inline in chat (current activity) */
.ai-status-inline {
    display: flex;
    align-items: center;
    padding: 0.25rem 0;
    gap: 0.5rem;
    animation: fadeIn 0.2s ease;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
}

.ai-status-icon {
    font-size: 0.85rem;
    flex-shrink: 0;
}

.ai-status-text {
    color: var(--text-muted);
}

.ai-status-spinner {
    display: none;
}

/* Activity messages - permanent log of what AI did */
.activity-message {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.2rem 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.activity-icon {
    font-size: 0.8rem;
    flex-shrink: 0;
    opacity: 0.8;
}

.activity-text {
    color: var(--text-muted);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Stop button - replaces send button when processing */
.btn-stop {
    background: var(--error) !important;
    border-color: var(--error) !important;
}

.btn-stop:hover {
    background: var(--error-light) !important;
    border-color: var(--error-light) !important;
}

/* Disabled input state */
.chat-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-message {
    max-width: 100%;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-message.user {
    align-self: flex-start;
}

.chat-message.assistant {
    align-self: flex-start;
}

.chat-message-content {
    padding: 0.5rem 0;
    font-size: 0.9rem;
    line-height: 1.7;
}

.chat-message.user .chat-message-content {
    background: transparent;
    color: var(--accent-primary);
    font-weight: 500;
}

.chat-message.user .chat-message-content::before {
    content: "You: ";
    color: var(--text-secondary);
    font-weight: 600;
}

.chat-message.assistant .chat-message-content {
    background: transparent;
    color: var(--text-primary);
}

.chat-message-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Agent Card in Chat */
.agent-card {
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.agent-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.agent-card-icon {
    font-size: 1.25rem;
}

.agent-card-name {
    font-weight: 600;
    flex: 1;
}

.agent-card-body {
    padding: 1rem;
}

.agent-card-task {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.agent-card-progress {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.progress-item-icon {
    width: 16px;
    text-align: center;
}

.progress-item.pending .progress-item-icon {
    color: var(--text-muted);
}

.progress-item.in-progress .progress-item-icon {
    color: var(--accent-primary);
}

.progress-item.completed .progress-item-icon {
    color: var(--success);
}

/* ========================================
   ENHANCED CHAT MESSAGE BOXES
   ======================================== */

/* Base Message Box */
.chat-message-box {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    margin-bottom: 0.75rem;
    animation: fadeIn 0.3s ease;
    overflow: visible;
    max-width: 100%;
    width: auto;
    min-width: 200px;
}

/* User messages align left */
.user-message-box {
    margin-right: auto;
    max-width: 80%;
}

/* Assistant messages take more width for content */
.assistant-message-box {
    margin-right: auto;
    max-width: 100%;
}

/* Message Box Header */
.message-box-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.message-box-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.user-avatar {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.assistant-avatar {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.message-box-meta {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.message-box-sender {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.message-box-role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.message-box-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-left: auto;
}

.message-box-badge {
    display: flex;
    align-items: center;
}

.ai-badge {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Message Box Content */
.message-box-content {
    padding: 0.75rem;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-primary);
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.message-box-content p {
    margin: 0;
    white-space: pre-wrap;
}

.message-box-content p + p {
    margin-top: 0.5rem;
}

/* Ensure div content in assistant messages displays properly */
.message-box-content > div {
    white-space: pre-wrap;
}

.assistant-content {
    background: transparent;
}

/* Inline code styling */
.assistant-content code {
    background: rgba(99, 102, 241, 0.15);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85em;
    color: var(--accent-secondary);
    white-space: pre-wrap;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
}

/* Code blocks - prettier styling */
.assistant-content pre {
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-primary);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin: 0.75rem 0;
    overflow-x: auto;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
}

.assistant-content pre code {
    background: transparent;
    padding: 0;
    color: var(--text-primary);
    font-size: inherit;
}

/* Ensure all text in assistant content is readable */
.assistant-content,
.assistant-content * {
    color: var(--text-primary);
}

/* Style checkboxes/status indicators */
.assistant-content input[type="checkbox"] {
    accent-color: var(--success);
}

/* Remove any black backgrounds from spans or divs */
.assistant-content span,
.assistant-content div:not(.message-box-content) {
    background: transparent !important;
}

/* ========================================
   ENHANCED MARKDOWN STYLING
   ======================================== */

/* Headers in responses */
.assistant-content h1,
.assistant-content h2,
.assistant-content h3 {
    color: var(--text-primary);
    margin: 1rem 0 0.5rem 0;
    font-weight: 600;
}

.assistant-content h1 {
    font-size: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.assistant-content h2 {
    font-size: 1.1rem;
    color: var(--accent-secondary);
}

.assistant-content h3 {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Lists */
.assistant-content ul,
.assistant-content ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.assistant-content li {
    margin: 0.25rem 0;
    line-height: 1.5;
}

/* Tables */
.assistant-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
    font-size: 0.8rem;
}

.assistant-content th,
.assistant-content td {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.assistant-content th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--accent-secondary);
}

.assistant-content tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

/* Blockquotes */
.assistant-content blockquote {
    margin: 0.75rem 0;
    padding: 0.5rem 1rem;
    border-left: 3px solid var(--accent-primary);
    background: rgba(99, 102, 241, 0.05);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

/* Horizontal rules */
.assistant-content hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1rem 0;
}

/* Links */
.assistant-content a {
    color: var(--accent-secondary);
    text-decoration: none;
}

.assistant-content a:hover {
    text-decoration: underline;
}

/* Strong/Bold text */
.assistant-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Emphasis */
.assistant-content em {
    color: var(--text-secondary);
    font-style: italic;
}

/* ========================================
   AGENT STATUS & PROGRESS STYLING
   ======================================== */

/* Status indicators */
.status-complete {
    color: var(--success);
    font-weight: 500;
}

.status-progress {
    color: var(--warning);
    font-weight: 500;
}

.status-pending {
    color: var(--text-muted);
}

.status-error {
    color: var(--error);
    font-weight: 500;
}

.status-warning {
    color: var(--warning);
    font-weight: 500;
}

/* Progress bars */
.progress-bar {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    color: var(--accent-secondary);
    letter-spacing: -0.5px;
}

/* Box drawing lines */
.box-line {
    color: var(--accent-primary);
    opacity: 0.6;
}

/* Code blocks with language */
.code-block {
    position: relative;
}

.code-block.lang-yaml::before,
.code-block.lang-json::before,
.code-block.lang-js::before,
.code-block.lang-css::before,
.code-block.lang-html::before {
    content: attr(class);
    position: absolute;
    top: 0;
    right: 0;
    padding: 0.25rem 0.5rem;
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    background: var(--bg-primary);
    border-radius: 0 var(--border-radius) 0 var(--border-radius);
}

.code-block.lang-yaml::before { content: 'yaml'; }
.code-block.lang-json::before { content: 'json'; }
.code-block.lang-js::before { content: 'javascript'; }
.code-block.lang-css::before { content: 'css'; }
.code-block.lang-html::before { content: 'html'; }

/* Inline code */
.inline-code {
    background: rgba(99, 102, 241, 0.15) !important;
    color: var(--accent-secondary) !important;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85em;
}

/* Markdown lists */
.md-list,
.md-list-num {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.md-list-item,
.md-list-item-num {
    margin: 0.25rem 0;
    line-height: 1.5;
}

/* Markdown blockquote */
.md-quote {
    margin: 0.5rem 0;
    padding: 0.5rem 1rem;
    border-left: 3px solid var(--accent-primary);
    background: rgba(99, 102, 241, 0.05);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    font-style: italic;
    color: var(--text-secondary);
}

/* Markdown hr */
.md-hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1rem 0;
}

/* Message Box Footer */
.message-box-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.tools-used {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tools-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.tool-tag {
    background: var(--bg-primary);
    color: var(--accent-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-family: monospace;
}

.message-box-stats {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.stat-icon {
    font-size: 0.8rem;
}

/* User Message Box Specific - border accent */
.user-message-box {
    border-left: 3px solid var(--accent-primary);
}

.user-message-box .message-box-content {
    background: rgba(99, 102, 241, 0.05);
}

/* Assistant Message Box Specific - border accent */
.assistant-message-box {
    border-left: 3px solid #10b981;
}

/* Agent Message Box - wider for task content */
.agent-message-box {
    max-width: 95%;
    min-width: 320px;
}

/* ========================================
   ENHANCED AGENT CARD
   ======================================== */

.agent-message-box {
    border-left: 3px solid var(--agent-color, var(--accent-primary));
}

.agent-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.agent-box-identity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.agent-box-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: linear-gradient(135deg, var(--agent-color, var(--accent-primary)), color-mix(in srgb, var(--agent-color, var(--accent-primary)) 70%, black));
    box-shadow: 0 2px 6px color-mix(in srgb, var(--agent-color, var(--accent-primary)) 30%, transparent);
}

.agent-box-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.agent-box-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.agent-box-role {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.agent-box-status {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
}

.agent-box-status.status-active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-secondary);
}

.agent-box-status.status-active .status-icon {
    animation: pulse 1.5s infinite;
}

.agent-box-status.status-completed {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.agent-box-status.status-pending {
    background: rgba(160, 160, 176, 0.15);
    color: var(--text-muted);
}

.agent-box-status.status-blocked {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

/* Agent Task Section */
.agent-box-task {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.task-label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.task-icon {
    font-size: 0.75rem;
}

.task-description {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Agent Progress Section */
.agent-box-progress {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.progress-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.progress-count {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.progress-bar-container {
    height: 3px;
    background: var(--bg-primary);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--success));
    border-radius: 2px;
    transition: width 0.3s ease;
}

.progress-items {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.progress-item-enhanced {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    padding: 0.125rem 0;
}

.progress-item-indicator {
    width: 16px;
    text-align: center;
    font-size: 0.7rem;
}

.indicator-completed {
    color: var(--success);
    font-weight: bold;
}

.indicator-active {
    color: var(--accent-primary);
    animation: pulse 1.5s infinite;
}

.indicator-pending {
    color: var(--text-muted);
}

.progress-item-text {
    flex: 1;
    color: var(--text-secondary);
}

.progress-item-enhanced.completed .progress-item-text {
    color: var(--text-muted);
    text-decoration: line-through;
}

.progress-item-enhanced.in-progress .progress-item-text {
    color: var(--text-primary);
    font-weight: 500;
}

.progress-item-duration {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-family: monospace;
}

/* Agent Output Section */
.agent-box-output {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.output-header {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.output-icon {
    font-size: 0.75rem;
}

.output-content {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.5rem 0.625rem;
}

.output-content pre {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace;
    line-height: 1.4;
}

/* Agent Footer */
.agent-box-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.375rem 0.75rem;
    background: var(--bg-secondary);
}

.footer-timestamp {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.footer-stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* ========================================
   ENHANCED HANDOFF MESSAGE
   ======================================== */

.handoff-message-box {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    animation: fadeIn 0.3s ease;
    max-width: fit-content;
}

.handoff-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.handoff-agent {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.handoff-agent-icon {
    font-size: 0.9rem;
}

.handoff-agent-name {
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--text-primary);
}

.handoff-arrow-container {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.handoff-arrow-line {
    width: 12px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 1px;
}

.handoff-arrow-icon {
    color: var(--accent-primary);
    font-size: 0.9rem;
    font-weight: bold;
}

.handoff-reason {
    margin-top: 0.375rem;
    padding-top: 0.375rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.375rem;
    font-size: 0.7rem;
}

.reason-label {
    color: var(--text-muted);
}

.reason-text {
    color: var(--text-secondary);
}

/* ========================================
   ENHANCED ACTIVITY MESSAGE
   ======================================== */

.activity-message-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 0.375rem;
    animation: fadeIn 0.2s ease;
    border-left: 3px solid var(--text-muted);
    max-width: fit-content;
    min-width: 200px;
}

.activity-indicator {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 50%;
    flex-shrink: 0;
}

.activity-message-box .activity-icon {
    font-size: 0.8rem;
}

.activity-details {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.activity-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.activity-message-box .activity-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    word-break: break-word;
}

.activity-file {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.375rem;
    font-size: 0.75rem;
}

.file-icon {
    font-size: 0.8rem;
}

.file-path {
    color: var(--accent-secondary);
    font-family: monospace;
    word-break: break-all;
}

.activity-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-left: auto;
    flex-shrink: 0;
}

/* Activity Type Colors */
.activity-reading { border-left-color: #3b82f6; }
.activity-reading .activity-indicator { background: rgba(59, 130, 246, 0.15); }

.activity-writing { border-left-color: #10b981; }
.activity-writing .activity-indicator { background: rgba(16, 185, 129, 0.15); }

.activity-searching { border-left-color: #f59e0b; }
.activity-searching .activity-indicator { background: rgba(245, 158, 11, 0.15); }

.activity-editing { border-left-color: #8b5cf6; }
.activity-editing .activity-indicator { background: rgba(139, 92, 246, 0.15); }

.activity-running,
.activity-executing { border-left-color: #ec4899; }
.activity-running .activity-indicator,
.activity-executing .activity-indicator { background: rgba(236, 72, 153, 0.15); }

.activity-creating { border-left-color: #06b6d4; }
.activity-creating .activity-indicator { background: rgba(6, 182, 212, 0.15); }

.activity-analyzing { border-left-color: #6366f1; }
.activity-analyzing .activity-indicator { background: rgba(99, 102, 241, 0.15); }

.activity-tool { border-left-color: #f43f5e; }
.activity-tool .activity-indicator { background: rgba(244, 63, 94, 0.15); }

.activity-thinking { border-left-color: #a855f7; }
.activity-thinking .activity-indicator { background: rgba(168, 85, 247, 0.15); }

.activity-completed { border-left-color: var(--success); }
.activity-completed .activity-indicator { background: rgba(16, 185, 129, 0.15); }

/* Legacy Handoff Message (keep for compatibility) */
.handoff-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.handoff-arrow {
    color: var(--accent-primary);
}

/* Chat Input */
.chat-input-container {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.chat-input-wrapper {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 0.5rem;
}

.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.875rem;
    padding: 0.5rem;
    outline: none;
    resize: none;
    min-height: 24px;
    max-height: 150px;
    overflow-y: auto;
    line-height: 1.4;
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.chat-input-actions {
    display: flex;
    align-items: flex-end;
    gap: 0.25rem;
}

.quick-commands {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.quick-command {
    padding: 0.25rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    font-family: inherit;
    box-shadow: none;
}

.quick-command:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
    color: var(--text-primary);
}

.quick-command:focus {
    outline: none;
    box-shadow: none;
}

.quick-command:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* ===== Screenshot Upload Styles ===== */

/* Drag overlay for chat window */
.chat-window.drag-over {
    position: relative;
}

.drag-overlay {
    position: absolute;
    inset: 0;
    background: rgba(99, 102, 241, 0.15);
    border: 2px dashed var(--accent-primary);
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
    animation: pulse-border 1.5s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% { border-color: var(--accent-primary); }
    50% { border-color: var(--accent-secondary); }
}

.drag-overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-primary);
}

.drag-overlay-icon {
    font-size: 3rem;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.drag-overlay-text {
    font-size: 1rem;
    font-weight: 600;
}

/* Attached files preview */
.attached-files {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    flex-wrap: wrap;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    margin-bottom: -1px;
}

.attached-file {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    max-width: 200px;
}

.attached-file-preview {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.attached-file-name {
    flex: 1;
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attached-file-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    padding: 0;
    border: none;
    background: var(--error);
    color: white;
    font-size: 12px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.attached-file:hover .attached-file-remove {
    opacity: 1;
}

.attached-file-remove:hover {
    background: var(--error-light);
}

/* Upload progress indicator */
.upload-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    margin-bottom: -1px;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.upload-progress-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Attach button in input */
.btn-attach {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    font-size: 1rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-attach:hover:not(:disabled) {
    background: var(--bg-hover);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-attach:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* When files are attached, show rounded top on input wrapper */
.chat-input-container:has(.attached-files) .chat-input-wrapper,
.chat-input-container:has(.upload-progress) .chat-input-wrapper {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* ===== Notes Panel ===== */
.notes-panel {
    display: flex;
    height: 100%;
    background: var(--bg-primary);
}

.notes-sidebar {
    width: 280px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
}

.notes-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.notes-sidebar-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.notes-search {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.notes-search input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.notes-search input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.notes-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.notes-list-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.notes-list-item {
    position: relative;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.notes-list-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
}

.notes-list-item.active {
    background: var(--bg-active);
    border-color: var(--accent-primary);
}

.notes-list-item-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notes-list-item-preview {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.notes-list-item-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.notes-list-item-delete {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 20px;
    height: 20px;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.notes-list-item:hover .notes-list-item-delete {
    opacity: 1;
}

.notes-list-item-delete:hover {
    background: var(--error);
    color: white;
}

/* Notes Editor */
.notes-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.notes-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.notes-editor-title {
    flex: 1;
    padding: 0.5rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
}

.notes-editor-title:hover {
    border-color: var(--border-color);
}

.notes-editor-title:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: var(--bg-tertiary);
}

.notes-editor-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.notes-editor-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.notes-editor-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.notes-editor-textarea {
    flex: 1;
    width: 100%;
    padding: 1.5rem;
    background: var(--bg-primary);
    border: none;
    color: var(--text-primary);
    font-size: 0.9375rem;
    line-height: 1.7;
    font-family: 'Inter', sans-serif;
    resize: none;
}

.notes-editor-textarea:focus {
    outline: none;
}

.notes-editor-textarea::placeholder {
    color: var(--text-muted);
}

.notes-editor-preview {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background: var(--bg-primary);
}

.notes-markdown {
    color: var(--text-primary);
    font-size: 0.9375rem;
    line-height: 1.7;
}

.notes-markdown h1, .notes-markdown h2, .notes-markdown h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: var(--text-primary);
}

.notes-markdown h1 { font-size: 1.5rem; }
.notes-markdown h2 { font-size: 1.25rem; }
.notes-markdown h3 { font-size: 1.1rem; }

.notes-markdown p {
    margin-bottom: 1em;
}

.notes-markdown ul, .notes-markdown ol {
    margin-bottom: 1em;
    padding-left: 1.5em;
}

.notes-markdown li {
    margin-bottom: 0.25em;
}

.notes-markdown code {
    background: var(--bg-tertiary);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.875em;
}

.notes-markdown pre {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin-bottom: 1em;
}

.notes-markdown pre code {
    background: transparent;
    padding: 0;
}

.notes-markdown blockquote {
    border-left: 3px solid var(--accent-primary);
    margin: 1em 0;
    padding-left: 1em;
    color: var(--text-secondary);
}

.notes-markdown a {
    color: var(--accent-primary);
}

.notes-markdown a:hover {
    color: var(--accent-secondary);
}

/* Notes Empty States */
.notes-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 2rem;
}

.notes-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.notes-empty-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.notes-empty-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.notes-editor-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

.notes-editor-empty {
    color: var(--text-muted);
    font-style: italic;
}

/* Preview Tab Icons */
.preview-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-tab-icon {
    font-size: 1rem;
}

.preview-tab-label {
    font-size: 0.875rem;
}

/* ===== Claude Chat ===== */
.claude-chat {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-primary);
}

.claude-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.claude-chat-header-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.claude-chat-header-icon {
    font-size: 1.5rem;
}

.claude-chat-header-title {
    font-weight: 600;
    color: var(--text-primary);
}

.claude-chat-header-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.claude-chat-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.claude-chat-info-icon {
    font-size: 1rem;
}

.claude-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.claude-chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 2rem;
}

.claude-chat-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.claude-chat-empty-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.claude-chat-empty-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
    max-width: 400px;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.claude-chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    max-width: 500px;
}

.claude-chat-suggestion {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.claude-chat-suggestion:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.claude-chat-message {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.claude-chat-message.user {
    flex-direction: row-reverse;
}

.claude-chat-message-avatar {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 50%;
    font-size: 1rem;
    flex-shrink: 0;
}

.claude-chat-message.user .claude-chat-message-avatar {
    background: var(--accent-primary);
}

.claude-chat-message.assistant .claude-chat-message-avatar {
    background: var(--bg-tertiary);
}

.claude-chat-message-content {
    flex: 1;
    max-width: 80%;
}

.claude-chat-message.user .claude-chat-message-content {
    text-align: right;
}

.claude-chat-message-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.claude-chat-message.user .claude-chat-message-header {
    justify-content: flex-end;
}

.claude-chat-message-role {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.claude-chat-message-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.claude-chat-message-text {
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-lg);
    color: var(--text-primary);
    font-size: 0.875rem;
    line-height: 1.6;
}

.claude-chat-message.user .claude-chat-message-text {
    background: var(--accent-primary);
    color: white;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 4px var(--border-radius-lg);
}

.claude-chat-message.assistant .claude-chat-message-text {
    border-radius: var(--border-radius-lg) var(--border-radius-lg) var(--border-radius-lg) 4px;
}

.claude-chat-message.error .claude-chat-message-text {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
}

.claude-chat-message-text p {
    margin-bottom: 0.5em;
}

.claude-chat-message-text p:last-child {
    margin-bottom: 0;
}

.claude-chat-message-text code {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.85em;
}

.claude-chat-message-text pre {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin: 0.5em 0;
}

.claude-chat-message-text pre code {
    background: transparent;
    padding: 0;
}

.claude-chat-message-text ul, .claude-chat-message-text ol {
    margin: 0.5em 0;
    padding-left: 1.5em;
}

.claude-chat-message-text h1, .claude-chat-message-text h2, .claude-chat-message-text h3 {
    margin: 1em 0 0.5em 0;
    font-weight: 600;
}

.claude-chat-message-text h1 { font-size: 1.25em; }
.claude-chat-message-text h2 { font-size: 1.1em; }
.claude-chat-message-text h3 { font-size: 1em; }

/* Loading animation */
.claude-chat-loading {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
}

.claude-chat-loading-dot {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: claude-chat-bounce 1.4s ease-in-out infinite;
}

.claude-chat-loading-dot:nth-child(1) { animation-delay: -0.32s; }
.claude-chat-loading-dot:nth-child(2) { animation-delay: -0.16s; }
.claude-chat-loading-dot:nth-child(3) { animation-delay: 0s; }

@keyframes claude-chat-bounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.claude-chat-loading-text {
    margin-left: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Input area */
.claude-chat-input-container {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.claude-chat-input-wrapper {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 0.5rem;
}

.claude-chat-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.875rem;
    padding: 0.5rem;
    outline: none;
    resize: none;
    min-height: 24px;
    max-height: 150px;
    font-family: inherit;
}

.claude-chat-input::placeholder {
    color: var(--text-muted);
}

/* ===== Command Dropdown ===== */
.command-dropdown {
    position: relative;
}

.command-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}

.command-dropdown-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.command-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    max-height: 400px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: slideDown 0.2s ease;
    z-index: 200;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.command-search {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.command-search input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.command-search input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.command-list {
    max-height: 300px;
    overflow-y: auto;
}

.command-category {
    padding: 0.5rem 0;
}

.command-category-title {
    padding: 0.375rem 1rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.command-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.command-item:hover {
    background: var(--bg-hover);
}

.command-name {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.8rem;
    color: var(--accent-secondary);
}

.command-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ===== Preview Area ===== */
.preview-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    overflow: hidden;
}

.preview-tabs {
    display: flex;
    gap: 0;
    padding: 0 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.preview-tab {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
}

.preview-tab:hover {
    color: var(--text-primary);
}

.preview-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent-primary);
}

.preview-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.preview-content > * {
    flex: 1;
    overflow: auto;
}

.preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
    border-radius: var(--border-radius);
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
}

.preview-placeholder-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.preview-placeholder-text {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.preview-placeholder-hint {
    font-size: 0.875rem;
    opacity: 0.7;
}

/* ===== File Browser ===== */
.file-browser {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.file-browser-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.file-browser-title {
    font-weight: 600;
}

.file-content-viewer {
    display: flex;
    flex-direction: column;
    height: calc(100% - 60px);
    overflow: hidden;
}

.file-content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
    font-family: var(--font-mono);
}

.file-content-body {
    flex: 1;
    margin: 0;
    padding: 1rem;
    overflow: auto;
    background: var(--bg-primary);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.file-content-body code {
    font-family: var(--font-mono);
    white-space: pre-wrap;
    word-break: break-word;
}

.agent-folder {
    border-bottom: 1px solid var(--border-color);
}

.agent-folder-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.agent-folder-header:hover {
    background: var(--bg-hover);
}

.agent-folder-icon {
    font-size: 1.25rem;
}

.agent-folder-name {
    flex: 1;
    font-weight: 500;
}

.agent-folder-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 0.125rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 999px;
}

.agent-folder-chevron {
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.agent-folder.expanded .agent-folder-chevron {
    transform: rotate(90deg);
}

.file-list {
    padding: 0.5rem;
    background: var(--bg-primary);
}

.file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.file-item:hover {
    background: var(--bg-hover);
}

.file-item.selected {
    background: var(--bg-active);
}

.file-item-icon {
    font-size: 1rem;
    color: var(--text-muted);
}

.file-item-name {
    flex: 1;
    font-size: 0.875rem;
}

.file-item-size {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.file-item-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.file-item:hover .file-item-actions {
    opacity: 1;
}

/* Project list items */
.project-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem;
}

.project-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.project-item:hover {
    background: var(--bg-hover);
}

.project-item-icon {
    font-size: 1.25rem;
}

.project-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.project-item-name {
    font-weight: 500;
    color: var(--text-primary);
}

.project-item-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.project-item-chevron {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ===== Template Modal ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal {
    width: 95%;
    max-width: 1400px;
    height: 90vh;
    max-height: 95vh;
    background: #0a0a0f;
    border-radius: 12px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    animation: scaleIn 0.2s ease;
    overflow: hidden;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Modal Header - Component Explorer Style */
.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: #0a0a0f;
}

.modal-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 0.5rem 0;
}

.modal-subtitle {
    color: #6b7280;
    font-size: 0.875rem;
}

.modal-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.modal-search {
    width: 250px;
    padding: 0.5rem 1rem;
    background: #12121a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #ffffff;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.modal-search:focus {
    outline: none;
    border-color: #6366f1;
}

.modal-search::placeholder {
    color: #6b7280;
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.2s;
    line-height: 1;
    border-radius: 6px;
}

.modal-close:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

/* Category Tabs - Horizontal like Component Explorer */
.modal-category-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.modal-category-tab {
    padding: 0.5rem 1rem;
    background: #12121a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    font-weight: 500;
}

.modal-category-tab:hover {
    background: #1a1a24;
    color: #ffffff;
}

.modal-category-tab.active {
    background: #6366f1;
    border-color: #6366f1;
    color: #ffffff;
}

/* Modal Body */
.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    min-height: 0;
    background: #0a0a0f;
}

.modal-sidebar {
    display: none;
}

.modal-content {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Template Grid - Component Explorer Style */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Template Card - Exact Component Explorer Style */
.template-card {
    background: #12121a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
}

.template-card:hover {
    border-color: #6366f1;
}

/* Card Header */
.template-card-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.template-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #ffffff;
}

.template-tag {
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
    background: rgba(99, 102, 241, 0.2);
    color: #6366f1;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Card Preview - scaled down content */
.template-preview {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    overflow: hidden;
    position: relative;
}

.template-preview.dark-bg {
    background: #1f2937;
}

/* Scaled preview container */
.template-preview-wrapper {
    transform: scale(0.25);
    transform-origin: center center;
    width: 400%;
    pointer-events: none;
}

/* Card Info */
.template-info {
    padding: 1rem;
    font-size: 0.75rem;
    color: #6b7280;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.template-description {
    line-height: 1.4;
}

/* Hide action buttons - click card to preview */
.template-actions {
    display: none;
}

/* Legacy thumbnail support */
.template-thumbnail {
    height: 120px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

/* Empty State */
.template-empty {
    text-align: center;
    padding: 4rem 2rem;
}

.template-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.template-empty-text {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.template-empty-hint {
    font-size: 0.875rem;
    color: #6b7280;
}

/* ===== Settings Panel ===== */
.settings-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    height: 100%;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.settings-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.settings-tabs {
    display: flex;
    padding: 0 1rem;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.settings-tab {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.settings-tab:hover {
    color: var(--text-primary);
}

.settings-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent-primary);
}

.settings-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.setting-group {
    margin-bottom: 1.5rem;
}

.setting-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.setting-select {
    width: 100%;
    padding: 0.625rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.setting-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--bg-tertiary);
    border-radius: 999px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.toggle-switch.active {
    background: var(--accent-primary);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform var(--transition-fast);
}

.toggle-switch.active::after {
    transform: translateX(20px);
}

.settings-footer {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* ===== Help Panel ===== */
.help-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 500px;
    height: 100%;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    animation: slideInRight 0.3s ease;
}

.help-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.help-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.help-sidebar {
    width: 180px;
    padding: 1rem;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
}

.help-category {
    margin-bottom: 1.5rem;
}

.help-category-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.help-link {
    display: block;
    padding: 0.375rem 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.help-link:hover {
    color: var(--accent-secondary);
}

.help-content {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
}

.help-article h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.help-article p {
    margin-bottom: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.help-article ol, .help-article ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.help-article li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.help-article code {
    padding: 0.125rem 0.375rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85em;
    color: var(--accent-secondary);
}

.shortcut-table {
    width: 100%;
    border-collapse: collapse;
}

.shortcut-row {
    display: flex;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.shortcut-key {
    width: 120px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.8rem;
    color: var(--accent-secondary);
    background: var(--bg-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.shortcut-desc {
    flex: 1;
    padding-left: 1rem;
    color: var(--text-secondary);
}

/* ===== Command Palette ===== */
.command-palette-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    z-index: 2000;
}

.command-palette {
    width: 600px;
    max-height: 60vh;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: scaleIn 0.15s ease;
}

.command-palette-input {
    width: 100%;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1.125rem;
    outline: none;
}

.command-palette-results {
    max-height: calc(60vh - 60px);
    overflow-y: auto;
}

.palette-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.palette-item:hover, .palette-item.selected {
    background: var(--bg-hover);
}

.palette-icon {
    font-size: 1.125rem;
}

.palette-label {
    flex: 1;
}

.palette-shortcut {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: 'Monaco', 'Menlo', monospace;
}

/* ===== Quick Actions Bar ===== */
.quick-actions-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.quick-action:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
    color: var(--text-primary);
}

.quick-action-icon {
    font-size: 1rem;
}

.quick-action-shortcut {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-left: 0.25rem;
}

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 3000;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    min-width: 300px;
    max-width: 400px;
    animation: slideInUp 0.3s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toast.fading {
    animation: fadeOut 0.5s ease forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.toast.success {
    border-left: 3px solid var(--success);
}

.toast.error {
    border-left: 3px solid var(--error);
}

.toast.warning {
    border-left: 3px solid var(--warning);
}

.toast.info {
    border-left: 3px solid var(--info);
}

.toast-icon {
    font-size: 1.125rem;
}

.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--error); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info .toast-icon { color: var(--info); }

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.125rem;
}

.toast-message {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.toast-dismiss {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.125rem;
    padding: 0;
    line-height: 1;
}

.toast-dismiss:hover {
    color: var(--text-primary);
}

/* ===== Validation Dashboard ===== */
.validation-dashboard {
    padding: 1.5rem;
}

.validation-gate {
    background: var(--bg-tertiary);
    border-radius: var(--border-radius-lg);
    margin-bottom: 1rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.validation-gate.critical {
    border-color: var(--warning);
}

.gate-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-secondary);
}

.gate-icon {
    font-size: 1.125rem;
}

.gate-icon.passed { color: var(--success); }
.gate-icon.failed { color: var(--error); }
.gate-icon.pending { color: var(--text-muted); }

.gate-name {
    flex: 1;
    font-weight: 500;
}

.gate-status {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
}

.gate-status.passed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.gate-status.failed {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.critical-badge {
    font-size: 0.65rem;
    padding: 0.125rem 0.5rem;
    background: var(--warning);
    color: var(--bg-primary);
    border-radius: 4px;
    font-weight: 600;
}

.gate-checks {
    padding: 1rem;
}

.gate-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0;
    font-size: 0.875rem;
}

.gate-check-icon {
    width: 16px;
    text-align: center;
}

.gate-check.passed .gate-check-icon { color: var(--success); }
.gate-check.failed .gate-check-icon { color: var(--error); }
.gate-check.pending .gate-check-icon { color: var(--text-muted); }

.gate-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
}

/* ===== Activity Log ===== */
.activity-log {
    padding: 1.5rem;
}

.log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.log-filter {
    padding: 0.375rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.8rem;
}

.log-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.log-entry {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
}

.log-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    width: 60px;
    flex-shrink: 0;
}

.log-icon {
    font-size: 1rem;
}

.log-entry.agent .log-icon { color: var(--agent-orchestrator); }
.log-entry.command .log-icon { color: var(--accent-primary); }
.log-entry.file .log-icon { color: var(--info); }
.log-entry.validation .log-icon { color: var(--warning); }
.log-entry.error .log-icon { color: var(--error); }

.log-content {
    flex: 1;
}

.log-title {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.125rem;
}

.log-details {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ===== Mode Toggle ===== */
.mode-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mode-toggle-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.mode-toggle-switch {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.mode-option {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mode-option:hover {
    color: var(--text-primary);
}

.mode-option.active {
    background: var(--accent-primary);
    color: white;
}

/* ===== Token Meter ===== */
.token-meter {
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.token-meter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
}

.token-meter-label {
    color: var(--text-muted);
    font-weight: 500;
}

.token-meter-value {
    color: var(--text-secondary);
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.7rem;
}

.token-meter-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.token-meter-fill {
    height: 100%;
    min-width: 2px;
    border-radius: 4px;
    transition: width 0.3s ease, background-color 0.3s ease;
    background: var(--color-success, #10b981);
}

.token-meter-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.token-meter-percent {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.token-meter-percent.warning {
    color: var(--warning);
}

.token-meter-compact-btn {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.token-meter-compact-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

/* Token Meter Compact (inline version) */
.token-meter-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.token-meter-compact-bar {
    width: 40px;
    height: 4px;
    background: var(--bg-hover);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.token-meter-compact-bar::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: var(--percent);
    background: var(--color);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.token-meter-compact-text {
    font-size: 0.7rem;
    font-weight: 600;
    font-family: 'Monaco', 'Menlo', monospace;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
    .sidebar {
        width: 240px;
    }

    .chat-window {
        width: 360px;
    }
}

@media (max-width: 992px) {
    .main-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .chat-window {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
}

/* ===== Code Viewer ===== */
.code-viewer {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-primary);
}

.code-viewer-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.code-viewer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.code-viewer-file-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex: 1;
}

.code-viewer-icon {
    font-size: 1rem;
    flex-shrink: 0;
}

.code-viewer-filename {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.code-viewer-path {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.code-viewer-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.code-viewer-language {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius);
    text-transform: uppercase;
}

.code-viewer-content {
    display: flex;
    flex: 1;
    overflow: auto;
    font-family: 'SF Mono', 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

.code-viewer-lines {
    padding: 1rem 0.75rem;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    text-align: right;
    user-select: none;
    flex-shrink: 0;
}

.code-viewer-lines pre {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.code-viewer-code {
    flex: 1;
    padding: 1rem;
    overflow-x: auto;
}

.code-viewer-code pre {
    margin: 0;
}

.code-viewer-code code {
    color: var(--text-primary);
    white-space: pre;
    tab-size: 4;
}

/* Syntax highlighting - basic */
.code-viewer-code .keyword { color: #c792ea; }
.code-viewer-code .string { color: #c3e88d; }
.code-viewer-code .number { color: #f78c6c; }
.code-viewer-code .comment { color: #546e7a; }
.code-viewer-code .function { color: #82aaff; }
.code-viewer-code .variable { color: #f07178; }

/* ===== Website Preview ===== */
.website-preview {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-primary);
}

.preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    gap: 1rem;
}

.preview-toolbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.preview-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.device-selector {
    display: flex;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    padding: 0.25rem;
    gap: 0.25rem;
}

.device-btn {
    padding: 0.375rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: calc(var(--border-radius) - 2px);
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}

.device-btn:hover {
    background: var(--bg-hover);
}

.device-btn.active {
    background: var(--accent-primary);
    color: white;
}

.page-selector {
    padding: 0.375rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
}

.page-selector:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.preview-url {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: monospace;
}

.preview-frame-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--bg-tertiary);
    overflow: auto;
    min-height: 0;
}

.preview-frame-wrapper {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    position: relative;
}

.preview-frame-wrapper.desktop {
    width: 100%;
    height: 100%;
    border-radius: 0;
    box-shadow: none;
}

.preview-frame-wrapper.tablet {
    border-radius: 20px;
    border: 8px solid #333;
    max-height: 100%;
    flex-shrink: 0;
}

.preview-frame-wrapper.mobile {
    border-radius: 30px;
    border: 8px solid #333;
    max-height: 100%;
    flex-shrink: 0;
}

.device-frame-header {
    background: #333;
    padding: 0.5rem;
    display: flex;
    justify-content: center;
    flex-shrink: 0;
    height: 30px;
    box-sizing: border-box;
}

.device-notch {
    width: 60px;
    height: 6px;
    background: #1a1a1a;
    border-radius: 3px;
}

.preview-iframe {
    width: 100%;
    border: none;
    background: white;
}

.preview-frame-wrapper.desktop .preview-iframe {
    flex: 1;
    height: 100%;
}

.preview-frame-wrapper.mobile .preview-iframe,
.preview-frame-wrapper.tablet .preview-iframe {
    flex: 1;
    height: calc(100% - 30px);
}

/* ===== Floating Windows ===== */
.floating-window {
    position: fixed;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow var(--transition-fast);
}

.floating-window.dragging {
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6), 0 0 30px rgba(99, 102, 241, 0.2);
    cursor: grabbing;
}

.floating-window.minimized {
    height: auto !important;
    width: auto !important;
    min-width: 200px;
}

.floating-window-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    cursor: grab;
    user-select: none;
    flex-shrink: 0;
}

.floating-window.dragging .floating-window-header {
    cursor: grabbing;
}

.floating-window-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.floating-window-icon {
    font-size: 1.1rem;
}

.floating-window-controls {
    display: flex;
    gap: 0.25rem;
}

.floating-window-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all var(--transition-fast);
}

.floating-window-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.floating-window-btn.close:hover {
    background: var(--error);
    color: white;
}

.floating-window-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.floating-window-resize-handle {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 24px;
    height: 24px;
    cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 50%, var(--border-color) 50%);
    border-radius: 0 0 var(--border-radius-lg) 0;
    z-index: 10;
}

.floating-window-resize-handle:hover {
    background: linear-gradient(135deg, transparent 50%, var(--accent-primary) 50%);
}

/* Disable pointer events on content during resize to prevent iframe capture */
.floating-window.resizing .floating-window-content {
    pointer-events: none;
}

.floating-window.resizing .floating-window-content * {
    pointer-events: none;
}

.floating-window.resizing {
    user-select: none;
}

/* Preview tabs spacer for floating toggles */
.preview-tabs-spacer {
    flex: 1;
}

/* Floating toggle buttons styling - match regular tabs */
.preview-tab.floating-toggle {
    /* Inherits all .preview-tab styles */
}

.preview-tab.floating-toggle.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent-primary);
}

/* Floating NotesPanel adjustments */
.notes-panel.floating {
    height: 100%;
    border-radius: 0;
}

.notes-panel.floating .notes-sidebar {
    width: 140px;
    min-width: 140px;
}

.notes-panel.floating .notes-sidebar-header h3 {
    font-size: 0.85rem;
}

.notes-panel.floating .notes-list-item {
    padding: 0.5rem;
}

.notes-panel.floating .notes-list-item-title {
    font-size: 0.8rem;
}

.notes-panel.floating .notes-list-item-preview {
    font-size: 0.7rem;
}

/* Floating ClaudeChat adjustments */
.claude-chat.floating {
    height: 100%;
    border-radius: 0;
}

.claude-chat.floating .claude-chat-header {
    padding: 0.5rem 0.75rem;
    display: flex; /* Show header in floating mode for history toggle */
}

.claude-chat.floating .claude-chat-info {
    border-radius: 0;
    margin: 0;
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
}

.claude-chat.floating .claude-chat-messages {
    padding: 0.75rem;
}

.claude-chat.floating .claude-chat-message {
    padding: 0.5rem;
}

.claude-chat.floating .claude-chat-input-container {
    padding: 0.5rem;
}

.claude-chat.floating .claude-chat-empty {
    padding: 1rem;
}

.claude-chat.floating .claude-chat-empty-icon {
    font-size: 2rem;
}

.claude-chat.floating .claude-chat-suggestion {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
}

/* Claude Chat History Styles */
.claude-chat-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.claude-chat-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.claude-chat-history-toggle {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-size: 1rem;
    margin-right: 0.5rem;
    transition: all var(--transition-fast);
}

.claude-chat-history-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.claude-chat-new-btn {
    padding: 0.375rem 0.75rem;
    background: var(--accent-primary);
    border: none;
    border-radius: var(--border-radius);
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.claude-chat-new-btn:hover {
    background: var(--accent-hover);
}

.claude-chat-history {
    width: 200px;
    min-width: 200px;
    background: var(--bg-tertiary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.claude-chat-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.claude-chat-history-count {
    background: var(--bg-hover);
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.claude-chat-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.claude-chat-history-empty {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.claude-chat-history-item {
    position: relative;
    padding: 0.625rem 0.75rem;
    padding-right: 2rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.claude-chat-history-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
}

.claude-chat-history-item.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.claude-chat-history-item.active .claude-chat-history-item-title,
.claude-chat-history-item.active .claude-chat-history-item-meta {
    color: white;
}

.claude-chat-history-item-title {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.claude-chat-history-item-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.claude-chat-history-item-delete {
    position: absolute;
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 1rem;
    opacity: 0;
    transition: all var(--transition-fast);
}

.claude-chat-history-item:hover .claude-chat-history-item-delete {
    opacity: 1;
}

.claude-chat-history-item-delete:hover {
    background: var(--error);
    color: white;
}

.claude-chat-history-item.active .claude-chat-history-item-delete {
    color: rgba(255, 255, 255, 0.7);
}

.claude-chat-history-item.active .claude-chat-history-item-delete:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Floating mode history adjustments */
.claude-chat.floating .claude-chat-history {
    width: 160px;
    min-width: 160px;
}

.claude-chat.floating .claude-chat-history-item {
    padding: 0.5rem;
    padding-right: 1.5rem;
}

.claude-chat.floating .claude-chat-history-item-title {
    font-size: 0.7rem;
}

.claude-chat.floating .claude-chat-history-item-meta {
    font-size: 0.6rem;
}

/* ===== Claude Chat Mode Toggle ===== */
.claude-chat-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.claude-chat-mode-toggle {
    display: flex;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2px;
}

.claude-chat-mode-toggle .mode-btn {
    padding: 0.25rem 0.5rem;
    background: transparent;
    border: none;
    border-radius: calc(var(--border-radius) - 2px);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    opacity: 0.6;
}

.claude-chat-mode-toggle .mode-btn:hover {
    opacity: 1;
}

.claude-chat-mode-toggle .mode-btn.active {
    background: var(--accent-primary);
    opacity: 1;
}

/* ===== Code Playground ===== */
.code-playground {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    background: var(--bg-secondary);
}

.code-playground-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    gap: 0.5rem;
    flex-wrap: wrap;
}

.code-playground-tabs {
    display: flex;
    gap: 0.25rem;
}

.code-playground-tab {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.code-playground-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.code-playground-tab.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.code-playground-actions {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.code-playground-autorun {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.code-playground-autorun input {
    cursor: pointer;
}

.code-playground-btn {
    padding: 0.25rem 0.5rem;
    background: var(--accent-primary);
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.7rem;
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.code-playground-btn:hover {
    background: var(--accent-hover);
}

.code-playground-btn.secondary {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.code-playground-btn.secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.console-badge {
    background: var(--error);
    color: white;
    font-size: 0.6rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    min-width: 16px;
    text-align: center;
}

.code-playground-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.code-playground-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    min-width: 0;
}

.code-playground-textarea {
    flex: 1;
    padding: 0.75rem;
    background: var(--bg-primary);
    border: none;
    color: var(--text-primary);
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    resize: none;
    outline: none;
    tab-size: 2;
}

.code-playground-textarea::placeholder {
    color: var(--text-muted);
}

.code-playground-preview {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.code-playground-preview-header {
    padding: 0.375rem 0.75rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.code-playground-iframe {
    flex: 1;
    border: none;
    background: white;
}

.code-playground-console {
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
    max-height: 150px;
    display: flex;
    flex-direction: column;
}

.code-playground-console-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.375rem 0.75rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.code-playground-console-header button {
    padding: 0.125rem 0.375rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.65rem;
    color: var(--text-muted);
    cursor: pointer;
}

.code-playground-console-header button:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.code-playground-console-output {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.7rem;
}

.code-playground-console-empty {
    color: var(--text-muted);
    font-style: italic;
}

.console-entry {
    display: flex;
    gap: 0.5rem;
    padding: 0.125rem 0;
    border-bottom: 1px solid var(--border-color);
}

.console-entry.error {
    color: var(--error);
}

.console-entry.warn {
    color: var(--warning);
}

.console-entry.log {
    color: var(--text-primary);
}

.console-time {
    color: var(--text-muted);
    flex-shrink: 0;
}

.console-text {
    word-break: break-all;
}

/* Floating mode playground adjustments */
.claude-chat.floating .code-playground-toolbar {
    padding: 0.375rem;
}

.claude-chat.floating .code-playground-tab {
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
}

.claude-chat.floating .code-playground-btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.65rem;
}

.claude-chat.floating .code-playground-textarea {
    font-size: 0.75rem;
    padding: 0.5rem;
}

.claude-chat.floating .code-playground-console {
    max-height: 100px;
}


/* ===== Chat History Dropdown ===== */
.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-history-dropdown {
    position: relative;
}

.chat-history-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    font-size: 0.8rem;
    max-width: 180px;
}

.chat-history-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.chat-history-icon {
    font-size: 1rem;
}

.chat-history-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    text-align: left;
}

.chat-history-arrow {
    font-size: 0.6rem;
    color: var(--text-muted);
}

.chat-history-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    max-height: 400px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.chat-history-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.chat-history-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.chat-history-action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.chat-history-action-btn.new-chat:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.chat-history-action-btn.save-chat:hover {
    border-color: var(--success);
    color: var(--success);
}

.chat-history-list {
    overflow-y: auto;
    max-height: 320px;
    padding: 0.5rem;
}

.chat-history-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.chat-history-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.25rem;
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chat-history-item:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
}

.chat-history-item.active {
    background: var(--bg-active);
    border-color: var(--accent-primary);
}

.chat-history-item-content {
    flex: 1;
    overflow: hidden;
}

.chat-history-item-title {
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.chat-history-item-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.chat-history-item-agent {
    font-size: 0.85rem;
}

.chat-history-item-date,
.chat-history-item-count {
    color: var(--text-muted);
}

.chat-history-item-delete {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 1rem;
    color: var(--text-muted);
    opacity: 0;
    transition: all var(--transition-fast);
}

.chat-history-item:hover .chat-history-item-delete {
    opacity: 1;
}

.chat-history-item-delete:hover {
    background: var(--error);
    color: white;
}
