/* Developer docs: compact teal band with tabs, then a three-column layout
   (section nav | content | "On this page") on white. */
.docs-band { padding-bottom: 0; }
.docs-band-in { max-width: 1440px; margin: 0 auto; padding: 22px 32px 0; color: #fff; }
.docs-band-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; }
.docs-home { font-size: 1.35rem; font-weight: 650; letter-spacing: -0.02em; color: #fff; text-decoration: none; }
.docs-stamp { font-size: .82rem; opacity: .8; }
.docs-band-row { align-items: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Search (client-side, index built by scripts/build.js). */
.docs-search { position: relative; flex: 1 1 260px; max-width: 420px; margin-right: auto; z-index: 40; }
.docs-search input { width: 100%; font: inherit; font-size: .92rem; color: #fff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22); border-radius: 10px; padding: 8px 36px 8px 12px; outline: none; -webkit-appearance: none; appearance: none; }
.docs-search input::placeholder { color: rgba(255,255,255,.6); }
.docs-search input:focus { background: rgba(255,255,255,.16); border-color: #9fe0da; }
.docs-search input::-webkit-search-cancel-button { display: none; }
.docs-search-key { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font: inherit; font-size: .72rem; font-weight: 650; color: rgba(255,255,255,.7); border: 1px solid rgba(255,255,255,.3); border-radius: 5px; padding: 0 6px; line-height: 1.5; pointer-events: none; }
.docs-search input:focus ~ .docs-search-key { display: none; }
.docs-search-results { position: absolute; left: 0; top: calc(100% + 6px); width: min(560px, calc(100vw - 40px)); max-height: min(70vh, 520px); overflow-y: auto; list-style: none; margin: 0; padding: 6px; background: #fff; color: #111; border: 1px solid #e3e3e0; border-radius: 12px; box-shadow: 0 18px 48px rgba(0,0,0,.28); }
.docs-search-results li a { display: block; padding: 9px 12px; border-radius: 8px; color: #111; text-decoration: none; }
.docs-search-results li a:hover, .docs-search-results li.active a { background: #eef6f5; }
.docs-search-results .ds-where { display: block; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: #0b6b6d; font-weight: 650; }
.docs-search-results b { display: block; font-weight: 650; font-size: .95rem; margin-top: 2px; }
.docs-search-results .ds-snip { display: block; font-size: .85rem; color: #555; line-height: 1.45; margin-top: 2px; }
.docs-search-results mark { background: #c9ece8; color: inherit; border-radius: 2px; padding: 0 1px; }
.docs-search-results .ds-where mark { background: none; color: inherit; }
.docs-search-empty { padding: 12px; font-size: .9rem; color: #666; }
.docs-stamp a { color: #9fe0da; text-decoration: none; font-weight: 550; }
.docs-stamp a:hover { color: #fff; }
.docs-tabs { display: flex; gap: 4px; margin-top: 18px; overflow-x: auto; scrollbar-width: none; }
.docs-tabs::-webkit-scrollbar { display: none; }
.docs-tabs a { flex: none; padding: 10px 16px 12px; color: rgba(255,255,255,.78); text-decoration: none; font-weight: 550; font-size: .95rem; border-radius: 10px 10px 0 0; white-space: nowrap; }
.docs-tabs a:hover { color: #fff; background: rgba(255,255,255,.08); }
.docs-tabs a[aria-current="page"] { background: #fff; color: #0b6b6d; }

.docs-shell {
  flex: 1; background: #fff; color: #111;
  display: grid; grid-template-columns: 240px minmax(0, 1fr) 220px; gap: 48px;
  max-width: 1440px; width: 100%; margin: 0 auto; padding: 40px 32px 110px; align-items: start;
}
.docs-shell.no-toc { grid-template-columns: 240px minmax(0, 1fr); }
/* The white panel spans the full width even though the grid is capped. */
body:has(.docs-shell) { background: #fff; }
.docs-shell a { color: #0b6b6d; text-decoration: none; font-weight: 550; }
.docs-shell a:hover { color: #000; }

.docs-side, .docs-toc { position: sticky; top: 88px; max-height: calc(100vh - 104px); overflow-y: auto; }
.docs-side { display: flex; flex-direction: column; gap: 2px; }
.docs-nav-label { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: #777; margin: 18px 0 6px 12px; font-weight: 650; }
.docs-side .docs-nav-label:first-child { margin-top: 0; }
.docs-side a { display: block; padding: 7px 12px; border-radius: 8px; color: #333; font-size: .94rem; }
.docs-side a:hover { background: #f2f2f0; color: #0b6b6d; }
.docs-side a[aria-current="page"] { background: #e7f4f3; color: #0b6b6d; }
.docs-menu-btn { display: none; }

.docs-toc .docs-nav-label { margin-left: 0; }
.docs-toc ul, .toc-mobile ul { list-style: none; padding: 0; }
.docs-toc li a, .toc-mobile li a { display: block; padding: 4px 0; color: #555; font-weight: 450; font-size: .86rem; line-height: 1.4; }
.docs-toc li.toc-h3 a, .toc-mobile li.toc-h3 a { padding-left: 12px; font-size: .83rem; }
.docs-toc li a:hover, .toc-mobile li a:hover { color: #0b6b6d; }
.docs-toc code, .toc-mobile code { font-size: .92em; background: none; padding: 0; }
.docs-toc { border-left: 1px solid #e7e7e3; padding-left: 18px; }
.toc-mobile { display: none; }

.docs-main { min-width: 0; max-width: 820px; }
.docs-head { margin-bottom: 32px; }
.docs-kick { font-size: .85rem; font-weight: 600; color: #0b6b6d; }
.docs-head h1 { font-size: clamp(1.9rem, 3.6vw, 2.6rem); letter-spacing: -0.04em; line-height: 1.1; margin-top: 6px; max-width: none; text-wrap: pretty; }
.docs-dek { margin-top: 12px; font-size: 1.12rem; color: #444; max-width: 42rem; }
.docs-source { display: inline-block; margin-top: 12px; font-size: .88rem; }

/* Prose */
.docs-prose { max-width: none; margin: 0; padding: 0; color: #1a1a1a; font-size: 1.02rem; line-height: 1.72; }
.docs-prose > * + * { margin-top: 1em; }
.docs-prose > *:first-child { margin-top: 0; }
.docs-prose h2 { font-size: 1.5rem; letter-spacing: -0.03em; line-height: 1.25; margin-top: 2.2em; padding-top: .2em; max-width: none; text-wrap: pretty; }
.docs-prose h3, .docs-prose h4 { max-width: none; }
.docs-prose h3 { font-size: 1.14rem; letter-spacing: -0.015em; line-height: 1.35; margin-top: 2em; }
.docs-prose h4 { font-size: 1rem; margin-top: 1.6em; }
.docs-prose h2, .docs-prose h3, .docs-prose h4 { scroll-margin-top: 88px; position: relative; }
.docs-prose h2 + *, .docs-prose h3 + *, .docs-prose h4 + * { margin-top: .6em; }
.h-anchor { margin-left: .4em; color: #b9c9c8 !important; font-weight: 400; opacity: 0; transition: opacity .15s; text-decoration: none; }
h2:hover > .h-anchor, h3:hover > .h-anchor, h4:hover > .h-anchor, .h-anchor:focus { opacity: 1; }
.docs-prose ul, .docs-prose ol { padding-left: 1.3em; }
.docs-prose li + li { margin-top: .4em; }
.docs-prose li > ul, .docs-prose li > ol { margin-top: .4em; }
.docs-prose code { font-size: .88em; background: #f0f0ee; color: #111; padding: 1px 6px; border-radius: 4px; overflow-wrap: anywhere; }
.docs-prose a code { color: inherit; }
.code-wrap { position: relative; margin: 1.3em 0; }
.docs-prose pre { background: #1b1e25; color: #e8e8e6; border-radius: 10px; padding: 16px 18px; overflow-x: auto; font-size: .86rem; line-height: 1.6; margin: 1.3em 0; }
.code-wrap pre { margin: 0; }
.docs-prose pre code { background: transparent; color: inherit; padding: 0; border-radius: 0; font-size: inherit; overflow-wrap: normal; }
.copy-btn { position: absolute; top: 8px; right: 8px; font: inherit; font-size: .75rem; font-weight: 600; color: #cfd2d6; background: #2b2f38; border: 1px solid #3a3f4a; border-radius: 6px; padding: 3px 9px; cursor: pointer; opacity: 0; transition: opacity .15s; }
.code-wrap:hover .copy-btn, .copy-btn:focus { opacity: 1; }
@media (hover: none) { .copy-btn { opacity: 1; } }
.copy-btn.ok { opacity: 1; color: #9fe0da; border-color: #2f6f6b; }
.copy-btn.err { opacity: 1; color: #f0c27a; }
.code-lang { position: absolute; top: 9px; right: 70px; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: #8a909a; pointer-events: none; opacity: 1; transition: opacity .15s; }
.code-wrap:hover .code-lang { opacity: 0; }
@media (hover: none) { .code-lang { display: none; } }
.docs-prose .h-anchor.copied { opacity: 1; }
.docs-prose .h-anchor.copied::after { content: "Link copied"; margin-left: 8px; font-size: .72rem; font-weight: 600; letter-spacing: 0; color: #0b6b6d; }
.docs-prose table { width: 100%; border-collapse: collapse; font-size: .93rem; margin: 1.3em 0; display: block; overflow-x: auto; }
.docs-prose th, .docs-prose td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid #e3e3e0; }
.docs-prose th { font-weight: 650; color: #111; border-bottom-color: #ccc; white-space: nowrap; }
.docs-prose blockquote { margin: 1.3em 0; padding: 12px 16px; border-left: 3px solid #0b6b6d; background: #f4f8f8; color: #333; border-radius: 0 8px 8px 0; }
.docs-prose blockquote > *:first-child { margin-top: 0; }
.docs-prose hr { border: 0; border-top: 1px solid #e3e3e0; margin: 2.4em 0; }
.docs-prose details { border: 1px solid #e3e3e0; border-radius: 10px; padding: 12px 16px; }
.docs-prose details > summary { cursor: pointer; font-weight: 600; }
.docs-prose details[open] > summary { margin-bottom: .6em; }
.docs-prose details > * + * { margin-top: .9em; }

/* Status badges (SWIP status, issue kinds) */
.badge { display: inline-block; vertical-align: middle; font-size: .7rem; font-weight: 650; letter-spacing: .02em; line-height: 1.5; padding: 1px 8px; border-radius: 999px; margin-left: 6px; white-space: nowrap; text-decoration: none; }
p .badge, li .badge, td .badge { margin-left: 0; }
a.badge:hover { filter: brightness(.95); }
.badge.swip { background: #e3f2ef; color: #0b5d55 !important; }
.badge.ext { background: #fff1d6; color: #7a4a00 !important; }
.badge.diverges { background: #fde6e1; color: #8a2a17 !important; }
.badge.kind-bug { background: #fde6e1; color: #8a2a17; }
.badge.kind-dx { background: #e6eefc; color: #1f3f86; }
.badge.kind-feature-request { background: #efe7fb; color: #4d2a86; }
.badge.community { background: #f0f0ee; color: #444; }
.badge.proposal { background: #fff1d6; color: #7a4a00; }
.badge.difficulty { background: #e3f2ef; color: #0b5d55; }

/* Cards (landing value points, Built with Freedom, examples) */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-top: 1.2em; }
.card-grid .dcard { border: 1px solid #e3e3e0; border-radius: 12px; padding: 18px 18px 16px; margin: 0; }
.card-grid .dcard h3 { margin: 0 0 6px; font-size: 1.02rem; }
.card-grid .dcard p { margin: 0; font-size: .93rem; color: #444; line-height: 1.6; }
.card-grid .dcard p + p { margin-top: 8px; }
.card-grid .dcard .dcard-links { font-size: .88rem; }
.docs-prose .lead { font-size: 1.15rem; color: #333; }

/* Open for contribution */
.issue-list { list-style: none; padding: 0 !important; display: grid; gap: 12px; }
.issue-list li + li { margin-top: 0; }
/* Grid items default to min-width:auto; let cards shrink and break long IDs (rad:z3…) instead of widening the page. */
.issue-card { min-width: 0; border: 1px solid #e3e3e0; border-radius: 12px; padding: 16px 18px; overflow-wrap: anywhere; }
.issue-title { font-size: 1.02rem; line-height: 1.4; }
.issue-num { color: #777; font-weight: 600; }
.issue-badges { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.issue-badges .badge { margin: 0; }
.issue-card p { margin-top: 8px; font-size: .95rem; color: #333; line-height: 1.6; }
.issue-card .issue-meta { font-size: .82rem; color: #777; margin-top: 6px; }

@media (max-width: 1240px) {
  .docs-shell { grid-template-columns: 220px minmax(0, 1fr) 200px; gap: 36px; }
  .docs-shell.no-toc { grid-template-columns: 220px minmax(0, 1fr); }
}
@media (max-width: 1023px) {
  .docs-band-in { padding: 18px 20px 0; }
  .docs-search { order: 3; flex-basis: 100%; max-width: none; margin-top: 4px; }
  .docs-search-key { display: none; }
  .docs-shell, .docs-shell.no-toc { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 20px 20px 90px; }
  .docs-toc { display: none; }
  .docs-shell:not(.no-toc) .toc-mobile { display: block; margin: -12px 0 28px; border: 1px solid #e3e3e0; border-radius: 10px; padding: 10px 14px; }
  .toc-mobile summary { cursor: pointer; font-weight: 600; font-size: .92rem; }
  .toc-mobile ul { margin-top: 8px; max-height: 50vh; overflow-y: auto; }
  .docs-side { position: static; max-height: none; overflow: visible; border: 1px solid #e3e3e0; border-radius: 10px; padding: 12px; margin-bottom: 24px; }
  .docs-side .docs-nav-label { margin-left: 4px; }
  .js .docs-menu-btn { display: flex; align-items: center; gap: 10px; width: 100%; font: inherit; font-weight: 600; font-size: .95rem; color: #111; background: #f4f4f2; border: 1px solid #e3e3e0; border-radius: 10px; padding: 10px 14px; cursor: pointer; margin-bottom: 20px; }
  .js .docs-side { display: none; }
  .js.nav-open .docs-side { display: flex; margin-top: -12px; }
  .docs-menu-icon, .docs-menu-icon::before, .docs-menu-icon::after { display: block; width: 14px; height: 2px; background: currentColor; border-radius: 1px; position: relative; }
  .docs-menu-icon::before, .docs-menu-icon::after { content: ""; position: absolute; left: 0; }
  .docs-menu-icon::before { top: -5px; }
  .docs-menu-icon::after { top: 5px; }
  .docs-head { margin-bottom: 24px; }
}
@media (max-width: 640px) {
  .docs-home { font-size: 1.15rem; }
  .docs-stamp { font-size: .76rem; }
  .docs-tabs { gap: 2px; }
  .docs-tabs a { padding: 9px 10px 11px; font-size: .9rem; }
  .docs-prose { font-size: 1rem; }
  .docs-prose pre { font-size: .82rem; padding: 14px; }
}
.issues-updated { display: inline-block; font-size: .85rem; color: #4a5160; background: #f1f4f6; border-radius: 6px; padding: .2rem .6rem; }
/* site.css styles every <nav> as the sticky blurred top bar; undo that for the docs navs */
nav.docs-side, nav.docs-tabs { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; z-index: auto; }
nav.docs-tabs { position: static; }
.card-grid .dcard .dcard-links code { white-space: nowrap; }
