/* MCP for Humans — a single dark theme, tuned for long reading sessions. */

:root {
  --bg: #0d1117;
  --bg-raised: #131a23;
  --bg-sunken: #0a0e14;
  --bg-input: #0c1219;
  --border: #232d3b;
  --border-strong: #33404f;

  --text: #e4e9f0;
  --text-dim: #98a4b5;
  --text-faint: #6a7686;

  --accent: #4c9ffe;
  --accent-dim: #1f4a7a;
  --ok: #3fb950;
  --bad: #f85149;
  --warn: #d29922;
  --violet: #a978f0;

  --radius: 8px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Inter, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-color: var(--border-strong) transparent;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

code,
pre,
.mono {
  font-family: var(--mono);
  font-size: 0.86em;
}

a {
  color: var(--accent);
}

/* ------------------------------------------------------------------ *
 * Top bar
 * ------------------------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 24px;
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 650;
  font-size: 16px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  color: var(--accent);
  font-size: 19px;
}

.connect {
  display: flex;
  gap: 8px;
  flex: 1;
  max-width: 780px;
  margin-left: auto;
}

.connect-input {
  flex: 1;
  min-width: 0;
}

.connect input,
.connect select {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
}

.connect select {
  width: auto;
  font-family: var(--sans);
}

.connect input:focus,
.connect select:focus,
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(76, 159, 254, 0.14);
}

/* ------------------------------------------------------------------ *
 * Buttons
 * ------------------------------------------------------------------ */

.btn {
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--bg-raised);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}

.btn:hover:not(:disabled) {
  background: #1a2330;
  border-color: var(--accent-dim);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #07121f;
  font-weight: 650;
}

.btn-primary:hover:not(:disabled) {
  background: #6bb0ff;
  border-color: #6bb0ff;
}

.btn-ghost {
  background: transparent;
}

.btn-sm {
  padding: 5px 11px;
  font-size: 12px;
}

/* ------------------------------------------------------------------ *
 * Layout
 * ------------------------------------------------------------------ */

#main {
  flex: 1;
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  padding: 32px 24px 96px;
}

/* ------------------------------------------------------------------ *
 * Landing
 * ------------------------------------------------------------------ */

.hero {
  padding: 40px 0 8px;
  max-width: 720px;
}

.hero h1 {
  margin: 0 0 16px;
  font-size: 40px;
  line-height: 1.15;
  letter-spacing: -0.022em;
  font-weight: 700;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.lede {
  margin: 0 0 14px;
  font-size: 17px;
  color: var(--text-dim);
}

.lede-sub {
  margin: 0;
  font-size: 14px;
  color: var(--text-faint);
}

.landing h2 {
  margin: 48px 0 16px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.example-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.example {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 15px 16px;
  text-align: left;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--sans);
  cursor: pointer;
  transition: border-color 0.14s, transform 0.14s;
}

.example:hover {
  border-color: var(--accent-dim);
  transform: translateY(-1px);
}

.example-name {
  font-weight: 650;
  font-size: 15px;
}

.example-blurb {
  font-size: 13px;
  color: var(--text-dim);
}

.example-url {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-faint);
  word-break: break-all;
}

.disclaimer,
.note {
  margin: 14px 0 0;
  font-size: 12.5px;
  color: var(--text-faint);
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 20px;
}

.steps li {
  display: flex;
  gap: 14px;
}

.step-n {
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-dim);
  color: #cfe4ff;
  font-size: 12px;
  font-weight: 700;
}

.steps h3 {
  margin: 2px 0 4px;
  font-size: 15px;
}

.steps p {
  margin: 0;
  font-size: 14px;
  color: var(--text-dim);
}

/* ------------------------------------------------------------------ *
 * Status
 * ------------------------------------------------------------------ */

.status {
  margin: 40px 0;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-raised);
}

.status-error {
  border-color: #5c2b28;
  background: #1c1214;
}

.status-message {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
}

.status-hint {
  margin: 10px 0 0;
  color: var(--text-dim);
  font-size: 14px;
}

.status-detail {
  margin: 12px 0;
  padding: 12px;
  background: var(--bg-sunken);
  border-radius: var(--radius);
  color: var(--text-dim);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}

.spinner {
  flex: none;
  width: 13px;
  height: 13px;
  border: 2px solid var(--accent-dim);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ------------------------------------------------------------------ *
 * Server card
 * ------------------------------------------------------------------ */

.server-card {
  display: block;
  padding: 18px 20px;
  margin-bottom: 24px;
  background: linear-gradient(180deg, #16202c, var(--bg-raised));
  border: 1px solid var(--border);
  border-radius: 10px;
}

.server-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.server-head h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.01em;
}

.server-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.server-url {
  color: var(--text-dim);
  word-break: break-all;
}

.instructions {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.instructions summary,
.schema-details summary,
.drawer-body summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 550;
  color: var(--text-dim);
}

.instructions summary:hover,
.schema-details summary:hover {
  color: var(--text);
}

/* ------------------------------------------------------------------ *
 * Chips
 * ------------------------------------------------------------------ */

.chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-sunken);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-dim);
  white-space: nowrap;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 6px 0;
}

.chip-type {
  color: #7fd4c1;
  border-color: #244a41;
  background: #10201c;
}

.chip-required {
  color: #ff9d94;
  border-color: #5c2b28;
  background: #1f1413;
}

.chip-optional {
  color: var(--text-faint);
}

.chip-cap,
.chip-version {
  color: #b39aef;
  border-color: #3b2d5c;
  background: #171429;
}

.chip-hint {
  color: var(--warn);
  border-color: #4a3a12;
  background: #1d1808;
}

.chip-readonly {
  color: var(--ok);
  border-color: #1d4326;
  background: #0d1c12;
}

.chip-destructive {
  color: var(--bad);
  border-color: #5c2b28;
  background: #1f1413;
}

/* ------------------------------------------------------------------ *
 * Tabs & filter
 * ------------------------------------------------------------------ */

.controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 9px;
}

.tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
}

.tab:hover:not(:disabled) {
  color: var(--text);
}

.tab-active {
  background: var(--bg-raised);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.tab:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.tab-count {
  padding: 0 6px;
  border-radius: 999px;
  background: var(--bg-input);
  font-family: var(--mono);
  font-size: 11px;
}

.filter {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
}

.group-heading {
  margin: 26px 0 10px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.group-heading:first-child {
  margin-top: 0;
}

.show-more {
  align-self: center;
  margin-top: 8px;
}

/* ------------------------------------------------------------------ *
 * Cards
 * ------------------------------------------------------------------ */

.catalog {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.14s;
}

.card:hover {
  border-color: var(--border-strong);
}

.card-open {
  border-color: var(--accent-dim);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 13px 16px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.card-head:hover {
  background: #17202c;
}

.card-kind {
  flex: none;
  padding: 2px 8px;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.card-kind-tool {
  background: #103049;
  color: #7cc4ff;
}

.card-kind-resource {
  background: #10302a;
  color: #6fd8bd;
}

.card-kind-template {
  background: #2c2440;
  color: #b79cf5;
}

.card-kind-prompt {
  background: #3a2c14;
  color: #e5bc6a;
}

.card-name {
  flex: none;
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 600;
}

.card-title {
  flex: none;
  color: var(--text-dim);
  font-size: 13px;
}

.card-summary {
  flex: 1;
  min-width: 0;
  color: var(--text-faint);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-badges {
  display: flex;
  gap: 4px;
  flex: none;
}

.card-chevron {
  flex: none;
  color: var(--text-faint);
  font-size: 18px;
  transition: transform 0.16s;
}

.card-open .card-chevron {
  transform: rotate(90deg);
}

.card-body {
  padding: 4px 16px 18px;
  border-top: 1px solid var(--border);
}

.section-heading {
  margin: 20px 0 10px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ------------------------------------------------------------------ *
 * Prose
 * ------------------------------------------------------------------ */

.prose {
  color: var(--text-dim);
  font-size: 14px;
}

.prose p {
  margin: 10px 0;
}

.prose h4 {
  margin: 16px 0 6px;
  font-size: 14px;
  color: var(--text);
}

.prose ul {
  margin: 8px 0;
  padding-left: 20px;
}

.prose li {
  margin: 3px 0;
}

.prose code,
.field-desc code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-sunken);
  color: #9fd0ff;
}

/* ------------------------------------------------------------------ *
 * Fields
 * ------------------------------------------------------------------ */

.fields {
  display: flex;
  flex-direction: column;
}

.field {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.field:first-child {
  border-top: none;
}

.field-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  align-content: start;
}

.field-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

.field-title {
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 550;
}

.field-desc {
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-dim);
}

.field-desc p {
  margin: 4px 0;
}

.input {
  width: 100%;
  padding: 8px 11px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13.5px;
  resize: vertical;
}

textarea.input,
.input.mono {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
}

.input[readonly] {
  color: var(--text-faint);
  cursor: not-allowed;
}

.field-error {
  margin-top: 6px;
  color: var(--bad);
  font-size: 12.5px;
}

.checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}

.check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
}

.nested {
  padding-left: 14px;
  border-left: 2px solid var(--border);
}

.nested .field {
  grid-template-columns: 160px 1fr;
}

.variant-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.variant-label {
  font-size: 12px;
  color: var(--text-faint);
}

.variant-select {
  width: auto;
  padding: 4px 9px;
  font-size: 12px;
}

.empty-note {
  margin: 10px 0;
  color: var(--text-faint);
  font-size: 13.5px;
  font-style: italic;
}

.kv {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 6px 14px;
  margin: 14px 0;
  font-size: 13px;
}

.kv dt {
  color: var(--text-faint);
}

.kv dd {
  margin: 0;
  word-break: break-all;
}

.uri-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 14px 0;
  padding: 10px 12px;
  background: var(--bg-sunken);
  border-radius: var(--radius);
}

.uri-label {
  flex: none;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.uri-preview {
  color: #7fd4c1;
  word-break: break-all;
}

/* ------------------------------------------------------------------ *
 * Actions & results
 * ------------------------------------------------------------------ */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 4px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.schema-details {
  margin-top: 12px;
}

pre.code {
  margin: 8px 0 0;
  padding: 12px 14px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-dim);
  line-height: 1.5;
}

.j-key {
  color: #7cc4ff;
}
.j-str {
  color: #9ae6b4;
}
.j-num {
  color: #f0b27a;
}
.j-bool {
  color: var(--violet);
}
.j-null {
  color: var(--text-faint);
}

.running {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 16px;
  color: var(--text-dim);
  font-size: 13.5px;
}

.result {
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-left: 3px solid var(--ok);
  border-radius: var(--radius);
}

.result-error {
  border-left-color: var(--bad);
}

.result-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.result-status {
  font-size: 13px;
  font-weight: 650;
}

.result-status.ok {
  color: var(--ok);
}

.result-status.bad {
  color: var(--bad);
}

.result-time,
.log-ms {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-faint);
}

.result-head .btn {
  margin-left: auto;
}

.result-desc {
  margin: 0 0 12px;
  color: var(--text-dim);
  font-size: 13.5px;
}

.blocks {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.block-text {
  padding: 10px 13px;
  background: var(--bg-raised);
  border-radius: var(--radius);
  color: var(--text);
}

/* ------------------------------------------------------------------ *
 * Format viewer
 * ------------------------------------------------------------------ */

.viewer {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.view-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 6px 12px;
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--border);
}

.view-format {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  cursor: pointer;
}

.view-tabs {
  display: flex;
  gap: 2px;
  margin-left: auto;
}

.view-tab {
  padding: 3px 11px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text-faint);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
}

.view-tab:hover {
  color: var(--text);
}

.view-tab-active {
  background: var(--bg-raised);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.view-slot {
  padding: 10px 13px;
}

.view-slot > .prose,
.view-slot > pre.code,
.view-slot > div > .clamp > .prose,
.view-slot > div > .clamp > pre.code {
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
}

.raw-text {
  color: var(--text-dim);
  white-space: pre-wrap;
}

/* The preview renders untrusted HTML, so it gets a white canvas of its own
   rather than inheriting anything from the page. */
.html-frame {
  width: 100%;
  height: 380px;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  resize: vertical;
  overflow: auto;
}

.frame-note {
  margin: 6px 0 0;
  font-size: 11.5px;
  color: var(--text-faint);
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.data-table th,
.data-table td {
  padding: 5px 10px;
  text-align: left;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.data-table th {
  position: sticky;
  top: 0;
  background: var(--bg-sunken);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-dim);
}

.data-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.clamp {
  position: relative;
  max-height: 340px;
  overflow: hidden;
}

.clamp-open {
  max-height: none;
}

/* Fades the cut-off edge so it reads as "there is more" rather than "it ended". */
.clamp-fade {
  position: absolute;
  inset: auto 0 0 0;
  height: 70px;
  background: linear-gradient(transparent, var(--bg-sunken));
  pointer-events: none;
}

.clamp-open .clamp-fade {
  display: none;
}

.clamp-toggle {
  margin-top: 8px;
}

.block-media img,
.block-resource img {
  max-width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.block-media {
  margin: 0;
}

.block-media figcaption {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--text-faint);
}

.block-link,
.block-resource-head {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.block-link {
  padding: 10px 12px;
  background: var(--bg-raised);
  border-radius: var(--radius);
}

.block-link-name {
  font-size: 13px;
  color: var(--text-dim);
}

.block-resource {
  padding: 10px 12px;
  background: var(--bg-raised);
  border-radius: var(--radius);
}

.problem-list {
  margin: 0;
  padding-left: 20px;
  color: #ff9d94;
  font-size: 13.5px;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  display: flex;
  gap: 12px;
}

.role {
  flex: none;
  width: 74px;
  padding: 2px 8px;
  height: fit-content;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 650;
  text-align: center;
  text-transform: uppercase;
}

.role-user {
  background: #103049;
  color: #7cc4ff;
}

.role-assistant {
  background: #2c2440;
  color: #b79cf5;
}

.message-body {
  flex: 1;
  min-width: 0;
}

/* ------------------------------------------------------------------ *
 * Network log drawer
 * ------------------------------------------------------------------ */

.drawer {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  width: min(560px, calc(100vw - 40px));
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.drawer-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 14px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
}

.drawer-toggle:hover {
  color: var(--text);
}

.drawer-count {
  margin-left: auto;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--bg-sunken);
  font-family: var(--mono);
  font-size: 11px;
}

.drawer-body {
  max-height: 48vh;
  overflow-y: auto;
  padding: 4px 14px 14px;
  border-top: 1px solid var(--border);
}

.log {
  display: flex;
  align-items: baseline;
  gap: 9px;
  flex-wrap: wrap;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}

.log-dir {
  font-family: var(--mono);
  color: var(--text-faint);
}

.log-out .log-dir {
  color: var(--accent);
}

.log-in .log-dir {
  color: var(--ok);
}

.log-time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
}

.log-method {
  font-family: var(--mono);
  color: var(--text);
}

.log details {
  flex-basis: 100%;
}

/* ------------------------------------------------------------------ *
 * Footer
 * ------------------------------------------------------------------ */

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 18px 24px 26px;
  color: var(--text-faint);
  font-size: 12.5px;
}

.dot {
  opacity: 0.5;
}

/* ------------------------------------------------------------------ *
 * Narrow screens
 * ------------------------------------------------------------------ */

@media (max-width: 860px) {
  .topbar {
    flex-wrap: wrap;
    gap: 10px;
  }

  .connect {
    max-width: none;
    flex-basis: 100%;
    flex-wrap: wrap;
  }

  /* Give the URL its own row — otherwise the select and buttons squeeze it
     down to a few pixels. */
  .connect-input {
    flex-basis: 100%;
  }

  .hero h1 {
    font-size: 30px;
  }

  .field,
  .nested .field {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .card-summary,
  .card-title {
    display: none;
  }

  .drawer {
    right: 10px;
    left: 10px;
    bottom: 10px;
    width: auto;
  }
}

/* ------------------------------------------------------------------ *
 * Output schema docs & conformance
 * ------------------------------------------------------------------ */

.output-docs {
  margin-bottom: 6px;
}

.doc-note {
  margin: 6px 0;
  font-size: 13px;
  color: var(--text-faint);
}

.doc-fields {
  margin-top: 10px;
}

.doc-field {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  padding: 11px 0;
  border-top: 1px solid var(--border);
}

.doc-field:first-child {
  border-top: none;
}

.conformance {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 13px;
}

.conformance.ok {
  border-color: #1d4326;
  background: #0d1c12;
}

.conformance.bad {
  border-color: #5c2b28;
  background: #1f1413;
}

.conformance-label {
  font-weight: 650;
}

.conformance.ok .conformance-label {
  color: var(--ok);
}

.conformance.bad .conformance-label {
  color: var(--bad);
}

.conformance-detail {
  color: var(--text-dim);
}

.conformance .problem-list {
  flex-basis: 100%;
  margin: 4px 0 0;
  font-size: 12.5px;
}

@media (max-width: 860px) {
  .doc-field {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

/* ------------------------------------------------------------------ *
 * Result-level render mode
 * ------------------------------------------------------------------ */

.mode-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border);
}

.mode-label {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.mode-bar .view-tabs {
  margin-left: 0;
}

/* ------------------------------------------------------------------ *
 * Markdown block elements
 * ------------------------------------------------------------------ */

.md-table {
  width: 100%;
  margin: 10px 0;
  border-collapse: collapse;
  font-size: 13px;
}

.md-table th,
.md-table td {
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
  border: 1px solid var(--border);
}

.md-table th {
  background: var(--bg-sunken);
  font-weight: 650;
  color: var(--text);
}

.md-table td {
  color: var(--text-dim);
}

.prose blockquote {
  margin: 10px 0;
  padding: 8px 14px;
  border-left: 3px solid var(--accent-dim);
  background: rgba(76, 159, 254, 0.06);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.prose blockquote p:first-child {
  margin-top: 0;
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

/* ------------------------------------------------------------------ *
 * Endpoint discovery
 * ------------------------------------------------------------------ */

.discovery-note {
  margin: 10px 0 0;
  font-size: 12.5px;
  color: var(--text-faint);
}

.discovery-note code {
  color: var(--text-dim);
  word-break: break-all;
}

.attempts {
  margin: 14px 0;
}

.attempts .section-heading {
  margin: 0 0 8px;
}

.attempt {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  padding: 6px 10px;
  border-radius: var(--radius);
  background: var(--bg-sunken);
  border-left: 2px solid var(--border-strong);
  margin-bottom: 4px;
  font-size: 12.5px;
}

.attempt-ok {
  border-left-color: var(--ok);
}

.attempt-url {
  color: var(--text-dim);
  word-break: break-all;
}

.attempt-reason {
  color: var(--text-faint);
  font-size: 11.5px;
}

.attempt-outcome {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-faint);
}

/* ------------------------------------------------------------------ *
 * Tooltips
 * ------------------------------------------------------------------ */

/* A plain pointer, matching every other interactive element. The `help`
   cursor draws a platform-specific question-mark glyph that reads as an
   artifact rather than an affordance. */
.has-tip {
  cursor: pointer;
}

.has-tip:hover,
.has-tip:focus-visible {
  border-color: var(--accent-dim);
  color: var(--text);
}

.has-tip:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(76, 159, 254, 0.16);
}

.tooltip {
  position: fixed;
  z-index: 100;
  max-width: 340px;
  padding: 9px 12px;
  background: #1b2532;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
  color: var(--text);
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.5;
  pointer-events: none;
  animation: tip-in 0.12s ease-out;
}

@keyframes tip-in {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
}

.tooltip-below {
  animation-name: tip-in-below;
}

@keyframes tip-in-below {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
}
