:root {
  color-scheme: dark;
  --bg: #0e1116;
  --panel: #161b23;
  --panel-2: #121720;
  --border: #232b36;
  --text: #e7edf5;
  --muted: #8b98a8;
  --blue: #7ec8ff;
  --gold: #e8c069;
  --green: #8fe28f;
  --orange: #e08a3c;
  --red: #e05555;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 15px/1.45 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, textarea, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.cosmos { position: fixed; inset: 0; pointer-events: none; opacity: .75; background: radial-gradient(circle at 18% 18%, rgba(62,99,221,.14), transparent 28%), radial-gradient(circle at 82% 8%, rgba(8,145,178,.09), transparent 24%), radial-gradient(circle at 65% 75%, rgba(232,192,105,.055), transparent 26%), radial-gradient(circle, rgba(255,255,255,.55) 0 1px, transparent 1.2px) 0 0/97px 97px; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; height: 68px; padding: 0 20px; border-bottom: 1px solid rgba(35,43,54,.8); background: rgba(14,17,22,.84); backdrop-filter: blur(18px); }
.brand { display: flex; gap: 10px; align-items: center; color: var(--text); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #334155; border-radius: 50%; color: var(--blue); background: linear-gradient(145deg,#151d2b,#0d1016); box-shadow: 0 0 24px rgba(126,200,255,.12); font-weight: 800; }
.brand strong { display: block; font-size: 13px; letter-spacing: .16em; }
.brand small { display: block; color: var(--muted); font-size: 10px; letter-spacing: .04em; }
.health { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.health i { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 10px currentColor; }
.health.online i { background: var(--green); }
.health.offline i { background: var(--red); }
.freshness-banner { position: relative; z-index: 8; display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 42px; padding: 7px 18px; border-bottom: 1px solid #3e3525; color: #d9c79f; background: rgba(54,42,24,.76); text-align: center; }
.freshness-banner span { font-size: 12px; white-space: nowrap; }
.freshness-banner small { color: #aa9d86; font-size: 11px; }
.freshness-banner.degraded { border-color: #67383c; color: #ffc3c3; background: rgba(87,37,42,.78); }
.shell { position: relative; width: min(1180px, 100%); margin: 0 auto; padding: 0 18px 112px; }
.app-view[hidden] { display: none !important; }
.hero { padding: clamp(54px, 10vh, 110px) 0 30px; }
.eyebrow { margin: 0 0 12px; color: var(--blue); font-size: 11px; font-weight: 750; letter-spacing: .2em; }
h1 { margin: 0; max-width: 720px; font-size: clamp(42px, 8vw, 78px); line-height: .98; letter-spacing: -.055em; }
h1 span { color: #6e7b8d; }
.lede { max-width: 580px; margin: 22px 0 28px; color: var(--muted); font-size: clamp(16px, 2.2vw, 19px); }
.ask-box { position: relative; padding: 17px; border: 1px solid #303a49; border-radius: 20px; background: rgba(22,27,35,.95); box-shadow: 0 22px 70px rgba(0,0,0,.25), inset 0 1px rgba(255,255,255,.025); }
.ask-box:focus-within { border-color: #486174; box-shadow: 0 22px 70px rgba(0,0,0,.3), 0 0 0 3px rgba(126,200,255,.07); }
.ask-box textarea { display: block; width: 100%; min-height: 68px; resize: none; border: 0; outline: 0; color: var(--text); background: transparent; font-size: clamp(18px, 3vw, 25px); line-height: 1.3; }
.ask-box textarea::placeholder { color: #657184; }
.ask-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.voice, .submit, .new-query, .auth-panel button { min-width: 46px; min-height: 46px; border: 1px solid var(--border); border-radius: 13px; background: #1b222c; cursor: pointer; }
.voice { color: var(--blue); font-size: 23px; }
.submit { display: flex; align-items: center; gap: 16px; padding: 0 17px; border-color: #3a667e; color: #071119; background: var(--blue); font-weight: 750; }
.submit b { font-size: 18px; }
.submit:disabled { opacity: .55; cursor: wait; }
.suggestions { display: flex; gap: 9px; overflow-x: auto; margin: 15px -18px 0; padding: 0 18px 8px; scrollbar-width: none; }
.suggestions button { flex: 0 0 auto; min-height: 44px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; color: #b4c0cf; background: rgba(18,23,32,.72); cursor: pointer; }
.suggestions button:hover { color: var(--blue); border-color: #34495c; }
.corpus { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 20px; color: var(--muted); font-size: 12px; }
.corpus strong { color: #cdd7e4; }
.corpus i { width: 3px; height: 3px; border-radius: 50%; background: #3a4654; }
.corpus code { color: var(--gold); }
.results { padding-top: 38px; }
.results-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.results h2, .auth-panel h2 { margin: 0; font-size: clamp(25px, 5vw, 38px); letter-spacing: -.035em; }
.new-query { padding: 0 14px; color: var(--blue); }
.confidence { display: flex; gap: 13px; padding: 14px 15px; border: 1px solid #4a3929; border-radius: 14px; background: rgba(64,42,25,.32); }
.confidence-dot { flex: 0 0 auto; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 13px rgba(224,138,60,.55); }
.confidence strong { color: #f1c797; }
.confidence p { margin: 3px 0 0; color: #aa9c8d; font-size: 13px; }
.result-meta { margin: 17px 2px 9px; color: var(--muted); font-size: 12px; letter-spacing: .03em; }
.agent-preview { display: grid; gap: 11px; margin: 14px 0; padding: 16px; border: 1px solid #33546a; border-radius: 14px; background: linear-gradient(145deg, rgba(20,34,45,.85), rgba(18,23,32,.9)); }
.agent-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.agent-preview-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 7px; }
.agent-preview-head .eyebrow { margin-bottom: 4px; color: #8fe28f; }
.agent-preview-head h3 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.agent-preview-head button { flex: 0 0 auto; min-height: 42px; padding: 0 12px; border: 1px solid #3e6f88; border-radius: 10px; color: #071119; background: var(--blue); cursor: pointer; font-weight: 700; }
.agent-preview-head button.secondary { color: #b8c9d7; border-color: #334a5c; background: #19242e; }
.agent-preview-head button:disabled { opacity: .55; cursor: wait; }
.agent-preview-note { margin: -4px 0 0; color: #aebdca; font-size: 12px; }
#agentPreviewContent { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.agent-preview-card { min-width: 0; padding: 12px; border: 1px solid #2c3c4a; border-radius: 10px; background: rgba(11,18,26,.62); }
.agent-preview-card strong { display: block; color: #d7e4ef; font-size: 12px; }
.agent-preview-card p { margin: 5px 0 0; color: #9dafbf; font-size: 12px; overflow-wrap: anywhere; }
.agent-preview-evidence { display: grid; gap: 6px; margin-top: 8px; }
.agent-preview-evidence > a { display: grid; gap: 2px; padding: 7px; border: 1px solid #2b4355; border-radius: 8px; color: var(--blue); background: rgba(18,31,42,.58); font: 10px/1.25 ui-monospace, SFMono-Regular, monospace; overflow-wrap: anywhere; text-decoration: none; }
.agent-preview-evidence small { color: #8194a6; font: 10px/1.25 ui-monospace, SFMono-Regular, monospace; }
.cards { display: grid; gap: 10px; }
.claim-card { position: relative; overflow: hidden; padding: 16px 16px 14px 18px; border: 1px solid var(--border); border-radius: 14px; background: rgba(22,27,35,.94); box-shadow: 0 8px 30px rgba(0,0,0,.13); }
.claim-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--gold); }
.claim-rank { color: var(--muted); font: 700 10px/1 ui-monospace, SFMono-Regular, monospace; letter-spacing: .12em; }
.claim-text { margin: 9px 0 12px; color: #e2e8f0; font-size: 15.5px; line-height: 1.52; }
.claim-context { margin-bottom: 7px; color: var(--gold); font-size: 12.5px; }
.claim-meeting { color: var(--muted); font-size: 12px; }
.claim-footer { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-top: 13px; }
.score-chip { padding: 4px 7px; border: 1px solid #2d3744; border-radius: 7px; color: #92a0b1; background: #121720; font: 11px/1.2 ui-monospace, SFMono-Regular, monospace; }
.source-link { min-height: 44px; margin-left: auto; padding: 11px 10px 0; color: var(--blue); text-decoration: none; font-size: 12px; font-weight: 650; }
.source-link.secondary { margin-left: 0; color: #a8b6c7; }
.source-link.unavailable { color: #5f6b7b; pointer-events: none; }
.truth-strip { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; padding-top: 12px; border-top: 1px solid #27303c; }
.truth-item { display: inline-flex; gap: 5px; align-items: center; max-width: 100%; padding: 5px 7px; border: 1px solid #2d3744; border-radius: 7px; color: #a9b5c5; background: #121720; font-size: 10px; }
.truth-item b { color: #6f7e91; font-weight: 600; }
.truth-item em { overflow-wrap: anywhere; color: #c2ccd8; font-style: normal; }
.truth-item.warning { border-color: #55432b; }
.truth-item.warning em { color: #f1c797; }
.truth-item.danger { border-color: #63383c; }
.truth-item.danger em { color: #ffc3c3; }
.skeleton { height: 148px; border-radius: 14px; background: linear-gradient(100deg,#151a21 25%,#1c232d 40%,#151a21 60%); background-size: 300% 100%; animation: shimmer 1.4s infinite; }
.state-card { padding: 28px 20px; border: 1px dashed #34404f; border-radius: 14px; color: #cbd5e1; background: rgba(18,23,32,.72); text-align: center; }
.state-card p { margin: 7px auto 0; max-width: 480px; color: var(--muted); }
.state-card button { min-height: 44px; margin-top: 16px; padding: 0 15px; border: 1px solid #3a667e; border-radius: 11px; color: #071119; background: var(--blue); cursor: pointer; font-weight: 750; }
.state-card.error { border-color: #56383a; }
@keyframes shimmer { to { background-position: -100% 0; } }
.auth-panel { max-width: 520px; margin: 14vh auto 0; padding: 26px; border: 1px solid var(--border); border-radius: 18px; background: var(--panel); }
.auth-panel p:not(.eyebrow) { color: var(--muted); }
.auth-panel label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; }
.auth-panel input { width: 100%; min-height: 48px; padding: 0 12px; border: 1px solid #303a49; border-radius: 10px; color: var(--text); background: #10141b; outline: none; }
.auth-panel button { width: 100%; margin-top: 10px; color: #081119; background: var(--blue); font-weight: 750; }
.google-sign-in { display: grid; min-height: 44px; margin-top: 22px; place-items: center; }
.google-sign-in > div { width: 100%; }
.google-sign-in:has(> *) + .google-sign-in-retry { display: none; }
.auth-status { min-height: 1.5em; margin: 14px 0 0; text-align: center; }
.bottom-nav { position: fixed; z-index: 20; right: 12px; bottom: max(10px, env(safe-area-inset-bottom)); left: 12px; display: grid; grid-template-columns: repeat(5,1fr); max-width: 560px; min-height: 66px; margin: auto; padding: 6px; border: 1px solid rgba(48,58,73,.86); border-radius: 19px; background: rgba(18,23,30,.9); box-shadow: 0 18px 60px rgba(0,0,0,.48); backdrop-filter: blur(20px); }
.bottom-nav a { display: grid; place-items: center; align-content: center; min-width: 0; min-height: 52px; border: 0; border-radius: 13px; color: #718095; background: transparent; cursor: pointer; text-decoration: none; font-size: 10px; }
.bottom-nav span { display: block; margin-bottom: 3px; font-size: 18px; }
.bottom-nav a.active { color: var(--blue); background: rgba(126,200,255,.09); }
.toast { position: fixed; z-index: 40; right: 20px; bottom: 94px; left: 20px; max-width: 480px; margin: auto; padding: 13px 15px; border: 1px solid #394554; border-radius: 12px; color: #cad4e0; background: #1a2029; box-shadow: 0 16px 48px rgba(0,0,0,.45); text-align: center; }

.workspace-view { padding: 38px 0 24px; }
.view-head { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 24px; }
.view-head h1 { max-width: none; font-size: clamp(34px, 6vw, 62px); }
.view-head > p, .view-head > div + p { max-width: 440px; margin: 0; color: var(--muted); }
.segmented { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 18px; padding: 5px; border: 1px solid var(--border); border-radius: 14px; background: rgba(18,23,32,.88); }
.segmented button { flex: 1 0 auto; min-height: 44px; padding: 0 15px; border: 0; border-radius: 10px; color: #8897aa; background: transparent; cursor: pointer; }
.segmented button.active { color: var(--blue); background: rgba(126,200,255,.1); }
.view-content, .inspect-stack, .catalog-layout { display: grid; gap: 14px; }
.source-panel, .stub-card { padding: 18px; border: 1px solid var(--border); border-radius: 15px; background: rgba(22,27,35,.92); }
.source-panel h2, .source-panel h3, .stub-card h2 { margin: 0 0 7px; letter-spacing: -.025em; }
.source-panel p, .stub-card p { margin: 5px 0; color: var(--muted); }
.source-panel > a, .context-link, .universe-source a { display: inline-flex; align-items: center; min-height: 44px; color: var(--blue); text-decoration: none; font-size: 13px; }
.meeting-list { display: grid; gap: 8px; }
.meeting-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 64px; padding: 12px 15px; border: 1px solid var(--border); border-radius: 13px; color: var(--text); background: rgba(22,27,35,.82); text-decoration: none; }
.meeting-row:hover, .meeting-row:focus-visible { border-color: #486174; }
.meeting-row strong { overflow-wrap: anywhere; font-size: 14px; }
.meeting-row span { flex: 0 0 auto; color: var(--muted); font-size: 11px; }
.section-chips, .planet-list { display: flex; flex-wrap: wrap; gap: 7px; }
.section-chips span, .planet-list span { padding: 6px 9px; border: 1px solid #303946; border-radius: 999px; color: #aab6c6; background: #121720; font-size: 11px; }
.inspect-claims { display: grid; gap: 9px; }
.inspect-claim { padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: rgba(22,27,35,.88); }
.inspect-claim.selected { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232,192,105,.08); }
.inspect-claim code { color: #77869a; font-size: 10px; overflow-wrap: anywhere; }
.inspect-claim > p { margin: 9px 0; color: #dde5ee; }
.inspect-claim > small { color: var(--gold); }
.health-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.health-grid > div { display: grid; gap: 3px; padding: 12px; border: 1px solid #29323f; border-radius: 10px; background: #121720; }
.health-grid small { color: var(--muted); }
.health-grid strong { overflow-wrap: anywhere; font-size: 13px; }
.family-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.family-card { display: grid; gap: 4px; min-width: 0; padding: 13px; border: 1px solid var(--border); border-radius: 12px; background: rgba(22,27,35,.85); }
.family-card strong { overflow-wrap: anywhere; }
.family-card span { color: var(--muted); font-size: 11px; }

.toolbar { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; margin-bottom: 14px; }
.search-control { display: grid; gap: 5px; min-width: 0; color: var(--muted); font-size: 11px; }
.search-control input, .search-control select { width: 100%; min-height: 46px; padding: 0 12px; border: 1px solid #303a49; border-radius: 11px; outline: none; color: var(--text); background: #121720; }
.search-control input:focus, .search-control select:focus { border-color: #486174; box-shadow: 0 0 0 3px rgba(126,200,255,.07); }
.universe-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .8fr); grid-template-areas: "map detail" "list detail"; gap: 14px; align-items: start; }
.universe-field { grid-area: map; overflow: hidden; min-height: 430px; border: 1px solid var(--border); border-radius: 16px; background: radial-gradient(circle at center,rgba(62,99,221,.13),transparent 54%),rgba(9,13,19,.92); }
.universe-field svg { display: block; width: 100%; min-width: 620px; height: auto; }
.universe-field text { fill: #8d9bad; font: 14px/1 sans-serif; pointer-events: none; }
.universe-field a:focus circle { stroke: #fff; stroke-width: 5px; }
.galaxy-list { grid-area: list; display: grid; gap: 16px; }
.funnel-group h2 { margin: 0 0 8px; color: #8998aa; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.system-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.system-card { display: grid; gap: 4px; min-width: 0; min-height: 86px; padding: 13px; border: 1px solid var(--border); border-radius: 12px; color: var(--text); background: rgba(22,27,35,.85); text-decoration: none; }
.system-card.selected { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(126,200,255,.07); }
.system-card strong { overflow-wrap: anywhere; }
.system-card span, .system-card small { color: var(--muted); font-size: 11px; }
.system-detail { position: sticky; top: 128px; grid-area: detail; overflow: auto; max-height: calc(100vh - 160px); padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: rgba(22,27,35,.94); }
.system-detail h2 { margin: 0; font-size: 28px; letter-spacing: -.04em; }
.system-detail h3 { margin: 20px 0 8px; font-size: 13px; }
.system-mass { color: var(--gold); }
.muted { color: var(--muted); }
.universe-sources { display: grid; gap: 8px; }
.universe-source { padding: 12px; border: 1px solid #29323f; border-radius: 11px; background: #121720; }
.universe-source p { display: -webkit-box; overflow: hidden; margin: 0 0 7px; color: #ccd6e2; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.universe-source small { color: var(--muted); }
.universe-source a { padding-top: 4px; }
.stub-view { max-width: 820px; margin: 0 auto; }
.stub-status { color: var(--gold) !important; font: 11px/1.4 ui-monospace, SFMono-Regular, monospace; overflow-wrap: anywhere; }
.placeholder-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin: 17px 0; }
.placeholder-grid > div { display: grid; gap: 4px; padding: 13px; border: 1px dashed #3b4655; border-radius: 10px; }
.placeholder-grid span { color: var(--muted); font-size: 12px; }
.stub-card button { width: 100%; min-height: 46px; border: 1px solid #303946; border-radius: 11px; color: #697587; background: #121720; }

button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
@media (min-width: 820px) {
  .topbar { padding: 0 34px; }
  .shell { padding-right: 34px; padding-left: 124px; }
  .hero { padding-top: 92px; }
  .bottom-nav { right: auto; bottom: 24px; left: 24px; display: flex; flex-direction: column; grid-template-columns: none; width: 78px; max-width: none; min-height: 350px; }
  .bottom-nav a { flex: 1; width: 100%; }
  .claim-card { padding: 19px 20px 17px 22px; }
  .claim-text { font-size: 16px; }
}
@media (max-width: 819px) {
  .freshness-banner { display: grid; gap: 1px; justify-items: center; }
  .freshness-banner span { white-space: normal; }
  .view-head { display: grid; gap: 10px; }
  .view-head > p, .view-head > div + p { font-size: 13px; }
  .universe-layout { display: grid; grid-template-columns: minmax(0,1fr); grid-template-areas: "detail" "list"; }
  .universe-field { display: none; }
  .system-detail { position: static; max-height: none; }
}
@media (max-width: 520px) {
  .topbar { height: 62px; padding: 0 14px; }
  .brand small { display: none; }
  .shell { padding-right: 14px; padding-left: 14px; }
  .hero { padding-top: 48px; }
  .suggestions { margin-right: -14px; margin-left: -14px; padding-right: 14px; padding-left: 14px; }
  .results { padding-top: 28px; }
  .results-head { align-items: start; }
  .new-query { flex: 0 0 auto; }
  .claim-footer { align-items: stretch; }
  #agentPreviewContent { grid-template-columns: minmax(0,1fr); }
  .agent-preview-head { align-items: start; }
  .source-link { flex: 1 0 calc(50% - 4px); margin-left: 0; padding: 12px 8px; border: 1px solid #2d3744; border-radius: 9px; text-align: center; }
  .meeting-row { display: grid; gap: 4px; }
  .meeting-row span { flex: auto; }
  .health-grid, .family-grid, .toolbar, .system-grid, .placeholder-grid { grid-template-columns: minmax(0,1fr); }
  .bottom-nav { right: 7px; left: 7px; min-height: 62px; padding: 4px; }
  .bottom-nav a { min-height: 52px; font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation-duration: .01ms !important; scroll-behavior: auto !important; } }
