/* cookbook.css — a customer's cookbooks (templates/cookbook/library.html,
 * templates/cookbook/<customer>/<slug>.html, cookbook.js).
 *
 * Owner, 2026-10-31: documentation, not a page of controls, and it looks like
 * our docs (docs.miraiminds.co). So the docs' page in the console's tokens: a
 * framed page; a breadcrumb over a large title and a grey description; plain
 * numbered sections; ruled tables; light code blocks with a copy icon; blue
 * notes; and "On this page" beside the text, its current place marked. The
 * list opens with a note to its readers and lists one line per cookbook. The copy buttons are Developers' own (.dev-copy in app.css,
 * dev.js), redrawn here as the docs' icon. Owner, 2026-11-03: the key is a
 * button in step 1, the first request is a docs code group (cURL, Python,
 * JavaScript) for any of the ten languages, and every script and sample
 * file is shown open, in full, with line numbers and colour. */

.cb-doc { --cb-r: 14px;
          --cb-copy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='8' y='8' width='14' height='14' rx='2'/%3E%3Cpath d='M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2'/%3E%3C/svg%3E");
          --cb-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
          max-width: 880px; margin-bottom: 48px; padding: 40px 44px 48px;
          background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 16px; }
.cb-doc[hidden] { display: none; }
.cb-reader { max-width: 1100px; container-type: inline-size; }

/* ── the head: breadcrumb, title, description ─────────────────────────── */
.cb-head { margin-bottom: 32px; }
.cb-eyebrow { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 13.5px;
              font-weight: 500; color: var(--c-ink-3); }
.cb-eyebrow a { color: inherit; text-decoration: none; transition: color 120ms var(--ease-out); }
.cb-crumb { color: var(--c-ink-4); }
.cb-title { margin: 0; font-size: 32px; font-weight: 600; line-height: 1.2; letter-spacing: -0.025em;
            color: var(--c-ink); text-wrap: balance; }
.cb-lead { margin: 10px 0 0; max-width: 62ch; font-size: 17px; line-height: 1.6; color: var(--c-ink-3);
           text-wrap: pretty; }
.cb-meta { margin: 14px 0 0; font-size: 13px; color: var(--c-ink-3); }

/* ── prose ────────────────────────────────────────────────────────────── */
.cb-prose { font-size: 15px; line-height: 1.75; color: var(--c-ink-2); }
.cb-prose p { margin: 0 0 16px; max-width: 72ch; text-wrap: pretty; }
.cb-prose h2 { margin: 44px 0 14px; font-size: 22px; font-weight: 600; line-height: 1.35;
               letter-spacing: -0.02em; color: var(--c-ink); text-wrap: balance; }
.cb-prose > h2:first-child, .cb-sec:first-child > h2 { margin-top: 0; }
.cb-sec { scroll-margin-top: 20px; }
.cb-prose h3 { margin: 28px 0 10px; font-size: 17px; font-weight: 600; line-height: 1.4;
               letter-spacing: -0.01em; color: var(--c-ink); }
.cb-prose b { font-weight: 600; color: var(--c-ink); }
.cb-prose a:not(.cb-book) { color: var(--c-ink); font-weight: 600; text-decoration: underline;
                            text-decoration-thickness: 1px; text-decoration-color: var(--c-ink-3);
                            text-underline-offset: 3px; transition: text-decoration-color 120ms var(--ease-out); }
.cb-file { font-family: var(--mono); font-size: 0.9em; }
.cb-file::after { content: " ↓"; font-family: var(--sans); color: var(--c-ink-3); }
.cb-doc :not(pre) > code { padding: 2px 6px; border: 1px solid var(--c-line); border-radius: 6px;
                           background: var(--c-sunk); font-family: var(--mono); font-size: 0.84em;
                           color: var(--c-ink); overflow-wrap: anywhere; }
.cb-list { margin: 0 0 18px; padding-left: 22px; max-width: 72ch; }
.cb-list li { margin: 6px 0; padding-left: 4px; }
.cb-list li::marker { color: var(--c-ink-4); }
.cb-quiet { margin-left: 4px; font-weight: 400; color: var(--c-ink-3); }

/* The docs' Note. */
.cb-note { --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E");
           display: flex; gap: 12px; margin: 4px 0 20px; padding: 13px 16px; border: 1px solid #cfe1f7;
           border-radius: var(--cb-r); background: #f2f7fe; color: #1e4f8c; font-size: 14px; line-height: 1.65; }
.cb-note::before { content: ""; flex: none; width: 16px; height: 16px; margin-top: 3px; background: currentColor;
                   -webkit-mask: var(--glyph) center / contain no-repeat; mask: var(--glyph) center / contain no-repeat; }
.cb-prose .cb-note p { margin: 0; max-width: none; }
.cb-doc .cb-note code { border-color: #cfe1f7; background: rgba(255, 255, 255, 0.7); color: inherit; }

/* ── code ─────────────────────────────────────────────────────────────── */
.cb-doc .dev-cmd { margin: 4px 0 20px; padding: 14px 16px; background: var(--c-surface);
                   border: 1px solid var(--c-line); border-radius: var(--cb-r); font-size: 13px;
                   color: var(--c-ink); }
.cb-doc .dev-cmd pre { padding-right: 36px; line-height: 1.7; color: var(--c-ink); user-select: text;
                       scrollbar-color: var(--c-line-strong) transparent; }
.cb-sh-cmd { color: #cf222e; }
.cb-sh-flag { color: #0550ae; }
.cb-sh-string { color: #0a3069; }
.cb-sh-var { color: #953800; }
.cb-sh-comment { color: #6e7781; }
/* Copy: an icon, as in the docs. The word stays in the button for the
 * accessibility tree (dev.js swaps it to "Copied"), at no size. */
.cb-doc .dev-copy { --glyph: var(--cb-copy); top: 9px; right: 9px; display: grid; place-items: center;
                    width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px;
                    background: var(--c-surface); color: var(--c-ink-3); font-size: 0;
                    transition: background-color 120ms var(--ease-out), color 120ms var(--ease-out),
                                transform 140ms var(--ease-out); }
.cb-doc .dev-copy::before { content: ""; width: 15px; height: 15px; background: currentColor;
                            -webkit-mask: var(--glyph) center / contain no-repeat;
                            mask: var(--glyph) center / contain no-repeat; }
.cb-doc .dev-copy.done { --glyph: var(--cb-check); color: var(--c-ink); }
.cb-doc .dev-copy.done::after { content: "Copied"; position: absolute; right: calc(100% + 4px); padding: 3px 8px;
                                border-radius: 6px; background: var(--c-ink); color: var(--c-surface);
                                font-size: 11.5px; font-weight: 500; line-height: 1.4; white-space: nowrap; }
.cb-doc .cb-copy.dev-copy { position: relative; top: auto; right: auto; display: inline-grid;
                            width: 26px; height: 26px; margin-left: 4px; vertical-align: middle; }
.cb-doc .cb-copy.dev-copy.done::after { right: auto; left: calc(100% + 4px); }

/* Code the docs' way: comments, strings, keywords, numbers, called names. */
.cb-tok-comment { color: #6e7781; }
.cb-tok-string { color: #0a3069; }
.cb-tok-kw { color: #cf222e; }
.cb-tok-num { color: #0550ae; }
.cb-tok-fn { color: #8250df; }
.cb-tok-punct { color: var(--c-ink-4); }

/* A framed block with a bar on top: the first request's code group, and
 * each script or sample file shown open in full. */
.cb-code, .cb-viewer { margin: 4px 0 22px; border: 1px solid var(--c-line); border-radius: var(--cb-r);
                       background: var(--c-surface); overflow: hidden; }
.cb-codebar { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 8px 0 14px;
              border-bottom: 1px solid var(--c-line); background: var(--c-paper); }
.cb-tabs { display: flex; align-self: stretch; gap: 18px; }
.cb-tabs button { margin-bottom: -1px; padding: 0; border: 0; border-bottom: 2px solid transparent;
                  border-radius: 0; background: none; color: var(--c-ink-3); font-size: 13.5px; font-weight: 500;
                  cursor: pointer; transition: color 120ms var(--ease-out), border-color 120ms var(--ease-out); }
.cb-tabs button[aria-selected="true"] { border-bottom-color: var(--c-ink); color: var(--c-ink); }
.cb-filename { font-family: var(--mono); font-size: 13px; font-weight: 600; color: var(--c-ink); }
.cb-filemeta { font-size: 12.5px; color: var(--c-ink-3); }
.cb-prose a.cb-filedl { margin-left: auto; font-size: 13px; font-weight: 500; text-decoration: none; color: var(--c-ink-2); }
.cb-codebar > .dev-copy { position: relative; top: auto; right: auto; flex: none; }
.cb-code .cb-codebar > .dev-copy { margin-left: auto; }
.cb-doc .cb-codebar > .dev-copy.done::after { right: calc(100% + 4px); top: 50%; transform: translateY(-50%); }
.cb-codepane, .cb-filebody pre { margin: 0; padding: 14px 16px; font-family: var(--mono); font-size: 13px;
                                 line-height: 1.7; color: var(--c-ink); white-space: pre; tab-size: 4;
                                 user-select: text; scrollbar-width: thin;
                                 scrollbar-color: var(--c-line-strong) transparent; }
.cb-codepane { overflow-x: auto; }
.cb-codepane[hidden], .cb-filebody[hidden], .cb-csvtable[hidden] { display: none; }
/* A file scrolls inside its frame; its line numbers scroll with it. */
.cb-filebody { display: grid; grid-template-columns: auto minmax(0, 1fr); max-height: 520px; overflow: auto; }
.cb-filebody pre:not(.cb-gutter) { overflow: visible; padding-left: 4px; }
.cb-filebody .cb-gutter { position: sticky; left: 0; padding: 14px 12px 14px 16px; background: var(--c-surface);
                          color: var(--c-ink-4); text-align: right; user-select: none;
                          font-variant-numeric: tabular-nums; }

/* The spoken language of the first request: one choice of ten. */
.cb-langs { display: flex; flex-wrap: wrap; gap: 5px; padding: 12px 14px; border-bottom: 1px solid var(--c-line); }
.cb-langs button { padding: 3px 9px; border: 1px solid var(--c-line-strong); border-radius: 999px;
                   background: var(--c-surface); color: var(--c-ink-2); font-size: 12.5px; line-height: 1.4;
                   cursor: pointer; transition: border-color 120ms var(--ease-out), background-color 120ms var(--ease-out); }
.cb-langs button[aria-checked="true"] { border-color: var(--c-ink); background: var(--c-ink); color: var(--c-surface); }

/* Step 1's key: a button, then the state of the key beside it. */
.cb-key { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 4px 0 14px; }
.cb-keybtn { padding: 9px 16px; border: 0; border-radius: 10px; background: var(--c-ink); color: var(--c-surface);
             font-size: 14px; font-weight: 600; cursor: pointer; transition: opacity 120ms var(--ease-out); }
.cb-keybtn:disabled { opacity: 0.45; cursor: default; }
.cb-keybtn[hidden] { display: none; }
.cb-prose .cb-keystate { flex: 1 1 280px; margin: 0; font-size: 14px; line-height: 1.6; color: var(--c-ink-3); }
.cb-live { display: inline-block; margin-right: 6px; padding: 1px 8px; border-radius: 999px; background: #dafbe1;
           color: #116329; font-size: 12px; font-weight: 600; }
.cb-key.ready + .dev-cmd { border-color: #a6d8b4; box-shadow: 0 0 0 3px #eefbf1; }

/* The sample CSV, read as a table. */
.cb-csvtable { padding: 6px 16px 2px; overflow-x: auto; }
.cb-csvtable .cb-table { margin: 0; font-size: 13.5px; }
.cb-sample td { vertical-align: top; }
.cb-sample .cb-col-text { min-width: 260px; white-space: normal; }
.cb-sample .cb-col-expect { min-width: 220px; white-space: normal; font-size: 12.5px; }
.cb-reading { display: block; }
.cb-reading + .cb-reading { margin-top: 4px; padding-top: 4px; border-top: 1px dashed var(--c-line); }

/* ── tables: the docs' rules ──────────────────────────────────────────── */
.cb-table { width: 100%; margin: 4px 0 22px; border-collapse: collapse; font-size: 14px; line-height: 1.6; }
.cb-table th, .cb-table td { padding: 11px 16px 11px 0; border-bottom: 1px solid var(--c-line);
                             text-align: left; vertical-align: baseline; color: var(--c-ink-2); }
.cb-table tr > :last-child { padding-right: 0; }
/* app.css sets every th as a small-caps label; the docs' headers are words. */
.cb-table th { font-size: 14px; font-weight: 600; line-height: 1.6; letter-spacing: 0; text-transform: none;
               color: var(--c-ink); }
.cb-table thead th { padding-top: 0; border-bottom-color: var(--c-line-strong); }
.cb-table td:first-child, .cb-table tbody th { color: var(--c-ink); white-space: nowrap; }
.cb-table tbody th small { display: block; font-size: 12px; font-weight: 400; color: var(--c-ink-3); }
.cb-fields td:first-child { width: 1%; }
.cb-msgs td:first-child { width: 55%; white-space: normal; }
.cb-ids td:last-child { white-space: nowrap; }
/* A table too wide for a phone (ids beside names) scrolls inside its frame,
 * never the page. */
.cb-scroll { margin: 4px 0 22px; overflow-x: auto; }
.cb-scroll > .cb-table { margin: 0; }

.cb-samples .cb-line { width: 100%; white-space: normal; }
.cb-samples td:not(.cb-line) { width: 1%; padding-right: 8px; }
.cb-play { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 9px;
           border: 1px solid var(--c-line-strong); border-radius: 999px; background: var(--c-surface);
           color: var(--c-ink); font-size: 12.5px; line-height: 1.2; }
.cb-play::before { content: ""; width: 0; height: 0; border-left: 7px solid currentColor;
                   border-top: 4.5px solid transparent; border-bottom: 4.5px solid transparent; }
.cb-play.loading { color: var(--c-ink-3); }
.cb-play.playing { border-color: var(--c-ink); }
.cb-play.playing::before { width: 7px; height: 7px; border: 0; border-radius: 1px; background: currentColor; }

/* ── On this page ─────────────────────────────────────────────────────── */
.cb-page { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "toc" "body"; }
.cb-page > .cb-head { grid-area: head; }
.cb-page > .cb-toc { grid-area: toc; }
.cb-page > .cb-prose { grid-area: body; }
.cb-toc { margin: 0 0 36px; padding: 14px 18px; border: 1px solid var(--c-line); border-radius: var(--cb-r);
          font-size: 13.5px; }
.cb-tochead { --glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M3 6h18M3 12h12M3 18h16'/%3E%3C/svg%3E");
              display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-weight: 500; color: var(--c-ink); }
.cb-tochead::before { content: ""; width: 14px; height: 14px; background: currentColor;
                      -webkit-mask: var(--glyph) center / contain no-repeat;
                      mask: var(--glyph) center / contain no-repeat; }
.cb-toc ul { margin: 0; padding: 0; list-style: none; columns: 2 220px; column-gap: 24px; }
.cb-toc li { break-inside: avoid; }
.cb-toc a { display: block; padding: 3px 0; line-height: 1.5; color: var(--c-ink-3); text-decoration: none;
            transition: color 120ms var(--ease-out), border-color 120ms var(--ease-out); }
/* Beside the text once there is room for both, held in view as it scrolls,
 * with the current section marked on its rule (cookbook.js · cookbookSpy). */
@container (min-width: 800px) {
  .cb-page { grid-template-columns: minmax(0, 1fr) 200px; grid-template-areas: "head toc" "body toc";
             column-gap: 48px; }
  .cb-page > .cb-toc { position: sticky; top: calc(20px + var(--banner-h, 0px)); align-self: start;
                       margin: 0; padding: 0; border: 0; border-radius: 0; }
  .cb-toc ul { columns: auto; border-left: 1px solid var(--c-line); }
  .cb-toc a { margin-left: -1px; padding: 4px 0 4px 14px; border-left: 1px solid transparent; }
  .cb-toc a.on { border-left-color: var(--c-ink); color: var(--c-ink); font-weight: 600; }
}

/* ── the list: a note to its readers, then one line per cookbook ──────── */
.cb-letter { margin-bottom: 40px; }
.cb-letter p { font-size: 16px; line-height: 1.75; }
.cb-prose .cb-sign { margin: 0; color: var(--c-ink-3); }
.cb-books { margin: 0 0 24px; padding: 0; list-style: none; border-top: 1px solid var(--c-line); }
.cb-book { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; column-gap: 14px; align-items: baseline;
           padding: 14px 2px; border-bottom: 1px solid var(--c-line); color: inherit; text-decoration: none; }
.cb-booknum { grid-row: span 2; font-family: var(--mono); font-size: 13px; color: var(--c-ink-3);
              font-variant-numeric: tabular-nums; }
.cb-booktitle { grid-column: 2; font-size: 15px; font-weight: 600; line-height: 1.5; color: var(--c-ink);
                text-underline-offset: 3px; text-decoration-thickness: 1px; }
.cb-bookkind { grid-column: 2; font-size: 13px; line-height: 1.5; color: var(--c-ink-3); }
.cb-bookwhen { grid-column: 3; grid-row: 1; font-size: 13px; line-height: 1.5; color: var(--c-ink-3);
               white-space: nowrap; }
.cb-book.later .cb-booktitle { font-weight: 500; color: var(--c-ink-3); }
.cb-new { margin-left: 8px; padding: 2px 7px; border-radius: 999px; background: var(--c-ink); color: var(--c-surface);
          font-size: 11px; font-weight: 600; line-height: 1.4; vertical-align: 1px; }
.cb-new[hidden] { display: none; }
.cb-prose .cb-help { font-size: 14px; color: var(--c-ink-3); }

@media (hover: hover) and (pointer: fine) {
  .cb-eyebrow a:hover, .cb-toc a:hover { color: var(--c-ink); }
  .cb-prose a:not(.cb-book):hover { text-decoration-color: var(--c-ink); }
  .cb-doc .dev-copy:hover { background: var(--c-sunk); color: var(--c-ink); }
  .cb-tabs button:hover, .cb-prose a.cb-filedl:hover { color: var(--c-ink); }
  .cb-langs button:hover { border-color: var(--c-ink-4); }
  .cb-keybtn:not(:disabled):hover { opacity: 0.86; }
  .cb-play:hover { border-color: var(--c-ink-4); }
  a.cb-book:hover .cb-booktitle { text-decoration: underline; }
}

/* ── phone: the page is the screen ────────────────────────────────────── */
@media (max-width: 640px) {
  .cb-doc { padding: 4px 0 0; border: 0; border-radius: 0; background: none; }
  .cb-title { font-size: 26px; }
  .cb-lead { font-size: 16px; }
  .cb-prose h2 { margin-top: 36px; font-size: 20px; }
  .cb-letter p { font-size: 15px; }
  .cb-bookwhen { grid-column: 2; grid-row: auto; }
  .cb-samples .cb-line { display: none; }
  .cb-ids td:last-child { white-space: normal; }
  .cb-filemeta { display: none; }
  .cb-filebody { max-height: 420px; }
}

/* The rail's mark for a cookbook not yet seen (core.js · paintCookbookNew). */
.nav-new { margin-left: auto; padding: 1px 7px; border-radius: 999px; background: var(--c-on-dark);
           color: var(--c-dark); font-size: 10.5px; font-weight: 600; line-height: 1.5; }
.nav-new[hidden], :is(.agent-workspace, .admin-workspace) > .nav .nav-new { display: none; }
