/* Generated by design/tooling/family.py from the brands' generated web tokens. Do not edit. */
/* The bar on every page of every product: the family's ink, paper and muted text, the same in light and dark. */
:root {
  --family-bar: #1B1C1C;
  --family-bar-text: #FAF9F5;
  --family-bar-muted: #E3E0DA;
}

/* Every product's pages. Colours, type and spacing come from the product's design tokens (assets/<brand>.css),
   so each product wears its own brand; what only one product's pages look like is in that product's own CSS. */

*, *::before, *::after { box-sizing: border-box; }

/* Anchored targets and focused elements clear the sticky header (WCAG 2.4.11). */
html { scroll-behavior: smooth; scroll-padding-top: var(--scribe-space-4); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--scribe-bg);
  color: var(--scribe-text);
  font-family: var(--scribe-font-text);
  font-size: var(--scribe-type-body-size);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--scribe-accent); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--scribe-focus); outline-offset: 2px; border-radius: 4px; }
:target { outline: none; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--scribe-primary); color: var(--scribe-on-primary);
  padding: var(--scribe-space-3) var(--scribe-space-4); border-radius: var(--scribe-radius-sm); z-index: 10;
}
.skip:focus { left: var(--scribe-space-4); top: var(--scribe-space-4); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 var(--scribe-space-6); }
.reading { max-width: 720px; }

/* The family bar: the same on every page of every app. Its colours are the family's (--family-bar…, from
   design/brands/scribe, put before this file by the build), so it looks the same on Brasscribe's brass, on
   Fretscribe's ruled paper and on the family home, in light and in dark. */
.family-bar { --bar: var(--family-bar); --bar-text: var(--family-bar-text); --bar-muted: var(--family-bar-muted); background: var(--bar); color: var(--bar-text); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.family-bar .wrap { display: flex; align-items: center; gap: var(--scribe-space-3); min-height: 52px; }
.family-switch { display: flex; align-items: center; gap: 2px; flex: 1 1 auto; min-width: 0; }
.family-switch a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 8px;
  color: var(--bar-muted); text-decoration: none; font-weight: 600; font-size: 0.9375rem; white-space: nowrap;
}
.family-switch a:hover { color: var(--bar-text); background: rgb(255 255 255 / 0.08); }
.family-switch a[aria-current] { color: var(--bar-text); background: rgb(255 255 255 / 0.14); }
.family-switch a:focus-visible, .lang-switch:focus-visible { outline: 2px solid var(--bar-text); outline-offset: -2px; }
.family-mark .mark-pen { flex: none; }
.lang-switch {
  flex: none; min-height: 36px; padding: 0 14px; border-radius: var(--scribe-radius-full); cursor: pointer;
  font: inherit; font-size: 0.875rem; color: var(--bar-text); background: none; border: 1px solid var(--bar-muted);
}
.lang-switch:hover { background: rgb(255 255 255 / 0.08); }
.lang-switch[hidden] { display: none; }
.lang-short { display: none; }
.lang-note { flex: 0 1 auto; font-size: 0.8125rem; line-height: 1.3; color: var(--bar-muted); text-align: right; }
@media (max-width: 700px) { .family-bar .wrap:has(.lang-note) { flex-wrap: wrap; } .lang-note { flex-basis: 100%; text-align: left; padding: 0 7px var(--scribe-space-2); } }
@media (max-width: 350px) {
  /* The bar stays one line on the narrowest phones. */
  .family-bar .wrap { padding: 0 var(--scribe-space-2); gap: 0; }
  .family-switch { gap: 0; }
  .family-switch a { padding: 0 4px; font-size: 0.75rem; gap: 3px; }
  .family-mark .mark-pen { width: 14px; }
  .lang-switch { padding: 0 8px; font-size: 0.75rem; }
  .lang-short { display: inline; }
  .lang-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 420px) {
  .family-bar .wrap { gap: var(--scribe-space-1); padding: 0 var(--scribe-space-3); }
  .family-switch a { padding: 0 7px; font-size: 0.8125rem; gap: 5px; }
  .family-mark .mark-pen { width: 20px; }
  .lang-switch { padding: 0 9px; font-size: 0.8125rem; }
}

/* Under it, the app's own row: its name and its pages, the same pages in the same order for every app. */
.product-nav { border-bottom: 1px solid var(--scribe-border); background: var(--scribe-bg); }
.product-nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 0 var(--scribe-space-6); min-height: 56px; }
.brand { display: inline-flex; align-items: center; flex: none; }
.brand img { height: 30px; width: auto; }
.logo-dark { display: none !important; }
@media (prefers-color-scheme: dark) {
  .logo-light { display: none !important; }
  .logo-dark { display: block !important; }
}
/* The pages stay on one line; on a narrow screen the line scrolls sideways and the logo steps aside. */
.product-nav nav { display: flex; align-items: center; gap: 0 var(--scribe-space-5); min-width: 0; overflow-x: auto; scrollbar-width: none; }
.product-nav nav::-webkit-scrollbar { display: none; }
@media (max-width: 700px) {
  .brand { display: none; }
  .product-nav .wrap { min-height: 48px; }
  .product-nav nav { gap: 0 var(--scribe-space-4); }
}
/* What a script must make work keeps its room, unseen, until the script has. */
.await-js { visibility: hidden; }
.product-nav nav a { white-space: nowrap; flex: none; display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; font-weight: 600; font-size: var(--scribe-type-callout-size); color: var(--scribe-text-muted); }
.product-nav nav a[aria-current="page"], .product-nav nav a:hover { color: var(--scribe-text); box-shadow: inset 0 -2px 0 var(--scribe-brand); }

/* What the language script swaps as a whole takes no box of its own. */
.slot { display: contents; }
/* A Norwegian reader does not see the English words flash by: they stay hidden until the Norwegian ones are in. */
html[data-lang-wanted="nb"] main, html[data-lang-wanted="nb"] .product-nav, html[data-lang-wanted="nb"] .site-footer { visibility: hidden; }

/* Type */
h1, h2, .display {
  font-family: var(--scribe-font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 0 0 var(--scribe-space-4);
}
h1 { font-size: clamp(2.5rem, 6vw, 4.25rem); }
h2 { font-size: clamp(2rem, 4vw, 2.75rem); }
h3 { font-size: var(--scribe-type-title-2-size); line-height: 1.3; margin: var(--scribe-space-8) 0 var(--scribe-space-2); }
em.brass, h1 em, h2 em { font-style: italic; color: var(--scribe-brand-text); }
p { margin: 0 0 var(--scribe-space-4); }
.lead { font-size: 1.25rem; color: var(--scribe-text-muted); max-width: 36em; }
.muted { color: var(--scribe-text-muted); }
.overline { font-size: var(--scribe-type-caption-size); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--scribe-brand-text); margin-bottom: var(--scribe-space-3); }
code, kbd {
  font-family: var(--scribe-font-mono); font-size: 0.9em;
  background: var(--scribe-surface); border: 1px solid var(--scribe-border); border-radius: var(--scribe-radius-xs);
  padding: 0.1em 0.35em;
}
kbd { border-bottom-width: 2px; }
pre { background: var(--scribe-surface); border: 1px solid var(--scribe-border); border-radius: var(--scribe-radius-md); padding: var(--scribe-space-4); overflow-x: auto; }
pre code { background: none; border: 0; padding: 0; }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: var(--scribe-space-3); margin-top: var(--scribe-space-6); }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--scribe-space-2);
  min-height: 52px; padding: 0 var(--scribe-space-6);
  border-radius: var(--scribe-radius-md); font-weight: 600; text-decoration: none;
  border: 1.5px solid transparent;
}
.button.primary { background: var(--scribe-primary); color: var(--scribe-on-primary); }
.button.secondary { background: var(--scribe-secondary); color: var(--scribe-on-secondary); }
.button.outline { border-color: var(--scribe-border-strong); color: var(--scribe-text); }
.button:hover { color: inherit; }
.button.primary:hover { color: var(--scribe-on-primary); opacity: 0.88; }
.button.secondary:hover, .button.outline:hover { color: var(--scribe-text); border-color: var(--scribe-text); }

/* Sections */
section { padding: var(--scribe-space-16) 0; }
section + section { border-top: 1px solid var(--scribe-border); }
.hero { padding-top: var(--scribe-space-12); background: linear-gradient(180deg, var(--scribe-brand-tint), var(--scribe-bg) 70%); }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--scribe-space-12); align-items: center; }
.hero .mark { width: 56px; margin-bottom: var(--scribe-space-6); }
.hero-grid.reverse > :first-child { order: 2; }

/* Screenshots. Phones sit in a device frame drawn here, desktops in a window frame.
   The frame fixes the ratio, so shots from any phone or desktop crop to fit. */
.device {
  --bezel: #1b1a18;
  position: relative; width: 100%;
  padding: 3.2%; border-radius: 13% / 6%;
  background: var(--bezel);
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.06), inset 0 0 0 1.5px rgb(255 255 255 / 0.07), var(--scribe-elevation-3);
}
.device picture, .window picture { display: block; }
.device img {
  width: 100%; height: auto; aspect-ratio: 600 / 1334; object-fit: cover; object-position: top;
  border-radius: 10.5% / 4.8%; background: var(--scribe-bg);
}
@media (prefers-color-scheme: dark) {
  .device { --bezel: #2c2a27; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.1), var(--scribe-elevation-3); }
}
.phones { display: flex; gap: var(--scribe-space-6); justify-content: center; align-items: flex-start; }
.phones .device { width: 46%; max-width: 280px; }
.phones .device:nth-child(2) { margin-top: var(--scribe-space-12); }

.window {
  border-radius: var(--scribe-radius-lg); overflow: hidden;
  border: 1px solid var(--scribe-border-strong); background: var(--scribe-surface-raised);
  box-shadow: var(--scribe-elevation-3);
}
.window-bar {
  display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px;
  background: var(--scribe-surface); border-bottom: 1px solid var(--scribe-border);
  font-size: 12px; color: var(--scribe-text-muted); white-space: nowrap; overflow: hidden;
}
.window-bar i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--scribe-border-strong); }
.window-bar span { flex: 1; text-align: center; margin-right: 44px; overflow: hidden; text-overflow: ellipsis; }
.window img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; }

/* Home page: iPhone screens in one slim frame, a thin rounded edge and a soft shadow. The
   hero groups a Mac window, an iPad and an iPhone. The guide keeps .device above. */
.phone-frame, .tablet-frame {
  position: relative; width: 100%;
  padding: 5px; border-radius: 18px;
  background: var(--scribe-surface-raised);
  border: 1px solid var(--scribe-border-strong);
  box-shadow: var(--scribe-elevation-2);
}
.phone-frame picture, .tablet-frame picture, .mac-frame picture { display: block; }
.phone-frame img, .tablet-frame img {
  width: 100%; height: auto; aspect-ratio: 600 / 1304; object-fit: cover; object-position: top;
  border-radius: 13px; background: var(--scribe-bg);
}
.tablet-frame { padding: 6px; border-radius: 16px; }
.tablet-frame img { aspect-ratio: 720 / 1036; border-radius: 10px; }
/* The macOS capture brings its own title bar and rounded corners; a shadow that follows them is enough. */
.mac-frame img {
  width: 100%; height: auto; aspect-ratio: 1440 / 929;
  filter: drop-shadow(0 0 0.5px rgb(0 0 0 / 0.35)) drop-shadow(0 12px 28px rgb(0 0 0 / 0.14));
}
@media (prefers-color-scheme: dark) {
  .mac-frame img { filter: drop-shadow(0 0 0.5px rgb(255 255 255 / 0.4)) drop-shadow(0 12px 28px rgb(0 0 0 / 0.5)); }
}

.hero .wrap.hero-grid { grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr); gap: var(--scribe-space-10); }
/* Positions are percentages of the group, so the arrangement scales without shifting. */
.device-group { position: relative; width: 100%; aspect-ratio: 100 / 80; }
.device-group > * { position: absolute; }
.device-group .mac-frame { left: 0; top: 0; width: 84%; }
.device-group .tablet-frame { right: 0; bottom: 0; width: 33%; }
.device-group .phone-frame { left: 5%; bottom: 0; width: 19%; padding: 4px; border-radius: 14px; }
.device-group .phone-frame img { border-radius: 10px; }

.phones .phone-frame { width: 46%; max-width: 260px; }
.phones .phone-frame:nth-child(2) { margin-top: var(--scribe-space-12); }
.phones.single .phone-frame { width: 60%; max-width: 280px; }

/* How it works: one phone per step */
.flow {
  list-style: none; padding: 0; margin: var(--scribe-space-12) 0 0; counter-reset: step;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--scribe-space-12) var(--scribe-space-8);
}
.flow li { counter-increment: step; }
.flow .phone-frame { max-width: 232px; margin: 0 auto var(--scribe-space-6); }
.flow h3 { display: flex; align-items: baseline; gap: var(--scribe-space-2); margin: 0 0 var(--scribe-space-2); font-size: var(--scribe-type-headline-size); }
.flow h3::before {
  content: counter(step) / "";
  flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: var(--scribe-radius-full);
  background: var(--scribe-brand-tint); color: var(--scribe-brand-text); font-size: var(--scribe-type-caption-size); font-weight: 700;
  transform: translateY(-2px);
}
.flow p { color: var(--scribe-text-muted); font-size: var(--scribe-type-callout-size); margin: 0; }

ul.ticks { list-style: none; padding: 0; margin: 0 0 var(--scribe-space-4); display: grid; gap: var(--scribe-space-3); }
ul.ticks li { position: relative; padding-left: 1.6em; }
ul.ticks li::before {
  content: ""; position: absolute; left: 0.2em; top: 0.62em; width: 0.5em; height: 0.5em;
  border-radius: 50%; background: var(--scribe-brand);
}

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--scribe-space-6); }
.cards { list-style: none; padding: 0; margin: var(--scribe-space-8) 0 0; counter-reset: step; }
.card {
  background: var(--scribe-surface-raised); border: 1px solid var(--scribe-border);
  border-radius: var(--scribe-radius-lg); padding: var(--scribe-space-6); box-shadow: var(--scribe-elevation-1);
}
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.card .tech { font-size: var(--scribe-type-callout-size); color: var(--scribe-text-muted); border-top: 1px solid var(--scribe-border); padding-top: var(--scribe-space-3); }
ol.cards > .card { counter-increment: step; }
ol.cards > .card::before {
  content: counter(step);
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--scribe-radius-full);
  background: var(--scribe-brand-tint); color: var(--scribe-brand-text); font-weight: 700; margin-bottom: var(--scribe-space-3);
}

.q { font-family: var(--scribe-font-display); font-size: 1.4em; line-height: 1; }
.qbox { display: inline-block; border: 1.5px solid currentColor; padding: 0 0.2em; line-height: 1.1; }
.uncertain { color: var(--scribe-uncertain); }
.very-uncertain { color: var(--bc-very-uncertain); }

.platforms-label { margin: var(--scribe-space-8) 0 var(--scribe-space-2); font-size: var(--scribe-type-callout-size); color: var(--scribe-text-muted); }
.platforms { display: flex; flex-wrap: wrap; gap: var(--scribe-space-3); margin: 0; padding: 0; list-style: none; }
.platforms li { background: var(--scribe-surface); border: 1px solid var(--scribe-border); border-radius: var(--scribe-radius-full); padding: var(--scribe-space-2) var(--scribe-space-4); font-weight: 600; font-size: var(--scribe-type-callout-size); }

.note {
  background: var(--scribe-surface); border-left: 3px solid var(--scribe-brand);
  border-radius: 0 var(--scribe-radius-md) var(--scribe-radius-md) 0; padding: var(--scribe-space-4) var(--scribe-space-5); margin: var(--scribe-space-6) 0;
}
.note p:last-child { margin: 0; }

details {
  border: 1px solid var(--scribe-border-strong); border-radius: var(--scribe-radius-md);
  background: var(--scribe-surface-raised); margin: var(--scribe-space-4) 0;
}
details > summary { cursor: pointer; padding: var(--scribe-space-3) var(--scribe-space-5); font-weight: 600; min-height: 48px; display: flex; align-items: center; gap: var(--scribe-space-3); list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "›" / ""; font-size: 1.4em; line-height: 1; transition: transform var(--scribe-duration-fast, 120ms) ease; }
details[open] > summary::before { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { details > summary::before { transition: none; } }
details[open] > summary { border-bottom: 1px solid var(--scribe-border); }
details > :not(summary) { margin-left: var(--scribe-space-5); margin-right: var(--scribe-space-5); }
details > :last-child { margin-bottom: var(--scribe-space-5); }
details > summary + * { margin-top: var(--scribe-space-4); }

.table-scroll { overflow-x: auto; margin: var(--scribe-space-4) 0 var(--scribe-space-6); border-radius: var(--scribe-radius-sm); }
table { border-collapse: collapse; width: 100%; font-size: var(--scribe-type-callout-size); }
caption { text-align: left; font-weight: 600; padding-bottom: var(--scribe-space-2); }
th, td { text-align: left; padding: var(--scribe-space-3); border-bottom: 1px solid var(--scribe-border); vertical-align: top; }
thead th { font-weight: 600; color: var(--scribe-text-muted); border-bottom-color: var(--scribe-border-strong); }
tbody th { font-weight: 600; }

/* Guide layout */
.guide { display: grid; grid-template-columns: 240px minmax(0, 720px); gap: var(--scribe-space-12); padding: var(--scribe-space-12) 0 var(--scribe-space-16); }
.toc { position: sticky; top: var(--scribe-space-4); align-self: start; max-height: calc(100vh - 32px); overflow-y: auto; font-size: var(--scribe-type-callout-size); }
.toc-title { font-family: var(--scribe-font-text); font-size: var(--scribe-type-caption-size); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--scribe-text-muted); margin: 0 0 var(--scribe-space-2) var(--scribe-space-3); }
.toc ol { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--scribe-space-1); }
.toc a { display: flex; align-items: center; min-height: 40px; padding: 0 var(--scribe-space-3); border-radius: var(--scribe-radius-sm); text-decoration: none; color: var(--scribe-text-muted); }
.toc a:hover { background: var(--scribe-surface); color: var(--scribe-text); }
.guide article section { padding: var(--scribe-space-10) 0; }
.guide article section:first-child { padding-top: 0; }
.guide figure { margin: var(--scribe-space-6) 0; }
.guide figure.phone { display: flex; gap: var(--scribe-space-6); }
.guide figure.phone .device { max-width: 260px; }
.guide figure.pair .device { width: 50%; max-width: 220px; }
.guide article section::after { content: ""; display: block; clear: both; }
@media (min-width: 901px) {
  .guide figure.phone:not(.pair) { float: right; width: 220px; margin: var(--scribe-space-2) 0 var(--scribe-space-6) var(--scribe-space-8); }
}
.guide figure.phone .phone-frame { max-width: 240px; }
.guide figure.pair .phone-frame { width: 50%; max-width: 220px; }
.to-top { font-size: var(--scribe-type-callout-size); }

/* Download page: a group per device, made from the product's list of release files. */
main.downloads { max-width: 820px; padding-top: var(--scribe-space-12); padding-bottom: var(--scribe-space-16); }
.download-groups { margin-top: var(--scribe-space-10); }
.download-groups section { padding: var(--scribe-space-8) 0; border-top: 1px solid var(--scribe-border); }
.download-groups h2 { font-size: var(--scribe-type-title-1-size); margin-bottom: var(--scribe-space-4); }
.download-files { list-style: none; padding: 0; margin: 0 0 var(--scribe-space-4); display: grid; gap: var(--scribe-space-3); }
.download-files li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--scribe-space-2) var(--scribe-space-4); }
.download-files .button { min-width: min(100%, 300px); overflow-wrap: anywhere; text-align: center; padding-top: var(--scribe-space-2); padding-bottom: var(--scribe-space-2); }
.download-files .muted { flex: 1 1 240px; font-size: var(--scribe-type-callout-size); }
.download-groups p { font-size: var(--scribe-type-callout-size); margin: 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--scribe-border); padding: var(--scribe-space-10) 0; color: var(--scribe-text-muted); font-size: var(--scribe-type-callout-size); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--scribe-space-4); }

@media (max-width: 900px) {
  /* A sticky header would cover too much of a small or zoomed screen (WCAG 1.4.10). */
  html { scroll-padding-top: var(--scribe-space-4); }
  .hero-grid, .hero .wrap.hero-grid, .grid-3, .guide { grid-template-columns: minmax(0, 1fr); }
  .device-group { max-width: 640px; margin: 0 auto; }
  .hero-grid.reverse > :first-child { order: 0; }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--scribe-space-10) var(--scribe-space-6); }
  .guide { gap: var(--scribe-space-8); padding-top: var(--scribe-space-8); }
  .toc { position: static; max-height: none; border: 1px solid var(--scribe-border); border-radius: var(--scribe-radius-md); padding: var(--scribe-space-3); }
  section { padding: var(--scribe-space-12) 0; }
}

@media (max-width: 520px) {
  .flow { gap: var(--scribe-space-8) var(--scribe-space-4); }
  .flow h3 { font-size: var(--scribe-type-callout-size); }
  .flow h3::before { width: 22px; height: 22px; }
  .flow .phone-frame { margin-bottom: var(--scribe-space-4); padding: 4px; border-radius: 14px; }
  .flow .phone-frame img { border-radius: 10px; }
  .phones { gap: var(--scribe-space-4); }
}

/* Narrow: no Mac. The iPhone in front, the iPad partly behind it. */
@media (max-width: 560px) {
  .device-group { aspect-ratio: 100 / 96; }
  .device-group .mac-frame { display: none; }
  .device-group .tablet-frame { right: 0; top: 0; bottom: auto; width: 62%; }
  .device-group .phone-frame { left: 2%; bottom: 0; width: 40%; }
}

@media (forced-colors: active) {
  .card, details, .platforms li, .note, .device, .window, .phone-frame, .tablet-frame { border: 1px solid CanvasText; }
  .mac-frame img { filter: none; outline: 1px solid CanvasText; }
  .product-nav nav a[aria-current="page"], .family-switch a[aria-current] { text-decoration: underline; }
}

@media print {
  .family-bar, .product-nav, .toc, .skip, .actions, .site-footer { display: none; }
  .guide { display: block; }
}

/* Research article (a product's research page) */
.paper { max-width: 70ch; }
.paper h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); }
.paper h2 { font-size: clamp(1.75rem, 3.4vw, 2.25rem); }
.paper h3 { font-family: var(--scribe-font-display); font-weight: 400; font-size: 1.5rem; line-height: 1.2; }
.paper h4 { font-size: var(--scribe-type-headline-size); margin: var(--scribe-space-6) 0 var(--scribe-space-2); }
.paper .secno { color: var(--scribe-brand-text); font-style: normal; }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.paper .takeaway { font-size: var(--scribe-type-callout-size); border-left: 3px solid var(--scribe-brand); padding-left: var(--scribe-space-3); margin-top: calc(-1 * var(--scribe-space-2)); }
.paper .byline { color: var(--scribe-text-muted); font-size: var(--scribe-type-callout-size); }
.paper .plain {
  font-size: 1.0625rem; background: var(--scribe-brand-tint);
  border-radius: var(--scribe-radius-md); padding: var(--scribe-space-4) var(--scribe-space-5); margin: 0 0 var(--scribe-space-6);
}
.paper .plain-label {
  display: block; font-size: var(--scribe-type-caption-size); font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--scribe-brand-text); margin-bottom: var(--scribe-space-1);
}
.paper .abstract { border: 1px solid var(--scribe-border-strong); border-radius: var(--scribe-radius-md); padding: var(--scribe-space-5); margin: var(--scribe-space-6) 0; background: var(--scribe-surface-raised); }
.paper .abstract h2 { font-size: var(--scribe-type-caption-size); font-family: var(--scribe-font-text); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--scribe-text-muted); margin-bottom: var(--scribe-space-2); }
.paper .abstract p:last-child { margin: 0; }
.paper figure { margin: var(--scribe-space-8) 0; }
.paper figcaption, .research-teaser figcaption { font-size: var(--scribe-type-callout-size); color: var(--scribe-text-muted); margin-top: var(--scribe-space-3); }
.paper figcaption b { color: var(--scribe-text); }
.paper sup { line-height: 0; }
.paper sup a { text-decoration: none; color: var(--scribe-accent); font-weight: 600; padding: 0 0.1em; }
.paper .src { display: block; font-size: var(--scribe-type-caption-size); color: var(--scribe-text-muted); font-weight: 400; }
.paper td.num, .paper th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.paper thead th.num { white-space: normal; }
.paper ol.refs { padding-left: 2.2em; font-size: var(--scribe-type-callout-size); }
.paper ol.refs li { margin-bottom: var(--scribe-space-3); overflow-wrap: anywhere; }
.paper ol.refs li:target { background: var(--scribe-brand-tint); border-radius: var(--scribe-radius-sm); }
.paper .eq { font-family: var(--scribe-font-mono); font-size: 0.95em; background: var(--scribe-surface); border-radius: var(--scribe-radius-sm); padding: var(--scribe-space-3) var(--scribe-space-4); overflow-x: auto; }
.toc-article a { min-height: 36px; }
/* .guide sets padding: … 0 …, which drops the .wrap gutter on narrow screens. */
main.guide { padding-left: var(--scribe-space-6); padding-right: var(--scribe-space-6); }
@media (max-width: 520px) { main.guide { padding-left: var(--scribe-space-4); padding-right: var(--scribe-space-4); } }

/* Inline diagrams: every colour is a design token, so light, dark and high contrast follow the page. */
.diagram { display: block; width: 100%; height: auto; margin: 0 auto; }
.diagram-pipeline { max-width: 560px; }
.diagram .box { fill: var(--scribe-surface-raised); stroke: var(--scribe-border-strong); stroke-width: 1.25; }
.diagram .box.model { fill: var(--scribe-brand-tint); stroke: var(--scribe-brand); stroke-width: 2; }
.diagram .box.human { fill: var(--scribe-surface); stroke: var(--scribe-text); stroke-width: 1.75; stroke-dasharray: 6 4; }
.diagram .t { fill: var(--scribe-text); font-family: var(--scribe-font-text); font-size: 15px; font-weight: 600; }
.diagram .s { fill: var(--scribe-text-muted); font-family: var(--scribe-font-text); font-size: 12.5px; }
.diagram .lbl { fill: var(--scribe-brand-text); font-family: var(--scribe-font-text); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; }
.diagram .arrow { stroke: var(--scribe-text-muted); stroke-width: 1.5; fill: none; }
.diagram .head { fill: var(--scribe-text-muted); }
.diagram .bar { fill: var(--scribe-brand); }
.diagram .bar.alt { fill: var(--scribe-border-strong); }
.diagram .grid { stroke: var(--scribe-border); stroke-width: 1; }
.legend { display: flex; flex-wrap: wrap; gap: var(--scribe-space-2) var(--scribe-space-5); list-style: none; padding: 0; margin: var(--scribe-space-3) 0 0; font-size: var(--scribe-type-callout-size); color: var(--scribe-text-muted); }
.legend li { display: inline-flex; align-items: center; gap: var(--scribe-space-2); }
.legend i { display: inline-block; width: 1.4em; height: 0.9em; border-radius: 3px; background: var(--scribe-surface-raised); border: 1.25px solid var(--scribe-border-strong); }
.legend i.model { background: var(--scribe-brand-tint); border: 2px solid var(--scribe-brand); }
.legend i.human { background: var(--scribe-surface); border: 2px dashed var(--scribe-text); }

/* Home page teaser for the research article */
.research-teaser .teaser-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--scribe-space-10); align-items: center; }
.research-teaser figure { margin: 0; }
.research-teaser .diagram { max-width: 520px; }
.research-teaser .teaser-narrow { display: none; max-width: 400px; margin: 0; }
@media (max-width: 900px) { .research-teaser .teaser-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .research-teaser .teaser-wide { display: none; }
  .research-teaser .teaser-narrow { display: block; }
}

@media (forced-colors: active) {
  .diagram .box, .diagram .box.model, .diagram .box.human { fill: Canvas; stroke: CanvasText; }
  .diagram .box.model { stroke-width: 4; }
  .legend i.model { border-width: 4px; }
  .diagram .t, .diagram .s, .diagram .lbl, .diagram .head, .diagram .bar { fill: CanvasText; }
  .diagram .arrow { stroke: CanvasText; }
}

@media print {
  body { background: #fff; color: #000; }
  .paper { max-width: none; }
  .paper .plain, .paper .abstract { background: none; border: 1px solid #999; }
  .paper h2, .paper h3 { break-after: avoid; }
  .paper figure, .paper .table-scroll { break-inside: avoid; }
  .paper .table-scroll { overflow: visible; }
  .paper a { text-decoration: none; }
}
