/* The brand faces ship with the build (staged from bridge/assets/fonts by the
 * builder). Relying on the reader having IBM Plex installed meant the design
 * system's own page could render in a system font — DESIGN.md R3 applies here
 * first. CJK falls through to the installed KR/JP cut named in --font-sans. */
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('assets/fonts/IBMPlexSans-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('assets/fonts/IBMPlexSans-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('assets/fonts/JetBrainsMono-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('assets/fonts/JetBrainsMono-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

* {
  box-sizing: border-box;
}
/* Author-level display rules (for example `.lightbox { display: flex }`) beat
 * the browser's built-in `[hidden] { display: none }`. Keep the HTML `hidden`
 * contract authoritative for every viewer surface, including overlays. */
[hidden] {
  display: none !important;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  color: var(--ink-900);
  background: var(--tide-50);
  font-family: var(--font-sans);
  font-feature-settings: 'ss01', 'cv11';
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button,
input,
select {
  font: inherit;
}
a {
  color: var(--kelp-700);
}
code,
pre,
.kicker,
.badge,
.rail-title,
.path,
dt {
  font-family: var(--font-mono);
  font-feature-settings: 'zero', 'ss01';
}
.skip-link {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--ink-900);
  color: var(--tide-50);
  border-radius: var(--r-md);
}
.skip-link:focus {
  top: 16px;
}

/* GNB-CSS:BEGIN (generated from scripts/pages-nav.css — do not edit by hand) */
.nav {
  position: sticky;
  top: 0;
  z-index: 200;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--tide-50) 85%, transparent);
  border-bottom: 1px solid var(--tide-200);
}
.nav-in {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink-900);
  /* Family inherits from the page body (IBM Plex on every surface), so the bar
     needs no --font-sans token — which keeps it out of the token-sync gate. */
  font-weight: 700;
  font-size: 17px;
  line-height: 1;
  letter-spacing: -0.01em;
}
.brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}
.nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.nav-links a {
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  color: var(--ink-700);
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links a.active {
  background: var(--tide-200);
  color: var(--ink-900);
}
.nav-links a.gh {
  color: var(--tide-50);
  background: var(--ink-800);
}
.nav-links a.gh:hover {
  background: var(--ink-900);
  color: var(--tide-50);
}
.lang {
  /* A <select> does not inherit font-family by default, so state it. */
  font-family: inherit;
  font-weight: 500;
  font-size: 13px;
  color: var(--ink-700);
  background: var(--tide-100);
  border: 1px solid var(--tide-200);
  border-radius: 999px;
  padding: 5px 10px;
  cursor: pointer;
}
.lang:hover {
  background: var(--tide-200);
  color: var(--ink-900);
}
@media (max-width: 768px) {
  .nav-in {
    align-items: flex-start;
    padding-inline: 16px;
  }
  .nav-links {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }
  .nav-links a {
    white-space: nowrap;
  }
  .nav-links .gh {
    display: none;
  }
}
/* GNB-CSS:END */


.system-head {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 40px var(--container-pad) 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 64px;
  align-items: end;
  border-bottom: 1px solid var(--tide-200);
}
.kicker {
  margin: 0 0 12px;
  color: var(--kelp-700);
  font-size: var(--t-kicker);
  font-weight: 600;
  letter-spacing: var(--tr-kicker);
  text-transform: uppercase;
}
h1 {
  margin: 0;
  max-width: 820px;
  font-size: var(--t-page-title);
  line-height: 1.02;
  letter-spacing: var(--tr-hero);
  font-weight: 600;
}
h1 em {
  color: var(--kelp-700);
  font-weight: inherit;
}
.lede {
  max-width: 68ch;
  margin: 20px 0 0;
  color: var(--ink-700);
  font-size: var(--t-lede);
}
.system-head__controls {
  display: grid;
  gap: 12px;
}
.search,
.search span {
  font-family: var(--font-mono);
  color: var(--ink-500);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.search input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink-900);
  background: var(--tide-100);
  border: 1px solid var(--tide-200);
  border-radius: var(--r-lg);
  outline: none;
}
.search input:focus {
  border-color: var(--kelp-500);
  box-shadow: 0 0 0 3px rgba(47, 138, 124, 0.15);
}

.workspace {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad) 96px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 40px;
}
.rail {
  position: sticky;
  top: 73px;
  align-self: start;
  max-height: calc(100vh - 73px);
  overflow: auto;
  padding: 32px 0;
}
.rail-group + .rail-group {
  margin-top: 22px;
}
.rail-title {
  margin: 0 0 8px;
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
/* Collapsible Project toggle button */
.rail-title--toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: left;
  border-radius: var(--r-sm);
  transition: color 0.15s;
}
.rail-title--toggle:hover {
  color: var(--ink-700);
}
.rail-toggle-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--r-pill);
  background: var(--tide-200);
  color: var(--ink-500);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1;
}
.rail-toggle-chevron {
  margin-left: auto;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  transition: transform 0.2s var(--ease-snap, ease);
}
.rail-toggle-chevron::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  margin: auto;
}
.rail-group--collapsible.is-open .rail-toggle-chevron {
  transform: rotate(180deg);
}
.rail-group-body {
  overflow: hidden;
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.22s var(--ease-snap, ease);
}
.rail-group--collapsible:not(.is-open) .rail-group-body {
  visibility: hidden;
}
.rail-group-inner {
  min-height: 0;
}
.rail-group--collapsible.is-open .rail-group-body {
  grid-template-rows: 1fr;
  margin-top: 4px;
}
.rail-button {
  width: 100%;
  display: block;
  padding: 7px 10px;
  color: var(--ink-700);
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: var(--r-md);
  cursor: pointer;
}
.rail-button span:first-child {
  display: block;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.rail-button:hover {
  background: var(--tide-100);
  color: var(--ink-900);
}
.rail-button.active {
  color: var(--tide-50);
  background: var(--ink-900);
}
.rail-button.active small {
  color: var(--kelp-300);
}
.rail-note {
  margin-top: 24px;
  padding: 14px;
  border: 1px solid var(--tide-200);
  border-radius: var(--r-xl);
  background: var(--tide-100);
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 2px 9px;
  align-items: center;
}
.rail-note strong {
  font-size: 12px;
}
.rail-note small {
  grid-column: 2;
  color: var(--ink-500);
  font-size: 10px;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--r-pill);
  background: var(--kelp-500);
  box-shadow: 0 0 0 3px rgba(47, 138, 124, 0.2);
}

.content {
  min-width: 0;
  padding: 32px 0;
}
.fallback {
  margin-bottom: 16px;
  padding: 10px 14px;
  color: var(--coral-700);
  background: rgba(192, 87, 58, 0.08);
  border-left: 3px solid var(--coral-500);
  border-radius: var(--r-md);
  font-size: 13px;
}
.content-head {
  display: flex;
  justify-content: space-between;
  gap: 32px;
  align-items: flex-start;
  min-height: 122px;
  padding-bottom: 24px;
}
.content-head h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: var(--tr-h2);
}
.description {
  max-width: 66ch;
  margin: 10px 0 0;
  color: var(--ink-500);
}
.badges {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  color: var(--tide-50);
  background: var(--ink-700);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge.canonical {
  background: var(--kelp-700);
}
.badge.required {
  background: var(--coral-700);
}
.view-tabs {
  display: flex;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--tide-200);
  border-radius: var(--r-xl);
  background: var(--tide-100);
}
.view-tabs button {
  flex: 0 1 140px;
  min-height: 34px;
  color: var(--ink-500);
  background: transparent;
  border: 0;
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.view-tabs button:hover {
  color: var(--ink-900);
}
.view-tabs button.active {
  color: var(--tide-50);
  background: var(--ink-900);
}
.view {
  min-height: 480px;
  margin-top: 24px;
}

.markdown {
  max-width: 880px;
}
.markdown h1 {
  margin: 0 0 20px;
  font-size: 38px;
  line-height: 1.1;
}
.markdown h2 {
  margin: 52px 0 16px;
  padding-top: 4px;
  font-size: 27px;
  line-height: 1.2;
  letter-spacing: var(--tr-h3);
  border-top: 1px solid var(--tide-200);
}
.markdown h3 {
  margin: 32px 0 12px;
  font-size: 20px;
}
.markdown p {
  margin: 0 0 16px;
}
.markdown ul,
.markdown ol {
  margin: 0 0 18px;
  padding-left: 24px;
}
.markdown li + li {
  margin-top: 5px;
}
.markdown blockquote {
  margin: 20px 0;
  padding: 10px 18px;
  color: var(--ink-700);
  background: var(--tide-100);
  border-left: 3px solid var(--kelp-500);
  border-radius: var(--r-md);
}
.markdown code {
  padding: 1px 5px;
  color: var(--coral-700);
  background: var(--tide-100);
  border-radius: var(--r-sm);
  font-size: 0.88em;
}
.markdown pre,
.source-code {
  margin: 20px 0;
  padding: 20px;
  overflow: auto;
  color: var(--tide-100);
  background: var(--ink-900);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-card);
  font: 12.5px/1.65 var(--font-mono);
  tab-size: 2;
  white-space: pre;
}
.markdown pre code {
  padding: 0;
  color: inherit;
  background: transparent;
}
.table-wrap {
  width: 100%;
  margin: 20px 0 28px;
  overflow-x: auto;
  border: 1px solid var(--tide-200);
  border-radius: var(--r-xl);
}
.markdown table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.markdown th {
  color: var(--tide-50);
  background: var(--ink-800);
  text-align: left;
  font-weight: 600;
}
.markdown th,
.markdown td {
  min-width: 105px;
  padding: 9px 11px;
  vertical-align: top;
  border-bottom: 1px solid var(--tide-200);
}
.markdown tr:last-child td {
  border-bottom: 0;
}
.markdown tbody tr:nth-child(even) {
  background: rgba(235, 230, 214, 0.45);
}
.markdown hr {
  border: 0;
  border-top: 1px solid var(--tide-200);
  margin: 40px 0;
}

.metadata-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}
.metadata-grid > div {
  padding: 15px 16px;
  background: var(--tide-100);
  border: 1px solid var(--tide-200);
  border-radius: var(--r-lg);
}
.metadata-grid dt {
  margin: 0 0 5px;
  color: var(--kelp-700);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.metadata-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}
.metadata-grid ul {
  margin: 0;
  padding-left: 18px;
}

.specimen-intro {
  margin-bottom: 24px;
  color: var(--ink-500);
}
.token-groups {
  display: grid;
  gap: 32px;
}
.token-section h3 {
  margin: 0 0 12px;
  font-size: 18px;
}
.token-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 10px;
}
.token-card {
  min-width: 0;
  overflow: hidden;
  background: var(--tide-100);
  border: 1px solid var(--tide-200);
  border-radius: var(--r-xl);
}
.swatch {
  height: 68px;
  background: var(--swatch);
  border-bottom: 1px solid var(--tide-200);
}
.token-copy {
  padding: 10px 12px;
}
.token-copy strong,
.token-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.token-copy strong {
  font: 11px var(--font-mono);
}
.token-copy small {
  margin-top: 3px;
  color: var(--ink-500);
  font: 10px var(--font-mono);
}
.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}
.asset-card {
  padding: 18px;
  background: var(--tide-100);
  border: 1px solid var(--tide-200);
  border-radius: var(--r-2xl);
}
.asset-stage {
  height: 150px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  background-color: var(--tide-50);
  background-image:
    linear-gradient(45deg, rgba(14, 31, 31, 0.035) 25%, transparent 25%, transparent 75%, rgba(14, 31, 31, 0.035) 75%),
    linear-gradient(45deg, rgba(14, 31, 31, 0.035) 25%, transparent 25%, transparent 75%, rgba(14, 31, 31, 0.035) 75%);
  background-position:
    0 0,
    8px 8px;
  background-size: 16px 16px;
  border-radius: var(--r-lg);
}
.asset-stage img {
  max-width: 112px;
  max-height: 112px;
}
.asset-card h3 {
  margin: 0;
  font-size: 15px;
}
.asset-card p {
  margin: 3px 0 0;
  color: var(--ink-500);
  font: 10px var(--font-mono);
  overflow-wrap: anywhere;
}
.asset-groups {
  display: grid;
  gap: 44px;
}
.asset-section-head {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--tide-200);
}
.asset-section-head h3 {
  margin: 0;
  font-size: 20px;
  letter-spacing: var(--tr-h3);
}
.asset-section-head p {
  max-width: 78ch;
  margin: 6px 0 0;
  color: var(--ink-500);
  font-size: 12.5px;
  line-height: 1.55;
}
.asset-stage--spec {
  padding: 0;
  background-image: none;
}
/* Masks are alpha only — the surface supplies the color, so the viewer paints
 * them in ink and lets the checkerboard read through the transparent cells. */
.asset-stage--mask {
  padding: 18px;
  color: var(--ink-900);
}
.asset-stage--mask svg {
  width: 100%;
  height: 100%;
  max-width: 118px;
  max-height: 118px;
}
.asset-stage--type {
  grid-auto-flow: row;
  gap: 6px;
  padding: 14px;
  color: var(--ink-900);
  text-align: center;
}
/* Scoped to the asset stage on purpose: `.type-sample` and `.type-row` already
 * belong to the Component lab type scale. */
.asset-stage--type .face-aa {
  font-size: 56px;
  line-height: 1;
  font-weight: 700;
}
.asset-stage--type .face-sample {
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-700);
  /* The stage centres its children, so an auto-width line overflows the card
   * instead of wrapping. Pin the width and let it break. */
  width: 100%;
  /* nowrap is inherited from the card chrome — a specimen line must wrap. */
  white-space: normal;
  overflow-wrap: anywhere;
}
.asset-hatch {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: var(--r-lg);
}
.asset-card--spec .asset-note {
  margin: 6px 0 8px;
  color: var(--ink-700);
  font: 12px/1.5 var(--font-sans);
}
.asset-link {
  display: inline-block;
  margin-top: 10px;
  font: 11px var(--font-mono);
}
/* === Component lab ===
 * The stage hosts canonical `.ad-*` markup from design/components.css and
 * design/patterns.css. Nothing below may restyle an `.ad-*` class — these rules
 * only lay specimens out and label them.
 */
.specimen-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.specimen {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 24px;
  background: var(--tide-100);
  border: 1px solid var(--tide-200);
  border-radius: var(--r-2xl);
}
.specimen--wide {
  grid-column: 1 / -1;
}
.specimen-head .ad-kicker {
  margin-bottom: 6px;
}
.specimen-head h3 {
  margin: 0 0 8px;
  font-size: 20px;
  letter-spacing: var(--tr-h3);
}
.specimen-class {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  color: var(--ink-700);
  background: var(--tide-50);
  border: 1px solid var(--tide-200);
  border-radius: var(--r-sm);
  font-size: 11px;
  overflow-wrap: anywhere;
}
.specimen-class-label {
  color: var(--ink-300);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.specimen-stage {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  padding: 20px;
  background: var(--tide-50);
  border: 1px solid var(--tide-200);
  border-radius: var(--r-xl);
}
.specimen-stage > * {
  min-width: 0;
}
.specimen-note {
  margin: auto 0 0;
  color: var(--ink-500);
  font-size: 12.5px;
  line-height: 1.55;
}
.specimen-copy {
  margin: 5px 0 0;
  color: var(--ink-500);
  font-size: 12.5px;
}
.specimen-inkpad {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--r-md);
}
.specimen-inkpad .ad-kicker {
  margin-bottom: 0;
}
.specimen-inkwrap {
  padding: 12px;
  border-radius: var(--r-2xl);
}
.specimen-cards,
.specimen-devices,
.specimen-patterns,
.specimen-surfaces {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}
.specimen-patterns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.specimen-stack {
  display: grid;
  gap: 10px;
  width: 100%;
}
.specimen-hatch {
  min-height: 200px;
  border: 1px solid var(--tide-200);
  border-radius: var(--r-3xl);
}
.specimen-surface {
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 96px;
  padding: 18px;
  border: 1px solid var(--tide-200);
  border-radius: var(--r-lg);
}
.specimen-surface .ad-kicker {
  margin-bottom: 0;
}
.specimen-surface small {
  font: 10px var(--font-mono);
  opacity: 0.7;
}
.type-scale {
  display: grid;
  gap: 14px;
  width: 100%;
}
.type-row {
  display: grid;
  grid-template-columns: 132px 84px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--tide-200);
}
.type-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.type-row code {
  color: var(--kelp-700);
  font-size: 11px;
}
.type-row small {
  color: var(--ink-500);
  font: 10px var(--font-mono);
}
.type-sample {
  min-width: 0;
  overflow: hidden;
  line-height: 1.08;
  letter-spacing: var(--tr-h2);
  white-space: nowrap;
}

/* === Token specimens ===
 * A token is only legible through the property it drives, so each group gets a
 * stage that applies the raw value the way a consumer would.
 */
.tk-stage {
  display: grid;
  place-items: center;
  height: 68px;
  padding: 10px;
  overflow: hidden;
  border-bottom: 1px solid var(--tide-200);
}
.tk-stage--bar,
.tk-stage--motion {
  place-items: center start;
}
.tk-stage--shadow {
  background: var(--tide-50);
}
.tk-radius {
  width: 46px;
  height: 46px;
  background: var(--ink-900);
}
.tk-bar {
  height: 10px;
  background: var(--kelp-500);
  border-radius: var(--r-pill);
}
.tk-type {
  color: var(--ink-900);
  line-height: 1.1;
  white-space: nowrap;
}
.tk-motion {
  width: 12px;
  height: 12px;
  background: var(--kelp-500);
  border-radius: var(--r-pill);
  animation-name: tk-travel;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}
@keyframes tk-travel {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(96px);
  }
}
.tk-shadow {
  width: 74px;
  height: 34px;
  background: var(--tide-100);
  border-radius: var(--r-md);
}
@media (prefers-reduced-motion: reduce) {
  .tk-motion {
    animation: none;
  }
}

footer {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 24px var(--container-pad) 48px;
  display: flex;
  justify-content: space-between;
  color: var(--ink-500);
  border-top: 1px solid var(--tide-200);
  font-size: 12px;
}

@media (max-width: 980px) {
  /* GNB responsive rules live in the canonical GNB-CSS block. */
  .system-head {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .system-head__controls {
    grid-template-columns: 1fr 220px;
  }
  .workspace {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 24px;
  }
}
@media (max-width: 720px) {
  :root {
    --container-pad: 18px;
  }
  /* GNB responsive rules live in the canonical GNB-CSS block. */
  .system-head {
    padding-top: 44px;
  }
  .system-head__controls {
    grid-template-columns: 1fr;
  }
  .workspace {
    display: block;
  }
  .rail {
    position: static;
    max-height: none;
    padding: 22px 0 0;
    overflow: visible;
  }
  #navigation {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
  }
  /* Flatten both regular and collapsible groups into one horizontal chip row.
   * Leaving the Project wrappers as a grid makes their tall inner list set
   * the flex line height and stretches every sibling button to ~1000px. */
  .rail-group,
  .rail-group-body,
  .rail-group-inner {
    display: contents;
  }
  .rail-group-body {
    visibility: visible !important;
  }
  .rail-title,
  .rail-note {
    display: none;
  }
  .rail-button {
    flex: 0 0 auto;
    width: auto;
    border: 1px solid var(--tide-200);
    background: var(--tide-100);
  }
  .content-head {
    display: block;
    min-height: 0;
  }
  .badges {
    justify-content: flex-start;
    margin-top: 14px;
  }
  .view-tabs button {
    flex: 1;
  }
  .metadata-grid,
  .specimen-grid,
  .specimen-cards,
  .specimen-devices,
  .specimen-patterns,
  .specimen-surfaces {
    grid-template-columns: 1fr;
  }
  .type-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .type-sample {
    grid-column: 1 / -1;
  }
  .markdown h1 {
    font-size: 31px;
  }
  footer {
    display: block;
  }
  footer span {
    display: block;
  }
}

/* ── Asset card: image zoom hint ──────────────────────────────────────────── */
.asset-card--img {
  cursor: zoom-in;
  transition: transform 0.15s var(--ease-snap, ease), box-shadow 0.15s;
}
.asset-card--img:hover,
.asset-card--img:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(14, 31, 31, 0.12);
  outline: none;
}
.asset-stage {
  position: relative;
}
.asset-zoom-hint {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 3px 8px;
  border-radius: var(--r-pill);
  background: rgba(14, 31, 31, 0.72);
  color: var(--tide-50);
  font: 10px var(--font-mono);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
  pointer-events: none;
}
.asset-card--img:hover .asset-zoom-hint,
.asset-card--img:focus-visible .asset-zoom-hint {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.asset-stage img {
  max-width: 140px;
  max-height: 140px;
  transition: transform 0.2s var(--ease-snap, ease);
}
.asset-card--img:hover .asset-stage img {
  transform: scale(1.05);
}

/* ── Lightbox ─────────────────────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(14, 31, 31, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: lb-in 0.18s var(--ease-snap, ease) both;
}
@keyframes lb-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
body.lightbox-open {
  overflow: hidden;
}
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--r-pill);
  color: var(--tide-50);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s;
}
.lightbox-close:hover {
  background: rgba(255,255,255,0.2);
}
.lightbox-fig {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: min(90vw, 1100px);
  max-height: 90vh;
}
.lightbox-fig img {
  max-width: 100%;
  max-height: calc(90vh - 60px);
  object-fit: contain;
  border-radius: var(--r-xl);
  box-shadow: var(--sh-frame);
}
.lightbox-fig figcaption {
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  text-align: center;
}

/* ── Copy HTML button ─────────────────────────────────────────────────────── */
.specimen-head-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.specimen-copy-btn {
  margin-left: auto;
  padding: 3px 9px;
  border: 1px solid var(--tide-200);
  border-radius: var(--r-sm);
  background: var(--tide-50);
  color: var(--ink-500);
  font: 10px var(--font-mono);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.specimen-copy-btn:hover {
  background: var(--ink-900);
  color: var(--tide-50);
  border-color: var(--ink-900);
}

/* ── Copy toast ───────────────────────────────────────────────────────────── */
.copy-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9100;
  padding: 9px 16px;
  border-radius: var(--r-xl);
  background: var(--ink-900);
  color: var(--tide-50);
  font: 600 12px var(--font-sans);
  box-shadow: 0 6px 24px rgba(14,31,31,0.25);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.18s, transform 0.18s;
  pointer-events: none;
}
.copy-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Markdown inline images ───────────────────────────────────────────────── */
.markdown .md-img {
  display: block;
  max-width: 100%;
  margin: 20px 0;
  border-radius: var(--r-xl);
  cursor: zoom-in;
  transition: opacity 0.15s;
}
.markdown .md-img:hover {
  opacity: 0.9;
}
