:root {
  --page: #eef4ef;
  --paper: #fffefa;
  --panel: #ffffff;
  --ink: #182420;
  --muted: #5d6a65;
  --line: #ccd8cf;
  --line-strong: #a8b9ad;
  --brand: #1f7a46;
  --brand-dark: #145532;
  --teal: #0b6b6f;
  --blue: #245c9a;
  --amber: #b7791f;
  --code-bg: #f8fbef;
  --code-line: #1f7a46;
  --shadow: 0 16px 48px rgba(24, 36, 32, 0.12);
  --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; background: var(--page); }

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

body > table,
body > h1,
body > h2,
body > h5,
body > .indent,
body > .txt,
body > pre,
body > ul,
body > p {
  width: var(--content-width) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

body > table:first-of-type,
body > h1:first-of-type { margin-top: 28px !important; }

body > table,
body > .indent,
body > .txt {
  max-width: var(--content-width);
  overflow-x: auto;
}

table { border-collapse: collapse; font-size: 100%; vertical-align: top; }
td { vertical-align: top; padding: 0; margin: 0; }

p { text-align: left; text-indent: 0; padding: 0; margin: 0 0 0.65rem; }
p[class] { width: auto !important; max-width: 78ch; }
span[class] { color: inherit !important; }
table[class] { background: transparent !important; }
img { max-width: 100%; height: auto; }

object[type="application/x-oleobject"] {
  position: absolute !important;
  width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

a { color: var(--blue); text-decoration: none; text-underline-offset: 0.16em; }
a:hover,
a:focus-visible { color: var(--brand-dark); text-decoration: underline; }

h1,
h2,
h3,
.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: 1.4rem 0 0.55rem; font-size: 1.18rem !important; color: var(--teal) !important; }
h5 { margin: 0.8rem 0 0.35rem; font-size: 1rem; font-weight: 700; color: var(--teal); }
hr { border: 0; border-top: 1px solid var(--line); }
hr.ln { height: 0; border-top: 2px solid var(--brand); }

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; }
div.vind { padding: 0; margin: 1em 0 0; }

div.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;
}

div.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);
}

div.nav a:hover { border-color: var(--brand); background: #eef8ef; text-decoration: none; }
div.nav a.nav-contents { border-color: rgba(31, 122, 70, 0.42); background: #e6f7ec; color: var(--brand-dark); }

.copyr,
.reference-footer {
  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;
}

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

.back-to-top {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--content-width);
  min-height: 38px;
  margin: 1.4rem auto 0;
  padding: 0.48rem 0.78rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--brand-dark);
  font-size: 0.92rem;
  font-weight: 700;
}

.back-to-top:hover,
.back-to-top:focus-visible {
  border-color: var(--brand);
  background: #eef8ef;
  color: var(--brand-dark);
  text-decoration: none;
}

div.txt,
ul,
ol,
td,
span,
p { color: inherit; }

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

ul,
ol { margin: 0.4rem 0 1rem 1.25rem !important; padding: 0 !important; font-family: inherit !important; color: var(--ink) !important; }
li { margin: 0 0 0.35rem; padding: 0; }
strong,
b { color: #111f19; }

table.constlist,
table.synd { margin: 0.7rem 0 1rem; }
td.consti,
td.constd,
td.syni,
td.synid { padding: 0.2rem 0.65rem 0.2rem 0; }
td.consti,
td.syni { color: var(--teal); font-style: italic; }

code,
pre,
.code,
.code-example,
.type-definition { font-family: Consolas, "Cascadia Mono", "Courier New", monospace !important; }

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

.code,
.code-example,
.type-definition,
pre {
  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: 8px !important;
  background: var(--code-bg) !important;
  color: #14241f !important;
  box-shadow: 0 10px 26px rgba(31, 122, 70, 0.08);
  white-space: pre;
}

.type-definition { border-left-color: var(--teal) !important; }
p.alarm { color: #aa1e1e; }

.site-shell { min-height: 100vh; }
.site-header { background: #142823; color: #fffefa; border-bottom: 4px solid var(--brand); }

.site-header-inner {
  width: var(--content-width);
  margin: 0 auto;
  padding: 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-lockup { display: flex; align-items: center; gap: 16px; }
.brand-lockup img { width: 96px; height: 30px; padding: 3px 5px; border-radius: 4px; background: #fff; }
.brand-title { margin: 0; color: #fffefa; font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; line-height: 1.2; }
.brand-subtitle { margin: 0.25rem 0 0; color: #d7ded8; font-size: 0.95rem; }
.topic-site-header .site-header-inner { padding: 18px 0; }

.top-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.help-search {
  position: relative;
  z-index: 20;
  flex: 1 1 300px;
  min-width: 240px;
  max-width: 390px;
}
.help-search input {
  width: 100%;
  min-height: 38px;
  padding: 0.48rem 0.78rem;
  border: 1px solid rgba(255, 254, 250, 0.42);
  border-radius: 8px;
  background: #fffefa;
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  outline: none;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
}
.help-search input::placeholder { color: var(--muted); }
.help-search input:focus {
  border-color: #fffefa;
  box-shadow: 0 0 0 3px rgba(255, 254, 250, 0.22), 0 10px 22px rgba(0, 0, 0, 0.1);
}
.doc-nav .help-search { flex: 1 1 320px; max-width: 430px; }
.doc-nav .help-search input {
  border-color: var(--line-strong);
  box-shadow: none;
}
.doc-nav .help-search input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 122, 70, 0.14);
}
.help-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: min(60vh, 420px);
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.help-search-results[hidden] { display: none; }
.help-search-results a,
.help-search-empty {
  display: block;
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  color: var(--ink);
}
.help-search-results a:hover,
.help-search-results a:focus-visible {
  background: #e6f7ec;
  color: var(--brand-dark);
  text-decoration: none;
}
.help-search-results strong { display: block; color: inherit; font-size: 0.94rem; }
.help-search-results span,
.help-search-empty { display: block; color: var(--muted); font-size: 0.8rem; }
.top-links a,
.hero-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0.48rem 0.78rem;
  border: 1px solid rgba(255, 254, 250, 0.36);
  border-radius: 8px;
  color: #fffefa;
  font-size: 0.92rem;
  font-weight: 700;
}
.top-links a:hover,
.hero-actions a:hover { background: rgba(255, 254, 250, 0.12); text-decoration: none; }

/* ── Doc-nav header (replaces site-header, matches PDFiumVCL card style) ── */
.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: 8px;
  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 {
  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;
}
.doc-links a:hover {
  border-color: rgba(31, 122, 70, 0.22);
  background: #eef8ef;
  color: var(--brand-dark);
  text-decoration: none;
}

.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;
}
.hero h1 { margin: 0 0 0.8rem !important; max-width: 760px; font-size: 2.45rem !important; line-height: 1.06; }
.hero p { max-width: 760px; color: var(--muted); font-size: 1.05rem; }
.hero-actions { margin-top: 1.2rem; display: flex; flex-wrap: wrap; gap: 10px; }
.hero-actions a { border-color: var(--line-strong); color: var(--ink); background: #fffefa; }
.hero-actions a.primary { border-color: var(--brand); background: var(--brand); color: #fffefa; }
.hero-stat { padding: 18px 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: var(--shadow); }
.hero-stat strong { display: block; margin-bottom: 0.2rem; color: var(--brand-dark); font-size: 1.8rem; font-family: Georgia, "Times New Roman", serif; }

.content-band { width: var(--content-width); margin: 0 auto; padding: 20px 0 52px; }
.topic-shell {
  width: var(--content-width);
  margin: 28px auto 0;
  padding: 0 0 42px;
}
.topic-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.topic-card,
.nav-section { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.topic-card { min-width: 0; padding: 18px; overflow-wrap: anywhere; }
.topic-shell > .topic-card {
  padding: 26px 30px;
  box-shadow: 0 12px 32px rgba(24, 36, 32, 0.07);
}
.topic-card h2,
.nav-section h2 { margin: 0 0 0.55rem; font-family: Georgia, "Times New Roman", serif; font-size: 1.05rem !important; color: var(--ink) !important; }
.topic-card p { color: var(--muted); font-size: 0.94rem; }
.topic-card a,
.section-link { display: inline-flex; margin-top: 0.4rem; font-weight: 700; }

.nav-layout {
  width: var(--content-width);
  margin: 0 auto;
  padding: 28px 0 54px;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 26px;
}
.nav-sidebar { position: sticky; top: 18px; align-self: start; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); overflow-wrap: anywhere; }
.nav-sidebar a { display: block; padding: 0.35rem 0; color: var(--ink); font-weight: 700; }
.nav-main { display: grid; min-width: 0; gap: 14px; }
.nav-section { min-width: 0; padding: 18px 20px; overflow-wrap: anywhere; }
.contents-tree,
.contents-tree ul { list-style: none; margin: 0 !important; padding: 0 !important; }
.contents-tree ul { margin: 0.35rem 0 0.35rem 0.9rem !important; padding-left: 0.9rem !important; border-left: 1px solid var(--line); }
.contents-tree li { margin: 0.22rem 0; }
.contents-tree a,
.node-label { display: inline-flex; min-height: 1.65rem; align-items: center; }
.node-label { color: var(--muted); font-weight: 700; }

.changelog-page {
  display: grid;
  gap: 16px;
}

.changelog-heading,
.changelog-entry {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  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: 78ch; color: var(--muted); }
.changelog-entry { padding: 22px 28px; }
.changelog-entry h2 { margin-top: 0; }
.changelog-entry li { margin-bottom: 0.55rem; }

@media (max-width: 900px) {
  .site-header-inner,
  .hero { grid-template-columns: 1fr; }
  .site-header-inner { align-items: flex-start; flex-direction: column; }
  .top-links { justify-content: flex-start; }
  .help-search { width: min(100%, 520px); max-width: 520px; }
  .topic-grid,
  .nav-layout { grid-template-columns: 1fr; }
  .nav-sidebar { position: static; }
  .doc-nav { align-items: flex-start; flex-direction: column; }
  .doc-links { justify-content: flex-start; }
}

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

  body > table,
  body > h1,
  body > h2,
  body > h5,
  body > .indent,
  body > .txt,
  body > pre,
  body > ul,
  body > p,
  div.nav,
  .copyr,
  .reference-footer,
  .back-to-top,
  .site-header-inner,
  .hero,
  .content-band,
  .topic-shell,
  .nav-layout { width: var(--content-width) !important; }
  .hero h1 { font-size: 1.9rem !important; }
  .brand-lockup { align-items: flex-start; flex-direction: column; }
  .help-search { width: 100%; min-width: 0; max-width: none; }
  .doc-nav { width: var(--content-width); }
  .topic-shell > .topic-card { padding: 18px; }
  .changelog-heading,
  .changelog-entry { padding: 18px; }
}
