/* =============================================================
   library.css: the component library's own chrome. Navigation,
   labels, specimen frames, notes and tables. Everything is scoped
   under .lib or a .lib-* class so it never touches a component.

   Colors, type and most sizes come from the prototype's tokens
   (../prototype/css/tokens.css), which this page loads in the locked
   state (F, hero 3, brand 5, room 0). The few values the chrome needs
   that have no token are named once in the block below.
   ============================================================= */

.lib {
  --lib-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --lib-code-size: 0.8125rem;                    /* 13, class names and token names */
  --lib-top-h: 56px;                             /* the library's own top bar */
  --lib-prose: 76ch;                             /* running text in the library */
  --lib-swatch: 72px;                            /* a color swatch's height */
  --lib-swatch-mini: 14px;                       /* the dot beside a color token in a table */
  --lib-shot-min: 280px;                         /* the narrowest a captured image sits */
  --lib-bar-h: 12px;                             /* a spacing bar's thickness */
  --lib-label-col: 220px;                        /* the name column in type and spacing rows */
  --lib-box: 160px;                              /* a radius or shadow sample */
  --lib-box-h: 96px;
  --lib-demo-h: 120px;                           /* the grid diagram's height */
  --lib-glyph-min: 200px;                        /* an icon sample's narrowest */
  --lib-filter-w: 420px;                         /* the token filter field */
  --lib-underline-offset: 0.2em;                 /* links in the library's own prose */
  --lib-new-fill: var(--text);                   /* the newest version's tag and the pressed switch */
  --lib-new-ink: var(--raised);
  /* The phone views (v1.1, 20 October): each shown at most at its own 390, side by
     side in columns no narrower than --lib-phone-col. */
  --lib-phone-w: 390px;
  --lib-phone-col: 300px;
  /* The library's own chrome by width; the block at the end gives the phone values. */
  --lib-top-position: sticky;
  --lib-nav-wrap: wrap;
  --lib-nav-overflow: visible;
  --lib-brand-wrap: nowrap;
  --lib-toc-cols: 4;
  --lib-facts-cols: 4;
  --lib-cols-n: 2;
  --lib-classes-cols: 3;
  --lib-shots-2: 2;
  --lib-shots-3: 3;
  --lib-type-cols: minmax(0, var(--lib-label-col)) minmax(0, 1fr);   /* a type row: the name, then the sample */
  /* Cell widths: the slot each component really gets on the 1184 column. */
  --lib-cell-card: calc((var(--column) - 3 * var(--card-gap)) / 4);
  --lib-cell-third: calc((var(--column) - 2 * var(--card-gap)) / 3);
  --lib-cell-topic: calc((var(--column) - 4 * var(--card-gap)) / 5);
  --lib-cell-person: calc((var(--column) - 4 * var(--card-gap)) / 5);
  --lib-cell-half: calc((var(--column) - var(--card-gap)) / 2);
  --lib-cell-rail: var(--read-rail-w);
  --lib-cell-guide-rail: var(--guide-rail);
  --lib-cell-chat: var(--chat-w);
  --lib-cell-chapter: calc(var(--column) - var(--guide-rail) - var(--guide-rail-gap));
}

body.lib { overflow-x: clip; }
/* The library's own text breaks a long name or address rather than run past
   a phone's edge; specimens keep the prototype's wrapping. */
:is(.lib-pagehead, .lib-entry__head, .lib-cols, .lib-shots, .lib-callout, .lib-block > p, .lib-block > ul, .lib-since-empty, .lib-spec__label) { overflow-wrap: break-word; }

/* ---- The top bar ---- */
.lib-top {
  position: var(--lib-top-position);
  top: 0;
  z-index: 50;
  background: var(--raised);
  border-bottom: var(--frame-rule) solid var(--border);
}
.lib-top__inner {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
  min-height: var(--lib-top-h);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--space-3);
}
.lib-top__home {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  padding: 0 var(--space-1);
  margin-inline-start: calc(-1 * var(--space-1));
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--text-3);
  white-space: nowrap;
}
.lib-top__home:hover { background: var(--accent-soft); color: var(--text); }
.lib-top__brand {
  display: flex;
  align-items: baseline;
  gap: var(--space-1);
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--tracking-display);
  white-space: var(--lib-brand-wrap);
}
.lib-top__brand small {
  font-family: var(--font-ui);
  font-weight: var(--weight-medium);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-kicker);
  text-transform: uppercase;
  color: var(--text-3);
}
.lib-nav {
  display: flex;
  flex-wrap: var(--lib-nav-wrap);
  overflow-x: var(--lib-nav-overflow);
  max-width: 100%;
  gap: 0 var(--space-half);
  margin-left: auto;
}
.lib-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  padding: 0 var(--space-1);
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--text-2);
  white-space: nowrap;
}
.lib-nav a:hover { background: var(--accent-soft); color: var(--text); }
.lib-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--text); font-weight: var(--weight-medium); }

/* ---- Page frame ---- */
.lib-main {
  max-width: var(--container);
  margin-inline: auto;
  padding: var(--space-6) 0 var(--space-12);
}
.lib-prose, .lib-pagehead, .lib-entry__head, .lib-cols, .lib-details, .lib-shots, .lib-block, .lib-toc, .lib-table-wrap, .lib-callout {
  padding-inline: var(--gutter);
}
.lib-pagehead { margin-bottom: var(--space-6); }
.lib-kicker {
  font-family: var(--font-ui);
  font-size: var(--kicker-size);
  font-weight: var(--kicker-weight);
  letter-spacing: var(--tracking-kicker);
  text-transform: uppercase;
  color: var(--text-3);
}
.lib-pagehead h1 { font-size: var(--text-2xl); margin-top: var(--space-1); }
.lib-pagehead p:not(.lib-kicker) { max-width: var(--lib-prose); margin-top: var(--space-2); color: var(--text-2); font-size: var(--text-md); line-height: var(--leading-snug); }
.lib-prose p, .lib-prose li { max-width: var(--lib-prose); }
.lib-prose p + p { margin-top: var(--space-2); }
.lib-prose h2, .lib-block > h2 { font-size: var(--text-xl); margin: var(--space-8) 0 var(--space-2); }
.lib-prose h3, .lib-block > h3 { font-size: var(--text-md); margin: var(--space-4) 0 var(--space-1); }
.lib-prose ul, .lib-cols ul, .lib-block ul.lib-list { list-style: disc; padding-left: var(--space-3); }
.lib-prose ul li + li, .lib-cols ul li + li, .lib-block ul.lib-list li + li { margin-top: var(--space-1); }
.lib-prose a, .lib-cols a, .lib-block a, .lib-entry__purpose a, .lib-callout a, .lib-table a, .lib-pagehead a { color: var(--accent-text); text-decoration: underline; text-underline-offset: var(--lib-underline-offset); }
.lib code, .lib-code {
  font-family: var(--lib-mono);
  font-size: var(--lib-code-size);
  background: var(--sunk);
  border-radius: var(--radius-sm);
  padding: 0 var(--space-half);
  overflow-wrap: anywhere;
}
.lib-callout {
  margin: var(--space-4) var(--gutter);
  padding: var(--space-3);
  border-left: var(--band-rule) solid var(--accent);
  background: var(--raised);
  border-radius: var(--radius-sm);
  max-width: var(--lib-prose);
}
.lib-callout p + p { margin-top: var(--space-1); }

/* ---- The page's index of entries ---- */
.lib-toc { margin-bottom: var(--space-6); }
.lib-toc ul {
  display: grid;
  grid-template-columns: repeat(var(--lib-toc-cols), minmax(0, 1fr));
  gap: var(--space-half) var(--space-3);
  border-top: var(--frame-rule) solid var(--border);
  padding-top: var(--space-2);
}
.lib-toc a { display: flex; align-items: center; min-height: var(--target); font-family: var(--font-ui); font-size: var(--text-sm); color: var(--text-2); }
.lib-toc a:hover { color: var(--link-hover); }

/* ---- An entry ---- */
.lib-entry {
  padding-top: var(--space-8);
  margin-top: var(--space-8);
  border-top: var(--frame-rule) solid var(--border-strong);
  scroll-margin-top: var(--lib-top-h);
}
.lib-entry:first-of-type { margin-top: 0; }
.lib-entry__title { font-size: var(--text-xl); }
.lib-entry__purpose { max-width: var(--lib-prose); margin-top: var(--space-2); font-size: var(--text-md); line-height: var(--leading-snug); color: var(--text-2); }
.lib-facts {
  display: grid;
  grid-template-columns: repeat(var(--lib-facts-cols), minmax(0, 1fr));
  gap: var(--space-3);
  margin: var(--space-3) 0 0;
  padding-top: var(--space-2);
  border-top: var(--frame-rule) solid var(--border);
}
.lib-facts dt { font-family: var(--font-ui); font-size: var(--kicker-size); font-weight: var(--kicker-weight); letter-spacing: var(--tracking-kicker); text-transform: uppercase; color: var(--text-3); }
.lib-facts dd { margin: var(--space-half) 0 0; font-size: var(--text-sm); color: var(--text-2); }
.lib-facts dd code { display: inline-block; margin: 0 var(--space-half) var(--space-half) 0; }
.lib-mode { display: inline-flex; gap: var(--space-half); flex-wrap: wrap; }
.lib-tag {
  display: inline-flex;
  align-items: center;
  padding: var(--space-half) var(--space-1);
  border-radius: var(--radius-sm);
  border: var(--frame-rule) solid var(--border);
  background: var(--raised);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-2);
}
.lib-tag--live { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.lib-tag--shot { background: var(--sunk); }
.lib-tag--confirm { border-color: var(--accent-text); color: var(--accent-text); }

/* ---- New in a version: the switch, the tag, the empty state ---- */
/* The newest version's tag is inverted ink, as on the prototype's "New in"
   tab and the sitemap's rows; an older version's is the plain tag. */
.lib-tag--newest { background: var(--lib-new-fill); border-color: var(--lib-new-fill); color: var(--lib-new-ink); }
.lib-since-line { max-width: var(--lib-prose); margin-top: var(--space-1); font-size: var(--text-sm); line-height: var(--leading-snug); color: var(--text-2); }
.lib-since-line .lib-tag { margin-right: var(--space-1); }
.lib-block > h2 + .lib-since-line { margin-top: calc(-1 * var(--space-1)); margin-bottom: var(--space-2); }
.lib-since {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  margin: 0 var(--gutter) var(--space-4);
}
.lib-since__label { font-family: var(--font-ui); font-size: var(--text-sm); color: var(--text-2); }
.lib-since__switch { display: inline-flex; border: var(--frame-rule) solid var(--border-strong); border-radius: var(--radius-button); overflow: hidden; }
.lib-since__switch button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--target);
  padding: 0 var(--space-2);
  border: 0;
  background: var(--raised);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--text-ui);
  cursor: pointer;
  transition: background var(--hover-duration, 150ms);
}
.lib-since__switch button + button { border-left: var(--frame-rule) solid var(--border-strong); }
.lib-since__switch button:hover { background: var(--sunk); }
.lib-since__switch button[aria-pressed="true"] { background: var(--lib-new-fill); color: var(--lib-new-ink); }
/* the page's own 2px ring (layout.css), drawn inside so the frame doesn't clip it */
.lib-since__switch button:focus-visible { outline-offset: calc(-1 * var(--space-half)); }
.lib-since__count { font-variant-numeric: tabular-nums; opacity: 0.8; }
.lib-since-empty { margin: 0 var(--gutter) var(--space-6); padding: var(--space-3); max-width: var(--lib-prose); border-radius: var(--radius-sm); background: var(--sunk); color: var(--text-2); }
.lib-since-empty strong { color: var(--text); }
.lib-since-empty a { color: var(--accent-text); text-decoration: underline; text-underline-offset: var(--lib-underline-offset); }
[data-lib-off] { display: none !important; }
[data-lib-new-only] { display: none; }
html[data-lib-show="new"] [data-lib-new-only] { display: block; }
/* A page with nothing new keeps its head and the empty state, nothing else. */
html[data-lib-show="new"] .lib-main[data-lib-count="0"] > :not(.lib-since):not(.lib-since-empty):not(.lib-pagehead) { display: none; }

/* ---- Specimens ---- */
.lib-spec { margin-top: var(--space-4); }
.lib-spec__label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-2);
  padding: 0 var(--gutter) var(--space-1);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}
.lib-spec__label span { font-weight: var(--weight-regular); color: var(--text-3); }
.lib-stage {
  position: relative;
  overflow: clip;
  background: var(--ground);
  outline: var(--frame-rule) solid var(--border);
  outline-offset: calc(-1 * var(--frame-rule));
  border-radius: var(--radius-card-lg);
  padding-block: var(--space-6);
  container-type: inline-size;
}
.lib-stage > .container > .column > :last-child,
.lib-stage > .container > .column > .lib-cells > .lib-cell > .lib-cell__body > :last-child { margin-block-end: 0; }
.lib-stage--bleed { padding-block: 0; margin-inline: calc(50% - 50vw); border-radius: 0; }
.lib-stage--bare { padding: var(--space-4) var(--gutter); }
.lib-bare { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.lib-w-read { max-width: var(--read-measure); }
.lib-cells { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-4) var(--card-gap); }
.lib-cell { margin: 0; min-width: 0; }
.lib-cell > figcaption {
  margin-bottom: var(--space-1);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-kicker);
  text-transform: uppercase;
  color: var(--text-3);
}
.lib-cell--card { width: var(--lib-cell-card); }
.lib-cell--third { width: var(--lib-cell-third); }
.lib-cell--topic { width: var(--lib-cell-topic); }
.lib-cell--person { width: var(--lib-cell-person); }
.lib-cell--half { width: var(--lib-cell-half); }
.lib-cell--rail { width: var(--lib-cell-rail); }
.lib-cell--guide-rail { width: var(--lib-cell-guide-rail); }
.lib-cell--chat { width: var(--lib-cell-chat); }
.lib-cell--auto { width: auto; }
.lib-cell--chapter { width: var(--lib-cell-chapter); }
.lib-cell--auto .lib-cell__body { display: flex; flex-direction: column; align-items: flex-start; }

/* ---- Captured states ---- */
.lib-shots { margin-top: var(--space-4); }
.lib-shots__label { font-family: var(--font-ui); font-size: var(--text-sm); font-weight: var(--weight-medium); margin-bottom: var(--space-1); }
.lib-shots__grid { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-3); }
.lib-shots__grid--2, .lib-shots__grid--3 { display: grid; align-items: start; }
.lib-shots__grid--2 { grid-template-columns: repeat(var(--lib-shots-2), minmax(0, 1fr)); }
.lib-shots__grid--3 { grid-template-columns: repeat(var(--lib-shots-3), minmax(0, 1fr)); }
/* The phone views: columns of at least --lib-phone-col, each image at most
   its own 390. */
.lib-shots__grid--phone { display: grid; align-items: start; grid-template-columns: repeat(auto-fill, minmax(min(var(--lib-phone-col), 100%), 1fr)); }
.lib-shots__grid--phone .lib-shot { min-width: 0; }
.lib-shots__grid--phone .lib-shot img { width: 100%; max-width: var(--lib-phone-w); }
.lib-shots__label .lib-tag { margin-left: var(--space-1); vertical-align: middle; }
.lib-shots__note { max-width: var(--lib-prose); margin-bottom: var(--space-2); font-size: var(--text-sm); line-height: var(--leading-snug); color: var(--text-2); }
.lib-shots__grid--2 .lib-shot, .lib-shots__grid--3 .lib-shot { min-width: 0; }
.lib-shot { margin: 0; flex: 0 1 auto; max-width: 100%; min-width: min(var(--lib-shot-min), 100%); }
.lib-shot img {
  display: block;
  max-width: 100%;
  height: auto;
  border: var(--frame-rule) solid var(--border);
  border-radius: var(--radius-card);
  background: var(--ground);
}
.lib-shot figcaption {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-half) var(--space-2);
  margin-top: var(--space-1);
  max-width: var(--lib-prose);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--text-2);
}
.lib-shot figcaption a { color: var(--accent-text); text-decoration: underline; text-underline-offset: var(--lib-underline-offset); }
.lib-shot__note { color: var(--text-3); }

/* ---- Notes in columns ---- */
.lib-cols {
  display: grid;
  grid-template-columns: repeat(var(--lib-cols-n), minmax(0, 1fr));
  gap: var(--space-3) var(--space-6);
  margin-top: var(--space-4);
}
.lib-cols h3, .lib-details summary, .lib-subhead {
  font-family: var(--font-ui);
  font-size: var(--kicker-size);
  font-weight: var(--kicker-weight);
  letter-spacing: var(--tracking-kicker);
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: var(--space-1);
}
.lib-cols p { font-size: var(--text-sm); }
.lib-cols li { font-size: var(--text-sm); line-height: var(--leading-body); color: var(--text-2); }
.lib-issues li { color: var(--text); }
.lib-fields { display: flex; flex-wrap: wrap; gap: var(--space-half); list-style: none; padding: 0; }
.lib-cols ul.lib-fields { list-style: none; padding: 0; }
.lib-cols ul.lib-fields li + li { margin-top: 0; }

/* ---- Details and tables ---- */
.lib-details { margin-top: var(--space-3); }
.lib-details summary { cursor: pointer; display: flex; align-items: center; min-height: var(--target); margin: 0; }
.lib-details summary:hover { color: var(--text); }
.lib-table-wrap { overflow-x: auto; }
.lib-block .lib-table-wrap, .lib-details .lib-table-wrap { padding-inline: 0; }
.lib-table td:first-child code { overflow-wrap: normal; white-space: nowrap; }
.lib-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.lib-table th, .lib-table td { text-align: left; vertical-align: top; padding: var(--space-1) var(--space-2) var(--space-1) 0; border-bottom: var(--frame-rule) solid var(--border); }
.lib-table th { font-family: var(--font-ui); font-size: var(--kicker-size); font-weight: var(--kicker-weight); letter-spacing: var(--tracking-kicker); text-transform: uppercase; color: var(--text-3); }
.lib-table td { color: var(--text-2); }
.lib-table td:first-child { color: var(--text); }
.lib-table .num, .lib-table code { font-variant-numeric: tabular-nums; }
.lib-dot {
  display: inline-block;
  width: var(--lib-swatch-mini);
  height: var(--lib-swatch-mini);
  border-radius: var(--radius-sm);
  border: var(--frame-rule) solid var(--border);
  vertical-align: middle;
  margin-right: var(--space-half);
}
.lib-classes { columns: var(--lib-classes-cols); column-gap: var(--space-4); font-size: var(--text-sm); }
.lib-classes li { break-inside: avoid; padding: var(--space-half) 0; }
.lib-classes li span { color: var(--text-3); }
.lib-filter { max-width: var(--lib-filter-w); margin-bottom: var(--space-2); }

/* ---- Foundations ---- */
.lib-block { margin-top: var(--space-6); }
.lib-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--lib-shot-min), 1fr)); gap: var(--space-2); }
.lib-swatches--small { grid-template-columns: repeat(auto-fill, minmax(calc(var(--lib-shot-min) * 0.6), 1fr)); }
.lib-swatch { border: var(--frame-rule) solid var(--border); border-radius: var(--radius-card); overflow: clip; background: var(--raised); }
.lib-swatch__chip { height: var(--lib-swatch); border-bottom: var(--frame-rule) solid var(--border); }
.lib-swatch__body { padding: var(--space-1) var(--space-2) var(--space-2); font-size: var(--text-sm); }
.lib-swatch__body code { background: transparent; padding: 0; }
.lib-swatch__value { display: block; color: var(--text-3); font-family: var(--lib-mono); font-size: var(--lib-code-size); overflow-wrap: anywhere; }
.lib-swatch__use { display: block; margin-top: var(--space-half); color: var(--text-2); }
.lib-type-row { display: grid; grid-template-columns: var(--lib-type-cols); gap: var(--space-3); align-items: baseline; padding: var(--space-2) 0; border-bottom: var(--frame-rule) solid var(--border); }
.lib-type-row__meta { font-size: var(--text-sm); color: var(--text-3); }
.lib-type-row__meta code { background: transparent; padding: 0; color: var(--text); }
.lib-space-row { display: grid; grid-template-columns: minmax(0, var(--lib-label-col)) minmax(0, 1fr); gap: var(--space-3); align-items: center; padding: var(--space-1) 0; }
.lib-space-bar { height: var(--lib-bar-h); background: var(--accent); border-radius: var(--radius-sm); }
.lib-boxes { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.lib-box { width: var(--lib-box); }
.lib-box__shape { height: var(--lib-box-h); background: var(--raised); border: var(--frame-rule) solid var(--border-strong); }
.lib-box p { margin-top: var(--space-1); font-size: var(--text-sm); color: var(--text-2); }
.lib-grid-demo { position: relative; display: grid; gap: var(--card-gap); height: var(--lib-demo-h); }
.lib-grid-demo > span { background: var(--accent-soft); border: var(--frame-rule) dashed var(--accent-text); border-radius: var(--radius-sm); display: grid; place-items: center; font-size: var(--text-xs); color: var(--text-2); }
.lib-glyphs { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--lib-glyph-min), 1fr)); gap: var(--space-2); }
.lib-glyph { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-1) var(--space-2); border: var(--frame-rule) solid var(--border); border-radius: var(--radius-card); background: var(--raised); font-size: var(--text-sm); color: var(--text-2); min-height: var(--target); }
.lib-glyph__mark { display: inline-grid; place-items: center; min-width: var(--target); min-height: var(--target); font-size: var(--text-md); color: var(--text); }
.lib-glyph__mark svg { width: var(--icon-size); height: var(--icon-size); }

/* ---- Footer ---- */
.lib-foot { border-top: var(--frame-rule) solid var(--border); }
.lib-foot p { max-width: var(--container); margin-inline: auto; padding: var(--space-3) var(--gutter); font-size: var(--text-sm); color: var(--text-3); }

/* ---- Small helpers ---- */
.lib-measure { max-width: var(--lib-prose); }
.lib-gap-top { margin-top: var(--space-2); }
.lib-table__group th { padding-top: var(--space-3); font-size: var(--text-sm); letter-spacing: 0; text-transform: none; }
.lib-table__group a { color: var(--text); font-family: var(--font-display); font-weight: var(--display-weight); }
.lib-details summary { gap: var(--space-1); }
.lib-details summary::before {
  content: "";
  width: var(--chevron-size);
  height: var(--chevron-size);
  border-right: var(--chevron-stroke) solid currentColor;
  border-bottom: var(--chevron-stroke) solid currentColor;
  transform: rotate(-45deg);
}
.lib-details[open] summary::before { transform: translateY(-25%) rotate(45deg); }

/* ---- At phone width (v1.1, 20 October) ----
   The library reads on a phone too: the top bar stops sticking and its nav
   scrolls in one row, grids go to one column, and a specimen cell takes the
   column's width. Opened at phone width, the live specimens draw in the
   prototype's phone layout, since they read the same tokens. */
@media (width < 640px) {
  .lib {
    --lib-top-position: static;
    --lib-nav-wrap: nowrap;
    --lib-nav-overflow: auto;
    --lib-brand-wrap: normal;
    --lib-toc-cols: 2;
    --lib-facts-cols: 1;
    --lib-cols-n: 1;
    --lib-classes-cols: 1;
    --lib-shots-2: 1;
    --lib-shots-3: 1;
    --lib-label-col: 112px;
    --lib-type-cols: minmax(0, 1fr);           /* the name over the sample */
    --lib-filter-w: 100%;
    --lib-cell-card: 100%;
    --lib-cell-third: 100%;
    --lib-cell-topic: 100%;
    --lib-cell-person: 100%;
    --lib-cell-half: 100%;
    --lib-cell-rail: 100%;
    --lib-cell-guide-rail: 100%;
    --lib-cell-chat: 100%;
    --lib-cell-chapter: 100%;
  }
}
