/* The documentation shares Cut E's water, tokens and type. Reading comes before decoration. */
.docs-page { min-width: 0; }
.docs-page.wide main { max-width: 90rem; padding-top: 2rem; }
.docs-page .bar { max-width: 90rem; width: 100%; margin-inline: auto; padding-block: .75rem; }
.docs-page .logo span { display: inline; }
.docs-page .bar nav { flex-wrap: wrap; gap: .25rem 1.5rem; }
.docs-guide { position: relative; }
.docs-layout { display: grid; grid-template-columns: 15rem minmax(0, 1fr) 12.5rem; align-items: start; gap: clamp(1.5rem, 4vw, 4rem); }

/* Left: search and the page list */
.docs-sidebar { position: sticky; top: 1.25rem; max-height: calc(100svh - 2.5rem); overflow-y: auto; padding: .2rem .5rem .5rem .1rem; font-size: .94rem; scrollbar-width: thin; }
.docs-search { margin-bottom: 1.5rem; }
.docs-search label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.docs-search-field { position: relative; }
.docs-search input { width: 100%; min-width: 0; padding: .6rem 2rem .6rem .75rem; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface); font: inherit; font-size: .9rem; line-height: 1.3; }
.docs-search input::placeholder { color: var(--muted); opacity: 1; }
.docs-search-field kbd { position: absolute; right: .6rem; top: .52rem; border: 1px solid var(--line); border-radius: 4px; padding: 0 .3rem; font: .75rem/1.5 var(--font-body); color: var(--muted); pointer-events: none; }
.docs-search-field:focus-within kbd { display: none; }
#docs-results { padding-top: .6rem; }
#docs-result-status { font-size: .8rem; color: var(--muted); margin: 0 0 .4rem; }
#docs-results ul { list-style: none; margin: 0; padding: 0; }
#docs-results li { margin: 0; border-bottom: 1px solid var(--line); }
#docs-results a { display: block; padding: .6rem .5rem; margin-inline: -.5rem; border-radius: 8px; text-decoration: none; }
#docs-results a b { display: block; font-weight: 600; line-height: 1.35; }
#docs-results a span { display: block; color: var(--muted); font-size: .76rem; margin-bottom: .1rem; }
#docs-results a small { display: block; margin-top: .2rem; color: var(--muted); font-size: .8rem; line-height: 1.45; }
#docs-results a mark { background: color-mix(in oklch, var(--jelly) 30%, transparent); color: inherit; border-radius: 2px; }
.docs-menu summary { display: none; }
.docs-nav-group + .docs-nav-group { margin-top: 1.35rem; }
.docs-nav-group > p { color: var(--muted); font-size: .78rem; font-weight: 600; letter-spacing: .02em; margin: 0 0 .4rem; }
.docs-nav-group ul { list-style: none; margin: 0; padding: 0; }
.docs-nav-group li + li { margin-top: .05rem; }
.docs-nav-group a { display: block; border-radius: 8px; padding: .3rem .6rem; margin-inline: -.6rem; line-height: 1.45; text-decoration: none; }
.docs-nav-group a[aria-current] { background: color-mix(in oklch, var(--jelly) 16%, transparent); color: var(--jelly-deep); font-weight: 600; }
.docs-updated { display: flex; flex-direction: column; align-items: start; gap: .6rem; color: var(--muted); font-size: .78rem; border-top: 1px solid var(--line); padding-top: 1rem; margin: 1.5rem 0 0; }
.docs-updated time { color: inherit; font-size: inherit; }
.docs-updated button { background: transparent; color: var(--ink); border: 1px solid var(--line); padding: .3rem .6rem; border-radius: 8px; font: inherit; cursor: pointer; }

/* Middle: the page */
.docs-reading { min-width: 0; max-width: 46rem; }
.docs-reading:focus { outline: none; }
.docs-label { color: var(--jelly-deep); font-size: .86rem; font-weight: 600; margin: .2rem 0 .5rem; }
.docs-page h1 { font-size: clamp(2.2rem, 3.6vw, 3rem); line-height: 1.02; margin: 0 0 .8rem; max-width: 20ch; }
.docs-summary { color: var(--muted); font-size: 1.14rem; line-height: 1.5; margin: 0 0 1.25rem; max-width: 60ch; }
.docs-actions { display: flex; flex-wrap: wrap; gap: .4rem; padding-bottom: 1.5rem; margin-bottom: 1.75rem; border-bottom: 1px solid var(--line); }
.docs-action { display: inline-flex; align-items: center; gap: .3rem; min-height: 2.1rem; padding: .3rem .7rem; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink); font: 600 .82rem/1.2 var(--font-body); text-decoration: none; cursor: pointer; }
.docs-action[data-primary]:not([hidden]) { background: var(--jelly); border-color: transparent; color: var(--on-jelly); }
.docs-action[data-done] { border-color: var(--glow); }
.docs-reading h2 { font-size: 1.6rem; font-weight: 710; margin: 2.6rem 0 .7rem; scroll-margin-top: 1.25rem; }
.docs-reading h3 { font-size: 1.18rem; line-height: 1.3; margin: 1.9rem 0 .55rem; font-weight: 680; scroll-margin-top: 1.25rem; }
.docs-reading h2 a, .docs-reading h3 a { text-decoration: none; }
.docs-reading h2:focus, .docs-reading h3:focus { outline: none; }
.docs-reading p, .docs-reading li { max-width: 68ch; }
.docs-reading p { margin-bottom: 1.05rem; }
.docs-reading ul, .docs-reading ol { padding-left: 1.3rem; }
.docs-reading li::marker { color: var(--jelly-deep); }
.docs-reading code { font: .84em/1.6 "Martian Mono", ui-monospace, "SFMono-Regular", Consolas, monospace; background: color-mix(in oklch, var(--ink) 7%, transparent); border-radius: 5px; padding: .12em .34em; overflow-wrap: anywhere; }
.docs-reading details { padding: .85rem 0; margin-block: 1.2rem; border-block: 1px solid var(--line); }
.docs-reading details summary { color: var(--jelly-deep); cursor: pointer; font-weight: 600; }
.docs-reading details[open] summary { margin-bottom: 1rem; }

/* Callouts: the kind is said in words as well as colour. */
.docs-note { --note: var(--jelly-deep); border: 1px solid color-mix(in oklch, var(--note) 28%, transparent); background: color-mix(in oklch, var(--note) 7%, var(--surface)); border-radius: 12px; padding: .9rem 1.1rem; margin: 1.4rem 0; font-size: .97rem; }
.docs-note[data-kind="tip"] { --note: var(--glow); }
.docs-note[data-kind="warning"], .docs-note[data-kind="important"] { --note: var(--cherry); }
.docs-note p { margin: 0; max-width: none; }
.docs-note p + p { margin-top: .5rem; }
.docs-note > p:first-child > strong:first-child { color: var(--note); margin-right: .35rem; }

/* Lists with a shape */
.docs-cards { list-style: none; padding: 0 !important; margin: 1.3rem 0 1.8rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: .75rem; }
.docs-cards li { position: relative; margin: 0; max-width: none; padding: .95rem 1.1rem 1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--muted); font-size: .93rem; line-height: 1.5; }
.docs-cards li strong { display: block; color: var(--ink); font-size: 1rem; line-height: 1.35; margin-bottom: .3rem; }
.docs-cards li a { text-decoration: none; }
.docs-cards li a::after { content: ""; position: absolute; inset: 0; border-radius: 14px; }
.docs-cards li a:focus-visible { outline: none; }
.docs-cards li:focus-within { outline: 2px solid var(--jelly); outline-offset: 3px; }
.docs-steps { padding-left: 1.4rem; margin: 1.3rem 0 1.6rem; }
.docs-steps li { padding-left: .3rem; }
.docs-steps li + li { margin-top: .85rem; }
.docs-steps li::marker { color: var(--jelly-deep); font-weight: 600; }
.docs-loop { display: grid; grid-template-columns: repeat(auto-fit, minmax(6.4rem, 1fr)); list-style: none; padding: 0 !important; margin: 1.5rem 0 1.7rem; gap: 1rem .5rem; }
.docs-loop li { border-top: 2px solid color-mix(in oklch, var(--jelly-deep) 45%, transparent); padding: .55rem .15rem 0; margin: 0; font-size: .76rem; line-height: 1.4; color: var(--muted); }
.docs-loop li:first-child, .docs-loop li:last-child { border-top-color: var(--glow); }
.docs-loop strong { display: block; font-size: .92rem; color: var(--ink); margin-bottom: .15rem; }
.docs-loop code { background: none; padding: 0; }

/* Code and tables */
.docs-code { margin: 1.25rem 0 1.5rem; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.docs-code[data-language="prompt"] { border-color: color-mix(in oklch, var(--jelly-deep) 45%, transparent); background: color-mix(in oklch, var(--jelly) 7%, var(--surface)); }
.docs-code-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .35rem .5rem .35rem .9rem; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .8rem; min-height: 2.5rem; }
.docs-copy { flex-shrink: 0; padding: .3rem .65rem; border: 0; border-radius: 7px; color: var(--ink); background: transparent; cursor: pointer; font: 600 .8rem/1.5 var(--font-body); }
.docs-code[data-language="prompt"] .docs-copy { background: var(--jelly); color: var(--on-jelly); }
.docs-code pre { margin: 0; padding: 1rem; max-width: 100%; overflow-x: auto; tab-size: 2; }
.docs-code pre code { background: none; border-radius: 0; padding: 0; overflow-wrap: normal; white-space: pre; font-size: .8125rem; line-height: 1.75; }
.docs-code[data-language="prompt"] pre code { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--font-body); font-size: .98rem; line-height: 1.6; }
.docs-table { max-width: 100%; overflow-x: auto; margin: 1.3rem 0 1.5rem; }
.docs-table table { display: table; width: 100%; font-size: .93rem; margin: 0; line-height: 1.5; }
.docs-table th, .docs-table td { padding: .65rem .9rem .65rem 0; overflow-wrap: anywhere; }
.docs-table thead th { font-size: .82rem; color: var(--muted); border-top: 0; white-space: nowrap; }
.docs-table td:first-child { min-width: 7.5rem; }
.docs-table td:last-child, .docs-table th:last-child { padding-right: 0; }

/* Previous and next */
.docs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin: 3rem 0 1rem; padding-top: 1.75rem; border-top: 1px solid var(--line); }
.docs-pager a { display: block; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; font-weight: 600; line-height: 1.35; }
.docs-pager a[rel="next"] { text-align: right; }
.docs-pager small { display: block; color: var(--muted); font-weight: 400; font-size: .78rem; margin-bottom: .15rem; }

/* Right: on this page */
.docs-toc { position: sticky; top: 1.25rem; max-height: calc(100svh - 2.5rem); overflow-y: auto; font-size: .86rem; padding-left: 1rem; border-left: 1px solid var(--line); scrollbar-width: thin; }
.docs-toc > p:first-child { color: var(--muted); font-size: .78rem; font-weight: 600; letter-spacing: .02em; margin: 0 0 .5rem; }
.docs-toc ul { list-style: none; margin: 0 0 1.25rem; padding: 0; }
.docs-toc li { margin: 0; }
.docs-toc li a { display: block; padding: .22rem 0; color: var(--muted); text-decoration: none; line-height: 1.4; }
.docs-toc li a[aria-current] { color: var(--jelly-deep); font-weight: 600; }
.docs-toc-agent { display: flex; flex-direction: column; gap: .35rem; margin: 0; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .82rem; }
.docs-toc-agent a { color: var(--muted); }

.docs-skip { position: fixed; top: .7rem; left: 1rem; z-index: 30; padding: .6rem 1rem; background: var(--ink); color: var(--bg); border-radius: 8px; transform: translateY(-200%); }
.docs-skip:focus { transform: none; }
.docs-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (hover: hover) {
  .docs-nav-group a:hover, #docs-results a:hover { background: color-mix(in oklch, var(--ink) 6%, transparent); }
  .docs-toc li a:hover, .docs-toc-agent a:hover { color: var(--ink); }
  .docs-action:hover, .docs-updated button:hover, .docs-pager a:hover { border-color: var(--muted); }
  .docs-cards li:hover { border-color: color-mix(in oklch, var(--jelly-deep) 55%, transparent); }
  .docs-copy:hover { background: color-mix(in oklch, var(--ink) 8%, transparent); }
  .docs-reading h2 a:hover::after, .docs-reading h3 a:hover::after { content: " #"; color: var(--muted); font-size: .8em; }
}
@media (prefers-reduced-motion: no-preference) {
  .docs-action, .docs-copy, .docs-pager a, .docs-cards li { transition: transform 150ms ease-out, border-color 150ms ease-out, background-color 150ms ease-out; }
  .docs-action:active, .docs-copy:active { transform: scale(.96); }
  html { scroll-behavior: smooth; }
}
@media (min-width: 60rem) { .docs-menu:not([open]) > nav { display: block; } }
@media (max-width: 72rem) {
  .docs-layout { grid-template-columns: 14rem minmax(0, 1fr); }
  .docs-toc { display: none; }
}
@media (max-width: 60rem) {
  .docs-page main { padding-top: 1.25rem; }
  .docs-layout { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .docs-sidebar { position: static; max-height: none; overflow: visible; padding: 0; }
  .docs-menu { border-block: 1px solid var(--line); }
  .docs-menu summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem .15rem; cursor: pointer; font-weight: 600; list-style: none; }
  .docs-menu summary::-webkit-details-marker { display: none; }
  .docs-menu[open] summary span { transform: rotate(180deg); }
  .docs-menu nav { padding: .5rem .6rem 1.2rem; columns: 2 12rem; column-gap: 2rem; }
  .docs-nav-group { break-inside: avoid; margin-bottom: 1.2rem; }
  .docs-nav-group + .docs-nav-group { margin-top: 0; }
  .docs-search { margin-bottom: 1rem; }
  .docs-search input { padding-block: .75rem; font-size: 1rem; }
  .docs-search-field kbd { display: none; }
  .docs-updated { flex-direction: row; align-items: center; justify-content: space-between; border-top: 0; margin-top: .8rem; padding-top: 0; }
  .docs-reading { max-width: none; }
}
@media (max-width: 38rem) {
  .docs-page .bar nav { gap: .15rem .875rem; }
  .docs-page .bar nav a[href$="/security"] { display: none; }
  .docs-page h1 { font-size: 2.2rem; }
  .docs-summary { font-size: 1.05rem; }
  .docs-reading h2 { font-size: 1.45rem; }
  .docs-code pre { padding: .85rem; }
  .docs-table table { font-size: .87rem; }
  .docs-pager { grid-template-columns: 1fr; }
  .docs-pager a[rel="next"] { text-align: left; }
}
@media print {
  .docs-page .bar, .docs-sidebar, .docs-toc, .docs-actions, .docs-copy, .docs-page .foot, .docs-pager { display: none !important; }
  .docs-page main { padding: 0; max-width: none; }
  .docs-layout { display: block; }
  .docs-reading { max-width: none; }
  .docs-code pre, .docs-code pre code { white-space: pre-wrap; overflow-wrap: anywhere; }
}
