/* ── CLI docs (docs.html only) ──
   Three columns on wide screens: grouped section nav | article | "on this
   page" rail for the current section (assets/docs.js). Dark by default with a
   light theme toggle (assets/docs-theme.js sets html[data-theme] before paint).
   Type matches the landing page: Figtree (styles.css) for text, the system
   monospace stack for code. Code colours come from build-time Shiki classes
   (scripts/highlight-docs.mjs -> assets/docs-code.css). */


/* ── Theme tokens ── */
:root {
  /* The site's ink ramp (styles.css), with green as the only accent. */
  --d-bg: #15181f;
  --d-surface: #1c2029;
  --d-surface-2: #262b35;
  --d-text: #e4e7ed;
  --d-text-soft: #c3c8d3;
  --d-muted: #9ba2b1;
  --d-border: rgba(238, 240, 245, .09);
  --d-link: #3fb950;
  --d-accent: #3fb950;
  --d-code-bg: #111419;
  --d-inline-code-bg: rgba(238, 240, 245, .08);
  --d-prompt: #3fb950;
  --d-nav-bg: rgba(21, 24, 31, .88);
  --d-active-bg: #262b35;
  --sans: 'Figtree', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --nav-h: 61px;
  color-scheme: dark;
}
html[data-theme="light"] {
  --d-bg: #ffffff;
  --d-surface: #f5f7fa;
  --d-surface-2: #eceff4;
  --d-text: #111827;
  --d-text-soft: #2e3644;
  --d-muted: #5b6475;
  --d-border: rgba(17, 24, 39, .1);
  --d-link: #1a7a35;
  --d-accent: #1a7a35;
  --d-code-bg: #f5f7fa;
  --d-inline-code-bg: rgba(17, 24, 39, .06);
  --d-prompt: #1a7a35;
  --d-nav-bg: rgba(255, 255, 255, .9);
  --d-active-bg: #eceff4;
  color-scheme: light;
  /* Shared site tokens (styles.css), so the nav, footer and CTA follow too. */
  --bg-dark: #ffffff;
  --bg-mid: #f5f7fa;
  --bg-raised: #eceff4;
  --text: #111827;
  --text-2: #2e3644;
  --text-muted: #5b6475;
  --border: rgba(17, 24, 39, .1);
  --border-strong: rgba(17, 24, 39, .18);
  --link: #1a7a35;
  --btn-bg: #111827;
  --btn-bg-h: #000000;
  --btn-fg: #ffffff;
}

body.docs { background: var(--d-bg); color: var(--d-text); }
body.docs > nav { background: var(--d-nav-bg); border-bottom-color: var(--d-border); }
html[data-theme="light"] body.docs > nav .logo img { filter: none; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Theme toggle + GitHub link in the top nav */
.theme-toggle {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  border: 1px solid var(--d-border); border-radius: 8px; background: transparent;
  color: var(--d-muted); cursor: pointer; transition: color .15s ease-out, background-color .15s ease-out;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { color: var(--d-text); background: var(--d-surface); }
.theme-toggle:active { transform: scale(.96); }
.theme-toggle svg { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-moon { display: none; }
html[data-theme="light"] .theme-toggle .icon-sun { display: none; }
html[data-theme="light"] .theme-toggle .icon-moon { display: block; }
body.docs .nav-links { flex-direction: row; align-items: center; }
body.docs .nav-links .nav-cta { order: 3; }
body.docs .nav-links .theme-toggle { order: 4; }
body.docs .nav-link { color: var(--d-muted); }
body.docs .nav-link:hover, body.docs .nav-link[aria-current] { color: var(--d-text); }
body.docs :focus-visible { outline: 2px solid var(--d-accent); outline-offset: 2px; border-radius: 4px; }

/* ── Layout ── */
.docs-layout {
  max-width: 1440px; margin: 0 auto; padding: 0 32px;
  display: grid; gap: 56px;
  grid-template-columns: 248px minmax(0, 46rem) 200px;
  justify-content: center;
}
.docs-main { padding: 48px 0 96px; max-width: none; margin: 0; min-width: 0; }

/* Left: grouped section nav */
.docs-sidebar {
  position: sticky; top: var(--nav-h); align-self: start;
  max-height: calc(100vh - var(--nav-h)); overflow-y: auto; overscroll-behavior: contain;
  padding: 40px 8px 48px 0; font-size: .875rem; line-height: 1.45;
  scrollbar-width: thin; scrollbar-color: var(--d-border) transparent;
}
.docs-menu > summary { display: none; }
@supports selector(::details-content) {
  @media (min-width: 961px) { .docs-menu::details-content { content-visibility: visible; display: block; } }
}
.nav-caption {
  font-size: .8125rem; font-weight: 500; color: var(--d-muted);
  margin: 24px 0 8px; padding-left: 12px;
}
.docs-menu-body > .nav-caption:first-child { margin-top: 0; }
.docs-sidebar ul { list-style: none; padding: 0; margin: 0; }
.docs-sidebar li { margin: 0; }
.docs-sidebar a {
  display: block; padding: 6px 12px; border-radius: 6px; color: var(--d-text-soft);
  transition: color .12s ease-out, background-color .12s ease-out;
}
.docs-sidebar a:hover { color: var(--d-text); background: var(--d-surface); text-decoration: none; }
.docs-sidebar a[aria-current] { color: var(--d-text); background: var(--d-active-bg); font-weight: 500; box-shadow: inset 2px 0 0 var(--d-accent); }
.docs-sidebar code { font-size: .92em; background: none; padding: 0; }
/* Sub-sections: shown for the current section only (with JS), indented on a rule. */
.docs-sidebar li > ul { display: none; margin: 2px 0 6px 14px; padding-left: 8px; border-left: 1px solid var(--d-border); }
.docs-sidebar li.is-open > ul { display: block; }
.docs-sidebar li > ul a { padding: 3px 10px; font-size: .8125rem; color: var(--d-muted); }
.docs-sidebar li > ul a[aria-current] { background: none; box-shadow: none; color: var(--d-text); font-weight: 500; }

/* Right: "on this page" rail for the current section */
.docs-rail {
  position: sticky; top: var(--nav-h); align-self: start;
  max-height: calc(100vh - var(--nav-h)); overflow-y: auto;
  padding: 40px 0 48px; font-size: .8125rem; line-height: 1.45;
}
.docs-rail .nav-caption { padding-left: 0; margin-top: 0; }
.docs-rail-list { list-style: none; padding: 0; margin: 0 0 16px; border-left: 1px solid var(--d-border); }
.docs-rail-list li { margin: 0; }
.docs-rail-list a {
  display: block; padding: 4px 0 4px 12px; margin-left: -1px; border-left: 2px solid transparent;
  color: var(--d-muted);
}
.docs-rail-list a:hover { color: var(--d-text); text-decoration: none; }
.docs-rail-list a[aria-current] { color: var(--d-text); border-left-color: var(--d-accent); }
.docs-rail-list .rail-section { color: var(--d-text-soft); font-weight: 500; }
.docs-rail-list code { font-size: .92em; background: none; padding: 0; }
.docs-rail-top { color: var(--d-muted); font-size: .8125rem; }

/* ── Article typography ── */
.docs-main, .docs-main p, .docs-main li {
  font-family: var(--sans);
}
.docs-main { font-size: 1.0625rem; line-height: 1.7; color: var(--d-text-soft); }
.docs-main p, .docs-main li { color: var(--d-text-soft); margin-bottom: 14px; text-wrap: pretty; }
.docs-main li { margin-bottom: 8px; }
.docs-main li > ul, .docs-main li > ol { margin-top: 8px; }
.docs-main ul, .docs-main ol { padding-left: 1.4em; margin-bottom: 16px; }
.docs-main li::marker { color: var(--d-muted); }
.docs-main strong { color: var(--d-text); font-weight: 600; }
.docs-main .lead strong { font-weight: inherit; }
.docs-main a { color: var(--d-link); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--d-link) 35%, transparent); text-underline-offset: 3px; }
.docs-main a:hover { text-decoration-color: currentColor; }

.docs-main h1, .docs-main h2, .docs-main h3, .docs-main h4 {
  font-family: var(--sans); color: var(--d-text); text-wrap: balance;
  scroll-margin-top: calc(var(--nav-h) + 20px); position: relative;
}
.docs-main h1 { font-size: clamp(2rem, 4.5vw, 2.75rem); font-weight: 600; line-height: 1.12; letter-spacing: -.02em; margin: 8px 0 16px; }
.docs-main h2 { font-size: 1.75rem; font-weight: 600; line-height: 1.2; letter-spacing: -.015em; margin: 0 0 16px; }
.docs-main h3 { font-size: 1.25rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; margin: 40px 0 12px; }
.docs-main h4 { font-size: 1.0625rem; font-weight: 600; margin: 28px 0 12px; }
.docs-main h2 code, .docs-main h3 code { font-size: .78em; }
.heading-anchor {
  margin-left: .35em; color: var(--d-muted) !important; text-decoration: none !important;
  font-weight: 400; opacity: 0; transition: opacity .12s ease-out;
}
:is(h2, h3, h4):hover > .heading-anchor, .heading-anchor:focus-visible { opacity: 1; }

.docs-main .lead { font-size: 1.1875rem; line-height: 1.6; color: var(--d-text); margin-bottom: 32px; }
.docs-main .breadcrumbs, .docs-main .breadcrumbs * { font-family: inherit; }
.docs-main .breadcrumbs { font-family: var(--sans); font-size: .8125rem; margin-bottom: 20px; }
.docs-main .breadcrumbs a { text-decoration: none; }

/* Sections: separated by space and a hairline, not boxes. */
.doc-section { padding: 48px 0 8px; border-top: 1px solid var(--d-border); scroll-margin-top: var(--nav-h); }
.docs-group-label + .doc-section { border-top: 0; padding-top: 4px; }
.docs-group-label {
  font-family: var(--sans) !important;
  font-size: .875rem !important; font-weight: 500;
  color: var(--d-muted) !important; margin: 72px 0 12px !important; padding-top: 28px;
  border-top: 1px solid var(--d-border); scroll-margin-top: var(--nav-h);
}

/* "Start here" cards */
.docs-cards {
  list-style: none; padding: 0 !important; margin: 32px 0 0 !important;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
}
.docs-cards li { margin: 0 !important; }
.docs-cards a {
  display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 16px 20px;
  border: 1px solid var(--d-border); border-radius: 10px; background: var(--d-surface);
  text-decoration: none !important; transition: border-color .15s ease-out, background-color .15s ease-out;
}
.docs-cards a:hover { border-color: color-mix(in srgb, var(--d-text) 22%, transparent); background: var(--d-surface-2); }
.docs-cards a:active { transform: scale(.98); }
.card-kicker { font-family: var(--sans); font-size: .8125rem; font-weight: 500; color: var(--d-muted); }
.card-title { font-family: var(--sans); font-size: 1rem; font-weight: 500; color: var(--d-text); }

/* Inline code */
.docs-main code, .docs-sidebar code, .docs-rail code { font-family: var(--mono); }
.docs-main :not(pre) > code {
  font-size: .86em; padding: .1em .35em; border-radius: 5px;
  background: var(--d-inline-code-bg); color: var(--d-text); overflow-wrap: anywhere;
  font-variant-ligatures: none;
}
.docs-main a > code { color: inherit; }

/* Tables */
.docs-main .table-wrap { border-color: var(--d-border); border-radius: 10px; margin: 8px 0 22px; }
.docs-main table { font-family: var(--sans); font-size: .875rem; font-variant-numeric: tabular-nums; }
.docs-main th, .docs-main td { color: var(--d-text-soft); border-bottom-color: var(--d-border); padding: 10px 14px; }
.docs-main thead th { background: var(--d-surface); color: var(--d-text); font-weight: 600; }
.docs-main td code { font-size: .86em; }
/* Flag / key names in the first column never break mid-word; wide tables scroll. */
.docs-main td:first-child { white-space: nowrap; }
.docs-main td:first-child code { overflow-wrap: normal; }

/* Callouts */
.docs-main .callout {
  font-family: var(--sans); border-radius: 10px; padding: 16px 20px; margin: 16px 0 24px;
  background: var(--d-surface);
  border: 1px solid var(--d-border); box-shadow: inset 2px 0 0 var(--d-muted);
}
.docs-main .callout-warning {
  background: color-mix(in srgb, #d29922 9%, transparent);
  border-color: color-mix(in srgb, #d29922 45%, transparent);
}
.docs-main .callout p:last-child { margin-bottom: 0; }

/* ── Code blocks (figure > figcaption + pre.shiki) ── */
.code-block {
  margin: 12px 0 24px; border: 1px solid var(--d-border); border-radius: 10px;
  background: var(--d-code-bg); overflow: hidden;
}
.code-block figcaption {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--d-border);
  background: var(--d-surface); font-family: var(--sans);
}
.code-label {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0;
  font-family: var(--mono); font-size: .75rem; color: var(--d-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.code-label::before {
  content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--d-border);
}
.code-block[data-lang="bash"] .code-label::before,
.code-block[data-lang="powershell"] .code-label::before { background: var(--d-prompt); }
.code-block[data-lang="yaml"] .code-label::before,
.code-block[data-lang="json"] .code-label::before,
.code-block[data-lang="dotenv"] .code-label::before { background: var(--d-muted); }
.code-copy {
  flex: none; min-height: 28px; padding: 3px 10px; border-radius: 6px;
  border: 1px solid transparent; background: transparent; color: var(--d-muted);
  font: 500 .75rem/1 var(--sans); cursor: pointer;
  transition: color .12s ease-out, background-color .12s ease-out, border-color .12s ease-out;
}
.code-copy:hover { color: var(--d-text); background: var(--d-surface-2); border-color: var(--d-border); }
.code-copy:active { transform: scale(.96); }
.code-copy[data-copied] { color: var(--d-accent); }
.code-copy[hidden] { display: none; }

.docs-main pre.shiki, .docs-main .cta-box pre.shiki {
  margin: 0; padding: 14px 18px 16px; border: 0; border-radius: 0;
  background: transparent; overflow-x: auto; tab-size: 2;
  font-family: var(--mono); font-size: .8125rem; line-height: 1.7;
  font-variant-ligatures: none;
}
.docs-main pre.shiki code { font-family: inherit; font-size: inherit; background: none; padding: 0; color: inherit; }
.shiki .line { display: inline-block; min-width: 100%; }
.shiki .line.cmd::before {
  content: "$ "; color: var(--d-prompt); user-select: none; -webkit-user-select: none;
}
.shiki span { color: var(--shiki-dark); font-style: var(--shiki-dark-font-style); font-weight: var(--shiki-dark-font-weight); }
html[data-theme="light"] .shiki span { color: var(--shiki-light); font-style: var(--shiki-light-font-style); font-weight: var(--shiki-light-font-weight); }
.code-block[data-lang="text"] .shiki span { color: var(--d-text-soft); }

/* CTA at the end of the page */
.docs-main .cta-box { background: var(--d-surface); border-color: var(--d-border); border-radius: 12px; margin-top: 72px; }
.docs-main .cta-box h2 { font-size: 1.5rem; }
.docs-main .cta-box .code-block { margin-bottom: 18px; }
/* `.docs-main a` would paint the buttons in link green; keep button ink. */
.docs-main .cta-box .btn-primary { color: var(--btn-fg); text-decoration: none; font-family: var(--sans); }
.docs-main .cta-box .btn-secondary { color: var(--d-text); text-decoration-color: var(--border-strong); font-family: var(--sans); }
.docs-main .cta-box .btn-secondary:hover { text-decoration-color: currentColor; }

/* Footer in light mode */
html[data-theme="light"] .site-footer { border-top: 1px solid var(--d-border); }

/* ── Responsive ── */
@media (max-width: 1279px) {
  .docs-layout { grid-template-columns: 236px minmax(0, 46rem); gap: 48px; }
  .docs-rail { display: none; }
}
@media (max-width: 960px) {
  .docs-layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0 16px; }
  .docs-sidebar {
    position: sticky; top: var(--nav-h); z-index: 50; max-height: none; overflow: visible;
    margin: 0 -16px; padding: 0; background: var(--d-nav-bg); border-bottom: 1px solid var(--d-border);
    backdrop-filter: blur(8px);
  }
  .docs-menu > summary {
    display: flex; align-items: center; justify-content: space-between;
    min-height: 44px; padding: 0 16px; cursor: pointer; list-style: none;
    font-weight: 600; font-size: .875rem; color: var(--d-text);
  }
  .docs-menu > summary::-webkit-details-marker { display: none; }
  .docs-menu > summary::after { content: "+"; color: var(--d-muted); font-weight: 400; font-size: 1.1rem; }
  .docs-menu[open] > summary::after { content: "–"; }
  .docs-menu-body {
    max-height: calc(100vh - var(--nav-h) - 44px); overflow-y: auto; overscroll-behavior: contain;
    padding: 4px 8px 20px; border-top: 1px solid var(--d-border); background: var(--d-bg);
  }
  .docs-main { padding-top: 28px; }
  .doc-section, .docs-main h2, .docs-main h3, .docs-group-label { scroll-margin-top: calc(var(--nav-h) + 56px); }
}
@media (max-width: 640px) {
  .docs-main { font-size: 1rem; }
  .docs-main .lead { font-size: 1.1rem; }
  .docs-main h2 { font-size: 1.5rem; }
  .docs-cards { grid-template-columns: minmax(0, 1fr); }
  body.docs .nav-github, body.docs .nav-link[aria-current] { display: none; }
  body.docs nav .nav-cta { white-space: nowrap; }
  .code-block { margin-left: -16px; margin-right: -16px; border-radius: 0; border-left: 0; border-right: 0; }
}

/* ── Docs hero: `secureci pin` (assets/pin-demo.js) ──
   One editor window with its terminal below, dark in both themes like a real
   editor. The markup is the finished state; the script rewinds and plays it
   once. Real words only on the subject: line 15, the command and its output.
   Everything else in the window is the file around it, in quiet ink. */
.pin-demo {
  --pd-bg: #101318; --pd-chrome: #171a21; --pd-line: rgba(238, 240, 245, .08);
  --pd-ink: #d5d9e2; --pd-ink-2: #9ba2b1; --pd-ink-3: #808797;
  --pd-green: #3fb950; --pd-info: #6cb6ff;
  --pd-mono: var(--mono);
  --pd-ease: cubic-bezier(0.23, 1, 0.32, 1);
  margin: 0 0 32px; container-type: inline-size;
  font-variant-ligatures: none;
}
.pd-window {
  background: var(--pd-bg); color: var(--pd-ink);
  border: 1px solid rgba(238, 240, 245, .12); border-radius: 12px; overflow: hidden;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 24px 48px -28px rgba(0, 0, 0, .7);
  font: 400 12.5px/20px var(--pd-mono);
}
html[data-theme="light"] .pd-window { border-color: rgba(17, 24, 39, .14); box-shadow: 0 24px 48px -28px rgba(17, 24, 39, .45); }
.pd-bar {
  display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 14px;
  background: var(--pd-chrome); border-bottom: 1px solid var(--pd-line);
  font-size: 12px; color: var(--pd-ink-2); white-space: nowrap;
}
.pd-dots { display: inline-flex; gap: 6px; }
.pd-dots i { width: 10px; height: 10px; border-radius: 50%; background: #2c313b; }
.pd-tab { color: var(--pd-ink); overflow: hidden; text-overflow: ellipsis; }
.pd-repo { margin-left: auto; }

/* Editor */
.pd-editor { padding: 12px 0; }
.pd-line { position: relative; display: flex; padding-right: 16px; white-space: pre; }
.pd-n { flex: none; width: 48px; padding-right: 16px; text-align: right; color: var(--pd-ink-3); user-select: none; }
.pd-code { color: var(--pd-ink-2); min-width: 0; }
.pd-code .k { color: var(--pd-ink-2); }
.pd-code .v { color: var(--pd-ink-2); }
.pd-code .c { color: var(--pd-ink-3); }
/* Line 15, the subject: brighter ink, and once pinned a changed-line bar in
   the gutter and a soft green row, the way an editor marks a modified line. */
.pd-target .pd-code, .pd-target .pd-code .k, .pd-target .pd-code .v { color: var(--pd-ink); }
.pd-target .pd-n { color: var(--pd-ink-2); }
.pd-target::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: rgba(63, 185, 80, .1); opacity: 0;
  transition: opacity .5s var(--pd-ease);
}
.pd-target::after {
  content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 3px;
  background: var(--pd-green); border-radius: 0 2px 2px 0;
  transform: scaleY(0); transition: transform .35s var(--pd-ease);
}
.pd-target > * { position: relative; z-index: 1; }
.pin-demo[data-state="done"] .pd-target::before { opacity: 1; }
.pin-demo[data-state="done"] .pd-target::after { transform: none; }
/* The ref: `v4` leaves upward, the SHA wipes in from the left. */
.pd-ref { display: inline-grid; }
.pd-ref > span { grid-area: 1 / 1; }
.pd-ref-old { transition: opacity .18s ease-out, transform .18s ease-out, filter .18s ease-out; }
.pd-ref-new { clip-path: inset(0 100% 0 0); transition: clip-path .55s var(--pd-ease) .08s; }
.pin-demo[data-state="done"] .pd-ref-old { opacity: 0; transform: translateY(-6px); filter: blur(2px); }
.pin-demo[data-state="done"] .pd-ref-new { clip-path: inset(0 0 0 0); }
.pd-sha { color: var(--pd-green); }

/* Terminal */
.pd-term { border-top: 1px solid var(--pd-line); background: var(--pd-bg); }
.pd-term-head {
  display: flex; align-items: center; justify-content: space-between; height: 32px; padding: 0 16px;
  background: var(--pd-chrome); border-bottom: 1px solid var(--pd-line);
  font: 500 12px/1 var(--sans); color: var(--pd-ink-2);
}
.pd-replay {
  appearance: none; border: 0; background: none; cursor: pointer; padding: 4px 0;
  font: 500 12px/1 var(--sans); color: var(--pd-ink-2);
}
.pd-replay:hover { color: var(--pd-ink); }
.pd-replay[hidden] { display: none; }
.pd-out { padding: 12px 16px 16px; min-height: calc(5 * 20px + 28px); }
.pd-o { white-space: pre-wrap; overflow-wrap: anywhere; }
.pd-ps { color: var(--pd-green); }
.pd-typed { color: #f4f5f8; font-weight: 500; }
.pd-muted { color: var(--pd-ink-2); }
.pd-info { color: var(--pd-info); }
.pd-ok { color: var(--pd-green); }
.pd-caret { display: none; }
.pin-demo[data-state="start"] .pd-caret, .pin-demo[data-state="typing"] .pd-caret {
  display: inline-block; width: .6em; height: 15px; margin-left: 1px; vertical-align: -3px;
  background: var(--pd-ink); border-radius: 1px;
}
.pin-demo[data-state="start"] .pd-caret { animation: pd-blink 1.1s steps(1, end) infinite; }
@keyframes pd-blink { 50% { opacity: 0; } }
/* Output lines: present in the layout from the start so nothing reflows. */
.pin-demo:not([data-state="done"]) .pd-o:not(.pd-cmd) { opacity: 0; transform: translateY(4px); }
.pin-demo .pd-o:not(.pd-cmd) { transition: opacity .2s var(--pd-ease), transform .2s var(--pd-ease); }
.pin-demo .pd-o.is-in { opacity: 1; transform: none; }

.pin-demo figcaption {
  margin-top: 12px; font-size: .875rem; line-height: 1.5; color: var(--d-muted); max-width: 40rem;
}
.pin-demo figcaption code { font-size: .86em; }

/* Compact: a second composition for narrow columns. The file is scrolled to
   the step, the long pinned line soft-wraps as an editor would, and the
   terminal drops the file path it already shows in the tab. */
@container (max-width: 620px) {
  .pd-window { font-size: 11.5px; line-height: 18px; }
  .pd-far { display: none; }
  .pd-repo { display: none; }
  .pd-n { width: 36px; padding-right: 12px; }
  .pd-line { white-space: pre-wrap; }
  .pd-code { flex: 1; word-break: break-all; }
  .pd-ref { display: inline; }
  .pd-ref > span { display: inline; }
  .pin-demo[data-state="done"] .pd-ref-old { display: none; }
  .pin-demo:not([data-state="done"]) .pd-ref-new { display: none; }
  .pin-demo .pd-ref-new, .pin-demo[data-state="done"] .pd-ref-new { clip-path: none; transition: none; }
  .pd-out { padding: 12px; min-height: calc(7 * 18px + 24px); }
}
@container (max-width: 620px) {
  .pin-demo[data-state="done"] .pd-ref-new { animation: pd-in .4s var(--pd-ease); }
}
@keyframes pd-in { from { opacity: 0; } }
