/*
 * Kolla-Ansible Academy portal: visual identity on top of the Zensical theme.
 *
 * Neutral slate base, one accent colour, system fonts, no web fonts and no
 * animation beyond the theme defaults. Every colour is a custom property
 * defined once per scheme (light: data-md-color-scheme="default",
 * dark: "slate"). Text/background pairs meet WCAG AA in both schemes.
 *
 * Contents
 *   1. Tokens (fonts, colours per scheme)
 *   2. Layout and typography
 *   3. Evidence chips            [CODE] / [NOT AVAILABLE]
 *   4. Impact chips              front matter `impact`
 *   5. Admonitions               GitHub alerts: note, tip, important, warning, caution
 *   6. Tables                    wide tables, key/value tables, severity cells
 *   7. Code blocks
 *   8. Grid cards (hub pages)
 *   9. Home page hero, search trigger, recently updated
 *  10. Page footer line, tags, anchors
 *  11. Reduced motion
 *  12. Print
 *  13. Releases                  header selector, home hero line, root pages
 */

/* ------------------------------------------------------------------ 1. Tokens */

:root,
body {
  --portal-font-text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    "Noto Sans", "Liberation Sans", Arial, sans-serif;
  --portal-font-code: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", "DejaVu Sans Mono", monospace;

  /* The theme reads these two (it sets them on <body>). */
  --md-text-font-family: var(--portal-font-text);
  --md-code-font-family: var(--portal-font-code);
}

[data-md-color-scheme="default"] {
  color-scheme: light;

  --portal-bg: #ffffff;
  --portal-surface: #f5f7f9;
  --portal-surface-strong: #eceff3;
  --portal-border: #dde2e8;
  --portal-border-strong: #c3cbd5;
  --portal-text: #1a2029;
  --portal-text-muted: #55606e;
  --portal-accent: #0f62a6;
  --portal-accent-strong: #0a4a80;
  --portal-accent-soft: #e7f0f8;

  /* Evidence chips */
  --portal-ev-code-fg: #3b4755;
  --portal-ev-code-bg: #eef1f4;
  --portal-ev-code-border: #cfd6de;
  --portal-ev-na-fg: #7a4a00;
  --portal-ev-na-bg: #fdf3dc;
  --portal-ev-na-border: #e8cf94;

  /* Status hues: text, tint, border. Shared by chips, severity, admonitions. */
  --portal-green-fg: #1b6a3b;
  --portal-green-bg: #e9f5ed;
  --portal-green-border: #b9dcc5;
  --portal-slate-fg: #3b4755;
  --portal-slate-bg: #eef1f4;
  --portal-slate-border: #cfd6de;
  --portal-blue-fg: #0f5a99;
  --portal-blue-bg: #e7f0f8;
  --portal-blue-border: #b8d3ea;
  --portal-amber-fg: #7a4a00;
  --portal-amber-bg: #fdf3dc;
  --portal-amber-border: #e8cf94;
  --portal-orange-fg: #94380a;
  --portal-orange-bg: #fdece1;
  --portal-orange-border: #efc3a6;
  --portal-red-fg: #a11b12;
  --portal-red-bg: #fde7e4;
  --portal-red-border: #efb5ae;
  --portal-violet-fg: #54389a;
  --portal-violet-bg: #f0ecfa;
  --portal-violet-border: #cfc3ec;
  --portal-teal-fg: #0b635d;
  --portal-teal-bg: #e4f4f2;
  --portal-teal-border: #b2dcd8;

  /* Solid chips: the two classes that must stand out. */
  --portal-critical-bg: #b42318;
  --portal-critical-fg: #ffffff;
  --portal-window-bg: #54389a;
  --portal-window-fg: #ffffff;

  /* Theme variables */
  --md-default-bg-color: var(--portal-bg);
  --md-default-fg-color: var(--portal-text);
  --md-default-fg-color--light: var(--portal-text-muted);
  --md-default-fg-color--lighter: #1a202952;
  --md-default-fg-color--lightest: #1a202912;
  --md-primary-fg-color: var(--portal-accent);
  --md-primary-fg-color--light: #3c82bd;
  --md-primary-fg-color--dark: var(--portal-accent-strong);
  --md-primary-bg-color: #ffffff;
  --md-primary-bg-color--light: #ffffffb3;
  --md-accent-fg-color: var(--portal-accent-strong);
  --md-accent-fg-color--transparent: #0f62a61a;
  --md-accent-bg-color: #ffffff;
  --md-typeset-color: var(--portal-text);
  --md-typeset-a-color: var(--portal-accent);
  --md-typeset-table-color: var(--portal-border);
  --md-typeset-table-color--light: #1a202908;
  --md-typeset-mark-color: #ffe58a;
  --md-code-fg-color: #27303b;
  --md-code-bg-color: #f2f4f7;
  --md-code-bg-color--light: #f2f4f7e6;
  --md-code-bg-color--lighter: #f2f4f78a;
  --md-code-hl-comment-color: #5b6673;
  --md-code-hl-string-color: #1a6f43;
  --md-code-hl-number-color: #b32424;
  --md-code-hl-keyword-color: #2a5cb0;
  --md-code-hl-function-color: #8a3a9b;
  --md-code-hl-constant-color: #5b47c2;
  --md-code-hl-special-color: #b5124a;
  --md-admonition-fg-color: var(--portal-text);
  --md-admonition-bg-color: var(--portal-bg);
  --md-footer-bg-color: #1a2029;
  --md-footer-bg-color--dark: #12161c;
}

[data-md-color-scheme="slate"] {
  color-scheme: dark;

  --portal-bg: #11151a;
  --portal-surface: #181d24;
  --portal-surface-strong: #1f262f;
  --portal-border: #2a323d;
  --portal-border-strong: #3d4856;
  --portal-text: #dfe4ea;
  --portal-text-muted: #a1acb9;
  --portal-accent: #74b7ee;
  --portal-accent-strong: #a3d0f5;
  --portal-accent-soft: #15293b;

  --portal-ev-code-fg: #c5ced8;
  --portal-ev-code-bg: #222a33;
  --portal-ev-code-border: #3a4552;
  --portal-ev-na-fg: #f0c674;
  --portal-ev-na-bg: #33290f;
  --portal-ev-na-border: #5e4a17;

  --portal-green-fg: #8fd3a6;
  --portal-green-bg: #14261b;
  --portal-green-border: #24492f;
  --portal-slate-fg: #c5ced8;
  --portal-slate-bg: #222a33;
  --portal-slate-border: #3a4552;
  --portal-blue-fg: #8cc3f2;
  --portal-blue-bg: #13273a;
  --portal-blue-border: #214665;
  --portal-amber-fg: #f0c674;
  --portal-amber-bg: #33290f;
  --portal-amber-border: #5e4a17;
  --portal-orange-fg: #f6a878;
  --portal-orange-bg: #382011;
  --portal-orange-border: #663a1d;
  --portal-red-fg: #ff9d95;
  --portal-red-bg: #3d1613;
  --portal-red-border: #6f2822;
  --portal-violet-fg: #c3b1f5;
  --portal-violet-bg: #251d3d;
  --portal-violet-border: #43357a;
  --portal-teal-fg: #7fd4cb;
  --portal-teal-bg: #10292a;
  --portal-teal-border: #1d4a4a;

  --portal-critical-bg: #c62f25;
  --portal-critical-fg: #ffffff;
  --portal-window-bg: #6a4bc4;
  --portal-window-fg: #ffffff;

  --md-default-bg-color: var(--portal-bg);
  --md-default-fg-color: var(--portal-text);
  --md-default-fg-color--light: var(--portal-text-muted);
  --md-default-fg-color--lighter: #dfe4ea52;
  --md-default-fg-color--lightest: #dfe4ea1a;
  --md-primary-fg-color: var(--portal-accent);
  --md-primary-fg-color--light: #a3d0f5;
  --md-primary-fg-color--dark: #4a97d8;
  --md-primary-bg-color: #11151a;
  --md-primary-bg-color--light: #11151ab3;
  --md-accent-fg-color: var(--portal-accent-strong);
  --md-accent-fg-color--transparent: #74b7ee24;
  --md-accent-bg-color: #11151a;
  --md-typeset-color: var(--portal-text);
  --md-typeset-a-color: var(--portal-accent);
  --md-typeset-table-color: var(--portal-border);
  --md-typeset-table-color--light: #dfe4ea0a;
  --md-typeset-mark-color: #574300;
  --md-code-fg-color: #d5dbe2;
  --md-code-bg-color: #181d24;
  --md-code-bg-color--light: #181d24e6;
  --md-code-bg-color--lighter: #181d248a;
  --md-code-hl-comment-color: #9aa5b2;
  --md-code-hl-string-color: #7fcf9c;
  --md-code-hl-number-color: #f29488;
  --md-code-hl-keyword-color: #8db4f0;
  --md-code-hl-function-color: #d79be3;
  --md-code-hl-constant-color: #b0a3f0;
  --md-code-hl-special-color: #f58cae;
  --md-admonition-fg-color: var(--portal-text);
  --md-admonition-bg-color: var(--portal-bg);
  --md-footer-bg-color: #0c0f13;
  --md-footer-bg-color--dark: #090b0e;
}

/* ------------------------------------------------- 2. Layout and typography */

/* Same text size on very large screens: more content, not bigger letters. */
@media screen and (min-width: 100em) {
  html {
    font-size: 125%;
  }
}

/* A wider page than the theme default (61rem) leaves room for tables. */
.md-grid {
  max-width: 70rem;
}

/* Opaque header: no frosted glass over the scrolling text. */
.md-header {
  background-color: var(--portal-bg);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.md-header--shadow {
  box-shadow: 0 0.05rem 0 var(--portal-border);
}

/* The page title that waits to slide into the header sits 1.25rem to the
   right of its place. On a small screen a long title then widens the page
   (seen without JavaScript): it is clipped to the title area. */
.md-header__title > .md-header__ellipsis {
  overflow: hidden;
}

.md-typeset {
  font-size: 0.78rem;
  line-height: 1.65;
}

.md-typeset h1 {
  margin-bottom: 0.8em;
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--portal-text);
}

.md-typeset h2 {
  margin-top: 2.2em;
  padding-top: 0.9em;
  font-size: 1.2rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  border-top: 0.05rem solid var(--portal-border);
}

.md-typeset h3 {
  margin-top: 1.9em;
  font-size: 0.98rem;
  font-weight: 650;
  letter-spacing: -0.005em;
}

.md-typeset h4 {
  font-size: 0.82rem;
  font-weight: 650;
}

/* The source separates sections with `---`; headings already draw that line. */
.md-typeset hr:has(+ h2) {
  display: none;
}

.md-typeset a {
  text-decoration-thickness: 0.05rem;
  text-underline-offset: 0.16em;
}

.md-typeset a:focus-visible,
.md-nav__link:focus-visible,
.md-tabs__link:focus-visible {
  outline: 0.1rem solid var(--portal-accent);
  outline-offset: 0.1rem;
  border-radius: 0.1rem;
}

/* --------------------------------------------------------- 3. Evidence chips */

.md-typeset .ev,
.md-nav .ev {
  display: inline-block;
  padding: 0.18em 0.5em;
  font-family: var(--portal-font-text);
  font-size: 0.72em;
  font-weight: 650;
  font-style: normal;
  line-height: 1.25;
  letter-spacing: 0.04em;
  white-space: nowrap;
  vertical-align: 0.08em;
  border: 0.05rem solid;
  border-radius: 0.2rem;
}

.md-typeset .ev-code,
.md-nav .ev-code {
  color: var(--portal-ev-code-fg);
  background-color: var(--portal-ev-code-bg);
  border-color: var(--portal-ev-code-border);
}

.md-typeset .ev-na,
.md-nav .ev-na {
  color: var(--portal-ev-na-fg);
  background-color: var(--portal-ev-na-bg);
  border-color: var(--portal-ev-na-border);
}

/* In headings the chip follows the heading, at a fixed readable size. */
.md-typeset :is(h1, h2, h3, h4, h5, h6) .ev {
  font-size: 0.6rem;
  vertical-align: 0.25em;
}

/* In the table of contents the chip is reduced to a quiet label. */
.md-nav .ev {
  padding: 0 0.3em;
  font-size: 0.82em;
  vertical-align: 0;
}

/* ----------------------------------------------------------- 4. Impact chips */

.md-typeset .portal-impact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
  margin: -0.4rem 0 1.2rem;
}

.md-typeset .portal-impact__label {
  margin-right: 0.2rem;
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  color: var(--portal-text-muted);
  text-transform: uppercase;
}

.md-typeset .portal-impact__chip {
  display: inline-block;
  padding: 0.22em 0.7em;
  font-size: 0.66rem;
  font-weight: 650;
  line-height: 1.4;
  color: var(--portal-slate-fg);
  text-decoration: none;
  white-space: nowrap;
  background-color: var(--portal-slate-bg);
  border: 0.05rem solid var(--portal-slate-border);
  border-radius: 0.25rem;
}

.md-typeset .portal-impact__chip:hover,
.md-typeset .portal-impact__chip:focus-visible {
  text-decoration: underline;
}

.md-typeset .portal-impact__chip--read-only {
  color: var(--portal-green-fg);
  background-color: var(--portal-green-bg);
  border-color: var(--portal-green-border);
}

.md-typeset .portal-impact__chip--writes-config {
  color: var(--portal-slate-fg);
  background-color: var(--portal-slate-bg);
  border-color: var(--portal-slate-border);
}

.md-typeset .portal-impact__chip--pulls-images {
  color: var(--portal-blue-fg);
  background-color: var(--portal-blue-bg);
  border-color: var(--portal-blue-border);
}

.md-typeset .portal-impact__chip--restarts-on-drift {
  color: var(--portal-amber-fg);
  background-color: var(--portal-amber-bg);
  border-color: var(--portal-amber-border);
}

.md-typeset .portal-impact__chip--recreates-containers {
  color: var(--portal-orange-fg);
  background-color: var(--portal-orange-bg);
  border-color: var(--portal-orange-border);
}

.md-typeset .portal-impact__chip--recovery {
  color: var(--portal-teal-fg);
  background-color: var(--portal-teal-bg);
  border-color: var(--portal-teal-border);
}

/* The two classes an operator must not miss are solid. */
.md-typeset .portal-impact__chip--critical {
  color: var(--portal-critical-fg);
  background-color: var(--portal-critical-bg);
  border-color: var(--portal-critical-bg);
}

.md-typeset .portal-impact__chip--maintenance-window {
  color: var(--portal-window-fg);
  background-color: var(--portal-window-bg);
  border-color: var(--portal-window-bg);
}

/*
 * The same class names written in the text as code spans (catalogue of the
 * Operations hub, definitions on the Conventions page): the class is set by
 * tools/site/portal_mdx/impact.py. They keep the look of code, never break
 * in the middle of a name, and take the colour of the matching chip.
 */
.md-typeset code.impact {
  font-weight: 600;
  white-space: nowrap;
  color: var(--portal-slate-fg);
  background-color: var(--portal-slate-bg);
  box-shadow: inset 0 0 0 0.05rem var(--portal-slate-border);
}

.md-typeset code.impact--read-only {
  color: var(--portal-green-fg);
  background-color: var(--portal-green-bg);
  box-shadow: inset 0 0 0 0.05rem var(--portal-green-border);
}

.md-typeset code.impact--pulls-images {
  color: var(--portal-blue-fg);
  background-color: var(--portal-blue-bg);
  box-shadow: inset 0 0 0 0.05rem var(--portal-blue-border);
}

.md-typeset code.impact--restarts-on-drift {
  color: var(--portal-amber-fg);
  background-color: var(--portal-amber-bg);
  box-shadow: inset 0 0 0 0.05rem var(--portal-amber-border);
}

.md-typeset code.impact--recreates-containers {
  color: var(--portal-orange-fg);
  background-color: var(--portal-orange-bg);
  box-shadow: inset 0 0 0 0.05rem var(--portal-orange-border);
}

.md-typeset code.impact--recovery {
  color: var(--portal-teal-fg);
  background-color: var(--portal-teal-bg);
  box-shadow: inset 0 0 0 0.05rem var(--portal-teal-border);
}

.md-typeset code.impact--critical {
  color: var(--portal-critical-fg);
  background-color: var(--portal-critical-bg);
  box-shadow: none;
}

.md-typeset code.impact--maintenance-window {
  color: var(--portal-window-fg);
  background-color: var(--portal-window-bg);
  box-shadow: none;
}

/* ------------------------------------------------------------ 5. Admonitions */

.md-typeset .admonition,
.md-typeset details {
  --portal-adm-fg: var(--portal-blue-fg);
  --portal-adm-bg: var(--portal-blue-bg);
  --portal-adm-border: var(--portal-blue-border);

  padding: 0 0.9rem;
  font-size: 0.72rem;
  color: var(--portal-text);
  background-color: var(--portal-adm-bg);
  border: 0.05rem solid var(--portal-adm-border);
  border-left: 0.2rem solid var(--portal-adm-fg);
  border-radius: 0.2rem;
  box-shadow: none;
}

.md-typeset .admonition-title,
.md-typeset summary {
  margin-top: 0.7rem;
  margin-bottom: 0.6em;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--portal-adm-fg);
  text-transform: uppercase;
}

.md-typeset .admonition > .admonition-title::before,
.md-typeset details > summary::before {
  top: 0.05em;
  background-color: var(--portal-adm-fg);
}

.md-typeset details > summary::after {
  color: var(--portal-adm-fg);
}

.md-typeset :is(.admonition, details).note {
  --portal-adm-fg: var(--portal-blue-fg);
  --portal-adm-bg: var(--portal-blue-bg);
  --portal-adm-border: var(--portal-blue-border);
}

.md-typeset :is(.admonition, details).tip {
  --portal-adm-fg: var(--portal-green-fg);
  --portal-adm-bg: var(--portal-green-bg);
  --portal-adm-border: var(--portal-green-border);
}

.md-typeset :is(.admonition, details).important {
  --portal-adm-fg: var(--portal-violet-fg);
  --portal-adm-bg: var(--portal-violet-bg);
  --portal-adm-border: var(--portal-violet-border);
}

.md-typeset :is(.admonition, details).warning {
  --portal-adm-fg: var(--portal-amber-fg);
  --portal-adm-bg: var(--portal-amber-bg);
  --portal-adm-border: var(--portal-amber-border);
}

.md-typeset :is(.admonition, details).caution {
  --portal-adm-fg: var(--portal-red-fg);
  --portal-adm-bg: var(--portal-red-bg);
  --portal-adm-border: var(--portal-red-border);
}

/* The theme tints the types it knows (note, tip, warning) with its own
   colours, in a rule as specific as this one: this one comes later. */
.md-typeset :is(.admonition, details):is(.note, .tip, .important, .warning, .caution) {
  background-color: var(--portal-adm-bg);
}

/* Icons: set in zensical.base.toml ([project.theme.icon.admonition]). */
.md-typeset .note > :is(.admonition-title, summary)::before {
  -webkit-mask-image: var(--md-admonition-icon--note);
  mask-image: var(--md-admonition-icon--note);
}

.md-typeset .tip > :is(.admonition-title, summary)::before {
  -webkit-mask-image: var(--md-admonition-icon--tip);
  mask-image: var(--md-admonition-icon--tip);
}

.md-typeset .important > :is(.admonition-title, summary)::before {
  -webkit-mask-image: var(--md-admonition-icon--important, var(--md-admonition-icon--info));
  mask-image: var(--md-admonition-icon--important, var(--md-admonition-icon--info));
}

.md-typeset .warning > :is(.admonition-title, summary)::before {
  -webkit-mask-image: var(--md-admonition-icon--warning);
  mask-image: var(--md-admonition-icon--warning);
}

.md-typeset .caution > :is(.admonition-title, summary)::before {
  -webkit-mask-image: var(--md-admonition-icon--caution, var(--md-admonition-icon--danger));
  mask-image: var(--md-admonition-icon--caution, var(--md-admonition-icon--danger));
}

/* Plain <details> (no alert type): neutral. */
.md-typeset details:not([class]) {
  --portal-adm-fg: var(--portal-slate-fg);
  --portal-adm-bg: var(--portal-surface);
  --portal-adm-border: var(--portal-border);
}

/* Inline code and chips inside a tinted box keep their own contrast. */
.md-typeset :is(.admonition, details) code:not(.impact) {
  background-color: var(--portal-bg);
}

/* ----------------------------------------------------------------- 6. Tables */

.md-typeset table:not([class]) {
  font-size: 0.68rem;
  line-height: 1.5;
  border: 0.05rem solid var(--portal-border);
  border-radius: 0.2rem;
}

.md-typeset table:not([class]) th {
  padding: 0.6em 0.9em;
  font-weight: 650;
  color: var(--portal-text);
  vertical-align: bottom;
  background-color: var(--portal-surface);
  border-bottom: 0.05rem solid var(--portal-border-strong);
}

.md-typeset table:not([class]) td {
  padding: 0.6em 0.9em;
}

.md-typeset table:not([class]) :is(td, th) + :is(td, th) {
  border-left: 0.05rem solid var(--portal-border);
}

/*
 * Code in cells (paths, `file:line` citations, commands). A line may break
 * after `-`, and after `/` and `,` where tools/site/portal_mdx/breaks.py has
 * put a <wbr>. In a table that is fitted to the text column, a token that is
 * still too long breaks where the line ends: one long identifier must not
 * make the whole table scroll sideways.
 */
.md-typeset table:not([class]) code {
  font-size: 0.92em;
  word-break: normal;
  overflow-wrap: anywhere;
}

/*
 * On a wide screen, a command or an identifier in a cell is not cut in the
 * middle of a word: its column grows to fit its longest token instead
 * (`break-word` counts that token in the column's minimum width, `anywhere`
 * does not). Citations keep breaking anywhere, after their <wbr>. On a narrow
 * screen every code span may break anywhere, so the table still fits.
 */
@media screen and (min-width: 60em) {
  .md-typeset table:not([class]) code:not(.cite) {
    overflow-wrap: break-word;
  }
}

/*
 * Wide tables (five columns or more). Instead of being squeezed into the
 * text column, the table takes the width its content needs, each column
 * capped so prose cells stay readable, and scrolls sideways inside the
 * theme's scroll wrapper. The page itself never scrolls sideways.
 *
 * The scroll wrapper is added by the theme's script, hence the
 * `.md-typeset__table >` prefix: without JavaScript the table keeps the
 * theme's fallback (it scrolls on its own).
 */
.md-typeset__table > table:not([class]):has(> thead th:nth-child(5)) {
  width: max-content;
  min-width: 100%;
  max-width: none;
}

.md-typeset table:not([class]):has(> thead th:nth-child(5)) :is(th, td) {
  min-width: 4.5rem;
  max-width: min(15rem, 75vw);
}

/* The first column is the key of the row (tag, role, command, number). */
.md-typeset table:not([class]):has(> thead th:nth-child(5)) :is(th, td):first-child {
  max-width: min(11rem, 60vw);
}

/* Tokens stay whole here: the table scrolls anyway. */
.md-typeset table:not([class]):has(> thead th:nth-child(5)) code {
  overflow-wrap: break-word;
}

/* Dense tables (seven columns or more): smaller type, narrower columns. */
.md-typeset table:not([class]):has(> thead th:nth-child(7)) {
  font-size: 0.62rem;
}

.md-typeset table:not([class]):has(> thead th:nth-child(7)) :is(th, td) {
  padding: 0.5em 0.7em;
  max-width: min(13rem, 75vw);
}

.md-typeset table:not([class]):has(> thead th:nth-child(7)) :is(th, td):first-child {
  max-width: min(10rem, 60vw);
}

/*
 * On screens wide enough for it, the first column of a wide table stays in
 * place while the others scroll, so a cell is always read next to its key.
 * The scroll area is then exactly the text column (the theme lets tables
 * run 0.8rem into each margin, which would show cells left of a fixed one).
 */
@media screen and (min-width: 60em) {
  .md-typeset__scrollwrap:has(> .md-typeset__table > table > thead th:nth-child(5)) {
    margin-right: 0;
    margin-left: 0;
  }

  .md-typeset__table:has(> table > thead th:nth-child(5)) {
    padding: 0;
  }

  .md-typeset__table > table:not([class]):has(> thead th:nth-child(5)) {
    overflow: visible;
  }

  .md-typeset__table > table:not([class]):has(> thead th:nth-child(5)) :is(th, td):first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background-color: var(--portal-bg);
    box-shadow: inset -0.1rem 0 0 var(--portal-border-strong);
  }

  .md-typeset__table > table:not([class]):has(> thead th:nth-child(5)) th:first-child {
    background-color: var(--portal-surface);
  }

  .md-typeset__table > table:not([class]):has(> thead th:nth-child(5)) :is(th, td):first-child + :is(th, td) {
    border-left: 0;
  }
}

.md-typeset__scrollwrap {
  scrollbar-color: var(--portal-border-strong) transparent;
  scrollbar-width: thin;
}

/* A wrapper that scrolls is focusable (portal.js): Tab, then arrow keys. */
.md-typeset__scrollwrap:focus-visible,
.md-typeset div.mermaid:focus-visible {
  outline: 0.1rem solid var(--portal-accent);
  outline-offset: 0.1rem;
}

/*
 * Key/value tables: two columns under an empty header row (`| | |`), used
 * for one record per section (risks, findings, questions). Rendered as a
 * compact definition table with a narrow first column.
 */
.md-typeset table:not([class]):has(> thead th:first-child:empty + th:last-child:empty) > thead {
  display: none;
}

.md-typeset__table:has(> table > thead th:first-child:empty + th:last-child:empty) {
  display: block;
}

.md-typeset table:not([class]):has(> thead th:first-child:empty + th:last-child:empty) td {
  padding: 0.5em 0.9em;
}

.md-typeset table:not([class]):has(> thead th:first-child:empty + th:last-child:empty) tr:first-child td {
  border-top: 0;
}

.md-typeset table:not([class]):has(> thead th:first-child:empty + th:last-child:empty) td:first-child {
  width: 10.5rem;
  min-width: 8rem;
  font-weight: 650;
  color: var(--portal-text);
  background-color: var(--portal-surface);
}

/* The keys are written `**Key**`: one weight, not bold on top of bold. */
.md-typeset table:not([class]):has(> thead th:first-child:empty + th:last-child:empty) td:first-child strong {
  font-weight: inherit;
}

@media screen and (max-width: 44.984375em) {
  /* Small screens: key above value, no sideways scrolling. */
  .md-typeset table:not([class]):has(> thead th:first-child:empty + th:last-child:empty),
  .md-typeset table:not([class]):has(> thead th:first-child:empty + th:last-child:empty) :is(tbody, tr, td) {
    display: block;
    width: auto;
  }

  .md-typeset table:not([class]):has(> thead th:first-child:empty + th:last-child:empty) td:first-child {
    width: auto;
    padding-bottom: 0.3em;
    border-top: 0.05rem solid var(--portal-border);
  }

  .md-typeset table:not([class]):has(> thead th:first-child:empty + th:last-child:empty) td + td {
    border-top: 0;
    border-left: 0;
  }
}

@media screen and (max-width: 44.984375em) {
  /*
   * Small screens: a table of three or four columns fitted to the screen
   * gets columns of a few characters, and names break in the middle
   * (`placemen` / `t`). It takes the width its content needs instead, each
   * column capped, and scrolls sideways inside the theme's scroll wrapper,
   * like the wide tables above.
   */
  .md-typeset__table > table:not([class]):has(> thead th:nth-child(3)) {
    width: max-content;
    min-width: 100%;
    max-width: none;
  }

  .md-typeset table:not([class]):has(> thead th:nth-child(3)) :is(th, td) {
    min-width: 4.5rem;
    max-width: 62vw;
  }

  .md-typeset table:not([class]):has(> thead th:nth-child(3)) code {
    overflow-wrap: break-word;
  }
}

/* Severity cells (class set by tools/site/portal_mdx/severity.py). */
.md-typeset td.sev {
  font-weight: 650;
}

.md-typeset td.sev-low {
  color: var(--portal-green-fg);
  background-color: var(--portal-green-bg);
}

.md-typeset td.sev-medium {
  color: var(--portal-amber-fg);
  background-color: var(--portal-amber-bg);
}

.md-typeset td.sev-high {
  color: var(--portal-orange-fg);
  background-color: var(--portal-orange-bg);
}

.md-typeset td.sev-critical {
  color: var(--portal-red-fg);
  background-color: var(--portal-red-bg);
  box-shadow: inset 0.2rem 0 0 var(--portal-critical-bg);
}

/* ------------------------------------------------------------ 7. Code blocks */

.md-typeset code {
  padding: 0.12em 0.36em;
  font-size: 0.88em;
  border-radius: 0.15rem;
}

.md-typeset pre > code {
  padding: 0.85em 1.1em;
  font-size: 0.7rem;
  line-height: 1.6;
  border: 0.05rem solid var(--portal-border);
  border-radius: 0.25rem;
  tab-size: 2;
}

/* The copy button is always visible, not only when the block is hovered. */
.md-code__nav {
  background-color: var(--md-code-bg-color);
  border-radius: 0.2rem;
}

.md-code__button {
  color: var(--portal-text-muted);
}

.md-code__button:hover,
.md-code__button:focus-visible {
  color: var(--portal-accent);
}

/* Diagrams are centred; one that is wider than the column scrolls sideways
   (portal-mermaid.js keeps it from shrinking below a readable size). The SVG
   sits in a shadow root: only inherited properties reach it. */
.md-typeset div.mermaid {
  display: block;
  margin: 1.2em 0;
  overflow-x: auto;
  text-align: center;
  scrollbar-color: var(--portal-border-strong) transparent;
  scrollbar-width: thin;
}

/* Diagram source shown until Mermaid has rendered it (or if it cannot). */
.md-typeset pre.mermaid {
  display: block;
  padding: 0.85em 1.1em;
  font-size: 0.66rem;
  color: var(--portal-text-muted);
  background-color: var(--portal-surface);
  border: 0.05rem dashed var(--portal-border-strong);
  border-radius: 0.25rem;
}

/* ------------------------------------------------------------- 8. Grid cards */

.md-typeset .grid {
  grid-gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}

.md-typeset .grid.cards > :is(ul, ol) > li,
.md-typeset .grid > .card {
  padding: 0.8rem 0.9rem;
  font-size: 0.72rem;
  background-color: var(--portal-bg);
  border: 0.05rem solid var(--portal-border);
  border-radius: 0.3rem;
}

.md-typeset .grid.cards > :is(ul, ol) > li:hover,
.md-typeset .grid.cards > :is(ul, ol) > li:focus-within,
.md-typeset .grid > .card:hover,
.md-typeset .grid > .card:focus-within {
  border-color: var(--portal-accent);
  box-shadow: none;
}

.md-typeset .grid.cards > :is(ul, ol) > li > p:first-child {
  font-size: 0.8rem;
}

.md-typeset .grid.cards > :is(ul, ol) > li > hr {
  margin: 0.6em 0;
  border-bottom-color: var(--portal-border);
}

.md-typeset .grid.cards > :is(ul, ol) > li > p:first-child a {
  font-weight: 650;
  text-decoration: none;
}

.md-typeset .grid.cards > :is(ul, ol) > li > p:first-child a:hover {
  text-decoration: underline;
}

/* --------------------------- 9. Home page hero, search trigger, recently updated */

.portal-hero {
  background-color: var(--portal-surface);
  border-bottom: 0.05rem solid var(--portal-border);
}

.portal-hero__inner {
  padding: 2.2rem 1.2rem 2.4rem;
}

@media screen and (max-width: 76.234375em) {
  .portal-hero__inner {
    padding: 1.6rem 0.8rem 1.8rem;
  }
}

.portal-hero__eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  color: var(--portal-text-muted);
  text-transform: uppercase;
}

.portal-hero__title {
  margin: 0;
  font-size: clamp(1.45rem, 7vw, 2.1rem);
  font-weight: 750;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--portal-text);
}

.portal-hero__lead {
  max-width: 34rem;
  margin: 0.8rem 0 0;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--portal-text-muted);
}

.portal-search {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  width: 100%;
  max-width: 28rem;
  min-height: 2.5rem;
  padding: 0 0.7rem 0 0.8rem;
  margin: 1.4rem 0 0;
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--portal-text-muted);
  text-align: left;
  cursor: pointer;
  background-color: var(--portal-bg);
  border: 0.05rem solid var(--portal-border-strong);
  border-radius: 0.3rem;
}

.portal-search[hidden] {
  display: none;
}

.portal-search:hover {
  color: var(--portal-text);
  border-color: var(--portal-accent);
}

.portal-search:focus-visible {
  outline: 0.1rem solid var(--portal-accent);
  outline-offset: 0.1rem;
}

.portal-search svg {
  flex: none;
  width: 0.95rem;
  height: 0.95rem;
}

.portal-search__label {
  flex: 1;
}

.portal-search__kbd {
  flex: none;
  padding: 0.15em 0.5em;
  font-family: var(--portal-font-text);
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--portal-text-muted);
  white-space: nowrap;
  background-color: var(--portal-surface);
  border: 0.05rem solid var(--portal-border);
  border-radius: 0.2rem;
}

.portal-search--inline {
  max-width: 20rem;
  margin: 0;
}

/* Keyboard hint, same convention as the theme's header search button. */
.portal-search__kbd::after {
  content: "Ctrl K";
}

[data-platform^="Mac"] .portal-search__kbd::after {
  content: "\2318 K";
}

/* No keyboard hint where there is no keyboard. */
@media (hover: none) {
  .portal-search__kbd {
    display: none;
  }
}

/* The home page has no sidebars: its column stays readable and starts at
   the hero's left edge. */
.md-container:has(> .portal-hero) .md-content__inner {
  padding-top: 0;
}

@media screen and (min-width: 76.25em) {
  .md-container:has(> .portal-hero) .md-content__inner {
    max-width: 56rem;
    margin-right: auto;
    margin-left: 1.2rem;
  }
}

.md-container:has(> .portal-hero) .md-typeset > h2:first-of-type {
  padding-top: 0;
  margin-top: 1.2rem;
  border-top: 0;
}

.md-container:has(> .portal-hero) .md-typeset > :is(p, ul, ol) {
  max-width: 44rem;
}

.md-typeset ul.portal-recent {
  max-width: 44rem;
  padding: 0;
  margin: 0.6em 0 0.8em;
  list-style: none;
  border: 0.05rem solid var(--portal-border);
  border-radius: 0.3rem;
}

.md-typeset ul.portal-recent > li {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  justify-content: space-between;
  padding: 0.45em 0.9em;
  margin: 0;
  font-size: 0.72rem;
}

.md-typeset ul.portal-recent > li + li {
  border-top: 0.05rem solid var(--portal-border);
}

.md-typeset .portal-recent time {
  flex: none;
  font-variant-numeric: tabular-nums;
  color: var(--portal-text-muted);
}

/* ------------------------------------- 10. Page footer line, tags, anchors */

.md-typeset .portal-updated {
  padding-top: 0.8rem;
  margin: 2.4rem 0 0;
  font-size: 0.66rem;
  color: var(--portal-text-muted);
  border-top: 0.05rem solid var(--portal-border);
}

.md-typeset .portal-updated time {
  font-variant-numeric: tabular-nums;
}

.md-typeset .md-tags:not([hidden]) {
  gap: 0.3rem;
  padding-top: 0.6rem;
  margin-top: 0.4rem;
}

.md-typeset .md-tag {
  padding: 0.15em 0.6em;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--portal-text-muted);
  background: var(--portal-surface);
  border: 0.05rem solid var(--portal-border);
  border-radius: 0.2rem;
}

/* Stable item anchors written as `<a id="r12"></a>` on their own line take
   no room; the heading that follows carries the visible spacing. */
.md-typeset p:has(> a[id]:only-child:empty) {
  height: 0;
  margin: 0;
}

/* ---------------------------------------------------------- 11. Reduced motion */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* -------------------------------------------------------------------- 12. Print */

@media print {
  .md-header,
  .md-tabs,
  .md-sidebar,
  .md-footer,
  .md-top,
  .md-content__button,
  .md-code__nav,
  .headerlink,
  .portal-hero .portal-search,
  .portal-release__panel,
  .portal-release__caret,
  .md-typeset .md-tags {
    display: none !important;
  }

  html,
  body {
    font-size: 10pt;
  }

  .md-grid {
    max-width: none;
  }

  .md-content__inner {
    margin: 0;
  }

  .md-typeset a {
    color: inherit;
    text-decoration: underline;
  }

  /* External targets are printed after the link text. */
  .md-typeset a[href^="http"]::after {
    font-size: 0.85em;
    content: " (" attr(href) ")";
    overflow-wrap: anywhere;
  }

  .md-typeset :is(h1, h2, h3, h4) {
    break-after: avoid;
  }

  .md-typeset :is(pre, tr, .admonition, .mermaid) {
    break-inside: avoid;
  }

  .md-typeset pre > code {
    white-space: pre-wrap;
    overflow: visible;
  }

  /* Wide tables are refitted to the page instead of being clipped. */
  .md-typeset__scrollwrap {
    overflow: visible;
  }

  .md-typeset table:not([class]) {
    width: 100% !important;
    max-width: 100% !important;
    font-size: 7.5pt;
  }

  .md-typeset table:not([class]) :is(th, td) {
    position: static !important;
    min-width: 0 !important;
    max-width: none !important;
    white-space: normal !important;
    box-shadow: none !important;
  }

  .md-typeset table:not([class]) code {
    overflow-wrap: anywhere !important;
  }

  .md-typeset .ev,
  .md-typeset .portal-impact__chip,
  .md-typeset td.sev {
    color: #000 !important;
    background: none !important;
    border-color: #000 !important;
    box-shadow: none !important;
  }

  .md-typeset .portal-impact__chip {
    border: 0.75pt solid #000;
  }

  .md-typeset .portal-updated[hidden] {
    display: none;
  }
}

/* ----------------------------------------------------------------- 13. Releases */

/*
 * Release selector of the header (overrides/partials/releases.html): a
 * <details> whose summary shows the release being read and whose panel lists
 * every release of versions.toml, available first, then "coming soon". The
 * panel scrolls when the list is longer than the space under the header.
 */
.portal-release {
  position: relative;
  flex: 0 0 auto;
  margin: 0 0.2rem;
  font-size: 0.7rem;
  line-height: 1.3;
}

.portal-release__button {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  margin: 0;
  padding: 0.3rem 0.35rem 0.3rem 0.6rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--portal-text);
  background-color: var(--portal-surface);
  border: 0.05rem solid var(--portal-border);
  border-radius: 0.3rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.portal-release__button::-webkit-details-marker {
  display: none;
}

.portal-release__button--alone {
  padding-right: 0.6rem;
  cursor: default;
}

.portal-release__button:hover,
.portal-release__menu[open] > .portal-release__button {
  border-color: var(--portal-border-strong);
  background-color: var(--portal-surface-strong);
}

.portal-release__button--alone:hover {
  border-color: var(--portal-border);
  background-color: var(--portal-surface);
}

.portal-release__button:focus-visible,
.portal-release__link:focus-visible {
  outline: 0.1rem solid var(--portal-accent);
  outline-offset: 0.1rem;
}

.portal-release__short {
  display: none;
}

.portal-release__caret {
  width: 1rem;
  height: 1rem;
  fill: currentcolor;
}

.portal-release__menu[open] .portal-release__caret {
  transform: rotate(180deg);
}

.portal-release__panel {
  position: absolute;
  top: calc(100% + 0.3rem);
  right: 0;
  z-index: 5;
  box-sizing: border-box;
  width: 19rem;
  max-width: calc(100vw - 0.8rem);
  max-height: min(26rem, calc(100vh - 4rem));
  padding: 0.3rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--portal-text);
  background-color: var(--portal-bg);
  border: 0.05rem solid var(--portal-border-strong);
  border-radius: 0.3rem;
  box-shadow: 0 0.3rem 0.9rem #0000002e;
}

.portal-release__heading {
  margin: 0;
  padding: 0.35rem 0.5rem 0.2rem;
  font-size: 0.58rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  color: var(--portal-text-muted);
  text-transform: uppercase;
}

.portal-release__list + .portal-release__heading {
  margin-top: 0.3rem;
  padding-top: 0.55rem;
  border-top: 0.05rem solid var(--portal-border);
}

.portal-release__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.portal-release__link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.32rem 0.5rem;
  font-weight: 600;
  color: var(--portal-text);
  border-radius: 0.2rem;
}

.portal-release__link:hover,
.portal-release__link:focus-visible {
  color: var(--portal-text);
  background-color: var(--portal-surface-strong);
}

.portal-release__link[aria-current] {
  color: var(--portal-accent-strong);
  background-color: var(--portal-accent-soft);
}

/* A planned release: lighter name, and the words "coming soon" on each line. */
.portal-release__link--planned {
  font-weight: 400;
  color: var(--portal-text-muted);
}

.portal-release__soon {
  flex: 0 0 auto;
  font-size: 0.58rem;
  font-weight: 400;
  color: var(--portal-text-muted);
  white-space: nowrap;
}

/* Small screens: the short name of the release, and a panel as wide as the
   screen under the header instead of under the button. */
@media screen and (max-width: 59.984375em) {
  .portal-release {
    position: static;
  }

  .portal-release__full {
    display: none;
  }

  .portal-release__short {
    display: inline;
  }

  .portal-release__panel {
    top: 100%;
    right: 0.4rem;
    left: 0.4rem;
    width: auto;
    max-width: none;
  }
}

/* Home page hero: the release this site studies. */
.portal-hero__release {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.7rem;
  margin: 0.6rem 0 0;
  font-size: 0.8rem;
  color: var(--portal-text-muted);
}

.portal-hero__release-name {
  font-weight: 650;
  color: var(--portal-text);
}

.portal-hero__release-tag code {
  padding: 0.05rem 0.3rem;
  font-size: 0.9em;
  background-color: var(--portal-surface-strong);
  border-radius: 0.15rem;
}

/* Root site (landing page, not-found page, planned releases): one column. */
.portal-planned__eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  color: var(--portal-amber-fg);
  text-transform: uppercase;
}

.md-typeset .portal-releases {
  margin-left: 0;
  padding: 0;
  list-style: none;
}

.md-typeset .portal-releases {
  max-width: 34rem;
}

[dir] .md-typeset .portal-releases li {
  margin: 0;
  padding: 0.45rem 0;
  border-bottom: 0.05rem solid var(--portal-border);
}

.md-typeset .portal-releases a {
  font-weight: 600;
}

.md-typeset .portal-releases--planned a {
  font-weight: 400;
}

.portal-releases__note {
  margin-left: 0.6rem;
  font-size: 0.9em;
  color: var(--portal-text-muted);
}

/* ------------------- 14. Landing page of the portal: OzarLand identity
   Colours taken from the OzarLand banner (navy pennants with a cloud
   emblem, parchment, wood, lanterns, sea, terracotta roofs). Used only by
   overrides/landing.html (classes oz-*) and its calls to action. */

[data-md-color-scheme="default"] {
  --oz-navy: #1f3a6b;
  --oz-navy-strong: #152a50;
  --oz-parchment: #f3e3c3;
  --oz-parchment-soft: #fbf4e4;
  --oz-wood: #c4904f;
  --oz-wood-dark: #6b4220;
  --oz-lantern: #f0b440;
  --oz-sea: #1e9fb5;
  --oz-terracotta: #b55a3a;
  --oz-hero-bg: linear-gradient(135deg, #fbf4e4 0%, #f3e3c3 55%, #dcebf7 100%);
  --oz-cta-bg: var(--oz-navy);
  --oz-cta-fg: #ffffff;
  --oz-ink: #1f3a6b;
}

[data-md-color-scheme="slate"] {
  --oz-navy: #8fb0e6;
  --oz-navy-strong: #b7cdf0;
  --oz-parchment: #f3e3c3;
  --oz-parchment-soft: #1c2433;
  --oz-wood: #d9a865;
  --oz-wood-dark: #d9a865;
  --oz-lantern: #f0b440;
  --oz-sea: #4cc3d6;
  --oz-terracotta: #e0825f;
  --oz-hero-bg: linear-gradient(135deg, #142038 0%, #1a2a47 55%, #1d3550 100%);
  --oz-cta-bg: #f0b440;
  --oz-cta-fg: #1a1408;
  --oz-ink: #f3e3c3;
}

.portal-hero.oz-hero {
  background: var(--oz-hero-bg);
  border-bottom: 0.2rem solid var(--oz-wood);
}

.oz-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 26rem);
  gap: 1.6rem;
  align-items: center;
}

@media screen and (max-width: 60em) {
  .oz-hero__inner {
    grid-template-columns: minmax(0, 1fr);
  }
}

.oz-hero__org {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.8rem;
  align-items: center;
  margin: 0 0 0.7rem;
  font-size: 0.7rem;
}

.oz-hero__org a {
  font-weight: 600;
  color: var(--oz-ink);
  text-decoration: none;
}

.oz-hero__org a:hover {
  text-decoration: underline;
}

.oz-hero__badge {
  padding: 0.15rem 0.55rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--oz-parchment);
  text-transform: uppercase;
  background-color: #1f3a6b;
  border-bottom: 0.1rem solid var(--oz-lantern);
  border-radius: 0.2rem;
}

.oz-hero .portal-hero__title {
  color: var(--oz-ink);
}

.oz-hero__tagline {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  font-style: italic;
  font-weight: 600;
  color: var(--oz-wood-dark);
}

.oz-hero .portal-hero__lead {
  color: var(--portal-text);
}

.oz-hero__art {
  margin: 0;
}

.oz-hero__art img {
  display: block;
  width: 100%;
  height: auto;
  border: 0.2rem solid var(--oz-wood);
  border-radius: 1rem;
  box-shadow: 0 0.4rem 1.2rem rgb(31 58 107 / 25%);
}

/* Calls to action (hero and closing block). */
.portal-hero__actions,
.oz-land__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.4rem 0 0;
}

.md-typeset :is(a, button).portal-cta,
:is(a, button).portal-cta {
  display: inline-flex;
  align-items: center;
  min-height: 2.2rem;
  padding: 0 1rem;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--oz-ink);
  text-decoration: none;
  background-color: var(--portal-bg);
  border: 0.1rem solid var(--oz-wood);
  border-radius: 0.3rem;
}

.md-typeset :is(a, button).portal-cta:hover,
:is(a, button).portal-cta:hover {
  border-color: var(--oz-wood-dark);
}

:is(a, button).portal-cta:focus-visible {
  outline: 0.1rem solid var(--portal-accent);
  outline-offset: 0.1rem;
}

.md-typeset a.portal-cta--primary,
a.portal-cta--primary,
.md-typeset a.portal-cta--primary:hover,
a.portal-cta--primary:hover {
  color: var(--oz-cta-fg);
  background-color: var(--oz-cta-bg);
  border-color: var(--oz-cta-bg);
}

a.portal-cta--primary:hover {
  filter: brightness(1.12);
}

/* Text beside an illustration. */
.oz-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18rem;
  gap: 1.6rem;
  align-items: center;
  max-width: 56rem;
}

.oz-split > div > :is(p, ol) {
  max-width: 44rem;
}

.oz-split--reverse {
  grid-template-columns: 15rem minmax(0, 1fr);
}

.oz-split--reverse > img {
  order: -1;
}

.oz-split__art {
  width: 100%;
  height: auto;
  border: 0.15rem solid var(--oz-wood);
  border-radius: 0.8rem;
  box-shadow: 0 0.3rem 0.9rem rgb(31 58 107 / 20%);
}

@media screen and (max-width: 44.9375em) {
  .oz-split,
  .oz-split--reverse {
    grid-template-columns: minmax(0, 1fr);
  }

  .oz-split__art {
    max-width: 20rem;
    margin: 0 auto;
  }

  .oz-split--reverse > img {
    order: 0;
  }
}

/* Cards with an icon. */
.md-typeset .oz-cards > ul > li {
  border-top: 0.2rem solid var(--oz-wood);
}

.oz-icon {
  display: block;
  width: 2.2rem;
  height: 2.2rem;
  margin-bottom: 0.4rem;
}

/* Learning path: numbered wooden markers. */
.md-typeset ol.oz-path {
  padding: 0;
  margin-left: 0;
  list-style: none;
  counter-reset: oz-step;
}

[dir] .md-typeset ol.oz-path > li {
  position: relative;
  padding-left: 2.2rem;
  margin: 0 0 0.7rem;
  counter-increment: oz-step;
}

.md-typeset ol.oz-path > li::before {
  position: absolute;
  top: -0.05rem;
  left: 0;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #ffffff;
  content: counter(oz-step);
  background-color: #1f3a6b;
  border: 0.1rem solid var(--oz-lantern);
  border-radius: 50%;
}

/* Learning path of the portal root (overrides/academy.html): the modules in
   order, one numbered card per step; a planned module is muted. */
.md-typeset ol.oz-steps {
  display: grid;
  gap: 0.8rem;
  max-width: 56rem;
  padding: 0;
  margin: 1rem 0 0;
  list-style: none;
}

.md-typeset .oz-steps__item {
  padding: 0.6rem 1rem;
  margin: 0;
  background-color: var(--oz-parchment-soft);
  border: 0.05rem solid var(--oz-wood);
  border-left: 0.3rem solid var(--portal-accent);
  border-radius: 0.4rem;
}

.md-typeset .oz-steps__item--planned {
  border-left-color: var(--oz-wood);
}

.md-typeset .oz-steps__item > p {
  margin: 0.2rem 0;
}

.md-typeset .oz-steps__step {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--portal-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.md-typeset .oz-steps__title {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
  font-size: 0.95rem;
  font-weight: 700;
}

/* Closing block "Part of OzarLand". */
.oz-land {
  max-width: 56rem;
  padding: 0.2rem 1.2rem 1.2rem;
  margin-top: 2rem;
  background-color: var(--oz-parchment-soft);
  border: 0.05rem solid var(--oz-wood);
  border-left: 0.3rem solid var(--oz-wood);
  border-radius: 0.4rem;
}

.md-typeset .oz-land > h2 {
  padding-top: 0;
  margin-top: 1rem;
  border-top: 0;
}

.md-typeset .oz-land table {
  display: table;
  width: 100%;
  font-size: 0.75rem;
}

.md-typeset .oz-land tr.oz-land__here td {
  background-color: var(--portal-accent-soft);
}

/* The first heading of the landing page sits in a split block: no rule above it. */
.md-container:has(> .oz-hero) .md-typeset > .oz-split:first-of-type h2 {
  padding-top: 0;
  margin-top: 1.2rem;
  border-top: 0;
}

/* Section illustration (index page of a section, planned release, not-found
   page): a wide band cut from the painted image. */
.md-typeset .oz-section-art {
  max-width: 44rem;
  margin: 1rem 0 1.4rem;
}

.md-typeset .oz-section-art img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 12 / 5;
  object-fit: cover;
  border: 0.15rem solid var(--oz-wood);
  border-radius: 0.8rem;
  box-shadow: 0 0.3rem 0.9rem rgb(21 42 80 / 15%);
}

/* Brand kit: keyboard focus ring in lantern gold. */
.oz-hero a:focus-visible,
a.portal-cta:focus-visible {
  outline: 0.1rem solid var(--oz-lantern);
  outline-offset: 0.1rem;
}

.oz-icon[src] {
  width: 2.4rem;
  height: 2.4rem;
}

/* ------------------------------------------------- 15. Learning journey
   Levels, the journey bar of a page, "mark as read", the journey page and
   the teaching callouts (!!! guide, why, lab, checkpoint). */

.oz-pagebar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  align-items: center;
  margin: -0.4rem 0 1rem;
}

.md-typeset .oz-level {
  display: inline-flex;
  gap: 0.3rem;
  align-items: center;
  padding: 0.1rem 0.6rem 0.1rem 0.45rem;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
  border: 0.05rem solid;
  border-radius: 1rem;
}

.md-typeset .oz-level::before {
  width: 0.95rem;
  height: 0.95rem;
  content: "";
  background: center / contain no-repeat;
}

.md-typeset .oz-level--discover::before {
  background-image: url("../images/ozarland/badges/level-discover.svg");
}

.md-typeset .oz-level--practise::before {
  background-image: url("../images/ozarland/badges/level-practise.svg");
}

.md-typeset .oz-level--master::before {
  background-image: url("../images/ozarland/badges/level-master.svg");
}

.md-typeset .oz-level--discover {
  color: var(--portal-green-fg);
  background-color: var(--portal-green-bg);
  border-color: var(--portal-green-border);
}

.md-typeset .oz-level--practise {
  color: var(--portal-amber-fg);
  background-color: var(--portal-amber-bg);
  border-color: var(--portal-amber-border);
}

.md-typeset .oz-level--master {
  color: var(--portal-violet-fg);
  background-color: var(--portal-violet-bg);
  border-color: var(--portal-violet-border);
}

.md-typeset a.oz-step {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  padding: 0.15rem 0.7rem;
  font-size: 0.66rem;
  color: var(--oz-ink);
  text-decoration: none;
  background-color: var(--oz-parchment-soft);
  border: 0.05rem solid var(--oz-wood);
  border-radius: 1rem;
}

.md-typeset a.oz-step:hover {
  border-color: var(--oz-wood-dark);
}

.oz-step__label {
  font-weight: 700;
}

/* End of a journey page. */
.md-typeset .oz-step-end {
  max-width: 44rem;
  padding: 0.9rem 1rem;
  margin: 2rem 0 1rem;
  background-color: var(--oz-parchment-soft);
  border: 0.05rem solid var(--oz-wood);
  border-left: 0.3rem solid var(--oz-wood);
  border-radius: 0.4rem;
}

.oz-step-end__read {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.8rem;
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
}

.oz-step-end__read[hidden] {
  display: none;
}

.oz-step-end__read input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--portal-green-fg);
}

.oz-step-end__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.md-typeset .oz-step-end__links a.portal-cta {
  gap: 0.4rem;
  height: auto;
  min-height: 2.2rem;
  padding: 0.4rem 0.9rem;
  font-size: 0.72rem;
  line-height: 1.3;
}

/* Journey page: progress. */
.md-typeset .oz-progress {
  max-width: 44rem;
  padding: 0.2rem 1rem 1rem;
  margin: 1.4rem 0;
  background-color: var(--oz-parchment-soft);
  border: 0.05rem solid var(--oz-wood);
  border-radius: 0.6rem;
}

.md-typeset .oz-progress > h2 {
  padding-top: 0;
  margin-top: 0.8rem;
  border-top: 0;
}

.oz-progress__bar {
  height: 0.7rem;
  overflow: hidden;
  background-color: var(--portal-surface-strong);
  border-radius: 1rem;
}

.oz-progress__bar > span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--oz-sea), var(--portal-green-fg));
  border-radius: 1rem;
  transition: width 0.3s ease;
}

.oz-progress.is-complete .oz-progress__bar > span {
  background: linear-gradient(90deg, var(--oz-lantern), var(--portal-green-fg));
}

.oz-progress__reset {
  padding: 0;
  font-family: inherit;
  font-size: 0.66rem;
  color: var(--portal-text-muted);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: 0;
}

.md-typeset ul.oz-levels {
  padding: 0;
  margin-left: 0;
  list-style: none;
}

[dir] .md-typeset ul.oz-levels > li {
  margin: 0 0 0.5rem;
}

/* Journey page: stages. */
.md-typeset ol.oz-stages {
  display: grid;
  gap: 1.2rem;
  max-width: 56rem;
  padding: 0;
  margin-left: 0;
  list-style: none;
}

[dir] .md-typeset ol.oz-stages > li.oz-stage {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: 1.2rem;
  align-items: start;
  padding: 1rem;
  margin: 0;
  background-color: var(--portal-bg);
  border: 0.05rem solid var(--portal-border);
  border-top: 0.2rem solid var(--oz-wood);
  border-radius: 0.6rem;
}

.md-typeset .oz-stage.is-complete {
  border-top-color: var(--portal-green-fg);
}

.oz-stage__art {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 0.5rem;
}

@media screen and (max-width: 44.9375em) {
  [dir] .md-typeset ol.oz-stages > li.oz-stage {
    grid-template-columns: minmax(0, 1fr);
  }

  .oz-stage__art {
    aspect-ratio: 12 / 5;
  }
}

.md-typeset .oz-stage__eyebrow {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--oz-wood-dark);
  text-transform: uppercase;
}

.oz-stage.is-complete .oz-stage__done {
  color: var(--portal-green-fg);
}

.md-typeset .oz-stage__name {
  margin: 0.2rem 0 0.3rem;
  font-size: 1rem;
}

.md-typeset .oz-stage__goal {
  margin: 0 0 0.6rem;
  color: var(--portal-text-muted);
}

.md-typeset ol.oz-stage__pages {
  margin: 0 0 0 1.1rem;
  list-style-type: decimal;
}

[dir] .md-typeset ol.oz-stage__pages > li {
  margin: 0 0 0.25rem;
}

.md-typeset .oz-stage__pages li.is-read > a {
  color: var(--portal-text-muted);
}

.oz-read-mark {
  margin-left: 0.4rem;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--portal-green-fg);
  text-transform: uppercase;
}

.oz-read-mark::before {
  content: "\2713";
}

/* Teaching callouts: !!! guide, !!! why, !!! lab, !!! checkpoint. */
.md-typeset :is(.admonition, details).guide {
  --portal-adm-fg: var(--oz-ink);
  --portal-adm-bg: var(--oz-parchment-soft);
  --portal-adm-border: var(--oz-wood);
}

.md-typeset :is(.admonition, details).why {
  --portal-adm-fg: var(--portal-blue-fg);
  --portal-adm-bg: var(--portal-blue-bg);
  --portal-adm-border: var(--portal-blue-border);
}

.md-typeset :is(.admonition, details).lab {
  --portal-adm-fg: var(--portal-teal-fg);
  --portal-adm-bg: var(--portal-teal-bg);
  --portal-adm-border: var(--portal-teal-border);
}

.md-typeset :is(.admonition, details).checkpoint {
  --portal-adm-fg: var(--portal-green-fg);
  --portal-adm-bg: var(--portal-green-bg);
  --portal-adm-border: var(--portal-green-border);
}

.md-typeset :is(.admonition, details):is(.guide, .why, .lab, .checkpoint) {
  background-color: var(--portal-adm-bg);
}





/* ------------------------------------------- 16. Lumo and the learning kit
   Lumo, the guide (assets/images/ozarland/lumo/), the island map, the seals
   of the stages and the callout icons of the OzarLand learning kit. */

.md-typeset .oz-lumo {
  display: flex;
  gap: 1rem;
  align-items: center;
  max-width: 44rem;
  margin: 1.2rem 0 1.6rem;
}

.md-typeset .oz-lumo__pose {
  flex: none;
  width: 8rem;
  height: auto;
}

.md-typeset .oz-lumo--done .oz-lumo__pose {
  width: 11rem;
}

.md-typeset .oz-lumo__bubble {
  position: relative;
  flex: 1;
  padding: 0.6rem 1rem;
  background-color: var(--oz-parchment-soft);
  border: 0.1rem solid var(--oz-wood);
  border-radius: 0.8rem;
}

/* The tail of the speech bubble points to Lumo. */
.md-typeset .oz-lumo__bubble::before {
  position: absolute;
  top: 50%;
  left: -0.5rem;
  width: 0.8rem;
  height: 0.8rem;
  content: "";
  background-color: var(--oz-parchment-soft);
  border-bottom: 0.1rem solid var(--oz-wood);
  border-left: 0.1rem solid var(--oz-wood);
  transform: translateY(-50%) rotate(45deg);
}

.md-typeset .oz-lumo__bubble > p {
  margin: 0.4rem 0;
}

.md-typeset .oz-lumo__name {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--oz-wood-dark);
  text-transform: uppercase;
}

@media screen and (max-width: 44.9375em) {
  .md-typeset .oz-lumo {
    flex-direction: column;
    align-items: flex-start;
  }

  .md-typeset .oz-lumo__pose {
    width: 6.5rem;
  }

  .md-typeset .oz-lumo__bubble::before {
    top: -0.5rem;
    left: 2.5rem;
    transform: rotate(135deg);
  }
}

/* Island map of the journey page. */
.md-typeset .oz-journey-map {
  max-width: 56rem;
  margin: 1rem 0 1.6rem;
}

.md-typeset .oz-journey-map img {
  display: block;
  width: 100%;
  height: auto;
  border: 0.15rem solid var(--oz-wood);
  border-radius: 0.8rem;
  box-shadow: 0 0.3rem 0.9rem rgb(21 42 80 / 15%);
}

.md-typeset .oz-journey-map figcaption {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  justify-content: center;
  max-width: none;
  margin-top: 0.6rem;
  font-size: 0.72rem;
}

.md-typeset .oz-journey-map figcaption a {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  color: var(--oz-ink);
  text-decoration: none;
}

.md-typeset .oz-journey-map figcaption a:hover {
  text-decoration: underline;
}

.oz-journey-map__n {
  display: inline-grid;
  place-items: center;
  width: 1.3rem;
  height: 1.3rem;
  font-size: 0.64rem;
  font-weight: 700;
  color: #ffffff;
  background-color: #1f3a6b;
  border: 0.1rem solid var(--oz-lantern);
  border-radius: 50%;
}

/* Seals: grey until the stage is complete. */
.md-typeset ul.oz-seals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  padding: 0;
  margin: 0.8rem 0;
  list-style: none;
}

[dir] .md-typeset ul.oz-seals > li.oz-seal {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: center;
  width: 4.6rem;
  margin: 0;
  font-size: 0.6rem;
  color: var(--portal-text-muted);
  text-align: center;
}

.oz-seal img {
  width: 3.4rem;
  height: 3.4rem;
  opacity: 0.35;
  filter: grayscale(1);
  transition: opacity 0.3s ease, filter 0.3s ease, transform 0.3s ease;
}

.oz-seal.is-complete {
  font-weight: 700;
  color: var(--oz-ink);
}

.oz-seal.is-complete img {
  opacity: 1;
  filter: none;
  transform: scale(1.08);
}

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

/* Seal next to each stage of the list. */
[dir] .md-typeset ol.oz-stages > li.oz-stage {
  grid-template-columns: 14rem minmax(0, 1fr) 4rem;
}

.oz-stage__seal {
  width: 4rem;
  height: 4rem;
  opacity: 0.3;
  filter: grayscale(1);
}

.oz-stage.is-complete .oz-stage__seal {
  opacity: 1;
  filter: none;
}

@media screen and (max-width: 44.9375em) {
  [dir] .md-typeset ol.oz-stages > li.oz-stage {
    grid-template-columns: minmax(0, 1fr);
  }

  .oz-stage__seal {
    display: none;
  }
}

/* Lumo at the end of a page of the journey. */
.md-typeset .oz-step-end__lumo {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin: 0 0 0.8rem;
  font-size: 0.75rem;
}

/* Lumo points along the path to the next step (page-end scene, 3:2). */
.md-typeset .oz-step-end__lumo img {
  flex: none;
  width: 6rem;
  height: auto;
}

/* Callout icons of the kit (colour drawings, not masks). */
.md-typeset :is(.guide, .why, .lab, .checkpoint, .careful, .remember, .quiz, .scenario) > :is(.admonition-title, summary)::before {
  width: 1.1rem;
  height: 1.1rem;
  background: center / contain no-repeat;
  -webkit-mask-image: none;
  mask-image: none;
}

.md-typeset .guide > :is(.admonition-title, summary)::before {
  background-image: url("../images/ozarland/callouts/guide-tip.svg");
}

.md-typeset .why > :is(.admonition-title, summary)::before {
  background-image: url("../images/ozarland/callouts/why-it-matters.svg");
}

.md-typeset .lab > :is(.admonition-title, summary)::before {
  background-image: url("../images/ozarland/callouts/try-in-lab.svg");
}

.md-typeset .checkpoint > :is(.admonition-title, summary)::before {
  background-image: url("../images/ozarland/callouts/checkpoint.svg");
}

.md-typeset .careful > :is(.admonition-title, summary)::before {
  background-image: url("../images/ozarland/callouts/careful.svg");
}

.md-typeset .remember > :is(.admonition-title, summary)::before {
  background-image: url("../images/ozarland/callouts/remember.svg");
}

.md-typeset .quiz > :is(.admonition-title, summary)::before {
  background-image: url("../images/ozarland/callouts/quiz.svg");
}

.md-typeset :is(.admonition, details).careful {
  --portal-adm-fg: var(--portal-orange-fg);
  --portal-adm-bg: var(--portal-orange-bg);
  --portal-adm-border: var(--portal-orange-border);

  background-color: var(--portal-adm-bg);
}

.md-typeset :is(.admonition, details).remember {
  --portal-adm-fg: var(--oz-ink);
  --portal-adm-bg: var(--oz-parchment-soft);
  --portal-adm-border: var(--oz-wood);

  background-color: var(--portal-adm-bg);
}

.md-typeset :is(.admonition, details).quiz {
  --portal-adm-fg: var(--portal-violet-fg);
  --portal-adm-bg: var(--portal-violet-bg);
  --portal-adm-border: var(--portal-violet-border);

  background-color: var(--portal-adm-bg);
}

.md-typeset .oz-lumo[hidden] {
  display: none;
}

/* ------------------------------------- 17. Definitions on hover and quizzes */

.md-typeset button.oz-term {
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: inherit;
  cursor: help;
  background: none;
  border: 0;
  border-bottom: 0.1rem dotted var(--oz-wood);
}

.md-typeset button.oz-term:hover,
.md-typeset button.oz-term[aria-expanded="true"] {
  border-bottom-style: solid;
  border-bottom-color: var(--oz-wood-dark);
}

.md-typeset button.oz-term:focus-visible {
  outline: 0.1rem solid var(--oz-lantern);
  outline-offset: 0.1rem;
}

.oz-term-pop {
  position: absolute;
  z-index: 5;
  padding: 0.6rem 0.8rem;
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--portal-text);
  background-color: var(--oz-parchment-soft);
  border: 0.1rem solid var(--oz-wood);
  border-radius: 0.5rem;
  box-shadow: 0 0.4rem 1.2rem rgb(21 42 80 / 22%);
}

.oz-term-pop[hidden] {
  display: none;
}

.oz-term-pop p {
  margin: 0 0 0.4rem;
}

.oz-term-pop__term {
  font-weight: 700;
  color: var(--oz-ink);
}

.oz-term-pop__more {
  font-size: 0.64rem;
  color: var(--portal-text-muted);
}

.oz-term-pop a {
  color: var(--portal-accent);
}

.oz-term-pop code {
  padding: 0 0.2em;
  font-size: 0.9em;
  background-color: var(--portal-surface-strong);
  border-radius: 0.15rem;
}

/* Quiz: "Check yourself". */
.md-typeset .oz-quiz {
  max-width: 44rem;
  margin-top: 2rem;
}

.md-typeset .oz-quiz__intro {
  display: flex;
  gap: 0.7rem;
  align-items: center;
}

.md-typeset .oz-quiz__intro img {
  flex: none;
  width: 4.5rem;
  height: auto;
}

.md-typeset fieldset.oz-quiz__q {
  padding: 0.5rem 0.8rem 0.6rem;
  margin: 0 0 0.8rem;
  background-color: var(--portal-bg);
  border: 0.05rem solid var(--portal-violet-border);
  border-radius: 0.4rem;
}

.md-typeset .oz-quiz__q.is-right {
  border-color: var(--portal-green-fg);
}

.md-typeset .oz-quiz__q.is-wrong {
  border-color: var(--portal-amber-fg);
}

.md-typeset .oz-quiz__q legend {
  padding: 0 0.3rem;
  font-weight: 700;
}

.md-typeset label.oz-quiz__option {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.25rem 0.3rem;
  cursor: pointer;
  border-radius: 0.3rem;
}

.md-typeset label.oz-quiz__option:hover {
  background-color: var(--portal-violet-bg);
}

.md-typeset .oz-quiz__option input {
  accent-color: var(--portal-violet-fg);
}

.md-typeset details.oz-quiz__answer {
  padding: 0 0.6rem;
  margin: 0.4rem 0 0;
  font-size: inherit;
  background-color: var(--portal-surface);
  border: 0;
  border-radius: 0.3rem;
}

.md-typeset details.oz-quiz__answer > summary {
  font-size: 0.64rem;
  color: var(--portal-text-muted);
  text-transform: none;
  letter-spacing: 0;
}

.md-typeset details.oz-quiz__answer > summary::before {
  background-color: var(--portal-text-muted);
}

.oz-quiz__q.is-right [data-oz-feedback] {
  color: var(--portal-green-fg);
}

.oz-quiz__q.is-wrong [data-oz-feedback] {
  color: var(--portal-amber-fg);
}

/* Lumo's caution (pages of a Critical operation) and cheer (page marked as read). */
.md-typeset .oz-lumo--caution .oz-lumo__bubble,
.md-typeset .oz-lumo--caution .oz-lumo__bubble::before {
  background-color: var(--portal-orange-bg);
  border-color: var(--portal-orange-border);
}

.md-typeset .oz-lumo--caution .oz-lumo__name {
  color: var(--portal-orange-fg);
}

.md-typeset .oz-step-end__cheer {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin: 0 0 0.8rem;
  font-size: 0.75rem;
  color: var(--portal-green-fg);
}

.md-typeset .oz-step-end__lumo[hidden],
.md-typeset .oz-step-end__cheer[hidden] {
  display: none;
}

.md-typeset .oz-step-end__cheer img {
  flex: none;
  width: 3.4rem;
  height: auto;
}

/* ===================================== 18. OzarLand Academy charter
   brand/charter/README.md: the island districts, the palette applied to
   the whole site (parchment canvas, navy header), the path stones of
   numbered steps, the path divider, the skyline footer and the seal states.
   Sizes are the charter's, in this theme's rem (20 px). Headings use the
   system stack, as the rest of the page: no web font is loaded
   (brand/academy/typography.md). */

:root {
  --oz-font-heading: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-md-color-scheme="default"] {
  --portal-bg: #fbf4e4;
  --portal-surface: #fffdf8;
  --portal-surface-strong: #f3e3c3;
  --portal-border: #e3d4b4;
  --portal-border-strong: #c9b894;
  --portal-text: #152a50;
  --portal-text-muted: #4e5a6d;
  --portal-accent: #1f3a6b;
  --portal-accent-strong: #152a50;
  --portal-accent-soft: #e2effb;
  --oz-header-bg: #152a50;
  --oz-header-raised: #1f3a6b;
  --oz-header-border: #2c4a7c;
  --oz-header-text: #fbf4e4;
  --oz-header-muted: #d6dfed;
  --oz-link-visited: #6b4220;
  --oz-district-harbour: #1e9fb5;
  --oz-district-map: #2f6fd0;
  --oz-district-library: #1f3a6b;
  --oz-district-workshop: #c4904f;
  --oz-district-bridge: #2c7a43;
  --oz-district-lighthouse: #b55a3a;
  --oz-district-citadel: #1f3a6b;
  --oz-district-archives: #6b4220;
  --md-footer-bg-color: #152a50;
  --md-footer-bg-color--dark: #0f1f3d;
}

[data-md-color-scheme="slate"] {
  --portal-bg: #11151a;
  --portal-surface: #1c2433;
  --portal-surface-strong: #202b3a;
  --portal-border: #2e3a4d;
  --portal-border-strong: #46566d;
  --portal-text: #f3e3c3;
  --portal-text-muted: #b2bdca;
  --portal-accent: #a9c7f2;
  --portal-accent-strong: #d6dfed;
  --portal-accent-soft: #1d3147;
  --oz-header-bg: #152038;
  --oz-header-raised: #1d2c4a;
  --oz-header-border: #2c3d5e;
  --oz-header-text: #fbf4e4;
  --oz-header-muted: #d6dfed;
  --oz-link-visited: #f2a28b;
  --oz-district-harbour: #4cc3d6;
  --oz-district-map: #8fb0e6;
  --oz-district-library: #a9c7f2;
  --oz-district-workshop: #d9a865;
  --oz-district-bridge: #85c693;
  --oz-district-lighthouse: #e58b7a;
  --oz-district-citadel: #a9c7f2;
  --oz-district-archives: #d9a865;
  --md-footer-bg-color: #152038;
  --md-footer-bg-color--dark: #0e1626;
}

/* Header and tabs: navy, with parchment text. The components inside them
   (search, release selector) read the same variables, set here. */
.md-header,
.md-tabs {
  --portal-bg: var(--oz-header-raised);
  --portal-surface: var(--oz-header-raised);
  --portal-surface-strong: var(--oz-header-border);
  --portal-border: var(--oz-header-border);
  --portal-border-strong: #48669a;
  --portal-text: var(--oz-header-text);
  --portal-text-muted: var(--oz-header-muted);
  --portal-accent: var(--oz-color-lantern, #f0b440);
  --md-default-fg-color: var(--oz-header-text);
  --md-default-fg-color--light: var(--oz-header-muted);

  color: var(--oz-header-text);
  background-color: var(--oz-header-bg);
}

.md-header--shadow {
  box-shadow: 0 0.05rem 0 var(--oz-header-border);
}

.md-header__title {
  font-family: var(--oz-font-heading);
}

.md-tabs {
  border-bottom: 0.05rem solid var(--oz-header-border);
}

.md-tabs__link {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  color: var(--oz-header-muted);
  opacity: 1;
}

.md-tabs__link:hover,
.md-tabs__item--active .md-tabs__link {
  color: var(--oz-header-text);
}

.md-tabs__item--active {
  box-shadow: inset 0 -0.16rem 0 #f0b440;
}

/* District icon before each tab label (the order of the nav of a release
   of the versioned module, day2; the other modules have their own nav). */
.md-header[data-oz-module="day2"] .md-tabs__link::before {
  flex: none;
  width: 0.9rem;
  height: 0.9rem;
  content: "";
  background-color: currentcolor;
  -webkit-mask: var(--oz-tab-icon) center / contain no-repeat;
  mask: var(--oz-tab-icon) center / contain no-repeat;
}

.md-header[data-oz-module="day2"] .md-tabs__item:nth-child(1) { --oz-tab-icon: url("../images/ozarland/districts/tab-harbour.svg"); }
.md-header[data-oz-module="day2"] .md-tabs__item:nth-child(2) { --oz-tab-icon: url("../images/ozarland/districts/tab-workshop.svg"); }
.md-header[data-oz-module="day2"] .md-tabs__item:nth-child(3) { --oz-tab-icon: url("../images/ozarland/districts/tab-bridge.svg"); }
.md-header[data-oz-module="day2"] .md-tabs__item:nth-child(4) { --oz-tab-icon: url("../images/ozarland/districts/tab-citadel.svg"); }
.md-header[data-oz-module="day2"] .md-tabs__item:nth-child(5) { --oz-tab-icon: url("../images/ozarland/districts/tab-lighthouse.svg"); }
.md-header[data-oz-module="day2"] .md-tabs__item:nth-child(6) { --oz-tab-icon: url("../images/ozarland/districts/tab-library.svg"); }
.md-header[data-oz-module="day2"] .md-tabs__item:nth-child(7) { --oz-tab-icon: url("../images/ozarland/districts/tab-archives.svg"); }

/* Headings; H2 opens with the emblem of the page's district. */
.md-typeset :is(h1, h2, h3),
.portal-hero__title {
  font-family: var(--oz-font-heading);
  font-weight: 700;
  letter-spacing: 0;
}

.md-typeset h1 {
  font-size: 1.9rem;
  line-height: 1.18;
}

.md-typeset h2 {
  font-size: 1.4rem;
  border-top: 0.1rem solid var(--portal-border);
}

.md-typeset h3 {
  font-size: 1.05rem;
}

@media screen and (max-width: 44.9375em) {
  .md-typeset h1 {
    font-size: 1.5rem;
  }

  .md-typeset h2 {
    font-size: 1.2rem;
  }
}

.md-main:has([data-oz-district]) .md-content .md-typeset > h2::before {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
  margin-right: 0.45rem;
  vertical-align: -0.12rem;
  content: "";
  background: var(--oz-emblem) center / contain no-repeat;
}

.md-main:has([data-oz-district="harbour"]) { --oz-accent: var(--oz-district-harbour); --oz-emblem: url("../images/ozarland/districts/harbour-emblem.svg"); }
.md-main:has([data-oz-district="map"]) { --oz-accent: var(--oz-district-map); --oz-emblem: url("../images/ozarland/districts/map-emblem.svg"); }
.md-main:has([data-oz-district="library"]) { --oz-accent: var(--oz-district-library); --oz-emblem: url("../images/ozarland/districts/library-emblem.svg"); }
.md-main:has([data-oz-district="workshop"]) { --oz-accent: var(--oz-district-workshop); --oz-emblem: url("../images/ozarland/districts/workshop-emblem.svg"); }
.md-main:has([data-oz-district="bridge"]) { --oz-accent: var(--oz-district-bridge); --oz-emblem: url("../images/ozarland/districts/bridge-emblem.svg"); }
.md-main:has([data-oz-district="lighthouse"]) { --oz-accent: var(--oz-district-lighthouse); --oz-emblem: url("../images/ozarland/districts/lighthouse-emblem.svg"); }
.md-main:has([data-oz-district="citadel"]) { --oz-accent: var(--oz-district-citadel); --oz-emblem: url("../images/ozarland/districts/citadel-emblem.svg"); }
.md-main:has([data-oz-district="archives"]) { --oz-accent: var(--oz-district-archives); --oz-emblem: url("../images/ozarland/districts/archives-emblem.svg"); }

/* The accent of the district marks the current page in the sidebar. */
.md-main:has([data-oz-district]) .md-nav__link--active {
  box-shadow: inset 0.15rem 0 0 var(--oz-accent);
}

/* Banner of a section index page; thin strip on its other pages. */
.md-typeset .oz-banner {
  max-width: 56rem;
  margin: 0 0 1.2rem;
}

.md-typeset .oz-banner img {
  display: block;
  width: 100%;
  height: auto;
  border: 0.1rem solid var(--portal-border-strong);
  border-bottom: 0.2rem solid var(--oz-accent, #c4904f);
  border-radius: 1rem;
}

.md-typeset img.oz-strip {
  display: block;
  width: 100%;
  max-width: 56rem;
  height: 3.6rem;
  margin: -0.4rem 0 1rem;
  object-fit: cover;
  object-position: center 60%;
  border-bottom: 0.15rem solid var(--oz-accent, #c4904f);
  border-radius: 0.6rem;
}

/* Links: visited links in wood, a double focus ring (navy and lantern). */
.md-content .md-typeset a:visited:not(.portal-cta, .oz-step, .oz-level, .md-content__button) {
  color: var(--oz-link-visited);
}

.md-typeset a:focus-visible,
.md-nav__link:focus-visible,
.md-tabs__link:focus-visible {
  outline: 0.1rem solid var(--portal-accent);
  outline-offset: 0.1rem;
  box-shadow: 0 0 0 0.25rem rgb(240 180 64 / 45%);
}

/* Numbered steps as path stones: top-level ordered lists of the content. */
.md-typeset > ol:not([class]) {
  margin-left: 0;
  padding-left: 0;
  list-style: none;
  counter-reset: oz-stone;
}

[dir] .md-typeset > ol:not([class]) > li {
  position: relative;
  padding-left: 2.1rem;
  margin-left: 0;
  counter-increment: oz-stone;
}

.md-typeset > ol:not([class]) > li::before {
  position: absolute;
  top: -0.1rem;
  left: 0;
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  font-size: 0.68rem;
  font-weight: 700;
  color: #152a50;
  content: counter(oz-stone);
  background: url("../images/ozarland/ui/step-stone-1.svg") center / contain no-repeat;
}

/* Section breaks: the dotted path. */
.md-typeset hr {
  height: 1.2rem;
  border: 0;
  background: url("../images/ozarland/ui/divider-path.svg") center / auto 100% no-repeat;
}

/* Footer: navy, with the island skyline rising from it. */
.md-footer {
  position: relative;
  margin-top: 3rem;
  color: var(--oz-header-text);
  background-color: var(--oz-header-bg);
}

.md-footer::before {
  position: absolute;
  bottom: 100%;
  right: 0;
  left: 0;
  height: 2.4rem;
  content: "";
  background-color: var(--oz-header-bg);
  -webkit-mask: url("../images/ozarland/ui/footer-skyline.svg") bottom left / auto 100% repeat-x;
  mask: url("../images/ozarland/ui/footer-skyline.svg") bottom left / auto 100% repeat-x;
  pointer-events: none;
}

.md-footer__link,
.md-footer__title,
.md-footer__direction,
.md-footer__button {
  color: var(--oz-header-text);
}

.md-footer__direction {
  color: var(--oz-header-muted);
  opacity: 1;
}

.md-footer-meta {
  color: var(--oz-header-muted);
  background-color: rgb(0 0 0 / 22%);
}

.md-footer-meta a,
.md-footer-copyright a {
  color: var(--oz-header-text);
}

/* Seal states of the journey page: not started (locked), in progress (the
   stage's seal, dimmed), done (the stage's seal, stamped). */
.oz-seal img,
.oz-stage__seal {
  opacity: 1;
  filter: none;
}

.oz-seal .oz-seal__progress,
.oz-seal .oz-seal__done,
.oz-seal:is(.is-progress, .is-complete) .oz-seal__locked {
  display: none;
}

.oz-seal:is(.is-progress, .is-complete) .oz-seal__done {
  display: block;
}

.oz-seal .oz-seal__locked {
  opacity: 0.55;
}

.oz-seal.is-progress .oz-seal__done {
  opacity: 0.5;
}

.oz-seal.is-progress {
  color: var(--portal-text);
}

.oz-seal.is-complete .oz-seal__done {
  animation: oz-stamp 420ms ease-out;
}

.oz-stage:not(.is-complete) .oz-stage__seal {
  opacity: 0.3;
  filter: grayscale(1);
}

@keyframes oz-stamp {
  0% { transform: scale(1.35) rotate(-4deg); opacity: 0; }
  70% { transform: scale(0.96) rotate(1deg); opacity: 1; }
  100% { transform: scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  .oz-seal.is-complete .oz-seal__done {
    animation: none;
  }

  .oz-progress__bar > span {
    transition: none;
  }
}

.md-footer-meta .md-copyright,
.md-footer-meta .md-copyright__highlight {
  color: var(--oz-header-muted);
}

.md-footer .md-footer-meta .md-copyright a,
.md-footer .md-footer-meta .md-copyright a:visited {
  color: var(--oz-header-text);
}

/* The copyright line is .md-typeset: its link takes the typeset link colour. */
.md-footer {
  --portal-accent: var(--oz-header-text);
  --md-typeset-a-color: var(--oz-header-text);
  --oz-link-visited: var(--oz-header-text);
  --md-default-fg-color: var(--oz-header-text);
  --md-default-fg-color--light: var(--oz-header-muted);
}

.md-typeset .oz-lumo__why {
  font-size: 0.7rem;
  color: var(--portal-text-muted);
}

/* ---------------------------------------------------------------------------
 * 19. Quiz score, quiz marks of the journey, "Continue where you left off"
 * (overrides/main.html, journey.html, partials/resume.html, learning.js).
 * ------------------------------------------------------------------------- */
.md-typeset .oz-quiz__score {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  padding: 0.6rem 0.8rem;
  margin: 0.4rem 0 0.2rem;
  background-color: var(--portal-bg);
  border: 0.05rem dashed var(--portal-amber-fg);
  border-radius: 0.4rem;
}

.md-typeset .oz-quiz__score[hidden],
.md-typeset .oz-quiz__score img[hidden] {
  display: none;
}

.md-typeset .oz-quiz__score.is-perfect {
  border-style: solid;
  border-color: var(--portal-green-fg);
}

.md-typeset .oz-quiz__score img {
  flex: none;
  width: 4.5rem;
  height: auto;
}

.md-typeset .oz-quiz__score p {
  margin: 0 0 0.5rem;
}

.md-typeset .oz-quiz__score .portal-cta {
  font-family: inherit;
  cursor: pointer;
}

.oz-quiz__best {
  font-weight: 700;
}

.oz-quiz-mark {
  padding: 0 0.3rem;
  margin-left: 0.4rem;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--portal-amber-fg);
  text-transform: uppercase;
  border: 0.05rem solid currentcolor;
  border-radius: 0.6rem;
}

.oz-quiz-mark.is-perfect {
  color: var(--portal-green-fg);
}

.oz-progress__quiz {
  margin-top: -0.4rem;
  font-size: 0.7rem;
  color: var(--portal-text-muted);
}

.md-typeset .oz-resume {
  margin: 0.6rem 0;
}

.md-typeset .oz-resume a.portal-cta {
  gap: 0.3rem;
  height: auto;
  padding: 0.4rem 1rem;
}

.md-typeset .oz-resume[hidden],
.md-typeset .oz-resume a[hidden] {
  display: none;
}

.oz-resume__stage {
  font-weight: 400;
  opacity: 0.85;
}

@media screen and (max-width: 44.9375em) {
  .md-typeset .oz-quiz__score {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------------------------------------------------------------------------
 * 20. "What would you do?": mini-scenarios (front matter `scenarios`,
 * overrides/main.html, learning.js). Icon: the lab callout of the kit.
 * ------------------------------------------------------------------------- */
.md-typeset :is(.admonition, details).scenario {
  --portal-adm-fg: var(--oz-ink);
  --portal-adm-bg: var(--oz-parchment-soft);
  --portal-adm-border: var(--oz-sea);

  max-width: 44rem;
  margin-top: 2rem;
  background-color: var(--portal-adm-bg);
}

.md-typeset .scenario > .admonition-title::before {
  background-image: url("../images/ozarland/callouts/try-in-lab.svg");
}

.md-typeset fieldset.oz-scenario {
  padding: 0.5rem 0.8rem 0.6rem;
  margin: 0 0 0.8rem;
  background-color: var(--portal-bg);
  border: 0.05rem solid var(--oz-sea);
  border-radius: 0.4rem;
}

.md-typeset fieldset.oz-scenario.is-best {
  border-color: var(--portal-green-fg);
}

.md-typeset fieldset.oz-scenario.is-risky {
  border-color: var(--portal-amber-fg);
}

.md-typeset fieldset.oz-scenario.is-avoid {
  border-color: var(--portal-red-fg);
}

.md-typeset .oz-scenario legend {
  padding: 0 0.3rem;
  font-family: var(--oz-font-heading, inherit);
  font-weight: 700;
}

.md-typeset .oz-scenario__situation {
  margin: 0.2rem 0 0.4rem;
}

.md-typeset .oz-scenario__ask {
  margin: 0 0 0.3rem;
  font-weight: 700;
}

.md-typeset .oz-scenario__feedback {
  padding: 0.3rem 0.6rem;
  margin: 0.1rem 0 0.5rem 1.6rem;
  border-left: 0.2rem solid var(--portal-text-muted);
  border-radius: 0 0.3rem 0.3rem 0;
  background-color: var(--portal-surface);
}

.md-typeset .oz-scenario__feedback[hidden] {
  display: none;
}

.md-typeset .oz-scenario__feedback p {
  margin: 0;
}

.md-typeset .oz-scenario__feedback--best {
  border-left-color: var(--portal-green-fg);
}

.md-typeset .oz-scenario__feedback--risky {
  border-left-color: var(--portal-amber-fg);
}

.md-typeset .oz-scenario__feedback--avoid {
  border-left-color: var(--portal-red-fg);
}

.oz-verdict--best {
  color: var(--portal-green-fg);
}

.oz-verdict--risky {
  color: var(--portal-amber-fg);
}

.oz-verdict--avoid {
  color: var(--portal-red-fg);
}

.md-typeset ul.oz-scenario__all {
  margin-top: 0.3rem;
}

/* ---------------------------------------------------------------------------
 * 21. Final challenge of a stage (overrides/journey.html, learning.js).
 * ------------------------------------------------------------------------- */
.md-typeset details.oz-challenge {
  grid-column: 1 / -1;
  margin: 0;
  font-size: inherit;
  background-color: var(--portal-violet-bg);
  border: 0.05rem solid var(--portal-violet-border);
  border-radius: 0.4rem;
  box-shadow: none;
}

.md-typeset details.oz-challenge > summary {
  padding: 0.5rem 1.8rem 0.5rem 2.4rem;
  font-weight: 700;
  color: var(--portal-violet-fg);
  background-color: transparent;
}

.md-typeset details.oz-challenge > summary::before {
  top: 0.5rem;
  left: 0.6rem;
  width: 1.1rem;
  height: 1.1rem;
  background: url("../images/ozarland/callouts/quiz.svg") center / contain no-repeat;
  -webkit-mask-image: none;
  mask-image: none;
}

.md-typeset .oz-challenge__quiz {
  max-width: none;
  padding: 0 0.7rem 0.4rem;
  margin: 0;
}

.md-typeset .oz-stage__challenge-state {
  margin: 0.5rem 0 0;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--portal-amber-fg);
}

.md-typeset .oz-stage__challenge-state.is-passed {
  color: var(--portal-green-fg);
}

.md-typeset .oz-stage__challenge-state[hidden] {
  display: none;
}

/* ---------------------------------------------------------------------------
 * 22. "To remember": takeaways of a page (front matter `remember`,
 * overrides/main.html, learning.js). Styled as a pinned parchment note.
 * ------------------------------------------------------------------------- */
.md-typeset .oz-remember {
  max-width: 44rem;
  margin-top: 2rem;
  border-left-width: 0.3rem;
}

.md-typeset .oz-remember__body {
  display: flex;
  gap: 0.8rem;
  align-items: flex-start;
}

.md-typeset .oz-remember__body > img {
  flex: none;
  width: 4.5rem;
  height: auto;
}

.md-typeset .oz-remember__lead {
  margin: 0 0 0.3rem;
}

.md-typeset ul.oz-remember__list {
  padding: 0;
  margin: 0 0 0.4rem;
  list-style: none;
}

.md-typeset ul.oz-remember__list > li {
  position: relative;
  padding-left: 1.3rem;
  margin: 0 0 0.35rem;
}

.md-typeset ul.oz-remember__list > li::before {
  position: absolute;
  top: 0.05rem;
  left: 0;
  font-weight: 700;
  color: var(--oz-wood-dark);
  content: "\2713";
}

.md-typeset .oz-remember__actions {
  margin: 0;
  font-size: 0.7rem;
}

.md-typeset .oz-remember__actions[hidden] {
  display: none;
}

@media screen and (max-width: 44.9375em) {
  .md-typeset .oz-remember__body {
    flex-direction: column;
  }
}

/* ---------------------------------------------------------------------------
 * 23. Source citations (tools/site/portal_mdx/cites.py): a code span that is a
 * `path:line` citation reads more quietly than a command or a setting, so the
 * explanation around it stands out. It keeps the code font, so it is still
 * clearly a reference to the code; it loses the background and is a bit
 * smaller and muted.
 * ------------------------------------------------------------------------- */
.md-typeset code.cite {
  padding: 0;
  font-size: 0.8em;
  color: var(--portal-text-muted);
  background-color: transparent;
  box-shadow: none;
}

.md-typeset a code.cite,
.md-typeset a:hover code.cite {
  color: inherit;
}

.md-typeset table:not([class]) code.cite {
  font-size: 0.82em;
}

/* ---------------------------------------------------------------------------
 * 24. Wide tables as cards on a phone (tools/site/portal_mdx/labels.py marks
 * tables of four columns or more and puts the column name on every cell).
 * Each row becomes a card; each cell shows its column name above its value.
 * Wide screens are not concerned.
 * ------------------------------------------------------------------------- */
@media screen and (max-width: 44.9375em) {
  .md-typeset__scrollwrap:has(table[data-portal-cards]),
  .md-typeset__table:has(table[data-portal-cards]) {
    overflow: visible;
  }

  .md-typeset table:not([class])[data-portal-cards][data-portal-cards] {
    display: block;
    width: 100%;
    max-width: 100%;
    font-size: 0.68rem;
    border: 0;
    box-shadow: none;
  }

  .md-typeset table:not([class])[data-portal-cards][data-portal-cards] thead {
    display: none;
  }

  .md-typeset table:not([class])[data-portal-cards][data-portal-cards] tbody {
    display: block;
  }

  .md-typeset table:not([class])[data-portal-cards][data-portal-cards] tr {
    display: block;
    padding: 0.4rem 0.6rem;
    margin: 0 0 0.6rem;
    background-color: var(--portal-bg);
    border: 0.05rem solid var(--portal-border);
    border-left: 0.2rem solid var(--oz-wood);
    border-radius: 0.4rem;
  }

  .md-typeset table:not([class])[data-portal-cards][data-portal-cards] td {
    display: block;
    min-width: 0;
    max-width: none;
    padding: 0.25rem 0;
    border: 0;
  }

  .md-typeset table:not([class])[data-portal-cards][data-portal-cards] td + td {
    border-top: 0.05rem dashed var(--portal-border);
  }

  .md-typeset table:not([class])[data-portal-cards][data-portal-cards] td[data-label]::before {
    display: block;
    margin-bottom: 0.1rem;
    font-size: 0.85em;
    font-weight: 700;
    color: var(--portal-text-muted);
    content: attr(data-label);
  }

  /* The first cell names the row: it reads as the card title. */
  .md-typeset table:not([class])[data-portal-cards][data-portal-cards] td:first-child {
    font-weight: 700;
  }

  .md-typeset table:not([class])[data-portal-cards][data-portal-cards] td:first-child::before {
    font-weight: 700;
  }
}

/* ---------------------------------------------------------------------------
 * 25. Room for the prose columns of wide tables (tools/site/portal_mdx/labels.py
 * marks long and short columns). On a wide screen a prose column may be much
 * wider than the default cap of section 6, and a column of short values
 * narrower, so a row is no longer as tall as its longest note in a squeezed
 * column. The table still scrolls sideways when it needs to.
 * ------------------------------------------------------------------------- */
@media screen and (min-width: 60em) {
  .md-typeset table:not([class])[data-portal-cards]:has(> thead th:nth-child(5)) :is(th, td)[data-col="long"] {
    min-width: 16rem;
    max-width: min(30rem, 60vw);
  }

  .md-typeset table:not([class])[data-portal-cards]:has(> thead th:nth-child(5)) :is(th, td)[data-col="short"] {
    max-width: 9rem;
  }
}

/* ---------------------------------------------------------------------------
 * 26. OzarLand Academy art direction (brand/academy/): the island trail of the
 * learning path. Tokens of brand/academy/tokens/palette.css that the
 * sections above do not already define (module accents, focus keyline, risk
 * states), the learning-path home (overrides/academy.html), the module home
 * (overrides/landing.html), the state pages (overrides/planned.html,
 * overrides/404.html). Module accents are fills, borders and icon details
 * only, never small text (brand/academy/accessibility.md).
 * ------------------------------------------------------------------------- */
[data-md-color-scheme="default"] {
  --oz-surface: #fffdf8;
  --oz-text: #152a50;
  --oz-text-muted: #4e5a6d;
  --oz-focus: #f0b440;
  --oz-focus-keyline: #152a50;
  --oz-module-lab: #1e9fb5;
  --oz-module-deploy: #2f6fd0;
  --oz-module-day2: #c4904f;
  --oz-module-runbooks: #2c7a43;
  --oz-module-production: #b55a3a;
  --oz-module-book: #6b4220;
  --oz-risk-readonly-text: #4b3b69;
  --oz-risk-readonly-bg: #f0ecf7;
  --oz-risk-state-text: #654100;
  --oz-risk-state-bg: #fff1cf;
  --oz-risk-destructive-text: #7a2430;
  --oz-risk-destructive-bg: #f9e7ea;
  --oz-radius-control: 0.4rem;
  --oz-radius-card: 0.7rem;
  --oz-radius-hero: 1rem;
  --oz-shadow: 0 0.3rem 1rem rgb(21 42 80 / 12%);
}

[data-md-color-scheme="slate"] {
  --oz-surface: #1c2433;
  --oz-text: #f3e3c3;
  --oz-text-muted: #b2bdca;
  --oz-focus: #f0b440;
  --oz-focus-keyline: #f3e3c3;
  --oz-module-lab: #4cc3d6;
  --oz-module-deploy: #8fb0e6;
  --oz-module-day2: #d9a865;
  --oz-module-runbooks: #70c78a;
  --oz-module-production: #e0825f;
  --oz-module-book: #d9a865;
  --oz-risk-readonly-text: #d7c9f0;
  --oz-risk-readonly-bg: #30293d;
  --oz-risk-state-text: #f2d28a;
  --oz-risk-state-bg: #3a301e;
  --oz-risk-destructive-text: #f0b1bb;
  --oz-risk-destructive-bg: #3d2228;
  --oz-radius-control: 0.4rem;
  --oz-radius-card: 0.7rem;
  --oz-radius-hero: 1rem;
  --oz-shadow: 0 0.4rem 1.2rem rgb(0 0 0 / 28%);
}

/* The accent of a module: one custom property, set by a class. */
.oz-module--lab { --oz-accent: var(--oz-module-lab); }
.oz-module--deploy { --oz-accent: var(--oz-module-deploy); }
.oz-module--day2 { --oz-accent: var(--oz-module-day2); }
.oz-module--runbooks { --oz-accent: var(--oz-module-runbooks); }
.oz-module--production { --oz-accent: var(--oz-module-production); }
.oz-module--book { --oz-accent: var(--oz-module-book); }

/* Keyboard focus: a gold inner ring and a keyline (navy on the light
   canvas, parchment on the dark one): gold alone does not reach 3:1 on the
   pale canvas. */
.oz-academy-hero :is(a, button):focus-visible,
.oz-module-hero :is(a, button):focus-visible,
.md-typeset :is(.oz-trail, .oz-book, .oz-state, .oz-next) :is(a, button):focus-visible,
:is(a, button).portal-cta:focus-visible {
  outline: 0.1rem solid var(--oz-focus);
  outline-offset: 0;
  box-shadow: 0 0 0 0.2rem var(--oz-focus-keyline);
}

/* Hero: heading and lead on a solid plate, never on the painted pixels. */
.oz-plate {
  padding: 1.2rem 1.4rem;
  color: var(--oz-text);
  background-color: var(--oz-surface);
  border: 0.05rem solid var(--oz-wood);
  border-radius: var(--oz-radius-hero);
  box-shadow: var(--oz-shadow);
}

.oz-academy-hero .oz-hero__inner {
  grid-template-columns: minmax(0, 1fr) minmax(0, 30rem);
}

.oz-academy-hero .oz-hero__art img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--oz-radius-hero);
}

/* Learning path: five stops joined by a vertical trail. The order and the
   rail stay the same on every width: no horizontally scrolling journey. */
.md-typeset ol.oz-trail {
  position: relative;
  display: grid;
  gap: 0.9rem;
  max-width: 50rem;
  padding: 0;
  margin: 1.2rem 0 0;
  list-style: none;
}

.md-typeset ol.oz-trail::before {
  position: absolute;
  top: 1.6rem;
  bottom: 1.6rem;
  left: 1.6rem;
  content: "";
  border-left: 0.2rem dashed var(--oz-wood);
}

[dir] .md-typeset .oz-stop {
  position: relative;
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  padding: 0;
  margin: 0;
}

.oz-stop__seal {
  position: relative;
  width: 3.2rem;
  height: 3.2rem;
}

.md-typeset .oz-stop__body {
  padding: 0.6rem 1rem 0.7rem;
  background-color: var(--oz-surface);
  border: 0.05rem solid var(--oz-wood);
  border-top: 0.25rem solid var(--oz-accent, var(--oz-wood));
  border-radius: var(--oz-radius-card);
}

.md-typeset .oz-stop__body > p {
  margin: 0.2rem 0;
}

.oz-stop__step {
  margin: 0 0 0.2rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--oz-text-muted);
  text-transform: uppercase;
}

.md-typeset .oz-stop__title {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 700;
}

.oz-stop__icon {
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
  vertical-align: middle;
}

/* An icon drawn in an <img> cannot take the text colour: its strokes stay
   navy, so in the dark scheme it sits on a small parchment disc. */
[data-md-color-scheme="slate"] .oz-stop__icon {
  padding: 0.12rem;
  background-color: #f3e3c3;
  border-radius: 50%;
}

.md-typeset .oz-stop--planned .oz-stop__body {
  background-color: transparent;
  border-style: dashed;
  border-top-style: solid;
}

.md-typeset .oz-stop--planned .oz-stop__seal {
  opacity: 0.55;
}

/* The book: a separate route, set apart from the trail. */
.md-typeset .oz-book {
  max-width: 50rem;
  margin-top: 2.4rem;
  overflow: hidden;
  background-color: var(--oz-surface);
  border: 0.05rem solid var(--oz-wood);
  border-left: 0.3rem solid var(--oz-accent);
  border-radius: var(--oz-radius-card);
}

.oz-book__band {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 1;
  object-fit: cover;
}

.md-typeset .oz-book__text {
  padding: 0 1.2rem 0.6rem;
}

.md-typeset .oz-book h2 {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding-top: 0;
  margin-top: 1rem;
  border-top: 0;
}

/* Module home: breadcrumb, seal, the band of the module. */
.oz-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.6rem;
  font-size: 0.7rem;
}

.oz-crumbs a {
  font-weight: 600;
  color: var(--oz-text);
  text-decoration: underline;
}

.oz-module-hero .oz-plate {
  border-top: 0.3rem solid var(--oz-accent);
}

.oz-module-hero .oz-hero__inner {
  grid-template-columns: minmax(0, 1fr) auto;
}

.oz-module-hero__title {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.oz-module-hero__title .oz-stop__icon {
  width: 2.4rem;
  height: 2.4rem;
}

.oz-module-hero__seal {
  width: 6rem;
  height: 6rem;
}

.oz-band {
  display: block;
  width: 100%;
  height: auto;
  margin: 1rem 0 0;
  aspect-ratio: 4 / 1;
  object-fit: cover;
  border: 0.05rem solid var(--oz-wood);
  border-radius: var(--oz-radius-card);
}

@media screen and (max-width: 60em) {
  .oz-academy-hero .oz-hero__inner,
  .oz-module-hero .oz-hero__inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .oz-module-hero__seal {
    display: none;
  }
}

/* Next stop and the book, at the end of a module home. */
.md-typeset .oz-next {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.8rem;
  max-width: 50rem;
  margin-top: 2rem;
}

.md-typeset a.oz-next__stop {
  display: block;
  padding: 0.7rem 1rem;
  color: var(--oz-text);
  text-decoration: none;
  background-color: var(--oz-surface);
  border: 0.05rem solid var(--oz-wood);
  border-left: 0.3rem solid var(--oz-accent);
  border-radius: var(--oz-radius-card);
}

.md-typeset a.oz-next__stop .oz-stop__step {
  display: block;
}

.md-typeset .oz-next__title {
  font-weight: 700;
  text-decoration: underline;
}

/* State pages (coming soon, page not found): the image beside a plain
   heading and its explanation; stacked on phones. */
.md-typeset .oz-state {
  display: grid;
  grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
  gap: 1.4rem;
  align-items: center;
  max-width: 50rem;
  margin: 0.4rem 0 1.4rem;
}

.oz-state__art {
  display: block;
  width: 100%;
  height: auto;
  border: 0.05rem solid var(--oz-wood);
  border-radius: var(--oz-radius-card);
}

.md-typeset .oz-state h1 {
  margin: 0 0 0.6rem;
}

.md-typeset .oz-state__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

@media screen and (max-width: 44.9375em) {
  .md-typeset .oz-state {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Controls of the art direction reach 44 x 44 CSS px on touch screens. */
@media (pointer: coarse) {
  :is(a, button).portal-cta {
    min-height: 2.2rem;
  }
}

/* Home page of a single module (overrides/main.html): breadcrumb, stage
   seal and band under the title written in its Markdown. */
.md-typeset .oz-module-head {
  max-width: 50rem;
  margin: 0.4rem 0 1.4rem;
}

.md-typeset .oz-module-head__stop {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin: 0.4rem 0 0;
}

.oz-module-head__seal {
  width: 2.8rem;
  height: 2.8rem;
}

.md-typeset .oz-module-head .oz-band {
  border-top: 0.25rem solid var(--oz-accent);
}
