/**
 * SEO Strategist Agent - Chat Interface Styles
 * A sophisticated, modern design for the AI strategy assistant
 */

/* ============================================
   Base Reset - Ensure full viewport coverage
   ============================================ */
html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: #ffffff;
}

#strategist-app {
    min-height: 100vh;
}

/* ============================================
   CSS Variables & Theme - AIROPS BRAND
   ============================================ */
:root {
    /* AirOps Brand Colors */
    --airops-forest: #1a3a32;
    --airops-forest-light: #2d5248;
    --airops-forest-dark: #0d2e27;
    --airops-lime: #c6e54d;
    --airops-lime-bright: #d4f050;
    --airops-lime-soft: rgba(198, 229, 77, 0.15);
    --airops-lime-glow: rgba(198, 229, 77, 0.4);
    --airops-teal: #5a9a8a;
    --airops-teal-soft: rgba(90, 154, 138, 0.15);
    
    /* Core Theme */
    --strategist-bg: #fafafa;
    --strategist-surface: #f3f4f6;
    --strategist-surface-elevated: #ffffff;
    --strategist-border: #e5e7eb;
    --strategist-border-subtle: rgba(0, 0, 0, 0.04);
    
    /* Primary colors - AirOps Forest Green */
    --strategist-primary: var(--airops-forest);
    --strategist-primary-glow: rgba(26, 58, 50, 0.12);
    --strategist-secondary: var(--airops-forest-light);
    --strategist-accent: var(--airops-lime);
    --strategist-accent-gradient: linear-gradient(135deg, var(--airops-forest) 0%, var(--airops-teal) 100%);
    
    /* Mode colors - Teal tones */
    --instant-color: var(--airops-teal);
    --planner-color: var(--airops-forest);
    
    /* Text - Refined hierarchy */
    --text-primary: #18181b;
    --text-secondary: #52525b;
    --text-tertiary: #a1a1aa;
    --text-muted: #a1a1aa;
    --text-link: var(--airops-forest);
    
    /* Status */
    --success: #16a34a;
    --warning: #ca8a04;
    --error: #dc2626;
    
    /* Typography - Premium fonts */
    --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
    --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Response content sizing */
    --content-max-width: 1200px;
    --content-line-height: 1.6;
    --content-paragraph-spacing: 1em;
    
    /* Shadows - Subtle and layered */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
}

/* ============================================
   Layout
   ============================================ */
.strategist-container {
    display: flex;
    flex-direction: row;
    height: 100vh;
    overflow: hidden;
    background: var(--strategist-bg);
    color: var(--text-primary);
    font-family: var(--font-sans);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    overflow: hidden;
}

/* ============================================
   Conversation Sidebar
   ============================================ */
.conversation-sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--strategist-surface-elevated);
    border-right: 1px solid var(--strategist-border);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 100;
}

.strategist-container:not(.sidebar-open) .conversation-sidebar {
    width: 0;
    min-width: 0;
    border-right: none;
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--strategist-border-subtle);
}

.new-chat-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--airops-forest);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-sans);
    width: 100%;
    box-shadow: var(--shadow-md);
    letter-spacing: -0.01em;
}

.new-chat-btn:hover {
    background: var(--airops-forest-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--airops-lime-soft);
}

.new-chat-btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

.new-chat-icon {
    font-size: 1.125rem;
    font-weight: 300;
}

.sidebar-toggle {
    display: none;
}

.sidebar-expand-btn {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 48px;
    background: linear-gradient(135deg, var(--airops-forest) 0%, var(--airops-teal) 100%);
    border: none;
    border-radius: 0 8px 8px 0;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    z-index: 50;
    transition: all 0.2s ease;
    opacity: 0;
    visibility: hidden;
    box-shadow: 2px 0 8px rgba(26, 58, 50, 0.25);
}

.strategist-container:not(.sidebar-open) .sidebar-expand-btn {
    opacity: 1;
    visibility: visible;
}

.sidebar-expand-btn:hover {
    background: linear-gradient(135deg, var(--airops-forest-light) 0%, var(--airops-teal) 100%);
    color: white;
    width: 32px;
    box-shadow: 3px 0 12px rgba(26, 58, 50, 0.35);
}

.conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.conversation-list::-webkit-scrollbar {
    width: 6px;
}

.conversation-list::-webkit-scrollbar-thumb {
    background: var(--strategist-border);
    border-radius: 3px;
}

.conversations-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.no-conversations {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 3rem 1rem;
    text-align: center;
    color: var(--text-muted);
}

.no-conversations-icon {
    font-size: 2rem;
    opacity: 0.5;
}

.no-conversations p {
    margin: 0;
    font-size: 0.875rem;
}

.no-conversations-hint {
    font-size: 0.75rem !important;
    color: var(--text-muted);
}

.conversation-group {
    margin-bottom: 1.25rem;
}

.conversation-group-title {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    padding: 0.5rem 0.75rem 0.5rem;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 0.125rem;
    position: relative;
}

.conversation-item:not(.active) {
    opacity: 0.75;
}

.conversation-item:hover {
    background: var(--airops-lime-soft);
}

.conversation-list:hover .conversation-item:not(.active) {
    opacity: 1;
}

.conversation-item.active {
    background: var(--airops-lime-soft);
    box-shadow: inset 0 0 0 1px rgba(198, 229, 77, 0.3);
}

/* Running agent indicator styles */
.conversation-item.running {
    padding-left: 0.5rem;
}

.conversation-running-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.running-pulse {
    display: block;
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse-ring 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
}

@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(34, 197, 94, 0);
        transform: scale(1.1);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
        transform: scale(1);
    }
}

/* Override opacity for running conversations - always visible */
.conversation-item.running:not(.active) {
    opacity: 1;
}

/* Unread conversation indicator styles */
.conversation-item.unread {
    font-weight: 600;
}

.conversation-item.unread .conversation-title {
    font-weight: 600;
}

.conversation-unread-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
}

.unread-dot {
    display: block;
    width: 8px;
    height: 8px;
    background: var(--accent-primary, #6366f1);
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(99, 102, 241, 0.5);
}

/* Adjust conversation item padding when unread or running indicator is shown */
.conversation-item.unread:not(.running),
.conversation-item.running {
    position: relative;
    padding-left: 1.25rem;
}

/* When both running and unread, show running indicator (takes priority) */
.conversation-item.running.unread .conversation-unread-indicator {
    display: none;
}

/* Streaming indicator for messages - shown when switching back to a running conversation */
.streaming-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 8px 12px;
    background: var(--surface-02);
    border-radius: 6px;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.streaming-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse-ring 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.streaming-text {
    font-style: italic;
}

.conversation-item-content {
    flex: 1;
    min-width: 0;
}

.conversation-title {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.125rem;
}

.conversation-preview {
    display: none;
    font-size: 0.6875rem;
    color: var(--text-muted);
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-favicon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: contain;
    flex-shrink: 0;
    margin-left: auto;
    opacity: 0.8;
    margin-right: 0.5rem;
    opacity: 0.8;
    transition: opacity 0.15s ease;
}

.conversation-item:hover .conversation-favicon {
    opacity: 1;
}

.conversation-item.active .conversation-favicon {
    opacity: 1;
}

.conversation-actions {
    display: flex;
    gap: 0.125rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--strategist-surface);
    padding: 0.125rem;
    border-radius: 6px;
}

.conversation-item:hover .conversation-actions {
    opacity: 1;
    visibility: visible;
}

/* Always show actions if a conversation is starred */
.conversation-actions:has(.star-btn.starred) {
    opacity: 1;
    visibility: visible;
}

.edit-btn,
.star-btn,
.delete-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.edit-btn:hover {
    color: var(--strategist-primary);
    background: rgba(88, 166, 255, 0.1);
}

.star-btn:hover {
    color: #f0883e;
    background: rgba(240, 136, 62, 0.1);
}

.star-btn.starred {
    color: #f0883e;
    opacity: 1;
}

.conversation-item .star-btn.starred {
    opacity: 1;
}

/* Hide star in the Starred section - it's redundant */
.starred-group .star-btn {
    display: none;
}

/* Hide non-starred action buttons when not hovering on starred conversations */
.conversation-actions:has(.star-btn.starred):not(:hover) .edit-btn,
.conversation-actions:has(.star-btn.starred):not(:hover) .delete-btn {
    opacity: 0;
    visibility: hidden;
    width: 0;
    padding: 0;
}

.conversation-item:not(:hover) .conversation-actions:has(.star-btn.starred) {
    opacity: 0.7;
}

.conversation-item:hover .conversation-actions:has(.star-btn.starred) {
    opacity: 1;
}

.delete-btn:hover {
    color: var(--error);
    background: rgba(248, 81, 73, 0.1);
}

.rename-input {
    width: 100%;
    background: var(--strategist-bg);
    border: 1px solid var(--strategist-primary);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    font-family: var(--font-sans);
}

.rename-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--strategist-primary-glow);
}

/* ============================================
   Grid Tab Bar (above grid/doc panel on right)
   ============================================ */
.grid-tab-bar {
    display: none;
    padding: 0.5rem 0.75rem;
    background: var(--strategist-surface-elevated);
    border-bottom: 1px solid var(--strategist-border);
    flex-shrink: 0;
}

.strategist-container.grid-open .grid-tab-bar,
.grid-tab-bar:not(.hidden) {
    display: block;
}

.grid-tab-bar.hidden {
    display: none !important;
}

.grid-tabs {
    display: flex;
    justify-content: flex-start;
    gap: 0.375rem;
    overflow-x: auto;
    padding-bottom: 0;
}

/* Hide scrollbar but keep scroll functionality */
.grid-tabs {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.grid-tabs::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.grid-tab {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    font-family: var(--font-sans);
}

.grid-tab:hover {
    background: var(--strategist-surface);
    color: var(--text-primary);
}

.grid-tab.active {
    background: var(--strategist-surface);
    border-color: var(--strategist-border);
    color: var(--text-primary);
    font-weight: 600;
}

.grid-tab-icon {
    font-size: 0.8rem;
}

.grid-tab-title {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.grid-tab-count {
    font-size: 0.6875rem;
    font-family: var(--font-mono);
    background: rgba(255, 255, 255, 0.08);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    color: var(--text-muted);
}

.grid-tab.active .grid-tab-count {
    background: rgba(88, 166, 255, 0.2);
    color: var(--strategist-primary);
}

.grid-tab-close {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 0.875rem;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.15s ease;
    margin-left: 0.25rem;
}

.grid-tab-close:hover {
    opacity: 1;
    background: rgba(248, 81, 73, 0.15);
    color: var(--error);
}

/* ============================================
   Closed Tabs Restore Button & Dropdown
   ============================================ */
.closed-tabs-restore {
    position: relative;
    margin-left: auto;
}

.restore-tabs-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.625rem;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 6px;
    color: var(--strategist-primary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.restore-tabs-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.35);
}

.restore-tabs-btn .restore-icon {
    font-size: 0.8rem;
}

.restore-tabs-btn .restore-count {
    background: var(--strategist-primary);
    color: white;
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

.closed-tabs-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 220px;
    max-width: 280px;
    background: var(--strategist-surface-elevated);
    border: 1px solid var(--strategist-border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    padding: 0.375rem;
    max-height: 300px;
    overflow-y: auto;
}

.closed-tabs-dropdown.hidden {
    display: none;
}

.closed-tab-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.625rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.closed-tab-item:hover {
    background: var(--strategist-surface);
    color: var(--text-primary);
}

.closed-tab-icon {
    font-size: 0.875rem;
    flex-shrink: 0;
}

.closed-tab-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.closed-tabs-divider {
    height: 1px;
    background: var(--strategist-border);
    margin: 0.375rem 0;
}

.closed-tab-clear {
    display: block;
    width: 100%;
    padding: 0.5rem 0.625rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.closed-tab-clear:hover {
    background: rgba(248, 81, 73, 0.08);
    color: var(--error);
}

.closed-tabs-empty {
    padding: 0.75rem;
    color: var(--text-muted);
    font-size: 0.8125rem;
    text-align: center;
}

/* ============================================
   Workspace Area (Grid + Chat Split)
   ============================================ */
.workspace-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

/* Side-by-side layout when grid is open - using CSS Grid */
.strategist-container.grid-open .workspace-area {
    display: grid;
    grid-template-columns: minmax(400px, 45%) 1fr;
    grid-template-rows: 1fr auto;
    grid-template-areas:
        "chat grid"
        "input grid";
    gap: 0;
}

/* Grid Panel - hidden by default, styled like a card */
.grid-panel {
    display: none;
    flex-direction: column;
    background: var(--strategist-surface-elevated);
    animation: gridPanelSlide 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0; /* Allow shrinking */
    overflow: hidden;
    margin: 1rem;
    margin-left: 0;
    border-radius: 12px;
    border: 1px solid var(--strategist-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
}

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

/* When grid is open: grid takes right side */
.strategist-container.grid-open .grid-panel {
    display: flex;
    grid-area: grid;
}

/* When grid is open: chat on top-left */
.strategist-container.grid-open .chat-area {
    grid-area: chat;
    max-width: none;
    min-width: 0;
    overflow: hidden;
}

/* When grid is open: input below chat on left */
.strategist-container.grid-open .chat-input-area {
    grid-area: input;
    max-width: none;
}

.grid-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--strategist-border-subtle);
    background: var(--strategist-surface-elevated);
}

.grid-panel-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.grid-panel-actions {
    display: flex;
    gap: 0.5rem;
}

.grid-action-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: transparent;
    border: 1px solid var(--strategist-border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--font-sans);
}

.grid-action-btn:hover {
    background: var(--strategist-surface-elevated);
    border-color: var(--text-muted);
    color: var(--text-secondary);
}

.grid-action-btn.copied {
    background: rgba(63, 185, 80, 0.15);
    border-color: var(--success);
    color: var(--success);
}

.grid-container {
    flex: 1;
    overflow: auto;
    padding: 0;
    min-width: 0;
    min-height: 0;
}

/* Document Panel */
.doc-panel-content {
    padding: 2rem;
    min-height: min-content;
}

.doc-content {
    max-width: 900px;
    margin: 0 auto;
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--text-primary);
}

.doc-content h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--strategist-border);
}

.doc-content h2 {
    font-size: 1.375rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
    color: var(--text-primary);
}

.doc-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem 0;
}

.doc-content p {
    margin: 0 0 1rem 0;
}

.doc-content ul, .doc-content ol {
    margin: 0.75rem 0 1rem 0;
    padding-left: 1.5rem;
}

.doc-content li {
    margin: 0.5rem 0;
}

.doc-content code {
    background: rgba(0, 0, 0, 0.06);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.875em;
}

.doc-content pre {
    background: var(--strategist-surface);
    border: 1px solid var(--strategist-border);
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.doc-content pre code {
    background: none;
    padding: 0;
}

.doc-content blockquote {
    border-left: 4px solid var(--strategist-primary);
    margin: 1rem 0;
    padding: 0.5rem 0 0.5rem 1rem;
    background: rgba(9, 105, 218, 0.04);
    border-radius: 0 8px 8px 0;
}

.doc-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.doc-content th,
.doc-content td {
    padding: 0.625rem 1rem;
    border: 1px solid var(--strategist-border);
    text-align: left;
}

.doc-content th {
    background: var(--strategist-surface);
    font-weight: 600;
}

/* Links in doc content */
.doc-content a {
    color: var(--text-link);
    text-decoration: underline;
    text-decoration-color: rgba(99, 102, 241, 0.4);
    text-underline-offset: 2px;
    word-break: break-word;
}

.doc-content a:hover {
    text-decoration-color: var(--text-link);
    color: #4f46e5;
}

.doc-content a[target="_blank"]::after {
    content: " ↗";
    font-size: 0.75em;
    opacity: 0.6;
}

/* Doc tab styling */
.grid-tab.doc-tab {
    background: rgba(91, 61, 143, 0.06);
    border-color: rgba(91, 61, 143, 0.15);
}

.grid-tab.doc-tab.active {
    background: rgba(91, 61, 143, 0.12);
    border-color: var(--planner-color);
}

/* Planner tab styling - dark green magic tab */
.grid-tab.planner-tab {
    background: #166534;
    border-color: #166534;
    color: white;
}

.grid-tab.planner-tab .grid-tab-title,
.grid-tab.planner-tab .grid-tab-count,
.grid-tab.planner-tab .grid-tab-icon {
    color: white;
}

.grid-tab.planner-tab:hover {
    background: #15803d;
    border-color: #15803d;
}

.grid-tab.planner-tab.active {
    background: #14532d;
    border-color: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.grid-tab.planner-tab .grid-tab-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* ============================================
   Plan Tab Content - Document Style Layout
   ============================================ */
.plan-doc-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.plan-doc-header {
    padding: 1.5rem 2rem 1rem;
    border-bottom: 1px solid var(--strategist-border-subtle);
    flex-shrink: 0;
}

.plan-doc-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.plan-doc-title {
    flex: 1;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    padding: 0.25rem 0.5rem;
    margin-left: -0.5rem;
    border-radius: 4px;
    outline: none;
    transition: background 0.15s ease;
}

.plan-doc-title:hover {
    background: var(--strategist-surface);
}

.plan-doc-title:focus {
    background: var(--strategist-surface);
}

.plan-doc-title.empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
}

.plan-doc-status {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.status-badge {
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.complete {
    background: rgba(63, 185, 80, 0.15);
    color: var(--success);
}

.status-badge.in-progress {
    background: rgba(88, 166, 255, 0.15);
    color: var(--strategist-primary);
}

.status-badge.pending {
    background: rgba(139, 148, 158, 0.12);
    color: var(--text-muted);
}

/* Document Body */
.plan-doc-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 2rem 2rem;
}

/* Document Sections */
.plan-doc-section {
    margin-bottom: 2rem;
}

.plan-doc-section:last-of-type {
    margin-bottom: 1rem;
}

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

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.section-actions {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.plan-doc-section:hover .section-actions {
    opacity: 1;
}

.section-action-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.15s ease;
}

.section-action-btn:hover {
    background: var(--strategist-surface);
    color: var(--text-primary);
}

.section-content {
    padding-left: 0;
}

.section-text {
    padding: 0.75rem 1rem;
    background: var(--strategist-surface);
    border-radius: 8px;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-secondary);
    min-height: 60px;
    outline: none;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.section-text:hover {
    background: var(--strategist-surface-elevated);
}

.section-text:focus {
    background: var(--strategist-surface-elevated);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.15);
}

.section-text.empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
}

/* Plan Steps List */
.plan-steps-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: step-counter;
}

.plan-step-item {
    position: relative;
    padding: 0.75rem 0;
    padding-left: 2.5rem;
    border-bottom: 1px solid var(--strategist-border-subtle);
    counter-increment: step-counter;
}

.plan-step-item:last-child {
    border-bottom: none;
}

.plan-step-item::before {
    content: counter(step-counter) ".";
    position: absolute;
    left: 0;
    top: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    width: 1.5rem;
}

.plan-step-item.complete::before {
    color: var(--success);
}

.plan-step-item.in_progress::before {
    color: var(--strategist-primary);
}

.step-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.step-hover-menu {
    position: absolute;
    left: -1.5rem;
    top: 0.75rem;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 4px;
    transition: all 0.15s ease;
}

.plan-step-item:hover .step-hover-menu {
    opacity: 1;
}

.step-hover-menu:hover {
    background: var(--strategist-surface);
    color: var(--text-primary);
}

.hover-menu-icon {
    font-size: 0.875rem;
    letter-spacing: -2px;
}

.step-status-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    margin-top: 2px;
}

.plan-step-item.pending .step-status-icon {
    color: var(--text-muted);
}

.plan-step-item.in_progress .step-status-icon {
    color: var(--strategist-primary);
}

.plan-step-item.complete .step-status-icon {
    color: var(--success);
}

/* Step content wrapper for title + tools */
.step-content-wrapper {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
}

.step-title-text {
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--text-primary);
    padding: 0.125rem 0.375rem;
    margin: -0.125rem 0;
    border-radius: 4px;
    outline: none;
    transition: background 0.15s ease;
}

.step-title-text:hover {
    background: var(--strategist-surface);
}

.step-title-text:focus {
    background: var(--strategist-surface);
}

.step-title-text:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
}

/* Tool pills */
.step-tools {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.tool-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(16, 185, 129, 0.15));
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    font-family: var(--font-mono);
    color: #16a34a;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.tool-pill:hover {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.25), rgba(16, 185, 129, 0.25));
    border-color: rgba(34, 197, 94, 0.5);
    transform: translateY(-1px);
}

/* Legacy step-content-editable for backwards compatibility */
.step-content-editable {
    flex: 1;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--text-primary);
    padding: 0.125rem 0.375rem;
    margin: -0.125rem -0.375rem;
    border-radius: 4px;
    outline: none;
    transition: background 0.15s ease;
}

.step-content-editable:hover {
    background: var(--strategist-surface);
}

.step-content-editable:focus {
    background: var(--strategist-surface);
}

.step-content-editable.empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
}

/* Step Exit Criteria Container - always takes space, opacity controls visibility */
.step-criteria-container {
    min-height: 1.5rem; /* Reserve space to prevent layout shift */
}

/* Empty state: show add button faded, visible on hover */
.step-criteria-container.empty .add-criteria-inline {
    opacity: 0;
}

.plan-step-item:hover .step-criteria-container.empty .add-criteria-inline {
    opacity: 1;
}

/* Has criteria state: always show the add button */
.step-criteria-container.has-criteria .add-criteria-inline {
    opacity: 0.6;
}

.plan-step-item:hover .step-criteria-container.has-criteria .add-criteria-inline {
    opacity: 1;
}

/* Step Exit Criteria */
.step-criteria-list {
    margin-top: 0.5rem;
    padding-left: 1.625rem;
}

.step-criterion {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.step-criterion input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--strategist-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.step-criterion .criterion-text {
    flex: 1;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
    outline: none;
    transition: background 0.15s ease;
}

.step-criterion .criterion-text:hover {
    background: var(--strategist-surface);
}

.step-criterion .criterion-text:focus {
    background: var(--strategist-surface);
}

.step-criterion.completed .criterion-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.step-criterion .criterion-remove {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    opacity: 0;
    transition: all 0.15s ease;
}

.step-criterion:hover .criterion-remove {
    opacity: 0.5;
}

.step-criterion .criterion-remove:hover {
    opacity: 1;
    background: rgba(248, 81, 73, 0.15);
    color: var(--error);
}

.add-criteria-inline {
    display: inline-block;
    padding: 0.25rem 0;
    margin-top: 0.25rem;
    margin-left: 1.625rem;
    background: transparent;
    border: none;
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s ease, opacity 0.15s ease;
}

.add-criteria-inline:hover {
    color: var(--strategist-primary);
    opacity: 1 !important;
}

.add-step-inline-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    margin-top: 0.75rem;
    background: transparent;
    border: 1px dashed var(--strategist-border);
    border-radius: 6px;
    font-size: 0.8125rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.add-step-inline-btn:hover {
    border-color: var(--strategist-primary);
    color: var(--strategist-primary);
    background: rgba(88, 166, 255, 0.05);
}

/* Output Requirements */
.plan-outputs-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: output-counter;
}

.no-outputs-placeholder {
    padding: 1rem;
    background: var(--strategist-surface);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-style: italic;
}

.plan-output-item {
    position: relative;
    padding: 0.625rem 0;
    padding-left: 2rem;
    border-bottom: 1px solid var(--strategist-border-subtle);
    counter-increment: output-counter;
}

.plan-output-item:last-child {
    border-bottom: none;
}

.plan-output-item::before {
    content: counter(output-counter) ".";
    position: absolute;
    left: 0;
    top: 0.625rem;
    font-weight: 600;
    color: var(--text-secondary);
    width: 1.25rem;
}

.output-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.output-hover-menu {
    position: absolute;
    left: -1.5rem;
    top: 0.625rem;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    cursor: pointer;
    color: var(--text-muted);
    border-radius: 4px;
    transition: all 0.15s ease;
}

.plan-output-item:hover .output-hover-menu {
    opacity: 1;
}

.output-hover-menu:hover {
    background: var(--strategist-surface);
    color: var(--text-primary);
}

.output-type-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.output-type-badge.grid {
    background: rgba(63, 185, 80, 0.15);
    color: var(--success);
}

.output-type-badge.doc {
    background: rgba(91, 61, 143, 0.15);
    color: var(--planner-color);
}

.output-type-badge.default {
    background: var(--strategist-surface);
    color: var(--text-secondary);
}

.output-content-editable {
    flex: 1;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--text-primary);
    padding: 0.125rem 0.375rem;
    margin: -0.125rem -0.375rem;
    border-radius: 4px;
    outline: none;
    transition: background 0.15s ease;
}

.output-content-editable:hover {
    background: var(--strategist-surface);
}

.output-content-editable:focus {
    background: var(--strategist-surface);
}

.output-content-editable.empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
}

.add-output-inline-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    margin-top: 0.75rem;
    background: transparent;
    border: 1px dashed var(--strategist-border);
    border-radius: 6px;
    font-size: 0.8125rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}

.add-output-inline-btn:hover {
    border-color: var(--strategist-primary);
    color: var(--strategist-primary);
    background: rgba(88, 166, 255, 0.05);
}

/* Output Type Selector */
.output-type-selector {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    margin-top: 0.5rem;
    background: var(--strategist-surface);
    border: 1px solid var(--strategist-border);
    border-radius: 8px;
}

.output-type-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    padding: 1rem;
    border: 1px solid var(--strategist-border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.output-type-option:hover {
    border-color: var(--strategist-primary);
    background: rgba(88, 166, 255, 0.05);
}

.output-type-icon {
    font-size: 1.5rem;
}

.output-type-label {
    font-weight: 600;
    color: var(--text-primary);
}

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

/* Add Section Row */
.plan-add-section-row {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--strategist-border-subtle);
}

.plan-add-section-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    font-size: 0.8125rem;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.plan-add-section-btn:hover {
    color: var(--strategist-primary);
    background: rgba(88, 166, 255, 0.05);
}

.plan-add-section-btn .add-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--strategist-border);
    border-radius: 4px;
    font-size: 0.875rem;
}

.plan-add-section-btn:hover .add-icon {
    border-color: var(--strategist-primary);
}

/* Context Menu */
.plan-context-menu {
    position: fixed;
    background: var(--strategist-surface-elevated);
    border: 1px solid var(--strategist-border);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    min-width: 160px;
    z-index: 1000;
    padding: 0.375rem;
}

.context-menu-item {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 4px;
    font-size: 0.8125rem;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    transition: background 0.1s ease;
}

.context-menu-item:hover {
    background: var(--strategist-surface);
}

.context-menu-item.danger {
    color: var(--error);
}

.context-menu-item.danger:hover {
    background: rgba(248, 81, 73, 0.1);
}

.context-menu-divider {
    height: 1px;
    background: var(--strategist-border-subtle);
    margin: 0.375rem 0;
}

/* Document Footer */
.plan-doc-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.625rem;
    padding: 1rem 2rem;
    border-top: 1px solid var(--strategist-border-subtle);
    background: var(--strategist-bg);
    flex-shrink: 0;
}

.plan-doc-btn {
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.plan-doc-btn.primary {
    background: var(--strategist-primary);
    border: none;
    color: white;
}

.plan-doc-btn.primary:hover {
    background: var(--strategist-primary-hover);
}

.plan-doc-btn.secondary {
    background: transparent;
    border: 1px solid var(--strategist-border);
    color: var(--text-secondary);
}

.plan-doc-btn.secondary:hover {
    background: var(--strategist-surface);
    border-color: var(--strategist-border-hover);
}

/* Approve Plan button - green gradient */
.plan-doc-btn.approve {
    background: linear-gradient(135deg, #16a34a, #15803d);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
    transition: all 0.2s ease;
}

.plan-doc-btn.approve:hover {
    background: linear-gradient(135deg, #15803d, #166534);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.4);
    transform: translateY(-1px);
}

.plan-doc-btn.approve:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.3);
}

/* Plan Approved Indicator */
.plan-approved-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.1), rgba(21, 128, 61, 0.15));
    border: 1px solid rgba(22, 163, 74, 0.3);
    border-radius: 0.5rem;
    color: #15803d;
    font-weight: 600;
    font-size: 0.9375rem;
}

.plan-approved-indicator .approved-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
}

/* ============================================
   Inline Plan Card (in chat stream)
   ============================================ */
.inline-plan-card {
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(22, 101, 52, 0.08), rgba(21, 128, 61, 0.05));
    border: 1px solid rgba(22, 163, 74, 0.2);
    border-radius: 12px;
    animation: planCardSlideIn 0.3s ease-out;
}

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

.inline-plan-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(22, 163, 74, 0.15);
}

.inline-plan-icon {
    font-size: 1.25rem;
}

.inline-plan-title {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.inline-plan-count {
    padding: 0.25rem 0.5rem;
    background: rgba(22, 163, 74, 0.15);
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #16a34a;
}

.inline-plan-steps {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    margin-bottom: 1rem;
}

.inline-plan-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0;
    font-size: 0.875rem;
}

.inline-plan-step .step-num {
    font-weight: 600;
    color: #16a34a;
    min-width: 1.5rem;
}

.inline-plan-step .step-title {
    flex: 1;
    color: var(--text-secondary);
}

.inline-plan-more {
    padding: 0.25rem 0;
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Mini tool pills for inline plan */
.tool-pill-mini {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.375rem;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.25);
    border-radius: 8px;
    font-size: 0.6875rem;
    font-weight: 500;
    font-family: var(--font-mono);
    color: #16a34a;
    white-space: nowrap;
}

.inline-plan-actions {
    display: flex;
    gap: 0.5rem;
}

.inline-plan-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.625rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.inline-plan-btn.view {
    background: var(--strategist-surface);
    border: 1px solid var(--strategist-border);
    color: var(--text-secondary);
}

.inline-plan-btn.view:hover {
    background: var(--strategist-surface-elevated);
    border-color: var(--strategist-border-hover);
    color: var(--text-primary);
}

.inline-plan-btn.approve {
    background: linear-gradient(135deg, #16a34a, #15803d);
    border: none;
    color: white;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.25);
}

.inline-plan-btn.approve:hover {
    background: linear-gradient(135deg, #15803d, #166534);
    box-shadow: 0 4px 10px rgba(22, 163, 74, 0.35);
    transform: translateY(-1px);
}

.inline-plan-btn.approve:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(22, 163, 74, 0.25);
}

/* Complexity Prompt */
.complexity-prompt {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    margin: 0.75rem 0;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(16, 185, 129, 0.08));
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 12px;
    animation: slideIn 0.2s ease-out;
}

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

.complexity-prompt-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.complexity-prompt-content {
    flex: 1;
}

.complexity-prompt-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

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

.complexity-prompt-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.complexity-btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.complexity-btn.secondary {
    background: transparent;
    border: 1px solid var(--strategist-border);
    color: var(--text-secondary);
}

.complexity-btn.secondary:hover {
    background: var(--strategist-surface);
    border-color: var(--strategist-border-hover);
}

.complexity-btn.primary {
    background: linear-gradient(135deg, #16a34a, #15803d);
    border: none;
    color: white;
}

.complexity-btn.primary:hover {
    background: linear-gradient(135deg, #15803d, #166534);
}

/* Hide deprecated plan panel */
.deprecated-plan-panel {
    display: none !important;
}

.grid-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
    table-layout: auto;
}

/* Wrapper for horizontal scroll if needed */
.grid-table-wrapper {
    overflow-x: auto;
    min-width: 0;
}

.grid-table th {
    position: sticky;
    top: 0;
    background: var(--strategist-surface-elevated);
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--strategist-border);
    white-space: nowrap;
    z-index: 10;
}

.grid-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--strategist-border-subtle);
    color: var(--text-primary);
    vertical-align: top;
    max-width: 350px;
    min-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
}

/* Links in grid cells */
.grid-table td a {
    color: var(--text-link);
    text-decoration: underline;
    text-decoration-color: rgba(99, 102, 241, 0.4);
    text-underline-offset: 2px;
    word-break: break-all;
}

.grid-table td a:hover {
    text-decoration-color: var(--text-link);
    color: #4f46e5;
}

.grid-table td a[target="_blank"]::after {
    content: " ↗";
    font-size: 0.7em;
    opacity: 0.6;
}

/* Wide content columns like titles, descriptions */
.grid-table td.col-wide {
    max-width: 400px;
    min-width: 150px;
}

/* Narrow columns like priority, counts */
.grid-table td.col-narrow {
    max-width: 100px;
    min-width: 60px;
    white-space: nowrap;
}

.grid-row {
    animation: gridRowSlide 0.3s ease-out both;
}

@keyframes gridRowSlide {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.grid-table tbody tr:hover {
    background: rgba(88, 166, 255, 0.05);
}

.grid-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.015);
}

.grid-table tbody tr:nth-child(even):hover {
    background: rgba(88, 166, 255, 0.05);
}

.grid-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.grid-empty-icon {
    font-size: 2rem;
    opacity: 0.5;
}

.grid-more {
    padding: 0.75rem 1rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--strategist-surface-elevated);
    border-top: 1px solid var(--strategist-border-subtle);
}

.strategist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: var(--strategist-surface-elevated);
    border-bottom: 1px solid var(--strategist-border);
}

.strategist-logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    margin: -0.25rem -0.5rem;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.strategist-logo:hover {
    background: var(--strategist-surface-hover, rgba(255, 255, 255, 0.05));
}

.strategist-logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.strategist-logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.strategist-logo-text h1 {
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-sans);
    margin: 0;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.strategist-logo-text span {
    font-size: 0.6875rem;
    color: var(--text-muted);
    letter-spacing: 0.01em;
}

/* Header Brand Subtitle (e.g., "for MasterClass") */
.header-brand-subtitle {
    font-size: 1.125rem;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: -0.02em;
}

/* Brand Logo in Header */
.brand-logo-container {
    display: none;
    align-items: center;
    gap: 0.25rem;
    margin-left: -0.25rem;
}

.brand-logo-divider {
    font-size: 1rem;
    font-weight: 300;
    color: var(--text-muted);
    opacity: 0.35;
    margin: 0 -0.25rem;
}

.header-brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: contain;
    background: var(--strategist-surface);
    padding: 2px;
    border: 1px solid var(--strategist-border);
}

/* Header Mode Badge */
.header-mode-badge {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    margin-left: 0.5rem;
    transition: all 0.2s ease;
}

.header-mode-badge .mode-badge-icon {
    font-size: 0.875rem;
    line-height: 1;
}

.header-mode-badge .mode-badge-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
}

/* Mode-specific styling */
.header-mode-badge[data-mode="instant"] {
    background: var(--airops-lime-soft);
    border-color: rgba(198, 229, 77, 0.3);
}

.header-mode-badge[data-mode="instant"] .mode-badge-label {
    color: var(--airops-forest);
}

.header-mode-badge[data-mode="planner"] {
    background: var(--airops-teal-soft);
    border-color: rgba(90, 154, 138, 0.3);
}

.header-mode-badge[data-mode="planner"] .mode-badge-label {
    color: var(--airops-forest);
}

.header-mode-badge[data-mode="auto"] {
    background: var(--airops-lime-soft);
    border-color: rgba(198, 229, 77, 0.3);
}

.header-mode-badge[data-mode="auto"] .mode-badge-label {
    color: var(--airops-forest);
}

/* ============================================
   Mode Dropdown (Simple Select)
   ============================================ */
.mode-dropdown-wrapper {
    display: flex;
    align-items: center;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.mode-dropdown {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 0.375rem 1.75rem 0.375rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    font-family: var(--font-sans);
    color: var(--text-primary);
    background-color: var(--strategist-surface-elevated);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 12px;
    border: 1px solid var(--strategist-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
}

.mode-dropdown:hover {
    border-color: var(--airops-teal);
    background-color: var(--strategist-surface);
}

.mode-dropdown:focus {
    outline: none;
    border-color: var(--airops-teal);
    box-shadow: 0 0 0 2px var(--airops-teal-soft);
}

.mode-dropdown option {
    padding: 0.5rem;
    background: var(--strategist-surface);
    color: var(--text-primary);
}

/* ============================================
   Input Controls Row (Mode + Slack on left, Send/Stop on right)
   ============================================ */
.input-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.controls-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.controls-right .send-btn,
.controls-right .stop-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.controls-right .send-btn {
    background: var(--airops-teal);
    color: white;
    border: none;
}

.controls-right .send-btn:hover:not(:disabled) {
    background: var(--airops-forest);
    transform: translateY(-1px);
}

.controls-right .send-btn:disabled {
    background: var(--strategist-border);
    color: var(--text-muted);
    cursor: not-allowed;
}

.controls-right .stop-btn {
    background: #ef4444;
    color: white;
    border: none;
}

.controls-right .stop-btn:hover {
    background: #dc2626;
}

/* ============================================
   Custom Mode Dropdown with Descriptions
   ============================================ */
.mode-dropdown-custom {
    position: relative;
}

.mode-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    font-family: var(--font-sans);
    color: var(--text-primary);
    background-color: var(--strategist-surface-elevated);
    border: 1px solid var(--strategist-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 110px;
}

.mode-dropdown-trigger:hover {
    border-color: var(--airops-teal);
    background-color: var(--strategist-surface);
}

.mode-dropdown-trigger.open {
    border-color: var(--airops-teal);
    box-shadow: 0 0 0 2px var(--airops-teal-soft);
}

.mode-icon {
    font-size: 0.875rem;
}

.mode-label {
    flex: 1;
}

.mode-chevron {
    opacity: 0.5;
    transition: transform 0.2s ease;
}

.mode-dropdown-trigger.open .mode-chevron {
    transform: rotate(180deg);
}

.mode-dropdown-menu {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 4px;
    width: 280px;
    background: var(--strategist-surface);
    border: 1px solid var(--strategist-border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    padding: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s ease;
    z-index: 100;
}

.mode-dropdown-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mode-option {
    display: block;
    width: 100%;
    padding: 0.75rem;
    text-align: left;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.mode-option:hover {
    background: var(--strategist-surface-elevated);
}

.mode-option.active {
    background: var(--airops-teal-soft);
    border-color: var(--airops-teal);
}

.mode-option-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.mode-option-icon {
    font-size: 1rem;
}

.mode-option-name {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-primary);
}

.mode-option-desc {
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

/* ============================================
   Slack Notification Toggle
   ============================================ */
.slack-notify-wrapper {
    position: relative;
}

.slack-notify-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: var(--strategist-surface-elevated);
    border: 1px solid var(--strategist-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.slack-notify-toggle .slack-icon {
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.slack-notify-toggle:hover {
    border-color: var(--airops-teal);
    background: var(--strategist-surface);
}

.slack-notify-toggle:hover .slack-icon {
    color: var(--text-primary);
}

.slack-notify-toggle.active {
    background: linear-gradient(135deg, #4A154B 0%, #611f69 100%);
    border-color: #4A154B;
}

.slack-notify-toggle.active .slack-icon {
    color: white;
}

.slack-notify-indicator {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    border: 2px solid var(--strategist-surface);
    transition: background 0.2s ease;
}

.slack-notify-toggle.active .slack-notify-indicator {
    background: #36c5f0;
}

/* Slack Tooltip */
.slack-notify-tooltip {
    position: absolute;
    bottom: 100%;
    left: 0;
    transform: translateY(8px);
    margin-bottom: 8px;
    width: 260px;
    padding: 0.875rem;
    background: var(--strategist-surface);
    border: 1px solid var(--strategist-border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
    pointer-events: none;
}

.slack-notify-wrapper:hover .slack-notify-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tooltip-title {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tooltip-title::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%234A154B'%3E%3Cpath d='M5.042 15.165a2.528 2.528 0 0 1-2.52 2.523A2.528 2.528 0 0 1 0 15.165a2.527 2.527 0 0 1 2.522-2.52h2.52v2.52zM6.313 15.165a2.527 2.527 0 0 1 2.521-2.52 2.527 2.527 0 0 1 2.521 2.52v6.313A2.528 2.528 0 0 1 8.834 24a2.528 2.528 0 0 1-2.521-2.522v-6.313zM8.834 5.042a2.528 2.528 0 0 1-2.521-2.52A2.528 2.528 0 0 1 8.834 0a2.528 2.528 0 0 1 2.521 2.522v2.52H8.834zM8.834 6.313a2.528 2.528 0 0 1 2.521 2.521 2.528 2.528 0 0 1-2.521 2.521H2.522A2.528 2.528 0 0 1 0 8.834a2.528 2.528 0 0 1 2.522-2.521h6.312zM18.956 8.834a2.528 2.528 0 0 1 2.522-2.521A2.528 2.528 0 0 1 24 8.834a2.528 2.528 0 0 1-2.522 2.521h-2.522V8.834zM17.688 8.834a2.528 2.528 0 0 1-2.523 2.521 2.527 2.527 0 0 1-2.52-2.521V2.522A2.527 2.527 0 0 1 15.165 0a2.528 2.528 0 0 1 2.523 2.522v6.312zM15.165 18.956a2.528 2.528 0 0 1 2.523 2.522A2.528 2.528 0 0 1 15.165 24a2.527 2.527 0 0 1-2.52-2.522v-2.522h2.52zM15.165 17.688a2.527 2.527 0 0 1-2.52-2.523 2.526 2.526 0 0 1 2.52-2.52h6.313A2.527 2.527 0 0 1 24 15.165a2.528 2.528 0 0 1-2.522 2.523h-6.313z'/%3E%3C/svg%3E");
    background-size: contain;
}

.tooltip-desc {
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 0.625rem 0;
}

.tooltip-status {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--strategist-border);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-dot.enabled {
    background: #2eb67d;
}

.status-text {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Legacy mode-pill styles removed - using simple dropdown now */

/* ============================================
   Input Field MAX Mode Styling
   ============================================ */
.chat-input-area[data-max-mode="true"] {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 50%, #ffedd5 100%);
    border-top: 2px solid #f59e0b;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-input-area[data-max-mode="true"] .chat-input,
.chat-input-area[data-max-mode="true"] #chat-input {
    background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%);
    border: 2px solid #fbbf24;
    box-shadow: 
        0 0 0 4px rgba(251, 191, 36, 0.1),
        0 4px 12px rgba(245, 158, 11, 0.15);
}

.chat-input-area[data-max-mode="true"] .chat-input:focus,
.chat-input-area[data-max-mode="true"] #chat-input:focus {
    border-color: #f97316;
    box-shadow: 
        0 0 0 4px rgba(249, 115, 22, 0.15),
        0 4px 20px rgba(245, 158, 11, 0.25);
}

.chat-input-area[data-max-mode="true"] .chat-input::placeholder,
.chat-input-area[data-max-mode="true"] #chat-input::placeholder {
    color: #92400e;
    opacity: 0.6;
}

.chat-input-area[data-max-mode="true"] .send-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.chat-input-area[data-max-mode="true"] .send-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #d97706 0%, #dc2626 100%);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
    transform: translateY(-2px);
}

.chat-input-area[data-max-mode="true"] .mode-dropdown-wrapper {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    padding: 0.125rem;
}

.chat-input-area[data-max-mode="true"] .mode-dropdown {
    border-color: #fbbf24;
    background-color: rgba(255, 255, 255, 0.9);
}

/* Animated glow behind input in MAX mode */
.chat-input-area[data-max-mode="true"] .chat-input-wrapper {
    position: relative;
}

.chat-input-area[data-max-mode="true"] .chat-input-wrapper::after {
    content: '';
    position: absolute;
    inset: -4px;
    background: linear-gradient(90deg, #f59e0b, #ef4444, #ec4899, #f59e0b);
    background-size: 300% 100%;
    border-radius: 18px;
    z-index: -1;
    opacity: 0.6;
    animation: max-border-flow 4s linear infinite;
    filter: blur(4px);
}

@keyframes max-border-flow {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

/* Ensure input stays above the glow */
.chat-input-area[data-max-mode="true"] .chat-input,
.chat-input-area[data-max-mode="true"] #chat-input {
    position: relative;
    z-index: 1;
}

/* Flight Supervisor styles moved to end of file - see "Supervisor Toggle" section */

/* ============================================
   Flight Supervisor Block (in response) - DEPRECATED
   Main supervisor block styles are at end of file
   ============================================ */
.supervisor-block-old {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
    margin: 0.75rem 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    border-radius: 8px;
    border-left: 3px solid #6366f1;
    font-size: 0.8125rem;
    transition: all 0.3s ease;
    animation: supervisorSlideIn 0.3s ease-out;
}

@keyframes supervisorSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.supervisor-block.starting {
    border-left-color: #6366f1;
}

.supervisor-block.issue-found {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(249, 115, 22, 0.05) 100%);
}

.supervisor-block.fixing {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(234, 88, 12, 0.05) 100%);
}

.supervisor-block.fixed {
    border-left-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(52, 211, 153, 0.05) 100%);
}

.supervisor-block.approved {
    border-left-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(52, 211, 153, 0.05) 100%);
}

.supervisor-block.fade-out {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.5s ease-out;
}

.supervisor-icon {
    font-size: 1.125rem;
    flex-shrink: 0;
}

.supervisor-icon.spinning {
    animation: supervisorSpin 1s linear infinite;
}

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

.supervisor-text {
    color: var(--text-secondary);
    flex: 1;
}

.supervisor-text em {
    color: var(--text-primary);
    font-style: normal;
    font-weight: 500;
}

.supervisor-progress {
    width: 60px;
    height: 4px;
    background: rgba(99, 102, 241, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.supervisor-progress-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 2px;
    animation: supervisorProgress 2s ease-in-out infinite;
}

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

/* Supervisor toggle removed - feature disabled */

/* ============================================
   BEAST MODE (Planner) Global Theme
   Note: Chat area colors intentionally not changed in planner mode
   ============================================ */
.strategist-container[data-mode="planner"] {
    --strategist-primary: #5b3d8f;
    --strategist-primary-glow: rgba(91, 61, 143, 0.15);
}

/* ============================================
   Admin Button
   ============================================ */
.admin-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4375rem 0.75rem;
    background: var(--strategist-surface-elevated);
    border: 1px solid var(--strategist-border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--font-sans);
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.admin-btn:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--text-muted);
    color: var(--text-secondary);
}

.admin-btn span:first-child {
    font-size: 1rem;
    font-weight: 400;
}

/* Header Actions Container */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Logout Button */
.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    background: transparent;
    border: 1px solid var(--strategist-border);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 1.125rem;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--font-sans);
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
    transform: translateX(2px);
}

.logout-btn span {
    display: block;
    transform: rotate(0deg);
    transition: transform 0.15s ease;
}

.logout-btn:hover span {
    transform: rotate(0deg) translateX(2px);
}

/* ============================================
   Chat Area
   ============================================ */
.strategist-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem 1.5rem;
    scroll-behavior: smooth;
    background: var(--strategist-bg);
    /* Center the messages */
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Hide scrollbar but keep scroll functionality */
.chat-messages {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.chat-messages::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Message layout - ChatGPT style */
.message {
    display: block;
    margin-bottom: 0;
    padding: 2rem 1rem;
    animation: messageSlide 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    border-bottom: 1px solid var(--strategist-border-subtle);
    width: 100%;
    max-width: var(--content-max-width);
    box-sizing: border-box;
}

.message:last-child {
    border-bottom: none;
}

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

.message.user {
    background: transparent;
    text-align: right;
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-start;
}

.message.user .message-content {
    background: linear-gradient(135deg, #f8f9fb 0%, #f3f4f7 100%);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px 16px 4px 16px;
    padding: 12px 16px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    text-align: left;
    display: inline-block;
    max-width: 80%;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-top: 2px;
    margin-right: 1.25rem;
    vertical-align: top;
}

/* User messages no longer have avatars */

.message.assistant .message-avatar {
    background: transparent;
    overflow: hidden;
}

.message.assistant .message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

/* User avatar styles removed - users no longer have avatars in chat */

/* Content wrapper - fills the constrained message */
.message-content {
    display: inline-block;
    max-width: calc(100% - 52px); /* Account for avatar + gap */
    vertical-align: top;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
}

/* User messages don't have avatars, so full width available */
.message.user .message-content {
    max-width: 100%;
}

/* User message content styling moved to .message.user rule above */

/* Response text styling - the heart of the typography */
.response-text,
.message-text {
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    line-height: var(--content-line-height);
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

/* Content elements - smooth appearance without jarring animation during streaming */
.message-content p,
.message-content li,
.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content blockquote,
.message-content pre,
.message-content table,
.message-content ul,
.message-content ol {
    opacity: 1;
}

/* During streaming, ensure no animations and stable layout */
.message:not(.complete) .message-content * {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
}

/* Only apply fade-in animation when streaming is complete */
.message.complete .message-content p,
.message.complete .message-content li,
.message.complete .message-content h1,
.message.complete .message-content h2,
.message.complete .message-content h3,
.message.complete .message-content h4,
.message.complete .message-content blockquote,
.message.complete .message-content pre,
.message.complete .message-content table {
    animation: contentFadeIn 0.3s ease-out both;
}

/* Stagger the fade-in for completed messages only */
.message.complete .message-content li:nth-child(1) { animation-delay: 0ms; }
.message.complete .message-content li:nth-child(2) { animation-delay: 20ms; }
.message.complete .message-content li:nth-child(3) { animation-delay: 40ms; }
.message.complete .message-content li:nth-child(4) { animation-delay: 60ms; }
.message.complete .message-content li:nth-child(5) { animation-delay: 80ms; }
.message.complete .message-content li:nth-child(n+6) { animation-delay: 100ms; }

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

.response-text p,
.message-text p {
    margin: 0 0 var(--content-paragraph-spacing);
}

.response-text p:last-child,
.message-text p:last-child {
    margin-bottom: 0;
}

/* Strong/Bold text */
.response-text strong,
.message-text strong {
    font-weight: 600;
    color: var(--text-primary);
}

/* Links */
.response-text a,
.message-text a {
    color: var(--text-link);
    text-decoration: underline;
    text-decoration-color: rgba(99, 102, 241, 0.4);
    text-underline-offset: 2px;
    transition: all 0.15s ease;
    word-break: break-word;
}

.response-text a:hover,
.message-text a:hover {
    text-decoration-color: var(--text-link);
    color: #4f46e5;
}

/* External link indicator for links that open in new tab */
.response-text a[target="_blank"]::after,
.message-text a[target="_blank"]::after {
    content: " ↗";
    font-size: 0.75em;
    opacity: 0.6;
}

/* Headings in responses */
.response-text h1,
.response-text h2,
.response-text h3,
.response-text h4,
.message-text h1,
.message-text h2,
.message-text h3,
.message-text h4 {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    line-height: 1.3;
}

.response-text h1:first-child,
.response-text h2:first-child,
.response-text h3:first-child,
.message-text h1:first-child,
.message-text h2:first-child,
.message-text h3:first-child {
    margin-top: 0;
}

.response-text h2,
.message-text h2 {
    font-size: 1.5rem;
    padding-bottom: 0.5em;
    border-bottom: 1px solid var(--strategist-border-subtle);
}

.response-text h3,
.message-text h3 {
    font-size: 1.25rem;
}

.response-text h4,
.message-text h4 {
    font-size: 1.125rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* Horizontal rules */
.response-text hr,
.message-text hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--strategist-border), transparent);
    margin: 1.5em 0;
}

/* Lists - clean standard styling */
.response-text ul,
.response-text ol,
.message-text ul,
.message-text ol {
    margin: 0.75em 0 1em;
    padding-left: 1.5em;
}

.response-text ul,
.message-text ul {
    list-style-type: disc;
}

.response-text ol,
.message-text ol {
    list-style-type: decimal;
}

.response-text li,
.message-text li {
    margin-bottom: 0.5em;
    line-height: 1.6;
}

.response-text li:last-child,
.message-text li:last-child {
    margin-bottom: 0;
}

/* Nested lists */
.response-text li ul,
.response-text li ol,
.message-text li ul,
.message-text li ol {
    margin-top: 0.375em;
    margin-bottom: 0.375em;
}

.response-text ul ul,
.message-text ul ul {
    list-style-type: circle;
}

.response-text ul ul ul,
.message-text ul ul ul {
    list-style-type: square;
}

/* Code - inline */
.response-text code,
.message-text code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: rgba(175, 184, 193, 0.2);
    color: #cf222e;
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-weight: 400;
}

/* Code blocks */
.response-text pre,
.message-text pre {
    background: #f6f8fa;
    border: 1px solid var(--strategist-border);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    overflow-x: auto;
    margin: 1em 0;
}

.response-text pre code,
.message-text pre code {
    background: transparent;
    color: var(--text-primary);
    padding: 0;
    font-size: 0.8125rem;
    line-height: 1.6;
}

/* Blockquotes */
.response-text blockquote,
.message-text blockquote {
    margin: 1em 0;
    padding: 0.75em 1em;
    border-left: 3px solid var(--strategist-primary);
    background: rgba(88, 166, 255, 0.05);
    border-radius: 0 6px 6px 0;
    color: var(--text-secondary);
    font-style: italic;
}

.response-text blockquote p:last-child,
.message-text blockquote p:last-child {
    margin-bottom: 0;
}

/* ============================================
   Tables - Premium Design
   ============================================ */
.response-text table,
.message-text table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1em 0;
    font-size: 0.875rem;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--strategist-border);
    background: var(--strategist-surface);
}

.response-text th,
.message-text th {
    padding: 0.625rem 0.875rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    background: var(--strategist-surface-elevated);
    border-bottom: 1px solid var(--strategist-border);
}

.response-text td,
.message-text td {
    padding: 0.625rem 0.875rem;
    text-align: left;
    border-bottom: 1px solid var(--strategist-border-subtle);
    color: var(--text-primary);
    vertical-align: top;
}

.response-text tr:last-child td,
.message-text tr:last-child td {
    border-bottom: none;
}

/* Alternating row colors */
.response-text tbody tr:nth-child(even),
.message-text tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

/* Row hover effect */
.response-text tbody tr:hover,
.message-text tbody tr:hover {
    background: rgba(88, 166, 255, 0.05);
}

/* Status indicators in tables */
.response-text td:first-child,
.message-text td:first-child {
    font-weight: 500;
}

/* Numeric columns right-align */
.response-text td:nth-child(2),
.response-text td:nth-child(3),
.message-text td:nth-child(2),
.message-text td:nth-child(3) {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
}

/* ============================================
   Thinking/Reasoning - Minimal Status Bar Style
   ============================================ */
.thinking-block {
    display: block;
    cursor: pointer;
    margin: 8px 0;
}

.thinking-block:hover .thinking-status-text {
    text-decoration: underline;
}

/* Status text styling */
.thinking-status-text {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-family: var(--font-sans);
}

/* Pulsing purple while reasoning */
.thinking-block.reasoning .thinking-status-text {
    color: #a371f7;
    animation: thinking-text-pulse 1.5s ease-in-out infinite;
}

.thinking-block.complete .thinking-status-text {
    color: var(--text-muted);
}

@keyframes thinking-text-pulse {
    0%, 100% { 
        opacity: 0.5;
        color: #a371f7;
    }
    50% { 
        opacity: 1;
        color: #8b5cf6;
    }
}

/* Expanded content */
.thinking-content {
    display: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.6;
    max-height: 200px;
    overflow-y: auto;
    padding: 8px 12px;
    margin-top: 8px;
    background: rgba(163, 113, 247, 0.04);
    border-radius: 6px;
    opacity: 0.8;
}

.thinking-block.expanded .thinking-content {
    display: block;
}

.thinking-content::-webkit-scrollbar {
    width: 3px;
}

.thinking-content::-webkit-scrollbar-thumb {
    background: rgba(163, 113, 247, 0.2);
    border-radius: 2px;
}

.thinking-content::-webkit-scrollbar-thumb:hover {
    background: rgba(163, 113, 247, 0.4);
}

/* ============================================
   Tool Execution - Minimal Status Bar (Default)
   ============================================ */

/* Minimal tool status bar - single line of subtle text */
.tool-status-bar {
    display: block;
    cursor: pointer;
    margin: 15px 0;
}

.tool-status-bar:hover .tool-status-text {
    text-decoration: underline;
}

/* Status text styling */
.tool-status-text {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-family: var(--font-sans);
}

/* Vibrant moving gradient animation while tools are executing */
.tool-status-bar.executing .tool-status-text {
    display: inline-block;
    background: linear-gradient(
        90deg,
        #6366f1 0%,
        #a855f7 12.5%,
        #ec4899 25%,
        #f97316 37.5%,
        #eab308 50%,
        #22c55e 62.5%,
        #06b6d4 75%,
        #6366f1 87.5%,
        #a855f7 100%
    );
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    -webkit-text-fill-color: transparent;
    animation: gradient-shimmer 2s linear infinite;
    font-weight: 600;
    letter-spacing: 0.01em;
}

@keyframes gradient-shimmer {
    0% {
        background-position: 200% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.tool-status-bar.executing .tool-status-text::after {
    content: '';
    display: none;
}

.tool-status-bar.complete .tool-status-text {
    color: var(--text-muted);
}

.tool-status-bar.complete .tool-status-text::after {
    display: none;
}

@keyframes cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ============================================
   Tool Execution - Detailed View (Expandable)
   ============================================ */

/* Container for tool icons - hidden by default, shown when expanded */
.tool-icons-container {
    display: none;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
    margin: 8px 0;
}

.tool-icons-container.expanded {
    display: flex;
}

/* Individual tool icon - compact circular design */
.tool-icon-compact {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--strategist-surface);
    border: 2px solid var(--strategist-border);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.75rem;
}

.tool-icon-compact:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Executing state - amber with spinning border */
.tool-icon-compact.executing {
    border-color: transparent;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    animation: tool-pulse 1.5s ease-in-out infinite;
}

.tool-icon-compact.executing::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #d97706;
    border-right-color: #d97706;
    animation: spin 0.8s linear infinite;
}

/* Complete state - green, reduced opacity when done */
.tool-icon-compact.complete {
    border-color: var(--success);
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: var(--success);
    opacity: 0.7;
}

.tool-icon-compact.complete:hover {
    opacity: 1;
}

/* Error state - red for failed tool calls */
.tool-icon-compact.error {
    border-color: var(--danger, #dc2626);
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
    color: var(--danger, #dc2626);
    opacity: 0.9;
}

.tool-icon-compact.error:hover {
    opacity: 1;
}

/* Cancelled state */
.tool-icon-compact.cancelled {
    border-color: var(--strategist-border);
    background: var(--strategist-surface);
    opacity: 0.5;
}

/* Timeout state */
.tool-icon-compact.timeout {
    border-color: var(--warning);
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    opacity: 0.8;
}

.tool-icon-compact.timeout .tool-icon-emoji {
    color: var(--warning);
}

.tool-hover-duration.timeout {
    color: var(--warning);
    background: rgba(154, 103, 0, 0.1);
}

.tool-result-timeout {
    color: var(--warning);
    font-size: 0.75rem;
}

@keyframes tool-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.3); }
    50% { box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.1); }
}

/* Tool icon inner content */
.tool-icon-emoji {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.tool-icon-emoji svg {
    width: 14px;
    height: 14px;
    stroke-width: 2;
}

.tool-icon-compact.executing .tool-icon-emoji {
    color: #b45309;
}

.tool-icon-compact.complete .tool-icon-emoji {
    color: var(--success);
}

.tool-icon-compact.error .tool-icon-emoji {
    color: var(--danger, #dc2626);
}

.tool-icon-compact.cancelled .tool-icon-emoji {
    color: var(--text-muted);
}

/* Hover menu that appears on tool icon - positioned ABOVE to avoid overlap */
.tool-hover-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 1000;
    white-space: nowrap;
}

/* Invisible bridge to allow mouse to travel from icon to menu */
.tool-hover-menu::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 12px;
    background: transparent;
}

.tool-icon-compact:hover .tool-hover-menu,
.tool-hover-menu:hover {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.tool-hover-content {
    background: var(--strategist-surface);
    border: 1px solid var(--strategist-border);
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), 0 -2px 8px rgba(0, 0, 0, 0.05);
    padding: 0.5rem;
    min-width: 180px;
}

/* Tool name and duration header */
.tool-hover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.375rem 0.5rem;
    border-bottom: 1px solid var(--strategist-border-subtle);
    margin-bottom: 0.375rem;
}

.tool-hover-name {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    color: var(--text-secondary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-hover-duration {
    font-family: var(--font-mono);
    font-size: 0.625rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.05);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
}

.tool-hover-duration.executing {
    color: #d97706;
    background: rgba(217, 119, 6, 0.1);
    animation: duration-pulse 1s ease-in-out infinite;
}

.tool-hover-duration.complete {
    color: var(--success);
    background: rgba(26, 127, 55, 0.1);
}

.tool-hover-duration.error {
    color: var(--danger, #dc2626);
    background: rgba(220, 38, 38, 0.1);
}

@keyframes duration-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Hover menu action buttons */
.tool-hover-actions {
    display: flex;
    gap: 0.25rem;
}

.tool-hover-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.375rem 0.5rem;
    background: transparent;
    border: 1px solid var(--strategist-border-subtle);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.625rem;
    color: var(--text-muted);
    transition: all 0.15s ease;
    white-space: nowrap;
}

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

.tool-hover-btn.primary {
    background: var(--strategist-primary);
    border-color: var(--strategist-primary);
    color: white;
}

.tool-hover-btn.primary:hover {
    background: var(--strategist-primary-hover);
}

.tool-hover-btn svg {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
}

/* Arrow pointer for hover menu - points UP since menu is below */
.tool-hover-content::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid var(--strategist-surface);
}

.tool-hover-content::before {
    content: '';
    position: absolute;
    top: -7px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 7px solid var(--strategist-border);
}

/* Expanded details modal (shown on View Details click) */
.tool-details-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.tool-details-modal.show {
    opacity: 1;
    visibility: visible;
}

.tool-details-panel {
    background: var(--strategist-surface);
    border: 1px solid var(--strategist-border);
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.tool-details-modal.show .tool-details-panel {
    transform: scale(1);
}

.tool-details-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--strategist-border-subtle);
    background: var(--strategist-surface-elevated);
}

.tool-details-panel-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tool-details-panel-name {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

.tool-details-panel-status {
    font-size: 0.6875rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.tool-details-panel-status.complete {
    background: rgba(26, 127, 55, 0.1);
    color: var(--success);
}

.tool-details-panel-status.executing {
    background: rgba(217, 119, 6, 0.1);
    color: #d97706;
}

.tool-details-panel-status.error {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger, #dc2626);
}

.tool-details-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.25rem;
    transition: all 0.15s ease;
}

.tool-details-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

/* Legacy tool block styles (for backwards compatibility) */
.tool-block {
    display: none; /* Hide old tool blocks, use new compact icons */
}

/* Click hint */
.click-hint {
    font-size: 0.6875rem;
    color: var(--text-muted);
    font-weight: normal;
    margin-left: 0.375rem;
    opacity: 0.7;
}

/* Tool Details Modal Content */
.tool-details-body {
    padding: 0;
    max-height: calc(80vh - 60px);
    overflow: auto;
}

/* Tool Details Panel (shown on click) - used in modal */
.tool-details {
    display: block;
    background: var(--strategist-surface);
}

.tool-block.expanded .tool-details {
    display: block;
}

/* Tool Details Tabs */
.tool-details-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--strategist-border-subtle);
    background: rgba(255, 255, 255, 0.01);
}

.tool-tab {
    flex: 1;
    padding: 0.625rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 2px solid transparent;
    font-family: var(--font-sans);
}

.tool-tab:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.02);
}

.tool-tab.active {
    color: var(--strategist-primary);
    border-bottom-color: var(--strategist-primary);
    background: rgba(88, 166, 255, 0.03);
}

/* Tool Tab Content */
.tool-details-content {
    max-height: 400px;
    overflow: auto;
}

.tool-tab-panel {
    display: none;
    padding: 0.875rem;
}

.tool-tab-panel.active {
    display: block;
}

.tool-args-content,
.tool-result-json {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
    background: var(--strategist-surface);
    padding: 1rem;
    border-radius: 8px;
    max-height: 350px;
    overflow: auto;
    border: 1px solid var(--strategist-border);
}

.tool-result-pending {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.75rem;
}

/* Make header clickable */
.tool-header {
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}

.tool-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.tool-block.complete .tool-header:hover .tool-expand-icon {
    color: var(--strategist-primary);
}

/* ============================================
   Tool Blocks - Compact mode when grid open
   ============================================ */
.strategist-container.grid-open .tool-block {
    margin: 0.75rem 0;
}

.strategist-container.grid-open .tool-header {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
}

.strategist-container.grid-open .tool-details-content {
    max-height: 250px;
}

.strategist-container.grid-open .tool-args-content,
.strategist-container.grid-open .tool-result-json {
    max-height: 200px;
    font-size: 0.6875rem;
    padding: 0.75rem;
}

.strategist-container.grid-open .tool-tab {
    padding: 0.5rem 0.75rem;
    font-size: 0.6875rem;
}

/* ============================================
   Error Message with Retry
   ============================================ */
.error-message {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #991b1b;
}

.error-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.error-icon {
    font-size: 1.125rem;
}

.error-text {
    font-size: 0.9375rem;
    line-height: 1.5;
}

.retry-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--text-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.retry-btn:hover {
    background: var(--strategist-primary);
    transform: translateY(-1px);
}

.retry-btn svg {
    flex-shrink: 0;
}

/* Inline error message styling */
.error-message.inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(248, 81, 73, 0.08);
    border: 1px solid rgba(248, 81, 73, 0.2);
    border-radius: 8px;
    color: var(--error);
}

.error-message.inline .error-icon {
    font-size: 1rem;
}

.error-message.inline .error-text {
    font-size: 0.875rem;
}

/* Overloaded auto-retry message */
.overloaded-message {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 12px;
    color: #92400e;
}

.overloaded-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.overloaded-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.overloaded-text strong {
    font-size: 0.95rem;
    color: #78350f;
}

.overloaded-countdown {
    font-size: 0.85rem;
    color: #a16207;
}

.overloaded-cancel-btn {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #d97706;
    border-radius: 6px;
    color: #92400e;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.overloaded-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: #b45309;
}

/* ============================================
   Chat Actions Bar (Retry, etc.)
   ============================================ */
.chat-actions-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem;
    margin: 0 1rem 1rem 1rem;
    background: var(--strategist-surface);
    border: 1px solid var(--strategist-border);
    border-radius: 12px;
    animation: slideUp 0.2s ease;
}

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

.chat-action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--font-sans);
}

.chat-action-btn.retry {
    background: var(--text-primary);
    color: white;
    border: none;
}

.chat-action-btn.retry:hover {
    background: var(--strategist-primary);
    transform: translateY(-1px);
}

.chat-action-btn.secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--strategist-border);
}

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

.chat-action-btn svg {
    flex-shrink: 0;
}

/* ============================================
   Agent Header (Combined Logo + Mode Badge)
   ============================================ */
.agent-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0.375rem 0.75rem 0.375rem 0.375rem;
    border-radius: 100px;
    font-family: var(--font-mono);
    width: fit-content; /* Don't stretch full width */
}

.agent-header-logo {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.agent-header-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.agent-header-mode {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.agent-header-mode-icon {
    font-size: 0.75rem;
}

/* Instant mode styling */
.agent-header.instant {
    background: rgba(240, 136, 62, 0.12);
    border: 1px solid rgba(240, 136, 62, 0.25);
}

.agent-header.instant .agent-header-mode {
    color: var(--instant-color);
}

/* Planner mode styling */
.agent-header.planner {
    background: rgba(163, 113, 247, 0.12);
    border: 1px solid rgba(163, 113, 247, 0.25);
}

.agent-header.planner .agent-header-mode {
    color: var(--planner-color);
}

/* Default styling when no mode class (fallback) */
.agent-header:not(.instant):not(.planner) {
    background: rgba(163, 113, 247, 0.12);
    border: 1px solid rgba(163, 113, 247, 0.25);
}

.agent-header:not(.instant):not(.planner) .agent-header-mode {
    color: var(--planner-color);
}

/* Hide message-avatar for assistant messages since we use agent-header */
.message.assistant .message-avatar {
    display: none;
}

/* Legacy mode-badge support for backwards compatibility */
.mode-badge {
    display: none; /* Hidden - use agent-header instead */
}

/* ============================================
   Model Indicator (shows current AI model)
   ============================================ */
.model-indicator {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.5rem;
    padding: 0.125rem 0.375rem;
    border-radius: 100px;
    font-size: 0.625rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    transition: all 0.2s ease;
    cursor: default;
}

.model-indicator .model-icon {
    font-size: 0.6875rem;
}

/* Hide label by default, show on hover */
.model-indicator .model-label {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: max-width 0.2s ease, opacity 0.2s ease, margin 0.2s ease;
    margin-left: 0;
}

.model-indicator:hover .model-label {
    max-width: 60px;
    opacity: 0.9;
    margin-left: 0.25rem;
}

.model-indicator:hover {
    padding-right: 0.5rem;
}

/* Haiku - Fast, light */
.model-indicator.model-haiku {
    background: rgba(120, 180, 140, 0.15);
    border: 1px solid rgba(120, 180, 140, 0.3);
    color: #5a9a6a;
}

/* Sonnet - Balanced */
.model-indicator.model-sonnet {
    background: rgba(100, 140, 200, 0.15);
    border: 1px solid rgba(100, 140, 200, 0.3);
    color: #5080c0;
}

/* Opus - Powerful */
.model-indicator.model-opus {
    background: rgba(180, 120, 200, 0.15);
    border: 1px solid rgba(180, 120, 200, 0.3);
    color: #a060c0;
}

/* Upgrade animation */
.model-indicator.upgrading {
    animation: modelUpgrade 0.5s ease-out;
}

@keyframes modelUpgrade {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); box-shadow: 0 0 12px rgba(180, 120, 200, 0.5); }
    100% { transform: scale(1); }
}

/* Model upgrade notice (inline) */
.model-upgrade-notice {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    margin: 0.5rem 0;
    background: linear-gradient(135deg, rgba(180, 120, 200, 0.1), rgba(100, 140, 200, 0.1));
    border: 1px solid rgba(180, 120, 200, 0.25);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    animation: slideIn 0.3s ease-out;
}

.model-upgrade-notice .upgrade-arrow {
    font-size: 0.875rem;
}

.model-upgrade-notice .upgrade-text strong {
    color: #a060c0;
}

.model-upgrade-notice.fading {
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.5s ease-out;
}

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

/* ============================================
   Input Area - Refined
   ============================================ */
.chat-input-area {
    flex-shrink: 0;
    padding: 1rem 1.5rem 1.5rem;
    background: var(--strategist-bg);
    border-top: 1px solid var(--strategist-border);
}

/* Working Indicator - hidden, no longer needed */
.chat-working-indicator {
    display: none !important;
}

.chat-working-indicator.hidden {
    display: none;
}

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

.working-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.working-dots span {
    width: 6px;
    height: 6px;
    background: linear-gradient(135deg, #5b3d8f 0%, #3b82f6 100%);
    border-radius: 50%;
    animation: workingPulse 1.4s ease-in-out infinite;
}

.working-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.working-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes workingPulse {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.working-text {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: linear-gradient(135deg, #5b3d8f 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* MAX mode working indicator */
.chat-input-area[data-max-mode="true"] .chat-working-indicator {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(234, 88, 12, 0.1) 100%);
    border-color: rgba(245, 158, 11, 0.25);
}

.chat-input-area[data-max-mode="true"] .working-dots span {
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
}

.chat-input-area[data-max-mode="true"] .working-text {
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.chat-input-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    max-width: var(--content-max-width);
    margin: 0 auto;
    position: relative;
}

.chat-input-wrapper {
    flex: 1;
    position: relative;
}

/* ============================================
   Autocomplete Dropdown
   ============================================ */
.autocomplete-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--strategist-surface-elevated);
    border: 1px solid var(--strategist-border);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
    max-height: 280px;
    overflow-y: auto;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.autocomplete-dropdown.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.autocomplete-dropdown::-webkit-scrollbar {
    width: 6px;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb {
    background: var(--strategist-border);
    border-radius: 3px;
}

.autocomplete-header {
    padding: 0.5rem 0.875rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--strategist-border-subtle);
    position: sticky;
    top: 0;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    cursor: pointer;
    transition: all 0.1s ease;
    border-bottom: 1px solid var(--strategist-border-subtle);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: rgba(88, 166, 255, 0.08);
}

.autocomplete-item.selected {
    background: rgba(88, 166, 255, 0.12);
}

.autocomplete-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.autocomplete-item.tool .autocomplete-icon {
    background: rgba(88, 166, 255, 0.1);
    color: var(--strategist-primary);
}

.autocomplete-item.command .autocomplete-icon {
    background: rgba(163, 113, 247, 0.1);
    color: var(--planner-color);
}

.autocomplete-item.topic .autocomplete-icon {
    background: rgba(63, 185, 80, 0.1);
    color: var(--success);
}

.autocomplete-content {
    flex: 1;
    min-width: 0;
}

.autocomplete-title {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
}

.autocomplete-title .highlight {
    color: var(--strategist-primary);
    font-weight: 600;
}

.autocomplete-description {
    font-size: 0.6875rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.autocomplete-shortcut {
    font-size: 0.625rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    flex-shrink: 0;
}

/* Keyboard hint at bottom */
.autocomplete-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.5rem 0.875rem;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--strategist-border-subtle);
    font-size: 0.625rem;
    color: var(--text-muted);
}

.autocomplete-hint kbd {
    font-family: var(--font-mono);
    background: rgba(255, 255, 255, 0.08);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    margin-right: 0.25rem;
}

.chat-input,
#chat-input {
    width: 100%;
    min-height: 48px;
    max-height: 200px;
    padding: 0.875rem 1.125rem;
    background: var(--strategist-surface-elevated);
    border: 1px solid var(--strategist-border);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    line-height: 1.55;
    resize: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    box-shadow: var(--shadow-sm);
}

/* Expand on focus */
.chat-input:focus,
#chat-input:focus {
    outline: none;
    border-color: var(--airops-teal);
    background: var(--strategist-surface-elevated);
    box-shadow: 0 0 0 3px var(--airops-teal-soft);
    box-shadow: var(--shadow-md);
    min-height: 72px;
}

/* Disabled state - when brand kits are loading */
.chat-input:disabled,
#chat-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--strategist-surface);
    border-color: var(--strategist-border-subtle);
}

.chat-input::placeholder,
#chat-input::placeholder {
    color: var(--text-muted);
}

.chat-input:disabled::placeholder,
#chat-input:disabled::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* Button group for proper alignment */
.input-buttons {
    display: flex;
    gap: 0.375rem;
    align-items: center;
}

.send-btn {
    width: 36px;
    height: 36px;
    background: var(--airops-forest);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.send-btn:hover:not(:disabled) {
    background: var(--airops-forest-light);
    box-shadow: var(--shadow-md), 0 0 0 2px var(--airops-lime-soft);
}

.send-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--strategist-border);
    color: var(--text-muted);
}

.send-btn.hidden,
.stop-btn.hidden,
.ideas-btn.hidden {
    display: none;
}

/* Stop Button */
.stop-btn {
    width: 34px;
    height: 34px;
    background: var(--error);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.stop-btn:hover {
    background: #b91c28;
}

.stop-btn:active {
    transform: scale(0.95);
}

@keyframes pulse-stop {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(248, 81, 73, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(248, 81, 73, 0);
    }
}

/* Stopped Indicator */
.stopped-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: rgba(248, 81, 73, 0.06);
    border: 1px solid rgba(248, 81, 73, 0.2);
    border-radius: 8px;
    color: var(--error);
    font-size: 0.8125rem;
    margin-top: 1rem;
    font-family: var(--font-sans);
}

.stopped-indicator span:first-child {
    font-size: 0.625rem;
}

/* ============================================
   Header Wrapper - Contains header + context panel
   ============================================ */
.header-wrapper {
    position: relative;
}

/* ============================================
   Context Panel - Hidden by default, shows on hover
   ============================================ */
.context-panel {
    padding: 0.5rem 1.5rem;
    background: var(--strategist-surface-elevated);
    border-bottom: 1px solid var(--strategist-border);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.25rem;
    font-size: 0.8125rem;
    /* Hidden by default */
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.25s ease;
}

/* Show context panel on header hover ONLY when no conversation is active */
.header-wrapper:not(.conversation-active):hover .context-panel,
.header-wrapper:not(.conversation-active) .context-panel:hover,
.context-panel.visible {
    max-height: 100px;
    padding: 0.5rem 1.5rem;
    opacity: 1;
    overflow: visible;
}

/* Always visible state - for new conversations or when user toggles via logo click */
.context-panel.always-visible {
    max-height: 100px;
    padding: 0.5rem 1.5rem;
    opacity: 1;
    overflow: visible;
}

.context-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.context-item .label {
    color: var(--text-tertiary);
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.context-item .value {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.8125rem;
}

.context-item.editable {
    gap: 0.5rem;
}

.context-input {
    width: 72px;
    padding: 0.25rem 0.5rem;
    background: var(--strategist-surface);
    border: 1px solid var(--strategist-border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.75rem;
    font-family: var(--font-mono);
    transition: all 0.15s ease;
}

.context-input:focus {
    outline: none;
    border-color: var(--strategist-primary);
    background: var(--strategist-surface-elevated);
}

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

/* Workspace/Brand Select Dropdowns */
.context-select {
    padding: 0.375rem 0.625rem;
    padding-right: 1.75rem;
    background: var(--strategist-surface-elevated);
    border: 1px solid var(--strategist-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.8125rem;
    font-family: var(--font-sans);
    font-weight: 500;
    transition: all 0.15s ease;
    cursor: pointer;
    max-width: 200px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a1a1aa' d='M3.5 4.5L6 7l2.5-2.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 12px;
    box-shadow: var(--shadow-sm);
}

.context-select:hover:not(:disabled) {
    border-color: var(--strategist-primary);
}

.context-select:focus {
    outline: none;
    border-color: var(--strategist-primary);
    background-color: var(--strategist-surface-elevated);
    box-shadow: 0 0 0 2px rgba(var(--strategist-primary-rgb, 0, 102, 255), 0.1);
}

.context-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--strategist-bg);
}

.context-select option {
    background: var(--strategist-surface);
    color: var(--text-primary);
    padding: 0.5rem;
}

/* Workspace selector (wider) */
#workspace-selector .context-select {
    min-width: 160px;
    max-width: 220px;
}

/* Brand kit selector */
#brand-selector .context-select {
    min-width: 140px;
    max-width: 200px;
}

/* ============================================
   Searchable Dropdown Component
   ============================================ */
.searchable-dropdown {
    position: relative;
    display: inline-block;
    z-index: 100;
}

.searchable-dropdown:focus-within {
    z-index: 10000;
}

.dropdown-input {
    padding: 0.25rem 0.5rem;
    padding-right: 1.5rem;
    background: var(--strategist-surface);
    border: 1px solid var(--strategist-border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.75rem;
    font-family: var(--font-sans);
    transition: all 0.15s ease;
    min-width: 180px;
    max-width: 260px;
    width: 100%;
    box-sizing: border-box;
}

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

.dropdown-input:hover:not(:disabled) {
    border-color: var(--strategist-primary);
}

.dropdown-input:focus {
    outline: none;
    border-color: var(--strategist-primary);
    background-color: var(--strategist-surface-elevated);
    box-shadow: 0 0 0 2px rgba(var(--strategist-primary-rgb, 0, 102, 255), 0.1);
}

.dropdown-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--strategist-bg);
}

.dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--strategist-surface-elevated);
    border: 1px solid var(--strategist-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 280px;
    overflow-y: auto;
    margin-top: 4px;
    display: none;
}

.dropdown-list.visible {
    display: block;
}

.dropdown-item {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background-color 0.1s ease;
    border-bottom: 1px solid var(--strategist-border-subtle);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover,
.dropdown-item.highlighted {
    background: var(--strategist-primary-glow);
}

.dropdown-item.disabled {
    color: var(--text-muted);
    cursor: default;
    font-style: italic;
}

.dropdown-item.disabled:hover {
    background: transparent;
}

/* Workspace dropdown wider */
#workspace-selector .dropdown-input {
    min-width: 200px;
    max-width: 280px;
}

#workspace-selector .dropdown-list {
    min-width: 280px;
}

/* Brand dropdown */
#brand-selector .dropdown-input {
    min-width: 160px;
    max-width: 240px;
}

#brand-selector .dropdown-list {
    min-width: 240px;
}

.context-load-btn {
    padding: 0.25rem 0.625rem;
    background: transparent;
    border: 1px solid var(--strategist-border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.6875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--font-sans);
}

.context-load-btn:hover:not(:disabled) {
    border-color: var(--strategist-primary);
    color: var(--strategist-primary);
}

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

.context-divider {
    width: 1px;
    height: 14px;
    background: var(--strategist-border);
    opacity: 0.5;
}

/* Context Toggle */
.context-toggle {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;
    cursor: pointer;
}

.context-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.context-toggle .toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--strategist-border);
    border-radius: 18px;
    transition: all 0.2s ease;
}

.context-toggle .toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-muted);
    border-radius: 50%;
    transition: all 0.2s ease;
}

.context-toggle input:checked + .toggle-slider {
    background-color: var(--strategist-primary);
}

.context-toggle input:checked + .toggle-slider:before {
    transform: translateX(14px);
    background-color: white;
}

.context-toggle:hover .toggle-slider {
    background-color: #c0c7cf;
}

.context-toggle input:checked:hover + .toggle-slider {
    background-color: #0860c7;
}

/* Disabled state for label */
.context-item .label.disabled {
    opacity: 0.5;
}

/* Disabled state for input */
.context-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--strategist-bg);
}

/* Memory stats removed - consolidated into Config dropdown */

/* ============================================
   Loading States
   ============================================ */
@keyframes spin {
    to { transform: rotate(360deg); }
}

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

@keyframes shimmer {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

.loading-indicator {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--text-muted);
    font-size: 0.8125rem;
    padding: 0.5rem 0;
}

.loading-dots {
    display: flex;
    gap: 5px;
}

.loading-dots span {
    width: 5px;
    height: 5px;
    background: var(--strategist-primary);
    border-radius: 50%;
    animation: shimmer 1.5s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.15s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.3s;
}

/* ============================================
   Strategy Output
   ============================================ */
.strategy-output {
    background: var(--strategist-bg);
    border: 1px solid var(--strategist-border);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 1rem;
}

.strategy-output-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--strategist-surface-elevated);
    border-bottom: 1px solid var(--strategist-border-subtle);
    font-size: 0.875rem;
    font-weight: 600;
}

.strategy-output-body {
    padding: 1rem;
}

/* ============================================
   Plan Panel - Minimized by Default
   ============================================ */
.plan-panel {
    background: var(--strategist-surface);
    border-bottom: 1px solid var(--strategist-border-subtle);
    padding: 0.5rem 1.25rem;
    width: 100%;
    max-width: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: visible;
    position: relative;
    z-index: 10;
}

.plan-panel:hover,
.plan-panel.expanded {
    padding-bottom: 1rem;
}

.plan-panel.hidden {
    display: none;
}

/* Minimized header - always visible */
.plan-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0;
    cursor: pointer;
    transition: margin 0.3s ease;
}

.plan-panel:hover .plan-header,
.plan-panel.expanded .plan-header {
    margin-bottom: 0.375rem;
}

.plan-icon {
    font-size: 0.75rem;
    opacity: 0.7;
}

.plan-title {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.2s ease;
}

.plan-panel:hover .plan-title,
.plan-panel.expanded .plan-title {
    color: var(--planner-color);
}

/* Minimized progress bar - full width segmented bar */
.plan-header-progress {
    flex: 1;
    display: flex;
    align-items: center;
    height: 6px;
    margin-left: 0.75rem;
    margin-right: 0.5rem;
    background: var(--strategist-border-subtle);
    border-radius: 3px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.plan-panel:hover .plan-header-progress,
.plan-panel.expanded .plan-header-progress {
    opacity: 0;
    height: 0;
    margin: 0;
    overflow: hidden;
}

/* Each segment fills its portion */
.plan-progress-segment {
    flex: 1;
    height: 100%;
    background: var(--strategist-border);
    transition: all 0.3s ease;
    position: relative;
}

.plan-progress-segment:first-child {
    border-radius: 3px 0 0 3px;
}

.plan-progress-segment:last-child {
    border-radius: 0 3px 3px 0;
}

.plan-progress-segment:only-child {
    border-radius: 3px;
}

.plan-progress-segment.complete {
    background: var(--success);
}

.plan-progress-segment.in_progress {
    background: var(--warning);
    animation: pulse-segment 1.5s ease-in-out infinite;
}

.plan-progress-segment.error {
    background: var(--error);
}

.plan-progress-segment.pending {
    background: transparent;
}

@keyframes pulse-segment {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Legacy dot support - hidden by default */
.plan-progress-dot {
    display: none;
}

/* Expand hint */
.plan-expand-hint {
    margin-left: auto;
    font-size: 0.625rem;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.plan-panel:hover .plan-expand-hint {
    opacity: 0.5;
}

.plan-panel.expanded .plan-expand-hint {
    opacity: 0;
}

.plan-toggle {
    display: none;
}

/* Plan content - hidden by default, shown on hover */
.plan-content {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0;
    width: 100%;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.plan-panel:hover .plan-content,
.plan-panel.expanded .plan-content {
    max-height: 120px;
    opacity: 1;
    padding-top: 0.5rem;
    padding-bottom: 0.75rem;
    overflow: visible;
}

.plan-content.collapsed {
    display: flex;
}

.plan-content::-webkit-scrollbar {
    display: none;
}

/* Stage Step - Evenly distributed */
.plan-step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.25rem;
    background: transparent;
    border-radius: 0;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 0;
}

/* Connector lines between stages */
.plan-step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: calc(50% + 14px);
    right: calc(-50% + 14px);
    top: 12px;
    height: 2px;
    background: var(--strategist-border);
    z-index: 0;
}

.plan-step:not(:last-child).complete::after {
    background: var(--success);
}

.plan-step:not(:last-child).in_progress::after {
    background: linear-gradient(90deg, var(--warning) 50%, var(--strategist-border) 50%);
    animation: pulse-line 1.5s ease-in-out infinite;
}

@keyframes pulse-line {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Stage indicator circle - smaller */
.plan-step-indicator {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    border-radius: 50%;
    background: var(--strategist-surface-elevated);
    border: 1.5px solid var(--strategist-border);
    color: var(--text-muted);
    flex-shrink: 0;
    transition: all 0.2s ease;
    z-index: 1;
}

.plan-step.pending .plan-step-indicator {
    background: var(--strategist-surface);
    border-color: var(--strategist-border);
    opacity: 0.6;
}

.plan-step.in_progress .plan-step-indicator {
    background: rgba(245, 158, 11, 0.15);
    border-color: var(--warning);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}

.plan-step.complete .plan-step-indicator {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--success);
    color: var(--success);
}

.plan-step.error .plan-step-indicator {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--error);
    color: var(--error);
}

.step-spinner {
    width: 12px;
    height: 12px;
    border: 1.5px solid rgba(245, 158, 11, 0.3);
    border-top-color: var(--warning);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Stage title - compact */
.plan-step-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

.plan-step-title {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-muted);
    max-width: 100%;
    text-align: center;
    line-height: 1.3;
    transition: color 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 0.125rem;
}

.plan-step.in_progress .plan-step-title {
    color: var(--warning);
    font-weight: 600;
}

.plan-step.complete .plan-step-title {
    color: var(--text-secondary);
}

.plan-step:hover .plan-step-title {
    color: var(--text-primary);
}

/* Hidden by default - shown on hover */
.plan-step-description,
.plan-step-tools {
    display: none;
}

/* Hover tooltip for details - positioned below */
.plan-step .plan-tooltip {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--strategist-surface-elevated);
    border: 1px solid var(--strategist-border);
    border-radius: 8px;
    padding: 0.625rem 0.875rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
    width: max-content;
    max-width: 220px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    white-space: normal;
    text-align: left;
}

/* Arrow pointing up */
.plan-step .plan-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: var(--strategist-border);
}

.plan-step .plan-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom-color: var(--strategist-surface-elevated);
    margin-bottom: -1px;
    z-index: 1;
}

.plan-step:hover .plan-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(8px);
}

/* Keep tooltip within bounds on edges */
.plan-step:first-child .plan-tooltip {
    left: 0;
    transform: translateX(0) translateY(4px);
}

.plan-step:first-child:hover .plan-tooltip {
    transform: translateX(0) translateY(8px);
}

.plan-step:first-child .plan-tooltip::after,
.plan-step:first-child .plan-tooltip::before {
    left: 20px;
}

.plan-step:last-child .plan-tooltip {
    left: auto;
    right: 0;
    transform: translateX(0) translateY(4px);
}

.plan-step:last-child:hover .plan-tooltip {
    transform: translateX(0) translateY(8px);
}

.plan-step:last-child .plan-tooltip::after,
.plan-step:last-child .plan-tooltip::before {
    left: auto;
    right: 20px;
}

/* Tooltip title */
.plan-tooltip-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.75rem;
    line-height: 1.3;
}

.plan-tooltip-title:not(:last-child) {
    margin-bottom: 0.25rem;
}

.plan-tooltip-desc {
    color: var(--text-secondary);
}

.plan-tooltip-desc:not(:last-child) {
    margin-bottom: 0.25rem;
}

.plan-tooltip-tools {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.625rem;
    margin-top: 0.375rem;
    padding-top: 0.25rem;
    border-top: 1px solid var(--strategist-border-subtle);
}

/* Hover state for entire step */
.plan-step:hover {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
}

.plan-step:hover .plan-step-indicator {
    transform: scale(1.05);
}

/* Plan Incomplete Warning */
.plan-incomplete-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 6px;
    margin-left: auto;
    animation: pulse-warning 2s ease-in-out infinite;
}

@keyframes pulse-warning {
    0%, 100% {
        border-color: rgba(245, 158, 11, 0.25);
    }
    50% {
        border-color: rgba(245, 158, 11, 0.5);
    }
}

.plan-incomplete-warning .warning-icon {
    font-size: 0.875rem;
}

.plan-incomplete-warning .warning-text {
    font-size: 0.6875rem;
    color: var(--warning);
    font-weight: 500;
}

.plan-step.step-incomplete-warning .plan-step-indicator {
    border-color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
    animation: pulse-indicator 2s ease-in-out infinite;
}

@keyframes pulse-indicator {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.3);
    }
    50% {
        box-shadow: 0 0 8px 2px rgba(245, 158, 11, 0.2);
    }
}

/* Responsive: Stack on small screens */
@media (max-width: 640px) {
    .plan-content {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .plan-step:not(:last-child)::after {
        display: none;
    }
    
    .plan-step {
        flex-direction: row;
        width: 100%;
        flex: none;
        justify-content: flex-start;
        padding: 0.5rem 0.75rem;
        background: var(--strategist-surface-elevated);
        border-radius: 8px;
    }
    
    .plan-step-content {
        align-items: flex-start;
        text-align: left;
    }
    
    .plan-step-title {
        max-width: none;
    }
    
    .plan-step::before {
        display: none;
    }
    
    /* Hide tooltips on mobile - info visible in expanded layout */
    .plan-step .plan-tooltip {
        display: none;
    }
}

/* ============================================
   Chat Area Flex Fix
   ============================================ */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* ============================================
   Responsive - Compact Layout for Narrow Viewports
   ============================================ */

/* Medium screens - start reducing */
@media (max-width: 900px) {
    .chat-messages {
        padding: 1.25rem 1rem;
    }
    
    .message {
        gap: 0.875rem;
        padding: 1.25rem 1rem;
    }
    
    .response-text,
    .message-text {
        font-size: 0.9375rem;
        line-height: 1.65;
    }
    
    .chat-input-area {
        padding: 0.75rem 1rem 1rem;
    }
}

/* Narrow screens - compact mode */
@media (max-width: 768px) {
    .strategist-header {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
    }
    
    .header-mode-badge {
        margin-left: 0;
        padding: 0.25rem 0.5rem;
        gap: 0.25rem;
    }
    
    .header-mode-badge .mode-badge-label {
        font-size: 0.7rem;
    }
    
    .mode-selector {
        width: 100%;
        justify-content: center;
    }
    
    .context-panel {
        flex-wrap: wrap;
        gap: 0.375rem;
        font-size: 0.7rem;
    }
    
    .header-wrapper:not(.conversation-active):hover .context-panel,
    .header-wrapper:not(.conversation-active) .context-panel:hover,
    .context-panel.visible {
        padding: 0.375rem 0.75rem;
    }
    
    .chat-messages {
        padding: 0.625rem 0.5rem;
    }
    
    .message {
        flex-direction: column;
        gap: 0.375rem;
        padding: 0.625rem 0.5rem;
    }
    
    .message-avatar {
        width: 22px;
        height: 22px;
        font-size: 0.75rem;
    }
    
    .response-text,
    .message-text {
        font-size: 0.8125rem;
        line-height: 1.55;
    }
    
    .response-text p,
    .message-text p {
        margin: 0 0 0.625em;
    }
    
    .response-text h1,
    .message-text h1 {
        font-size: 1.125rem;
        margin: 1em 0 0.5em;
    }
    
    .response-text h2,
    .message-text h2 {
        font-size: 1rem;
        margin: 0.875em 0 0.375em;
    }
    
    .response-text h3,
    .message-text h3 {
        font-size: 0.9rem;
        margin: 0.75em 0 0.25em;
    }
    
    .response-text ul,
    .response-text ol,
    .message-text ul,
    .message-text ol {
        padding-left: 1.25em;
        margin: 0.5em 0;
    }
    
    .response-text li,
    .message-text li {
        margin: 0.25em 0;
    }
    
    .message-content {
        max-width: 100%;
    }
    
    /* Move action buttons BELOW message content on narrow screens */
    .message-actions {
        width: 100%;
        order: 3;
        padding: 0 0 0 0 !important;
        margin: 0.5rem 0 0 0;
        justify-content: flex-start;
        opacity: 1;
        border-top: 1px solid var(--strategist-border-subtle);
    }
    
    .message.assistant:hover .message-actions {
        opacity: 1;
    }
    
    .message-action-btn {
        width: 26px;
        height: 26px;
    }
    
    .message-action-btn svg {
        width: 13px;
        height: 13px;
    }
    
    .message-action-divider {
        height: 14px;
    }
    
    .chat-input-area {
        padding: 0.5rem 0.5rem 0.625rem;
    }
    
    .chat-input,
    #chat-input {
        min-height: 36px;
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
        border-radius: 10px;
    }
    
    /* Simplified mode dropdown on small screens */
    .mode-dropdown-wrapper {
        margin-right: 0.25rem;
    }
    
    .mode-dropdown {
        font-size: 0.7rem;
        min-width: 100px;
        padding: 0.25rem 1.5rem 0.25rem 0.5rem;
    }
    
    .send-btn,
    .stop-btn {
        width: 30px;
        height: 30px;
        border-radius: 6px;
        font-size: 0.8rem;
    }
    
    .ideas-btn {
        height: 30px;
        padding: 0 8px;
        font-size: 0.7rem;
        border-radius: 6px;
    }
    
    .ideas-btn .ideas-icon {
        font-size: 0.75rem;
    }
    
    .ideas-btn .ideas-text {
        display: none;
    }
    
    /* Empty state compact */
    .empty-state {
        padding: 1.5rem 0.75rem;
    }

    .empty-state.start-screen {
        padding: 1rem 0.75rem;
    }

    .start-screen-header h2 {
        font-size: 1.75rem;
    }

    .start-screen-header p {
        font-size: 0.875rem;
    }
    
    .empty-state p {
        font-size: 0.75rem;
    }
    
    .prompt-categories {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .category-header {
        margin-bottom: 0.5rem;
    }
    
    .category-title {
        font-size: 0.625rem;
    }
}

/* Very narrow / mobile */
@media (max-width: 480px) {
    .chat-messages {
        padding: 0.375rem 0.375rem;
    }
    
    .message {
        gap: 0.25rem;
        padding: 0.5rem 0.375rem;
    }
    
    .message-avatar {
        width: 18px;
        height: 18px;
        font-size: 0.65rem;
    }
    
    .response-text,
    .message-text {
        font-size: 0.75rem;
        line-height: 1.5;
    }
    
    .response-text p,
    .message-text p {
        margin: 0 0 0.5em;
    }
    
    .response-text h1 {
        font-size: 1rem;
    }
    
    .response-text h2 {
        font-size: 0.9rem;
    }
    
    .response-text h3 {
        font-size: 0.8125rem;
    }
    
    /* Action buttons even smaller - still below content */
    .message-actions {
        width: 100%;
        order: 3;
        padding: 0.375rem 0 0 0 !important;
        margin: 0.375rem 0 0 0;
        gap: 0.25rem;
    }
    
    .message-action-btn {
        width: 24px;
        height: 24px;
    }
    
    .message-action-btn svg {
        width: 11px;
        height: 11px;
    }
    
    .message-action-divider {
        height: 12px;
        margin: 0 0.125rem;
    }
    
    .chat-input-area {
        padding: 0.375rem 0.375rem 0.5rem;
    }
    
    .chat-input,
    #chat-input {
        min-height: 32px;
        padding: 0.375rem 0.625rem;
        font-size: 0.75rem;
        border-radius: 8px;
    }
    
    .send-btn,
    .stop-btn {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
    
    .ideas-btn {
        height: 28px;
        padding: 0 6px;
        font-size: 0.65rem;
    }
    
    .mode-dropdown-wrapper {
        display: none;
    }
    
    .send-btn,
    .stop-btn {
        width: 30px;
        height: 30px;
    }
    
    .ideas-btn {
        height: 30px;
        min-width: 30px;
        padding: 0 8px;
    }
    
    /* Typography compact */
    .response-text h1,
    .message-text h1 {
        font-size: 1.25rem;
        margin: 1.5em 0 0.5em;
    }
    
    .response-text h2,
    .message-text h2 {
        font-size: 1.125rem;
        margin: 1.25em 0 0.4em;
    }
    
    .response-text h3,
    .message-text h3 {
        font-size: 1rem;
        margin: 1em 0 0.35em;
    }
    
    .response-text ul,
    .response-text ol,
    .message-text ul,
    .message-text ol {
        padding-left: 1.25em;
        margin: 0.625em 0;
    }
    
    .response-text li,
    .message-text li {
        margin-bottom: 0.25em;
    }
}

/* ============================================
   Empty State / Start Screen - Refined Minimal
   ============================================ */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    padding: 3rem 2rem 2rem;
    height: 100%;
    max-width: 1000px;
    margin: 0 auto;
    overflow-y: auto;
}

.empty-state.start-screen {
    justify-content: flex-start;
    padding-top: 6rem;
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

/* Smooth hide animation when user sends first message */
.empty-state.start-screen.hiding {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

.start-screen-header {
    margin-bottom: 4rem;
    text-align: center;
}

.start-screen-header h2 {
    font-size: 2.5rem;
    font-weight: 400;
    font-family: var(--font-display);
    font-optical-sizing: auto;
    font-style: normal;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin: 0 0 1.5rem 0;
    line-height: 1.2;
    display: block;
}

.start-screen-header p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0 auto;
    max-width: 420px;
    font-weight: 400;
    font-family: var(--font-sans);
}

/* Prompt Categories Container - Three Column Grid */
.prompt-categories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem 3rem;
    width: 100%;
    max-width: 1000px;
}

/* Individual Category */
.prompt-category {
    text-align: left;
}

/* Category Header */
.category-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.category-icon {
    display: none;
}

.category-title {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.category-time {
    font-size: 0.625rem;
    color: var(--text-tertiary);
    padding: 0;
    background: none;
    border-radius: 0;
    margin-left: auto;
    opacity: 0.6;
    font-weight: 500;
}

/* Category Prompts - Stack */
.category-prompts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Suggested Prompt Cards - Refined */
.suggested-prompt {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: 0.875rem 1rem;
    background: var(--strategist-surface-elevated);
    border: 1px solid var(--strategist-border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-sans);
    min-height: auto;
    box-shadow: var(--shadow-sm);
}

.suggested-prompt:last-child {
    border-bottom: 1px solid var(--strategist-border);
}

.suggested-prompt:hover {
    background: var(--strategist-surface-elevated);
    border-color: var(--strategist-border);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.suggested-prompt .prompt-text {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.45;
    margin-bottom: 0.375rem;
    letter-spacing: -0.01em;
}

.suggested-prompt .prompt-meta {
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    line-height: 1.4;
    opacity: 1;
}

/* B&W minimal styling - unified across all prompt types */
.prompt-category.quick .category-title,
.prompt-category.competitive .category-title,
.prompt-category.strategic .category-title {
    color: var(--text-tertiary);
}

.suggested-prompt.quick,
.suggested-prompt.competitive,
.suggested-prompt.strategic {
    border-left: none;
}

.suggested-prompt.quick:hover,
.suggested-prompt.competitive:hover,
.suggested-prompt.strategic:hover {
    background: var(--strategist-surface-elevated);
    border-color: rgba(198, 229, 77, 0.4);
    box-shadow: var(--shadow-md), 0 0 0 1px var(--airops-lime-soft);
    transform: translateY(-1px);
}

/* Active/pressed state */
.suggested-prompt:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Responsive adjustments for start screen */
@media (max-width: 900px) {
    .prompt-categories {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem 2rem;
    }
}

@media (max-width: 640px) {
    .prompt-categories {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .empty-state.start-screen {
        padding: 1.5rem 1rem;
        padding-top: 3rem;
    }
    
    .start-screen-header h2 {
        font-size: 1.75rem;
    }
    
    .start-screen-header p {
        font-size: 0.875rem;
    }
    
    .start-screen-header {
        margin-bottom: 2.5rem;
    }
    
    .suggested-prompt {
        padding: 0.75rem 0.875rem;
    }
    
    .suggested-prompt .prompt-text {
        font-size: 0.8125rem;
    }
    
    .suggested-prompt .prompt-meta {
        font-size: 0.6875rem;
    }
}

/* Legacy suggested-prompts (fallback) */
.suggested-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

/* ============================================
   Ideas Button
   ============================================ */
.ideas-btn {
    height: 34px;
    padding: 0 12px;
    background: linear-gradient(135deg, #6b4d9a 0%, #5b3d8f 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    /* Hidden by default, shown on focus */
    opacity: 0;
    transform: translateX(8px);
    pointer-events: none;
}

/* Show ideas button when input area has focus or is active */
.chat-input-container:focus-within .ideas-btn,
.chat-input-area.controls-visible .ideas-btn {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    box-shadow: 0 1px 4px rgba(91, 61, 143, 0.2);
}

.ideas-btn .ideas-icon {
    font-size: 0.85rem;
    transition: transform 0.2s ease;
}

.ideas-btn .ideas-text {
    max-width: 0;
    opacity: 0;
    white-space: nowrap;
    overflow: hidden;
    transition: max-width 0.25s ease, opacity 0.2s ease;
}

.ideas-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #7a5ca8 0%, #6b4d9a 100%);
    box-shadow: 0 3px 10px rgba(91, 61, 143, 0.3);
    transform: translateY(-1px);
    padding: 0 14px;
}

.ideas-btn:hover:not(:disabled) .ideas-text {
    max-width: 80px;
    opacity: 1;
    margin-left: 4px;
}

.ideas-btn:hover:not(:disabled) .ideas-icon {
    transform: rotate(15deg) scale(1.1);
}

.ideas-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 6px rgba(91, 61, 143, 0.25);
}

.ideas-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(135deg, #8a7aaf 0%, #6b4d9a 100%);
    box-shadow: none;
}

.ideas-btn.loading {
    animation: ideas-pulse 1.5s ease-in-out infinite;
}

.ideas-btn.loading .ideas-icon {
    animation: sparkle-spin 1s linear infinite;
}

@keyframes ideas-pulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(91, 61, 143, 0.25);
    }
    50% {
        box-shadow: 0 4px 20px rgba(91, 61, 143, 0.45);
    }
}

@keyframes sparkle-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   Ideas Stream Content
   ============================================ */
.ideas-phase {
    padding: 1rem;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 12px;
    margin-bottom: 1.25rem;
}

.ideas-phase-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.ideas-phase-icon {
    font-size: 1.25rem;
}

.ideas-phase-text {
    flex: 1;
    font-size: 0.9rem;
    color: var(--strategist-primary);
    font-weight: 500;
}

.ideas-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-top-color: var(--strategist-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Phase Progress Steps */
.ideas-phase-steps {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    flex-wrap: wrap;
}

.phase-step {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0.5;
    transition: all 0.3s ease;
}

.phase-step .step-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: all 0.3s ease;
}

.phase-step.active {
    opacity: 1;
    color: var(--strategist-primary);
}

.phase-step.active .step-dot {
    background: var(--strategist-primary);
    box-shadow: 0 0 8px var(--strategist-primary);
    animation: pulse-dot 1.5s ease-in-out infinite;
}

.phase-step.complete {
    opacity: 1;
    color: var(--success);
}

.phase-step.complete .step-dot {
    background: var(--success);
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* Section Headers */
.ideas-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.ideas-section-header h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.overall-visibility {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
}

.overall-visibility.critical {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.overall-visibility.needs_work {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.overall-visibility.good {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.ideas-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
}

/* Topics Section */
.ideas-topics {
    margin-bottom: 1.5rem;
}

.ideas-topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.5rem;
}

.ideas-topic-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.875rem;
    background: var(--strategist-surface-elevated);
    border: 1px solid var(--strategist-border-subtle);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.ideas-topic-item .topic-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.ideas-topic-item .topic-status {
    font-size: 0.75rem;
    flex-shrink: 0;
}

.ideas-topic-item.critical {
    border-left: 3px solid var(--error);
    background: rgba(239, 68, 68, 0.05);
}

.ideas-topic-item.needs_work {
    border-left: 3px solid var(--warning);
    background: rgba(245, 158, 11, 0.05);
}

.ideas-topic-item.good,
.ideas-topic-item.excellent {
    border-left: 3px solid var(--success);
}

.ideas-topic-item .clickable-topic {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: color 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ideas-topic-item .clickable-topic:hover {
    color: var(--strategist-primary);
    text-decoration: underline;
}

.topic-metrics {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.topic-visibility {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.ideas-topic-item.critical .topic-visibility {
    color: var(--error);
    background: rgba(239, 68, 68, 0.15);
}

.ideas-topic-item.needs_work .topic-visibility {
    color: var(--warning);
    background: rgba(245, 158, 11, 0.15);
}

.ideas-topic-item.good .topic-visibility,
.ideas-topic-item.excellent .topic-visibility {
    color: var(--success);
    background: rgba(16, 185, 129, 0.15);
}

.topic-questions {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
}

/* Folders Section */
.ideas-folders {
    margin-bottom: 1.5rem;
}

.ideas-folders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
}

.ideas-folder-item {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 0.625rem 0.75rem;
    background: var(--strategist-surface-elevated);
    border: 1px solid var(--strategist-border-subtle);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.ideas-folder-item:hover {
    border-color: var(--strategist-secondary);
    background: rgba(20, 184, 166, 0.05);
}

.ideas-folder-item .folder-name {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--strategist-secondary);
    cursor: pointer;
    transition: color 0.15s ease;
}

.ideas-folder-item .folder-name:hover {
    color: var(--strategist-primary);
    text-decoration: underline;
}

.folder-metrics {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.folder-pages,
.folder-clicks,
.folder-share {
    font-size: 0.65rem;
    color: var(--text-muted);
    padding: 0.125rem 0.375rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 3px;
}

.folder-share {
    color: var(--strategist-secondary);
    background: rgba(20, 184, 166, 0.1);
}

/* Ideas List */
.ideas-list {
    margin-bottom: 1.5rem;
}

.ideas-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.ideas-grid {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.clickable-idea {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    background: var(--strategist-surface);
    border: 1px solid var(--strategist-border-subtle);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.clickable-idea:hover {
    background: var(--strategist-surface-elevated);
    border-color: var(--strategist-primary);
    transform: translateX(4px);
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.15);
}

.clickable-idea.priority-high {
    border-left: 3px solid var(--error);
}

.clickable-idea.priority-high:hover {
    border-color: var(--error);
    box-shadow: 0 2px 12px rgba(239, 68, 68, 0.2);
}

.clickable-idea.priority-medium {
    border-left: 3px solid var(--warning);
}

.idea-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.idea-icon {
    font-size: 1.125rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    flex-shrink: 0;
}

.idea-priority {
    font-size: 0.875rem;
}

.idea-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
}

.clickable-idea:hover .idea-text {
    color: var(--strategist-primary);
}

.idea-impact {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Comprehensive Summary Section */
.ideas-summary {
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(20, 184, 166, 0.08) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    margin-top: 1.25rem;
}

.ideas-summary.comprehensive {
    background: var(--strategist-surface-elevated);
    border: 1px solid var(--strategist-border);
}

.summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--strategist-border-subtle);
}

.summary-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-trend {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.summary-trend.trend-up {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.summary-trend.trend-down {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.summary-trend.trend-flat {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.summary-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    text-align: center;
}

.summary-stat.primary {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(20, 184, 166, 0.15) 100%);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.summary-stat.primary .stat-value {
    background: var(--strategist-accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.stat-alert {
    font-size: 0.65rem;
    color: var(--error);
    margin-top: 0.25rem;
}

.stat-detail {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
}

.summary-insights {
    margin-bottom: 1rem;
}

.summary-insights h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.summary-insights ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.summary-insights li {
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 0.375rem 0;
    border-bottom: 1px solid var(--strategist-border-subtle);
}

.summary-insights li:last-child {
    border-bottom: none;
}

.summary-competitors {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.summary-competitors .label {
    color: var(--text-secondary);
}

.summary-competitors .value {
    color: var(--text-primary);
    font-weight: 500;
}

.summary-cta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
    padding-top: 0.75rem;
    border-top: 1px solid var(--strategist-border-subtle);
}

/* ============================================
   Clarification Wizard - Clean Black & White
   ============================================ */
.clarification-wizard {
    background: var(--strategist-surface);
    border: 1px solid var(--strategist-border);
    border-radius: 12px;
    margin: 1rem 0;
    overflow: hidden;
    animation: wizardFadeIn 0.25s ease-out;
}

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

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

@keyframes wizardSlideOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(-20px); }
}

/* Wizard Header */
.wizard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--strategist-border);
    background: var(--strategist-surface);
}

.wizard-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin: 0;
}

.wizard-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wizard-progress-text {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.wizard-progress-bar {
    width: 60px;
    height: 3px;
    background: var(--strategist-border);
    border-radius: 2px;
    overflow: hidden;
}

.wizard-progress-fill {
    height: 100%;
    background: var(--text-primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Wizard Content */
.wizard-content {
    padding: 1.5rem 1.25rem;
    min-height: 180px;
}

/* Current Question */
.wizard-question {
    animation: wizardSlideIn 0.25s ease-out;
}

.wizard-question.exiting {
    animation: wizardSlideOut 0.2s ease-out forwards;
}

.wizard-question-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.375rem 0;
    line-height: 1.4;
}

.wizard-question-description {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0 0 1.25rem 0;
    line-height: 1.5;
}

/* Wizard Footer */
.wizard-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--strategist-border);
    background: var(--strategist-surface);
}

.wizard-skip-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s ease;
    font-family: var(--font-sans);
}

.wizard-skip-btn:hover {
    color: var(--text-secondary);
}

.wizard-nav-btns {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.wizard-back-btn {
    background: transparent;
    border: 1px solid var(--strategist-border);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--font-sans);
}

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

.wizard-back-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.wizard-next-btn {
    background: var(--text-primary);
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--strategist-surface);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.15s ease;
    font-family: var(--font-sans);
}

.wizard-next-btn:hover:not(:disabled) {
    opacity: 0.85;
}

.wizard-next-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.wizard-next-btn .btn-arrow {
    font-size: 0.875rem;
    transition: transform 0.15s ease;
}

.wizard-next-btn:hover:not(:disabled) .btn-arrow {
    transform: translateX(2px);
}

/* Skip All Button */
.wizard-skip-all-btn {
    background: transparent;
    border: 1px solid var(--strategist-border);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--font-sans);
    margin-left: auto;
}

.wizard-skip-all-btn:hover {
    border-color: var(--text-muted);
    color: var(--text-secondary);
}

/* ============================================
   Wizard Radio Options - Clean Minimal Style
   ============================================ */
.wizard-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wizard-radio-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: transparent;
    border: 1px solid var(--strategist-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.wizard-radio-option:hover {
    border-color: var(--text-muted);
    background: rgba(0, 0, 0, 0.02);
}

@media (prefers-color-scheme: dark) {
    .wizard-radio-option:hover {
        background: rgba(255, 255, 255, 0.03);
    }
}

.wizard-radio-option.selected {
    border-color: var(--text-primary);
    background: rgba(0, 0, 0, 0.03);
}

@media (prefers-color-scheme: dark) {
    .wizard-radio-option.selected {
        background: rgba(255, 255, 255, 0.06);
    }
}

.wizard-radio-option input[type="radio"] {
    display: none;
}

.wizard-radio-check {
    width: 18px;
    height: 18px;
    border: 2px solid var(--strategist-border);
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    transition: all 0.15s ease;
}

.wizard-radio-option.selected .wizard-radio-check {
    border-color: var(--text-primary);
}

.wizard-radio-option.selected .wizard-radio-check::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 10px;
    height: 10px;
    background: var(--text-primary);
    border-radius: 50%;
}

.wizard-radio-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
    transition: color 0.15s ease;
}

.wizard-radio-option.selected .wizard-radio-label {
    color: var(--text-primary);
    font-weight: 500;
}

/* Other option with text input */
.wizard-radio-option.other-option {
    flex-wrap: wrap;
}

.wizard-other-input {
    flex: 1;
    min-width: 150px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--strategist-border);
    padding: 0.25rem 0;
    font-size: 0.875rem;
    color: var(--text-primary);
    font-family: var(--font-sans);
    outline: none;
    transition: border-color 0.15s ease;
}

.wizard-other-input:focus {
    border-bottom-color: var(--text-primary);
}

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

/* ============================================
   Wizard Checkbox Options
   ============================================ */
.wizard-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.wizard-checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border: 1px solid var(--strategist-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.wizard-checkbox-option:hover {
    border-color: var(--text-muted);
    background: rgba(0, 0, 0, 0.02);
}

@media (prefers-color-scheme: dark) {
    .wizard-checkbox-option:hover {
        background: rgba(255, 255, 255, 0.03);
    }
}

.wizard-checkbox-option.selected {
    border-color: var(--text-primary);
    background: rgba(0, 0, 0, 0.03);
}

@media (prefers-color-scheme: dark) {
    .wizard-checkbox-option.selected {
        background: rgba(255, 255, 255, 0.06);
    }
}

.wizard-checkbox-option input[type="checkbox"] {
    display: none;
}

.wizard-checkbox-check {
    width: 18px;
    height: 18px;
    border: 2px solid var(--strategist-border);
    border-radius: 4px;
    flex-shrink: 0;
    position: relative;
    transition: all 0.15s ease;
}

.wizard-checkbox-option.selected .wizard-checkbox-check {
    border-color: var(--text-primary);
    background: var(--text-primary);
}

.wizard-checkbox-option.selected .wizard-checkbox-check::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 4px;
    height: 8px;
    border: solid var(--strategist-surface);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.wizard-checkbox-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
    transition: color 0.15s ease;
}

.wizard-checkbox-option.selected .wizard-checkbox-label {
    color: var(--text-primary);
    font-weight: 500;
}

/* ============================================
   Wizard Text/Textarea Inputs
   ============================================ */
.wizard-text-input {
    width: 100%;
    box-sizing: border-box;
    background: transparent;
    border: 1px solid var(--strategist-border);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-family: var(--font-sans);
    transition: border-color 0.15s ease;
}

.wizard-text-input:hover {
    border-color: var(--text-muted);
}

.wizard-text-input:focus {
    outline: none;
    border-color: var(--text-primary);
}

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

.wizard-textarea {
    width: 100%;
    box-sizing: border-box;
    background: transparent;
    border: 1px solid var(--strategist-border);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.15s ease;
}

.wizard-textarea:hover {
    border-color: var(--text-muted);
}

.wizard-textarea:focus {
    outline: none;
    border-color: var(--text-primary);
}

.wizard-textarea::placeholder {
    color: var(--text-muted);
}

/* ============================================
   Wizard Completion State
   ============================================ */
.wizard-complete {
    text-align: center;
    padding: 2rem 1rem;
}

.wizard-complete-icon {
    width: 48px;
    height: 48px;
    background: var(--text-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.25rem;
    color: var(--strategist-surface);
}

.wizard-complete-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ============================================
   Legacy Clarification Styles (for backwards compat)
   ============================================ */
.clarification-form-container {
    background: var(--strategist-surface);
    border: 1px solid var(--strategist-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
    animation: wizardFadeIn 0.25s ease-out;
}

.clarification-form-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--strategist-border);
}

.clarification-icon {
    display: none;
}

.clarification-header-text h3 {
    font-size: 0.8125rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.clarification-header-text p {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0.25rem 0 0;
}

.clarification-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.clarification-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform 0.2s ease;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--strategist-border-subtle);
}

.clarification-field:last-of-type {
    padding-bottom: 0;
    border-bottom: none;
}

.clarification-field.filled {
    transform: none;
}

.clarification-field .field-label {
    font-size: 0.925rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    line-height: 1.4;
}

.clarification-field .field-label .required {
    color: var(--text-muted);
    font-weight: 400;
}

.clarification-field .field-description {
    font-size: 0.825rem;
    color: var(--text-muted);
    margin: 0 0 0.5rem 0;
    line-height: 1.5;
}

/* Radio Group - Clean minimal style */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: transparent;
    border: 1px solid var(--strategist-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.radio-option:hover {
    border-color: var(--text-muted);
    background: rgba(0, 0, 0, 0.02);
}

@media (prefers-color-scheme: dark) {
    .radio-option:hover {
        background: rgba(255, 255, 255, 0.03);
    }
}

.radio-option:has(input:checked) {
    border-color: var(--text-primary);
    background: rgba(0, 0, 0, 0.03);
}

@media (prefers-color-scheme: dark) {
    .radio-option:has(input:checked) {
        background: rgba(255, 255, 255, 0.06);
    }
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--strategist-border);
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.radio-option input[type="radio"]:checked + .radio-checkmark {
    border-color: var(--text-primary);
}

.radio-option input[type="radio"]:checked + .radio-checkmark::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 10px;
    height: 10px;
    background: var(--text-primary);
    border-radius: 50%;
}

.radio-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: color 0.15s ease;
    line-height: 1.4;
}

.radio-option:has(input:checked) .radio-label {
    color: var(--text-primary);
    font-weight: 500;
}

/* Compact layout for 4+ options */
.radio-group:has(.radio-option:nth-child(4)) .radio-option {
    padding: 0.75rem 1rem;
}

/* Checkbox Group (Multiselect) - Clean minimal style */
.multiselect-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: transparent;
    border: 1px solid var(--strategist-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.checkbox-option:hover {
    border-color: var(--text-muted);
    background: rgba(0, 0, 0, 0.02);
}

@media (prefers-color-scheme: dark) {
    .checkbox-option:hover {
        background: rgba(255, 255, 255, 0.03);
    }
}

.checkbox-option:has(input:checked) {
    border-color: var(--text-primary);
    background: rgba(0, 0, 0, 0.03);
}

@media (prefers-color-scheme: dark) {
    .checkbox-option:has(input:checked) {
        background: rgba(255, 255, 255, 0.06);
    }
}

.checkbox-option input[type="checkbox"] {
    display: none;
}

.checkbox-checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--strategist-border);
    border-radius: 4px;
    position: relative;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.checkbox-option input[type="checkbox"]:checked + .checkbox-checkmark {
    border-color: var(--text-primary);
    background: var(--text-primary);
}

.checkbox-option input[type="checkbox"]:checked + .checkbox-checkmark::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 4px;
    height: 8px;
    border: solid var(--strategist-surface);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: color 0.15s ease;
    line-height: 1.4;
}

.checkbox-option:has(input:checked) .checkbox-label {
    color: var(--text-primary);
    font-weight: 500;
}

/* Compact layout for 4+ options */
.multiselect-group:has(.checkbox-option:nth-child(4)) .checkbox-option {
    padding: 0.625rem 1rem;
}

/* "Other" option with text input */
.radio-option.other-option,
.checkbox-option.other-option {
    flex-wrap: wrap;
    gap: 0.5rem;
}

.other-option .other-input {
    flex: 1;
    min-width: 150px;
    box-sizing: border-box;
    padding: 0.25rem 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--strategist-border);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: var(--font-sans);
    transition: border-color 0.15s ease;
    outline: none;
}

.other-option .other-input:hover {
    border-bottom-color: var(--text-muted);
}

.other-option .other-input:focus {
    border-bottom-color: var(--text-primary);
}

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

/* Textarea for "Anything else" field */
.clarification-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.875rem 1rem;
    background: transparent;
    border: 1px solid var(--strategist-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-sans);
    line-height: 1.5;
    resize: vertical;
    min-height: 80px;
    max-height: 200px;
    transition: border-color 0.15s ease;
}

.clarification-textarea:hover {
    border-color: var(--text-muted);
}

.clarification-textarea:focus {
    outline: none;
    border-color: var(--text-primary);
}

.clarification-textarea::placeholder {
    color: var(--text-muted);
}

/* "Anything else" field styling */
.anything-else-field {
    margin-top: 0.5rem;
    padding-top: 1.25rem;
    padding-bottom: 0;
    border-top: 1px solid var(--strategist-border);
    border-bottom: none;
}

.anything-else-field .field-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

/* Select Dropdown */
.clarification-select {
    width: 100%;
    box-sizing: border-box;
    background-color: transparent;
    border: 1px solid var(--strategist-border);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color 0.15s ease;
    appearance: none;
    -webkit-appearance: none;
    font-family: var(--font-sans);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.75rem;
}

.clarification-select:hover {
    border-color: var(--text-muted);
}

.clarification-select:focus {
    outline: none;
    border-color: var(--text-primary);
}

.clarification-select option {
    background: var(--strategist-surface);
    color: var(--text-primary);
    padding: 0.5rem;
}

/* Text Input */
.clarification-input {
    width: 100%;
    box-sizing: border-box;
    background: transparent;
    border: 1px solid var(--strategist-border);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: border-color 0.15s ease;
    font-family: var(--font-sans);
}

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

.clarification-input:hover {
    border-color: var(--text-muted);
}

.clarification-input:focus {
    outline: none;
    border-color: var(--text-primary);
}

/* Form Actions */
.clarification-form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 1px solid var(--strategist-border);
}

.clarification-skip-btn {
    background: transparent;
    border: 1px solid var(--strategist-border);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--font-sans);
}

.clarification-skip-btn:hover {
    color: var(--text-secondary);
    border-color: var(--text-muted);
}

.clarification-submit-btn {
    background: var(--text-primary);
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--strategist-surface);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.15s ease;
    font-family: var(--font-sans);
}

.clarification-submit-btn:hover:not(:disabled) {
    opacity: 0.85;
}

.clarification-submit-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.clarification-submit-btn .button-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--strategist-surface);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Submitted/Skipped States */
.clarification-submitted,
.clarification-skipped {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: transparent;
    border: 1px solid var(--strategist-border);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    animation: wizardFadeIn 0.25s ease-out;
}

.clarification-submitted .check-icon {
    width: 22px;
    height: 22px;
    background: var(--text-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--strategist-surface);
}

.clarification-skipped {
    color: var(--text-muted);
}

/* ============================================
   Config Dropdown (Tools + Debug combined)
   ============================================ */
.config-dropdown {
    position: relative;
    margin-left: auto;
}

.config-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: var(--strategist-surface-elevated);
    border: 1px solid var(--strategist-border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.15s;
}

.config-btn:hover {
    border-color: var(--strategist-primary);
    color: var(--text-primary);
    background: rgba(88, 166, 255, 0.05);
}

.config-icon {
    font-size: 0.875rem;
}

.config-chevron {
    font-size: 0.625rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.config-dropdown-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    background: var(--strategist-surface);
    border: 1px solid var(--strategist-border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.5);
    z-index: 1000;
    overflow: hidden;
}

.config-dropdown-panel.hidden {
    display: none;
}

.config-section {
    border-bottom: 1px solid var(--strategist-border-subtle);
}

.config-section:last-child {
    border-bottom: none;
}

.config-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--strategist-surface-elevated);
    border-bottom: 1px solid var(--strategist-border-subtle);
}

.config-section-icon {
    font-size: 0.875rem;
}

.config-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tool-selector-count {
    background: var(--strategist-primary);
    color: var(--strategist-bg);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.65rem;
    font-family: var(--font-mono);
}

.tool-selector-actions {
    display: flex;
    gap: 0.375rem;
    margin-left: auto;
}

.tool-action-btn {
    padding: 0.25rem 0.5rem;
    background: transparent;
    border: 1px solid var(--strategist-border);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 0.625rem;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.15s;
}

.tool-action-btn:hover {
    border-color: var(--strategist-primary);
    color: var(--strategist-primary);
}

.tool-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
}

.tool-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.625rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    opacity: 0.5;
}

.tool-item:hover {
    background: var(--strategist-surface-elevated);
}

.tool-item.enabled {
    opacity: 1;
}

.tool-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--strategist-primary);
    cursor: pointer;
}

.tool-icon {
    font-size: 1rem;
}

.tool-name {
    flex: 1;
    font-size: 0.75rem;
    color: var(--text-primary);
}

/* Debug section inside config */
.debug-section .debug-content {
    padding: 0.75rem 1rem;
}

.debug-section .debug-content .debug-status,
.debug-section .debug-content .debug-operation,
.debug-section .debug-content .debug-timing {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0;
    border-bottom: 1px solid var(--strategist-border-subtle);
}

.debug-section .debug-content > div:last-child {
    border-bottom: none;
}

.debug-section .debug-log {
    margin-top: 0.5rem;
    max-height: 120px;
    overflow-y: auto;
}

/* ============================================
   Debug Panel (inside Config dropdown)
   ============================================ */

.debug-status,
.debug-operation,
.debug-timing {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0;
    border-bottom: 1px solid var(--strategist-border-subtle);
}

.debug-label {
    color: var(--text-muted);
    font-family: var(--font-mono);
    min-width: 70px;
}

.debug-value {
    color: var(--text-primary);
    font-family: var(--font-mono);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#debug-status-value {
    color: var(--warning);
}

#debug-time-value {
    color: var(--strategist-primary);
    font-weight: 600;
}

/* ============================================
   Profile Section (inside Config dropdown)
   ============================================ */

.profile-section {
    border-top: 1px solid var(--strategist-border-subtle);
}

.profile-config-content {
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.profile-config-email {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    padding: 0.5rem 0.75rem;
    background: var(--strategist-surface);
    border-radius: 6px;
    border: 1px solid var(--strategist-border-subtle);
}

.profile-edit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    background: var(--airops-teal-soft);
    border: 1px solid rgba(90, 154, 138, 0.3);
    border-radius: 6px;
    color: var(--airops-forest);
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-edit-btn:hover {
    background: rgba(90, 154, 138, 0.2);
    border-color: var(--airops-teal);
}

/* ============================================
   Danger Zone Section (inside Config dropdown)
   ============================================ */

.danger-section {
    border-top: 1px solid var(--strategist-border-subtle);
}

.danger-section .config-section-header {
    background: rgba(239, 68, 68, 0.05);
}

.danger-section .config-section-title {
    color: #ef4444;
}

.danger-content {
    padding: 0.75rem 1rem;
}

.danger-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    color: #ef4444;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.danger-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

.danger-btn:active {
    background: rgba(239, 68, 68, 0.15);
    transform: scale(0.98);
}

.danger-btn-icon {
    font-size: 0.875rem;
}

.danger-btn-text {
    flex: 1;
    text-align: left;
}

.debug-log {
    margin-top: 0.5rem;
    max-height: 180px;
    overflow-y: auto;
}

.debug-log-entry {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.375rem;
    border-radius: 4px;
    margin-bottom: 2px;
    background: rgba(255, 255, 255, 0.02);
}

.debug-log-entry.running {
    background: rgba(210, 153, 34, 0.1);
}

.debug-log-entry.done {
    background: rgba(63, 185, 80, 0.1);
}

.debug-log-entry.started {
    background: rgba(88, 166, 255, 0.1);
}

.debug-log-icon {
    font-size: 0.7rem;
}

.debug-log-op {
    flex: 1;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.debug-log-time {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.65rem;
}

/* ============================================
   Loading Animations
   ============================================ */
.loading-dots {
    display: flex;
    align-items: center;
    gap: 4px;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--strategist-primary);
    animation: loadingDot 1.4s infinite both;
}

.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes loadingDot {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Loading state for conversation switch */
.loading-conversation {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-muted);
}

.loading-conversation .loading-dots span {
    width: 8px;
    height: 8px;
}

/* Smooth transition for main layout */
.strategist-container {
    transition: none;
}

.strategist-container.sidebar-open .main-content {
    margin-left: 0;
}

/* Ensure proper z-indexing */
.conversation-sidebar {
    z-index: 100;
}

.sidebar-expand-btn {
    z-index: 50;
}

/* Mobile responsiveness - stack vertically on small screens */
@media (max-width: 1024px) {
    .conversation-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        width: 280px;
        z-index: 1000;
    }
    
    .strategist-container:not(.sidebar-open) .conversation-sidebar {
        transform: translateX(-100%);
    }
    
    .strategist-container.sidebar-open .main-content {
        opacity: 0.5;
    }
    
    /* Revert to stacked layout on mobile/tablet */
    .strategist-container.grid-open .workspace-area {
        display: flex;
        flex-direction: column;
        grid-template-columns: unset;
        grid-template-rows: unset;
        grid-template-areas: unset;
    }
    
    .strategist-container.grid-open .grid-panel {
        grid-area: unset;
        flex: none;
        height: 50%;
        min-height: 200px;
        order: 1;
        margin: 0.5rem;
        margin-bottom: 0;
        border-radius: 12px 12px 0 0;
    }
    
    .strategist-container.grid-open .chat-area {
        grid-area: unset;
        flex: 1;
        max-width: none;
        order: 2;
    }
    
    .strategist-container.grid-open .chat-input-area {
        grid-area: unset;
        max-width: none;
        order: 3;
    }
}

/* Ensure grid tab bar is always visible when there are tabs */
.grid-tab-bar:not(.hidden) {
    display: block !important;
}

/* ============================================
   Input Area - Compact mode when grid open
   ============================================ */
.strategist-container.grid-open .chat-input-container {
    flex-wrap: wrap;
    gap: 0.5rem;
}

.strategist-container.grid-open .mode-dropdown-wrapper {
    order: 2;
    margin-right: 0;
    margin-left: auto;
}

.strategist-container.grid-open .chat-input-wrapper {
    order: 1;
    flex: 1 1 100%;
    min-width: 0;
}

.strategist-container.grid-open .input-buttons {
    order: 3;
}

/* Mode dropdown responsive when grid open */
@media (max-width: 1400px) {
    .strategist-container.grid-open .mode-dropdown {
        min-width: 100px;
        font-size: 0.7rem;
    }
}

/* Fix for workspace area layout */
.workspace-area {
    position: relative;
    overflow: hidden;
}

/* Smooth animations for grid panel */
.grid-panel {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Chat Hidden Mode - Full-width grid/doc
   ============================================ */
.strategist-container.grid-open.chat-hidden .workspace-area {
    grid-template-columns: 1fr;
    grid-template-areas:
        "grid"
        "grid";
}

.strategist-container.grid-open.chat-hidden .chat-area,
.strategist-container.grid-open.chat-hidden .chat-input-area {
    display: none;
}

.strategist-container.grid-open.chat-hidden .grid-panel {
    margin-left: 1rem;
}

/* Toggle chat button styling */
.toggle-chat-btn {
    background: rgba(9, 105, 218, 0.08) !important;
    border-color: rgba(9, 105, 218, 0.2) !important;
}

.toggle-chat-btn:hover {
    background: rgba(9, 105, 218, 0.15) !important;
    border-color: rgba(9, 105, 218, 0.4) !important;
}

.strategist-container.chat-hidden .toggle-chat-btn {
    background: var(--strategist-primary) !important;
    color: white !important;
    border-color: var(--strategist-primary) !important;
}

/* ============================================
   Clickable Suggestions in Chat
   ============================================ */
/* Inline clickable suggestions - hover-only styling */
.clickable-suggestion {
    cursor: pointer;
    padding: 0.125em 0.35em;
    margin: -0.125em -0.125em;
    border-radius: 4px;
    transition: all 0.15s ease;
    display: inline;
}

.clickable-suggestion:hover {
    background: rgba(9, 105, 218, 0.1);
    color: var(--strategist-primary);
}

/* Clickable list items (full li element) - hover-only styling */
.response-text li.clickable-list-item,
.message-text li.clickable-list-item {
    cursor: pointer;
    margin-left: -0.5em;
    margin-right: -0.5em;
    padding-left: 0.5em;
    padding-right: 0.5em;
    padding-top: 0.35em;
    padding-bottom: 0.35em;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.response-text li.clickable-list-item:hover,
.message-text li.clickable-list-item:hover {
    background: rgba(9, 105, 218, 0.08);
}
/*
.response-text li.clickable-list-item:hover::before,
.message-text li.clickable-list-item:hover::before {
    background: var(--strategist-primary);
    opacity: 1;
}
*/

/* Clickable topic entities in text - hover-only styling */
.clickable-entity {
    cursor: pointer;
    padding: 0.05em 0.1em;
    margin: -0.1em 0;
    border-radius: 4px;
    transition: all 0.15s ease;
    font-weight: 500;
}

.clickable-entity:hover {
    background: rgba(26, 127, 55, 0.15);
    color: var(--strategist-secondary);
}

/* ============================================
   Message Action Buttons
   ============================================ */
.message-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0 0 0rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    width: 100%;
    clear: both;
}

.message.assistant:hover .message-actions,
.message.assistant.complete .message-actions:focus-within {
    opacity: 1;
}

/* Always show on touch devices */
@media (hover: none) {
    .message.assistant.complete .message-actions {
        opacity: 0.7;
    }
}

.message-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s ease;
}

.message-action-btn:hover {
    background: var(--strategist-surface);
    border-color: var(--strategist-border);
    color: var(--text-primary);
}

.message-action-btn.thumbs-up-action:hover {
    background: rgba(26, 127, 55, 0.1);
    border-color: rgba(26, 127, 55, 0.3);
    color: var(--success);
}

.message-action-btn.thumbs-down-action:hover {
    background: rgba(207, 34, 46, 0.1);
    border-color: rgba(207, 34, 46, 0.3);
    color: var(--error);
}

.message-action-btn.copied {
    background: rgba(26, 127, 55, 0.15);
    border-color: var(--success);
    color: var(--success);
}

.message-action-btn.markdown-action:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
    color: #8b5cf6;
}

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

.message-action-divider {
    width: 1px;
    height: 16px;
    background: var(--strategist-border);
    margin: 0 0.25rem;
}

/* ============================================
   Feedback Modal
   ============================================ */
.feedback-modal-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.6) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: modalFadeIn 0.25s ease-out;
    padding: 1.5rem;
}

@keyframes modalFadeIn {
    from { 
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to { 
        opacity: 1;
        backdrop-filter: blur(8px);
    }
}

.feedback-modal {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.98) 0%,
        rgba(249, 250, 251, 0.98) 100%);
    border-radius: 24px;
    width: 100%;
    max-width: 480px;
    box-shadow: 
        0 0 0 1px rgba(0, 0, 0, 0.04),
        0 4px 6px -1px rgba(0, 0, 0, 0.05),
        0 20px 40px -8px rgba(0, 0, 0, 0.15),
        0 40px 80px -20px rgba(0, 0, 0, 0.2);
    animation: modalSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    position: relative;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .feedback-modal {
        background: linear-gradient(180deg, 
            rgba(30, 32, 36, 0.98) 0%, 
            rgba(24, 26, 30, 0.98) 100%);
        box-shadow: 
            0 0 0 1px rgba(255, 255, 255, 0.08),
            0 4px 6px -1px rgba(0, 0, 0, 0.15),
            0 20px 40px -8px rgba(0, 0, 0, 0.4),
            0 40px 80px -20px rgba(0, 0, 0, 0.5);
    }
}

/* Subtle top border accent */
.feedback-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        #10b981 0%, 
        #34d399 50%, 
        #6ee7b7 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.feedback-modal.positive::before {
    opacity: 1;
}

.feedback-modal.negative::before {
    background: linear-gradient(90deg, 
        #f43f5e 0%, 
        #fb7185 50%, 
        #fda4af 100%);
    opacity: 1;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.feedback-modal-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.75rem 1.75rem 0 1.75rem;
    position: relative;
}

.feedback-modal-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    font-size: 1.625rem;
    flex-shrink: 0;
    position: relative;
    animation: iconBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}

@keyframes iconBounce {
    from {
        transform: scale(0.5);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.feedback-modal-icon.positive {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.feedback-modal-icon.negative {
    background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.15);
}

@media (prefers-color-scheme: dark) {
    .feedback-modal-icon.positive {
        background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(52, 211, 153, 0.15) 100%);
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
    }
    
    .feedback-modal-icon.negative {
        background: linear-gradient(135deg, rgba(244, 63, 94, 0.2) 0%, rgba(251, 113, 133, 0.15) 100%);
        box-shadow: 0 4px 12px rgba(244, 63, 94, 0.1);
    }
}

.feedback-modal-header h3 {
    flex: 1;
    margin: 0;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary, #111827);
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.feedback-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-muted, #9ca3af);
    font-size: 1.25rem;
    transition: all 0.15s ease;
    flex-shrink: 0;
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.feedback-modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary, #111827);
    transform: scale(1.05);
}

@media (prefers-color-scheme: dark) {
    .feedback-modal-close:hover {
        background: rgba(255, 255, 255, 0.08);
    }
}

.feedback-modal-body {
    padding: 1.5rem 1.75rem 1.75rem 1.75rem;
}

.feedback-modal-body label {
    display: flex;
    align-items: center;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary, #111827);
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.feedback-modal-body label .required {
    color: #f43f5e;
    margin-left: 0.375rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.feedback-modal-body textarea {
    width: 100%;
    min-height: 120px;
    padding: 0.875rem 1rem;
    background: rgba(0, 0, 0, 0.02);
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    font-family: inherit;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-primary, #111827);
    resize: none;
    transition: all 0.2s ease;
}

@media (prefers-color-scheme: dark) {
    .feedback-modal-body textarea {
        background: rgba(255, 255, 255, 0.03);
        border-color: rgba(255, 255, 255, 0.1);
    }
}

.feedback-modal-body textarea:hover {
    border-color: rgba(0, 0, 0, 0.15);
}

@media (prefers-color-scheme: dark) {
    .feedback-modal-body textarea:hover {
        border-color: rgba(255, 255, 255, 0.15);
    }
}

.feedback-modal-body textarea:focus {
    outline: none;
    border-color: var(--strategist-primary, #0969da);
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.12);
    background: white;
}

@media (prefers-color-scheme: dark) {
    .feedback-modal-body textarea:focus {
        background: rgba(255, 255, 255, 0.05);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    }
}

.feedback-modal-body textarea::placeholder {
    color: var(--text-muted, #9ca3af);
    opacity: 0.8;
}

.feedback-hint {
    margin-top: 0.875rem;
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    color: var(--text-muted, #6b7280);
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 10px;
}

@media (prefers-color-scheme: dark) {
    .feedback-hint {
        background: rgba(255, 255, 255, 0.03);
    }
}

.feedback-hint-icon {
    font-size: 1rem;
    flex-shrink: 0;
    filter: grayscale(0.3);
}

.feedback-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.75rem 1.5rem 1.75rem;
}

.feedback-modal-footer .btn-secondary {
    padding: 0.625rem 1.25rem;
    background: transparent;
    border: 1.5px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary, #4b5563);
    cursor: pointer;
    transition: all 0.15s ease;
}

@media (prefers-color-scheme: dark) {
    .feedback-modal-footer .btn-secondary {
        border-color: rgba(255, 255, 255, 0.15);
        color: var(--text-secondary, #9ca3af);
    }
}

.feedback-modal-footer .btn-secondary:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.2);
}

@media (prefers-color-scheme: dark) {
    .feedback-modal-footer .btn-secondary:hover {
        background: rgba(255, 255, 255, 0.06);
        border-color: rgba(255, 255, 255, 0.2);
    }
}

.feedback-modal-footer .btn-primary {
    padding: 0.625rem 1.375rem;
    background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 
        0 1px 2px rgba(37, 99, 235, 0.2),
        0 4px 12px rgba(37, 99, 235, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.feedback-modal-footer .btn-primary:hover:not(:disabled) {
    background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 
        0 2px 4px rgba(37, 99, 235, 0.2),
        0 8px 20px rgba(37, 99, 235, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.feedback-modal-footer .btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 
        0 1px 2px rgba(37, 99, 235, 0.2),
        0 2px 8px rgba(37, 99, 235, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.feedback-modal-footer .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    background: linear-gradient(180deg, #9ca3af 0%, #6b7280 100%);
}

/* Thank you state */
.feedback-thank-you {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    animation: feedbackThankYouIn 0.4s ease-out;
}

@keyframes feedbackThankYouIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.feedback-thank-you-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    animation: feedbackIconBounce 0.5s ease-out 0.2s both;
}

@keyframes feedbackIconBounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.feedback-thank-you h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #111827);
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.02em;
}

.feedback-thank-you p {
    font-size: 1rem;
    color: var(--text-secondary, #6b7280);
    margin: 0;
}

/* Fade out animation for modal */
.feedback-modal-overlay.fade-out {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* ============================================
   Feedback Toast
   ============================================ */
.feedback-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(180deg, 
        rgba(255, 255, 255, 0.98) 0%, 
        rgba(249, 250, 251, 0.98) 100%);
    color: var(--text-primary, #111827);
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 
        0 0 0 1px rgba(0, 0, 0, 0.06),
        0 4px 6px -1px rgba(0, 0, 0, 0.08),
        0 12px 24px -4px rgba(0, 0, 0, 0.12);
    z-index: 10001;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
    .feedback-toast {
        background: linear-gradient(180deg, 
            rgba(40, 44, 52, 0.98) 0%, 
            rgba(32, 36, 44, 0.98) 100%);
        color: rgba(255, 255, 255, 0.95);
        box-shadow: 
            0 0 0 1px rgba(255, 255, 255, 0.08),
            0 4px 6px -1px rgba(0, 0, 0, 0.2),
            0 12px 24px -4px rgba(0, 0, 0, 0.3);
    }
}

.feedback-toast::before {
    content: '✓';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.feedback-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.feedback-toast.error {
    border-left: 3px solid #f43f5e;
}

.feedback-toast.error::before {
    content: '!';
    background: linear-gradient(135deg, #f43f5e 0%, #fb7185 100%);
}

.feedback-toast.success {
    border-left: 3px solid #10b981;
}

/* ============================================
   Stat Blocks - Clean Minimal Stats Display
   ============================================ */
.stat-blocks {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1.25rem 0;
}

.stat-block {
    flex: 1 1 auto;
    min-width: 120px;
    max-width: 180px;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid var(--strategist-border-subtle);
    border-radius: 12px;
    text-align: center;
    transition: all 0.2s ease;
}

.stat-block:hover {
    border-color: var(--strategist-border);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-block-value {
    font-size: 1.75rem;
    line-height: 1.1;
    margin-bottom: 0.575rem;
    font-family: var(--font-mono);
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--strategist-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-block-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.3;
}

/* Stat block color variants */
.stat-block[data-color="green"] .stat-block-value {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-block[data-color="blue"] .stat-block-value {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-block[data-color="amber"] .stat-block-value {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-block[data-color="red"] .stat-block-value {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-block[data-color="purple"] .stat-block-value {
    background: linear-gradient(135deg, #7a5ca8 0%, #5b3d8f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Larger variant for key metrics */
.stat-blocks.large .stat-block {
    min-width: 150px;
    max-width: 220px;
    padding: 1.25rem 1.5rem;
}

.stat-blocks.large .stat-block-value {
    font-size: 2.25rem;
}

.stat-blocks.large .stat-block-label {
    font-size: 0.8125rem;
}

/* Compact variant */
.stat-blocks.compact .stat-block {
    min-width: 100px;
    max-width: 140px;
    padding: 0.75rem 1rem;
}

.stat-blocks.compact .stat-block-value {
    font-size: 1.375rem;
}

.stat-blocks.compact .stat-block-label {
    font-size: 0.6875rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .stat-blocks {
        gap: 0.75rem;
    }
    
    .stat-block {
        min-width: 100px;
        max-width: none;
        flex: 1 1 calc(50% - 0.375rem);
        padding: 0.875rem 1rem;
    }
    
    .stat-block-value {
        font-size: 1.5rem;
    }
}

/* ============================================
   Citation Pills - Data source indicators
   ============================================ */

/* Base citation pill - small, subtle, gray */
.citation-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.375rem;
    margin-left: 0.25rem;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    cursor: help;
    position: relative;
    vertical-align: baseline;
    transition: all 0.15s ease;
}

.citation-pill:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-secondary);
}

/* Tooltip on hover - uses ::after pseudo-element */
.citation-pill::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background: var(--text-primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 400;
    font-family: var(--font-sans);
    text-transform: none;
    letter-spacing: normal;
    line-height: 1.4;
    border-radius: 6px;
    max-width: 300px;
    min-width: 150px;
    white-space: normal;
    text-align: left;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

.citation-pill:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Tooltip arrow */
.citation-pill::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--text-primary);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 1001;
}

.citation-pill:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Inline variant - used within prose text */
.citation-pill-inline {
    margin-left: 0.125rem;
    vertical-align: middle;
}

/* Container for inline cited values */
.inline-cited-value {
    display: inline;
}

/* Stat block citation - positioned below label */
.stat-block-citation {
    margin-top: 0.5rem;
}

.stat-block-citation .citation-pill {
    font-size: 0.5625rem;
    padding: 0.0625rem 0.25rem;
}

/* Handle tooltip overflow near edges */
.citation-pill[data-tooltip-position="left"]::after {
    left: 0;
    transform: translateX(0);
}

.citation-pill[data-tooltip-position="left"]::before {
    left: 12px;
    transform: translateX(0);
}

.citation-pill[data-tooltip-position="right"]::after {
    left: auto;
    right: 0;
    transform: translateX(0);
}

.citation-pill[data-tooltip-position="right"]::before {
    left: auto;
    right: 12px;
    transform: translateX(0);
}

/* Mobile: tap to show tooltip */
@media (max-width: 768px) {
    .citation-pill::after {
        max-width: 250px;
    }
    
    /* On mobile, show tooltip on focus for accessibility */
    .citation-pill:focus::after,
    .citation-pill:focus::before {
        opacity: 1;
        visibility: visible;
    }
    
    .citation-pill {
        /* Make tappable */
        -webkit-tap-highlight-color: transparent;
    }
}

/* =============================================================================
   Flight Supervisor - Anti-hallucination verification UI
   ============================================================================= */

/* Supervisor Toggle removed - feature disabled */

/* Flight Supervisor Status Block (kept for response rendering) */
.supervisor-block {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
    margin: 0.5rem 0;
    background: linear-gradient(135deg, rgba(100, 100, 255, 0.08), rgba(255, 200, 50, 0.08));
    border-radius: 0.5rem;
    border-left: 3px solid #6464ff;
    font-size: 0.8125rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
    animation: supervisor-slide-in 0.3s ease-out;
}

@keyframes supervisor-slide-in {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.supervisor-block.starting {
    border-left-color: #6464ff;
}

.supervisor-block.checking {
    border-left-color: #64b5f6;
    background: linear-gradient(135deg, rgba(100, 181, 246, 0.1), rgba(100, 100, 255, 0.05));
}

.supervisor-block.issue-found {
    border-left-color: #ff6b6b;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.12), rgba(255, 200, 50, 0.05));
}

.supervisor-block.fixing {
    border-left-color: #ffc832;
    background: linear-gradient(135deg, rgba(255, 200, 50, 0.12), rgba(100, 100, 255, 0.05));
}

.supervisor-block.fixed {
    border-left-color: #4ecdc4;
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.12), rgba(255, 200, 50, 0.08));
}

.supervisor-block.approved {
    border-left-color: #4ecdc4;
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.1), rgba(100, 100, 255, 0.05));
}

.supervisor-block.retry {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(234, 88, 12, 0.08));
    animation: supervisor-pulse 1.5s ease-in-out infinite;
}

@keyframes supervisor-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.supervisor-block.fade-out {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.5s ease;
}

.supervisor-icon {
    font-size: 1.125rem;
    flex-shrink: 0;
}

.supervisor-icon.spinning {
    animation: spin 1s linear infinite;
}

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

.supervisor-text {
    flex: 1;
    color: var(--text-primary);
}

.supervisor-text em {
    color: var(--text-secondary);
    font-style: italic;
}

.supervisor-progress {
    width: 60px;
    height: 3px;
    background: rgba(100, 100, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.supervisor-progress-bar {
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, #6464ff, #ffc832);
    border-radius: 2px;
    animation: progress-slide 1.5s ease-in-out infinite;
}

@keyframes progress-slide {
    0% { transform: translateX(-100%); width: 30%; }
    50% { width: 60%; }
    100% { transform: translateX(300%); width: 30%; }
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .supervisor-block {
        background: linear-gradient(135deg, rgba(100, 100, 255, 0.12), rgba(255, 200, 50, 0.08));
    }
}

/* =============================================================================
   Action Inbox - Full-screen sitemap-style work queue (localhost only)
   ============================================================================= */

/* Header Button */
.action-inbox-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4375rem 0.875rem;
    background: var(--strategist-surface-elevated);
    border: 1px solid var(--strategist-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.action-inbox-btn:hover {
    background: var(--strategist-surface);
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.action-inbox-icon {
    font-size: 0.9375rem;
}

.action-inbox-label {
    font-weight: 500;
}

.action-inbox-count {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    background: var(--text-primary);
    border-radius: 9px;
    color: white;
    font-size: 0.6875rem;
    font-weight: 700;
}

.action-inbox-count:not(:empty) {
    display: flex;
}

/* Full-screen Overlay */
.action-inbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.action-inbox-overlay.visible {
    opacity: 1;
}

.action-inbox-overlay.closing {
    opacity: 0;
}

.action-inbox-container {
    width: 95%;
    max-width: 1400px;
    height: 90vh;
    background: var(--strategist-surface);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: var(--font-sans);
}

.action-inbox-overlay.visible .action-inbox-container {
    transform: scale(1);
}

/* Header */
.action-inbox-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--strategist-surface-elevated);
    border-bottom: 1px solid var(--strategist-border);
}

.action-inbox-header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-sans);
}

.action-inbox-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.action-inbox-close {
    margin-left: auto;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--strategist-border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-inbox-close:hover {
    background: var(--strategist-surface);
    border-color: var(--strategist-border-strong);
    color: var(--text-primary);
}

/* Body - Split View */
.action-inbox-body {
    display: grid;
    grid-template-columns: 320px 1fr;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Sidebar - Sitemap */
.action-inbox-sidebar {
    border-right: 1px solid var(--strategist-border);
    overflow-y: auto;
    background: var(--strategist-bg);
}

.sitemap-section {
    padding: 1rem;
}

.sitemap-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--strategist-surface);
    border-radius: 6px;
}

.sitemap-section-icon {
    font-size: 0.875rem;
}

/* Sitemap Tree */
.sitemap-tree {
    font-size: 0.8125rem;
}

.sitemap-node {
    margin-left: 0.5rem;
}

.sitemap-node[data-depth="0"] {
    margin-left: 0;
}

.sitemap-node-header {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.sitemap-node-header:hover {
    background: var(--strategist-surface);
}

.sitemap-toggle {
    width: 16px;
    font-size: 0.625rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.sitemap-toggle-placeholder {
    width: 16px;
}

.sitemap-folder-icon {
    font-size: 0.875rem;
}

.sitemap-name {
    flex: 1;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
}

.sitemap-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: rgba(59, 130, 246, 0.15);
    border-radius: 9px;
    color: #3b82f6;
    font-size: 0.6875rem;
    font-weight: 600;
}

.sitemap-children {
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sitemap-children.collapsed {
    display: none;
}

/* Sitemap Items */
.sitemap-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.625rem;
    margin-left: 1.25rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sitemap-item:hover {
    background: var(--strategist-surface);
}

.sitemap-item.selected {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.sitemap-item-icon {
    font-size: 0.75rem;
}

.sitemap-item-title {
    flex: 1;
    font-size: 0.75rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Empty State */
.sitemap-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

.sitemap-empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.sitemap-empty p {
    margin: 0.5rem 0;
}

.sitemap-empty-hint {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Detail Panel */
.action-inbox-detail {
    overflow-y: auto;
    padding: 1.5rem;
    background: var(--strategist-surface);
}

.inbox-detail-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
}

.inbox-detail-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.inbox-detail-content {
    max-width: 700px;
}

/* Stacked View for Multiple Items */
.inbox-stacked-view {
    max-width: 800px;
}

.inbox-page-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--strategist-border);
}

.inbox-items-stack {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.inbox-item-card {
    background: var(--strategist-bg);
    border: 1px solid var(--strategist-border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.inbox-item-card:hover {
    border-color: var(--strategist-border-hover);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.inbox-item-card .inbox-detail-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.inbox-item-card .inbox-detail-section {
    margin-bottom: 1rem;
}

.inbox-item-card .inbox-detail-meta {
    margin-bottom: 1rem;
}

.inbox-item-card .inbox-detail-source {
    margin-bottom: 1rem;
}

.inbox-item-card .inbox-detail-actions {
    padding-top: 1rem;
    border-top: 1px solid var(--strategist-border);
    margin-top: 0.5rem;
}

/* Page clickable style in sidebar */
.sitemap-page {
    cursor: pointer;
}

.sitemap-page:hover {
    background: var(--strategist-bg);
}

.inbox-detail-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.inbox-detail-type {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.inbox-detail-type.existing {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.inbox-detail-type.new {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.inbox-detail-path {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.inbox-detail-title {
    margin: 0 0 1.5rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    font-family: var(--font-sans);
}

/* Brief Loading State */
.inbox-brief-loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--strategist-bg);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.inbox-brief-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--strategist-border);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Detail Sections */
.inbox-detail-section {
    margin-bottom: 1.5rem;
}

.inbox-detail-section h3 {
    margin: 0 0 0.5rem 0;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.inbox-detail-section p {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.inbox-changes-list {
    margin: 0;
    padding-left: 1.25rem;
    list-style: disc;
}

.inbox-changes-list li {
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    line-height: 1.5;
}

/* Meta Badges */
.inbox-detail-meta {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.inbox-meta-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

/* Source Info */
.inbox-detail-source {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--strategist-bg);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.8125rem;
}

.inbox-source-label {
    color: var(--text-muted);
}

.inbox-source-value {
    color: var(--text-primary);
    font-weight: 500;
}

/* Actions */
.inbox-detail-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--strategist-border);
}

.inbox-status-select {
    padding: 0.5rem 0.75rem;
    background: var(--strategist-surface-elevated);
    border: 1px solid var(--strategist-border);
    border-radius: 6px;
    font-size: 0.8125rem;
    color: var(--text-primary);
    cursor: pointer;
    text-transform: capitalize;
}

.inbox-status-select:focus {
    outline: none;
    border-color: #3b82f6;
}

.inbox-delete-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    color: #ef4444;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.inbox-delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.5);
}

/* Grid Checkbox Column */
.col-checkbox {
    width: 40px;
    text-align: center;
    padding: 0.25rem !important;
}

.col-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #3b82f6;
}

.col-actions {
    width: 44px;
    text-align: center;
    padding: 0.25rem !important;
}

/* Grid Inbox Button */
.grid-inbox-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--strategist-border);
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
}

.grid-row:hover .grid-inbox-btn {
    opacity: 1;
}

.grid-inbox-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    transform: scale(1.1);
}

/* Row Added Animation */
.grid-row.inbox-added {
    animation: inbox-pulse 0.6s ease-out;
}

@keyframes inbox-pulse {
    0% {
        background: transparent;
    }
    30% {
        background: rgba(59, 130, 246, 0.2);
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
    }
    100% {
        background: transparent;
    }
}

/* Grid Selection Bar */
.grid-selection-bar {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--strategist-surface-elevated);
    border: 1px solid var(--strategist-border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 100;
}

.grid-selection-bar.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.selection-count {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.selection-action-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.selection-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.selection-clear-btn {
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: 1px solid var(--strategist-border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.selection-clear-btn:hover {
    background: var(--strategist-surface);
    border-color: var(--strategist-border-strong);
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1.25rem;
    background: var(--strategist-surface-elevated);
    border: 1px solid var(--strategist-border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    transform: translateY(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-notification.visible {
    transform: translateY(0);
    opacity: 1;
}

.toast-notification.success {
    border-left: 3px solid #10b981;
}

.toast-notification.error {
    border-left: 3px solid #ef4444;
}

.toast-icon {
    font-size: 1rem;
}

.toast-notification.success .toast-icon {
    color: #10b981;
}

.toast-notification.error .toast-icon {
    color: #ef4444;
}

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

/* Inbox count bounce animation */
@keyframes inbox-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.action-inbox-count.bounce {
    animation: inbox-bounce 0.4s ease-out;
}

/* =============================================================================
   STRATEGY SESSION - 3-Stage Planner Flow
   ============================================================================= */

.strategy-session {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 800px;
}

.session-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.session-logo img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

.session-title h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.session-subtitle {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Stage Indicators */
.stage-indicators {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.stage-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    opacity: 0.5;
    transition: all 0.2s ease;
}

.stage-indicator.active {
    opacity: 1;
    background: rgba(99, 102, 241, 0.1);
}

.stage-indicator.completed {
    opacity: 1;
}

.stage-indicator.completed .stage-icon {
    color: #10b981;
}

.stage-icon {
    font-size: 1.25rem;
}

.stage-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.stage-connector {
    width: 40px;
    height: 2px;
    background: var(--border-color);
}

/* Session Content */
.session-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.session-stage {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    opacity: 0.5;
    pointer-events: none;
    transition: all 0.2s ease;
}

.session-stage.active,
.session-stage:has(.selected) {
    opacity: 1;
    pointer-events: auto;
    border-color: var(--accent-color);
}

.stage-heading {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Stage 1: Request Refiner */
.request-refiner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.request-comparison {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.request-original,
.request-refined {
    flex: 1;
}

.request-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.request-text {
    margin: 0;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    font-size: 0.875rem;
    line-height: 1.5;
}

.request-text.dimmed {
    opacity: 0.6;
}

.request-edit {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    color: var(--text-primary);
}

.request-edit:focus {
    outline: none;
    border-color: var(--accent-color);
}

.request-arrow {
    flex-shrink: 0;
    padding-top: 1.5rem;
    font-size: 1.25rem;
    color: var(--text-secondary);
}

/* Interpretation Cards */
.interpretation-cards {
    margin-top: 1rem;
}

.interpretation-intro {
    margin: 0 0 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.interpretation-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.interpretation-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.interpretation-card:hover {
    border-color: var(--accent-color);
}

.interpretation-card.selected {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--accent-color);
}

.interpretation-card input {
    margin-top: 0.125rem;
}

.interp-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

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

.interp-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Stage 2: Plan Selector */
.plan-selector {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.plan-variations {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.plan-card {
    position: relative;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.plan-card:hover {
    border-color: var(--accent-color);
}

.plan-card.selected {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--accent-color);
}

.plan-card.recommended {
    border-color: var(--accent-color);
}

.plan-badge {
    position: absolute;
    top: -8px;
    right: 8px;
    padding: 0.125rem 0.5rem;
    background: var(--accent-color);
    color: white;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
}

.plan-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.plan-icon {
    font-size: 1.25rem;
}

.plan-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.plan-meta {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.plan-steps,
.plan-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.plan-description {
    margin: 0 0 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

.plan-best-for {
    font-size: 0.6875rem;
    font-style: italic;
    color: var(--text-tertiary);
}

/* Steps Editor */
.plan-steps-editor {
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.plan-steps-editor.hidden {
    display: none;
}

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

.steps-header h5 {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.add-step-btn {
    padding: 0.375rem 0.75rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.add-step-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.steps-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.step-drag-handle {
    cursor: grab;
    color: var(--text-tertiary);
    font-size: 0.75rem;
}

.step-content {
    flex: 1;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.step-number {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-color);
    color: white;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 50%;
}

.step-title-input {
    flex: 1;
    padding: 0.25rem 0.5rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 0.8125rem;
    color: var(--text-primary);
}

.step-title-input:focus {
    outline: none;
    border-color: var(--border-color);
    background: var(--bg-tertiary);
}

.step-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.25rem;
    padding-left: 1.75rem;
}

.step-tool {
    padding: 0.125rem 0.375rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 3px;
    font-size: 0.625rem;
    color: var(--accent-color);
}

.step-delete {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 1rem;
    cursor: pointer;
    border-radius: 4px;
}

.step-delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Stage 3: Output Configurator */
.output-configurator {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.output-types {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.output-type-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 0.5rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.output-type-card:hover {
    border-color: var(--accent-color);
}

.output-type-card.selected {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--accent-color);
}

.output-type-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.output-icon {
    font-size: 1.5rem;
}

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

.output-desc {
    font-size: 0.6875rem;
    color: var(--text-secondary);
}

/* Grid Size Selector */
.output-options {
    padding-top: 0.5rem;
}

.grid-size-selector label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.size-options {
    display: flex;
    gap: 0.5rem;
}

.size-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.size-btn:hover {
    border-color: var(--accent-color);
}

.size-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

/* Session Actions */
.session-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.session-btn {
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.session-btn.secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.session-btn.secondary:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.session-btn.primary {
    background: var(--accent-color);
    border: 1px solid var(--accent-color);
    color: white;
}

.session-btn.primary:hover:not(:disabled) {
    background: var(--accent-hover);
}

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

/* Session Cancelled/Executing States */
.session-cancelled,
.session-executing {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.session-executing .session-header {
    display: inline-flex;
    border: none;
    padding: 0;
    margin-bottom: 1rem;
}

.session-executing .session-header img {
    width: 24px;
    height: 24px;
    margin-right: 0.5rem;
}

/* =============================================================================
   PLAN SESSION - Clean To-Do Style Design
   ============================================================================= */

.plan-session {
    max-width: 500px;
}

.plan-container {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.plan-header-title {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.plan-add-step {
    padding: 0.375rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.plan-add-step:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

/* Steps List */
.plan-steps-list {
    padding: 0.5rem 0;
}

.plan-steps-list .no-steps {
    padding: 1rem;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
}

/* Plan step items - scoped to plan-steps-list to avoid conflicts */
.plan-steps-list .plan-step {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    transition: background 0.15s ease;
    background: transparent;
    border-radius: 0;
}

.plan-steps-list .plan-step::after {
    display: none;
}

.plan-steps-list .plan-step:hover {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.plan-steps-list .plan-step.dragging {
    opacity: 0.5;
}

.plan-steps-list .plan-step.drag-over {
    background: rgba(99, 102, 241, 0.1);
}

.plan-steps-list .step-drag {
    flex-shrink: 0;
    padding: 0.25rem 0;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    cursor: grab;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.plan-steps-list .plan-step:hover .step-drag {
    opacity: 1;
}

.plan-steps-list .step-radio {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 0.125rem;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    transition: border-color 0.15s ease;
}

.plan-steps-list .plan-step:hover .step-radio {
    border-color: var(--text-tertiary);
}

.plan-steps-list .step-text {
    flex: 1;
    min-width: 0;
}

.plan-steps-list .step-title-edit {
    width: 100%;
    padding: 0;
    background: transparent;
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
}

.plan-steps-list .step-title-edit:focus {
    outline: none;
}

.plan-steps-list .step-tools-label {
    display: block;
    font-size: 0.6875rem;
    color: var(--text-tertiary);
    margin-top: 0.125rem;
}

.plan-steps-list .step-remove {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    font-size: 1rem;
    color: var(--text-tertiary);
    cursor: pointer;
    opacity: 0;
    transition: all 0.15s ease;
    border-radius: 4px;
}

.plan-steps-list .plan-step:hover .step-remove {
    opacity: 1;
}

.plan-steps-list .step-remove:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Plan Discovery Phase */
.plan-discovery {
    padding: 1rem;
}

.discovery-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.discovery-logo {
    width: 24px;
    height: 24px;
    border-radius: 4px;
}

.discovery-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.discovery-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.discovery-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.discovery-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.discovery-tool {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.discovery-tool.complete {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

.discovery-tool-icon {
    font-size: 0.875rem;
}

.discovery-tool-name {
    color: var(--text-primary);
    font-weight: 500;
}

.discovery-tool-status {
    color: var(--text-tertiary);
    font-size: 0.6875rem;
}

.discovery-tool.complete .discovery-tool-status {
    color: #10b981;
    color: #ef4444;
}

/* Add Step Input */
.plan-add-input {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.step-add-field {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.8125rem;
    color: var(--text-primary);
}

.step-add-field:focus {
    outline: none;
    border-color: var(--accent-color);
}

.step-add-btn {
    padding: 0.5rem 0.75rem;
    background: var(--accent-color);
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
    cursor: pointer;
}

.step-add-btn:hover {
    background: var(--accent-hover);
}

.step-add-cancel {
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.step-add-cancel:hover {
    background: var(--bg-secondary);
}

/* Output Row */
.plan-output-row {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    padding: 0.75rem 0;
}

.output-section,
.ideas-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.output-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.output-options-row,
.ideas-options {
    display: flex;
    gap: 0.25rem;
}

.output-opt,
.ideas-opt {
    padding: 0.375rem 0.625rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.output-opt:hover,
.ideas-opt:hover {
    border-color: var(--accent-color);
    color: var(--text-primary);
}

.output-opt.active,
.ideas-opt.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

/* Plan Actions */
.plan-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.plan-cancel {
    background: transparent;
    border: none;
    padding: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-tertiary);
    cursor: pointer;
}

.plan-cancel:hover {
    color: var(--text-primary);
}

.plan-start {
    padding: 0.5rem 1.25rem;
    background: var(--accent-color);
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    cursor: pointer;
    transition: background 0.15s ease;
}

.plan-start:hover {
    background: var(--accent-hover);
}

.plan-start:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Step Library Modal */
.step-library-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.step-library-content {
    background: var(--card-bg);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 70vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.step-library-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.step-library-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.step-library-header .close-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
}

.step-library-header .close-btn:hover {
    background: var(--bg-tertiary);
}

.step-library-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.library-step {
    display: block;
    width: 100%;
    padding: 0.75rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-align: left;
    cursor: pointer;
    margin-bottom: 0.5rem;
    transition: all 0.15s ease;
}

.library-step:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-color);
}

.library-step-title {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.library-step-desc {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.library-step-tools {
    display: block;
    font-size: 0.6875rem;
    color: var(--accent-color);
}

/* Plan Execution Controls */
.plan-controls {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
    margin-right: 1rem;
}

.plan-control-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.6875rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.plan-control-btn:hover {
    border-color: var(--accent-color);
    color: var(--text-primary);
}

.plan-control-btn.skip-btn:hover {
    background: rgba(251, 191, 36, 0.1);
    border-color: #fbbf24;
    color: #fbbf24;
}

.plan-control-btn.pause-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

.plan-control-btn.pause-btn.paused {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    color: #10b981;
}

.plan-control-btn span:first-child {
    font-size: 0.75rem;
}

/* Toast notification info type */
.toast-notification.info {
    border-left: 3px solid #6366f1;
}

.toast-notification.info .toast-icon {
    color: #6366f1;
}

/* Try Planner Mode Button - inline suggestion in chat */
.try-planner-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--accent-color);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    vertical-align: middle;
}

.try-planner-btn:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    border-color: var(--accent-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.try-planner-btn:active {
    transform: translateY(0);
}

.try-planner-icon {
    font-size: 0.875rem;
}

/* ============================================
   Profile Settings Modal
   ============================================ */

.profile-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.profile-btn:hover {
    background: var(--hover-bg);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.profile-modal-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.6) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

.profile-modal-overlay.closing {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.profile-modal {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.98) 0%,
        rgba(249, 250, 251, 0.98) 100%);
    border-radius: 20px;
    width: 100%;
    max-width: 480px;
    box-shadow: 
        0 0 0 1px rgba(0, 0, 0, 0.05),
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 20px 40px -10px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.2s ease;
}

@media (prefers-color-scheme: dark) {
    .profile-modal {
        background: linear-gradient(180deg, 
            rgba(30, 32, 36, 0.98) 0%, 
            rgba(24, 26, 30, 0.98) 100%);
        box-shadow: 
            0 0 0 1px rgba(255, 255, 255, 0.08),
            0 4px 6px -1px rgba(0, 0, 0, 0.3),
            0 20px 40px -10px rgba(0, 0, 0, 0.5);
    }
}

.profile-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.5rem 0 1.5rem;
}

.profile-modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.profile-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

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

.profile-modal-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.profile-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-field label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.profile-hint {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.profile-email {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    padding: 0.625rem 0.875rem;
    background: var(--input-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.profile-field textarea {
    width: 100%;
    padding: 0.75rem;
    font-size: 0.9375rem;
    font-family: inherit;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--input-bg);
    color: var(--text-primary);
    resize: vertical;
    min-height: 100px;
    transition: all 0.2s ease;
}

.profile-field textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.profile-field textarea::placeholder {
    color: var(--text-tertiary);
}

.profile-char-count {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-align: right;
}

.profile-char-count.over-limit {
    color: #ef4444;
}

.profile-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.875rem;
    background: rgba(99, 102, 241, 0.08);
    border-radius: 10px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.profile-tip-icon {
    font-size: 0.9375rem;
}

.profile-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem 1.5rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

.profile-modal-footer .btn-secondary {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-modal-footer .btn-secondary:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.profile-modal-footer .btn-primary {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    background: var(--accent-color);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.profile-modal-footer .btn-primary:hover {
    background: var(--accent-hover);
}

.profile-modal-footer .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================
   Onboarding Modal (First-time users)
   ============================================ */

.onboarding-modal-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.7) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

.onboarding-modal-overlay.closing {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.onboarding-modal {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.98) 0%,
        rgba(249, 250, 251, 0.98) 100%);
    border-radius: 24px;
    width: 100%;
    max-width: 520px;
    box-shadow: 
        0 0 0 1px rgba(0, 0, 0, 0.05),
        0 8px 16px -4px rgba(0, 0, 0, 0.1),
        0 24px 48px -16px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

@media (prefers-color-scheme: dark) {
    .onboarding-modal {
        background: linear-gradient(180deg, 
            rgba(30, 32, 36, 0.98) 0%, 
            rgba(24, 26, 30, 0.98) 100%);
        box-shadow: 
            0 0 0 1px rgba(255, 255, 255, 0.08),
            0 8px 16px -4px rgba(0, 0, 0, 0.3),
            0 24px 48px -16px rgba(0, 0, 0, 0.5);
    }
}

.onboarding-header {
    text-align: center;
    padding: 2rem 2rem 1rem 2rem;
}

.onboarding-emoji {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.onboarding-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.onboarding-body {
    padding: 0 2rem 1.5rem 2rem;
}

.onboarding-body > p {
    text-align: center;
    color: var(--text-secondary);
    margin: 0 0 1.5rem 0;
    line-height: 1.5;
}

.onboarding-field {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.onboarding-field label {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
}

.onboarding-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.875rem;
    font-size: 0.9375rem;
    font-family: inherit;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--input-bg);
    color: var(--text-primary);
    resize: none;
    min-height: 100px;
    transition: all 0.2s ease;
}

.onboarding-field textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.onboarding-field textarea::placeholder {
    color: var(--text-tertiary);
}

.onboarding-examples {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.example-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.example-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.example-btn:hover {
    background: var(--hover-bg);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.onboarding-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    margin-top: 1rem;
    padding: 0.875rem;
    background: rgba(99, 102, 241, 0.08);
    border-radius: 10px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.tip-icon {
    font-size: 0.9375rem;
}

.onboarding-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 2rem 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
}

.onboarding-footer .btn-skip {
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.onboarding-footer .btn-skip:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.onboarding-footer .btn-primary {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    background: var(--airops-teal, #5a9a8a);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(90, 154, 138, 0.3);
}

.onboarding-footer .btn-primary:hover {
    background: var(--airops-forest, #3d6b5f);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(90, 154, 138, 0.4);
}

.onboarding-footer .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}


/* ============================================
   Read-Only Mode (Shared Conversations)
   ============================================ */
.read-only-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 8px;
    margin: 0.75rem;
    font-size: 0.875rem;
    color: #92400e;
}

.read-only-banner .read-only-icon {
    font-size: 1.25rem;
}

/* Disabled input styling for read-only */
.strategist-input-box input:disabled,
.strategist-input-box textarea:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

.strategist-input-box .send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================================
   MODAL DARK MODE OVERRIDE
   Force all modals to use light backgrounds regardless of browser color scheme.
   This ensures readability on dark mode browsers.
   ============================================ */

/* Override dark mode for onboarding modal */
@media (prefers-color-scheme: dark) {
    .onboarding-modal {
        background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.98) 0%,
            rgba(249, 250, 251, 0.98) 100%) !important;
        box-shadow: 
            0 0 0 1px rgba(0, 0, 0, 0.05),
            0 8px 16px -4px rgba(0, 0, 0, 0.1),
            0 24px 48px -16px rgba(0, 0, 0, 0.2) !important;
        color: #111827 !important;
    }
    
    .onboarding-modal .onboarding-header h2,
    .onboarding-modal .onboarding-body > p,
    .onboarding-modal .onboarding-field label,
    .onboarding-modal .onboarding-field textarea,
    .onboarding-modal .onboarding-tip {
        color: #374151 !important;
    }
    
    .onboarding-modal .onboarding-field textarea {
        background: #ffffff !important;
        border-color: #d1d5db !important;
        color: #111827 !important;
    }
    
    .onboarding-modal .onboarding-field textarea::placeholder {
        color: #9ca3af !important;
    }
    
    .onboarding-modal .onboarding-footer {
        border-color: #e5e7eb !important;
    }
    
    .onboarding-modal .btn-skip {
        color: #6b7280 !important;
    }
    
    .onboarding-modal .btn-skip:hover {
        background: rgba(0, 0, 0, 0.04) !important;
        color: #111827 !important;
    }
}

/* Override dark mode for feedback modal */
@media (prefers-color-scheme: dark) {
    .feedback-modal {
        background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.98) 0%,
            rgba(249, 250, 251, 0.98) 100%) !important;
        box-shadow: 
            0 0 0 1px rgba(0, 0, 0, 0.04),
            0 4px 6px -1px rgba(0, 0, 0, 0.05),
            0 20px 40px -8px rgba(0, 0, 0, 0.15),
            0 40px 80px -20px rgba(0, 0, 0, 0.2) !important;
        color: #111827 !important;
    }
    
    .feedback-modal-header h3 {
        color: #111827 !important;
    }
    
    .feedback-modal-close:hover {
        background: rgba(0, 0, 0, 0.05) !important;
    }
    
    .feedback-modal-body textarea {
        background: #ffffff !important;
        border-color: rgba(0, 0, 0, 0.08) !important;
        color: #111827 !important;
    }
    
    .feedback-modal-body textarea:hover {
        border-color: rgba(0, 0, 0, 0.15) !important;
    }
    
    .feedback-modal-body textarea:focus {
        background: white !important;
        box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.12) !important;
    }
    
    .feedback-hint {
        background: rgba(0, 0, 0, 0.02) !important;
        color: #6b7280 !important;
    }
    
    .feedback-modal-footer .btn-secondary {
        border-color: rgba(0, 0, 0, 0.12) !important;
        color: #4b5563 !important;
    }
    
    .feedback-modal-footer .btn-secondary:hover {
        background: rgba(0, 0, 0, 0.04) !important;
        border-color: rgba(0, 0, 0, 0.2) !important;
    }
    
    .feedback-modal-icon.positive {
        background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%) !important;
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15) !important;
    }
    
    .feedback-modal-icon.negative {
        background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%) !important;
        box-shadow: 0 4px 12px rgba(244, 63, 94, 0.15) !important;
    }
}

/* Override dark mode for profile modal */
@media (prefers-color-scheme: dark) {
    .profile-modal {
        background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.98) 0%,
            rgba(249, 250, 251, 0.98) 100%) !important;
        box-shadow: 
            0 0 0 1px rgba(0, 0, 0, 0.05),
            0 8px 16px -4px rgba(0, 0, 0, 0.1),
            0 24px 48px -16px rgba(0, 0, 0, 0.2) !important;
        color: #111827 !important;
    }
    
    .profile-modal h3,
    .profile-modal label,
    .profile-modal p {
        color: #374151 !important;
    }
    
    .profile-modal input,
    .profile-modal textarea {
        background: #ffffff !important;
        border-color: #d1d5db !important;
        color: #111827 !important;
    }
}

/* Override dark mode for tool details modal */
@media (prefers-color-scheme: dark) {
    .tool-details-panel {
        background: #ffffff !important;
        color: #111827 !important;
    }
    
    .tool-details-panel-header {
        background: #f9fafb !important;
        border-color: #e5e7eb !important;
        color: #111827 !important;
    }
}
