/* Ingence site: tokens and components, over the PyData Sphinx theme.

   Light is the default, and the only state with JavaScript off (no data-theme attribute, or
   data-theme="light"); html[data-theme="dark"] is dark, the attribute the theme's own switch sets.
   The tokens are the Dashboard's, with the few the site adds (marked). Nothing here loads a font,
   an image or a script from another site: the type is the system's, and the two families the design
   names (Atkinson Hyperlegible, IBM Plex Mono) are used only where a reader already has them.

   The theme's own variables (--pst-*) are pointed at the tokens in the same two selectors, so its
   header, sidebar, notes, tables and search follow the palette in both schemes.

   One job per color: magenta only where a person said so; red only as a border or a dot beside a
   word; the later-stage color for cautions; hatching for unknown; blue is the accent (selection,
   links, the made file in the mark). */

:root,
html:not([data-theme]),
html[data-theme="light"] {
  color-scheme: light;
  --ink: #16181d;
  --ink-soft: #5b6270;
  --line: #d9dce3;
  --page: #fbfbfc;
  --panel: #ffffff;
  --accent: #1f5fa8;
  --on-accent: #ffffff;
  --accent-soft: #e6eef9;
  --acq: #0b6b57;
  --later: #8a4a10;
  --doubt: #a11b3a;
  --person: #c2185b;
  --problem: #d03b3b;
  --hatch: repeating-linear-gradient(135deg, #5b6270 0 1px, transparent 1px 5px);
  --code-bg: #f2f3f6;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e8eaef;
  --ink-soft: #9aa2b1;
  --line: #333844;
  --page: #14161b;
  --panel: #1b1e25;
  --accent: #79b0ee;
  --on-accent: #14161b;
  --accent-soft: #223247;
  --acq: #58c9ab;
  --later: #e0a469;
  --doubt: #f08098;
  --person: #e4679e;
  --problem: #f07070;
  --hatch: repeating-linear-gradient(135deg, #9aa2b1 0 1px, transparent 1px 5px);
  --code-bg: #1b1e25;
}

:root,
html:not([data-theme]),
html[data-theme="light"],
html[data-theme="dark"] {
  --font-sans: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --pst-font-family-base: var(--font-sans);
  --pst-font-family-heading: var(--font-sans);
  --pst-font-family-monospace: var(--font-mono);
  --pst-font-size-base: 1.0625rem;
  --pst-sidebar-font-size: 0.95rem;
  --pst-header-height: 60px;

  --pst-color-text-base: var(--ink);
  --pst-color-text-muted: var(--ink-soft);
  --pst-color-heading: var(--ink);
  --pst-color-background: var(--page);
  --pst-color-on-background: var(--panel);
  --pst-color-surface: var(--code-bg);
  --pst-color-on-surface: var(--ink);
  --pst-color-border: var(--line);
  --pst-color-border-muted: var(--line);
  --pst-color-primary: var(--accent);
  --pst-color-primary-text: var(--on-accent);
  --pst-color-primary-highlight: var(--accent-soft);
  --pst-color-primary-bg: var(--accent-soft);
  --pst-color-secondary: var(--accent);
  --pst-color-secondary-text: var(--on-accent);
  --pst-color-secondary-highlight: var(--accent-soft);
  --pst-color-secondary-bg: var(--accent-soft);
  --pst-color-link: var(--accent);
  --pst-color-link-hover: var(--accent);
  --pst-color-link-higher-contrast: var(--accent);
  --pst-color-inline-code: var(--ink);
  --pst-color-inline-code-links: var(--accent);
  --pst-color-target: var(--accent-soft);
  --pst-color-info: var(--accent);
  --pst-color-info-bg: var(--panel);
  --pst-color-warning: var(--later);
  --pst-color-warning-bg: var(--panel);
  --pst-color-danger: var(--problem);
  --pst-color-danger-bg: var(--panel);
  --pst-color-success: var(--acq);
  --pst-color-success-bg: var(--panel);
  --pst-color-attention: var(--later);
  --pst-color-attention-bg: var(--panel);
  --pst-color-info-text: var(--on-accent);
  --pst-color-warning-text: var(--on-accent);
  --pst-color-danger-text: var(--on-accent);
  --pst-color-success-text: var(--on-accent);
  --pst-color-attention-text: var(--on-accent);
  --pst-color-shadow: transparent;
  --pst-color-table-row-hover-bg: var(--accent-soft);
  --pst-color-table-inner-border: var(--line);
  --pst-color-accent: var(--person);
  --pst-color-accent-bg: var(--accent-soft);
}

/* ---- Base ------------------------------------------------------------------------------- */

body {
  font-variant-numeric: tabular-nums;
  text-wrap: pretty;
}

a {
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.005em;
}

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

/* A control that does nothing without JavaScript is not shown without it. */
.js-only,
button.copy {
  display: none;
}

html.ingence-js .js-only {
  display: revert;
}

html.ingence-js button.copy {
  display: inline-flex;
}

/* ---- The brand and the header ------------------------------------------------------------- */

.navbar-brand.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.navbar-brand.logo svg {
  width: 28px;
  height: 28px;
  flex: none;
}

.navbar-brand .files {
  stroke: currentColor;
}

.navbar-brand .made {
  fill: var(--accent);
}

.navbar-brand .logo__title {
  margin: 0;
  font-size: inherit;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
}

.bd-header {
  border-bottom: 1px solid var(--line);
  background: var(--page) !important;
  box-shadow: none;
}

.bd-header .navbar-nav .nav-link {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding-block: 0.35rem;
}

.bd-header .navbar-nav .nav-link:hover,
.bd-header .navbar-nav .nav-link[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.bd-header .search-button-field,
.bd-header .version-switcher__button,
.bd-header .theme-switch-button {
  border-color: var(--line);
  background: var(--panel);
  color: var(--ink);
  box-shadow: none;
}

.bd-header .search-button-field kbd {
  border: 1px solid var(--line);
  background: none;
  color: var(--ink-soft);
}

/* The pre-alpha notice, in the later-stage color: the one color a caution has. */
.bd-header-announcement {
  background: var(--panel);
  color: var(--ink);
  border-bottom: 1px solid var(--later);
  font-weight: 400;
}

.bd-header-announcement .announcement-content {
  max-width: 70rem;
}

.bd-header-announcement a {
  color: var(--ink);
}

.bd-header-announcement strong {
  color: var(--later);
}

/* ---- The sidebar and the page ------------------------------------------------------------- */

.bd-sidebar-primary {
  background: var(--page);
  border-right: 0;
  font-size: 0.95rem;
}

.bd-sidebar-primary .sidebar-primary-item .caption-text,
.bd-sidebar-primary .caption {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.bd-sidebar-primary a.reference {
  color: var(--ink);
  text-decoration: none;
}

.bd-sidebar-primary a.reference:hover {
  background: var(--panel);
}

.bd-sidebar-primary li.current > a.reference,
.bd-sidebar-primary a.reference.current {
  color: var(--accent);
  font-weight: 700;
  background: var(--panel);
  box-shadow: inset 2px 0 0 var(--accent);
}

.bd-sidebar-secondary,
.bd-toc .onthispage {
  font-size: 0.9rem;
}

.bd-toc .toc-entry a.reference {
  color: var(--ink-soft);
  text-decoration: none;
}

.bd-toc .toc-entry a.reference:hover,
.bd-toc .toc-entry a.reference.active {
  color: var(--ink);
}

.bd-toc .toc-entry a.reference.active {
  box-shadow: inset 2px 0 0 var(--accent);
}

.bd-article-container {
  max-width: 62rem;
}

.bd-article h2 {
  margin-top: 2.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.bd-article > section > h1 + h2,
.bd-article h1 + h2 {
  margin-top: 1.5rem;
}

.breadcrumb a {
  color: var(--ink-soft);
  text-decoration: none;
}

.prev-next-area a {
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.prev-next-area a:hover {
  border-color: var(--ink-soft);
}

/* ---- Code ------------------------------------------------------------------------------- */

div.highlight {
  position: relative;
}

div.highlight pre {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.9rem 4.5rem 0.9rem 1rem;
  line-height: 1.5;
  font-size: 0.9rem;
  overflow-x: auto;
}

/* One accent and no rainbow: every token reads as ink, but the prompt, the output and a comment. */
html:is(:not([data-theme]), [data-theme]) div.highlight pre span[class] {
  color: inherit;
  font-weight: inherit;
  font-style: inherit;
  background: none;
}

html:is(:not([data-theme]), [data-theme]) div.highlight pre span.gp {
  color: var(--ink-soft);
  user-select: none;
}

html:is(:not([data-theme]), [data-theme]) div.highlight pre :is(span.go, span.c, span.c1, span.cm, span.ch) {
  color: var(--ink-soft);
}

code.literal,
.rst-content code {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 0.3em;
  color: var(--ink);
}

pre code.literal {
  border: 0;
  padding: 0;
}

div.code-block-caption {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* The copy button: a few lines of script put it on every code block and every copyable entry. */
button.copy {
  align-items: center;
  justify-content: center;
  min-height: 26px;
  min-width: 44px;
  padding: 0.15rem 0.7rem;
  font: inherit;
  font-size: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

button.copy:hover {
  border-color: var(--ink-soft);
}

button.copy[data-state="copied"] {
  border-color: var(--accent);
  color: var(--accent);
}

div.highlight > button.copy {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
}

/* ---- Tables ----------------------------------------------------------------------------- */

table.table,
table.doc {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.98rem;
  border: 0;
}

table.table th,
table.table td,
table.doc th,
table.doc td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.75rem;
  border: 0;
  border-bottom: 1px solid var(--line);
}

table.table thead th,
table.doc th {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}

table.table td code,
table.doc td code {
  white-space: nowrap;
}

.table-scroll {
  overflow-x: auto;
}

/* ---- Notes, cautions and the maturity notice -------------------------------------------- */

html div.admonition {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: none;
  padding: 0.9rem 1.1rem;
}

html div.admonition > .admonition-title {
  background: none;
  padding: 0;
  margin: 0 0 0.35rem;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

html div.admonition > .admonition-title::after {
  display: none;
}

html div.admonition > :not(.admonition-title) {
  margin-left: 0;
}

html div.admonition.warning,
html div.admonition.danger,
html div.admonition.error,
html div.admonition.caution {
  border-color: var(--line);
  border-left-color: var(--problem);
}

html div.admonition.warning > .admonition-title,
html div.admonition.danger > .admonition-title,
html div.admonition.error > .admonition-title,
html div.admonition.caution > .admonition-title {
  color: var(--ink);
}

html div.admonition.warning > .admonition-title::before,
html div.admonition.danger > .admonition-title::before,
html div.admonition.error > .admonition-title::before,
html div.admonition.caution > .admonition-title::before {
  content: "";
  position: static;
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--problem);
}

html div.admonition:is(.note, .tip, .hint, .seealso, .admonition-todo) > .admonition-title::before {
  display: none;
}

html div.admonition.important,
html div.admonition.attention {
  border: 1px solid var(--later);
}

html div.admonition.important > .admonition-title,
html div.admonition.attention > .admonition-title {
  color: var(--later);
}

html div.admonition.important > .admonition-title::before,
html div.admonition.attention > .admonition-title::before {
  display: none;
}

/* ---- Cards from sphinx-design ----------------------------------------------------------- */

.sd-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: none;
}

.sd-card .sd-card-title {
  color: var(--ink);
}

.sd-card-hover:hover {
  border-color: var(--ink-soft);
  transform: none;
}

/* Tabs from sphinx-design take the design's tab box. */
html {
  --sd-color-tabs-label-active: var(--accent);
  --sd-color-tabs-label-hover: var(--ink);
  --sd-color-tabs-label-inactive: var(--ink-soft);
  --sd-color-tabs-underline-active: var(--accent);
  --sd-color-tabs-underline-hover: var(--ink-soft);
  --sd-color-tabs-underline-inactive: transparent;
  --sd-color-tabs-overline: var(--line);
  --sd-color-tabs-underline: var(--line);
}

html .bd-content .sd-tab-set {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 0 0.5rem;
}

html .bd-content .sd-tab-set > label {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--ink-soft);
  font-weight: 700;
  line-height: 1.4;
  min-height: 44px;
  padding: 0.7rem 1rem 0.5rem;
}

html .bd-content .sd-tab-set > input:checked + label {
  background: none;
  border: 0;
  border-bottom: 2px solid var(--accent);
  border-radius: 0;
  color: var(--accent);
}

html .bd-content .sd-tab-set > input:focus-visible + label {
  background: none;
  border: 0;
  border-bottom: 2px solid var(--accent);
  border-radius: 0;
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

html .bd-content .sd-tab-set > input:not(:checked, :focus-visible) + label:hover {
  border-color: var(--ink-soft);
  color: var(--ink);
  text-decoration: none;
}

html .bd-content .sd-tab-set .sd-tab-content {
  background: none;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  padding: 0.75rem 0.5rem;
}

/* ---- Buttons and notices as the design has them ----------------------------------------- */

.btn-ingence {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}

.btn-ingence:hover {
  border-color: var(--ink-soft);
  color: var(--ink);
}

.btn-ingence.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.btn-ingence.primary:hover {
  filter: brightness(1.08);
  border-color: var(--accent);
  color: var(--on-accent);
}

.dot-person::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--person);
  margin-right: 0.45rem;
  vertical-align: 0.05em;
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.id {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

/* A name read into its parts */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  background: var(--page);
  font-size: 0.95rem;
}

.chip code {
  font-size: 0.95em;
  color: var(--ink);
  border: 0;
  background: none;
  padding: 0;
}

.chip .sense {
  color: var(--ink-soft);
  font-size: 0.85em;
}

.chip-person {
  border-color: var(--person);
}

.chip-person .sense {
  color: var(--person);
}

/* Swatches for legends */
.sw {
  display: inline-block;
  width: 28px;
  height: 14px;
  border-radius: 3px;
  vertical-align: -2px;
  border: 1px solid transparent;
}

.sw-acq { background: var(--acq); }
.sw-later { background: var(--later); }
.sw-doubt { background: var(--doubt); }
.sw-hatch { background: var(--hatch); border-color: var(--line); }
.sw-empty { border-color: var(--ink-soft); }
.sw-problem { border-color: var(--problem); }
.sw-dashed { border: 1px dashed var(--ink-soft); }
.sw-person { background: var(--person); width: 10px; height: 10px; border-radius: 50%; }

/* ---- The landing page ------------------------------------------------------------------- */

.landing {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 3rem 5rem;
  padding-block: 2rem 3rem;
  align-items: start;
}

.landing .left {
  position: sticky;
  top: 5rem;
  display: grid;
  gap: 1.5rem;
}

.landing .lead {
  color: var(--ink-soft);
  font-size: 1.1rem;
  margin: 0;
}

.landing .ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.landing .license {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin: 0;
}

.landing .right {
  display: grid;
  gap: 2.5rem;
}

.landing p {
  margin: 0;
}

.landing .soft {
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.landing .hero {
  font-size: clamp(1.7rem, 1.2rem + 1.9vw, 2.5rem);
  margin: 0;
  padding: 0;
  border: 0;
  line-height: 1.2;
}

/* The landing page keeps its Markdown title for the contents and the tab, and shows the design's
   heading instead. */
.bd-article:has(.landing) > section > h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.bd-article-container:has(.catalogue),
.bd-article-container:has(.landing),
.bd-main:has(.landing) .bd-content,
.bd-main:has(.landing) .bd-article-container {
  max-width: 76rem;
}

.maturity {
  border-left: 3px solid var(--later);
  padding: 0.2rem 0 0.2rem 1rem;
  display: grid;
  gap: 0.2rem;
  font-size: 0.98rem;
}

.maturity strong {
  color: var(--later);
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.6rem;
  margin-bottom: 1.4rem;
}

.section-title h2 {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0;
  padding: 0;
  border: 0;
}

.trail {
  display: grid;
  gap: 0;
}

.trail-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 0 1rem;
}

.trail-rail {
  position: relative;
}

.trail-rail::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--line);
}

.trail-step:first-child .trail-rail::before { top: 14px; }
.trail-step:last-child .trail-rail::before { bottom: auto; height: 14px; }

.trail-rail::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--page);
  border: 2px solid var(--ink-soft);
}

.trail-step[data-made] .trail-rail::after {
  background: var(--accent);
  border-color: var(--accent);
}

.trail-step[data-gap] .trail-rail::after {
  background: var(--hatch);
  border-color: var(--ink-soft);
}

.trail-body {
  padding: 0 0 1.4rem;
  display: grid;
  gap: 0.4rem;
}

.trail-step:last-child .trail-body { padding-bottom: 0; }

.trail-k {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  line-height: 28px;
}

.file-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.6rem;
  align-items: baseline;
}

.file-line code {
  font-size: 1.05rem;
}

.file-line .path {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.why {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
  background: var(--panel);
  display: grid;
  gap: 0.25rem;
  font-size: 0.98rem;
}

.gap-mark {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  background: var(--hatch);
  border: 1px dotted var(--problem);
  vertical-align: -3px;
  margin-right: 0.4rem;
}

.plist .p {
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr);
  gap: 1rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
}

.plist .p:first-child {
  border-top: 0;
  padding-top: 0;
}

.plist .n {
  font-family: var(--font-mono);
  font-size: 1.6rem;
  color: var(--accent);
  line-height: 1.1;
}

.plist h3 {
  font-size: 1.2rem;
  margin: 0;
}

.plist p {
  color: var(--ink-soft);
  margin-top: 0.3rem;
  font-size: 1rem;
}

/* ---- Reference cards: a rule, a Dictionary word ----------------------------------------- */

.ref-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.25rem 1.4rem;
  display: grid;
  gap: 0.9rem;
  align-content: start;
  min-width: 0;
}

.ref-card p {
  margin: 0;
}

.ref-card table.doc td code {
  white-space: normal;
  overflow-wrap: anywhere;
}

.ref-card .sentence {
  font-size: 1.2rem;
  line-height: 1.4;
  font-weight: 700;
}

.ref-card .kv {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.3rem 1rem;
  font-size: 0.98rem;
  margin: 0;
}

.ref-card .kv dt {
  color: var(--ink-soft);
  font-weight: 400;
}

.ref-card .kv dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.bd-article .ref-card dl,
.bd-article .ref-card dd,
.bd-article .ref-card p,
.bd-article .ref-card details {
  margin: 0;
}

.ref-card h4 {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0.25rem 0 0;
}

.ambiguous {
  color: var(--doubt);
  font-weight: 700;
}

/* ---- The catalogue: list and cards, by tab ---------------------------------------------- */

.catalogue {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.cat-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
}

.cat-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--panel);
}

.cat-switch label {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 1rem;
  cursor: pointer;
  color: var(--ink-soft);
  font-weight: 700;
}

.cat-switch label + label {
  border-left: 1px solid var(--line);
}

.catalogue:has(#view-list:checked) label[for="view-list"],
.catalogue:has(#view-cards:checked) label[for="view-cards"] {
  background: var(--accent-soft);
  color: var(--accent);
}

.catalogue:has(#view-list:focus-visible) label[for="view-list"],
.catalogue:has(#view-cards:focus-visible) label[for="view-cards"] {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
}

.catalogue:has(#view-cards:checked) .cat-listview,
.catalogue:has(#view-list:checked) .cat-cardview {
  display: none;
}

html.ingence-js .cat-filter {
  display: flex;
  flex: 1 1 18rem;
  align-items: center;
  gap: 1rem;
}

.cat-filter input[type="search"] {
  font: inherit;
  min-height: 44px;
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  width: min(100%, 24rem);
}

.cat-found {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.25rem;
  border-bottom: 1px solid var(--line);
}

.cat-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0 0.7rem;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.cat-tabs a:hover {
  color: var(--ink);
}

.cat-count {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

/* The section the address names shows, and the first with none. A browser without :has shows
   every section, one under the other. */
.cat-sections:not(:has(:target)) > .cat-section:not(:first-child),
.cat-sections:has(:target) > .cat-section:not(:target):not(:has(:target)) {
  display: none;
}

html.ingence-js .catalogue.is-filtering .cat-sections > .cat-section {
  display: block;
}

.cat-section {
  display: grid;
  gap: 1rem;
  scroll-margin-top: 14rem;
}

.cat-section > h2 {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 1.35rem;
}

.cat-section > h2 small {
  font-weight: 400;
  font-size: 0.95rem;
  color: var(--ink-soft);
  letter-spacing: 0;
}

.cat-blurb {
  color: var(--ink-soft);
  margin: 0;
  max-width: 72ch;
}

.cat-table {
  table-layout: auto;
}

.cat-table th:nth-child(1) { width: 24%; }
.cat-table th:nth-child(2) { width: 13%; }
.cat-table th:nth-child(4) { width: 15%; }
.cat-table th:nth-child(5) { width: 11rem; }

html .bd-main .bd-content .bd-article-container .bd-article .cat-section:target > h2 {
  background: none;
}

.cat-table th.cat-name {
  text-transform: none;
  letter-spacing: 0;
  font-size: inherit;
  color: var(--ink);
  font-weight: 700;
}

.cat-table .id {
  font-weight: 400;
  display: block;
}

.cat-table .id code {
  border: 0;
  padding: 0;
  background: none;
}

.cat-table td.cat-act {
  white-space: nowrap;
  text-align: right;
}

.cat-table td.cat-act button + button {
  margin-left: 0.35rem;
}

.cat-table td code {
  white-space: normal;
}

.cat-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 1rem;
}

.cat-card {
  padding: 1rem 1.1rem;
  gap: 0.6rem;
}

.cat-card .sentence {
  font-size: 1.05rem;
}

.cat-card .kv {
  font-size: 0.95rem;
}

.cat-card .id code {
  border: 0;
  padding: 0;
  background: none;
}

.cat-card-act {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
}

.cat-card-act .more {
  font-size: 0.95rem;
}

.cat-yaml summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 0.95rem;
  min-height: 26px;
}

.cat-yaml pre {
  margin: 0.5rem 0 0;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  overflow-x: auto;
}

.cat-note {
  margin: 0.6rem 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.cat-empty {
  color: var(--ink-soft);
}

.catalogue [hidden] {
  display: none !important;
}

/* ---- Annotated screenshot and demo frame: ready for the screenshots ---------------------- */

.annotated {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(240px, 2fr);
  gap: 1.5rem;
  align-items: start;
}

.annotated figure {
  margin: 0;
  position: relative;
}

.annotated .shot {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}

.annotated .shot img {
  width: 100%;
  height: auto;
}

/* A picture of the Dashboard in a guide fills the column. A class does this: the figure's own width
   option would write an inline style, which the site does not allow. */
img.archive-shot {
  width: 100%;
  height: auto;
}

.marker {
  position: absolute;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  font-size: 0.85rem;
  display: grid;
  place-items: center;
  border: 2px solid var(--page);
  box-shadow: 0 0 0 1px var(--accent);
}

.annotated ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: m;
  display: grid;
  gap: 0.75rem;
}

.annotated ol li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 0.75rem;
  counter-increment: m;
  font-size: 0.98rem;
}

.annotated ol li::before {
  content: counter(m);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  font-size: 0.85rem;
  display: grid;
  place-items: center;
}

.annotated figcaption {
  color: var(--ink-soft);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.placeholder {
  background: repeating-linear-gradient(135deg, var(--panel) 0 10px, var(--page) 10px 20px);
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
  aspect-ratio: 16 / 10;
}

.demo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border: 1px solid var(--later);
  border-radius: 8px 8px 0 0;
  padding: 0.6rem 1rem;
  background: var(--panel);
}

.demo-banner strong {
  color: var(--later);
}

.demo-stage {
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 8px 8px;
  min-height: 560px;
  background: var(--page);
}

.demo-stage iframe {
  width: 100%;
  min-height: 560px;
  border: 0;
}

.tour {
  display: grid;
  gap: 1rem;
}

.tour-still {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
  margin: 0;
}

.tour-still .placeholder {
  aspect-ratio: 4 / 3;
}

.tour-still figcaption {
  padding: 0.75rem 1rem;
  display: grid;
  gap: 0.25rem;
}

.demo-frame .phone {
  display: none;
}

.tour-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

/* ---- The footer ------------------------------------------------------------------------- */

.bd-footer {
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.bd-footer a {
  color: var(--ink-soft);
}

.bd-footer .footer-items__start,
.bd-footer .footer-items__center,
.bd-footer .footer-items__end {
  flex: 1 1 auto;
}

.ingence-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2.5rem;
  justify-content: space-between;
  width: 100%;
  padding-block: 0.75rem;
}

.ingence-footer p {
  margin: 0;
}

.ingence-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

/* ---- Phone and print -------------------------------------------------------------------- */

@media (max-width: 900px) {
  .landing {
    grid-template-columns: minmax(0, 1fr);
    gap: 2.5rem;
    padding-block: 1.5rem 3rem;
  }

  .landing .left {
    position: static;
  }
}

@media (max-width: 760px) {
  /* The list becomes one block for each entry: the name and its Copy button, then the rest. */
  .cat-table thead {
    display: none;
  }

  .cat-table,
  .cat-table tbody {
    display: block;
  }

  .cat-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.15rem 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--line);
  }

  table.doc.cat-table th,
  table.doc.cat-table td {
    display: block;
    width: auto;
    border: 0;
    padding: 0;
  }

  .cat-table th.cat-name {
    grid-column: 1;
  }

  .cat-table td.cat-act {
    grid-column: 2;
    grid-row: 1;
    text-align: right;
  }

  .cat-table td:nth-child(2),
  .cat-table td:nth-child(3),
  .cat-table td:nth-child(4) {
    grid-column: 1 / -1;
    color: var(--ink-soft);
    font-size: 0.95rem;
  }

  :root,
  html:not([data-theme]),
  html[data-theme="light"],
  html[data-theme="dark"] {
    --pst-font-size-base: 1rem;
  }

  .annotated {
    grid-template-columns: minmax(0, 1fr);
  }

  .demo-frame .desk {
    display: none;
  }

  .demo-frame .phone {
    display: block;
  }

  .cat-section {
    scroll-margin-top: 20rem;
  }
}

@media print {
  .bd-header,
  .bd-sidebar-primary,
  .bd-sidebar-secondary,
  .bd-header-announcement,
  button.copy,
  .no-print {
    display: none !important;
  }
}
