@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap");

:root {
  --bg: #0b0f14;
  --panel: #121725;
  --accent: #5cc8ff;
  --text: #e9eef5;
  --muted: #8f9bb0;
  --code: #0f1420;
  --border: #2a3245;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "Calibri", sans-serif;
  background: radial-gradient(80% 80% at 20% 20%, #182232, #0b0f14);
  color: var(--text);
}

header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: #0f1420;
}

h1 { margin: 0 0 6px 0; font-size: 24px; }
h2 { margin: 24px 0 8px 0; font-size: 18px; }
h3 { margin: 16px 0 6px 0; font-size: 15px; }
h4 { margin: 12px 0 6px 0; font-size: 14px; }

.wrap {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 12px;
  padding: 16px;
  max-width: 1600px;
  margin: 0 auto;
}

.hub-page aside {
  overflow: auto;
  scrollbar-width: none;
}

.hub-page aside::-webkit-scrollbar {
  width: 0;
  height: 0;
}

nav {
  position: sticky;
  top: 86px;
  align-self: start;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

nav a {
  display: block;
  color: var(--text);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
  background: #0f1420;
  border: 1px solid transparent;
  margin-bottom: 6px;
}

nav a:hover {
  border-color: var(--border);
  background: #121a2a;
}

.menu-group { margin-bottom: 8px; }

.menu-header {
  width: 100%;
  text-align: left;
  background: #0f1420;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
}

.menu-header::after { content: "?"; float: right; opacity: 0.7; }
.menu-group.collapsed .menu { display: none; }
.menu-group.collapsed .menu-header::after { content: "?"; }

main {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
}

/* Make diagram text visible on dark backgrounds */
svg text,
svg .title,
svg .label,
svg .sub {
  fill: #e9eef5 !important;
  font-weight: 600;
  letter-spacing: 0.2px;
}

svg rect {
  stroke: #2a3245;
  fill: #121725;
}

svg {
  background: #0f1420 !important;
  border: 1px solid #2a3245 !important;
  border-radius: 12px !important;
}

svg .node {
  fill: #121725 !important;
  stroke: #2a3245 !important;
}

svg .link {
  stroke: #5cc8ff !important;
  stroke-width: 2 !important;
}

code, pre {
  font-family: Consolas, "Courier New", monospace;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

pre { background: var(--code); padding: 10px; border-radius: 10px; overflow: auto; }

.muted { color: var(--muted); }

.callout { border-left: 3px solid var(--accent); padding: 10px 12px; background: #0f1420; border-radius: 10px; }

ul, ol { margin: 8px 0 8px 18px; }

@media (max-width: 980px) {
  .wrap { grid-template-columns: 1fr; }
  nav { position: static; }
}

/* Landing page (multicolor, bold, image-forward) */
.landing-page {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", "Calibri", sans-serif;
  background:
    radial-gradient(80% 80% at 15% 10%, #0c111a 0%, #070a12 55%, #05070c 100%),
    linear-gradient(120deg, rgba(0, 166, 255, 0.10), rgba(99, 102, 241, 0.08));
  color: #f1f5ff;
}

.landing-page .wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 64px;
  display: block;
}

.landing-page .hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 28px;
  align-items: center;
  padding: 28px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(0, 166, 255, 0.14), rgba(99, 102, 241, 0.12));
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  position: relative;
  overflow: hidden;
}

.landing-page .hero::after {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(50% 50% at 70% 20%, rgba(0, 180, 255, 0.16), transparent 60%),
    radial-gradient(40% 40% at 10% 80%, rgba(99, 102, 241, 0.14), transparent 60%);
  pointer-events: none;
}

.landing-page .pill {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #00a6ff, #6366f1);
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.landing-page h1 {
  font-size: 40px;
  line-height: 1.1;
  margin: 16px 0;
}

.landing-page .sub {
  color: #c8d2ee;
  font-size: 16px;
  max-width: 640px;
}

.landing-page .cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.landing-page .btn {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid #ffffff;
  color: #000000;
  text-decoration: none;
  background: #ffffff;
  font-weight: 700;
}

.landing-page .btn.primary {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
}

.landing-page .hero-panel {
  position: relative;
  background: rgba(7, 10, 18, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 18px;
  z-index: 1;
}

.landing-page .mesh {
  position: relative;
  height: 180px;
  border-radius: 16px;
  background:
    radial-gradient(60% 60% at 30% 30%, rgba(0, 166, 255, 0.16), transparent 60%),
    radial-gradient(50% 50% at 70% 70%, rgba(99, 102, 241, 0.14), transparent 60%),
    linear-gradient(135deg, rgba(0, 166, 255, 0.06), rgba(99, 102, 241, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin: 0 auto 14px;
}

.landing-page .mesh-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 1;
}

.landing-page .mesh::before,
.landing-page .mesh::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.14) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.10) 1px, transparent 1px),
    linear-gradient(60deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(-60deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 28px 28px, 28px 28px;
  opacity: 0.35;
}

.landing-page .mesh::after {
  transform: translateY(10px);
  opacity: 0.2;
}

.landing-page .node {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
  animation: drift 6s ease-in-out infinite, pulse 3.5s ease-in-out infinite;
}


.landing-page .node.n1 { top: 20%; left: 18%; animation-delay: 0s; }
.landing-page .node.n2 { top: 35%; left: 62%; animation-delay: 0.8s; }
.landing-page .node.n3 { top: 65%; left: 40%; animation-delay: 1.2s; }
.landing-page .node.n4 { top: 55%; left: 75%; animation-delay: 1.6s; }
.landing-page .node.n5 { top: 25%; left: 80%; animation-delay: 2s; }
.landing-page .node.n6 { top: 70%; left: 20%; animation-delay: 2.4s; }
.landing-page .node.n7 { top: 45%; left: 30%; animation-delay: 2.8s; }
.landing-page .node.n8 { top: 15%; left: 50%; animation-delay: 3.2s; }

.landing-page .grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.landing-page .mini,
.landing-page .card,
.landing-page .step {
  background: rgba(12, 17, 26, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px;
}

.landing-page .section {
  margin-top: 36px;
}

.landing-page .cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.landing-page .strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: center;
}

.landing-page .image img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.landing-page .steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.landing-page .step span {
  display: inline-block;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 166, 255, 0.22);
}

.landing-page .footer {
  margin-top: 40px;
  text-align: center;
  color: #a8b3d6;
  opacity: 0.85;
}

@keyframes drift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(10px, -8px); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.35); opacity: 1; }
}


@media (max-width: 980px) {
  .landing-page .hero,
  .landing-page .strip {
    grid-template-columns: 1fr;
  }
  .landing-page .cards { grid-template-columns: repeat(2, 1fr); }
  .landing-page .steps { grid-template-columns: repeat(2, 1fr); }
  .landing-page .image img { height: 220px; }
}

@media (max-width: 640px) {
  .landing-page .cards,
  .landing-page .steps {
    grid-template-columns: 1fr;
  }
}


/* Agent Chat (exact restore) */
body.agent-chat {
  color-scheme: dark;
  --bg: #0a0f1e;
  --panel: #0f1426;
  --panel2: #121a33;
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.62);
  --border: rgba(255,255,255,0.08);
  --accent: #7c8cff;
  --good: #9edc8b;
  --bad: #f19999;
  --shadow: 0 30px 80px rgba(0,0,0,0.6);
  --radius: 18px;
  --radius2: 12px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: "Space Grotesk", "Segoe UI", Tahoma, sans-serif;
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(1000px 700px at 20% 10%, rgba(76,94,168,0.25), transparent 60%),
    radial-gradient(800px 600px at 80% 30%, rgba(55,63,120,0.22), transparent 55%),
    radial-gradient(600px 500px at 50% 90%, rgba(30,38,78,0.4), transparent 60%),
    var(--bg);
  display: grid;
  place-items: stretch;
  padding: 0;
}

body.agent-chat .app {
  width: 100%;
  height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
}

@media (max-width: 900px) {
  body.agent-chat .app { grid-template-columns: 1fr; height: auto; }
}

body.agent-chat .card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

body.agent-chat .sidebar {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
  max-height: calc(100vh - 05px);
  background: linear-gradient(180deg, #0e1427 0%, #0b1020 100%);
}
body.agent-chat .spacer { flex: 1; }

body.agent-chat .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

body.agent-chat .logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background-image: url("https://www.titanvx.com/qt=q_95.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

body.agent-chat .brand h1 {
  font-size: 14px;
  margin: 0;
  letter-spacing: 0.2px;
  font-weight: 600;
}
body.agent-chat .brand p {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--muted);
}

body.agent-chat .row { display: grid; gap: 6px; }
body.agent-chat label { font-size: 12px; color: var(--muted); }
body.agent-chat input,
body.agent-chat textarea,
body.agent-chat select {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.65);
  color: var(--text);
  outline: none;
}
body.agent-chat input:focus,
body.agent-chat textarea:focus,
body.agent-chat select:focus {
  border-color: rgba(255,255,255,0.65);
  box-shadow: 0 0 0 4px rgba(255,255,255,0.12);
}

body.agent-chat .stack {
  display: grid;
  gap: 10px;
}

body.agent-chat .btn {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 500;
  cursor: pointer;
  transition: transform .06s ease, filter .15s ease, opacity .15s ease;
  text-align: left;
}
body.agent-chat .btn:hover { filter: brightness(1.08); }
body.agent-chat .btn:active { transform: translateY(1px); }
body.agent-chat .btn.secondary {
  background: rgba(255,255,255,0.04);
  border-color: var(--border);
  color: var(--text);
}

body.agent-chat .status {
  font-family: var(--mono);
  font-size: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.35);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  overflow: hidden;
}

body.agent-chat .pill {
  font-family: var(--mono);
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  white-space: nowrap;
}
body.agent-chat .sidebar .btn {
  text-align: left;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
}
body.agent-chat .sidebar .btn:hover {
  background: rgba(255,255,255,0.06);
}
body.agent-chat .healthRow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  font-size: 11px;
  color: var(--muted);
}
body.agent-chat .healthDot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #9aa3b2;
  box-shadow: 0 0 0 3px rgba(154,163,178,0.15);
}
body.agent-chat .healthDot.ok {
  background: #7ee787;
  box-shadow: 0 0 0 3px rgba(126,231,135,0.2);
}
body.agent-chat .healthDot.bad {
  background: #f85149;
  box-shadow: 0 0 0 3px rgba(248,81,73,0.2);
}
body.agent-chat .composerRow .btn {
  background: var(--accent);
  color: #0b0f1e;
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 600;
  text-align: center;
}

body.agent-chat .main {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 520px;
  background: #0b1020;
}

body.agent-chat .mainHeader {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(8,12,24,0.8);
}

body.agent-chat .mainHeader .title {
  display: grid;
  gap: 2px;
}
body.agent-chat .mainHeader .title b { font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; }
body.agent-chat .mainHeader .title span { font-size: 12px; color: var(--muted); }
body.agent-chat .headerRight {
  display: flex;
  align-items: center;
  gap: 10px;
}

body.agent-chat .chat {
  padding: 22px 24px 8px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

body.agent-chat .msg {
  display: grid;
  gap: 6px;
  align-self: center;
  width: min(980px, 100%);
}
body.agent-chat .msg .meta {
  font-size: 10px;
  color: var(--muted);
  display: grid;
  gap: 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
body.agent-chat .metaRow {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
body.agent-chat .processing {
  font-size: 10px;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}
body.agent-chat .steps {
  display: grid;
  gap: 4px;
  margin-top: 4px;
}
body.agent-chat .stepLine {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
  opacity: 0.8;
}
body.agent-chat .stepLine.active {
  animation: fadePulse 1.4s ease-in-out infinite;
}
body.agent-chat .refs {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: rgba(230, 235, 255, 0.7);
}
body.agent-chat .refItem {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 12, 24, 0.6);
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
  text-decoration: none;
  color: inherit;
}
body.agent-chat .refItem:hover {
  border-color: rgba(114, 156, 255, 0.5);
  color: rgba(255, 255, 255, 0.95);
  transform: translateY(-1px);
}
body.agent-chat .chunkLine.highlight {
  outline: 2px solid rgba(114, 156, 255, 0.45);
  box-shadow: 0 0 0 2px rgba(8, 12, 24, 0.6) inset;
}
body.agent-chat .webPrompt {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
body.agent-chat .debugBanner {
  margin-top: 6px;
  font-size: 11px;
  color: rgba(255, 196, 120, 0.9);
  font-family: var(--mono);
}
body.agent-chat .debugPanel {
  margin-top: 6px;
  font-size: 11px;
  color: rgba(255, 196, 120, 0.85);
  font-family: var(--mono);
  text-transform: none;
  letter-spacing: 0;
  white-space: pre-wrap;
}
body.agent-chat .debugToggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
  user-select: none;
}
body.agent-chat .meta .role {
  font-weight: 600;
  color: var(--text);
}
body.agent-chat .bubble {
  border: none;
  background: transparent;
  border-radius: 0;
  padding: 0;
  line-height: 1.6;
  font-size: 14px;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-width: 100%;
}

body.agent-chat .msg.user { justify-items: start; }
body.agent-chat .msg.assistant { justify-items: start; }

body.agent-chat .composer {
  padding: 16px 18px 18px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: grid;
  gap: 10px;
  background: rgba(8,12,24,0.85);
}
body.agent-chat .composerRow {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  width: min(980px, 100%);
  margin: 0 auto;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}
body.agent-chat .inputWrap {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(6,10,22,0.7);
  border-radius: 14px;
  padding: 8px 12px;
}
body.agent-chat .inputWrap textarea {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0;
  height: auto;
}
body.agent-chat .attachBtn {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-radius: 12px;
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  flex: 0 0 auto;
}
body.agent-chat .attachRow { display: none; }
body.agent-chat textarea {
  resize: none;
  min-height: 44px;
  max-height: 160px;
  line-height: 1.35;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  padding: 10px 12px;
  border-radius: 12px;
}

body.agent-chat .tiny {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
body.agent-chat .indicator {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(0,0,0,0.35);
  white-space: nowrap;
}

body.agent-chat .kbd {
  font-family: var(--mono);
  font-size: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 4px 8px;
  color: var(--muted);
  white-space: nowrap;
}

body.agent-chat .danger { color: var(--bad); }
body.agent-chat .ok { color: var(--good); }
body.agent-chat .mono { font-family: var(--mono); }
body.agent-chat .hidden { display:none; }
body.agent-chat .pendingUpload {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: none;
  background: transparent;
}
body.agent-chat .pendingUpload .btn {
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 11px;
  text-align: center;
}
body.agent-chat .attachRow .mono {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.agent-chat .pendingChips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: min(860px, 100%);
  margin: 0 auto;
  min-height: 24px;
}
body.agent-chat .chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  font-size: 11px;
  color: var(--text);
  max-width: 260px;
}
body.agent-chat .chip span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.agent-chat .chip button {
  border: none;
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border-radius: 999px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}
body.agent-chat .chatList {
  display: grid;
  gap: 8px;
  max-height: 40vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  background: rgba(0,0,0,0.25);
}
body.agent-chat .chatItem {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  cursor: pointer;
}
body.agent-chat .chatItem.active {
  border-color: rgba(124,140,255,0.4);
  background: rgba(124,140,255,0.08);
}
body.agent-chat .chatItemTitle {
  font-size: 12px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.agent-chat .chatItemBtn {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-radius: 8px;
  padding: 4px 6px;
  font-size: 10px;
  cursor: pointer;
}
body.agent-chat .banner {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.05);
  color: var(--muted);
  font-size: 12px;
}
body.agent-chat .banner.warn {
  color: #ffffff;
  border-color: rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.08);
}
body.agent-chat .docsList {
  display: grid;
  gap: 8px;
  max-height: 55vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  background: rgba(0,0,0,0.35);
}
body.agent-chat .docItem {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  cursor: pointer;
  display: grid;
  gap: 4px;
  background: rgba(0,0,0,0.35);
}
body.agent-chat .docItem b { font-size: 12px; }
body.agent-chat .docItem span { font-size: 11px; color: var(--muted); }
body.agent-chat .chunkViewer {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(0,0,0,0.55);
  min-height: 220px;
  max-height: 55vh;
  overflow: auto;
  white-space: pre-wrap;
  font-family: var(--mono);
  font-size: 12px;
}
body.agent-chat .chunkActions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
body.agent-chat .chunkLine {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  background: rgba(0,0,0,0.35);
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}
body.agent-chat .chunkEdit {
  width: 100%;
  min-height: 90px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.55);
  color: var(--text);
  padding: 8px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.4;
}
body.agent-chat .modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}
body.agent-chat .modal.open { display: flex; }
body.agent-chat .modalCard {
  width: min(980px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #000000;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
}
body.agent-chat .knowledgeGrid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  min-height: 380px;
}
@media (max-width: 900px) {
  body.agent-chat .knowledgeGrid { grid-template-columns: 1fr; }
}
body.agent-chat .knowledgeSide {
  border-right: 1px solid var(--border);
  padding-right: 14px;
  display: grid;
  gap: 12px;
  align-content: start;
}
body.agent-chat .knowledgeMain {
  display: grid;
  gap: 12px;
  align-content: start;
}
body.agent-chat .actionList {
  display: grid;
  gap: 8px;
}
body.agent-chat .modalHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Docs */
.panel {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 16px;
  background: rgba(10,14,28,0.6);
  margin-bottom: 16px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(230,235,255,0.85);
  text-decoration: none;
  background: rgba(255,255,255,0.05);
}

/* Modern docs / hubs */
body:not(.agent-chat) {
  background:
    radial-gradient(900px 600px at 10% 10%, rgba(76,94,168,0.25), transparent 60%),
    radial-gradient(800px 600px at 80% 30%, rgba(55,63,120,0.22), transparent 55%),
    radial-gradient(600px 500px at 50% 90%, rgba(30,38,78,0.4), transparent 60%),
    #0a0f1e;
  color: rgba(255,255,255,0.92);
}
body:not(.agent-chat) header {
  padding: 18px 24px;
  margin: 16px 24px 0;
  background: rgba(8,12,24,0.7);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
}
body:not(.agent-chat) header h1 {
  margin: 0 0 6px;
  font-size: 22px;
  letter-spacing: 0.2px;
}
body:not(.agent-chat) .muted {
  color: rgba(255,255,255,0.65);
}
body:not(.agent-chat) .wrap.grid {
  margin: 18px 24px 40px;
  gap: 18px;
}
body.hub-page {
  height: 100vh;
  overflow: hidden;
  overflow-x: hidden;
}
html, body.hub-page {
  height: 100%;
}
body.hub-page .wrap.grid {
  margin: 12px;
  width: calc(100% - 24px);
  max-width: none;
  height: calc(100vh - 120px);
  align-items: stretch;
  overflow: hidden;
}
body.hub-page .wrap.grid > * {
  min-width: 0;
}
body.hub-page .panel {
  min-width: 0;
}
body.hub-page iframe {
  display: block;
}
body.hub-page aside {
  max-height: 100%;
  overflow: auto;
  overflow-x: hidden;
  padding-right: 6px;
}
body.hub-page header {
  margin: 16px 12px 0;
}
body:not(.agent-chat) nav {
  background: rgba(8,12,24,0.7);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 14px;
  height: fit-content;
  position: sticky;
  top: 16px;
}
body:not(.agent-chat) .panel {
  background: rgba(9,13,26,0.7);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.35);
}
body:not(.agent-chat) .panel h2 {
  margin-top: 0;
  font-size: 16px;
}
body:not(.agent-chat) .panel p,
body:not(.agent-chat) .panel li {
  font-size: 13px;
  line-height: 1.5;
}
body:not(.agent-chat) .menuStack {
  display: grid;
  gap: 16px;
}
body:not(.agent-chat) .menuStack .pill {
  justify-content: center;
  text-align: center;
  width: 100%;
}
body:not(.agent-chat) .panel .menuStack .pill {
  padding: 12px 16px;
  border-radius: 12px;
}
body:not(.agent-chat) .panel .menuStack {
  gap: 12px;
}
body:not(.agent-chat) .list .item {
  padding: 12px 14px;
  align-items: flex-start;
}
body:not(.agent-chat) .list .item .row {
  gap: 8px;
}
body:not(.agent-chat) .list .item div {
  word-break: break-word;
}
body:not(.agent-chat) .list .item .small {
  white-space: normal;
}
body:not(.agent-chat) .keyCard {
  display: grid;
  gap: 6px;
}
body:not(.agent-chat) .keyRow {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 8px;
}
body:not(.agent-chat) .keyLabel {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.55);
}
body:not(.agent-chat) .keyValue {
  font-size: 12px;
  color: rgba(255,255,255,0.9);
  word-break: break-word;
}
body:not(.agent-chat) .pill:hover {
  border-color: rgba(124,140,255,0.5);
  color: rgba(255,255,255,0.95);
}
body:not(.agent-chat) input,
body:not(.agent-chat) textarea,
body:not(.agent-chat) select,
body:not(.agent-chat) button {
  background: rgba(6,10,22,0.7);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.92);
  border-radius: 10px;
  padding: 8px 10px;
}
body:not(.agent-chat) button.pill {
  padding: 6px 10px;
}
body:not(.agent-chat) .list .item {
  background: rgba(10,14,28,0.6);
  border: 1px solid rgba(255,255,255,0.08);
}
body:not(.agent-chat) iframe {
  background: #0b1020;
}

/* Shared lists */
.list {
  display: grid;
  gap: 10px;
}
.item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(8,12,24,0.6);
}
.tag {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(90,130,255,0.2);
  color: rgba(230,235,255,0.9);
}
.row {
  display: flex;
  gap: 8px;
  align-items: center;
}
