:root {
  --page: #eef4ef;
  --paper: #fffefa;
  --panel: #ffffff;
  --ink: #182420;
  --text: #24312c;
  --muted: #5d6a65;
  --line: #ccd8cf;
  --line-strong: #a8b9ad;
  --brand: #1f7a46;
  --brand-dark: #145532;
  --teal: #0b6b6f;
  --blue: #245c9a;
  --amber: #b7791f;
  --red: #9e2f2f;
  --code-bg: #f8fbef;
  --code-line: #1f7a46;
  --shadow: 0 16px 48px rgba(24, 36, 32, 0.12);
  --radius: 8px;
  --content-max: 1180px;
  --content-gutter: 40px;
  --content-width: min(var(--content-max), calc(100% - var(--content-gutter)));
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
  background: var(--page);
}

body,
body[class] {
  margin: 0 !important;
  min-width: 0;
  color: var(--text) !important;
  background: linear-gradient(180deg, #e6f0e8 0, #fffefa 280px, #eef4ef 100%) !important;
  font-family: "Segoe UI", "Aptos", Tahoma, sans-serif !important;
  font-size: 16px !important;
  line-height: 1.58;
  letter-spacing: 0;
}

body > h1,
body > h2,
body > h3,
body > h4,
body > h5,
body > p,
body > ul,
body > ol,
body > table,
body > blockquote,
body > pre,
body > .api-section,
body > .feature-category,
body > .troubleshooting,
body > .component-header,
body > .centered,
body > .example-code {
  width: var(--content-width) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

body > h1:first-of-type,
body > h2:first-of-type,
body > .component-header:first-of-type {
  margin-top: 28px !important;
}

main {
  width: var(--content-width);
  margin: 0 auto;
}

h1,
h2,
h3,
h4,
.f_Heading1,
span.f_Heading1 {
  color: var(--ink) !important;
  font-family: Georgia, "Times New Roman", serif !important;
  font-weight: 700 !important;
  letter-spacing: 0;
}

h1,
span.f_Heading1 {
  margin-top: 1.2rem !important;
  margin-bottom: 0.5rem !important;
  font-size: 1.58rem !important;
  line-height: 1.22;
}

h2 {
  margin-top: 1.4rem !important;
  margin-bottom: 0.55rem !important;
  padding: 0;
  border: 0;
  color: var(--teal) !important;
  font-size: 1.18rem !important;
  line-height: 1.25;
}

h3 {
  margin-top: 1.25rem !important;
  margin-bottom: 0.48rem !important;
  padding: 0;
  border: 0;
  color: var(--brand-dark) !important;
  font-size: 1.08rem !important;
  line-height: 1.3;
}

h4,
h5 {
  margin-top: 0.95rem !important;
  margin-bottom: 0.35rem !important;
  color: var(--teal) !important;
  font-size: 1rem !important;
  font-weight: 700 !important;
  line-height: 1.35;
  text-transform: none;
}

p {
  margin: 0 0 0.65rem;
  padding: 0;
  text-align: left;
  text-indent: 0;
}

p[class] {
  max-width: 78ch;
}

ul,
ol {
  margin: 0.4rem 0 1rem 1.25rem !important;
  padding: 0 !important;
  color: var(--text) !important;
  font-family: inherit !important;
}

li {
  margin: 0 0 0.35rem;
  padding: 0;
  overflow-wrap: anywhere;
}

a {
  color: var(--blue);
  text-decoration: none;
  text-underline-offset: 0.16em;
}

a:hover,
a:focus-visible {
  color: var(--brand-dark);
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(31, 122, 70, 0.18);
  outline-offset: 2px;
}

strong,
b {
  color: #111f19;
}

img {
  max-width: 100%;
  height: auto;
}

table {
  width: var(--content-width);
  margin-top: 0.7rem !important;
  margin-bottom: 1.2rem !important;
  border-collapse: collapse;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 10px 26px rgba(24, 36, 32, 0.07);
  font-size: 100%;
  vertical-align: top;
}

th,
td {
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

th {
  background: #142823;
  color: #fffefa;
  font-weight: 700;
}

tr:last-child td {
  border-bottom: 0;
}

tr:nth-child(even) td {
  background: #f8fbf6;
}

tr:hover td {
  background: #eef8ef;
}

blockquote {
  margin-top: 0.9rem !important;
  margin-bottom: 1.1rem !important;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--text);
  box-shadow: 0 10px 26px rgba(31, 122, 70, 0.08);
}

code,
pre,
.code,
.comment,
.string,
.keyword,
.class,
.preprocessor,
.number,
.example-code,
.type-definition {
  font-family: Consolas, "Cascadia Mono", "Courier New", monospace !important;
}

code {
  padding: 0.1rem 0.28rem;
  border-radius: 4px;
  background: #e9f1e4;
  color: #122820;
}

pre,
.example-code,
.type-definition {
  position: relative;
  display: block;
  max-width: 100%;
  margin-top: 0.9rem !important;
  margin-bottom: 1.1rem !important;
  padding: 1rem 1.1rem !important;
  overflow-x: auto;
  border: 1px solid #cfddb9 !important;
  border-left: 5px solid var(--code-line) !important;
  border-radius: var(--radius) !important;
  background: var(--code-bg) !important;
  color: #14241f !important;
  box-shadow: 0 10px 26px rgba(31, 122, 70, 0.08);
  white-space: pre;
}

pre code,
.example-code code,
.example-code .code {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre;
}

.comment {
  color: #597d67;
  font-style: italic;
}

.string {
  color: #8b5d1d;
}

.keyword {
  color: var(--blue);
  font-weight: 700;
}

.class {
  color: var(--brand-dark);
  font-weight: 650;
}

.preprocessor {
  color: var(--amber);
}

.number {
  color: var(--red);
  font-weight: 700;
}

.centered {
  text-align: center;
}

.bold {
  display: inline-block;
  margin: 0.95rem 0 0.35rem;
  color: var(--ink);
  font-weight: 780;
}

body > p.bold[id^="feature-"] {
  display: block;
  width: var(--content-width) !important;
  max-width: var(--content-width) !important;
  margin: 1.35rem auto 0.65rem !important;
}

.api-section,
.feature-category,
.troubleshooting,
.component-header {
  min-width: 0;
  margin-top: 1rem !important;
  margin-bottom: 1rem !important;
  padding: 1.15rem 1.25rem;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 12px 32px rgba(24, 36, 32, 0.07);
}

.feature-category {
  border-left: 5px solid var(--brand);
}

.troubleshooting {
  border-left: 5px solid var(--amber);
  background: var(--paper);
}

.api-section h2:first-child,
.feature-category h3:first-child,
.troubleshooting h3:first-child {
  margin-top: 0 !important;
}

.component-header {
  padding: 1.5rem 1.75rem;
  background: var(--panel);
  color: var(--text) !important;
  border: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 12px 32px rgba(24, 36, 32, 0.07);
}

.component-header h1 {
  margin-top: 0 !important;
  margin-bottom: 0.45rem !important;
  color: var(--ink) !important;
  font-size: 1.9rem !important;
}

.component-header .description,
.component-header div {
  color: var(--muted);
}

.doc-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: var(--content-width);
  margin: 14px auto;
  padding: 11px 14px;
  border: 1px solid rgba(204, 216, 207, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 254, 250, 0.94);
  box-shadow: 0 10px 28px rgba(24, 36, 32, 0.06);
}

.doc-brand {
  color: var(--ink);
  font-weight: 820;
  text-decoration: none;
  white-space: nowrap;
}

.doc-brand:hover {
  color: var(--brand-dark);
  text-decoration: none;
}

.doc-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.doc-links a,
.button-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--brand-dark);
  font-size: 0.91rem;
  font-weight: 720;
  text-decoration: none;
}

.hero-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0.48rem 0.78rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: #fffefa;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
}

.doc-links a:hover,
.button-link:hover {
  border-color: rgba(31, 122, 70, 0.22);
  background: #eef8ef;
  color: var(--brand-dark);
  text-decoration: none;
}

.hero-actions a:hover {
  background: rgba(255, 254, 250, 0.12);
  text-decoration: none;
}

.button-link.primary,
.hero-actions a.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fffefa;
}

.button-link.primary:hover,
.hero-actions a.primary:hover {
  background: var(--brand-dark);
  color: #fffefa;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.doc-search {
  position: relative;
  z-index: 20;
  flex: 1 1 320px;
  min-width: 240px;
  max-width: 430px;
}

.doc-search input {
  width: 100%;
  min-height: 38px;
  padding: 0.48rem 2.25rem 0.48rem 0.78rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fffefa;
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  outline: none;
}

.doc-search::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 14px;
  width: 11px;
  height: 11px;
  border: 2px solid var(--brand-dark);
  border-radius: 50%;
  transform: translateY(-58%);
  pointer-events: none;
}

.doc-search::before {
  content: "";
  position: absolute;
  top: 23px;
  right: 10px;
  z-index: 1;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: var(--brand-dark);
  transform: rotate(45deg);
  pointer-events: none;
}

.doc-search input::placeholder {
  color: var(--muted);
}

.doc-search input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 122, 70, 0.14);
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: none;
  max-height: min(60vh, 420px);
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.doc-search.is-open .search-results {
  display: block;
}

.search-result,
.search-empty {
  display: block;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
}

.search-result:hover,
.search-result.is-active {
  background: #e6f7ec;
  color: var(--brand-dark);
}

.search-result strong {
  display: block;
  color: inherit;
  font-size: 0.94rem;
}

.search-result span,
.search-empty {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.landing-hero,
.hero {
  width: var(--content-width);
  margin: 0 auto;
  padding: 46px 0 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 34px;
  align-items: end;
}

.landing-kicker {
  margin-bottom: 0.6rem;
  color: var(--brand-dark);
  font-size: 0.86rem;
  font-weight: 780;
  text-transform: uppercase;
}

.landing-title,
.hero h1 {
  max-width: 760px;
  margin: 0 0 0.8rem !important;
  color: var(--ink) !important;
  font-size: 2.45rem !important;
  line-height: 1.06;
}

.landing-copy,
.hero p {
  max-width: 760px;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 1.2rem;
}

.hero-panel,
.hero-stat {
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-stat strong,
.stat strong {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--brand-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
  line-height: 1;
}

.hero-stat p,
.stat span {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.component-strip {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 0 0 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.component-strip:last-of-type {
  margin-bottom: 0;
  border-bottom: 0;
}

.component-strip img {
  width: 42px;
  height: 42px;
  image-rendering: pixelated;
}

.component-strip h2 {
  margin: 0 0 0.25rem !important;
  color: var(--ink) !important;
  font-size: 1.05rem !important;
}

.component-strip p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.stat {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.content-band {
  width: var(--content-width);
  margin: 0 auto;
  padding: 20px 0 32px;
}

.nav-section {
  width: var(--content-width);
  margin: 0 auto 2rem;
}

.nav-section h2 {
  margin-bottom: 0.4rem !important;
}

.nav-section h3 {
  margin-top: 1rem !important;
  margin-bottom: 0.3rem !important;
}

.nav-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 1.6rem 0 1.2rem;
}

.section-intro {
  max-width: 760px;
  color: var(--muted);
}

.topic-grid,
.nav-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.topic-card,
.nav-card {
  display: block;
  min-width: 0;
  min-height: 0;
  padding: 18px;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  box-shadow: none;
}

.topic-card h2,
.nav-card strong {
  display: block;
  margin: 0 0 0.55rem !important;
  color: var(--ink) !important;
  font-family: Georgia, "Times New Roman", serif !important;
  font-size: 1.05rem !important;
  line-height: 1.25;
}

.topic-card p,
.nav-card span {
  color: var(--muted);
  font-size: 0.94rem;
}

.topic-card a,
.section-link,
.nav-card em {
  display: inline-flex;
  margin-top: 0.4rem;
  color: var(--blue);
  font-style: normal;
  font-weight: 700;
}

.topic-card:hover,
.nav-card:hover {
  border-color: rgba(31, 122, 70, 0.35);
  background: #fffefa;
  color: var(--text);
  text-decoration: none;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tag-list a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0.38rem 0.68rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.tag-list a:hover {
  border-color: var(--brand);
  background: #eef8ef;
  color: var(--brand-dark);
  text-decoration: none;
}

/* ── api navigation link grids ──────────────────────────────── */

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.18rem 0;
  margin: 0.3rem 0 0.8rem;
  padding: 0;
  list-style: none;
}

.nav-links li {
  margin: 0;
  min-width: 160px;
  width: 20%;
}

.nav-links a {
  display: inline-block;
  padding: 0.15rem 0.3rem 0.15rem 0;
  color: var(--blue);
  font-size: 0.92rem;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.nav-links a:hover {
  color: var(--brand-dark);
  text-decoration: underline;
}

@media (max-width: 900px) {
  .nav-links li { width: 25%; min-width: 140px; }
}

@media (max-width: 560px) {
  .nav-links li { width: 50%; min-width: 120px; }
}

/* ── release notes / changelog ───────────────────────────────── */

.changelog-page {
  display: grid;
  gap: 16px;
  width: var(--content-width);
  margin: 24px auto;
}

.changelog-heading,
.changelog-last-release,
.changelog-entry {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 12px 32px rgba(24, 36, 32, 0.07);
  overflow-wrap: anywhere;
}

.changelog-heading { padding: 24px 28px; }
.changelog-heading h1 { margin: 0 0 0.65rem !important; }
.changelog-heading p { max-width: none; color: var(--muted); }

.language-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
}
.local-docs .language-links {
  display: none !important;
}
.language-links span {
  color: var(--muted);
  font-weight: 700;
}
.language-links a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--brand-dark);
  font-weight: 700;
  text-decoration: none;
}
.language-links a:hover,
.language-links a:focus-visible {
  border-color: rgba(31, 122, 70, 0.22);
  background: #eef8ef;
  color: var(--brand-dark);
}

.lang-select {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.lang-select:hover,
.lang-select:focus-visible {
  border-color: var(--brand);
  color: var(--brand-dark);
}

.changelog-last-release,
.changelog-entry { padding: 22px 28px; }

.changelog-last-release h2,
.changelog-entry h2 { margin-top: 0; }

.changelog-last-release li,
.changelog-entry li { margin-bottom: 0.55rem; }

@media (max-width: 560px) {
  .changelog-heading,
  .changelog-last-release,
  .changelog-entry { padding: 18px; }
}

/* ── entries pages ───────────────────────────────────────────── */

div.indent {
  padding: 0;
  margin: 0 0 0 1rem;
}

body > div.indent {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  margin-left: auto !important;
  margin-right: auto !important;
  width: var(--content-width) !important;
}

div.txt {
  margin: 0.28rem 0 0.35rem;
  font-size: 0.98rem;
  padding: 0;
}

/* breadcrumb nav */
.topic-quick-nav {
  width: var(--content-width);
  margin: 18px auto 0;
  padding: 10px 0 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.topic-quick-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0.38rem 0.68rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
}

.topic-quick-nav a:hover {
  border-color: var(--brand);
  background: #eef8ef;
  text-decoration: none;
}

/* parameter tables */
table.synd {
  margin: 0.7rem 0 1rem;
  border-collapse: collapse;
}

td.syni,
td.synid {
  padding: 0.2rem 0.65rem 0.2rem 0;
  vertical-align: top;
}

td.syni {
  color: var(--teal);
  font-style: italic;
  white-space: nowrap;
}

td.synid {
  color: var(--text);
}

.doc-footer,
.reference-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: var(--content-width);
  margin: 2rem auto 0;
  padding: 1.2rem 0 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

.doc-footer p {
  margin: 0;
  color: inherit;
  font-size: inherit;
}

.doc-footer a,
.reference-footer a {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.doc-footer a:hover,
.reference-footer a:hover {
  text-decoration: underline;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 14px;
}

@media (max-width: 900px) {
  .landing-hero,
  .hero,
  .topic-grid,
  .nav-grid {
    grid-template-columns: 1fr;
  }

  .doc-nav,
  .doc-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .doc-links,
  .footer-links {
    justify-content: flex-start;
  }

  .doc-search {
    width: min(100%, 520px);
    min-width: 0;
    max-width: 520px;
  }
}

@media (max-width: 560px) {
  :root {
    --content-gutter: 24px;
  }

  body > table,
  body > h1,
  body > h2,
  body > h3,
  body > h4,
  body > h5,
  body > p,
  body > ul,
  body > ol,
  body > blockquote,
  body > pre,
  body > .api-section,
  body > .feature-category,
  body > .troubleshooting,
  body > .component-header,
  body > .centered,
  body > .example-code,
  .doc-nav,
  .doc-footer,
  main {
    width: var(--content-width) !important;
  }

  .landing-title,
  .hero h1 {
    font-size: 1.9rem !important;
  }

  .doc-search {
    width: 100%;
    max-width: none;
  }

  .api-section,
  .feature-category,
  .troubleshooting,
  .component-header,
  .topic-card,
  .nav-card,
  blockquote,
  pre,
  .example-code {
    padding: 18px;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  th,
  td {
    padding: 0.48rem 0.6rem;
  }

  .stat-row {
    grid-template-columns: 1fr;
  }
}

@media print {
  body,
  body[class] {
    background: #ffffff !important;
  }

  .doc-nav,
  .doc-footer,
  .hero-actions {
    display: none;
  }

  .api-section,
  .feature-category,
  .troubleshooting,
  .component-header,
  .topic-card,
  .nav-card,
  blockquote,
  pre,
  .example-code {
    box-shadow: none;
  }
}
