:root {
  --bg: #0d1117;
  --panel: #141a22;
  --panel-2: #19212c;
  --text: #edf2f7;
  --muted: #9ca9b8;
  --border: #2b3644;
  --accent: #d6b56f;
  --accent-2: #f0d99e;
  --person: #8fb3d9;
  --org: #d3b778;
  --pac: #bd91c8;
  --gov: #8fbf9a;
  --danger: #d88d8d;
  --focus: #8ab4f8;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin:0; background:var(--bg); color:var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color:var(--accent-2); }
button,input,select { font:inherit; }
button { cursor:pointer; }
button:disabled { cursor:not-allowed; opacity:.45; }
.site-header { min-height:68px; padding:14px clamp(18px,4vw,48px); display:flex; gap:20px; justify-content:space-between; align-items:center; border-bottom:1px solid var(--border); position:sticky; top:0; z-index:50; background:rgba(13,17,23,.94); backdrop-filter: blur(12px); }
.brand-wrap,.mode-wrap { display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
.brand { font-weight:900; letter-spacing:.09em; text-decoration:none; color:var(--text); }
.brand span { color:var(--accent); }
.section-name { color:var(--muted); font-size:.9rem; border-left:1px solid var(--border); padding-left:14px; }
.badge { padding:6px 10px; border-radius:999px; font-size:.78rem; font-weight:700; border:1px solid var(--border); }
.badge-public { background:#152019; color:#b9dabf; }
.badge-private { background:#241f16; color:var(--accent-2); border-color:#6b5931; }
.small-link { font-size:.82rem; color:var(--muted); }
main { width:min(1440px, calc(100% - 32px)); margin:0 auto; padding:34px 0 70px; }
.intro { display:grid; grid-template-columns:minmax(0,1.6fr) minmax(280px,.7fr); gap:28px; align-items:end; margin-bottom:24px; }
.eyebrow { margin:0 0 8px; font-size:.72rem; font-weight:800; letter-spacing:.16em; color:var(--accent); }
h1 { font-size:clamp(2.1rem,5vw,4.5rem); line-height:.95; margin:.1em 0 .25em; letter-spacing:-.04em; }
h2 { font-size:clamp(1.25rem,2.2vw,1.8rem); margin:0 0 8px; }
.lede { max-width:820px; color:#c5ced8; font-size:clamp(1rem,1.8vw,1.2rem); line-height:1.6; margin:0; }
.principle-card { border-left:3px solid var(--accent); background:var(--panel); padding:18px 20px; }
.principle-card p { margin:8px 0 0; color:var(--muted); line-height:1.5; }
.panel { background:var(--panel); border:1px solid var(--border); border-radius:14px; }
.toolbar { display:grid; grid-template-columns:minmax(280px,2fr) 130px 220px 140px; gap:14px; padding:16px; margin-bottom:14px; align-items:end; }
.control { min-width:0; }
.control label,.label-like { display:block; font-size:.78rem; color:var(--muted); margin-bottom:7px; font-weight:700; }
input,select { width:100%; min-height:44px; border:1px solid var(--border); border-radius:9px; background:#0e141c; color:var(--text); padding:10px 12px; outline:none; }
input:focus,select:focus,button:focus-visible { border-color:var(--focus); outline:2px solid rgba(138,180,248,.25); outline-offset:1px; }
.autocomplete { position:relative; }
.results { position:absolute; left:0; right:0; top:calc(100% + 5px); z-index:40; max-height:320px; overflow:auto; background:#101720; border:1px solid var(--border); border-radius:10px; box-shadow:0 18px 50px rgba(0,0,0,.35); }
.result-btn { width:100%; border:0; border-bottom:1px solid var(--border); background:transparent; color:var(--text); text-align:left; padding:10px 12px; display:flex; justify-content:space-between; gap:12px; }
.result-btn:last-child { border-bottom:0; }
.result-btn:hover,.result-btn:focus-visible { background:var(--panel-2); }
.result-meta { color:var(--muted); font-size:.75rem; white-space:nowrap; }
.chosen { min-height:20px; margin-top:6px; color:var(--accent-2); font-size:.78rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.segmented { display:grid; grid-template-columns:1fr 1fr; border:1px solid var(--border); border-radius:9px; overflow:hidden; }
.seg { min-height:44px; border:0; background:#0e141c; color:var(--muted); }
.seg.active { background:#252c34; color:var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.primary,.secondary { min-height:44px; border-radius:9px; padding:10px 14px; font-weight:800; }
.primary { border:1px solid #9b824d; color:#17130b; background:var(--accent); }
.secondary { border:1px solid var(--border); color:var(--text); background:#111821; }
.control-action .primary { width:100%; }
.staff-controls { display:flex; justify-content:space-between; gap:20px; align-items:center; padding:15px 18px; margin-bottom:14px; border-color:#65552f; }
.staff-controls p { margin:4px 0 0; }
.switch-row { display:flex; align-items:center; gap:10px; font-weight:700; white-space:nowrap; }
.switch-row input { width:20px; min-height:20px; }
.filter-panel { padding:14px 16px; margin-bottom:14px; }
.filter-head { display:flex; justify-content:space-between; gap:16px; align-items:center; }
.chips { display:flex; gap:8px; flex-wrap:wrap; }
.chip { display:inline-flex; align-items:center; gap:7px; min-height:36px; padding:7px 10px; border:1px solid var(--border); border-radius:999px; color:var(--muted); background:#10161e; font-size:.78rem; }
.chip input { width:16px; min-height:16px; margin:0; }
.map-actions { display:flex; gap:7px; flex:0 0 auto; }
.map-actions .secondary { min-width:44px; padding:8px 10px; }
.legend { margin-top:12px; display:flex; gap:16px; align-items:center; flex-wrap:wrap; color:var(--muted); font-size:.76rem; }
.line { width:30px; border-top:2px solid #9aa7b4; display:inline-block; vertical-align:middle; margin-right:5px; }
.line.dashed { border-top-style:dashed; }
.line.dotted { border-top-style:dotted; }
.legend-note { margin-left:auto; }
.map-shell { display:grid; grid-template-columns:minmax(0,1fr) 340px; gap:14px; min-height:680px; }
.map-main { min-width:0; overflow:hidden; display:flex; flex-direction:column; }
.map-meta { display:flex; justify-content:space-between; gap:10px; padding:12px 15px; border-bottom:1px solid var(--border); font-weight:800; }
#cy { width:100%; min-height:620px; background:radial-gradient(circle at center, #151c25 0, #10151c 55%, #0d1218 100%); }
.empty-state { min-height:620px; display:grid; place-content:center; text-align:center; gap:7px; color:var(--muted); padding:30px; }
.empty-state strong { color:var(--text); font-size:1.2rem; }
.detail-panel { padding:16px; overflow:auto; max-height:680px; }
.detail-empty { color:var(--muted); line-height:1.5; }
.detail-title { font-size:1.35rem; line-height:1.15; margin:0 0 5px; }
.detail-type { color:var(--muted); font-size:.78rem; text-transform:uppercase; letter-spacing:.08em; }
.detail-statgrid { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:14px 0; }
.detail-stat { padding:10px; background:#10161e; border:1px solid var(--border); border-radius:9px; }
.detail-stat b { display:block; font-size:1.25rem; }
.detail-actions { display:flex; gap:8px; flex-wrap:wrap; margin:12px 0; }
.detail-actions button { flex:1 1 120px; }
.edge-label { color:var(--accent-2); font-weight:800; }
.evidence-list { display:grid; gap:10px; margin-top:14px; }
.evidence-item { padding:11px; border:1px solid var(--border); border-radius:9px; background:#10161e; }
.evidence-item h4 { margin:0 0 5px; font-size:.92rem; }
.evidence-item p { margin:5px 0; color:#c4ccd5; font-size:.82rem; line-height:1.45; }
.evidence-item a { font-size:.8rem; overflow-wrap:anywhere; }
.muted { color:var(--muted); }
.pathfinder { margin-top:14px; padding:18px; }
.pathfinder-head { max-width:900px; }
.pathfinder-head p { margin:.35em 0; line-height:1.5; }
.path-controls { display:grid; grid-template-columns:minmax(220px,1fr) 36px minmax(220px,1fr) 110px 150px; gap:12px; align-items:end; margin-top:15px; }
.path-arrow { text-align:center; padding-bottom:16px; color:var(--accent); font-size:1.5rem; }
.path-result { margin-top:16px; padding:14px; border:1px solid var(--border); border-radius:10px; background:#10161e; }
.path-step { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:7px 0; border-bottom:1px solid var(--border); }
.path-step:last-child { border-bottom:0; }
.path-edge { color:var(--accent-2); font-size:.8rem; }
.path-actions { margin-top:10px; display:flex; gap:8px; flex-wrap:wrap; }
.method { margin-top:14px; padding:18px; }
.method-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:22px; }
.method-grid p { color:var(--muted); line-height:1.5; margin:6px 0 0; }
.toast { position:fixed; right:20px; bottom:20px; z-index:100; max-width:min(420px,calc(100% - 40px)); padding:12px 14px; background:#1a232e; border:1px solid var(--border); border-radius:10px; box-shadow:0 12px 40px rgba(0,0,0,.35); }
@media (max-width: 1050px) {
  .toolbar { grid-template-columns:1fr 120px 200px; }
  .control-action { grid-column:1/-1; }
  .map-shell { grid-template-columns:1fr; }
  .detail-panel { max-height:none; }
  .path-controls { grid-template-columns:1fr 36px 1fr; }
  .path-controls > .control:nth-of-type(3), .path-controls > .control-action { grid-column:auto; }
  .method-grid { grid-template-columns:1fr; }
}
@media (max-width: 720px) {
  main { width:min(100% - 20px,1440px); padding-top:20px; }
  .site-header { position:static; padding:12px; }
  .section-name { display:none; }
  .intro { grid-template-columns:1fr; }
  .toolbar { grid-template-columns:1fr 1fr; }
  .control-search { grid-column:1/-1; }
  .toolbar .control-action { grid-column:1/-1; }
  .filter-head { align-items:flex-start; flex-direction:column; }
  .legend-note { width:100%; margin-left:0; }
  #cy,.empty-state { min-height:520px; }
  .map-shell { min-height:0; }
  .staff-controls { align-items:flex-start; flex-direction:column; }
  .path-controls { grid-template-columns:1fr; }
  .path-arrow { display:none; }
  .path-controls .control { grid-column:auto !important; }
  .mode-wrap { justify-content:flex-end; }
}
.overview { display:grid; grid-template-columns:repeat(4,1fr); margin-bottom:14px; overflow:hidden; }
.overview-stat { padding:15px 18px; border-right:1px solid var(--border); }
.overview-stat:last-child { border-right:0; }
.overview-stat b { display:block; font-size:1.45rem; }
.overview-stat span { display:block; color:var(--muted); font-size:.78rem; margin-top:3px; }
.quick-start { padding:16px; margin-bottom:14px; }
.quick-start-head { display:flex; justify-content:space-between; gap:16px; align-items:flex-start; }
.quick-start-head p { margin:.25rem 0 0; }
.quick-start-list { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:9px; margin-top:12px; }
.quick-pick { min-width:0; border:1px solid var(--border); background:#10161e; color:var(--text); border-radius:10px; padding:10px; text-align:left; }
.quick-pick:hover,.quick-pick:focus-visible { border-color:#776742; background:#151d27; }
.quick-pick-name { display:block; font-weight:800; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.quick-pick-meta { display:block; color:var(--muted); font-size:.74rem; margin-top:3px; }
.research-roles { margin-top:14px; padding:18px; }
.research-roles h2 { margin:.25rem 0; }
.research-roles label { display:block; margin:16px 0 6px; font-weight:700; }
.research-roles input { width:min(100%,520px); }
#researchCy { width:100%; height:470px; margin-top:14px; border:1px solid var(--border); border-radius:10px; background:radial-gradient(circle at center,#17212a,#0d1218); }
.research-role-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:14px; max-height:520px; overflow:auto; }
.research-role-card { padding:14px; border:1px solid var(--border); border-radius:10px; background:#10161e; }
.research-role-card h3 { margin:0 0 9px; font-size:1rem; line-height:1.4; }
.research-role-card p { color:var(--muted); font-size:.82rem; line-height:1.5; }
.research-role-card a { overflow-wrap:anywhere; }
@media (max-width:1050px){ .quick-start-list{grid-template-columns:repeat(3,minmax(0,1fr));} }
@media (max-width:720px){ .overview{grid-template-columns:1fr 1fr;} .overview-stat:nth-child(2){border-right:0;} .overview-stat:nth-child(-n+2){border-bottom:1px solid var(--border);} .quick-start-head{flex-direction:column;} .quick-start-list{grid-template-columns:1fr 1fr;} }
@media (max-width:720px){ .research-role-list{grid-template-columns:1fr;} }
[hidden] { display: none !important; }
