/* ══════════════════════════════════════════════════════════════════
   Abit's pages inside claudiopietronik.com.
   The website's stylesheet comes first and gives the shell, the tokens
   (deep space by default, ice on the toggle), the type and the buttons.
   This sheet styles only Abit's own content, in those tokens and the
   website's colours (no pink: the owner's call). Only the module families
   keep their own colours, the ones the instrument gives them.
   ══════════════════════════════════════════════════════════════════ */

/* ── The few tokens the website does not define ─────────────────── */
.abit-doc main, .abit-bar {
  --abit-glow: color-mix(in srgb, var(--accent) 24%, transparent);
  --shot-bg: #070A14;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow: 0 6px 22px rgba(0, 0, 0, .4);
  --rule: var(--border);
  --ink: var(--fg);
  --card: var(--elevated);
  --bar-h: 116px;              /* the website's bar and Abit's row, for sticky offsets */
}
:root[data-theme="light"] .abit-doc main, :root[data-theme="light"] .abit-bar {
  --abit-glow: color-mix(in srgb, var(--accent) 14%, transparent);
  --shot-bg: #0B1020;
  --shadow-sm: 0 1px 2px rgba(10, 16, 34, .08);
  --shadow: 0 6px 22px rgba(10, 16, 34, .10);
}
.abit-doc main a:not(.btn):not(.card):not(.rail-link) { color: var(--accent); }
.abit-doc main a:not(.btn):not(.card):not(.rail-link):hover { color: var(--accent-hover); }

/* ── Abit's row under the website's bar ─────────────────────────── */
.abit-bar {
  position: sticky; top: var(--bar-h-site, 64px); z-index: 40;
  background: var(--bar-bg); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.abit-bar-in { display: flex; align-items: center; gap: 22px; height: 52px; }
.abit-word { display: flex; align-items: center; }
.abit-word span { font-family: var(--display); font-weight: 800; font-size: 17px; letter-spacing: .02em; color: var(--fg); text-transform: uppercase; }
.abit-word:hover span { color: var(--accent); }
.abit-links { display: flex; gap: 4px; margin-left: auto; }
.abit-links a {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px;
  color: var(--muted); font-size: 14px; font-weight: 650; transition: color .2s, background .2s;
}
.abit-links a:hover { color: var(--fg); background: var(--subtle); }
.abit-links a.on { color: var(--fg); background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); }
.abit-links a span { font-family: var(--mono); font-size: 11px; color: var(--accent); }
@media (max-width: 520px) { .abit-bar-in { gap: 10px; } .abit-links a { padding: 7px 9px; font-size: 13.5px; } .abit-links a span { display: none; } }

/* ── Page heads: the website's type, Abit's glow ─────────────────── */
.abit-doc main { position: relative; }
.abit-doc main::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 520px; pointer-events: none; z-index: -1;
  background: radial-gradient(60% 70% at 78% 0%, var(--abit-glow), transparent 70%),
              radial-gradient(40% 50% at 8% 10%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 70%);
}
.doc-head { padding-top: 54px; padding-bottom: 30px; }   /* not the shorthand: it would take the .wrap gutter away */
.doc-head h1 { font-family: var(--display); font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 800; line-height: 1.02; letter-spacing: -.02em; margin: 8px 0 18px; }
.doc-head .lede { color: var(--muted); font-size: clamp(1.05rem, 1.6vw, 1.22rem); max-width: 62ch; margin: 0; }
.doc-head .eyebrow { color: var(--accent); }
.abit-doc h2 { font-family: var(--display); font-weight: 700; letter-spacing: -.015em; }
.abit-doc .section-head { display: block; }
.doc-h2 { font-size: clamp(1.35rem, 2.2vw, 1.7rem); margin: 2.4em 0 .7em; scroll-margin-top: calc(var(--bar-h) + 16px); }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--faint); }
.crumbs a { color: var(--muted) !important; }
.crumbs a:hover { color: var(--fg) !important; }
.crumbs b { color: var(--fg); font-weight: 650; }
.doc-pager { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--border); }
.doc-pager .btn-primary { margin-left: auto; }

/* ── Motion: what rises into view, what leans toward the pointer ──── */
.rise { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.rise.in { opacity: 1; transform: none; }
.tilt { transition: transform .5s var(--ease), box-shadow .5s var(--ease); transform-style: preserve-3d; will-change: transform; }
.tilt.leaning { transition: transform .12s linear, box-shadow .5s var(--ease); }
@keyframes abit-float { 0%, 100% { transform: translateY(0) rotate(-.4deg); } 50% { transform: translateY(-10px) rotate(.4deg); } }
@keyframes abit-breathe { 0%, 100% { opacity: .55; transform: scale(1); } 50% { opacity: .9; transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) {
  .rise { opacity: 1; transform: none; transition: none; }
  .tilt { transition: none; }
}

/* ── Shared layout ──────────────────────────────────────────────── */
h1, h2, h3 { letter-spacing: -.015em; text-wrap: balance; }
.section { padding: 72px 0; border-top: 1px solid var(--border); }
.section:first-of-type { border-top: 0; }
.section-head { max-width: var(--read); margin-bottom: 36px; }
.section-head h2 { font-size: clamp(26px, 3.2vw, 34px); margin: 0 0 12px; }
.section-head p { color: var(--muted); margin: 0; font-size: 17px; }


/* ── Figures ────────────────────────────────────────────────────────
   Nothing on this site is a window. A figure is either a PLATE — a
   rectangle cut out of an editor, given a radius, a bevelled rim and a
   shadow so it sits on the paper like a pressed panel — or a CUTOUT: an
   image whose own alpha is its silhouette (a module, a chain, a panel
   card), floating on its own shadow with no frame at all.
   The bevel is what does the work: a light inner edge along the top and
   a dark one along the bottom read as a lit object, not a capture.     */
.fig-frame {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  background: var(--shot-bg); box-shadow: var(--lift);
}
.fig-frame::after {                      /* the rim, over the pixels */
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.07),
    inset 0 1px 0 rgba(255,255,255,.14),
    inset 0 -1px 0 rgba(0,0,0,.55);
}
.fig-frame img { width: 100%; display: block; }

.cutout {                                /* alpha IS the shape */
  filter:
    drop-shadow(0 1px 1px rgba(0,0,0,.26))
    drop-shadow(0 9px 18px rgba(0,0,0,.17))
    drop-shadow(0 26px 44px rgba(0,0,0,.11));
}

/* A plate small enough that the rim would be noise — inside a card. */
.plated { border-radius: var(--radius); box-shadow: var(--shadow); }

.shot { display: block; }
/* A figure fills the column when it is WIDE, and is capped when it is TALL.
   `width: 100%` alone stretched a 1358x1552 crop to the full column and made it
   a screen and a half high, next to strips a few hundred pixels tall — the page
   lost its rhythm and the tall one read as a mistake. Capping the height and
   centring keeps every figure in the same visual weight class. */
.shot img {
  display: block; margin: 0 auto;
  max-width: 100%; width: auto;
  max-height: 620px; height: auto;
}
/* A figure that IS wide still fills the column: without this, one narrower than
   the column would sit at its natural size and look accidentally small. */
.shot img.wide { width: 100%; }
.shot figcaption {
  margin-top: 13px; font-size: 13.5px; line-height: 1.55; color: var(--muted);
  max-width: var(--read);
}
.shot figcaption b { color: var(--fg); font-weight: 600; }
.shot-wide { margin: 0 0 46px; }
/* Small figures stand next to each other and keep their own scale — a strip
   132 pixels wide has no business spanning a 1280-pixel column. */
.figrow {
  display: flex; flex-wrap: wrap; gap: 34px; align-items: flex-start;
  margin: 0 0 46px;
}
/* The picture keeps its own width; the caption is free to be wider than it,
   because a sentence squeezed into 132 pixels is a column of syllables. */
.shot-in-row { margin: 0; flex: 0 1 auto; min-width: 216px; max-width: 100%; }

/* A figure that is a COLUMN of interface — the clip inspector, the scene
   navigator — reads badly stacked: the picture is a narrow strip, so the row it
   occupies is mostly empty page, and its caption ends up a screen below the
   thing it describes. Side by side, the empty space becomes the text column and
   the two are read together. */
.shot-column {
  display: grid; grid-template-columns: minmax(0, auto) minmax(24ch, 1fr);
  gap: 30px; align-items: start;
}
/* A COLUMN of interface is as tall as the editor it was cut from, whatever is in
   it: the Grid's rail holds six icons and then four hundred pixels of empty rail.
   At full size that is a stripe running most of a screen with its sentence
   stranded beside it, and the page reads as a mistake rather than as a panel with
   room to spare. Capped, the strip stays legible and the caption sits at its top
   where the eye already is. */
.shot-column .fig-media img { max-height: 440px; width: auto; }
.shot-column figcaption { margin-top: 0; max-width: 52ch; }
@media (max-width: 720px) {
  .shot-column { grid-template-columns: 1fr; gap: 14px; }
}
/* The picture is as wide as it really is; only the sentence under it is capped,
   or a 130-pixel figure would drag its caption into a column of syllables while
   an 860-pixel one shrank to fit a limit meant for the small case. */
.shot-in-row figcaption { font-size: 13px; margin-top: 15px; max-width: 40ch; }
.fig-media { margin: 0; }
.shot-row { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-bottom: 46px; }
@media (max-width: 860px) { .shot-row { grid-template-columns: 1fr; } }

/* ── Cards ──────────────────────────────────────────────────────── */
.card-grid {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
}
.card {
  display: flex; flex-direction: column;
  background: var(--elevated); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  color: var(--fg); box-shadow: var(--shadow-sm);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.card:hover {
  transform: translateY(-3px); border-color: var(--accent);
  box-shadow: var(--shadow); color: var(--fg);
}
/* Panels are ~2:1 but not all alike, so CONTAIN them: a cropped panel hides
   the very thing the picture is for (its name, its edge jacks). */
.card-media { background: var(--subtle); aspect-ratio: 16 / 9; overflow: hidden; padding: 14px; }
.card-media img { width: 100%; height: 100%; object-fit: contain; }
/* Every card is the same size already — the aspect-ratio box sees to that. What
   was not the same was how much of it the picture used: `contain` fits the whole
   asset inside, so a 2.1-wide screenshot filled the width while a 1.7-wide one
   sat in the middle with air on both sides, and the cards read as different
   sizes. A PLATE is a rectangle cut out of the app, so it can fill the box and
   be cropped a little; a CUTOUT is an object floating on its own shadow, and
   cropping one would cut the object, so it keeps `contain` and its padding. */
.card-media:has(> img.plated) { padding: 0; }
.card-media img.plated { object-fit: cover; }
.card-media.empty {
  display: grid; place-items: center; color: var(--faint); font-size: 12.5px;
  background: var(--subtle);
}
/* Quick links with no thumbnail. Without a picture to lead with, the card has
   to earn its presence from type and air, and the arrow says "this goes
   somewhere" — visible always, not only on hover, because a touch screen has
   no hover to reveal it. */
.card-text .card-body { padding: 22px 22px 20px; }
.card-text h3 { display: flex; align-items: baseline; gap: 8px; }
.card-text h3::after {
  content: '→'; color: var(--accent); font-size: 15px;
  opacity: .55; transition: opacity .16s ease, transform .16s ease;
}
.card-text:hover h3::after { opacity: 1; transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) {
  .card-text:hover h3::after { transform: none; }
}

.card-body { padding: 18px 20px 20px; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { margin: 0 0 6px; font-size: 18px; }
.card-body p { margin: 0 0 14px; color: var(--muted); font-size: 14px; flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); background: var(--subtle);
  border: 1px solid var(--border); border-radius: 5px; padding: 3px 8px;
}
.chip.accent { color: var(--accent); background: var(--accent-soft); border-color: transparent; }

/* ── Catalog controls ───────────────────────────────────────────── */
.catalog-controls { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.search, .select {
  padding: 10px 14px; font: inherit; font-size: 14.5px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--elevated); color: var(--fg);
}
.search { min-width: 280px; flex: 1; max-width: 420px; }
.search::placeholder { color: var(--faint); }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.filter {
  font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--elevated);
  color: var(--muted); cursor: pointer;
}
.filter:hover { border-color: var(--accent); color: var(--accent); }
.filter.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.filter .n { opacity: .65; margin-left: 5px; font-variant-numeric: tabular-nums; }
.count-line { color: var(--faint); font-size: 13.5px; margin: 0 0 18px; }

/* ── Module page ────────────────────────────────────────────────── */
.mod-head {
  display: grid; grid-template-columns: 300px 1fr; gap: 40px;
  padding: 56px 0 40px; align-items: start;
}
@media (max-width: 860px) { .mod-head { grid-template-columns: 1fr; gap: 24px; } }
/* The panel PNG carries its own rounded corners in alpha, so it floats on the
   page: no frame, no dark rectangle, just the module. */
.mod-panel { padding: 0; }
.mod-panel.empty {
  display: grid; place-items: center; min-height: 300px;
  color: var(--faint); font-size: 13px; background: var(--subtle);
}
.mod-title h1 { font-size: clamp(30px, 4vw, 42px); margin: 6px 0 14px; }
.mod-title .lede { color: var(--muted); font-size: 17.5px; max-width: 60ch; margin: 0 0 20px; }

.spec { margin: 0 0 44px; }
.spec h2 {
  font-size: 13px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--faint); margin: 0 0 14px; font-weight: 600;
}
table.params {
  width: 100%; border-collapse: collapse; font-size: 14.5px;
  background: var(--elevated); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
table.params th {
  text-align: left; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint); font-weight: 600; padding: 10px 14px;
  background: var(--subtle); border-bottom: 1px solid var(--border);
}
table.params td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.params tr:last-child td { border-bottom: 0; }
table.params .pname { font-weight: 600; }
table.params .num { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
table.params .unit { color: var(--faint); font-size: 12.5px; }
.labels { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.labels span {
  font-size: 11.5px; padding: 2px 7px; border-radius: 4px;
  background: var(--subtle); border: 1px solid var(--border); color: var(--muted);
}
.section-title-row td {
  background: var(--subtle); font-size: 11.5px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--accent);
}

.ports { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 700px) { .ports { grid-template-columns: 1fr; } }
.port-list { list-style: none; margin: 0; padding: 0; }
.port-list li {
  display: flex; align-items: baseline; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--border); font-size: 14.5px;
}
.port-list li:last-child { border-bottom: 0; }
.port-list .pid { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.port-list .pnote { font-size: 12px; font-style: italic; color: var(--muted); }
.kind {
  font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 4px; margin-left: auto;
}
.kind-audio   { background: #E9F2FF; color: #1B5FBF; }
.kind-signal  { background: #FFF0E4; color: #B4671B; }
.kind-clock   { background: #EAF7EE; color: #1E7A44; }
.kind-context { background: #F3EBFF; color: #6B3FBF; }
.kind-trigger { background: #FFEAF3; color: #C42073; }
.kind-other   { background: var(--subtle); color: var(--muted); }
[data-theme="dark"] .kind-audio   { background: #16283F; color: #7FB4FF; }
[data-theme="dark"] .kind-signal  { background: #3A2712; color: #F0B168; }
[data-theme="dark"] .kind-clock   { background: #12301F; color: #6FD79B; }
[data-theme="dark"] .kind-context { background: #291B3F; color: #B994FF; }
[data-theme="dark"] .kind-trigger { background: #3A1228; color: #FF7FBB; }

/* ── Prose (guide sections) ─────────────────────────────────────── */
.prose { max-width: var(--read); }
.prose p { color: var(--muted); margin: 0 0 1.05em; }
.prose p strong, .prose li strong { color: var(--fg); font-weight: 600; }
.prose h3 { font-size: 20px; margin: 2em 0 .5em; }
.prose ul { padding-left: 1.25em; margin: 0 0 1.1em; color: var(--muted); }
.prose li { margin-bottom: .4em; }
.prose code {
  font-family: var(--mono); font-size: .84em; padding: 1px 6px;
  background: var(--subtle); border: 1px solid var(--border); border-radius: 5px;
  color: var(--fg);
}
.keycap {
  font-family: var(--mono); font-size: .82em; padding: 1px 7px;
  border: 1px solid var(--border-strong); border-bottom-width: 2px;
  border-radius: 6px; background: var(--elevated);
}
.callout {
  border-left: 3px solid var(--accent); background: var(--accent-soft);
  padding: 14px 18px; border-radius: 0 var(--radius) var(--radius) 0;
  margin: 0 0 1.4em; color: var(--fg); max-width: var(--read);
}
.callout p:last-child { margin-bottom: 0; }
.callout p { color: inherit; }

/* ── Steps (how-to sequences) ───────────────────────────────────── */
.steps { counter-reset: step; margin: 0 0 44px; }
.step {
  display: grid; grid-template-columns: 42px 1fr; gap: 18px;
  padding: 18px 0; border-bottom: 1px solid var(--border);
}
.step:last-child { border-bottom: 0; }
.step::before {
  counter-increment: step; content: counter(step);
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: #fff; font-weight: 600; font-size: 15px;
}
.step h4 { margin: 4px 0 6px; font-size: 17px; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }

/* ── Local nav (in-page section list) ───────────────────────────── */
.toc {
  position: sticky; top: calc(var(--bar-h) + 20px);
  align-self: start; font-size: 14px;
}
.toc a { display: block; padding: 5px 0; color: var(--muted); }
.toc a:hover, .toc a.on { color: var(--accent); }
.with-toc { display: grid; grid-template-columns: 200px 1fr; gap: 52px; }
@media (max-width: 980px) { .with-toc { grid-template-columns: 1fr; } .toc { display: none; } }

/* ── CODE reference ─────────────────────────────────────────────── */
.fn {
  border-left: 2px solid var(--border-strong);
  padding: 2px 0 2px 16px; margin: 0 0 18px;
  max-width: var(--read);
}
.fn:hover { border-left-color: var(--accent); }
.fn-sig {
  display: inline-block; font-family: var(--mono); font-size: 13.5px;
  background: var(--subtle); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 10px; color: var(--fg);
}
.fn-desc { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.fn-ex {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.55;
  background: var(--shot-bg); color: #C9D3E6;
  border-radius: var(--radius); padding: 12px 14px; margin: 10px 0 0;
  overflow-x: auto; border: 1px solid var(--border);
}
[data-theme="dark"] .fn-ex { background: #0B0D12; }

.rail-toc .railnum {
  font-style: normal; font-size: 10px; font-weight: 700; color: var(--faint);
  margin-right: 7px; font-variant-numeric: tabular-nums;
}

/* ── The manual bar (Code's module page) ────────────────────────────
   A module whose documentation is a manual needs a way IN that sits with its
   name, not two screens below it. Tabs in look, anchors in fact: they move you
   down the page the module already owns rather than to another one. */
.manualbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--border);
}
.manualbar-h {
  font-size: 10.5px; font-weight: 700; letter-spacing: .15em;
  text-transform: uppercase; color: var(--faint); margin-right: 6px;
}
.manualbar a {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 7px 13px; border-radius: 8px; font-size: 14px; font-weight: 600;
  color: var(--fg); background: var(--subtle); border: 1px solid var(--border);
}
.manualbar a:hover { border-color: var(--accent); color: var(--accent); }
.manualbar a em {
  font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.manualbar a:hover em { color: var(--accent); }

/* ── CODE: snippets and the patch library ───────────────────────────
   Both are CODE first and prose second, so the block is the object and the
   title sits on it like a label rather than above it like a heading. They
   auto-fill: on a wide page three programs sit side by side and are still
   read one at a time, because each one is a complete thought. */
.snipgrid, .patchgrid {
  display: grid; gap: 16px; margin: 0 0 10px;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}
.snip, .patch { margin: 0; min-width: 0; }
.snip figcaption, .patch figcaption {
  display: flex; flex-direction: column; gap: 2px;
  font-size: 14px; font-weight: 600; color: var(--fg); margin: 0 0 7px;
}
.patch figcaption span { font-weight: 400; font-size: 13px; color: var(--muted); }
.snip .fn-ex, .patch .fn-ex { margin: 0; white-space: pre; }
/* A section title inside a reference block — smaller than the tab it lives in. */
.fn-sec {
  font-size: 15px; margin: 1.8em 0 .5em; color: var(--fg);
  font-weight: 600;
}

/* ── Usage examples ─────────────────────────────────────────────── */
.example { margin: 0 0 26px; }
.example img { width: 100%; }
.example figcaption { margin-top: 14px; max-width: var(--read); }
.example figcaption p { margin: 8px 0 0; color: var(--muted); font-size: 14.5px; }
.chainline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13.5px; }
.chainline .link {
  border: 1px solid var(--border-strong); border-radius: 999px;
  padding: 3px 11px; color: var(--muted); font-weight: 600;
}
.chainline .link:hover { border-color: var(--accent); color: var(--accent); }
.chainline .link.star { background: var(--accent); border-color: var(--accent); color: #fff; }
.chainline .arrow { color: var(--faint); }

/* ── Panel cards (a generator/transformer, shown and explained) ────
   Thirty of these run down a page. One per row wasted the right half of
   the column on nothing, so they pair up: two cards across, each still a
   picture beside its text. Below 1080px they go back to one across, and
   below 640 the picture stacks over the words. */
.panelgrid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px;
  margin: 8px 0 12px;
}
@media (max-width: 1080px) { .panelgrid { grid-template-columns: 1fr; } }
.panelcard {
  display: grid; grid-template-columns: 220px 1fr; gap: 20px;
  align-items: start; padding: 22px 0; border-top: 1px solid var(--border);
}
/* Only the first card of each column loses its rule, or the two columns
   start at different heights. */
.panelgrid > .panelcard:nth-child(1),
.panelgrid > .panelcard:nth-child(2) { border-top: 0; padding-top: 0; }
@media (max-width: 1080px) { .panelgrid > .panelcard:nth-child(2) { border-top: 1px solid var(--border); padding-top: 22px; } }
@media (max-width: 640px) { .panelcard { grid-template-columns: 1fr; gap: 14px; } }
/* A card on its own is not in the grid, so it keeps the full column and a
   bigger picture: pairing is for runs, not for singles. */
.panelcard-solo { grid-template-columns: 300px 1fr; gap: 26px; border-top: 0; }
.panelcard-solo .panelcard-img img { max-width: 300px; }
.panelcard-solo .panelcard-body p { font-size: 15.5px; max-width: 62ch; }
.panelcard-img img { width: 100%; max-width: 220px; }
.panelcard-body h4 { margin: 0 0 8px; font-size: 17.5px; letter-spacing: -.01em; }
.panelcard-body p { margin: 0 0 12px; color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.paramchips { display: flex; flex-wrap: wrap; gap: 6px; }
.paramchips code {
  font-family: var(--mono); font-size: 11.5px; padding: 3px 9px;
  background: var(--subtle); border: 1px solid var(--border);
  border-radius: 999px; color: var(--muted);
}

/* The parameter's id beside the words the app shows for it: the words are what
   you look for, the id is what a plan or a preset file will say. */
.pid-inline {
  font-family: var(--mono); font-size: 11px; color: var(--faint);
  margin-left: 8px; padding: 1px 6px; background: var(--subtle);
  border-radius: 4px; white-space: nowrap;
}

/* The parameter's own sentence, under its name. The reference is the manual:
   a range tells you what a control may be, this tells you what it is for. */
.pdoc {
  margin: 6px 0 2px; max-width: 62ch;
  color: var(--muted); font-size: 14px; line-height: 1.6;
}
.params td.pname { padding-top: 12px; padding-bottom: 12px; vertical-align: top; }

/* ── The left rail ──────────────────────────────────────────────── */
.with-rail {
  display: grid; grid-template-columns: 248px minmax(0, 1fr);
  gap: 56px; padding-top: 30px; align-items: start;
}
.rail {
  position: sticky; top: calc(var(--bar-h) + 22px);
  max-height: calc(100vh - var(--bar-h) - 44px); overflow-y: auto;
  padding-right: 6px; font-size: 14px; scrollbar-width: thin;
}
.rail-h {
  margin: 0 0 9px; font-size: 10.5px; font-weight: 600; letter-spacing: .15em;
  text-transform: uppercase; color: var(--faint);
}
.rail-list { display: flex; flex-direction: column; gap: 1px; }
.rail-list a {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px; border-radius: 7px; color: var(--muted); line-height: 1.35;
}
.rail-list a:hover { background: var(--subtle); color: var(--fg); }
.rail-list a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.rail-fam i { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.rail-toc a {
  font-size: 13px; padding-left: 11px; border-left: 2px solid var(--border);
  border-radius: 0 6px 6px 0;
}
.rail-toc a.on { border-left-color: var(--accent); background: none; }
.rail-back { display: inline-block; margin-top: 16px; font-size: 13px; font-weight: 600; }
@media (max-width: 1080px) {
  .with-rail { grid-template-columns: 1fr; gap: 0; }
  .rail { position: static; max-height: none; overflow: visible; }
  .nav-rail { display: none; }
  .filter-rail { margin-bottom: 26px; }
}

.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--faint); margin: 0 0 4px;
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs b { color: var(--faint); font-weight: 600; }
.crumbs span { opacity: .5; }

/* ── Catalog: the shelf, in drawers ─────────────────────────────── */
.facet-search {
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
  padding: 7px 11px; border: 1px solid var(--border-strong);
  border-radius: 9px; background: var(--elevated); color: var(--faint);
}
.facet-search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: none;
  color: var(--fg); font: inherit; font-size: 13.5px;
}
.facet-search:focus-within { border-color: var(--accent); }

.drawer { margin-bottom: 6px; }
.drawer summary {
  display: flex; align-items: center; gap: 7px; cursor: pointer; list-style: none;
  padding: 6px 8px; border-radius: 7px;
  font-size: 11px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase;
  color: var(--faint);
}
.drawer summary::-webkit-details-marker { display: none; }
.drawer summary:hover { background: var(--subtle); color: var(--fg); }
.drawer summary .n { margin-left: auto; letter-spacing: 0; font-variant-numeric: tabular-nums; opacity: .75; }
.drawer .tw { transition: transform .15s ease; flex: none; }
.drawer[open] .tw { transform: rotate(90deg); }
.drawer-body { padding: 2px 0 8px; }
.facet {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 5px 10px; border: 0; border-radius: 7px; background: none;
  color: var(--muted); font: inherit; font-size: 13.5px; cursor: pointer; text-align: left;
}
.facet:hover { background: var(--subtle); color: var(--fg); }
.facet i {
  width: 9px; height: 9px; border-radius: 3px; flex: none;
  background: var(--fam); box-shadow: 0 0 0 3px transparent; transition: box-shadow .15s;
}
.facet .fname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facet .n { margin-left: auto; font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.facet.on { color: var(--fg); font-weight: 600; background: var(--subtle); }
.facet.on i { box-shadow: 0 0 0 3px color-mix(in srgb, var(--fam) 26%, transparent); }
.facet.dim { display: none; }

.findbar { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.findfield {
  display: flex; align-items: center; gap: 10px; flex: 1;
  padding: 11px 14px; border: 1px solid var(--border-strong);
  border-radius: 11px; background: var(--elevated); color: var(--faint);
}
.findfield:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.findfield input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: none;
  color: var(--fg); font: inherit; font-size: 15px;
}
.findfield input::-webkit-search-cancel-button { display: none; }
.clearx {
  border: 0; background: none; color: var(--faint); cursor: pointer;
  font-size: 19px; line-height: 1; padding: 0 2px;
}
.clearx:hover { color: var(--fg); }
.viewtoggle {
  display: flex; gap: 2px; padding: 3px; border: 1px solid var(--border-strong);
  border-radius: 10px; background: var(--elevated);
}
.vt {
  width: 32px; height: 30px; display: grid; place-items: center;
  border: 0; border-radius: 7px; background: none; color: var(--faint); cursor: pointer;
}
.vt:hover { color: var(--fg); }
.vt.on { background: var(--subtle); color: var(--accent); }

.activebar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.activebar .count-line { margin: 0; }
.activechips { display: flex; flex-wrap: wrap; gap: 6px; }
.achip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 6px 3px 9px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--elevated);
  color: var(--fg); font: inherit; font-size: 12.5px; font-weight: 600;
}
.achip i { width: 8px; height: 8px; border-radius: 2px; background: var(--fam); }
.achip span { color: var(--faint); font-size: 15px; line-height: 1; }
.achip:hover { border-color: var(--accent); color: var(--accent); }
.clearall, .linkish {
  border: 0; background: none; color: var(--accent); cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; padding: 0;
}
.clearall:hover, .linkish:hover { text-decoration: underline; }
.noresults { color: var(--muted); padding: 30px 0; }

.chip.fam { display: inline-flex; align-items: center; gap: 6px; }
.chip.fam i { width: 7px; height: 7px; border-radius: 2px; background: var(--fam); }
.card { border-top: 2px solid transparent; }
.card:hover { border-top-color: var(--fam); }

/* Compact list — 293 cards is a long scroll when you already know the name. */
.card-grid.as-list { display: flex; flex-direction: column; gap: 0; }
.as-list .card {
  display: grid; grid-template-columns: 96px 1fr; align-items: center;
  gap: 16px; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--border);
  border-radius: 0; box-shadow: none; background: none;
}
.as-list .card:hover { background: var(--subtle); }
.as-list .card-media { padding: 0; background: none; min-height: 0; }
.as-list .card-media img { max-height: 44px; width: auto; margin: 0; }
.as-list .card-body {
  display: grid; grid-template-columns: 190px 1fr; gap: 14px;
  align-items: baseline; padding: 0;
}
.as-list .card-body h3 { margin: 0; font-size: 15px; }
.as-list .card-body p {
  margin: 0; font-size: 13px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.as-list .chips { display: none; }

/* ── Module page: the panel, bigger ─────────────────────────────
   It was 300px in a 1280-wide page — a stamp beside its own name. The app
   draws these at 3x, so there is real resolution to spend on them. */
.mod-head { grid-template-columns: minmax(340px, 520px) 1fr; gap: 56px; padding-top: 26px; }
@media (max-width: 1100px) { .mod-head { grid-template-columns: 1fr; gap: 24px; } }

/* ── "In a chain" ───────────────────────────────────────────────────
   The smallest honest picture of a module working: its own card between a
   card that can feed it and a card it can feed, with the cable named by the
   two ports it really joins. The cards are the app's drawings; the cable is
   drawn here, because a curve between two cards is a diagram and not a claim
   about where a jack sits. */
.chainfig { margin: 0 0 26px; }
.chainrow {
  display: flex; align-items: flex-start; gap: 0; flex-wrap: nowrap;
  overflow-x: auto; padding: 18px 4px 6px;
  background: var(--subtle); border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.chaincard {
  flex: 1 1 0; min-width: 0; max-width: 300px; text-align: center;
  color: var(--muted); padding: 0 6px;
}
.chaincard img { width: 100%; height: auto; }
.chaincard b {
  display: block; margin-top: 8px; font-size: 13px; font-weight: 600;
  color: var(--muted); letter-spacing: .02em;
}
.chaincard:hover b { color: var(--accent); }
/* The module the page is about is marked, not magnified — and its neighbours are
   NOT faded: a washed-out card reads as broken rather than as secondary, and
   these are real drawings of real modules. The mark is a ring and the name in
   full ink; everything else keeps its own. */
.chaincard.star { position: relative; }
.chaincard.star b { color: var(--fg); }
.chaincard.star::before {
  content: ""; position: absolute; inset: -6px 0 20px; border-radius: 14px;
  border: 1.5px solid var(--accent); opacity: .55; pointer-events: none;
}
.chainbox {
  display: block; aspect-ratio: 2 / 1; border-radius: 10px;
  background: var(--elevated); border: 1px dashed var(--border-strong);
}

.chaincable {
  flex: 0 0 74px; align-self: stretch; position: relative;
  display: flex; flex-direction: column; align-items: center;
}
.chaincable svg { width: 74px; height: 96px; overflow: visible; }
.chaincable .cbl { stroke-width: 2.4; stroke-linecap: round; }
.cbl.kind-audio   { stroke: #4E8CE8; }
.cbl.kind-signal  { stroke: #D7913C; }
.cbl.kind-clock   { stroke: #3FA86A; }
.cbl.kind-trigger { stroke: #D8508F; }
.cbl.kind-context { stroke: #8A63D8; }
.cbl.kind-lattice, .cbl.kind-grid { stroke: var(--faint); }
.cbllabel {
  font-family: var(--mono); font-size: 10px; color: var(--faint);
  text-align: center; line-height: 1.3; margin-top: -6px; word-break: break-word;
}
.chainfig figcaption {
  margin-top: 14px; color: var(--muted); font-size: 14.5px; max-width: var(--read);
}
.chainfig figcaption b { color: var(--fg); font-weight: 600; }
@media (max-width: 700px) {
  .chaincable { flex-basis: 46px; }
  .chaincable svg { width: 46px; }
  .cbllabel { display: none; }
}

/* ── The inspector slides ────────────────────────────────────────
   One tab, one slide: the panel as the app draws it on the left, what its
   controls do on the right. A module with six tabs would be six screens of
   stacked pictures; as slides it is one screen with arrows. */
.slides { border: 1px solid var(--rule, #e6e3dc); border-radius: 12px; overflow: hidden; }
.slides-bar {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-bottom: 1px solid var(--rule, #e6e3dc);
}
.slides-tabs { display: flex; gap: 6px; flex: 1; overflow-x: auto; }
.slides-tab {
  font: 600 11px/1 var(--mono, monospace); letter-spacing: .06em;
  padding: 7px 11px; border-radius: 6px; border: 1px solid transparent;
  background: none; color: var(--muted, #6b6b6b); cursor: pointer; white-space: nowrap;
}
.slides-tab.on { color: var(--ink, #111); border-color: var(--rule, #e6e3dc); background: var(--card, #fff); }
.slides-arrow {
  width: 30px; height: 30px; flex: none; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--rule, #e6e3dc); background: var(--card, #fff);
  color: var(--ink, #111); font-size: 14px; line-height: 1;
}
.slides-arrow:disabled { opacity: .35; cursor: default; }
.slide { display: none; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 26px; padding: 22px; }
.slide.on { display: grid; }
/* The panel is 350 CSS px in the app and drawn at 2x; showing it wider than it
   is would be a blow-up of a picture that is already the right size. */
.slide-shot img { width: 100%; max-width: 350px; height: auto; border-radius: 8px; display: block; }
.slide-body h3 { font: 600 12px/1 var(--mono, monospace); letter-spacing: .08em; margin: 0 0 10px; }
.slide-param { padding: 12px 0; border-bottom: 1px solid var(--rule, #e6e3dc); }
.slide-param:last-child { border-bottom: 0; }
.slide-param-head { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.slide-range { margin-left: auto; font: 500 12px/1 var(--mono, monospace); color: var(--muted, #6b6b6b); }
@media (max-width: 780px) { .slide.on { grid-template-columns: 1fr; } }


/* ── In the website's language: cards, frames, the module's panel ── */
.card { border-radius: var(--radius-lg); background: var(--elevated); transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .3s; }
.card:hover { transform: translateY(-4px); box-shadow: var(--lift); }
.card-body h3 { font-family: var(--display); font-weight: 650; letter-spacing: -.01em; }
.fig-frame { border-radius: var(--radius-lg); border: 1px solid var(--border-strong); box-shadow: var(--lift); background: var(--shot-bg); overflow: hidden; }
.shot figcaption { color: var(--muted); }
.mod-panel { position: relative; isolation: isolate; }
.mod-panel::before {
  content: ""; position: absolute; inset: 6% 4%; z-index: -1; border-radius: 50%; filter: blur(34px);
  background: radial-gradient(closest-side, color-mix(in srgb, var(--fam, var(--accent)) 55%, transparent), transparent);
  animation: abit-breathe 6.5s ease-in-out infinite;
}
.mod-panel img { animation: abit-float 7.5s ease-in-out infinite; }
.mod-title h1 { font-family: var(--display); font-size: clamp(2rem, 4.4vw, 3.4rem); font-weight: 800; line-height: 1.03; letter-spacing: -.02em; }
.chip { border-radius: 6px; font-weight: 650; }
.chip.accent { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.rail-link.on, .rail-toc a.on { color: var(--fg); }
@media (prefers-reduced-motion: reduce) { .mod-panel::before, .mod-panel img { animation: none; } }

/* Phones: Abit's toolbar and a module's parameter table fit 390px */
.findfield { min-width: 0; }
@media (max-width: 600px) { table.params { display: block; overflow-x: auto; } }

/* ── Names the website also uses, for other things ────────────────
   The website's .spec is a two-column fact list, .shot a hoverable
   screenshot card, .search a big rounded field, .callout bold: here they
   are Abit's blocks, so what the website adds and Abit does not set is
   taken back. */
.abit-doc main .spec { display: block; font-size: inherit; }
.abit-doc main .shot { border: 0; border-radius: 0; background: none; overflow: visible; transition: none; }
.abit-doc main .shot:hover { transform: none; box-shadow: none; }
.abit-doc main .shot img { transition: none; }
.abit-doc main .callout { font-weight: inherit; }
.abit-doc main .findfield .search { height: auto; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; width: auto; max-width: none; }
@media (max-width: 640px) { .panelcard-solo { grid-template-columns: minmax(0, 1fr); } .panelcard-solo .panelcard-img img { max-width: 100%; } }
@media (max-width: 1100px) { .mod-head { grid-template-columns: minmax(0, 1fr); } }   /* not 1fr: a wide panel would stretch the page */
.kindrow { display: flex; flex-wrap: wrap; gap: 8px; }
.mod-title .lede { overflow-wrap: anywhere; }   /* Code's description carries long unbroken tokens */
