:root{
  --bg:#04060d; --ink:#dfe9f5; --dim:#7d8aa0; --line:rgba(120,160,220,.14);
  --glass:rgba(10,16,30,.72); --glass2:rgba(14,22,40,.86);
  --cyan:#57d7ff; --teal:#3ce6b0; --amber:#ffc65c; --rose:#ff7a90;
  --violet:#b48bff; --local:#8fd3ff;
  --rail-w:236px;

  /* ---- prompt-bar liquid glass (CONTRACT.md Addendum v3.5 §7) — its own
     tint, deliberately NOT the globe's cyan/teal palette above, so the bar
     reads as one consistent control whether it's sitting over the bright
     ocean or the dark night side. Defined unconditionally on bare :root
     (not nested in a prefers-color-scheme block) — this console has a
     single fixed dark theme regardless of OS setting, so these are simply
     always-on tokens, never gated behind a media query that could leave
     them undefined. ---- */
  --prompt-fill-1:rgba(56,40,92,.58); --prompt-fill-2:rgba(20,16,36,.66);
  --prompt-border:rgba(186,158,255,.30); --prompt-highlight:rgba(255,255,255,.16);
  --prompt-shadow:0 20px 54px rgba(4,2,14,.55),0 0 0 1px rgba(0,0,0,.15);
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%;background:var(--bg);color:var(--ink);
  font:14px/1.55 "Avenir Next","PingFang SC","Segoe UI",system-ui,sans-serif;
  overflow:hidden}
#globe{position:fixed;inset:0;display:block;transition:filter .4s ease}
/* Non-globe routes dim the canvas behind their view root's content — the
   canvas itself is never touched/destroyed (CONTRACT §1), just visually
   receded. WP-E's #globeMarkers overlay (z-index:3) is unaffected by this
   filter (it's a sibling element, not a descendant of #globe). */
body[data-route="cases"] #globe,
body[data-route="workbench"] #globe,
body[data-route="data"] #globe{filter:brightness(.4) saturate(.75)}

/* ---- top bar: connectivity/state chips + lang toggle + compact menu only.
   The site title/brand moved into #leftRail (CONTRACT §2: left rail is
   site title -> tab strip -> panel body, top to bottom). ---- */
#topbar{position:fixed;top:0;left:0;right:0;z-index:5;display:flex;
  justify-content:flex-end;align-items:center;padding:14px 22px;
  pointer-events:none}
.chips{display:flex;gap:8px;pointer-events:auto;align-items:center}
.chip{padding:4px 12px;border:1px solid var(--line);border-radius:999px;
  background:var(--glass);font-size:12px;color:var(--dim);
  backdrop-filter:blur(10px);transition:all .4s}
.chip.on{color:var(--teal);border-color:rgba(60,230,176,.4)}
.chip.busy{color:var(--amber);border-color:rgba(255,198,92,.45);
  animation:breathe 1.6s ease-in-out infinite}
.chip.err{color:var(--rose);border-color:rgba(255,122,144,.5)}
.chip-btn{cursor:pointer;font:inherit;transition:all .25s}
.chip-btn:hover{color:var(--ink);border-color:rgba(87,215,255,.4);
  box-shadow:0 0 12px rgba(87,215,255,.2)}
#langToggle{min-width:30px;text-align:center;font-weight:600;letter-spacing:.02em}

/* ---- compact menu (⋯): Runs/Data-sources live behind a dropdown so the
   top bar stays down to the chips + this button ---- */
.menu-wrap{position:relative}
#menuBtn{min-width:30px;text-align:center;font-weight:700}
.menu-dropdown{position:absolute;top:calc(100% + 8px);right:0;min-width:168px;
  background:var(--glass2);border:1px solid var(--line);border-radius:12px;
  padding:6px;display:flex;flex-direction:column;gap:2px;
  box-shadow:0 10px 30px rgba(0,0,0,.4);backdrop-filter:blur(12px);
  animation:rise .22s cubic-bezier(.2,.9,.25,1.1) both;z-index:8}
.menu-dropdown.hidden{display:none}
.menu-item{background:transparent;border:0;color:var(--ink);text-align:left;
  padding:8px 10px;border-radius:8px;font:inherit;font-size:12.5px;cursor:pointer;
  transition:background .2s ease;width:100%}
.menu-item:hover{background:rgba(87,215,255,.1)}

/* ============================================================ left rail ==
   CONTRACT.md Addendum v3.5 §2/§2.1/§5. Global chrome, present on every
   route (the tab strip and title never change with run state). Sits above
   WP-E's #globeMarkers overlay (z-index:3) so markers never steal a rail
   click. Top->bottom: site title, tab strip, panel body. ---- */
#leftRail{position:fixed;left:0;top:0;bottom:0;width:var(--rail-w);z-index:6;
  display:flex;flex-direction:column;background:var(--glass);
  border-right:1px solid var(--line);backdrop-filter:blur(16px);
  box-shadow:8px 0 40px rgba(0,0,0,.3)}
#railTitle{display:flex;align-items:center;gap:10px;padding:16px 16px 14px;
  border-bottom:1px solid var(--line);flex:none}
#railTitle .orb{width:11px;height:11px;border-radius:50%;flex:none;
  background:radial-gradient(circle at 35% 35%,#bfeaff,var(--cyan) 60%,#0a3550);
  box-shadow:0 0 14px var(--cyan);animation:breathe 3.2s ease-in-out infinite}
#railTitle .title{font-size:15px;letter-spacing:.3px;color:#fff;line-height:1.3}
#railTitle .title b{color:var(--cyan);font-weight:600;display:block;font-size:13px}
#railTitle .sub{display:none} /* tagline: kept in the DOM for i18n, hidden — the
  rail is narrow and the tab strip needs the vertical room */

#railTabs{display:flex;flex-direction:column;gap:2px;padding:10px;flex:none;
  border-bottom:1px solid var(--line)}
.rail-tab{display:flex;align-items:center;gap:10px;padding:9px 10px;
  border-radius:10px;border:1px solid transparent;background:transparent;
  color:var(--dim);font:inherit;font-size:13px;cursor:pointer;text-align:left;
  transition:all .2s ease}
.rail-tab:hover{color:var(--ink);background:rgba(87,215,255,.06)}
.rail-tab.active{color:#fff;background:rgba(87,215,255,.12);
  border-color:rgba(87,215,255,.35)}
.rt-ico{width:18px;text-align:center;font-size:13px;flex:none;opacity:.85}
.rt-label{flex:1}

#railBody{flex:1;min-height:0;display:flex;flex-direction:column}
.rail-panel{flex:1;min-height:0;overflow-y:auto;padding:12px 14px;
  scrollbar-width:thin;scrollbar-color:#26344d transparent}

/* ---- stage rail: five GeoAgent stages, current one lit ---- */
/* Centered in the space right of the left rail, not the full viewport —
   #leftRail eats a fixed strip on the left so a true viewport-center would
   read as off-center relative to the visible globe/panel area. */
#stageRail{position:fixed;top:56px;left:calc(50% + var(--rail-w) / 2);
  transform:translateX(-50%);z-index:5;display:flex;gap:6px;pointer-events:none}
.stage-pill{display:flex;align-items:center;gap:6px;padding:4px 12px 4px 9px;
  border:1px solid var(--line);border-radius:999px;background:var(--glass);
  font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--dim);
  backdrop-filter:blur(10px);transition:all .4s}
.sp-dot{width:6px;height:6px;border-radius:50%;background:var(--dim);
  transition:all .4s}
.stage-pill.done{color:var(--ink);border-color:rgba(60,230,176,.3)}
.stage-pill.done .sp-dot{background:var(--teal)}
.stage-pill.active{color:#fff;border-color:rgba(87,215,255,.5);
  box-shadow:0 0 14px rgba(87,215,255,.2)}
.stage-pill.active .sp-dot{background:var(--cyan);box-shadow:0 0 8px var(--cyan);
  animation:breathe 1.3s ease-in-out infinite}

/* CJK stage labels (意图/检索/规划/执行/综合) don't need uppercase tracking
   and read a touch cramped at the English chip's padding — widen slightly
   and drop the transform/letter-spacing that's an English-typography choice. */
html[lang="zh-CN"] .stage-pill{text-transform:none;letter-spacing:.02em;
  padding:4px 13px 4px 10px}

/* ---- panels ---- */
.panel{background:var(--glass);border:1px solid var(--line);border-radius:14px;
  backdrop-filter:blur(14px);box-shadow:0 8px 40px rgba(0,0,0,.35)}
.panel-title{padding:10px 14px;font-size:12px;letter-spacing:.12em;
  text-transform:uppercase;color:var(--dim);border-bottom:1px solid var(--line)}
.panel-title .hint{float:right;text-transform:none;letter-spacing:0;opacity:.7}
.scroll{overflow-y:auto;scrollbar-width:thin;scrollbar-color:#26344d transparent}
.dim{color:var(--dim)}

/* ---- prompt bar: PERMANENTLY bottom-centre on #/ (CONTRACT.md Addendum
   v3.5 §2/§7). The v3.4 landing->dock choreography is retired — it starts
   in this position and never moves. Liquid-glass treatment: backdrop blur,
   a translucent fill with its own violet-indigo tint (NOT the globe's
   cyan/teal — see the --prompt-* tokens on :root above), a hairline top
   highlight (::before), and a soft outer shadow that separates it from
   whatever texture is behind it (bright ocean or dark night side alike).
   Router.js hides the whole #promptDock on every route except '#/'. */
#promptDock{position:fixed;left:50%;bottom:26px;z-index:6;
  width:min(560px,88vw);transform:translateX(-50%)}
.stage-body{flex:1;padding:10px 12px;display:flex;flex-direction:column;
  gap:8px;overflow-y:auto}
.promptbar{position:relative;display:flex;padding:8px;border-radius:20px;
  background:linear-gradient(165deg,var(--prompt-fill-1),var(--prompt-fill-2));
  border:1px solid var(--prompt-border);
  backdrop-filter:blur(20px) saturate(150%);
  -webkit-backdrop-filter:blur(20px) saturate(150%);
  box-shadow:var(--prompt-shadow)}
.promptbar::before{content:"";position:absolute;left:16px;right:16px;top:0;
  height:1px;pointer-events:none;
  background:linear-gradient(90deg,transparent,var(--prompt-highlight),transparent)}
.promptbar input{flex:1;background:transparent;border:0;outline:0;
  color:var(--ink);font-size:15.5px;padding:11px 14px}
.promptbar input::placeholder{color:#9a8fc4}
.promptbar button{width:42px;border:1px solid var(--prompt-border);border-radius:12px;
  background:linear-gradient(160deg,rgba(186,158,255,.22),rgba(186,158,255,.05));
  color:#e4d9ff;font-size:17px;cursor:pointer;transition:all .25s}
.promptbar button:hover{box-shadow:0 0 14px rgba(186,158,255,.35)}

/* ---- staged panels: one right-side stacked column, translucent overlays —
   the globe stays visible behind/around every panel, never fully hidden.
   Every panel is class="panel-hidden" by default (landing shows none); a
   panel's stage's first SSE event adds .shown via app.js's showStage(),
   which drives the opacity/translate entrance below. ---- */
#stagePanels{position:fixed;z-index:4;right:18px;top:96px;bottom:18px;width:430px;
  display:flex;flex-direction:column;gap:10px;pointer-events:none}
#stagePanels>*{pointer-events:auto}
.panel-hidden{display:none!important}
:root{--panel-dx:26px}
@media (prefers-reduced-motion: reduce){:root{--panel-dx:0px}}
#stagePanels .panel,#stagePanels .kg-used-strip{
  opacity:0;transform:translateX(var(--panel-dx));
  transition:opacity .38s cubic-bezier(.2,.9,.25,1.1),transform .38s cubic-bezier(.2,.9,.25,1.1)}
#stagePanels .panel.shown,#stagePanels .kg-used-strip.shown{opacity:1;transform:translateX(0)}
#reasoningLogPanel{flex:1.5;display:flex;flex-direction:column;min-height:0;
  position:relative}
#understandingPanel{flex:1;display:flex;flex-direction:column;min-height:0}
#planPanel{flex:1.1;display:flex;flex-direction:column;min-height:0}
#kgPanel{flex:1.2;display:flex;flex-direction:column;min-height:120px}
#kg{flex:1;width:100%;min-height:0;position:relative}
#tldrPanel{flex:1;display:flex;flex-direction:column;min-height:0}

/* TL;DR takes visual priority once it lands: reorders to the top of the
   stack, gains a highlighted border, and the other panels compress (shrink
   their flex share + dim) to make room — nothing disappears, per the
   addendum's "globe/panels never fully hidden" rule. */
body.tldr-prominent #tldrPanel{order:-1;flex:1.9;
  border-color:rgba(60,230,176,.4);box-shadow:0 8px 40px rgba(0,0,0,.35),0 0 26px rgba(60,230,176,.12)}
body.tldr-prominent #reasoningLogPanel,
body.tldr-prominent #understandingPanel,
body.tldr-prominent #planPanel,
body.tldr-prominent #kgPanel{flex:.55;opacity:.72}
body.tldr-prominent #kg-used-strip,
body.tldr-prominent .kg-used-strip{opacity:.85}

/* ============================================================ view roots =
   CONTRACT.md Addendum v3.5 §1/§5: one per non-globe route (#viewCases,
   #viewWorkbench, #viewData), display:none unless active — router.js
   toggles that and nothing else. Positioned in the main content area
   between the left rail and the right column, above the dimmed globe
   (see body[data-route] on #globe above) and above WP-E's #globeMarkers
   overlay (z-index:3) but below the persistent chrome (#leftRail/
   #stagePanels/#topbar, z-index >=4). Empty containers — each is owned and
   styled by its own work package (WP-F: cases/data, WP-G: workbench); this
   is only the mount point + base layout so their content has somewhere
   sane to sit from the first paint. */
.view-root{position:fixed;left:var(--rail-w);right:0;top:0;bottom:0;
  z-index:2;overflow-y:auto;padding:96px 48px 48px}

/* ---- GeoTKG toolbar: search + catalog/run toggle + expand ---- */
.kg-toolbar{display:flex;align-items:center;gap:6px;padding:6px 10px;
  border-bottom:1px solid var(--line);flex:none}
.kg-search{flex:1;min-width:0;background:rgba(255,255,255,.03);
  border:1px solid var(--line);border-radius:8px;padding:5px 9px;
  color:var(--ink);font-size:11.5px;outline:0;transition:border-color .25s}
.kg-search:focus{border-color:rgba(87,215,255,.45)}
.kg-search::placeholder{color:#4d5b73}
.kg-chip{flex:none;padding:4px 9px;border:1px solid var(--line);border-radius:999px;
  background:var(--glass);font-size:10.5px;color:var(--dim);cursor:pointer;
  transition:all .25s;font-family:inherit}
.kg-chip:hover{color:var(--ink);border-color:rgba(87,215,255,.4)}
.kg-chip.active{color:var(--cyan);border-color:rgba(87,215,255,.5);
  box-shadow:0 0 10px rgba(87,215,255,.2)}
.kg-expand{width:26px;padding:4px 0;text-align:center;font-size:12px}

/* ---- GeoTKG near-fullscreen overlay (⤢) — same drawer-overlay backdrop as
   the report/sources/runs drawers, but a centered near-fullscreen card
   instead of a right-anchored strip. ---- */
#kgOverlay{position:fixed;inset:0;z-index:12;display:flex;
  align-items:center;justify-content:center;background:rgba(3,5,12,.6);
  backdrop-filter:blur(4px)}
#kgOverlay.hidden{display:none}
#kgOverlayCard{width:min(1400px,94vw);height:92vh;background:var(--glass2);
  border:1px solid var(--line);border-radius:16px;overflow:hidden;
  display:flex;flex-direction:column;box-shadow:0 24px 80px rgba(0,0,0,.55);
  animation:rise .35s cubic-bezier(.2,.9,.25,1.1) both}
#kgOverlayHead{padding:12px 16px;border-bottom:1px solid var(--line);
  display:flex;align-items:center;gap:14px;font-size:13px;letter-spacing:.08em;
  text-transform:uppercase;color:var(--dim)}
#kgOverlayHead .report-actions{flex:1;display:flex;align-items:center}
#kgOverlayHead .kg-toolbar{border-bottom:0;padding:0;flex:1}
#kgOverlayClose{background:transparent;border:0;color:var(--dim);
  font-size:16px;cursor:pointer}
#kgOverlayBody{flex:1;min-height:0;position:relative}
#kgOverlayBody #kg{height:100%}

/* force-graph's own hover tooltip (rel labels on link hover, etc.) — themed
   to match the console rather than the library's default light/white box.
   Extra selector specificity (not !important) beats the lib's injected
   stylesheet regardless of injection order. */
body .float-tooltip-kap{background:rgba(10,16,30,.92);color:var(--ink);
  border:1px solid var(--line);border-radius:6px;padding:3px 8px;
  font:11.5px "Avenir Next",sans-serif;box-shadow:0 4px 16px rgba(0,0,0,.4)}
#planPanel{flex:1;display:flex;flex-direction:column;min-height:0}
#tldrPanel{flex:1;display:flex;flex-direction:column;min-height:0}
#tldrPanel .panel-title{flex:none}
#tldrBody{flex:1;padding:14px;font-size:13.5px;overflow-y:auto}

/* ---- stream entries (execution log) ---- */
.entry{border-left:2px solid var(--line);padding:6px 10px;border-radius:4px;
  animation:slidein .35s ease both}
.entry .tag{font-size:10.5px;letter-spacing:.1em;text-transform:uppercase;
  color:var(--dim)}
.entry .tag.dim{opacity:.65}
.entry .row-body{margin-top:3px;font-size:12.8px}
.entry .row-body.dim{color:var(--dim)}
.entry.call{border-color:var(--cyan)}
.entry.call .tag{color:var(--cyan)}
.entry.result.ok{border-color:var(--teal)}
.entry.result.err{border-color:var(--rose);color:var(--rose)}
.spin{display:inline-block;width:10px;height:10px;border-radius:50%;
  border:2px solid var(--teal);border-top-color:transparent;
  animation:spin .8s linear infinite;vertical-align:-1px;margin-right:6px}
.tick{color:var(--teal);margin-right:6px}
.exec-log{display:flex;flex-direction:column;gap:8px;margin-top:12px;
  opacity:0;transform:translateY(var(--panel-dx,10px));
  transition:opacity .35s ease,transform .35s ease}
.exec-log.shown{opacity:1;transform:none}

/* ---- reasoning pane: "watch the GeoAgent think" ---- */
.r-entry{border-left:2px solid var(--line);padding:6px 10px;border-radius:4px;
  animation:slidein .35s ease both;font-size:13px}
.r-stage{display:inline-block;font-size:10px;letter-spacing:.1em;
  text-transform:uppercase;color:var(--dim);margin-right:8px}
.r-text{color:var(--ink);white-space:pre-wrap}
.r-entry.r-intent{border-color:var(--cyan)}
.r-entry.r-intent .r-stage{color:var(--cyan)}
.r-entry.r-retrieval{border-color:var(--violet)}
.r-entry.r-retrieval .r-stage{color:var(--violet)}
.r-entry.r-plan{border-color:var(--amber)}
.r-entry.r-plan .r-stage{color:var(--amber)}
.r-entry.r-execute{border-color:var(--teal)}
.r-entry.r-execute .r-stage{color:var(--teal)}
.r-entry.r-synthesis{border-color:var(--rose)}
.r-entry.r-synthesis .r-stage{color:var(--rose)}
.r-entry.r-you{border-color:#fff;background:rgba(255,255,255,.04)}
.r-entry.r-you .r-stage{display:none}
.r-entry.r-confirm{border-color:var(--teal);background:rgba(60,230,176,.06)}
.r-entry.r-confirm .r-stage{display:none}
.r-entry.r-error{border-color:var(--rose);color:var(--rose)}
.r-entry.r-error .r-stage{display:none}
.reasoning-caret{position:absolute;left:14px;bottom:8px;pointer-events:none}
.reasoning-caret span{display:inline-block;width:7px;height:13px;
  background:var(--cyan);opacity:.55;animation:caret 1.1s step-end infinite}

/* ---- understanding: intent chips + discovery rows ---- */
.intent-line{font-size:13.5px;margin-bottom:8px}
.intent-chips{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:10px}
.i-chip{padding:4px 10px;border:1px solid var(--line);border-radius:999px;
  font-size:11.5px;color:var(--ink);background:rgba(87,215,255,.05)}
.i-chip b{color:var(--cyan);font-weight:600;text-transform:uppercase;
  font-size:10px;letter-spacing:.06em;margin-right:5px}
.discovery-body{display:flex;flex-direction:column}
.owner-row{border:1px solid var(--line);border-radius:10px;padding:9px 12px;
  margin:5px 0;animation:slidein .4s ease both;font-size:13px}
.owner-row.skipped{opacity:.55}
.ord{display:inline-block;width:14px;color:var(--teal);font-weight:700}
.owner-row.skipped .ord{color:var(--dim)}
.oname{font-weight:600;margin-right:8px}
.oreason{color:var(--dim);font-size:12px;margin-top:3px}
.okv{margin-top:4px;color:var(--dim);font-size:11.5px;font-family:ui-monospace,Menlo,monospace}
.okv b{color:var(--ink);font-weight:500}
.origin-badge{float:right;font-size:9.5px;text-transform:uppercase;
  letter-spacing:.06em;padding:2px 7px;border-radius:999px;border:1px solid var(--line);
  color:var(--dim)}
.origin-badge.gee{color:var(--teal);border-color:rgba(60,230,176,.4)}
.origin-badge.oge{color:var(--amber);border-color:rgba(255,198,92,.4)}
.origin-badge.fed{color:var(--violet);border-color:rgba(180,139,255,.4)}
.origin-badge.local{color:var(--local);border-color:rgba(143,211,255,.4)}

/* ---- plan & execution: mini-DAG shared by the side panel + approval card --- */
.plan-purpose{font-size:12.5px;color:var(--dim);margin-bottom:10px}
.plan-purpose b{color:var(--ink);font-weight:500}
.plan-dag-wrap{overflow-x:auto;padding-bottom:4px}
.plan-dag{position:relative}
.plan-dag-arrows{position:absolute;top:0;left:0;pointer-events:none}
.plan-dag-cols{display:flex;gap:20px;position:relative;z-index:1}
.plan-col{display:flex;flex-direction:column;gap:10px}
.plan-step{width:154px;flex:none;border:1px solid var(--line);border-radius:10px;
  padding:8px 10px;font-size:11.5px;background:rgba(10,16,30,.55);
  transition:border-color .3s,box-shadow .3s}
.ps-head{display:flex;align-items:center;gap:6px}
.ps-status{color:var(--dim);font-size:11px}
.ps-id{font-family:ui-monospace,Menlo,monospace;color:var(--ink);font-weight:600}
.ps-owner{color:var(--dim);margin-top:3px}
.ps-skill{color:var(--cyan);margin-top:2px}
.ps-assets{color:var(--dim);margin-top:2px;font-family:ui-monospace,Menlo,monospace;
  font-size:10.5px}
.ps-rationale{color:var(--dim);margin-top:4px;font-size:10.5px;font-style:italic}
.ps-running{border-color:var(--amber);box-shadow:0 0 12px rgba(255,198,92,.25)}
.ps-running .ps-status{color:var(--amber);animation:breathe 1s ease-in-out infinite}
.ps-done{border-color:var(--teal)}
.ps-done .ps-status{color:var(--teal)}
.ps-failed{border-color:var(--rose)}
.ps-failed .ps-status{color:var(--rose)}

/* ---- TL;DR ---- */
.tldr-answer{font-size:15.5px;line-height:1.6;padding:12px 14px;
  border:1px solid rgba(60,230,176,.3);border-radius:12px;
  background:rgba(60,230,176,.06);animation:rise .5s cubic-bezier(.2,.9,.25,1.2) both}
.tldr-chip{display:inline-block;margin-top:10px;padding:3px 10px;
  border-radius:999px;border:1px solid var(--line);font-size:11px;
  color:var(--dim);text-transform:uppercase;letter-spacing:.08em}
.reportBtn{display:block;margin-top:14px;padding:9px 16px;border-radius:10px;
  border:1px solid rgba(87,215,255,.4);background:rgba(87,215,255,.08);
  color:var(--cyan);cursor:pointer;font-size:13px;transition:all .25s}
.reportBtn:hover{box-shadow:0 0 16px rgba(87,215,255,.35)}

/* ---- feedback: thumbs + optional note, shown on the TL;DR panel after run_done ---- */
.feedback-row{display:flex;align-items:center;gap:8px;margin-top:16px;
  padding-top:12px;border-top:1px solid var(--line)}
.fb-btn{width:32px;height:32px;border-radius:10px;border:1px solid var(--line);
  background:rgba(255,255,255,.03);font-size:15px;cursor:pointer;
  transition:all .25s;line-height:1}
.fb-btn:hover:not(:disabled){border-color:rgba(87,215,255,.4);
  box-shadow:0 0 10px rgba(87,215,255,.2)}
.fb-btn:disabled{cursor:default;opacity:.55}
.fb-note{flex:1;min-width:0;background:transparent;border:1px solid var(--line);
  border-radius:8px;padding:7px 9px;color:var(--ink);font-size:12.5px;outline:0}
.fb-note::placeholder{color:#4d5b73}
.fb-note:disabled{opacity:.55}
.fb-status{font-size:11px;white-space:nowrap}
.feedback-row.recorded{opacity:.85}
.feedback-row.recorded .fb-status{color:var(--teal)}

/* ---- report drawer ---- */
#reportWrap{position:fixed;inset:0;z-index:10;display:flex;justify-content:flex-end;
  background:rgba(3,5,12,.5);backdrop-filter:blur(3px)}
#reportWrap.hidden{display:none}
#reportDrawer{width:min(720px,92vw);height:100%;background:var(--glass2);
  border-left:1px solid var(--line);display:flex;flex-direction:column;
  animation:slidein-right .35s ease both}
.report-head{padding:14px 18px;border-bottom:1px solid var(--line);
  display:flex;justify-content:space-between;align-items:center;
  font-size:13px;letter-spacing:.08em;text-transform:uppercase;color:var(--dim)}
.report-actions{display:flex;gap:14px;align-items:center}
.report-actions a{color:var(--cyan);text-decoration:none;font-size:12px}
.report-actions button{background:transparent;border:0;color:var(--dim);
  font-size:16px;cursor:pointer}
#reportBody{flex:1;padding:20px 26px;font-size:14px;line-height:1.7}
.md-h{margin:18px 0 8px;color:#fff;font-weight:600}
.md-h:first-child{margin-top:0}
#reportBody p{margin:8px 0}
.md-list{margin:8px 0 8px 22px}
.md-code{background:rgba(255,255,255,.04);border:1px solid var(--line);
  border-radius:8px;padding:10px 12px;overflow-x:auto;margin:10px 0}
#reportBody code{font-family:ui-monospace,Menlo,monospace;font-size:12.5px;
  color:var(--teal)}
#reportBody strong{color:#fff}

/* ---- data sources drawer (reuses report drawer's slide-in pattern) ---- */
#sourcesWrap{position:fixed;inset:0;z-index:10;display:flex;justify-content:flex-end;
  background:rgba(3,5,12,.5);backdrop-filter:blur(3px)}
#sourcesWrap.hidden{display:none}
#sourcesDrawer{width:min(560px,92vw);height:100%;background:var(--glass2);
  border-left:1px solid var(--line);display:flex;flex-direction:column;
  animation:slidein-right .35s ease both}
#sourcesBody{flex:1;padding:14px 18px;font-size:13px;line-height:1.5}
.src-group-head{font-size:11px;letter-spacing:.1em;text-transform:uppercase;
  margin:16px 0 8px;opacity:.85}
.src-group-head:first-child{margin-top:0}
.src-group-head.gee{color:var(--teal)}
.src-group-head.oge{color:var(--amber)}
.src-group-head.fed{color:var(--violet)}
.src-group-head.other{color:var(--dim)}
.src-row{border:1px solid var(--line);border-radius:10px;padding:9px 12px;
  margin:6px 0;position:relative;transition:border-color .3s,background .3s}
.src-row.touched{border-color:rgba(60,230,176,.5);background:rgba(60,230,176,.05)}
.src-top{display:flex;align-items:center;gap:7px}
.src-dot{width:7px;height:7px;border-radius:50%;background:transparent;
  flex:none}
.src-row.touched .src-dot{background:var(--teal);box-shadow:0 0 8px var(--teal);
  animation:breathe 1.6s ease-in-out infinite}
.src-id{font-family:ui-monospace,Menlo,monospace;font-size:12.5px;color:var(--ink)}
.src-tag{margin-left:auto;font-size:9.5px;text-transform:uppercase;
  letter-spacing:.06em;padding:2px 7px;border-radius:999px;border:1px solid var(--line);
  color:var(--dim)}
.src-tag.sov{color:var(--rose);border-color:rgba(255,122,144,.4)}
.src-ref{margin-top:3px;font-family:ui-monospace,Menlo,monospace;font-size:11.5px;
  color:var(--cyan)}
.src-node{margin-top:2px;font-size:11.5px;color:var(--dim)}
.src-desc{margin-top:4px;font-size:12px;color:var(--dim);
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.okv-src{margin-top:2px;color:var(--dim);font-size:11px;opacity:.8}
.src-group-head.local{color:var(--local)}

/* ---- runs drawer (reuses report drawer's slide-in pattern) ---- */
#runsWrap{position:fixed;inset:0;z-index:10;display:flex;justify-content:flex-end;
  background:rgba(3,5,12,.5);backdrop-filter:blur(3px)}
#runsWrap.hidden{display:none}
#runsDrawer{width:min(520px,92vw);height:100%;background:var(--glass2);
  border-left:1px solid var(--line);display:flex;flex-direction:column;
  animation:slidein-right .35s ease both}
#runsBody{flex:1;padding:14px 18px;font-size:13px;line-height:1.5}
.run-row{border:1px solid var(--line);border-radius:10px;padding:9px 12px;
  margin:6px 0;transition:border-color .3s,background .3s}
.run-row.clickable{cursor:pointer}
.run-row.clickable:hover{border-color:rgba(87,215,255,.4);background:rgba(87,215,255,.05)}
.run-top{display:flex;align-items:center;gap:8px}
.run-time{font-family:ui-monospace,Menlo,monospace;font-size:11.5px;color:var(--dim)}
.run-outcome{margin-left:auto;font-size:9.5px;text-transform:uppercase;
  letter-spacing:.06em;padding:2px 7px;border-radius:999px;border:1px solid var(--line);
  color:var(--dim)}
.run-outcome.succeeded{color:var(--teal);border-color:rgba(60,230,176,.4)}
.run-outcome.failed{color:var(--rose);border-color:rgba(255,122,144,.4)}
.run-outcome.denied{color:var(--amber);border-color:rgba(255,198,92,.4)}
.run-fb{font-size:13px}
.run-prompt{margin-top:4px;color:var(--ink);font-size:12.5px;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}

/* ---- TL;DR sources-touched summary ---- */
.src-touched-line{margin-top:10px;font-size:11.5px;color:var(--dim);cursor:pointer;
  text-decoration:underline dotted rgba(125,138,160,.5);width:fit-content}
.src-touched-line:hover{color:var(--ink)}

/* ---- knowledge-used chip strip: one chip per card consumed by the run so
   far (kg.markUsed() companion — CONTRACT.md Addendum v3.4). Origin-hued,
   persists after run_done as the run's evidence surface; click centers/
   zooms that card in the GeoTKG graph. ---- */
.kg-used-strip{flex:none;display:flex;flex-direction:column;gap:6px;padding:2px 4px}
.kg-used-label{font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:var(--dim)}
.kg-used-chips{display:flex;flex-wrap:wrap;gap:6px}
.used-chip{padding:4px 10px;border-radius:999px;border:1px solid var(--line);
  background:rgba(255,255,255,.04);font:11px ui-monospace,Menlo,monospace;
  color:var(--ink);cursor:pointer;transition:box-shadow .25s,border-color .25s;
  animation:rise .35s cubic-bezier(.2,.9,.25,1.1) both}
.used-chip:hover{box-shadow:0 0 10px rgba(87,215,255,.3)}
.used-chip.gee{border-color:rgba(60,230,176,.5);color:var(--teal)}
.used-chip.oge{border-color:rgba(255,198,92,.5);color:var(--amber)}
.used-chip.fed{border-color:rgba(180,139,255,.5);color:var(--violet)}
.used-chip.local{border-color:rgba(143,211,255,.5);color:var(--local)}

/* ---- error toast: fallback surface for `error` events that land before any
   panel is visible (reasoning pane is the primary surface — see app.js) ---- */
.toast{position:fixed;left:50%;bottom:108px;z-index:20;max-width:80vw;
  padding:10px 18px;border-radius:10px;background:rgba(255,50,70,.16);
  border:1px solid rgba(255,122,144,.5);color:#ffd7dc;font-size:13px;
  opacity:0;transform:translate(-50%,10px);pointer-events:none;
  transition:opacity .3s ease,transform .3s ease}
.toast.show{opacity:1;transform:translate(-50%,0)}

@keyframes breathe{0%,100%{opacity:1}50%{opacity:.45}}
@keyframes spin{to{transform:rotate(360deg)}}
@keyframes caret{0%,49%{opacity:.55}50%,100%{opacity:0}}
@keyframes slidein{from{opacity:0;transform:translateY(8px)}to{opacity:1}}
@keyframes slidein-right{from{opacity:0;transform:translateX(24px)}to{opacity:1}}
@keyframes rise{from{opacity:0;transform:translateY(26px) scale(.97)}to{opacity:1}}
@keyframes fadein{from{opacity:0}to{opacity:1}}

/* ---- motion-abundant choreography, but never at the cost of accessibility:
   collapse every translate/scale entrance to a plain fade, and shorten the
   docking/panel transitions, when the OS asks for reduced motion. ---- */
@media (prefers-reduced-motion: reduce){
  .entry,.r-entry,.owner-row,.used-chip,.tldr-answer,.plan-step,#kgOverlayCard{
    animation:fadein .25s ease both!important}
  #promptDock,#stagePanels .panel,#stagePanels .kg-used-strip,.toast{
    transition-duration:.18s!important}
}

@media (max-width:1100px){#stagePanels{width:64vw}}

/* CC BY 4.0 attribution for the Solar System Scope earth textures — the
   license requires credit; keep it visible but quiet (zashboard pattern). */
.tex-credit {
  position: fixed; right: 12px; bottom: 6px; z-index: 40;
  font-size: 10px; letter-spacing: .02em; opacity: .38;
  color: #cfe0ee; pointer-events: none; user-select: none;
}
