/* Pressmark docs: header with search and tabs, grouped sidebar, article, "On this page". Uses the tokens in site.css. */
.docs .site-header { border-bottom-color: var(--line); }
.docs-bar { gap: 16px; }
.docs-tabs-row.wrap { height: 44px; }
.i { width: 16px; height: 16px; flex: none; }
kbd { font: 500 11.5px/1 var(--ui); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 3px 6px; background: var(--paper); color: var(--ink-2); }

.docs-badge { font: 600 12px/1 var(--ui); color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 5px 9px; text-decoration: none; margin-left: -6px; }
.docs-badge:hover { color: var(--ink); text-decoration: none; }
.docs-search-btn { flex: 1; max-width: 380px; margin: 0 auto; display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 8px 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2); color: var(--ink-2); font: 400 14px var(--ui); cursor: pointer; }
.docs-search-btn:hover { border-color: var(--ink-2); }
.docs-search-btn span { flex: 1; text-align: left; }
.docs .header-actions { margin-left: 0; }
.docs-contact { font-size: 14px; color: var(--ink-2); white-space: nowrap; margin-right: 4px; }
.docs-contact:hover { color: var(--ink); }
.docs-menu { display: none; width: 38px; height: 38px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); cursor: pointer; flex: none; }

.docs-tabs { display: flex; gap: 24px; align-self: stretch; }
.docs-tabs a { display: flex; align-items: center; font-size: 14px; color: var(--ink-2); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.docs-tabs a:hover { color: var(--ink); text-decoration: none; }
.docs-tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--ember); font-weight: 550; }

.docs-shell { display: grid; grid-template-columns: 240px minmax(0, 1fr) 200px; gap: 48px; align-items: start; }
.docs-shell:has(.docs-home-hero) { grid-template-columns: 240px minmax(0, 1fr); }
.docs-shell:has(.docs-home-hero) .docs-toc { display: none; }

.docs-nav { position: sticky; top: 110px; max-height: calc(100vh - 110px); overflow-y: auto; padding: 32px 4px 48px 0; font-size: 14px; overscroll-behavior: contain; }
.nav-group + .nav-group { margin-top: 22px; }
.nav-group-title { display: flex; gap: 8px; align-items: center; font-weight: 600; color: var(--ink); margin: 0 0 6px; font-size: 13.5px; }
.nav-group-title .i { color: var(--ink-2); }
.nav-group ul { list-style: none; margin: 0 0 0 7px; padding: 0; border-left: 1px solid var(--line); }
.nav-group a { display: block; padding: 5px 0 5px 15px; margin-left: -1px; border-left: 2px solid transparent; color: var(--ink-2); text-decoration: none; line-height: 1.4; }
.nav-group a:hover { color: var(--ink); text-decoration: none; }
.nav-group a[aria-current] { color: var(--ember); border-left-color: var(--ember); font-weight: 550; }

.docs-main { padding: 40px 0 80px; min-width: 0; max-width: 720px; }
.docs-shell:has(.docs-home-hero) .docs-main { max-width: none; }
.docs-eyebrow { font: 600 13px/1.4 var(--ui); color: var(--ember); margin: 0 0 8px; }
.docs-title-row { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; }
.docs-head h1, .docs-home-hero h1 { font-family: var(--reading); font-size: clamp(30px, 4vw, 42px); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 12px; text-wrap: balance; }
.docs-head .lede { color: var(--ink-2); font-size: 18px; line-height: 1.55; margin: 0 0 28px; padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.copy-page { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink-2); font: 500 13px var(--ui); cursor: pointer; margin-top: 8px; }
.copy-page:hover { color: var(--ink); border-color: var(--ink-2); }

.docs-body { font-size: 16px; line-height: 1.7; }
.docs-body h2 { font-family: var(--reading); font-size: 26px; line-height: 1.25; letter-spacing: -0.01em; margin: 44px 0 12px; scroll-margin-top: 124px; }
.docs-body h3 { font-size: 17px; line-height: 1.35; margin: 28px 0 8px; scroll-margin-top: 124px; }
.docs-body > :first-child { margin-top: 0; }
.docs-body p, .docs-body ul, .docs-body ol { margin: 0 0 16px; }
.docs-body ul, .docs-body ol { padding-left: 22px; }
.docs-body li { margin-bottom: 6px; }
.docs-body li > p { margin: 0; }
.docs-body strong { font-weight: 600; }
.docs-body a { color: var(--ember); text-underline-offset: 3px; }
.docs-body code { font: 0.88em var(--mono); background: var(--paper-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; overflow-wrap: anywhere; }
.docs-body pre { background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow-x: auto; margin: 0 0 18px; line-height: 1.55; }
.docs-body pre code { border: 0; padding: 0; background: none; font-size: 13.5px; overflow-wrap: normal; }
.anchor { margin-left: 8px; color: var(--ink-2); opacity: 0; text-decoration: none; font-weight: 400; }
.docs-body h2:hover .anchor, .docs-body h3:hover .anchor, .anchor:focus-visible { opacity: 1; }
.table-wrap { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--line); border-radius: 10px; }
.docs-body table { border-collapse: collapse; width: 100%; font-size: 14.5px; line-height: 1.5; }
.docs-body th, .docs-body td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.docs-body th { background: var(--paper-2); font-weight: 600; }
.docs-body tr:last-child td { border-bottom: 0; }

.docs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 56px; }
.pager { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); }
.pager:hover { border-color: var(--ember); text-decoration: none; }
.pager span { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.pager b { font-weight: 550; }
.pager.next { align-items: flex-end; text-align: right; }
.docs-stuck { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 32px; color: var(--ink-2); font-size: 14px; }
.docs-stuck .i { margin-right: 2px; }

.docs-toc { position: sticky; top: 110px; padding: 40px 0; font-size: 13.5px; }
.toc-title { font-weight: 600; margin: 0 0 10px; }
.docs-toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.docs-toc a { display: block; padding: 4px 0 4px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--ink-2); text-decoration: none; line-height: 1.4; }
.docs-toc a:hover { color: var(--ink); text-decoration: none; }
.docs-toc a.is-active { color: var(--ember); border-left-color: var(--ember); }

/* Docs home */
.docs-home-hero { padding: 8px 0 28px; }
.docs-home-hero .lede { color: var(--ink-2); font-size: 18px; max-width: 620px; margin: 0 0 20px; }
.home-search { width: 100%; max-width: 560px; display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 12px 0 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: var(--shadow); color: var(--ink-2); font: 400 16px var(--ui); cursor: pointer; margin: 0 0 20px; }
.home-search:hover { border-color: var(--ink-2); }
.home-search span { flex: 1; text-align: left; }
.home-search .i { width: 18px; height: 18px; }
.home-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.home-quick a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; color: var(--ink); text-decoration: none; background: var(--paper); }
.home-quick a:hover { border-color: var(--ink-2); text-decoration: none; }
.home-quick .i { color: var(--ember); }
.home-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.home-group { border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; background: var(--paper); }
.home-group h2 { display: flex; align-items: center; gap: 8px; font: 600 15px/1.3 var(--ui); margin: 0 0 8px; }
.home-group h2 .i { color: var(--ember); }
.home-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.home-group a { display: block; padding: 8px 10px; margin: 0 -10px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.home-group a:hover { background: var(--paper-2); text-decoration: none; }
.home-group b { display: block; font-weight: 550; font-size: 15px; }
.home-group span { display: block; color: var(--ink-2); font-size: 13.5px; line-height: 1.45; margin-top: 2px; }

/* Search */
.search-dialog { border: 0; padding: 0; background: transparent; width: min(640px, calc(100% - 32px)); max-width: none; margin: 10vh auto auto; color: var(--ink); }
.search-dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.search-box { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); overflow: hidden; }
.search-field { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.search-field input { flex: 1; min-width: 0; height: 54px; border: 0; background: transparent; font: 400 17px var(--ui); color: var(--ink); outline: none; }
.search-results { list-style: none; margin: 0; padding: 8px; max-height: min(60vh, 520px); overflow-y: auto; }
.search-results a { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.search-results a[aria-selected="true"], .search-results a:hover { background: var(--paper-2); text-decoration: none; }
.search-results small { display: block; color: var(--ember); font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.search-results b { display: block; font-weight: 550; }
.search-results span { display: block; color: var(--ink-2); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results mark { background: var(--ember-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
.search-empty { padding: 20px 12px; color: var(--ink-2); font-size: 14px; }
.search-foot { display: flex; flex-wrap: wrap; gap: 14px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-2); }

/* Smaller screens */
@media (max-width: 1180px) {
  .docs-shell { grid-template-columns: 220px minmax(0, 1fr); gap: 40px; }
  .docs-toc { display: none; }
}
@media (max-width: 900px) {
  .docs-shell, .docs-shell:has(.docs-home-hero) { display: block; }
  .docs-menu { display: inline-flex; }
  .docs-nav { position: fixed; top: 109px; left: 0; right: 0; bottom: 0; z-index: 70; max-height: none; background: var(--paper); padding: 20px var(--gutter) 48px; visibility: hidden; opacity: 0; transition: opacity 0.15s ease, visibility 0.15s; }
  .docs-nav.is-open { visibility: visible; opacity: 1; }
  body.docs-nav-open { overflow: hidden; }
  .docs-search-btn { flex: none; width: 38px; padding: 0; justify-content: center; margin: 0 0 0 auto; }
  .docs-search-btn span, .docs-search-btn kbd { display: none; }
  .docs-contact, .docs-cta { display: none; }
  .docs-main { padding-top: 28px; }
}
@media (max-width: 560px) {
  .docs-pager { grid-template-columns: 1fr; }
  .docs-title-row { flex-direction: column; gap: 0; }
  .copy-page { margin: 0 0 12px; }
  .docs-badge { display: none; }
  .home-search kbd { display: none; }
}
@media (prefers-reduced-motion: reduce) { .docs-nav { transition: none; } }
