/* Harness Relay landing page. Tokens follow the app (src/web/styles.css): neutrals, the three
   agent colours (the other eight CLIs' only on their dots in the CLI lists), 14px radius, system UI text. Bricolage Grotesque is the display face. */

@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
  src: url('fonts/bricolage-grotesque-latin.woff2') format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #ffffff;
  --surface: #f4f4f5;
  --surface-2: #ececee;
  --border: #e4e4e7;
  --text: #18181b;
  --muted: #5f5f68;
  --primary: #18181b;
  --primary-contrast: #ffffff;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 4px 12px -4px rgb(0 0 0 / 0.1);

  --claude: #d97757;
  --codex: #10a37f;
  --grok: #7c5cff;
  /* Text-safe versions of the agent colours on --bg (4.5:1 or better). */
  --claude-ink: #b2502c;
  --codex-ink: #0b7a5f;
  --grok-ink: #6440f0;
  --cursor-ink: #9d246f;
  --antigravity-ink: #3f6212;
  --copilot-ink: #0f766e;
  /* Fills that keep white initials legible (5:1 or better) in both colour schemes. */
  --claude-deep: #b2502c;
  --codex-deep: #0b7a5f;
  --grok-deep: #6440f0;
  --cursor-deep: #9d246f;
  --antigravity-deep: #3f6212;
  --copilot-deep: #0f766e;
  /* The other nine CLIs' brand colours, as in the app (the same in both themes): the dots in their lists, and the
     tint of the pills for CLIs in the recordings. */
  --cursor: #d6409f;
  --antigravity: #65a30d;
  --copilot: #0f766e;
  --muse: #e11d48;
  --opencode: #2563eb;
  --goose: #b45309;
  --cline: #2e7d32;
  --openhands: #0891b2;
  --pi: #64748b;

  /* The dark panels around the use-case recordings. */
  --band: #111113;
  --band-2: #1c1c1f;
  --band-text: #f4f4f5;
  --band-muted: #a1a1aa;
  --band-line: rgb(255 255 255 / 0.09);
  --claude-lit: #e8906f;
  --codex-lit: #34c79d;
  --grok-lit: #a593ff;
  --cursor-lit: #f5a4d7;
  --antigravity-lit: #84cc16;
  --copilot-lit: #2dd4bf;

  /* The GitHub star on the GitHub buttons, the page's only yellow. On a light button it gets a
     darker edge to stand out; --star-inverse is for the primary button, which is the other way round. */
  --star: #eac54f;
  --star-edge: #bf8700;
  --star-inverse: #e3b341;
  --star-inverse-edge: #e3b341;

  /* A file changed or removed, and the amber of a waiting approval, in the UI excerpts (as in the app). */
  --warn: #b45309;
  --danger: #dc2626;
  /* What is happening, never who (design/design-language.md, 2): working (also the focus ring), done, and the
     edge of a card that needs your decision, the one strong accent a screen shows at a time. */
  --info: #2563eb;
  --ok: #16a34a;
  --decide: #d97706;
  /* What shows in one theme only (the theme button's icon): its display there, none in the other. */
  --when-light: block;
  --when-dark: none;

  --radius: 14px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang TC', 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
  --display: 'Bricolage Grotesque', var(--font);
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(16px, 4vw, 32px);
  color-scheme: light;
}

/* The dark colours: the visitor's system in dark mode, unless they chose light with the theme button
   (assets/theme.js: <html data-theme="light">), and dark chosen there. Keep the two lists the same
   (test/site-theme.test.ts checks), and keep everything else that differs in dark mode a token here. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #141415;
    --surface: #1e1e20;
    --surface-2: #2a2a2d;
    --border: #333336;
    --text: #ececec;
    --muted: #a1a1aa;
    --primary: #ececec;
    --primary-contrast: #18181b;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 4px 12px -4px rgb(0 0 0 / 0.45);
    --claude-ink: #e8906f;
    --codex-ink: #34c79d;
    --grok-ink: #a593ff;
    --cursor-ink: #f5a4d7;
    --antigravity-ink: #84cc16;
    --copilot-ink: #2dd4bf;
    --band: #0a0a0b;
    --band-2: #18181a;
    --star: #e3b341;
    --star-edge: #e3b341;
    --star-inverse: #eac54f;
    --star-inverse-edge: #bf8700;
    --warn: #fbbf24;
    --danger: #f87171;
    --info: #60a5fa;
    --ok: #4ade80;
    --decide: #f59e0b;
    --when-light: none;
    --when-dark: block;
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --bg: #141415;
  --surface: #1e1e20;
  --surface-2: #2a2a2d;
  --border: #333336;
  --text: #ececec;
  --muted: #a1a1aa;
  --primary: #ececec;
  --primary-contrast: #18181b;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 4px 12px -4px rgb(0 0 0 / 0.45);
  --claude-ink: #e8906f;
  --codex-ink: #34c79d;
  --grok-ink: #a593ff;
  --cursor-ink: #f5a4d7;
  --antigravity-ink: #84cc16;
  --copilot-ink: #2dd4bf;
  --band: #0a0a0b;
  --band-2: #18181a;
  --star: #e3b341;
  --star-edge: #e3b341;
  --star-inverse: #eac54f;
  --star-inverse-edge: #bf8700;
  --warn: #fbbf24;
  --danger: #f87171;
  --info: #60a5fa;
  --ok: #4ade80;
  --decide: #f59e0b;
  --when-light: none;
  --when-dark: block;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 80px;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  caret-color: var(--grok-ink);
}

::selection {
  background: color-mix(in srgb, var(--grok) 26%, transparent);
}

img,
video,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  transition: text-decoration-color 0.2s;
}

a:hover {
  text-decoration-color: currentColor;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

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

code,
kbd,
pre {
  font-family: var(--mono);
  font-size: 0.92em;
}

:not(pre) > code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.05em 0.35em;
  white-space: nowrap;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 700;
  text-wrap: balance;
  margin: 0;
}

/* The design language's type scale (design/design-language.md, 1): a page's headline is the display token,
   48/60 (32/42 on a phone), the largest on the site; a section's heading the h1 token, 32/44. */
h1 {
  font-size: 48px;
  line-height: 60px;
  letter-spacing: -0.03em;
  font-stretch: 94%;
}

h2 {
  font-size: 32px;
  line-height: 44px;
  letter-spacing: -0.02em;
  font-stretch: 94%;
}

h3 {
  font-size: 1.3rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

:lang(zh) h1,
:lang(zh) h2 {
  letter-spacing: -0.01em;
}

p {
  margin: 0;
  text-wrap: pretty;
}

.wrap {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.lead {
  font-size: clamp(1.06rem, 1rem + 0.3vw, 1.22rem);
  line-height: 1.55;
  color: var(--muted);
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--primary);
  color: var(--primary-contrast);
  padding: 8px 14px;
  border-radius: 10px;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Agent colour helpers ---------- */

.t-claude {
  --agent: var(--claude);
  --agent-ink: var(--claude-ink);
  --agent-lit: var(--claude-lit);
  --agent-deep: var(--claude-deep);
}

.t-codex {
  --agent: var(--codex);
  --agent-ink: var(--codex-ink);
  --agent-lit: var(--codex-lit);
  --agent-deep: var(--codex-deep);
}

.t-grok {
  --agent: var(--grok);
  --agent-ink: var(--grok-ink);
  --agent-lit: var(--grok-lit);
  --agent-deep: var(--grok-deep);
}

/* The recordings also use these CLIs in pills, avatars and chapter rails. */
.t-antigravity {
  --agent: var(--antigravity);
  --agent-ink: var(--antigravity-ink);
  --agent-lit: var(--antigravity-lit);
  --agent-deep: var(--antigravity-deep);
}

.t-copilot {
  --agent: var(--copilot);
  --agent-ink: var(--copilot-ink);
  --agent-lit: var(--copilot-lit);
  --agent-deep: var(--copilot-deep);
}

.t-cursor {
  --agent: var(--cursor);
  --agent-ink: var(--cursor-ink);
  --agent-lit: var(--cursor-lit);
  --agent-deep: var(--cursor-deep);
}

/* The remaining CLIs use their brand colour for the dot in their list. */

.t-muse {
  --agent: var(--muse);
}

.t-opencode {
  --agent: var(--opencode);
}

.t-goose {
  --agent: var(--goose);
}

.t-cline {
  --agent: var(--cline);
}

.t-openhands {
  --agent: var(--openhands);
}

.t-pi {
  --agent: var(--pi);
}

/* The app's avatar: a coloured disc with the member's initial. */
.av {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--agent-deep, var(--text));
  color: #fff;
  font: 700 11px/22px var(--font);
  text-align: center;
}

.av-you {
  background: var(--band-text);
  color: var(--band);
}

/* The app's CLI pill: tinted background, coloured text. The tint is faint enough that each agent's
   -ink keeps 4.5:1 on it in both themes (test/site-theme.test.ts checks): at 14% Claude Code's was 4.46:1. */
.pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
  color: var(--agent-ink, var(--muted));
  background: color-mix(in srgb, var(--agent, var(--muted)) 12%, transparent);
}

.chip {
  display: inline-block;
  padding: 1px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color 0.2s,
    border-color 0.2s,
    transform 0.2s var(--ease);
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-contrast);
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--primary) 86%, var(--bg));
}

.btn-ghost {
  border-color: var(--border);
  background: var(--bg);
}

.btn-ghost:hover {
  border-color: color-mix(in srgb, var(--text) 35%, var(--border));
}

.btn:active {
  transform: translateY(1px);
}

/* The repository's star count on the GitHub buttons, read from GitHub's API when the page loads
   (site.js). Until then, and without JavaScript, the buttons show no count. */
.stars {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 2px;
  padding-left: 10px;
  border-left: 1px solid color-mix(in srgb, currentColor 28%, transparent);
  line-height: 18px;
  font-variant-numeric: tabular-nums;
}

.stars[hidden] {
  display: none;
}

.btn .stars svg {
  width: 15px;
  height: 15px;
  fill: var(--star);
  color: var(--star-edge);
}

.btn-primary .stars svg {
  fill: var(--star-inverse);
  color: var(--star-inverse-edge);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s;
}

.site-header.is-scrolled {
  border-bottom-color: var(--border);
}

.header-row {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.015em;
  margin-right: auto;
  /* One line: the name is hidden where it does not fit (the narrow screens' rules below). */
  white-space: nowrap;
}

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

.site-nav {
  display: flex;
  gap: 22px;
  font-size: 14.5px;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  /* "Use cases" and "Quick start" stay whole: the links draw closer instead (the 1080px rules). */
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a[aria-current] {
  color: var(--text);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang {
  display: inline-flex;
  /* Never squeezed by the header's other buttons: 中文 would break between its characters. */
  flex: none;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.lang a {
  padding: 4px 11px;
  border-radius: 999px;
  white-space: nowrap;
  text-decoration: none;
  color: var(--muted);
}

.lang a[aria-current='page'] {
  background: var(--surface-2);
  color: var(--text);
}

.lang a:not([aria-current]):hover {
  color: var(--text);
}

.explore {
  display: none;
  position: relative;
  flex: none;
}

.explore summary {
  padding: 8px 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* The header's links, the same seven. On a short screen (a phone turned sideways) the list scrolls inside
   itself rather than running past the screen's bottom. */
.explore nav {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1;
  min-width: max-content;
  max-height: calc(100dvh - 72px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  box-shadow: var(--shadow);
}

.explore nav a {
  display: block;
  padding: 9px 14px;
  border-radius: 7px;
  text-decoration: none;
}

.explore nav a:hover,
.explore nav a:focus-visible {
  background: var(--surface);
}

.header-tools .btn {
  height: 36px;
  padding: 0 14px;
  font-size: 14px;
}

/* The theme button at the end of the header (assets/theme.js): the moon in the light theme and the sun
   in the dark one, for the theme a press gives. It only works with JavaScript, so without it, it is not
   there. */
.header-tools .btn.theme-toggle {
  width: 36px;
  min-width: 36px;
  padding: 0;
  justify-content: center;
  color: var(--muted);
}

.header-tools .btn.theme-toggle:hover {
  color: var(--text);
}

.theme-toggle .i-moon {
  display: var(--when-light);
}

.theme-toggle .i-sun {
  display: var(--when-dark);
}

html:not(.js) .theme-toggle {
  display: none;
}

/* While the theme changes (assets/theme.js), every colour changes at once: no button fades. */
.theme-changing *,
.theme-changing *::before,
.theme-changing *::after {
  transition: none !important;
}

/* ---------- Hero ----------
   The design language's first screen (design/design-language.md, 7.1): the display headline, one muted
   sentence, the ask box with three examples under it, and one primary button, Download free. */

.hero {
  padding-block: clamp(40px, 6vw, 72px) clamp(40px, 5vw, 64px);
}

.hero-stack {
  display: grid;
  justify-items: center;
  gap: 16px;
  text-align: center;
}

/* A phrase the headline never breaks inside (Chinese breaks between any two characters). */
.phrase {
  white-space: nowrap;
}

/* Who the page is for, above the headline: one plain line, the small token (14/22) at weight 600, no pill
   (a pill on this page is a button). */
.hero-for {
  margin-bottom: -4px;
  font-size: 14px;
  line-height: 22px;
  font-weight: 600;
  color: var(--text);
}

/* Its lines about as long as each other. Chinese keeps each clause whole in a .phrase (分工、先問你), not
   with word-break: keep-all, which WebKit does not break after 、 or ， (one line, wider than the page). */
.hero-story {
  max-width: 36em;
  font-size: 16px;
  line-height: 28px;
  text-wrap: balance;
}

.hero .ask,
.hero-preview {
  width: min(100%, 640px);
  margin-top: 8px;
  text-align: left;
}

/* Centred while they fit; from its start once they do not (auto margins, which a scrolled line drops). */
.hero .ask-examples > li:first-child {
  margin-left: auto;
}

.hero .ask-examples > li:last-child {
  margin-right: auto;
}

.hero .download {
  justify-items: center;
  margin-top: 16px;
}

.hero .download-row {
  justify-content: center;
}

.hero .cta-row {
  justify-content: center;
}

/* The hero's last thing: an arrow down to the use cases, so a first screen with room left under the buttons
   still says the page goes on. It bobs three times, then rests (motion that stops within 5 seconds or so,
   WCAG 2.2.2); with reduced motion it stays still. */
.scroll-cue {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-top: clamp(8px, 2.5vw, 24px);
  border-radius: 999px;
  color: var(--muted);
  transition:
    color 0.15s,
    background-color 0.15s;
}

.scroll-cue svg {
  width: 24px;
  height: 24px;
}

@media (hover: hover) {
  .scroll-cue:hover {
    color: var(--text);
    background: var(--surface);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .scroll-cue svg {
    animation: scroll-cue 2.4s ease-in-out 3;
  }
}

@keyframes scroll-cue {
  0%,
  50%,
  100% {
    transform: translateY(0);
  }

  25% {
    transform: translateY(6px);
  }
}

.install-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  white-space: nowrap;
  color: var(--muted);
}

/* The preview of the example's delivery: shown once Send question is pressed (site.js), and as it is
   without JavaScript. */
.js .hero-preview:not(.is-open) {
  display: none;
}

.hero-preview {
  display: grid;
  gap: 12px;
}

.hero-preview:focus {
  outline: none;
}

.hero-preview-note {
  font-size: 14px;
  line-height: 22px;
  color: var(--muted);
}

@media (prefers-reduced-motion: no-preference) {
  .hero-preview.is-open {
    animation: preview-in 0.45s var(--ease);
  }
}

@keyframes preview-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: 32px;
    line-height: 42px;
  }

  /* On a phone the hero sits closer together, its sentence a size down, so that Download free stays on the
     first screen of a 360×640 one, in both languages (measured in Chromium and WebKit). */
  .hero {
    padding-top: 16px;
  }

  .hero-stack {
    gap: 12px;
  }

  .hero .ask,
  .hero-preview {
    margin-top: 0;
  }

  .hero .download {
    margin-top: 8px;
  }

  .hero-story {
    font-size: 15px;
    line-height: 24px;
  }
}

.cmd {
  position: relative;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 52px 13px 16px;
}

.cmd pre {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.7;
  overflow-x: auto;
  scrollbar-width: thin;
}

.cmd pre::before {
  content: none;
}

.cmd .prompt {
  color: var(--muted);
  user-select: none;
}

.copy {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  transition:
    background-color 0.2s,
    color 0.2s;
}

.copy:hover {
  background: var(--surface-2);
  color: var(--text);
}

.copy svg {
  width: 17px;
  height: 17px;
}

.copy .i-check {
  display: none;
}

.copy.is-done {
  color: var(--codex-ink);
}

.copy.is-done .i-copy {
  display: none;
}

.copy.is-done .i-check {
  display: block;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}

.text-link {
  font-weight: 600;
  font-size: 15px;
}

/* ---------- Downloads ----------
   Every button links to the releases page; downloads.js points each one at its installer in the
   newest release, names the visitor's system on the hero's button and marks it in the quick start. */

.download {
  display: grid;
  gap: 10px;
  justify-items: start;
}

/* The download button and its companion link. */
.download-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
}

.btn-download {
  height: 52px;
  padding: 0 26px;
  font-size: 16.5px;
}

.btn-download svg {
  width: 20px;
  height: 20px;
}

.download-meta {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
}

/* The newest release's version, once downloads.js knows it. */
.release-line [data-release-meta]:not(:empty)::after {
  content: ' · ';
}

/* One row per system, so each one's details stay on one line. */
.downloads {
  display: grid;
  gap: 12px;
  padding-top: 8px;
}

.dl {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
  transition:
    border-color 0.2s,
    transform 0.2s var(--ease);
}

.dl:hover {
  border-color: color-mix(in srgb, var(--text) 35%, var(--border));
}

.dl:active {
  transform: translateY(1px);
}

.dl svg {
  flex: none;
}

.dl-os {
  width: 26px;
  height: 26px;
}

.dl-get {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.dl-text {
  display: grid;
  gap: 1px;
}

.dl-name {
  font-weight: 700;
}

.steps .dl-detail,
.doc-body .dl-detail {
  color: var(--muted);
  font-size: 13.5px;
}

/* The visitor's system: a firmer outline and a label on the edge. */
.dl.is-yours {
  border-color: var(--text);
  box-shadow: var(--shadow);
}

.dl-yours {
  display: none;
  position: absolute;
  top: -10px;
  left: 14px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-contrast);
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
}

.dl.is-yours .dl-yours {
  display: inline-block;
}

/* ---------- Use-case recordings and their chapter rails ---------- */

.screening-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: clamp(20px, 2.4vw, 32px);
  align-items: start;
}

.player {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  background: var(--band-2);
  box-shadow:
    0 0 0 1px var(--band-line),
    0 30px 70px -30px rgb(0 0 0 / 0.8);
}

.player video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rail {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Beside the video, the rail is as tall as the video: its own content does not size the row (contain),
   it stretches to the row, and the chapters scroll inside it (site.js keeps the one playing in view). */
@media (min-width: 921px) {
  .rail {
    align-self: stretch;
    contain: size;
  }

  .chapters {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--band-line) transparent;
  }

  /* More chapters above or below: the list fades out at that edge. */
  .chapters.more-above {
    mask-image: linear-gradient(to bottom, transparent, #000 32px);
  }

  .chapters.more-below {
    mask-image: linear-gradient(to top, transparent, #000 32px);
  }

  .chapters.more-above.more-below {
    mask-image: linear-gradient(to bottom, transparent, #000 32px, #000 calc(100% - 32px), transparent);
  }
}

.rail-note {
  margin-top: 6px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--band-muted);
}

.chapters {
  /* The chapters' offsets are measured from the list (site.js scrolls it). */
  position: relative;
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  align-content: start;
  gap: 2px;
}

.chapter {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 2px 8px;
  width: 100%;
  padding: 9px 12px 11px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--band-muted);
  text-align: left;
  transition:
    background-color 0.25s,
    color 0.25s;
}

.chapter:hover {
  background: rgb(255 255 255 / 0.045);
  color: var(--band-text);
}

.chapter[aria-current='true'] {
  background: rgb(255 255 255 / 0.075);
  color: var(--band-text);
}

.chapter time {
  grid-row: span 2;
  padding-top: 2px;
  font: 500 12px/1.5 var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--band-muted);
}

.chapter[aria-current='true'] time {
  color: var(--band-text);
}

.actor {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--band-text);
}

.actor .av {
  width: 18px;
  height: 18px;
  font-size: 9.5px;
  line-height: 18px;
}

.actor .stack {
  display: flex;
}

.actor .stack .av + .av {
  margin-left: -5px;
  box-shadow: 0 0 0 2px var(--band);
}

.actor .who {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.actor .via {
  font-weight: 600;
  color: var(--agent-lit, var(--band-muted));
  white-space: nowrap;
}

.chapter .say {
  font-size: 14px;
  line-height: 1.45;
}

/* Progress inside the active chapter, in the colour of whoever acts. */
.chapter .bar {
  position: absolute;
  left: 10px;
  right: 12px;
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: var(--agent-lit, var(--band-text));
  clip-path: inset(0 calc((1 - var(--p, 0)) * 100%) 0 0 round 2px);
  opacity: 0;
  transition: opacity 0.3s;
}

.chapter.t-team .bar {
  background: linear-gradient(90deg, var(--claude-lit) 0 33.33%, var(--codex-lit) 33.33% 66.66%, var(--grok-lit) 66.66% 100%);
}

.chapter[aria-current='true'] .bar {
  opacity: 1;
}

/* ---------- Use cases ----------
   The home page lists them, each with its poster, name and one sentence, linking to its section on the
   use-cases page (site/use-cases/), where each plays in a screen of its own: the screening's video and
   chapter rail on a dark panel, then what was asked and what it shows. */

.cases {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: clamp(32px, 3.4vw, 44px) clamp(20px, 2.4vw, 32px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.case {
  display: grid;
  align-content: start;
  gap: 10px;
}

.case-link {
  display: grid;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.case-link img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 12px;
  background: var(--band-2);
  box-shadow:
    0 0 0 1px var(--border),
    var(--shadow);
}

.case-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.case-link:hover .case-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.case-text {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.cases-more {
  margin-top: clamp(32px, 3.4vw, 44px);
}

/* What a run was: its agents (pills) and how they took turns, with what permission (chips). */
.usecase-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.uc-hero .lead {
  margin-top: 22px;
}

.uc-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.uc-jump a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  transition: background-color 0.2s;
}

.uc-jump a:hover {
  background: var(--surface);
}

.usecase-head {
  display: grid;
  gap: 16px;
  margin-bottom: clamp(28px, 3vw, 40px);
}

.usecase-note {
  font-size: 14px;
  color: var(--muted);
}

/* Whose work a use case is, above its name: on its section and on its card. */
.usecase-role,
.case-role {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.usecase-role {
  margin-bottom: -8px;
}

/* The screening, as a panel of its own in the page. */
.usecase-screen {
  padding: clamp(12px, 2vw, 24px);
  border-radius: 22px;
  background: var(--band);
  color: var(--band-text);
}

.rail .rail-title {
  font-size: 1.25rem;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.usecase-body {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 24px clamp(28px, 4vw, 64px);
  margin-top: clamp(28px, 3vw, 40px);
}

.usecase-body h3 {
  margin-bottom: 12px;
  font-size: 1.05rem;
}

/* What was typed, as the app's message box would hold it. */
.usecase-ask blockquote {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  font-size: 15px;
  line-height: 1.55;
}

/* Under what was asked: the conversation as it was shared, and the files attached to the question. */
.usecase-links {
  display: grid;
  gap: 6px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.usecase-links a {
  color: var(--text);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.usecase-shows ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.usecase-shows li {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.usecase-shows li b {
  color: var(--text);
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(72px, 9vw, 132px);
}

.section + .section {
  border-top: 1px solid var(--border);
}

.section-head {
  display: grid;
  gap: 18px;
  margin-bottom: clamp(36px, 4.5vw, 60px);
}

/* Agents: the mark at page scale. */
.agents-grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
}

.agents-grid .section-head {
  margin-bottom: 28px;
}

.driven {
  display: grid;
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--border);
}

.driven > div {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.driven dt {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-weight: 700;
}

.driven dt::before {
  content: '';
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--agent);
  transform: translateY(-1px);
}

.driven dd {
  margin: 0;
  color: var(--muted);
}

.agents-foot {
  margin-top: 20px;
  color: var(--muted);
}

.mark {
  position: relative;
  aspect-ratio: 25 / 23;
  width: 100%;
  max-width: 520px;
  justify-self: end;
}

.disc {
  position: absolute;
  display: grid;
  place-content: center;
  gap: 4px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--agent);
  text-align: center;
  transform: translate(-50%, -50%);
  transition: transform 0.6s var(--ease);
}

.disc strong {
  font-family: var(--display);
  font-size: clamp(19px, 1rem + 1vw, 30px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.disc code {
  justify-self: center;
  padding: 1px 10px;
  border: 0;
  border-radius: 8px;
  background: color-mix(in srgb, currentColor 13%, transparent);
  color: inherit;
  font-size: clamp(19px, 0.95rem + 0.4vw, 21px);
  font-weight: 700;
}

.disc.t-claude {
  left: 24%;
  top: 47.8%;
  width: 48%;
  color: #18181b;
}

.disc.t-codex {
  left: 80%;
  top: 21.7%;
  width: 40%;
  color: #18181b;
}

.disc.t-grok {
  left: 80%;
  top: 78.3%;
  width: 40%;
  color: #ffffff;
}

/* Open agents: the five, beside the app's Model connections card. Their colour is only their dot in the list,
   as in the app: the headline and the mark keep the demo's three. */
.open-grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}

.open-grid .section-head {
  margin-bottom: 28px;
}

.open-grid .excerpt-note {
  margin-top: 0;
}

.ui-backends {
  display: grid;
  gap: 10px;
}

.ui-title {
  font-weight: 700;
  font-size: 15px;
}

.ui-group {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
}

.ui-field {
  display: grid;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.ui-input-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.ui-input {
  flex: 1;
  min-width: 0;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.ui-backends code,
.ui-backends .ui-muted {
  overflow-wrap: anywhere;
}

/* Modes */
.modes-tabs {
  display: none;
  gap: 6px;
  padding: 5px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  width: max-content;
  max-width: 100%;
}

.js .modes-tabs {
  display: inline-flex;
}

.modes-tabs button {
  height: 40px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 650;
  font-size: 15px;
  transition:
    background-color 0.2s,
    color 0.2s;
}

.modes-tabs button:hover {
  color: var(--text);
}

.modes-tabs button[aria-selected='true'] {
  background: var(--primary);
  color: var(--primary-contrast);
}

.mode-panels {
  display: grid;
  gap: 18px;
}

.mode-panel {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
  padding: clamp(20px, 3vw, 40px);
  background: var(--surface);
  border-radius: 22px;
}

.js .mode-panel:not(.is-active) {
  display: none;
}

.mode-copy {
  display: grid;
  gap: 14px;
  align-content: start;
}

.mode-copy h3 {
  font-size: clamp(1.6rem, 1.2rem + 1vw, 2.1rem);
  letter-spacing: -0.02em;
}

.mode-copy p {
  color: var(--muted);
}

.mode-copy .good {
  color: var(--text);
}

.mode-copy .good b {
  font-weight: 650;
}

.mode-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.mode-svg .you {
  fill: var(--text);
}

.mode-svg .you-label {
  fill: var(--bg);
  font: 700 15px var(--font);
  text-anchor: middle;
  dominant-baseline: central;
}

.mode-svg .node {
  fill: var(--agent);
}

.mode-svg .name {
  fill: var(--text);
  font: 650 16px var(--font);
}

.mode-svg .tag {
  fill: var(--muted);
  font: 500 13.5px var(--font);
}

.mode-svg .tag.strong {
  fill: var(--agent-ink, var(--text));
  font-weight: 650;
}

.mode-svg .edge {
  fill: none;
  stroke: color-mix(in srgb, var(--text) 55%, transparent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 1;
}

.mode-svg .edge.soft {
  stroke-dasharray: 0.012 0.012;
}

.mode-svg .tip {
  fill: color-mix(in srgb, var(--text) 55%, transparent);
}

.mode-svg .box {
  fill: none;
  stroke: color-mix(in srgb, var(--text) 30%, transparent);
  stroke-width: 1.5;
  stroke-dasharray: 5 5;
}

.mode-svg .halo {
  fill: none;
  stroke: var(--agent);
  stroke-width: 2;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.mode-svg .round {
  fill: var(--bg);
  stroke: var(--border);
}

.mode-svg .round-label {
  fill: var(--text);
  font: 650 13px var(--font);
  text-anchor: middle;
  dominant-baseline: central;
}

/* Diagrams act their mode out step by step (site.js). Without JS, or with reduced motion,
   every step is shown at once. */
.js .mode-svg [data-step] {
  transition:
    stroke-dashoffset 0.7s var(--ease),
    opacity 0.45s var(--ease);
}

.js .mode-svg .edge[data-step]:not(.on) {
  stroke-dashoffset: 1;
}

.js .mode-svg .edge.soft[data-step]:not(.on) {
  opacity: 0;
}

.js .mode-svg .tip[data-step],
.js .mode-svg .tag[data-step],
.js .mode-svg .box[data-step],
.js .mode-svg .round-g[data-step] {
  opacity: 0;
}

.js .mode-svg .tip[data-step].on {
  opacity: 1;
  transition-delay: 0.45s;
}

.js .mode-svg .tag[data-step].on,
.js .mode-svg .box[data-step].on,
.js .mode-svg .round-g[data-step].on {
  opacity: 1;
}

.mode-svg .halo.now {
  animation: halo 1.2s var(--ease) infinite;
}

@keyframes halo {
  0% {
    opacity: 0.9;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.75);
  }
}

/* Teams */
.teams-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(36px, 5vw, 80px);
  align-items: start;
}

.teams-copy {
  display: grid;
  gap: 18px;
}

.teams-copy p {
  color: var(--muted);
}

.teams-copy p strong,
.hero .lead strong {
  color: var(--text);
}

.picker {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.picker-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  font-weight: 650;
  color: var(--muted);
}

.tpl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.tpl:last-child {
  border-bottom: 0;
}

.tpl.auto {
  background: color-mix(in srgb, var(--grok) 7%, var(--bg));
}

.tpl .members {
  display: flex;
  grid-row: span 2;
  padding-top: 2px;
}

.tpl .members .av + .av {
  margin-left: -6px;
  box-shadow: 0 0 0 2px var(--bg);
}

.tpl.auto .members .av + .av {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--grok) 7%, var(--bg));
}

.tpl .spark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
}

.tpl .spark svg {
  width: 13px;
  height: 13px;
}

.tpl-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-weight: 700;
}

.tpl p {
  font-size: 14.5px;
  color: var(--muted);
}

/* You stay in charge: excerpts of the app's own UI. Each excerpt takes two rows of the grid (its card,
   its text), so the two side by side share them: the cards are as tall as each other and the texts
   start on the same line. */
.control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 56px) clamp(24px, 3vw, 40px);
}

.control-grid > .excerpt {
  grid-row: span 2;
  grid-template-rows: subgrid;
  row-gap: 18px;
}

.excerpt {
  display: grid;
  gap: 18px;
  align-content: start;
}

.excerpt-text {
  display: grid;
  gap: 6px;
  align-content: start;
}

.excerpt-text p {
  color: var(--muted);
}

.ui {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.5;
}

.ui-msg {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
}

.ui-msg .av {
  width: 26px;
  height: 26px;
  line-height: 26px;
  font-size: 12px;
}

.ui-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-weight: 700;
  min-height: 26px;
}

.ui-body {
  grid-column: 2;
  display: grid;
  gap: 10px;
}

.ui-approval {
  border: 1px solid color-mix(in srgb, #d97706 45%, var(--border));
  background: color-mix(in srgb, #d97706 6%, var(--bg));
  border-radius: 12px;
  padding: 12px 14px;
  display: grid;
  gap: 10px;
}

/* A phrase a heading must not break inside (Chinese breaks between any two characters). */
.keep {
  white-space: nowrap;
}

/* A long member name (@Adversarial_Reviewer) wraps instead of pushing a phone's page sideways. */
.ui-approval-head > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ui-approval-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 10px;
  font-weight: 650;
}

.waiting {
  color: var(--warn);
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
}

.ui pre {
  margin: 0;
  padding: 10px 12px;
  border-radius: 9px;
  background: #0d1117;
  color: #e6edf3;
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.ui-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ui-btn {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.ui-btn.dark {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-contrast);
}

.ui-muted {
  color: var(--muted);
  font-size: 13px;
}

/* You stay in charge: the files a reply changed, in a card of their own as the app shows them, headed by
   how many and the lines added and removed. */
.ui-changes {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  display: grid;
  gap: 10px;
}

.ui-changes-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}

.ui-changes-head .n {
  font-family: var(--mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.files {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
  font-family: var(--mono);
  font-size: 12.5px;
}

.files li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: baseline;
}

.files .st {
  font-weight: 700;
}

.files .st.m {
  color: var(--warn);
}

.files .st.a {
  color: var(--codex-ink);
}

.files .path {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.files .n {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.files .add,
.ui-changes-head .add {
  color: var(--codex-ink);
}

.files .del,
.ui-changes-head .del {
  color: var(--danger);
}

.ui-tray {
  display: grid;
  gap: 10px;
}

.tray-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface);
}

.composer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
}

.composer > span:first-child {
  flex: 1;
  min-width: 0;
}

.stop {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-contrast);
  font-size: 13px;
  font-weight: 650;
}

.stop::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: currentColor;
}

/* You stay in charge: a card taller than its content (as tall as the one beside it) keeps the content at
   its top, and the message tray's composer at its bottom. */
.control-grid .ui {
  align-content: start;
}

.control-grid .ui-tray {
  align-content: space-between;
}

.excerpt-note {
  margin-top: clamp(28px, 3vw, 40px);
  font-size: 13.5px;
  color: var(--muted);
}

/* Also included */
.more {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(28px, 5vw, 72px);
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--border);
}

.more li {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  text-wrap: pretty;
}

.more li > b:first-child {
  display: block;
  margin-bottom: 2px;
  color: var(--text);
  font-weight: 650;
}

/* Common questions: the heading beside them on a wide screen, above them on a narrow one; each question a
   heading of its own, its answer in a sentence or two under it, between the list's hairlines. */
.faq-grid {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: 0 clamp(36px, 5vw, 80px);
  align-items: start;
}

.faq-grid .section-head {
  margin-bottom: 0;
}

.faq {
  display: grid;
  border-top: 1px solid var(--border);
}

.faq > div {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.faq h3 {
  margin-bottom: 4px;
  font-size: 18px;
  line-height: 28px;
}

.faq p {
  color: var(--muted);
}

/* Safety */
.safety-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  /* The last row takes up the table's extra height, so the paragraph and list stay together. */
  grid-template-rows: auto auto 1fr;
  gap: 18px clamp(36px, 5vw, 80px);
  align-items: start;
}

/* The heading takes the first row on its own, so the permission table starts level with the
   paragraph under it. */
.safety-copy {
  display: contents;
}

.safety-copy h2 {
  grid-column: 1;
  grid-row: 1;
}

.safety-copy > p {
  grid-column: 1;
  grid-row: 2;
  color: var(--muted);
}

.safety-copy .facts {
  grid-column: 1;
  grid-row: 3;
}

.safety-side {
  grid-column: 2;
  grid-row: 2 / span 2;
}

.perm {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.perm caption {
  text-align: left;
  font-weight: 650;
  padding-bottom: 10px;
}

.perm th,
.perm td {
  text-align: left;
  vertical-align: top;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

.perm th {
  width: 9.5em;
  padding-right: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.perm td {
  color: var(--muted);
}

.perm tr:last-child th,
.perm tr:last-child td {
  border-bottom: 1px solid var(--border);
}

.facts {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.facts li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  color: var(--muted);
}

.facts svg {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  color: var(--text);
}

/* Quick start */
.start {
  background: var(--surface);
}

.section.start {
  border-top: 0;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  border-top: 1px solid var(--border);
  counter-reset: step;
}

/* One row per step: title on the left, what to do on the right. */
.steps > li {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: 12px clamp(24px, 4vw, 64px);
  align-items: start;
  padding: clamp(22px, 2.6vw, 32px) 0;
  border-bottom: 1px solid var(--border);
  counter-increment: step;
}

.steps > li > * {
  min-width: 0;
}

.steps h3::before {
  content: counter(step);
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-contrast);
  font: 700 15px/1 var(--font);
  vertical-align: 3px;
}

.steps p,
.steps li li {
  color: var(--muted);
}

.steps ul {
  margin: 0;
  padding-left: 1.1em;
  display: grid;
  gap: 4px;
}

.steps .cmd {
  background: var(--bg);
}

/* A step with several blocks keeps them together in the right-hand column. */
.step-body {
  display: grid;
  gap: 12px;
}

.current-installer:empty {
  display: none;
}

.current-installer:not(:empty),
.install-details[open] > .step-body {
  display: grid;
  gap: 12px;
}

.install-details summary {
  width: fit-content;
  cursor: pointer;
  font-weight: 600;
}

.install-details[open] > summary {
  margin-bottom: 12px;
}

.install-details p + ul,
.phone-setup {
  margin-top: 16px;
}

.start-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px 32px;
  margin-top: clamp(28px, 3vw, 40px);
}

.start-foot p {
  color: var(--muted);
}

.docs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-weight: 600;
}

/* Footer */
.site-footer {
  padding-block: 32px 40px;
  font-size: 14px;
  color: var(--muted);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
}

.footer-row .brand {
  font-size: 16px;
  color: var(--text);
  margin-right: 0;
}

.footer-row .brand svg {
  width: 22px;
  height: 22px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .screening-grid {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  /* The section links draw closer, so that they fit beside the switch and the buttons down to 981px, where
     they go (the 980px block). */
  .header-row {
    gap: 16px;
  }

  .site-nav {
    gap: 12px;
    font-size: 13.5px;
  }
}

/* English's eight section links are wider than Chinese's: they draw closer from 1160px already, and from
   1040px the header's star count goes (the hero's GitHub button keeps it), so that they stay on one line down
   to 981px, a long star count (12.3K) included (measured in Chromium and WebKit at every width). */
@media (max-width: 1160px) {
  :lang(en) .site-header .header-row {
    gap: 16px;
  }

  :lang(en) .site-nav {
    gap: 12px;
    font-size: 13.5px;
  }
}

@media (max-width: 1040px) {
  :lang(en) .site-header .header-tools .stars {
    display: none;
  }
}

/* Below 981px the English header's seven section links no longer fit beside the switch and the buttons
   (measured in Chromium at every width, a long star count included): they go, and the header keeps the mark,
   the switch and the buttons. */
@media (max-width: 980px) {
  .site-nav {
    display: none;
  }

  /* Keep the section links within reach while the header fits on one line. */
  .explore {
    display: block;
  }

  .site-header .header-tools .stars {
    display: none;
  }
}

@media (max-width: 920px) {
  .agents-grid,
  .open-grid,
  .teams-grid,
  .safety-grid,
  .faq-grid,
  .usecase-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .safety-grid {
    grid-template-rows: none;
  }

  .faq-grid .section-head {
    margin-bottom: clamp(28px, 4vw, 36px);
  }

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

  .chapters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
  }

  .mark {
    justify-self: center;
    max-width: 440px;
  }

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

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

  .safety-copy h2,
  .safety-copy > p,
  .safety-copy .facts,
  .safety-side {
    grid-column: 1;
    grid-row: auto;
  }
}

/* Where the use cases' grid would leave one column (under some 718px), they become one row that is swiped
   sideways, card by card, the next card showing at the edge. The row runs to the screen's edges and its
   first card lines up with the text; it scrolls inside itself, never the page, and a swipe at either end
   goes no further (no browser back). */
@media (max-width: 720px) {
  .cases {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: min(84%, 360px);
    gap: 16px;
    margin-inline: calc(-1 * var(--gutter));
    padding: 4px var(--gutter) 14px;
    scroll-padding-inline: var(--gutter);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
  }

  .case {
    scroll-snap-align: start;
  }

  .cases-more {
    margin-top: 18px;
  }
}

@media (max-width: 680px) {
  /* Hidden from sight only: screen readers still hear "GitHub". */
  .header-tools .btn .gh-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .header-tools .btn {
    min-width: 36px;
    padding: 0 9px;
    justify-content: center;
  }

  .header-tools .btn:has(.stars:not([hidden])) {
    padding-right: 12px;
  }

  .site-header .header-tools .btn:has(.stars) {
    padding-right: 9px;
  }

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

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

  .driven > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .perm th {
    width: auto;
  }

  .modes-tabs {
    display: none;
    width: 100%;
  }

  .js .modes-tabs {
    display: flex;
  }

  .modes-tabs button {
    flex: 1;
    padding: 0 8px;
  }

  /* Phones: let long commands wrap instead of hiding behind a scrollbar. */
  .cmd pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }

  /* Phones: the diagram scales down to ~60%, so its labels grow to stay legible. */
  .mode-panel {
    padding: 16px 14px 22px;
  }

  .mode-svg .name {
    font-size: 21px;
  }

  .mode-svg .tag {
    font-size: 18px;
  }

  .mode-svg .you-label {
    font-size: 19px;
  }

  .mode-svg .round-label {
    font-size: 16px;
  }
}

/* The header's name, its language switch and its buttons, with the header's wider gaps, fit on one
   line from some 481px: below 500px the name goes, the logo stays. The rule hides the name in the
   footer's logo link too, so both links keep the name as their label for screen readers. */
@media (max-width: 500px) {
  .brand span {
    display: none;
  }

  .header-row {
    gap: 12px;
  }
}

/* No page scrolls sideways, down to a 280px screen (the narrowest phones', folded; measured in Chromium
   at every width from 280px, test/site-header.test.ts): a long command or package name in the text
   breaks where it must, the approval and changes cards' buttons wrap, the headline scales with the
   screen so that the phrases it keeps whole fit, and the header's controls draw closer. */
@media (max-width: 480px) {
  :not(pre) > code {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .ui-approval .ui-btn {
    white-space: normal;
  }

  .ui-changes .ui-btn {
    white-space: normal;
  }
}

@media (max-width: 360px) {
  :root {
    --gutter: 12px;
  }

  .header-row {
    gap: 8px;
  }

  .header-tools {
    gap: 6px;
  }

  .lang a {
    padding: 4px 8px;
  }

  .header-tools .btn {
    padding: 0 8px;
  }

  .header-tools .btn:has(.stars:not([hidden])) {
    padding-right: 10px;
  }

  .site-header .header-tools .btn:has(.stars) {
    padding-right: 8px;
  }

  .explore summary {
    font-size: 13px;
  }

  .header-tools .btn.theme-toggle {
    width: 32px;
    min-width: 32px;
  }

  .stars {
    padding-left: 8px;
  }
}

@media (max-width: 300px) {
  .lang a {
    padding: 4px 6px;
  }
}

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

/* ---------- The Codespaces dialog ----------
   site.js opens it from the Codespaces links (without JavaScript they go to GitHub): what a codespace
   is and is not, and where Harness Relay's link shows, before GitHub's page opens in a new tab. */

body:has(.cs-dialog[open]) {
  overflow: hidden;
}

.cs-dialog {
  --cs-pad: clamp(20px, 4vw, 32px);
  width: min(680px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow);
  overflow: auto;
  overscroll-behavior: contain;
}

.cs-dialog::backdrop {
  background: rgb(0 0 0 / 0.5);
}

.cs-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  /* No padding at the bottom: the actions' bar holds it. */
  padding: var(--cs-pad) var(--cs-pad) 0;
}

.cs-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.cs-head h2 {
  font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.1rem);
  line-height: 1.08;
}

.cs-body h3 {
  margin-top: 8px;
}

.cs-close {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

.cs-close:hover {
  border-color: color-mix(in srgb, var(--text) 35%, var(--border));
}

.cs-close svg {
  width: 18px;
  height: 18px;
}

.cs-lead {
  color: var(--muted);
}

/* A command in the text wraps rather than widen the dialog on a phone. */
.cs-body code {
  white-space: normal;
  overflow-wrap: anywhere;
}

.cs-facts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  padding-left: 1.2em;
  color: var(--muted);
}

.cs-facts b {
  color: var(--text);
}

.cs-shot {
  margin: 0;
}

.cs-shot .excerpt-note {
  margin-top: 10px;
}

.cs-term {
  padding: 0;
  overflow: hidden;
}

.cs-tabs {
  display: flex;
  gap: 18px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.cs-tabs span:first-child {
  color: var(--text);
  box-shadow: inset 0 -1px 0 var(--text);
}

.cs-term pre {
  margin: 0;
  padding: 12px 14px 14px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* The link the visitor is to click, and how. */
.cs-link {
  color: var(--text);
  font-weight: 700;
  text-decoration: underline 2px;
  text-underline-offset: 3px;
}

.cs-click {
  margin-left: 4px;
  background: var(--bg);
  font-family: var(--font);
  color: var(--text);
}

.cs-actions {
  display: flex;
  /* One line, also on a phone: the rules for narrow screens below make it fit at every width from
     280px, in both languages. Only where a phone's fonts are wider still does it wrap: two lines rather
     than a dialog that scrolls sideways. */
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  /* Kept at the dialog's bottom while the rest scrolls under it (the dialog is what scrolls), across
     its whole width, over the text behind it. */
  position: sticky;
  bottom: 0;
  margin: 4px calc(-1 * var(--cs-pad)) 0;
  padding: 16px var(--cs-pad) var(--cs-pad);
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* Neither is squeezed: the button's label and the link stay whole. */
.cs-actions > * {
  flex: none;
}

/* On a phone the dialog takes more of the width (past the browser's own limit for a modal dialog,
   100% - 2em - 6px), and its actions get smaller step by step, so that the button and the link stay on
   one line down to a 320px screen, in both languages. */
@media (max-width: 440px) {
  .cs-dialog {
    --cs-pad: 16px;
    width: calc(100% - 16px);
    max-width: none;
  }

  .cs-actions {
    gap: 14px;
  }

  .cs-actions .btn {
    padding: 0 14px;
  }
}

@media (max-width: 400px) {
  .cs-actions .btn svg {
    display: none;
  }

  .cs-actions .btn,
  .cs-actions .text-link {
    font-size: 14px;
  }
}

@media (max-width: 350px) {
  .cs-dialog {
    --cs-pad: 14px;
  }

  .cs-actions {
    gap: 10px;
  }

  .cs-actions .btn {
    padding: 0 11px;
  }

  .cs-actions .btn,
  .cs-actions .text-link {
    font-size: 13px;
  }
}

@media (max-width: 320px) {
  .cs-dialog {
    --cs-pad: 12px;
    width: calc(100% - 8px);
  }

  .cs-actions {
    gap: 6px;
  }

  .cs-actions .btn {
    padding: 0 10px;
  }

  .cs-actions .btn,
  .cs-actions .text-link {
    font-size: 12px;
  }
}

@media (max-width: 295px) {
  .cs-dialog {
    --cs-pad: 10px;
  }
}

/* ---------- The ask box, the members' status, the result card and the decision card ----------
   The design language's four components (design/design-language.md, 4), recreated with the meeting-notes
   example: the same markup on the landing page (where the ask box works and the decision card's buttons show
   what each does) and in the docs (as pictures, .is-static), said so under them like the other excerpts.
   Buttons and fields 12px, cards 14px, examples a full pill, every target 44px or taller; colour on a member
   says who, on a dot what is happening, and the decision card's edge is a screen's one strong accent. */

.mock-icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ask {
  display: grid;
  gap: 12px;
}

.ask-box {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--text) 22%, var(--border));
  border-radius: 12px;
  background: var(--bg);
  box-shadow: var(--shadow);
}

.ask-box:focus-within {
  outline: 2px solid var(--info);
  outline-offset: 2px;
}

.ask-input {
  display: block;
  width: 100%;
  min-height: 56px;
  margin: 0;
  padding: 0;
  border: 0;
  resize: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  line-height: 28px;
  text-align: left;
}

.ask-input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.ask-input:focus-visible {
  outline: none;
}

.ask-tools {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.ask-attach {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-right: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--muted);
}

.ask-send:disabled,
.card-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ask-send:disabled:hover {
  background: var(--primary);
}

/* Sending: the button keeps its words and turns a ring (7.1). */
.ask-send .ask-ring {
  display: none;
}

.ask.is-sending .ask-send .ask-ring {
  display: block;
}

@media (prefers-reduced-motion: no-preference) {
  .ask.is-sending .ask-ring {
    animation: ask-spin 0.8s linear infinite;
  }
}

@keyframes ask-spin {
  to {
    transform: rotate(360deg);
  }
}

.ask-examples {
  /* One line, whatever the width, as in the app (design language 4): where the three do not all fit (English
     on a phone), the line scrolls sideways, its right edge fading out while more is off to the right. It
     keeps room inside for a pill's focus ring, which a scrolling line would cut. */
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin: -6px -6px;
  padding: 6px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}

.ask-examples::-webkit-scrollbar {
  display: none;
}

.ask-examples > li {
  flex: none;
}

@property --ask-fade {
  syntax: '<length>';
  inherits: false;
  initial-value: 0px;
}

@supports (animation-timeline: scroll()) {
  .ask-examples {
    mask-image: linear-gradient(to right, #000 calc(100% - var(--ask-fade)), transparent);
    animation: ask-fade linear both;
    animation-timeline: scroll(self inline);
  }

  @keyframes ask-fade {
    from {
      --ask-fade: 32px;
    }
    to {
      --ask-fade: 0px;
    }
  }
}

.doc-body .ask-examples {
  /* The article's list indent off, the line's room for focus rings kept. */
  padding: 6px;
}

.doc-body .ask-examples li + li {
  margin-top: 0;
}

.ask-example {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  min-height: 44px;
  /* As the app's (14px): the same question box in both. */
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 22px;
  text-align: left;
  transition: border-color 0.2s;
}

button.ask-example:hover {
  border-color: color-mix(in srgb, var(--text) 35%, var(--border));
}

/* The cards, in the order a delivery shows them. */
.delivery {
  display: grid;
  gap: 12px;
}

.member-list,
.result-card,
.decision-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
  box-shadow: var(--shadow);
  font-size: 16px;
  line-height: 28px;
  text-align: left;
}

/* Who is working: an avatar and a name in the member's colour, one sentence of what it does (not coloured),
   and a dot or a check for what is happening. */
.member-list {
  margin: 0;
  padding: 0 16px;
  list-style: none;
}

.doc-body .member-list {
  padding-left: 16px;
}

.member {
  display: grid;
  grid-template-columns: 32px auto minmax(0, 1fr) 22px;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  font-size: 14px;
  line-height: 22px;
}

.doc-body .member-list li + li {
  margin-top: 0;
}

.member + .member {
  border-top: 1px solid var(--border);
}

.member-face {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--agent-deep, var(--text));
  color: #fff;
  font: 700 14px/1 var(--font);
}

.member-name {
  color: var(--agent-ink, var(--text));
  font-size: 15px;
  font-weight: 650;
}

.member-status {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
}

.member-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.member.is-working .member-dot {
  background: var(--info);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--info) 22%, transparent);
}

@media (prefers-reduced-motion: no-preference) {
  .member.is-working .member-dot {
    animation: member-pulse 1.6s ease-in-out infinite;
  }
}

@keyframes member-pulse {
  50% {
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--info) 10%, transparent);
  }
}

.member.is-done .member-status {
  color: var(--ok);
}

/* The result: its file, three lines of it, Open and Download. */
.result-card,
.decision-card {
  display: grid;
  gap: 8px;
  padding: 16px 24px;
}

.result-file {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 18px;
  font-weight: 500;
}

.result-file .mock-icon {
  width: 16px;
  height: 16px;
}

.result-preview {
  margin: 0;
  padding: 0 0 0 12px;
  border-left: 2px solid var(--border);
  list-style: none;
}

.doc-body .result-preview {
  padding-left: 12px;
}

.doc-body .result-preview li + li {
  margin-top: 0;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid color-mix(in srgb, var(--text) 22%, var(--border));
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.card-btn.is-primary {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-contrast);
}

/* Needs your decision: the app's card for what waits in the outbox. The action as its title, "Needs your
   decision" beside it, what it would send, and the orange edge until it is answered. */
.decision-card {
  border-color: color-mix(in srgb, var(--decide) 45%, var(--border));
  border-left: 4px solid var(--decide);
  background: color-mix(in srgb, var(--decide) 4%, var(--bg));
  padding: 14px 18px;
}

.decision-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 0;
}

.decision-head .mock-icon {
  width: 18px;
  height: 18px;
  color: var(--decide);
}

.decision-title {
  font-size: 15px;
  line-height: 22px;
  font-weight: 600;
}

.decision-tag {
  margin-left: auto;
  font-size: 13px;
  line-height: 20px;
  font-weight: 600;
  color: var(--warn);
}

.decision-fields {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 16px;
  margin: 0;
  font-size: 14px;
  line-height: 22px;
}

.decision-fields dt {
  color: var(--muted);
}

.decision-fields dd {
  margin: 0;
}

.decision-text {
  font-size: 14px;
  line-height: 22px;
}

.decision-card.is-settled {
  border-color: var(--border);
  border-left-color: var(--border);
  background: var(--bg);
}

.decision-card:focus {
  outline: none;
}

.decision-card:focus-visible {
  outline: 2px solid var(--info);
  outline-offset: 2px;
}

.decision-outcome {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  line-height: 22px;
  font-weight: 600;
}

.decision-outcome .mock-icon {
  width: 18px;
  height: 18px;
  color: var(--ok);
}

.decision-card.is-sent [data-outcome='sent'],
.decision-card.is-kept [data-outcome='kept'] {
  display: flex;
}

.decision-card.is-settled .decision-tag,
.decision-card.is-settled .decision-text {
  display: none;
}

.decision-card.is-settled .card-actions {
  display: none;
}

/* The landing page's preview: a small copy of the app's chat (site.js plays it). */
.app-mock {
  display: grid;
  /* Its columns never wider than the box: content wraps instead of being cut at the edge (on a phone). */
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: var(--shadow);
  font-size: 15px;
  line-height: 24px;
  text-align: left;
}

.app-mock [hidden] {
  display: none !important;
}

.app-mock p {
  margin: 0;
}

.app-mock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.app-mock-more {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  line-height: 1;
}

.app-mock-thread {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
}

.app-mock-you {
  justify-self: end;
  max-width: 85%;
  padding: 8px 14px;
  border-radius: 18px;
  background: var(--surface);
}

.app-mock-replies,
.app-mock-reply {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.app-mock-replies:empty {
  display: none;
}

/* The lead member's team design, as the app's chat shows it (MessageItem's PlanCard): while it chooses, a
   line with the mark turning; then the card, open, with the team, how it takes turns, why, and each member's
   role. Hide folds it into the app's one line, and View team opens it again. Without JavaScript it shows
   open, without the two buttons. Its "used without asking" keeps the green to its icon (small text). On the
   page's background, not the app's surface: the members' pills keep 4.5:1 only there (test/site-theme.test.ts). */
.app-mock-plan {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.app-mock-plan-status,
.app-mock-plan-folded {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}

.app-mock-plan-status,
.app-mock-plan-folded,
.app-mock-plan.is-planning .app-mock-plan-card,
.app-mock-plan.is-folded .app-mock-plan-card,
.app-mock-plan:not(.is-answered) [data-plan-line='answered'],
.app-mock-plan.is-answered [data-plan-line='answering'] {
  display: none;
}

.app-mock-plan.is-planning .app-mock-plan-status,
.app-mock-plan.is-folded .app-mock-plan-folded {
  display: flex;
}

.app-mock-plan-status {
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 20px;
}

.app-mock-plan svg:not(.mock-icon) {
  flex: none;
  width: 18px;
  height: 18px;
}

.app-mock-plan-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}

.app-mock-plan-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

.app-mock-plan-by,
.app-mock-plan-headline span {
  color: var(--muted);
  font-size: 13px;
}

.app-mock-plan-toggle {
  padding: 0 2px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--text) 35%, transparent);
  cursor: pointer;
}

.app-mock-plan-toggle:hover {
  text-decoration-color: currentColor;
}

.app-mock-plan-head .app-mock-plan-toggle {
  margin-left: auto;
}

html:not(.js) .app-mock-plan-toggle {
  display: none;
}

.app-mock-plan-headline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
}

.app-mock-plan-reason,
.app-mock-plan-members {
  font-size: 13.5px;
  line-height: 21px;
}

.app-mock-plan-members {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-mock-plan-members li {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.app-mock-plan-member {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.app-mock-plan-member .app-mock-face {
  width: 20px;
  height: 20px;
  font-size: 10px;
}

/* Under the name: the avatar (20px) and the gap (8px). */
.app-mock-plan-role {
  padding-left: 28px;
}

.app-mock-plan-done {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.app-mock-plan-done .mock-icon {
  width: 16px;
  height: 16px;
  color: var(--ok);
}

/* One line: only the names give way, cut with an ellipsis. */
.app-mock-plan-folded {
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 22px;
  white-space: nowrap;
}

.app-mock-plan-line {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

@media (pointer: coarse) {
  .app-mock-plan-toggle {
    min-height: 44px;
  }

  .app-mock-plan-folded {
    padding-block: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .app-mock-plan-card,
  .app-mock-plan-folded {
    animation: preview-in 0.35s var(--ease);
  }

  .app-mock-plan-logo {
    animation: plan-turn 1.6s linear infinite;
  }
}

@keyframes plan-turn {
  to {
    transform: rotate(360deg);
  }
}

.app-mock-who {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-mock-face {
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--agent-deep, var(--text));
  color: #fff;
  font: 700 13px/1 var(--font);
}

.app-mock-reply .result-card,
.app-mock-reply .decision-card {
  box-shadow: none;
  font-size: 15px;
  line-height: 24px;
}

.app-mock-reply .result-card {
  padding: 12px 16px;
}

.app-mock-reply .card-btn {
  min-height: 36px;
  font-size: 14px;
}

@media (prefers-reduced-motion: no-preference) {
  .app-mock-reply {
    animation: preview-in 0.35s var(--ease);
  }
}

.app-mock-dock {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  padding: 8px 12px 12px;
}

.app-mock-status {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0;
  padding: 0 4px;
  list-style: none;
  font-size: 13px;
  line-height: 22px;
}

.app-mock-member {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.app-mock-member .app-mock-face {
  width: 18px;
  height: 18px;
  font-size: 10px;
}

.app-mock-member b {
  color: var(--agent-ink, var(--text));
  font-weight: 600;
}

.app-mock-state {
  color: var(--muted);
}

.app-mock-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}

.app-mock-member.is-working .app-mock-dot {
  background: var(--info);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--info) 22%, transparent);
}

.app-mock-member.is-done .app-mock-dot {
  background: var(--ok);
}

@media (prefers-reduced-motion: no-preference) {
  .app-mock-member.is-working .app-mock-dot {
    animation: mock-pulse 1.2s ease-in-out infinite;
  }
}

@keyframes mock-pulse {
  50% {
    opacity: 0.35;
  }
}

.app-mock-context {
  display: flex;
  align-items: center;
  min-height: 28px;
  padding: 0 4px;
  font-size: 13px;
  line-height: 20px;
  color: var(--muted);
}

.app-mock-reminder {
  padding: 0;
  border: 0;
  background: none;
  color: var(--warn);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.app-mock-reminder:hover {
  text-decoration: underline;
}

@media (pointer: coarse) {
  .app-mock-reminder {
    min-height: 44px;
  }
}

.app-mock-route u {
  color: var(--text);
}

.app-mock-composer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 14px;
  border: 1px solid var(--border);
  border-radius: 22px;
  color: var(--muted);
}

.app-mock-composer .mock-icon {
  flex: none;
  width: 18px;
  height: 18px;
}

.app-mock-placeholder {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.app-mock-send {
  flex: none;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-contrast);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

/* The narrowest phones: the message box's microphone goes, so that "Let the team continue" still fits. */
@media (max-width: 300px) {
  .app-mock-composer {
    gap: 8px;
  }

  .app-mock-composer .mock-icon:last-of-type {
    display: none;
  }
}

/* In the docs, the same components as pictures: nothing in them is a control. */
.mock {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
}

.mock .ask-input {
  min-height: 0;
}

.doc-body .mock p,
.doc-body .mock ul {
  margin: 0;
}

@media (max-width: 480px) {
  .result-card,
  .decision-card {
    padding: 12px 16px;
  }

  .member-list {
    padding: 0 12px;
  }

  .doc-body .member-list {
    padding-left: 12px;
  }

  .member {
    grid-template-columns: 28px auto minmax(0, 1fr) 18px;
    gap: 8px;
  }

  .member-face {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .card-btn {
    white-space: normal;
  }
}

/* ---------- The docs (docs/ and zh-TW/docs/) ----------
   For people who use Harness Relay: a page per task, in the landing page's world, its type, tokens and
   hairlines at reading scale. The technical details stay in the repository's docs on GitHub, which every
   page names at its end (.doc-more). On a wide screen, three columns: the docs' pages (.doc-nav, a search
   field above them), the page (its title and a button that copies it as Markdown), and its sections
   (.doc-toc), the menu and the contents sticky. At 1180px and narrower the search and pages share one
   sticky row. The contents fold into a second row beneath it. The field is the narrower of the two until it is opened, when it fills the row
   (with JavaScript; without it the pages show in full above the page, and the search field and the copy
   button stay hidden). */

.doc-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 200px;
  grid-template-areas:
    'nav head toc'
    'nav body toc';
  grid-template-rows: auto 1fr;
  gap: 0 clamp(32px, 4vw, 56px);
  align-items: start;
  padding-block: clamp(32px, 4vw, 56px) clamp(72px, 9vw, 120px);
}

/* The docs' pages, in their groups, with GitHub's technical docs under them. The current page's highlight
   reaches 10px left of the column, so that the links' text lines up with it: the nav scrolls by itself, which
   clips what leaves its padding box, so it takes those 10px as padding of its own (and a margin that gives
   them back). */
.doc-nav {
  grid-area: nav;
  margin-left: -10px;
  padding-left: 10px;
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  font-size: 14.5px;
}

/* Search and the button that copies the page need JavaScript (docs.js). Without it the pages read as written. */
.doc-search,
.doc-actions {
  display: none;
}

.js .doc-search {
  display: block;
  position: sticky;
  top: 0;
  z-index: 2;
  /* The current page's highlight sits 10px left of this column. Cover it while the menu scrolls under the field. */
  margin: 0 0 16px -10px;
  padding-left: 10px;
  background: var(--bg);
}

.doc-search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}

/* The menu scrolls, and the field sits against the top and left of that column, so an outline
   outside the field is clipped and reads as a second border shifted off the radius. The ring
   stays inside the field. */
.doc-search-field:focus-within {
  border-color: var(--info);
  box-shadow: inset 0 0 0 1px var(--info);
}

.doc-search input:focus-visible {
  outline: none;
}

.doc-search-field svg {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--muted);
}

.doc-search input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: 0;
  padding: 0;
  appearance: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
}

.doc-search-panel {
  position: fixed;
  z-index: 45;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  box-shadow: var(--shadow);
}

.doc-search-panel ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.doc-search-panel a {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
}

.doc-search-panel a[aria-selected='true'],
.doc-search-panel a:hover {
  background: var(--surface);
  color: var(--text);
}

.doc-search-title {
  color: var(--text);
  font-size: 14.5px;
  font-weight: 650;
}

.doc-search-heading {
  font-size: 13px;
  font-weight: 600;
}

.doc-search-snippet {
  font-size: 13px;
  line-height: 1.45;
}

.doc-search-panel mark {
  background: color-mix(in srgb, var(--grok) 28%, transparent);
  color: inherit;
  border-radius: 3px;
}

.doc-search-empty {
  margin: 0;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 14px;
}

.doc-nav-toggle,
.doc-nav.is-compact:not(.is-open) .doc-nav-list {
  display: none;
}

.doc-nav.is-compact .doc-nav-toggle {
  display: flex;
}

.doc-nav-title {
  margin-bottom: 4px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--muted);
}

.doc-nav ul {
  list-style: none;
  margin: 0 0 22px -10px;
  padding: 0;
  display: grid;
  gap: 1px;
}

.doc-nav ul a {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--muted);
  line-height: 1.35;
  text-decoration: none;
}

.doc-nav ul a:hover {
  color: var(--text);
  background: var(--surface);
}

.doc-nav ul a[aria-current='page'] {
  color: var(--text);
  background: var(--surface-2);
  font-weight: 600;
}

.doc-nav-out {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
}

.doc-nav-out:hover {
  color: var(--text);
}

.doc-nav-out svg {
  flex: none;
  width: 16px;
  height: 16px;
}

.doc-head {
  grid-area: head;
  display: grid;
  gap: 16px;
  margin-bottom: clamp(28px, 3vw, 40px);
}

.doc-head h1 {
  /* The h1 token: 32/44. */
  font-size: 32px;
  line-height: 44px;
  letter-spacing: -0.02em;
  font-stretch: 94%;
  text-wrap: pretty;
}

:lang(zh) .doc-head h1 {
  letter-spacing: -0.01em;
}

/* Where the page is: the docs, its group in the menu, the page; three levels at most. */
.doc-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0 0 -8px;
  padding: 0;
  list-style: none;
  font-size: 14px;
  line-height: 22px;
  color: var(--muted);
}

.doc-crumbs li + li::before {
  content: '›';
  margin: 0 8px;
}

.doc-crumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-block: -11px;
  color: inherit;
}

.doc-crumbs a:hover {
  color: var(--text);
}

.doc-crumbs [aria-current='page'] {
  color: var(--text);
}

.doc-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
}

.doc-title-row h1 {
  flex: 1 1 12rem;
  min-width: 0;
}

.doc-actions {
  flex: none;
  padding-top: 0.4rem;
}

.js .doc-actions {
  display: block;
}

.doc-copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 14px 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}

.doc-copy svg {
  width: 16px;
  height: 16px;
}

.doc-copy:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--text) 35%, var(--border));
}

.doc-copy.is-done {
  color: var(--text);
}

.doc-copy.is-failed {
  color: var(--danger);
}

/* Jump to the chosen heading without opening intermediate branches on the way through a long article. */
html:has(.doc-toc) {
  scroll-behavior: auto;
}
/* The page's sections, the one on screen marked (site.js). */
.doc-toc {
  grid-area: toc;
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  scrollbar-width: thin;
  font-size: 13.5px;
}

.doc-toc-toggle[hidden],
.doc-toc > ol[hidden] {
  display: none;
}

.doc-toc-title {
  margin-bottom: 8px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--muted);
}

.doc-toc ol {
  display: grid;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.doc-toc ol ol {
  margin: 2px 0 5px 7px;
  padding-left: 9px;
  border-left: 1px solid var(--border);
}
.doc-toc a,
.doc-toc summary {
  padding: 5px 6px;
  color: var(--muted);
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.doc-toc summary {
  cursor: pointer;
  font-weight: 600;
}
.doc-toc summary::marker {
  font-size: 0.8em;
}
.doc-toc a {
  display: block;
  text-decoration: none;
}
.doc-toc a:hover,
.doc-toc summary:hover,
.doc-toc details:has(a[aria-current='true']) > summary {
  color: var(--text);
}
.doc-toc a[aria-current='true'] {
  color: var(--text);
  background: var(--surface);
  box-shadow: inset 2px 0 currentColor;
}
.doc-toc :is(a, summary):focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}

/* The page's text: the body at reading scale, in the page's ink. */
.doc-body {
  grid-area: body;
  min-width: 0;
  max-width: 720px;
  /* The body token: 16/28. */
  font-size: 16px;
  line-height: 28px;
}

.doc-body > section + section {
  margin-top: 48px;
}

.doc-body h2 {
  /* The h2 token: 22/32. */
  margin-bottom: 12px;
  font-size: 22px;
  line-height: 32px;
  font-weight: 650;
  letter-spacing: -0.01em;
  font-stretch: 96%;
}

/* A page is its steps (design/design-language.md, 8.7 and 9.1): every section of the page, numbered, but
   "If something goes wrong" (#trouble) and the sections in the Advanced fold. */
.doc-body {
  counter-reset: doc-step;
}

.doc-body > section:not(#trouble) > h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  counter-increment: doc-step;
}

.doc-body > section:not(#trouble) > h2::before {
  content: counter(doc-step);
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-contrast);
  font: 700 16px/1 var(--font);
}

:lang(zh) .doc-body h2 {
  letter-spacing: 0;
}

/* Then the page's one sentence for when something goes wrong, and the next page, as a text link: a docs
   page has no primary button (8.3). */
.doc-next {
  margin: 20px 0 0;
  font-size: 16px;
  font-weight: 600;
}

.doc-next a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

/* Keys, addresses and how things connect, at the end of the page they belong to: folded, its title at h2
   size, the chevron saying it opens. Its sections are not steps (no number). */
.doc-advanced {
  margin-top: 48px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.doc-advanced > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 14px 0;
  font-size: 22px;
  line-height: 32px;
  font-weight: 650;
  letter-spacing: -0.01em;
  cursor: pointer;
  list-style: none;
}

.doc-advanced > summary::-webkit-details-marker {
  display: none;
}

.doc-advanced > summary::after {
  content: '';
  flex: none;
  width: 9px;
  height: 9px;
  margin: 0 6px 6px 0;
  border-right: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: rotate(45deg);
  color: var(--muted);
}

.doc-advanced[open] > summary::after {
  margin-bottom: -4px;
  transform: rotate(-135deg);
}

.doc-advanced > section {
  margin: 8px 0 32px;
}

.doc-advanced > section + section {
  margin-top: 40px;
}

/* The page's states (9.3), which docs.js shows: pictures that did not load, no connection (a neutral line,
   its dot warn, or info where a decision card's picture already has the one orange), and a press on a
   button in a picture of the app. */
.doc-state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0 0 24px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  line-height: 22px;
}

.doc-body .doc-state p {
  margin: 0;
}

.doc-state.is-offline p::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--warn);
  vertical-align: 1px;
}

.doc-body:has(.decision-card) .doc-state.is-offline p::before {
  background: var(--info);
}

.doc-state-action,
.doc-search-retry {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.doc-state-action:hover,
.doc-search-retry:hover {
  border-color: color-mix(in srgb, var(--text) 35%, var(--border));
}

.doc-figure > .doc-state {
  margin: 0;
}

.doc-search-retry {
  margin-left: 4px;
}

.doc-body h3 {
  margin: 32px 0 8px;
  font-size: 18px;
  line-height: 28px;
  font-weight: 650;
}

.doc-body p,
.doc-body ul,
.doc-body ol {
  margin: 0 0 16px;
}

.doc-body ul,
.doc-body ol {
  padding-left: 1.3em;
}

.doc-body li + li {
  margin-top: 6px;
}

.doc-body li > ul,
.doc-body li > ol {
  margin: 6px 0 0;
}

.doc-body kbd {
  display: inline-block;
  padding: 0 0.42em;
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--bg);
  font-size: 0.84em;
  line-height: 1.55;
  white-space: nowrap;
}

/* A table of choices (modes, permissions, sign-ins): the landing page's permission table, at reading scale.
   Its cells wrap, so it never widens the page. */
.doc-table {
  width: 100%;
  margin: 6px 0 20px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.55;
}

.doc-table th,
.doc-table td {
  padding: 12px 18px 12px 0;
  border-top: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.doc-table th:last-child,
.doc-table td:last-child {
  padding-right: 0;
}

.doc-table thead th {
  padding-top: 0;
  border-top: 0;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
}

.doc-table tbody th {
  font-weight: 650;
}

/* The download cards, as on the landing page's quick start, with room under them. */
.doc-body .downloads {
  margin-bottom: 14px;
}

.doc-table td {
  color: var(--muted);
}

.doc-table tbody tr:last-child > * {
  border-bottom: 1px solid var(--border);
}

/* A note beside the text, two a page at most (8.7), of three kinds by its left edge and its icon: a tip
   (info, the default), a caution (.is-warn) and a danger (.is-danger). */
.doc-note {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 12px;
  margin: 6px 0 20px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--info);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 15.5px;
}

.doc-note > svg {
  width: 20px;
  height: 20px;
  margin-top: 3px;
  color: var(--info);
}

.doc-note.is-warn {
  border-left-color: var(--warn);
}

.doc-note.is-warn > svg {
  color: var(--warn);
}

.doc-note.is-danger {
  border-left-color: var(--danger);
}

.doc-note.is-danger > svg {
  color: var(--danger);
}

.doc-note p {
  margin: 0;
}

.doc-note p + p {
  margin-top: 8px;
}

/* Numbered steps, each number a disc like the quick start's. */
.doc-steps {
  list-style: none;
  margin: 6px 0 20px;
  padding: 0;
  display: grid;
  gap: 14px;
  counter-reset: step;
}

.doc-body .doc-steps {
  padding-left: 0;
}

.doc-steps > li {
  position: relative;
  min-height: 30px;
  padding-left: 44px;
  counter-increment: step;
}

.doc-body .doc-steps > li + li {
  margin-top: 0;
}

.doc-steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -1px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-contrast);
  font: 700 14px/1 var(--font);
}

/* The words the app uses, each with what it means. */
.doc-terms {
  margin: 6px 0 20px;
  border-top: 1px solid var(--border);
}

.doc-terms dt {
  padding-top: 14px;
  font-weight: 650;
}

.doc-terms dd {
  margin: 2px 0 0;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

/* The overview's three entries (design/design-language.md, 7.4): numbered, a title at h2 size and one line,
   each the whole row a link. */
.doc-start {
  list-style: none;
  margin: 0 0 48px;
  padding: 0;
  counter-reset: start;
  border-top: 1px solid var(--border);
}

.doc-body .doc-start {
  padding-left: 0;
}

.doc-start li {
  counter-increment: start;
  border-bottom: 1px solid var(--border);
}

.doc-body .doc-start li + li {
  margin-top: 0;
}

.doc-start a {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 16px;
  min-height: 44px;
  padding: 16px 0;
  color: var(--muted);
  text-decoration: none;
}

.doc-start a::before {
  content: counter(start, decimal-leading-zero);
  font: 16px/1 var(--mono);
  color: var(--muted);
}

.doc-start b {
  display: block;
  color: var(--text);
  font-size: 22px;
  line-height: 32px;
  font-weight: 600;
}

.doc-start a:hover b {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.doc-start svg {
  width: 20px;
  height: 20px;
  transform: rotate(-90deg);
}

/* The overview's pages: a list in two columns, as "Also in every chat" on the landing page. */
.doc-index {
  list-style: none;
  margin: 6px 0 20px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(24px, 4vw, 48px);
  border-top: 1px solid var(--border);
}

.doc-body .doc-index {
  padding-left: 0;
}

.doc-body .doc-index li {
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.doc-index a {
  display: grid;
  gap: 2px;
  height: 100%;
  padding: 16px 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 15.5px;
  line-height: 1.55;
}

.doc-index b {
  color: var(--text);
  font-size: 16.5px;
  font-weight: 650;
}

.doc-index a:hover b {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* A picture of the app: a frame of a real recording, or an excerpt recreated with sample content (.ui),
   said so under it. */
.doc-figure {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin: 10px 0 24px;
}

.doc-body img {
  height: auto;
}

.doc-body h2 > svg {
  display: inline-block;
  vertical-align: -0.06em;
}

.doc-figure > a:has(> img),
.doc-figure > img {
  justify-self: start;
  max-width: 100%;
}

.doc-figure > img,
.doc-figure > a > img {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.doc-figure figcaption {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
}

.doc-figure .ui {
  font-size: 14px;
}

/* Where the technical details are: the repository's docs on GitHub. */
.doc-more {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 12px;
  margin-top: clamp(48px, 6vw, 72px);
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.doc-more > svg {
  width: 20px;
  height: 20px;
  margin-top: 3px;
}

.doc-more p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 15px;
}

.doc-body .doc-more ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  font-size: 15px;
  font-weight: 600;
}

.doc-body .doc-more li + li {
  margin-top: 0;
}

/* The page before and after, so a page never ends on a dead end. */
.doc-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.doc-pager a {
  display: grid;
  gap: 2px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.2s;
}

.doc-pager a:hover {
  border-color: color-mix(in srgb, var(--text) 35%, var(--border));
}

.doc-pager a[rel='next'] {
  grid-column: 2;
  text-align: right;
}

.doc-pager span {
  font-size: 13px;
  color: var(--muted);
}

.doc-pager b {
  font-weight: 650;
}

@media (max-width: 1180px), (hover: none) and (pointer: coarse) {
  .doc-toc {
    position: static;
    max-height: none;
    overflow: visible;
    margin-bottom: clamp(32px, 4vw, 44px);
    padding: 14px 18px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }

  .doc-toc > ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 24px;
    align-items: start;
  }
  .doc-toc:has(details) > ol {
    grid-template-columns: minmax(0, 1fr);
  }
  .doc-toc a,
  .doc-toc summary {
    padding-block: 8px;
  }

  .doc-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      'nav'
      'head'
      'toc'
      'body';
    grid-template-rows: none;
    padding-top: 0;
  }

  .doc-nav {
    position: static;
    max-height: none;
    overflow: visible;
    margin: 0 calc(-1 * var(--gutter)) 20px;
    padding: 8px var(--gutter);
    background: var(--bg);
  }

  .js .doc-layout {
    grid-template-areas: 'nav' 'toc' 'head' 'body';
  }

  /* With JavaScript, the search field and the docs' button share one row and stay at the top while the page
     scrolls, under the header, on the page's background from edge to edge; the pages, opened, scroll inside
     the screen that is left. (Without it the pages show in full, and scroll away with the page.) The field
     is the narrower of the two. Opening it (or leaving its results open) lets the field fill the row. */
  .js .doc-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 8px;
    margin-bottom: 0;
    position: sticky;
    top: 64px;
    z-index: 40;
  }

  .js .doc-search {
    /* Narrower than the docs' button. 7.75rem fits 搜尋文件 and "Search"; the cap keeps that on a small screen. */
    flex: 0 1 7.75rem;
    max-width: 42%;
    min-width: 0;
    margin: 0;
    padding: 0;
    position: static;
    background: transparent;
    transition:
      max-width 0.16s var(--ease),
      flex-basis 0.16s var(--ease);
  }

  .js .doc-search:focus-within,
  .js .doc-search.is-wide {
    flex-basis: 100%;
    max-width: 100%;
  }

  .js .doc-search:focus-within ~ .doc-nav-toggle,
  .js .doc-search.is-wide ~ .doc-nav-toggle {
    display: none;
  }

  .js .doc-search-field {
    height: 46px;
    border-radius: 12px;
  }

  html.js:has(.doc-nav) {
    --doc-search-bottom: 126px; /* header 64 + search row 46 + padding 16 */
    --doc-contents-height: max(44px, 2.75rem);
    /* Keep focusing the sticky controls from scrolling the article backwards behind them. */
    scroll-padding-top: 0;
  }
  .js .doc-body [id] {
    scroll-margin-top: calc(var(--doc-search-bottom) + var(--doc-contents-height) + 8px);
  }

  .js .doc-toc {
    position: sticky;
    top: var(--doc-search-bottom);
    z-index: 39;
    margin: 0 calc(-1 * var(--gutter)) 24px;
    padding: 0 var(--gutter);
    border: 0;
    border-radius: 0;
    background: var(--bg);
    box-shadow: 0 1px var(--border);
  }

  .js .doc-toc-title {
    display: none;
  }

  .doc-toc-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: var(--doc-contents-height);
    padding: 0 12px;
    appearance: none;
    border: 0;
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
    font-weight: 650;
    cursor: pointer;
  }

  .doc-toc-toggle::after {
    content: '';
    width: 8px;
    height: 8px;
    margin-inline-end: 3px;
    border: solid var(--muted);
    border-width: 0 1.5px 1.5px 0;
    transform: translateY(-2px) rotate(45deg);
  }
  .doc-toc-toggle[aria-expanded='true']::after {
    transform: translateY(2px) rotate(225deg);
  }
  .doc-toc-toggle:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: -2px;
  }

  .js .doc-toc > ol {
    position: absolute;
    top: 100%;
    inset-inline: var(--gutter);
    max-height: calc(100vh - var(--doc-search-bottom) - var(--doc-contents-height) - 12px);
    max-height: calc(100dvh - var(--doc-search-bottom) - var(--doc-contents-height) - 12px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 0 0 12px 12px;
    background: var(--bg);
    box-shadow: var(--shadow);
  }

  .js .doc-nav-toggle {
    align-items: center;
    gap: 10px;
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    min-height: 46px;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg);
    text-align: left;
  }

  .doc-nav-toggle span {
    flex: none;
    color: var(--muted);
  }

  .doc-nav-toggle b {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 650;
  }

  .doc-nav-toggle svg {
    flex: none;
    width: 18px;
    height: 18px;
    color: var(--muted);
    transition: transform 0.2s var(--ease);
  }

  .doc-nav.is-open .doc-nav-toggle svg {
    transform: rotate(180deg);
  }

  .js .doc-nav-list {
    position: absolute;
    top: 100%;
    inset-inline: 0;
    max-height: calc(100vh - var(--doc-search-bottom) - 12px);
    max-height: calc(100dvh - var(--doc-search-bottom) - 12px);
    padding: 14px var(--gutter) 16px calc(var(--gutter) + 10px);
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid var(--border);
    border-radius: 0 0 12px 12px;
    background: var(--bg);
    box-shadow: var(--shadow);
  }

  /* The pages panel occupies this row. Its hidden controls cannot be tabbed to behind the panel. */
  .js .doc-nav.is-open ~ .doc-toc {
    visibility: hidden;
  }

  @media (prefers-reduced-motion: reduce) {
    .js .doc-search {
      transition: none;
    }
  }
}

/* A table's cells break a long word (an address, a command) where they must, so that the table fits a 280px
   screen; its row names stay whole. */
@media (max-width: 480px) {
  .doc-table {
    font-size: 14px;
  }

  .doc-table th,
  .doc-table td {
    padding-right: 12px;
  }

  .doc-table td {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 560px) {
  .doc-toc > ol,
  .doc-index {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .doc-pager a[rel='next'] {
    grid-column: 1;
  }

  .doc-note,
  .doc-more {
    padding: 14px;
    gap: 10px;
  }
}
