/* ==========================================================================
   paulicert Documentation — Clean, Scannable Technical Docs Stylesheet
   ========================================================================== */

:root {
  --text: #181a1f;
  --text-muted: #525866;
  --text-faint: #7d8594;
  --link: #181a1f;
  --link-underline: #aeb5c2;
  --accent: #181a1f;
  --rule: #181a1f;
  --rule-light: #e5e7eb;
  --surface: #f7f8fa;
  --surface-hover: #eef0f3;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "STIX Two Text", "STIXGeneral", "Times New Roman", Times, serif;
  --font-mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --header-h: 56px;
  --sidebar-w: 248px;
  --toc-w: 256px;
  --measure: 47rem;
}

* { box-sizing: border-box; }

html {
  font-size: 16px;
  scroll-padding-top: calc(var(--header-h) + 24px);
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  background: #ffffff;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.96875rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

figure, blockquote { margin: 0; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2.5px; }

/* Subtle underlines on prose links so they stay unmistakably clickable in monochrome */
.doc-main p a,
.doc-main li a,
.doc-main td a,
.doc-main dd a,
.doc-main figcaption a {
  text-decoration: underline;
  text-decoration-color: var(--link-underline);
  text-underline-offset: 2.5px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 0.12s ease;
}
.doc-main p a:hover,
.doc-main li a:hover,
.doc-main td a:hover,
.doc-main dd a:hover,
.doc-main figcaption a:hover {
  text-decoration-color: var(--text);
}
.doc-main a code {
  transition: background 0.12s ease;
}
.doc-main a:hover code {
  background: var(--surface-hover);
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 50;
  background: #ffffff;
  border-bottom: 1px solid var(--rule-light);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0 1.5rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  text-decoration: none !important;
}

.brand-icon { width: 20px; height: 20px; border-radius: 3px; }
.brand-title { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.015em; }
.brand-version {
  font-size: 0.75rem;
  color: var(--text-faint);
  background: var(--surface);
  border: 1px solid var(--rule-light);
  padding: 0.05rem 0.4rem;
  border-radius: 3px;
}

.header-spacer { flex: 1; }

.header-link {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.header-link i { font-size: 1.05rem; }
.header-link:hover { color: var(--text); text-decoration: none; }

.mobile-menu-btn {
  display: none;
  border: 0;
  background: none;
  font-size: 1.15rem;
  line-height: 1;
  padding: 0.25rem;
  cursor: pointer;
  color: var(--text);
}

/* Search */
.search-wrapper { position: relative; width: 320px; }

.search-icon {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  color: var(--text-faint);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 34px;
  padding: 0 2.2rem 0 2.05rem;
  border: 1px solid #d5d9e0;
  border-radius: 4px;
  background: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--text);
  outline: none;
  text-overflow: ellipsis;
}
.search-input:focus { border-color: var(--link); }
.search-input::placeholder { color: var(--text-faint); }

.search-kbd {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.72rem;
  color: var(--text-faint);
  border: 1px solid #dddddd;
  border-radius: 3px;
  padding: 0 0.3rem;
  line-height: 1.35;
}

.search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  width: 460px;
  max-height: 70vh;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #d5d9e0;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.search-dropdown.open { display: block; }

.search-result-item {
  display: block;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--rule-light);
  color: var(--text);
  text-decoration: none !important;
}
.search-result-item:last-child { border-bottom: 0; }
.search-result-item:hover { background: var(--surface); }

.search-result-title {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}
.search-result-module { color: var(--text-faint); font-family: var(--font-sans); font-size: 0.75rem; white-space: nowrap; }
.search-result-desc { margin-top: 0.15rem; font-size: 0.8rem; color: var(--text-muted); }

/* ==========================================================================
   Layout
   ========================================================================== */

.doc-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  padding-top: var(--header-h);
  min-height: calc(100vh - 3.25rem);
}

/* Left sidebar */
.doc-sidebar {
  grid-column: 1;
  position: sticky;
  top: var(--header-h);
  align-self: start;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 1.5rem 1.15rem 3rem 1.35rem;
  background: #ffffff;
  font-size: 0.875rem;
  line-height: 1.45;
}

.toc-label {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}
.toc-label + .toc-pages { margin-bottom: 1.5rem; }

.toc-pages, .toc-pages ul { list-style: none; margin: 0; padding: 0; }
.toc-pages > li { margin: 0.1rem 0; }

.toc-pages > li > a {
  display: block;
  padding: 0.36rem 0.65rem;
  margin-left: -0.65rem;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  color: var(--text-muted);
  transition: color 0.12s ease, background 0.12s ease;
}
.toc-pages > li > a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.toc-pages > li > a.active {
  color: var(--link);
  font-weight: 600;
  background: var(--surface);
  border-left-color: var(--link);
}

/* Right in-page TOC */
.doc-toc {
  grid-column: 3;
  position: sticky;
  top: var(--header-h);
  align-self: start;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 1.5rem 1.35rem 3rem 1.15rem;
  background: #ffffff;
  font-size: 0.85rem;
  line-height: 1.45;
}

.toc-sections {
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0;
  border-left: 1px solid var(--rule-light);
}
.toc-sections li { margin: 0; }
.toc-sections a {
  display: block;
  padding: 0.24rem 0 0.24rem 0.85rem;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.toc-sections a:hover { color: var(--text); text-decoration: none; }
.toc-sections a.current { color: var(--link); font-weight: 500; border-left-color: var(--link); }
.toc-sections .toc-h3 a { padding-left: 1.55rem; font-size: 0.77rem; color: var(--text-faint); }
.toc-sections .toc-h3 a.current { color: var(--link); }
.toc-num { display: inline-block; min-width: 1.5em; }

/* Main column */
.doc-main {
  grid-column: 2;
  position: relative;
  padding: 2.25rem 2.75rem 4rem;
  min-width: 0;
}

.doc-main > * {
  max-width: min(var(--measure), 100%);
  margin-left: auto;
  margin-right: auto;
}

/* ==========================================================================
   Typography
   ========================================================================== */

.breadcrumb {
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-bottom: 1rem;
}
.breadcrumb a { color: var(--text-faint); }

h1.page-title {
  font-size: 1.95rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-top: 0;
  margin-bottom: 0.85rem;
}
h1.page-title code {
  display: inline-block;
  font-size: 0.54em;
  font-weight: 500;
  color: var(--text-muted);
  vertical-align: middle;
  margin: 0.15rem 0.3rem 0.1rem 0;
  padding: 0.16em 0.45em;
}

p.page-lead {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-bottom: 1.85rem;
}

h2 {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  margin-top: 2.6rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--rule-light);
}

h3 {
  font-size: 1.06rem;
  font-weight: 600;
  line-height: 1.35;
  margin-top: 1.85rem;
  margin-bottom: 0.55rem;
}

h4 {
  font-size: 0.88rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-top: 1.15rem;
  margin-bottom: 0.45rem;
}

h2 code {
  font-size: 0.86em;
  font-weight: 500;
  color: var(--text-muted);
}

.sec-num { margin-right: 0.4em; color: var(--text-faint); font-weight: 500; }

p {
  margin-top: 0;
  margin-bottom: 0.9em;
  text-align: left;
}
p.cont { margin-top: 0; }

.overbar {
  display: inline-block;
  border-top: 1.25px solid currentColor;
  line-height: 0.92;
  padding-top: 1px;
}

ul.plain, ol.plain {
  margin-top: 0;
  margin-bottom: 1em;
  padding-left: 1.35em;
}
ul.plain li, ol.plain li { margin-bottom: 0.4em; }

/* Feature cards on Overview */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
  margin-top: 1.25rem;
  margin-bottom: 1.75rem;
}
.card {
  padding: 1rem 1.05rem;
  background: var(--surface);
  border: 1px solid var(--rule-light);
  border-radius: 6px;
}
.card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.45rem;
}
.card-title .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 600;
  flex-shrink: 0;
}
.card p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Callout / Note */
.callout {
  padding: 0.85rem 1.05rem;
  margin-top: 1rem;
  margin-bottom: 1.25rem;
  background: var(--surface);
  border-left: 3px solid var(--link);
  border-radius: 0 4px 4px 0;
  font-size: 0.92rem;
}
.callout p { margin: 0; }
.callout p + p { margin-top: 0.5rem; }

/* Collapsible Notation & API Reference (Foundations) */
details.notation-ref {
  margin-top: -0.6rem;
  margin-bottom: 1.85rem;
  background: var(--surface);
  border: 1px solid var(--rule-light);
  border-radius: 5px;
}
details.notation-ref > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.58rem 0.95rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  user-select: none;
  transition: color 0.12s ease, background 0.12s ease;
}
details.notation-ref > summary::-webkit-details-marker { display: none; }
details.notation-ref > summary:hover {
  color: var(--text);
  background: var(--surface-hover);
}
details.notation-ref > summary::before {
  content: "\25B8";
  display: inline-block;
  font-size: 0.85rem;
  color: var(--text-faint);
  transition: transform 0.15s ease;
}
details.notation-ref[open] > summary {
  color: var(--text);
  border-bottom: 1px solid var(--rule-light);
}
details.notation-ref[open] > summary::before {
  transform: rotate(90deg);
  color: var(--text);
}
details.notation-ref .notation-body {
  padding: 0.65rem 0.95rem 0.75rem;
  background: #ffffff;
  border-radius: 0 0 5px 5px;
}
details.notation-ref .table-wrap {
  margin-top: 0;
  margin-bottom: 0;
}

/* Bibliography (Foundations only) */
ol.references {
  list-style: none;
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
  padding: 0;
  font-size: 0.86rem;
  line-height: 1.55;
}
ol.references li {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}
ol.references .ref-num {
  flex: 0 0 1.85rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
ol.references .ref-body {
  flex: 1;
  min-width: 0;
  overflow-wrap: break-word;
}
ol.references .ref-links {
  display: inline-block;
  white-space: nowrap;
  font-size: 0.78rem;
}
.ref-icon { margin-right: 0.25rem; font-size: 0.82em; }

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--text);
  background: var(--surface);
  padding: 0.1em 0.32em;
  border-radius: 3px;
  overflow-wrap: anywhere;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
pre code, .signature code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  overflow-wrap: normal;
}

strong { font-weight: 600; }

/* ==========================================================================
   Display equations (Foundations)
   ========================================================================== */

.equation {
  position: relative;
  margin-top: 0.65rem;
  margin-bottom: 0.65rem;
}
.equation .katex-display {
  position: relative;
  margin: 0;
  padding: 0.35rem 0;
  overflow-x: auto;
  overflow-y: hidden;
}
.katex {
  position: relative;
  font-size: 1.05em;
}

/* ==========================================================================
   API entries & signatures
   ========================================================================== */

.api-entry {
  padding: 1.15rem 0 0.4rem;
  border-top: 1px solid var(--rule-light);
}
h2 + .api-entry,
h3 + .api-entry {
  border-top: 0;
  padding-top: 0.2rem;
}
.api-entry > p:last-child { margin-bottom: 0.5rem; }

.signature {
  font-family: var(--font-mono);
  font-size: 0.835rem;
  line-height: 1.55;
  margin-top: 0.35rem;
  margin-bottom: 0.8rem;
  padding: 0.65rem 0.95rem;
  background: var(--surface);
  border-left: 3px solid var(--link);
  border-radius: 0 4px 4px 0;
  color: #222222;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  text-align: left;
}
.signature .sig-kw { color: #8b1a6b; font-weight: 500; }
.signature .sig-name { color: var(--text); font-weight: 600; }

dl.api-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.3rem 1rem;
  margin-top: 0.45rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.5;
}
dl.api-meta dt {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  padding-top: 0.16rem;
}
dl.api-meta dd { margin: 0; color: var(--text-muted); }

/* ==========================================================================
   Code listings
   ========================================================================== */

figure.listing {
  width: 100%;
  margin: 1rem auto 1.4rem;
}

figure.listing figcaption {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 0.4rem;
}

.listing-body {
  position: relative;
  width: 100%;
  max-width: 100%;
}

.listing pre {
  margin: 0;
  width: 100%;
  max-width: 100%;
  padding: 0.95rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--rule-light);
  border-radius: 5px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  tab-size: 4;
}

.copy-btn {
  position: absolute;
  top: 0.55rem;
  right: 0.6rem;
  padding: 0.22rem 0.55rem;
  border: 1px solid #d5d9e0;
  border-radius: 4px;
  background: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.74rem;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.listing-body:hover .copy-btn, .copy-btn:focus { opacity: 1; }
.copy-btn:hover { color: var(--text); border-color: var(--text); }
.copy-btn i { margin-right: 0.3rem; font-size: 0.72rem; }

.tok-kw { color: #8b1a6b; }
.tok-str { color: #0b6e4f; }
.tok-com { color: #8a8a8a; font-style: italic; }
.tok-num { color: #a14a00; }

/* ==========================================================================
   Tables
   ========================================================================== */

.table-wrap {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 0.75rem;
  margin-bottom: 1.4rem;
}

.table-caption {
  margin-bottom: 0.45rem;
  font-size: 0.86rem;
  color: var(--text-muted);
}
.table-caption .table-label {
  font-weight: 600;
  color: var(--text);
  margin-right: 0.45rem;
}

table.booktabs {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  line-height: 1.48;
}
table.booktabs thead th {
  text-align: left;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  border-top: 1px solid var(--rule-light);
  border-bottom: 1px solid #cbd2dc;
  vertical-align: bottom;
}
table.booktabs td {
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--rule-light);
  vertical-align: top;
  text-align: left;
}
table.booktabs td code { font-size: 0.82rem; white-space: normal; overflow-wrap: break-word; }
table.booktabs td:first-child code { white-space: nowrap; }
table.booktabs td.nowrap, table.booktabs th.nowrap { white-space: nowrap; }
table.booktabs .katex { font-size: 0.98em; }
table.booktabs.compact { font-size: 0.82rem; }
table.booktabs.compact thead th,
table.booktabs.compact td { padding: 0.42rem 0.42rem; }
table.booktabs.compact td code,
table.booktabs.compact th code { font-size: 0.78rem; }

/* ==========================================================================
   Figures
   ========================================================================== */

figure.fig {
  max-width: min(var(--measure), 100%);
  width: 100%;
  margin: 1.5rem auto 1.75rem;
  text-align: center;
}
figure.fig img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
}
figure.fig figcaption {
  max-width: var(--measure);
  margin: 0.65rem auto 0;
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.5;
  text-align: left;
}
.cap-label { font-weight: 600; color: var(--text); margin-right: 0.35em; }

/* ==========================================================================
   Footer & page navigation
   ========================================================================== */

.page-nav {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 3.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule-light);
  font-size: 0.875rem;
}
.page-nav a { display: block; font-weight: 500; }
.page-nav .nav-dir { display: block; font-size: 0.75rem; font-weight: 400; color: var(--text-faint); margin-bottom: 0.15rem; }
.page-nav .nav-dir i { font-size: 0.7rem; }
.page-nav .next { text-align: right; margin-left: auto; }

.site-footer {
  width: 100%;
  background: #ffffff;
  border-top: 1px solid var(--rule-light);
}
.footer-inner {
  padding: 1.2rem 1.5rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-faint);
}
.site-footer a {
  color: var(--text-muted);
  font-weight: 500;
  text-decoration: none;
}
.site-footer a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sidebar-backdrop { display: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1200px) {
  .doc-layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .doc-toc { display: none; }
  .doc-main { padding: 2rem 2rem 3.5rem; }
}

@media (max-width: 900px) {
  html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  .header-inner { gap: 0.55rem; padding: 0 0.9rem; }
  .header-spacer, .header-link-text, .brand-version, .search-kbd { display: none; }
  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin-left: -0.3rem;
    border-radius: 4px;
    flex-shrink: 0;
  }
  .mobile-menu-btn:hover { background: var(--surface); }
  .brand-link { flex-shrink: 0; }
  .search-wrapper { margin-left: auto; width: 100%; max-width: 190px; flex: 1; min-width: 0; }
  .search-input { padding: 0 0.65rem 0 1.9rem; font-size: 16px; }
  .header-link {
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    color: var(--text);
  }
  .header-link i { font-size: 1.2rem; }
  .search-dropdown {
    position: fixed;
    top: calc(var(--header-h) + 6px);
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
    max-height: 68vh;
  }
  .card-grid { grid-template-columns: 1fr; }
  .doc-layout {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: rgba(24, 26, 31, 0.32);
    z-index: 35;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .sidebar-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }
  .doc-sidebar {
    position: fixed;
    top: var(--header-h);
    bottom: 0;
    left: 0;
    width: min(272px, 82vw);
    height: calc(100vh - var(--header-h));
    height: calc(100dvh - var(--header-h));
    max-height: none;
    align-self: stretch;
    padding: 1.25rem 1.15rem 2.5rem 1.25rem;
    border-right: 1px solid var(--rule-light);
    transform: translateX(-100%);
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 40;
    box-shadow: none;
  }
  .doc-sidebar.open {
    transform: translateX(0);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
  }
  .doc-main {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    padding: 1.4rem 1.15rem 2.75rem;
  }
}

@media (max-width: 700px) {
  table.booktabs:not(.compact):has(th:nth-child(3)) {
    min-width: 30rem;
  }
  table.booktabs:not(.compact):has(th:nth-child(3)) th:last-child,
  table.booktabs:not(.compact):has(th:nth-child(3)) td:last-child {
    min-width: 12rem;
  }
}

@media (max-width: 600px) {
  h1.page-title { font-size: 1.6rem; }
  p.page-lead { font-size: 0.98rem; margin-bottom: 1.4rem; }
  h2 { font-size: 1.18rem; margin-top: 2.1rem; }
  h3 { font-size: 1rem; }
  p .katex, li .katex, dd .katex, figcaption .katex {
    white-space: normal;
  }
  p .katex .base, li .katex .base, dd .katex .base, figcaption .katex .base {
    white-space: nowrap;
  }
  .equation .katex-display { font-size: 0.86rem; padding: 0.4rem 0; -webkit-overflow-scrolling: touch; }
  .equation .katex-display > .katex {
    display: inline-block;
    min-width: 100%;
    padding-right: 2.25rem;
  }
  dl.api-meta { grid-template-columns: 1fr; gap: 0.15rem; }
  dl.api-meta dd { margin-bottom: 0.5rem; }
  .listing pre { padding: 0.8rem 0.9rem; font-size: 0.78rem; }
  table.booktabs { font-size: 0.82rem; }
  table.booktabs thead th, table.booktabs td { padding: 0.4rem 0.55rem; }
}

@media (hover: none) {
  .copy-btn { opacity: 0.9; }
}
