/* ==========================================
   PLAINSPEAK STYLES - Fresh Build
   ========================================== */

/* ==========================================
   VARIABLES & RESET
   ========================================== */

:root {
    --bg-dark: #0d0d12;
    --bg-card: #1a1a22;
    --bg-lighter: #2a2a35;
    --bg-input: #15151c;
    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-green: #22c55e;
    --accent-teal: #14b8a6;
    --accent-red: #ef4444;
    --accent-orange: #f97316;
    --accent-yellow: #eab308;
    --accent-purple: #a78bfa;
    --accent-pink: #ec4899;
    --rainbow: linear-gradient(90deg, #ec4899, #a78bfa, #3b82f6, #06b6d4, #22c55e, #eab308, #f97316, #ef4444);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.4);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-pill: 20px;
}

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

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.5;
    overflow: hidden;
}

/* ==========================================
   HEADER
   ========================================== */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    border-bottom: 1px solid var(--bg-lighter);
    background: var(--bg-dark);
    height: 60px;
    position: relative;
    z-index: 100;
}

.header-left, .header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 150px;
}

.header-right {
    justify-content: flex-end;
}

.header-center {
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.logo-plain {
    color: white;
}

.logo-speak {
    background: var(--rainbow);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* App Navigation Tabs */
.app-nav {
    display: flex;
    gap: 6px;
}

.nav-tab {
    padding: 8px 20px;
    background: transparent;
    border: 1px solid var(--bg-lighter);
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-tab:hover {
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.nav-tab.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.nav-counter {
    font-size: 11px;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-pill);
    margin-left: 4px;
}

.nav-tab:not(.active) .nav-counter {
    background: var(--bg-lighter);
    color: var(--text-muted);
}

.header-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--bg-lighter);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-btn:hover {
    background: var(--bg-lighter);
    color: var(--text-primary);
}

.btn-icon {
    font-size: 16px;
}

.badge {
    background: var(--accent-blue);
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.badge.hidden {
    display: none;
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-card);
    border: 1px solid var(--bg-lighter);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    min-width: 180px;
    z-index: 1000;
    overflow: hidden;
}

.dropdown-menu.hidden {
    display: none;
}

.dropdown-menu a {
    display: block;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.15s ease;
}

.dropdown-menu a:hover {
    background: var(--bg-lighter);
    color: var(--text-primary);
}

.menu-divider {
    height: 1px;
    background: var(--bg-lighter);
    margin: 4px 0;
}

.menu-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.menu-toggle:hover {
    background: var(--bg-lighter);
    color: var(--text-primary);
}

.menu-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-blue);
    cursor: pointer;
}

.header-actions {
    position: relative;
}

/* ==========================================
   SCREENS
   ========================================== */

.screen {
    height: calc(100vh - 60px);
    overflow: hidden;
}

.screen.hidden {
    display: none !important;
}

/* General hidden class */
.hidden {
    display: none !important;
}

/* ==========================================
   ENTRY SCREEN - Premium, Calm, Obvious
   ========================================== */

.entry-screen {
    height: 100vh !important;
}

.entry-layout {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
}

.entry-menu-wrapper {
    position: relative;
}

.entry-menu-wrapper .dropdown-menu {
    top: 100%;
    right: 0;
    margin-top: 8px;
}

.logo-large {
    font-size: 1.75rem;
}

.entry-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 20px 60px;
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
}

.steve-greeting {
    text-align: center;
    margin-bottom: 40px;
}

.steve-avatar-large {
    width: 90px;
    height: 90px;
    background: var(--bg-card);
    border: 2px solid var(--accent-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.12);
}

.steve-eyes {
    font-family: monospace;
    font-size: 22px;
    color: var(--accent-blue);
    letter-spacing: 2px;
}

.steve-message {
    font-size: 20px;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 8px;
}

.steve-submessage {
    font-size: 15px;
    color: var(--text-muted);
}

/* Entry Input */
.entry-input-container {
    width: 100%;
    margin-bottom: 24px;
}

.entry-input {
    width: 100%;
    padding: 20px 24px;
    background: var(--bg-card);
    border: 1px solid var(--bg-lighter);
    border-radius: 16px;
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    resize: none;
    min-height: 140px;
    line-height: 1.6;
    transition: all 0.2s ease;
}

.entry-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

/* Primary Action Buttons */
.entry-actions {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.entry-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 18px 36px;
    background: var(--bg-card);
    border: 2px solid var(--bg-lighter);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
    position: relative;
}

.entry-btn:hover {
    transform: translateY(-1px);
}

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

/* Subtle focus state */
.entry-btn:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* Analyze - Blue (thinking, clarity) */
.entry-btn[data-action="analyze"] {
    border-color: rgba(59, 130, 246, 0.3);
}
.entry-btn[data-action="analyze"]:hover {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
}
.entry-btn[data-action="analyze"] .btn-label {
    color: var(--accent-blue);
}

/* Research - Green (growth, verification) */
.entry-btn[data-action="research"] {
    border-color: rgba(34, 197, 94, 0.3);
}
.entry-btn[data-action="research"]:hover {
    border-color: var(--accent-green);
    background: rgba(34, 197, 94, 0.1);
}
.entry-btn[data-action="research"] .btn-label {
    color: var(--accent-green);
}

/* Reply - Orange (action, expression) */
.entry-btn[data-action="reply"] {
    border-color: rgba(249, 115, 22, 0.3);
}
.entry-btn[data-action="reply"]:hover {
    border-color: var(--accent-orange);
    background: rgba(249, 115, 22, 0.1);
}
.entry-btn[data-action="reply"] .btn-label {
    color: var(--accent-orange);
}

/* Button pulse animation for keyboard shortcuts */
.entry-btn.pulse {
    animation: btn-pulse 0.2s ease-out;
}

@keyframes btn-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.entry-btn .btn-label {
    font-size: 16px;
    font-weight: 600;
    transition: color 0.2s ease;
}

.entry-btn .btn-hint {
    font-size: 11px;
    color: var(--text-muted);
    font-family: monospace;
}

/* Secondary Write Link */
.entry-write-link {
    text-align: center;
}

.entry-write-link a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.entry-write-link a:hover {
    color: var(--text-secondary);
}

.entry-write-link .arrow {
    display: inline-block;
    transition: transform 0.2s;
}

.entry-write-link a:hover .arrow {
    transform: translateX(4px);
}

.mode-card.active {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

.mode-card-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.mode-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.mode-card-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.3;
}

/* ==========================================
   WORKSPACE / CANVAS
   ========================================== */

#workspace-screen {
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Workspace Toolbar */
.workspace-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--bg-lighter);
    flex-shrink: 0;
    gap: 16px;
}

.toolbar-left, .toolbar-center, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

#card-search {
    padding: 8px 12px;
    background: var(--bg-main);
    border: 1px solid var(--bg-lighter);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    width: 180px;
}

#card-search:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.search-count {
    position: absolute;
    right: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.search-count.hidden {
    display: none;
}

#quick-research {
    padding: 8px 12px;
    background: var(--bg-main);
    border: 1px solid var(--bg-lighter);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    width: 220px;
}

#quick-research:focus {
    outline: none;
    border-color: var(--accent-blue);
}

#quick-research-btn {
    padding: 8px 16px;
    background: var(--accent-blue);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

#quick-research-btn:hover {
    background: #2563eb;
}

/* Quick input in toolbar */
#quick-input {
    padding: 8px 12px;
    background: var(--bg-main);
    border: 1px solid var(--bg-lighter);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    width: 200px;
}

#quick-input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

#quick-input-btn {
    padding: 8px 16px;
    background: var(--bg-lighter);
    border: 1px solid var(--bg-lighter);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

#quick-input-btn:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

/* Toolbar buttons */
.toolbar-btn {
    padding: 8px 16px;
    background: var(--bg-main);
    border: 1px solid var(--bg-lighter);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toolbar-btn:hover {
    background: var(--bg-lighter);
    color: var(--text-primary);
    border-color: var(--accent-blue);
}

.toolbar-btn.primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border: none;
    color: white;
}

.toolbar-btn.primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-main);
    border: 1px solid var(--bg-lighter);
    border-radius: var(--radius-sm);
    padding: 2px;
}

.zoom-controls button {
    padding: 6px 10px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.zoom-controls button:hover {
    background: var(--bg-lighter);
    color: var(--text-primary);
}

#zoom-level {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 40px;
    text-align: center;
}

#canvas {
    width: 100%;
    flex: 1;
    position: relative;
    overflow: auto;
    background: var(--bg-dark);
}

.canvas-inner {
    position: relative;
    min-width: 3000px;
    min-height: 2000px;
    transform-origin: 0 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.03) 0%, transparent 50%);
}

/* Card search highlight */
.card.search-match {
    box-shadow: 0 0 0 3px var(--accent-blue), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.card.search-dim {
    opacity: 0.3;
}

#connection-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 6000px;
    height: 4000px;
    pointer-events: none;
    z-index: 0;
    overflow: visible;
}

#connection-lines path {
    transition: opacity 0.2s ease;
}

#connection-lines path:hover {
    opacity: 1 !important;
    stroke-width: 3;
}

/* ==========================================
   CARDS
   ========================================== */

.card {
    position: absolute;
    width: 300px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: visible;
    cursor: grab;
    z-index: 1;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card.dragging {
    cursor: grabbing;
    z-index: 1000;
    opacity: 0.95;
    transform: scale(1.02);
}

.card.expanded {
    /* Don't elevate z-index - let expanded cards stay in their natural layer */
    /* This prevents expanded cards from covering cards below them */
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.card.loading {
    opacity: 0.7;
    pointer-events: none;
}

.card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.card-pill {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 18px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: white;
    z-index: 10;
    white-space: nowrap;
    background: #1a1a2e !important;  /* Dark background */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    /* Colored outline based on card type - set via inline style */
}

.card-header {
    padding: 20px 16px 12px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: white;
    line-height: 1.4;
    /* Allow titles to wrap to 2-3 lines instead of truncating */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word;
}

.card-content {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-height: 100px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.card.expanded .card-content {
    max-height: 400px;
    overflow-y: auto;
}

.card-content p {
    margin-bottom: 8px;
}

.card-content ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.card-content li {
    margin-bottom: 6px;
    padding-left: 16px;
    position: relative;
}

.card-content li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--text-muted);
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-top: 1px solid var(--bg-lighter);
}

.card-source {
    font-size: 11px;
    color: var(--text-muted);
    text-decoration: none;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-source:hover {
    color: var(--accent-blue);
}

.card-actions {
    display: flex;
    gap: 2px;
}

.card-actions button {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, opacity 0.2s ease;
    color: var(--text-secondary);
    opacity: 0.7;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.card-actions button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    opacity: 1;
}

.card-actions button.active {
    background: var(--accent-blue);
    color: white;
    opacity: 1;
}

/* Card type colors */
.card-type-SOURCE .card-pill,
.card-type-SOURCE .card-header {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
}

.card-type-SUMMARY .card-pill,
.card-type-SUMMARY .card-header {
    background: linear-gradient(135deg, #6b7280, #9ca3af);
}

.card-type-VERIFIED .card-pill,
.card-type-VERIFIED .card-header {
    background: linear-gradient(135deg, var(--accent-green), var(--accent-teal));
}

.card-type-MISLEADING .card-pill,
.card-type-MISLEADING .card-header {
    background: linear-gradient(135deg, var(--accent-red), var(--accent-orange));
}

.card-type-SPIN .card-pill,
.card-type-SPIN .card-header {
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-yellow));
}

.card-type-OMITTED .card-pill,
.card-type-OMITTED .card-header {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

.card-type-ANALYSIS .card-pill,
.card-type-ANALYSIS .card-header {
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
}

.card-type-INSIGHT .card-pill,
.card-type-INSIGHT .card-header {
    background: linear-gradient(135deg, #a78bfa, #6366f1);
}

/* SECONDARY sources (Wikipedia, etc.) - amber/yellow to indicate caution */
.card-type-SECONDARY .card-pill,
.card-type-SECONDARY .card-header {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

.card-type-SECONDARY .card-pill::after {
    content: ' ⚠';
    font-size: 10px;
}

/* Gradient offset variations - subtle angle shifts only */
.card.gradient-offset-1 .card-header {
    filter: hue-rotate(5deg);
}

.card.gradient-offset-2 .card-header {
    filter: hue-rotate(-5deg);
}

/* ==========================================
   FOLDERS
   ========================================== */

.card-folder {
    background: rgba(26, 26, 34, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    min-width: 320px;
    max-width: 340px;
    box-shadow: var(--shadow);
    cursor: grab;
    z-index: 5;
}

.card-folder:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: var(--shadow-lg);
}

.card-folder.dragging {
    cursor: grabbing;
    opacity: 0.9;
    z-index: 1000;
}

.folder-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: grab;
}

.folder-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    padding: 4px;
    transition: color 0.15s ease;
}

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

.folder-name {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-count {
    font-size: 12px;
    color: var(--text-muted);
}

.folder-expand {
    background: var(--bg-lighter);
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.folder-expand:hover {
    background: var(--accent-blue);
    color: white;
}

.folder-content {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 400px;
    overflow-y: auto;
}

.folder-content.collapsed {
    display: none;
}

.folder-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-lighter);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.folder-card:hover {
    background: var(--bg-dark);
    transform: translateX(4px);
}

.folder-card-type {
    font-size: 8px;
    padding: 2px 6px;
    border-radius: 8px;
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
}

.folder-card-title {
    font-size: 12px;
    color: var(--text-secondary);
    /* Allow wrapping for full titles */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word;
}

/* ==========================================
   STACKS
   ========================================== */

.card-stack {
    position: absolute;
    z-index: 1;
}

.card-stack .card {
    position: relative;
    margin-bottom: -160px;
    cursor: grab;
}

.card-stack .card:last-of-type {
    margin-bottom: 0;
}

/* Hide pills on stacked cards except the top one to prevent overlap */
.card-stack .card:not(:last-of-type) .card-pill {
    opacity: 0;
    pointer-events: none;
}

.stack-counter {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    padding: 12px 16px;
    margin-top: 8px;
    cursor: grab;
    background: var(--bg-lighter);
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.stack-counter:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.stack-counter::before {
    content: '⋮⋮ ';
    opacity: 0.5;
}

.card-stack.dragging {
    opacity: 0.8;
    cursor: grabbing;
}

.card-stack.dragging .stack-counter {
    cursor: grabbing;
    background: var(--accent-blue);
    color: white;
}

/* ==========================================
   STEVE (Legacy - kept for backwards compat)
   New Steve Agent styles are in the STEVE AGENT section
   ========================================== */

/* Legacy #steve - replaced by .steve-agent system */
#steve { display: none; }

/* Reply mode uses the position-reply class, no override needed */

/* ==========================================
   OUTLINE SCREEN
   ========================================== */

.outline-container {
    height: 100%;
    padding: 24px;
    overflow-y: auto;
}

/* Back button */
.back-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--bg-lighter);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 16px;
}

.back-btn:hover {
    background: var(--bg-lighter);
    color: var(--text-primary);
    border-color: var(--accent-blue);
}

.outline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.outline-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.outline-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.outline-controls select {
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--bg-lighter);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
}

.outline-btn {
    padding: 10px 20px;
    background: var(--bg-card);
    border: 1px solid var(--bg-lighter);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.outline-btn.primary {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.outline-btn.primary:hover {
    background: #2563eb;
}

.outline-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.outline-card {
    background: var(--bg-card);
    border: 1px solid var(--bg-lighter);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}

.outline-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.outline-card.expanded {
    background: var(--bg-lighter);
}

.outline-card.expanded .outline-card-content {
    max-height: 500px;
}

.outline-card.expanded .outline-card-preview {
    display: none;
}

.outline-card.expanded .outline-card-full {
    display: block;
}

.outline-card.dragging {
    opacity: 0.5;
    transform: scale(0.98);
}

.outline-card.drag-over {
    border-top: 3px solid var(--accent-blue);
    padding-top: 0;
}

.outline-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.outline-card-drag-handle {
    color: var(--text-muted);
    font-size: 14px;
    cursor: grab;
    user-select: none;
    padding: 0 4px;
}

.outline-card-drag-handle:active {
    cursor: grabbing;
}

.outline-card-title {
    font-weight: 600;
    font-size: 15px;
    flex: 1;
    /* Allow wrapping for full titles */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word;
}

.outline-card-type {
    font-size: 10px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.outline-card-content {
    font-size: 13px;
    color: var(--text-secondary);
    max-height: 60px;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 16px;
}

.outline-card-preview {
    line-height: 1.5;
}

.outline-card-full {
    display: none;
    line-height: 1.6;
    padding-bottom: 8px;
}

.outline-card-full p {
    margin-bottom: 8px;
}

.outline-card-full ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.outline-card-full li {
    margin-bottom: 6px;
    padding-left: 16px;
    position: relative;
}

.outline-card-full li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--text-muted);
}

.outline-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-top: 1px solid var(--bg-lighter);
    margin-top: 8px;
}

.outline-card-expand-hint {
    font-size: 11px;
    color: var(--text-muted);
}

.outline-card-source {
    font-size: 11px;
    color: var(--accent-blue);
    text-decoration: none;
}

.outline-card-source:hover {
    text-decoration: underline;
}

.outline-card-hierarchy {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: 12px;
    background: var(--bg-lighter);
    border-radius: var(--radius-sm);
    padding: 2px 4px;
}

.hierarchy-level {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.outline-indent-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 10px;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.outline-indent-btn:hover:not(:disabled) {
    background: var(--accent-blue);
    color: white;
}

.outline-indent-btn:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

.outline-card-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 0 4px;
    margin-left: auto;
}

.outline-card-remove:hover {
    color: var(--accent-red);
}

/* Hierarchy level indicators */
.outline-card.outline-level-1 {
    border-left-width: 3px;
}

.outline-card.outline-level-2 {
    border-left-width: 2px;
}

.outline-card.outline-level-3 {
    border-left-width: 2px;
    opacity: 0.9;
}

.outline-card.outline-level-1::before,
.outline-card.outline-level-2::before,
.outline-card.outline-level-3::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 50%;
    width: 16px;
    height: 2px;
    background: var(--bg-lighter);
}

.outline-card.outline-level-2::before {
    left: -48px;
    width: 40px;
}

.outline-card.outline-level-3::before {
    left: -72px;
    width: 64px;
}

/* ==========================================
   OUTLINE SECTIONS
   ========================================== */

.outline-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--bg-lighter);
}

.outline-section-add {
    margin-bottom: 16px;
}

.outline-section {
    background: var(--bg-card);
    border: 1px solid var(--bg-lighter);
    border-radius: var(--radius);
    margin-bottom: 16px;
    overflow: hidden;
}

.outline-section.dragging {
    opacity: 0.5;
}

.outline-section.drag-over {
    border-color: var(--accent-blue);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.outline-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-lighter);
    border-bottom: 1px solid var(--bg-dark);
}

.outline-section-drag {
    cursor: grab;
    color: var(--text-muted);
    font-size: 14px;
    user-select: none;
}

.outline-section-drag:active {
    cursor: grabbing;
}

.outline-section-title-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.outline-section-title-input:focus {
    outline: none;
    background: var(--bg-dark);
}

.outline-section-title {
    flex: 1;
    font-weight: 600;
    color: var(--text-primary);
}

.outline-section-count {
    font-size: 12px;
    color: var(--text-muted);
    padding: 2px 8px;
    background: var(--bg-dark);
    border-radius: 10px;
}

.outline-section-delete {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.outline-section-delete:hover {
    background: var(--error-color);
    color: white;
}

.outline-section-content {
    min-height: 60px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.outline-section-content.drop-target {
    background: rgba(59, 130, 246, 0.1);
    outline: 2px dashed var(--accent-blue);
}

.outline-section-content:empty::before {
    content: 'Drag cards here';
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 20px;
}

.outline-section-unassigned {
    border-style: dashed;
    opacity: 0.8;
}

.outline-section-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-darker);
    border-radius: var(--radius-sm);
    cursor: grab;
    transition: all 0.15s ease;
}

.outline-section-card:hover {
    background: var(--bg-lighter);
}

.outline-section-card.dragging {
    opacity: 0.5;
}

.outline-section-card-type {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    color: white;
    text-transform: uppercase;
}

.outline-section-card-title {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    /* Allow wrapping for full titles */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word;
}

.outline-section-card-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.15s ease;
    padding: 4px;
}

.outline-section-card:hover .outline-section-card-remove {
    opacity: 1;
}

.outline-section-card-remove:hover {
    color: var(--error-color);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 60px 20px;
    font-size: 15px;
}

/* Mode toggle buttons */
.outline-mode-toggle {
    display: flex;
    gap: 0;
    background: var(--bg-lighter);
    border-radius: var(--radius-sm);
    padding: 4px;
}

.mode-btn {
    padding: 8px 20px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.mode-btn.active {
    background: var(--accent-blue);
    color: white;
}

/* Outline action buttons */
.outline-actions {
    display: flex;
    gap: 12px;
}

.outline-action-btn {
    padding: 10px 20px;
    background: var(--bg-card);
    border: 1px solid var(--bg-lighter);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.outline-action-btn:hover {
    background: var(--bg-lighter);
}

.outline-action-btn.primary {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.outline-action-btn.primary:hover {
    background: #2563eb;
}

/* Outline view */
.outline-view {
    flex: 1;
    overflow-y: auto;
}

.outline-main {
    display: flex;
    gap: 24px;
}

.outline-suggestions {
    width: 200px;
    flex-shrink: 0;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
}

.outline-suggestions h4 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.suggestion-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.suggestion-btn {
    padding: 8px 12px;
    background: var(--bg-lighter);
    border: 1px solid var(--bg-lighter);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
}

.suggestion-btn:hover {
    background: var(--bg-main);
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.outline-ai-btn {
    width: 100%;
    padding: 10px 12px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.outline-ai-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.outline-cards {
    flex: 1;
}

/* Planner view */
.planner-view {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.planner-view.hidden {
    display: none;
}

.planner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    margin-bottom: 8px;
}

.planner-hint {
    font-size: 13px;
    color: var(--text-muted);
}

.planner-columns {
    display: flex;
    gap: 16px;
    height: 100%;
    padding: 8px 0;
    overflow-x: auto;
}

.planner-column {
    background: var(--bg-card);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 220px;
    flex: 1;
}

.planner-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--bg-lighter);
}

.planner-column h3 {
    padding: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    outline: none;
    cursor: text;
    margin: 0;
}

.planner-column h3:focus {
    color: var(--text-primary);
    background: var(--bg-lighter);
    padding: 4px 8px;
    border-radius: 4px;
    margin: -4px -8px;
}

.planner-column-delete {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 0 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.planner-column:hover .planner-column-delete {
    opacity: 0.5;
}

.planner-column-delete:hover {
    opacity: 1;
    color: #ef4444;
}

.planner-header-actions {
    display: flex;
    gap: 8px;
}

.planner-dropzone {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.planner-dropzone.drag-over {
    background: rgba(59, 130, 246, 0.1);
    border: 2px dashed var(--accent-blue);
}

.planner-card {
    background: var(--bg-main);
    border-radius: var(--radius-sm);
    padding: 12px;
    cursor: grab;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.planner-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.planner-card.dragging {
    opacity: 0.5;
}

.planner-card-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    /* Allow wrapping for full titles */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word;
}

.planner-card-type {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    display: inline-block;
}

/* ==========================================
   PLANNER SCREEN (Dedicated)
   ========================================== */

.planner-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 24px;
    gap: 20px;
}

.planner-screen-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.planner-title-area h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.planner-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

.planner-controls {
    display: flex;
    gap: 8px;
}

.planner-action-btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-lighter);
    border: 1px solid var(--bg-lighter);
    color: var(--text-secondary);
}

.planner-action-btn:hover {
    background: var(--bg-card);
    border-color: var(--text-muted);
}

.planner-action-btn.primary {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.planner-action-btn.primary:hover {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
}

/* Planner Input Area */
.planner-input-area {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.planner-input-area.hidden {
    display: none;
}

.planner-input-wrapper {
    display: flex;
    gap: 12px;
}

.planner-goal-input {
    flex: 1;
    padding: 14px 18px;
    border-radius: var(--radius);
    border: 2px solid var(--bg-lighter);
    background: var(--bg-main);
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s ease;
}

.planner-goal-input:focus {
    border-color: var(--accent-blue);
}

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

.planner-start-btn {
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border: none;
    border-radius: var(--radius);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.planner-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

.planner-quick-templates {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.template-label {
    font-size: 13px;
    color: var(--text-muted);
}

.template-btn {
    padding: 6px 14px;
    background: var(--bg-lighter);
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.template-btn:hover {
    background: var(--bg-main);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.template-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

/* Planning Progress */
.planner-progress {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: center;
}

.planner-progress.hidden {
    display: none;
}

.progress-steve {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(59, 130, 246, 0.3); }
    50% { box-shadow: 0 0 30px rgba(139, 92, 246, 0.5); }
}

.progress-face {
    color: white;
    font-weight: bold;
    font-size: 16px;
}

.progress-content {
    flex: 1;
}

.progress-status {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.progress-bar {
    height: 6px;
    background: var(--bg-lighter);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    width: 0%;
    transition: width 0.5s ease;
}

.progress-detail {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
}

/* Planner Columns - enhanced for standalone screen */
#planner-screen .planner-columns {
    flex: 1;
    overflow-x: auto;
    padding-bottom: 16px;
}

#planner-screen .planner-column {
    min-width: 280px;
    max-width: 350px;
}

/* Planner Column Content - rich content support */
.planner-item {
    background: var(--bg-main);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-bottom: 10px;
    border-left: 3px solid var(--accent-blue);
}

.planner-item-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.planner-item-content {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.planner-item-content ul {
    margin: 8px 0 0 0;
    padding-left: 20px;
}

.planner-item-content li {
    margin-bottom: 4px;
}

.planner-item-meta {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.planner-item-tag {
    font-size: 11px;
    padding: 2px 8px;
    background: var(--bg-lighter);
    border-radius: var(--radius-pill);
    color: var(--text-muted);
}

/* Planner Footer */
.planner-footer {
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-top: auto;
}

.planner-footer.hidden {
    display: none;
}

.planner-disclaimer {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

/* Empty state for planner */
.planner-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.planner-empty-state p {
    margin: 8px 0;
}

.planner-empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Planner Clarification Panel */
.clarify-panel {
    max-width: 700px;
    margin: 0 auto;
    padding: 24px;
}

.clarify-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.clarify-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.clarify-questions {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 32px;
}

.clarify-question {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
}

.clarify-question label {
    display: block;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.clarify-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.clarify-option {
    padding: 10px 18px;
    background: var(--bg-lighter);
    border: 2px solid transparent;
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clarify-option:hover {
    background: var(--bg-input);
    color: var(--text-primary);
    border-color: var(--accent-blue);
}

.clarify-option.selected {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.clarify-option.default {
    background: transparent;
    border: 1px dashed var(--text-muted);
    color: var(--text-muted);
    font-size: 12px;
}

.clarify-option.default:hover {
    border-color: var(--text-secondary);
    color: var(--text-secondary);
}

.clarify-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--bg-lighter);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
}

.clarify-input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.clarify-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding-top: 16px;
}

.clarify-actions .planner-start-btn {
    padding: 16px 40px;
    font-size: 16px;
    min-width: 200px;
}

.clarify-actions .planner-action-btn {
    padding: 16px 24px;
}

/* ==========================================
   I'M LOST - PANIC BUTTON SYSTEM
   ========================================== */

.im-lost-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--border);
    cursor: pointer;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.im-lost-btn:hover {
    border-color: var(--accent-blue);
    transform: scale(1.05);
}

.im-lost-btn:hover::after {
    content: "I'm lost";
    position: absolute;
    left: 56px;
    background: var(--bg-card);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.lost-icon {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-muted);
}

.im-lost-btn:hover .lost-icon {
    color: var(--accent-blue);
}

/* I'm Lost Panel */
.im-lost-panel {
    position: fixed;
    bottom: 80px;
    left: 24px;
    width: 360px;
    max-width: calc(100vw - 48px);
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 901;
    padding: 20px;
    animation: lost-slide-up 0.2s ease;
}

.im-lost-panel.hidden {
    display: none;
}

@keyframes lost-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lost-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.lost-steve {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.lost-message {
    flex: 1;
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-primary);
    margin: 0;
}

.lost-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.lost-close:hover {
    color: var(--text-primary);
}

.lost-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.lost-pill {
    padding: 8px 14px;
    background: var(--bg-lighter);
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.lost-pill:hover {
    background: var(--bg-main);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.lost-input-area {
    margin-top: 12px;
}

.lost-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
}

.lost-input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

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

/* ==========================================
   ONBOARDING MODAL
   ========================================== */

.onboarding-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.onboarding-modal.hidden {
    display: none;
}

.onboarding-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 40px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
    animation: onboard-fade-in 0.4s ease;
}

@keyframes onboard-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.onboarding-steve {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 24px;
    margin: 0 auto 24px;
}

.onboarding-content h2 {
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: var(--text-primary);
}

.onboarding-intro {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0 0 24px 0;
    line-height: 1.5;
}

.onboarding-sections {
    text-align: left;
    background: var(--bg-lighter);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin-bottom: 20px;
}

.onboarding-sections p {
    margin: 0 0 12px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.onboarding-sections ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.onboarding-sections li {
    padding: 6px 0;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
}

.onboarding-sections li:last-child {
    border-bottom: none;
}

.onboarding-sections strong {
    color: var(--accent-blue);
}

.onboarding-reassure {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 20px 0;
}

.onboarding-help {
    text-align: left;
    margin-bottom: 20px;
}

.onboarding-help p {
    margin: 0 0 8px 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.onboarding-help ul {
    margin: 0;
    padding-left: 20px;
}

.onboarding-help li {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.inline-steve {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: bold;
    vertical-align: middle;
}

.inline-icon {
    display: inline-block;
    background: var(--bg-lighter);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    vertical-align: middle;
}

.onboarding-final {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
    margin: 0 0 24px 0;
}

.onboarding-btn {
    padding: 14px 48px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border: none;
    border-radius: var(--radius-pill);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.onboarding-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
}

/* Feedback Button */
.feedback-btn {
    margin-right: 8px;
}

.feedback-btn:hover {
    background: var(--accent-blue);
}

/* Steve's follow-up response in lost panel */
.lost-response {
    background: var(--bg-lighter);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-top: 12px;
}

.lost-response p {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.5;
}

.lost-actions {
    display: flex;
    gap: 8px;
}

.lost-action-btn {
    flex: 1;
    padding: 10px;
    border-radius: var(--radius);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.lost-action-btn.primary {
    background: var(--accent-blue);
    border: none;
    color: white;
}

.lost-action-btn.primary:hover {
    background: var(--accent-purple);
}

.lost-action-btn.secondary {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.lost-action-btn.secondary:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

/* ==========================================
   WRITE SCREEN
   ========================================== */

.write-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 24px;
}

.write-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.write-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.write-mode-toggle {
    display: flex;
    gap: 0;
    background: var(--bg-lighter);
    border-radius: var(--radius-sm);
    padding: 4px;
}

.write-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.write-actions select {
    padding: 8px 14px;
    background: var(--bg-main);
    border: 1px solid var(--bg-lighter);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    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 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

.write-actions select:hover {
    background-color: var(--bg-card);
    border-color: var(--accent-blue);
}

.write-actions select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.write-actions select option {
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 8px;
}

/* Export dropdown */
.export-dropdown {
    position: relative;
}

.export-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--bg-card);
    border: 1px solid var(--bg-lighter);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    min-width: 180px;
    overflow: hidden;
}

.export-menu.hidden {
    display: none;
}

.export-menu button {
    display: block;
    width: 100%;
    padding: 10px 14px;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.export-menu button:hover {
    background: var(--bg-lighter);
}

.export-menu button:not(:last-child) {
    border-bottom: 1px solid var(--bg-lighter);
}

.write-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.write-view.hidden {
    display: none;
}

/* Sections mode */
#write-sections-view {
    flex-direction: row;
    gap: 24px;
}

.sections-sidebar {
    width: 280px;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px;
    overflow-y: auto;
    flex-shrink: 0;
}

.sections-sidebar h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.sections-sidebar .helper-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.sections-main {
    flex: 1;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    overflow-y: auto;
}

.write-sections {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 200px;
}

.write-sections.drag-over {
    background: rgba(59, 130, 246, 0.1);
    border: 2px dashed var(--accent-blue);
    border-radius: var(--radius);
}

.write-section {
    background: var(--bg-main);
    border-radius: var(--radius);
    border: 1px solid var(--bg-lighter);
    overflow: hidden;
    transition: all 0.2s ease;
}

.write-section.dragging {
    opacity: 0.5;
    transform: scale(0.98);
}

.write-section.drag-over {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.write-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-lighter);
    cursor: grab;
}

.write-section-drag {
    color: var(--text-muted);
    cursor: grab;
    user-select: none;
}

.write-section-title {
    flex: 1;
}

.write-section-title {
    font-weight: 600;
    font-size: 14px;
}

.write-section-actions {
    display: flex;
    gap: 8px;
}

.write-section-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.write-section-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.write-section-btn.ai-btn {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.write-section-btn.ai-btn:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(139, 92, 246, 0.4));
    color: #c4b5fd;
    border-color: rgba(139, 92, 246, 0.5);
}

/* Section Reference - shows card content as reference */
.write-section-reference {
    padding: 12px 16px;
    background: rgba(59, 130, 246, 0.05);
    border-bottom: 1px solid var(--bg-lighter);
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.write-section-reference.collapsed {
    max-height: 0;
    padding: 0 16px;
    overflow: hidden;
    border-bottom: none;
}

.reference-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.reference-content {
    color: var(--text-secondary);
    font-style: italic;
}

.reference-expand {
    margin-top: 8px;
    padding: 4px 10px;
    background: transparent;
    border: 1px solid var(--bg-lighter);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
}

.reference-expand:hover {
    background: var(--bg-lighter);
    color: var(--text-primary);
}

/* Section Content - where user writes */
.write-section-content {
    padding: 16px;
    min-height: 120px;
    background: var(--bg-card);
}

.write-section-content[contenteditable] {
    outline: none;
}

.write-section-content[contenteditable]:empty::before {
    content: attr(placeholder);
    color: var(--text-muted);
    font-style: italic;
}

.write-section-content[contenteditable]:focus {
    background: rgba(59, 130, 246, 0.05);
}

.write-sidebar {
    width: 280px;
    background: var(--bg-card);
    border-right: 1px solid var(--bg-lighter);
    padding: 20px;
    overflow-y: auto;
}

.write-sidebar h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.write-outline-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.write-outline-item {
    padding: 12px;
    background: var(--bg-lighter);
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: grab;
    transition: all 0.2s ease;
    overflow: hidden;
}

.write-outline-item:hover {
    background: var(--bg-dark);
    transform: translateX(4px);
}

.write-outline-item.active {
    background: var(--bg-dark);
    box-shadow: 0 0 0 2px var(--accent-blue);
}

.write-outline-item.expanded {
    background: var(--bg-dark);
}

.write-outline-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.write-outline-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.write-outline-item-title {
    font-weight: 600;
    font-size: 13px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.write-outline-item-type {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
}

.write-outline-item-preview {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
    margin-top: 4px;
}

.write-outline-item-full {
    display: none;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--bg-lighter);
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
}

.write-outline-item.expanded .write-outline-item-preview {
    display: none;
}

.write-outline-item.expanded .write-outline-item-full {
    display: block;
}

/* Make sections sidebar scrollable with max height */
.sections-sidebar {
    max-height: calc(100vh - 200px);
}

.write-outline-list {
    max-height: calc(100vh - 320px);
    overflow-y: auto;
    padding-right: 4px;
}

/* Better scrollbar for write outline list */
.write-outline-list::-webkit-scrollbar {
    width: 6px;
}

.write-outline-list::-webkit-scrollbar-track {
    background: transparent;
}

.write-outline-list::-webkit-scrollbar-thumb {
    background: var(--bg-lighter);
    border-radius: 3px;
}

.write-outline-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.write-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.write-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--bg-lighter);
    background: var(--bg-card);
}

.tool-btn {
    padding: 8px 12px;
    background: var(--bg-lighter);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tool-btn:hover {
    background: var(--bg-dark);
    color: var(--text-primary);
}

.tool-btn.primary {
    background: var(--accent-blue);
    color: white;
}

.tool-btn.primary:hover {
    background: #2563eb;
}

.toolbar-spacer {
    flex: 1;
}

.write-toolbar select {
    padding: 8px 12px;
    background: var(--bg-lighter);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
}

/* Flow state layout */
.flow-layout {
    display: flex;
    gap: 24px;
    height: 100%;
}

.flow-reference {
    width: 280px;
    flex-shrink: 0;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.flow-reference h4 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.flow-outline-ref {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flow-ref-card {
    padding: 10px 12px;
    background: var(--bg-lighter);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}

.flow-ref-card:hover {
    background: var(--bg-main);
    transform: translateX(4px);
}

.flow-ref-card-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.flow-ref-card-preview {
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.flow-insert-btn {
    margin-top: 12px;
    padding: 10px 16px;
    background: var(--accent-blue);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.flow-insert-btn:hover {
    background: #2563eb;
}

.flow-insert-btn.ai-btn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.flow-insert-btn.ai-btn:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

.tool-btn.ai-btn {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.tool-btn.ai-btn:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.4), rgba(139, 92, 246, 0.4));
    color: #c4b5fd;
}

.toolbar-divider {
    width: 1px;
    height: 20px;
    background: var(--bg-lighter);
    margin: 0 8px;
}

.flow-editor {
    flex: 1;
    background: var(--bg-card);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.write-area {
    flex: 1;
    padding: 30px;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-primary);
    overflow-y: auto;
}

.write-area:focus {
    outline: none;
}

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

.write-area.drag-over {
    background: rgba(59, 130, 246, 0.1);
    border: 2px dashed var(--accent-blue);
    border-radius: var(--radius);
}

/* Flow State guidance text - different from user content */
.write-area .write-guidance {
    color: var(--text-muted);
    font-family: 'Georgia', 'Times New Roman', serif;
    font-weight: 400;
    opacity: 0.6;
    margin-bottom: 4px;
}

.write-area h2.write-guidance {
    font-size: 20px;
    border-bottom: 1px solid var(--bg-lighter);
    padding-bottom: 8px;
    margin-top: 24px;
}

.write-area h3.write-guidance {
    font-size: 17px;
    margin-top: 20px;
}

.write-area h4.write-guidance {
    font-size: 15px;
    margin-top: 16px;
}

.write-area .write-guidance-hint {
    color: var(--text-muted);
    font-size: 13px;
    font-style: italic;
    opacity: 0.5;
    line-height: 1.5;
    margin-bottom: 12px;
    padding-left: 12px;
    border-left: 2px solid var(--bg-lighter);
}

.write-area .write-user-content {
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.8;
    min-height: 60px;
}

.source-reference {
    background: var(--bg-card);
    border-left: 3px solid var(--accent-blue);
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    cursor: default;
    user-select: text;
}

.source-reference strong {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--accent-blue);
}

.source-reference p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* Writing Blocks - Flow State Writing */
.writing-block {
    background: var(--bg-card);
    border-radius: var(--radius);
    margin: 20px 0;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
}

.writing-block:hover {
    box-shadow: var(--shadow-lg);
}

.writing-block:focus-within {
    box-shadow: 0 0 0 2px var(--accent-blue), var(--shadow-lg);
}

.writing-block-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
}

.writing-block-type {
    font-size: 9px;
    padding: 3px 8px;
    border-radius: 10px;
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.writing-block-title {
    font-weight: 600;
    font-size: 14px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.writing-block-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.writing-block-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.writing-block-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.writing-block-remove:hover {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
}

.writing-block-source {
    background: var(--bg-lighter);
    padding: 16px;
    border-top: 1px solid var(--bg-dark);
    border-bottom: 1px solid var(--bg-dark);
    max-height: 200px;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.writing-block-source.collapsed {
    max-height: 0;
    padding: 0 16px;
    overflow: hidden;
    border: none;
}

.writing-block-source-content {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.writing-block-source-content p {
    margin-bottom: 8px;
}

.writing-block-source-content ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.writing-block-source-content li {
    margin-bottom: 6px;
    padding-left: 16px;
    position: relative;
}

.writing-block-source-content li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--text-muted);
}

.writing-block-source-link {
    display: inline-block;
    margin-top: 12px;
    font-size: 11px;
    color: var(--accent-blue);
    text-decoration: none;
}

.writing-block-source-link:hover {
    text-decoration: underline;
}

.writing-block-write {
    min-height: 120px;
    padding: 20px;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-primary);
    outline: none;
    background: transparent;
}

.writing-block-write:empty::before {
    content: attr(placeholder);
    color: var(--text-muted);
    pointer-events: none;
}

.writing-block-write:focus {
    background: rgba(59, 130, 246, 0.03);
}

.write-outline-item {
    cursor: grab;
}

.write-outline-item.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

/* ==========================================
   REPLY BUILDER v2 - 3-Column Layout
   ========================================== */

.reply-builder {
    display: grid;
    grid-template-columns: 280px 1fr 1fr;
    gap: 20px;
    height: 100%;
    padding: 20px;
    overflow: hidden;
}

/* Column Base Styles */
.reply-col {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
}

.col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--bg-lighter);
    flex-shrink: 0;
}

.col-header h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.col-action {
    padding: 4px 10px;
    background: transparent;
    border: 1px solid var(--bg-lighter);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.col-action:hover {
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

.col-action.hidden {
    display: none;
}

/* Left Column - What They Said */
.reply-col-left {
    min-width: 0;
}

.reply-original-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#reply-original {
    flex: 1;
    width: 100%;
    padding: 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-family: inherit;
    resize: none;
    line-height: 1.6;
    overflow-y: auto;
}

#reply-original:focus {
    outline: none;
}

#reply-original::placeholder {
    color: var(--text-muted);
}

.platform-detected {
    padding: 8px 16px;
    border-top: 1px solid var(--bg-lighter);
    font-size: 11px;
    color: var(--text-muted);
}

.platform-detected:empty {
    display: none;
}

/* Center Column - PlainSpeak Cards */
.reply-col-center {
    min-width: 0;
    overflow: hidden;
}

.reply-cards {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    padding-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cards-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 14px;
}

/* PlainSpeak Card */
.cards-empty-state,
.cards-loading {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

.cards-loading {
    color: var(--accent-blue);
}

.ps-card {
    background: var(--bg-lighter);
    border-radius: var(--radius);
    overflow: visible;
    box-shadow: var(--shadow);
    position: relative;
}

.ps-card-header {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border-radius: var(--radius) var(--radius) 0 0;
    position: relative;
    overflow: hidden;
}

/* Header gradient overlay - fades to background */
.ps-card-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, var(--card-color, var(--accent-blue)) 0%, transparent 50%);
    opacity: 0.25;
    pointer-events: none;
}

.ps-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    position: relative;
}

.ps-card-body {
    overflow: visible;
    transition: max-height 0.3s ease;
}

.ps-card-body.collapsed {
    display: none;
}

.text-muted {
    color: var(--text-muted);
    font-style: italic;
}

.ps-card-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    padding: 0 4px;
    line-height: 1;
}

.ps-card-toggle:hover {
    color: var(--text-primary);
}

.ps-card-content {
    padding: 12px 16px;
}

.ps-card-content p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.ps-card-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ps-card-content li {
    font-size: 13px;
    color: var(--text-secondary);
    padding-left: 16px;
    position: relative;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.ps-card-content li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--card-color, var(--accent-blue));
}

.ps-card-actions {
    border-top: 1px solid var(--bg-card);
    overflow: visible;
}

.ps-card-insert {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--bg-card);
    color: var(--card-color, var(--accent-blue));
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
    min-height: auto;
}

.ps-card-insert:last-child {
    border-bottom: none;
    border-radius: 0 0 var(--radius) var(--radius);
}

.ps-card-insert:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--text-primary);
}

/* Card type header gradient colors */
.ps-card[data-type="translation"] .ps-card-header::before {
    background: linear-gradient(90deg, #3b82f6 0%, transparent 50%);
}
.ps-card[data-type="didnt_say"] .ps-card-header::before {
    background: linear-gradient(90deg, #f97316 0%, transparent 50%);
}
.ps-card[data-type="pressure"] .ps-card-header::before {
    background: linear-gradient(90deg, #ef4444 0%, transparent 50%);
}
.ps-card[data-type="address"] .ps-card-header::before {
    background: linear-gradient(90deg, #a78bfa 0%, transparent 50%);
}
.ps-card[data-type="strong_reply"] .ps-card-header::before {
    background: linear-gradient(90deg, #22c55e 0%, transparent 50%);
}
.ps-card[data-type="angles"] .ps-card-header::before {
    background: linear-gradient(90deg, #06b6d4 0%, transparent 50%);
}

/* Example Wording (collapsed by default) */
.ps-card-example {
    border-top: 1px solid var(--bg-card);
}

.ps-card-example-toggle {
    display: block;
    width: 100%;
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    text-align: left;
}

.ps-card-example-toggle:hover {
    color: var(--text-secondary);
}

.ps-card-example-content {
    display: none;
    padding: 12px 16px;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-card);
    line-height: 1.5;
}

.ps-card-example-content.expanded {
    display: block;
}

.ps-card-example-insert {
    display: block;
    margin-top: 8px;
    padding: 6px 12px;
    background: var(--bg-lighter);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
}

.ps-card-example-insert:hover {
    color: var(--text-primary);
}

/* Right Column - Your Reply */
.reply-col-right {
    min-width: 0;
}

.compile-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.compile-controls select {
    padding: 4px 8px;
    background: var(--bg-lighter);
    border: 1px solid var(--bg-lighter);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 11px;
}

.compile-btn, .cleanup-btn {
    padding: 4px 12px;
    background: var(--accent-blue);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.compile-btn:disabled, .cleanup-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cleanup-btn {
    background: var(--bg-lighter);
    color: var(--text-secondary);
}

.cleanup-btn:hover:not(:disabled) {
    background: var(--bg-card);
}

.reply-draft {
    flex: 1;
    width: 100%;
    padding: 16px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: none;
    line-height: 1.7;
}

.reply-draft:focus {
    outline: none;
}

.reply-draft::placeholder {
    color: var(--text-muted);
}

.reply-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-top: 1px solid var(--bg-lighter);
}

.footer-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-lighter);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.footer-btn:hover:not(:disabled) {
    background: var(--accent-blue);
    color: white;
}

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

.char-count {
    font-size: 11px;
    color: var(--text-muted);
}

/* Scaffold Insertions */
.scaffold {
    background: rgba(59, 130, 246, 0.1);
    border: 1px dashed var(--accent-blue);
    border-radius: 4px;
    padding: 2px 6px;
    color: var(--accent-blue);
    font-size: 13px;
}

/* Reply Builder Responsive */
@media (max-width: 1100px) {
    .reply-builder {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto 1fr;
    }

    .reply-col-left {
        grid-column: 1 / -1;
        max-height: 200px;
    }
}

@media (max-width: 768px) {
    .reply-builder {
        grid-template-columns: 1fr;
    }

    .reply-col-left {
        max-height: 150px;
    }

    .reply-col-center {
        max-height: 300px;
    }
}

#reply-original {
    width: 100%;
    height: 120px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-top: 1px solid var(--bg-lighter);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    resize: none;
    line-height: 1.6;
}

#reply-original:focus {
    outline: none;
    background: rgba(59, 130, 246, 0.03);
}

#reply-original::placeholder {
    color: var(--text-muted);
}

/* Coach's Read Section */
.coach-read {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    border-left: 3px solid var(--accent-blue);
}

.coach-read.hidden {
    display: none;
}

.coach-headline {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.coach-points {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.coach-points li {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    padding-left: 20px;
    position: relative;
}

.coach-points li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--accent-blue);
    font-weight: bold;
}

/* Posture Selection */
.posture-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
}

.posture-section.hidden {
    display: none;
}

.posture-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.posture-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.posture-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    background: var(--bg-lighter);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.posture-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-blue);
}

.posture-btn.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--accent-blue);
}

.posture-icon {
    font-size: 20px;
}

.posture-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Starter Sentences */
.starters-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
}

.starters-section.hidden {
    display: none;
}

.starters-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.starter-sentences {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.starter-sentence {
    padding: 10px 12px;
    background: var(--bg-lighter);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.4;
    border: 1px solid transparent;
}

.starter-sentence:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-blue);
    color: var(--text-primary);
}

/* Right Panel - Writing Area */
.reply-writing-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.writing-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.writing-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Cards Container */
.reply-cards-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 4px;
}

/* Reply Card - Clickable analysis cards */
.reply-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.reply-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.reply-card.added {
    opacity: 0.5;
    cursor: default;
    transform: none;
}

.reply-card.added::after {
    content: 'Added';
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--accent-green);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}

.reply-card-header {
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reply-card-type {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
}

.reply-card-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.reply-card-content {
    padding: 0 12px 12px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.reply-card-content ul {
    margin: 0;
    padding-left: 16px;
}

.reply-card-content li {
    margin-bottom: 4px;
}

/* Card type colors - matching workspace */
.reply-card.verified .reply-card-header {
    background: linear-gradient(135deg, #059669, #10b981);
}
.reply-card.verified .reply-card-type { color: #10b981; }

.reply-card.omitted .reply-card-header {
    background: linear-gradient(135deg, #dc2626, #f87171);
}
.reply-card.omitted .reply-card-type { color: #f87171; }

.reply-card.spin .reply-card-header {
    background: linear-gradient(135deg, #d97706, #fbbf24);
}
.reply-card.spin .reply-card-type { color: #fbbf24; }

.reply-card.misleading .reply-card-header {
    background: linear-gradient(135deg, #dc2626, #ef4444);
}
.reply-card.misleading .reply-card-type { color: #ef4444; }

.reply-card.summary .reply-card-header {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
}
.reply-card.summary .reply-card-type { color: #3b82f6; }

.reply-card.suggestion .reply-card-header {
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
}
.reply-card.suggestion .reply-card-type { color: #a78bfa; }

.reply-card.advice .reply-card-header {
    background: linear-gradient(135deg, #0891b2, #22d3ee);
}
.reply-card.advice .reply-card-type { color: #22d3ee; }

/* Arsenal empty state */
.arsenal-empty-state {
    text-align: center;
    padding: 24px 16px;
    color: var(--text-muted);
}

.arsenal-empty-state p {
    font-size: 13px;
    margin-bottom: 16px;
}

.reply-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-lighter);
    border: 1px solid var(--bg-lighter);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reply-action-btn:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.btn-icon {
    font-size: 16px;
}

/* Reply Blocks Container */
.reply-blocks-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
    min-height: 100px;
    max-height: 40%;
    padding: 8px;
    background: var(--bg-darker);
    border-radius: var(--radius);
    border: 1px dashed var(--bg-lighter);
}

.blocks-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
    padding: 16px;
}

/* Reply Block - Individual point to address */
.reply-block {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}

.reply-block-source {
    padding: 8px 12px;
    border-left: 3px solid var(--accent-blue);
    background: var(--bg-lighter);
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.reply-block-type {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.reply-block-summary {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    flex: 1;
}

.reply-block-text {
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    resize: none;
    min-height: 60px;
    line-height: 1.5;
}

.reply-block-text:focus {
    outline: none;
    background: rgba(59, 130, 246, 0.05);
}

.reply-block-text::placeholder {
    color: var(--text-muted);
}

.reply-block-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(239, 68, 68, 0.2);
    border: none;
    border-radius: 50%;
    color: #ef4444;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.2s;
}

.reply-block:hover .reply-block-remove {
    opacity: 1;
}

.reply-block-remove:hover {
    background: #ef4444;
    color: white;
}

/* Block type colors */
.reply-block.verified .reply-block-source { border-color: #10b981; }
.reply-block.verified .reply-block-type { color: #10b981; }

.reply-block.omitted .reply-block-source { border-color: #f87171; }
.reply-block.omitted .reply-block-type { color: #f87171; }

.reply-block.spin .reply-block-source { border-color: #fbbf24; }
.reply-block.spin .reply-block-type { color: #fbbf24; }

.reply-block.misleading .reply-block-source { border-color: #ef4444; }
.reply-block.misleading .reply-block-type { color: #ef4444; }

.reply-block.suggestion .reply-block-source { border-color: #a78bfa; }
.reply-block.suggestion .reply-block-type { color: #a78bfa; }

/* Main Reply Draft Textarea */
#reply-draft {
    flex: 1;
    width: 100%;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--bg-lighter);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    resize: none;
    line-height: 1.7;
    min-height: 300px;
}

#reply-draft:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#reply-draft::placeholder {
    color: var(--text-muted);
}

.reply-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-shrink: 0;
}

.reply-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    background: var(--bg-card);
    border: 1px solid var(--bg-lighter);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.reply-btn.primary {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.reply-btn.primary:hover {
    background: #2563eb;
}

.reply-options-inline {
    display: flex;
    gap: 8px;
}

.reply-options-inline select {
    padding: 6px 10px;
    background: var(--bg-card);
    border: 1px solid var(--bg-lighter);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
}

/* Reply Builder Responsive */
@media (max-width: 900px) {
    .reply-coach {
        flex-direction: column;
    }

    .reply-context-panel {
        width: 100%;
        max-height: 40vh;
    }
}

/* Quick Takes Section */
.quick-takes-section {
    margin-top: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.quick-takes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.quick-takes-header h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.quick-takes-hint {
    font-size: 11px;
    color: var(--text-muted);
}

.quick-takes-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 4px;
}

.quick-takes-empty {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 13px;
}

/* Quick Take - Compact pill style */
.quick-take {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(30, 30, 40, 0.8);
    border-left: 3px solid var(--take-color, #666);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quick-take:hover {
    background: rgba(45, 45, 55, 0.9);
    transform: translateX(4px);
}

.quick-take.added {
    opacity: 0.4;
    cursor: default;
    transform: none;
}

.quick-take-icon {
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 1px;
}

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

.quick-take-category {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--take-color, #888);
    margin-bottom: 3px;
}

.quick-take-text {
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-primary);
}

.quick-take-add {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    background: transparent;
    border: 1px solid var(--bg-lighter);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-take:hover .quick-take-add {
    opacity: 1;
    border-color: var(--take-color, #666);
    color: var(--take-color, #888);
}

.quick-take-add:hover {
    background: var(--take-color, #666);
    color: white;
}

/* Quick Take Categories */
.quick-take.didnt-say { --take-color: #ef4444; }
.quick-take.question { --take-color: #fbbf24; }
.quick-take.blind-spot { --take-color: #f97316; }
.quick-take.suggestion { --take-color: #22c55e; }
.quick-take.watch-out { --take-color: #ef4444; }

/* Reply Writing Area */
.reply-writing-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 150px;
}

.reply-writing-area #reply-draft {
    flex: 1;
    min-height: 120px;
}

/* Reply Block - Updated for Quick Takes */
.reply-block {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    border: 1px solid var(--bg-lighter);
}

.reply-block-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-lighter);
    border-left: 3px solid var(--block-color, #666);
}

.reply-block-icon {
    font-size: 14px;
}

.reply-block-label {
    font-size: 12px;
    color: var(--text-secondary);
    flex: 1;
    line-height: 1.3;
}

.reply-block-remove {
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    opacity: 0.5;
    transition: all 0.2s;
}

.reply-block:hover .reply-block-remove {
    opacity: 1;
}

.reply-block-remove:hover {
    color: #ef4444;
}

.reply-block-edit {
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    resize: none;
    min-height: 50px;
    line-height: 1.5;
}

.reply-block-edit:focus {
    outline: none;
    background: rgba(59, 130, 246, 0.03);
}

.reply-block-edit::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

/* Block colors matching take categories */
.reply-block.didnt-say { --block-color: #ef4444; }
.reply-block.question { --block-color: #fbbf24; }
.reply-block.blind-spot { --block-color: #f97316; }
.reply-block.suggestion { --block-color: #22c55e; }
.reply-block.watch-out { --block-color: #ef4444; }

/* ==========================================
   MODALS
   ========================================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--bg-lighter);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 0 4px;
}

.modal-close:hover {
    color: var(--text-primary);
}

.lineage-content {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.lineage-item {
    padding: 12px;
    background: var(--bg-lighter);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.15s ease;
}

.lineage-item:not(.current):hover {
    background: var(--bg-card);
    transform: translateX(4px);
}

.lineage-item.current {
    border: 2px solid var(--accent-blue);
    cursor: default;
}

.lineage-type {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    color: white;
}

.lineage-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
}

/* Confirm Modal */
.confirm-modal-content {
    max-width: 400px;
}

.confirm-body {
    padding: 20px;
}

.confirm-body p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.confirm-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--bg-lighter);
}

.confirm-btn {
    padding: 10px 20px;
    background: var(--bg-lighter);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.confirm-btn.primary {
    background: var(--accent-blue);
    color: white;
}

.confirm-btn.primary:hover {
    background: #2563eb;
}

.confirm-btn.danger {
    background: var(--accent-red);
    color: white;
}

.confirm-btn.danger:hover {
    background: #dc2626;
}

/* Card highlight animation */
.card.highlighted {
    animation: highlight-pulse 2s ease-out;
}

@keyframes highlight-pulse {
    0%, 100% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); }
    50% { box-shadow: 0 0 30px rgba(59, 130, 246, 0.8); }
}

/* ==========================================
   LOADING & TOAST
   ========================================== */

#loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 13, 18, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

#loading.hidden {
    display: none;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--bg-lighter);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

#loading-text {
    font-size: 16px;
    color: var(--text-secondary);
}

#toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-card);
    border: 1px solid var(--bg-lighter);
    padding: 14px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    color: var(--text-primary);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 3000;
}

#toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ==========================================
   STEVE AGENT - Mobile & Contextual AI
   ========================================== */

/* Main Agent Container */
.steve-agent {
    position: fixed;
    z-index: 9000; /* High z-index to ensure visibility */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.steve-agent.hidden {
    display: none;
}

/* Position states for Steve - CONTEXTUAL based on where user is working */

/* Default/fallback - bottom right */
.steve-agent.position-corner {
    bottom: 24px;
    right: 24px;
    left: auto;
    top: auto;
}

/* Workspace/Canvas - bottom right, near the cards */
.steve-agent.position-canvas {
    bottom: 100px;
    right: 40px;
    left: auto;
    top: auto;
}

/* Planner - bottom right, so conversation panel doesn't get cut off */
.steve-agent.position-planner {
    bottom: 24px;
    right: 24px;
    left: auto;
    top: auto;
}

/* Outline - left side, near the outline list */
.steve-agent.position-outline {
    bottom: 100px;
    left: 320px; /* Next to the outline panel */
    right: auto;
    top: auto;
}

/* Write mode - right side middle, alongside the editor */
.steve-agent.position-write {
    top: 45%;
    right: 40px;
    left: auto;
    bottom: auto;
    transform: translateY(-50%);
}

/* Reply mode - right side, near the draft area */
.steve-agent.position-reply {
    top: 40%;
    right: 40px;
    left: auto;
    bottom: auto;
    transform: translateY(-50%);
}

/* Custom position - user dragged Steve */
.steve-agent.position-custom {
    /* Position is set at bottom-right, transform moves from there */
    right: 24px !important;
    bottom: 24px !important;
    left: auto !important;
    top: auto !important;
    /* transform is set via JS */
}

/* Steve Avatar - The face that moves around */
.steve-avatar {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-lighter) 100%);
    border: 3px solid var(--accent-blue);
    border-radius: 50%;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    transition: all 0.3s ease, left 0s, top 0s;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
    position: relative;
    user-select: none;
}

.steve-avatar:active {
    cursor: grabbing;
}

.steve-avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(59, 130, 246, 0.4);
    border-color: var(--accent-purple);
}

.steve-avatar.excited {
    animation: steve-bounce 0.6s ease infinite;
    border-color: var(--accent-green);
}

.steve-avatar.thinking {
    border-color: var(--accent-yellow);
}

.steve-avatar.has-message {
    animation: steve-pulse 1.5s ease-in-out infinite;
    border-color: var(--accent-purple);
}

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

@keyframes steve-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.5);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 0 20px 10px rgba(139, 92, 246, 0.2);
    }
}

.steve-face {
    font-size: 20px;
    font-weight: bold;
    color: var(--accent-blue);
    letter-spacing: 1px;
}

.steve-avatar:hover .steve-face {
    color: var(--accent-purple);
}

/* Thinking Animation */
.steve-thinking {
    position: absolute;
    bottom: -8px;
    display: flex;
    gap: 4px;
}

.steve-thinking.hidden {
    display: none;
}

.thinking-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-yellow);
    border-radius: 50%;
    animation: thinking-bounce 1.4s ease-in-out infinite;
}

.thinking-dot:nth-child(2) { animation-delay: 0.2s; }
.thinking-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes thinking-bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40% { transform: translateY(-6px); opacity: 1; }
}

/* Speech Bubble - Comic book style */
.steve-bubble {
    position: absolute;
    bottom: 80px;
    left: 0;
    right: auto;
    min-width: 280px;
    max-width: 360px;
    background: var(--bg-card);
    border: 2px solid var(--accent-blue);
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

/* Default bubble tail on left */
.steve-bubble .bubble-tail {
    left: 24px;
    right: auto;
}

/* When Steve is on the RIGHT side, bubble opens to the LEFT */
.steve-agent.position-canvas .steve-bubble,
.steve-agent.position-planner .steve-bubble,
.steve-agent.position-write .steve-bubble,
.steve-agent.position-reply .steve-bubble,
.steve-agent.position-corner .steve-bubble {
    left: auto;
    right: 0;
}

.steve-agent.position-canvas .steve-bubble .bubble-tail,
.steve-agent.position-planner .steve-bubble .bubble-tail,
.steve-agent.position-write .steve-bubble .bubble-tail,
.steve-agent.position-reply .steve-bubble .bubble-tail,
.steve-agent.position-corner .steve-bubble .bubble-tail {
    left: auto;
    right: 24px;
}

/* When Steve is on the LEFT side (outline), bubble opens to the RIGHT */
.steve-agent.position-outline .steve-bubble {
    left: 0;
    right: auto;
}

.steve-agent.position-outline .steve-bubble .bubble-tail {
    left: 24px;
    right: auto;
}

/* Custom position - bubble adapts based on screen position */
.steve-agent.position-custom .steve-bubble,
.steve-agent.position-custom .steve-conversation {
    /* Default to right side */
    left: auto;
    right: 0;
}

.steve-agent.position-custom .steve-bubble .bubble-tail {
    left: auto;
    right: 24px;
}

.steve-bubble.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.steve-bubble.hidden {
    display: none;
}

.bubble-content {
    padding: 16px 20px;
}

.bubble-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    margin: 0;
}

.bubble-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--bg-lighter);
}

.bubble-actions.hidden {
    display: none;
}

.bubble-btn {
    flex: 1;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bubble-btn.bubble-yes {
    background: var(--accent-blue);
    border: none;
    color: white;
}

.bubble-btn.bubble-yes:hover {
    background: var(--accent-purple);
}

.bubble-btn.bubble-no {
    background: transparent;
    border: 1px solid var(--bg-lighter);
    color: var(--text-muted);
}

.bubble-btn.bubble-no:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

/* Bubble input for open-ended questions */
.bubble-input {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--bg-lighter);
}

.bubble-input.hidden {
    display: none;
}

.bubble-text-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--bg-lighter);
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

.bubble-text-input:focus {
    border-color: var(--accent-blue);
}

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

.bubble-input .bubble-btn {
    flex: none;
}

.bubble-input .bubble-submit {
    background: var(--accent-blue);
    border: none;
    color: white;
}

.bubble-input .bubble-submit:hover {
    background: var(--accent-purple);
}

.bubble-input .bubble-dismiss {
    background: transparent;
    border: 1px solid var(--bg-lighter);
    color: var(--text-muted);
}

.bubble-input .bubble-dismiss:hover {
    border-color: var(--text-muted);
}

.bubble-input-row {
    display: flex;
    gap: 8px;
}

.bubble-tail {
    position: absolute;
    bottom: -12px;
    left: 24px;
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 12px solid var(--accent-blue);
}

.bubble-tail::before {
    content: '';
    position: absolute;
    left: -10px;
    top: -14px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid var(--bg-card);
}

/* Full Conversation Panel */
.steve-conversation {
    position: absolute;
    bottom: 80px;
    left: 0;
    right: auto;
    width: 400px;
    max-width: calc(100vw - 48px);
    max-height: min(500px, calc(100vh - 200px)); /* Never overflow viewport */
    background: var(--bg-card);
    border: 2px solid var(--accent-blue);
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* When Steve is on the RIGHT, conversation opens LEFT */
.steve-agent.position-canvas .steve-conversation,
.steve-agent.position-planner .steve-conversation,
.steve-agent.position-write .steve-conversation,
.steve-agent.position-reply .steve-conversation,
.steve-agent.position-corner .steve-conversation {
    left: auto;
    right: 0;
}

/* When Steve is on the LEFT (outline), conversation opens RIGHT */
.steve-agent.position-outline .steve-conversation {
    left: 0;
    right: auto;
}

.steve-conversation.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.steve-conversation.hidden {
    display: none;
}

.conversation-header {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--bg-lighter);
    background: var(--bg-lighter);
}

.conversation-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    font-weight: 600;
    color: var(--text-primary);
}

.steve-mini-face {
    width: 28px;
    height: 28px;
    background: var(--bg-card);
    border: 2px solid var(--accent-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: var(--accent-blue);
}

.conversation-minimize,
.conversation-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.conversation-minimize:hover,
.conversation-close:hover {
    color: var(--text-primary);
}

.conversation-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    max-height: 340px;
}

.conv-msg {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
}

.conv-msg.user {
    align-items: flex-end;
}

.conv-msg.steve {
    align-items: flex-start;
}

.conv-msg .msg-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.conv-msg.user .msg-bubble {
    background: var(--accent-blue);
    color: white;
    border-bottom-right-radius: 4px;
}

.conv-msg.steve .msg-bubble {
    background: var(--bg-lighter);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.conversation-input {
    display: flex;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid var(--bg-lighter);
    background: var(--bg-dark);
}

.conversation-input input {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--bg-lighter);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 14px;
}

.conversation-input input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.conversation-input button {
    background: var(--accent-blue);
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.conversation-input button:hover {
    background: var(--accent-purple);
}

/* Steve's Suggestion Chips */
.steve-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0;
    margin-top: 4px;
}

.steve-suggestion-chip {
    background: var(--bg-lighter);
    border: 1px solid var(--accent-blue);
    border-radius: 16px;
    padding: 6px 14px;
    font-size: 13px;
    color: var(--accent-blue);
    cursor: pointer;
    transition: all 0.2s ease;
}

.steve-suggestion-chip:hover {
    background: var(--accent-blue);
    color: white;
    transform: translateY(-1px);
}

/* Legacy Steve Popup (keeping for backwards compat) */
#steve-popup {
    position: fixed;
    bottom: 80px;
    left: 20px;
    background: var(--bg-card);
    border: 1px solid var(--accent-blue);
    border-radius: var(--radius);
    padding: 16px 20px;
    max-width: 320px;
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.3);
    z-index: 2500;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
    cursor: pointer;
}

#steve-popup.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.steve-popup-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-lighter);
    border: 2px solid var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: var(--accent-blue);
    flex-shrink: 0;
}

.steve-popup-message {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
}

/* ==========================================
   STEVE AGENT VISUAL FEEDBACK
   Animations when Steve takes actions
   ========================================== */

/* Card highlight when Steve references or moves it */
.card.steve-highlight {
    animation: steve-card-highlight 2s ease;
    z-index: 100;
}

.card.steve-moving {
    transition: all 0.5s ease;
    box-shadow: 0 0 30px var(--accent-blue) !important;
}

@keyframes steve-card-highlight {
    0%, 100% {
        box-shadow: none;
    }
    25%, 75% {
        box-shadow: 0 0 30px var(--accent-blue), 0 0 60px rgba(59, 130, 246, 0.3);
        transform: scale(1.02);
    }
}

/* Steve thinking state - pulsing glow on avatar */
.steve-avatar.thinking .steve-face {
    animation: steve-think-glow 1.5s ease-in-out infinite;
}

@keyframes steve-think-glow {
    0%, 100% {
        text-shadow: 0 0 5px var(--accent-blue);
    }
    50% {
        text-shadow: 0 0 15px var(--accent-blue), 0 0 30px rgba(59, 130, 246, 0.5);
    }
}

/* Steve excited state - brief bounce when taking action */
.steve-avatar.action-complete {
    animation: steve-action-bounce 0.6s ease;
}

@keyframes steve-action-bounce {
    0%, 100% { transform: scale(1); }
    30% { transform: scale(1.15); }
    60% { transform: scale(0.95); }
}

/* Steve has a message indicator */
.steve-avatar.has-notification::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background: var(--success-color, #22c55e);
    border-radius: 50%;
    border: 2px solid var(--bg-dark);
    animation: notification-pulse 2s ease-in-out infinite;
}

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

/* Section being modified by Steve */
.outline-section.steve-modifying {
    border-color: var(--accent-blue);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
    animation: section-glow 1s ease;
}

@keyframes section-glow {
    0% { box-shadow: 0 0 0 rgba(59, 130, 246, 0); }
    50% { box-shadow: 0 0 30px rgba(59, 130, 246, 0.5); }
    100% { box-shadow: 0 0 20px rgba(59, 130, 246, 0.3); }
}

/* Smooth card movement animation */
.card.transitioning {
    transition: left 0.5s ease, top 0.5s ease;
}

/* ==========================================
   RAINBOW BAR
   ========================================== */

.rainbow-bar {
    height: 3px;
    background: var(--rainbow);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

/* ==========================================
   SCROLLBARS
   ========================================== */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-lighter);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a3a45;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .header {
        padding: 10px 16px;
    }

    .mode-tabs {
        display: none;
    }

    .header-left .btn-text,
    .header-right .btn-text {
        display: none;
    }

    .entry-container {
        padding: 20px;
    }

    .input-area {
        flex-direction: column;
    }

    #go-btn {
        width: 100%;
    }

    .reply-container {
        flex-direction: column;
    }

    .reply-advice {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
    }

    .write-container {
        flex-direction: column;
    }

    .write-sidebar {
        width: 100%;
        max-height: 150px;
    }
}

/* ==========================================
   FEEDBACK & SESSION MODALS
   ========================================== */

/* Feedback Modal */
.feedback-modal-content {
    max-width: 480px;
}

.feedback-intro {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.feedback-body {
    padding: 16px 0;
}

.feedback-textarea {
    width: 100%;
    height: 150px;
    background: var(--bg-input);
    border: 1px solid var(--bg-lighter);
    border-radius: var(--radius-sm);
    padding: 12px;
    color: var(--text-primary);
    font-size: 14px;
    resize: vertical;
    margin-bottom: 12px;
}

.feedback-textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.feedback-type {
    display: flex;
    gap: 16px;
}

.feedback-type label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
}

.feedback-type input[type="radio"] {
    accent-color: var(--accent-blue);
}

.feedback-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--bg-lighter);
}

.feedback-btn {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.feedback-btn.secondary {
    background: transparent;
    border: 1px solid var(--bg-lighter);
    color: var(--text-secondary);
}

.feedback-btn.secondary:hover {
    background: var(--bg-lighter);
    color: var(--text-primary);
}

.feedback-btn.primary {
    background: var(--accent-blue);
    border: none;
    color: white;
}

.feedback-btn.primary:hover {
    background: #2563eb;
}

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

/* Session Modals */
.session-modal-content {
    max-width: 420px;
}

.session-body {
    padding: 16px 0;
}

.session-body p {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.session-name-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--bg-lighter);
    border-radius: var(--radius-sm);
    padding: 12px;
    color: var(--text-primary);
    font-size: 14px;
}

.session-name-input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.session-list {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.session-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    border: 1px solid var(--bg-lighter);
    transition: all 0.2s;
}

.session-item:hover {
    border-color: var(--accent-blue);
}

.session-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.session-name {
    font-weight: 500;
    color: var(--text-primary);
}

.session-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.session-actions {
    display: flex;
    gap: 8px;
}

.session-load-btn {
    padding: 6px 14px;
    background: var(--accent-blue);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.session-load-btn:hover {
    background: #2563eb;
}

.session-delete-btn {
    padding: 6px 10px;
    background: transparent;
    border: 1px solid var(--accent-red);
    border-radius: var(--radius-sm);
    color: var(--accent-red);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.session-delete-btn:hover {
    background: var(--accent-red);
    color: white;
}

.session-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--bg-lighter);
}

.session-btn {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.session-btn.secondary {
    background: transparent;
    border: 1px solid var(--bg-lighter);
    color: var(--text-secondary);
}

.session-btn.secondary:hover {
    background: var(--bg-lighter);
    color: var(--text-primary);
}

.session-btn.primary {
    background: var(--accent-blue);
    border: none;
    color: white;
}

.session-btn.primary:hover {
    background: #2563eb;
}

/* ==========================================
   CREATE CARD MODAL
   ========================================== */

.create-card-modal-content {
    max-width: 500px;
}

.create-card-body {
    padding: 20px 0;
}

.create-card-field {
    margin-bottom: 20px;
}

.create-card-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.create-card-field .optional {
    color: var(--text-muted);
    font-weight: 400;
}

.create-card-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--bg-lighter);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
}

.create-card-input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.create-card-textarea {
    width: 100%;
    height: 120px;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--bg-lighter);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    resize: vertical;
}

.create-card-textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.create-card-types {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.card-type-btn {
    padding: 10px 16px;
    background: var(--bg-lighter);
    border: 2px solid transparent;
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.card-type-btn:hover {
    background: var(--bg-input);
    color: var(--text-primary);
}

.card-type-btn.selected {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.create-card-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--bg-lighter);
}

.create-card-btn {
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.create-card-btn.secondary {
    background: transparent;
    border: 1px solid var(--bg-lighter);
    color: var(--text-secondary);
}

.create-card-btn.secondary:hover {
    background: var(--bg-lighter);
    color: var(--text-primary);
}

.create-card-btn.primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border: none;
    color: white;
}

.create-card-btn.primary:hover {
    filter: brightness(1.1);
}
