/* Adtraction docs UI — shared styling for /lead-qualifier/docs and /specific/:id/docs. */

:root {
  --ink: #14192b;
  --ink-2: #303751;
  --muted: #6b7280;
  --line: #e6e8ef;
  --bg: #fafbfc;
  --accent: #00b988;
  --accent-dark: #009470;
  --accent-soft: #e9f9f3;
  --maxw: 1080px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.at-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.at-header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.at-header-inner img.at-logo { height: 26px; }
.at-header-inner .spacer { flex: 1; }
.at-header-inner .at-support {
  color: var(--muted);
  font-size: 14px;
}

/* Page title (lives at the top of the content column) */
.at-hero { margin-bottom: 10px; }
.at-hero h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.at-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin: 0 0 14px;
}
.at-meta {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.at-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border: 1px solid rgba(0, 185, 136, 0.25);
}
.at-chip.muted {
  background: #f1f3f7;
  color: var(--ink-2);
  border-color: var(--line);
}
/* the display:inline-flex above otherwise defeats the [hidden] attribute */
.at-chip[hidden] { display: none; }

/* Lead-qualifier docs page still uses the original centered title strip + shell */
.at-title { background: linear-gradient(180deg, #fff 0%, var(--bg) 100%); border-bottom: 1px solid var(--line); }
.at-title-inner { max-width: var(--maxw); margin: 0 auto; padding: 36px 24px 28px; }
.at-title h1 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.at-shell { max-width: var(--maxw); margin: 28px auto 64px; }

/* Two-column docs layout: sticky left menu + content */
.at-doc {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 44px;
  align-items: start;
}
.at-menu {
  position: sticky;
  top: 24px;
  padding-top: 34px;
}
.at-menu .at-eyebrow { margin-bottom: 16px; }
.at-menu-nav { display: flex; flex-direction: column; gap: 2px; }
.at-mi {
  appearance: none;
  text-align: left;
  background: none;
  border: 0;
  border-left: 2px solid transparent;
  padding: 7px 12px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  border-radius: 0 7px 7px 0;
}
.at-mi:hover { background: #eef0f4; color: var(--ink); }
.at-mi:focus { outline: none; }
.at-mi.act { color: var(--accent-dark); border-left-color: var(--accent); background: var(--accent-soft); }
.at-menu .at-dl-link { display: inline-block; margin: 22px 0 0 12px; font-size: 13px; font-weight: 600; color: var(--accent-dark); }

.at-content { padding-top: 34px; padding-bottom: 80px; min-width: 0; }

/* Swagger UI overrides */
.swagger-ui .topbar { display: none; }
.swagger-ui .info { margin: 0 0 24px; padding: 0; }
.swagger-ui .info hgroup.main { display: none; }
.swagger-ui .info .description { padding: 0 4px; }

/* Markdown rhythm inside info.description */
.swagger-ui .markdown h2,
.swagger-ui .renderedMarkdown h2 {
  margin-top: 36px;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
}
.swagger-ui .markdown p,
.swagger-ui .renderedMarkdown p { color: var(--ink-2); }
.swagger-ui .markdown li,
.swagger-ui .renderedMarkdown li { color: var(--ink-2); margin-bottom: 4px; }
.swagger-ui .markdown code,
.swagger-ui .renderedMarkdown code {
  background: #f1f3f7;
  color: var(--ink);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}
.swagger-ui .markdown pre,
.swagger-ui .renderedMarkdown pre {
  background: #f6f8fa;
  color: var(--ink);
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: none;
}
.swagger-ui .markdown pre code,
.swagger-ui .renderedMarkdown pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}

/* Info callouts — markdown blockquotes used for the implementation-checklist notes */
.swagger-ui .markdown blockquote,
.swagger-ui .renderedMarkdown blockquote {
  margin: 6px 0 14px;
  padding: 10px 14px;
  border-left: 3px solid #3b82f6;
  background: #f0f6ff;
  border-radius: 0 6px 6px 0;
}
.swagger-ui .markdown blockquote p,
.swagger-ui .renderedMarkdown blockquote p {
  margin: 0;
  color: var(--ink-2);
}

/* Tables — force grid borders since Swagger UI's defaults win otherwise */
.swagger-ui .info table,
.swagger-ui .markdown table,
.swagger-ui .renderedMarkdown table {
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  margin: 12px 0 20px;
  font-size: 14px;
  width: auto;
}
.swagger-ui .info table th,
.swagger-ui .info table td,
.swagger-ui .markdown table th,
.swagger-ui .markdown table td,
.swagger-ui .renderedMarkdown table th,
.swagger-ui .renderedMarkdown table td {
  padding: 8px 12px !important;
  border: 1px solid var(--line) !important;
  text-align: left;
  vertical-align: top;
}
.swagger-ui .info table th,
.swagger-ui .markdown table th,
.swagger-ui .renderedMarkdown table th {
  background: #f7f8fb !important;
  font-weight: 600 !important;
  color: var(--ink);
}
.swagger-ui .info table tbody tr:nth-child(even) td,
.swagger-ui .markdown table tbody tr:nth-child(even) td,
.swagger-ui .renderedMarkdown table tbody tr:nth-child(even) td {
  background: #fcfcfd;
}

/* Operations */
.swagger-ui .scheme-container {
  background: transparent;
  box-shadow: none;
  padding: 12px 0;
}
.swagger-ui .opblock-tag {
  font-size: 18px;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
}
.swagger-ui .opblock.opblock-post {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.swagger-ui .opblock.opblock-post .opblock-summary-method { background: var(--accent); }
.swagger-ui .opblock.opblock-get .opblock-summary-method { background: var(--ink-2); }
.swagger-ui .btn.execute {
  background: var(--accent);
  border-color: var(--accent);
}
.swagger-ui .btn.execute:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}
.swagger-ui section.models { border-color: var(--line); }
.swagger-ui section.models.is-open h4 { border-color: var(--line); }

/* Footer */
.at-footer {
  max-width: var(--maxw);
  margin: 0 auto 32px;
  padding: 0 24px;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ==========================================================================
   Left-menu views (src/integrations/docs-ui.html). The menu flips [data-view]
   on .at-content; the rules below show the prose panel (Overview), the Swagger
   operations (Endpoints), the Swagger models (Schemas) or the guide panel (Guide).
   ========================================================================== */
.swagger-ui .wrapper { padding: 0; max-width: none; }

/* View heading (e.g. "Endpoints") shown above the Swagger operations */
.at-view-h {
  display: none;
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 22px;
  font-weight: 680;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* Each view shown on its own; Swagger's built-in info block is always hidden
   (the overview prose lives in #doc-panel instead). */
#doc-panel, #guide-panel { display: none; }
.swagger-ui .information-container { display: none; }

.at-content[data-view="overview"] #doc-panel { display: block; }
.at-content[data-view="overview"] #swagger-ui { display: none; }

/* Endpoints = the operations plus the implementation guide (checklist + errors),
   clearly separated below them. */
.at-content[data-view="endpoints"] .at-view-h { display: block; }
.at-content[data-view="endpoints"] .swagger-ui section.models { display: none; }
.at-content[data-view="endpoints"] #guide-panel {
  display: block;
  margin-top: 44px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.at-content[data-view="schemas"] .swagger-ui .scheme-container,
.at-content[data-view="schemas"] .swagger-ui .opblock-tag-section { display: none; }

/* Collapse the sidebar into a horizontal menu on narrow screens */
@media (max-width: 880px) {
  .at-doc { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .at-menu { position: static; padding-top: 24px; }
  .at-menu-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .at-mi { border-left: 0; border-radius: 7px; }
  .at-mi.act { border-left: 0; }
  .at-menu .at-dl-link { margin-left: 0; }
  .at-content { padding-top: 16px; }
}

/* Overview prose panel — one consistent style for the whole narrative
   (overview + flow + checklist + errors), rendered from markdown via marked. */
.at-tabpanel { padding: 12px 0 32px; color: var(--ink-2); }
.at-tabpanel > :first-child { margin-top: 0; }
.at-tabpanel h2 {
  margin: 36px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
}
.at-tabpanel h3 { margin: 22px 0 6px; font-size: 16px; font-weight: 650; color: var(--ink); }
.at-tabpanel p { margin: 10px 0; }
.at-tabpanel a { color: var(--accent-dark); }
.at-tabpanel ul, .at-tabpanel ol { padding-left: 22px; margin: 12px 0; }
.at-tabpanel li { margin: 7px 0; padding-left: 4px; }
.at-tabpanel code {
  background: #f1f3f7; color: var(--ink); padding: 1px 6px; border-radius: 4px;
  font-family: ui-monospace, Menlo, monospace; font-size: 0.88em;
}
.at-tabpanel pre {
  background: #f6f8fa; color: var(--ink); padding: 14px 16px; border-radius: 8px;
  border: 1px solid var(--line); overflow: auto; margin: 12px 0;
}
.at-tabpanel pre code { background: transparent; padding: 0; }
.at-tabpanel table { border-collapse: collapse; width: 100%; font-size: 14px; margin: 14px 0; }
.at-tabpanel th, .at-tabpanel td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.at-tabpanel th { background: #f7f8fb; font-weight: 600; color: var(--ink); }
.at-tabpanel tbody tr:nth-child(even) td { background: #fcfcfd; }
