/* ==========================================================================
   SEO Pipeline Dashboard — Apple-inspired Theme (Light + Dark)
   ========================================================================== */

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

/* ==========================================================================
   Dark Theme (default)
   ========================================================================== */
:root, [data-theme="dark"] {
  --bg:            #1c1c1e;
  --bg-elevated:   #2c2c2e;
  --bg-secondary:  #252528;
  --bg-tertiary:   #38383a;
  --bg-hover:      #3a3a3c;
  --bg-active:     #48484a;

  --surface:       rgba(44, 44, 46, 0.72);
  --surface-solid: #2c2c2e;

  --border:        rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --separator:     rgba(255, 255, 255, 0.06);

  --text:          #f5f5f7;
  --text-secondary:#a1a1a6;
  --text-tertiary: #6e6e73;
  --text-quaternary:#48484a;

  --blue:          #0a84ff;
  --green:         #30d158;
  --red:           #ff453a;
  --orange:        #ff9f0a;
  --purple:        #bf5af2;
  --teal:          #64d2ff;
  --indigo:        #5e5ce6;

  --accent:        var(--blue);
  --card-bg:       rgba(44, 44, 46, 0.55);
  --card-hover:    rgba(58, 58, 60, 0.65);
  --card-selected: rgba(10, 132, 255, 0.12);

  --tab-bg:        rgba(0, 0, 0, 0.1);
  --tab-active-bg: var(--bg-tertiary);
  --checklist-bg:  rgba(0, 0, 0, 0.08);
  --thinking-bg:   rgba(10, 132, 255, 0.06);
  --done-tint:     rgba(48, 209, 88, 0.04);
  --tool-bg:       rgba(10, 132, 255, 0.08);
  --tool-border:   rgba(10, 132, 255, 0.15);

  --scrollbar-thumb: rgba(255, 255, 255, 0.12);
  --scrollbar-hover: rgba(255, 255, 255, 0.22);
  --select-chevron:  %23a1a1a6;

  --shadow-sm:     0 1px 3px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.15);
  --shadow-md:     0 4px 12px rgba(0,0,0,0.25), 0 2px 4px rgba(0,0,0,0.15);
  --shadow-lg:     0 12px 40px rgba(0,0,0,0.35), 0 4px 12px rgba(0,0,0,0.2);
  --shadow-float:  0 20px 60px rgba(0,0,0,0.45), 0 8px 20px rgba(0,0,0,0.25);
  --accent-glow:   rgba(10, 132, 255, 0.3);
  --danger-glow:   rgba(255, 69, 58, 0.3);
  --warn-glow:     rgba(255, 159, 10, 0.3);
  --focus-ring:    rgba(10, 132, 255, 0.25);
  --selection-bg:  rgba(10, 132, 255, 0.35);

  --radius-sm:     8px;
  --radius-md:     12px;
  --radius-lg:     16px;
  --radius-xl:     20px;
}

/* ==========================================================================
   Light Theme
   ========================================================================== */
[data-theme="light"] {
  --bg:            #f5f5f7;
  --bg-elevated:   #ffffff;
  --bg-secondary:  #f0f0f2;
  --bg-tertiary:   #e8e8ed;
  --bg-hover:      #e0e0e5;
  --bg-active:     #d6d6db;

  --surface:       rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;

  --border:        rgba(0, 0, 0, 0.06);
  --border-strong: rgba(0, 0, 0, 0.12);
  --separator:     rgba(0, 0, 0, 0.05);

  --text:          #1d1d1f;
  --text-secondary:#6e6e73;
  --text-tertiary: #86868b;
  --text-quaternary:#aeaeb2;

  --blue:          #007aff;
  --green:         #28cd41;
  --red:           #ff3b30;
  --orange:        #ff9500;
  --purple:        #af52de;
  --teal:          #5ac8fa;
  --indigo:        #5856d6;

  --accent:        var(--blue);
  --card-bg:       rgba(255, 255, 255, 0.7);
  --card-hover:    rgba(255, 255, 255, 0.9);
  --card-selected: rgba(0, 122, 255, 0.08);

  --tab-bg:        rgba(0, 0, 0, 0.03);
  --tab-active-bg: #ffffff;
  --checklist-bg:  rgba(0, 0, 0, 0.02);
  --thinking-bg:   rgba(0, 122, 255, 0.04);
  --done-tint:     rgba(40, 205, 65, 0.04);
  --tool-bg:       rgba(0, 122, 255, 0.06);
  --tool-border:   rgba(0, 122, 255, 0.12);

  --scrollbar-thumb: rgba(0, 0, 0, 0.15);
  --scrollbar-hover: rgba(0, 0, 0, 0.25);
  --select-chevron:  %236e6e73;

  --shadow-sm:     0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:     0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg:     0 12px 40px rgba(0,0,0,0.1), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-float:  0 20px 60px rgba(0,0,0,0.15), 0 8px 20px rgba(0,0,0,0.08);
  --accent-glow:   rgba(0, 122, 255, 0.2);
  --danger-glow:   rgba(255, 59, 48, 0.2);
  --warn-glow:     rgba(255, 149, 0, 0.2);
  --focus-ring:    rgba(0, 122, 255, 0.3);
  --selection-bg:  rgba(0, 122, 255, 0.2);
}

/* ==========================================================================
   Global
   ========================================================================== */
html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.3s ease, color 0.3s ease;
}

body {
  display: grid;
  grid-template-columns: 72px 1fr;
}

/* ==========================================================================
   Nav Rail — Icon sidebar navigation
   ========================================================================== */
#nav-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 14px 10px;
  height: 100vh;
  z-index: 20;
  transition: background 0.3s ease;
}

.nav-logo {
  padding: 4px 0 14px;
  flex-shrink: 0;
}

.nav-logo img {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  padding: 3px;
}

[data-theme="dark"] .nav-logo img {
  filter: invert(1);
}

.nav-items {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 8px 8px;
  width: calc(100% - 12px);
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-item svg {
  flex-shrink: 0;
}

.nav-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1;
}

.nav-item:hover {
  color: var(--text-secondary);
  background: var(--bg-hover);
}

.nav-item.active {
  color: var(--accent);
  background: rgba(10, 132, 255, 0.1);
}

[data-theme="light"] .nav-item.active {
  background: rgba(0, 122, 255, 0.08);
}

.nav-social-link {
  text-decoration: none;
}

/* Nav status indicator dot */
.nav-status {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: none;
}

.nav-status[data-status="running"] {
  display: block;
  background: var(--accent);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.nav-status[data-status="done"] {
  display: block;
  background: var(--green);
}

.nav-status[data-status="error"] {
  display: block;
  background: var(--red);
}

.nav-bottom {
  flex-shrink: 0;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  align-self: stretch;
}

.nav-bottom .theme-toggle {
  transform: scale(0.85);
}

/* ==========================================================================
   App Container
   ========================================================================== */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ==========================================================================
   Top Bar (now embedded in chat header)
   ========================================================================== */

/* Hamburger hidden on desktop */
.mobile-hamburger {
  display: none;
}

.topbar-filter {
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-tertiary);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 4px 28px 4px 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23a1a1a6' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

[data-theme="light"] .topbar-filter {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236e6e73' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.topbar-filter:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.topbar-stats {
  display: flex;
  gap: 20px;
  align-items: center;
}

.stat {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 400;
}

.stat-val {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Theme Toggle — macOS-style pill switch
   ========================================================================== */
.theme-toggle {
  position: relative;
  width: 52px;
  height: 28px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  padding: 0 4px;
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--text-tertiary);
}

.theme-toggle-knob {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .theme-toggle-knob {
  transform: translateX(0);
}

[data-theme="light"] .theme-toggle-knob {
  transform: translateX(22px);
}

.theme-toggle-icons {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px;
  font-size: 12px;
  pointer-events: none;
}

/* ==========================================================================
   Main Layout — Two-panel (chat left, context right)
   ========================================================================== */
#main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ==========================================================================
   Chat Panel (left, 40%)
   ========================================================================== */
#chat-panel {
  flex: 4;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

#chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 0 16px;
  background: var(--surface);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 12px;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.chat-header-title {
  display: flex;
  flex-direction: column;
}

.chat-header-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
  line-height: 1.2;
}

.chat-header-stats {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.2;
}

.chat-header-role {
  font-size: 10px;
  color: var(--text-tertiary);
  line-height: 1.2;
}

.chat-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.chat-workspace-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(10, 132, 255, 0.1);
  padding: 3px 10px;
  border-radius: 12px;
  letter-spacing: -0.1px;
  white-space: nowrap;
}

/* Chat messages area */
#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

/* Chat input area */
#chat-input-area {
  padding: 0 16px 16px;
  flex-shrink: 0;
}

/* Launch bar (removed — pipelines now launched via chat commands) */

.launch-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-tertiary);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 5px 24px 5px 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23a1a1a6' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  transition: border-color 0.2s ease;
}

.launch-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.launch-input {
  background: var(--bg-tertiary);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 400;
  flex: 1;
  min-width: 80px;
  transition: border-color 0.2s ease;
}

.launch-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.launch-input::placeholder {
  color: var(--text-quaternary);
}

.launch-textarea {
  background: var(--bg-tertiary);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: 12px;
  font-family: inherit;
  flex: 1;
  min-width: 100px;
  resize: none;
  line-height: 1.5;
  transition: border-color 0.2s ease;
}

.launch-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.launch-textarea::placeholder {
  color: var(--text-quaternary);
}

.launch-num {
  background: var(--bg-tertiary);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 5px 2px;
  font-size: 12px;
  font-weight: 500;
  width: 40px;
  text-align: center;
  -moz-appearance: textfield;
}

.launch-num::-webkit-inner-spin-button,
.launch-num::-webkit-outer-spin-button {
  opacity: 1;
}

.launch-selected-issue {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--card-selected);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 11px;
}

.btn-launch-sm {
  padding: 5px 12px;
  font-size: 12px;
  white-space: nowrap;
}

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

.photo-dropzone-mini {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  transition: border-color 0.2s;
}

.photo-dropzone-mini:hover {
  border-color: var(--accent);
}

/* Vertical resize handle between panels */
.panel-resize-v {
  width: 6px;
  cursor: ew-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 5;
}

.resize-grip-v {
  width: 3px;
  height: 36px;
  border-radius: 2px;
  background: var(--text-quaternary);
  transition: background 0.2s ease;
}

.panel-resize-v:hover .resize-grip-v,
.panel-resize-v.dragging .resize-grip-v {
  background: var(--accent);
}

/* ==========================================================================
   Context Panel (right, 60%)
   ========================================================================== */
#context-panel {
  flex: 6;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border);
}

#context-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  flex-shrink: 0;
}

.context-tab {
  flex: 1;
  padding: 10px 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
  text-align: center;
}

.context-tab:hover {
  color: var(--text-secondary);
}

.context-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

#context-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.ctx-section {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.ctx-runs-inner {
  padding: 12px;
  overflow-y: auto;
  flex: 1;
}

.runs-section h3 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-tertiary);
  letter-spacing: 0.6px;
  margin-bottom: 8px;
  padding: 0 8px;
}

.runs-section + .runs-section:not(.hidden) {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--separator);
}

.runs-section ul {
  list-style: none;
}

.runs-section li {
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.15s ease, color 0.15s ease;
  color: var(--text);
}

.runs-section li:hover {
  background: var(--bg-hover);
}

.runs-section li.active {
  background: var(--accent);
  color: #fff;
}

.runs-section li.active .run-status {
  color: rgba(255, 255, 255, 0.7);
}

.runs-section li.active .run-label {
  color: #fff;
}

.runs-section li.batch-child {
  padding-left: 26px;
  font-size: 12px;
}

.runs-section li:hover .run-delete-btn { opacity: 1; }

/* Team section in context panel */
.ctx-team-section {
  padding: 12px;
  border-bottom: 1px solid var(--separator);
}

.ctx-team-toggle {
  font-size: 11px !important;
  font-weight: 600 !important;
  text-transform: uppercase;
  color: var(--text-tertiary) !important;
  letter-spacing: 0.6px;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.ctx-team-toggle:hover {
  background: var(--bg-hover);
}

/* Pipeline activity card in chat */
.chat-pipeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin: 4px 0;
  width: 100%;
  animation: chatFadeIn 0.2s ease;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.chat-pipeline-card:hover {
  border-color: var(--border-strong);
}

.chat-pipeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.chat-pipeline-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-pipeline-meta {
  font-size: 10px;
  color: var(--text-tertiary);
}

.chat-pipeline-stages {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-stage-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
  font-size: 12px;
}

.chat-stage-row:hover {
  background: var(--bg-hover);
}

.chat-stage-row.stage-running {
  background: rgba(10, 132, 255, 0.06);
}

.chat-stage-row.stage-done {
  opacity: 0.7;
}

.chat-stage-status {
  font-size: 11px;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
}

.chat-stage-name {
  font-weight: 500;
  color: var(--text);
  flex: 1;
}

.chat-stage-cost {
  font-size: 10px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

/* Sidebar section styles (reused in context panel) */

.sidebar-section h3 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-tertiary);
  letter-spacing: 0.6px;
  margin-bottom: 8px;
  padding: 0 8px;
}

/* Collapsible sections */
.section-toggle {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: var(--radius-sm);
  padding: 4px 8px !important;
  margin: -4px 0 8px 0 !important;
  transition: background 0.15s ease;
}

.section-toggle:hover {
  background: var(--bg-hover);
}

.toggle-arrow {
  font-size: 10px;
  transition: transform 0.2s ease;
}

.collapsible.collapsed .toggle-arrow {
  transform: rotate(-90deg);
}

.collapsible.collapsed .section-body {
  display: none;
}

.sidebar-section + .sidebar-section:not(.hidden) {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--separator);
}

/* Reset separator when previous sibling is hidden */
.sidebar-section.hidden + .sidebar-section:not(.hidden) {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

#sidebar ul {
  list-style: none;
}

#sidebar li {
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.15s ease, color 0.15s ease;
  color: var(--text);
}

#sidebar li:hover {
  background: var(--bg-hover);
}

#sidebar li.active {
  background: var(--accent);
  color: #fff;
}

#sidebar li.active .run-status {
  color: rgba(255, 255, 255, 0.7);
}

#sidebar li.active .run-label {
  color: #fff;
}

.site-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px currentColor;
}

.run-status {
  margin-left: auto;
  font-size: 11px;
  flex-shrink: 0;
}

.run-status.running { color: var(--blue); }
.run-status.done { color: var(--green); }
.run-status.failed, .run-status.checklist-failed { color: var(--red); }
.run-status.stopped { color: var(--text-tertiary); }

.run-label {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  color: var(--text);
}

/* ==========================================================================
   Kanban Board
   ========================================================================== */
#kanban {
  overflow: hidden;
  padding: 16px;
  background: var(--bg);
  transition: background 0.3s ease;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.content-kanban-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
  flex-shrink: 0;
}

#kanban .kanban-columns {
  flex: 1;
  min-height: 0;
}

#kanban .kanban-col-body {
  padding: 12px;
  gap: 12px;
}

.kanban-columns {
  display: flex;
  gap: 10px;
  height: 100%;
}

.kanban-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: background 0.3s ease;
}

.kanban-col-header {
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.kanban-col-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.col-count {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-quaternary);
  background: var(--bg-tertiary);
  padding: 0 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.kanban-col.done-col {
  background: var(--done-tint);
}

/* Outreach lifecycle column header accents */
.outreach-col-queued .kanban-col-header {
  border-bottom-color: var(--text-quaternary);
}
.outreach-col-sent .kanban-col-header {
  border-bottom: 2px solid var(--blue);
  color: var(--blue);
}
.outreach-col-opened .kanban-col-header {
  border-bottom: 2px solid var(--purple);
  color: var(--purple);
}
.outreach-col-replied .kanban-col-header {
  border-bottom: 2px solid var(--green);
  color: var(--green);
}
.outreach-col-following-up .kanban-col-header {
  border-bottom: 2px solid #f0a030;
  color: #f0a030;
}
.outreach-col-won .kanban-col-header {
  border-bottom: 2px solid var(--green);
  color: var(--green);
}
.outreach-col-lost .kanban-col-header {
  border-bottom: 2px solid var(--text-quaternary);
  color: var(--text-quaternary);
}

/* ==========================================================================
   Pipeline Card
   ========================================================================== */
.pipeline-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  border-left: 3px solid var(--text-tertiary);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.pipeline-card:hover {
  background: var(--card-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.pipeline-card.selected {
  background: var(--card-selected);
  box-shadow: 0 0 0 1.5px var(--accent), var(--shadow-md);
}

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

.card-site {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.1px;
}

.card-id {
  font-size: 10px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.card-status {
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
}

.card-type {
  font-size: 10px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.card-topic {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-stage {
  font-size: 10px;
  color: var(--text-tertiary);
  font-weight: 500;
}

/* ==========================================================================
   Pulsing dot
   ========================================================================== */
.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.4); }
}

.status-icon.done { color: var(--green); }
.status-icon.failed, .status-icon.checklist-failed { color: var(--red); }
.status-icon.stopped { color: var(--text-tertiary); }
.status-icon.pending { color: var(--text-quaternary); }

/* ==========================================================================
   Batch Badge & Batch Sidebar
   ========================================================================== */
.batch-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border-radius: 10px;
  padding: 1px 6px;
  margin-left: 4px;
  vertical-align: middle;
  letter-spacing: 0.2px;
}

.batch-index {
  font-size: 10px;
  color: var(--text-tertiary);
  font-weight: 500;
  margin-left: auto;
  margin-right: 4px;
  flex-shrink: 0;
}

#sidebar li.batch-child {
  padding-left: 26px;
  font-size: 12px;
}

.run-status.pending { color: var(--text-quaternary); }

/* ==========================================================================
   Bottom Output Panel
   ========================================================================== */
/* Output panel is now inside context panel, no longer a bottom panel */

#pipeline-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

#output-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
}

#output-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

#output-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  margin-left: 8px;
}

/* ==========================================================================
   Stage Tabs — Segmented control
   ========================================================================== */
#stage-tabs {
  display: flex;
  gap: 2px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  flex-shrink: 0;
  background: var(--tab-bg);
}

#stage-tabs:empty {
  padding: 0;
  border-bottom: none;
  background: none;
}

.stage-tab {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: all 0.2s ease;
  border: none;
  background: transparent;
}

.stage-tab:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.stage-tab.active {
  color: var(--text);
  background: var(--tab-active-bg);
  box-shadow: var(--shadow-sm);
}

/* Stage status indicators handled by avatar glow effects */

/* ==========================================================================
   Thinking Indicator
   ========================================================================== */
#output-thinking {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  background: var(--thinking-bg);
  border-bottom: 1px solid var(--border);
  animation: thinking-glow 2s ease-in-out infinite;
}

@keyframes thinking-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ==========================================================================
   Output Content
   ========================================================================== */
#output-content {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
}

#output-text {
  font-family: 'SF Mono', 'Menlo', 'Monaco', 'Cascadia Code', 'Fira Code', monospace;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  tab-size: 2;
}

/* ==========================================================================
   Checklist Panel
   ========================================================================== */
#checklist-panel {
  border-top: 1px solid var(--border);
  padding: 14px 16px;
  max-height: 250px;
  overflow-y: auto;
  flex-shrink: 0;
  background: var(--checklist-bg);
}

#checklist-panel h4 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

#checklist-items {
  list-style: none;
}

#checklist-items li {
  padding: 5px 0;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-icon {
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  font-size: 13px;
}

.check-icon.pass { color: var(--green); }
.check-icon.fail { color: var(--red); }

.check-name {
  color: var(--text);
  min-width: 130px;
  font-weight: 500;
}

.check-detail {
  color: var(--text-secondary);
  font-size: 12px;
}

#checklist-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

/* ==========================================================================
   Sidebar Launch Controls
   ========================================================================== */
.launch-section {
  padding-top: 16px !important;
}

.launch-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 4px;
}

.launch-row {
  display: flex;
  gap: 6px;
}

.launch-controls select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  background: var(--bg-tertiary);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 7px 28px 7px 10px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23a1a1a6' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.launch-row select {
  flex: 1;
  min-width: 0;
}

[data-theme="light"] .launch-controls select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236e6e73' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.launch-controls select:focus,
.launch-controls input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.launch-controls input[type="number"] {
  background: var(--bg-tertiary);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 7px 4px;
  font-size: 13px;
  font-weight: 500;
  width: 48px;
  text-align: center;
  flex-shrink: 0;
  -moz-appearance: textfield;
}

.launch-controls input[type="number"]::-webkit-inner-spin-button,
.launch-controls input[type="number"]::-webkit-outer-spin-button {
  opacity: 1;
}

.btn-launch-full {
  width: 100%;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  padding: 7px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: -0.1px;
}

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

.btn:active {
  transform: translateY(0);
  filter: brightness(0.95);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 4px var(--accent-glow);
}

.btn-primary:hover {
  box-shadow: 0 2px 8px var(--accent-glow);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn-danger {
  background: var(--red);
  color: #fff;
  box-shadow: 0 1px 4px var(--danger-glow);
}

.btn-warn {
  background: var(--orange);
  color: #000;
  box-shadow: 0 1px 4px var(--warn-glow);
}

/* ==========================================================================
   Icon Buttons
   ========================================================================== */
.btn-icon {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  line-height: 1;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  color: var(--text);
  background: var(--bg-hover);
}

/* Panel toggle and old resize handle removed — now using vertical panel resize */

/* ==========================================================================
   Panel Toolbar
   ========================================================================== */
#panel-toolbar {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* ==========================================================================
   Context Menu — macOS-style
   ========================================================================== */
.context-menu {
  position: fixed;
  background: var(--surface-solid);
  backdrop-filter: saturate(180%) blur(30px);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 5px;
  min-width: 180px;
  z-index: 1000;
  box-shadow: var(--shadow-float);
  animation: contextFadeIn 0.12s ease-out;
}

@keyframes contextFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.context-item {
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.1s ease;
}

.context-item:hover {
  background: var(--accent);
  color: #fff;
}

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

.context-item.context-danger:hover {
  background: var(--red);
  color: #fff;
}

.context-item.context-warn {
  color: var(--orange);
}

.context-item.context-warn:hover {
  background: var(--orange);
  color: #000;
}

/* ==========================================================================
   Tool Indicator
   ========================================================================== */
.tool-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  background: var(--tool-bg);
  border: 1px solid var(--tool-border);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  margin-top: 4px;
}

.tool-indicator::before {
  content: "\2699";
}

#current-tool {
  padding: 0 16px;
  min-height: 24px;
  display: flex;
  align-items: center;
}

/* ==========================================================================
   Persona Avatars
   ========================================================================== */
.persona-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.3px;
  flex-shrink: 0;
  line-height: 1;
}

/* ==========================================================================
   Team Strip
   ========================================================================== */
#team-strip {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.team-member {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  opacity: 0.5;
  transition: opacity 0.3s ease, background 0.15s ease;
}

.team-member:hover {
  background: var(--bg-hover);
  opacity: 0.8;
}

.team-member.active {
  opacity: 1;
}

.team-member.selected {
  opacity: 1;
  background: var(--card-selected);
}

.team-member.active .persona-avatar {
  box-shadow: 0 0 8px currentColor;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.team-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.team-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.team-title {
  font-size: 10px;
  color: var(--text-tertiary);
  line-height: 1.3;
}

/* ==========================================================================
   Card Worker Row (persona on running cards)
   ========================================================================== */
.card-worker {
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-worker-name {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.pulse-dot-sm {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  margin-left: 2px;
}

/* ==========================================================================
   Stage Tabs with Avatars
   ========================================================================== */
.stage-tab {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Override the ::before pseudo-elements since we now use inline avatars */
.stage-tab.done .persona-avatar {
  box-shadow: 0 0 4px var(--green);
}

.stage-tab.failed .persona-avatar {
  box-shadow: 0 0 4px var(--red);
}

.stage-tab.running .persona-avatar {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ==========================================================================
   Kanban Column Headers with Avatars
   ========================================================================== */
.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ==========================================================================
   Thinking Indicator with Persona
   ========================================================================== */
#output-thinking {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================================================
   Empty State
   ========================================================================== */
.empty-state {
  color: var(--text-tertiary);
  font-size: 13px;
  text-align: center;
  padding: 24px 12px;
  font-weight: 500;
}

/* ==========================================================================
   Utility
   ========================================================================== */
.hidden { display: none !important; }

/* ==========================================================================
   Scrollbar
   ========================================================================== */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-hover);
}

#sidebar, .kanban-col-body, #output-content, #checklist-panel {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

#sidebar:hover, .kanban-col-body:hover, #output-content:hover, #checklist-panel:hover {
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

/* ==========================================================================
   Agent Profile Panel
   ========================================================================== */
#agent-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

#agent-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

#agent-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

#agent-header-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#agent-display-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

#agent-display-title {
  font-size: 12px;
  color: var(--text-secondary);
}

#agent-settings {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.agent-field-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.agent-field-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.agent-input {
  background: var(--bg-tertiary);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 500;
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.agent-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.agent-input-sm {
  max-width: 60px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

.agent-color-input {
  width: 40px;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  cursor: pointer;
}

.agent-field-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-sm {
  padding: 5px 14px;
  font-size: 12px;
}

.save-status {
  font-size: 12px;
  color: var(--green);
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.save-status.visible {
  opacity: 1;
}

/* Agent Prompt Editor */
#agent-prompt-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

#agent-prompt-header {
  padding: 12px 16px 8px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-shrink: 0;
}

#agent-prompt-header h4 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-tertiary);
  letter-spacing: 0.5px;
}

.prompt-path {
  font-size: 10px;
  color: var(--text-quaternary);
  font-family: 'SF Mono', 'Menlo', monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#agent-prompt-wrap {
  flex: 1;
  padding: 0 16px;
  min-height: 0;
  overflow: hidden;
}

.agent-prompt-editor {
  width: 100%;
  height: 100%;
  background: var(--bg-secondary);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: 'SF Mono', 'Menlo', 'Monaco', 'Cascadia Code', monospace;
  font-size: 12px;
  line-height: 1.6;
  resize: none;
  tab-size: 2;
  white-space: pre-wrap;
  word-break: break-word;
}

.agent-prompt-editor:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.agent-prompt-editor.no-prompt {
  color: var(--text-tertiary);
  font-style: italic;
}

#agent-prompt-actions {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
}

/* ==========================================================================
   Selection
   ========================================================================== */
::selection {
  background: var(--selection-bg);
  color: var(--text);
}

/* View tabs removed — now using nav-rail icons */

/* ==========================================================================
   Engineering Kanban
   ========================================================================== */
#eng-kanban {
  overflow: hidden;
  padding: 16px;
  background: var(--bg);
  transition: background 0.3s ease;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.eng-kanban-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.outreach-kanban-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
  flex-shrink: 0;
}

#outreach-board .kanban-columns {
  flex: 1;
  min-height: 0;
}

#eng-kanban .kanban-columns {
  flex: 1;
  min-height: 0;
}

#eng-kanban .kanban-col-body {
  padding: 12px;
  gap: 12px;
}

/* Issue Card */
.issue-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  border: 1px solid var(--border);
}

.issue-card:hover {
  background: var(--card-hover);
  border-color: var(--border-strong);
}

.issue-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.issue-card-site {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.issue-card-site .site-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.issue-card-number {
  font-size: 9px;
  color: var(--text-quaternary);
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  opacity: 0.6;
}

.issue-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  letter-spacing: -0.1px;
}

.issue-card-status-line {
  font-size: 10px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.issue-card-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.issue-badge {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.1px;
}

.issue-badge-type {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.issue-badge-type[data-type="Bug"] {
  background: rgba(255, 69, 58, 0.10);
  color: var(--red);
}

.issue-badge-type[data-type="Feature"] {
  background: rgba(10, 132, 255, 0.10);
  color: var(--accent);
}

.issue-badge-type[data-type="Infra"] {
  background: rgba(94, 92, 230, 0.10);
  color: var(--indigo);
}

.issue-badge-type[data-type="Refactor"] {
  background: rgba(191, 90, 242, 0.10);
  color: var(--purple);
}

.issue-badge-priority {
  background: var(--bg-tertiary);
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.issue-badge-priority[data-priority="P0"] {
  background: rgba(255, 69, 58, 0.10);
  color: var(--red);
}

.issue-badge-priority[data-priority="P1"] {
  background: rgba(255, 159, 10, 0.10);
  color: var(--orange);
}

.issue-card-link {
  font-size: 11px;
  color: var(--text-quaternary);
  text-decoration: none;
  margin-left: auto;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.15s ease, background 0.15s ease;
  opacity: 0;
}

.issue-card:hover .issue-card-link {
  opacity: 1;
}

.issue-card-link:hover {
  color: var(--accent);
  background: var(--bg-hover);
}

/* Engineering team strip reuses #team-strip styles */
#eng-team-strip {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Engineering launch controls */
.eng-prompt-textarea {
  background: var(--bg-tertiary);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 400;
  width: 100%;
  resize: vertical;
  min-height: 60px;
  max-height: 160px;
  line-height: 1.5;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.eng-prompt-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.eng-prompt-textarea::placeholder {
  color: var(--text-quaternary);
}

/* Selected issue in launch area */
.eng-selected-issue {
  background: var(--card-selected);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.eng-selected-header {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.eng-selected-site {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
  flex-shrink: 0;
  padding-top: 2px;
}

.eng-selected-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.btn-deselect {
  flex-shrink: 0;
  font-size: 14px;
  padding: 0 4px;
  margin: -2px -4px 0 0;
}

.eng-selected-meta {
  display: block;
  font-size: 10px;
  color: var(--text-tertiary);
  margin-top: 4px;
  font-family: 'SF Mono', 'Menlo', monospace;
}

/* Selected issue card on the kanban */
.issue-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  background: var(--card-selected);
}

#eng-runs-list .empty-hint {
  color: var(--text-quaternary);
  font-size: 12px;
  font-style: italic;
  padding: 6px 10px;
  cursor: default;
}

#eng-runs-list .empty-hint:hover {
  background: none;
}

/* ==========================================================================
   Deploy Panel (Right Sidebar)
   ========================================================================== */
#deploy-view-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 48px;
  gap: 8px;
}

#deploy-view-title-wrap {
  min-width: 0;
}

#deploy-site-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

#deploy-site-meta {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
  font-family: 'SF Mono', 'Menlo', monospace;
}

#deploy-view-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Deploy Changes */
#deploy-changes-section h4,
#deploy-preflight-results h4,
#deploy-progress-section h4,
#deploy-history-section h4 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-tertiary);
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.deploy-commit-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.deploy-commit {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 10px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.commit-hash {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 11px;
  color: var(--accent);
  flex-shrink: 0;
}

.commit-msg {
  font-size: 13px;
  color: var(--text);
}

.deploy-unpushed {
  font-size: 12px;
  color: var(--orange);
  padding: 6px 10px;
  background: rgba(255, 159, 10, 0.08);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 159, 10, 0.15);
}

.deploy-file-list {
  margin-top: 8px;
}

.deploy-file-header {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.deploy-file {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 11px;
  color: var(--text-secondary);
  padding: 3px 10px;
  line-height: 1.5;
}

.deploy-empty {
  color: var(--text-tertiary);
  font-size: 13px;
  padding: 12px 0;
  font-style: italic;
}

/* Deploy Action Bar */
#deploy-action-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.deploy-input {
  background: var(--bg-tertiary);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 400;
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.deploy-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.deploy-input::placeholder {
  color: var(--text-quaternary);
}

#deploy-buttons {
  display: flex;
  gap: 8px;
}

/* Preflight Results */
#preflight-list {
  list-style: none;
}

#preflight-list li {
  padding: 5px 0;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.preflight-loading {
  color: var(--accent);
  font-style: italic;
}

.preflight-error {
  color: var(--red);
}

/* Deploy Progress */
#deploy-progress-list {
  list-style: none;
}

#deploy-progress-list li {
  padding: 5px 0;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-step {
  font-weight: 600;
  color: var(--text);
  min-width: 80px;
  text-transform: capitalize;
}

.progress-detail {
  color: var(--text-secondary);
  font-size: 12px;
}

.check-icon.warn { color: var(--orange); }
.check-icon.running { color: var(--accent); animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }


/* ==========================================================================
   Deploy View (Right Sidebar)
   ========================================================================== */
#deploy-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

#deploy-history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.deploy-history-entry {
  padding: 10px 12px;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.history-entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.history-tag {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.history-status {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1px 8px;
  border-radius: 10px;
}

.history-status.success {
  color: var(--green);
  background: rgba(48, 209, 88, 0.1);
}

.history-status.warning {
  color: var(--orange);
  background: rgba(255, 159, 10, 0.1);
}

.history-status.error {
  color: var(--red);
  background: rgba(255, 69, 58, 0.1);
}

.history-entry-meta {
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
}

.history-time {
  font-size: 11px;
  color: var(--text-tertiary);
}

.history-duration {
  font-size: 11px;
  color: var(--text-quaternary);
}

.history-rollback-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--orange);
  background: rgba(255, 159, 10, 0.1);
  padding: 1px 6px;
  border-radius: 8px;
  letter-spacing: 0.3px;
}

.history-entry-msg {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  line-height: 1.4;
}

.btn-rollback {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 3px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-rollback:hover {
  color: var(--orange);
  border-color: var(--orange);
  background: rgba(255, 159, 10, 0.06);
}

/* ==========================================================================
   Chat — Main panel styles (replaces floating widget)
   ========================================================================== */

/* (chat-welcome removed — replaced by quick-actions cards) */

.chat-msg {
  display: flex;
  animation: chatFadeIn 0.2s ease;
}

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

.chat-msg-user {
  justify-content: flex-end;
}

.chat-msg-assistant {
  justify-content: flex-start;
}

.chat-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.55;
  word-wrap: break-word;
}

.chat-bubble code {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.15);
  padding: 1px 5px;
  border-radius: 4px;
}

.chat-bubble-user {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
  white-space: pre-wrap;
}

.chat-bubble-assistant {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  position: relative;
}

.btn-copy-chat {
  position: absolute;
  top: 6px;
  right: 6px;
  background: none;
  border: none;
  color: var(--text-quaternary);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease;
  display: flex;
  align-items: center;
}

.chat-bubble-assistant:hover .btn-copy-chat {
  opacity: 1;
}

.btn-copy-chat:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.chat-error {
  color: var(--red);
}

/* Chat tool call cards */
.chat-tool-card {
  margin: 4px 0;
  padding: 8px 12px;
  background: var(--tool-bg);
  border: 1px solid var(--tool-border);
  border-radius: 10px;
  font-size: 12px;
  max-width: 85%;
  animation: chatFadeIn 0.2s ease;
}

.chat-tool-header {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-weight: 500;
}

.chat-tool-icon {
  font-size: 13px;
}

.chat-tool-label {
  flex: 1;
}

.chat-tool-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: chatSpin 0.8s linear infinite;
  flex-shrink: 0;
}

.chat-tool-spinner.done {
  animation: none;
  border: none;
  color: var(--green);
  font-size: 12px;
  width: auto;
  height: auto;
  font-weight: 600;
}

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

.chat-tool-detail {
  color: var(--text-tertiary);
  font-size: 11px;
  margin-top: 3px;
  font-family: 'SF Mono', 'Menlo', monospace;
}

/* Thinking dots */
.chat-thinking-dots {
  display: inline-flex;
  gap: 4px;
  padding: 4px 0;
}

.chat-thinking-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-tertiary);
  animation: chatDotPulse 1.4s ease-in-out infinite;
}

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

@keyframes chatDotPulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* Quick action cards in chat panel */
.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  max-height: 50vh;
  overflow-y: auto;
  flex-shrink: 0;
}
.quick-actions.collapsed {
  max-height: 0;
  padding: 0 16px;
  overflow: hidden;
  border-bottom: none;
}
.quick-actions.collapsed > *:not(#qa-collapse-bar) {
  display: none;
}

.qa-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  transition: border-color 0.15s;
}

.qa-card.hidden {
  display: none;
}

.qa-card:hover {
  border-color: var(--accent);
}

.qa-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

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

.qa-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.qa-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qa-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.qa-chip {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-strong, rgba(255,255,255,0.15));
  background: var(--surface, #1e1e2e);
  color: var(--text-muted, #999);
  transition: all 0.15s;
  user-select: none;
}

.qa-chip:hover {
  border-color: var(--accent);
}

.qa-chip.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.qa-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qa-num {
  width: 40px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 12px;
  text-align: center;
}

.qa-label {
  font-size: 11px;
  color: var(--text-secondary);
}

.qa-input-sm {
  width: 80px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
}

.qa-input {
  flex: 1;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
}

.qa-textarea {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  font-family: var(--font-sans);
  resize: vertical;
  min-height: 48px;
  max-height: 120px;
  margin-top: 6px;
  box-sizing: border-box;
}

.qa-textarea::placeholder,
.qa-input::placeholder,
.qa-input-sm::placeholder {
  color: var(--text-tertiary);
}

.qa-go {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.qa-go:hover {
  opacity: 0.9;
}

/* Chat input area */

.chat-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 6px 6px 6px 14px;
  transition: border-color 0.2s ease;
}

.chat-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.chat-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  line-height: 1.5;
  resize: none;
  padding: 6px 0;
  max-height: 120px;
}

.chat-input::placeholder {
  color: var(--text-tertiary);
}

.btn-chat-mic {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  border: none;
  background: none;
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.2s ease, background 0.2s ease;
}

.btn-chat-mic:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.btn-chat-mic.recording {
  color: #ff453a;
  background: rgba(255, 69, 58, 0.12);
  animation: mic-pulse 1.5s ease-in-out infinite;
}

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

.btn-chat-send {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}

.btn-chat-send:hover {
  opacity: 0.85;
}

.chat-input-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 6px;
}

.btn-chat-clear {
  font-size: 11px;
  color: var(--text-tertiary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 6px;
  transition: color 0.2s ease;
}

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

/* Chat photo attachment */
.btn-chat-attach {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  border: none;
  background: none;
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.2s ease, background 0.2s ease;
}

.btn-chat-attach:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.chat-photo-strip {
  display: flex;
  gap: 6px;
  padding: 6px 2px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.chat-photo-thumb {
  position: relative;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
}

.chat-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.chat-photo-remove {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.chat-photo-remove:hover {
  background: #ff453a;
}

.chat-bubble-photos {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.chat-bubble-photo {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
}

/* ==========================================================================
   Outreach Pipeline
   ========================================================================== */

/* Outreach Board */
#outreach-board {
  overflow: hidden;
  padding: 16px;
  background: var(--bg);
  transition: background 0.3s ease;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

#personal-board {
  overflow: hidden;
  padding: 16px;
  background: var(--bg);
  transition: background 0.3s ease;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.personal-kanban-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
  flex-shrink: 0;
}

#personal-board .kanban-columns {
  flex: 1;
  min-height: 0;
}

#personal-board .kanban-col-body {
  padding: 12px;
  gap: 12px;
}

.outreach-board-content {
  max-width: 800px;
  margin: 0 auto;
}

/* Outreach Campaign Cards */
.outreach-campaign-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  border-left: 3px solid #ff6b9d;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  box-shadow: var(--shadow-sm);
  margin-bottom: 10px;
}

.outreach-campaign-card:hover {
  background: var(--card-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.outreach-campaign-card.selected {
  background: var(--card-selected);
  box-shadow: 0 0 0 1.5px #ff6b9d, var(--shadow-md);
}

.outreach-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.outreach-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.2px;
}

.outreach-card-count {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.outreach-card-audience {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.outreach-card-channels {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.outreach-channel-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border-radius: 10px;
  padding: 2px 8px;
  text-transform: capitalize;
  letter-spacing: 0.2px;
}

/* Outreach Launch Form */
.outreach-launch-controls {
  gap: 8px;
}

.outreach-input {
  width: 100%;
  background: var(--bg-tertiary);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.outreach-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.outreach-input::placeholder {
  color: var(--text-quaternary);
  font-weight: 400;
}

.outreach-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.outreach-channel-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.outreach-channel-label input[type="checkbox"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.outreach-field-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  flex: 1;
}

#outreach-team-strip {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.empty-hint {
  color: var(--text-tertiary);
  font-size: 12px;
  text-align: center;
  padding: 12px 8px;
  font-weight: 400;
}

/* ==========================================================================
   Outreach Lab Panel
   ========================================================================== */
#outreach-lab-panel {
  border-top: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  max-height: 280px;
  overflow-y: auto;
  flex-shrink: 0;
}

.lab-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  z-index: 2;
}

.lab-panel-header h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.1px;
}

.lab-panel-tabs {
  display: flex;
  gap: 2px;
  background: var(--tab-bg);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.lab-tab {
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-tertiary);
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.lab-tab:hover {
  color: var(--text-secondary);
}

.lab-tab.active {
  color: var(--text);
  background: var(--tab-active-bg);
  box-shadow: var(--shadow-sm);
}

.lab-badge {
  font-size: 9px;
  font-weight: 700;
  background: var(--red);
  color: #fff;
  padding: 0 5px;
  border-radius: 8px;
  min-width: 16px;
  text-align: center;
  line-height: 16px;
}

.lab-badge:empty,
.lab-badge[data-count="0"] {
  display: none;
}

.lab-section {
  padding: 12px 16px;
}

/* Follow-Up Queue */
.followup-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  transition: background 0.15s ease;
}

.followup-card:hover {
  background: var(--card-hover);
}

.followup-info {
  flex: 1;
  min-width: 0;
}

.followup-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.followup-meta {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.followup-type {
  font-size: 10px;
  font-weight: 600;
  color: var(--purple);
  background: rgba(191, 90, 242, 0.1);
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.followup-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.followup-empty {
  color: var(--text-tertiary);
  font-size: 12px;
  text-align: center;
  padding: 20px 0;
}

/* Metrics Grid */
#outreach-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.metric-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.metric-card-header {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
}

.metric-card-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.metric-card-value .metric-unit {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  margin-left: 2px;
}

.metric-card-detail {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.metric-card.wide {
  grid-column: 1 / -1;
}

.metric-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.metric-table th {
  text-align: left;
  font-weight: 600;
  color: var(--text-tertiary);
  padding: 4px 8px 6px;
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.metric-table td {
  padding: 5px 8px;
  color: var(--text);
  border-bottom: 1px solid var(--separator);
}

.metric-table td:not(:first-child) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Prospect activity table */
.prospect-table td {
  text-align: left;
}

.prospect-table td:not(:first-child) {
  text-align: left;
}

.prospect-name-cell {
  font-weight: 600;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prospect-email-cell {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: var(--text-secondary);
}

.prospect-table tr[onclick]:hover {
  background: var(--card-hover);
}

.metric-bar {
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
  min-width: 40px;
}

.metric-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.metric-bar-fill.green { background: var(--green); }
.metric-bar-fill.purple { background: var(--purple); }

/* Result Badges on Kanban Cards */
.result-badge {
  font-size: 9px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.result-badge-queued {
  color: var(--text-tertiary);
  background: var(--bg-tertiary);
}

.result-badge-sent {
  color: var(--blue);
  background: rgba(10, 132, 255, 0.1);
}

.result-badge-opened {
  color: var(--purple);
  background: rgba(191, 90, 242, 0.1);
}

.result-badge-replied {
  color: var(--green);
  background: rgba(48, 209, 88, 0.1);
}

.result-badge-meeting {
  color: var(--purple);
  background: rgba(191, 90, 242, 0.15);
}

.result-badge-won {
  color: #d4a017;
  background: rgba(212, 160, 23, 0.12);
}

.result-badge-lost {
  color: var(--red);
  background: rgba(255, 69, 58, 0.1);
}

.result-badge-no-response {
  color: var(--text-quaternary);
  background: var(--bg-tertiary);
}

/* Gmail Status */
.gmail-status-wrap {
  padding: 0 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#gmail-status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

.gmail-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.gmail-disconnected .gmail-dot {
  background: var(--text-quaternary);
}

.gmail-connected .gmail-dot {
  background: var(--green);
}

.gmail-email {
  font-size: 11px;
  color: var(--text-tertiary);
  font-family: 'SF Mono', 'Menlo', monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Send button on issue cards */
.issue-card-send-btn {
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  transition: opacity 0.15s ease;
  opacity: 0;
}

.issue-card:hover .issue-card-send-btn {
  opacity: 1;
}

.issue-card-send-btn:hover {
  filter: brightness(1.1);
}

/* Draft Ready badge */
.result-badge-draft-ready {
  color: #e67e22;
  background: rgba(230, 126, 34, 0.12);
  animation: pulse-badge 2s ease-in-out infinite;
}

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

/* Review button on cards */
.issue-card-review-btn {
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: #e67e22;
  border: none;
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  transition: opacity 0.15s ease;
  animation: pulse-badge 2s ease-in-out infinite;
}

.issue-card-review-btn:hover {
  filter: brightness(1.1);
}

/* Conversation Drawer */
#conversation-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 440px;
  max-width: 100vw;
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 100;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.25s ease;
}

#conversation-drawer.open {
  transform: translateX(0);
}

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

.drawer-header-info {
  min-width: 0;
  flex: 1;
}

.drawer-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-meta {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Drawer tab toggle */
.drawer-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer-tab {
  flex: 1;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.drawer-tab:hover {
  color: var(--text-secondary);
}
.drawer-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Drawer details view */
.drawer-details {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.detail-section {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}
.detail-section-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}
.detail-row + .detail-row {
  border-top: 1px solid var(--border);
}
.detail-label {
  font-size: 12px;
  color: var(--text-tertiary);
}
.detail-value {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
}
.detail-subject {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.detail-body {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-word;
}
.detail-link {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
  display: inline-block;
}
.detail-link:hover {
  text-decoration: underline;
}
.detail-hook-used {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.detail-hook {
  padding: 8px 0;
}
.detail-hook + .detail-hook {
  border-top: 1px solid var(--border);
}
.detail-hook-type {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  margin-right: 6px;
}
.detail-hook-source {
  font-size: 10px;
  color: var(--text-tertiary);
}
.detail-hook-detail {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.5;
}

.drawer-conversation {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Email thread messages */
.conv-message {
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  border-radius: var(--radius-md);
}

.conv-message-us {
  background: var(--surface);
  border-left: 3px solid var(--accent);
}

.conv-message-prospect {
  background: var(--bg-elevated);
  border-left: 3px solid #e67e22;
}

.conv-message-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.conv-message-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.conv-message-us .conv-message-label {
  color: var(--accent);
}

.conv-message-prospect .conv-message-label {
  color: #e67e22;
}

.conv-message-date {
  font-size: 10px;
  color: var(--text-quaternary);
}

.conv-message-subject {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.conv-message-body {
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

/* Draft area */
.drawer-draft-area {
  border-top: 1px solid var(--border);
  padding: 14px 16px;
  flex-shrink: 0;
  background: var(--bg-elevated);
}

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

.draft-label {
  font-size: 11px;
  font-weight: 600;
  color: #e67e22;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.drawer-draft-textarea {
  width: 100%;
  min-height: 120px;
  max-height: 200px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  resize: vertical;
  box-sizing: border-box;
}

.drawer-draft-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.draft-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* Review Queue */
.review-queue-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.review-queue-card:hover {
  background: var(--card-hover);
}

.review-queue-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.review-queue-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.review-queue-card-time {
  font-size: 10px;
  color: var(--text-quaternary);
  flex-shrink: 0;
}

.review-queue-snippet {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-queue-snippet-label {
  font-weight: 600;
  color: var(--text-secondary);
}

.review-queue-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.review-queue-empty {
  color: var(--text-tertiary);
  font-size: 12px;
  text-align: center;
  padding: 20px 0;
}

/* Drawer backdrop */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.drawer-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-backdrop {
  display: none;
}

.mobile-hamburger {
  display: none;
}

/* ==========================================================================
   Mobile — PWA responsive layout
   ========================================================================== */
@media (max-width: 768px) {

  /* --- Body grid: remove nav-rail column, add row for bottom tabs --- */
  body {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }

  #app {
    height: auto;
    min-height: 0;
    overflow: auto;
  }

  /* --- Nav Rail → Bottom Tab Bar --- */
  #nav-rail {
    order: 2;
    flex-direction: row;
    height: auto;
    width: 100%;
    border-right: none;
    border-top: 1px solid var(--border);
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around;
  }

  .nav-logo { display: none; }

  .nav-items {
    flex-direction: row;
    gap: 0;
    flex: 1;
    justify-content: space-evenly;
  }

  .nav-item {
    min-height: 44px;
    min-width: 44px;
    width: auto;
  }

  .nav-bottom {
    display: flex;
    align-items: center;
    padding: 0 8px;
  }

  /* --- Chat header --- */
  #chat-header {
    padding-top: env(safe-area-inset-top);
  }

  .topbar-stats { display: none; }
  .topbar-filter { display: none; }

  /* --- Hamburger button --- */
  .mobile-hamburger {
    display: flex;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    min-height: 44px;
    min-width: 44px;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-right: 8px;
  }

  /* --- Two-panel → Stack vertically --- */
  #main {
    flex-direction: column;
  }

  #chat-panel {
    flex: 1;
  }

  #context-panel {
    flex: 0;
    max-height: 50vh;
    border-left: none;
    border-top: 1px solid var(--border);
  }

  #context-panel.mobile-expanded {
    flex: 1;
  }

  .panel-resize-v {
    display: none;
  }

  /* --- Kanban → Horizontal Swipe --- */
  .kanban-columns {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .kanban-col {
    flex: 0 0 85vw;
    scroll-snap-align: start;
  }

  /* --- Conversation Drawer → Full-Width --- */
  #conversation-drawer {
    width: 100vw;
  }

  #chat-input-area {
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }

  /* --- Touch Targets --- */
  .btn, .btn-icon, .nav-item, .lab-tab, .drawer-tab {
    min-height: 44px;
  }

  /* Show hover-only elements always on touch */
  .issue-card-link {
    opacity: 1;
  }

  .issue-card-send-btn {
    opacity: 1;
  }
}

/* ==========================================================================
   Personal Pipeline — Photo Dropzone & Approval UI
   ========================================================================== */

/* Photo dropzone */
.photo-dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--bg-secondary);
}

.photo-dropzone:hover,
.photo-dropzone.drag-over {
  border-color: var(--accent);
  background: var(--card-selected);
}

.dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
}

.dropzone-content svg {
  color: var(--text-tertiary);
}

/* Photo preview grid */
.photo-preview-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.photo-preview-grid:empty {
  display: none;
}

.photo-preview-item {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.photo-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-preview-item .photo-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  padding: 0;
  opacity: 0;
  transition: opacity 0.15s;
}

.photo-preview-item:hover .photo-remove {
  opacity: 1;
}

/* Auto-submit checkbox */
.personal-auto-submit {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 0;
}

.personal-auto-submit input[type="checkbox"] {
  accent-color: var(--accent);
}

/* Listing Approval Panel */
#listing-approval-panel {
  padding: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin: 12px;
  border: 1px solid var(--border-strong);
}

#listing-approval-panel h4 {
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
}

.approval-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.approval-field > span {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.approval-input {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}

.approval-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.approval-row {
  display: flex;
  gap: 10px;
}

.approval-row .approval-field {
  flex: 1;
}

.approval-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.approval-actions .btn {
  flex: 1;
}

/* Personal launch controls */
.personal-launch-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ==========================================================================
   Fair Value Screener
   ========================================================================== */
#fair-value-panel {
  border-top: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  max-height: 400px;
  overflow-y: auto;
  flex-shrink: 0;
}

.fv-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  z-index: 2;
}

.fv-panel-header h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.1px;
}

.fv-panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fv-status {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 500;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fv-summary {
  padding: 8px 16px;
}

.fv-summary-grid {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.fv-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.fv-stat-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.fv-stat-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.fv-table-container {
  overflow-x: auto;
  padding: 0 16px 12px;
}

.fv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.fv-table thead th {
  text-align: left;
  font-weight: 600;
  color: var(--text-tertiary);
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
  user-select: none;
}

.fv-sortable {
  cursor: pointer;
  transition: color 0.15s;
}

.fv-sortable:hover {
  color: var(--text-secondary);
}

.fv-sortable::after {
  content: "";
  display: inline-block;
  margin-left: 4px;
  width: 0;
  height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
  vertical-align: middle;
}

.fv-sort-active::after {
  border-top: 4px solid var(--accent);
}

.fv-sort-active.fv-sort-asc::after {
  border-top: none;
  border-bottom: 4px solid var(--accent);
}

.fv-table tbody td {
  padding: 5px 8px;
  color: var(--text);
  border-bottom: 1px solid var(--separator);
  font-variant-numeric: tabular-nums;
}

.fv-table tbody tr:hover {
  background: var(--card-hover);
}

.fv-right {
  text-align: right;
}

.fv-symbol {
  font-weight: 600;
  color: var(--accent);
}

.fv-name {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}

.fv-industry {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
  font-size: 11px;
}

.fv-green {
  color: var(--green);
  font-weight: 600;
}

.fv-yellow {
  color: var(--orange);
  font-weight: 600;
}

.fv-red {
  color: var(--red);
  font-weight: 600;
}

.fv-empty {
  text-align: center;
  color: var(--text-tertiary);
  padding: 20px 0;
  font-size: 12px;
}

.fv-report-link {
  color: var(--blue);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}

.fv-report-link:hover {
  text-decoration: underline;
}

.fv-no-report {
  color: var(--text-tertiary);
  font-size: 12px;
}

.fv-delete-btn {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}

.fv-delete-btn:hover {
  color: var(--red);
  background: rgba(255, 69, 58, 0.1);
}

@media (max-width: 768px) {
  #fair-value-panel,
  #finance-results-panel {
    position: fixed;
    bottom: calc(52px + env(safe-area-inset-bottom));
    left: 0;
    right: 0;
    max-height: 50vh;
    z-index: 40;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
  }
}

/* ==========================================================================
   Finance Results Panel
   ========================================================================== */
#finance-results-panel {
  border-top: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  max-height: 400px;
  overflow-y: auto;
  flex-shrink: 0;
}

/* ==========================================================================
   Video Pipeline Panel
   ========================================================================== */
#video-pipeline-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

/* ==========================================================================
   Video Pipeline - Sidebar
   ========================================================================== */

/* Mode tabs (Freeform / Template / Blog Video) */
.video-mode-tabs {
  display: flex;
  gap: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.video-mode-tab {
  flex: 1;
  padding: 5px 4px;
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  text-align: center;
}

.video-mode-tab:not(:last-child) {
  border-right: 1px solid var(--border-strong);
}

.video-mode-tab:hover {
  background: var(--bg-hover);
}

.video-mode-tab.active {
  background: var(--accent);
  color: #fff;
}

/* Mode card (each mode's controls) */
.video-mode-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.video-template-actions {
  display: flex;
  gap: 6px;
}

.video-template-actions .btn {
  flex: 1;
}

/* Viable templates list */
.video-viable-header {
  padding: 8px 0 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.video-viable-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.video-viable-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.video-viable-list li {
  padding: 4px 0;
  cursor: pointer;
  font-size: 11px;
  color: var(--text-secondary);
  transition: color 0.15s;
}

.video-viable-list li:hover {
  color: var(--accent);
}

/* Blog posts list */
.video-blog-posts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.video-blog-posts-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.video-blog-posts-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 150px;
  overflow-y: auto;
}

.video-blog-posts-list li {
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 11px;
  color: var(--text-secondary);
  transition: color 0.15s;
}

.video-blog-posts-list li:hover {
  color: var(--accent);
}

.video-blog-post-meta {
  color: var(--text-muted);
  font-size: 10px;
  display: block;
  margin-top: 2px;
}

/* Run items - disk badge */
.run-badge-disk {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  border: 1px solid var(--border);
}

.run-badge-mode {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 4px;
}

.run-delete-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  margin-left: auto;
}
#sidebar li:hover .run-delete-btn { opacity: 1; }
.run-delete-btn:hover { color: var(--red); }

/* ==========================================================================
   Video Pipeline - Main Panel
   ========================================================================== */

/* Panel header */
.video-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  min-height: 44px;
}

.video-panel-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.video-panel-header-left h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.video-panel-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.video-panel-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Status badge */
.video-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  line-height: 1.3;
  flex-shrink: 0;
}

.video-status-badge.status-running {
  background: rgba(10, 132, 255, 0.15);
  color: var(--accent);
}

.video-status-badge.status-done {
  background: rgba(48, 209, 88, 0.15);
  color: var(--green);
}

.video-status-badge.status-failed {
  background: rgba(255, 69, 58, 0.15);
  color: var(--red);
}

.video-status-badge.status-waiting {
  background: rgba(232, 121, 249, 0.15);
  color: #e879f9;
}

/* Studio indicator */
.video-studio-link {
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
}

/* Stage dots */
.video-stages {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.video-stages-empty {
  text-align: center;
  color: var(--text-tertiary);
  padding: 40px 20px;
  font-size: 13px;
}

.video-stage-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  position: relative;
}

.video-stage-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  border: 2px solid var(--border-strong);
  background: var(--bg-secondary);
  color: var(--text-tertiary);
  transition: all 0.2s ease;
  z-index: 1;
}

.video-stage-step.stage-done .video-stage-dot {
  border-color: var(--green);
  background: rgba(48, 209, 88, 0.15);
  color: var(--green);
}

.video-stage-step.stage-running .video-stage-dot {
  border-color: var(--accent);
  background: rgba(10, 132, 255, 0.15);
  color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.2);
}

.video-stage-step.stage-failed .video-stage-dot {
  border-color: var(--red);
  background: rgba(255, 69, 58, 0.15);
  color: var(--red);
}

.video-stage-line {
  position: absolute;
  top: 11px;
  left: calc(50% + 14px);
  right: calc(-50% + 14px);
  height: 2px;
  background: var(--border-strong);
  z-index: 0;
}

.video-stage-step.stage-done .video-stage-line {
  background: var(--green);
}

.video-stage-step.stage-running .video-stage-line {
  background: var(--accent);
}

.video-stage-step:last-child .video-stage-line {
  display: none;
}

.video-stage-name {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-align: center;
}

.video-stage-step.stage-done .video-stage-name { color: var(--green); }
.video-stage-step.stage-running .video-stage-name { color: var(--accent); }
.video-stage-step.stage-failed .video-stage-name { color: var(--red); }

/* Panel content area */
.video-panel-content {
  padding: 16px 20px;
}

/* ==========================================================================
   Pipeline Flow — Agent node diagram + output gallery + distribution
   ========================================================================== */

/* ── Pipeline flow container ── */
.pipeline-flow {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 16px 20px;
  font-family: Inter, -apple-system, system-ui, sans-serif;
}

/* Section labels */
.pipeline-section-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

/* ── Agent nodes row ── */
.pipeline-agents {
  display: flex;
  align-items: center;
  gap: 0;
  position: relative;
  padding: 4px 0;
}

.pipeline-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 72px;
  flex: 1;
  position: relative;
  z-index: 1;
}

.pipeline-node-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  transition: all 0.25s ease;
  position: relative;
}

.pipeline-node-avatar .persona-avatar {
  width: 36px !important;
  height: 36px !important;
  font-size: 12px !important;
}

.pipeline-node-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.pipeline-node-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.2;
}

.pipeline-node-status {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-align: center;
}

.pipeline-node-cost {
  font-size: 9px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

/* Connector line between nodes */
.pipeline-connector {
  flex: 0 0 auto;
  width: 24px;
  height: 1px;
  background: var(--border);
  align-self: flex-start;
  margin-top: 21px; /* center on avatar */
  position: relative;
  z-index: 0;
}

/* ── Status-based node styling ── */
.pipeline-node.node-done .pipeline-node-avatar {
  border-color: rgba(48, 209, 88, 0.4);
  background: rgba(48, 209, 88, 0.06);
}
.pipeline-node.node-done .pipeline-node-name { color: var(--green); }
.pipeline-node.node-done .pipeline-node-status { color: var(--green); }

.pipeline-node.node-running .pipeline-node-avatar {
  border-color: rgba(10, 132, 255, 0.5);
  background: rgba(10, 132, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.1);
}
.pipeline-node.node-running .pipeline-node-name { color: var(--accent); }
.pipeline-node.node-running .pipeline-node-status { color: var(--accent); }

.pipeline-node.node-running .pipeline-node-avatar::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(10, 132, 255, 0.3);
  animation: node-pulse 1.5s ease-in-out infinite;
}

@keyframes node-pulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.05); }
}

.pipeline-node.node-failed .pipeline-node-avatar {
  border-color: rgba(255, 69, 58, 0.4);
  background: rgba(255, 69, 58, 0.06);
}
.pipeline-node.node-failed .pipeline-node-name { color: var(--red); }
.pipeline-node.node-failed .pipeline-node-status { color: var(--red); }

.pipeline-node.node-pending .pipeline-node-avatar {
  opacity: 0.35;
}
.pipeline-node.node-pending .pipeline-node-name { opacity: 0.4; }
.pipeline-node.node-pending .pipeline-node-status { opacity: 0.4; }

/* ── Output gallery ── */
.pipeline-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.pipeline-asset-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.pipeline-asset-card:hover {
  border-color: rgba(10, 132, 255, 0.4);
  transform: translateY(-1px);
}

.pipeline-asset-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 22px;
  overflow: hidden;
}

.pipeline-asset-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pipeline-asset-thumb.thumb-vertical {
  aspect-ratio: 9 / 16;
  max-height: 220px;
}

.pipeline-asset-body {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pipeline-asset-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pipeline-asset-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  color: var(--text-tertiary);
}

.pipeline-asset-badge {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 700;
  background: rgba(10, 132, 255, 0.12);
  color: var(--accent);
}

.pipeline-asset-dl {
  font-size: 10px;
  color: var(--accent);
  text-decoration: none;
  margin-top: 4px;
}
.pipeline-asset-dl:hover {
  text-decoration: underline;
}

/* Empty state for gallery */
.pipeline-gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 24px;
  color: var(--text-tertiary);
  font-size: 12px;
}

/* ── Distribution badges ── */
.pipeline-dist-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pipeline-dist-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-tertiary);
  transition: all 0.15s ease;
  min-height: 36px;
}

.pipeline-dist-icon {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
}

.pipeline-dist-badge.dist-posted {
  border-color: rgba(48, 209, 88, 0.3);
  color: var(--green);
}

.pipeline-dist-badge.dist-failed {
  border-color: rgba(255, 69, 58, 0.3);
  color: var(--red);
}

.pipeline-dist-badge.dist-connected {
  color: var(--text-secondary);
}

/* Voiceover Upload Area */
.video-upload {
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  background: rgba(232, 121, 249, 0.04);
}

.video-upload-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.video-upload-label {
  font-size: 13px;
  font-weight: 500;
  color: #e879f9;
  margin: 0;
}

.video-upload-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.video-upload-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.video-upload-field-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.video-upload-dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  background: var(--bg-tertiary);
}

.video-upload-dropzone:hover,
.video-upload-dropzone.dragover {
  border-color: var(--accent);
  background: rgba(10, 132, 255, 0.05);
}

.video-upload-dropzone-sm {
  padding: 10px;
}

.video-dropzone-text {
  font-size: 12px;
  color: var(--text-secondary);
}

.video-blog-attachments { margin-top: 6px; }

.video-blog-dropzone {
  border: 2px dashed var(--border);
  border-radius: 6px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--bg-tertiary);
}

.video-blog-dropzone:hover,
.video-blog-dropzone.dragover {
  border-color: var(--accent);
  background: rgba(10, 132, 255, 0.05);
}

.video-blog-file-list {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.video-blog-file-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  color: var(--text-secondary);
}

.video-blog-file-item .remove-file {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1;
}

.video-blog-file-item .remove-file:hover { color: var(--text-primary); }

.video-blog-file-item .file-icon {
  font-size: 10px;
  opacity: 0.6;
}

.video-upload-filename {
  font-size: 11px;
  color: var(--accent);
  min-height: 14px;
}

/* ==========================================================================
   Video Pipeline - Asset Manager Tree
   ========================================================================== */

.asset-storage-bar {
  font-size: 10px;
  color: var(--text-muted);
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
  line-height: 1.4;
}

.asset-upload-status {
  font-size: 10px;
  color: var(--accent);
  display: none;
  padding: 2px 0;
}

.asset-tree {
  max-height: 400px;
  overflow-y: auto;
}

.asset-brand-group {
  margin-bottom: 2px;
}

.asset-brand-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.asset-brand-header:hover {
  background: var(--bg-hover);
}

.asset-brand-delete {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.asset-brand-header:hover .asset-brand-delete { opacity: 1; }
.asset-brand-delete:hover { color: var(--red); }

.asset-brand-arrow {
  font-size: 8px;
  color: var(--text-muted);
  transition: transform 0.15s;
  width: 10px;
  text-align: center;
}

.asset-brand-group.expanded .asset-brand-arrow {
  transform: rotate(90deg);
}

.asset-brand-meta {
  margin-left: auto;
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
}

.asset-brand-body {
  display: none;
  padding-left: 12px;
}

.asset-brand-group.expanded .asset-brand-body {
  display: block;
}

.asset-category-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 4px 2px;
}

.asset-file-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px;
  font-size: 11px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.asset-file-row:hover {
  background: var(--bg-hover);
}

.asset-file-icon {
  font-size: 10px;
  color: var(--text-muted);
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}

.asset-file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}

.asset-file-size {
  color: var(--text-muted);
  font-size: 10px;
  flex-shrink: 0;
}

.asset-file-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 0 2px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}

.asset-file-row:hover .asset-file-delete {
  opacity: 1;
}

.asset-file-delete:hover {
  color: var(--red);
}

.asset-brand-upload {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--accent);
  cursor: pointer;
  padding: 4px;
  margin-top: 2px;
  transition: color 0.15s;
}

.asset-brand-upload:hover {
  color: var(--text);
}

.asset-no-files {
  font-size: 11px;
  color: var(--text-muted);
  padding: 4px;
  font-style: italic;
}

/* ==========================================================================
   Chat Team Strip — Compact horizontal agent bar
   ========================================================================== */
.chat-team-strip {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 8px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  flex-shrink: 0;
  min-height: 40px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chat-team-strip::-webkit-scrollbar {
  display: none;
}

.chat-team-strip:empty {
  display: none;
}

.chat-team-node {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

.chat-team-avatar {
  position: relative;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.chat-team-avatar:hover {
  transform: scale(1.15);
}

.chat-team-avatar .persona-avatar {
  border: 2px solid var(--bg);
  transition: box-shadow 0.3s ease;
}

.chat-team-avatar.status-done .persona-avatar {
  box-shadow: 0 0 0 2px var(--green);
}

.chat-team-avatar.status-running .persona-avatar {
  box-shadow: 0 0 0 2px var(--accent);
  animation: teamPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.chat-team-avatar.status-failed .persona-avatar {
  box-shadow: 0 0 0 2px var(--red);
}

.chat-team-avatar.status-pending .persona-avatar {
  opacity: 0.4;
}

.chat-team-avatar .team-check {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--bg);
}

.chat-team-connector {
  width: 20px;
  height: 1px;
  background: var(--border-strong);
  flex-shrink: 0;
}

.chat-team-avatar-name {
  font-size: 9px;
  color: var(--text-tertiary);
  text-align: center;
  margin-top: 2px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

@keyframes teamPulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--accent); }
  50% { box-shadow: 0 0 8px 2px var(--accent); }
}

/* ==========================================================================
   Activity Timeline — Right panel
   ========================================================================== */
.activity-timeline {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.activity-empty {
  color: var(--text-tertiary);
  font-size: 13px;
  text-align: center;
  padding: 40px 20px;
}

.activity-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  position: relative;
}

.activity-item + .activity-item {
  border-top: 1px solid var(--separator);
}

.activity-dot-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 20px;
  flex-shrink: 0;
  padding-top: 2px;
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-quaternary);
  flex-shrink: 0;
}

.activity-dot.status-running {
  background: var(--accent);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.activity-dot.status-done {
  background: var(--green);
}

.activity-dot.status-failed {
  background: var(--red);
}

.activity-line {
  width: 1px;
  flex: 1;
  background: var(--border);
  margin-top: 4px;
}

.activity-body {
  flex: 1;
  min-width: 0;
}

.activity-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.activity-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-time {
  font-size: 10px;
  color: var(--text-tertiary);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.activity-detail {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.activity-cost {
  font-size: 11px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.activity-agents {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 6px;
}

.activity-agents .persona-avatar {
  border: 1.5px solid var(--bg-elevated);
  margin-left: -4px;
}

.activity-agents .persona-avatar:first-child {
  margin-left: 0;
}

.activity-item:hover {
  cursor: pointer;
}

.activity-item:hover .activity-label {
  color: var(--accent);
}

/* ==========================================================================
   Pipeline Activity Card v2 — Richer card in chat (base styles at line ~803)
   ========================================================================== */
.chat-pipeline-card .chat-pipeline-agent-strip {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 8px 0 4px;
  padding: 4px 0;
}

.chat-pipeline-card .pipeline-agent-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.chat-pipeline-card .pipeline-agent-connector {
  width: 16px;
  height: 1px;
  background: var(--border-strong);
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 10px;
}

.chat-pipeline-card .pipeline-agent-status {
  font-size: 9px;
  line-height: 1;
}

.chat-pipeline-card .pipeline-agent-initials {
  font-size: 8px;
  color: var(--text-tertiary);
  font-weight: 600;
}

.chat-pipeline-card .chat-pipeline-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-secondary);
}

.chat-pipeline-card .chat-pipeline-active-agent {
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-pipeline-card .chat-pipeline-running-text {
  font-style: italic;
}

/* ==========================================================================
   Collapsible Pipeline Cards — Compact command center cards
   ========================================================================== */

/* Base card: compact, surface bg, status-colored left border */
.chat-pipeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin: 4px 0;
  max-width: 90%;
  animation: chatFadeIn 0.2s ease;
  cursor: pointer;
  transition: border-color 0.15s ease, max-height 0.3s ease;
  border-left: 3px solid var(--accent);
  overflow: hidden;
}

.chat-pipeline-card:hover {
  border-color: var(--border-strong);
}

/* Status left border colors */
.chat-pipeline-card.pipeline-card-running {
  border-left-color: var(--accent);
}

.chat-pipeline-card.pipeline-card-done {
  border-left-color: var(--green);
}

.chat-pipeline-card.pipeline-card-failed {
  border-left-color: var(--red);
}

/* Collapsed single line */
.pipeline-card-collapsed-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
}

.pipeline-card-collapsed-line .pipeline-card-status-icon {
  font-size: 12px;
  flex-shrink: 0;
}

.pipeline-card-collapsed-line .pipeline-card-status-icon.status-done {
  color: var(--green);
}

.pipeline-card-collapsed-line .pipeline-card-status-icon.status-failed {
  color: var(--red);
}

.pipeline-card-collapsed-label {
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.pipeline-card-collapsed-detail {
  font-size: 11px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.pipeline-card-collapsed-cost {
  font-size: 11px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* When collapsed, card has minimal padding */
.chat-pipeline-card[data-collapsed="true"] {
  padding: 8px 14px;
}

/* Expanded section with smooth height */
.pipeline-card-expanded {
  transition: opacity 0.2s ease;
}

/* Compact agent initials strip (CR -> LU -> VI) */
.pipeline-agent-initials-strip {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: 0.3px;
  padding: 4px 0 2px;
  font-family: 'SF Mono', 'Menlo', monospace;
}

/* Override old pipeline card styles that conflict */
.chat-pipeline-card .chat-pipeline-header {
  margin-bottom: 4px;
}

.chat-pipeline-card .chat-pipeline-footer {
  margin-top: 4px;
}

/* ==========================================================================
   Context Tabs — Clean underline style (no borders between tabs)
   ========================================================================== */
#context-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  flex-shrink: 0;
  padding: 0 12px;
}

.context-tab {
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
  text-align: center;
  white-space: nowrap;
  flex: none;
}

.context-tab:hover {
  color: var(--text-secondary);
}

.context-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Context sections: full height, scrollable */
.ctx-section {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Video tab sections (Preview/Clips/Distribute) */
.video-tab-section {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.video-tab-section.hidden {
  display: none;
}

/* ==========================================================================
   Script Modal / Teleprompter
   ========================================================================== */

.script-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: scriptModalIn 0.2s ease;
}

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

.script-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.script-modal-container {
  position: relative;
  width: min(900px, 90vw);
  max-height: 85vh;
  background: #1a1a1a;
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

:root[data-theme="light"] .script-modal-container {
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.15);
}

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

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

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

.script-modal-close {
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border: none;
  background: none;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}

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

.script-modal-body {
  padding: 32px 40px;
  overflow-y: auto;
  flex: 1;
  font-family: var(--font-sans);
  font-size: 20px;
  line-height: 1.8;
  color: #e0e0e0;
}

:root[data-theme="light"] .script-modal-body {
  color: #1a1a1a;
}

:root[data-theme="light"] .script-modal-body h1,
:root[data-theme="light"] .script-modal-body h2,
:root[data-theme="light"] .script-modal-body h3 {
  color: #111;
}

:root[data-theme="light"] .script-modal-body strong {
  color: #111;
}

:root[data-theme="light"] .script-modal-header {
  border-bottom-color: #e5e5e5;
}

:root[data-theme="light"] .script-modal-header h3 {
  color: #111;
}

/* Script content classes (no inline styles so teleprompter CSS can override) */
.script-content { padding: 16px 20px; font-family: Inter, system-ui, sans-serif; }
.script-content p { margin: 10px 0; line-height: 1.7; }
.script-content strong { color: var(--text-primary); }
.script-content em { color: var(--text-muted); font-style: italic; }
.script-content hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.script-h2 { color: var(--accent); margin: 0 0 16px; font-size: 1.25em; font-weight: 700; }
.script-h3 { color: var(--text-primary); margin: 24px 0 10px; font-size: 1.1em; font-weight: 700; }
.script-h4 { color: var(--accent); margin: 20px 0 8px; font-size: 0.9em; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.script-bullet { padding: 3px 0 3px 16px; border-left: 2px solid var(--border); }

.teleprompter-speed {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.teleprompter-speed.hidden { display: none; }

.teleprompter-speed .btn-icon {
  width: 24px;
  height: 24px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#tp-wpm {
  min-width: 60px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Fullscreen (manual, without teleprompter) */
.script-modal.fullscreen .script-modal-container {
  width: 100vw;
  max-height: 100vh;
  height: 100vh;
  border-radius: 0;
  border: none;
}

.script-modal.fullscreen .script-modal-body {
  font-size: 22px;
  line-height: 1.9;
  padding: 60px 15vw;
}

:root[data-theme="light"] .script-modal.fullscreen .script-modal-container {
  background: #ffffff;
}

/* Teleprompter active state — fullscreen black bg, large white text */
.script-modal.teleprompter-active .script-modal-container {
  width: 100vw;
  max-height: 100vh;
  height: 100vh;
  border-radius: 0;
  border: none;
  background: #000;
}

.script-modal.teleprompter-active .script-modal-header {
  background: #000;
  border-bottom-color: #222;
}

.script-modal.teleprompter-active .script-modal-header h3 {
  color: #666;
  font-size: 12px;
}

.script-modal.teleprompter-active .script-modal-body {
  background: #000;
  padding: 5%;
  font-size: 58px;
  line-height: 1.5;
  color: #fff;
  font-weight: 500;
  cursor: none;
}

.script-modal.teleprompter-active .script-content,
.script-modal.teleprompter-active .script-content p,
.script-modal.teleprompter-active .script-content strong,
.script-modal.teleprompter-active .script-content em,
.script-modal.teleprompter-active .script-h2,
.script-modal.teleprompter-active .script-h3,
.script-modal.teleprompter-active .script-h4 {
  color: #fff;
  font-size: inherit;
  border-color: #333;
}

.script-modal.teleprompter-active .script-content em { color: #bbb; }
.script-modal.teleprompter-active .script-content hr { border-top-color: #333; }
.script-modal.teleprompter-active .script-bullet { border-left-color: #444; }

.script-modal.teleprompter-active #btn-teleprompter {
  background: var(--accent);
  color: #fff;
}

.script-modal.teleprompter-active .script-modal-controls .btn,
.script-modal.teleprompter-active .script-modal-controls .btn-icon {
  color: #999;
}

.script-modal.teleprompter-active .teleprompter-speed {
  color: #666;
}

@keyframes scriptModalIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

/* Content Table View */
#content-table-view table tr:hover {
  background: var(--bg-secondary) !important;
}
#content-table-view table th {
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 1;
}

/* Settings Panel */
.view-panel {
  position: absolute;
  inset: 0;
  background: var(--bg);
  z-index: 10;
  overflow-y: auto;
}

.settings-container {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 24px;
}

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

.settings-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.settings-section h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.settings-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.settings-section-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-row label {
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 100px;
}

.settings-input-sm {
  width: 80px;
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg);
  color: var(--text-primary);
}

.settings-select {
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg);
  color: var(--text-primary);
}

.settings-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Toggle switch */
.settings-toggle {
  position: relative;
  width: 44px;
  height: 24px;
}

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

.settings-toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-hover);
  border-radius: 12px;
  transition: 0.3s;
}

.settings-toggle-slider:before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}

.settings-toggle input:checked + .settings-toggle-slider {
  background: var(--accent);
}

.settings-toggle input:checked + .settings-toggle-slider:before {
  transform: translateX(20px);
}

/* Sites list */
.settings-site-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.settings-site-row:last-child {
  border-bottom: none;
}

.settings-site-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-site-short {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(10, 132, 255, 0.1);
  padding: 3px 8px;
  border-radius: 4px;
  min-width: 36px;
  text-align: center;
}

.settings-site-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.settings-site-url {
  font-size: 12px;
  color: var(--text-tertiary);
}

.settings-site-pipelines {
  font-size: 11px;
  color: var(--text-tertiary);
}

/* Schedule Calendar Grid */
.schedule-calendar {
  margin: 4px 0;
}

.schedule-grid {
  width: 100%;
  border-collapse: collapse;
}

.schedule-grid th {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  padding: 6px 0;
  text-align: center;
  width: 36px;
}

.schedule-grid th:first-child {
  text-align: left;
  width: auto;
}

.schedule-grid td {
  padding: 4px 0;
  text-align: center;
}

.schedule-grid td:first-child {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding-right: 8px;
}

.schedule-grid .schedule-cell {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  font-size: 12px;
  color: transparent;
}

.schedule-grid .schedule-cell:hover {
  border-color: var(--accent);
  background: rgba(10, 132, 255, 0.05);
}

.schedule-grid .schedule-cell.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.schedule-grid .schedule-cell.active::after {
  content: "\2713";
  font-size: 14px;
  font-weight: 700;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: white;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 4.7s forwards;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-success { background: #22c55e; }
.toast-error { background: #ef4444; }
.toast-info { background: var(--accent, #0a84ff); }
.toast-warning { background: #f59e0b; }

.toast-icon { font-size: 16px; flex-shrink: 0; }

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

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

/* File Library */
.files-list {
  max-height: 400px;
  overflow-y: auto;
}

.files-run {
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  margin-bottom: 8px;
  overflow: hidden;
}

.files-run-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  background: var(--bg-secondary);
}

.files-run-header:hover {
  background: var(--bg-hover);
}

.files-run-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.files-run-id {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}

.files-run-subtitle {
  font-size: 10px;
  color: var(--text-tertiary);
  font-family: var(--font-mono, monospace);
  opacity: 0.6;
}

.files-run-meta {
  font-size: 11px;
  color: var(--text-tertiary);
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}

.files-run-type {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
}

.files-run-type[data-type="content"] { background: rgba(10, 132, 255, 0.1); color: var(--accent); }
.files-run-type[data-type="video"] { background: rgba(168, 85, 247, 0.1); color: #a855f7; }
.files-run-type[data-type="finance"] { background: rgba(34, 197, 94, 0.1); color: #22c55e; }
.files-run-type[data-type="voiceover"] { background: rgba(251, 146, 60, 0.1); color: #fb923c; }
.files-run-type[data-type="screenshot"] { background: rgba(56, 189, 248, 0.1); color: #38bdf8; }
.files-run-type[data-type="upload"] { background: rgba(244, 114, 182, 0.1); color: #f472b6; }
.files-run-type[data-type="social"] { background: rgba(250, 204, 21, 0.1); color: #facc15; }
.files-run-type[data-type="engineering"] { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }
.files-run-type[data-type="outreach"] { background: rgba(20, 184, 166, 0.1); color: #14b8a6; }
.files-run-type[data-type="personal"] { background: rgba(156, 163, 175, 0.1); color: #9ca3af; }
.files-run-type[data-type="render-cache"] { background: rgba(239, 68, 68, 0.1); color: #ef4444; }

.files-run-files {
  display: none;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
}

.files-run-files.open {
  display: block;
}

.files-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 12px;
}

.files-file-name {
  color: var(--text-secondary);
  word-break: break-all;
}

.files-file-size {
  color: var(--text-tertiary);
  flex-shrink: 0;
  margin-left: 12px;
}

.files-delete-btn {
  background: none;
  border: none;
  color: var(--red);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 4px;
}

.files-delete-btn:hover {
  background: rgba(239, 68, 68, 0.1);
}
