:root {
  --ink: #f2eee6;
  --muted: #97918a;
  --dim: #625d58;
  --line: rgba(242, 238, 230, .1);
  --panel: rgba(255, 255, 255, .035);
  --orange: #ff8d3a;
  --orange-bright: #ffb15c;
  --green: #67d391;
  --bg: #0b0c0d;
  --display: "Syne", sans-serif;
  --body: "DM Sans", sans-serif;
  --mono: "DM Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--ink); font-family: var(--body); }
button, input { font: inherit; }
button { cursor: pointer; }
.page-glow { position: fixed; width: 55vw; height: 40vw; border-radius: 50%; pointer-events: none; filter: blur(80px); opacity: .12; z-index: -1; }
.page-glow--top { top: -25vw; left: -15vw; background: var(--orange); }
.page-glow--bottom { right: -20vw; bottom: -25vw; background: #36765a; opacity: .08; }
.shell { width: min(1160px, calc(100% - 48px)); margin: 0 auto; padding: 28px 0 42px; }
.topbar { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 22px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font: 700 1rem var(--display); }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--orange); color: var(--orange); font: 800 1rem var(--display); transform: rotate(-8deg); }
.status-pill { color: var(--muted); font: 500 .68rem var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.status-dot { display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); }
.hero { max-width: 740px; padding: 82px 0 64px; }
.eyebrow, .panel-kicker { color: var(--orange); font: 500 .69rem var(--mono); letter-spacing: .18em; text-transform: uppercase; }
.hero h1 { margin: 18px 0 22px; font: 800 clamp(3.3rem, 8vw, 7.1rem)/.92 var(--display); letter-spacing: -.055em; }
.hero h1 em { color: var(--orange); font-style: normal; }
.hero-copy { max-width: 540px; margin: 0; color: var(--muted); font-size: 1.08rem; line-height: 1.7; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .85fr); gap: 18px; align-items: stretch; }
.panel { border: 1px solid var(--line); background: var(--panel); }
.query-panel { padding: 30px; }
.panel-kicker { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.panel-kicker span { color: var(--dim); }
label { display: block; margin-bottom: 12px; color: var(--ink); font: 600 1.05rem var(--display); }
.query-row { display: flex; gap: 10px; }
input { min-width: 0; flex: 1; border: 1px solid rgba(242, 238, 230, .16); border-radius: 2px; outline: 0; background: rgba(0, 0, 0, .22); color: var(--ink); padding: 16px; transition: border-color .2s, box-shadow .2s; }
input::placeholder { color: var(--dim); }
input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255, 141, 58, .12); }
.primary-button { display: inline-flex; align-items: center; justify-content: space-between; gap: 22px; border: 0; border-radius: 2px; background: var(--orange); color: #17110c; padding: 0 17px; font: 700 .8rem var(--display); transition: background .2s, transform .2s; }
.primary-button:hover { background: var(--orange-bright); transform: translateY(-2px); }
.button-arrow { font-size: 1.35rem; font-weight: 400; }
.suggestions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 24px; }
.suggestion-label { margin-right: 5px; color: var(--dim); font: .67rem var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.suggestion, .quiet-button { border: 1px solid var(--line); border-radius: 2px; background: transparent; color: var(--muted); padding: 8px 10px; font-size: .75rem; transition: color .2s, border-color .2s, background .2s; }
.suggestion:hover, .quiet-button:hover { border-color: var(--orange); color: var(--orange-bright); background: rgba(255, 141, 58, .06); }
.form-error { margin: 16px 0 0; color: #ff8d83; font: .75rem var(--mono); }
.pipeline-panel { padding: 30px; }
.pipeline-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.pipeline-step { display: grid; grid-template-columns: 34px 1fr auto; gap: 13px; align-items: center; min-height: 69px; border-top: 1px solid var(--line); color: var(--muted); }
.step-icon { color: var(--dim); font: .65rem var(--mono); }
.pipeline-step strong { display: block; color: var(--ink); font: 600 .91rem var(--display); }
.pipeline-step small { display: block; margin-top: 4px; color: var(--dim); font-size: .75rem; }
.pipeline-step b { color: var(--dim); font: 500 .61rem var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.pipeline-step.is-running { border-color: rgba(255, 141, 58, .35); }
.pipeline-step.is-running .step-icon, .pipeline-step.is-running b { color: var(--orange); }
.pipeline-step.is-running b::before { content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 5px 1px 0; border-radius: 50%; background: currentColor; animation: pulse 1s infinite; }
.pipeline-step.is-done .step-icon, .pipeline-step.is-done b { color: var(--green); }
.results { padding-top: 80px; animation: rise .45s ease both; }
.results-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.results-heading .eyebrow { margin: 0 0 10px; }
.results-heading h2 { margin: 0; font: 700 2rem var(--display); }
.result-actions { display: flex; gap: 8px; }
.report-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 18px; }
.report-panel, .feedback-panel { padding: 30px; min-width: 0; }
.panel-kicker--green { color: var(--green); }
.markdown-content { color: #c8c3bb; font-size: .94rem; line-height: 1.75; }
.markdown-content h1, .markdown-content h2, .markdown-content h3 { color: var(--ink); font-family: var(--display); line-height: 1.2; }
.markdown-content h1 { font-size: 1.8rem; }.markdown-content h2 { font-size: 1.3rem; margin-top: 28px; }.markdown-content h3 { font-size: 1rem; }
.markdown-content p { margin: 0 0 15px; }.markdown-content ul { padding-left: 20px; }.markdown-content li { margin: 7px 0; }.markdown-content strong { color: var(--ink); }
.markdown-content a { color: var(--orange-bright); }
.source-details { margin-top: 18px; padding: 20px 24px; }.source-details summary { color: var(--muted); cursor: pointer; font: .72rem var(--mono); letter-spacing: .1em; text-transform: uppercase; }.raw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 20px; }.raw-grid pre { max-height: 300px; overflow: auto; margin: 0; color: var(--muted); white-space: pre-wrap; font: .72rem/1.6 var(--mono); }
footer { margin-top: 82px; color: var(--dim); font: .65rem var(--mono); letter-spacing: .08em; text-transform: uppercase; } footer span { color: var(--orange); margin: 0 6px; }
[hidden] { display: none !important; }
@keyframes pulse { 50% { opacity: .25; } } @keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.visuals-container { margin-top: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.chart-card { border: 1px solid var(--line); background: var(--panel); padding: 18px; border-radius: 2px; min-height: 280px; }
.conflict-card { grid-column: 1 / -1; }
.mermaid-box { padding: 15px; overflow-x: auto; background: rgba(0,0,0,0.3); border-radius: 2px; }
.sources-card { margin-top: 24px; padding: 24px; }
.sources-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 12px; }
.source-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; background: rgba(255,255,255,0.02); border: 1px solid var(--line); border-radius: 2px; font-size: 0.85rem; }
.source-item a { color: var(--orange-bright); text-decoration: none; font-weight: 500; }
.source-item a:hover { text-decoration: underline; }
.source-meta { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.75rem; font-family: var(--mono); }
.cred-badge { padding: 3px 8px; border-radius: 2px; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; }
.cred-high { background: rgba(103, 211, 145, 0.15); color: var(--green); border: 1px solid rgba(103, 211, 145, 0.3); }
.cred-med { background: rgba(255, 177, 92, 0.15); color: var(--orange-bright); border: 1px solid rgba(255, 177, 92, 0.3); }
.cred-low { background: rgba(255, 107, 107, 0.15); color: #ff6b6b; border: 1px solid rgba(255, 107, 107, 0.3); }
.audit-list { margin-top: 14px; display: grid; gap: 10px; }
.audit-item { padding: 10px 14px; background: rgba(0,0,0,0.25); border-left: 3px solid var(--orange); font-size: 0.8rem; line-height: 1.5; }
.audit-quote { color: var(--muted); font-style: italic; margin-top: 4px; font-family: var(--mono); font-size: 0.74rem; }
.markdown-content a { display: inline-block; padding: 1px 6px; margin: 0 2px; border-radius: 3px; background: rgba(255,141,58,0.12); border: 1px solid rgba(255,141,58,0.25); text-decoration: none; font-size: 0.82rem; font-family: var(--mono); }
.markdown-content a:hover { background: rgba(255,141,58,0.22); border-color: var(--orange); }

.topbar-actions { display: flex; align-items: center; gap: 14px; }
.cloud-badge { padding: 4px 9px; font-size: 0.7rem; font-family: var(--mono); color: var(--green); background: rgba(103,211,145,0.12); border: 1px solid rgba(103,211,145,0.3); border-radius: 2px; }
.history-drawer { position: fixed; top: 0; right: 0; width: min(420px, 90vw); height: 100vh; background: #121316; border-left: 1px solid var(--line); z-index: 100; padding: 24px; overflow-y: auto; box-shadow: -10px 0 30px rgba(0,0,0,0.6); display: flex; flex-direction: column; }
.drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(3px); z-index: 99; }
.drawer-header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 18px; }
.close-drawer-btn { font-size: 1.2rem; line-height: 1; padding: 4px 8px; }
.history-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: 2px; margin-bottom: 10px; cursor: pointer; transition: border-color .2s, background .2s; }
.history-item:hover { border-color: var(--orange); background: rgba(255,141,58,0.06); }
.history-title { font-weight: 600; font-size: 0.88rem; color: var(--ink); margin-bottom: 6px; }
.history-meta { font-size: 0.72rem; color: var(--muted); font-family: var(--mono); display: flex; justify-content: space-between; }
.history-empty { color: var(--dim); font-size: 0.82rem; font-family: var(--mono); padding: 16px 0; text-align: center; }

/* User Profile & Auth Modal */
.user-pill { display: inline-flex; align-items: center; gap: 9px; padding: 4px 12px 4px 6px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 999px; font-size: 0.78rem; }
.user-avatar { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(255, 141, 58, 0.15); border: 1px solid rgba(255, 141, 58, 0.3); font-size: 0.72rem; }
.user-email { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-family: var(--mono); font-size: 0.75rem; }
.logout-link { background: transparent; border: 0; border-left: 1px solid var(--line); padding: 0 0 0 8px; color: var(--dim); font: 500 0.72rem var(--mono); cursor: pointer; transition: color .2s; }
.logout-link:hover { color: #ff8d83; }

.auth-modal { position: fixed; inset: 0; display: grid; place-items: center; z-index: 150; padding: 20px; background: rgba(0, 0, 0, 0.72); backdrop-filter: blur(8px); animation: rise .2s ease both; }
.auth-card { width: min(440px, 100%); background: #121316; border: 1px solid rgba(242, 238, 230, 0.15); padding: 32px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(255, 141, 58, 0.08); border-radius: 4px; }
.auth-actions { display: grid; gap: 12px; margin-top: 24px; }
.auth-success { margin: 14px 0 0; color: var(--green); font: 0.75rem var(--mono); background: rgba(103, 211, 145, 0.1); border: 1px solid rgba(103, 211, 145, 0.25); padding: 10px 14px; border-radius: 2px; line-height: 1.4; }

@media (max-width: 760px) { .shell { width: min(100% - 30px, 600px); padding-top: 18px; }.hero { padding: 64px 0 44px; }.hero h1 { font-size: clamp(3rem, 15vw, 5.2rem); }.workspace, .report-layout, .visuals-container { grid-template-columns: 1fr; }.query-panel, .pipeline-panel, .report-panel, .feedback-panel { padding: 22px; }.query-row, .results-heading { align-items: stretch; flex-direction: column; }.primary-button { min-height: 50px; }.result-actions { width: 100%; }.quiet-button { flex: 1; }.raw-grid { grid-template-columns: 1fr; }.pipeline-step { min-height: 62px; } .user-email { max-width: 90px; } }


