/* Theme overlay for makeinfo HTML manuals (linked via --css-ref).
   Matches site.css: default dark, light via html[data-theme="light"]
   (set by /assets/js/manual-theme.js from the same theme cookie). */

:root,
html[data-theme="dark"],
html:not([data-theme="light"]) {
  --ti-bg: #0d0d0d;
  --ti-bg-elev: #1a1a1a;
  --ti-bg-card: #242424;
  --ti-line: #333333;
  --ti-text: #e8e8e8;
  --ti-text-dim: #9a9a9a;
  --ti-accent: #3ddc84;
  --ti-link: #3ddc84;
  --ti-link-visit: #2bb86c;
  --ti-mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  --ti-sans: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ti-max: 52rem;
}

html[data-theme="light"] {
  --ti-bg: #f2f2f2;
  --ti-bg-elev: #ffffff;
  --ti-bg-card: #ececec;
  --ti-line: #d0d0d0;
  --ti-text: #1a1a1a;
  --ti-text-dim: #5a5a5a;
  --ti-accent: #1a9e56;
  --ti-link: #1a9e56;
  --ti-link-visit: #147a42;
}

html {
  background: var(--ti-bg) !important;
  color: var(--ti-text) !important;
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
}

body {
  margin: 0 auto !important;
  padding: 1.5rem 1.25rem 3rem !important;
  max-width: var(--ti-max) !important;
  background: var(--ti-bg) !important;
  color: var(--ti-text) !important;
  font-family: var(--ti-sans) !important;
  font-size: 1.02rem !important;
  line-height: 1.65 !important;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--ti-text) !important;
  font-family: var(--ti-sans) !important;
  font-weight: 650 !important;
  line-height: 1.25 !important;
  margin-top: 1.75rem !important;
  margin-bottom: 0.65rem !important;
}

h1 {
  font-size: 1.75rem !important;
  color: var(--ti-accent) !important;
  border-bottom: 1px solid var(--ti-line) !important;
  padding-bottom: 0.5rem !important;
}

h2 {
  font-size: 1.35rem !important;
}

a {
  color: var(--ti-link) !important;
  text-decoration: none !important;
}

a:hover {
  text-decoration: underline !important;
}

a:visited {
  color: var(--ti-link-visit) !important;
}

hr {
  border: 0 !important;
  border-top: 1px solid var(--ti-line) !important;
  margin: 1.5rem 0 !important;
}

div.header,
table.header,
td.header,
th.header {
  background: var(--ti-bg-elev) !important;
  color: var(--ti-text-dim) !important;
  border-color: var(--ti-line) !important;
  font-size: 0.9rem !important;
}

div.header {
  border: 1px solid var(--ti-line) !important;
  border-radius: 0.35rem !important;
  padding: 0.5rem 0.75rem !important;
  margin-bottom: 1.25rem !important;
}

table {
  border-collapse: collapse !important;
}

td,
th {
  color: var(--ti-text) !important;
}

pre,
code,
tt,
samp,
kbd {
  font-family: var(--ti-mono) !important;
}

pre,
div.example {
  background: var(--ti-bg-card) !important;
  color: var(--ti-text) !important;
  border: 1px solid var(--ti-line) !important;
  border-radius: 0.35rem !important;
  padding: 0.85rem 1rem !important;
  overflow-x: auto !important;
  font-size: 0.92rem !important;
  line-height: 1.45 !important;
}

code,
tt {
  background: var(--ti-bg-card) !important;
  padding: 0.1em 0.35em !important;
  border-radius: 0.2rem !important;
  font-size: 0.92em !important;
}

pre code,
pre tt {
  background: transparent !important;
  padding: 0 !important;
}

blockquote,
div.display {
  border-left: 3px solid var(--ti-accent) !important;
  margin-left: 0 !important;
  padding-left: 1rem !important;
  color: var(--ti-text-dim) !important;
}

ul,
ol {
  padding-left: 1.35rem !important;
}

li {
  margin: 0.25rem 0 !important;
}

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

.settitle,
.shortcontents,
.contents {
  color: var(--ti-text) !important;
}

.footnote {
  font-size: 0.9rem !important;
  color: var(--ti-text-dim) !important;
}
