/* The documentation shell: navigation, page, "On this page". Built pages: docs, guides, API reference. */
.docs { display: grid; grid-template-columns: 264px minmax(0, 1fr) 224px; gap: 56px; max-width: 1400px; margin: 0 auto; padding: 0 24px; }

/* Navigation */
.dnav { position: sticky; top: 64px; align-self: start; height: calc(100vh - 64px); overflow-y: auto; padding: 28px 16px 48px 0; border-right: 1px solid var(--line); font-size: 14px; scrollbar-width: thin; }
.dnav-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 18px; }
.dnav-home { font-weight: 650; color: var(--fg); text-decoration: none; font-size: 15px; }
.ver { font: 600 11.5px/1 "Geist Mono", ui-monospace, monospace; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 4px 8px; }
.dnav-group { margin-bottom: 20px; }
.dnav h2 { font: 600 11.5px/1 "Geist Mono", ui-monospace, monospace; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; padding-left: 10px; }
.dnav a { display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 6px; color: var(--muted); text-decoration: none; line-height: 1.4; }
.dnav a:hover { color: var(--fg); background: var(--bg-soft); }
.dnav a[aria-current="page"] { color: var(--brand); background: var(--accent-soft); font-weight: 600; }
.dnav a svg { width: 12px; height: 12px; opacity: .6; flex: none; }
.dnav-toggle { display: none; }

/* On this page */
.dtoc { position: sticky; top: 64px; align-self: start; max-height: calc(100vh - 64px); overflow-y: auto; padding: 40px 0 40px; font-size: 13.5px; }
.dtoc b { display: block; font: 600 11.5px/1 "Geist Mono", ui-monospace, monospace; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 12px; }
.dtoc a { display: block; color: var(--muted); text-decoration: none; padding: 4px 0 4px 12px; border-left: 2px solid var(--line); line-height: 1.4; }
.dtoc a.l3 { padding-left: 24px; font-size: 13px; }
.dtoc a:hover { color: var(--fg); }
.dtoc a.on { color: var(--brand); border-left-color: var(--brand); font-weight: 600; }
.dtoc .totop { margin-top: 14px; border-left: 0; padding-left: 0; font-size: 13px; }

/* The page */
.dmain { min-width: 0; padding: 36px 0 96px; }
.crumbs { font-size: 13.5px; color: var(--muted); margin: 0 0 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--fg); }
.crumbs > * + *::before { content: "/"; margin-right: 8px; opacity: .5; color: var(--muted); }
.dmain h1 { font-size: 40px; line-height: 1.12; letter-spacing: -0.035em; font-weight: 650; margin: 0 0 12px; }
.dmain .lead { font-size: 18px; color: var(--muted); margin: 0 0 20px; max-width: 760px; line-height: 1.6; }
.dmeta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 32px; font-size: 13.5px; color: var(--muted); }
.dmeta .facts { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.dmeta .facts span + span::before { content: ""; display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; margin-right: 16px; vertical-align: middle; }
.dmeta .acts { display: flex; gap: 6px; }
.act { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: 500 13px/1 inherit; font-family: inherit; padding: 7px 10px; border-radius: 7px; cursor: pointer; text-decoration: none; }
.act:hover { color: var(--fg); border-color: var(--line-strong); }
.act svg { width: 14px; height: 14px; }

.doc { max-width: 780px; font-size: 16.5px; line-height: 1.75; }
.doc > p, .doc li { color: color-mix(in srgb, var(--fg) 84%, var(--muted)); }
.doc h2 { font-size: 26px; line-height: 1.25; letter-spacing: -0.02em; font-weight: 650; margin: 52px 0 12px; scroll-margin-top: 84px; }
.doc h3 { font-size: 19px; font-weight: 600; margin: 32px 0 8px; scroll-margin-top: 84px; }
.doc h2 + p, .doc h3 + p { margin-top: 0; }
.doc .anchor { margin-left: 8px; color: var(--line-strong); text-decoration: none; font-weight: 500; opacity: 0; transition: opacity .15s; }
.doc h2:hover .anchor, .doc h3:hover .anchor, .doc .anchor:focus { opacity: 1; }
.doc a { color: var(--brand); }
.doc :not(pre) > code { font-size: .86em; background: var(--bg-soft); border: 1px solid var(--line); padding: .08em .38em; border-radius: 5px; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin: 4px 0; }
.doc .editor { margin: 20px 0 26px; }
.doc pre.code { font-size: 13.5px; line-height: 1.65; }
.editor .copy { margin-left: auto; border: 1px solid #2a3d32; background: transparent; color: #a9c2b3; font: 500 12px/1 "Geist Mono", ui-monospace, monospace; padding: 6px 10px; border-radius: 6px; cursor: pointer; }
.editor .copy:hover { color: #fff; border-color: #4a6b58; }
.doc figure { margin: 24px 0 30px; }
.doc figure img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow-sm); }
.doc figcaption { color: var(--muted); font-size: 14px; margin-top: 10px; }
.doc .tw { overflow-x: auto; margin: 16px 0 26px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.doc th, .doc td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc thead th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: var(--bg-soft); }
.doc blockquote { margin: 24px 0; padding: 14px 18px 14px 46px; border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line)); background: var(--accent-soft); border-radius: 10px; position: relative; }
.doc blockquote::before { content: "i"; position: absolute; left: 16px; top: 15px; width: 18px; height: 18px; border-radius: 50%; background: var(--brand); color: var(--on-brand); font: 700 12px/18px Georgia, serif; text-align: center; }
.doc blockquote p { margin: 0; color: var(--fg); }

/* Live example card, feedback and pager */
.live-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 36px 0 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-soft); text-decoration: none; color: var(--fg); }
.live-card:hover { border-color: var(--line-strong); }
.live-card b { display: block; font-weight: 600; }
.live-card span { color: var(--muted); font-size: 14px; }
.live-card i { font-style: normal; color: var(--brand); font-weight: 600; white-space: nowrap; }
.feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 44px 0 0; padding-top: 22px; border-top: 1px solid var(--line); font-size: 14.5px; color: var(--muted); }
.feedback button { border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: 500 13.5px/1 inherit; font-family: inherit; padding: 7px 14px; border-radius: 7px; cursor: pointer; }
.feedback button:hover { border-color: var(--line-strong); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 28px; }
.pg { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; }
.pg:hover { border-color: var(--line-strong); background: var(--bg-soft); }
.pg span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.pg b { color: var(--fg); font-weight: 600; }
.pg.next { text-align: right; }

/* Docs home */
.dhero { padding: 8px 0 28px; }
.dhero h1 { font-size: 46px; }
.dgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 36px 0; }
.dcard { border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; background: var(--surface); }
.dcard h2 { font-size: 17px; margin: 0 0 4px; font-weight: 650; letter-spacing: -0.01em; }
.dcard h2 a { color: var(--fg); text-decoration: none; }
.dcard p { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.dcard ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: 14.5px; }
.dcard li a { color: var(--brand); text-decoration: none; }
.dcard li a:hover { text-decoration: underline; }
.dcard .more { color: var(--muted); font-size: 13.5px; }
.tested { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.tested span { font: 500 12.5px/1 "Geist Mono", ui-monospace, monospace; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; background: var(--surface); }

/* API reference */
.api-entry { padding: 28px 0 8px; border-top: 1px solid var(--line); margin-top: 28px; scroll-margin-top: 76px; }
.api-entry:first-of-type { border-top: 0; margin-top: 0; }
.api-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.api-head h2 { margin: 0 !important; font-size: 21px !important; }
.api-head h2 code { font-family: "Geist Mono", ui-monospace, monospace; background: none !important; border: 0 !important; padding: 0 !important; font-size: 1em !important; }
.kind { font: 600 11px/1 "Geist Mono", ui-monospace, monospace; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 4px 8px; }
.api-entry h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 22px 0 6px; font-weight: 600; }
.api-entry table td:first-child { white-space: nowrap; }
.api-entry table code { font-size: 12.5px; }
.api-entry td code.ty { white-space: pre-wrap; word-break: break-word; }
.opt { color: var(--muted); font-size: 12px; margin-left: 4px; }
.src { font-size: 13px; color: var(--muted); }

/* Guides */
.try { margin: 52px 0 0; padding: 26px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-soft); display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; }
.try h2 { margin: 0 0 6px !important; font-size: 21px !important; }
.try p { margin: 0 !important; color: var(--muted) !important; font-size: 15px; }
.try .buttons { margin: 0; }
.guide-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin: 18px 0; }
.guide-cards.three { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 1180px) {
  .docs { grid-template-columns: 240px minmax(0, 1fr); gap: 40px; }
  .dtoc { display: none; }
}
@media (max-width: 860px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0 16px; }
  .dnav-toggle { display: inline-flex; align-items: center; gap: 8px; position: sticky; top: 64px; z-index: 15; width: 100%; padding: 10px 16px; border: 0; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(8px); color: var(--fg); font: 600 14px/1 inherit; font-family: inherit; cursor: pointer; }
  .dnav-toggle svg { width: 18px; height: 18px; }
  .dnav { display: none; position: fixed; z-index: 30; inset: 64px 0 0 0; height: auto; background: var(--bg); padding: 20px 20px 60px; border-right: 0; }
  .dnav.open { display: block; }
  .dmain { padding-top: 24px; }
  .dmain h1, .dhero h1 { font-size: 32px; }
  .dgrid, .guide-cards, .guide-cards.three { grid-template-columns: 1fr; }
  .try { grid-template-columns: 1fr; }
  .pager { grid-template-columns: 1fr; }
  .pg.next { text-align: left; }
}
.api-entry table th:nth-child(2) { width: 40%; }

.doc kbd { font: 500 .8em/1 "Geist Mono", ui-monospace, monospace; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 2px 6px; background: var(--surface); color: var(--fg); }

/* Print: the page only, code wrapped, no navigation */
@media print {
  header.top, .announce, .dnav, .dtoc, .dnav-toggle, footer.site, .feedback, .pager, .dmeta .acts, .editor .copy, .try, .live-card, .guide-cards { display: none !important; }
  .docs { display: block; padding: 0; max-width: none; }
  .dmain { padding: 0; }
  .doc { max-width: none; font-size: 11pt; }
  .editor { break-inside: avoid; box-shadow: none; }
  pre.code { white-space: pre-wrap; }
  .doc a { color: inherit; text-decoration: underline; }
}
