/* Lead411 V3 OpenAPI docs — light/dark, sidebar, try-it */
:root {
  --l411-green: #1a5f2a;
  --l411-green-soft: #e8f4ec;
  --bg-page: #f5f5f5;
  --bg-panel: #fff;
  --bg-code: #1e1e1e;
  --text: #333;
  --text-muted: #666;
  --border: #e8e8e8;
  --code-text: #d4d4d4;
  --shadow: rgba(0, 0, 0, 0.06);
}
html[data-theme="dark"] {
  --bg-page: #121212;
  --bg-panel: #1a1a1a;
  --bg-code: #0d0d0d;
  --text: #e8e8e8;
  --text-muted: #aaa;
  --border: #333;
  --l411-green-soft: #1e3d28;
  --code-text: #ccc;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-page);
  height: 100%;
}
.layout { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 260px; min-width: 260px; background: var(--bg-panel);
  border-right: 1px solid var(--border); overflow-y: auto; flex-shrink: 0;
}
.sidebar-header {
  padding: 16px; border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 12px; font-weight: 600;
}
.sidebar-header img { max-width: 200px; max-height: 40px; }
.sidebar-group { padding: 8px 0; border-bottom: 1px solid var(--border); }
.sidebar-group-title {
  padding: 8px 16px; font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.sidebar a {
  display: block; padding: 8px 16px; color: var(--text); text-decoration: none; font-size: 13px;
}
.sidebar a:hover { background: var(--bg-page); }
.sidebar a.active {
  color: var(--l411-green); font-weight: 600; background: var(--l411-green-soft);
  margin: 2px 8px; border-radius: 6px; padding: 8px 10px;
}
.sidebar a.deprecated { opacity: 0.65; font-size: 12px; }
.top-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 24px; border-bottom: 1px solid var(--border); background: var(--bg-panel);
  flex-wrap: wrap;
}
.doc-tabs { display: flex; gap: 0; }
.doc-tabs button {
  padding: 14px 18px; font-size: 14px; background: transparent; border: none;
  border-bottom: 3px solid transparent; color: var(--text-muted); cursor: pointer;
}
.doc-tabs button.active { color: var(--l411-green); border-bottom-color: var(--l411-green); font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.top-actions a, .top-actions button {
  font-size: 12px; padding: 6px 10px; border-radius: 4px; border: 1px solid var(--border);
  background: var(--bg-panel); color: var(--text); cursor: pointer; text-decoration: none;
}
.main-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.content-row { flex: 1; display: flex; min-height: 0; overflow: hidden; }
.content-area {
  flex: 1; overflow-y: auto; padding: 24px 28px; background: var(--bg-panel); min-width: 0;
}
.right-panel {
  width: 440px; min-width: 320px; max-width: 48vw; background: var(--bg-code); color: var(--code-text);
  border-left: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden;
}
.right-panel-header { padding: 12px 14px; border-bottom: 1px solid #333; font-size: 12px; }
.right-panel-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.right-panel-controls select, .right-panel-controls input {
  font-size: 12px; padding: 5px 8px; border-radius: 4px; border: 1px solid #444; background: #222; color: #eee;
}
.code-block {
  flex: 1; overflow: auto; padding: 14px; font-family: Consolas, Monaco, monospace;
  font-size: 12px; white-space: pre-wrap; word-break: break-all;
}
.try-panel { padding: 12px 14px; border-top: 1px solid #333; font-size: 12px; max-height: 45%; overflow-y: auto; }
.try-panel label { display: block; margin: 6px 0 2px; color: #aaa; }
.try-panel input, .try-panel textarea {
  width: 100%; font-size: 12px; padding: 6px; border-radius: 4px; border: 1px solid #444;
  background: #111; color: #eee; font-family: inherit;
}
.try-panel textarea { min-height: 72px; font-family: Consolas, monospace; }
.btn-primary {
  margin-top: 8px; padding: 8px 12px; background: var(--l411-green); color: #fff;
  border: none; border-radius: 4px; cursor: pointer; font-weight: 600;
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.response-box {
  margin-top: 10px; padding: 8px; background: #111; border-radius: 4px; max-height: 160px; overflow: auto;
  font-family: Consolas, monospace; font-size: 11px;
}
.method-badge {
  display: inline-block; padding: 2px 8px; font-size: 11px; font-weight: 700; border-radius: 3px;
  color: #fff; margin-right: 8px;
}
.method-POST { background: #28a745; }
.method-GET { background: #007bff; }
.method-DELETE { background: #dc3545; }
.endpoint-path { font-family: monospace; font-size: 14px; word-break: break-all; }
h1 { font-size: 22px; margin-bottom: 12px; }
h2 { font-size: 17px; margin: 20px 0 10px; padding-top: 12px; border-top: 1px solid var(--border); }
h2:first-child { border-top: none; padding-top: 0; }
p { margin-bottom: 10px; }
table.param-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
table.param-table th, table.param-table td { border: 1px solid var(--border); padding: 8px; text-align: left; }
table.param-table th { background: var(--bg-page); }
.content-area pre { background: var(--bg-page); padding: 12px; overflow-x: auto; border-radius: 4px; margin: 10px 0; }
.badge-dep { font-size: 11px; background: #f0ad4e; color: #222; padding: 2px 6px; border-radius: 3px; margin-left: 8px; }
.guide-content code { background: var(--bg-page); padding: 2px 5px; border-radius: 3px; }
.guide-content pre { background: var(--bg-page); padding: 12px; overflow-x: auto; border-radius: 4px; margin: 10px 0; }
.cors-note {
  background: var(--l411-green-soft); border-left: 4px solid var(--l411-green);
  padding: 10px 12px; margin: 12px 0; font-size: 13px;
}
.tab-panel { display: none; height: 100%; flex-direction: column; min-height: 0; }
.tab-panel.active { display: flex; }
.guide-only .right-panel { display: none; }
.guide-only .content-row { overflow: hidden; }
.guide-layout,
.content-wrapper.guide-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-panel);
  width: 100%;
}
.guide-layout .guide-scroll,
.guide-layout .content-main {
  flex: 1;
  min-width: 0;
  max-width: none;
  margin: 0;
}
.content-toc {
  width: 220px;
  min-width: 200px;
  flex-shrink: 0;
  padding: 24px 16px;
  border-left: 1px solid var(--border);
  overflow-y: auto;
  background: var(--bg-panel);
  font-size: 13px;
}
.content-toc-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.content-toc a {
  display: block;
  padding: 6px 0;
  color: var(--text-muted);
  text-decoration: none;
  line-height: 1.4;
}
.content-toc a:hover { color: var(--text); }
.content-toc a.active { color: var(--l411-green); font-weight: 600; }
.content-toc .toc-h3 { padding-left: 12px; font-size: 12px; }
@media (max-width: 960px) {
  .guide-layout,
  .content-wrapper.guide-layout { flex-direction: column; }
  .content-toc { width: 100%; max-height: 200px; border-left: none; border-top: 1px solid var(--border); }
}
.tab-scroll { overflow-y: auto; flex: 1; min-height: 0; }
.continuous-docs .doc-section {
  padding-bottom: 36px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 16px;
}
.continuous-docs .doc-section:last-child { border-bottom: none; }
.continuous-docs h2[id], .continuous-docs h3[id],
.mcp-int-content h2[id], .mcp-int-content h3[id] { scroll-margin-top: 20px; }
.right-hint { color: #aaa; font-size: 12px; line-height: 1.5; margin: 0; }
.right-hint a { color: #8fdf9f; }
.endpoints-loading { color: var(--text-muted); padding: 16px 0; font-size: 13px; }
.note-box {
  background: var(--l411-green-soft); border-left: 4px solid var(--l411-green);
  padding: 10px 12px; margin: 12px 0; font-size: 13px;
}
/* MCP + Integrations (legacy parity) */
.mcp-features, .int-features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 24px 0; }
.mcp-feature-card, .int-card { background: var(--bg-page); border: 1px solid var(--border); border-radius: 6px; padding: 20px; }
.mcp-feature-card h3, .int-card h3 { font-size: 15px; color: var(--l411-green); margin-bottom: 8px; }
.mcp-feature-card p, .int-card p { font-size: 13px; color: var(--text-muted); margin: 0; line-height: 1.5; }
.mcp-works-with { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.mcp-works-item { background: var(--l411-green-soft); color: var(--l411-green); padding: 8px 14px; border-radius: 6px; font-size: 13px; font-weight: 500; }
.mcp-tools-table { margin: 20px 0; width: 100%; border-collapse: collapse; font-size: 13px; }
.mcp-tools-table th, .mcp-tools-table td { padding: 8px 12px; border: 1px solid var(--border); text-align: left; }
.mcp-tools-table th { background: var(--bg-page); }
.int-overview { background: var(--bg-page); border-left: 4px solid var(--l411-green); padding: 16px 20px; margin: 20px 0; }
.tool-doc-card { background: var(--bg-page); border: 1px solid var(--border); border-radius: 6px; padding: 16px; margin: 16px 0; }
.int-connector-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0; padding: 14px 16px; background: var(--bg-page); border: 1px solid var(--border); border-radius: 6px; font-size: 12px; font-weight: 600; }
.int-connector-flow span { color: var(--l411-green); }
.int-prereq { background: #fffbeb; border: 1px solid #fcd34d; border-left: 4px solid #f59e0b; border-radius: 6px; padding: 14px 18px; margin: 20px 0; display: flex; gap: 12px; align-items: flex-start; }
html[data-theme="dark"] .int-prereq { background: #2a2410; border-color: #92680a; color: #f5e6b8; }
.int-prereq h4 { font-size: 14px; margin-bottom: 8px; }
.int-prereq ul { margin: 0 0 0 18px; font-size: 13px; line-height: 1.65; }
.int-steps { display: flex; flex-direction: column; margin-top: 16px; }
.int-step-row { display: flex; }
.int-step-num { width: 48px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; }
.int-step-bubble { width: 36px; height: 36px; border-radius: 50%; background: var(--l411-green); color: #fff; font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.int-step-vline { width: 2px; flex: 1; min-height: 20px; background: #c8e6d0; margin-top: 4px; }
.int-step-row:last-child .int-step-vline { display: none; }
.int-step-card { flex: 1; background: var(--bg-panel); border: 1px solid var(--border); border-radius: 8px; padding: 18px 20px; margin: 0 0 16px 6px; }
.int-step-card .int-step-tag { font-size: 11px; font-weight: 700; letter-spacing: .5px; color: var(--l411-green); text-transform: uppercase; margin-bottom: 4px; }
.int-step-card h4 { font-size: 16px; margin-bottom: 8px; }
.int-step-card p { font-size: 13px; color: var(--text-muted); margin: 0; line-height: 1.6; }
.int-step-img { margin-top: 12px; border-radius: 6px; border: 1px solid var(--border); max-width: 100%; height: auto; display: block; }
.int-step-split { display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.int-step-split-col { flex: 1 1 240px; border: 1px solid var(--border); border-radius: 8px; padding: 10px; background: var(--bg-page); }
.int-tip { margin-top: 12px; background: #eff6ff; border-left: 3px solid #0066cc; padding: 10px 14px; font-size: 13px; }
html[data-theme="dark"] .int-tip { background: #0f1c2e; }
.int-security-note { margin-top: 12px; background: var(--l411-green-soft); border-left: 3px solid var(--l411-green); padding: 10px 14px; font-size: 13px; }
.int-section-label { font-size: 14px; font-weight: 700; margin: 28px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.int-ts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 16px; }
.int-ts-card { background: var(--bg-panel); border: 1px solid var(--border); border-radius: 6px; padding: 14px 16px; }
.int-help-foot { margin-top: 24px; background: var(--bg-page); border: 1px solid var(--border); border-radius: 8px; padding: 20px; text-align: center; }
@media (max-width: 960px) {
  .layout { flex-direction: column; height: auto; min-height: 100vh; }
  .sidebar { width: 100%; max-height: 220px; }
  .content-row { flex-direction: column; }
  .right-panel { width: 100%; max-width: none; max-height: 420px; }
  .mcp-features, .int-features { grid-template-columns: 1fr; }
}
