:root {
  --ink: #0d0b13;
  --ink-2: #13101c;
  --panel: #191522;
  --panel-2: #211b2d;
  --line: #352d45;
  --line-soft: #272133;
  --paper: #f0ebf8;
  --muted: #aaa0ba;
  --dim: #746b83;
  --acid: #ff9478;
  --acid-deep: #d96f58;
  --orange: #ffb268;
  --blue: #c8b5ff;
  --mint: #78dfb5;
  --red: #ff6f82;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { height: 100%; background: var(--ink); }
body { margin: 0; min-height: 100%; color: var(--paper); background: var(--ink); font-family: var(--sans); font-size: 14px; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--acid); outline-offset: 2px; }
button:disabled { cursor: wait; opacity: .5; }
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 100; padding: 10px 14px; color: var(--ink); background: var(--acid); }
.skip-link:focus { top: 12px; }

.topbar { position: sticky; top: 0; z-index: 20; height: 68px; display: grid; grid-template-columns: 280px minmax(260px, 1fr) 280px; align-items: center; border-bottom: 1px solid var(--line); background: rgba(13,11,19,.96); backdrop-filter: blur(14px); }
.brand { height: 100%; display: flex; align-items: center; gap: 12px; padding: 0 22px; color: var(--paper); text-decoration: none; border-right: 1px solid var(--line); }
.brand-mark { position: relative; display: block; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.brand-mark i { position: absolute; width: 7px; height: 7px; border: 1px solid var(--mint); border-radius: 50%; }
.brand-mark i:nth-child(1) { left: 7px; top: 13px; }
.brand-mark i:nth-child(2) { right: 7px; top: 7px; border-color: var(--acid); }
.brand-mark i:nth-child(3) { right: 7px; bottom: 6px; border-color: var(--blue); }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; left: 13px; width: 9px; height: 1px; background: var(--dim); transform-origin: left; }
.brand-mark::before { top: 15px; transform: rotate(-31deg); }
.brand-mark::after { top: 18px; transform: rotate(31deg); }
.brand strong { display: block; font-size: 14px; letter-spacing: .01em; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font: 10px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.topbar-center { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 0 20px; }
.repo-select-label { color: var(--dim); font: 10px var(--mono); text-transform: uppercase; letter-spacing: .12em; }
.topbar select { min-width: 220px; max-width: 420px; padding: 9px 34px 9px 12px; border: 1px solid var(--line); border-radius: 4px; color: var(--paper); background: var(--ink-2); }
.topbar-actions { height: 100%; display: flex; align-items: center; justify-content: flex-end; gap: 20px; padding: 0 22px; border-left: 1px solid var(--line); }
.health { display: flex; align-items: center; gap: 8px; color: var(--muted); font: 11px var(--mono); }
.health i { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 9px rgba(255,157,92,.5); }
.health.ready i { background: var(--mint); box-shadow: 0 0 9px rgba(120,223,181,.5); }
.health.failed i { background: var(--red); }
.docs-link { color: var(--paper); font: 11px var(--mono); text-decoration: none; }
.docs-link:hover { color: var(--acid); }
.icon-button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); background: transparent; }
.icon-button:hover { color: var(--paper); border-color: var(--muted); }
.icon-button svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app-shell { min-height: calc(100vh - 68px); display: grid; grid-template-columns: 280px minmax(540px, 1fr) 280px; }
.sidebar, .inspector { min-width: 0; background: var(--ink-2); }
.sidebar { border-right: 1px solid var(--line); }
.inspector { border-left: 1px solid var(--line); }
.content { min-width: 0; background-color: var(--ink); background-image: linear-gradient(rgba(200,181,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(200,181,255,.018) 1px, transparent 1px); background-size: 28px 28px; }
.eyebrow { color: var(--acid); font: 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; }

.repo-card { padding: 25px 22px 21px; border-bottom: 1px solid var(--line); }
.repo-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-top: 10px; }
.repo-title-row h1 { margin: 0; max-width: 220px; overflow: hidden; text-overflow: ellipsis; font-size: 19px; letter-spacing: -.02em; white-space: nowrap; }
.repo-title-row p { margin: 6px 0 0; max-width: 225px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font: 11px var(--mono); white-space: nowrap; }
.revision { flex: none; padding: 4px 6px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); font: 10px var(--mono); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin: 22px 0 18px; border: 1px solid var(--line); }
.stat-grid div { padding: 12px 9px 10px; border-right: 1px solid var(--line); }
.stat-grid div:last-child { border: 0; }
.stat-grid strong { display: block; font: 18px var(--mono); color: var(--paper); }
.stat-grid span { display: block; margin-top: 3px; color: var(--dim); font: 9px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.pipeline { display: grid; gap: 5px; }
.pipeline button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 10px; border: 1px solid var(--line-soft); border-radius: 4px; text-align: left; color: var(--paper); background: rgba(255,255,255,.015); }
.pipeline button:hover:not(:disabled) { border-color: #586258; background: var(--panel); }
.pipeline button.running { border-color: var(--orange); }
.pipeline button.done .step-number { color: var(--acid); }
.step-number { color: var(--dim); font: 10px var(--mono); }
.pipeline b { display: block; font-size: 12px; font-weight: 600; }
.pipeline small { color: var(--muted); font-size: 10px; }
.text-button { margin-top: 15px; padding: 0; border: 0; color: var(--acid); background: none; font: 11px var(--mono); }
.text-button:hover { text-decoration: underline; }

.explorer { padding: 20px 14px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 7px; }
.section-head h2, .inspector-head h2 { margin: 0; font-size: 13px; }
.section-head span { color: var(--dim); font: 10px var(--mono); }
.mini-tabs { display: grid; grid-template-columns: repeat(3, 1fr); margin: 13px 0 11px; border-bottom: 1px solid var(--line); }
.mini-tabs button { padding: 8px 2px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: none; font-size: 11px; }
.mini-tabs button[aria-selected="true"] { color: var(--paper); border-color: var(--acid); }
.filter-input { display: flex; align-items: center; gap: 7px; padding: 0 9px; border: 1px solid var(--line); border-radius: 4px; color: var(--dim); background: var(--ink); }
.filter-input input { width: 100%; padding: 9px 0; border: 0; outline: 0; color: var(--paper); background: transparent; font-size: 11px; }
.explorer-list { height: calc(100vh - 480px); min-height: 210px; margin-top: 10px; overflow: auto; scrollbar-color: var(--line) transparent; }
.explorer-item { width: 100%; display: flex; align-items: flex-start; gap: 9px; padding: 9px 8px; border: 0; border-radius: 3px; text-align: left; color: var(--muted); background: transparent; }
.explorer-item:hover { color: var(--paper); background: var(--panel); }
.explorer-item .file-icon { color: var(--acid-deep); font: 10px var(--mono); }
.explorer-item > span:last-child { min-width: 0; }
.explorer-item b { display: block; overflow: hidden; text-overflow: ellipsis; color: inherit; font: 11px var(--mono); white-space: nowrap; }
.explorer-item small { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; color: var(--dim); font: 9px var(--mono); white-space: nowrap; }
.empty-small { padding: 26px 8px; color: var(--dim); font: 11px/1.6 var(--mono); text-align: center; }

.mode-tabs { height: 68px; display: flex; align-items: stretch; gap: 0; padding: 0 38px; border-bottom: 1px solid var(--line); background: rgba(16,20,16,.8); }
.mode-tabs button { position: relative; min-width: 140px; padding: 0 20px; border: 0; color: var(--muted); background: transparent; text-align: left; }
.mode-tabs button::after { content: ""; position: absolute; right: 20px; bottom: -1px; left: 20px; height: 2px; background: transparent; }
.mode-tabs button.active { color: var(--paper); }
.mode-tabs button.active::after { background: var(--acid); }
.mode-tabs span { display: block; font-size: 13px; font-weight: 650; }
.mode-tabs small { display: block; margin-top: 2px; color: var(--dim); font: 9px var(--mono); }
.view { padding-bottom: 60px; }
.query-hero { padding: 52px clamp(28px, 5vw, 72px) 34px; border-bottom: 1px solid var(--line-soft); background: rgba(13,11,19,.82); }
.query-hero > div:first-child { max-width: 720px; }
.query-hero h2 { margin: 9px 0 7px; font-size: clamp(30px, 4vw, 48px); line-height: 1; letter-spacing: -.045em; }
.query-hero p { margin: 0; color: var(--muted); line-height: 1.5; }
.query-form { margin-top: 28px; max-width: 860px; border: 1px solid #485248; border-radius: 7px; background: var(--panel); box-shadow: 0 18px 60px rgba(0,0,0,.24); }
.query-form textarea { display: block; width: 100%; min-height: 94px; padding: 18px; resize: vertical; border: 0; outline: 0; color: var(--paper); background: transparent; font-size: 15px; line-height: 1.5; }
.query-controls { min-height: 54px; display: flex; align-items: center; gap: 18px; padding: 8px; border-top: 1px solid var(--line); }
.control-group { display: flex; align-items: center; gap: 8px; margin-left: 7px; }
.control-group label, .search-options > label:not(.switch) { color: var(--dim); font: 9px var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.control-group select, .search-options input { padding: 6px 8px; border: 1px solid var(--line); border-radius: 3px; color: var(--paper); background: var(--ink); font: 10px var(--mono); }
.primary-button, .secondary-button, .file-button { display: inline-flex; align-items: center; justify-content: center; gap: 16px; min-height: 38px; padding: 0 16px; border: 1px solid var(--acid); border-radius: 4px; color: var(--ink); background: var(--acid); font-weight: 700; font-size: 11px; }
.primary-button:hover, .file-button:hover { background: #ffad98; }
.query-controls .primary-button { margin-left: auto; }
.secondary-button { color: var(--paper); border-color: var(--line); background: transparent; }
.switch { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch > span { position: relative; width: 27px; height: 15px; border: 1px solid #4a544a; border-radius: 20px; background: var(--ink); }
.switch > span::after { content: ""; position: absolute; width: 9px; height: 9px; left: 2px; top: 2px; border-radius: 50%; background: var(--dim); transition: .15s; }
.switch input:checked + span { border-color: var(--acid-deep); }
.switch input:checked + span::after { transform: translateX(12px); background: var(--acid); }

.empty-state { max-width: 620px; margin: 80px auto; text-align: center; }
.empty-state.slim { margin-top: 58px; }
.empty-state h3 { margin: 18px 0 8px; font-size: 18px; }
.empty-state p { margin: 0 auto; max-width: 530px; color: var(--muted); line-height: 1.65; }
.empty-glyph { display: flex; justify-content: center; align-items: center; gap: 11px; color: var(--dim); font: 30px var(--mono); }
.empty-glyph i { display: block; width: 36px; height: 36px; border: 1px solid var(--acid); transform: rotate(45deg); }
.prompt-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-top: 24px; }
.prompt-chips button { padding: 8px 11px; border: 1px solid var(--line); border-radius: 30px; color: var(--muted); background: var(--ink-2); font-size: 10px; }
.prompt-chips button:hover { color: var(--paper); border-color: var(--acid-deep); }
.loading { display: flex; justify-content: center; align-items: center; gap: 12px; min-height: 180px; color: var(--muted); font: 11px var(--mono); }
.loading i { width: 17px; height: 17px; border: 2px solid var(--line); border-top-color: var(--acid); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.answer { padding: 36px clamp(28px, 5vw, 72px); }
.answer-meta, .results-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; color: var(--dim); font: 10px var(--mono); }
.research-timeline { margin: 0 0 25px; border: 1px solid var(--line); border-radius: 6px; background: rgba(25,21,34,.72); }
.research-timeline > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }
.research-intent { padding: 4px 7px; border: 1px solid var(--line); border-radius: 20px; color: var(--blue); font: 8px var(--mono); text-transform: uppercase; }
.research-intent.deterministic { color: var(--mint); border-color: rgba(120,223,181,.35); }
.research-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); }
.research-step { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; padding: 11px 12px; border-right: 1px solid var(--line-soft); }
.research-step:last-child { border-right: 0; }
.research-sequence { color: var(--acid); font: 8px var(--mono); }
.research-step b { display: block; color: var(--paper); font: 9px var(--mono); font-weight: 500; text-transform: uppercase; }
.research-step small { display: block; margin-top: 4px; overflow: hidden; color: var(--dim); font: 8px/1.4 var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.research-step-meta { grid-column: 2; color: var(--muted); font: 8px var(--mono); }
.research-step.degraded .research-sequence, .research-step.no_match .research-sequence { color: var(--orange); }
.status-pill, .channel, .kind-pill { padding: 4px 7px; border: 1px solid var(--line); border-radius: 20px; }
.status-pill.good { color: var(--acid); border-color: rgba(200,241,105,.35); }
.answer-summary { margin: 0 0 28px; max-width: 850px; font-size: 21px; line-height: 1.55; letter-spacing: -.015em; }
.citation-button { padding: 1px 5px; border: 0; border-radius: 3px; color: var(--ink); background: var(--acid); font: 9px var(--mono); vertical-align: super; }
.claims { display: grid; gap: 9px; }
.claim { display: grid; grid-template-columns: 90px 1fr; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line-soft); }
.claim-type { color: var(--blue); font: 9px var(--mono); letter-spacing: .09em; text-transform: uppercase; }
.claim[data-type="inference"] .claim-type { color: var(--orange); }
.claim[data-type="recommendation"] .claim-type { color: var(--acid); }
.claim p { margin: 0; line-height: 1.6; }
.claim .code { grid-column: 1 / -1; }
.limitations { margin-top: 24px; padding: 16px 18px; border-left: 2px solid var(--orange); color: var(--muted); background: rgba(255,157,92,.05); }
.limitations h3 { margin: 0 0 7px; color: var(--orange); font: 10px var(--mono); text-transform: uppercase; }
.limitations ul { margin: 0; padding-left: 17px; line-height: 1.6; }
.evidence-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 9px; margin-top: 35px; }
.evidence-card, .result-card { border: 1px solid var(--line); border-radius: 5px; background: var(--ink-2); }
.evidence-card.selected { border-color: var(--acid); box-shadow: 0 0 0 1px rgba(200,241,105,.15); }
.evidence-head { display: flex; align-items: center; gap: 9px; padding: 11px 13px; border-bottom: 1px solid var(--line-soft); }
.evidence-id { color: var(--acid); font: 10px var(--mono); }
.evidence-path { min-width: 0; overflow: hidden; text-overflow: ellipsis; font: 10px var(--mono); white-space: nowrap; }
.evidence-kind { margin-left: auto; color: var(--dim); font: 8px var(--mono); text-transform: uppercase; }
.code { margin: 0; max-height: 250px; overflow: auto; padding: 14px; color: #cbd2c7; background: #111511; font: 10px/1.65 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2; }

.query-hero.compact { padding-top: 35px; padding-bottom: 27px; }
.query-hero.compact h2 { font-size: 34px; }
.search-bar { display: grid; grid-template-columns: 1fr 120px auto; gap: 7px; max-width: 900px; margin-top: 24px; }
.search-bar input, .search-bar select { height: 44px; padding: 0 13px; border: 1px solid #485248; border-radius: 4px; color: var(--paper); background: var(--panel); }
.search-options { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; margin-top: 12px; }
.search-options > label:not(.switch) { display: grid; gap: 5px; }
.search-options input { width: 130px; }
#search-stage { padding: 28px clamp(28px, 5vw, 72px); }
.results-list { display: grid; gap: 10px; }
.result-card { overflow: hidden; }
.result-card-header { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; width: 100%; padding: 14px 15px; border: 0; color: var(--paper); background: transparent; text-align: left; }
.result-rank { color: var(--dim); font: 10px var(--mono); }
.result-location { min-width: 0; }
.result-location b { display: block; overflow: hidden; text-overflow: ellipsis; font: 11px var(--mono); white-space: nowrap; }
.result-location small { display: block; margin-top: 4px; color: var(--muted); font: 9px var(--mono); }
.result-score { color: var(--acid); font: 10px var(--mono); }
.result-card .code { max-height: 0; padding-top: 0; padding-bottom: 0; transition: max-height .22s, padding .22s; }
.result-card.open .code { max-height: 340px; padding-top: 14px; padding-bottom: 14px; border-top: 1px solid var(--line-soft); }
.result-footer { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 15px 12px 48px; }
.channel { color: var(--muted); font: 8px var(--mono); }
.relation-row { padding: 9px 15px 9px 48px; border-top: 1px dashed var(--line); color: var(--muted); font: 9px/1.5 var(--mono); }
.relation-row strong { color: var(--blue); }

/* Relationship canvas */
.graph-view { min-height: calc(100vh - 136px); padding: 0; }
.graph-header { min-height: 126px; display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; padding: 28px 30px 23px; border-bottom: 1px solid var(--line-soft); background: rgba(13,11,19,.9); }
.graph-header h2 { margin: 7px 0 6px; font-size: clamp(25px, 3vw, 38px); line-height: 1; letter-spacing: -.04em; }
.graph-header p { margin: 0; color: var(--muted); line-height: 1.5; }
.graph-summary { flex: none; display: grid; grid-template-columns: repeat(2, minmax(88px, 1fr)); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--panel); }
.graph-summary div { padding: 12px 16px; }
.graph-summary div + div { border-left: 1px solid var(--line); }
.graph-summary strong { display: block; color: var(--paper); font: 18px var(--mono); }
.graph-summary span { display: block; margin-top: 3px; color: var(--dim); font: 8px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.graph-toolbar { min-height: 58px; display: flex; align-items: flex-end; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); background: var(--ink-2); }
.graph-toolbar > label:not(.graph-search) { display: grid; gap: 4px; color: var(--dim); font: 8px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.graph-toolbar select { min-width: 122px; height: 34px; padding: 0 28px 0 10px; border: 1px solid var(--line); border-radius: 4px; color: var(--paper); background: var(--panel); font: 10px var(--mono); }
.graph-toolbar .secondary-button { min-height: 34px; margin-left: auto; }
.graph-search { flex: 1; max-width: 420px; height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; color: var(--dim); background: var(--panel); }
.graph-search:focus-within { border-color: var(--blue); }
.graph-search input { width: 100%; border: 0; outline: 0; color: var(--paper); background: transparent; font: 10px var(--mono); }
.graph-workspace { min-height: 560px; display: grid; grid-template-columns: minmax(0, 1fr) 230px; }
.graph-canvas { position: relative; min-width: 0; min-height: 560px; overflow: auto; background-color: #0f0c17; background-image: radial-gradient(circle, rgba(200,181,255,.12) 1px, transparent 1.2px); background-size: 24px 24px; }
#relationship-graph { display: block; width: 100%; min-width: 720px; height: 100%; min-height: 560px; }
.graph-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; padding: 30px; text-align: center; background: rgba(15,12,23,.9); }
.graph-empty[hidden] { display: none; }
.graph-empty > span { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; color: var(--blue); font: 18px var(--mono); }
.graph-empty h3 { margin: 15px 0 6px; }
.graph-empty p { max-width: 380px; margin: 0; color: var(--muted); line-height: 1.5; }
.graph-legend { position: absolute; left: 14px; bottom: 14px; display: flex; gap: 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: rgba(19,16,28,.92); font: 8px var(--mono); text-transform: uppercase; }
.graph-legend span { display: flex; align-items: center; gap: 6px; }
.graph-legend i { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); }
.graph-legend i.unresolved { background: var(--dim); }
.graph-legend i.selected { background: var(--acid); }
.graph-edge { fill: none; stroke: var(--mint); stroke-width: 1.2; stroke-opacity: .43; }
.graph-edge.unresolved { stroke: var(--dim); stroke-dasharray: 5 5; stroke-opacity: .55; }
.graph-edge.ambiguous { stroke: var(--orange); stroke-dasharray: 3 3; }
.graph-edge.active { stroke: var(--acid); stroke-width: 2.2; stroke-opacity: .92; }
.graph-edge-label { fill: var(--dim); font: 7px var(--mono); text-anchor: middle; pointer-events: none; }
.graph-node { cursor: pointer; outline: none; }
.graph-node rect { fill: #191522; stroke: #42374f; stroke-width: 1; transition: stroke .15s, fill .15s; }
.graph-node:hover rect, .graph-node:focus rect { fill: #211b2d; stroke: var(--blue); }
.graph-node.active rect { fill: #2b1c2a; stroke: var(--acid); stroke-width: 2; }
.graph-node.related rect { stroke: var(--mint); }
.graph-node .node-dot { fill: var(--blue); }
.graph-node.file .node-dot { fill: var(--mint); }
.graph-node.unresolved .node-dot { fill: var(--dim); }
.graph-node text { fill: var(--paper); font: 10px var(--mono); pointer-events: none; }
.graph-node .node-path { fill: var(--dim); font-size: 7px; }
.graph-detail { min-width: 0; padding: 20px 18px; border-left: 1px solid var(--line); background: var(--ink-2); }
.graph-detail h3 { margin: 8px 0 7px; overflow-wrap: anywhere; font-size: 15px; }
.graph-detail > p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.graph-detail-meta { display: grid; gap: 1px; margin: 18px 0; border: 1px solid var(--line-soft); background: var(--line-soft); }
.graph-detail-meta div { display: flex; justify-content: space-between; gap: 8px; padding: 8px 9px; background: var(--panel); }
.graph-detail-meta span { color: var(--dim); font: 8px var(--mono); text-transform: uppercase; }
.graph-detail-meta strong { overflow: hidden; color: var(--paper); font: 9px var(--mono); text-align: right; text-overflow: ellipsis; }
.graph-connections { margin-top: 18px; }
.graph-connections h4 { margin: 0 0 8px; color: var(--dim); font: 8px var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.graph-connection { width: 100%; padding: 9px 0; border: 0; border-top: 1px solid var(--line-soft); color: var(--paper); background: transparent; text-align: left; }
.graph-connection b { display: block; overflow: hidden; font: 9px var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.graph-connection small { color: var(--dim); font: 8px var(--mono); }
.graph-connection:hover b { color: var(--mint); }

.eval-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; }
.file-button { position: relative; flex: none; cursor: pointer; }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }
#eval-stage { padding: 28px clamp(28px, 5vw, 72px); }
.eval-drop { padding: 70px 25px; border: 1px dashed #4c564c; border-radius: 7px; color: var(--muted); text-align: center; background: rgba(29,35,29,.65); }
.eval-drop.dragging { border-color: var(--acid); background: rgba(200,241,105,.05); }
.eval-drop > span { color: var(--acid); font-size: 28px; }
.eval-drop h3 { margin: 12px 0 7px; color: var(--paper); }
.eval-drop p { margin: 0 0 18px; }
.eval-drop code { color: var(--dim); font: 10px var(--mono); }
.eval-header { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 24px; }
.eval-header h3 { margin: 4px 0; font-size: 22px; }
.eval-header p { margin: 0; color: var(--muted); font: 10px var(--mono); }
.gate { padding: 8px 12px; border: 1px solid; border-radius: 3px; font: 10px var(--mono); text-transform: uppercase; }
.gate.pass { color: var(--acid); border-color: var(--acid-deep); }
.gate.fail { color: var(--red); border-color: var(--red); }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 8px; }
.metric { min-height: 100px; padding: 15px; border: 1px solid var(--line); background: var(--ink-2); }
.metric strong { display: block; font: 25px var(--mono); }
.metric span { display: block; margin-top: 13px; color: var(--muted); font: 9px/1.35 var(--mono); text-transform: uppercase; }
.case-table { width: 100%; margin-top: 25px; border-collapse: collapse; font: 10px var(--mono); }
.case-table th { padding: 9px; color: var(--dim); border-bottom: 1px solid var(--line); text-align: left; font-weight: 400; text-transform: uppercase; }
.case-table td { padding: 12px 9px; border-bottom: 1px solid var(--line-soft); }
.case-table td:first-child { color: var(--paper); }

.inspector-head { height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-bottom: 1px solid var(--line); }
.inspector-head .eyebrow { margin-bottom: 3px; }
.inspector-block { padding: 20px 18px; border-bottom: 1px solid var(--line); }
.inspector-block h3 { margin: 0 0 13px; color: var(--dim); font: 9px var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.inspector-block dl { margin: 0; }
.inspector-block dl div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; }
.inspector-block dt { color: var(--muted); font-size: 11px; }
.inspector-block dd { margin: 0; color: var(--paper); font: 10px var(--mono); text-align: right; }
.inspector-block dd.good { color: var(--acid); }
.inspector-block dd.bad { color: var(--red); }
.activity-list { display: grid; gap: 10px; }
.activity-list p, .trace-empty { margin: 0; color: var(--dim); font: 10px/1.55 var(--mono); }
.activity { display: grid; grid-template-columns: 7px 1fr; gap: 9px; }
.activity > i { width: 6px; height: 6px; margin-top: 4px; border-radius: 50%; background: var(--acid); }
.activity b { display: block; font-size: 10px; font-weight: 500; }
.activity small { color: var(--dim); font: 9px var(--mono); }
.trace-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); }
.trace-grid div { padding: 9px; background: var(--ink-2); }
.trace-grid strong { display: block; font: 13px var(--mono); }
.trace-grid span { color: var(--dim); font: 8px var(--mono); text-transform: uppercase; }
.trace-lines { margin-top: 10px; color: var(--muted); font: 9px/1.7 var(--mono); overflow-wrap: anywhere; }
.inspector-toggle { display: none; position: fixed; right: 15px; bottom: 15px; z-index: 15; padding: 9px 12px; border: 1px solid var(--acid); border-radius: 3px; color: var(--ink); background: var(--acid); font: 10px var(--mono); }

.toast-region { position: fixed; right: 22px; bottom: 22px; z-index: 80; display: grid; gap: 8px; }
.toast { max-width: 390px; padding: 12px 15px; border: 1px solid #5a655a; border-radius: 4px; color: var(--paper); background: #242b24; box-shadow: 0 10px 35px rgba(0,0,0,.35); font: 11px/1.45 var(--mono); animation: toast-in .18s ease-out; }
.toast.error { border-color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } }
dialog { width: min(470px, calc(100% - 30px)); padding: 0; border: 1px solid #4c564c; border-radius: 6px; color: var(--paper); background: var(--panel); box-shadow: 0 30px 100px rgba(0,0,0,.7); }
dialog::backdrop { background: rgba(3,5,3,.78); backdrop-filter: blur(3px); }
dialog form { padding: 24px; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; }
.dialog-head h2 { margin: 6px 0 0; }
dialog p { color: var(--muted); line-height: 1.5; }
dialog label { display: grid; gap: 7px; margin-top: 16px; color: var(--muted); font: 10px var(--mono); }
dialog input { padding: 11px; border: 1px solid var(--line); border-radius: 3px; color: var(--paper); background: var(--ink); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }

@media (max-width: 1380px) {
  .topbar { grid-template-columns: 280px 1fr 230px; }
  .app-shell { grid-template-columns: 280px minmax(500px, 1fr); }
  .inspector { position: fixed; top: 68px; right: 0; bottom: 0; z-index: 30; width: 320px; transform: translateX(100%); transition: transform .2s; box-shadow: -15px 0 50px rgba(0,0,0,.4); }
  .inspector.open { transform: translateX(0); }
  .inspector-toggle { display: block; }
}
@media (max-width: 800px) {
  .topbar { height: auto; min-height: 68px; grid-template-columns: 1fr auto; }
  .brand { border: 0; }
  .topbar-center { grid-column: 1 / -1; grid-row: 2; justify-content: stretch; padding: 10px 15px; border-top: 1px solid var(--line); }
  .topbar-center select { flex: 1; min-width: 0; max-width: none; }
  .repo-select-label, .health { display: none; }
  .topbar-actions { border: 0; padding: 0 15px; }
  .app-shell { min-height: calc(100vh - 123px); grid-template-columns: 1fr; }
  .sidebar { border: 0; border-bottom: 1px solid var(--line); }
  .repo-card { padding-bottom: 17px; }
  .pipeline { grid-template-columns: repeat(3, 1fr); }
  .pipeline button { gap: 7px; }
  .pipeline small { display: none; }
  .explorer { display: none; }
  .mode-tabs { height: 62px; padding: 0 10px; }
  .mode-tabs button { min-width: 0; flex: 1; padding: 0 10px; text-align: center; }
  .mode-tabs small { display: none; }
  .query-hero { padding: 36px 20px 25px; }
  .query-controls { flex-wrap: wrap; }
  .query-controls .primary-button { width: 100%; margin: 0; }
  .search-bar { grid-template-columns: 1fr 100px; }
  .search-bar .primary-button { grid-column: 1 / -1; }
  .answer, #search-stage, #eval-stage { padding: 25px 20px; }
  .claim { grid-template-columns: 1fr; gap: 6px; }
  .eval-intro { align-items: flex-start; flex-direction: column; }
  .graph-header { align-items: flex-start; flex-direction: column; padding: 28px 20px 20px; }
  .graph-summary { width: 100%; }
  .graph-toolbar { align-items: stretch; flex-wrap: wrap; }
  .graph-search { flex-basis: 100%; max-width: none; }
  .graph-toolbar > label:not(.graph-search) { flex: 1; }
  .graph-toolbar select { width: 100%; min-width: 0; }
  .graph-toolbar .secondary-button { margin-left: 0; align-self: flex-end; }
  .graph-workspace { grid-template-columns: 1fr; }
  .graph-detail { border-top: 1px solid var(--line); border-left: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }

[hidden] { display: none !important; }

.account-page { min-height: 100vh; background: radial-gradient(circle at 12% 0%, rgba(200,181,255,.08), transparent 36%), var(--ink); }
.account-page-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 76px; padding: 14px clamp(24px, 5vw, 72px); border-bottom: 1px solid var(--line); background: rgba(13,11,19,.9); }
.account-back { color: var(--muted); font: 11px var(--mono); text-decoration: none; }
.account-back:hover { color: var(--acid); }
.account-main { width: min(1200px, 100%); margin: 0 auto; padding: clamp(30px, 5vw, 64px) clamp(20px, 5vw, 56px) 80px; }
.account-heading h1 { margin: 11px 0 8px; font-size: clamp(30px, 4vw, 44px); letter-spacing: -.045em; }
.account-heading p, .account-card-heading p { color: var(--muted); line-height: 1.6; }
.account-heading p { margin: 0 0 32px; }
.account-layout { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); align-items: start; gap: 22px; }
.account-card { min-width: 0; padding: clamp(20px, 3vw, 30px); border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.account-card-heading { margin-bottom: 23px; }
.account-card-heading h2 { margin: 9px 0 5px; font-size: 20px; letter-spacing: -.025em; }
.account-card-heading p { margin: 0; font-size: 12px; }
.account-card form { display: grid; gap: 9px; }
.account-card label { margin-top: 9px; font-size: 12px; font-weight: 600; }
.account-card input, .account-card select, .account-password { width: 100%; min-height: 43px; padding: 0 12px; border: 1px solid #52485f; border-radius: 5px; color: var(--paper); background: var(--ink-2); }
.account-card input:hover, .account-card select:hover, .account-password:hover { border-color: var(--muted); }
.account-card .field-hint { color: var(--dim); font: 10px var(--mono); }
.account-card form > button { justify-content: space-between; width: 100%; min-height: 44px; margin-top: 17px; }
.account-list { display: grid; gap: 12px; }
.account-row { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 6px; background: var(--ink-2); }
.account-row-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.account-row-head strong { display: block; overflow-wrap: anywhere; font-size: 13px; }
.account-row-head small { display: block; margin-top: 4px; overflow-wrap: anywhere; color: var(--muted); font-size: 11px; }
.account-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.account-badge { padding: 4px 7px; border: 1px solid var(--line); border-radius: 20px; color: var(--blue); font: 9px var(--mono); white-space: nowrap; }
.account-badge.enabled { border-color: rgba(120,223,181,.35); color: var(--mint); }
.account-badge.disabled { border-color: rgba(255,111,130,.4); color: #ffb0bb; }
.account-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.account-actions button { min-height: 33px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 4px; color: var(--paper); background: var(--panel); font-size: 11px; }
.account-actions button:hover { border-color: var(--acid); color: var(--acid); }
.account-actions .danger:hover { border-color: var(--red); color: var(--red); }
.account-password-form { display: flex; gap: 7px; margin-top: 10px; }
.account-password-form .account-password { flex: 1; min-width: 0; }
.account-password-form button { flex: none; min-height: 39px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; color: var(--paper); background: var(--panel); font-size: 11px; }
.account-password-form button:hover { border-color: var(--acid); color: var(--acid); }
.account-status { margin: 0 0 20px; padding: 11px 13px; border: 1px solid rgba(120,223,181,.38); border-radius: 4px; color: var(--mint); background: rgba(120,223,181,.07); font-size: 12px; }
#account-error { max-width: 900px; }
@media (max-width: 760px) { .account-layout { grid-template-columns: 1fr; } }
@media (max-width: 460px) { .account-page-header { align-items: flex-start; flex-direction: column; gap: 8px; } .account-row-head { flex-direction: column; } .account-badges { justify-content: flex-start; } .account-password-form { flex-direction: column; } }

/* Sign-in and signed-in account controls */
.auth-page { min-height: 100vh; }
.auth-layout { display: grid; grid-template-columns: minmax(360px, 1fr) minmax(390px, 1fr); min-height: 100vh; }
.auth-intro { position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; padding: clamp(28px, 5vw, 72px); overflow: hidden; border-right: 1px solid var(--line); background: radial-gradient(circle at 20% 70%, rgba(200,181,255,.13), transparent 38%), linear-gradient(145deg, #191523, #100e18 72%); }
.auth-intro::before { content: ""; position: absolute; inset: 0; opacity: .35; pointer-events: none; background-image: linear-gradient(rgba(200,181,255,.1) 1px, transparent 1px), linear-gradient(90deg, rgba(200,181,255,.1) 1px, transparent 1px); background-size: 38px 38px; mask-image: linear-gradient(transparent 5%, black 100%); }
.auth-intro > * { position: relative; }
.auth-brand { display: inline-flex; align-items: center; gap: 13px; align-self: flex-start; color: var(--paper); text-decoration: none; font-weight: 700; font-size: 16px; }
.auth-intro-copy { max-width: 560px; }
.auth-intro-copy h1 { margin: 18px 0 20px; font-size: clamp(39px, 4vw, 70px); line-height: 1.08; letter-spacing: -.05em; }
.auth-intro-copy h1 em { color: var(--acid); font-style: normal; }
.auth-intro-copy p { max-width: 440px; margin: 0; color: var(--muted); font-size: clamp(15px, 1.25vw, 18px); line-height: 1.65; }
.auth-intro-foot { color: var(--dim); font: 10px var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.auth-form-side { display: grid; place-items: center; padding: 48px 28px; }
.auth-card { width: min(100%, 410px); }
.auth-card h2 { margin: 13px 0 10px; font-size: clamp(25px, 2.2vw, 32px); line-height: 1.15; letter-spacing: -.035em; }
.auth-subtitle { margin: 0 0 32px; color: var(--muted); line-height: 1.6; }
.auth-card form { display: grid; gap: 10px; }
.auth-card label { margin-top: 10px; color: var(--paper); font-size: 12px; font-weight: 600; }
.auth-card input { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid #52485f; border-radius: 5px; outline: none; color: var(--paper); background: var(--ink-2); transition: border-color .15s, box-shadow .15s; }
.auth-card input:hover { border-color: var(--muted); }
.auth-card input:focus-visible { border-color: var(--acid); box-shadow: 0 0 0 3px rgba(255,148,120,.15); }
.auth-submit { justify-content: space-between; width: 100%; min-height: 48px; margin-top: 19px; padding: 0 16px; font-size: 13px; }
.auth-help { margin: 25px 0 0; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.5; }
.form-message { margin: 0 0 18px; padding: 11px 13px; border: 1px solid rgba(255,111,130,.4); border-radius: 4px; color: #ffb0bb; background: rgba(255,111,130,.08); font-size: 12px; line-height: 1.5; }

.topbar { z-index: 40; grid-template-columns: 280px minmax(260px, 1fr) minmax(300px, auto); }
.topbar-actions { gap: 17px; }
.account-menu { position: relative; flex: none; }
.account-menu summary { display: flex; align-items: center; gap: 9px; min-width: 140px; padding: 6px 8px; border: 1px solid transparent; border-radius: 5px; cursor: pointer; list-style: none; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary:hover, .account-menu[open] summary { border-color: var(--line); background: var(--panel); }
.account-avatar { display: grid; flex: none; place-items: center; width: 31px; height: 31px; border: 1px solid #8e5d5b; border-radius: 6px; color: var(--acid); background: #302029; font: 700 13px var(--mono); }
.account-trigger-text { display: grid; gap: 2px; min-width: 0; }
.account-trigger-text strong { max-width: 115px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.account-trigger-text small { color: var(--dim); font: 9px var(--mono); }
.account-chevron { margin-left: auto; color: var(--dim); font-size: 15px; }
.account-dropdown { position: absolute; top: calc(100% + 12px); right: 0; z-index: 50; width: min(260px, calc(100vw - 24px)); padding: 6px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); box-shadow: 0 18px 50px rgba(0,0,0,.5); }
.account-dropdown-head { display: grid; gap: 4px; padding: 12px; border-bottom: 1px solid var(--line); }
.account-dropdown-head strong { overflow-wrap: anywhere; font-size: 12px; }
.account-dropdown-head span { overflow-wrap: anywhere; color: var(--muted); font-size: 11px; }
.account-dropdown a, .account-dropdown button { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 39px; padding: 0 12px; border: 0; border-radius: 4px; color: var(--paper); background: transparent; font-size: 11px; text-align: left; text-decoration: none; }
.account-dropdown a:hover, .account-dropdown button:hover { color: var(--acid); background: var(--ink-2); }
.account-dropdown button { cursor: pointer; }

@media (max-width: 1100px) {
  .topbar { grid-template-columns: 220px minmax(180px, 1fr) auto; }
  .topbar-actions { gap: 10px; padding: 0 12px; }
  .health { display: none; }
}
@media (max-width: 800px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-intro { min-height: 0; padding: 25px 24px; border-right: 0; border-bottom: 1px solid var(--line); }
  .auth-intro-copy, .auth-intro-foot { display: none; }
  .auth-form-side { min-height: calc(100vh - 87px); padding: 40px 24px 64px; }
  .topbar { grid-template-columns: minmax(0, 1fr) auto; }
  .topbar-actions { height: 68px; gap: 8px; padding: 0 12px; }
  .account-menu summary { min-width: 0; padding: 4px; }
  .account-trigger-text, .account-chevron { display: none; }
}
@media (max-width: 500px) {
  .topbar-actions .docs-link { display: none; }
  .brand { padding: 0 12px; }
  .brand small { display: none; }
}

/* Planner V1: proposals are never executed. */
.experimental-tag { display: inline-block; margin-left: 6px; padding: 1px 5px; border: 1px solid rgba(255,157,92,.5); border-radius: 4px; color: var(--orange); font: 600 8px var(--mono); font-style: normal; letter-spacing: .08em; text-transform: uppercase; vertical-align: middle; }
.eyebrow .experimental-tag { margin-left: 0; }
.proposal-banner strong { color: var(--orange); }
.proposal-banner { margin: 0 0 14px; padding: 10px 14px; border: 1px solid rgba(255,157,92,.35); border-radius: 8px; color: var(--orange); background: rgba(255,157,92,.05); font: 11px var(--mono); }
.plan-section { margin-top: 22px; }
.plan-section h3 { margin: 0 0 8px; color: var(--dim); font: 10px var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.plan-steps { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.plan-step { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.plan-step .step-number { color: var(--acid); font: 12px var(--mono); }
.plan-step .step-target { font: 11px var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.plan-step p { margin: 4px 0 0; line-height: 1.6; }
.plan-step .code { margin-top: 8px; }
.plan-tag { display: inline-block; margin-left: 6px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 12px; color: var(--dim); font: 9px var(--mono); }
.plan-list { margin: 0; padding-left: 17px; line-height: 1.6; }
.plan-files { width: 100%; border-collapse: collapse; font: 11px var(--mono); }
.plan-files td { padding: 6px 8px 6px 0; border-top: 1px solid var(--line-soft); vertical-align: top; overflow-wrap: anywhere; }

