/* Documentation: three-column reference layout (sidebar / article / on-this-page). */
.docs-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 210px;
  gap: clamp(2rem, 4vw, 4rem);
  max-width: 1320px;
  margin: 0 auto;
  padding: 11rem clamp(1.25rem, 4vw, 3rem) 0;
  align-items: start;
}
.docs-nav-toggle { display: none; }

/* ---------- sidebar ---------- */
.docs-sidebar { position: sticky; top: 110px; max-height: calc(100vh - 130px); overflow-y: auto; padding-right: .5rem; scrollbar-width: thin; }
.docs-home { display: block; font-weight: 700; color: var(--text); margin-bottom: .75rem; font-size: .95rem; }
.docs-filter input {
  width: 100%; font: inherit; font-size: .875rem; padding: .5rem .75rem;
  border: 1px solid var(--border); border-radius: 8px; background: var(--band); color: var(--text);
}
.docs-filter input:focus { outline: 2px solid var(--brand); outline-offset: 1px; background: #fff; }
.docs-nav { display: flex; flex-direction: column; gap: 1.25rem; margin-top: 1.25rem; font-size: .9rem; }
.docs-nav-group h2 { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 .4rem .6rem; }
.docs-nav-group ul { list-style: none; margin: 0; padding: 0; }
.docs-nav-group a {
  display: block; padding: .38rem .6rem; border-radius: 7px; color: var(--text-soft); line-height: 1.35;
  border-left: 2px solid transparent;
}
.docs-nav-group a:hover { background: var(--band); color: var(--text); }
.docs-nav-group a[aria-current] { background: #F1ECFD; color: var(--brand); font-weight: 700; }
.docs-nav-group[hidden], .docs-nav-group li[hidden] { display: none; }
.docs-nav-group .enterprise-only { margin-left: .25rem; }

/* ---------- article ---------- */
.docs-article { min-width: 0; max-width: 760px; }
.docs-breadcrumb { display: flex; gap: .5rem; font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }
.docs-breadcrumb a { color: var(--brand); }
.docs-head h1 { font-size: clamp(2.1rem, 3.4vw, 2.9rem); line-height: 1.12; letter-spacing: -.03em; font-weight: 400; }
.docs-description { font-size: 1.15rem; color: var(--muted); margin: 1rem 0 2.25rem; line-height: 1.5; }
.docs-prose { font-size: 1rem; line-height: 1.75; }
.docs-prose > :first-child { margin-top: 0; }
.docs-prose h2 { font-size: 1.55rem; margin: 2.75rem 0 .9rem; padding-top: .5rem; scroll-margin-top: 120px; }
.docs-prose h3 { font-size: 1.15rem; font-weight: 700; margin: 2rem 0 .6rem; scroll-margin-top: 120px; }
.docs-prose h4 { font-size: 1rem; font-weight: 700; color: var(--text); margin: 1.5rem 0 .5rem; }
.docs-prose h2 .heading-accent, .docs-prose h3 .heading-accent { color: inherit; font-style: normal; }
.docs-prose .docs-anchor { margin-left: .4rem; color: var(--border); text-decoration: none; opacity: 0; font-weight: 400; }
.docs-prose h2:hover .docs-anchor, .docs-prose h3:hover .docs-anchor { opacity: 1; color: var(--brand); }
.docs-prose p, .docs-prose ul, .docs-prose ol { margin-bottom: 1.1rem; }
.docs-prose li + li { margin-top: .3rem; }
.docs-prose strong { color: var(--text); }
.docs-prose code { font-family: var(--mono); font-size: .82em; background: var(--band); border: 1px solid var(--border); border-radius: 5px; padding: .1em .35em; color: var(--text); }
.docs-prose pre { position: relative; background: #17151F; color: #ECEAF3; border-radius: 10px; padding: 1rem 1.15rem; overflow-x: auto; margin: 0 0 1.25rem; font-size: .84rem; line-height: 1.6; }
.docs-prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.docs-prose .docs-copy { position: absolute; top: .5rem; right: .5rem; font: 700 .72rem var(--sans); color: #ECEAF3; background: rgba(255,255,255,.12); border: 0; border-radius: 6px; padding: .3rem .55rem; cursor: pointer; }
.docs-prose .docs-copy:hover { background: rgba(255,255,255,.22); }
.docs-prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }
.docs-prose kbd { font-family: var(--mono); font-size: .78em; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: .05em .4em; background: #fff; color: var(--text); }

/* tables (reference sections) */
.docs-prose table { display: table; width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; margin: 0 0 1.5rem; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.docs-prose .docs-table-wrap { overflow-x: auto; margin: 0 0 1.5rem; }
.docs-prose .docs-table-wrap table { margin: 0; }
.docs-prose th { background: var(--band); color: var(--text); font-weight: 700; text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--border); font-size: .8rem; letter-spacing: .02em; }
.docs-prose td { padding: .65rem .8rem; border-bottom: 1px solid var(--border); vertical-align: top; min-width: 0; }
.docs-prose tr:last-child td { border-bottom: 0; }
.docs-prose td:first-child { color: var(--text); font-weight: 700; white-space: nowrap; }
.docs-prose td code { white-space: nowrap; }

/* callouts: kramdown IAL on a blockquote, e.g. `{:.callout .tip}` */
.docs-prose blockquote { margin: 0 0 1.25rem; padding: .9rem 1.1rem .9rem 1rem; border-left: 3px solid var(--border); background: var(--band); border-radius: 0 10px 10px 0; color: var(--text-soft); }
.docs-prose blockquote > :last-child { margin-bottom: 0; }
.docs-prose .callout { border-radius: 10px; border: 1px solid var(--border); border-left-width: 4px; padding-left: 1.1rem; }
.docs-prose .callout p:first-child::before { display: inline-block; font-weight: 700; margin-right: .5rem; color: var(--text); }
.docs-prose .callout.tip { border-left-color: var(--up); background: #EEF8F4; }
.docs-prose .callout.tip p:first-child::before { content: "Tip"; color: var(--up); }
.docs-prose .callout.note { border-left-color: var(--brand); background: #F3F0FC; }
.docs-prose .callout.note p:first-child::before { content: "Note"; color: var(--brand); }
.docs-prose .callout.warning { border-left-color: #D97706; background: #FEF6E7; }
.docs-prose .callout.warning p:first-child::before { content: "Warning"; color: #B45309; }
.docs-prose .callout.info { border-left-color: #2563EB; background: #EEF3FE; }
.docs-prose .callout.info p:first-child::before { content: "Info"; color: #1D4ED8; }
.docs-prose .callout.enterprise { border-left-color: #17151F; background: var(--band); }
.docs-prose .callout.enterprise p:first-child::before { content: "Enterprise"; }

/* steps: kramdown IAL on an ordered list, e.g. `{:.steps}` */
.docs-prose ol.steps { list-style: none; padding: 0; margin: 0 0 1.75rem; counter-reset: step; }
.docs-prose ol.steps > li { position: relative; padding: 0 0 1.5rem 3rem; margin: 0; counter-increment: step; }
.docs-prose ol.steps > li::before { content: counter(step); position: absolute; left: 0; top: .05rem; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; font-size: .85rem; display: grid; place-items: center; }
.docs-prose ol.steps > li::after { content: ""; position: absolute; left: .9rem; top: 2.2rem; bottom: .2rem; width: 2px; background: var(--border); }
.docs-prose ol.steps > li:last-child::after { display: none; }
.docs-prose ol.steps > li > p:first-child { margin-bottom: .4rem; }
.docs-prose ol.steps > li > strong:first-child, .docs-prose ol.steps > li > p:first-child > strong:first-child { display: block; color: var(--text); font-size: 1.02rem; margin-bottom: .2rem; }
.docs-prose ol.steps .docs-shot { margin-top: .75rem; }

/* option lists: `{:.options}` on a definition-style list */
.docs-prose ul.options { list-style: none; padding: 0; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 1.5rem; }
.docs-prose ul.options > li { padding: .8rem 1rem; border-bottom: 1px solid var(--border); margin: 0; }
.docs-prose ul.options > li:last-child { border-bottom: 0; }
.docs-prose ul.options > li > strong:first-child, .docs-prose ul.options > li > code:first-child { display: block; margin-bottom: .2rem; color: var(--text); }

/* screenshots */
.docs-shot { margin: 1.25rem 0 1.75rem; }
/* A gentle radius only: the app inside the screenshot has its own corners, and
   a large radius on the frame shaves them and leaves the frame colour showing
   through. White background so any sub-pixel gap is invisible. */
.docs-shot-frame { width: fit-content; max-width: 100%; margin-inline: auto; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: #fff; box-shadow: 0 1px 2px rgba(23,21,31,.06), 0 12px 32px -18px rgba(23,21,31,.25); }
/* No `width` declaration: each image keeps the size in its width/height
   attributes (its capture size in CSS pixels) and only scales down. */
.docs-shot img { display: block; max-width: 100%; height: auto; margin-inline: auto; }
.docs-shot-narrow { max-width: 480px; }
.docs-shot figcaption { font-size: .85rem; color: var(--muted); margin-top: .6rem; text-align: center; }

/* cards */
.docs-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin: 0 0 2rem; }
.docs-card { display: flex; flex-direction: column; gap: .35rem; padding: 1.1rem 1.15rem; border: 1px solid var(--border); border-radius: 12px; color: var(--text-soft); text-decoration: none; transition: border-color .2s, transform .2s, box-shadow .2s; background: #fff; }
.docs-card:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: 0 12px 28px -18px rgba(101,61,233,.45); }
.docs-card strong { color: var(--text); font-size: 1rem; }
.docs-card p { margin: 0; font-size: .9rem; line-height: 1.45; }
.docs-card-icon { width: 34px; height: 34px; border-radius: 9px; background: #F1ECFD; color: var(--brand); display: grid; place-items: center; margin-bottom: .35rem; }
.docs-card-icon svg { width: 18px; height: 18px; }

/* pager + footer */
.docs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3.5rem; }
.docs-pager a { display: flex; flex-direction: column; gap: .2rem; padding: 1rem 1.15rem; border: 1px solid var(--border); border-radius: 12px; color: var(--text); text-decoration: none; }
.docs-pager a:hover { border-color: var(--brand); color: var(--brand); }
.docs-pager small { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.docs-pager-next { text-align: right; align-items: flex-end; }
.docs-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border-top: 1px solid var(--border); margin-top: 2.5rem; padding-top: 1.75rem; font-size: .9rem; color: var(--muted); }
.docs-foot a:not(.pill) { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }

/* on this page */
.docs-toc { position: sticky; top: 110px; font-size: .84rem; max-height: calc(100vh - 130px); overflow-y: auto; }
.docs-toc h2 { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 .6rem; }
.docs-toc ol { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--border); }
.docs-toc li a { display: block; padding: .3rem .8rem; color: var(--text-soft); border-left: 2px solid transparent; margin-left: -1px; line-height: 1.35; }
.docs-toc li[data-level="3"] a { padding-left: 1.6rem; font-size: .8rem; }
.docs-toc li a:hover { color: var(--text); }
.docs-toc li a[aria-current] { color: var(--brand); border-left-color: var(--brand); font-weight: 700; }
.docs-toc:empty, .docs-toc[hidden] { display: none; }

/* docs index */
.docs-index { max-width: 1120px; margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 3rem); }
.docs-index-group { margin-top: 3rem; }
.docs-index-group h2 { font-size: 1.35rem; font-weight: 400; margin-bottom: .35rem; }
.docs-index-group > p { color: var(--muted); margin-bottom: 1.1rem; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .docs-shell { grid-template-columns: 230px minmax(0, 1fr); }
  .docs-toc { display: none; }
}
@media (max-width: 850px) {
  .docs-shell { grid-template-columns: 1fr; padding-top: 8.5rem; gap: 1rem; }
  .docs-nav-toggle { display: inline-flex; align-items: center; gap: .5rem; font: inherit; font-size: .9rem; padding: .55rem .9rem; border: 1px solid var(--border); border-radius: 999px; background: #fff; color: var(--text); cursor: pointer; justify-self: start; }
  .docs-sidebar { position: static; max-height: none; display: none; padding: 1rem; border: 1px solid var(--border); border-radius: 12px; }
  .docs-sidebar.is-open { display: block; }
  .docs-pager { grid-template-columns: 1fr; }
  .docs-foot { flex-direction: column; align-items: flex-start; }
  .docs-prose table { display: block; overflow-x: auto; }
}

/* ---------- diagrams ---------- */
.docs-diagram { margin: 1.25rem 0 1.75rem; }
.docs-diagram figcaption { font-size: .85rem; color: var(--muted); margin-top: .6rem; text-align: center; }
.docs-diagram-svg svg { display: block; width: 100%; height: auto; max-width: 100%; font-family: var(--sans); }
.docs-diagram-narrow svg { max-width: 520px; margin: 0 auto; }
.docs-flow-track { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem 0; align-items: stretch; counter-reset: flow; }
.docs-flow-track li { position: relative; flex: 1 1 120px; min-width: 120px; margin: 0; padding: .8rem .9rem .8rem 2.4rem; border: 1px solid var(--border); border-radius: 10px; background: #fff; counter-increment: flow; display: flex; flex-direction: column; gap: .15rem; }
.docs-flow-track li::before { content: counter(flow); position: absolute; left: .75rem; top: .8rem; width: 1.35rem; height: 1.35rem; border-radius: 50%; background: var(--band); color: var(--text); font-size: .72rem; font-weight: 700; display: grid; place-items: center; border: 1px solid var(--border); }
.docs-flow-track li + li { margin-left: 1.5rem; }
.docs-flow-track li + li::after { content: ""; position: absolute; left: -1.5rem; top: 50%; width: 1.5rem; height: 2px; background: var(--border); }
.docs-flow-track li + li > strong::before { content: ""; position: absolute; left: -.55rem; top: calc(50% - 5px); border: 5px solid transparent; border-left: 7px solid #C9C4D6; }
.docs-flow-track li strong { color: var(--text); font-size: .95rem; line-height: 1.25; }
.docs-flow-track li small { color: var(--muted); font-size: .8rem; line-height: 1.35; }
.docs-flow-track li.is-accent { border-color: var(--brand); background: #F6F3FE; }
.docs-flow-track li.is-accent::before { background: var(--brand); color: #fff; border-color: var(--brand); }
.docs-flow-loop .docs-flow-track { padding-bottom: 1.4rem; position: relative; }
.docs-flow-loop .docs-flow-track::after { content: "repeats on every schedule, repair or change"; position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font-size: .75rem; color: var(--muted); }
@media (max-width: 600px) {
  .docs-flow-track { flex-direction: column; }
  .docs-flow-track li + li { margin-left: 0; margin-top: 1.25rem; }
  .docs-flow-track li + li::after { left: 1.25rem; top: -1.25rem; width: 2px; height: 1.25rem; }
  .docs-flow-track li + li > strong::before { left: .95rem; top: -.45rem; border: 5px solid transparent; border-top: 7px solid #C9C4D6; }
}

/* examples: `{:.example}` on a blockquote — a worked example, prompt or brief */
.docs-prose .example { border: 1px dashed #C9C1E0; border-left: 4px solid var(--brand); background: #FBFAFE; border-radius: 10px; padding: 1rem 1.15rem 1rem 1.1rem; color: var(--text); font-size: .97rem; }
.docs-prose .example p:first-child::before { content: "Example"; display: block; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin-bottom: .35rem; }
.docs-prose .example p + p { margin-top: .6rem; }
.docs-prose .example.prompt p:first-child::before { content: "Try asking Jason"; }
.docs-prose .example.brief p:first-child::before { content: "Example brief"; }
.docs-prose .example.result p:first-child::before { content: "What you get"; }

/* two-column compare: `{:.compare}` on a table */
.docs-prose table.compare td:first-child { white-space: normal; }

/* feature cards inside pages */
.docs-prose .docs-cards { margin-top: .5rem; }
.docs-prose .docs-cards a { text-decoration: none; }
.docs-prose .docs-card p { color: var(--text-soft); }

/* key/value facts strip */
.docs-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin: 0 0 1.5rem; }
.docs-facts div { border: 1px solid var(--border); border-radius: 10px; padding: .75rem .9rem; background: #fff; }
.docs-facts dt { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.docs-facts dd { margin: .2rem 0 0; color: var(--text); font-weight: 700; }

.docs-index-group h2 { display: flex; align-items: center; gap: .6rem; }
.docs-group-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; }
.docs-group-icon svg { width: 16px; height: 16px; }
.docs-nav-group h2 { display: flex; align-items: center; gap: .4rem; }
.docs-nav-group h2 svg { width: 13px; height: 13px; color: var(--brand); }

/* A screenshot that has not been captured yet must be obvious in dev, never a
   silent broken-image icon. check-screenshots.mjs fails the build on these. */
.docs-shot img:not([src]), .docs-shot-frame img[data-missing] { min-height: 160px; }
.docs-shot-frame { position: relative; }
.tour-shot-frame { position: relative; }
.tour-shot-frame::after {
  content: "Screenshot missing — run product_screenshots.py";
  position: absolute; inset: 0; display: none; place-items: center;
  font-size: .85rem; color: var(--down); background: var(--band);
}
.docs-shot-frame::after {
  content: "Screenshot missing — run product_screenshots.py";
  position: absolute; inset: 0; display: none; place-items: center;
  font-size: .85rem; color: var(--down); background: var(--band);
}
.docs-shot-frame.is-missing::after, .tour-shot-frame.is-missing::after { display: grid; }

/* ---------- click to zoom ---------- */
.docs-shot-frame, .tour-shot-frame { cursor: zoom-in; }
/* A <dialog> is display:none until open; only style the open state, or the
   overlay covers the page permanently. */
.docs-lightbox:not([open]) { display: none; }
.docs-lightbox[open] {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background: rgba(23,21,31,.72); padding: clamp(1rem, 4vw, 3rem);
  border: 0; width: 100%; height: 100%; max-width: none; max-height: none;
}
.docs-lightbox::backdrop { background: rgba(23,21,31,.72); }
.docs-lightbox img {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  border-radius: 10px; background: #fff; box-shadow: 0 30px 80px -20px rgba(0,0,0,.6);
}
.docs-lightbox figcaption { color: #fff; font-size: .9rem; text-align: center; margin-top: .9rem; }
.docs-lightbox-close {
  position: absolute; top: 1rem; right: 1rem; width: 2.25rem; height: 2.25rem;
  border: 0; border-radius: 50%; background: rgba(255,255,255,.16); color: #fff;
  font-size: 1.1rem; line-height: 1; cursor: pointer;
}
.docs-lightbox-close:hover { background: rgba(255,255,255,.28); }
@media (prefers-reduced-motion: no-preference) { .docs-lightbox[open] img { animation: docs-zoom .18s ease-out; } }
@keyframes docs-zoom { from { transform: scale(.97); opacity: .6; } to { transform: none; opacity: 1; } }
