/* ═══════════════════════════════════════════════════
   AutoPilot — Refined Dark Theme
   Inspired by Linear, Vercel, Stripe
   ═══════════════════════════════════════════════════ */

:root {
  --bg-0: #09090b;
  --bg-1: #0f0f12;
  --bg-2: #18181b;
  --bg-3: #1e1e23;
  --bg-4: #27272a;
  --bg-elevated: #1c1c20;
  --bg-input: #131316;
  --bg-hover: rgba(255, 255, 255, .03);
  --bg-active: rgba(139, 92, 246, .08);

  --border: rgba(255, 255, 255, .06);
  --border-subtle: rgba(255, 255, 255, .04);
  --border-bright: rgba(255, 255, 255, .1);
  --border-accent: rgba(139, 92, 246, .25);

  --text: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-dim: #52525b;

  --accent: #8b5cf6;
  --accent-light: #a78bfa;
  --accent-dim: rgba(139, 92, 246, .15);
  --accent-glow: rgba(139, 92, 246, .08);

  --success: #34d399;
  --success-dim: rgba(52, 211, 153, .12);
  --warning: #fbbf24;
  --warning-dim: rgba(251, 191, 36, .12);
  --danger: #f87171;
  --danger-dim: rgba(248, 113, 113, .12);
  --info: #60a5fa;
  --info-dim: rgba(96, 165, 250, .12);

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow: 0 2px 8px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.4);
  --shadow-xl: 0 20px 60px rgba(0,0,0,.5);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
  --transition: 150ms ease;
  --transition-slow: 250ms ease;
}

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

body {
  font-family: var(--font);
  background: var(--bg-0);
  color: var(--text-secondary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.hidden { display: none !important; }

::selection {
  background: rgba(139, 92, 246, .3);
  color: #fff;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }


/* ═══════════════════════════════════════════════════
   Landing Page
   ═══════════════════════════════════════════════════ */
.landing {
  min-height: 100vh;
  background: var(--bg-0);
  position: relative;
}

.landing::before {
  content: '';
  position: fixed;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 800px; height: 600px;
  background: radial-gradient(ellipse, rgba(139, 92, 246, .06) 0%, transparent 70%);
  pointer-events: none;
}

/* Nav */
.landing-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  background: rgba(9, 9, 11, .8);
  border-bottom: 1px solid var(--border);
}
.landing-nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-icon { flex-shrink: 0; line-height: 0; }
.brand-name {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  letter-spacing: -.3px;
}
.brand-sm .brand-name { font-size: 14px; }

/* Hero */
.hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: 160px 24px 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.hero-glow { display: none; }
.hero-inner { position: relative; }
.hero-badge-wrap { margin-bottom: 20px; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 8px;
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-light);
  letter-spacing: .2px;
}
.pulse-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
  animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

.hero h1 {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -1.5px;
  color: var(--text);
  margin-bottom: 20px;
}
.gradient-text {
  background: linear-gradient(135deg, var(--accent-light) 0%, #c084fc 50%, #e879f9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-desc {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 480px;
  margin-bottom: 32px;
}
.hero-cta { display: flex; gap: 12px; }

/* Hero visual */
.hero-visual { position: relative; }
.hero-card-stack { perspective: 800px; }
.hero-demo-card {
  background: var(--bg-2);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  transform: rotateY(-4deg) rotateX(2deg);
  transition: transform .4s ease;
}
.hero-demo-card:hover { transform: rotateY(0) rotateX(0); }
.demo-prompt {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 16px;
  line-height: 1.6;
}
.demo-steps { display: flex; flex-direction: column; gap: 6px; }
.demo-step {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  transition: all var(--transition);
}
.demo-step.done { color: var(--success); background: var(--success-dim); border-color: rgba(52, 211, 153, .08); }
.demo-step.active { color: var(--warning); background: var(--warning-dim); border-color: rgba(251, 191, 36, .1); animation: pulse 2s infinite; }
.demo-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 11px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.demo-step.done .demo-num { background: rgba(52, 211, 153, .15); border-color: rgba(52, 211, 153, .25); color: var(--success); }
.demo-step.active .demo-num { background: rgba(251, 191, 36, .15); border-color: rgba(251, 191, 36, .25); color: var(--warning); }

/* Features */
.features {
  max-width: 1080px;
  margin: 0 auto;
  padding: 60px 24px 100px;
}
.section-title {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.6px;
  margin-bottom: 48px;
  color: var(--text);
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.feature-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color var(--transition-slow);
}
.feature-card:hover { border-color: var(--border-bright); }
.feature-icon { font-size: 24px; margin-bottom: 14px; display: block; }
.feature-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.feature-card p { font-size: 13px; color: var(--text-muted); line-height: 1.65; }

.landing-footer {
  text-align: center;
  padding: 32px 24px;
  font-size: 13px;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
}


/* ═══════════════════════════════════════════════════
   Auth Modal
   ═══════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn .15s ease;
}
@keyframes fadeIn { from{opacity:0} to{opacity:1} }

.modal-card {
  background: var(--bg-2);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-xl);
  padding: 36px;
  width: 400px;
  max-width: 92vw;
  position: relative;
  box-shadow: var(--shadow-xl);
}
.modal-close {
  position: absolute;
  top: 14px; right: 18px;
  background: none; border: none;
  color: var(--text-dim);
  font-size: 22px;
  cursor: pointer;
  transition: color var(--transition);
  line-height: 1;
}
.modal-close:hover { color: var(--text-secondary); }
.modal-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 24px;
}
.modal-card h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -.3px;
}
.modal-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}
.form-field { margin-bottom: 18px; }
.form-field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-field input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.field-hint {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 6px;
}


/* ═══════════════════════════════════════════════════
   Buttons
   ═══════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  font-family: var(--font);
  line-height: 1.4;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.btn-primary:hover { background: #7c3aed; box-shadow: 0 2px 8px rgba(139, 92, 246, .25); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn-lg { padding: 12px 28px; font-size: 14px; border-radius: var(--radius-lg); }
.btn-full { width: 100%; justify-content: center; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-bright);
  color: var(--text-secondary);
  padding: 8px 16px;
  font-size: 13px;
}
.btn-ghost:hover { background: var(--bg-hover); border-color: var(--border-bright); color: var(--text); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-bright);
  color: var(--text-secondary);
}
.btn-outline:hover { background: var(--bg-hover); color: var(--text); }
.btn-danger {
  background: var(--danger-dim);
  border: 1px solid rgba(248, 113, 113, .15);
  color: var(--danger);
}
.btn-danger:hover { background: rgba(248, 113, 113, .18); }

.btn-icon {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 32px; height: 32px;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.btn-icon:hover { background: var(--bg-4); border-color: var(--border-bright); color: var(--text); }
.btn-icon-sm { width: 28px; height: 28px; border-radius: var(--radius-sm); }


/* ═══════════════════════════════════════════════════
   App Layout
   ═══════════════════════════════════════════════════ */
.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
}

/* Sidebar */
.sidebar {
  background: var(--bg-1);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
}

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

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
  flex-shrink: 0;
}
.user-info { flex: 1; min-width: 0; }
.user-name { display: block; font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-label { display: block; font-size: 11px; color: var(--text-dim); }

.sidebar-nav {
  display: flex;
  gap: 4px;
  padding: 10px 10px 0;
}
.nav-link {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 8px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  transition: all var(--transition);
}
.nav-link:hover { color: var(--text-secondary); background: var(--bg-hover); }
.nav-link.active {
  color: var(--text);
  background: var(--bg-3);
  border-color: var(--border);
}

.sidebar-search { padding: 10px 14px; }
.sidebar-search input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition);
}
.sidebar-search input:focus { border-color: var(--accent); }
.sidebar-search input::placeholder { color: var(--text-dim); }

.task-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
}
.task-item {
  padding: 10px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
  margin-bottom: 2px;
  border: 1px solid transparent;
}
.task-item:hover { background: var(--bg-hover); }
.task-item.active { background: var(--bg-active); border-color: var(--border-accent); }
.task-item .task-item-prompt {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 5px;
  font-weight: 500;
  color: var(--text-secondary);
}
.task-item.active .task-item-prompt { color: var(--text); }
.task-item .codename {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--accent-light);
  margin-right: 3px;
}
.task-item .task-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-dim);
  flex-wrap: wrap;
}
.task-item .task-item-meta > span:last-child { margin-left: auto; }
.task-item-mode {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-3);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.task-item-cost {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

.empty-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-dim);
  font-size: 13px;
}
.empty-state .muted { font-size: 12px; margin-top: 4px; opacity: .6; }


/* ═══════════════════════════════════════════════════
   Main Content
   ═══════════════════════════════════════════════════ */
.main-content { overflow-y: auto; padding: 0; position: relative; background: var(--bg-0); }
.view { height: 100%; }

/* Prompt Container */
.prompt-container { max-width: 720px; margin: 0 auto; padding: 48px 24px 60px; }
.welcome-section { text-align: center; margin-bottom: 36px; }
.prompt-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.6px;
  line-height: 1.2;
  margin-bottom: 10px;
  color: var(--text);
}
.prompt-subtitle { color: var(--text-muted); font-size: 15px; max-width: 480px; margin: 0 auto; line-height: 1.7; }

/* Stats */
.stats-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 28px; }
.stat-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color var(--transition);
}
.stat-card:hover { border-color: var(--border-bright); }
.stat-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.3px;
  font-variant-numeric: tabular-nums;
}
.stat-sub { font-size: 11px; color: var(--text-dim); margin-top: 2px; font-variant-numeric: tabular-nums; }

/* Prompt Box */
.prompt-box {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}
.prompt-box textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 14px;
  font-family: var(--font);
  line-height: 1.6;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition);
  background: var(--bg-input);
  color: var(--text);
}
.prompt-box textarea::placeholder { color: var(--text-dim); }
.prompt-box textarea:focus { border-color: var(--accent); }

.prompt-options { margin-top: 14px; display: flex; gap: 14px; }
.option-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.option-group select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition);
}
.option-group select:focus { border-color: var(--accent); }

.collapsible-section {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.collapsible-section summary {
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  background: var(--bg-hover);
  color: var(--text-muted);
  transition: color var(--transition);
}
.collapsible-section summary:hover { color: var(--text-secondary); }
.collapsible-body { padding: 14px; }
.field-row { display: flex; gap: 12px; }
.field { flex: 1; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 5px;
}
.field input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  background: var(--bg-input);
  color: var(--text);
  transition: border-color var(--transition);
}
.field input:focus { border-color: var(--accent); }
.prompt-actions { margin-top: 16px; display: flex; justify-content: flex-end; }

/* Templates */
.templates { margin-top: 32px; }
.templates h3 {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.template-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-secondary);
}
.template-card:hover { border-color: var(--border-bright); background: var(--bg-2); }
.template-card strong { display: block; font-size: 13px; font-weight: 600; margin-bottom: 3px; color: var(--text); }
.template-card span { font-size: 12px; color: var(--text-dim); }


/* ═══════════════════════════════════════════════════
   Task View
   ═══════════════════════════════════════════════════ */
.task-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-1);
}
.task-meta h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -.2px;
}
.task-badges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2px;
}
.badge-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.task-actions { display: flex; gap: 8px; }
.task-prompt-display {
  padding: 14px 24px;
  background: var(--bg-1);
  font-size: 13px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  line-height: 1.6;
}

/* Status badges */
.status-queued { background: var(--bg-3); color: var(--text-dim); }
.status-planning { background: var(--accent-dim); color: var(--accent-light); }
.status-executing { background: var(--warning-dim); color: var(--warning); }
.status-verifying { background: var(--info-dim); color: var(--info); }
.status-reporting { background: var(--accent-dim); color: var(--accent-light); }
.status-done { background: var(--success-dim); color: var(--success); }
.status-failed { background: var(--danger-dim); color: var(--danger); }
.status-cancelled { background: var(--bg-3); color: var(--text-dim); }

/* Plan */
.plan-section { padding: 20px 24px; }
.plan-section h3 { font-size: 14px; font-weight: 600; margin-bottom: 12px; color: var(--text); }
.plan-goal {
  padding: 10px 14px;
  background: var(--accent-dim);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 14px;
  color: var(--text-secondary);
}
.plan-steps { display: flex; flex-direction: column; gap: 6px; }
.plan-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
}
.plan-step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 11px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.plan-step-num.done { background: var(--success-dim); color: var(--success); border-color: rgba(52, 211, 153, .2); }
.plan-step-num.failed { background: var(--danger-dim); color: var(--danger); border-color: rgba(248, 113, 113, .2); }
.plan-step-num.running { background: var(--warning-dim); color: var(--warning); border-color: rgba(251, 191, 36, .2); animation: pulse 1.5s infinite; }
.plan-step-action {
  font-family: var(--font-mono);
  background: var(--bg-3);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  color: var(--text-muted);
}


/* ═══════════════════════════════════════════════════
   Task Summary Panel
   ═══════════════════════════════════════════════════ */
.task-summary {
  padding: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-1);
}
.ts-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-subtle);
}
.ts-status {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ts-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ts-status-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.ts-sep {
  width: 1px;
  height: 16px;
  background: var(--border);
}
.ts-date {
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.ts-metrics {
  display: flex;
  align-items: stretch;
  padding: 0;
}
.ts-metric {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 12px;
  gap: 4px;
  min-width: 0;
}
.ts-metric-divider {
  width: 1px;
  background: var(--border-subtle);
  align-self: stretch;
  margin: 12px 0;
}
.ts-metric-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.3px;
  font-variant-numeric: tabular-nums;
  font-family: var(--font);
  line-height: 1;
}
.ts-metric-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.ts-metric-cost .ts-metric-value {
  color: var(--text);
}
.ts-report-preview {
  border-top: 1px solid var(--border);
}
.ts-report-preview iframe {
  width: 100%;
  height: 80vh;
  display: block;
  background: #fff;
  border-radius: 0 0 var(--radius) var(--radius);
}
.ts-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ts-download-btn {
  display: inline-flex;
  align-items: center;
}


/* ═══════════════════════════════════════════════════
   Feed
   ═══════════════════════════════════════════════════ */
.feed-section { padding: 20px 24px; }
.feed-section h3 { font-size: 14px; font-weight: 600; margin-bottom: 12px; color: var(--text); }
.feed {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-height: 440px;
  overflow-y: auto;
}
.feed-empty { padding: 40px; text-align: center; color: var(--text-dim); font-size: 13px; }
.feed-item {
  padding: 9px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-secondary);
}
.feed-item:last-child { border-bottom: none; }
.feed-time {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  font-family: var(--font-mono);
  padding-top: 1px;
}
.feed-content { flex: 1; line-height: 1.5; }
.feed-content strong { font-weight: 600; color: var(--text); }
.feed-screenshot {
  margin-top: 8px;
  max-width: 280px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: opacity var(--transition);
}
.feed-screenshot:hover { opacity: .85; }


/* ═══════════════════════════════════════════════════
   Screenshots
   ═══════════════════════════════════════════════════ */
.screenshots-section { padding: 20px 24px; }
.screenshots-section h3 { font-size: 14px; font-weight: 600; margin-bottom: 12px; color: var(--text); }
.screenshots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.screenshot-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition);
}
.screenshot-card:hover { border-color: var(--border-bright); }
.screenshot-card img { width: 100%; display: block; }
.screenshot-card .caption {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
}


/* ═══════════════════════════════════════════════════
   Usage View
   ═══════════════════════════════════════════════════ */
.usage-container { padding: 32px 24px; max-width: 1080px; margin: 0 auto; }
.loading-state { text-align: center; padding: 80px 24px; color: var(--text-dim); }
.spinner {
  display: inline-block;
  width: 24px; height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  margin-bottom: 12px;
}
@keyframes spin { to{transform:rotate(360deg)} }

.usage-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 28px; }
.usage-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  position: relative;
}
.usage-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.usage-card.uc-blue::before { background: var(--info); }
.usage-card.uc-green::before { background: var(--success); }
.usage-card.uc-purple::before { background: var(--accent); }
.usage-card.uc-amber::before { background: var(--warning); }
.usage-card .uc-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.usage-card .uc-value { font-size: 24px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.usage-card .uc-sub { font-size: 12px; color: var(--text-dim); margin-top: 3px; font-variant-numeric: tabular-nums; }

.usage-table-wrap {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.usage-table-wrap table { width: 100%; border-collapse: collapse; }
.usage-table-wrap thead th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}
.usage-table-wrap tbody td {
  padding: 10px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  color: var(--text-secondary);
}
.usage-table-wrap tbody tr:last-child td { border-bottom: none; }
.usage-table-wrap tbody tr:hover { background: var(--bg-hover); }


/* ═══════════════════════════════════════════════════
   Lightbox
   ═══════════════════════════════════════════════════ */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .85);
  backdrop-filter: blur(8px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 9999;
  cursor: pointer;
}
.lightbox img {
  max-width: 90%;
  max-height: 85vh;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.lightbox p { color: var(--text-muted); font-size: 13px; margin-top: 12px; }
.lightbox-close {
  position: absolute;
  top: 16px; right: 24px;
  background: none; border: none;
  color: var(--text-secondary);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  transition: color var(--transition);
}
.lightbox-close:hover { color: var(--text); }


/* ═══════════════════════════════════════════════════
   Auth Modal Extras
   ═══════════════════════════════════════════════════ */
.auth-error {
  background: rgba(239, 68, 68, .12);
  border: 1px solid rgba(239, 68, 68, .3);
  color: #f87171;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.auth-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-dim);
}
.auth-toggle .btn-sm { font-size: 13px; padding: 2px 8px; }

/* ═══════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════ */
/* ── File Upload Zone ── */
.file-upload-zone{margin-top:12px}
.file-drop-area{border:2px dashed var(--border);border-radius:10px;padding:28px 20px;text-align:center;cursor:pointer;transition:all .2s}
.file-drop-area:hover,.file-drop-area.dragover{border-color:var(--accent);background:rgba(139,92,246,.06)}
.file-drop-icon{color:var(--text-dim);margin-bottom:8px}
.file-drop-text{font-size:14px;color:var(--text-secondary);margin-bottom:4px}
.file-browse-link{color:var(--accent);font-weight:600;cursor:pointer}
.file-drop-hint{font-size:12px;color:var(--text-dim)}
.file-selected{display:flex;align-items:center;justify-content:space-between;background:var(--bg-secondary);border:1px solid var(--border);border-radius:10px;padding:12px 16px}
.file-selected-info{display:flex;align-items:center;gap:10px}
.file-selected-icon{font-size:24px}
.file-selected-name{font-size:13px;font-weight:600;color:var(--text-primary)}
.file-selected-size{font-size:11px;color:var(--text-dim)}
.file-remove-btn{background:none;border:none;color:var(--text-dim);font-size:16px;cursor:pointer;padding:4px 8px;border-radius:4px;transition:all .15s}
.file-remove-btn:hover{color:var(--danger);background:rgba(239,68,68,.1)}

@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; padding-top: 120px; gap: 40px; }
  .hero-visual { display: none; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .prompt-container { padding: 24px 16px; }
  .task-header { flex-direction: column; gap: 12px; padding: 16px; }
  .field-row { flex-direction: column; }
  .template-grid { grid-template-columns: 1fr; }
  .stats-bar { grid-template-columns: 1fr 1fr; }
  .prompt-title { font-size: 24px; }
  .hero h1 { font-size: 32px; }
  .features-grid { grid-template-columns: 1fr; }
  .landing-nav-inner { padding: 12px 16px; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
}
