/* The user guide: the studio's palette and type, laid out as a documentation site — chapters on the left, the page in
   the middle, its sections on the right. */
:root {
  color-scheme: light;
  --bg: #f8f7f4;
  --panel: #fdfcf9;
  --surface: #fff;
  --sunken: #edf0e8;
  --hover: #eef0ea;
  --ink: #343a35;
  --heading: #252a26;
  --secondary: #58674f;
  --muted: #707b69;
  --line: #e9e8e2;
  --line-strong: #d6d9cf;
  --accent: #e2603c;
  --accent-ink: #c4522f;
  --accent-soft: #faece5;
  --green: #527360;
  --green-soft: #e9f0ea;
  --blue: #3b6fd6;
  --blue-soft: #e8eefb;
  --warn: #946c26;
  --warn-soft: #f8f0dd;
  --code: #f1f0ea;
  --shadow: 0 1px 2px #2a2f2a14, 0 8px 24px #2a2f2a12;
  --topbar: 60px;
  --sidebar: 288px;
  --outline: 224px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #18191b;
  --panel: #1d1e21;
  --surface: #232427;
  --sunken: #2b2c30;
  --hover: #2c2d31;
  --ink: #dcdde1;
  --heading: #f2f2f4;
  --secondary: #c3c5cc;
  --muted: #9a9ca5;
  --line: #303136;
  --line-strong: #44464d;
  --accent: #f18a65;
  --accent-ink: #f49a78;
  --accent-soft: #3a2a23;
  --green: #9cc0a7;
  --green-soft: #213029;
  --blue: #8fb0f0;
  --blue-soft: #1f2a3f;
  --warn: #e4be78;
  --warn-soft: #3a3020;
  --code: #2a2b2f;
  --shadow: 0 1px 2px #0006, 0 8px 24px #0005;
}
* {
  box-sizing: border-box;
}
html {
  scroll-padding-top: calc(var(--topbar) + 20px);
}
body {
  margin: 0;
  background: var(--bg);
  font-size: 16px;
  line-height: 1.7;
}
body.locked {
  overflow: hidden;
}
a {
  color: var(--accent-ink);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
button {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
.icon {
  width: 20px;
  height: 20px;
  flex: none;
}
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.skip-link:focus {
  top: 10px;
}

/* ---- Top bar ---- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--topbar);
  padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--heading);
  min-width: calc(var(--sidebar) - 40px);
}
.brand:hover {
  text-decoration: none;
}
.brand-mark {
  width: 28px;
  height: 28px;
}
.brand-word {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.04em;
}
.brand-word i {
  font-style: normal;
  color: var(--accent);
}
.brand-section {
  padding-left: 10px;
  border-left: 1px solid var(--line-strong);
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}
.search-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(320px, 100%);
  height: 38px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.search-button:hover {
  border-color: var(--line-strong);
}
.search-label {
  flex: 1;
  text-align: left;
}
.search-key {
  font-family: inherit;
  font-size: 11px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--secondary);
  cursor: pointer;
}
.icon-button:hover {
  background: var(--hover);
}
.menu-button {
  display: none;
}
.language-switch {
  display: flex;
  padding: 3px;
  border-radius: 10px;
  background: var(--sunken);
}
.language-switch button {
  min-width: 40px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.language-switch button[aria-pressed='true'] {
  background: var(--surface);
  color: var(--heading);
  box-shadow: 0 1px 2px #0000001a;
}
.open-app {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
:root[data-theme='dark'] .open-app {
  color: #201b16;
}
.open-app:hover {
  text-decoration: none;
  filter: brightness(1.05);
}
.open-app .icon {
  width: 16px;
  height: 16px;
}

/* ---- Layout ---- */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr) var(--outline);
  max-width: 1480px;
  margin: 0 auto;
}
.sidebar {
  position: sticky;
  top: var(--topbar);
  height: calc(100vh - var(--topbar));
  overflow-y: auto;
  padding: 28px 20px 48px 24px;
  border-right: 1px solid var(--line);
  scrollbar-width: thin;
}
.nav-group + .nav-group {
  margin-top: 22px;
}
.nav-group h2 {
  margin: 0 0 6px 10px;
  color: var(--heading);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.nav-group ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-group a {
  display: block;
  padding: 5px 10px;
  border-radius: 8px;
  color: var(--secondary);
  font-size: 14.5px;
  line-height: 1.45;
}
.nav-group a:hover {
  background: var(--hover);
  text-decoration: none;
  color: var(--heading);
}
.nav-group a[aria-current] {
  color: var(--accent-ink);
  background: var(--accent-soft);
  font-weight: 600;
}
/* The whole guide as a PDF in the reader's language, always in the top bar. */
.pdf-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--heading);
  font-size: 14px;
  font-weight: 600;
}
.pdf-button:hover {
  background: var(--hover);
  text-decoration: none;
}
.pdf-button[hidden] {
  display: none;
}
.pdf-button .icon {
  width: 17px;
  height: 17px;
  color: var(--accent-ink);
}
/* ---- Reading progress ---- */
/* Under the top bar: the whole guide as a line of parts, each as long as its pages. The warm fill runs up to the open
   page and on through it as the page scrolls, with a glowing head at its end. */
.reading-bar {
  --head: 0px;
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
}
.reading-parts {
  position: absolute;
  left: 0;
  right: 0;
  top: -5px;
  bottom: -5px;
  display: flex;
  gap: 3px;
}
.reading-parts a {
  position: relative;
  min-width: 4px;
}
.reading-parts a::before,
.reading-parts a::after {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  height: 3px;
  border-radius: 2px;
  transform: translateY(-50%);
  transition: height 0.2s;
}
.reading-parts a::before {
  right: 0;
  background: var(--line);
}
.reading-parts a.current::before {
  background: color-mix(in srgb, var(--accent) 16%, var(--line));
}
.reading-parts a::after {
  width: calc(var(--into, 0) * 100%);
  background: linear-gradient(90deg, var(--accent) 0%, #f39a5b 55%, #ffc978 100%);
  background-size: var(--bar-w, 100vw) 100%;
  background-position: calc(var(--x, 0px) * -1) 0;
}
.reading-parts:hover a::before,
.reading-parts:hover a::after {
  height: 6px;
}
.reading-parts a:hover::before {
  background: var(--line-strong);
}
.reading-head {
  position: absolute;
  top: 50%;
  left: var(--head);
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -6px;
  border-radius: 50%;
  background: #ffd48b;
  box-shadow:
    0 0 0 3px color-mix(in srgb, #ffd48b 35%, transparent),
    0 0 14px 3px color-mix(in srgb, var(--accent) 55%, transparent);
  transition:
    left 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 0.2s;
}
/* A wider target than the dot itself. */
.reading-head::before {
  content: '';
  position: absolute;
  inset: -6px;
}
.reading-head:hover {
  transform: scale(1.3);
}
/* The label shows only under the pointer, so it never covers the page while reading. */
.reading-chip {
  position: absolute;
  top: 12px;
  left: 0;
  max-width: min(380px, calc(100vw - 16px));
  overflow: hidden;
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--heading);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  text-overflow: ellipsis;
  pointer-events: none;
  opacity: 0;
  translate: 0 -4px;
  transition:
    opacity 0.2s,
    translate 0.2s;
}
.reading-chip.active {
  opacity: 1;
  translate: 0 0;
}
.reading-bar.done .reading-parts a::after {
  animation: finish 1.2s ease;
}
@keyframes finish {
  30% {
    filter: brightness(1.25) saturate(1.2);
  }
}
/* The outline of the open page fills down its rule as the page is read. */
.outline ul {
  position: relative;
}
.outline ul::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 0;
  width: 2px;
  height: calc(var(--read, 0) * 100%);
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), #ffc978);
}
.sidebar-backdrop {
  display: none;
}
.content {
  min-width: 0;
  padding: 44px 56px 80px;
  outline: none;
}
.outline {
  position: sticky;
  top: var(--topbar);
  align-self: start;
  max-height: calc(100vh - var(--topbar));
  overflow-y: auto;
  padding: 44px 20px 40px 0;
  font-size: 13.5px;
  scrollbar-width: thin;
}
.outline h2 {
  margin: 0 0 8px;
  color: var(--heading);
  font-size: 13px;
  font-weight: 700;
}
.outline ul {
  margin: 0;
  padding: 0 0 0 12px;
  list-style: none;
  border-left: 1px solid var(--line);
}
.outline a {
  display: block;
  padding: 4px 0;
  color: var(--muted);
  line-height: 1.4;
}
.outline a:hover,
.outline a.active {
  color: var(--accent-ink);
  text-decoration: none;
}

/* ---- Article ---- */
.doc {
  max-width: 820px;
  margin: 0 auto;
}
.eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 0 0 6px;
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.eyebrow-count {
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
.eyebrow-count::before {
  content: '·';
  margin-right: 10px;
}
.doc h1 {
  margin: 0 0 18px;
  color: var(--heading);
  font-size: 40px;
  line-height: 1.15;
  letter-spacing: -0.025em;
}
/* The summary under a title reads at the size of the text; a rule in the accent and a heavier weight set it apart. */
.doc .lead {
  margin: 0 0 32px;
  padding: 2px 0 2px 18px;
  border-left: 3px solid var(--accent);
  color: var(--heading);
  font-weight: 500;
}
.doc h2 {
  position: relative;
  margin: 56px 0 14px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  color: var(--heading);
  font-size: 26px;
  line-height: 1.3;
  letter-spacing: -0.015em;
}
.doc h3 {
  position: relative;
  margin: 34px 0 8px;
  color: var(--heading);
  font-size: 19px;
  line-height: 1.4;
}
.heading-anchor {
  display: inline-grid;
  place-items: center;
  margin-left: 8px;
  vertical-align: middle;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.15s;
}
.heading-anchor .icon {
  width: 16px;
  height: 16px;
}
h2:hover .heading-anchor,
h3:hover .heading-anchor,
.heading-anchor:focus-visible {
  opacity: 1;
}
.doc p,
.doc ul,
.doc ol {
  margin: 0 0 16px;
}
.doc ul,
.doc ol {
  padding-left: 24px;
}
.doc li {
  margin: 6px 0;
}
.doc li::marker {
  color: var(--muted);
}
.doc strong {
  color: var(--heading);
  font-weight: 600;
}
.doc code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--code);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
}
kbd {
  display: inline-block;
  min-width: 24px;
  padding: 0 7px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--heading);
  font-family: inherit;
  font-size: 0.82em;
  font-weight: 600;
  line-height: 1.75;
  text-align: center;
  white-space: nowrap;
}
.plus {
  margin: 0 3px;
  color: var(--muted);
  font-size: 0.85em;
}
.ui {
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--sunken);
  color: var(--heading);
  font-weight: 600;
  font-size: 0.92em;
  white-space: nowrap;
}

/* Steps of a task */
.steps {
  counter-reset: step;
  list-style: none;
  padding-left: 0 !important;
}
.steps > li {
  position: relative;
  counter-increment: step;
  margin: 0 0 14px;
  padding-left: 44px;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 700;
}

/* Callouts */
.callout {
  margin: 22px 0;
  padding: 14px 18px 2px;
  border-left: 4px solid var(--green);
  border-radius: 4px 12px 12px 4px;
  background: var(--green-soft);
}
.callout-title {
  margin: 0 0 4px !important;
  color: var(--heading);
  font-weight: 700;
}
.callout.note {
  border-color: var(--blue);
  background: var(--blue-soft);
}
.callout.warn {
  border-color: var(--warn);
  background: var(--warn-soft);
}

/* Tables */
.table-wrap {
  margin: 18px 0 24px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.55;
}
th,
td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
th {
  background: var(--panel);
  color: var(--heading);
  font-size: 13.5px;
  font-weight: 700;
}
tr:last-child td {
  border-bottom: 0;
}
/* The first column names the thing a row is about: one weight for all of it, so no row stands out. */
td:first-child {
  white-space: nowrap;
  font-weight: 600;
  color: var(--heading);
}
.table-wrap.wrap td:first-child {
  white-space: normal;
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
  margin: 22px 0 28px;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  transition:
    transform 0.15s,
    box-shadow 0.15s,
    border-color 0.15s;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--line-strong);
  text-decoration: none;
}
.card strong {
  color: var(--heading);
  font-size: 16.5px;
}
.card span {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
}
.card .card-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 8px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.card .card-icon svg {
  width: 22px;
  height: 22px;
}
.card.tone-blue .card-icon {
  background: var(--blue-soft);
  color: var(--blue);
}
.card.tone-green .card-icon {
  background: var(--green-soft);
  color: var(--green);
}
.card.tone-purple .card-icon {
  background: color-mix(in srgb, #7a5cc7 14%, var(--surface));
  color: #7a5cc7;
}
.card.tone-grey .card-icon {
  background: var(--sunken);
  color: var(--secondary);
}
:root[data-theme='dark'] .card.tone-purple .card-icon {
  color: #b9a3f0;
}

/* ---- Pictures ---- */
/* Two narrow pictures side by side, such as the phone screens. */
.shot-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0 28px;
  align-items: start;
}
.shot-pair .shot .shot-frame {
  margin-left: auto;
}
.shot {
  margin: 26px 0 30px;
}
.shot-frame {
  position: relative;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  /* Not clipped: a callout on a part at the edge of the picture keeps its whole number. */
  background: var(--surface);
  box-shadow: var(--shadow);
  cursor: zoom-in;
}
.shot.small .shot-frame {
  margin-left: 0;
}
/* A tall panel cut into columns: each column is a frame of its own, the parts read left to right. */
.shot-frame {
  --column-gap: 22px;
}
.shot-frame.split {
  display: grid;
  grid-template-columns: repeat(var(--parts), minmax(0, var(--part)));
  gap: 18px var(--column-gap);
  align-items: start;
  border: 0;
  background: none;
  box-shadow: none;
}
.shot-frame.split .part,
.lightbox-frame.split .part {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.part-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 11px;
}
.shot-frame.split img,
.lightbox-frame.split img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
}
.shot-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 11px;
}
.shot-frame.missing {
  min-height: 160px;
  background: repeating-linear-gradient(45deg, var(--sunken) 0 10px, var(--panel) 10px 20px);
}
.shot figcaption {
  margin: 10px auto 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}
.shot.small figcaption {
  text-align: left;
}
.mark {
  position: absolute;
  border: 2px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 0 0 3px #e2603c26;
  pointer-events: none;
}
.mark.badge-only {
  border-color: transparent;
  box-shadow: none;
}
.mark b {
  position: absolute;
  left: -11px;
  top: -11px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 0 2px #fff, 0 2px 6px #0003;
}
.mark.badge-only b {
  left: calc(50% - 12px);
  top: calc(50% - 12px);
}
/* A number that would cover its neighbour's moves to another corner of its outline (corners() in guide.js). */
.mark.corner-tr b,
.mark.corner-br b {
  left: auto;
  right: -11px;
}
.mark.corner-bl b,
.mark.corner-br b {
  top: auto;
  bottom: -11px;
}
.legend {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 6px 24px;
  margin: 16px 0 0 !important;
  padding: 16px 18px 14px 18px !important;
  list-style: none;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  counter-reset: none;
  font-size: 15px;
  line-height: 1.5;
}
.legend li {
  position: relative;
  margin: 0 !important;
  padding-left: 32px;
}
.legend li::before {
  content: attr(value);
  position: absolute;
  left: 0;
  top: 1px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
:root[data-theme='dark'] .shot-frame {
  border-color: var(--line-strong);
}

/* Inline illustrations drawn for the guide follow the palette */
.illustration {
  margin: 26px 0 30px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.illustration svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 340px;
}
.illustration figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
.illustration .ink {
  fill: var(--ink);
}
.illustration .muted {
  fill: var(--muted);
}
.illustration .frame {
  fill: var(--sunken);
  stroke: var(--line-strong);
}
.illustration .item {
  fill: var(--accent-soft);
  stroke: var(--accent);
}
.illustration .item-alt {
  fill: var(--blue-soft);
  stroke: var(--blue);
}
.illustration .guide {
  fill: none;
  stroke: var(--accent);
  stroke-dasharray: 4 4;
}
.illustration .line {
  fill: none;
  stroke: var(--muted);
}
.illustration text {
  fill: var(--secondary);
  font-family: inherit;
  font-size: 13px;
}
.illustration .label {
  fill: var(--heading);
  font-weight: 600;
}
/* The diagrams of content/art.js: cards that wrap to one per row on a phone. */
.art-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.art-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.art-grid + .art-grid {
  margin-top: 14px;
}
.art-grid.rows {
  grid-template-columns: minmax(0, 1fr);
}
.art-grid.rows .art-card {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}
.art-grid.rows .art-title {
  margin-top: 0 !important;
}
.art-card {
  min-width: 0;
  padding: 14px 16px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.art-card.wide {
  grid-column: 1 / -1;
}
/* A phone has room for one card across, its picture over its words. */
@media (max-width: 560px) {
  .art-grid,
  .art-grid.cols-3,
  .art-grid.rows .art-card {
    grid-template-columns: minmax(0, 1fr);
  }
  .illustration {
    padding: 12px;
  }
}
.art-card svg {
  max-height: none;
}
.art-title {
  margin: 10px 0 2px !important;
  color: var(--heading);
  font-size: 15px;
  font-weight: 600;
}
.art-note {
  margin: 0 !important;
  color: var(--secondary);
  font-size: 14px;
  line-height: 1.5;
}
.art-card .legend {
  margin-top: 12px !important;
  background: var(--surface);
}
.swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin: 0 2px -1px 0;
  border-radius: 3px;
}
.swatch.pad,
.illustration .pad {
  background: #e2603c38;
  fill: #e2603c38;
}
.swatch.gap,
.illustration .gap {
  background: #3b6fd438;
  fill: #3b6fd438;
}
.illustration .content-box {
  fill: var(--sunken);
}
.illustration .dim {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.2;
}
.illustration .dim-text {
  fill: var(--accent);
  font-size: 11px;
  font-weight: 700;
}
.illustration .gap-text {
  fill: var(--blue);
}
.illustration .flow {
  fill: none;
  stroke: var(--heading);
  stroke-width: 1.6;
}
.illustration .ghost {
  fill: none;
  stroke: var(--muted);
  stroke-dasharray: 4 3;
}
.illustration .pin {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-dasharray: 4 3;
}
.illustration .bar {
  fill: var(--muted);
  opacity: 0.55;
}
.illustration .caret {
  stroke: var(--accent);
  stroke-width: 2;
}
.illustration .overflow {
  opacity: 0.35;
}
.illustration .text-box {
  fill: var(--surface);
  stroke: var(--blue);
  stroke-width: 1.4;
}
.illustration .text-handle {
  fill: var(--surface);
  stroke: var(--blue);
}
.illustration .port {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 1.4;
}
.illustration .port.used {
  fill: var(--accent);
}
.illustration .connector {
  fill: none;
  stroke: var(--heading);
  stroke-width: 2;
}
.illustration .crossing {
  stroke-width: 1.6;
}
.illustration .handle {
  fill: var(--surface);
  stroke: var(--blue);
  stroke-width: 2;
}
.illustration .tag {
  fill: var(--surface);
  stroke: var(--line-strong);
}
.illustration .tag-text {
  fill: var(--heading);
  font-size: 12px;
}
.illustration .badge circle {
  fill: var(--accent);
  stroke: var(--surface);
  stroke-width: 2;
}
.illustration .badge text {
  fill: #fff;
  font-size: 12px;
  font-weight: 700;
}

/* ---- Pager ---- */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 820px;
  margin: 64px auto 0;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.pager a {
  display: flex;
  flex-direction: column;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color 0.15s;
}
.pager a:hover {
  border-color: var(--accent);
  text-decoration: none;
}
.pager small {
  color: var(--muted);
  font-size: 13px;
}
.pager span {
  color: var(--accent-ink);
  font-weight: 600;
}
.pager-next {
  text-align: right;
  grid-column: 2;
}

/* ---- Search ---- */
.search-dialog {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 10vh 16px 16px;
  background: #18191b66;
  backdrop-filter: blur(3px);
}
.search-dialog[hidden],
.lightbox[hidden] {
  display: none;
}
.search-panel {
  display: flex;
  flex-direction: column;
  width: min(640px, 100%);
  max-height: 76vh;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 24px 64px #0004;
  overflow: hidden;
}
.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.search-field input {
  flex: 1;
  height: 40px;
  border: 0;
  background: none;
  color: var(--heading);
  font: inherit;
  font-size: 17px;
  outline: none;
}
.search-results {
  overflow-y: auto;
  padding: 8px;
}
.search-result {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink);
}
.search-result:hover,
.search-result[aria-selected='true'] {
  background: var(--accent-soft);
  text-decoration: none;
}
.search-result small {
  color: var(--muted);
  font-size: 12.5px;
}
.search-result strong {
  color: var(--heading);
}
.search-result span {
  color: var(--secondary);
  font-size: 14px;
  line-height: 1.45;
}
.search-result mark {
  background: none;
  color: var(--accent-ink);
  font-weight: 700;
}
.search-empty {
  margin: 0;
  padding: 26px 14px;
  color: var(--muted);
  text-align: center;
}

/* ---- Lightbox ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #101112e6;
  cursor: zoom-out;
  overflow: auto;
}
.lightbox-frame {
  position: relative;
  /* As large as the screen allows, never past the picture's own pixels; the callouts are placed in percent of it. */
  width: min(100%, calc((100vh - 48px) * var(--ratio, 1.6)), var(--full, 100%));
  aspect-ratio: var(--ratio, 1.6);
  border-radius: 8px;
  box-shadow: 0 20px 60px #0008;
}
.lightbox-frame img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 8px;
}
.lightbox-frame.split {
  display: grid;
  grid-template-columns: repeat(var(--parts), 1fr);
  gap: 16px;
  align-items: start;
  aspect-ratio: auto;
  box-shadow: none;
}
.lightbox-close {
  position: fixed;
  top: 14px;
  right: 14px;
  color: #fff;
  background: #ffffff1f;
}

/* ---- Narrower screens ---- */
@media (max-width: 1240px) {
  .layout {
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
  }
  .outline {
    display: none;
  }
  .content {
    padding: 40px 40px 72px;
  }
}
@media (max-width: 960px) {
  :root {
    --topbar: 56px;
  }
  .topbar {
    gap: 8px;
    padding: 0 12px;
  }
  .menu-button {
    display: inline-grid;
  }
  .brand {
    min-width: 0;
  }
  .brand-section {
    display: none;
  }
  .search-button {
    width: 38px;
    padding: 0;
    justify-content: center;
    border-color: transparent;
    background: none;
  }
  .search-label,
  .search-key {
    display: none;
  }
  .open-app span {
    display: none;
  }
  .open-app {
    width: 38px;
    padding: 0;
    justify-content: center;
  }
  .layout {
    display: block;
  }
  .sidebar {
    position: fixed;
    top: var(--topbar);
    left: 0;
    z-index: 40;
    width: min(320px, 86vw);
    height: calc(100dvh - var(--topbar));
    background: var(--bg);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow);
  }
  .menu-open .sidebar {
    transform: none;
  }
  .menu-open .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: var(--topbar) 0 0;
    z-index: 35;
    background: #0003;
  }
  .content {
    padding: 28px 16px 64px;
  }
  .doc h1 {
    font-size: 31px;
  }
  .doc h2 {
    font-size: 22px;
    margin-top: 44px;
  }
  .legend {
    grid-template-columns: 1fr;
  }
  .mark b {
    width: 20px;
    height: 20px;
    left: -8px;
    top: -8px;
    font-size: 11px;
  }
  .mark.corner-tr b,
  .mark.corner-br b {
    left: auto;
    right: -8px;
  }
  .mark.corner-bl b,
  .mark.corner-br b {
    top: auto;
    bottom: -8px;
  }
  .pager {
    grid-template-columns: 1fr;
  }
  .pager-next {
    grid-column: 1;
  }
}
/* On a phone the columns of a tall panel would be too narrow to read: they stand one under another instead. */
@media (max-width: 560px) {
  .shot-frame.split {
    grid-template-columns: minmax(0, var(--part));
  }
}
@media (max-width: 420px) {
  .brand-word {
    display: none;
  }
}
/* On a phone the top bar keeps every control: the buttons and the gaps between them get a little narrower. */
@media (max-width: 560px) {
  .topbar,
  .topbar-actions {
    gap: 4px;
  }
  .topbar .icon-button,
  .search-button,
  .open-app {
    width: 34px;
  }
  .pdf-button {
    gap: 4px;
    padding: 0 8px;
  }
  .language-switch button {
    min-width: 34px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
