/* Codex — společný obsah, jiná typografická kompozice.
   PRAVIDLA V1–V11, I3–I4, VY3–VY4. Vše je omezené na vybrané téma.
   HEX je náhrada pro starší prohlížeče; OKLCH je autoritativní paleta. */
html[data-theme="codex"] {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #edf0f4;
  --ink: #152232;
  --ink-2: #465568;
  --ink-3: #58677a;
  --line: #d9dfe6;
  --line-2: #7b8898;
  --accent: #ffd400;
  --accent-soft: #fff2b3;
  --ok: #17613f;
  --ok-soft: #e7f3ec;
  --warn: #825000;
  --warn-soft: #fff1d6;
  --bad: #b32624;
  --bad-soft: #fcebea;
  --cx-strong: #152232;
  --cx-on-strong: #ffffff;
  --cx-hover: #304358;
  --cx-accent-ink: #152232;
  --cx-focus: #315b8a;
  --cx-footer: #152232;
  --cx-footer-ink: #f7f8fa;
  --cx-footer-muted: #b7c1ce;
  --cx-footer-line: #58677a;
  --cx-logo-surface: #ffffff;
  --cx-space: clamp(1rem, 2.4vw, 1.75rem);
  --radius: 6px;
  --radius-sm: 4px;
  --radius-xs: 3px;
  --shadow-1: none;
  --shadow-2: 0 8px 24px rgb(21 34 50 / 14%);
  --display: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --text: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --stencil: var(--display);
  --head-h: 4.5rem;
  --gutter: clamp(1rem, 4vw, 3rem);
  color-scheme: light;
  scroll-padding-block-start: calc(var(--head-h) + 1.5rem);
}
@supports (color: oklch(50% 0.1 250)) {
  html[data-theme="codex"] {
    --bg: oklch(97.8% 0.003 255);
    --surface: oklch(100% 0 0);
    --surface-2: oklch(95.3% 0.008 255);
    --ink: oklch(25% 0.035 255);
    --ink-2: oklch(44% 0.033 255);
    --ink-3: oklch(50% 0.032 255);
    --line: oklch(90% 0.012 255);
    --line-2: oklch(62% 0.027 255);
    --accent: oklch(88% 0.18 95);
    --accent-soft: oklch(96% 0.085 95);
    --ok: oklch(43% 0.09 156);
    --ok-soft: oklch(96% 0.025 156);
    --warn: oklch(44% 0.095 75);
    --warn-soft: oklch(96% 0.06 85);
    --bad: oklch(48% 0.17 27);
    --bad-soft: oklch(96% 0.026 27);
    --cx-strong: oklch(25% 0.035 255);
    --cx-on-strong: oklch(100% 0 0);
    --cx-hover: oklch(36% 0.045 255);
    --cx-accent-ink: oklch(25% 0.035 255);
    --cx-focus: oklch(45% 0.09 255);
    --cx-footer: oklch(25% 0.035 255);
    --cx-footer-ink: oklch(97.8% 0.003 255);
    --cx-footer-muted: oklch(80% 0.025 255);
    --cx-footer-line: oklch(50% 0.032 255);
  }
}

/* Základ a navigace: klidná mřížka, logo i názvosloví zůstávají společné. */
html[data-theme="codex"] body { line-height: 1.6; }
html[data-theme="codex"]:lang(ja),
html[data-theme="codex"] :lang(ja) { --text: "IBM Plex Sans", "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans JP", sans-serif; --display: var(--text); }
html[data-theme="codex"]:lang(zh-Hans),
html[data-theme="codex"] :lang(zh-Hans) { --text: "IBM Plex Sans", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; --display: var(--text); }
html[data-theme="codex"] :is(button, input, select, textarea, table, time, .figure) { font-variant-numeric: tabular-nums; }
html[data-theme="codex"] :focus-visible { outline: 3px solid var(--cx-focus); outline-offset: 3px; }
html[data-theme="codex"] ::selection { background: var(--accent); color: var(--cx-accent-ink); }
html[data-theme="codex"] .wrap { max-inline-size: 1280px; }
html[data-theme="codex"] :is(h1, h2, h3, .h2, .h3) { font-weight: 650; letter-spacing: -0.035em; line-height: 1.12; }
html[data-theme="codex"] .h2 { font-size: clamp(1.85rem, 4.5vw, 2.8rem); max-inline-size: 28ch; }
html[data-theme="codex"] .lead { max-inline-size: 58ch; font-size: clamp(1rem, 1.6vw, 1.125rem); line-height: 1.65; }
html[data-theme="codex"] .mast { border-block-end-color: var(--line); }
html[data-theme="codex"] .mast-in { gap: 0.4rem 0.75rem; padding-block: 0.65rem; }
html[data-theme="codex"] .wordmark { font-size: 1.125rem; font-weight: 650; line-height: 1; letter-spacing: -0.025em; text-transform: none; }
html[data-theme="codex"] .mark { inline-size: 2.25rem; block-size: 2.25rem; }
html[data-theme="codex"] .mast-meta { font-size: 0.75rem; font-weight: 500; letter-spacing: 0; text-transform: none; }
html[data-theme="codex"] :is(.lang-menu summary, .appearance-menu summary) { min-block-size: 44px; border-radius: var(--radius-sm); font-size: 0.875rem; letter-spacing: 0; }
html[data-theme="codex"] .app-nav a { border-radius: var(--radius-sm); font-size: 0.9375rem; min-block-size: 44px; }
html[data-theme="codex"] :is(.lang-list a[aria-current], .app-nav a[aria-current], .subtabs a[aria-current], .dev-threads a[aria-current], .choice input:checked + span) { background: var(--cx-strong); border-color: var(--cx-strong); color: var(--cx-on-strong); }
html[data-theme="codex"] .lang-list a { min-block-size: 44px; border-radius: var(--radius-sm); }
html[data-theme="codex"] .lang-list .code { font-size: 0.75rem; }
html[data-theme="codex"] .skip { background: var(--cx-strong); color: var(--cx-on-strong); }
html[data-theme="codex"] :is(.btn, .fb-toggle) { background: var(--cx-strong); border-color: var(--cx-strong); color: var(--cx-on-strong); border-radius: var(--radius-sm); font-weight: 600; }
html[data-theme="codex"] :is(.btn:hover, .fb-toggle:hover, .fb-toggle[aria-expanded="true"]) { background: var(--cx-hover); border-color: var(--cx-hover); color: var(--cx-on-strong); }
html[data-theme="codex"] .btn--line { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
html[data-theme="codex"] .btn--line:hover { background: var(--surface-2); border-color: var(--ink); color: var(--ink); }
html[data-theme="codex"] .btn:active { transform: none; }
html[data-theme="codex"] .btn:disabled { opacity: 0.6; }
html[data-theme="codex"] .btn--sm { min-block-size: 40px; font-size: 0.875rem; }
html[data-theme="codex"] .arrow { display: none; }

/* Úvod: rovná sazba místo odstupňovaných slov, pramen v rovnocenném sloupci. */
html[data-theme="codex"] .cover { padding-block: clamp(1.5rem, 5vw, 3.5rem) clamp(2.5rem, 6vw, 5rem); }
html[data-theme="codex"] .cover-meta { margin-block-end: clamp(1.75rem, 4vw, 3rem); padding-block-end: 1rem; border-block-end: 1px solid var(--line); gap: 0.5rem 1.5rem; font-size: 0.75rem; font-weight: 500; letter-spacing: 0; text-transform: none; }
html[data-theme="codex"] .cover-meta .status { gap: 0.5rem; font-weight: 600; }
html[data-theme="codex"] .cover-meta .status::before { inline-size: 0.5rem; block-size: 0.5rem; border-radius: 1px; box-shadow: none; border: 1px solid var(--cx-accent-ink); }
html[data-theme="codex"] .cover-grid { gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
html[data-theme="codex"] .cover h1 { --fit: 100cqi; font-weight: 650; font-stretch: 85%; font-size: clamp(2.5rem, 10vw, 6rem); line-height: 0.98; letter-spacing: -0.045em; }
@supports (width: 1cqi) {
  html[data-theme="codex"] .cover h1 { font-size: min(clamp(2.5rem, 10vw, 6rem), calc(100cqi / 5.4)); }
  html[data-theme="codex"]:is(:lang(ja), :lang(zh-Hans)) .cover h1 { font-size: min(clamp(2rem, 8vw, 4.8rem), calc(100cqi / 5.3)); }
}
html[data-theme="codex"] .cover h1 > span:nth-child(n):not(.sr) { margin-inline-start: 0; background: none; }
html[data-theme="codex"] .cover h1 > span:nth-child(2) { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 0.09em; text-underline-offset: 0.05em; }
html[data-theme="codex"] .cover-sub { margin-block-start: 1.75rem; gap: 1.25rem; }
html[data-theme="codex"] .cover-sub .lead { flex-basis: 100%; }
html[data-theme="codex"] .cover-cta { margin-block-start: 1.5rem; gap: 0.75rem; }
html[data-theme="codex"] .specimen { container-type: inline-size; min-inline-size: 0; }
html[data-theme="codex"] .sheet { box-shadow: none; }
html[data-theme="codex"] .sheet-head { margin: 0; font-size: 0.75rem; font-weight: 500; letter-spacing: 0; text-transform: none; background: var(--surface-2); padding: 1rem var(--cx-space); }
html[data-theme="codex"] .sheet-head span:first-child { font-weight: 600; }
html[data-theme="codex"] .sheet-body { padding: var(--cx-space); }
html[data-theme="codex"] .specimen-sheet { border-block-start: 3px solid var(--ink); }
html[data-theme="codex"] .specimen-body { padding: var(--cx-space); }
html[data-theme="codex"] .specimen-event { margin: 0 0 1.25rem; padding-inline-end: 6rem; font-size: clamp(1.25rem, 2vw, 1.65rem); font-weight: 600; letter-spacing: -0.025em; line-height: 1.2; text-transform: none; }
html[data-theme="codex"] .specimen-event span { display: block; margin: 0.3rem 0 0; font-size: 0.875rem; font-weight: 500; letter-spacing: 0; }
html[data-theme="codex"] .specimen-stamp { top: auto; right: auto; inset-block-start: 4.6rem; inset-inline-end: var(--cx-space); }
html[data-theme="codex"] .specimen-notes { border-block-start-style: solid; font-size: 0.875rem; gap: 0.6rem; }
html[data-theme="codex"] .specimen-src { font-size: 0.75rem; font-weight: 500; }
html[data-theme="codex"] .fig-cap { font: 400 0.875rem/1.55 var(--text); }
html[data-theme="codex"] .pmark,
html[data-theme="codex"] .specimen-notes li::before { border-width: 1px; border-color: var(--cx-accent-ink); background: var(--accent-soft); color: var(--cx-accent-ink); font-weight: 600; }
html[data-theme="codex"] .plate { border: 1px solid var(--cx-accent-ink); border-radius: var(--radius-xs); background: var(--accent); color: var(--cx-accent-ink); font-weight: 650; letter-spacing: 0; }
html[data-theme="codex"] .ref { border-radius: 2px; background: var(--accent-soft); color: var(--cx-accent-ink); font-weight: 500; }
html[data-theme="codex"] .stamp { --c: var(--cx-accent-ink); border-width: 1px; font-size: 0.75rem; font-weight: 500; letter-spacing: 0.02em; }
html[data-theme="codex"] .stamp--ink { --c: var(--ink); }
html[data-theme="codex"] .stamp--green,
html[data-theme="codex"] .cover-sub .stamp { --c: var(--ok); --b: var(--ok-soft); }
html[data-theme="codex"] .stamp--plate { --c: var(--cx-accent-ink); }
html[data-theme="codex"] .state { font: 500 0.875rem/1.4 var(--text); letter-spacing: 0; text-transform: none; }
html[data-theme="codex"] .flag { font-size: 0.875rem; letter-spacing: 0; }

/* Oddíly a data: jedna mřížka a jemné linky, bez dekorativních čísel. */
html[data-theme="codex"] .sec { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
html[data-theme="codex"] .mlabel { font-size: 0.875rem; font-weight: 500; line-height: 1.4; letter-spacing: 0; text-transform: none; }
html[data-theme="codex"] .mlabel::before { inline-size: 0.5rem; block-size: 0.5rem; border-color: var(--cx-accent-ink); border-width: 1px; border-radius: 1px; }
html[data-theme="codex"] .figure { padding: 1.25rem; border-radius: var(--radius); background: var(--surface); gap: 0.75rem; }
html[data-theme="codex"] .figure dd { font-size: clamp(2rem, 5vw, 3rem); font-weight: 500; line-height: 1.05; letter-spacing: -0.05em; }
html[data-theme="codex"] .figure dt { font-size: 0.875rem; }
html[data-theme="codex"] .note { font: 400 0.875rem/1.6 var(--text); }
html[data-theme="codex"] .steps { gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
html[data-theme="codex"] .step { border: 0; border-radius: 0; background: transparent; padding: 1.25rem; }
html[data-theme="codex"] .step + .step { border-block-start: 1px solid var(--line); }
html[data-theme="codex"] .step::after { content: none; }
html[data-theme="codex"] .step p { font-size: 1rem; }
html[data-theme="codex"] .tbl th { background: var(--surface-2); padding-block: 0.8rem; color: var(--ink-2); font: 500 0.875rem/1.3 var(--text); letter-spacing: 0; text-transform: none; text-align: start; }
html[data-theme="codex"] .tbl td { padding-block: 0.85rem; }
html[data-theme="codex"] .tbl :is(.num, .t) { text-align: end; }
html[data-theme="codex"] .tbl .pos { font-weight: 500; letter-spacing: -0.04em; }
html[data-theme="codex"] .tbl .who b { font-weight: 600; letter-spacing: 0; overflow-wrap: anywhere; }
html[data-theme="codex"] .tbl .who small { font-size: 0.875rem; }
html[data-theme="codex"] .specimen-tbl { font-size: 0.875rem; }
html[data-theme="codex"] .specimen-tbl :is(th, td) { padding-inline: 0.35rem; padding-block: 0.65rem; }
html[data-theme="codex"] .specimen-tbl th { font-size: 0.75rem; }
html[data-theme="codex"] .specimen-tbl .pos { inline-size: 1.6rem; }
html[data-theme="codex"] .entry-list .disc b { font: 600 1.0625rem/1.3 var(--text); letter-spacing: 0; text-transform: none; }
html[data-theme="codex"] .passes { gap: 1rem; }
html[data-theme="codex"] .pass { --band: var(--surface-2); --band-ink: var(--ink); box-shadow: none; }
html[data-theme="codex"] .pass-band { padding: 1rem; border-block-end: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; text-transform: none; }
html[data-theme="codex"] .pass-band small { font-size: 0.75rem; font-weight: 500; letter-spacing: 0; }
html[data-theme="codex"] .pass-body h3 { font-weight: 600; }
html[data-theme="codex"] .pass--fan .pass-band,
html[data-theme="codex"] .pass--tester .pass-band { background: var(--accent-soft); color: var(--cx-accent-ink); }
html[data-theme="codex"] :is(.pass--admin, .pass--pro, .pass--org) .pass-band { background: var(--cx-strong); color: var(--cx-on-strong); }
html[data-theme="codex"] .pass-id { font-size: 0.75rem; font-weight: 500; }
html[data-theme="codex"] .partner--lg { background: var(--cx-logo-surface); border-radius: var(--radius); }

/* Stejné komponenty ve formulářích, interních revizích a vývojovém pultu. */
html[data-theme="codex"] :is(.field-label, .legend, .kv dt) { font: 500 0.875rem/1.4 var(--text); letter-spacing: 0; text-transform: none; }
html[data-theme="codex"] :is(.field input, .field textarea, .field select, .input, .fb-form textarea) { border-color: var(--line-2); border-radius: var(--radius-sm); }
html[data-theme="codex"] :is(.field input:focus, .field textarea:focus, .field select:focus, .fb-form textarea:focus) { outline: 3px solid var(--cx-focus); outline-offset: 2px; box-shadow: none; }
html[data-theme="codex"] .field select { appearance: none; padding-inline-end: 2.2rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m2.5 4.5 3.5 3.5 3.5-3.5' fill='none' stroke='%23465568' stroke-width='1.8'/%3E%3C/svg%3E"); background-size: 0.75rem; background-position: right 0.85rem center; background-repeat: no-repeat; }
html[data-theme="codex"] .choice span { border-radius: var(--radius-sm); min-block-size: 44px; }
html[data-theme="codex"] .tick input { appearance: auto; accent-color: var(--cx-strong); border-radius: var(--radius-xs); }
html[data-theme="codex"] .flash--ok { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
html[data-theme="codex"] .flash--err { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
html[data-theme="codex"] :is(.page-head h1, .event-head h1, .legal h1, .nf h1) { font-weight: 600; letter-spacing: -0.04em; line-height: 1.1; text-transform: none; }
html[data-theme="codex"] .page-head h1 { font-size: clamp(2rem, 6vw, 3.5rem); }
html[data-theme="codex"] .event-head h1 { font-size: clamp(2.25rem, 7vw, 4.5rem); }
html[data-theme="codex"] .proto-bar { color: var(--cx-accent-ink); }
html[data-theme="codex"] .crumbs { font-size: 0.75rem; letter-spacing: 0; text-transform: none; }
html[data-theme="codex"] .tabs a { font: 600 1rem var(--text); letter-spacing: 0; text-transform: none; }
html[data-theme="codex"] .subtabs a { min-block-size: 40px; border-radius: var(--radius-sm); font-size: 0.875rem; letter-spacing: 0; text-transform: none; }
html[data-theme="codex"] .src-tag--ai { background: var(--cx-strong); color: var(--cx-on-strong); }
html[data-theme="codex"] .scan pre { color: var(--ink-2); }
html[data-theme="codex"] :is(.scan mark, .diff ins, .pending, .legal .fallback) { color: var(--cx-accent-ink); }
html[data-theme="codex"] .queue tr[aria-selected="true"] { background: var(--surface-2); box-shadow: inset 4px 0 0 var(--accent); }
html[data-theme="codex"] .msg--user { background: var(--surface-2); color: var(--ink); }
html[data-theme="codex"] .fb-msg--user { background: var(--cx-strong); color: var(--cx-on-strong); }
html[data-theme="codex"] .fb-msg--user .small { color: inherit; }
html[data-theme="codex"] .fb-toggle::before { color: var(--cx-accent-ink); }
html[data-theme="codex"] .dev-check--manual .dev-check-mark { color: var(--cx-accent-ink); }
html[data-theme="codex"] .dev-check--ok .dev-check-mark { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok); }
html[data-theme="codex"] .dev-check--bad .dev-check-mark { background: var(--bad-soft); color: var(--bad); border: 1px solid var(--bad); }
html[data-theme="codex"] .md pre { background: var(--cx-footer); color: var(--cx-footer-ink); }
html[data-theme="codex"] .foot { background: var(--cx-footer); color: var(--cx-footer-ink); }
html[data-theme="codex"] .foot :is(a, .brand) { color: var(--cx-footer-ink); }
html[data-theme="codex"] .foot :is(h2, .muted, .foot-ids, .foot-legal) { color: var(--cx-footer-muted); }
html[data-theme="codex"] .foot h2 { font-size: 0.875rem; font-weight: 500; letter-spacing: 0; text-transform: none; }
html[data-theme="codex"] .foot-legal { border-block-start-color: var(--cx-footer-line); }
html[data-theme="codex"] .foot :is(.mark-loop, .mark-joker) { stroke: var(--cx-footer-ink); }
html[data-theme="codex"] .foot .mark-dot { stroke: var(--cx-footer); }
html[data-theme="codex"] .foot :focus-visible { outline-color: var(--accent); }

@media (min-width: 900px) {
  html[data-theme="codex"] .doc { grid-template-columns: 10rem minmax(0, 1fr); column-gap: clamp(2rem, 5vw, 5rem); }
  html[data-theme="codex"] .steps .step + .step { border-block-start: 0; border-inline-start: 1px solid var(--line); }
  html[data-theme="codex"] .mast-meta { display: none; }
}
@media (min-width: 960px) {
  html[data-theme="codex"] .cover-grid { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); }
}
@media (min-width: 1280px) {
  html[data-theme="codex"] .mast-meta { display: block; }
}
@container (max-width: 25rem) {
  html[data-theme="codex"] .specimen-body { padding: 0.85rem; }
  html[data-theme="codex"] .specimen-event { font-size: 1.25rem; }
  html[data-theme="codex"] .specimen-tbl .who { font-size: 0.875rem; }
  html[data-theme="codex"] .specimen-tbl .plate { min-inline-size: 1.8em; }
  html[data-theme="codex"] .specimen-tbl :is(th, td) { padding-inline: 0.2rem; }
}
@media (pointer: coarse) {
  html[data-theme="codex"] :is(.btn--sm, .subtabs a, .foot-langs a) { min-block-size: 44px; }
}

/* Tmavé schéma se řídí systémem; význam značky a stavů se nemění. */
@media (prefers-color-scheme: dark) {
  html[data-theme="codex"] {
    --bg: #101923;
    --surface: #16212d;
    --surface-2: #202d3b;
    --ink: #edf2f8;
    --ink-2: #c0cbd8;
    --ink-3: #a9b8c9;
    --line: #354557;
    --line-2: #7b90a7;
    --accent: #ffd400;
    --accent-soft: #f3de85;
    --ok: #8bd7ac;
    --ok-soft: #183c2c;
    --warn: #f0c77b;
    --warn-soft: #3b301b;
    --bad: #ffaaa5;
    --bad-soft: #482727;
    --cx-strong: #f3de85;
    --cx-on-strong: #152232;
    --cx-hover: #ffe9a0;
    --cx-focus: #ffd400;
    color-scheme: dark;
  }
  @supports (color: oklch(50% 0.1 250)) {
    html[data-theme="codex"] {
      --bg: oklch(21% 0.025 255);
      --surface: oklch(25% 0.027 255);
      --surface-2: oklch(30% 0.032 255);
      --ink: oklch(96% 0.01 255);
      --ink-2: oklch(83% 0.025 255);
      --ink-3: oklch(76% 0.03 255);
      --line: oklch(39% 0.035 255);
      --line-2: oklch(67% 0.045 255);
      --accent: oklch(88% 0.18 95);
      --accent-soft: oklch(90% 0.12 95);
      --ok: oklch(82% 0.095 156);
      --ok-soft: oklch(32% 0.05 156);
      --warn: oklch(84% 0.1 85);
      --warn-soft: oklch(32% 0.045 85);
      --bad: oklch(82% 0.1 27);
      --bad-soft: oklch(33% 0.055 27);
      --cx-strong: oklch(90% 0.12 95);
      --cx-on-strong: oklch(25% 0.035 255);
      --cx-hover: oklch(94% 0.1 95);
      --cx-focus: oklch(88% 0.18 95);
    }
  }
  html[data-theme="codex"] .field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m2.5 4.5 3.5 3.5 3.5-3.5' fill='none' stroke='%23c0cbd8' stroke-width='1.8'/%3E%3C/svg%3E"); }
}
@media (prefers-reduced-motion: reduce) {
  html[data-theme="codex"] *,
  html[data-theme="codex"] *::before,
  html[data-theme="codex"] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  html[data-theme="codex"] {
    --bg: Canvas; --surface: Canvas; --surface-2: Canvas;
    --ink: CanvasText; --ink-2: CanvasText; --ink-3: CanvasText;
    --line: CanvasText; --line-2: ButtonText;
    --accent: Highlight; --accent-soft: Canvas;
    --ok: CanvasText; --ok-soft: Canvas; --bad: CanvasText; --bad-soft: Canvas;
    --warn: CanvasText; --warn-soft: Canvas;
    --cx-strong: ButtonFace; --cx-on-strong: ButtonText; --cx-hover: Highlight;
    --cx-accent-ink: CanvasText; --cx-focus: Highlight;
    --cx-footer: Canvas; --cx-footer-ink: CanvasText; --cx-footer-muted: CanvasText; --cx-footer-line: CanvasText;
  }
  html[data-theme="codex"] :is(a, button, input, summary, .plate, .stamp, .ref) { forced-color-adjust: auto; }
  html[data-theme="codex"] .foot .partner img { filter: none; }
  html[data-theme="codex"] :is(.btn, .lang-list a[aria-current], .app-nav a[aria-current]) { border: 1px solid ButtonText; }
  html[data-theme="codex"] :is(.btn:hover, .fb-toggle:hover, .fb-toggle[aria-expanded="true"]) { background: Highlight; color: HighlightText; }
  html[data-theme="codex"] .field select { appearance: auto; background-image: none; }
}
@media print {
  html[data-theme="codex"] {
    --bg: white; --surface: white; --surface-2: white;
    --ink: black; --ink-2: black; --ink-3: black;
    --line: black; --line-2: black; --accent: white; --accent-soft: white;
    --cx-accent-ink: black; --ok: black; --ok-soft: white; --bad: black; --bad-soft: white;
    color-scheme: light;
  }
  html[data-theme="codex"] .appearance-menu { display: none !important; }
  html[data-theme="codex"] .cover { padding-block: 1rem; }
  html[data-theme="codex"] :is(.sheet, .step, .figure, .pass) { break-inside: avoid; box-shadow: none; }
}
