/* Bramble Help: article content (Markdown output), code, callouts, tabs and
   API endpoint blocks. Self-contained so Console's editor preview can load it
   on its own: every colour falls back to a light-theme value. */
.md, .api-page, .callout, .code-block, .tabs, .endpoint, .disclosure {
  --md-text: var(--text, #15171c);
  --md-text-2: var(--text-2, #383d48);
  --md-muted: var(--muted, #5f6673);
  --md-border: var(--border, #e2e4e8);
  --md-border-strong: var(--border-strong, #cdd1d7);
  --md-soft: var(--bg-soft, #f6f7f8);
  --md-surface: var(--surface, #ffffff);
  --md-hover: var(--hover, #eef0f2);
  --md-accent: var(--accent, #1f9d57);
  --md-accent-strong: var(--accent-strong, #157a43);
  --md-accent-soft: var(--accent-soft, #e9f7ef);
  --md-link: var(--link, #137a43);
  --md-mono: var(--mono, ui-monospace, "Cascadia Code", Menlo, Consolas, monospace);
  --md-code-bg: color-mix(in srgb, var(--md-text) 5%, var(--md-surface));
}
.md { font-size: 16px; line-height: 1.7; color: var(--md-text); overflow-wrap: break-word; }
.md > :first-child { margin-top: 0; }
.md p, .md ul, .md ol, .md table, .md figure, .md .table-wrap { margin: 0 0 1.05em; }
.md a { color: var(--md-link); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--md-link) 35%, transparent); text-underline-offset: 2px; }
.md a:hover { text-decoration-color: currentColor; }
.md a svg.ext { width: 11px; height: 11px; margin-left: 3px; vertical-align: -1px; opacity: .7; }
.md h2, .md h3, .md h4, .md h5, .md h6 { position: relative; line-height: 1.3; color: var(--md-text); scroll-margin-top: 80px; }
.md h2 { font-size: 1.5rem; margin: 2.2em 0 .6em; letter-spacing: -.01em; font-weight: 700; }
.md h3 { font-size: 1.2rem; margin: 1.8em 0 .5em; font-weight: 650; }
.md h4 { font-size: 1.04rem; margin: 1.5em 0 .4em; font-weight: 650; }
.md h5, .md h6 { font-size: .95rem; margin: 1.3em 0 .4em; }
.anchor { position: absolute; left: -1.1em; width: 1em; color: var(--md-muted); opacity: 0; text-decoration: none !important; font-weight: 400; }
:is(h2, h3, h4):hover > .anchor, .anchor:focus { opacity: 1; }
.md strong { font-weight: 650; color: var(--md-text); }
.md ul, .md ol { padding-left: 1.5em; }
.md li { margin: .3em 0; }
.md li > ul, .md li > ol { margin: .3em 0 .4em; }
.md hr { border: 0; border-top: 1px solid var(--md-border); margin: 2.2em 0; }
.md blockquote { margin: 0 0 1.05em; padding: .2em 1.1em; border-left: 3px solid var(--md-border-strong); color: var(--md-text-2); }
.md code, .api-page code, .ep-facts code, .api-table code { font-family: var(--md-mono); font-size: .88em; padding: .14em .38em; border-radius: 5px; background: var(--md-code-bg); border: 1px solid var(--md-border); }
.md kbd { font: 600 .8em var(--md-mono); padding: .15em .45em; border: 1px solid var(--md-border-strong); border-bottom-width: 2px; border-radius: 5px; background: var(--md-surface); }
.md mark { background: color-mix(in srgb, #facc15 40%, transparent); color: inherit; padding: 0 .15em; border-radius: 3px; }
.md img { display: block; max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--md-border); }
.md .img-frame { display: block; margin: .6em 0 1.2em; }
.md figure { margin: 1.2em 0 1.4em; }
.md figcaption { margin-top: .5em; font-size: .88em; color: var(--md-muted); text-align: center; }

/* Numbered steps: top-level ordered lists in an article */
.md > ol.steps, .tab-panel > ol.steps, .disclosure-body > ol.steps, .callout > ol.steps { list-style: none; padding-left: 0; counter-reset: step; }
.md > ol.steps > li, .tab-panel > ol.steps > li, .disclosure-body > ol.steps > li, .callout > ol.steps > li { position: relative; counter-increment: step; padding: 0 0 .9em 2.75em; margin: 0; }
.md > ol.steps > li::before, .tab-panel > ol.steps > li::before, .disclosure-body > ol.steps > li::before, .callout > ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: .1em; width: 1.85em; height: 1.85em; border-radius: 50%;
  display: grid; place-items: center; font-size: .85em; font-weight: 700; background: var(--md-accent-soft); color: var(--md-accent-strong); border: 1px solid color-mix(in srgb, var(--md-accent) 30%, transparent);
}
.md > ol.steps > li:not(:last-child)::after, .tab-panel > ol.steps > li:not(:last-child)::after { content: ""; position: absolute; left: calc(.925em - 1px); top: 2.15em; bottom: .25em; width: 2px; background: var(--md-border); }
.md ol.steps > li > p:first-child { margin-top: 0; }
.md ol.steps > li > :last-child { margin-bottom: 0; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--md-border); border-radius: 10px; margin: 0 0 1.2em; }
.table-wrap table { width: 100%; border-collapse: collapse; margin: 0; font-size: .92em; line-height: 1.5; }
.table-wrap th { text-align: left; font-weight: 650; background: var(--md-soft); color: var(--md-text); white-space: nowrap; }
.table-wrap th, .table-wrap td { padding: .6em .9em; border-bottom: 1px solid var(--md-border); vertical-align: top; }
.table-wrap tr:last-child td { border-bottom: 0; }

/* Callouts */
.callout { margin: 0 0 1.2em; padding: .85em 1.1em; border-radius: 10px; border: 1px solid; border-left-width: 4px; font-size: .97em; line-height: 1.6; }
.callout > :last-child { margin-bottom: 0; }
.callout p { margin: 0 0 .6em; }
.callout-title { display: flex; align-items: center; gap: .5em; font-weight: 700; margin-bottom: .35em !important; }
.callout-title svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.callout-note { --c: #2563eb; }
.callout-tip { --c: #16a34a; }
.callout-important { --c: #7c3aed; }
.callout-warning { --c: #d97706; }
.callout-caution { --c: #dc2626; }
.callout { border-color: color-mix(in srgb, var(--c) 30%, transparent); border-left-color: var(--c); background: color-mix(in srgb, var(--c) 7%, var(--md-surface)); }
.callout-title { color: color-mix(in srgb, var(--c) 85%, var(--md-text)); }

/* Code blocks */
.code-block { margin: 0 0 1.2em; border: 1px solid var(--md-border); border-radius: 10px; overflow: hidden; background: var(--md-code-bg); }
.code-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 4px 14px; border-bottom: 1px solid var(--md-border); background: color-mix(in srgb, var(--md-text) 3%, var(--md-surface)); }
.code-lang { font-size: 12px; font-weight: 650; color: var(--md-muted); }
.code-copy { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: var(--md-muted); font: 600 12.5px var(--font, sans-serif); cursor: pointer; }
.code-copy svg { width: 13px; height: 13px; fill: currentColor; }
.code-copy:hover { background: var(--md-hover); color: var(--md-text); }
.code-copy.done { color: var(--md-accent-strong); }
.code-block pre { margin: 0; padding: 14px 16px; overflow-x: auto; font: 13.5px/1.6 var(--md-mono); tab-size: 2; }
.code-block code { font: inherit; background: none; border: 0; padding: 0; color: var(--md-text); }
.hljs-comment, .hljs-quote { color: #6a737d; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-type { color: #b4237a; }
.hljs-string, .hljs-regexp, .hljs-addition, .hljs-meta .hljs-string { color: #0b7a3e; }
.hljs-number, .hljs-built_in, .hljs-variable, .hljs-template-variable { color: #b35b00; }
.hljs-title, .hljs-section, .hljs-function .hljs-title { color: #5b3ad1; }
.hljs-attr, .hljs-attribute, .hljs-name, .hljs-tag, .hljs-property { color: #1f5fbf; }
.hljs-deletion { color: #b91c1c; }
.hljs-meta { color: #6b7280; }
:root[data-theme="dark"] .hljs-comment { color: #8b949e; }
:root[data-theme="dark"] .hljs-keyword, :root[data-theme="dark"] .hljs-literal, :root[data-theme="dark"] .hljs-type { color: #ff7bc0; }
:root[data-theme="dark"] .hljs-string, :root[data-theme="dark"] .hljs-regexp { color: #7ee2a8; }
:root[data-theme="dark"] .hljs-number, :root[data-theme="dark"] .hljs-built_in, :root[data-theme="dark"] .hljs-variable { color: #ffb86b; }
:root[data-theme="dark"] .hljs-title, :root[data-theme="dark"] .hljs-section { color: #c3a6ff; }
:root[data-theme="dark"] .hljs-attr, :root[data-theme="dark"] .hljs-attribute, :root[data-theme="dark"] .hljs-name, :root[data-theme="dark"] .hljs-tag, :root[data-theme="dark"] .hljs-property { color: #8ab4ff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hljs-comment { color: #8b949e; }
  :root:not([data-theme="light"]) .hljs-keyword, :root:not([data-theme="light"]) .hljs-literal, :root:not([data-theme="light"]) .hljs-type { color: #ff7bc0; }
  :root:not([data-theme="light"]) .hljs-string, :root:not([data-theme="light"]) .hljs-regexp { color: #7ee2a8; }
  :root:not([data-theme="light"]) .hljs-number, :root:not([data-theme="light"]) .hljs-built_in, :root:not([data-theme="light"]) .hljs-variable { color: #ffb86b; }
  :root:not([data-theme="light"]) .hljs-title, :root:not([data-theme="light"]) .hljs-section { color: #c3a6ff; }
  :root:not([data-theme="light"]) .hljs-attr, :root:not([data-theme="light"]) .hljs-attribute, :root:not([data-theme="light"]) .hljs-name, :root:not([data-theme="light"]) .hljs-tag, :root:not([data-theme="light"]) .hljs-property { color: #8ab4ff; }
}

/* Tabs */
.tabs { margin: 0 0 1.2em; border: 1px solid var(--md-border); border-radius: 10px; overflow: hidden; }
.tab-list { display: flex; gap: 2px; padding: 0 6px; overflow-x: auto; border-bottom: 1px solid var(--md-border); background: var(--md-soft); }
.tab-list button { position: relative; height: 40px; padding: 0 14px; border: 0; background: none; color: var(--md-muted); font: 600 13.5px var(--font, sans-serif); cursor: pointer; white-space: nowrap; }
.tab-list button:hover { color: var(--md-text); }
.tab-list button[aria-selected="true"] { color: var(--md-accent-strong); }
.tab-list button[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--md-accent); }
.tab-panel { padding: 1em 1.1em .2em; }
.tab-panel > .code-block:only-child, .tab-panel > .code-block:last-child { margin-bottom: .9em; }
.tabs[data-tab-group="lang"] .tab-panel { padding: 0; }
.tabs[data-tab-group="lang"] .tab-panel .code-block { margin: 0; border: 0; border-radius: 0; }
.tab-print-title { display: none; }
@media print { .tab-panel[hidden] { display: block !important; } .tab-print-title { display: block; font-weight: 700; } .tab-list { display: none; } }

/* Collapsed sections */
.disclosure { margin: 0 0 1.2em; border: 1px solid var(--md-border); border-radius: 10px; background: var(--md-surface); }
.disclosure > summary { cursor: pointer; padding: .7em 1em; font-weight: 600; list-style: none; display: flex; align-items: center; gap: .55em; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before { content: ""; width: .5em; height: .5em; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s; color: var(--md-muted); }
.disclosure[open] > summary::before { transform: rotate(45deg); }
.disclosure-body { padding: 0 1em .4em; }
.disclosure-body > .code-block { margin-bottom: .8em; }

/* API endpoint blocks */
.endpoint { margin-top: 2.6em; padding-top: 1.8em; border-top: 1px solid var(--md-border); }
.endpoint h2 { position: relative; font-size: 1.4rem; margin: 0 0 .6em; scroll-margin-top: 80px; }
.endpoint h3 { font-size: 1rem; margin: 1.5em 0 .6em; }
.ep-line { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border: 1px solid var(--md-border); border-radius: 9px; background: var(--md-soft); margin-bottom: 1em; overflow-x: auto; }
.ep-path { font: 600 14px var(--md-mono) !important; background: none !important; border: 0 !important; padding: 0 !important; white-space: nowrap; flex: 1; }
.ep-facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0 0 1em; font-size: 14.5px; }
.ep-facts dt { font-weight: 650; color: var(--md-muted); }
.ep-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.ep-facts.wide { padding: 14px 18px; border: 1px solid var(--md-border); border-radius: 10px; background: var(--md-soft); }
.api-table { font-size: 14px !important; }
.api-table td:first-child { white-space: nowrap; }
.req { margin-left: 6px; font-size: 11px; font-weight: 700; color: #b45309; text-transform: uppercase; letter-spacing: .03em; }
.type { font-family: var(--md-mono); font-size: 12.5px; color: var(--md-text-2); }
.status { display: inline-block; font: 700 12px var(--md-mono); padding: 2px 7px; border-radius: 5px; background: var(--md-soft); border: 1px solid var(--md-border); }
.status.s2 { color: #15803d; } .status.s3 { color: #2563eb; } .status.s4 { color: #b45309; } .status.s5 { color: #b91c1c; }
.endpoint .callout { margin-top: .4em; }
@media (max-width: 900px) {
  .md { font-size: 15.5px; }
  .anchor { display: none; }
  .ep-facts { grid-template-columns: 1fr; gap: 2px; }
  .ep-facts dd { margin-bottom: 8px; }
}
