/* ═══════════════════════════════════════════════════════════
   Loopy Design System — Dark mode, datatable.tech-inspired
   Inter + JetBrains Mono, cyan/purple accents
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --bg: #0a0a0f;
  --bg-card: #12121a;
  --bg-card-hover: #1a1a28;
  --accent: #00d4ff;
  --accent2: #7b61ff;
  --accent3: #ff6b6b;
  --text: #e8e8ef;
  --text-dim: #8888a0;
  --border: #1e1e2e;
  --glow: rgba(0, 212, 255, 0.15);
  --glow-purple: rgba(123, 97, 255, 0.15);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
  --radius: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow: 0 4px 20px rgba(0,0,0,0.4);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-sans); background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
a:visited { color: inherit; }

/* ── Grid background ────────────────────────────────────── */
.grid-bg {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ── Animations ─────────────────────────────────────────── */
@keyframes drift {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(-30px, -20px) rotate(2deg); }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
@keyframes float-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(0,212,255,0.15), 0 0 60px rgba(0,212,255,0.05); }
  50% { box-shadow: 0 0 30px rgba(0,212,255,0.25), 0 0 80px rgba(0,212,255,0.1); }
}

/* ── Top Bar (datatable.tech style) ────────────────────── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 0 2rem; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(10, 10, 15, 0.8);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.topbar-brand {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-mono); font-size: 1.3rem; font-weight: 700;
  color: var(--accent); letter-spacing: -0.5px;
}
.topbar-logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 8px; color: var(--bg); font-size: 14px; font-weight: 700;
}
.topbar-name { color: var(--accent); }
.topbar-nav {
  display: flex; align-items: center; gap: 2rem;
}
.topbar-nav a {
  color: var(--text-dim); font-size: 0.9rem; font-weight: 500;
  transition: color 0.3s;
}
.topbar-nav a:hover, .topbar-nav a.active { color: var(--accent); }
.topbar-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
}
body { padding-top: 56px; }

/* ── Container & Layout ─────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 2rem 2.5rem; position: relative; z-index: 1; }
.page-header { margin-bottom: 2rem; animation: float-in 0.5s ease-out; }
.page-header h1 {
  font-size: 1.75rem; font-weight: 800; letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--text), var(--text-dim));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.page-header p { color: var(--text-dim); font-size: 0.9rem; margin-top: 0.25rem; }

/* ── Login Page ─────────────────────────────────────────── */
.login-body {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--bg); position: relative; overflow: hidden;
}
.login-body::before {
  content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(0,212,255,0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 60%, rgba(123,97,255,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(255,107,107,0.04) 0%, transparent 50%);
  animation: drift 20s ease-in-out infinite alternate;
}
.login-body::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px; pointer-events: none;
}
.login-container {
  width: 100%; max-width: 400px; padding: 2.5rem;
  background: rgba(18, 18, 26, 0.85);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  backdrop-filter: blur(20px);
  position: relative; z-index: 1;
  animation: float-in 0.6s ease-out;
}
.login-header { text-align: center; margin-bottom: 2rem; }
.login-header h1 {
  font-size: 1.6rem; font-weight: 800; letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.login-subtitle { color: var(--text-dim); font-size: 0.85rem; margin-top: 0.4rem; }
.login-logo {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  color: #0a0a0f; font-family: var(--font-mono); font-size: 24px; font-weight: 700;
  margin: 0 auto 1.25rem;
  animation: glow-pulse 3s ease-in-out infinite;
}
.login-form { display: flex; flex-direction: column; gap: 1rem; }
.login-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 1rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg);
  font-size: 0.75rem; color: var(--text-dim); font-weight: 500;
  margin: 0 auto 1.5rem;
}
.login-badge-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 8px var(--accent);
  animation: pulse-dot 2s ease-in-out infinite;
}

/* ── Forms ───────────────────────────────────────────────── */
.form-group, .field { display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }
.form-group label, .field label {
  font-size: 0.8rem; font-weight: 500; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.form-group input, .form-group select,
.field input, .field select {
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border); border-radius: 8px;
  font-family: var(--font-sans); font-size: 0.875rem;
  color: var(--text); background: var(--bg);
  transition: all 0.2s;
}
.form-group input:focus, .form-group select:focus,
.field input:focus, .field select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,212,255,0.1);
}
.form-group input[type="file"] { padding: 0.5rem; cursor: pointer; }
.form-group input[type="file"]::file-selector-button {
  background: var(--bg-card); color: var(--text-dim); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.3rem 0.75rem; font-size: 0.8rem; cursor: pointer;
  transition: all 0.2s; margin-right: 0.5rem;
}
.form-group input[type="file"]::file-selector-button:hover {
  background: var(--bg-card-hover); border-color: var(--accent);
}
.field-hint { font-size: 0.75rem; color: var(--text-dim); opacity: 0.7; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-full { grid-column: 1 / -1; }
.form-section { margin-bottom: 2rem; }
.form-section h2 {
  font-size: 0.9rem; font-weight: 600; margin-bottom: 1rem;
  padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); color: var(--text-dim);
}
.form-row { display: flex; gap: 1rem; }
.form-actions {
  display: flex; gap: 0.5rem; justify-content: flex-end;
  margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border);
}
.form-page { max-width: 720px; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.65rem 1.5rem; border-radius: 10px;
  font-family: var(--font-sans); font-size: 0.875rem; font-weight: 600;
  border: none; cursor: pointer; transition: all 0.3s; text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #0a0a0f;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,212,255,0.3);
}
.btn-secondary {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--accent); background: var(--glow);
}
.btn-accent {
  background: linear-gradient(135deg, var(--accent2), var(--accent3));
  color: white;
}
.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--glow-purple);
}
.btn-full { width: 100%; }
.btn-lg { padding: 0.85rem 2rem; font-size: 0.95rem; }
.btn-deploy { padding: 0.85rem 2.5rem; font-size: 1rem; font-weight: 700; }
.data-src-btn { padding: 0.5rem 1rem; font-size: 0.85rem; border: 1px solid var(--border); opacity: 0.6; }
.data-src-btn.active { opacity: 1; border-color: var(--accent); background: var(--glow); color: var(--accent); }

/* ── Setup Steps ─────────────────────────────────────────── */
.setup-step {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.75rem;
  margin-bottom: 1rem; box-shadow: var(--shadow-sm);
  transition: all 0.3s; position: relative; overflow: hidden;
}
.setup-step::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0; transition: opacity 0.3s;
}
.setup-step:hover::before { opacity: 1; }
.setup-step-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.25rem; }
.step-number {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #0a0a0f;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; flex-shrink: 0;
}
.step-number.done { background: #10b981; }
.step-title { font-weight: 700; font-size: 0.95rem; }
.step-subtitle { color: var(--text-dim); font-size: 0.8rem; margin-left: auto; }

/* ── Profile Results ─────────────────────────────────────── */
.profile-results {
  background: rgba(0,212,255,0.04); border: 1px solid rgba(0,212,255,0.15);
  border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem;
}
.profile-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.profile-icon {
  width: 22px; height: 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: #0a0a0f; font-size: 11px;
}
.profile-label {
  font-weight: 600; font-size: 0.8rem; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.profile-summary { font-size: 0.9rem; line-height: 1.7; color: var(--text-dim); margin-bottom: 1.25rem; }
.profile-flags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.flag {
  display: inline-flex; align-items: center;
  padding: 0.25rem 0.65rem; border-radius: 6px;
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 500;
}
.flag-warn { background: rgba(255,107,107,0.1); color: var(--accent3); border: 1px solid rgba(255,107,107,0.2); }
.flag-info { background: rgba(0,212,255,0.08); color: var(--accent); border: 1px solid rgba(0,212,255,0.15); }
.flag-ok { background: rgba(16,185,129,0.1); color: #34d399; border: 1px solid rgba(16,185,129,0.2); }

/* ── Dashboard ───────────────────────────────────────────── */
.dashboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.stats-row { display: flex; gap: 1rem; margin-bottom: 2rem; }
.stat-card {
  flex: 1; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; text-align: center;
  box-shadow: var(--shadow-sm); transition: all 0.3s;
}
.stat-card:hover { border-color: rgba(0,212,255,0.2); background: var(--bg-card-hover); }
.stat-value {
  font-size: 1.5rem; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.stat-label {
  color: var(--text-dim); font-size: 0.7rem;
  text-transform: uppercase; letter-spacing: 0.06em; margin-top: 0.3rem; font-weight: 500;
}

/* ── Sections ────────────────────────────────────────────── */
.section { margin-bottom: 2.5rem; }
.section h2 {
  font-size: 0.8rem; font-weight: 600; margin-bottom: 1rem;
  color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em;
  font-family: var(--font-mono);
}
.section h2::before { content: '// '; color: var(--text-dim); }

/* ── Run Cards ───────────────────────────────────────────── */
.run-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; max-height: 600px; overflow-y: auto; padding-right: 0.5rem; }
.run-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  text-decoration: none; color: var(--text);
  transition: all 0.35s; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.run-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0; transition: opacity 0.35s;
}
.run-card:hover {
  border-color: rgba(0,212,255,0.2); background: var(--bg-card-hover);
  transform: translateY(-3px); box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}
.run-card:hover::before { opacity: 1; }
.run-card-active { border-left: 3px solid #10b981; }
.run-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.run-name { font-weight: 700; font-size: 0.95rem; }
.run-meta { color: var(--text-dim); font-size: 0.8rem; margin-top: 0.25rem; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 0.2rem 0.65rem; border-radius: 999px;
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  font-family: var(--font-mono);
}
.badge-active { background: rgba(16,185,129,0.15); color: #34d399; }
.badge-complete { background: rgba(0,212,255,0.1); color: var(--accent); }
.badge-pending { background: rgba(123,97,255,0.15); color: var(--accent2); }

/* ── Tables ──────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; padding: 0.75rem 1rem;
  font-size: 0.7rem; font-weight: 600; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
}
.table td {
  padding: 0.875rem 1rem; border-bottom: 1px solid var(--border);
  font-size: 0.875rem; color: var(--text);
}
.table tbody tr { cursor: pointer; transition: all 0.2s; }
.table tbody tr:hover { background: var(--bg-card); }

/* ── Detail Grid ─────────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.detail-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 1rem; box-shadow: var(--shadow-sm);
  transition: all 0.3s;
}
.detail-item:hover { border-color: rgba(0,212,255,0.15); }
.detail-label {
  display: block; font-size: 0.7rem; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.4rem;
  font-family: var(--font-mono); font-weight: 500;
}
.detail-value { font-size: 0.95rem; font-weight: 600; }
.detail-value.highlight {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  font-size: 1.15rem; font-weight: 800;
}
.detail-value.mono { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-dim); }

/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 3rem; color: var(--text-dim);
  background: var(--bg-card); border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.empty-state a { color: var(--accent); text-decoration: none; }
.empty-state a:hover { text-decoration: underline; }

/* ── Alerts ──────────────────────────────────────────────── */
.alert { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: 0.875rem; }
.alert-error { background: rgba(255,107,107,0.1); color: var(--accent3); border: 1px solid rgba(255,107,107,0.2); }

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  text-align: center; padding: 2.5rem; border-top: 1px solid var(--border);
  position: relative; z-index: 1;
}
.footer p, .footer { font-size: 0.8rem; color: var(--text-dim); }
.footer a { color: var(--accent); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ── Workspace Layout (New Run) ─────────────────────────── */
.run-workspace {
  display: grid; grid-template-columns: 1fr 300px; gap: 1.5rem;
  align-items: start; max-width: 1100px; margin: 0 auto;
}
.workspace-main { min-width: 0; }

/* ── Sidebar ────────────────────────────────────────────── */
.workspace-sidebar {
  position: sticky; top: 72px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
}
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: rgba(0,212,255,0.03);
}
.sidebar-title {
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-dim); font-family: var(--font-mono);
}
.sidebar-badge {
  display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px;
  font-size: 0.65rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; font-family: var(--font-mono);
  background: rgba(123,97,255,0.15); color: var(--accent2);
}
.config-entries { padding: 0.5rem 0; }
.config-entry {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.6rem 1.25rem;
  transition: background 0.3s;
}
.config-entry:hover { background: rgba(255,255,255,0.02); }
.config-label {
  font-size: 0.75rem; color: var(--text-dim); font-weight: 500;
}
.config-value {
  font-size: 0.8rem; font-weight: 600; color: var(--text);
  font-family: var(--font-mono); text-align: right; max-width: 160px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.config-updated {
  animation: config-flash 2s ease-out;
}
@keyframes config-flash {
  0% { background: rgba(0,212,255,0.15); }
  100% { background: transparent; }
}
.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

/* ── AI Message Card ────────────────────────────────────── */
.ai-message {
  display: flex; gap: 0.75rem; align-items: flex-start;
  padding: 1.25rem; margin-bottom: 1.5rem;
  background: rgba(123,97,255,0.06); border: 1px solid rgba(123,97,255,0.15);
  border-radius: var(--radius);
  font-size: 0.9rem; line-height: 1.65; color: var(--text);
}
.ai-avatar {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: var(--bg); font-family: var(--font-mono);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700;
}
.ai-text { flex: 1; }

/* ── Recommendation Cards Grid ──────────────────────────── */
.rec-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem;
}
.rec-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 1.1rem;
  transition: all 0.3s; position: relative; overflow: hidden;
}
.rec-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent2), transparent);
  opacity: 0; transition: opacity 0.3s;
}
.rec-card:hover { border-color: rgba(123,97,255,0.3); transform: translateY(-2px); }
.rec-card:hover::before { opacity: 1; }
.rec-card-wide { grid-column: 1 / -1; }
.rec-card-header {
  display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem;
}
.rec-icon {
  font-size: 1rem; line-height: 1;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.rec-label {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--text-dim); font-family: var(--font-mono);
}
.rec-value {
  font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: 0.4rem;
  font-family: var(--font-mono);
}
.rec-detail { font-size: 0.78rem; color: var(--text-dim); line-height: 1.55; }
.rec-models { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.5rem; }
.model-chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.3rem 0.7rem; border-radius: 6px;
  background: rgba(0,212,255,0.08); border: 1px solid rgba(0,212,255,0.15);
  font-size: 0.78rem; font-weight: 600; color: var(--accent);
  font-family: var(--font-mono);
}
.model-chip em { font-style: normal; color: var(--text-dim); font-weight: 400; }
.fe-item {
  padding: 0.6rem 0; border-bottom: 1px solid var(--border);
  font-size: 0.85rem; line-height: 1.55;
}
.fe-item:last-child { border-bottom: none; padding-bottom: 0; }
.fe-item strong { color: var(--text); font-weight: 600; }

/* ── Chat Thread ────────────────────────────────────────── */
.chat-thread {
  max-height: 350px; overflow-y: auto; padding: 0.5rem 0; margin-bottom: 1rem;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.chat-thread::-webkit-scrollbar { width: 6px; }
.chat-thread::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.chat-msg {
  display: flex; gap: 0.6rem; padding: 0.6rem 0;
  animation: float-in 0.3s ease-out;
}
.chat-msg-user { justify-content: flex-end; }
.chat-msg-user .chat-text {
  background: rgba(0,212,255,0.1); border: 1px solid rgba(0,212,255,0.2);
  border-radius: 12px 12px 4px 12px;
  padding: 0.6rem 1rem; max-width: 80%;
  font-size: 0.85rem; color: var(--text);
}
.chat-msg-ai {
  align-items: flex-start;
}
.chat-msg-ai .chat-text {
  background: rgba(123,97,255,0.08); border: 1px solid rgba(123,97,255,0.15);
  border-radius: 12px 12px 12px 4px;
  padding: 0.6rem 1rem; max-width: 85%;
  font-size: 0.85rem; color: var(--text); line-height: 1.55;
}
.chat-input-row { display: flex; gap: 0.5rem; }
.chat-input {
  flex: 1; padding: 0.65rem 1rem;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font-family: var(--font-sans); font-size: 0.875rem;
  transition: border-color 0.2s;
}
.chat-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,212,255,0.1); }
.chat-input::placeholder { color: var(--text-dim); }
.btn-chat { flex-shrink: 0; padding: 0.65rem 1.25rem; }

/* ── Step Actions ───────────────────────────────────────── */
.step-actions { margin-top: 1.25rem; display: flex; gap: 0.5rem; }

/* ── Launch Summary ─────────────────────────────────────── */
.launch-summary {
  padding: 1.25rem; margin-bottom: 1rem;
  background: rgba(16,185,129,0.05); border: 1px solid rgba(16,185,129,0.15);
  border-radius: var(--radius); line-height: 1.65; font-size: 0.9rem;
}
.launch-summary strong { color: var(--accent); }

/* ── Textarea ───────────────────────────────────────────── */
textarea {
  width: 100%; padding: 0.65rem 0.85rem;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-family: var(--font-sans); font-size: 0.875rem;
  resize: vertical; transition: border-color 0.2s; line-height: 1.55;
}
textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0,212,255,0.1); }
textarea::placeholder { color: var(--text-dim); }

/* ── File Input (workspace) ─────────────────────────────── */
.field input[type="file"] { padding: 0.5rem; cursor: pointer; }
.field input[type="file"]::file-selector-button {
  background: var(--bg-card); color: var(--text-dim); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.3rem 0.75rem; font-size: 0.8rem; cursor: pointer;
  transition: all 0.2s; margin-right: 0.5rem;
}
.field input[type="file"]::file-selector-button:hover {
  background: var(--bg-card-hover); border-color: var(--accent);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .run-workspace { grid-template-columns: 1fr; }
  .workspace-sidebar { position: static; order: -1; }
  .rec-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .stats-row { flex-direction: column; }
  .form-row, .form-grid { flex-direction: column; grid-template-columns: 1fr; }
  .container { padding: 1rem; }
  .topbar { padding: 0 1rem; }
  .topbar-nav { gap: 1rem; }
  .login-container { margin: 1rem; }
}
