:root {
  color-scheme: light;
  --blue: #3157f6;
  --blue-dark: #1f35d2;
  --ink: #111827;
  --muted: #667085;
  --line: #dfe7f2;
  --soft: #f4f7fb;
  --panel: #ffffff;
  --green: #18b766;
  --red: #cb2d3d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 80% -5%, rgba(49, 87, 246, 0.14), transparent 30rem),
    linear-gradient(180deg, #fbfcff 0%, #f1f5fb 100%);
}
a { color: inherit; text-decoration: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  min-height: 72px;
  padding: 0 34px;
  border-bottom: 1px solid rgba(217, 225, 238, 0.9);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 900;
  font-size: 20px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 4px;
  transform: skewX(-7deg);
}
.brand-mark span {
  border-radius: 4px;
  background: #111827;
}
.brand-mark span:first-child,
.brand-mark span:nth-child(4) { border-radius: 9px 4px 4px 9px; }
.brand-mark span:nth-child(3) { border-radius: 4px 9px 4px 4px; }
.brand-mark span:nth-child(6) { border-radius: 4px 4px 9px 4px; }
.brand-mark span:nth-child(4) { opacity: .72; }
.brand-mark span:nth-child(5) { opacity: .86; }

nav {
  justify-self: center;
  display: flex;
  gap: 8px;
  padding: 4px;
  border: 1px solid #d8e1ee;
  border-radius: 9px;
  background: #fff;
}
nav a {
  min-width: 118px;
  padding: 9px 14px;
  border-radius: 7px;
  color: #536174;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}
nav a.is-active {
  color: #fff;
  background: var(--blue);
  box-shadow: 0 10px 22px rgba(49, 87, 246, .22);
}

.dashboard-link {
  justify-self: end;
  height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px;
  border: 1px solid #d8e1ee;
  border-radius: 7px;
  color: #263348;
  background: #fff;
  font-weight: 800;
  font-size: 14px;
}

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 42px 32px 72px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(440px, 1.1fr);
  align-items: end;
  gap: 42px;
  padding: 28px 0 36px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
h1, h2, h3, p { letter-spacing: 0; }
h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(42px, 6vw, 76px);
  line-height: .98;
}
h2 { margin: 0; font-size: 26px; line-height: 1.12; }
h3 { margin: 0; font-size: 17px; }
.hero p {
  max-width: 640px;
  color: #516073;
  font-size: 18px;
  line-height: 1.58;
}

.search-card, .panel, .notice {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}
.search-card {
  padding: 22px;
}
.search-card label {
  display: block;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 900;
  color: #344054;
}
.search-card div,
.mini-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}
input {
  width: 100%;
  height: 44px;
  border: 1px solid #d4deeb;
  border-radius: 8px;
  padding: 0 13px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}
button {
  height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  color: #fff;
  background: var(--blue);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}
button:hover { background: var(--blue-dark); }
small { color: #718096; font-weight: 700; }
.search-card small { display: block; margin-top: 12px; }

.notice {
  margin: 18px 0;
  padding: 18px 20px;
  background: #fffaf1;
  border-color: #f5d99b;
}
.notice.error {
  background: #fff5f6;
  border-color: #f5b8c0;
}
.notice p { margin: 6px 0 0; color: #5d6978; }
code {
  padding: 2px 5px;
  border-radius: 5px;
  background: #eef2f7;
  font-size: .92em;
}

.panel {
  overflow: hidden;
}
.panel-head {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 24px;
  border-bottom: 1px solid #edf1f7;
}
.panel-head a {
  color: var(--blue);
  font-weight: 900;
}

.result-list,
.document-list,
.entity-list,
.relationship-list {
  display: grid;
}
.result-card,
.document-card,
.entity-card,
.relationship-card {
  border-bottom: 1px solid #edf1f7;
  background: #fff;
}
.result-card {
  padding: 22px 24px;
}
.result-card:last-child,
.document-card:last-child,
.entity-card:last-child,
.relationship-card:last-child { border-bottom: 0; }
.result-card p {
  max-width: 980px;
  color: #344054;
  line-height: 1.65;
}
.result-card h3 a,
.document-card h3 a {
  color: #15233b;
  text-decoration: underline;
  text-decoration-color: rgba(49, 87, 246, .28);
  text-underline-offset: 4px;
}
.result-card h3 a:hover,
.document-card h3 a:hover { color: var(--blue); }
.result-meta,
.copy-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  color: #667085;
  font-size: 13px;
  font-weight: 750;
}
.copy-row { margin-top: 14px; }
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 9px;
  border: 1px solid #bdd1ff;
  border-radius: 999px;
  color: #2448d8;
  background: #eef4ff;
  font-size: 12px;
  font-weight: 900;
}

.document-card {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 24px;
}
.document-card p {
  margin: 5px 0 0;
  color: #667085;
  font-weight: 700;
}
.document-card > div:last-child {
  text-align: right;
  min-width: 160px;
}
.document-card small {
  display: block;
  margin-top: 8px;
}

.document-detail .panel-head {
  align-items: flex-start;
}
.document-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 18px 24px 0;
  color: #667085;
  font-size: 13px;
  font-weight: 800;
}
.source-uri {
  margin: 14px 24px 0;
  color: #667085;
  font-size: 14px;
  font-weight: 750;
  overflow-wrap: anywhere;
}
.document-body {
  padding: 20px 24px 28px;
}
.document-body h1,
.document-body h2,
.document-body h3,
.document-body h4,
.document-body h5,
.document-body h6 {
  margin: 1.2em 0 .45em;
  color: #111827;
  line-height: 1.16;
}
.document-body h1:first-child,
.document-body h2:first-child,
.document-body h3:first-child { margin-top: 0; }
.document-body h1 { font-size: 34px; }
.document-body h2 { font-size: 26px; }
.document-body h3 { font-size: 20px; }
.document-body p {
  max-width: 840px;
  margin: 0 0 1em;
  color: #243044;
  line-height: 1.72;
}
.document-body ul,
.document-body ol {
  max-width: 840px;
  margin: 0 0 1.1em 1.25em;
  padding: 0;
  color: #243044;
  line-height: 1.68;
}
.document-body li { margin: .35em 0; }
.document-body a {
  color: var(--blue);
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.document-body code {
  color: #15233b;
  background: #eef2f7;
}
.code-block {
  max-width: 940px;
  margin: 0 0 1.35em;
  overflow: hidden;
  border: 1px solid #162238;
  border-radius: 12px;
  background: #0b1220;
  box-shadow: 0 14px 30px rgba(15, 23, 42, .16);
}
.code-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(148, 163, 184, .16);
  background: linear-gradient(180deg, #121c31 0%, #0f172a 100%);
}
.code-bar span {
  color: #9fb0c8;
  font: 750 12px/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.code-bar::before {
  content: "";
  width: 34px;
  height: 10px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 5px 5px, #ff5f57 0 4px, transparent 4.5px),
    radial-gradient(circle at 17px 5px, #febc2e 0 4px, transparent 4.5px),
    radial-gradient(circle at 29px 5px, #28c840 0 4px, transparent 4.5px);
}
.document-body pre {
  margin: 0;
  max-width: 940px;
  overflow-x: auto;
  border: 0;
  border-radius: 0;
  padding: 18px 20px;
  background: #0b1220;
  color: #e5edf8;
  line-height: 1.68;
  box-shadow: none;
}
.document-body pre code {
  padding: 0;
  color: inherit;
  background: transparent;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13.5px;
  tab-size: 2;
}
.document-body pre {
  white-space: pre;
  overflow-wrap: normal;
}

.graph-grid {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  gap: 18px;
}
.entity-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 12px;
  align-items: center;
  padding: 16px 20px;
}
.entity-card small { grid-column: 2; }
.relationship-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 16px 20px;
}
.relationship-card strong {
  color: #2448d8;
  text-align: center;
}
.relationship-card small {
  grid-column: 1 / -1;
}

.empty {
  padding: 34px 24px;
  color: #667085;
  font-weight: 750;
}

footer {
  display: flex;
  justify-content: space-between;
  max-width: 1240px;
  margin: 0 auto;
  padding: 26px 32px 46px;
  color: #667085;
  font-weight: 750;
}
footer a {
  color: var(--blue);
  font-weight: 900;
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }
  nav {
    justify-self: stretch;
    overflow-x: auto;
  }
  nav a { min-width: 104px; }
  .dashboard-link { justify-self: stretch; justify-content: center; }
  main { padding: 26px 16px 52px; }
  .hero,
  .graph-grid {
    grid-template-columns: 1fr;
  }
  .hero { gap: 22px; }
  .search-card div,
  .mini-search {
    grid-template-columns: 1fr;
  }
  .panel-head,
  .document-card {
    align-items: stretch;
    flex-direction: column;
  }
  .document-card > div:last-child { text-align: left; }
}
