/* Spec PDUs, after BlueTools' tokens.css and base.css: what is this app's own.
   Codes: blue for the code in the enclosing format, amber for a format's own code (as an
   HCI opcode's OGF and OCF). Comparing versions: blue added, amber changed, red removed
   (always struck through as well). Marks on the version strip have their own steps. */
:root {
  --measure: 84rem; /* the reading column of every view but the split one */
  --index-w: clamp(17rem, 24vw, 24rem);
}

/* sections and formats jumped to land just under the finder, not under a table header */
html { scroll-padding-top: calc(var(--finder-h) + 1rem); }

[tabindex="-1"]:focus { outline: none; }
.muted { color: var(--muted); }

/* Layout. The title and the finder, then a start page, a protocol's page or the search's
   results; once a format is open on a wide screen, that list narrows to an index on the left
   and the format takes the room. Other views show a format over their right side, and
   narrow screens show it as a page of its own. Without a format beside it, a view is one
   column of --measure, centred, under the title and finder in the same column; the split
   and the table of all formats take the whole --page, and so do the title and finder. */

.page {
  --page: 112rem; /* wider than the suite bar's: the index beside a 32-bit diagram needs it */
  max-width: var(--page);
  margin-inline: auto;
  padding: clamp(2rem, 5vw, 4rem) var(--gutter) 3rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  row-gap: 1.25rem;
}
body.has-page .page { padding-top: 0.75rem; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem 2.5rem; min-width: 0; }
main, .detail { min-width: 0; }
.workspace:not(.is-split) > main, .page > .intro, .page > .finder { width: 100%; max-width: var(--measure); margin-inline: auto; }
/* the table of all formats has six columns: it keeps the whole page, or its summaries are cut short */
.workspace:not(.is-split) > main:has(> .view.all:not([hidden])) { max-width: none; }
.page:has(> .workspace.is-split, > .workspace > main > .view.all:not([hidden])) > :is(.intro, .finder) { max-width: none; }

@media (min-width: 64rem) {
  .workspace.is-split { grid-template-columns: var(--index-w) minmax(0, 1fr); }
  .workspace.is-split > main {
    position: sticky;
    top: var(--finder-h);
    align-self: start;
    max-height: calc(100dvh - var(--finder-h));
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding: 0.75rem 0.5rem 1.5rem 0;
  }
  .workspace.is-split > .detail { padding-top: 0.75rem; }
}

.detail.is-peek {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 8;
  width: min(62rem, 66vw);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1rem clamp(1.25rem, 2.5vw, 2.5rem) 3rem;
  background: var(--paper);
  box-shadow: -1px 0 0 var(--line), -1.5rem 0 3rem var(--shadow);
}
body.has-page :is(.intro, .finder), body.has-page .workspace > main { display: none !important; }

/* The title, as HCI Ref's: the page's name, then the versions and how many formats */

.intro h1 {
  margin: 0 0 0.875rem;
  font-size: clamp(2.125rem, 1.5rem + 2.4vw, 3rem);
  font-weight: 750;
  line-height: 1;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.intro-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.375rem 0.75rem; margin: 0; color: var(--muted); }

/* The finder (base.css makes it stick): the views, the search and the version. The views
   are links, each its own address, drawn as base.css's switch draws its radio buttons. */

.switch > a {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 1rem;
  border: 1.5px solid var(--edge);
  font-weight: 650;
  white-space: nowrap;
  text-decoration: none;
}
.switch > a + a { margin-left: -1.5px; }
.switch > a:first-child { border-radius: 6px 0 0 6px; }
.switch > a:last-child { border-radius: 0 6px 6px 0; }
.switch > a:hover { background: var(--raise); }
.switch > a[aria-current="page"] { position: relative; background: var(--ink); border-color: var(--ink); color: var(--paper); }
.switch > a:focus-visible { position: relative; z-index: 1; }

/* What the search finds, as it is typed */
.search-results {
  position: absolute; top: calc(100% + 0.375rem); left: 0; z-index: 9;
  width: max(100%, min(40rem, 90vw));
  max-height: min(32rem, 70dvh); overflow-y: auto;
  margin: 0; padding: 0.375rem; list-style: none;
  border: 1px solid var(--edge); border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 0.75rem 2rem var(--shadow);
}
.search-results li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 0.75rem; padding: 0.4375rem 0.625rem; border-radius: 5px; cursor: pointer; }
.search-results li[aria-selected="true"] { background: var(--blue-tint); box-shadow: inset 3px 0 0 var(--blue); }
.search-results .sr-name { font: 650 0.875rem var(--mono); overflow-wrap: anywhere; }
.search-results .sr-name.is-words { font: 650 0.9375rem var(--sans); }
.search-results .sr-code { font-size: 0.8125rem; text-align: right; }
.search-results .sr-meta { grid-column: 1 / -1; font-size: 0.8125rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results .sr-meta b { font-weight: 650; color: var(--ink); }
.search-results .sr-more { display: block; color: var(--ink); font-weight: 650; font-size: 0.875rem; }
.search-results .sr-empty { display: block; color: var(--muted); cursor: default; }

/* The changes' filter: a smaller search box */
.filter-box input {
  width: 100%;
  font: 400 1rem var(--sans);
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--edge);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  appearance: none;
}
.filter-box input::placeholder { color: var(--muted); }
.filter-box input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-tint); }

.version-pick { display: flex; align-items: center; gap: 0.375rem; font-weight: 650; color: var(--muted); }
.version-pick select {
  font: 650 0.9375rem var(--sans);
  color: var(--ink);
  background-color: var(--paper);
  border: 1.5px solid var(--edge);
  border-radius: 6px;
  padding: 0 0.375rem;
  min-height: 2.375rem;
}
/* the version, as tall as the views and the search */
.top-version select { min-height: 2.75rem; padding: 0 0.5rem; font-size: 1rem; cursor: pointer; }
.top-version select:hover { border-color: var(--ink); }

/* The bit order of a diagram: base.css's switch, a size down */
.switch.small label > span { gap: 0; min-height: 1.875rem; padding: 0 0.625rem; border-width: 1px; font-size: 0.8125rem; font-weight: 600; }
.switch.small label + label > span { margin-left: -1px; }

/* The start page: the protocols as the stack */

.home { padding-top: 0.75rem; }
.stack { display: grid; gap: 0.75rem; }
.band { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0.5rem 1rem; padding-top: 0.75rem; border-top: 1px solid var(--line); }
.band h2 { margin: 0.5rem 0 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.band-rows { display: grid; gap: 0.5rem; }
/* never five to a row (six tiles would leave one alone): a track is at least a fifth of the row */
.band-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(max(12.5rem, calc((100% - 2rem) / 5 + 1px)), 1fr)); gap: 0.5rem; }
.band-row.is-wide { grid-template-columns: minmax(0, 1fr); }
.band-label { grid-column: 1 / -1; margin: 0.25rem 0 0; font-size: 0.8125rem; font-weight: 700; color: var(--muted); }
.tile {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: start; gap: 0.125rem 0.5rem;
  padding: 0.625rem 0.75rem; border: 1px solid var(--edge); border-radius: 8px;
  text-decoration: none; background: var(--paper);
}
.tile:hover { background: var(--raise); border-color: var(--ink); }
.tile .t-name { font-weight: 750; }
.tile .t-n { color: var(--muted); font-variant-numeric: tabular-nums; }
.tile .t-note { grid-column: 1 / -1; font-size: 0.8125rem; color: var(--muted); line-height: 1.4; }
.tile.is-gone { border-style: dashed; }
.tile.is-gone .t-name { color: var(--muted); }
.home-more { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin: 2rem 0 0; font-weight: 600; }

/* A protocol's page and the search's results: one row per format */

.view-title { margin: 0.75rem 0 0.25rem; font-size: 1.5rem; font-weight: 750; letter-spacing: -0.015em; }
.view-sub { margin: 0; color: var(--muted); }
.jumps { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 0.75rem 0 0; font-size: 0.9375rem; font-weight: 600; }
.section { margin-top: 1.75rem; scroll-margin-top: calc(var(--finder-h) + 1rem); }
.section > h3 { margin: 0 0 0.25rem; padding-bottom: 0.25rem; border-bottom: 1.5px solid var(--ink); font-size: 1.0625rem; font-weight: 750; }
.family { margin-top: 0.75rem; }
.family-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; margin: 0.5rem 0 0.125rem; }
.family-head h4 { margin: 0; font-size: 0.9375rem; font-weight: 750; }
.family-head .n { font-size: 0.875rem; color: var(--muted); }
.family-head .link-button { margin-left: auto; font-size: 0.875rem; font-weight: 600; }
.family .code-grid, .family .code-list { margin: 0.5rem 0 1rem; }
.map-note { margin: 0.25rem 0 0; font-size: 0.875rem; color: var(--muted); }

.frows { margin: 0; padding: 0; list-style: none; }
.frow {
  display: grid; grid-template-columns: 5.5rem minmax(10rem, 20rem) minmax(0, 1fr); gap: 0 1rem; align-items: baseline;
  padding: 0.375rem 0.5rem; border-bottom: 1px solid var(--line);
}
.frows.no-codes .frow { grid-template-columns: minmax(10rem, 20rem) minmax(0, 1fr); }
.frows.no-codes .fr-code { display: none; }
.js .frow { cursor: pointer; }
.frow:hover { background: var(--raise); }
.frow.is-selected { background: var(--blue-tint); box-shadow: inset 3px 0 0 var(--blue); }
.fr-code { font-size: 0.875rem; white-space: nowrap; }
.fr-name a { font: 600 0.875rem var(--mono); text-decoration: none; overflow-wrap: anywhere; }
.fr-name a.is-words { font: 650 0.9375rem var(--sans); }
.fr-name a:hover { text-decoration: underline; }
.fr-summary { font-size: 0.9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-more { grid-column: 2 / -1; font-size: 0.8125rem; color: var(--muted); }
.frows.no-codes .fr-more { grid-column: 1 / -1; }
.fr-more b { font-weight: 650; color: var(--ink); }
.results .frow { grid-template-columns: minmax(10rem, 22rem) 5.5rem minmax(0, 1fr); }
.results .fr-name { grid-column: 1; grid-row: 1; }
.results .fr-code { grid-column: 2; grid-row: 1; }
.results .fr-more { grid-column: 1 / -1; }
.gone-formats { margin-top: 2rem; }
.gone-formats summary { width: fit-content; cursor: pointer; font-weight: 650; color: var(--muted); }

.bytes-hint { margin: 1rem 0 0; padding: 0.5rem 0.75rem; border: 1px solid var(--blue); border-radius: 6px; background: var(--blue-tint); font-size: 0.9375rem; }
.bytes-hint .link-button { font-weight: 650; }
.text-button, .empty button {
  font: 600 0.875rem var(--sans); color: var(--ink); background: transparent;
  border: 1px solid var(--edge); border-radius: 6px; padding: 0.375rem 0.75rem; cursor: pointer;
}
.text-button:hover, .empty button:hover { background: var(--raise); }
.link-button {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer;
  text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 0.18em;
}
.link-button:hover { text-decoration-color: currentColor; }
.empty { padding: 2.5rem 0; text-align: center; color: var(--muted); }
.empty p { margin: 0 0 1rem; }

/* Beside an open format, the list is an index: names and codes */
.is-split .view-sub, .is-split .jumps, .is-split .fr-summary, .is-split .fr-more, .is-split .bytes-hint, .is-split .family-head .link-button, .is-split .family .code-grid, .is-split .family .code-list, .is-split .family .map-note, .is-split .gone-formats { display: none; }
.is-split .view-title { margin-top: 0; font-size: 1.125rem; }
.is-split .view-title a { text-decoration: none; }
.is-split .section { margin-top: 1rem; }
.is-split .section > h3 { font-size: 0.875rem; }
.is-split .family-head h4 { font-size: 0.8125rem; }
.is-split .frow, .is-split .frows.no-codes .frow, .is-split .results .frow { grid-template-columns: minmax(0, 1fr) auto; padding: 0.25rem 0.375rem; }
.is-split .fr-name { grid-column: 1; grid-row: 1; }
.is-split .fr-code { grid-column: 2; grid-row: 1; text-align: right; }
.is-split .fr-name a { font-size: 0.8125rem; }
.is-split .fr-name a.is-words { font-size: 0.875rem; }

/* All formats: one table, a group per protocol */

.count { margin: 0 0 0.5rem; font-size: 0.875rem; color: var(--muted); }
.listing thead th.c-code { color: var(--amber); }
.listing tr.group-head th { padding: 1.25rem 0.625rem 0.375rem; text-align: left; border-bottom: 1px solid var(--line); font-size: 1rem; font-weight: 750; }
.group-head .n { font-weight: 400; color: var(--muted); font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.listing tbody th, .listing td { padding-block: 0.4375rem; } /* a step tighter than base.css's */

.c-name { width: 30%; }
.c-code { width: 6.5rem; white-space: nowrap; }
.c-size { width: 7.5rem; font-size: 0.875rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.c-since { width: 5.5rem; font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.c-spec { width: 6.5rem; white-space: nowrap; }
.c-spec a { font: 0.875rem var(--mono); }
.until { color: var(--red); }

.name { font: 600 0.875rem var(--mono); text-decoration: none; overflow-wrap: anywhere; }
.name.is-words { font: 650 0.9375rem var(--sans); }
.name:hover { text-decoration: underline; }
.place { display: block; margin-top: 0.0625rem; font-size: 0.8125rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place:empty { display: none; }
.code-own { font-weight: 650; color: var(--amber); }
.code-parent { font-weight: 650; color: var(--blue); }
.summary { display: block; margin-top: 0.25rem; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The small layout strip of a row: one cell per field, widths on a square-root scale */
.strip { display: flex; gap: 2px; height: 0.75rem; max-width: 26rem; }
.strip-cell { flex: var(--w) 1 0; min-width: 3px; border-radius: 2px; background: var(--raise); box-shadow: inset 0 0 0 1px var(--edge); }
.strip-cell.is-value { background: var(--amber); box-shadow: none; }
.strip-cell.is-rfu { background: repeating-linear-gradient(-45deg, var(--hatch) 0 2px, transparent 2px 4px); box-shadow: inset 0 0 0 1px var(--line); }
.strip-cell.is-optional { background: transparent; box-shadow: none; outline: 1px dashed var(--edge); outline-offset: -1px; }

.is-split .listing .c-layout, .is-split .listing .c-size, .is-split .listing .c-since, .is-split .listing .c-spec, .is-split .listing .place, .is-split .listing .tag, .is-split .count { display: none; }
.is-split .listing { table-layout: auto; }
.is-split .listing .c-name { width: auto; }
.is-split .listing .c-code { width: 5.5rem; text-align: right; }
.is-split .listing thead th { top: 0; }
.is-split .listing tbody th, .is-split .listing td { padding-block: 0.3125rem; }
.is-split .listing tr.group-head th { padding-top: 1rem; }
.is-split .listing .name { font-size: 0.8125rem; }
.is-split .listing .name.is-words { font-size: 0.875rem; }

/* Chips: the kind of change, base.css's a size down */
.filter { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem 0.75rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.chip-list { align-items: center; gap: 0.375rem 0.5rem; }
.chips label > span { padding: 0.1875rem 0.6875rem; font-size: 0.875rem; }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin: 1rem 0 0.75rem; }
.filter-box { flex: 0 1 18rem; }
.filter-box input { padding-right: 0.75rem; }

/* The format */

.detail-top, [data-detail-body] { max-width: 80rem; }
.detail-top { display: flex; align-items: center; gap: 0.75rem; min-height: 2rem; margin-bottom: 0.5rem; }
.crumbs { flex: 1; min-width: 0; font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 0 0.375rem; margin: 0; padding: 0; list-style: none; }
.crumbs li + li::before { content: "\203A"; margin-right: 0.375rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.back { display: none; align-items: center; gap: 0.25rem; padding: 0.375rem 0.625rem 0.375rem 0.375rem; border: 1px solid var(--edge); border-radius: 6px; background: transparent; font-weight: 650; cursor: pointer; }
.back svg { width: 1rem; height: 1rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.back:hover { background: var(--raise); }
.detail.is-page .back { display: inline-flex; }
.detail.is-page .close { display: none; } /* the back button, named for where it goes, closes it */

.breadcrumb { margin: 0; font-size: 0.875rem; color: var(--muted); }
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.125rem 0.375rem; margin: 0; padding: 0; list-style: none; }
.breadcrumb li + li::before { content: "\203A"; margin-right: 0.375rem; color: var(--muted); }
.breadcrumb a { color: var(--ink); }
.breadcrumb code { margin-left: 0.25rem; font-size: 0.8125rem; }
.detail-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.625rem; margin: 0.25rem 0 0.25rem; font-size: 1.5rem; line-height: 1.2; }
.detail-title .number { color: var(--muted); font-weight: 600; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.detail-title .title { font: 700 1.3125rem var(--mono); overflow-wrap: anywhere; }
.detail-title .title.is-words { font: 750 1.5rem var(--sans); letter-spacing: -0.01em; }
.detail-sub { display: flex; flex-wrap: wrap; gap: 0.125rem 0.375rem; margin: 0; color: var(--muted); font-size: 0.875rem; }
.detail-sub > span + span::before { content: "·"; margin-right: 0.375rem; }
.detail-note { margin: 0.5rem 0 0; padding: 0.375rem 0.625rem; border-left: 3px solid var(--amber); background: var(--amber-tint); font-size: 0.875rem; }
.detail-summary { max-width: 52rem; margin: 0.625rem 0 0; font-size: 1.0625rem; text-wrap: pretty; }
.detail-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1rem; margin: 0.5rem 0 0; font-size: 0.875rem; }
.detail-links .where { color: var(--muted); }
.detail-links a, .detail-links .link-button { font-weight: 600; }
.detail h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.5rem; margin: 2rem 0 0.625rem; font-size: 1.0625rem; font-weight: 750; }
.detail h3 .n { font-weight: 400; color: var(--muted); font-size: 0.9375rem; }
.detail h3 .h-tools { margin-left: auto; font-size: 0.8125rem; }
.panel-note { margin: 0.375rem 0 0; font-size: 0.875rem; color: var(--muted); text-wrap: pretty; }
.panel-note.is-issue { color: var(--red); }

/* The versions of a format: one button per version, a mark where it changed */
.versions { margin: 1.25rem 0 1rem; }
.v-track { display: grid; grid-template-columns: repeat(var(--n, 13), minmax(0, 1fr)); max-width: 48rem; }
.v {
  position: relative; display: grid; justify-items: center; gap: 0.1875rem;
  min-width: 0; padding: 0.3125rem 0 0.25rem; border: 0; border-radius: 4px; background: none;
  font: 600 0.8125rem var(--sans); color: var(--muted); font-variant-numeric: tabular-nums; cursor: pointer;
}
.v::before { content: ""; position: absolute; top: calc(0.3125rem + 0.375rem - 1px); left: 0; right: 0; height: 2px; }
.v.is-in::before { background: var(--edge); }
.v.is-first::before { left: 50%; }
.v.is-last::before { right: 50%; }
.v.is-first.is-last::before { display: none; }
.v-mark { position: relative; z-index: 1; display: block; width: 0.75rem; height: 0.75rem; }
.v.is-in .v-mark::after { content: ""; position: absolute; inset: 0.25rem; border-radius: 50%; background: var(--edge); }
.v .v-mark.m-new::after { inset: 0; border-radius: 1px; background: var(--blue-mark); box-shadow: 0 0 0 2px var(--paper); }
.v .v-mark.m-changed::after { inset: 0; border-radius: 50%; background: var(--amber-mark); box-shadow: 0 0 0 2px var(--paper); }
.v .v-mark.m-gone::after { content: "\00d7"; inset: auto; top: -0.4rem; left: 0; width: 0.75rem; text-align: center; background: none; color: var(--ink); font-size: 1.125rem; line-height: 1; }
.v:hover:not(:disabled) { background: var(--raise); color: var(--ink); }
.v:disabled { cursor: default; opacity: 0.55; }
.v.is-shown { background: var(--raise); color: var(--ink); font-weight: 800; box-shadow: inset 0 -2px 0 var(--ink); }
.v.is-compare { color: var(--ink); font-weight: 800; box-shadow: inset 0 -2px 0 var(--blue); }
.v-legend { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 0.375rem 0 0; font-size: 0.8125rem; color: var(--muted); }
.v-legend .lg::before { content: ""; display: inline-block; width: 0.625rem; height: 0.625rem; margin-right: 0.3125rem; vertical-align: -0.05em; }
.v-legend .lg-new::before { border-radius: 1px; background: var(--blue-mark); }
.v-legend .lg-changed::before { border-radius: 50%; background: var(--amber-mark); }
.v-legend .lg-gone::before { content: "\00d7"; width: auto; height: auto; color: var(--ink); }
.compare-pick { display: inline-flex; align-items: center; gap: 0.375rem; color: var(--ink); font-weight: 600; }
.compare-pick select {
  font: 600 0.8125rem var(--sans); color: var(--ink); background-color: var(--paper);
  border: 1px solid var(--edge); border-radius: 6px; min-height: 1.75rem; padding: 0 0.25rem;
}

.diagram-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin: 1rem 0 0.75rem; }

/* The diagram: rows of 32 bits (16 where fields are smaller than an octet), each field as
   wide as its bits. The ruler above names the octets; a bit ruler under a row numbers its
   bits. A label that doesn't fit across its cell runs down it. */

.diagram { --cols: 32; font-size: 0.8125rem; }
.diagram-head, .diagram-row { display: grid; grid-template-columns: 3rem repeat(var(--cols), minmax(0, 1fr)); }
.diagram-head { margin-bottom: 0.125rem; color: var(--muted); font: 600 0.75rem var(--sans); font-variant-numeric: tabular-nums; }
.diagram-head span { grid-column: span 8; padding-left: 0.25rem; border-left: 1px solid var(--line); }
.diagram-head .gutter, .diagram-row .gutter { grid-column: 1; padding-right: 0.5rem; text-align: right; border: 0; color: var(--muted); font: 600 0.75rem var(--sans); font-variant-numeric: tabular-nums; align-self: center; }
.diagram-row { min-height: 3.25rem; }
.diagram-row + .diagram-row { margin-top: -1px; }
.cell {
  position: relative;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 0.0625rem;
  min-width: 0;
  padding: 0.25rem 0.125rem;
  border: 1px solid var(--edge);
  margin-left: -1px;
  background: var(--paper);
  text-align: center;
  line-height: 1.2;
}
[data-scope] .cell[data-hot] { cursor: pointer; }
.cell .f-name { max-width: 100%; font: 650 0.8125rem var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell .f-size { color: var(--muted); font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cell .f-value { font: 700 0.75rem var(--mono); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell .f-unit { font-size: 0.6875rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cell.is-narrow .f-name { font-size: 0.6875rem; }
.cell.is-narrow .f-size { display: none; }
.cell.is-vertical { padding-block: 0.375rem; }
.cell.is-vertical .f-name { writing-mode: vertical-rl; rotate: 180deg; max-height: 10rem; }
.cell.is-vertical .f-size { display: none; }
.cell.is-value { background: var(--amber); border-color: var(--amber); color: var(--on-amber); }
.cell.is-value .f-size, .cell.is-value .f-unit { color: inherit; opacity: 0.8; }
.cell.is-rfu { background: repeating-linear-gradient(-45deg, var(--hatch) 0 2px, transparent 2px 6px); color: var(--muted); }
.cell.is-optional { border-style: dashed; }
.cell.is-open { border-right-style: dashed; background: linear-gradient(to right, var(--paper) 70%, var(--raise)); }
.cell.cont-left { border-left-style: dotted; }
.cell.cont-right { border-right-style: dotted; }
.cell.is-link .f-name { text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 50%, transparent); text-underline-offset: 0.18em; }
.cell.is-hot, .cell.is-pinned { background: var(--blue-tint); outline: 2px solid var(--blue); outline-offset: -2px; z-index: 1; color: var(--ink); }
.cell.ch-added { background: var(--blue-tint); border-color: var(--blue); }
.cell.ch-changed { background: var(--amber-tint); border-color: var(--amber); color: var(--ink); }
.cell.ch-removed { background: var(--red-tint); border-color: var(--red); }
.cell.ch-removed .f-name { text-decoration: line-through; }
.cell.is-decoded .f-value { font-weight: 600; }
.cell.is-bad { background: var(--red-tint); border-color: var(--red); color: var(--red); }
.fold { grid-column: 2 / -1; display: flex; align-items: center; justify-content: center; min-height: 1.5rem; margin-top: -1px; border: 1px dashed var(--edge); color: var(--muted); font-size: 0.75rem; }
.bit-ruler { display: grid; grid-template-columns: 3rem repeat(var(--cols), minmax(0, 1fr)); margin-top: 0.125rem; color: var(--muted); font: 0.6875rem var(--mono); text-align: center; }
.bit-ruler span:first-child { grid-column: 1; }
.diagram-caption { margin: 0.375rem 0 0 3rem; font-size: 0.8125rem; color: var(--muted); }
.diagram + .diagram { margin-top: 0.75rem; }
.diagram-label { margin: 0.75rem 0 0.25rem 3rem; font-size: 0.8125rem; font-weight: 700; }
.diagram-key { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 0.5rem 0 0 3rem; font-size: 0.8125rem; color: var(--muted); }
.diagram-key span::before { content: ""; display: inline-block; width: 0.75rem; height: 0.75rem; margin-right: 0.3125rem; vertical-align: -0.1em; border: 1px solid var(--edge); }
.diagram-key .k-added::before { background: var(--blue-tint); border-color: var(--blue); }
.diagram-key .k-changed::before { background: var(--amber-tint); border-color: var(--amber); }
.diagram-key .k-removed::before { background: var(--red-tint); border-color: var(--red); }

/* The fields of the shown version */
.fields { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.fields th, .fields td { padding: 0.4375rem 0.625rem 0.4375rem 0; text-align: left; vertical-align: baseline; border-bottom: 1px solid var(--line); }
.fields thead th { font-size: 0.75rem; font-weight: 700; color: var(--muted); border-bottom: 1.5px solid var(--ink); white-space: nowrap; }
.fields .fl-name { width: 28%; }
.field-name {
  padding: 0; border: 0; background: none; cursor: pointer; text-align: left;
  font: 650 0.8125rem var(--mono); color: var(--ink); overflow-wrap: anywhere;
}
.field-name:hover, .field-name[aria-pressed="true"] { text-decoration: underline; text-underline-offset: 0.18em; }
.fields .fl-size, .fields .fl-at { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.fields .fl-note { color: var(--ink); text-wrap: pretty; }
.fields tr.is-hot td, .fields tr.is-hot th { background: var(--blue-tint); }
.fields .value { font: 700 0.8125rem var(--mono); color: var(--amber); }
.fields .tag { margin: 0 0.25rem 0.125rem 0; }
.fields .tag.is-unit { border-color: var(--edge); color: var(--ink); }
.fields .note { display: block; }
.spec-quotes { margin-top: 0.25rem; font-size: 0.8125rem; }
.spec-quotes summary, .values summary { width: fit-content; cursor: pointer; color: var(--muted); font-weight: 600; }
.spec-quote { display: block; margin-top: 0.25rem; padding-left: 0.625rem; border-left: 2px solid var(--line); color: var(--muted); font-size: 0.8125rem; text-wrap: pretty; }
.values { margin-top: 0.25rem; font-size: 0.8125rem; }
.values table { border-collapse: collapse; margin-top: 0.25rem; }
.values th, .values td { padding: 0.125rem 0.75rem 0.125rem 0; border: 0; vertical-align: baseline; text-align: left; }
.values th code { font-weight: 650; white-space: nowrap; }

.tag.is-issue { margin-top: 0.25rem; border-color: var(--red); color: var(--red); }

/* What a format contains */
.contains { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.contains th, .contains td { padding: 0.3125rem 0.75rem 0.3125rem 0; text-align: left; vertical-align: baseline; border-bottom: 1px solid var(--line); }
.contains thead th { font-size: 0.75rem; font-weight: 700; color: var(--muted); border-bottom: 1.5px solid var(--ink); }
.contains .ct-code { width: 6rem; }
.contains .ct-since { width: 4rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.contains .ct-name a { font: 600 0.8125rem var(--mono); }
.contains .ct-name a.is-words { font: 650 0.875rem var(--sans); }
.contains .ct-summary { color: var(--muted); }

.spec-intro { max-width: 52rem; margin: 0; font-size: 0.875rem; }
.spec-intro summary { width: fit-content; cursor: pointer; font-weight: 650; }
.spec-intro blockquote { margin: 0.5rem 0 0; padding-left: 0.75rem; border-left: 3px solid var(--line); color: var(--muted); }
.spec-intro blockquote p { margin: 0 0 0.375rem; text-wrap: pretty; }
.fixes { margin: 0.25rem 0 0.75rem; font-size: 0.875rem; color: var(--muted); }
.fixes summary { cursor: pointer; }
.fixes ul { margin: 0.375rem 0 0; padding-left: 1.25rem; }

/* Examples, and decoded bytes */
.example { margin: 0.75rem 0 1.5rem; }
.example-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; margin: 0 0 0.375rem; }
.example-head .n { color: var(--muted); font-size: 0.875rem; }
.example-head .h-tools { display: flex; gap: 0.5rem; margin-left: auto; }
.example .diagram { margin-top: 0.625rem; }
.example-given { margin-top: 0.5rem; font-size: 0.875rem; }
.example-given summary { cursor: pointer; color: var(--muted); }
.examples-through .link-button { font-weight: 600; color: var(--ink); }

.bytes { display: flex; flex-wrap: wrap; gap: 0.25rem 0.3125rem; margin: 0.25rem 0 0.5rem; font: 0.9375rem var(--mono); font-variant-numeric: tabular-nums; }
.byte { padding: 0 0.125rem; border-radius: 3px; border-bottom: 2px solid var(--line); cursor: default; }
.byte:nth-child(8n):not(:last-child) { margin-right: 0.5rem; }
.byte.is-hot { background: var(--blue-tint); border-bottom-color: var(--blue); color: var(--ink); }
.byte.is-left { color: var(--red); border-bottom-color: var(--red); }

.nested { margin-left: 1rem; padding-left: 0.75rem; border-left: 2px solid var(--line); }
.layer-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.5rem; margin: 1.5rem 0 0.375rem; font-size: 1rem; }
.layer-head a { font-family: var(--mono); font-weight: 700; }
.layer-head .n { font-weight: 400; color: var(--muted); font-size: 0.875rem; }
h4.layer-head { font-size: 0.9375rem; }
.decoded { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0 1rem; margin: 0.5rem 0 0; font-size: 0.8125rem; }
.decoded div { display: contents; }
.decoded dt, .decoded dd { margin: 0; padding: 0.1875rem 0; border-bottom: 1px solid var(--line); }
.decoded dd { overflow-wrap: anywhere; }
.decoded .is-hot dt, .decoded .is-hot dd { background: var(--blue-tint); }
.decoded .is-bad dd, .decoded .is-bad dt { color: var(--red); }
.decoded .means { color: var(--muted); }
.decoded .means::before { content: "→"; margin: 0 0.25rem 0 0.375rem; }
.decoded .unit { margin-left: 0.5rem; font-weight: 650; }
.decoded .warn { display: block; color: var(--red); font-size: 0.75rem; }

/* Changes, in a format and in the Changes view */
.change-list { margin: 0; padding: 0; list-style: none; font-size: 0.875rem; }
.change-list li { display: grid; grid-template-columns: 4.75rem minmax(0, 1fr); gap: 0 0.5rem; padding: 0.3125rem 0; border-bottom: 1px solid var(--line); }
.change-list.no-version li { grid-template-columns: minmax(0, 1fr); }
.change-list .ver { font-weight: 700; font-variant-numeric: tabular-nums; }
.change-list .ver .link-button { font-weight: 700; }
.kind { display: inline-flex; align-items: center; gap: 0.3rem; margin-right: 0.375rem; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.kind::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--amber-mark); }
.kind.k-added::before, .kind.k-field-added::before, .kind.k-rfu-taken::before { border-radius: 1px; background: var(--blue-mark); }
.kind.k-removed::before, .kind.k-field-removed::before { content: "\00d7"; width: auto; height: auto; background: none; color: var(--red); font-size: 1rem; line-height: 0.5; }
.change-list code { font-size: 0.8125rem; font-weight: 600; }

.changes .rail { display: grid; grid-template-columns: repeat(var(--steps, 12), minmax(0, 1fr)); gap: 0 2px; margin: 0 0 0.375rem; }
.rail-step { display: grid; gap: 0.25rem; padding: 0.25rem 0.125rem 0; border: 0; border-radius: 4px 4px 0 0; background: transparent; color: var(--muted); font: 600 0.75rem var(--sans); cursor: pointer; text-align: center; font-variant-numeric: tabular-nums; }
.rail-step:hover { background: var(--raise); color: var(--ink); }
.rail-step.is-in { background: var(--raise); color: var(--ink); }
.rail-bars { display: flex; align-items: end; justify-content: center; gap: 2px; height: 2.5rem; }
.rail-bars span { width: min(0.75rem, 30%); border-radius: 3px 3px 0 0; }
.rail-bars .b-changed { background: var(--amber-mark); }
.rail-bars .b-new { background: var(--blue-mark); }
.rail-label { padding: 0.25rem 0; border-top: 1.5px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-step.is-in .rail-label { border-top-color: var(--ink); }
.rail-legend { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0; font-size: 0.8125rem; color: var(--muted); }
.rail-legend .shift-hint::before { display: none; }
.rail-legend span::before { content: ""; display: inline-block; width: 0.625rem; height: 0.625rem; margin-right: 0.3125rem; border-radius: 2px; vertical-align: -0.05em; }
.rail-legend .lg-new::before { background: var(--blue-mark); }
.rail-legend .lg-changed::before { background: var(--amber-mark); }
.changes .step { margin-top: 1.75rem; }
.changes .step h3 { margin: 0 0 0.25rem; font-size: 1.0625rem; }
.changes .step-row { display: grid; grid-template-columns: minmax(12rem, 1fr) minmax(0, 2fr); gap: 0.25rem 1.5rem; padding: 0.625rem 0; border-bottom: 1px solid var(--line); font-size: 0.875rem; }
.changes .step-row .name { font-size: 0.8125rem; }
.changes .step-row .place { white-space: normal; }
.changes .step-row.is-selected { background: var(--blue-tint); box-shadow: -0.5rem 0 0 var(--blue-tint), inset 3px 0 0 var(--blue); }
.layouts { margin-top: 0.375rem; }
.layouts summary { width: fit-content; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 0.8125rem; }
.layouts .diagram { font-size: 0.75rem; }
.view-intro { max-width: 52rem; margin: 0 0 1rem; color: var(--muted); }

/* All the values of a code, in a protocol's page: a grid of 16 or 8 to a row, or a list */
.code-legend { display: inline-flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin-left: 0.5rem; font-size: 0.8125rem; color: var(--muted); }
.code-legend span::before { content: ""; display: inline-block; width: 0.75rem; height: 0.75rem; margin-right: 0.375rem; vertical-align: -0.1em; border-radius: 2px; }
.code-legend .l-used::before { border: 1px solid var(--edge); background: var(--raise); }
.code-legend .l-new::before { border: 1px solid var(--blue); background: var(--blue-tint); }
.code-legend .l-gone::before { border: 1px solid var(--line); background: linear-gradient(to top right, transparent 45%, var(--muted) 45% 55%, transparent 55%); }
.code-legend .l-free::before { border: 1px dashed var(--line); }
.code-grid { display: grid; grid-template-columns: 3rem repeat(var(--cols, 16), minmax(0, 1fr)); gap: 3px; max-width: 90rem; font-size: 0.75rem; }
.code-grid .axis { display: grid; place-items: center; color: var(--muted); font: 600 0.6875rem var(--mono); }
.code-cell {
  display: flex; flex-direction: column; justify-content: start; align-items: center; gap: 0.0625rem;
  min-height: 3.5rem; padding: 0.25rem 0.1875rem;
  border: 1px dashed var(--line); border-radius: 3px;
  color: var(--muted); font: 0.6875rem var(--mono); text-align: center;
  text-decoration: none; overflow: hidden;
}
.code-cell .cc-code { font-weight: 700; }
.code-cell .cc-name { max-width: 100%; font-size: 0.625rem; line-height: 1.25; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
a.code-cell { border: 1px solid var(--edge); background: var(--raise); color: var(--ink); font-weight: 600; }
a.code-cell:hover { outline: 2px solid var(--blue); outline-offset: -1px; }
a.code-cell.is-new { background: var(--blue-tint); border-color: var(--blue); }
a.code-cell.is-selected { outline: 2px solid var(--ink); outline-offset: -1px; }
.code-cell.is-gone { border-style: solid; border-color: var(--line); }
.code-cell.is-gone .cc-name { text-decoration: line-through; }
.code-list { width: 100%; max-width: 48rem; border-collapse: collapse; font-size: 0.875rem; }
.code-list th, .code-list td { padding: 0.3125rem 0.75rem 0.3125rem 0; text-align: left; vertical-align: baseline; border-bottom: 1px solid var(--line); }
.code-list th { width: 7rem; font: 650 0.8125rem var(--mono); white-space: nowrap; }
.code-list td a { font: 600 0.8125rem var(--mono); }
.code-list .cl-since { width: 4.5rem; color: var(--muted); }
.code-list tr.is-free td, .code-list tr.is-free th { color: var(--muted); font-weight: 400; }
.code-list tr.is-gone td { color: var(--muted); }
.code-list tr.is-gone .cl-name { text-decoration: line-through; }
.code-list tr.is-new th { color: var(--blue); }

/* Decoding */
.decode-form { display: grid; gap: 0.75rem; margin: 0 0 1rem; }
.decode-input { display: grid; gap: 0.25rem; }
.decode-input .label { font-size: 0.875rem; font-weight: 700; color: var(--muted); }
.decode-input textarea {
  width: 100%; min-height: 5.5rem; resize: vertical;
  font: 400 1rem/1.5 var(--mono); color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--edge); border-radius: 6px; padding: 0.625rem 0.75rem;
}
.decode-input textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-tint); }
.decode-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.decode-controls select { font-size: 0.9375rem; min-height: 2.25rem; }
.decode-summary { margin: 0 0 0.25rem; font-weight: 650; }
.decode-why { margin: 0 0 0.75rem; font-size: 0.875rem; color: var(--muted); }
.decode-try { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.375rem 0.75rem; font-size: 0.875rem; color: var(--muted); }
.decode-try .link-button { color: var(--ink); font-weight: 600; }

/* Phones: the views and the version, then the search; the stack in one column, each row a
   small block */
@media (max-width: 47.99rem) {
  .switch > a { padding: 0 0.75rem; font-size: 0.9375rem; }
  .top-version { margin-left: auto; }
  .finder .search { order: 1; max-width: none; }
  .search kbd { display: none; }
  .search-results { width: 100%; }
  .band { grid-template-columns: minmax(0, 1fr); }
  .band-row { grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); }
  .band h2 { margin-top: 0; }
  .frow, .frows.no-codes .frow, .results .frow { grid-template-columns: minmax(0, 1fr) auto; gap: 0.125rem 0.75rem; padding-inline: 0; }
  .fr-name, .results .fr-name { grid-column: 1; grid-row: 1; }
  .fr-code, .results .fr-code { grid-column: 2; grid-row: 1; text-align: right; }
  .fr-summary { grid-column: 1 / -1; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; color: var(--muted); }
  .fr-more, .frows.no-codes .fr-more { grid-column: 1 / -1; }
  .frows.no-codes .fr-code { display: none; }
  .tools .filter-box { flex-basis: 100%; }
  .listing tr.group-head { display: block; }
  .listing tr.group-head th { display: block; padding: 1.25rem 0 0.375rem; }
  .listing tbody tr[data-id] {
    grid-template-areas: "name spec" "code since" "layout layout";
    gap: 0.125rem 1rem;
    padding: 0.75rem 0;
  }
  .listing tbody tr[data-id] > * { padding: 0; } /* over the padding above, as base.css's */
  .c-name { grid-area: name; }
  .c-code { grid-area: code; }
  .c-layout { grid-area: layout; }
  .c-size { display: none; }
  .c-since { grid-area: since; text-align: right; }
  .c-since::before { content: "since "; color: var(--muted); }
  .c-spec { grid-area: spec; text-align: right; }
  .c-layout .strip { margin-top: 0.25rem; }
  .summary { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
  .diagram-head, .diagram-row, .bit-ruler { grid-template-columns: 2rem repeat(var(--cols), minmax(0, 1fr)); }
  .diagram-caption, .diagram-label, .diagram-key { margin-left: 2rem; }
  .cell .f-size { display: none; }
  .fields .fl-at, .fields thead th:nth-child(3) { display: none; }
  .fields .fl-name { width: 34%; }
  .changes .step-row { grid-template-columns: minmax(0, 1fr); }
  .detail-title { font-size: 1.25rem; }
  .detail-title .title { font-size: 1.125rem; }
  .detail-title .title.is-words { font-size: 1.3125rem; }
}

@media (pointer: coarse) {
  .chips label > span { padding-block: 0.5rem; } /* base.css's, over the size above */
  .v { padding-block: 0.5rem; }
  .compare-pick select { min-height: 2.25rem; }
  .shift-hint { display: none; }
}

@media (forced-colors: active) {
  .switch > a[aria-current="page"] { forced-color-adjust: none; background: Highlight; border-color: Highlight; color: HighlightText; }
  .cell.is-value, .strip-cell.is-value { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .cell.is-hot, .cell.is-pinned, .byte.is-hot { outline: 2px solid Highlight; }
}
