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

:root {
    --bg: #0f1117;
    --bg2: #1a1d27;
    --bg3: #22263a;
    --border: rgba(125,211,252,0.12);
    --accent: #7dd3fc;
    --accent2: #a78bfa;
    --green: #10b981;
    --text: #e2e8f0;
    --text-muted: #8892a4;
    --radius: 10px;
    --font: 'Inter', sans-serif;
    --mono: 'Fira Code', monospace;
}

body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; min-height: 100vh; }

.container { max-width: 1400px; margin: 0 auto; padding: 24px; }

/* ── Header ── */
.header { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; margin-bottom: 20px; }

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

/* ── Brand lockup: parrot + title ──────────────────────── */
.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.header-parrot {
    height: 52px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
    filter: drop-shadow(0 2px 10px rgba(0,0,0,0.6));
    transition: transform 0.3s ease, filter 0.3s ease;
}
.header-parrot:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 4px 16px rgba(59,130,246,0.4));
}
.header h1 { font-size: 26px; color: #fff; margin: 0; line-height: 1.15; }
/* Remove old pseudo — parrot image replaces it */
.header h1::before { content: none; }

.header-badges { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }

.version-badge { display: inline-flex; align-items: center; padding: 6px 14px; background: linear-gradient(135deg, #10b981, #059669); color: #fff; font-size: 12px; font-weight: 700; border-radius: 20px; box-shadow: 0 2px 8px rgba(16,185,129,0.3); }

.changelog-btn { display: inline-flex; align-items: center; padding: 6px 14px; background: rgba(125,211,252,0.1); color: var(--accent); font-size: 12px; font-weight: 600; border-radius: 20px; border: 1.5px solid rgba(125,211,252,0.3); text-decoration: none; transition: all 0.2s; }
.changelog-btn:hover { background: rgba(125,211,252,0.2); transform: translateY(-1px); }
.crosslink-btn { display: inline-flex; align-items: center; padding: 6px 14px; background: rgba(16,185,129,0.1); color: #10b981; font-size: 12px; font-weight: 600; border-radius: 20px; border: 1.5px solid rgba(16,185,129,0.35); text-decoration: none; transition: all 0.2s; white-space: nowrap; font-family: 'Fira Code', monospace; }
.crosslink-btn:hover { background: rgba(16,185,129,0.2); border-color: rgba(16,185,129,0.6); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(16,185,129,0.2); }
.support-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%); border: 1px solid #fbbf24; border-radius: 20px; color: #1e1e2e; font-size: 12px; font-weight: 700; text-decoration: none; transition: all 0.2s; white-space: nowrap; }
.support-btn:hover { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(251,191,36,0.4); }
.support-icon { font-size: 14px; line-height: 1; }
.support-text { font-family: 'Inter', sans-serif; }

/* ── Overview ── */
.overview-section { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.overview-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.overview-heading { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 10px; }

.overview-text { font-size: 13px; color: #c0c0d8; line-height: 1.7; margin-bottom: 8px; }

.overview-list { list-style: disc; padding-left: 20px; margin: 8px 0 0 0; }
.overview-list li { font-size: 13px; color: #c0c0d8; line-height: 1.7; margin-bottom: 4px; }

/* ── How It Works ── */
.how-it-works { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.how-step { display: flex; align-items: center; gap: 10px; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 10px 16px; }
.step-number { width: 26px; height: 26px; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; font-weight: 700; font-size: 13px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.step-text { font-size: 13px; color: var(--text); }
.how-arrow { color: var(--accent); font-size: 18px; font-weight: 700; }

/* ── Value Props ── */
.header-value-props { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.value-prop { display: flex; align-items: flex-start; gap: 12px; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.value-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.value-text { display: flex; flex-direction: column; gap: 3px; }
.value-text strong { font-size: 13px; color: var(--text); }
.value-text span { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* ── Settings ── */
.settings-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.setting-group { display: flex; flex-direction: column; gap: 6px; }
.setting-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.key-hint { font-size: 10px; color: var(--green); text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 4px; }
.setting-select, .setting-input { background: var(--bg3); border: 1px solid var(--border); border-radius: 6px; color: var(--text); padding: 8px 12px; font-size: 13px; font-family: var(--font); outline: none; transition: border 0.2s; }
.setting-select:focus, .setting-input:focus { border-color: var(--accent); }
.api-key-group { flex: 1; min-width: 280px; }
.api-key-input-wrap { display: flex; gap: 6px; }
.api-key-input-wrap .setting-input { flex: 1; font-family: var(--mono); font-size: 12px; }
.toggle-key-btn, .save-key-btn { padding: 8px 12px; border-radius: 6px; border: 1px solid var(--border); cursor: pointer; font-size: 12px; font-weight: 600; transition: all 0.2s; }
.toggle-key-btn { background: var(--bg3); color: var(--text-muted); }
.save-key-btn { background: linear-gradient(135deg, var(--green), #059669); color: #fff; border-color: transparent; }
.save-key-btn:hover { opacity: 0.85; }
.key-status { margin-top: 8px; font-size: 12px; min-height: 16px; }
.key-status.ok { color: var(--green); }
.key-status.err { color: #f87171; }

/* ── Feature Badges ── */
.header-features {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}
.feature-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(125, 211, 252, 0.1);
    border: 1px solid rgba(125, 211, 252, 0.3);
    border-radius: 20px;
    font-size: 13px;
    color: #7dd3fc;
    font-weight: 500;
    transition: all 0.2s;
}
.feature-badge:hover {
    background: rgba(125, 211, 252, 0.15);
    border-color: rgba(125, 211, 252, 0.5);
    transform: translateY(-1px);
}

/* ── Demo Section ───────────────────────────────────────────────── */
.demo-section {
    background: linear-gradient(135deg, rgba(16,185,129,0.08) 0%, rgba(59,130,246,0.08) 100%);
    border-top: 1px solid rgba(125,211,252,0.15);
    border-bottom: 1px solid rgba(125,211,252,0.15);
    padding: 48px 32px;
}
.demo-container { max-width: 1300px; margin: 0 auto; }
.demo-title {
    font-size: 28px; font-weight: 700; color: #fff;
    display: flex; align-items: center; gap: 12px;
    justify-content: center; margin-bottom: 10px;
}
.demo-icon { font-size: 32px; }
.demo-subtitle {
    text-align: center; color: #94a3b8; font-size: 15px;
    margin-bottom: 28px; max-width: 620px; margin-left: auto; margin-right: auto;
}
.demo-controls {
    display: flex; gap: 12px; justify-content: center; margin-bottom: 32px;
}
.demo-btn {
    padding: 10px 24px; border-radius: 8px; font-size: 14px; font-weight: 600;
    border: 2px solid rgba(125,211,252,0.3); background: rgba(125,211,252,0.08);
    color: #7dd3fc; cursor: pointer; transition: all 0.2s ease;
}
.demo-btn:hover { background: rgba(125,211,252,0.18); border-color: rgba(125,211,252,0.6); }
.demo-btn.primary {
    background: linear-gradient(135deg,#10b981,#059669);
    border-color: transparent; color: #fff;
    box-shadow: 0 4px 14px rgba(16,185,129,0.35);
}
.demo-btn.primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(16,185,129,0.5); }
.demo-panels {
    display: grid; grid-template-columns: 1fr 40px 1fr;
    gap: 0; align-items: start; margin-bottom: 28px;
}
.demo-column {
    display: flex; flex-direction: column; gap: 12px;
}
.demo-panel {
    background: #0f172a; border: 1px solid rgba(125,211,252,0.15);
    border-radius: 12px; overflow: visible;
    opacity: 0.45; transition: opacity 0.5s ease;
}
.demo-panel.active { opacity: 1; }
.demo-panel-header {
    padding: 12px 16px; background: rgba(125,211,252,0.07);
    border-bottom: 1px solid rgba(125,211,252,0.1);
    display: flex; align-items: center; gap: 10px;
}
.demo-step {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: #7dd3fc;
    background: rgba(125,211,252,0.12); padding: 3px 9px; border-radius: 20px;
}
.demo-panel-header h3 { font-size: 13px; font-weight: 600; color: #e2e8f0; margin: 0; }
.demo-code {
    padding: 20px; min-height: 360px; max-height: none; overflow: visible;
}
.demo-code pre { margin: 0; }
.demo-code code {
    font-family: 'Fira Code', monospace; font-size: 13px;
    color: #a5f3fc; line-height: 1.7; white-space: pre-wrap; word-break: break-word;
}
.demo-issues, .demo-benefits {
    padding: 10px 16px; display: flex; flex-wrap: wrap; gap: 8px;
    border-top: 1px solid rgba(125,211,252,0.1); transition: opacity 0.5s ease;
}
.issue-badge {
    font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 20px;
    background: rgba(239,68,68,0.15); color: #f87171;
    border: 1px solid rgba(239,68,68,0.3);
}
.benefit-badge {
    font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 20px;
    background: rgba(16,185,129,0.15); color: #34d399;
    border: 1px solid rgba(16,185,129,0.3);
}
.demo-arrow {
    display: flex; align-items: center; justify-content: center;
    font-size: 36px; color: #7dd3fc; padding-top: 160px;
    text-shadow: 0 0 12px rgba(125,211,252,0.4);
}
.demo-stats {
    display: flex; flex-direction: column;
    gap: 0; margin-bottom: 28px;
    background: rgba(15,23,42,0.6);
    border: 1px solid rgba(125,211,252,0.15);
    border-radius: 16px; overflow: hidden;
}

/* ── Score Cards (per-panel) ── */
.demo-score-card {
    background: rgba(15,23,42,0.7);
    border: 1px solid rgba(125,211,252,0.15);
    border-radius: 12px; padding: 16px 18px;
    backdrop-filter: blur(8px);
}
.score-card-title {
    font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; margin-bottom: 12px;
}
.score-card-title.bad  { color: #f87171; }
.score-card-title.good { color: #34d399; }
.score-card-row {
    display: flex; gap: 16px;
}
.score-card-metric {
    flex: 1; display: flex; flex-direction: column; gap: 4px;
}
.score-card-label {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; color: #64748b;
}
.score-card-num {
    font-size: 36px; font-weight: 800; line-height: 1;
    font-family: 'Fira Code', monospace;
}
.score-card-num.bad  { color: #f87171; }
.score-card-num.good { color: #34d399; }
.score-card-deltas {
    display: flex; gap: 12px; margin-top: 12px;
}

/* ── Shared score primitives ── */
.metrics-block { padding: 20px 28px; }
.score-divider {
    height: 1px; background: rgba(125,211,252,0.1); margin: 0;
}
.score-title {
    font-size: 13px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; color: #7dd3fc; margin-bottom: 16px;
}
.score-bar-track {
    height: 8px; background: rgba(255,255,255,0.06);
    border-radius: 99px; overflow: hidden; margin-top: 4px;
}
.score-bar {
    height: 100%; border-radius: 99px;
    transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
    width: 0%;
}
.score-bar.before { background: linear-gradient(90deg, #f87171, #fb923c); }
.score-bar.after  { background: linear-gradient(90deg, #34d399, #10b981); }
.score-delta {
    font-size: 12px; font-weight: 600;
    color: #34d399; transition: opacity 0.6s ease;
    display: flex; align-items: center; gap: 4px;
}
.score-delta::before { content: '▲'; font-size: 9px; }

/* ── Metric Pills ── */
.metrics-grid {
    display: flex; flex-wrap: wrap; gap: 8px;
}
.metric-pill {
    font-size: 12px; font-weight: 600;
    padding: 5px 12px; border-radius: 20px;
    background: rgba(52,211,153,0.1);
    border: 1px solid rgba(52,211,153,0.25);
    color: #34d399; transition: opacity 0.4s ease;
}

/* ── Legacy stat cards (kept for compatibility) ── */
.stat-card {
    background: rgba(125,211,252,0.07); border: 1px solid rgba(125,211,252,0.15);
    border-radius: 12px; padding: 20px 28px; text-align: center; min-width: 140px;
}
.stat-card.highlight {
    background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.3);
}
.stat-value { font-size: 32px; font-weight: 700; color: #7dd3fc; }
.stat-card.highlight .stat-value { color: #22c55e; }
.stat-label { font-size: 13px; color: #94a3b8; margin-top: 4px; }
.stat-arrow { font-size: 28px; color: #7dd3fc; }
.demo-cta {
    text-align: center; padding: 28px;
    background: rgba(59,130,246,0.08); border-radius: 12px;
    border: 2px solid rgba(59,130,246,0.3);
}
.demo-cta p { font-size: 18px; color: #fff; margin-bottom: 16px; font-weight: 600; }
.cta-btn {
    padding: 14px 36px; font-size: 16px; font-weight: 600; border: none;
    border-radius: 10px; cursor: pointer;
    background: linear-gradient(135deg,#3b82f6,#2563eb); color: #fff;
    transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(59,130,246,0.4);
}
.cta-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(59,130,246,0.6); }

@media (max-width: 1024px) {
    .demo-panels { grid-template-columns: 1fr; }
    .demo-arrow { padding-top: 0; transform: rotate(90deg); }
}
@media (max-width: 768px) {
    .header-value-props { grid-template-columns: 1fr; }
    .demo-section { padding: 30px 16px; }
    .demo-title { font-size: 22px; flex-direction: column; }
    .demo-controls { flex-direction: column; }

    /* Score cards already stack via grid → 1fr, just tighten */
    .demo-score-card { padding: 14px; }
    .score-card-num { font-size: 30px; }
    .metrics-block { padding: 16px; }
}

/* ── Main Content ── */
.main-content {
    display: grid; grid-template-columns: 1fr auto 1fr;
    gap: 0; align-items: stretch;
}

.panel {
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: var(--radius); display: flex; flex-direction: column;
}
.panel-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 20px; border-bottom: 1px solid var(--border);
}
.panel-title { font-size: 14px; font-weight: 600; color: var(--accent); }
.panel-actions { display: flex; gap: 8px; }
.action-btn {
    background: var(--bg3); border: 1px solid var(--border); border-radius: 6px;
    color: var(--text-muted); padding: 6px 14px; font-size: 12px; cursor: pointer;
    font-weight: 500; transition: all 0.2s;
}
.action-btn:hover { background: rgba(125,211,252,0.08); color: var(--text); border-color: rgba(125,211,252,0.3); }
.action-btn:disabled { opacity: 0.3; cursor: default; }

.upload-btn {
    background: var(--bg3); border: 1px solid var(--border); border-radius: 6px;
    color: var(--text-muted); padding: 6px 14px; font-size: 12px; cursor: pointer;
    font-weight: 500; transition: all 0.2s;
}
.upload-btn:hover { background: rgba(125,211,252,0.08); color: var(--text); border-color: rgba(125,211,252,0.3); }

.score-btn { color: #7dd3fc; border-color: rgba(125,211,252,0.25); }
.score-btn:hover { border-color: rgba(125,211,252,0.5); background: rgba(125,211,252,0.1); color: #7dd3fc; }

#inputEditor {
    flex: 1; min-height: 480px; background: transparent; border: none;
    color: var(--text); font-family: var(--mono); font-size: 13px; line-height: 1.65;
    padding: 20px; resize: none; outline: none;
}

.options-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
    padding: 10px 20px; border-bottom: 1px solid var(--border);
    background: rgba(125,211,252,0.03);
}
.options-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.opt-toggle { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text); cursor: pointer; }
.opt-toggle input { accent-color: var(--green); }

#outputArea {
    flex: 1; min-height: 480px; padding: 20px;
    font-family: var(--mono); font-size: 13px; line-height: 1.65;
    color: var(--text); white-space: pre-wrap; overflow: auto;
}

.output-placeholder {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; height: 100%; min-height: 400px;
    color: var(--text-muted); text-align: center; gap: 12px;
}
.placeholder-icon { font-size: 48px; opacity: 0.4; }
.placeholder-sub { font-size: 12px; color: #475569; }

.panel-footer {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 20px; border-top: 1px solid var(--border); min-height: 52px;
}
.stats-text { font-size: 12px; color: var(--text-muted); font-family: var(--mono); }
.improvement-badges { display: flex; gap: 6px; flex-wrap: wrap; }

.format-btn {
    background: linear-gradient(135deg, var(--green), #059669);
    color: #fff; border: none; border-radius: 8px;
    padding: 10px 24px; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.3s; white-space: nowrap;
    box-shadow: 0 4px 15px rgba(16,185,129,0.3);
}
.format-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(16,185,129,0.4); }
.format-btn:disabled { opacity: 0.5; cursor: default; transform: none; box-shadow: none; }

.divider {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 0 8px; gap: 8px;
}
.divider-line { width: 1px; height: 60px; background: var(--border); }
.divider-icon { font-size: 20px; color: var(--accent); }

/* ── Modal ── */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; justify-content: center; align-items: center; z-index: 1000; }
.modal-content { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; width: 90vw; max-width: 900px; max-height: 80vh; display: flex; flex-direction: column; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 16px; color: var(--text); margin: 0; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 20px; cursor: pointer; padding: 4px 8px; }
.diff-content { padding: 20px; overflow: auto; flex: 1; font-family: var(--mono); font-size: 12px; line-height: 1.7; }
.diff-add { display: block; color: #34d399; background: rgba(16,185,129,0.08); }
.diff-remove { display: block; color: #f87171; background: rgba(239,68,68,0.08); }
.diff-neutral { display: block; color: #475569; }

/* ── Loading ── */
.loading-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; justify-content: center; align-items: center; z-index: 1001; backdrop-filter: blur(4px); }
.loading-box { background: var(--bg2); border: 1px solid var(--border); border-radius: 16px; padding: 40px 50px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.spinner { width: 48px; height: 48px; border: 3px solid var(--border); border-top-color: var(--green); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 20px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-sub { font-size: 12px; color: var(--text-muted); margin-top: 8px; }

/* ── Responsive ── */
@media (max-width: 1024px) {
    .main-content { grid-template-columns: 1fr; }
    .divider { flex-direction: row; padding: 8px 0; }
    .divider-line { width: 60px; height: 1px; }
    .header-top { flex-direction: column; align-items: flex-start; }
}

/* ── ISP (Inline Score Panel) ── */
.isp-panel {
    background: linear-gradient(135deg, rgba(15,23,42,0.95), rgba(30,41,59,0.95));
    border: 1px solid rgba(125,211,252,0.15);
    border-radius: 14px; padding: 18px;
    margin-bottom: 16px;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    position: relative;
}
.isp-close {
    position: absolute; top: 10px; right: 12px;
    background: none; border: none; color: #475569;
    font-size: 16px; cursor: pointer; padding: 2px 6px;
    border-radius: 4px; transition: color 0.2s;
}
.isp-close:hover { color: #94a3b8; }

/* ── Score rows ── */
.isp-scores-row {
    display: flex; gap: 0; align-items: stretch;
}
.isp-divider-v {
    width: 1px; background: rgba(125,211,252,0.08);
    margin: 0 16px; flex-shrink: 0;
}
.isp-score-section {
    flex: 1; display: flex; flex-direction: column; gap: 8px;
    padding: 0 4px;
}
.isp-score-header {
    display: flex; align-items: baseline; gap: 6px;
}
.isp-score-label {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; color: #64748b;
}
.isp-score-val {
    font-size: 36px; font-weight: 800;
    font-family: 'Fira Code', monospace; line-height: 1;
}
.isp-score-max { font-size: 13px; color: #475569; margin-left: 1px; }
.isp-score-grade {
    font-size: 18px; font-weight: 800; margin-left: 4px;
    font-family: 'Fira Code', monospace;
}
.isp-score-delta {
    font-size: 11px; font-weight: 700; padding: 2px 8px;
    border-radius: 12px; margin-left: 4px; white-space: nowrap;
}
.isp-score-delta.pos {
    color: #34d399; background: rgba(52,211,153,0.12);
    border: 1px solid rgba(52,211,153,0.25);
}
.isp-score-delta.neg {
    color: #f87171; background: rgba(248,113,113,0.1);
    border: 1px solid rgba(248,113,113,0.2);
}

/* ── Progress bar ── */
.isp-bar-track {
    height: 8px; background: rgba(255,255,255,0.05);
    border-radius: 99px; overflow: hidden; position: relative;
}
.isp-bar-from {
    position: absolute; height: 100%; left: 0; top: 0;
    background: rgba(248,113,113,0.3); border-radius: 99px;
}
.isp-bar-fill {
    height: 100%; border-radius: 99px; width: 0%;
    position: relative; z-index: 1;
    box-shadow: 0 0 8px currentColor;
}
.isp-score-label-row {
    display: flex; justify-content: space-between;
    margin-top: 3px;
}
.isp-sublabel {
    font-size: 9px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .05em; color: #475569;
}
.isp-sublabel.after { color: #34d399; }

/* ── Dividers ── */
.isp-divider-h { height: 1px; background: rgba(125,211,252,0.08); margin: 12px 0; }

/* ── Checklist ── */
.isp-checklist {}
.isp-checklist-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px;
}
.isp-checklist-title {
    font-size: 10px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .07em; color: #64748b;
}
.isp-checklist-score {
    font-size: 10px; font-weight: 700; color: #34d399;
    background: rgba(52,211,153,0.1); border: 1px solid rgba(52,211,153,0.2);
    padding: 2px 8px; border-radius: 10px;
}
.isp-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.isp-pill {
    font-size: 11px; font-weight: 600; padding: 3px 9px;
    border-radius: 14px; white-space: nowrap; transition: opacity 0.4s ease;
}
.isp-pill.pass {
    color: #34d399; background: rgba(52,211,153,0.1);
    border: 1px solid rgba(52,211,153,0.2);
}
.isp-pill.fail {
    color: #f87171; background: rgba(248,113,113,0.07);
    border: 1px solid rgba(248,113,113,0.18);
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .isp-scores-row { flex-direction: column; gap: 12px; }
    .isp-divider-v  { display: none; }
    .isp-score-section { padding: 0; }
}

/* ── Footer ── */
.site-footer {
    text-align: center;
    padding: 18px 24px;
    border-top: 1px solid rgba(125, 211, 252, 0.1);
    margin-top: 24px;
    color: #64748b;
    font-size: 12px;
}
.site-footer strong { color: #94a3b8; }
.footer-domain {
    color: #7dd3fc;
    font-family: 'Fira Code', monospace;
    font-weight: 600;
}

/* ── Chunk Preview ─────────────────────────────────────────────── */
.modal-wide { max-width: 900px; width: 95vw; }
.chunk-subtitle { font-size: 13px; color: #94a3b8; margin-left: 12px; }
.chunk-stats-bar {
    display: flex; gap: 16px; padding: 12px 20px;
    background: rgba(77,101,255,.06); border-bottom: 1px solid var(--border);
    font-size: 13px; color: #cbd5e1; flex-wrap: wrap;
}
.chunk-stats-bar .chunk-stat { display: flex; align-items: center; gap: 5px; }
.chunk-stats-bar .chunk-stat strong { color: #a78bfa; }
.chunk-content { padding: 16px 20px; max-height: 70vh; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.chunk-card {
    background: rgba(30,30,40,.6); border: 1px solid var(--border); border-radius: 8px;
    padding: 14px 16px; position: relative; transition: border-color .2s;
}
.chunk-card:hover { border-color: var(--accent); }
.chunk-card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.06);
}
.chunk-card-title { font-weight: 600; color: #e2e8f0; font-size: 14px; }
.chunk-card-meta { display: flex; gap: 10px; font-size: 12px; color: #94a3b8; }
.chunk-card-meta .chunk-tokens { color: #a78bfa; font-weight: 600; }
.chunk-card-meta .chunk-warn { color: #fbbf24; }
.chunk-card-meta .chunk-ok { color: #34d399; }
.chunk-card-body {
    font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12px;
    color: #94a3b8; line-height: 1.6; white-space: pre-wrap; word-break: break-word;
    max-height: 200px; overflow-y: auto;
}
.chunk-card-anchors { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.chunk-anchor-tag {
    font-size: 11px; padding: 2px 8px; border-radius: 4px;
    background: rgba(77,101,255,.15); color: #818cf8; border: 1px solid rgba(77,101,255,.2);
}
.chunk-freshness-bar {
    margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.06);
    font-size: 12px; color: #94a3b8; display: flex; gap: 12px; flex-wrap: wrap;
}
.chunk-freshness-bar .fresh { color: #34d399; }
.chunk-freshness-bar .stale { color: #f87171; }
.chunk-freshness-bar .unknown { color: #fbbf24; }
.chunk-overlap-warn {
    margin-top: 6px; padding: 6px 10px; border-radius: 4px;
    background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.2);
    color: #fbbf24; font-size: 12px;
}

/* ── Why RAG & GEO Matter Section ── */
.why-section { margin-top: 8px; }
.why-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}
.why-card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.85), rgba(30, 41, 59, 0.7));
    border: 1px solid rgba(125, 211, 252, 0.12);
    border-radius: 14px;
    padding: 24px;
    transition: border-color 0.2s;
}
.why-card:hover { border-color: rgba(125, 211, 252, 0.3); }
.why-rag { border-left: 3px solid #38bdf8; }
.why-geo { border-left: 3px solid #a78bfa; }
.why-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.why-icon { font-size: 24px; }
.why-card-header h3 {
    font-size: 16px;
    color: #e2e8f0;
    margin: 0;
    line-height: 1.3;
}
.why-lead {
    font-size: 13.5px;
    color: #94a3b8;
    line-height: 1.65;
    margin: 0 0 16px 0;
}
.why-problem, .why-solution {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
}
.why-problem { border-left: 3px solid #fb7185; }
.why-solution { border-left: 3px solid #4ade80; }
.why-problem strong, .why-solution strong {
    display: block;
    font-size: 13px;
    color: #e2e8f0;
    margin-bottom: 8px;
}
.why-problem, .why-solution {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.6;
}
.why-solution ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.why-solution li {
    font-size: 12.5px;
    color: #cbd5e1;
    padding: 4px 0 4px 18px;
    position: relative;
    line-height: 1.55;
}
.why-solution li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #4ade80;
    font-weight: 700;
}
.why-solution a { color: #7dd3fc; text-decoration: none; }
.why-solution a:hover { text-decoration: underline; }
.why-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.15);
    border-radius: 10px;
    padding: 12px 16px;
    margin-top: 4px;
}
.why-geo .why-stat {
    background: rgba(167, 139, 250, 0.08);
    border-color: rgba(167, 139, 250, 0.15);
}
.stat-number {
    font-size: 22px;
    font-weight: 700;
    color: #38bdf8;
    white-space: nowrap;
}
.why-geo .stat-number { color: #a78bfa; }
.stat-label {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.5;
}
.stat-label a { color: #7dd3fc; text-decoration: none; }
.stat-label a:hover { text-decoration: underline; }
.why-bottom { margin-top: 4px; }
.why-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(125, 211, 252, 0.1);
    border-radius: 12px;
    padding: 20px;
}
.comparison-col h4 {
    font-size: 14px;
    color: #e2e8f0;
    margin: 0 0 10px 0;
}
.comparison-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.comparison-col li {
    font-size: 12.5px;
    color: #94a3b8;
    padding: 5px 0;
    border-bottom: 1px solid rgba(125, 211, 252, 0.05);
    line-height: 1.5;
}
.comparison-col li:last-child { border-bottom: none; }

@media (max-width: 768px) {
    .header-value-props { grid-template-columns: 1fr; }
    .why-grid { grid-template-columns: 1fr; }
    .why-comparison { grid-template-columns: 1fr; }
}

/* ── AI Enhancement Bar ───────────────────────────────────────── */
.ai-enhance-bar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 20px; margin: 0 auto 12px; max-width: 1400px;
    background: rgba(30,30,40,.5); border: 1px solid var(--border);
    border-radius: 8px; flex-wrap: wrap; gap: 8px;
}
.ai-enhance-left { display: flex; align-items: center; gap: 10px; }
.ai-badge {
    padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;
    background: rgba(52,211,153,.12); color: #34d399; border: 1px solid rgba(52,211,153,.2);
}
.ai-badge.ai-active {
    background: rgba(168,139,250,.12); color: #a78bfa; border-color: rgba(168,139,250,.2);
}
.ai-hint { font-size: 12px; color: #64748b; max-width: 600px; line-height: 1.5; }
.ai-enhance-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ai-toggle-btn {
    padding: 6px 14px; border-radius: 6px; font-size: 12px; font-weight: 600;
    background: rgba(168,139,250,.1); color: #a78bfa; border: 1px solid rgba(168,139,250,.25);
    cursor: pointer; transition: all .2s;
}
.ai-toggle-btn:hover { background: rgba(168,139,250,.2); }

/* ── Mode Detail Cards ── */
.mode-details-section {
    max-width: 1400px;
    margin: 0 auto 24px;
    padding: 0;
}
.mode-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.mode-detail-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
}
.mode-instant-card { border-top: 3px solid #34d399; }
.mode-ai-card { border-top: 3px solid #a78bfa; }
.mode-detail-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.mode-detail-icon { font-size: 22px; }
.mode-detail-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #e2e8f0;
    margin: 0;
}
.mode-detail-desc {
    font-size: 13.5px;
    color: #94a3b8;
    line-height: 1.65;
    margin: 0 0 16px 0;
}
.mode-detail-desc strong { color: #e2e8f0; }
.mode-rule-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.mode-rule-list > li {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.mode-rule-list > li:last-child { border-bottom: none; }
.mode-rule-list > li > strong {
    display: block;
    font-size: 13.5px;
    color: #e2e8f0;
    margin-bottom: 5px;
}
.mode-rule-list > li > span {
    display: block;
    font-size: 12.5px;
    color: #94a3b8;
    line-height: 1.6;
}
.mode-rule-list code {
    background: rgba(125, 211, 252, 0.08);
    color: #7dd3fc;
    padding: 1px 5px;
    border-radius: 3px;
    font-family: 'Fira Code', monospace;
    font-size: 11px;
}
.mode-rule-list a {
    color: #7dd3fc;
    text-decoration: none;
}
.mode-rule-list a:hover { text-decoration: underline; }
.mode-ai-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.mode-ai-tag {
    background: rgba(167, 139, 250, 0.08);
    color: #a78bfa;
    border: 1px solid rgba(167, 139, 250, 0.15);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
}
@media (max-width: 768px) {
    .header-value-props { grid-template-columns: 1fr; }
    .mode-details-grid { grid-template-columns: 1fr; }
}



/* ── Methodology Section ──────────────────────────────────────── */
.methodology-section {
    padding: 48px 24px; max-width: 1100px; margin: 0 auto;
}
.methodology-title {
    font-size: 24px; font-weight: 700; color: #e2e8f0; margin-bottom: 12px;
}
.methodology-intro {
    font-size: 14px; color: #94a3b8; line-height: 1.7; margin-bottom: 28px; max-width: 700px;
}
.methodology-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 28px;
}
@media (max-width: 768px) {
    .header-value-props { grid-template-columns: 1fr; } .methodology-grid { grid-template-columns: 1fr; } }
.method-card {
    background: rgba(30,30,40,.6); border: 1px solid var(--border); border-radius: 10px;
    padding: 24px;
}
.method-card h3 { font-size: 16px; color: #a78bfa; margin-bottom: 8px; }
.method-card > p { font-size: 13px; color: #94a3b8; margin-bottom: 14px; line-height: 1.6; }
.method-card ul { list-style: none; padding: 0; margin: 0; }
.method-card li {
    font-size: 13px; color: #cbd5e1; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.04);
    line-height: 1.5;
}
.method-card li:last-child { border-bottom: none; }
.method-card cite { font-style: normal; font-size: 11px; color: #64748b; }
.methodology-refs {
    background: rgba(30,30,40,.4); border: 1px solid var(--border); border-radius: 10px;
    padding: 20px 24px; margin-bottom: 20px;
}
.methodology-refs h3 { font-size: 15px; color: #e2e8f0; margin-bottom: 12px; }
.methodology-refs ul { list-style: none; padding: 0; margin: 0; }
.methodology-refs li { font-size: 12px; color: #94a3b8; padding: 4px 0; line-height: 1.6; }
.methodology-refs a { color: #818cf8; text-decoration: none; }
.methodology-refs a:hover { text-decoration: underline; }
.methodology-disclaimer {
    font-size: 12px; color: #94a3b8; padding: 14px 18px;
    background: rgba(251,191,36,.04); border: 1px solid rgba(251,191,36,.15);
    border-radius: 8px; line-height: 1.7;
}
.methodology-disclaimer strong { color: #fbbf24; }

/* ══════════════════════════════════════════════════════════════════
   TAB BAR
   ══════════════════════════════════════════════════════════════════ */
.tab-bar {
    display: flex; gap: 0; margin: 20px 0 0;
    border-bottom: 2px solid rgba(125,211,252,0.15);
}
.tab-btn {
    padding: 12px 28px; font-size: 14px; font-weight: 600;
    background: none; border: none; border-bottom: 3px solid transparent;
    color: #64748b; cursor: pointer; transition: all 0.2s;
    font-family: var(--font);
}
.tab-btn:hover { color: #94a3b8; }
.tab-btn.tab-active {
    color: #7dd3fc; border-bottom-color: #7dd3fc;
}

/* ══════════════════════════════════════════════════════════════════
   PIPELINE TAB
   ══════════════════════════════════════════════════════════════════ */
.pl-container { max-width: 1400px; margin: 0 auto; padding: 0; }

.pl-hero {
    padding: 32px 0 24px;
}
.pl-hero h2 {
    font-size: 24px; font-weight: 700; color: #e2e8f0; margin: 0 0 8px;
}
.pl-hero p {
    font-size: 14px; color: #94a3b8; line-height: 1.7; max-width: 700px; margin: 0 0 16px;
}
.pl-stack-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pl-pill {
    font-size: 11px; font-weight: 600; padding: 4px 12px; border-radius: 20px;
}
.pl-pill-green  { background: rgba(16,185,129,0.12); color: #34d399; border: 1px solid rgba(16,185,129,0.25); }
.pl-pill-blue   { background: rgba(56,189,248,0.1);  color: #38bdf8; border: 1px solid rgba(56,189,248,0.2); }
.pl-pill-purple { background: rgba(167,139,250,0.1); color: #a78bfa; border: 1px solid rgba(167,139,250,0.2); }
.pl-pill-cyan   { background: rgba(125,211,252,0.1); color: #7dd3fc; border: 1px solid rgba(125,211,252,0.2); }
.pl-pill-amber  { background: rgba(251,191,36,0.1);  color: #fbbf24; border: 1px solid rgba(251,191,36,0.2); }

/* Step Cards */
.pl-step-card {
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px; margin-bottom: 16px;
}
.pl-step-header {
    display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap;
}
.pl-step-num {
    width: 30px; height: 30px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff; font-weight: 700; font-size: 14px;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.pl-step-header h3 { font-size: 16px; color: #e2e8f0; margin: 0; }
.pl-step-tag {
    font-size: 11px; color: #64748b; background: rgba(255,255,255,0.04);
    padding: 3px 10px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.06);
}
.pl-step-desc {
    font-size: 13px; color: #94a3b8; line-height: 1.7; margin: 0 0 16px;
}
.pl-step-desc code {
    background: rgba(125,211,252,0.08); color: #7dd3fc;
    padding: 1px 5px; border-radius: 3px; font-family: var(--mono); font-size: 12px;
}
.pl-step-actions {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.pl-embed-actions {
    display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap;
}

/* Buttons */
.pl-btn {
    padding: 8px 18px; border-radius: 8px; font-size: 13px; font-weight: 600;
    border: none; cursor: pointer; transition: all 0.2s; font-family: var(--font);
    white-space: nowrap;
}
.pl-btn:disabled { opacity: 0.4; cursor: default; }
.pl-btn-primary {
    background: linear-gradient(135deg, var(--green), #059669); color: #fff;
    box-shadow: 0 2px 8px rgba(16,185,129,0.25);
}
.pl-btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(16,185,129,0.35); }
.pl-btn-outline {
    background: var(--bg3); border: 1px solid var(--border); color: var(--text-muted);
}
.pl-btn-outline:hover { background: rgba(125,211,252,0.08); color: var(--text); border-color: rgba(125,211,252,0.3); }
.pl-btn-danger-sm {
    background: rgba(239,68,68,0.1); color: #f87171; border: 1px solid rgba(239,68,68,0.2);
    padding: 4px 12px; font-size: 11px;
}
.pl-btn-danger-sm:hover { background: rgba(239,68,68,0.2); }

/* Status */
.pl-status {
    font-size: 12px; color: #64748b;
}
.pl-status-loading { color: #fbbf24; }
.pl-status-ok { color: #34d399; }
.pl-status-err { color: #f87171; }

/* Textarea & Input */
.pl-textarea {
    width: 100%; background: var(--bg3); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text); font-family: var(--mono);
    font-size: 12px; line-height: 1.6; padding: 14px; resize: vertical;
    outline: none; margin-bottom: 12px; min-height: 120px;
}
.pl-textarea:focus { border-color: var(--accent); }
.pl-input {
    flex: 1; background: var(--bg3); border: 1px solid var(--border);
    border-radius: 8px; color: var(--text); font-family: var(--font);
    font-size: 13px; padding: 10px 14px; outline: none;
}
.pl-input:focus { border-color: var(--accent); }
.pl-search-row {
    display: flex; gap: 8px; margin-bottom: 16px;
}

/* Store Bar */
.pl-store-bar {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
}
.pl-store-count { font-size: 13px; color: #34d399; font-weight: 600; }
.pl-store-empty { font-size: 13px; color: #64748b; }

/* Search Results */
.pl-results { display: flex; flex-direction: column; gap: 10px; }
.pl-result-card {
    background: var(--bg3); border: 1px solid var(--border);
    border-radius: 8px; padding: 14px 16px; transition: border-color 0.2s;
}
.pl-result-card:hover { border-color: rgba(125,211,252,0.3); }
.pl-result-header {
    display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.pl-result-rank {
    font-size: 11px; font-weight: 700; color: #7dd3fc;
    background: rgba(125,211,252,0.1); padding: 2px 8px; border-radius: 10px;
}
.pl-result-title {
    font-size: 13px; font-weight: 600; color: #e2e8f0; flex: 1;
}
.pl-result-score {
    font-size: 12px; font-weight: 700; color: #34d399;
    background: rgba(52,211,153,0.1); padding: 2px 8px; border-radius: 10px;
    border: 1px solid rgba(52,211,153,0.2); font-family: var(--mono);
}
.pl-result-body {
    font-size: 12px; color: #94a3b8; line-height: 1.6;
    font-family: var(--mono); white-space: pre-wrap; word-break: break-word;
}
.pl-result-meta {
    font-size: 11px; color: #475569; margin-top: 8px;
}

/* Ask Answer */
.pl-answer {
    margin-bottom: 12px;
}
.pl-answer-text {
    font-size: 14px; color: #e2e8f0; line-height: 1.8;
    background: linear-gradient(135deg, rgba(16,185,129,0.06), rgba(56,189,248,0.06));
    border: 1px solid rgba(125,211,252,0.12); border-radius: 10px;
    padding: 20px;
}
.pl-answer-text strong { color: #7dd3fc; }

/* Sources */
.pl-sources { display: flex; flex-direction: column; gap: 6px; }
.pl-sources-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em; color: #64748b; margin-bottom: 4px;
}
.pl-source-pill {
    display: flex; align-items: center; gap: 8px;
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px; padding: 6px 10px;
}
.pl-source-num {
    width: 20px; height: 20px; border-radius: 50%;
    background: rgba(125,211,252,0.1); color: #7dd3fc;
    font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.pl-source-name { font-size: 12px; color: #cbd5e1; flex: 1; }
.pl-source-score {
    font-size: 11px; color: #34d399; font-family: var(--mono); font-weight: 600;
}

/* Loading / Error messages */
.pl-loading-msg { font-size: 13px; color: #fbbf24; padding: 12px; }
.pl-empty-msg   { font-size: 13px; color: #64748b; padding: 12px; }
.pl-error-msg   { font-size: 13px; color: #f87171; padding: 12px; }

/* Pipeline responsive */
@media (max-width: 768px) {
    .pl-search-row { flex-direction: column; }
    .pl-step-header { flex-direction: column; align-items: flex-start; }
    .tab-btn { padding: 10px 16px; font-size: 13px; }
}

/* ══════════════════════════════════════════════════════════════════
   PIPELINE DEMO
   ══════════════════════════════════════════════════════════════════ */
.pl-demo-section {
    background: linear-gradient(135deg, rgba(16,185,129,0.06), rgba(56,189,248,0.06));
    border: 1px solid rgba(125,211,252,0.12); border-radius: 12px;
    padding: 28px; margin-bottom: 20px;
}
.pl-demo-title {
    font-size: 22px; font-weight: 700; color: #e2e8f0;
    display: flex; align-items: center; gap: 10px;
    margin: 0 0 6px;
}
.pl-demo-subtitle {
    font-size: 14px; color: #94a3b8; margin: 0 0 20px; line-height: 1.6;
}
.pl-demo-controls { margin-bottom: 20px; display: flex; gap: 10px; }
.pl-demo-stage-bar {
    display: flex; align-items: center; gap: 0; justify-content: center;
    margin-bottom: 20px;
}
.pl-demo-stage {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: 8px; font-size: 13px;
    font-weight: 600; color: #94a3b8; transition: all 0.3s;
    cursor: pointer; user-select: none;
}
.pl-demo-stage:hover {
    background: rgba(125,211,252,0.12); color: #e2e8f0;
    transform: scale(1.05);
}
.pl-demo-stage-num {
    width: 22px; height: 22px; border-radius: 50%;
    background: rgba(125,211,252,0.15); color: #7dd3fc;
    font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.pl-demo-stage-arrow { color: #475569; font-size: 16px; margin: 0 6px; }
.pl-demo-canvas {
    background: rgba(15,23,42,0.7); border: 1px solid rgba(125,211,252,0.1);
    border-radius: 10px; padding: 20px; min-height: 600px; max-height: none;
    overflow-y: visible;
}
.pl-demo-placeholder {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; min-height: 200px; gap: 8px;
}
.pl-demo-panel {
    background: rgba(15,23,42,0.5); border: 1px solid rgba(125,211,252,0.08);
    border-radius: 8px; padding: 14px; margin-bottom: 10px;
}
.pl-demo-panel-label {
    font-size: 12px; font-weight: 700; color: #7dd3fc;
    text-transform: uppercase; letter-spacing: .05em; margin-bottom: 10px;
}
.pl-demo-code { min-height: 80px; }
.pl-cursor { color: #34d399; animation: plBlink 0.8s infinite; }
@keyframes plBlink { 0%,100%{opacity:1} 50%{opacity:0} }
.pl-demo-arrow-down {
    text-align: center; font-size: 24px; color: #7dd3fc; padding: 8px 0;
}
.pl-demo-chunks { display: flex; gap: 10px; flex-wrap: wrap; }
.pl-demo-chunk {
    background: rgba(56,189,248,0.08); border: 1px solid rgba(56,189,248,0.2);
    border-radius: 6px; padding: 8px 14px; font-size: 12px; color: #cbd5e1;
}
.pl-demo-chunk strong { color: #38bdf8; }
.pl-demo-embed-grid { display: flex; flex-direction: column; gap: 8px; }
.pl-demo-embed-row {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.pl-demo-embed-chunk {
    background: rgba(56,189,248,0.08); border: 1px solid rgba(56,189,248,0.15);
    border-radius: 6px; padding: 4px 12px; font-size: 12px; color: #38bdf8;
    font-weight: 600; min-width: 140px;
}
.pl-demo-embed-arrow { color: #475569; font-size: 14px; }
.pl-demo-embed-vec {
    font-family: 'Fira Code', monospace; font-size: 11px; color: #a78bfa;
    background: rgba(167,139,250,0.08); border: 1px solid rgba(167,139,250,0.15);
    border-radius: 4px; padding: 4px 8px; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; max-width: 300px;
}
.pl-demo-embed-ok { font-size: 14px; }
.pl-demo-embed-status {
    font-size: 12px; color: #34d399; font-weight: 600;
    margin-top: 8px; padding: 6px 12px;
    background: rgba(16,185,129,0.08); border-radius: 6px;
    border: 1px solid rgba(16,185,129,0.15);
}
.pl-demo-search { min-height: 80px; }
.pl-demo-searching { font-size: 13px; color: #fbbf24; padding: 12px 0; }
.pl-demo-search-result {
    display: flex; align-items: center; gap: 12px; padding: 8px 12px;
    border-radius: 6px; margin-bottom: 6px; flex-wrap: wrap;
}
.pl-demo-match-high { background: rgba(52,211,153,0.08); border: 1px solid rgba(52,211,153,0.2); }
.pl-demo-match-med  { background: rgba(251,191,36,0.06); border: 1px solid rgba(251,191,36,0.15); }
.pl-demo-match-low  { background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.06); }
.pl-demo-match-score {
    font-family: 'Fira Code', monospace; font-size: 12px; font-weight: 700;
    min-width: 50px;
}
.pl-demo-match-high .pl-demo-match-score { color: #34d399; }
.pl-demo-match-med  .pl-demo-match-score { color: #fbbf24; }
.pl-demo-match-low  .pl-demo-match-score { color: #64748b; }
.pl-demo-match-title { font-size: 13px; font-weight: 600; color: #e2e8f0; min-width: 140px; }
.pl-demo-match-preview { font-size: 12px; color: #94a3b8; flex: 1; }
.pl-demo-ask-q {
    font-size: 14px; color: #7dd3fc; font-weight: 600;
    margin-bottom: 12px; padding: 8px 14px;
    background: rgba(125,211,252,0.06); border-radius: 6px;
    border-left: 3px solid #7dd3fc;
}
.pl-demo-answer { min-height: 60px; }
.pl-demo-answer-sources {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(125,211,252,0.08);
}
.pl-demo-source-tag {
    font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 12px;
    background: rgba(52,211,153,0.08); color: #34d399;
    border: 1px solid rgba(52,211,153,0.2);
}
@media (max-width: 768px) {
    .pl-demo-stage-bar { flex-wrap: wrap; justify-content: flex-start; }
    .pl-demo-embed-row { flex-direction: column; align-items: flex-start; }
    .pl-demo-search-result { flex-direction: column; align-items: flex-start; }
}
