/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0f0f13;
  --bg2: #1a1a24;
  --bg3: #22223a;
  --border: #2e2e4a;
  --accent: #6c63ff;
  --accent2: #a78bfa;
  --green: #22c55e;
  --red: #ef4444;
  --yellow: #f59e0b;
  --text: #e2e2f0;
  --text2: #8888aa;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
}
body { background: var(--bg); color: var(--text); font-family: 'Segoe UI', system-ui, sans-serif; min-height: 100vh; }

/* ── Layout ──────────────────────────────────────────────── */
#app { display: flex; min-height: 100vh; }

.sidebar {
  width: 220px; min-height: 100vh; background: var(--bg2);
  border-right: 1px solid var(--border); display: flex;
  flex-direction: column; padding: 20px 0; position: fixed; top: 0; left: 0;
}
.main-content { margin-left: 220px; flex: 1; padding: 32px; }

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar-logo { display: flex; align-items: center; gap: 10px; padding: 0 20px 24px; border-bottom: 1px solid var(--border); }
.logo-icon { font-size: 26px; }
.logo-text { font-size: 18px; font-weight: 700; color: var(--accent2); }

.sidebar-nav { flex: 1; padding: 16px 0; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; color: var(--text2); text-decoration: none;
  transition: all 0.2s; cursor: pointer; border: none; background: none;
  font-size: 14px; width: 100%;
}
.nav-item:hover { color: var(--text); background: var(--bg3); }
.nav-item.active { color: var(--accent2); background: rgba(108,99,255,0.15); border-right: 3px solid var(--accent); }
.nav-icon { font-size: 16px; }
.badge { margin-left: auto; background: var(--accent); color: white; border-radius: 10px; padding: 1px 7px; font-size: 11px; font-weight: 700; }

.sidebar-footer { padding: 16px 20px; border-top: 1px solid var(--border); }
.provider-status { font-size: 12px; color: var(--text2); margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.btn-logout { width: 100%; padding: 8px; background: transparent; border: 1px solid var(--border); color: var(--text2); border-radius: 8px; cursor: pointer; font-size: 13px; }
.btn-logout:hover { border-color: var(--red); color: var(--red); }

/* ── Section header ──────────────────────────────────────── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.section-header h2 { font-size: 22px; font-weight: 700; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary { background: var(--accent); color: white; border: none; padding: 10px 20px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600; transition: opacity 0.2s; }
.btn-primary:hover { opacity: 0.85; }
.btn-primary.btn-large { width: 100%; padding: 14px; font-size: 16px; margin-top: 8px; }
.btn-secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border); padding: 9px 18px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.btn-approve { background: var(--green); color: white; border: none; padding: 8px 16px; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 13px; }
.btn-reject { background: transparent; color: var(--red); border: 1px solid var(--red); padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.btn-regen { background: transparent; color: var(--accent2); border: 1px solid var(--accent); padding: 8px 16px; border-radius: 6px; cursor: pointer; font-size: 13px; }

/* ── Login ───────────────────────────────────────────────── */
#section-login { display: flex; align-items: center; justify-content: center; min-height: 90vh; }
.login-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px; width: 360px; text-align: center; }
.login-card h1 { font-size: 28px; margin-bottom: 8px; }
.login-card p { color: var(--text2); margin-bottom: 24px; }
.login-card input, .login-card select { width: 100%; padding: 12px; margin-bottom: 12px; background: var(--bg3); border: 1px solid var(--border); color: var(--text); border-radius: 8px; font-size: 14px; }
.form-error { color: var(--red); font-size: 13px; margin-top: 8px; }
.form-success { color: var(--green); font-size: 14px; margin-top: 12px; padding: 10px; background: rgba(34,197,94,0.1); border-radius: 8px; }
.register-link { font-size: 13px; color: var(--text2); margin-top: 16px; }
.register-link a { color: var(--accent2); cursor: pointer; }

/* ── Posts Grid ──────────────────────────────────────────── */
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.empty-state { color: var(--text2); font-size: 15px; padding: 40px; text-align: center; }

.post-card {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: border-color 0.2s;
}
.post-card:hover { border-color: var(--accent); }

.post-card-img { width: 100%; height: 200px; object-fit: cover; background: var(--bg3); display: flex; align-items: center; justify-content: center; color: var(--text2); font-size: 13px; }
.post-card-img img { width: 100%; height: 100%; object-fit: cover; }

.post-card-body { padding: 16px; }
.post-platform { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; margin-bottom: 10px; background: rgba(108,99,255,0.2); color: var(--accent2); }
.post-caption { font-size: 13px; color: var(--text); line-height: 1.5; margin-bottom: 12px; max-height: 72px; overflow: hidden; }
.post-hashtags { font-size: 11px; color: var(--accent2); margin-bottom: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* QA Score bar */
.qa-bar { margin-bottom: 14px; }
.qa-bar-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--text2); margin-bottom: 4px; }
.qa-bar-track { height: 6px; background: var(--bg3); border-radius: 3px; }
.qa-bar-fill { height: 6px; border-radius: 3px; transition: width 0.5s; }
.qa-high { background: var(--green); }
.qa-mid { background: var(--yellow); }
.qa-low { background: var(--red); }

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

/* ── Forms ───────────────────────────────────────────────── */
.campaign-form, .brand-form-card { max-width: 640px; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; color: var(--text2); margin-bottom: 6px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 11px 14px; background: var(--bg3);
  border: 1px solid var(--border); color: var(--text); border-radius: 8px;
  font-size: 14px; font-family: inherit; transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--accent);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.checkbox-group { display: flex; gap: 16px; flex-wrap: wrap; }
.checkbox-group label { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text); cursor: pointer; }

/* ── Campaigns list ──────────────────────────────────────── */
.campaign-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.campaign-card-left h3 { font-size: 16px; margin-bottom: 4px; }
.campaign-card-left p { font-size: 13px; color: var(--text2); }
.status-badge { padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.status-draft { background: rgba(100,100,120,0.3); color: #aaa; }
.status-active { background: rgba(34,197,94,0.2); color: var(--green); }
.status-completed { background: rgba(108,99,255,0.2); color: var(--accent2); }

/* ── Modal ───────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.7); }
.modal-content { position: relative; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); max-width: 600px; width: 90%; max-height: 90vh; overflow-y: auto; padding: 28px; box-shadow: var(--shadow); }
.modal-close { position: absolute; top: 16px; right: 16px; background: var(--bg3); border: none; color: var(--text); width: 30px; height: 30px; border-radius: 6px; cursor: pointer; font-size: 14px; }

/* ── Toast ───────────────────────────────────────────────── */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 20px; border-radius: 8px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow); animation: slideIn 0.3s ease; }
.toast-success { background: #166534; color: #bbf7d0; border: 1px solid var(--green); }
.toast-error { background: #7f1d1d; color: #fecaca; border: 1px solid var(--red); }
.toast-info { background: #1e1b4b; color: #c4b5fd; border: 1px solid var(--accent); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Brands ──────────────────────────────────────────────── */
.brand-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; align-items: center; gap: 16px; margin-bottom: 10px; }
.brand-avatar { width: 44px; height: 44px; border-radius: 10px; background: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; color: white; }
.brand-info h3 { font-size: 15px; margin-bottom: 2px; }
.brand-info p { font-size: 12px; color: var(--text2); }

/* ── UGC Studio ──────────────────────────────────────────── */
.ugc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ugc-panel { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.panel-title { font-size: 16px; font-weight: 700; margin-bottom: 18px; color: var(--accent2); }
.script-section { margin-bottom: 14px; }
.script-label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text2); margin-bottom: 5px; letter-spacing: 0.5px; }
.hook-label { color: var(--yellow) !important; }
.cta-label { color: var(--green) !important; }
.script-text { font-size: 14px; line-height: 1.6; color: var(--text); background: var(--bg3); padding: 10px 14px; border-radius: 8px; border-left: 3px solid var(--accent); }
.script-meta { display: flex; gap: 16px; margin-top: 12px; font-size: 12px; color: var(--text2); }
.script-hashtags { margin-top: 8px; font-size: 12px; color: var(--accent2); }
.broll-list { margin: 6px 0 0 16px; font-size: 13px; color: var(--text2); line-height: 1.8; }
.ugc-gen-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ugc-status { margin-top: 12px; padding: 12px 16px; background: rgba(108,99,255,0.1); border: 1px solid var(--accent); border-radius: 8px; font-size: 13px; color: var(--accent2); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .logo-text, .nav-item span:not(.nav-icon), .sidebar-footer .provider-status { display: none; }
  .main-content { margin-left: 60px; padding: 16px; }
  .form-row { grid-template-columns: 1fr; }
  .ugc-grid { grid-template-columns: 1fr; }
  .ugc-gen-grid { grid-template-columns: 1fr; }
}

/* ── Engagement Dashboard ────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 16px; text-align: center; }
.stat-card.positive { border-color: #22c55e44; }
.stat-card.negative { border-color: #ef444444; }
.stat-card.neutral  { border-color: var(--border); }
.stat-card.highlight { border-color: var(--accent); background: rgba(108,99,255,0.1); }
.stat-value { font-size: 26px; font-weight: 700; color: var(--accent2); }
.stat-label { font-size: 11px; color: var(--text2); margin-top: 4px; }

.engagement-list { display: flex; flex-direction: column; gap: 10px; }
.engagement-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.engagement-card.sentiment-positive { border-left: 3px solid #22c55e; }
.engagement-card.sentiment-negative { border-left: 3px solid #ef4444; }
.engagement-card.sentiment-neutral  { border-left: 3px solid var(--border); }
.eng-header { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.eng-platform { font-size: 12px; font-weight: 600; color: var(--accent2); }
.eng-type { font-size: 11px; background: var(--bg3); padding: 2px 8px; border-radius: 20px; color: var(--text2); }
.eng-status { font-size: 11px; padding: 2px 8px; border-radius: 20px; }
.status-pending { background: #f59e0b22; color: var(--yellow); }
.status-sent    { background: #22c55e22; color: var(--green); }
.status-failed  { background: #ef444422; color: var(--red); }
.status-skipped { background: var(--bg3); color: var(--text2); }
.eng-time { font-size: 11px; color: var(--text2); margin-left: auto; }
.eng-user { font-size: 12px; color: var(--text2); margin-bottom: 6px; }
.eng-text { font-size: 14px; color: var(--text); line-height: 1.5; }
.eng-reply { margin-top: 8px; padding: 8px 12px; background: rgba(108,99,255,0.08); border-radius: 8px; font-size: 13px; }
.reply-label { font-size: 11px; text-transform: uppercase; color: var(--text2); margin-right: 6px; }
.eng-actions { display: flex; gap: 8px; margin-top: 10px; }
.btn-small { padding: 5px 12px; border-radius: 6px; font-size: 12px; border: none; cursor: pointer; font-weight: 600; }
.btn-small.btn-primary { background: var(--accent); color: white; }
.btn-small.btn-secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }

.filter-select { background: var(--bg2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; font-size: 13px; }

/* ── Analytics Dashboard ─────────────────────────────────── */
.platform-breakdown { display: flex; flex-direction: column; gap: 8px; }
.platform-row { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.plat-name { font-weight: 600; min-width: 120px; }
.plat-stat { font-size: 13px; color: var(--text2); }
.plat-stat b { color: var(--text); }

.sentiment-bars { display: flex; flex-direction: column; gap: 12px; max-width: 500px; }
.sent-row { display: flex; align-items: center; gap: 12px; }
.sent-label { width: 80px; font-size: 13px; color: var(--text2); }
.sent-bar-wrap { flex: 1; background: var(--bg3); border-radius: 4px; height: 12px; overflow: hidden; }
.sent-bar { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.sent-count { font-size: 12px; color: var(--text2); min-width: 70px; text-align: right; }

/* ── Agent Monitor ────────────────────────────────────────── */
.pipeline-schema { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin: 24px 0; }
.pipeline-title { font-size: 13px; text-transform: uppercase; color: var(--text2); letter-spacing: 1px; margin-bottom: 16px; }
.pipeline-steps { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pipe-step { background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; text-align: center; min-width: 110px; position: relative; }
.pipe-step:hover { border-color: var(--accent); }
.pipe-icon { font-size: 20px; }
.pipe-name { font-size: 12px; font-weight: 700; margin-top: 4px; }
.pipe-desc { font-size: 10px; color: var(--text2); margin-top: 2px; }
.pipe-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); position: absolute; top: 6px; right: 6px; }
.pipe-dot.dot-running { background: var(--yellow); animation: pulse 1s infinite; }
.pipe-dot.dot-success { background: var(--green); }
.pipe-dot.dot-failed  { background: var(--red); }
.pipe-dot.dot-skipped { background: var(--text2); }
.pipe-arrow { color: var(--text2); font-size: 18px; flex-shrink: 0; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

.agent-log-list { display: flex; flex-direction: column; gap: 2px; font-size: 13px; font-family: monospace; max-height: 500px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); padding: 8px; }
.log-row { display: flex; align-items: baseline; gap: 10px; padding: 6px 8px; border-radius: 6px; flex-wrap: wrap; }
.log-row:hover { background: var(--bg2); }
.log-row.log-failed { background: rgba(239,68,68,0.07); }
.log-row.log-running { background: rgba(245,158,11,0.07); }
.log-time { color: var(--text2); min-width: 55px; }
.log-agent { color: var(--accent2); min-width: 80px; }
.log-action { color: var(--text2); min-width: 120px; }
.log-status-badge { font-size: 10px; padding: 1px 7px; border-radius: 10px; }
.log-msg { color: var(--text); flex: 1; }
.log-dur { color: var(--text2); font-size: 10px; }
.status-success { background: #22c55e22; color: var(--green); }
.status-failed  { background: #ef444422; color: var(--red); }
.status-running { background: #f59e0b22; color: var(--yellow); }
.status-skipped { background: var(--bg3); color: var(--text2); }
.sys-indicator { font-size: 14px; }
.badge-error { background: var(--red) !important; }

/* ── Settings Panel ───────────────────────────────────────── */
.settings-tabs { display: flex; gap: 8px; margin: 16px 0; border-bottom: 1px solid var(--border); padding-bottom: 0; }
.tab-btn { background: none; border: none; color: var(--text2); padding: 10px 16px; cursor: pointer; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all 0.2s; }
.tab-btn.active { color: var(--accent2); border-bottom-color: var(--accent); }
.tab-btn:hover { color: var(--text); }
.tab-content { padding-top: 20px; }
.settings-note { font-size: 13px; color: var(--text2); margin-bottom: 20px; }
.settings-note code { background: var(--bg3); padding: 2px 6px; border-radius: 4px; font-family: monospace; }
.settings-group { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.settings-group-title { font-size: 13px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 16px; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.settings-field { display: flex; flex-direction: column; gap: 6px; }
.settings-field label { font-size: 13px; color: var(--text2); }
.settings-field input, .settings-field textarea { background: var(--bg3); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 9px 12px; font-size: 13px; font-family: inherit; width: 100%; transition: border-color 0.2s; }
.settings-field input:focus, .settings-field textarea:focus { outline: none; border-color: var(--accent); }
.key-badge { font-size: 10px; background: var(--bg3); padding: 1px 6px; border-radius: 10px; color: var(--text2); font-weight: normal; margin-left: 4px; }

/* ── Schema doc ───────────────────────────────────────────── */
.schema-doc { max-width: 900px; }
.schema-section { margin: 24px 0; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.schema-section h4 { margin-bottom: 16px; color: var(--accent2); }
.schema-flow { display: flex; flex-direction: column; gap: 4px; }
.schema-flow.horizontal { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; }
.schema-arrow { text-align: center; color: var(--text2); padding: 4px 0; }
.schema-flow.horizontal .schema-arrow { padding: 0 4px; }
.schema-block { background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 10px 16px; }
.schema-block.accent { border-left: 3px solid var(--accent); }
.schema-block.accent2 { border-left: 3px solid var(--green); }
.schema-block strong { display: block; margin-bottom: 2px; }
.schema-block small { font-size: 12px; color: var(--text2); display: block; }
.schema-block code { font-size: 11px; color: var(--accent2); font-family: monospace; margin-top: 4px; display: block; }
.schema-entities { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.schema-entity { background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; min-width: 160px; }
.schema-entity strong { display: block; margin-bottom: 6px; color: var(--accent2); }
.schema-entity ul { list-style: none; padding: 0; }
.schema-entity li { font-size: 11px; color: var(--text2); padding: 1px 0; }
.schema-rel { align-self: center; color: var(--text2); font-size: 18px; padding: 0 4px; }

.endpoint-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.endpoint-group { background: var(--bg3); border-radius: 10px; padding: 14px; }
.ep-title { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text2); margin-bottom: 8px; }
.ep-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 12px; }
.ep-row code { font-family: monospace; color: var(--text2); }
.ep-row span:last-child { color: var(--text2); font-size: 11px; }
.ep-method { font-size: 10px; padding: 1px 6px; border-radius: 4px; font-weight: 700; min-width: 40px; text-align: center; }
.ep-method.get  { background: #22c55e22; color: var(--green); }
.ep-method.post { background: #6c63ff22; color: var(--accent2); }
.ep-method.put  { background: #f59e0b22; color: var(--yellow); }

/* ── Prompt editor ────────────────────────────────────────── */
.prompt-textarea {
  font-family: 'Consolas', 'Cascadia Code', monospace;
  font-size: 12px;
  line-height: 1.6;
  resize: vertical;
  min-height: 120px;
}

/* ── Research section ─────────────────────────────────────── */
.research-controls { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 24px; }
.section-desc { font-size: 13px; color: var(--text2); margin-left: 12px; }
.research-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.research-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.research-card h3 { font-size: 14px; font-weight: 600; margin-bottom: 12px; color: var(--accent2); }
.research-card-wide { grid-column: span 2; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.research-tag { background: var(--bg3); border: 1px solid var(--accent); color: var(--accent2); border-radius: 20px; padding: 4px 10px; font-size: 12px; }
.research-list { list-style: none; padding: 0; }
.research-list li { padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text); }
.research-list li:last-child { border-bottom: none; }
.recommendations-list li { color: var(--green); }
.audience-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.audience-item { background: var(--bg3); border-radius: 8px; padding: 10px 14px; font-size: 13px; }
.audience-item strong { display: block; color: var(--text2); font-size: 11px; text-transform: uppercase; margin-bottom: 4px; }
.times-grid { display: flex; flex-direction: column; gap: 6px; }
.time-item { font-size: 13px; }
.time-item strong { color: var(--text2); }
.competitor-item { background: var(--bg3); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; }
.competitor-item strong { display: block; color: var(--accent2); margin-bottom: 4px; }
.comp-strength { font-size: 12px; color: var(--green); margin-top: 4px; }
.comp-weakness { font-size: 12px; color: var(--yellow); margin-top: 2px; }
.research-meta { margin-top: 16px; text-align: right; }
.badge-green { background: #22c55e22; color: var(--green); border: 1px solid var(--green); border-radius: 20px; padding: 4px 12px; font-size: 12px; }
.badge-blue  { background: #6c63ff22; color: var(--accent2); border: 1px solid var(--accent); border-radius: 20px; padding: 4px 12px; font-size: 12px; }

/* ── Pipeline tracker ─────────────────────────────────────── */
.pipeline-tracker { background: var(--bg3); border: 1px solid var(--accent); border-radius: var(--radius); padding: 16px 20px; }
.tracker-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.tracker-hint { font-size: 11px; color: var(--text2); }
.tracker-steps { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
.tracker-step { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.tstep-arrow { color: var(--text2); font-size: 14px; padding: 0 2px; }
.tstep-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot-pending  { background: var(--bg2); border: 2px solid var(--border); }
.dot-waiting  { background: var(--bg2); border: 2px solid var(--accent2); }
.dot-running  { background: var(--accent); animation: pulse 1s infinite; }
.dot-success  { background: var(--green); }
.dot-error    { background: var(--red); }
.tracker-msg  { font-size: 12px; color: var(--text2); font-style: italic; }
.tracker-msg a { color: var(--accent2); }

/* ── Pipeline sidebar indikátor ───────────────────────────── */
.pipeline-indicator { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--bg3); border-top: 1px solid var(--border); font-size: 12px; color: var(--accent2); }
.pi-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1s infinite; flex-shrink: 0; }
.nav-running { position: relative; }
.nav-running::after { content: ""; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 1s infinite; }

/* ── Trace viewer ─────────────────────────────────────────── */
.trace-controls { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.trace-header-card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 16px; }
.trace-brief { font-size: 12px; color: var(--text2); margin-top: 6px; max-height: 60px; overflow: hidden; }
.trace-meta { font-size: 11px; color: var(--accent2); margin-top: 4px; }

.trace-step { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; overflow: hidden; }
.trace-step-success { border-left: 3px solid var(--green); }
.trace-step-failed  { border-left: 3px solid var(--red); }
.trace-step-running { border-left: 3px solid var(--accent); }
.trace-step-skipped { border-left: 3px solid var(--text2); }

.trace-step-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; cursor: pointer; user-select: none; }
.trace-step-header:hover { background: var(--bg3); }
.trace-step-left { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.trace-step-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.trace-step-num { background: var(--bg3); color: var(--text2); border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; }
.trace-step-icon { font-size: 18px; flex-shrink: 0; }
.trace-step-title { font-weight: 600; font-size: 13px; }
.trace-step-msg { font-size: 12px; color: var(--text2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 400px; }
.trace-tokens { font-size: 11px; color: var(--text2); background: var(--bg3); border-radius: 10px; padding: 2px 8px; }
.trace-dur { font-size: 12px; color: var(--accent2); font-weight: 600; }
.trace-time { font-size: 11px; color: var(--text2); }
.trace-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.trace-expand-icon { font-size: 11px; color: var(--text2); }

.trace-step-body { border-top: 1px solid var(--border); padding: 0; }
.trace-section { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.trace-section:last-child { border-bottom: none; }
.trace-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text2); margin-bottom: 8px; letter-spacing: 0.5px; }
.trace-section-prompt .trace-section-title { color: #60a5fa; }
.trace-section-response .trace-section-title { color: var(--green); }
.trace-section-json .trace-section-title { color: var(--accent2); }
.trace-section-error .trace-section-title { color: var(--red); }
.trace-section-url .trace-section-title { color: var(--yellow); }
.trace-pre { font-family: 'Consolas', 'Cascadia Code', monospace; font-size: 12px; line-height: 1.6; color: var(--text); background: var(--bg); border-radius: 6px; padding: 12px; white-space: pre-wrap; word-break: break-word; max-height: 400px; overflow-y: auto; }
.trace-url-link { color: var(--accent2); font-size: 13px; word-break: break-all; }
.trace-no-detail { padding: 12px; font-size: 12px; color: var(--text2); font-style: italic; }
