/* Shared styles for /api-docs.html and /mcp-docs.html */
:root {
  --bg: #f7f8fa;
  --card: #ffffff;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-soft: #94a3b8;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: #eef2ff;
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(15,23,42,0.04);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ── Brandbar ─────────────────────────────────────────── */
.brandbar {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 20px 28px 18px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.brand-text { display: flex; flex-direction: column; }
.brand {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.9px;
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1;
  color: var(--text);
  text-decoration: none;
}
.brand em { font-style: normal; color: var(--accent); }
.brand-logo { width: 32px; height: 32px; color: var(--accent); flex-shrink: 0; }
.brand-tag { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }

.nav { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nav a {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: white;
  transition: all .12s;
  white-space: nowrap;
}
.nav a:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.nav a.active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

/* ── Container & hero ─────────────────────────────────── */
.container { max-width: 1240px; margin: 32px auto; padding: 0 28px 80px; }

.hero {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 32px 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}
.hero h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.6px; margin-bottom: 8px; }
.hero p { color: var(--text-muted); font-size: 15px; max-width: 720px; }
.hero .endpoint {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  background: #f1f3f7;
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  word-break: break-all;
}
.hero .endpoint .verb {
  background: #059669;
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.hero .endpoint .verb.mcp { background: #7c3aed; }

/* ── Layout grid ──────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: 480px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 1000px) { .grid { grid-template-columns: 1fr; } }

.col-stack > * + * { margin-top: 20px; }

/* ── Cards ────────────────────────────────────────────── */
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 20px; }
.card h2 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.card h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.card p { color: var(--text-muted); margin-bottom: 12px; font-size: 13.5px; }
.card p:last-child { margin-bottom: 0; }
.card ul, .card ol { padding-left: 20px; color: var(--text-muted); font-size: 13.5px; }
.card ul li, .card ol li { margin-bottom: 6px; }
.card ul li code, .card ol li code { color: var(--text); }
.card a { color: var(--accent); text-decoration: none; font-weight: 500; }
.card a:hover { text-decoration: underline; }

/* ── Try-it form ──────────────────────────────────────── */
textarea {
  width: 100%;
  min-height: 320px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.55;
  outline: none;
  resize: vertical;
  background: #fcfcfd;
  transition: border-color .12s, box-shadow .12s;
  color: var(--text);
}
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,70,229,0.12); }

.row { display: flex; gap: 10px; margin-top: 14px; align-items: center; flex-wrap: wrap; }

button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 9px 18px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s;
}
button:hover { background: var(--accent-hover); }
button:disabled { opacity: .5; cursor: default; }

/* Subtle text-style button (Reset to demo) */
.link-btn {
  background: transparent;
  color: var(--text-muted);
  padding: 9px 6px;
  font-weight: 500;
  font-size: 13px;
}
.link-btn:hover { background: transparent; color: var(--accent); text-decoration: underline; }

/* Segmented format toggle */
.seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
  background: #f1f3f7;
  padding: 2px;
}
.seg-btn {
  background: transparent;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.seg-btn:hover { background: rgba(255,255,255,0.6); color: var(--text); }
.seg-btn.active {
  background: white;
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(15,23,42,0.06);
}

.status { font-size: 12.5px; color: var(--text-muted); margin-left: auto; }
.status.ok { color: #059669; }
.status.err { color: #dc2626; }

/* ── Preview ──────────────────────────────────────────── */
.preview {
  background: #f1f3f7;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preview img { max-width: 100%; height: auto; border-radius: 6px; box-shadow: 0 6px 28px rgba(15,23,42,0.10); }
.preview .placeholder { color: var(--text-muted); font-size: 13px; text-align: center; }

/* ── Code blocks ──────────────────────────────────────── */
pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 14px 16px;
  border-radius: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
}
code.inline {
  background: #f1f3f7;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text);
  word-break: break-word;
}

/* ── Schema tables ────────────────────────────────────── */
.table-scroll { width: 100%; overflow-x: auto; }
table.schema {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.schema th, table.schema td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.schema th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  font-weight: 700;
}
table.schema td:first-child { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--text); white-space: nowrap; }
table.schema td.type { color: var(--accent); font-family: 'JetBrains Mono', monospace; font-size: 12px; }
table.schema td.desc { color: var(--text-muted); }

/* ── Tabs ─────────────────────────────────────────────── */
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tab {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Misc ─────────────────────────────────────────────── */
.notice {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 18px;
}
.notice strong { color: #7c2d12; }

.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 6px;
}
.compare th, .compare td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.compare th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  font-weight: 700;
}
.compare td:first-child { color: var(--text-muted); width: 28%; }

/* ── Mobile ───────────────────────────────────────────── */
@media (max-width: 720px) {
  .brandbar {
    padding: 14px 16px;
    gap: 10px;
  }
  .brand { font-size: 20px; gap: 8px; }
  .brand-logo { width: 26px; height: 26px; }
  .brand-tag { font-size: 11.5px; }
  .nav {
    width: 100%;
    margin-left: 0;
    margin-top: 4px;
    gap: 6px;
  }
  .nav a {
    flex: 1 1 auto;
    text-align: center;
    padding: 8px 10px;
    font-size: 12.5px;
  }

  .container { margin: 18px auto; padding: 0 16px 60px; }

  .hero { padding: 22px 20px; border-radius: 12px; }
  .hero h1 { font-size: 22px; }
  .hero p { font-size: 14px; }
  .hero .endpoint { font-size: 12px; padding: 8px 10px; }

  .card { padding: 18px 16px; border-radius: 10px; }
  .card h3 { font-size: 15px; }

  textarea { min-height: 240px; font-size: 12px; }

  .row { gap: 8px; }
  .status { width: 100%; margin-left: 0; margin-top: 4px; }

  pre { font-size: 11px; padding: 12px; }

  .preview { min-height: 220px; padding: 14px; }
}
