/* Pacton Workbench website and portal.
   One stylesheet built on the tokens below. Dark only, to sit with the app and its screenshots:
   a cool ink base that is darker and bluer than the app's neutral greys, so screenshots read as lit
   panels, and one accent, the app's own Signal blue (shared/theme/PtDarkTheme.cpp, #70B5FF). */

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;

  --ink-0: #070b14;
  --ink-1: #0b111e;
  --ink-2: #111a2b;
  --ink-3: #18233a;
  --line: #22304a;
  --line-strong: #33445f;

  --text: #e8eef7;
  --text-muted: #a3b0c4;
  --text-faint: #7a89a1;

  --signal: #6cb4ff;
  --signal-strong: #9acbff;
  --signal-ink: #06101f;
  --signal-glow: rgba(108, 180, 255, 0.18);
  --signal-wash: rgba(108, 180, 255, 0.07);

  --ok: #3dd6a0;
  --ok-wash: rgba(61, 214, 160, 0.1);
  --warn: #f2c14e;
  --warn-wash: rgba(242, 193, 78, 0.1);
  --danger: #ff7a7a;
  --danger-wash: rgba(255, 122, 122, 0.1);

  /* Graticule: the measurement grid of an oscilloscope screen. */
  --grid-minor: rgba(108, 180, 255, 0.05);
  --grid-major: rgba(108, 180, 255, 0.11);

  --font-sans: "Instrument Sans", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", Consolas, ui-monospace, "SF Mono", Menlo, monospace;

  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.0625rem;
  --step-2: 1.3125rem;
  --step-3: clamp(1.5rem, 1.2rem + 1vw, 1.875rem);
  --step-4: clamp(1.875rem, 1.4rem + 1.8vw, 2.75rem);
  --step-5: clamp(2.5rem, 1.6rem + 3.6vw, 4.5rem);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --space-10: 128px;

  --radius-input: 6px;
  --radius-button: 9px;
  --radius-panel: 14px;
  --radius-frame: 16px;

  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --fast: 140ms;
  --enter: 240ms;

  --content: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --measure: 62ch;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink-0);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

h1,
h2,
h3 {
  margin: 0;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

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

a {
  color: var(--signal);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--signal-strong);
}

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

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--signal-glow);
  border-radius: 4px;
}

.icon {
  width: 1em;
  height: 1em;
  flex: none;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 10;
  padding: var(--space-2) var(--space-4);
  background: var(--signal);
  color: var(--signal-ink);
  border-radius: var(--radius-button);
  font-weight: 600;
}

.skip-link:focus {
  top: var(--space-4);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.wrap {
  width: min(var(--content), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

/* ---------- Wordmark ---------- */
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.wordmark:hover {
  color: var(--text);
}

/* A small screen with a trace: the bench, in one mark. */
.wordmark__mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--ink-3);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--signal);
}

.wordmark__mark svg {
  width: 20px;
  height: 20px;
}

.wordmark__name span {
  color: var(--text-muted);
  font-weight: 500;
}

/* ---------- Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  font: inherit;
  font-weight: 600;
  font-size: var(--step-0);
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--fast) var(--ease-out), border-color var(--fast) var(--ease-out),
    color var(--fast) var(--ease-out);
}

.button--primary {
  background: var(--signal);
  color: var(--signal-ink);
}

.button--primary:hover {
  background: var(--signal-strong);
  color: var(--signal-ink);
}

.button--quiet {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}

.button--quiet:hover {
  border-color: var(--signal);
  color: var(--text);
}

.button--danger {
  background: transparent;
  border-color: rgba(255, 122, 122, 0.45);
  color: var(--danger);
}

.button--danger:hover {
  background: var(--danger-wash);
  color: var(--danger);
}

.button--small {
  min-height: 36px;
  padding: 0 var(--space-4);
  font-size: var(--step--1);
}

.button--block {
  width: 100%;
}

.button--provider {
  justify-content: flex-start;
  gap: var(--space-4);
  width: 100%;
  min-height: 52px;
  background: var(--ink-3);
  border-color: var(--line-strong);
  color: var(--text);
}

.button--provider:hover {
  border-color: var(--signal);
  color: var(--text);
}

.button--provider .icon {
  color: var(--signal);
  width: 18px;
  height: 18px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.inline-form {
  display: inline;
  margin: 0;
}

/* ---------- Site header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(7, 11, 20, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  min-height: 64px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin-left: auto;
}

.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}

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

.site-nav__actions {
  display: flex;
  gap: var(--space-3);
}

.menu-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-button);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.menu-toggle .icon {
  width: 18px;
  height: 18px;
  margin: auto;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: var(--space-9) var(--space-10);
  isolation: isolate;
}

/* The graticule: minor and major divisions, fading out towards the edges. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px), linear-gradient(var(--grid-minor) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-minor) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 60% 40%, #000 30%, transparent 80%);
  mask-image: radial-gradient(ellipse 80% 70% at 60% 40%, #000 30%, transparent 80%);
}

.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: -10%;
  top: 10%;
  width: 70%;
  height: 80%;
  background: radial-gradient(closest-side, rgba(108, 180, 255, 0.16), transparent);
  filter: blur(20px);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--space-8);
  align-items: center;
}

.hero__title {
  font-size: var(--step-5);
  letter-spacing: -0.03em;
  line-height: 1.02;
  font-weight: 650;
}

.hero__lede {
  margin-top: var(--space-5);
  max-width: 44ch;
  color: var(--text-muted);
  font-size: var(--step-2);
  line-height: 1.5;
}

.hero__actions {
  margin-top: var(--space-6);
}

.hero__note {
  margin-top: var(--space-4);
  color: var(--text-faint);
  font-size: var(--step--1);
}

.hero__visual {
  position: relative;
  margin-right: calc(-1 * var(--gutter) - 6vw);
}

/* One trace drawn across the graticule when the page opens. */
.trace {
  position: absolute;
  z-index: -1;
  left: -12%;
  right: -8%;
  bottom: -88px;
  height: 150px;
  overflow: visible;
  pointer-events: none;
}

.trace path {
  fill: none;
  stroke: var(--signal);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(108, 180, 255, 0.7));
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
  animation: trace-draw 1.8s var(--ease-out) 0.15s both;
}

@keyframes trace-draw {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}

/* ---------- Screenshot frame ---------- */
.shot {
  margin: 0;
  border-radius: var(--radius-frame);
  background: #1e1e1e;
  box-shadow: 0 0 0 1px var(--line-strong), 0 1px 0 0 rgba(255, 255, 255, 0.06) inset, 0 30px 80px -20px rgba(0, 0, 0, 0.7),
    0 0 120px -30px rgba(108, 180, 255, 0.35);
  overflow: hidden;
}

.shot__bar {
  display: flex;
  align-items: center;
  height: 34px;
  padding-left: var(--space-4);
  background: #2b2b2e;
  border-bottom: 1px solid #1a1a1c;
  color: #c8c8c8;
  font-size: 12px;
}

.shot__controls {
  display: flex;
  margin-left: auto;
  height: 100%;
}

.shot__controls span {
  display: grid;
  place-items: center;
  width: 44px;
  color: #a8a8a8;
}

.shot__controls .icon {
  width: 14px;
  height: 14px;
}

.shot__body img {
  width: 100%;
  height: auto;
}

.shot__placeholder {
  display: grid;
  place-content: center;
  gap: var(--space-2);
  aspect-ratio: 16 / 10;
  padding: var(--space-6);
  text-align: center;
  color: var(--text-faint);
  font-size: var(--step--1);
  background-color: #1e1e1e;
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
}

.shot__placeholder strong {
  color: var(--text-muted);
  font-weight: 600;
  font-size: var(--step-0);
}

.shot--wide .shot__placeholder {
  aspect-ratio: 2 / 1;
}

/* ---------- Sections ---------- */
.section {
  padding-block: var(--space-9);
}

.section--band {
  background: var(--ink-1);
  border-block: 1px solid var(--line);
}

.section__head {
  max-width: 46rem;
}

.section__title {
  font-size: var(--step-4);
}

.section__lede {
  margin-top: var(--space-4);
  color: var(--text-muted);
  font-size: var(--step-1);
  max-width: var(--measure);
}

.instruments {
  padding-block: var(--space-6);
  border-block: 1px solid var(--line);
  background: var(--ink-1);
}

.instruments__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3) var(--space-6);
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
}

.instruments__list li {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.instruments__list .icon {
  color: var(--signal);
}

/* Feature rows: text beside a framed screenshot, sides alternating. */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: var(--space-8);
  align-items: center;
}

.feature + .feature {
  margin-top: var(--space-10);
}

.feature--flip .feature__text {
  order: 2;
}

.feature__title {
  font-size: var(--step-3);
}

.feature__text p {
  margin-top: var(--space-4);
  color: var(--text-muted);
  max-width: 48ch;
}

.points {
  display: grid;
  gap: var(--space-3);
  margin: var(--space-5) 0 0;
  padding: 0;
  list-style: none;
}

.points li {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: var(--space-3);
  color: var(--text-muted);
}

.points .icon {
  margin-top: 0.3em;
  color: var(--signal);
}

/* The version rail: a component's versions as a sequence, with the draft that becomes the next. */
.versions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: var(--space-7) 0 0;
  padding: 0;
  list-style: none;
  position: relative;
}

.versions::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 11px;
  height: 2px;
  background: linear-gradient(90deg, var(--signal) 0 75%, var(--line-strong) 75%);
}

.versions li {
  position: relative;
  padding-top: var(--space-7);
  padding-right: var(--space-5);
}

.versions li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ink-0);
  border: 2px solid var(--signal);
}

.versions li.versions__draft::before {
  border-style: dashed;
  border-color: var(--text-faint);
}

.versions h3 {
  font-size: var(--step-1);
}

.versions p {
  margin-top: var(--space-2);
  color: var(--text-muted);
  font-size: var(--step--1);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 2px var(--space-3);
  border-radius: 999px;
  background: var(--warn-wash);
  color: var(--warn);
  font-size: var(--step--1);
  font-weight: 600;
}

.status-pill--ok {
  background: var(--ok-wash);
  color: var(--ok);
}

/* Download band */
.download {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-6);
  align-items: center;
  padding: var(--space-7);
  border-radius: var(--radius-frame);
  background: radial-gradient(120% 140% at 100% 0%, rgba(108, 180, 255, 0.14), transparent 55%), var(--ink-2);
  box-shadow: 0 0 0 1px var(--line);
}

.download p {
  margin-top: var(--space-3);
  color: var(--text-muted);
  max-width: var(--measure);
}

/* Footer */
.site-footer {
  padding-block: var(--space-7);
  border-top: 1px solid var(--line);
  color: var(--text-faint);
  font-size: var(--step--1);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.site-footer nav {
  display: flex;
  gap: var(--space-5);
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--text);
}

/* ---------- Sign-in and security pages ---------- */
.auth {
  display: grid;
  min-height: 100vh;
  grid-template-rows: auto 1fr auto;
}

.auth__top {
  padding: var(--space-5) var(--gutter);
}

.auth__main {
  display: grid;
  place-items: start center;
  padding: var(--space-7) var(--gutter) var(--space-9);
}

.panel {
  width: min(460px, 100%);
  padding: var(--space-7) var(--space-6);
  border-radius: var(--radius-panel);
  background: var(--ink-2);
  box-shadow: 0 0 0 1px var(--line), 0 24px 60px -30px rgba(0, 0, 0, 0.8);
}

.panel--wide {
  width: min(620px, 100%);
}

.panel__title {
  font-size: var(--step-3);
}

.panel__lede {
  margin-top: var(--space-3);
  color: var(--text-muted);
}

.panel__body {
  display: grid;
  gap: var(--space-5);
  margin-top: var(--space-6);
}

.panel__foot {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
  color: var(--text-faint);
  font-size: var(--step--1);
}

.steps {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: var(--space-3);
  align-items: baseline;
  color: var(--text-muted);
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ink-3);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--signal);
  font-size: var(--step--1);
  font-weight: 650;
}

.qr {
  display: grid;
  place-items: center;
  margin: 0;
  padding: var(--space-4);
  border-radius: var(--radius-panel);
  background: #ffffff;
  justify-self: center;
}

.qr svg {
  width: 196px;
  height: 196px;
}

.secret {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-input);
  background: var(--ink-1);
  box-shadow: inset 0 0 0 1px var(--line);
}

.secret code {
  font-size: var(--step-0);
  letter-spacing: 0.04em;
  word-break: break-all;
}

.codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2) var(--space-4);
  margin: 0;
  padding: var(--space-5);
  border-radius: var(--radius-input);
  background: var(--ink-1);
  box-shadow: inset 0 0 0 1px var(--line);
  list-style: none;
}

.codes code {
  font-size: var(--step-1);
  letter-spacing: 0.06em;
}

.client-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-2) var(--space-5);
  margin: 0;
  padding: var(--space-5);
  border-radius: var(--radius-input);
  background: var(--ink-1);
  box-shadow: inset 0 0 0 1px var(--line);
}

.client-facts dt {
  color: var(--text-faint);
}

.client-facts dd {
  margin: 0;
}

/* ---------- Forms ---------- */
.field {
  display: grid;
  gap: var(--space-2);
}

.field label,
.field__label {
  font-weight: 600;
  font-size: var(--step--1);
  color: var(--text-muted);
}

.input,
.select {
  width: 100%;
  min-height: 44px;
  padding: 0 var(--space-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-input);
  background: var(--ink-1);
  color: var(--text);
  font: inherit;
  transition: border-color var(--fast) var(--ease-out);
}

.input:hover,
.select:hover {
  border-color: #46597a;
}

.input:focus-visible,
.select:focus-visible {
  border-color: var(--signal);
  border-radius: var(--radius-input);
}

.input--code {
  font-family: var(--font-mono);
  font-size: var(--step-2);
  letter-spacing: 0.3em;
  text-align: center;
}

.check {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 32px;
  color: var(--text);
  cursor: pointer;
}

.check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--signal);
}

.message {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-input);
  font-size: var(--step--1);
}

.message .icon {
  margin-top: 0.3em;
}

.message--error {
  background: var(--danger-wash);
  color: #ffc2c2;
  box-shadow: inset 0 0 0 1px rgba(255, 122, 122, 0.35);
}

.message--error .icon {
  color: var(--danger);
}

.message--ok {
  background: var(--ok-wash);
  color: #bdf3df;
  box-shadow: inset 0 0 0 1px rgba(61, 214, 160, 0.3);
}

.message--ok .icon {
  color: var(--ok);
}

.message--warn {
  background: var(--warn-wash);
  color: #f8e2a8;
  box-shadow: inset 0 0 0 1px rgba(242, 193, 78, 0.3);
}

.message--warn .icon {
  color: var(--warn);
}

/* ---------- Portal (signed in) ---------- */
.portal-bar {
  border-bottom: 1px solid var(--line);
  background: var(--ink-1);
}

.portal-bar__inner {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  min-height: 60px;
}

.portal-bar__org {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-input);
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--step--1);
  box-shadow: inset 0 0 0 1px var(--line);
}

.portal-bar__org:hover {
  color: var(--text);
}

.portal-nav {
  display: flex;
  gap: var(--space-1);
  margin-left: auto;
}

.portal-nav a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 36px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-input);
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--step--1);
}

.portal-nav a:hover {
  color: var(--text);
  background: var(--ink-3);
}

.portal-nav a[aria-current="page"] {
  color: var(--text);
  background: var(--ink-3);
  box-shadow: inset 0 -2px 0 var(--signal);
}

.portal-main {
  padding-block: var(--space-7) var(--space-9);
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.page-head h1 {
  font-size: var(--step-4);
}

.page-head p {
  margin-top: var(--space-2);
  color: var(--text-muted);
}

.stack {
  display: grid;
  gap: var(--space-6);
}

.block {
  padding: var(--space-6);
  border-radius: var(--radius-panel);
  background: var(--ink-2);
  box-shadow: 0 0 0 1px var(--line);
}

.block__title {
  font-size: var(--step-2);
}

.block__lede {
  margin-top: var(--space-2);
  color: var(--text-muted);
  max-width: var(--measure);
}

.block__body {
  margin-top: var(--space-5);
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: var(--space-6);
  align-items: start;
}

.rows {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--line);
}

.row__main {
  min-width: 0;
}

.row__title {
  font-weight: 600;
}

.row__meta {
  margin-top: 2px;
  color: var(--text-faint);
  font-size: var(--step--1);
  overflow-wrap: anywhere;
}

.row__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
}

.row__detail {
  grid-column: 1 / -1;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: var(--space-2);
  padding: 1px var(--space-2);
  border-radius: 999px;
  background: var(--ink-3);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  vertical-align: 2px;
}

.badge--admin {
  background: var(--signal-wash);
  color: var(--signal);
}

.badge--warn {
  background: var(--warn-wash);
  color: var(--warn);
}

.access {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-5);
}

details.more > summary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 36px;
  color: var(--text-muted);
  font-size: var(--step--1);
  cursor: pointer;
  list-style: none;
}

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

details.more > summary:hover {
  color: var(--text);
}

details.more[open] > summary {
  color: var(--text);
}

.more__body {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-4);
  margin-top: var(--space-2);
  border-radius: var(--radius-input);
  background: var(--ink-1);
  box-shadow: inset 0 0 0 1px var(--line);
}

.empty {
  padding: var(--space-6);
  border-radius: var(--radius-input);
  background: var(--ink-1);
  color: var(--text-muted);
  text-align: center;
}

.facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3) var(--space-6);
  margin: 0;
}

.facts dt {
  color: var(--text-faint);
}

.facts dd {
  margin: 0;
}

/* ---------- Small screens ---------- */
@media (max-width: 1080px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-7);
  }

  .hero__visual {
    margin-right: 0;
  }

  .trace {
    left: -4%;
    right: -4%;
    bottom: -64px;
  }
}

@media (max-width: 960px) {
  .hero__grid,
  .feature,
  .two-col,
  .download {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero {
    padding-block: var(--space-7) var(--space-8);
  }

  .hero__visual {
    margin-right: 0;
  }


  .feature--flip .feature__text {
    order: 0;
  }

  .feature {
    gap: var(--space-6);
  }

  .feature + .feature {
    margin-top: var(--space-8);
  }

  .versions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: var(--space-5);
  }

  .versions::before {
    display: none;
  }
}

@media (max-width: 720px) {
  .menu-toggle {
    display: grid;
  }

  .site-header__inner {
    flex-wrap: wrap;
  }

  .site-nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-bottom: var(--space-4);
  }

  .site-nav a {
    padding: var(--space-3) 0;
  }

  .site-nav__actions {
    flex-direction: column;
    margin-top: var(--space-3);
  }

  .site-header[data-open] .site-nav {
    display: flex;
  }

  .section {
    padding-block: var(--space-8);
  }

  .panel {
    padding: var(--space-6) var(--space-5);
  }

  .block {
    padding: var(--space-5);
  }

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

  .row__actions {
    justify-content: flex-start;
  }

  .portal-bar__inner {
    flex-wrap: wrap;
    padding-block: var(--space-3);
  }

  .portal-nav {
    margin-left: 0;
    flex-basis: 100%;
    overflow-x: auto;
  }

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

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

  .download {
    padding: var(--space-6) var(--space-5);
  }
}

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

  .trace path {
    animation: none;
  }
}

.library-shot {
  margin-top: var(--space-7);
}

fieldset.field {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
