/* ==========================================================================
   LOOPS PRIMITIVES
   Button (ink / ghost, two sizes), Tag, Verdict Pill, Card, Rule, and the
   framed page container. Built to the component specs in DESIGN.md.

   Every fill, stroke, radius, duration and gap reads from styles/tokens.css.
   The exceptions are marked `loops-allow` and are all component-intrinsic
   paddings that DESIGN.md states numerically but the space scale does not
   carry.

   Linked on every page after tokens.css. Specimen: design/primitives.html
   ========================================================================== */

/* --------------------------------------------------------------------------
   LINE BREAKS
   Everything balances: leads, intros, card copy and captions break into
   lines of even length, so no line is left holding one or two words. Long
   reading text (a post's prose, FAQ answers, the legal pages) uses pretty
   instead, which only keeps the last line from being a lone word, because
   balancing a long paragraph narrows the whole column. Browsers without
   text-wrap simply wrap as before.
   -------------------------------------------------------------------------- */

h1, h2, h3, h4, summary, figcaption, p, li, dd, td, th, blockquote { text-wrap: balance; }
.prose p, .prose li, .prose blockquote, .qa .a p, .answer p, .doc p, .doc li { text-wrap: pretty; }

/* --------------------------------------------------------------------------
   FRAMED PAGE CONTAINER
   One .frame holds everything between the nav and the end of the footer, and
   it is the only element that ever draws a vertical frame rule. Sections are
   its direct children: they set padding and a bottom rule, never a side
   border and never a margin, so a section's rule meets both verticals and
   there is nothing between sections for the frame to skip.

   The column is --max wide, but never closer than one --gutter to the
   viewport edge, so the frame is 1400 only above 1488 (1400 + 2 x 44). The
   nav's inner row uses the same width so its cell dividers land on the
   frame's x positions. At phone width the column takes the full viewport.
   -------------------------------------------------------------------------- */

.frame,
.nav-in {
  width: min(var(--max), 100% - 2 * var(--gutter));
  margin-inline: auto;
  border-inline: 1px solid var(--rule);
}
@media (max-width: 767px) {
  .frame,
  .nav-in { width: 100%; }
}

.sec {
  padding: var(--sec-y) var(--gutter);
  border-bottom: 1px solid var(--rule);
}

/* The footer draws the rule above itself, so the last block of <main> does
   not draw a second one beside it. */
.frame > main > :last-child { border-bottom: 0; }

/* In-frame bleed. A row inside a padded section that runs frame edge to
   frame edge so its rules close the corners: a stat row, a three-up cell
   row. It is pulled out by the section's gutter and its cells take the
   gutter back as padding. .bleed-end on the last row also cancels the
   section's bottom padding, so the cell dividers run to the section's
   bottom rule. */
.bleed { margin-inline: calc(-1 * var(--gutter)); }
.bleed-end { margin-bottom: calc(-1 * var(--sec-y)); }

/* --------------------------------------------------------------------------
   ACCENT PANEL
   The one place colour gets scale, once per page: --accent-wash under the 4px
   radial dot texture in --accent-edge, the only texture in the system. It is
   an in-flow field, not a full-bleed band. On the homepage it is the hero's
   right column, filling it to the frame rule, and it holds one product card.
   Rules around it belong to its neighbours: the hero copy's right border and
   the partner band's top border.
   -------------------------------------------------------------------------- */

.panel {
  background:
    radial-gradient(var(--accent-edge) .6px, transparent .6px) 0 0 / 4px 4px, /* loops-allow: DESIGN.md Accent Panel dot, 0.6px dot on a 4px cell */
    var(--accent-wash);
}

/* --------------------------------------------------------------------------
   HERO
   One block, shared by the homepage and the industry pages. Row 1 is the copy
   beside the tinted media column (the Accent Panel), row 2 is optional (the
   homepage's partner band). It fills the viewport under the nav, up to 940px,
   and carries the section's bottom rule. The product UI sits centred on the
   panel's dots.
   -------------------------------------------------------------------------- */
.hero{position:relative;display:grid;grid-template-rows:1fr auto;min-height:min(calc(100svh - var(--nav-h)), 940px);border-bottom:1px solid var(--rule)} /* loops-allow: 940px hero cap, from the hero spec */
/* 42 / 58, with the copy column snapped to a whole pixel so the column rule
   is crisp and the panel ends exactly on the frame rule. */
.hero-body{display:grid;grid-template-columns:42fr 58fr;grid-template-columns:round(down, 42%, 1px) minmax(0,1fr);min-width:0}
/* The negative space: the copy centres in a tall column. Its right border is
   the column rule, running from the nav rule to the partner band's rule. */
.hero-media{display:grid;align-content:center;justify-items:stretch;gap:var(--space-16);min-width:0;padding:var(--space-40) var(--gutter)}
.hero-copy{display:grid;grid-template-columns:minmax(0,1fr);align-content:center;justify-items:start;gap:var(--space-24);min-width:0;padding:var(--hero-y) var(--gutter);border-right:1px solid var(--rule);text-align:left}
.hero h1{margin:0;text-wrap:balance;font-size:var(--text-display-xl);line-height:var(--leading-display-xl);letter-spacing:var(--tracking-display-xl);max-width:16ch;font-weight:400}
.hero h1 span{color:var(--ink-3)}
@media (max-width:1079px){
  .hero{min-height:0}
  .hero-body{grid-template-columns:minmax(0,1fr)}
  .hero .hero-copy{border-right:0;border-bottom:1px solid var(--rule)}
}
@media (max-width:640px){
  .hero h1{font-size:var(--text-display-l);line-height:var(--leading-display-l);letter-spacing:var(--tracking-display-l)}
}
@media (max-width:420px){
  .hero h1{font-size:var(--text-heading-l);line-height:var(--leading-heading-l);letter-spacing:var(--tracking-heading-l)}
}

/* --------------------------------------------------------------------------
   FAQ
   Native <details name="faq">: the shared name makes the group exclusive, so
   one row is open at a time, and it is keyboard and screen-reader correct
   with no script and no ARIA of our own. The header centres (the one
   documented exception to left alignment); the rows do not, because a
   question read from the middle of a line is slower to scan.
   -------------------------------------------------------------------------- */

.faq-head {
  display: grid;
  gap: var(--space-12);
  justify-items: center;
  text-align: center; /* loops-allow: the FAQ header, DESIGN.md FAQ exception */
  margin-bottom: var(--space-40);
}
.faq-head > * { margin: 0; }
/* The title sets on two balanced lines: a caption measure at display size. */
.faq-head h2 { max-width: var(--measure-caption); }
.faq-head .lead { max-width: var(--measure-lead); }

.faq {
  max-width: 820px; /* loops-allow: FAQ container, from the section patterns spec */
  margin-inline: auto;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-card);
  overflow: hidden;
}
.faq details + details { border-top: 1px solid var(--rule); }

.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-20);
  min-height: var(--faq-row-h);
  padding: var(--space-16) var(--space-24);
  font-size: var(--text-body-l);
  line-height: var(--leading-body-l);
  letter-spacing: var(--tracking-body-l);
  font-weight: 500;
  color: var(--ink);
  transition: background-color var(--fast) var(--ease);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { background: var(--inset); }
.faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* The indicator is two 1px rules; the vertical one folds away on open. */
.faq .sign { margin-left: auto; position: relative; width: 12px; height: 12px; flex: none; color: var(--ink-3); } /* loops-allow: 12px indicator */
.faq .sign::before,
.faq .sign::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  background: currentColor;
  transition: transform var(--base) var(--ease);
}
.faq .sign::before { width: 12px; height: 1px; } /* loops-allow: the indicator's rules */
.faq .sign::after { width: 1px; height: 12px; } /* loops-allow: the indicator's rules */
.faq details[open] .sign { color: var(--ink); }
.faq details[open] .sign::after { transform: scaleY(0); }

/* Open and close animate through ::details-content, with interpolate-size on
   :root. Where a browser lacks either, the panel opens instantly. */
.faq details::details-content {
  block-size: 0;
  overflow: hidden;
  transition: block-size var(--base) var(--ease), content-visibility var(--base) allow-discrete;
}
.faq details[open]::details-content { block-size: auto; }

.ans { display: grid; gap: var(--space-12); padding: 0 var(--space-24) var(--space-24); }
.ans p { margin: 0; font-size: var(--text-body-m); line-height: var(--leading-body-m); color: var(--ink-2); max-width: var(--measure-body); }
.ans-note { font-family: var(--mono); font-size: var(--text-mono); line-height: var(--leading-mono); color: var(--ink-3); }
/* A guide link's prefix sits outside the link's underline. */
.ans .more::before { content: "Guide: "; display: inline-block; white-space: pre; color: var(--ink-3); }

.faq-foot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-12);
  align-items: center;
  justify-content: center;
  margin-top: var(--space-32);
  text-align: center; /* loops-allow: the FAQ header, DESIGN.md FAQ exception */
}
.faq-foot p { margin: 0; flex-basis: 100%; font-size: var(--text-body-m); line-height: var(--leading-body-m); color: var(--ink-2); }

/* Three-up cells divided by vertical rules rather than floating cards.
   At phone width the cells stack and the vertical rules become horizontal. */
.cells {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.cells > * + * { border-left: 1px solid var(--rule); }
.cell { padding: var(--bay) var(--gutter); }

@media (max-width: 860px) {
  .cells { grid-template-columns: 1fr; }
  .cells > * + * { border-left: 0; border-top: 1px solid var(--rule); }
}

/* --------------------------------------------------------------------------
   RULE
   Elevation is a hairline and a surface step, never a shadow.
   -------------------------------------------------------------------------- */

.rule,
.rule-strong {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}
.rule-strong { border-top-color: var(--rule-2); }

.rule-v {
  align-self: stretch;
  width: 1px;
  background: var(--rule);
}

/* --------------------------------------------------------------------------
   BUTTON (v2)
   Hierarchy is fill against outline against bare, never hue. Size comes from
   min-height on the control scale, so a label never sets the height. Radius
   0. No control ever draws an underline: hover is a fill or border shift
   over 150ms plus the scramble (ui.js). No transform, no shadow.
   -------------------------------------------------------------------------- */

.btn {
  --h: var(--btn-h-md);
  --pad-x: var(--space-24);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  min-height: var(--h);
  padding: 0 var(--pad-x);
  border: 1px solid transparent;
  border-radius: var(--r-button);
  background: none;
  color: inherit;
  font-family: var(--sans);
  font-size: var(--text-label);
  line-height: var(--leading-label);
  letter-spacing: var(--tracking-label);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--fast) var(--ease),
    border-color var(--fast) var(--ease),
    color var(--fast) var(--ease);
}
.btn:hover { text-decoration: none; }
.btn-lg { --h: var(--btn-h-lg); --pad-x: var(--space-32); font-size: var(--text-label-lg); }
.btn-sm { --h: var(--btn-h-sm); --pad-x: var(--space-16); font-size: var(--text-label-sm); }

/* Ink. One primary per view. The fill becomes bone in dark and the label
   near-black, so it stays the highest-contrast object on the page. */
.btn-ink { background: var(--ink); color: var(--on-ink); }
.btn-ink:hover,
.btn-ink.is-hover { background: var(--ink-hover); }

/* Ghost. Every secondary action. Never a fill, never the accent. */
.btn-ghost { border-color: var(--rule-2); color: var(--ink-2); font-weight: 400; }
.btn-ghost:hover,
.btn-ghost.is-hover { border-color: var(--ink-3); color: var(--ink); }

/* Text. Bare, but still a control: it keeps the height so it lines up in a
   row with the other two, and it never draws an underline. */
.btn-text { --pad-x: 0px; color: var(--ink-2); font-weight: 400; justify-content: flex-start; }
.btn-text:hover,
.btn-text.is-hover { color: var(--ink); }

/* For an identifier as the label, such as a call ID. */
.btn-mono { font-family: var(--mono); font-size: var(--text-mono); letter-spacing: .02em; font-weight: 400; } /* loops-allow: tracking from the v2 button spec */

/* Busy: pressed and still running. The fill or border steps down, the
   cursor says progress, hover is inert, no scramble. */
.btn[aria-busy="true"] { cursor: progress; }
.btn-ink[aria-busy="true"],
.btn-ink[aria-busy="true"]:hover { background: var(--ink-3); }
.btn-ghost[aria-busy="true"],
.btn-ghost[aria-busy="true"]:hover,
.btn-text[aria-busy="true"],
.btn-text[aria-busy="true"]:hover { border-color: var(--rule); color: var(--ink-3); }

/* Disabled: no hover, no scramble. Prefer hiding the action or saying why. */
.btn[disabled] { opacity: .5; cursor: not-allowed; } /* loops-allow: 0.5, from the v2 button spec */
.btn-ink[disabled]:hover { background: var(--ink); }
.btn-ghost[disabled]:hover { border-color: var(--rule-2); color: var(--ink-2); }
.btn-text[disabled]:hover { color: var(--ink-2); }

/* --------------------------------------------------------------------------
   ACTION LABELS AND LINKS
   The scrambling label is aria-hidden; its .sr-only sibling holds the real
   label for assistive tech. ui.js locks the label's box for the length of a
   run so nothing reflows.
   -------------------------------------------------------------------------- */

.lbl { display: inline-block; text-align: inherit; white-space: nowrap; }
/* A decoding section title: each word is its own box, width locked by ui.js
   so the line breaks cannot move while the letters settle. */
.w { display: inline-block; white-space: pre; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Nav and footer links are actions: they scramble and never underline, and
   they meet the smallest control height. */
.navlink,
.footlink {
  display: inline-flex;
  align-items: center;
  min-height: var(--btn-h-sm);
  text-decoration: none;
  transition: color var(--fast) var(--ease);
}
.navlink:hover,
.footlink:hover { color: var(--ink); text-decoration: none; }

/* --------------------------------------------------------------------------
   FOOTER
   Two halves on one grid: the mark and one line about Loops on the left, the
   link columns grouped on the right, the last one ending on the right gutter,
   so the footer's right edge lines up with the legal links under it. The
   legal row runs frame edge to frame edge under both halves.
   -------------------------------------------------------------------------- */

.foot { border-top: 1px solid var(--rule); padding: var(--space-64) var(--gutter) var(--space-40); font-size: var(--text-body-m); line-height: var(--leading-body-m); color: var(--ink-3); }
.foot-in { display: grid; gap: var(--space-40); }
.foot-brand { display: grid; gap: var(--space-16); align-content: start; justify-items: start; }
.foot-brand p { margin: 0; max-width: var(--measure-lead); color: var(--ink-2); }
.foot .logo { padding-inline: 0; text-decoration: none; }
.foot-cols { display: grid; grid-template-columns: repeat(3, max-content); justify-content: end; gap: var(--space-40) var(--space-64); }
.foot nav { display: grid; align-content: start; }
/* Column label. The column is a <nav aria-label>, which names it for assistive
   tech, so the visible label is a span hidden from the accessibility tree. */
.foot-h { display: block; margin: 0 0 var(--space-8); font-family: var(--mono); font-size: var(--text-eyebrow); line-height: var(--leading-eyebrow); letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--ink-3); }
.foot a, .foot .linkish { display: inline-flex; align-items: center; min-height: var(--btn-h-sm); color: var(--ink-2); text-decoration: none; }
.linkish { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.foot .legal { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--space-8) var(--space-24); justify-content: space-between; align-items: center; margin: var(--space-24) calc(-1 * var(--gutter)) 0; padding: var(--space-20) var(--gutter) 0; border-top: 1px solid var(--rule); }
.foot .legal-links { display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-20); }
@media (min-width: 880px) {
  .foot-in { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); column-gap: var(--space-64); }
}
@media (max-width: 560px) {
  /* Product and Trust share a row; Guides, with the longest labels, takes a row of its own. */
  .foot-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); justify-content: stretch; column-gap: var(--space-32); }
  .foot-cols nav[aria-label="Guides"] { order: 3; grid-column: 1 / -1; }
}

/* --------------------------------------------------------------------------
   FILTER
   The /blog topic row. See DESIGN.md, Filter.
   -------------------------------------------------------------------------- */

/* A control (square, 36px, scrambles),
   not a pill: bare at rest, the chosen one sits on --inset in --ink. */
.filters{display:flex;flex-wrap:wrap;gap:var(--space-8);margin:0 0 var(--space-64)}
/* With script on, the row's space is held from first paint, so revealing it moves nothing. */
.js .filters[hidden]{display:flex;visibility:hidden}
.filter{display:inline-flex;align-items:center;min-height:var(--btn-h-sm);padding:0 var(--space-16);border:1px solid transparent;border-radius:var(--r-button);background:none;color:var(--ink-3);font:inherit;font-size:var(--text-label);line-height:var(--leading-label);letter-spacing:var(--tracking-label);cursor:pointer;transition:background-color var(--fast) var(--ease),color var(--fast) var(--ease)}
.filter:hover{color:var(--ink)}
/* On a phone the row scrolls sideways instead of stacking, and runs to the frame edge. */
@media (max-width:700px){.filters{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;margin-inline:calc(-1 * var(--gutter));padding-inline:var(--gutter)}.filters::-webkit-scrollbar{display:none}.filter{flex:none;position:relative}}
/* The filter row scrolls on phones. Each button contains its own .sr-only label, or the absolutely
   positioned label escapes the scroller and widens the page (the blog read 754px wide at 390). */

/* --------------------------------------------------------------------------
   SCROLL PROGRESS
   The top edge, above the nav. ui.js drives transform, never width.
   -------------------------------------------------------------------------- */

.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 70; /* loops-allow: 2px bar, from the Scroll Progress spec */
  background: var(--accent);
  transform: scaleX(0); transform-origin: 0 50%;
  will-change: transform; pointer-events: none;
}

/* --------------------------------------------------------------------------
   TAG
   Section label. Sits above a heading and names the section.
   -------------------------------------------------------------------------- */

.tag {
  display: inline-block;
  width: fit-content;   /* a label, never a bar: it hugs its text in any grid or flex parent */
  max-width: 100%;
  padding: var(--space-8) var(--space-12);
  border: 1px solid var(--rule-2);
  border-radius: var(--r-tag);
  background: transparent;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: var(--text-eyebrow);
  line-height: var(--leading-eyebrow);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
}

/* Fill variant, for a Tag inside a card: no second outline beside the card's
   hairline, the label sits on --inset instead. Same type and padding. */
.tag-fill {
  border-color: transparent;
  background: var(--inset);
}

/* --------------------------------------------------------------------------
   VERDICT PILL
   States the outcome of one rule on one call. The only component permitted to
   use the verdict colours. A pass has no colour of its own so the eye lands
   on the two verdicts that need action.
   -------------------------------------------------------------------------- */

.pill {
  display: inline-block;
  padding: var(--space-4) var(--space-8);
  border: 1px solid currentColor;
  border-radius: var(--r-tag);
  background: transparent;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: var(--text-eyebrow);
  line-height: var(--leading-eyebrow);
  letter-spacing: .14em; /* loops-allow: DESIGN.md Verdict Pill; no tracking token at this ratio */
  text-transform: uppercase;
  white-space: nowrap;
}
/* A pass, and any neutral status (Sample, Approved), is the base pill. Only
   the two verdicts that need action carry a colour. */
.pill-miss    { color: var(--miss); }
.pill-partial { color: var(--partial); }

/* --------------------------------------------------------------------------
   CITATION
   The rule, regulation or source behind a line. Plain Mono / M text: no
   border, no fill, no radius, because it is text rather than a label.
   -------------------------------------------------------------------------- */

.cite {
  font-family: var(--mono);
  font-size: var(--text-mono);
  line-height: var(--leading-mono);
  letter-spacing: var(--tracking-mono);
  font-weight: 400;
  color: var(--ink-3);
}

/* --------------------------------------------------------------------------
   CARD
   One surface step above its parent, separated by a hairline. Where a card
   sits on the accent panel the tint does the separating, so the card keeps
   the same hairline it uses everywhere else.
   -------------------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-card);
  padding: var(--space-24);
  color: var(--ink);
}

/* For cards whose panes carry their own padding, like the graded call card. */
.card-flush {
  padding: 0;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   APP SHELL
   A product graphic. Real DOM, five bands, always in this order:
     identity   who and what, plus a status badge and the Sample marker
     summary    the one number that matters, before the evidence
     tabs       with counts: there is more product than the frame shows
     body       the evidence
     footer     the audit line: what it was graded against, and when
   Three type levels inside the frame: Mono eyebrow for anything the system
   names, sans caption for anything a person said or wrote, a subheading
   figure for the number the summary exists to deliver.
   The markup ships finished. site.js rewinds a scene and plays it forward;
   without script, or under reduced motion, the finished state is what shows.
   -------------------------------------------------------------------------- */

.app {
  width: 100%; min-width: 0; margin: 0; container-type: inline-size;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--rule); border-radius: var(--r-card);
  overflow: hidden;
  font-size: var(--text-caption); line-height: var(--leading-body-m);
}
.app-id, .app-foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-6) var(--space-10);
  padding: var(--space-10) var(--space-16); background: var(--inset);
  font-family: var(--mono); font-size: var(--text-eyebrow); line-height: var(--leading-eyebrow); color: var(--ink-3);
}
.app-id { border-bottom: 1px solid var(--rule); }
.app-foot { border-top: 1px solid var(--rule); }
.app-id .title { font-family: var(--sans); font-size: var(--text-label-sm); font-weight: 500; letter-spacing: var(--tracking-label); color: var(--ink); }
.app-id .sl, .app-foot .sl { color: var(--rule-2); }
.app-id .end, .app-foot .end { margin-left: auto; display: inline-flex; align-items: center; gap: var(--space-6); }
.app .badge { display: inline-flex; align-items: center; gap: var(--space-6); }
.app-sum {
  display: flex; flex-wrap: wrap; align-items: stretch; gap: var(--space-12) var(--space-24);
  padding: var(--space-12) var(--space-16); border-bottom: 1px solid var(--rule);
}
.app-sum .fig { display: grid; gap: var(--space-2); align-content: start; }
.app-sum .fig b { font-size: var(--text-subheading); line-height: var(--leading-subheading); letter-spacing: var(--tracking-subheading); font-weight: 500; color: var(--ink); }
.app-sum .fig span, .app-pt {
  font-family: var(--mono); font-size: var(--text-eyebrow); line-height: var(--leading-eyebrow);
  letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); /* loops-allow: eyebrow tracking at micro size, as the Verdict Pill */
}
.app-sum .div { width: 1px; background: var(--rule); }
.app-tabs {
  display: flex; flex-wrap: wrap; gap: var(--space-2); padding: 0 var(--space-8);
  border-bottom: 1px solid var(--rule); background: var(--canvas);
}
.app-tabs span {
  position: relative; padding: var(--space-8) var(--space-10);
  font-size: var(--text-caption); color: var(--ink-3);
}
.app-tabs span[aria-current] { color: var(--ink); }
.app-tabs span[aria-current]::after { content: ""; position: absolute; left: var(--space-8); right: var(--space-8); bottom: -1px; height: 1px; background: var(--ink); }
.app-tabs i { font-style: normal; font-family: var(--mono); font-size: var(--text-eyebrow); color: var(--ink-3); margin-left: var(--space-4); }
.app-body { display: grid; grid-template-columns: minmax(0, 1fr); }
.app-body.split { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
.app-body.split > * + * { border-left: 1px solid var(--rule); }
.app-pane { padding: var(--space-12) var(--space-16); min-width: 0; }
.app-pt { display: flex; gap: var(--space-8); margin: 0 0 var(--space-10); }
.app-pt .n { margin-left: auto; letter-spacing: .08em; } /* loops-allow: a count beside an eyebrow */
.app .replay {
  font: inherit; text-transform: uppercase; letter-spacing: .16em; /* loops-allow: eyebrow tracking at micro size */
  padding: var(--space-2) var(--space-8); border: 1px solid var(--rule-2); border-radius: var(--r-button);
  background: none; color: var(--ink-3); cursor: pointer;
  transition: color var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard);
}
.app .replay:hover { color: var(--ink); border-color: var(--ink-3); }
@container (max-width: 560px) {
  .app-body.split { grid-template-columns: minmax(0, 1fr); }
  .app-body.split > * + * { border-left: 0; border-top: 1px solid var(--rule); }
}

/* Ambient. Run only while their scene is on screen, stop under reduced motion. */
.spin {
  width: 10px; height: 10px; flex: none; display: inline-block; border-radius: 50%; /* loops-allow: a spinner is round */
  border: 1.5px solid var(--rule-2); border-top-color: var(--ink); /* loops-allow: spinner stroke */
  animation: spin var(--dur-land) var(--ease-enter) infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.livedot {
  width: 6px; height: 6px; flex: none; display: inline-block; border-radius: 50%; /* loops-allow: DESIGN.md live dot */
  background: var(--accent); animation: breathe var(--dur-breathe) var(--ease-enter) infinite;
}
@keyframes breathe { 50% { opacity: .35; transform: scale(.82); } }
[data-scene]:not(.is-playing) :is(.spin, .livedot) { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .spin, .livedot { animation: none; }
  [data-replay] { display: none; }
}

/* ---- inside an app: transcript, criteria, rules, bars ---- */
.type-rest { visibility: hidden; }
.a-turn { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: var(--space-10); margin: 0; padding: var(--space-6) 0; } /* loops-allow: speaker column fits "CUSTOMER" in eyebrow Mono */
.a-turn .who { display: grid; gap: var(--space-2); align-content: start; font-family: var(--mono); font-size: var(--text-eyebrow); line-height: var(--leading-eyebrow); color: var(--ink-3); }
.a-turn .who b { font-weight: 400; color: var(--ink-2); text-transform: uppercase; letter-spacing: .1em; } /* loops-allow: speaker label */
.a-turn .say { font-size: var(--text-caption); line-height: var(--leading-body-m); color: var(--ink-2); }
/* The flagged turn: the wash and the rail are layers, so their arrival is
   opacity and transform, never a background change. */
.a-turn.flag { margin-inline: calc(var(--space-10) * -1); padding-inline: var(--space-10); }
.a-turn.flag::before, .a-turn.flag::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; }
.a-turn.flag::before { right: 0; background: var(--accent-wash); transition: opacity var(--dur-enter) var(--ease-enter); }
.a-turn.flag::after { width: 2px; background: var(--accent); transform-origin: top; transition: transform var(--dur-enter) var(--ease-enter); }
.a-turn.flag > * { position: relative; z-index: 1; }
.a-turn.flag .say { color: var(--ink); }
.a-turn.flag.is-quiet::before { opacity: 0; }
.a-turn.flag.is-quiet::after { transform: scaleY(0); }
.a-turn .cite { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-6); margin-top: var(--space-6); font-size: var(--text-eyebrow); color: var(--ink-3); }
.a-crow { display: grid; gap: var(--space-4); padding: var(--space-8) 0; border-bottom: 1px solid var(--rule); }
.a-crow:last-child { border-bottom: 0; }
.a-crow .top { display: flex; align-items: center; gap: var(--space-8); margin: 0; }
.a-crow .top b, .a-rrow .top b { flex: none; font-family: var(--mono); font-weight: 400; font-size: var(--text-eyebrow); color: var(--ink-3); }
.a-crow .top span:not(.pill), .a-rrow .top span:not(.pill) { color: var(--ink-2); line-height: var(--leading-label); }
.a-crow .pill, .a-rrow .pill { margin-left: auto; flex: none; }
.a-crow .why { margin: 0; padding-left: var(--space-24); color: var(--ink-3); }
/* SOP parse */
.app-body.parse { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
.app-body.parse > * + * { border-left: 1px solid var(--rule); }
.a-doc { display: grid; gap: var(--space-8); }
.a-doc i { position: relative; display: block; height: 5px; background: var(--inset); width: 100%; } /* loops-allow: a line of a page, drawn */
.a-doc i.a-ls { width: 58%; } .a-doc i.a-lm { width: 82%; }
.a-doc i::after { content: ""; position: absolute; inset: -2px 0; border: 1px solid var(--ink-3); opacity: 0; transition: opacity var(--dur-base) var(--ease-standard); }
.a-doc i.is-hot::after { opacity: 1; }
.a-rrow { display: grid; gap: var(--space-4); padding: var(--space-8) var(--space-10); margin-bottom: var(--space-6); border: 1px solid var(--rule); background: var(--surface); }
.a-rrow:last-child { margin-bottom: 0; }
.a-rrow .top { display: flex; align-items: center; gap: var(--space-8); margin: 0; }
.a-rrow .a-src { padding-left: var(--space-24); font-family: var(--mono); font-size: var(--text-eyebrow); color: var(--ink-3); }
@container (max-width: 560px) {
  .app-body.parse { grid-template-columns: minmax(0, 1fr); }
  .app-body.parse > * + * { border-left: 0; border-top: 1px solid var(--rule); }
}
/* release compare: one scale, the last release as a marker, this one as a bar */
.a-brow, .a-axis { display: grid; grid-template-columns: 24px minmax(56px, 92px) minmax(0, 1fr) 40px 40px; gap: var(--space-8); align-items: center; } /* loops-allow: chart columns sized to their mono content */
.a-brow { padding: var(--space-6) 0; }
.a-brow b { font-family: var(--mono); font-weight: 400; font-size: var(--text-eyebrow); color: var(--ink-3); }
.a-brow .nm { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-track { position: relative; height: 8px; background: var(--inset); } /* loops-allow: DESIGN.md bar chart track */
.a-fill { position: absolute; inset: 0; background: var(--ink-3); transform: scaleX(var(--v)); transform-origin: left; transition: transform var(--dur-land) var(--ease-enter); }
.a-mark { position: absolute; top: -3px; bottom: -3px; width: 0; border-left: 1px solid var(--rule-2); } /* loops-allow: DESIGN.md release marker */
.a-brow.worse .a-fill { background: var(--accent); }
.a-brow .val, .a-brow .delta { font-family: var(--mono); font-size: var(--text-eyebrow); text-align: right; color: var(--ink-2); }
.a-brow .delta { color: var(--ink-3); }
.a-brow.worse .val, .a-brow.worse .delta, .a-brow.worse b { color: var(--ink); }
.a-axis { margin-top: var(--space-6); padding-top: var(--space-6); border-top: 1px solid var(--rule); }
.a-axis .ticks { grid-column: 3; display: flex; justify-content: space-between; font-family: var(--mono); font-size: var(--text-eyebrow); color: var(--ink-3); }
.a-note { margin: var(--space-10) 0 0; color: var(--ink-3); }
@container (max-width: 440px) { .app-sum .div { display: none; } }

/* --------------------------------------------------------------------------
   CLOSING BANNER (DESIGN.md)
   Every page's closing call to action: copy and actions on the left, a
   cut-off product screen on the right. Markup from tools/banner.py (and the
   homepage, by hand). The window parts are the Step Stage's, scoped here.
   -------------------------------------------------------------------------- */
.cl-shot .fo{position:relative;margin:0;background:var(--surface);border:1px solid var(--rule);border-radius:var(--r-card);color:var(--ink);font-size:var(--text-body-m);line-height:var(--leading-label)}
.cl-shot .win{width:min(420px,calc(100cqi - var(--space-64)))}
.cl-shot .fo-h{display:flex;justify-content:space-between;align-items:center;gap:var(--space-12);margin:0;padding:var(--space-10) var(--space-16);font-family:var(--mono);font-size:var(--text-mono);line-height:var(--leading-mono);color:var(--ink-3)}
.cl-shot .fo-h .ttl{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cl-shot .fo-h .stat{flex:none;color:var(--ink-2);border:0;padding:0;background:none} /* a blog stat cell shares the class name */
.cl-shot .win-b{padding:var(--space-8) 0 var(--space-24)}
.cl-shot .fo-rows{list-style:none;margin:0;padding:0}
.cl-shot .fo-rows li{position:relative;display:grid;grid-template-columns:var(--space-24) minmax(0,1fr) auto;align-items:center;gap:var(--space-10);padding:var(--space-8) var(--space-16)}
.cl-shot .fo-rows li > *{position:relative}
.cl-shot .fo-rows li > .hl{position:absolute;inset:0;background:var(--inset);opacity:0}
.cl-shot .fo-rows :is(.miss,.moved,.fixed) > .hl{opacity:1}
.cl-shot .fo-rows b{font-family:var(--mono);font-size:var(--text-mono);line-height:var(--leading-mono);font-weight:400;color:var(--ink-3)}
.cl-shot .fo-rows .nm{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cl-shot .fo-rows :is(.miss,.moved,.fixed) b{color:var(--ink)}
.cl-shot .ok{width:var(--space-16);height:var(--space-16);flex:none;color:var(--accent)}
.cl-shot .av{display:grid;place-items:center;width:var(--space-20);height:var(--space-20);flex:none;background:var(--ink);color:var(--on-ink);font-family:var(--mono);font-size:var(--text-eyebrow);line-height:1}
/* The loop closes (DESIGN.md, Closing Banner): copy and the action on the left; on the right a
   cut-off screen of the release Loops drafted, running into the card's right edge and off its bottom. No tint. */
.close-loop{margin-top:var(--space-16);display:grid;grid-template-columns:minmax(0,1fr);background:var(--surface);border:1px solid var(--rule);border-radius:var(--r-card);overflow:hidden}
.close-loop .cl-copy{display:grid;align-content:center;justify-items:start;gap:var(--space-16);padding:var(--space-40) var(--space-32)}
.close-loop .cl-copy > *{margin:0}
.close-loop .loop-mark{width:var(--space-40);height:var(--space-40);color:var(--ink-3)}
.close-loop .loop-mark circle{fill:var(--accent)}
.close-loop :is(h2,h3){font-size:var(--text-heading-l);line-height:var(--leading-heading-l);letter-spacing:var(--tracking-heading-l);color:var(--ink);font-weight:400}
.close-loop .cl-copy p{color:var(--ink-2);font-size:var(--text-body-m);line-height:var(--leading-body-m);max-width:var(--measure-lead)}
.close-loop .loop-cta{margin-top:var(--space-8)}
.close-loop .row{display:flex;flex-wrap:wrap;gap:var(--space-10)}
.cl-shot{position:relative;margin:0;display:grid;gap:var(--space-8);padding:var(--space-32) 0 0 var(--space-32);overflow:hidden}
.cl-shot .win{width:calc(100% + 1px);margin-bottom:calc(var(--space-24) * -1);background:var(--canvas);border-color:var(--rule-2)}
.cl-shot .chg{display:inline-flex;align-items:center;gap:var(--space-6)}
.cl-shot .arr{color:var(--ink-3)}
/* the product cards around the screen's edge: surfaces on a --rule-2 frame, over its padding only */
.cl-shot .pc{margin:0;background:var(--surface);border-color:var(--rule-2);font-size:var(--text-label-sm);line-height:var(--leading-label)}
.cl-shot .pc-a{display:grid;gap:var(--space-4);padding:var(--space-10) var(--space-12)}
.cl-shot .pc-h{font-family:var(--mono);font-size:var(--text-eyebrow);line-height:var(--leading-eyebrow);letter-spacing:var(--tracking-eyebrow);text-transform:uppercase;color:var(--ink-3)}
.cl-shot .pc-l{display:flex;gap:var(--space-8);font-family:var(--mono);font-size:var(--text-mono);line-height:var(--leading-mono);color:var(--ink-3)}
.cl-shot .pc-l b{font-weight:400;color:var(--ink)}
.cl-shot .pc-t{display:flex;gap:var(--space-6);color:var(--ink)}
.cl-shot .pc-t i{font-style:normal;font-family:var(--mono);color:var(--accent)}
.cl-shot .pc-b{display:flex;align-items:center;gap:var(--space-8);padding:var(--space-8) var(--space-12);white-space:nowrap}
.cl-shot .pc-b b{font-weight:500}
/* one card carries the colour: the fix itself */
.cl-shot .pc-hi{position:relative;background:var(--accent-wash);border-color:var(--accent)}
.cl-shot .pc-hi::before{content:"";position:absolute;left:-1px;top:-1px;bottom:-1px;width:var(--space-2);background:var(--accent)}
/* the screen: a window with the three macOS dots, then the release line as a summary row */
.cl-shot .dots{display:inline-flex;gap:var(--space-6);margin-right:var(--space-12);flex:none}
.cl-shot .dots i{width:var(--space-10);height:var(--space-10);border-radius:50%} /* loops-allow: window dots are round */
.cl-shot .dots i:nth-child(1){background:#FF5F57} /* loops-allow: macOS window dot, plain hex by the owner's call 2026-10-05 */
.cl-shot .dots i:nth-child(2){background:#FEBC2E} /* loops-allow: macOS window dot, plain hex by the owner's call 2026-10-05 */
.cl-shot .dots i:nth-child(3){background:#28C840} /* loops-allow: macOS window dot, plain hex by the owner's call 2026-10-05 */
.cl-shot .win .fo-h{justify-content:flex-start}
.cl-shot .win .fo-h .stat{margin-left:auto}
.cl-shot .sum{margin:0;padding:var(--space-10) var(--space-16);border-bottom:1px solid var(--rule)}
.cl-shot .sum .pill{border:0;padding:0;color:var(--ink-2)}
.cl-shot .pcs{order:-1;display:grid;justify-items:start;gap:var(--space-8);padding-right:var(--space-32)}
@media (min-width:880px){
  .close-loop{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  .close-loop .cl-copy{padding:var(--space-64)}
  /* the screen sits up and to the right, running off the card's right and bottom edges; the three
     cards stack along its left edge, each overlapping only the screen's 16px left padding */
  .cl-shot{display:block;min-height:100%;padding:0}
  .cl-shot .win{position:absolute;left:calc(var(--space-64) * 3 + var(--space-40) + var(--space-8));top:var(--space-64);right:-1px;bottom:-1px;width:auto;margin:0}
  .cl-shot .pcs{position:absolute;z-index:1;left:var(--space-24);top:var(--space-40);bottom:var(--space-40);width:calc(var(--space-64) * 3 + var(--space-32));padding:0;display:flex;flex-direction:column;align-items:stretch;justify-content:center;gap:var(--space-24)}
  .cl-shot .pc{white-space:normal}

}


