/* Qualia Forge · Simplified version · shared styles */
:root {
  --bg: #ffffff; --bg2: #f5f4f2; --text: #1c1e21; --muted: #494d53;
  --line: #d9d8d4; --link: oklch(44% 0.13 305); --link-h: oklch(34% 0.13 305);
  --mark: #b9541a;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14161b; --bg2: #1d2026; --text: #e9e9ec; --muted: #b4b7bd;
    --line: #383b42; --link: oklch(87% 0.07 75); --link-h: oklch(93% 0.07 75);
    --mark: #f0c896;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14161b; --bg2: #1d2026; --text: #e9e9ec; --muted: #b4b7bd;
  --line: #383b42; --link: oklch(87% 0.07 75); --link-h: oklch(93% 0.07 75);
  --mark: #f0c896;
  color-scheme: dark;
}
:root[data-contrast="high"] {
  --bg: #ffffff; --bg2: #ffffff; --text: #000000; --muted: #000000;
  --line: #000000; --link: #3d0a8c; --link-h: #3d0a8c; --mark: #000000;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root[data-contrast="high"]:not([data-theme="light"]) {
    --bg: #000000; --bg2: #000000; --text: #ffffff; --muted: #ffffff;
    --line: #ffffff; --link: #ffd9a0; --link-h: #ffd9a0; --mark: #ffffff;
    color-scheme: dark;
  }
}
:root[data-contrast="high"][data-theme="dark"] {
  --bg: #000000; --bg2: #000000; --text: #ffffff; --muted: #ffffff;
  --line: #ffffff; --link: #ffd9a0; --link-h: #ffd9a0; --mark: #ffffff;
  color-scheme: dark;
}
html { font-size: 112.5%; scroll-behavior: auto; }
:root[data-size="1"] { font-size: 125%; }
:root[data-size="2"] { font-size: 140%; }
* { margin: 0; padding: 0; box-sizing: border-box; animation: none !important; transition: none !important; }
body {
  background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.65;
}
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--bg); color: var(--link); padding: 12px 18px; border: 2px solid var(--link);
}
.skip:focus { left: 8px; top: 8px; }
a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
a:hover, a:focus { color: var(--link-h); }
:root[data-contrast="high"] a { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.wrap { max-width: 46rem; margin: 0 auto; padding: 0 1.2rem; }
header.site { border-bottom: 1px solid var(--line); }
:root[data-contrast="high"] header.site { border-bottom-width: 2px; }
.masthead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 1rem; padding: 1.1rem 0 0.2rem; }
.masthead .brand { font-weight: 700; font-size: 1.05rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text); text-decoration: none; }
.masthead .brand:hover, .masthead .brand:focus { color: var(--link-h); text-decoration: underline; }
.masthead .vtag { color: var(--muted); font-size: 0.85rem; }
.masthead .tofull { margin-left: auto; font-size: 0.85rem; }
.tools { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; padding: 0.7rem 0 0.9rem; }
.tools .grp { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.tools .lbl { font-size: 0.8rem; color: var(--muted); letter-spacing: 0.04em; }
.tools button {
  min-height: 44px; min-width: 44px; padding: 0.3rem 0.8rem;
  font: inherit; font-size: 0.85rem; cursor: pointer;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
}
.tools button[aria-pressed="true"] {
  background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 700;
}
nav.main { border-top: 1px solid var(--line); }
nav.main ul, nav.sub ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0 0.2rem; padding: 0.25rem 0; }
nav.main a, nav.sub a {
  display: inline-block; padding: 0.55rem 0.7rem; min-height: 44px;
  text-decoration: none; color: var(--text); font-size: 0.95rem;
}
nav.main a:hover, nav.main a:focus, nav.sub a:hover, nav.sub a:focus { text-decoration: underline; color: var(--link-h); }
nav.main a[aria-current="page"], nav.sub a[aria-current="page"] { font-weight: 700; text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; }
nav.sub { background: var(--bg2); border-top: 1px solid var(--line); }
nav.sub .lbl { font-size: 0.8rem; color: var(--muted); padding: 0.55rem 0.7rem 0 0.7rem; display: block; }
nav.sub a { font-size: 0.9rem; }
.crumbs { font-size: 0.85rem; color: var(--muted); padding: 1.1rem 0 0; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.crumbs li + li::before { content: "/"; margin-right: 0.3rem; color: var(--muted); }
main { padding: 0.4rem 0 2.5rem; }
h1 { font-size: 1.9rem; line-height: 1.25; margin: 1.2rem 0 0.6rem; text-wrap: balance; }
.lede { font-size: 1.1rem; color: var(--muted); max-width: 62ch; margin-bottom: 0.4rem; }
h2 { font-size: 1.35rem; line-height: 1.3; margin: 2.4rem 0 0.6rem; padding-top: 1.2rem; border-top: 1px solid var(--line); text-wrap: balance; }
h2:first-of-type { border-top: 0; padding-top: 0.4rem; }
h3 { font-size: 1.08rem; margin: 1.5rem 0 0.35rem; }
p, ul.plain, ol.plain, table, figure, dl { margin-bottom: 0.9rem; max-width: 68ch; }
p { text-wrap: pretty; }
ul.plain, ol.plain { padding-left: 1.3rem; }
ul.plain li, ol.plain li { margin-bottom: 0.45rem; }
figure { margin: 1.3rem 0; }
figure img { width: 100%; max-width: 100%; height: auto; display: block; border: 1px solid var(--line); border-radius: 4px; }
figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.45rem; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
caption { text-align: left; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.4rem; caption-side: top; }
th, td { border: 1px solid var(--line); padding: 0.55rem 0.7rem; text-align: left; vertical-align: top; }
th { background: var(--bg2); }
.note {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 6px;
  padding: 0.9rem 1.1rem; margin: 1.1rem 0; max-width: 68ch; font-size: 0.95rem;
}
.btnrow { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 1.2rem 0; }
.btn {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0.5rem 1.3rem;
  border: 2px solid var(--link); border-radius: 8px; text-decoration: none;
  font-weight: 700; font-size: 1rem; color: var(--link); background: var(--bg);
}
.btn:hover, .btn:focus { color: var(--bg); background: var(--link); }
.btn--solid { color: var(--bg); background: var(--link); }
.btn--solid:hover, .btn--solid:focus { background: var(--link-h); border-color: var(--link-h); }
.toplink { display: inline-block; margin: 1.6rem 0 0; font-size: 0.9rem; }
footer.site { border-top: 2px solid var(--line); background: var(--bg2); padding: 1.6rem 0 2.2rem; margin-top: 1rem; }
footer.site h2 { border: 0; margin: 0.8rem 0 0.3rem; padding: 0; font-size: 1rem; }
footer.site ul { list-style: none; }
footer.site li { margin-bottom: 0.3rem; }
footer.site p { font-size: 0.9rem; color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
@media print { .tools, nav.main, nav.sub, .skip, .toplink { display: none; } }
