/* woolshed.dev/docs: the docs pages (ops/site/docs.py). Uses the site's tokens from style.css, so light, dark and 98 all work. */
.docspage { flex: 1; }
.ds-shell { max-width: 1380px; margin: 0 auto; padding: 32px 28px 72px; display: grid; grid-template-columns: 248px minmax(0, 1fr) 208px; gap: 48px; align-items: start; }
.ds-vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* Sidebar */
.ds-side { position: sticky; top: 82px; z-index: 10; display: flex; flex-direction: column; gap: 4px; max-height: calc(100vh - 98px); padding: 2px 4px 0 2px; }
.ds-menu { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding-bottom: 24px; }
.ds-menu > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-weight: 600; font-size: 15px; color: var(--fg); }
.ds-menu > summary::-webkit-details-marker { display: none; }
.ds-menu > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--mute); border-bottom: 2px solid var(--mute); transform: rotate(45deg) translateY(-2px); }
.ds-menu[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
html.js .ds-menu > summary { display: none; }
.ds-nav { padding-top: 14px; font-size: 14.5px; }
.ds-nav ul { list-style: none; margin: 0 0 14px; padding: 0; }
.ds-nav a { display: block; padding: 5px 10px; border-radius: 7px; color: var(--mute); text-decoration: none; line-height: 1.35; }
.ds-nav a:hover { color: var(--fg); background: var(--bg-2); }
.ds-nav a[aria-current="page"] { color: var(--fg); background: var(--panel); box-shadow: inset 2px 0 0 var(--accent); font-weight: 600; }
.ds-nav .ds-home { margin-bottom: 10px; font-weight: 600; }
.ds-gh { margin: 10px 10px 4px; font: 600 11.5px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--mute); }

/* Search */
.ds-search { position: relative; }
.ds-search input { width: 100%; height: 40px; padding: 0 34px 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--fg); font: inherit; font-size: 15px; -webkit-appearance: none; appearance: none; }
.ds-search input::placeholder { color: var(--mute); opacity: 1; }
.ds-search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.ds-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.ds-key { position: absolute; right: 9px; top: 9px; height: 22px; min-width: 20px; padding: 0 6px; display: grid; place-items: center; font: 600 12px/1 var(--mono); color: var(--mute); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--bg-2); pointer-events: none; }
.ds-search input:focus ~ .ds-key, .ds-search input:not(:placeholder-shown) ~ .ds-key { display: none; }
.ds-search.big { margin: 26px 0 8px; max-width: 640px; }
.ds-search.big input { height: 52px; font-size: 17px; padding-left: 16px; border-radius: 12px; }
.ds-search.big .ds-key { top: 14px; right: 13px; }
.ds-results { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: min(560px, calc(100vw - 32px)); max-height: min(70vh, 560px); overflow-y: auto; margin: 0; padding: 6px; list-style: none; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .55); }
.ds-search.big .ds-results { width: 100%; }
.ds-results li { padding: 9px 11px; border-radius: 8px; cursor: pointer; }
.ds-results li[aria-selected="true"] { background: var(--bg-2); box-shadow: inset 2px 0 0 var(--accent); }
.ds-results li[aria-disabled="true"] { cursor: default; color: var(--mute); }
.ds-r-t { display: block; font-weight: 600; font-size: 14.5px; color: var(--fg); line-height: 1.35; }
.ds-r-t span { color: var(--mute); font-weight: 500; }
.ds-r-x { display: block; margin-top: 3px; font-size: 13.5px; line-height: 1.45; color: var(--mute); }
.ds-results mark { background: color-mix(in srgb, var(--accent) 26%, transparent); color: var(--fg); border-radius: 3px; padding: 0 1px; }

/* Content */
.ds-main { min-width: 0; max-width: 800px; }
.ds-crumbs { font-size: 13.5px; color: var(--mute); margin-bottom: 18px; }
.ds-crumbs a { color: var(--mute); }
.ds-crumbs a:hover { color: var(--fg); }
.ds-main h1 { font-size: clamp(32px, 3.6vw, 46px); line-height: 1.08; letter-spacing: -.03em; margin: 0 0 14px; overflow-wrap: anywhere; }
.ds-lede { font-size: 19px; line-height: 1.55; color: var(--mute); margin: 0 0 8px; max-width: 46em; }
.ds-lede a, .ds-body a, .ds-note a, .ds-card span a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.ds-body { font-size: 16.5px; line-height: 1.68; color: var(--fg); }
.ds-body > * + * { margin-top: 14px; }
.ds-body h2 { font-size: 27px; line-height: 1.2; letter-spacing: -.02em; margin-top: 44px; padding-top: 6px; }
.ds-body h3 { font-size: 20px; line-height: 1.3; margin-top: 32px; }
.ds-body h4, .ds-body h5 { font-size: 17px; margin-top: 24px; }
.ds-body > :first-child { margin-top: 26px; }
.ds-body ul, .ds-body ol { padding-left: 22px; }
.ds-body li + li { margin-top: 9px; }
.ds-body li > ul, .ds-body li > ol, .ds-body li > pre, .ds-body li > blockquote, .ds-body li > p, .ds-body li > .ds-table { margin-top: 9px; }
.ds-body li::marker { color: var(--mute); }
.ds-body p, .ds-body li { overflow-wrap: break-word; }
.ds-body strong { font-weight: 650; }
.ds-body code, .ds-note code, .ds-lede code, .ds-card code, .ds-r-x code { font: .86em/1.4 var(--mono); background: var(--bg-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; overflow-wrap: anywhere; }
.ds-pre { margin: 14px 0 0; padding: 14px 16px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; font: 13.5px/1.62 var(--mono); white-space: pre; tab-size: 2; }
.ds-pre code { background: none; border: 0; padding: 0; font: inherit; overflow-wrap: normal; }
.ds-body blockquote { margin-left: 0; padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--bg-2); border-radius: 0 10px 10px 0; color: var(--fg); }
.ds-body blockquote > * + * { margin-top: 8px; }
.ds-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.ds-table table { border-collapse: collapse; width: 100%; font-size: 14.5px; line-height: 1.5; }
.ds-table th, .ds-table td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.ds-table th { background: var(--bg-2); font-weight: 600; white-space: nowrap; }
.ds-table tr:last-child td { border-bottom: 0; }
.ds-table td code { overflow-wrap: normal; white-space: nowrap; }
.ds-pre:focus-visible, .ds-table:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ds-note { margin: 40px 0 0; padding: 14px 16px; border-left: 3px solid var(--accent); background: var(--bg-2); border-radius: 0 10px 10px 0; font-size: 14.5px; line-height: 1.6; color: var(--mute); }

/* Clips and pictures */
.ds-media { position: relative; margin: 24px 0 6px; }
.ds-media video, .ds-media > img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); }
.ds-media figcaption { margin-top: 9px; font-size: 14px; line-height: 1.5; color: var(--mute); }
.ds-clip-btn { position: absolute; top: 10px; right: 10px; z-index: 2; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(8, 19, 14, .78); color: #fff; font: 600 12.5px/1 var(--sans); cursor: pointer; }
.ds-clip-btn:hover { background: rgba(8, 19, 14, .92); }
.ds-phones { display: flex; gap: 18px; flex-wrap: wrap; }
.ds-phone { margin: 0; width: min(200px, calc(50% - 9px)); }
.ds-phone img { display: block; width: 100%; height: auto; border-radius: 22px; border: 1px solid var(--line); }

/* Previous and next */
.ds-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 36px; }
.ds-pager a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--fg); font-weight: 600; line-height: 1.35; }
.ds-pager a:hover { border-color: var(--accent); }
.ds-pager small { display: block; font-weight: 500; font-size: 12.5px; color: var(--mute); margin-bottom: 3px; }
.ds-pager .next { text-align: right; grid-column: 2; }

/* On this page */
.ds-toc { position: sticky; top: 82px; max-height: calc(100vh - 98px); overflow-y: auto; font-size: 13.5px; padding-bottom: 24px; }
.ds-toc-h { font: 600 11.5px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--mute); margin: 4px 0 10px; }
.ds-toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.ds-toc a { display: block; padding: 4px 0 4px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--mute); text-decoration: none; line-height: 1.4; }
.ds-toc a:hover { color: var(--fg); }
.ds-toc a.on { color: var(--fg); border-left-color: var(--accent); }

/* Overview */
.ds-overview .ds-main h2 { font-size: 27px; letter-spacing: -.02em; margin: 44px 0 16px; }
.ds-cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ds-card { display: block; height: 100%; padding: 18px 18px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); text-decoration: none; color: var(--fg); }
.ds-card:hover { border-color: var(--accent); }
.ds-card b { display: block; font-size: 17px; margin-bottom: 6px; }
.ds-card span { display: block; font-size: 14.5px; line-height: 1.55; color: var(--mute); }
.ds-topics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 32px; }
.ds-group h3 { font: 600 12px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--accent); margin: 18px 0 8px; }
.ds-group ul { list-style: none; padding: 0; margin: 0; }
.ds-group li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.ds-group li a { font-weight: 600; color: var(--fg); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.ds-group li a:hover { text-decoration-color: var(--accent); }
.ds-group li span { display: block; margin-top: 3px; font-size: 14px; line-height: 1.5; color: var(--mute); }

@media (max-width: 1199px) {
  .ds-shell { grid-template-columns: 232px minmax(0, 1fr); gap: 40px; }
  .ds-toc { display: none; }
}
@media (max-width: 859px) {
  .ds-shell { display: block; padding: 16px 16px 56px; }
  .ds-side { position: relative; max-height: none; padding: 0; margin-bottom: 22px; display: grid; gap: 10px; }
  .ds-menu { overflow: visible; padding-bottom: 0; }
  html.js .ds-menu > summary { display: flex; }
  .ds-menu[open] .ds-nav { margin-top: 6px; padding: 10px 6px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
  .ds-results { width: calc(100vw - 32px); }
  .ds-key { display: none; }
  .ds-cards, .ds-topics { grid-template-columns: minmax(0, 1fr); }
  .ds-pager { grid-template-columns: minmax(0, 1fr); }
  .ds-pager .next { grid-column: 1; }
  .ds-lede { font-size: 17.5px; }
  .ds-body { font-size: 16px; }
  .ds-body h2 { font-size: 23px; }
}

/* Woolshed 98: the docs sit on a grey window so text keeps its contrast on the teal desktop. */
[data-theme="98"] .ds-shell { background: var(--panel); border: 2px solid; border-color: #fff #404040 #404040 #fff; margin-top: 16px; margin-bottom: 16px; }
[data-theme="98"] .docspage .kicker { color: var(--accent) !important; text-shadow: none !important; }
[data-theme="98"] .ds-search input, [data-theme="98"] .ds-results, [data-theme="98"] .ds-card, [data-theme="98"] .ds-menu > summary { background: #fff; border-radius: 0; }
[data-theme="98"] .docspage code, [data-theme="98"] .ds-pre, [data-theme="98"] .ds-note, [data-theme="98"] .ds-body blockquote, [data-theme="98"] .ds-table th { background: var(--panel-2); }
[data-theme="98"] .ds-nav a[aria-current="page"] { background: #000080; color: #fff; box-shadow: none; }
[data-theme="98"] .ds-results li[aria-selected="true"] { background: #000080; color: #fff; }
[data-theme="98"] .ds-results li[aria-selected="true"] * { color: #fff; }
[data-theme="98"] .ds-media video, [data-theme="98"] .ds-media > img, [data-theme="98"] .ds-phone img { border-radius: 0; }
@media (prefers-reduced-motion: reduce) { .ds-menu > summary::after { transition: none; } }
[data-theme="98"] .docspage a:not(.pill):not(.brand) { color: #0000ee !important; }
[data-theme="98"] .docspage .ds-nav a[aria-current="page"] { color: #fff !important; }
[data-theme="98"] .docspage h1 { color: #000 !important; text-shadow: none !important; }
[data-theme="98"] .docspage .ds-pre code { background: none; border: 0; color: inherit; }
